@beechcms/api 0.4.0-preview.6 → 0.4.0-preview.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ function oZ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
5
5
  `);for(C=v=0;v<J.length&&!J[v].includes("DetermineComponentFrameRoot");)v++;for(;C<ve.length&&!ve[C].includes("DetermineComponentFrameRoot");)C++;if(v===J.length||C===ve.length)for(v=J.length-1,C=ve.length-1;1<=v&&0<=C&&J[v]!==ve[C];)C--;for(;1<=v&&0<=C;v--,C--)if(J[v]!==ve[C]){if(v!==1||C!==1)do if(v--,C--,0>C||J[v]!==ve[C]){var Ee=`
6
6
  `+J[v].replace(" at new "," at ");return c.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",c.displayName)),Ee}while(1<=v&&0<=C);break}}}finally{Jt=!1,Error.prepareStackTrace=m}return(m=c?c.displayName||c.name:"")?Ne(m):""}function Ut(c,d){switch(c.tag){case 26:case 27:case 5:return Ne(c.type);case 16:return Ne("Lazy");case 13:return c.child!==d&&d!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return ut(c.type,!1);case 11:return ut(c.type.render,!1);case 1:return ut(c.type,!0);case 31:return Ne("Activity");default:return""}}function nn(c){try{var d="",m=null;do d+=Ut(c,m),m=c,c=c.return;while(c);return d}catch(v){return`
7
7
  Error generating stack: `+v.message+`
8
- `+v.stack}}var kn=Object.prototype.hasOwnProperty,Xn=e.unstable_scheduleCallback,sr=e.unstable_cancelCallback,Nn=e.unstable_shouldYield,Pn=e.unstable_requestPaint,Kt=e.unstable_now,bn=e.unstable_getCurrentPriorityLevel,Nt=e.unstable_ImmediatePriority,$n=e.unstable_UserBlockingPriority,Bn=e.unstable_NormalPriority,En=e.unstable_LowPriority,Fn=e.unstable_IdlePriority,Ts=e.log,Kr=e.unstable_setDisableYieldValue,Ar=null,Qn=null;function _n(c){if(typeof Ts=="function"&&Kr(c),Qn&&typeof Qn.setStrictMode=="function")try{Qn.setStrictMode(Ar,c)}catch{}}var _t=Math.clz32?Math.clz32:ht,_s=Math.log,Or=Math.LN2;function ht(c){return c>>>=0,c===0?32:31-(_s(c)/Or|0)|0}var ke=256,Me=262144,Le=4194304;function rt(c){var d=c&42;if(d!==0)return d;switch(c&-c){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function U(c,d,m){var v=c.pendingLanes;if(v===0)return 0;var C=0,E=c.suspendedLanes,D=c.pingedLanes;c=c.warmLanes;var $=v&134217727;return $!==0?(v=$&~E,v!==0?C=rt(v):(D&=$,D!==0?C=rt(D):m||(m=$&~c,m!==0&&(C=rt(m))))):($=v&~E,$!==0?C=rt($):D!==0?C=rt(D):m||(m=v&~c,m!==0&&(C=rt(m)))),C===0?0:d!==0&&d!==C&&(d&E)===0&&(E=C&-C,m=d&-d,E>=m||E===32&&(m&4194048)!==0)?d:C}function Q(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function ge(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32: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 d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function je(){var c=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),c}function Rt(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function lt(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Ke(c,d,m,v,C,E){var D=c.pendingLanes;c.pendingLanes=m,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=m,c.entangledLanes&=m,c.errorRecoveryDisabledLanes&=m,c.shellSuspendCounter=0;var $=c.entanglements,J=c.expirationTimes,ve=c.hiddenUpdates;for(m=D&~m;0<m;){var Ee=31-_t(m),_e=1<<Ee;$[Ee]=0,J[Ee]=-1;var ye=ve[Ee];if(ye!==null)for(ve[Ee]=null,Ee=0;Ee<ye.length;Ee++){var Se=ye[Ee];Se!==null&&(Se.lane&=-536870913)}m&=~_e}v!==0&&Xe(c,v,0),E!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=E&~(D&~d))}function Xe(c,d,m){c.pendingLanes|=d,c.suspendedLanes&=~d;var v=31-_t(d);c.entangledLanes|=d,c.entanglements[v]=c.entanglements[v]|1073741824|m&261930}function dt(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var v=31-_t(m),C=1<<v;C&d|c[v]&d&&(c[v]|=d),m&=~C}}function G(c,d){var m=d&-d;return m=(m&42)!==0?1:se(m),(m&(c.suspendedLanes|d))!==0?0:m}function se(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function me(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function ze(){var c=te.p;return c!==0?c:(c=window.event,c===void 0?32:K9(c.type))}function qe(c,d){var m=te.p;try{return te.p=c,d()}finally{te.p=m}}var ct=Math.random().toString(36).slice(2),Qe="__reactFiber$"+ct,et="__reactProps$"+ct,pt="__reactContainer$"+ct,it="__reactEvents$"+ct,Ct="__reactListeners$"+ct,mt="__reactHandles$"+ct,vn="__reactResources$"+ct,en="__reactMarker$"+ct;function Hn(c){delete c[Qe],delete c[et],delete c[it],delete c[Ct],delete c[mt]}function yn(c){var d=c[Qe];if(d)return d;for(var m=c.parentNode;m;){if(d=m[pt]||m[Qe]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=O9(c);c!==null;){if(m=c[Qe])return m;c=O9(c)}return d}c=m,m=c.parentNode}return null}function hr(c){if(c=c[Qe]||c[pt]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function an(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Dr(c){var d=c[vn];return d||(d=c[vn]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Jn(c){c[en]=!0}var ca=new Set,$s={};function Yr(c,d){Pe(c,d),Pe(c+"Capture",d)}function Pe(c,d){for($s[c]=d,c=0;c<d.length;c++)ca.add(d[c])}var yt=RegExp("^[: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]*$"),Ht={},xn={};function fr(c){return kn.call(xn,c)?!0:kn.call(Ht,c)?!1:yt.test(c)?xn[c]=!0:(Ht[c]=!0,!1)}function Lt(c,d,m){if(fr(d))if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var v=d.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+m)}}function Ln(c,d,m){if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+m)}}function Hr(c,d,m,v){if(v===null)c.removeAttribute(m);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(m);return}c.setAttributeNS(d,m,""+v)}}function wn(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function un(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Xa(c,d,m){var v=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var C=v.get,E=v.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return C.call(this)},set:function(D){m=""+D,E.call(this,D)}}),Object.defineProperty(c,d,{enumerable:v.enumerable}),{getValue:function(){return m},setValue:function(D){m=""+D},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function Qa(c){if(!c._valueTracker){var d=un(c)?"checked":"value";c._valueTracker=Xa(c,d,""+c[d])}}function Tu(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),v="";return c&&(v=un(c)?c.checked?"true":"false":c.value),c=v,c!==m?(d.setValue(c),!0):!1}function Yd(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var C2=/[\n"\\]/g;function hi(c){return c.replace(C2,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function o0(c,d,m,v,C,E,D,$){c.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?c.type=D:c.removeAttribute("type"),d!=null?D==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+wn(d)):c.value!==""+wn(d)&&(c.value=""+wn(d)):D!=="submit"&&D!=="reset"||c.removeAttribute("value"),d!=null?Zd(c,D,wn(d)):m!=null?Zd(c,D,wn(m)):v!=null&&c.removeAttribute("value"),C==null&&E!=null&&(c.defaultChecked=!!E),C!=null&&(c.checked=C&&typeof C!="function"&&typeof C!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?c.name=""+wn($):c.removeAttribute("name")}function _u(c,d,m,v,C,E,D,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(c.type=E),d!=null||m!=null){if(!(E!=="submit"&&E!=="reset"||d!=null)){Qa(c);return}m=m!=null?""+wn(m):"",d=d!=null?""+wn(d):m,$||d===c.value||(c.value=d),c.defaultValue=d}v=v??C,v=typeof v!="function"&&typeof v!="symbol"&&!!v,c.checked=$?c.checked:!!v,c.defaultChecked=!!v,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.name=D),Qa(c)}function Zd(c,d,m){d==="number"&&Yd(c.ownerDocument)===c||c.defaultValue===""+m||(c.defaultValue=""+m)}function Rs(c,d,m,v){if(c=c.options,d){d={};for(var C=0;C<m.length;C++)d["$"+m[C]]=!0;for(m=0;m<c.length;m++)C=d.hasOwnProperty("$"+c[m].value),c[m].selected!==C&&(c[m].selected=C),C&&v&&(c[m].defaultSelected=!0)}else{for(m=""+wn(m),d=null,C=0;C<c.length;C++){if(c[C].value===m){c[C].selected=!0,v&&(c[C].defaultSelected=!0);return}d!==null||c[C].disabled||(d=c[C])}d!==null&&(d.selected=!0)}}function pg(c,d,m){if(d!=null&&(d=""+wn(d),d!==c.value&&(c.value=d),m==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=m!=null?""+wn(m):""}function Xd(c,d,m,v){if(d==null){if(v!=null){if(m!=null)throw Error(r(92));if(ce(v)){if(1<v.length)throw Error(r(93));v=v[0]}m=v}m==null&&(m=""),d=m}m=wn(d),c.defaultValue=m,v=c.textContent,v===m&&v!==""&&v!==null&&(c.value=v),Qa(c)}function Pt(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var mg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zr(c,d,m){var v=d.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?v?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":v?c.setProperty(d,m):typeof m!="number"||m===0||mg.has(d)?d==="float"?c.cssFloat=m:c[d]=(""+m).trim():c[d]=m+"px"}function Un(c,d,m){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,m!=null){for(var v in m)!m.hasOwnProperty(v)||d!=null&&d.hasOwnProperty(v)||(v.indexOf("--")===0?c.setProperty(v,""):v==="float"?c.cssFloat="":c[v]="");for(var C in d)v=d[C],d.hasOwnProperty(C)&&m[C]!==v&&Zr(c,C,v)}else for(var E in d)d.hasOwnProperty(E)&&Zr(c,E,d[E])}function nc(c){if(c.indexOf("-")===-1)return!1;switch(c){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 Ja=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rc(c){return a0.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ye(){}var xt=null;function Wt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var dn=null,Er=null;function so(c){var d=hr(c);if(d&&(c=d.stateNode)){var m=c[et]||null;e:switch(c=d.stateNode,d.type){case"input":if(o0(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+hi(""+d)+'"][type="radio"]'),d=0;d<m.length;d++){var v=m[d];if(v!==c&&v.form===c.form){var C=v[et]||null;if(!C)throw Error(r(90));o0(v,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(d=0;d<m.length;d++)v=m[d],v.form===c.form&&Tu(v)}break e;case"textarea":pg(c,m.value,m.defaultValue);break e;case"select":d=m.value,d!=null&&Rs(c,!!m.multiple,d,!1)}}}var l0=!1;function gg(c,d,m){if(l0)return c(d,m);l0=!0;try{var v=c(d);return v}finally{if(l0=!1,(dn!==null||Er!==null)&&(r1(),dn&&(d=dn,c=Er,Er=dn=null,so(d),c)))for(d=0;d<c.length;d++)so(c[d])}}function c0(c,d){var m=c.stateNode;if(m===null)return null;var v=m[et]||null;if(v===null)return null;m=v[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(c=c.type,v=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!v;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,d,typeof m));return m}var el=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),k2=!1;if(el)try{var u0={};Object.defineProperty(u0,"passive",{get:function(){k2=!0}}),window.addEventListener("test",u0,u0),window.removeEventListener("test",u0,u0)}catch{k2=!1}var sc=null,E2=null,bg=null;function E7(){if(bg)return bg;var c,d=E2,m=d.length,v,C="value"in sc?sc.value:sc.textContent,E=C.length;for(c=0;c<m&&d[c]===C[c];c++);var D=m-c;for(v=1;v<=D&&d[m-v]===C[E-v];v++);return bg=C.slice(c,1<v?1-v:void 0)}function vg(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function yg(){return!0}function N7(){return!1}function pi(c){function d(m,v,C,E,D){this._reactName=m,this._targetInst=C,this.type=v,this.nativeEvent=E,this.target=D,this.currentTarget=null;for(var $ in c)c.hasOwnProperty($)&&(m=c[$],this[$]=m?m(E):E[$]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?yg:N7,this.isPropagationStopped=N7,this}return p(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=yg)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=yg)},persist:function(){},isPersistent:yg}),d}var Ru={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xg=pi(Ru),d0=p({},Ru,{view:0,detail:0}),sK=pi(d0),N2,M2,f0,wg=p({},d0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_2,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==f0&&(f0&&c.type==="mousemove"?(N2=c.screenX-f0.screenX,M2=c.screenY-f0.screenY):M2=N2=0,f0=c),N2)},movementY:function(c){return"movementY"in c?c.movementY:M2}}),M7=pi(wg),iK=p({},wg,{dataTransfer:0}),oK=pi(iK),aK=p({},d0,{relatedTarget:0}),T2=pi(aK),lK=p({},Ru,{animationName:0,elapsedTime:0,pseudoElement:0}),cK=pi(lK),uK=p({},Ru,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),dK=pi(uK),fK=p({},Ru,{data:0}),T7=pi(fK),hK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pK={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gK(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=mK[c])?!!d[c]:!1}function _2(){return gK}var bK=p({},d0,{key:function(c){if(c.key){var d=hK[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=vg(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?pK[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_2,charCode:function(c){return c.type==="keypress"?vg(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?vg(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),vK=pi(bK),yK=p({},wg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_7=pi(yK),xK=p({},d0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_2}),wK=pi(xK),SK=p({},Ru,{propertyName:0,elapsedTime:0,pseudoElement:0}),CK=pi(SK),kK=p({},wg,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),EK=pi(kK),NK=p({},Ru,{newState:0,oldState:0}),MK=pi(NK),TK=[9,13,27,32],R2=el&&"CompositionEvent"in window,h0=null;el&&"documentMode"in document&&(h0=document.documentMode);var _K=el&&"TextEvent"in window&&!h0,R7=el&&(!R2||h0&&8<h0&&11>=h0),A7=" ",O7=!1;function D7(c,d){switch(c){case"keyup":return TK.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function j7(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Qd=!1;function RK(c,d){switch(c){case"compositionend":return j7(d);case"keypress":return d.which!==32?null:(O7=!0,A7);case"textInput":return c=d.data,c===A7&&O7?null:c;default:return null}}function AK(c,d){if(Qd)return c==="compositionend"||!R2&&D7(c,d)?(c=E7(),bg=E2=sc=null,Qd=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return R7&&d.locale!=="ko"?null:d.data;default:return null}}var OK={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function I7(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!OK[c.type]:d==="textarea"}function z7(c,d,m,v){dn?Er?Er.push(v):Er=[v]:dn=v,d=u1(d,"onChange"),0<d.length&&(m=new xg("onChange","change",null,m,v),c.push({event:m,listeners:d}))}var p0=null,m0=null;function DK(c){v9(c,0)}function Sg(c){var d=an(c);if(Tu(d))return c}function L7(c,d){if(c==="change")return d}var P7=!1;if(el){var A2;if(el){var O2="oninput"in document;if(!O2){var $7=document.createElement("div");$7.setAttribute("oninput","return;"),O2=typeof $7.oninput=="function"}A2=O2}else A2=!1;P7=A2&&(!document.documentMode||9<document.documentMode)}function B7(){p0&&(p0.detachEvent("onpropertychange",F7),m0=p0=null)}function F7(c){if(c.propertyName==="value"&&Sg(m0)){var d=[];z7(d,m0,c,Wt(c)),gg(DK,d)}}function jK(c,d,m){c==="focusin"?(B7(),p0=d,m0=m,p0.attachEvent("onpropertychange",F7)):c==="focusout"&&B7()}function IK(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Sg(m0)}function zK(c,d){if(c==="click")return Sg(d)}function LK(c,d){if(c==="input"||c==="change")return Sg(d)}function PK(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Di=typeof Object.is=="function"?Object.is:PK;function g0(c,d){if(Di(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),v=Object.keys(d);if(m.length!==v.length)return!1;for(v=0;v<m.length;v++){var C=m[v];if(!kn.call(d,C)||!Di(c[C],d[C]))return!1}return!0}function H7(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function U7(c,d){var m=H7(c);c=0;for(var v;m;){if(m.nodeType===3){if(v=c+m.textContent.length,c<=d&&v>=d)return{node:m,offset:d-c};c=v}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=H7(m)}}function V7(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?V7(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function q7(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=Yd(c.document);d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=Yd(c.document)}return d}function D2(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var $K=el&&"documentMode"in document&&11>=document.documentMode,Jd=null,j2=null,b0=null,I2=!1;function G7(c,d,m){var v=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;I2||Jd==null||Jd!==Yd(v)||(v=Jd,"selectionStart"in v&&D2(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),b0&&g0(b0,v)||(b0=v,v=u1(j2,"onSelect"),0<v.length&&(d=new xg("onSelect","select",null,d,m),c.push({event:d,listeners:v}),d.target=Jd)))}function Au(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var ef={animationend:Au("Animation","AnimationEnd"),animationiteration:Au("Animation","AnimationIteration"),animationstart:Au("Animation","AnimationStart"),transitionrun:Au("Transition","TransitionRun"),transitionstart:Au("Transition","TransitionStart"),transitioncancel:Au("Transition","TransitionCancel"),transitionend:Au("Transition","TransitionEnd")},z2={},W7={};el&&(W7=document.createElement("div").style,"AnimationEvent"in window||(delete ef.animationend.animation,delete ef.animationiteration.animation,delete ef.animationstart.animation),"TransitionEvent"in window||delete ef.transitionend.transition);function Ou(c){if(z2[c])return z2[c];if(!ef[c])return c;var d=ef[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in W7)return z2[c]=d[m];return c}var K7=Ou("animationend"),Y7=Ou("animationiteration"),Z7=Ou("animationstart"),BK=Ou("transitionrun"),FK=Ou("transitionstart"),HK=Ou("transitioncancel"),X7=Ou("transitionend"),Q7=new Map,L2="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");L2.push("scrollEnd");function Po(c,d){Q7.set(c,d),Yr(d,[c])}var Cg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},io=[],tf=0,P2=0;function kg(){for(var c=tf,d=P2=tf=0;d<c;){var m=io[d];io[d++]=null;var v=io[d];io[d++]=null;var C=io[d];io[d++]=null;var E=io[d];if(io[d++]=null,v!==null&&C!==null){var D=v.pending;D===null?C.next=C:(C.next=D.next,D.next=C),v.pending=C}E!==0&&J7(m,C,E)}}function Eg(c,d,m,v){io[tf++]=c,io[tf++]=d,io[tf++]=m,io[tf++]=v,P2|=v,c.lanes|=v,c=c.alternate,c!==null&&(c.lanes|=v)}function $2(c,d,m,v){return Eg(c,d,m,v),Ng(c)}function Du(c,d){return Eg(c,null,null,d),Ng(c)}function J7(c,d,m){c.lanes|=m;var v=c.alternate;v!==null&&(v.lanes|=m);for(var C=!1,E=c.return;E!==null;)E.childLanes|=m,v=E.alternate,v!==null&&(v.childLanes|=m),E.tag===22&&(c=E.stateNode,c===null||c._visibility&1||(C=!0)),c=E,E=E.return;return c.tag===3?(E=c.stateNode,C&&d!==null&&(C=31-_t(m),c=E.hiddenUpdates,v=c[C],v===null?c[C]=[d]:v.push(d),d.lane=m|536870912),E):null}function Ng(c){if(50<$0)throw $0=0,Kw=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var nf={};function UK(c,d,m,v){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(c,d,m,v){return new UK(c,d,m,v)}function B2(c){return c=c.prototype,!(!c||!c.isReactComponent)}function tl(c,d){var m=c.alternate;return m===null?(m=ji(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&65011712,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m.refCleanup=c.refCleanup,m}function e8(c,d){c.flags&=65011714;var m=c.alternate;return m===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=m.childLanes,c.lanes=m.lanes,c.child=m.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=m.memoizedProps,c.memoizedState=m.memoizedState,c.updateQueue=m.updateQueue,c.type=m.type,d=m.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function Mg(c,d,m,v,C,E){var D=0;if(v=c,typeof c=="function")B2(c)&&(D=1);else if(typeof c=="string")D=KY(c,m,de.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case L:return c=ji(31,m,d,C),c.elementType=L,c.lanes=E,c;case x:return ju(m.children,C,E,d);case S:D=8,C|=24;break;case k:return c=ji(12,m,d,C|2),c.elementType=k,c.lanes=E,c;case _:return c=ji(13,m,d,C),c.elementType=_,c.lanes=E,c;case A:return c=ji(19,m,d,C),c.elementType=A,c.lanes=E,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case T:D=10;break e;case N:D=9;break e;case R:D=11;break e;case I:D=14;break e;case j:D=16,v=null;break e}D=29,m=Error(r(130,c===null?"null":typeof c,"")),v=null}return d=ji(D,m,d,C),d.elementType=c,d.type=v,d.lanes=E,d}function ju(c,d,m,v){return c=ji(7,c,v,d),c.lanes=m,c}function F2(c,d,m){return c=ji(6,c,null,d),c.lanes=m,c}function t8(c){var d=ji(18,null,null,0);return d.stateNode=c,d}function H2(c,d,m){return d=ji(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var n8=new WeakMap;function oo(c,d){if(typeof c=="object"&&c!==null){var m=n8.get(c);return m!==void 0?m:(d={value:c,source:d,stack:nn(d)},n8.set(c,d),d)}return{value:c,source:d,stack:nn(d)}}var rf=[],sf=0,Tg=null,v0=0,ao=[],lo=0,ic=null,ua=1,da="";function nl(c,d){rf[sf++]=v0,rf[sf++]=Tg,Tg=c,v0=d}function r8(c,d,m){ao[lo++]=ua,ao[lo++]=da,ao[lo++]=ic,ic=c;var v=ua;c=da;var C=32-_t(v)-1;v&=~(1<<C),m+=1;var E=32-_t(d)+C;if(30<E){var D=C-C%5;E=(v&(1<<D)-1).toString(32),v>>=D,C-=D,ua=1<<32-_t(d)+C|m<<C|v,da=E+c}else ua=1<<E|m<<C|v,da=c}function U2(c){c.return!==null&&(nl(c,1),r8(c,1,0))}function V2(c){for(;c===Tg;)Tg=rf[--sf],rf[sf]=null,v0=rf[--sf],rf[sf]=null;for(;c===ic;)ic=ao[--lo],ao[lo]=null,da=ao[--lo],ao[lo]=null,ua=ao[--lo],ao[lo]=null}function s8(c,d){ao[lo++]=ua,ao[lo++]=da,ao[lo++]=ic,ua=d.id,da=d.overflow,ic=c}var As=null,pr=null,gn=!1,oc=null,co=!1,q2=Error(r(519));function ac(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw y0(oo(d,c)),q2}function i8(c){var d=c.stateNode,m=c.type,v=c.memoizedProps;switch(d[Qe]=c,d[et]=v,m){case"dialog":cn("cancel",d),cn("close",d);break;case"iframe":case"object":case"embed":cn("load",d);break;case"video":case"audio":for(m=0;m<F0.length;m++)cn(F0[m],d);break;case"source":cn("error",d);break;case"img":case"image":case"link":cn("error",d),cn("load",d);break;case"details":cn("toggle",d);break;case"input":cn("invalid",d),_u(d,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":cn("invalid",d);break;case"textarea":cn("invalid",d),Xd(d,v.value,v.defaultValue,v.children)}m=v.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||d.textContent===""+m||v.suppressHydrationWarning===!0||S9(d.textContent,m)?(v.popover!=null&&(cn("beforetoggle",d),cn("toggle",d)),v.onScroll!=null&&cn("scroll",d),v.onScrollEnd!=null&&cn("scrollend",d),v.onClick!=null&&(d.onclick=Ye),d=!0):d=!1,d||ac(c,!0)}function o8(c){for(As=c.return;As;)switch(As.tag){case 5:case 31:case 13:co=!1;return;case 27:case 3:co=!0;return;default:As=As.return}}function of(c){if(c!==As)return!1;if(!gn)return o8(c),gn=!0,!1;var d=c.tag,m;if((m=d!==3&&d!==27)&&((m=d===5)&&(m=c.type,m=!(m!=="form"&&m!=="button")||c4(c.type,c.memoizedProps)),m=!m),m&&pr&&ac(c),o8(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));pr=A9(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));pr=A9(c)}else d===27?(d=pr,wc(c.type)?(c=p4,p4=null,pr=c):pr=d):pr=As?fo(c.stateNode.nextSibling):null;return!0}function Iu(){pr=As=null,gn=!1}function G2(){var c=oc;return c!==null&&(vi===null?vi=c:vi.push.apply(vi,c),oc=null),c}function y0(c){oc===null?oc=[c]:oc.push(c)}var W2=P(null),zu=null,rl=null;function lc(c,d,m){X(W2,d._currentValue),d._currentValue=m}function sl(c){c._currentValue=W2.current,H(W2)}function K2(c,d,m){for(;c!==null;){var v=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,v!==null&&(v.childLanes|=d)):v!==null&&(v.childLanes&d)!==d&&(v.childLanes|=d),c===m)break;c=c.return}}function Y2(c,d,m,v){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var E=C.dependencies;if(E!==null){var D=C.child;E=E.firstContext;e:for(;E!==null;){var $=E;E=C;for(var J=0;J<d.length;J++)if($.context===d[J]){E.lanes|=m,$=E.alternate,$!==null&&($.lanes|=m),K2(E.return,m,c),v||(D=null);break e}E=$.next}}else if(C.tag===18){if(D=C.return,D===null)throw Error(r(341));D.lanes|=m,E=D.alternate,E!==null&&(E.lanes|=m),K2(D,m,c),D=null}else D=C.child;if(D!==null)D.return=C;else for(D=C;D!==null;){if(D===c){D=null;break}if(C=D.sibling,C!==null){C.return=D.return,D=C;break}D=D.return}C=D}}function af(c,d,m,v){c=null;for(var C=d,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var D=C.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var $=C.type;Di(C.pendingProps.value,D.value)||(c!==null?c.push($):c=[$])}}else if(C===pe.current){if(D=C.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(G0):c=[G0])}C=C.return}c!==null&&Y2(d,c,m,v),d.flags|=262144}function _g(c){for(c=c.firstContext;c!==null;){if(!Di(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Lu(c){zu=c,rl=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Os(c){return a8(zu,c)}function Rg(c,d){return zu===null&&Lu(c),a8(c,d)}function a8(c,d){var m=d._currentValue;if(d={context:d,memoizedValue:m,next:null},rl===null){if(c===null)throw Error(r(308));rl=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else rl=rl.next=d;return m}var VK=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(m,v){c.push(v)}};this.abort=function(){d.aborted=!0,c.forEach(function(m){return m()})}},qK=e.unstable_scheduleCallback,GK=e.unstable_NormalPriority,Xr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Z2(){return{controller:new VK,data:new Map,refCount:0}}function x0(c){c.refCount--,c.refCount===0&&qK(GK,function(){c.controller.abort()})}var w0=null,X2=0,lf=0,cf=null;function WK(c,d){if(w0===null){var m=w0=[];X2=0,lf=e4(),cf={status:"pending",value:void 0,then:function(v){m.push(v)}}}return X2++,d.then(l8,l8),d}function l8(){if(--X2===0&&w0!==null){cf!==null&&(cf.status="fulfilled");var c=w0;w0=null,lf=0,cf=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function KK(c,d){var m=[],v={status:"pending",value:null,reason:null,then:function(C){m.push(C)}};return c.then(function(){v.status="fulfilled",v.value=d;for(var C=0;C<m.length;C++)(0,m[C])(d)},function(C){for(v.status="rejected",v.reason=C,C=0;C<m.length;C++)(0,m[C])(void 0)}),v}var c8=F.S;F.S=function(c,d){GN=Kt(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&WK(c,d),c8!==null&&c8(c,d)};var Pu=P(null);function Q2(){var c=Pu.current;return c!==null?c:ir.pooledCache}function Ag(c,d){d===null?X(Pu,Pu.current):X(Pu,d.pool)}function u8(){var c=Q2();return c===null?null:{parent:Xr._currentValue,pool:c}}var uf=Error(r(460)),J2=Error(r(474)),Og=Error(r(542)),Dg={then:function(){}};function d8(c){return c=c.status,c==="fulfilled"||c==="rejected"}function f8(c,d,m){switch(m=c[m],m===void 0?c.push(d):m!==d&&(d.then(Ye,Ye),d=m),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,p8(c),c;default:if(typeof d.status=="string")d.then(Ye,Ye);else{if(c=ir,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(v){if(d.status==="pending"){var C=d;C.status="fulfilled",C.value=v}},function(v){if(d.status==="pending"){var C=d;C.status="rejected",C.reason=v}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,p8(c),c}throw Bu=d,uf}}function $u(c){try{var d=c._init;return d(c._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(Bu=m,uf):m}}var Bu=null;function h8(){if(Bu===null)throw Error(r(459));var c=Bu;return Bu=null,c}function p8(c){if(c===uf||c===Og)throw Error(r(483))}var df=null,S0=0;function jg(c){var d=S0;return S0+=1,df===null&&(df=[]),f8(df,c,d)}function C0(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function Ig(c,d){throw d.$$typeof===g?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function m8(c){function d(he,ae){if(c){var be=he.deletions;be===null?(he.deletions=[ae],he.flags|=16):be.push(ae)}}function m(he,ae){if(!c)return null;for(;ae!==null;)d(he,ae),ae=ae.sibling;return null}function v(he){for(var ae=new Map;he!==null;)he.key!==null?ae.set(he.key,he):ae.set(he.index,he),he=he.sibling;return ae}function C(he,ae){return he=tl(he,ae),he.index=0,he.sibling=null,he}function E(he,ae,be){return he.index=be,c?(be=he.alternate,be!==null?(be=be.index,be<ae?(he.flags|=67108866,ae):be):(he.flags|=67108866,ae)):(he.flags|=1048576,ae)}function D(he){return c&&he.alternate===null&&(he.flags|=67108866),he}function $(he,ae,be,Te){return ae===null||ae.tag!==6?(ae=F2(be,he.mode,Te),ae.return=he,ae):(ae=C(ae,be),ae.return=he,ae)}function J(he,ae,be,Te){var Mt=be.type;return Mt===x?Ee(he,ae,be.props.children,Te,be.key):ae!==null&&(ae.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===j&&$u(Mt)===ae.type)?(ae=C(ae,be.props),C0(ae,be),ae.return=he,ae):(ae=Mg(be.type,be.key,be.props,null,he.mode,Te),C0(ae,be),ae.return=he,ae)}function ve(he,ae,be,Te){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==be.containerInfo||ae.stateNode.implementation!==be.implementation?(ae=H2(be,he.mode,Te),ae.return=he,ae):(ae=C(ae,be.children||[]),ae.return=he,ae)}function Ee(he,ae,be,Te,Mt){return ae===null||ae.tag!==7?(ae=ju(be,he.mode,Te,Mt),ae.return=he,ae):(ae=C(ae,be),ae.return=he,ae)}function _e(he,ae,be){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=F2(""+ae,he.mode,be),ae.return=he,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return be=Mg(ae.type,ae.key,ae.props,null,he.mode,be),C0(be,ae),be.return=he,be;case y:return ae=H2(ae,he.mode,be),ae.return=he,ae;case j:return ae=$u(ae),_e(he,ae,be)}if(ce(ae)||re(ae))return ae=ju(ae,he.mode,be,null),ae.return=he,ae;if(typeof ae.then=="function")return _e(he,jg(ae),be);if(ae.$$typeof===T)return _e(he,Rg(he,ae),be);Ig(he,ae)}return null}function ye(he,ae,be,Te){var Mt=ae!==null?ae.key:null;if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Mt!==null?null:$(he,ae,""+be,Te);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case b:return be.key===Mt?J(he,ae,be,Te):null;case y:return be.key===Mt?ve(he,ae,be,Te):null;case j:return be=$u(be),ye(he,ae,be,Te)}if(ce(be)||re(be))return Mt!==null?null:Ee(he,ae,be,Te,null);if(typeof be.then=="function")return ye(he,ae,jg(be),Te);if(be.$$typeof===T)return ye(he,ae,Rg(he,be),Te);Ig(he,be)}return null}function Se(he,ae,be,Te,Mt){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return he=he.get(be)||null,$(ae,he,""+Te,Mt);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case b:return he=he.get(Te.key===null?be:Te.key)||null,J(ae,he,Te,Mt);case y:return he=he.get(Te.key===null?be:Te.key)||null,ve(ae,he,Te,Mt);case j:return Te=$u(Te),Se(he,ae,be,Te,Mt)}if(ce(Te)||re(Te))return he=he.get(be)||null,Ee(ae,he,Te,Mt,null);if(typeof Te.then=="function")return Se(he,ae,be,jg(Te),Mt);if(Te.$$typeof===T)return Se(he,ae,be,Rg(ae,Te),Mt);Ig(ae,Te)}return null}function ft(he,ae,be,Te){for(var Mt=null,Mn=null,wt=ae,Zt=ae=0,hn=null;wt!==null&&Zt<be.length;Zt++){wt.index>Zt?(hn=wt,wt=null):hn=wt.sibling;var Tn=ye(he,wt,be[Zt],Te);if(Tn===null){wt===null&&(wt=hn);break}c&&wt&&Tn.alternate===null&&d(he,wt),ae=E(Tn,ae,Zt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn,wt=hn}if(Zt===be.length)return m(he,wt),gn&&nl(he,Zt),Mt;if(wt===null){for(;Zt<be.length;Zt++)wt=_e(he,be[Zt],Te),wt!==null&&(ae=E(wt,ae,Zt),Mn===null?Mt=wt:Mn.sibling=wt,Mn=wt);return gn&&nl(he,Zt),Mt}for(wt=v(wt);Zt<be.length;Zt++)hn=Se(wt,he,Zt,be[Zt],Te),hn!==null&&(c&&hn.alternate!==null&&wt.delete(hn.key===null?Zt:hn.key),ae=E(hn,ae,Zt),Mn===null?Mt=hn:Mn.sibling=hn,Mn=hn);return c&&wt.forEach(function(Nc){return d(he,Nc)}),gn&&nl(he,Zt),Mt}function It(he,ae,be,Te){if(be==null)throw Error(r(151));for(var Mt=null,Mn=null,wt=ae,Zt=ae=0,hn=null,Tn=be.next();wt!==null&&!Tn.done;Zt++,Tn=be.next()){wt.index>Zt?(hn=wt,wt=null):hn=wt.sibling;var Nc=ye(he,wt,Tn.value,Te);if(Nc===null){wt===null&&(wt=hn);break}c&&wt&&Nc.alternate===null&&d(he,wt),ae=E(Nc,ae,Zt),Mn===null?Mt=Nc:Mn.sibling=Nc,Mn=Nc,wt=hn}if(Tn.done)return m(he,wt),gn&&nl(he,Zt),Mt;if(wt===null){for(;!Tn.done;Zt++,Tn=be.next())Tn=_e(he,Tn.value,Te),Tn!==null&&(ae=E(Tn,ae,Zt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn);return gn&&nl(he,Zt),Mt}for(wt=v(wt);!Tn.done;Zt++,Tn=be.next())Tn=Se(wt,he,Zt,Tn.value,Te),Tn!==null&&(c&&Tn.alternate!==null&&wt.delete(Tn.key===null?Zt:Tn.key),ae=E(Tn,ae,Zt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn);return c&&wt.forEach(function(iZ){return d(he,iZ)}),gn&&nl(he,Zt),Mt}function nr(he,ae,be,Te){if(typeof be=="object"&&be!==null&&be.type===x&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case b:e:{for(var Mt=be.key;ae!==null;){if(ae.key===Mt){if(Mt=be.type,Mt===x){if(ae.tag===7){m(he,ae.sibling),Te=C(ae,be.props.children),Te.return=he,he=Te;break e}}else if(ae.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===j&&$u(Mt)===ae.type){m(he,ae.sibling),Te=C(ae,be.props),C0(Te,be),Te.return=he,he=Te;break e}m(he,ae);break}else d(he,ae);ae=ae.sibling}be.type===x?(Te=ju(be.props.children,he.mode,Te,be.key),Te.return=he,he=Te):(Te=Mg(be.type,be.key,be.props,null,he.mode,Te),C0(Te,be),Te.return=he,he=Te)}return D(he);case y:e:{for(Mt=be.key;ae!==null;){if(ae.key===Mt)if(ae.tag===4&&ae.stateNode.containerInfo===be.containerInfo&&ae.stateNode.implementation===be.implementation){m(he,ae.sibling),Te=C(ae,be.children||[]),Te.return=he,he=Te;break e}else{m(he,ae);break}else d(he,ae);ae=ae.sibling}Te=H2(be,he.mode,Te),Te.return=he,he=Te}return D(he);case j:return be=$u(be),nr(he,ae,be,Te)}if(ce(be))return ft(he,ae,be,Te);if(re(be)){if(Mt=re(be),typeof Mt!="function")throw Error(r(150));return be=Mt.call(be),It(he,ae,be,Te)}if(typeof be.then=="function")return nr(he,ae,jg(be),Te);if(be.$$typeof===T)return nr(he,ae,Rg(he,be),Te);Ig(he,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,ae!==null&&ae.tag===6?(m(he,ae.sibling),Te=C(ae,be),Te.return=he,he=Te):(m(he,ae),Te=F2(be,he.mode,Te),Te.return=he,he=Te),D(he)):m(he,ae)}return function(he,ae,be,Te){try{S0=0;var Mt=nr(he,ae,be,Te);return df=null,Mt}catch(wt){if(wt===uf||wt===Og)throw wt;var Mn=ji(29,wt,null,he.mode);return Mn.lanes=Te,Mn.return=he,Mn}}}var Fu=m8(!0),g8=m8(!1),cc=!1;function ew(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tw(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function uc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function dc(c,d,m){var v=c.updateQueue;if(v===null)return null;if(v=v.shared,(Rn&2)!==0){var C=v.pending;return C===null?d.next=d:(d.next=C.next,C.next=d),v.pending=d,d=Ng(c),J7(c,null,m),d}return Eg(c,v,d,m),Ng(c)}function k0(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194048)!==0)){var v=d.lanes;v&=c.pendingLanes,m|=v,d.lanes=m,dt(c,m)}}function nw(c,d){var m=c.updateQueue,v=c.alternate;if(v!==null&&(v=v.updateQueue,m===v)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var D={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};E===null?C=E=D:E=E.next=D,m=m.next}while(m!==null);E===null?C=E=d:E=E.next=d}else C=E=d;m={baseState:v.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:v.shared,callbacks:v.callbacks},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}var rw=!1;function E0(){if(rw){var c=cf;if(c!==null)throw c}}function N0(c,d,m,v){rw=!1;var C=c.updateQueue;cc=!1;var E=C.firstBaseUpdate,D=C.lastBaseUpdate,$=C.shared.pending;if($!==null){C.shared.pending=null;var J=$,ve=J.next;J.next=null,D===null?E=ve:D.next=ve,D=J;var Ee=c.alternate;Ee!==null&&(Ee=Ee.updateQueue,$=Ee.lastBaseUpdate,$!==D&&($===null?Ee.firstBaseUpdate=ve:$.next=ve,Ee.lastBaseUpdate=J))}if(E!==null){var _e=C.baseState;D=0,Ee=ve=J=null,$=E;do{var ye=$.lane&-536870913,Se=ye!==$.lane;if(Se?(fn&ye)===ye:(v&ye)===ye){ye!==0&&ye===lf&&(rw=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var ft=c,It=$;ye=d;var nr=m;switch(It.tag){case 1:if(ft=It.payload,typeof ft=="function"){_e=ft.call(nr,_e,ye);break e}_e=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=It.payload,ye=typeof ft=="function"?ft.call(nr,_e,ye):ft,ye==null)break e;_e=p({},_e,ye);break e;case 2:cc=!0}}ye=$.callback,ye!==null&&(c.flags|=64,Se&&(c.flags|=8192),Se=C.callbacks,Se===null?C.callbacks=[ye]:Se.push(ye))}else Se={lane:ye,tag:$.tag,payload:$.payload,callback:$.callback,next:null},Ee===null?(ve=Ee=Se,J=_e):Ee=Ee.next=Se,D|=ye;if($=$.next,$===null){if($=C.shared.pending,$===null)break;Se=$,$=Se.next,Se.next=null,C.lastBaseUpdate=Se,C.shared.pending=null}}while(!0);Ee===null&&(J=_e),C.baseState=J,C.firstBaseUpdate=ve,C.lastBaseUpdate=Ee,E===null&&(C.shared.lanes=0),gc|=D,c.lanes=D,c.memoizedState=_e}}function b8(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function v8(c,d){var m=c.callbacks;if(m!==null)for(c.callbacks=null,c=0;c<m.length;c++)b8(m[c],d)}var ff=P(null),zg=P(0);function y8(c,d){c=hl,X(zg,c),X(ff,d),hl=c|d.baseLanes}function sw(){X(zg,hl),X(ff,ff.current)}function iw(){hl=zg.current,H(ff),H(zg)}var Ii=P(null),uo=null;function fc(c){var d=c.alternate;X(Ur,Ur.current&1),X(Ii,c),uo===null&&(d===null||ff.current!==null||d.memoizedState!==null)&&(uo=c)}function ow(c){X(Ur,Ur.current),X(Ii,c),uo===null&&(uo=c)}function x8(c){c.tag===22?(X(Ur,Ur.current),X(Ii,c),uo===null&&(uo=c)):hc()}function hc(){X(Ur,Ur.current),X(Ii,Ii.current)}function zi(c){H(Ii),uo===c&&(uo=null),H(Ur)}var Ur=P(0);function Lg(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||f4(m)||h4(m)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var il=0,Yt=null,er=null,Qr=null,Pg=!1,hf=!1,Hu=!1,$g=0,M0=0,pf=null,YK=0;function jr(){throw Error(r(321))}function aw(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!Di(c[m],d[m]))return!1;return!0}function lw(c,d,m,v,C,E){return il=E,Yt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,F.H=c===null||c.memoizedState===null?rN:Cw,Hu=!1,E=m(v,C),Hu=!1,hf&&(E=S8(d,m,v,C)),w8(c),E}function w8(c){F.H=R0;var d=er!==null&&er.next!==null;if(il=0,Qr=er=Yt=null,Pg=!1,M0=0,pf=null,d)throw Error(r(300));c===null||Jr||(c=c.dependencies,c!==null&&_g(c)&&(Jr=!0))}function S8(c,d,m,v){Yt=c;var C=0;do{if(hf&&(pf=null),M0=0,hf=!1,25<=C)throw Error(r(301));if(C+=1,Qr=er=null,c.updateQueue!=null){var E=c.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}F.H=sN,E=d(m,v)}while(hf);return E}function ZK(){var c=F.H,d=c.useState()[0];return d=typeof d.then=="function"?T0(d):d,c=c.useState()[0],(er!==null?er.memoizedState:null)!==c&&(Yt.flags|=1024),d}function cw(){var c=$g!==0;return $g=0,c}function uw(c,d,m){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~m}function dw(c){if(Pg){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}Pg=!1}il=0,Qr=er=Yt=null,hf=!1,M0=$g=0,pf=null}function Qs(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qr===null?Yt.memoizedState=Qr=c:Qr=Qr.next=c,Qr}function Vr(){if(er===null){var c=Yt.alternate;c=c!==null?c.memoizedState:null}else c=er.next;var d=Qr===null?Yt.memoizedState:Qr.next;if(d!==null)Qr=d,er=c;else{if(c===null)throw Yt.alternate===null?Error(r(467)):Error(r(310));er=c,c={memoizedState:er.memoizedState,baseState:er.baseState,baseQueue:er.baseQueue,queue:er.queue,next:null},Qr===null?Yt.memoizedState=Qr=c:Qr=Qr.next=c}return Qr}function Bg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function T0(c){var d=M0;return M0+=1,pf===null&&(pf=[]),c=f8(pf,c,d),d=Yt,(Qr===null?d.memoizedState:Qr.next)===null&&(d=d.alternate,F.H=d===null||d.memoizedState===null?rN:Cw),c}function Fg(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return T0(c);if(c.$$typeof===T)return Os(c)}throw Error(r(438,String(c)))}function fw(c){var d=null,m=Yt.updateQueue;if(m!==null&&(d=m.memoCache),d==null){var v=Yt.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(d={data:v.data.map(function(C){return C.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),m===null&&(m=Bg(),Yt.updateQueue=m),m.memoCache=d,m=d.data[d.index],m===void 0)for(m=d.data[d.index]=Array(c),v=0;v<c;v++)m[v]=q;return d.index++,m}function ol(c,d){return typeof d=="function"?d(c):d}function Hg(c){var d=Vr();return hw(d,er,c)}function hw(c,d,m){var v=c.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=m;var C=c.baseQueue,E=v.pending;if(E!==null){if(C!==null){var D=C.next;C.next=E.next,E.next=D}d.baseQueue=C=E,v.pending=null}if(E=c.baseState,C===null)c.memoizedState=E;else{d=C.next;var $=D=null,J=null,ve=d,Ee=!1;do{var _e=ve.lane&-536870913;if(_e!==ve.lane?(fn&_e)===_e:(il&_e)===_e){var ye=ve.revertLane;if(ye===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),_e===lf&&(Ee=!0);else if((il&ye)===ye){ve=ve.next,ye===lf&&(Ee=!0);continue}else _e={lane:0,revertLane:ve.revertLane,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},J===null?($=J=_e,D=E):J=J.next=_e,Yt.lanes|=ye,gc|=ye;_e=ve.action,Hu&&m(E,_e),E=ve.hasEagerState?ve.eagerState:m(E,_e)}else ye={lane:_e,revertLane:ve.revertLane,gesture:ve.gesture,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},J===null?($=J=ye,D=E):J=J.next=ye,Yt.lanes|=_e,gc|=_e;ve=ve.next}while(ve!==null&&ve!==d);if(J===null?D=E:J.next=$,!Di(E,c.memoizedState)&&(Jr=!0,Ee&&(m=cf,m!==null)))throw m;c.memoizedState=E,c.baseState=D,c.baseQueue=J,v.lastRenderedState=E}return C===null&&(v.lanes=0),[c.memoizedState,v.dispatch]}function pw(c){var d=Vr(),m=d.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var v=m.dispatch,C=m.pending,E=d.memoizedState;if(C!==null){m.pending=null;var D=C=C.next;do E=c(E,D.action),D=D.next;while(D!==C);Di(E,d.memoizedState)||(Jr=!0),d.memoizedState=E,d.baseQueue===null&&(d.baseState=E),m.lastRenderedState=E}return[E,v]}function C8(c,d,m){var v=Yt,C=Vr(),E=gn;if(E){if(m===void 0)throw Error(r(407));m=m()}else m=d();var D=!Di((er||C).memoizedState,m);if(D&&(C.memoizedState=m,Jr=!0),C=C.queue,bw(N8.bind(null,v,C,c),[c]),C.getSnapshot!==d||D||Qr!==null&&Qr.memoizedState.tag&1){if(v.flags|=2048,mf(9,{destroy:void 0},E8.bind(null,v,C,m,d),null),ir===null)throw Error(r(349));E||(il&127)!==0||k8(v,d,m)}return m}function k8(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=Yt.updateQueue,d===null?(d=Bg(),Yt.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function E8(c,d,m,v){d.value=m,d.getSnapshot=v,M8(d)&&T8(c)}function N8(c,d,m){return m(function(){M8(d)&&T8(c)})}function M8(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!Di(c,m)}catch{return!0}}function T8(c){var d=Du(c,2);d!==null&&yi(d,c,2)}function mw(c){var d=Qs();if(typeof c=="function"){var m=c;if(c=m(),Hu){_n(!0);try{m()}finally{_n(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:c},d}function _8(c,d,m,v){return c.baseState=m,hw(c,er,typeof v=="function"?v:ol)}function XK(c,d,m,v,C){if(qg(c))throw Error(r(485));if(c=d.action,c!==null){var E={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){E.listeners.push(D)}};F.T!==null?m(!0):E.isTransition=!1,v(E),m=d.pending,m===null?(E.next=d.pending=E,R8(d,E)):(E.next=m.next,d.pending=m.next=E)}}function R8(c,d){var m=d.action,v=d.payload,C=c.state;if(d.isTransition){var E=F.T,D={};F.T=D;try{var $=m(C,v),J=F.S;J!==null&&J(D,$),A8(c,d,$)}catch(ve){gw(c,d,ve)}finally{E!==null&&D.types!==null&&(E.types=D.types),F.T=E}}else try{E=m(C,v),A8(c,d,E)}catch(ve){gw(c,d,ve)}}function A8(c,d,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(v){O8(c,d,v)},function(v){return gw(c,d,v)}):O8(c,d,m)}function O8(c,d,m){d.status="fulfilled",d.value=m,D8(d),c.state=m,d=c.pending,d!==null&&(m=d.next,m===d?c.pending=null:(m=m.next,d.next=m,R8(c,m)))}function gw(c,d,m){var v=c.pending;if(c.pending=null,v!==null){v=v.next;do d.status="rejected",d.reason=m,D8(d),d=d.next;while(d!==v)}c.action=null}function D8(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function j8(c,d){return d}function I8(c,d){if(gn){var m=ir.formState;if(m!==null){e:{var v=Yt;if(gn){if(pr){t:{for(var C=pr,E=co;C.nodeType!==8;){if(!E){C=null;break t}if(C=fo(C.nextSibling),C===null){C=null;break t}}E=C.data,C=E==="F!"||E==="F"?C:null}if(C){pr=fo(C.nextSibling),v=C.data==="F!";break e}}ac(v)}v=!1}v&&(d=m[0])}}return m=Qs(),m.memoizedState=m.baseState=d,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j8,lastRenderedState:d},m.queue=v,m=eN.bind(null,Yt,v),v.dispatch=m,v=mw(!1),E=Sw.bind(null,Yt,!1,v.queue),v=Qs(),C={state:d,dispatch:null,action:c,pending:null},v.queue=C,m=XK.bind(null,Yt,C,E,m),C.dispatch=m,v.memoizedState=c,[d,m,!1]}function z8(c){var d=Vr();return L8(d,er,c)}function L8(c,d,m){if(d=hw(c,d,j8)[0],c=Hg(ol)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var v=T0(d)}catch(D){throw D===uf?Og:D}else v=d;d=Vr();var C=d.queue,E=C.dispatch;return m!==d.memoizedState&&(Yt.flags|=2048,mf(9,{destroy:void 0},QK.bind(null,C,m),null)),[v,E,c]}function QK(c,d){c.action=d}function P8(c){var d=Vr(),m=er;if(m!==null)return L8(d,m,c);Vr(),d=d.memoizedState,m=Vr();var v=m.queue.dispatch;return m.memoizedState=c,[d,v,!1]}function mf(c,d,m,v){return c={tag:c,create:m,deps:v,inst:d,next:null},d=Yt.updateQueue,d===null&&(d=Bg(),Yt.updateQueue=d),m=d.lastEffect,m===null?d.lastEffect=c.next=c:(v=m.next,m.next=c,c.next=v,d.lastEffect=c),c}function $8(){return Vr().memoizedState}function Ug(c,d,m,v){var C=Qs();Yt.flags|=c,C.memoizedState=mf(1|d,{destroy:void 0},m,v===void 0?null:v)}function Vg(c,d,m,v){var C=Vr();v=v===void 0?null:v;var E=C.memoizedState.inst;er!==null&&v!==null&&aw(v,er.memoizedState.deps)?C.memoizedState=mf(d,E,m,v):(Yt.flags|=c,C.memoizedState=mf(1|d,E,m,v))}function B8(c,d){Ug(8390656,8,c,d)}function bw(c,d){Vg(2048,8,c,d)}function JK(c){Yt.flags|=4;var d=Yt.updateQueue;if(d===null)d=Bg(),Yt.updateQueue=d,d.events=[c];else{var m=d.events;m===null?d.events=[c]:m.push(c)}}function F8(c){var d=Vr().memoizedState;return JK({ref:d,nextImpl:c}),function(){if((Rn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function H8(c,d){return Vg(4,2,c,d)}function U8(c,d){return Vg(4,4,c,d)}function V8(c,d){if(typeof d=="function"){c=c();var m=d(c);return function(){typeof m=="function"?m():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function q8(c,d,m){m=m!=null?m.concat([c]):null,Vg(4,4,V8.bind(null,d,c),m)}function vw(){}function G8(c,d){var m=Vr();d=d===void 0?null:d;var v=m.memoizedState;return d!==null&&aw(d,v[1])?v[0]:(m.memoizedState=[c,d],c)}function W8(c,d){var m=Vr();d=d===void 0?null:d;var v=m.memoizedState;if(d!==null&&aw(d,v[1]))return v[0];if(v=c(),Hu){_n(!0);try{c()}finally{_n(!1)}}return m.memoizedState=[v,d],v}function yw(c,d,m){return m===void 0||(il&1073741824)!==0&&(fn&261930)===0?c.memoizedState=d:(c.memoizedState=m,c=KN(),Yt.lanes|=c,gc|=c,m)}function K8(c,d,m,v){return Di(m,d)?m:ff.current!==null?(c=yw(c,m,v),Di(c,d)||(Jr=!0),c):(il&42)===0||(il&1073741824)!==0&&(fn&261930)===0?(Jr=!0,c.memoizedState=m):(c=KN(),Yt.lanes|=c,gc|=c,d)}function Y8(c,d,m,v,C){var E=te.p;te.p=E!==0&&8>E?E:8;var D=F.T,$={};F.T=$,Sw(c,!1,d,m);try{var J=C(),ve=F.S;if(ve!==null&&ve($,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var Ee=KK(J,v);_0(c,d,Ee,$i(c))}else _0(c,d,v,$i(c))}catch(_e){_0(c,d,{then:function(){},status:"rejected",reason:_e},$i())}finally{te.p=E,D!==null&&$.types!==null&&(D.types=$.types),F.T=D}}function eY(){}function xw(c,d,m,v){if(c.tag!==5)throw Error(r(476));var C=Z8(c).queue;Y8(c,C,d,K,m===null?eY:function(){return X8(c),m(v)})}function Z8(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:K},next:null};var m={};return d.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:m},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function X8(c){var d=Z8(c);d.next===null&&(d=c.alternate.memoizedState),_0(c,d.next.queue,{},$i())}function ww(){return Os(G0)}function Q8(){return Vr().memoizedState}function J8(){return Vr().memoizedState}function tY(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var m=$i();c=uc(m);var v=dc(d,c,m);v!==null&&(yi(v,d,m),k0(v,d,m)),d={cache:Z2()},c.payload=d;return}d=d.return}}function nY(c,d,m){var v=$i();m={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},qg(c)?tN(d,m):(m=$2(c,d,m,v),m!==null&&(yi(m,c,v),nN(m,d,v)))}function eN(c,d,m){var v=$i();_0(c,d,m,v)}function _0(c,d,m,v){var C={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(qg(c))tN(d,C);else{var E=c.alternate;if(c.lanes===0&&(E===null||E.lanes===0)&&(E=d.lastRenderedReducer,E!==null))try{var D=d.lastRenderedState,$=E(D,m);if(C.hasEagerState=!0,C.eagerState=$,Di($,D))return Eg(c,d,C,0),ir===null&&kg(),!1}catch{}if(m=$2(c,d,C,v),m!==null)return yi(m,c,v),nN(m,d,v),!0}return!1}function Sw(c,d,m,v){if(v={lane:2,revertLane:e4(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},qg(c)){if(d)throw Error(r(479))}else d=$2(c,m,v,2),d!==null&&yi(d,c,2)}function qg(c){var d=c.alternate;return c===Yt||d!==null&&d===Yt}function tN(c,d){hf=Pg=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function nN(c,d,m){if((m&4194048)!==0){var v=d.lanes;v&=c.pendingLanes,m|=v,d.lanes=m,dt(c,m)}}var R0={readContext:Os,use:Fg,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useLayoutEffect:jr,useInsertionEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useSyncExternalStore:jr,useId:jr,useHostTransitionStatus:jr,useFormState:jr,useActionState:jr,useOptimistic:jr,useMemoCache:jr,useCacheRefresh:jr};R0.useEffectEvent=jr;var rN={readContext:Os,use:Fg,useCallback:function(c,d){return Qs().memoizedState=[c,d===void 0?null:d],c},useContext:Os,useEffect:B8,useImperativeHandle:function(c,d,m){m=m!=null?m.concat([c]):null,Ug(4194308,4,V8.bind(null,d,c),m)},useLayoutEffect:function(c,d){return Ug(4194308,4,c,d)},useInsertionEffect:function(c,d){Ug(4,2,c,d)},useMemo:function(c,d){var m=Qs();d=d===void 0?null:d;var v=c();if(Hu){_n(!0);try{c()}finally{_n(!1)}}return m.memoizedState=[v,d],v},useReducer:function(c,d,m){var v=Qs();if(m!==void 0){var C=m(d);if(Hu){_n(!0);try{m(d)}finally{_n(!1)}}}else C=d;return v.memoizedState=v.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},v.queue=c,c=c.dispatch=nY.bind(null,Yt,c),[v.memoizedState,c]},useRef:function(c){var d=Qs();return c={current:c},d.memoizedState=c},useState:function(c){c=mw(c);var d=c.queue,m=eN.bind(null,Yt,d);return d.dispatch=m,[c.memoizedState,m]},useDebugValue:vw,useDeferredValue:function(c,d){var m=Qs();return yw(m,c,d)},useTransition:function(){var c=mw(!1);return c=Y8.bind(null,Yt,c.queue,!0,!1),Qs().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,m){var v=Yt,C=Qs();if(gn){if(m===void 0)throw Error(r(407));m=m()}else{if(m=d(),ir===null)throw Error(r(349));(fn&127)!==0||k8(v,d,m)}C.memoizedState=m;var E={value:m,getSnapshot:d};return C.queue=E,B8(N8.bind(null,v,E,c),[c]),v.flags|=2048,mf(9,{destroy:void 0},E8.bind(null,v,E,m,d),null),m},useId:function(){var c=Qs(),d=ir.identifierPrefix;if(gn){var m=da,v=ua;m=(v&~(1<<32-_t(v)-1)).toString(32)+m,d="_"+d+"R_"+m,m=$g++,0<m&&(d+="H"+m.toString(32)),d+="_"}else m=YK++,d="_"+d+"r_"+m.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:ww,useFormState:I8,useActionState:I8,useOptimistic:function(c){var d=Qs();d.memoizedState=d.baseState=c;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=m,d=Sw.bind(null,Yt,!0,m),m.dispatch=d,[c,d]},useMemoCache:fw,useCacheRefresh:function(){return Qs().memoizedState=tY.bind(null,Yt)},useEffectEvent:function(c){var d=Qs(),m={impl:c};return d.memoizedState=m,function(){if((Rn&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},Cw={readContext:Os,use:Fg,useCallback:G8,useContext:Os,useEffect:bw,useImperativeHandle:q8,useInsertionEffect:H8,useLayoutEffect:U8,useMemo:W8,useReducer:Hg,useRef:$8,useState:function(){return Hg(ol)},useDebugValue:vw,useDeferredValue:function(c,d){var m=Vr();return K8(m,er.memoizedState,c,d)},useTransition:function(){var c=Hg(ol)[0],d=Vr().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:C8,useId:Q8,useHostTransitionStatus:ww,useFormState:z8,useActionState:z8,useOptimistic:function(c,d){var m=Vr();return _8(m,er,c,d)},useMemoCache:fw,useCacheRefresh:J8};Cw.useEffectEvent=F8;var sN={readContext:Os,use:Fg,useCallback:G8,useContext:Os,useEffect:bw,useImperativeHandle:q8,useInsertionEffect:H8,useLayoutEffect:U8,useMemo:W8,useReducer:pw,useRef:$8,useState:function(){return pw(ol)},useDebugValue:vw,useDeferredValue:function(c,d){var m=Vr();return er===null?yw(m,c,d):K8(m,er.memoizedState,c,d)},useTransition:function(){var c=pw(ol)[0],d=Vr().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:C8,useId:Q8,useHostTransitionStatus:ww,useFormState:P8,useActionState:P8,useOptimistic:function(c,d){var m=Vr();return er!==null?_8(m,er,c,d):(m.baseState=c,[c,m.queue.dispatch])},useMemoCache:fw,useCacheRefresh:J8};sN.useEffectEvent=F8;function kw(c,d,m,v){d=c.memoizedState,m=m(v,d),m=m==null?d:p({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var Ew={enqueueSetState:function(c,d,m){c=c._reactInternals;var v=$i(),C=uc(v);C.payload=d,m!=null&&(C.callback=m),d=dc(c,C,v),d!==null&&(yi(d,c,v),k0(d,c,v))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var v=$i(),C=uc(v);C.tag=1,C.payload=d,m!=null&&(C.callback=m),d=dc(c,C,v),d!==null&&(yi(d,c,v),k0(d,c,v))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=$i(),v=uc(m);v.tag=2,d!=null&&(v.callback=d),d=dc(c,v,m),d!==null&&(yi(d,c,m),k0(d,c,m))}};function iN(c,d,m,v,C,E,D){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(v,E,D):d.prototype&&d.prototype.isPureReactComponent?!g0(m,v)||!g0(C,E):!0}function oN(c,d,m,v){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,v),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,v),d.state!==c&&Ew.enqueueReplaceState(d,d.state,null)}function Uu(c,d){var m=d;if("ref"in d){m={};for(var v in d)v!=="ref"&&(m[v]=d[v])}if(c=c.defaultProps){m===d&&(m=p({},m));for(var C in c)m[C]===void 0&&(m[C]=c[C])}return m}function aN(c){Cg(c)}function lN(c){console.error(c)}function cN(c){Cg(c)}function Gg(c,d){try{var m=c.onUncaughtError;m(d.value,{componentStack:d.stack})}catch(v){setTimeout(function(){throw v})}}function uN(c,d,m){try{var v=c.onCaughtError;v(m.value,{componentStack:m.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Nw(c,d,m){return m=uc(m),m.tag=3,m.payload={element:null},m.callback=function(){Gg(c,d)},m}function dN(c){return c=uc(c),c.tag=3,c}function fN(c,d,m,v){var C=m.type.getDerivedStateFromError;if(typeof C=="function"){var E=v.value;c.payload=function(){return C(E)},c.callback=function(){uN(d,m,v)}}var D=m.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(c.callback=function(){uN(d,m,v),typeof C!="function"&&(bc===null?bc=new Set([this]):bc.add(this));var $=v.stack;this.componentDidCatch(v.value,{componentStack:$!==null?$:""})})}function rY(c,d,m,v,C){if(m.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(d=m.alternate,d!==null&&af(d,m,C,!0),m=Ii.current,m!==null){switch(m.tag){case 31:case 13:return uo===null?s1():m.alternate===null&&Ir===0&&(Ir=3),m.flags&=-257,m.flags|=65536,m.lanes=C,v===Dg?m.flags|=16384:(d=m.updateQueue,d===null?m.updateQueue=new Set([v]):d.add(v),Xw(c,v,C)),!1;case 22:return m.flags|=65536,v===Dg?m.flags|=16384:(d=m.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([v])},m.updateQueue=d):(m=d.retryQueue,m===null?d.retryQueue=new Set([v]):m.add(v)),Xw(c,v,C)),!1}throw Error(r(435,m.tag))}return Xw(c,v,C),s1(),!1}if(gn)return d=Ii.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=C,v!==q2&&(c=Error(r(422),{cause:v}),y0(oo(c,m)))):(v!==q2&&(d=Error(r(423),{cause:v}),y0(oo(d,m))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,v=oo(v,m),C=Nw(c.stateNode,v,C),nw(c,C),Ir!==4&&(Ir=2)),!1;var E=Error(r(520),{cause:v});if(E=oo(E,m),P0===null?P0=[E]:P0.push(E),Ir!==4&&(Ir=2),d===null)return!0;v=oo(v,m),m=d;do{switch(m.tag){case 3:return m.flags|=65536,c=C&-C,m.lanes|=c,c=Nw(m.stateNode,v,c),nw(m,c),!1;case 1:if(d=m.type,E=m.stateNode,(m.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(bc===null||!bc.has(E))))return m.flags|=65536,C&=-C,m.lanes|=C,C=dN(C),fN(C,c,m,v),nw(m,C),!1}m=m.return}while(m!==null);return!1}var Mw=Error(r(461)),Jr=!1;function Ds(c,d,m,v){d.child=c===null?g8(d,null,m,v):Fu(d,c.child,m,v)}function hN(c,d,m,v,C){m=m.render;var E=d.ref;if("ref"in v){var D={};for(var $ in v)$!=="ref"&&(D[$]=v[$])}else D=v;return Lu(d),v=lw(c,d,m,D,E,C),$=cw(),c!==null&&!Jr?(uw(c,d,C),al(c,d,C)):(gn&&$&&U2(d),d.flags|=1,Ds(c,d,v,C),d.child)}function pN(c,d,m,v,C){if(c===null){var E=m.type;return typeof E=="function"&&!B2(E)&&E.defaultProps===void 0&&m.compare===null?(d.tag=15,d.type=E,mN(c,d,E,v,C)):(c=Mg(m.type,null,v,d,d.mode,C),c.ref=d.ref,c.return=d,d.child=c)}if(E=c.child,!Iw(c,C)){var D=E.memoizedProps;if(m=m.compare,m=m!==null?m:g0,m(D,v)&&c.ref===d.ref)return al(c,d,C)}return d.flags|=1,c=tl(E,v),c.ref=d.ref,c.return=d,d.child=c}function mN(c,d,m,v,C){if(c!==null){var E=c.memoizedProps;if(g0(E,v)&&c.ref===d.ref)if(Jr=!1,d.pendingProps=v=E,Iw(c,C))(c.flags&131072)!==0&&(Jr=!0);else return d.lanes=c.lanes,al(c,d,C)}return Tw(c,d,m,v,C)}function gN(c,d,m,v){var C=v.children,E=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((d.flags&128)!==0){if(E=E!==null?E.baseLanes|m:m,c!==null){for(v=d.child=c.child,C=0;v!==null;)C=C|v.lanes|v.childLanes,v=v.sibling;v=C&~E}else v=0,d.child=null;return bN(c,d,E,m,v)}if((m&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&Ag(d,E!==null?E.cachePool:null),E!==null?y8(d,E):sw(),x8(d);else return v=d.lanes=536870912,bN(c,d,E!==null?E.baseLanes|m:m,m,v)}else E!==null?(Ag(d,E.cachePool),y8(d,E),hc(),d.memoizedState=null):(c!==null&&Ag(d,null),sw(),hc());return Ds(c,d,C,m),d.child}function A0(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function bN(c,d,m,v,C){var E=Q2();return E=E===null?null:{parent:Xr._currentValue,pool:E},d.memoizedState={baseLanes:m,cachePool:E},c!==null&&Ag(d,null),sw(),x8(d),c!==null&&af(c,d,v,!0),d.childLanes=C,null}function Wg(c,d){return d=Yg({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function vN(c,d,m){return Fu(d,c.child,null,m),c=Wg(d,d.pendingProps),c.flags|=2,zi(d),d.memoizedState=null,c}function sY(c,d,m){var v=d.pendingProps,C=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(gn){if(v.mode==="hidden")return c=Wg(d,v),d.lanes=536870912,A0(null,c);if(ow(d),(c=pr)?(c=R9(c,co),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ic!==null?{id:ua,overflow:da}:null,retryLane:536870912,hydrationErrors:null},m=t8(c),m.return=d,d.child=m,As=d,pr=null)):c=null,c===null)throw ac(d);return d.lanes=536870912,null}return Wg(d,v)}var E=c.memoizedState;if(E!==null){var D=E.dehydrated;if(ow(d),C)if(d.flags&256)d.flags&=-257,d=vN(c,d,m);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(Jr||af(c,d,m,!1),C=(m&c.childLanes)!==0,Jr||C){if(v=ir,v!==null&&(D=G(v,m),D!==0&&D!==E.retryLane))throw E.retryLane=D,Du(c,D),yi(v,c,D),Mw;s1(),d=vN(c,d,m)}else c=E.treeContext,pr=fo(D.nextSibling),As=d,gn=!0,oc=null,co=!1,c!==null&&s8(d,c),d=Wg(d,v),d.flags|=4096;return d}return c=tl(c.child,{mode:v.mode,children:v.children}),c.ref=d.ref,d.child=c,c.return=d,c}function Kg(c,d){var m=d.ref;if(m===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(c===null||c.ref!==m)&&(d.flags|=4194816)}}function Tw(c,d,m,v,C){return Lu(d),m=lw(c,d,m,v,void 0,C),v=cw(),c!==null&&!Jr?(uw(c,d,C),al(c,d,C)):(gn&&v&&U2(d),d.flags|=1,Ds(c,d,m,C),d.child)}function yN(c,d,m,v,C,E){return Lu(d),d.updateQueue=null,m=S8(d,v,m,C),w8(c),v=cw(),c!==null&&!Jr?(uw(c,d,E),al(c,d,E)):(gn&&v&&U2(d),d.flags|=1,Ds(c,d,m,E),d.child)}function xN(c,d,m,v,C){if(Lu(d),d.stateNode===null){var E=nf,D=m.contextType;typeof D=="object"&&D!==null&&(E=Os(D)),E=new m(v,E),d.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Ew,d.stateNode=E,E._reactInternals=d,E=d.stateNode,E.props=v,E.state=d.memoizedState,E.refs={},ew(d),D=m.contextType,E.context=typeof D=="object"&&D!==null?Os(D):nf,E.state=d.memoizedState,D=m.getDerivedStateFromProps,typeof D=="function"&&(kw(d,m,D,v),E.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(D=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),D!==E.state&&Ew.enqueueReplaceState(E,E.state,null),N0(d,v,E,C),E0(),E.state=d.memoizedState),typeof E.componentDidMount=="function"&&(d.flags|=4194308),v=!0}else if(c===null){E=d.stateNode;var $=d.memoizedProps,J=Uu(m,$);E.props=J;var ve=E.context,Ee=m.contextType;D=nf,typeof Ee=="object"&&Ee!==null&&(D=Os(Ee));var _e=m.getDerivedStateFromProps;Ee=typeof _e=="function"||typeof E.getSnapshotBeforeUpdate=="function",$=d.pendingProps!==$,Ee||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($||ve!==D)&&oN(d,E,v,D),cc=!1;var ye=d.memoizedState;E.state=ye,N0(d,v,E,C),E0(),ve=d.memoizedState,$||ye!==ve||cc?(typeof _e=="function"&&(kw(d,m,_e,v),ve=d.memoizedState),(J=cc||iN(d,m,J,v,ye,ve,D))?(Ee||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(d.flags|=4194308)):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=v,d.memoizedState=ve),E.props=v,E.state=ve,E.context=D,v=J):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),v=!1)}else{E=d.stateNode,tw(c,d),D=d.memoizedProps,Ee=Uu(m,D),E.props=Ee,_e=d.pendingProps,ye=E.context,ve=m.contextType,J=nf,typeof ve=="object"&&ve!==null&&(J=Os(ve)),$=m.getDerivedStateFromProps,(ve=typeof $=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==_e||ye!==J)&&oN(d,E,v,J),cc=!1,ye=d.memoizedState,E.state=ye,N0(d,v,E,C),E0();var Se=d.memoizedState;D!==_e||ye!==Se||cc||c!==null&&c.dependencies!==null&&_g(c.dependencies)?(typeof $=="function"&&(kw(d,m,$,v),Se=d.memoizedState),(Ee=cc||iN(d,m,Ee,v,ye,Se,J)||c!==null&&c.dependencies!==null&&_g(c.dependencies))?(ve||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(v,Se,J),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(v,Se,J)),typeof E.componentDidUpdate=="function"&&(d.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=1024),d.memoizedProps=v,d.memoizedState=Se),E.props=v,E.state=Se,E.context=J,v=Ee):(typeof E.componentDidUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=1024),v=!1)}return E=v,Kg(c,d),v=(d.flags&128)!==0,E||v?(E=d.stateNode,m=v&&typeof m.getDerivedStateFromError!="function"?null:E.render(),d.flags|=1,c!==null&&v?(d.child=Fu(d,c.child,null,C),d.child=Fu(d,null,m,C)):Ds(c,d,m,C),d.memoizedState=E.state,c=d.child):c=al(c,d,C),c}function wN(c,d,m,v){return Iu(),d.flags|=256,Ds(c,d,m,v),d.child}var _w={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rw(c){return{baseLanes:c,cachePool:u8()}}function Aw(c,d,m){return c=c!==null?c.childLanes&~m:0,d&&(c|=Pi),c}function SN(c,d,m){var v=d.pendingProps,C=!1,E=(d.flags&128)!==0,D;if((D=E)||(D=c!==null&&c.memoizedState===null?!1:(Ur.current&2)!==0),D&&(C=!0,d.flags&=-129),D=(d.flags&32)!==0,d.flags&=-33,c===null){if(gn){if(C?fc(d):hc(),(c=pr)?(c=R9(c,co),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ic!==null?{id:ua,overflow:da}:null,retryLane:536870912,hydrationErrors:null},m=t8(c),m.return=d,d.child=m,As=d,pr=null)):c=null,c===null)throw ac(d);return h4(c)?d.lanes=32:d.lanes=536870912,null}var $=v.children;return v=v.fallback,C?(hc(),C=d.mode,$=Yg({mode:"hidden",children:$},C),v=ju(v,C,m,null),$.return=d,v.return=d,$.sibling=v,d.child=$,v=d.child,v.memoizedState=Rw(m),v.childLanes=Aw(c,D,m),d.memoizedState=_w,A0(null,v)):(fc(d),Ow(d,$))}var J=c.memoizedState;if(J!==null&&($=J.dehydrated,$!==null)){if(E)d.flags&256?(fc(d),d.flags&=-257,d=Dw(c,d,m)):d.memoizedState!==null?(hc(),d.child=c.child,d.flags|=128,d=null):(hc(),$=v.fallback,C=d.mode,v=Yg({mode:"visible",children:v.children},C),$=ju($,C,m,null),$.flags|=2,v.return=d,$.return=d,v.sibling=$,d.child=v,Fu(d,c.child,null,m),v=d.child,v.memoizedState=Rw(m),v.childLanes=Aw(c,D,m),d.memoizedState=_w,d=A0(null,v));else if(fc(d),h4($)){if(D=$.nextSibling&&$.nextSibling.dataset,D)var ve=D.dgst;D=ve,v=Error(r(419)),v.stack="",v.digest=D,y0({value:v,source:null,stack:null}),d=Dw(c,d,m)}else if(Jr||af(c,d,m,!1),D=(m&c.childLanes)!==0,Jr||D){if(D=ir,D!==null&&(v=G(D,m),v!==0&&v!==J.retryLane))throw J.retryLane=v,Du(c,v),yi(D,c,v),Mw;f4($)||s1(),d=Dw(c,d,m)}else f4($)?(d.flags|=192,d.child=c.child,d=null):(c=J.treeContext,pr=fo($.nextSibling),As=d,gn=!0,oc=null,co=!1,c!==null&&s8(d,c),d=Ow(d,v.children),d.flags|=4096);return d}return C?(hc(),$=v.fallback,C=d.mode,J=c.child,ve=J.sibling,v=tl(J,{mode:"hidden",children:v.children}),v.subtreeFlags=J.subtreeFlags&65011712,ve!==null?$=tl(ve,$):($=ju($,C,m,null),$.flags|=2),$.return=d,v.return=d,v.sibling=$,d.child=v,A0(null,v),v=d.child,$=c.child.memoizedState,$===null?$=Rw(m):(C=$.cachePool,C!==null?(J=Xr._currentValue,C=C.parent!==J?{parent:J,pool:J}:C):C=u8(),$={baseLanes:$.baseLanes|m,cachePool:C}),v.memoizedState=$,v.childLanes=Aw(c,D,m),d.memoizedState=_w,A0(c.child,v)):(fc(d),m=c.child,c=m.sibling,m=tl(m,{mode:"visible",children:v.children}),m.return=d,m.sibling=null,c!==null&&(D=d.deletions,D===null?(d.deletions=[c],d.flags|=16):D.push(c)),d.child=m,d.memoizedState=null,m)}function Ow(c,d){return d=Yg({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function Yg(c,d){return c=ji(22,c,null,d),c.lanes=0,c}function Dw(c,d,m){return Fu(d,c.child,null,m),c=Ow(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function CN(c,d,m){c.lanes|=d;var v=c.alternate;v!==null&&(v.lanes|=d),K2(c.return,d,m)}function jw(c,d,m,v,C,E){var D=c.memoizedState;D===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:v,tail:m,tailMode:C,treeForkCount:E}:(D.isBackwards=d,D.rendering=null,D.renderingStartTime=0,D.last=v,D.tail=m,D.tailMode=C,D.treeForkCount=E)}function kN(c,d,m){var v=d.pendingProps,C=v.revealOrder,E=v.tail;v=v.children;var D=Ur.current,$=(D&2)!==0;if($?(D=D&1|2,d.flags|=128):D&=1,X(Ur,D),Ds(c,d,v,m),v=gn?v0:0,!$&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&CN(c,m,d);else if(c.tag===19)CN(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(C){case"forwards":for(m=d.child,C=null;m!==null;)c=m.alternate,c!==null&&Lg(c)===null&&(C=m),m=m.sibling;m=C,m===null?(C=d.child,d.child=null):(C=m.sibling,m.sibling=null),jw(d,!1,C,m,E,v);break;case"backwards":case"unstable_legacy-backwards":for(m=null,C=d.child,d.child=null;C!==null;){if(c=C.alternate,c!==null&&Lg(c)===null){d.child=C;break}c=C.sibling,C.sibling=m,m=C,C=c}jw(d,!0,m,null,E,v);break;case"together":jw(d,!1,null,null,void 0,v);break;default:d.memoizedState=null}return d.child}function al(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),gc|=d.lanes,(m&d.childLanes)===0)if(c!==null){if(af(c,d,m,!1),(m&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,m=tl(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=tl(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function Iw(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&_g(c)))}function iY(c,d,m){switch(d.tag){case 3:Re(d,d.stateNode.containerInfo),lc(d,Xr,c.memoizedState.cache),Iu();break;case 27:case 5:Ze(d);break;case 4:Re(d,d.stateNode.containerInfo);break;case 10:lc(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,ow(d),null;break;case 13:var v=d.memoizedState;if(v!==null)return v.dehydrated!==null?(fc(d),d.flags|=128,null):(m&d.child.childLanes)!==0?SN(c,d,m):(fc(d),c=al(c,d,m),c!==null?c.sibling:null);fc(d);break;case 19:var C=(c.flags&128)!==0;if(v=(m&d.childLanes)!==0,v||(af(c,d,m,!1),v=(m&d.childLanes)!==0),C){if(v)return kN(c,d,m);d.flags|=128}if(C=d.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),X(Ur,Ur.current),v)break;return null;case 22:return d.lanes=0,gN(c,d,m,d.pendingProps);case 24:lc(d,Xr,c.memoizedState.cache)}return al(c,d,m)}function EN(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps)Jr=!0;else{if(!Iw(c,m)&&(d.flags&128)===0)return Jr=!1,iY(c,d,m);Jr=(c.flags&131072)!==0}else Jr=!1,gn&&(d.flags&1048576)!==0&&r8(d,v0,d.index);switch(d.lanes=0,d.tag){case 16:e:{var v=d.pendingProps;if(c=$u(d.elementType),d.type=c,typeof c=="function")B2(c)?(v=Uu(c,v),d.tag=1,d=xN(null,d,c,v,m)):(d.tag=0,d=Tw(null,d,c,v,m));else{if(c!=null){var C=c.$$typeof;if(C===R){d.tag=11,d=hN(null,d,c,v,m);break e}else if(C===I){d.tag=14,d=pN(null,d,c,v,m);break e}}throw d=le(c)||c,Error(r(306,d,""))}}return d;case 0:return Tw(c,d,d.type,d.pendingProps,m);case 1:return v=d.type,C=Uu(v,d.pendingProps),xN(c,d,v,C,m);case 3:e:{if(Re(d,d.stateNode.containerInfo),c===null)throw Error(r(387));v=d.pendingProps;var E=d.memoizedState;C=E.element,tw(c,d),N0(d,v,null,m);var D=d.memoizedState;if(v=D.cache,lc(d,Xr,v),v!==E.cache&&Y2(d,[Xr],m,!0),E0(),v=D.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:D.cache},d.updateQueue.baseState=E,d.memoizedState=E,d.flags&256){d=wN(c,d,v,m);break e}else if(v!==C){C=oo(Error(r(424)),d),y0(C),d=wN(c,d,v,m);break e}else for(c=d.stateNode.containerInfo,c.nodeType===9?c=c.body:c=c.nodeName==="HTML"?c.ownerDocument.body:c,pr=fo(c.firstChild),As=d,gn=!0,oc=null,co=!0,m=g8(d,null,v,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Iu(),v===C){d=al(c,d,m);break e}Ds(c,d,v,m)}d=d.child}return d;case 26:return Kg(c,d),c===null?(m=z9(d.type,null,d.pendingProps,null))?d.memoizedState=m:gn||(m=d.type,c=d.pendingProps,v=d1(we.current).createElement(m),v[Qe]=d,v[et]=c,js(v,m,c),Jn(v),d.stateNode=v):d.memoizedState=z9(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return Ze(d),c===null&&gn&&(v=d.stateNode=D9(d.type,d.pendingProps,we.current),As=d,co=!0,C=pr,wc(d.type)?(p4=C,pr=fo(v.firstChild)):pr=C),Ds(c,d,d.pendingProps.children,m),Kg(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&gn&&((C=v=pr)&&(v=IY(v,d.type,d.pendingProps,co),v!==null?(d.stateNode=v,As=d,pr=fo(v.firstChild),co=!1,C=!0):C=!1),C||ac(d)),Ze(d),C=d.type,E=d.pendingProps,D=c!==null?c.memoizedProps:null,v=E.children,c4(C,E)?v=null:D!==null&&c4(C,D)&&(d.flags|=32),d.memoizedState!==null&&(C=lw(c,d,ZK,null,null,m),G0._currentValue=C),Kg(c,d),Ds(c,d,v,m),d.child;case 6:return c===null&&gn&&((c=m=pr)&&(m=zY(m,d.pendingProps,co),m!==null?(d.stateNode=m,As=d,pr=null,c=!0):c=!1),c||ac(d)),null;case 13:return SN(c,d,m);case 4:return Re(d,d.stateNode.containerInfo),v=d.pendingProps,c===null?d.child=Fu(d,null,v,m):Ds(c,d,v,m),d.child;case 11:return hN(c,d,d.type,d.pendingProps,m);case 7:return Ds(c,d,d.pendingProps,m),d.child;case 8:return Ds(c,d,d.pendingProps.children,m),d.child;case 12:return Ds(c,d,d.pendingProps.children,m),d.child;case 10:return v=d.pendingProps,lc(d,d.type,v.value),Ds(c,d,v.children,m),d.child;case 9:return C=d.type._context,v=d.pendingProps.children,Lu(d),C=Os(C),v=v(C),d.flags|=1,Ds(c,d,v,m),d.child;case 14:return pN(c,d,d.type,d.pendingProps,m);case 15:return mN(c,d,d.type,d.pendingProps,m);case 19:return kN(c,d,m);case 31:return sY(c,d,m);case 22:return gN(c,d,m,d.pendingProps);case 24:return Lu(d),v=Os(Xr),c===null?(C=Q2(),C===null&&(C=ir,E=Z2(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=m),C=E),d.memoizedState={parent:v,cache:C},ew(d),lc(d,Xr,C)):((c.lanes&m)!==0&&(tw(c,d),N0(d,null,null,m),E0()),C=c.memoizedState,E=d.memoizedState,C.parent!==v?(C={parent:v,cache:v},d.memoizedState=C,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=C),lc(d,Xr,v)):(v=E.cache,lc(d,Xr,v),v!==C.cache&&Y2(d,[Xr],m,!0))),Ds(c,d,d.pendingProps.children,m),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function ll(c){c.flags|=4}function zw(c,d,m,v,C){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(C&335544128)===C)if(c.stateNode.complete)c.flags|=8192;else if(QN())c.flags|=8192;else throw Bu=Dg,J2}else c.flags&=-16777217}function NN(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!F9(d))if(QN())c.flags|=8192;else throw Bu=Dg,J2}function Zg(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?je():536870912,c.lanes|=d,yf|=d)}function O0(c,d){if(!gn)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var v=null;m!==null;)m.alternate!==null&&(v=m),m=m.sibling;v===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:v.sibling=null}}function mr(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,v=0;if(d)for(var C=c.child;C!==null;)m|=C.lanes|C.childLanes,v|=C.subtreeFlags&65011712,v|=C.flags&65011712,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)m|=C.lanes|C.childLanes,v|=C.subtreeFlags,v|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=v,c.childLanes=m,d}function oY(c,d,m){var v=d.pendingProps;switch(V2(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mr(d),null;case 1:return mr(d),null;case 3:return m=d.stateNode,v=null,c!==null&&(v=c.memoizedState.cache),d.memoizedState.cache!==v&&(d.flags|=2048),sl(Xr),Ae(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(c===null||c.child===null)&&(of(d)?ll(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,G2())),mr(d),null;case 26:var C=d.type,E=d.memoizedState;return c===null?(ll(d),E!==null?(mr(d),NN(d,E)):(mr(d),zw(d,C,null,v,m))):E?E!==c.memoizedState?(ll(d),mr(d),NN(d,E)):(mr(d),d.flags&=-16777217):(c=c.memoizedProps,c!==v&&ll(d),mr(d),zw(d,C,c,v,m)),null;case 27:if(nt(d),m=we.current,C=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(!v){if(d.stateNode===null)throw Error(r(166));return mr(d),null}c=de.current,of(d)?i8(d):(c=D9(C,v,m),d.stateNode=c,ll(d))}return mr(d),null;case 5:if(nt(d),C=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(!v){if(d.stateNode===null)throw Error(r(166));return mr(d),null}if(E=de.current,of(d))i8(d);else{var D=d1(we.current);switch(E){case 1:E=D.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:E=D.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":E=D.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":E=D.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":E=D.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof v.is=="string"?D.createElement("select",{is:v.is}):D.createElement("select"),v.multiple?E.multiple=!0:v.size&&(E.size=v.size);break;default:E=typeof v.is=="string"?D.createElement(C,{is:v.is}):D.createElement(C)}}E[Qe]=d,E[et]=v;e:for(D=d.child;D!==null;){if(D.tag===5||D.tag===6)E.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===d)break e;for(;D.sibling===null;){if(D.return===null||D.return===d)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}d.stateNode=E;e:switch(js(E,C,v),C){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ll(d)}}return mr(d),zw(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,m),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(typeof v!="string"&&d.stateNode===null)throw Error(r(166));if(c=we.current,of(d)){if(c=d.stateNode,m=d.memoizedProps,v=null,C=As,C!==null)switch(C.tag){case 27:case 5:v=C.memoizedProps}c[Qe]=d,c=!!(c.nodeValue===m||v!==null&&v.suppressHydrationWarning===!0||S9(c.nodeValue,m)),c||ac(d,!0)}else c=d1(c).createTextNode(v),c[Qe]=d,d.stateNode=c}return mr(d),null;case 31:if(m=d.memoizedState,c===null||c.memoizedState!==null){if(v=of(d),m!==null){if(c===null){if(!v)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[Qe]=d}else Iu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mr(d),c=!1}else m=G2(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=m),c=!0;if(!c)return d.flags&256?(zi(d),d):(zi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return mr(d),null;case 13:if(v=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=of(d),v!==null&&v.dehydrated!==null){if(c===null){if(!C)throw Error(r(318));if(C=d.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));C[Qe]=d}else Iu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mr(d),C=!1}else C=G2(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=C),C=!0;if(!C)return d.flags&256?(zi(d),d):(zi(d),null)}return zi(d),(d.flags&128)!==0?(d.lanes=m,d):(m=v!==null,c=c!==null&&c.memoizedState!==null,m&&(v=d.child,C=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(C=v.alternate.memoizedState.cachePool.pool),E=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(E=v.memoizedState.cachePool.pool),E!==C&&(v.flags|=2048)),m!==c&&m&&(d.child.flags|=8192),Zg(d,d.updateQueue),mr(d),null);case 4:return Ae(),c===null&&s4(d.stateNode.containerInfo),mr(d),null;case 10:return sl(d.type),mr(d),null;case 19:if(H(Ur),v=d.memoizedState,v===null)return mr(d),null;if(C=(d.flags&128)!==0,E=v.rendering,E===null)if(C)O0(v,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(E=Lg(c),E!==null){for(d.flags|=128,O0(v,!1),c=E.updateQueue,d.updateQueue=c,Zg(d,c),d.subtreeFlags=0,c=m,m=d.child;m!==null;)e8(m,c),m=m.sibling;return X(Ur,Ur.current&1|2),gn&&nl(d,v.treeForkCount),d.child}c=c.sibling}v.tail!==null&&Kt()>t1&&(d.flags|=128,C=!0,O0(v,!1),d.lanes=4194304)}else{if(!C)if(c=Lg(E),c!==null){if(d.flags|=128,C=!0,c=c.updateQueue,d.updateQueue=c,Zg(d,c),O0(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!gn)return mr(d),null}else 2*Kt()-v.renderingStartTime>t1&&m!==536870912&&(d.flags|=128,C=!0,O0(v,!1),d.lanes=4194304);v.isBackwards?(E.sibling=d.child,d.child=E):(c=v.last,c!==null?c.sibling=E:d.child=E,v.last=E)}return v.tail!==null?(c=v.tail,v.rendering=c,v.tail=c.sibling,v.renderingStartTime=Kt(),c.sibling=null,m=Ur.current,X(Ur,C?m&1|2:m&1),gn&&nl(d,v.treeForkCount),c):(mr(d),null);case 22:case 23:return zi(d),iw(),v=d.memoizedState!==null,c!==null?c.memoizedState!==null!==v&&(d.flags|=8192):v&&(d.flags|=8192),v?(m&536870912)!==0&&(d.flags&128)===0&&(mr(d),d.subtreeFlags&6&&(d.flags|=8192)):mr(d),m=d.updateQueue,m!==null&&Zg(d,m.retryQueue),m=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==m&&(d.flags|=2048),c!==null&&H(Pu),null;case 24:return m=null,c!==null&&(m=c.memoizedState.cache),d.memoizedState.cache!==m&&(d.flags|=2048),sl(Xr),mr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function aY(c,d){switch(V2(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return sl(Xr),Ae(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return nt(d),null;case 31:if(d.memoizedState!==null){if(zi(d),d.alternate===null)throw Error(r(340));Iu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(zi(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Iu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return H(Ur),null;case 4:return Ae(),null;case 10:return sl(d.type),null;case 22:case 23:return zi(d),iw(),c!==null&&H(Pu),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return sl(Xr),null;case 25:return null;default:return null}}function MN(c,d){switch(V2(d),d.tag){case 3:sl(Xr),Ae();break;case 26:case 27:case 5:nt(d);break;case 4:Ae();break;case 31:d.memoizedState!==null&&zi(d);break;case 13:zi(d);break;case 19:H(Ur);break;case 10:sl(d.type);break;case 22:case 23:zi(d),iw(),c!==null&&H(Pu);break;case 24:sl(Xr)}}function D0(c,d){try{var m=d.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var C=v.next;m=C;do{if((m.tag&c)===c){v=void 0;var E=m.create,D=m.inst;v=E(),D.destroy=v}m=m.next}while(m!==C)}}catch($){qn(d,d.return,$)}}function pc(c,d,m){try{var v=d.updateQueue,C=v!==null?v.lastEffect:null;if(C!==null){var E=C.next;v=E;do{if((v.tag&c)===c){var D=v.inst,$=D.destroy;if($!==void 0){D.destroy=void 0,C=d;var J=m,ve=$;try{ve()}catch(Ee){qn(C,J,Ee)}}}v=v.next}while(v!==E)}}catch(Ee){qn(d,d.return,Ee)}}function TN(c){var d=c.updateQueue;if(d!==null){var m=c.stateNode;try{v8(d,m)}catch(v){qn(c,c.return,v)}}}function _N(c,d,m){m.props=Uu(c.type,c.memoizedProps),m.state=c.memoizedState;try{m.componentWillUnmount()}catch(v){qn(c,d,v)}}function j0(c,d){try{var m=c.ref;if(m!==null){switch(c.tag){case 26:case 27:case 5:var v=c.stateNode;break;case 30:v=c.stateNode;break;default:v=c.stateNode}typeof m=="function"?c.refCleanup=m(v):m.current=v}}catch(C){qn(c,d,C)}}function fa(c,d){var m=c.ref,v=c.refCleanup;if(m!==null)if(typeof v=="function")try{v()}catch(C){qn(c,d,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(C){qn(c,d,C)}else m.current=null}function RN(c){var d=c.type,m=c.memoizedProps,v=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":m.autoFocus&&v.focus();break e;case"img":m.src?v.src=m.src:m.srcSet&&(v.srcset=m.srcSet)}}catch(C){qn(c,c.return,C)}}function Lw(c,d,m){try{var v=c.stateNode;_Y(v,c.type,m,d),v[et]=d}catch(C){qn(c,c.return,C)}}function AN(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&wc(c.type)||c.tag===4}function Pw(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||AN(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&wc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function $w(c,d,m){var v=c.tag;if(v===5||v===6)c=c.stateNode,d?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(c,d):(d=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,d.appendChild(c),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Ye));else if(v!==4&&(v===27&&wc(c.type)&&(m=c.stateNode,d=null),c=c.child,c!==null))for($w(c,d,m),c=c.sibling;c!==null;)$w(c,d,m),c=c.sibling}function Xg(c,d,m){var v=c.tag;if(v===5||v===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(v!==4&&(v===27&&wc(c.type)&&(m=c.stateNode),c=c.child,c!==null))for(Xg(c,d,m),c=c.sibling;c!==null;)Xg(c,d,m),c=c.sibling}function ON(c){var d=c.stateNode,m=c.memoizedProps;try{for(var v=c.type,C=d.attributes;C.length;)d.removeAttributeNode(C[0]);js(d,v,m),d[Qe]=c,d[et]=m}catch(E){qn(c,c.return,E)}}var cl=!1,es=!1,Bw=!1,DN=typeof WeakSet=="function"?WeakSet:Set,Cs=null;function lY(c,d){if(c=c.containerInfo,a4=v1,c=q7(c),D2(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var v=m.getSelection&&m.getSelection();if(v&&v.rangeCount!==0){m=v.anchorNode;var C=v.anchorOffset,E=v.focusNode;v=v.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var D=0,$=-1,J=-1,ve=0,Ee=0,_e=c,ye=null;t:for(;;){for(var Se;_e!==m||C!==0&&_e.nodeType!==3||($=D+C),_e!==E||v!==0&&_e.nodeType!==3||(J=D+v),_e.nodeType===3&&(D+=_e.nodeValue.length),(Se=_e.firstChild)!==null;)ye=_e,_e=Se;for(;;){if(_e===c)break t;if(ye===m&&++ve===C&&($=D),ye===E&&++Ee===v&&(J=D),(Se=_e.nextSibling)!==null)break;_e=ye,ye=_e.parentNode}_e=Se}m=$===-1||J===-1?null:{start:$,end:J}}else m=null}m=m||{start:0,end:0}}else m=null;for(l4={focusedElem:c,selectionRange:m},v1=!1,Cs=d;Cs!==null;)if(d=Cs,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Cs=c;else for(;Cs!==null;){switch(d=Cs,E=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(m=0;m<c.length;m++)C=c[m],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&E!==null){c=void 0,m=d,C=E.memoizedProps,E=E.memoizedState,v=m.stateNode;try{var ft=Uu(m.type,C);c=v.getSnapshotBeforeUpdate(ft,E),v.__reactInternalSnapshotBeforeUpdate=c}catch(It){qn(m,m.return,It)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,m=c.nodeType,m===9)d4(c);else if(m===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":d4(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,Cs=c;break}Cs=d.return}}function jN(c,d,m){var v=m.flags;switch(m.tag){case 0:case 11:case 15:dl(c,m),v&4&&D0(5,m);break;case 1:if(dl(c,m),v&4)if(c=m.stateNode,d===null)try{c.componentDidMount()}catch(D){qn(m,m.return,D)}else{var C=Uu(m.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(C,d,c.__reactInternalSnapshotBeforeUpdate)}catch(D){qn(m,m.return,D)}}v&64&&TN(m),v&512&&j0(m,m.return);break;case 3:if(dl(c,m),v&64&&(c=m.updateQueue,c!==null)){if(d=null,m.child!==null)switch(m.child.tag){case 27:case 5:d=m.child.stateNode;break;case 1:d=m.child.stateNode}try{v8(c,d)}catch(D){qn(m,m.return,D)}}break;case 27:d===null&&v&4&&ON(m);case 26:case 5:dl(c,m),d===null&&v&4&&RN(m),v&512&&j0(m,m.return);break;case 12:dl(c,m);break;case 31:dl(c,m),v&4&&LN(c,m);break;case 13:dl(c,m),v&4&&PN(c,m),v&64&&(c=m.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(m=bY.bind(null,m),LY(c,m))));break;case 22:if(v=m.memoizedState!==null||cl,!v){d=d!==null&&d.memoizedState!==null||es,C=cl;var E=es;cl=v,(es=d)&&!E?fl(c,m,(m.subtreeFlags&8772)!==0):dl(c,m),cl=C,es=E}break;case 30:break;default:dl(c,m)}}function IN(c){var d=c.alternate;d!==null&&(c.alternate=null,IN(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Hn(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var vr=null,mi=!1;function ul(c,d,m){for(m=m.child;m!==null;)zN(c,d,m),m=m.sibling}function zN(c,d,m){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Ar,m)}catch{}switch(m.tag){case 26:es||fa(m,d),ul(c,d,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:es||fa(m,d);var v=vr,C=mi;wc(m.type)&&(vr=m.stateNode,mi=!1),ul(c,d,m),U0(m.stateNode),vr=v,mi=C;break;case 5:es||fa(m,d);case 6:if(v=vr,C=mi,vr=null,ul(c,d,m),vr=v,mi=C,vr!==null)if(mi)try{(vr.nodeType===9?vr.body:vr.nodeName==="HTML"?vr.ownerDocument.body:vr).removeChild(m.stateNode)}catch(E){qn(m,d,E)}else try{vr.removeChild(m.stateNode)}catch(E){qn(m,d,E)}break;case 18:vr!==null&&(mi?(c=vr,T9(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,m.stateNode),Mf(c)):T9(vr,m.stateNode));break;case 4:v=vr,C=mi,vr=m.stateNode.containerInfo,mi=!0,ul(c,d,m),vr=v,mi=C;break;case 0:case 11:case 14:case 15:pc(2,m,d),es||pc(4,m,d),ul(c,d,m);break;case 1:es||(fa(m,d),v=m.stateNode,typeof v.componentWillUnmount=="function"&&_N(m,d,v)),ul(c,d,m);break;case 21:ul(c,d,m);break;case 22:es=(v=es)||m.memoizedState!==null,ul(c,d,m),es=v;break;default:ul(c,d,m)}}function LN(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Mf(c)}catch(m){qn(d,d.return,m)}}}function PN(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Mf(c)}catch(m){qn(d,d.return,m)}}function cY(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new DN),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new DN),d;default:throw Error(r(435,c.tag))}}function Qg(c,d){var m=cY(c);d.forEach(function(v){if(!m.has(v)){m.add(v);var C=vY.bind(null,c,v);v.then(C,C)}})}function gi(c,d){var m=d.deletions;if(m!==null)for(var v=0;v<m.length;v++){var C=m[v],E=c,D=d,$=D;e:for(;$!==null;){switch($.tag){case 27:if(wc($.type)){vr=$.stateNode,mi=!1;break e}break;case 5:vr=$.stateNode,mi=!1;break e;case 3:case 4:vr=$.stateNode.containerInfo,mi=!0;break e}$=$.return}if(vr===null)throw Error(r(160));zN(E,D,C),vr=null,mi=!1,E=C.alternate,E!==null&&(E.return=null),C.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)$N(d,c),d=d.sibling}var $o=null;function $N(c,d){var m=c.alternate,v=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:gi(d,c),bi(c),v&4&&(pc(3,c,c.return),D0(3,c),pc(5,c,c.return));break;case 1:gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),v&64&&cl&&(c=c.updateQueue,c!==null&&(v=c.callbacks,v!==null&&(m=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=m===null?v:m.concat(v))));break;case 26:var C=$o;if(gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),v&4){var E=m!==null?m.memoizedState:null;if(v=c.memoizedState,m===null)if(v===null)if(c.stateNode===null){e:{v=c.type,m=c.memoizedProps,C=C.ownerDocument||C;t:switch(v){case"title":E=C.getElementsByTagName("title")[0],(!E||E[en]||E[Qe]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=C.createElement(v),C.head.insertBefore(E,C.querySelector("head > title"))),js(E,v,m),E[Qe]=c,Jn(E),v=E;break e;case"link":var D=$9("link","href",C).get(v+(m.href||""));if(D){for(var $=0;$<D.length;$++)if(E=D[$],E.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&E.getAttribute("rel")===(m.rel==null?null:m.rel)&&E.getAttribute("title")===(m.title==null?null:m.title)&&E.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){D.splice($,1);break t}}E=C.createElement(v),js(E,v,m),C.head.appendChild(E);break;case"meta":if(D=$9("meta","content",C).get(v+(m.content||""))){for($=0;$<D.length;$++)if(E=D[$],E.getAttribute("content")===(m.content==null?null:""+m.content)&&E.getAttribute("name")===(m.name==null?null:m.name)&&E.getAttribute("property")===(m.property==null?null:m.property)&&E.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&E.getAttribute("charset")===(m.charSet==null?null:m.charSet)){D.splice($,1);break t}}E=C.createElement(v),js(E,v,m),C.head.appendChild(E);break;default:throw Error(r(468,v))}E[Qe]=c,Jn(E),v=E}c.stateNode=v}else B9(C,c.type,c.stateNode);else c.stateNode=P9(C,v,c.memoizedProps);else E!==v?(E===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):E.count--,v===null?B9(C,c.type,c.stateNode):P9(C,v,c.memoizedProps)):v===null&&c.stateNode!==null&&Lw(c,c.memoizedProps,m.memoizedProps)}break;case 27:gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),m!==null&&v&4&&Lw(c,c.memoizedProps,m.memoizedProps);break;case 5:if(gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),c.flags&32){C=c.stateNode;try{Pt(C,"")}catch(ft){qn(c,c.return,ft)}}v&4&&c.stateNode!=null&&(C=c.memoizedProps,Lw(c,C,m!==null?m.memoizedProps:C)),v&1024&&(Bw=!0);break;case 6:if(gi(d,c),bi(c),v&4){if(c.stateNode===null)throw Error(r(162));v=c.memoizedProps,m=c.stateNode;try{m.nodeValue=v}catch(ft){qn(c,c.return,ft)}}break;case 3:if(p1=null,C=$o,$o=f1(d.containerInfo),gi(d,c),$o=C,bi(c),v&4&&m!==null&&m.memoizedState.isDehydrated)try{Mf(d.containerInfo)}catch(ft){qn(c,c.return,ft)}Bw&&(Bw=!1,BN(c));break;case 4:v=$o,$o=f1(c.stateNode.containerInfo),gi(d,c),bi(c),$o=v;break;case 12:gi(d,c),bi(c);break;case 31:gi(d,c),bi(c),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 13:gi(d,c),bi(c),c.child.flags&8192&&c.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(e1=Kt()),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 22:C=c.memoizedState!==null;var J=m!==null&&m.memoizedState!==null,ve=cl,Ee=es;if(cl=ve||C,es=Ee||J,gi(d,c),es=Ee,cl=ve,bi(c),v&8192)e:for(d=c.stateNode,d._visibility=C?d._visibility&-2:d._visibility|1,C&&(m===null||J||cl||es||Vu(c)),m=null,d=c;;){if(d.tag===5||d.tag===26){if(m===null){J=m=d;try{if(E=J.stateNode,C)D=E.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{$=J.stateNode;var _e=J.memoizedProps.style,ye=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;$.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(ft){qn(J,J.return,ft)}}}else if(d.tag===6){if(m===null){J=d;try{J.stateNode.nodeValue=C?"":J.memoizedProps}catch(ft){qn(J,J.return,ft)}}}else if(d.tag===18){if(m===null){J=d;try{var Se=J.stateNode;C?_9(Se,!0):_9(J.stateNode,!1)}catch(ft){qn(J,J.return,ft)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}v&4&&(v=c.updateQueue,v!==null&&(m=v.retryQueue,m!==null&&(v.retryQueue=null,Qg(c,m))));break;case 19:gi(d,c),bi(c),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 30:break;case 21:break;default:gi(d,c),bi(c)}}function bi(c){var d=c.flags;if(d&2){try{for(var m,v=c.return;v!==null;){if(AN(v)){m=v;break}v=v.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var C=m.stateNode,E=Pw(c);Xg(c,E,C);break;case 5:var D=m.stateNode;m.flags&32&&(Pt(D,""),m.flags&=-33);var $=Pw(c);Xg(c,$,D);break;case 3:case 4:var J=m.stateNode.containerInfo,ve=Pw(c);$w(c,ve,J);break;default:throw Error(r(161))}}catch(Ee){qn(c,c.return,Ee)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function BN(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;BN(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function dl(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)jN(c,d.alternate,d),d=d.sibling}function Vu(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:pc(4,d,d.return),Vu(d);break;case 1:fa(d,d.return);var m=d.stateNode;typeof m.componentWillUnmount=="function"&&_N(d,d.return,m),Vu(d);break;case 27:U0(d.stateNode);case 26:case 5:fa(d,d.return),Vu(d);break;case 22:d.memoizedState===null&&Vu(d);break;case 30:Vu(d);break;default:Vu(d)}c=c.sibling}}function fl(c,d,m){for(m=m&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var v=d.alternate,C=c,E=d,D=E.flags;switch(E.tag){case 0:case 11:case 15:fl(C,E,m),D0(4,E);break;case 1:if(fl(C,E,m),v=E,C=v.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(ve){qn(v,v.return,ve)}if(v=E,C=v.updateQueue,C!==null){var $=v.stateNode;try{var J=C.shared.hiddenCallbacks;if(J!==null)for(C.shared.hiddenCallbacks=null,C=0;C<J.length;C++)b8(J[C],$)}catch(ve){qn(v,v.return,ve)}}m&&D&64&&TN(E),j0(E,E.return);break;case 27:ON(E);case 26:case 5:fl(C,E,m),m&&v===null&&D&4&&RN(E),j0(E,E.return);break;case 12:fl(C,E,m);break;case 31:fl(C,E,m),m&&D&4&&LN(C,E);break;case 13:fl(C,E,m),m&&D&4&&PN(C,E);break;case 22:E.memoizedState===null&&fl(C,E,m),j0(E,E.return);break;case 30:break;default:fl(C,E,m)}d=d.sibling}}function Fw(c,d){var m=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==m&&(c!=null&&c.refCount++,m!=null&&x0(m))}function Hw(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&x0(c))}function Bo(c,d,m,v){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)FN(c,d,m,v),d=d.sibling}function FN(c,d,m,v){var C=d.flags;switch(d.tag){case 0:case 11:case 15:Bo(c,d,m,v),C&2048&&D0(9,d);break;case 1:Bo(c,d,m,v);break;case 3:Bo(c,d,m,v),C&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&x0(c)));break;case 12:if(C&2048){Bo(c,d,m,v),c=d.stateNode;try{var E=d.memoizedProps,D=E.id,$=E.onPostCommit;typeof $=="function"&&$(D,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(J){qn(d,d.return,J)}}else Bo(c,d,m,v);break;case 31:Bo(c,d,m,v);break;case 13:Bo(c,d,m,v);break;case 23:break;case 22:E=d.stateNode,D=d.alternate,d.memoizedState!==null?E._visibility&2?Bo(c,d,m,v):I0(c,d):E._visibility&2?Bo(c,d,m,v):(E._visibility|=2,gf(c,d,m,v,(d.subtreeFlags&10256)!==0||!1)),C&2048&&Fw(D,d);break;case 24:Bo(c,d,m,v),C&2048&&Hw(d.alternate,d);break;default:Bo(c,d,m,v)}}function gf(c,d,m,v,C){for(C=C&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var E=c,D=d,$=m,J=v,ve=D.flags;switch(D.tag){case 0:case 11:case 15:gf(E,D,$,J,C),D0(8,D);break;case 23:break;case 22:var Ee=D.stateNode;D.memoizedState!==null?Ee._visibility&2?gf(E,D,$,J,C):I0(E,D):(Ee._visibility|=2,gf(E,D,$,J,C)),C&&ve&2048&&Fw(D.alternate,D);break;case 24:gf(E,D,$,J,C),C&&ve&2048&&Hw(D.alternate,D);break;default:gf(E,D,$,J,C)}d=d.sibling}}function I0(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var m=c,v=d,C=v.flags;switch(v.tag){case 22:I0(m,v),C&2048&&Fw(v.alternate,v);break;case 24:I0(m,v),C&2048&&Hw(v.alternate,v);break;default:I0(m,v)}d=d.sibling}}var z0=8192;function bf(c,d,m){if(c.subtreeFlags&z0)for(c=c.child;c!==null;)HN(c,d,m),c=c.sibling}function HN(c,d,m){switch(c.tag){case 26:bf(c,d,m),c.flags&z0&&c.memoizedState!==null&&YY(m,$o,c.memoizedState,c.memoizedProps);break;case 5:bf(c,d,m);break;case 3:case 4:var v=$o;$o=f1(c.stateNode.containerInfo),bf(c,d,m),$o=v;break;case 22:c.memoizedState===null&&(v=c.alternate,v!==null&&v.memoizedState!==null?(v=z0,z0=16777216,bf(c,d,m),z0=v):bf(c,d,m));break;default:bf(c,d,m)}}function UN(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function L0(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];Cs=v,qN(v,c)}UN(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)VN(c),c=c.sibling}function VN(c){switch(c.tag){case 0:case 11:case 15:L0(c),c.flags&2048&&pc(9,c,c.return);break;case 3:L0(c);break;case 12:L0(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,Jg(c)):L0(c);break;default:L0(c)}}function Jg(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];Cs=v,qN(v,c)}UN(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:pc(8,d,d.return),Jg(d);break;case 22:m=d.stateNode,m._visibility&2&&(m._visibility&=-3,Jg(d));break;default:Jg(d)}c=c.sibling}}function qN(c,d){for(;Cs!==null;){var m=Cs;switch(m.tag){case 0:case 11:case 15:pc(8,m,d);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var v=m.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:x0(m.memoizedState.cache)}if(v=m.child,v!==null)v.return=m,Cs=v;else e:for(m=c;Cs!==null;){v=Cs;var C=v.sibling,E=v.return;if(IN(v),v===m){Cs=null;break e}if(C!==null){C.return=E,Cs=C;break e}Cs=E}}}var uY={getCacheForType:function(c){var d=Os(Xr),m=d.data.get(c);return m===void 0&&(m=c(),d.data.set(c,m)),m},cacheSignal:function(){return Os(Xr).controller.signal}},dY=typeof WeakMap=="function"?WeakMap:Map,Rn=0,ir=null,ln=null,fn=0,Vn=0,Li=null,mc=!1,vf=!1,Uw=!1,hl=0,Ir=0,gc=0,qu=0,Vw=0,Pi=0,yf=0,P0=null,vi=null,qw=!1,e1=0,GN=0,t1=1/0,n1=null,bc=null,us=0,vc=null,xf=null,pl=0,Gw=0,Ww=null,WN=null,$0=0,Kw=null;function $i(){return(Rn&2)!==0&&fn!==0?fn&-fn:F.T!==null?e4():ze()}function KN(){if(Pi===0)if((fn&536870912)===0||gn){var c=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Pi=c}else Pi=536870912;return c=Ii.current,c!==null&&(c.flags|=32),Pi}function yi(c,d,m){(c===ir&&(Vn===2||Vn===9)||c.cancelPendingCommit!==null)&&(wf(c,0),yc(c,fn,Pi,!1)),lt(c,m),((Rn&2)===0||c!==ir)&&(c===ir&&((Rn&2)===0&&(qu|=m),Ir===4&&yc(c,fn,Pi,!1)),ha(c))}function YN(c,d,m){if((Rn&6)!==0)throw Error(r(327));var v=!m&&(d&127)===0&&(d&c.expiredLanes)===0||Q(c,d),C=v?pY(c,d):Zw(c,d,!0),E=v;do{if(C===0){vf&&!v&&yc(c,d,0,!1);break}else{if(m=c.current.alternate,E&&!fY(m)){C=Zw(c,d,!1),E=!1;continue}if(C===2){if(E=d,c.errorRecoveryDisabledLanes&E)var D=0;else D=c.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){d=D;e:{var $=c;C=P0;var J=$.current.memoizedState.isDehydrated;if(J&&(wf($,D).flags|=256),D=Zw($,D,!1),D!==2){if(Uw&&!J){$.errorRecoveryDisabledLanes|=E,qu|=E,C=4;break e}E=vi,vi=C,E!==null&&(vi===null?vi=E:vi.push.apply(vi,E))}C=D}if(E=!1,C!==2)continue}}if(C===1){wf(c,0),yc(c,d,0,!0);break}e:{switch(v=c,E=C,E){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:yc(v,d,Pi,!mc);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(C=e1+300-Kt(),10<C)){if(yc(v,d,Pi,!mc),U(v,0,!0)!==0)break e;pl=d,v.timeoutHandle=N9(ZN.bind(null,v,m,vi,n1,qw,d,Pi,qu,yf,mc,E,"Throttled",-0,0),C);break e}ZN(v,m,vi,n1,qw,d,Pi,qu,yf,mc,E,null,-0,0)}}break}while(!0);ha(c)}function ZN(c,d,m,v,C,E,D,$,J,ve,Ee,_e,ye,Se){if(c.timeoutHandle=-1,_e=d.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ye},HN(d,E,_e);var ft=(E&62914560)===E?e1-Kt():(E&4194048)===E?GN-Kt():0;if(ft=ZY(_e,ft),ft!==null){pl=E,c.cancelPendingCommit=ft(s9.bind(null,c,d,E,m,v,C,D,$,J,Ee,_e,null,ye,Se)),yc(c,E,D,!ve);return}}s9(c,d,E,m,v,C,D,$,J)}function fY(c){for(var d=c;;){var m=d.tag;if((m===0||m===11||m===15)&&d.flags&16384&&(m=d.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var v=0;v<m.length;v++){var C=m[v],E=C.getSnapshot;C=C.value;try{if(!Di(E(),C))return!1}catch{return!1}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function yc(c,d,m,v){d&=~Vw,d&=~qu,c.suspendedLanes|=d,c.pingedLanes&=~d,v&&(c.warmLanes|=d),v=c.expirationTimes;for(var C=d;0<C;){var E=31-_t(C),D=1<<E;v[E]=-1,C&=~D}m!==0&&Xe(c,m,d)}function r1(){return(Rn&6)===0?(B0(0),!1):!0}function Yw(){if(ln!==null){if(Vn===0)var c=ln.return;else c=ln,rl=zu=null,dw(c),df=null,S0=0,c=ln;for(;c!==null;)MN(c.alternate,c),c=c.return;ln=null}}function wf(c,d){var m=c.timeoutHandle;m!==-1&&(c.timeoutHandle=-1,OY(m)),m=c.cancelPendingCommit,m!==null&&(c.cancelPendingCommit=null,m()),pl=0,Yw(),ir=c,ln=m=tl(c.current,null),fn=d,Vn=0,Li=null,mc=!1,vf=Q(c,d),Uw=!1,yf=Pi=Vw=qu=gc=Ir=0,vi=P0=null,qw=!1,(d&8)!==0&&(d|=d&32);var v=c.entangledLanes;if(v!==0)for(c=c.entanglements,v&=d;0<v;){var C=31-_t(v),E=1<<C;d|=c[C],v&=~E}return hl=d,kg(),m}function XN(c,d){Yt=null,F.H=R0,d===uf||d===Og?(d=h8(),Vn=3):d===J2?(d=h8(),Vn=4):Vn=d===Mw?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Li=d,ln===null&&(Ir=1,Gg(c,oo(d,c.current)))}function QN(){var c=Ii.current;return c===null?!0:(fn&4194048)===fn?uo===null:(fn&62914560)===fn||(fn&536870912)!==0?c===uo:!1}function JN(){var c=F.H;return F.H=R0,c===null?R0:c}function e9(){var c=F.A;return F.A=uY,c}function s1(){Ir=4,mc||(fn&4194048)!==fn&&Ii.current!==null||(vf=!0),(gc&134217727)===0&&(qu&134217727)===0||ir===null||yc(ir,fn,Pi,!1)}function Zw(c,d,m){var v=Rn;Rn|=2;var C=JN(),E=e9();(ir!==c||fn!==d)&&(n1=null,wf(c,d)),d=!1;var D=Ir;e:do try{if(Vn!==0&&ln!==null){var $=ln,J=Li;switch(Vn){case 8:Yw(),D=6;break e;case 3:case 2:case 9:case 6:Ii.current===null&&(d=!0);var ve=Vn;if(Vn=0,Li=null,Sf(c,$,J,ve),m&&vf){D=0;break e}break;default:ve=Vn,Vn=0,Li=null,Sf(c,$,J,ve)}}hY(),D=Ir;break}catch(Ee){XN(c,Ee)}while(!0);return d&&c.shellSuspendCounter++,rl=zu=null,Rn=v,F.H=C,F.A=E,ln===null&&(ir=null,fn=0,kg()),D}function hY(){for(;ln!==null;)t9(ln)}function pY(c,d){var m=Rn;Rn|=2;var v=JN(),C=e9();ir!==c||fn!==d?(n1=null,t1=Kt()+500,wf(c,d)):vf=Q(c,d);e:do try{if(Vn!==0&&ln!==null){d=ln;var E=Li;t:switch(Vn){case 1:Vn=0,Li=null,Sf(c,d,E,1);break;case 2:case 9:if(d8(E)){Vn=0,Li=null,n9(d);break}d=function(){Vn!==2&&Vn!==9||ir!==c||(Vn=7),ha(c)},E.then(d,d);break e;case 3:Vn=7;break e;case 4:Vn=5;break e;case 7:d8(E)?(Vn=0,Li=null,n9(d)):(Vn=0,Li=null,Sf(c,d,E,7));break;case 5:var D=null;switch(ln.tag){case 26:D=ln.memoizedState;case 5:case 27:var $=ln;if(D?F9(D):$.stateNode.complete){Vn=0,Li=null;var J=$.sibling;if(J!==null)ln=J;else{var ve=$.return;ve!==null?(ln=ve,i1(ve)):ln=null}break t}}Vn=0,Li=null,Sf(c,d,E,5);break;case 6:Vn=0,Li=null,Sf(c,d,E,6);break;case 8:Yw(),Ir=6;break e;default:throw Error(r(462))}}mY();break}catch(Ee){XN(c,Ee)}while(!0);return rl=zu=null,F.H=v,F.A=C,Rn=m,ln!==null?0:(ir=null,fn=0,kg(),Ir)}function mY(){for(;ln!==null&&!Nn();)t9(ln)}function t9(c){var d=EN(c.alternate,c,hl);c.memoizedProps=c.pendingProps,d===null?i1(c):ln=d}function n9(c){var d=c,m=d.alternate;switch(d.tag){case 15:case 0:d=yN(m,d,d.pendingProps,d.type,void 0,fn);break;case 11:d=yN(m,d,d.pendingProps,d.type.render,d.ref,fn);break;case 5:dw(d);default:MN(m,d),d=ln=e8(d,hl),d=EN(m,d,hl)}c.memoizedProps=c.pendingProps,d===null?i1(c):ln=d}function Sf(c,d,m,v){rl=zu=null,dw(d),df=null,S0=0;var C=d.return;try{if(rY(c,C,d,m,fn)){Ir=1,Gg(c,oo(m,c.current)),ln=null;return}}catch(E){if(C!==null)throw ln=C,E;Ir=1,Gg(c,oo(m,c.current)),ln=null;return}d.flags&32768?(gn||v===1?c=!0:vf||(fn&536870912)!==0?c=!1:(mc=c=!0,(v===2||v===9||v===3||v===6)&&(v=Ii.current,v!==null&&v.tag===13&&(v.flags|=16384))),r9(d,c)):i1(d)}function i1(c){var d=c;do{if((d.flags&32768)!==0){r9(d,mc);return}c=d.return;var m=oY(d.alternate,d,hl);if(m!==null){ln=m;return}if(d=d.sibling,d!==null){ln=d;return}ln=d=c}while(d!==null);Ir===0&&(Ir=5)}function r9(c,d){do{var m=aY(c.alternate,c);if(m!==null){m.flags&=32767,ln=m;return}if(m=c.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!d&&(c=c.sibling,c!==null)){ln=c;return}ln=c=m}while(c!==null);Ir=6,ln=null}function s9(c,d,m,v,C,E,D,$,J){c.cancelPendingCommit=null;do o1();while(us!==0);if((Rn&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(E=d.lanes|d.childLanes,E|=P2,Ke(c,m,E,D,$,J),c===ir&&(ln=ir=null,fn=0),xf=d,vc=c,pl=m,Gw=E,Ww=C,WN=v,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,yY(Bn,function(){return c9(),null})):(c.callbackNode=null,c.callbackPriority=0),v=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||v){v=F.T,F.T=null,C=te.p,te.p=2,D=Rn,Rn|=4;try{lY(c,d,m)}finally{Rn=D,te.p=C,F.T=v}}us=1,i9(),o9(),a9()}}function i9(){if(us===1){us=0;var c=vc,d=xf,m=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||m){m=F.T,F.T=null;var v=te.p;te.p=2;var C=Rn;Rn|=4;try{$N(d,c);var E=l4,D=q7(c.containerInfo),$=E.focusedElem,J=E.selectionRange;if(D!==$&&$&&$.ownerDocument&&V7($.ownerDocument.documentElement,$)){if(J!==null&&D2($)){var ve=J.start,Ee=J.end;if(Ee===void 0&&(Ee=ve),"selectionStart"in $)$.selectionStart=ve,$.selectionEnd=Math.min(Ee,$.value.length);else{var _e=$.ownerDocument||document,ye=_e&&_e.defaultView||window;if(ye.getSelection){var Se=ye.getSelection(),ft=$.textContent.length,It=Math.min(J.start,ft),nr=J.end===void 0?It:Math.min(J.end,ft);!Se.extend&&It>nr&&(D=nr,nr=It,It=D);var he=U7($,It),ae=U7($,nr);if(he&&ae&&(Se.rangeCount!==1||Se.anchorNode!==he.node||Se.anchorOffset!==he.offset||Se.focusNode!==ae.node||Se.focusOffset!==ae.offset)){var be=_e.createRange();be.setStart(he.node,he.offset),Se.removeAllRanges(),It>nr?(Se.addRange(be),Se.extend(ae.node,ae.offset)):(be.setEnd(ae.node,ae.offset),Se.addRange(be))}}}}for(_e=[],Se=$;Se=Se.parentNode;)Se.nodeType===1&&_e.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<_e.length;$++){var Te=_e[$];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}v1=!!a4,l4=a4=null}finally{Rn=C,te.p=v,F.T=m}}c.current=d,us=2}}function o9(){if(us===2){us=0;var c=vc,d=xf,m=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||m){m=F.T,F.T=null;var v=te.p;te.p=2;var C=Rn;Rn|=4;try{jN(c,d.alternate,d)}finally{Rn=C,te.p=v,F.T=m}}us=3}}function a9(){if(us===4||us===3){us=0,Pn();var c=vc,d=xf,m=pl,v=WN;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?us=5:(us=0,xf=vc=null,l9(c,c.pendingLanes));var C=c.pendingLanes;if(C===0&&(bc=null),me(m),d=d.stateNode,Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Ar,d,void 0,(d.current.flags&128)===128)}catch{}if(v!==null){d=F.T,C=te.p,te.p=2,F.T=null;try{for(var E=c.onRecoverableError,D=0;D<v.length;D++){var $=v[D];E($.value,{componentStack:$.stack})}}finally{F.T=d,te.p=C}}(pl&3)!==0&&o1(),ha(c),C=c.pendingLanes,(m&261930)!==0&&(C&42)!==0?c===Kw?$0++:($0=0,Kw=c):$0=0,B0(0)}}function l9(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,x0(d)))}function o1(){return i9(),o9(),a9(),c9()}function c9(){if(us!==5)return!1;var c=vc,d=Gw;Gw=0;var m=me(pl),v=F.T,C=te.p;try{te.p=32>m?32:m,F.T=null,m=Ww,Ww=null;var E=vc,D=pl;if(us=0,xf=vc=null,pl=0,(Rn&6)!==0)throw Error(r(331));var $=Rn;if(Rn|=4,VN(E.current),FN(E,E.current,D,m),Rn=$,B0(0,!1),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Ar,E)}catch{}return!0}finally{te.p=C,F.T=v,l9(c,d)}}function u9(c,d,m){d=oo(m,d),d=Nw(c.stateNode,d,2),c=dc(c,d,2),c!==null&&(lt(c,2),ha(c))}function qn(c,d,m){if(c.tag===3)u9(c,c,m);else for(;d!==null;){if(d.tag===3){u9(d,c,m);break}else if(d.tag===1){var v=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(bc===null||!bc.has(v))){c=oo(m,c),m=dN(2),v=dc(d,m,2),v!==null&&(fN(m,v,d,c),lt(v,2),ha(v));break}}d=d.return}}function Xw(c,d,m){var v=c.pingCache;if(v===null){v=c.pingCache=new dY;var C=new Set;v.set(d,C)}else C=v.get(d),C===void 0&&(C=new Set,v.set(d,C));C.has(m)||(Uw=!0,C.add(m),c=gY.bind(null,c,d,m),d.then(c,c))}function gY(c,d,m){var v=c.pingCache;v!==null&&v.delete(d),c.pingedLanes|=c.suspendedLanes&m,c.warmLanes&=~m,ir===c&&(fn&m)===m&&(Ir===4||Ir===3&&(fn&62914560)===fn&&300>Kt()-e1?(Rn&2)===0&&wf(c,0):Vw|=m,yf===fn&&(yf=0)),ha(c)}function d9(c,d){d===0&&(d=je()),c=Du(c,d),c!==null&&(lt(c,d),ha(c))}function bY(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),d9(c,m)}function vY(c,d){var m=0;switch(c.tag){case 31:case 13:var v=c.stateNode,C=c.memoizedState;C!==null&&(m=C.retryLane);break;case 19:v=c.stateNode;break;case 22:v=c.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(d),d9(c,m)}function yY(c,d){return Xn(c,d)}var a1=null,Cf=null,Qw=!1,l1=!1,Jw=!1,xc=0;function ha(c){c!==Cf&&c.next===null&&(Cf===null?a1=Cf=c:Cf=Cf.next=c),l1=!0,Qw||(Qw=!0,wY())}function B0(c,d){if(!Jw&&l1){Jw=!0;do for(var m=!1,v=a1;v!==null;){if(c!==0){var C=v.pendingLanes;if(C===0)var E=0;else{var D=v.suspendedLanes,$=v.pingedLanes;E=(1<<31-_t(42|c)+1)-1,E&=C&~(D&~$),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(m=!0,m9(v,E))}else E=fn,E=U(v,v===ir?E:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(E&3)===0||Q(v,E)||(m=!0,m9(v,E));v=v.next}while(m);Jw=!1}}function xY(){f9()}function f9(){l1=Qw=!1;var c=0;xc!==0&&AY()&&(c=xc);for(var d=Kt(),m=null,v=a1;v!==null;){var C=v.next,E=h9(v,d);E===0?(v.next=null,m===null?a1=C:m.next=C,C===null&&(Cf=m)):(m=v,(c!==0||(E&3)!==0)&&(l1=!0)),v=C}us!==0&&us!==5||B0(c),xc!==0&&(xc=0)}function h9(c,d){for(var m=c.suspendedLanes,v=c.pingedLanes,C=c.expirationTimes,E=c.pendingLanes&-62914561;0<E;){var D=31-_t(E),$=1<<D,J=C[D];J===-1?(($&m)===0||($&v)!==0)&&(C[D]=ge($,d)):J<=d&&(c.expiredLanes|=$),E&=~$}if(d=ir,m=fn,m=U(c,c===d?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),v=c.callbackNode,m===0||c===d&&(Vn===2||Vn===9)||c.cancelPendingCommit!==null)return v!==null&&v!==null&&sr(v),c.callbackNode=null,c.callbackPriority=0;if((m&3)===0||Q(c,m)){if(d=m&-m,d===c.callbackPriority)return d;switch(v!==null&&sr(v),me(m)){case 2:case 8:m=$n;break;case 32:m=Bn;break;case 268435456:m=Fn;break;default:m=Bn}return v=p9.bind(null,c),m=Xn(m,v),c.callbackPriority=d,c.callbackNode=m,d}return v!==null&&v!==null&&sr(v),c.callbackPriority=2,c.callbackNode=null,2}function p9(c,d){if(us!==0&&us!==5)return c.callbackNode=null,c.callbackPriority=0,null;var m=c.callbackNode;if(o1()&&c.callbackNode!==m)return null;var v=fn;return v=U(c,c===ir?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),v===0?null:(YN(c,v,d),h9(c,Kt()),c.callbackNode!=null&&c.callbackNode===m?p9.bind(null,c):null)}function m9(c,d){if(o1())return null;YN(c,d,!0)}function wY(){DY(function(){(Rn&6)!==0?Xn(Nt,xY):f9()})}function e4(){if(xc===0){var c=lf;c===0&&(c=ke,ke<<=1,(ke&261888)===0&&(ke=256)),xc=c}return xc}function g9(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:rc(""+c)}function b9(c,d){var m=d.ownerDocument.createElement("input");return m.name=d.name,m.value=d.value,c.id&&m.setAttribute("form",c.id),d.parentNode.insertBefore(m,d),c=new FormData(c),m.parentNode.removeChild(m),c}function SY(c,d,m,v,C){if(d==="submit"&&m&&m.stateNode===C){var E=g9((C[et]||null).action),D=v.submitter;D&&(d=(d=D[et]||null)?g9(d.formAction):D.getAttribute("formAction"),d!==null&&(E=d,D=null));var $=new xg("action","action",null,v,C);c.push({event:$,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(xc!==0){var J=D?b9(C,D):new FormData(C);xw(m,{pending:!0,data:J,method:C.method,action:E},null,J)}}else typeof E=="function"&&($.preventDefault(),J=D?b9(C,D):new FormData(C),xw(m,{pending:!0,data:J,method:C.method,action:E},E,J))},currentTarget:C}]})}}for(var t4=0;t4<L2.length;t4++){var n4=L2[t4],CY=n4.toLowerCase(),kY=n4[0].toUpperCase()+n4.slice(1);Po(CY,"on"+kY)}Po(K7,"onAnimationEnd"),Po(Y7,"onAnimationIteration"),Po(Z7,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(BK,"onTransitionRun"),Po(FK,"onTransitionStart"),Po(HK,"onTransitionCancel"),Po(X7,"onTransitionEnd"),Pe("onMouseEnter",["mouseout","mouseover"]),Pe("onMouseLeave",["mouseout","mouseover"]),Pe("onPointerEnter",["pointerout","pointerover"]),Pe("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var F0="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),EY=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(F0));function v9(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var v=c[m],C=v.event;v=v.listeners;e:{var E=void 0;if(d)for(var D=v.length-1;0<=D;D--){var $=v[D],J=$.instance,ve=$.currentTarget;if($=$.listener,J!==E&&C.isPropagationStopped())break e;E=$,C.currentTarget=ve;try{E(C)}catch(Ee){Cg(Ee)}C.currentTarget=null,E=J}else for(D=0;D<v.length;D++){if($=v[D],J=$.instance,ve=$.currentTarget,$=$.listener,J!==E&&C.isPropagationStopped())break e;E=$,C.currentTarget=ve;try{E(C)}catch(Ee){Cg(Ee)}C.currentTarget=null,E=J}}}}function cn(c,d){var m=d[it];m===void 0&&(m=d[it]=new Set);var v=c+"__bubble";m.has(v)||(y9(d,c,2,!1),m.add(v))}function r4(c,d,m){var v=0;d&&(v|=4),y9(m,c,v,d)}var c1="_reactListening"+Math.random().toString(36).slice(2);function s4(c){if(!c[c1]){c[c1]=!0,ca.forEach(function(m){m!=="selectionchange"&&(EY.has(m)||r4(m,!1,c),r4(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[c1]||(d[c1]=!0,r4("selectionchange",!1,d))}}function y9(c,d,m,v){switch(K9(d)){case 2:var C=JY;break;case 8:C=eZ;break;default:C=y4}m=C.bind(null,d,m,c),C=void 0,!k2||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(C=!0),v?C!==void 0?c.addEventListener(d,m,{capture:!0,passive:C}):c.addEventListener(d,m,!0):C!==void 0?c.addEventListener(d,m,{passive:C}):c.addEventListener(d,m,!1)}function i4(c,d,m,v,C){var E=v;if((d&1)===0&&(d&2)===0&&v!==null)e:for(;;){if(v===null)return;var D=v.tag;if(D===3||D===4){var $=v.stateNode.containerInfo;if($===C)break;if(D===4)for(D=v.return;D!==null;){var J=D.tag;if((J===3||J===4)&&D.stateNode.containerInfo===C)return;D=D.return}for(;$!==null;){if(D=yn($),D===null)return;if(J=D.tag,J===5||J===6||J===26||J===27){v=E=D;continue e}$=$.parentNode}}v=v.return}gg(function(){var ve=E,Ee=Wt(m),_e=[];e:{var ye=Q7.get(c);if(ye!==void 0){var Se=xg,ft=c;switch(c){case"keypress":if(vg(m)===0)break e;case"keydown":case"keyup":Se=vK;break;case"focusin":ft="focus",Se=T2;break;case"focusout":ft="blur",Se=T2;break;case"beforeblur":case"afterblur":Se=T2;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=M7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=oK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=wK;break;case K7:case Y7:case Z7:Se=cK;break;case X7:Se=CK;break;case"scroll":case"scrollend":Se=sK;break;case"wheel":Se=EK;break;case"copy":case"cut":case"paste":Se=dK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=_7;break;case"toggle":case"beforetoggle":Se=MK}var It=(d&4)!==0,nr=!It&&(c==="scroll"||c==="scrollend"),he=It?ye!==null?ye+"Capture":null:ye;It=[];for(var ae=ve,be;ae!==null;){var Te=ae;if(be=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||be===null||he===null||(Te=c0(ae,he),Te!=null&&It.push(H0(ae,Te,be))),nr)break;ae=ae.return}0<It.length&&(ye=new Se(ye,ft,null,m,Ee),_e.push({event:ye,listeners:It}))}}if((d&7)===0){e:{if(ye=c==="mouseover"||c==="pointerover",Se=c==="mouseout"||c==="pointerout",ye&&m!==xt&&(ft=m.relatedTarget||m.fromElement)&&(yn(ft)||ft[pt]))break e;if((Se||ye)&&(ye=Ee.window===Ee?Ee:(ye=Ee.ownerDocument)?ye.defaultView||ye.parentWindow:window,Se?(ft=m.relatedTarget||m.toElement,Se=ve,ft=ft?yn(ft):null,ft!==null&&(nr=i(ft),It=ft.tag,ft!==nr||It!==5&&It!==27&&It!==6)&&(ft=null)):(Se=null,ft=ve),Se!==ft)){if(It=M7,Te="onMouseLeave",he="onMouseEnter",ae="mouse",(c==="pointerout"||c==="pointerover")&&(It=_7,Te="onPointerLeave",he="onPointerEnter",ae="pointer"),nr=Se==null?ye:an(Se),be=ft==null?ye:an(ft),ye=new It(Te,ae+"leave",Se,m,Ee),ye.target=nr,ye.relatedTarget=be,Te=null,yn(Ee)===ve&&(It=new It(he,ae+"enter",ft,m,Ee),It.target=be,It.relatedTarget=nr,Te=It),nr=Te,Se&&ft)t:{for(It=NY,he=Se,ae=ft,be=0,Te=he;Te;Te=It(Te))be++;Te=0;for(var Mt=ae;Mt;Mt=It(Mt))Te++;for(;0<be-Te;)he=It(he),be--;for(;0<Te-be;)ae=It(ae),Te--;for(;be--;){if(he===ae||ae!==null&&he===ae.alternate){It=he;break t}he=It(he),ae=It(ae)}It=null}else It=null;Se!==null&&x9(_e,ye,Se,It,!1),ft!==null&&nr!==null&&x9(_e,nr,ft,It,!0)}}e:{if(ye=ve?an(ve):window,Se=ye.nodeName&&ye.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ye.type==="file")var Mn=L7;else if(I7(ye))if(P7)Mn=LK;else{Mn=IK;var wt=jK}else Se=ye.nodeName,!Se||Se.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?ve&&nc(ve.elementType)&&(Mn=L7):Mn=zK;if(Mn&&(Mn=Mn(c,ve))){z7(_e,Mn,m,Ee);break e}wt&&wt(c,ye,ve),c==="focusout"&&ve&&ye.type==="number"&&ve.memoizedProps.value!=null&&Zd(ye,"number",ye.value)}switch(wt=ve?an(ve):window,c){case"focusin":(I7(wt)||wt.contentEditable==="true")&&(Jd=wt,j2=ve,b0=null);break;case"focusout":b0=j2=Jd=null;break;case"mousedown":I2=!0;break;case"contextmenu":case"mouseup":case"dragend":I2=!1,G7(_e,m,Ee);break;case"selectionchange":if($K)break;case"keydown":case"keyup":G7(_e,m,Ee)}var Zt;if(R2)e:{switch(c){case"compositionstart":var hn="onCompositionStart";break e;case"compositionend":hn="onCompositionEnd";break e;case"compositionupdate":hn="onCompositionUpdate";break e}hn=void 0}else Qd?D7(c,m)&&(hn="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(hn="onCompositionStart");hn&&(R7&&m.locale!=="ko"&&(Qd||hn!=="onCompositionStart"?hn==="onCompositionEnd"&&Qd&&(Zt=E7()):(sc=Ee,E2="value"in sc?sc.value:sc.textContent,Qd=!0)),wt=u1(ve,hn),0<wt.length&&(hn=new T7(hn,c,null,m,Ee),_e.push({event:hn,listeners:wt}),Zt?hn.data=Zt:(Zt=j7(m),Zt!==null&&(hn.data=Zt)))),(Zt=_K?RK(c,m):AK(c,m))&&(hn=u1(ve,"onBeforeInput"),0<hn.length&&(wt=new T7("onBeforeInput","beforeinput",null,m,Ee),_e.push({event:wt,listeners:hn}),wt.data=Zt)),SY(_e,c,ve,m,Ee)}v9(_e,d)})}function H0(c,d,m){return{instance:c,listener:d,currentTarget:m}}function u1(c,d){for(var m=d+"Capture",v=[];c!==null;){var C=c,E=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||E===null||(C=c0(c,m),C!=null&&v.unshift(H0(c,C,E)),C=c0(c,d),C!=null&&v.push(H0(c,C,E))),c.tag===3)return v;c=c.return}return[]}function NY(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function x9(c,d,m,v,C){for(var E=d._reactName,D=[];m!==null&&m!==v;){var $=m,J=$.alternate,ve=$.stateNode;if($=$.tag,J!==null&&J===v)break;$!==5&&$!==26&&$!==27||ve===null||(J=ve,C?(ve=c0(m,E),ve!=null&&D.unshift(H0(m,ve,J))):C||(ve=c0(m,E),ve!=null&&D.push(H0(m,ve,J)))),m=m.return}D.length!==0&&c.push({event:d,listeners:D})}var MY=/\r\n?/g,TY=/\u0000|\uFFFD/g;function w9(c){return(typeof c=="string"?c:""+c).replace(MY,`
8
+ `+v.stack}}var kn=Object.prototype.hasOwnProperty,Xn=e.unstable_scheduleCallback,sr=e.unstable_cancelCallback,Nn=e.unstable_shouldYield,Pn=e.unstable_requestPaint,Kt=e.unstable_now,bn=e.unstable_getCurrentPriorityLevel,Nt=e.unstable_ImmediatePriority,$n=e.unstable_UserBlockingPriority,Bn=e.unstable_NormalPriority,En=e.unstable_LowPriority,Fn=e.unstable_IdlePriority,Ts=e.log,Kr=e.unstable_setDisableYieldValue,Ar=null,Qn=null;function _n(c){if(typeof Ts=="function"&&Kr(c),Qn&&typeof Qn.setStrictMode=="function")try{Qn.setStrictMode(Ar,c)}catch{}}var _t=Math.clz32?Math.clz32:ht,_s=Math.log,Or=Math.LN2;function ht(c){return c>>>=0,c===0?32:31-(_s(c)/Or|0)|0}var ke=256,Me=262144,Le=4194304;function rt(c){var d=c&42;if(d!==0)return d;switch(c&-c){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function U(c,d,m){var v=c.pendingLanes;if(v===0)return 0;var C=0,E=c.suspendedLanes,D=c.pingedLanes;c=c.warmLanes;var $=v&134217727;return $!==0?(v=$&~E,v!==0?C=rt(v):(D&=$,D!==0?C=rt(D):m||(m=$&~c,m!==0&&(C=rt(m))))):($=v&~E,$!==0?C=rt($):D!==0?C=rt(D):m||(m=v&~c,m!==0&&(C=rt(m)))),C===0?0:d!==0&&d!==C&&(d&E)===0&&(E=C&-C,m=d&-d,E>=m||E===32&&(m&4194048)!==0)?d:C}function Q(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function ge(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32: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 d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function je(){var c=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),c}function Rt(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function lt(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Ke(c,d,m,v,C,E){var D=c.pendingLanes;c.pendingLanes=m,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=m,c.entangledLanes&=m,c.errorRecoveryDisabledLanes&=m,c.shellSuspendCounter=0;var $=c.entanglements,J=c.expirationTimes,ve=c.hiddenUpdates;for(m=D&~m;0<m;){var Ee=31-_t(m),_e=1<<Ee;$[Ee]=0,J[Ee]=-1;var ye=ve[Ee];if(ye!==null)for(ve[Ee]=null,Ee=0;Ee<ye.length;Ee++){var Se=ye[Ee];Se!==null&&(Se.lane&=-536870913)}m&=~_e}v!==0&&Xe(c,v,0),E!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=E&~(D&~d))}function Xe(c,d,m){c.pendingLanes|=d,c.suspendedLanes&=~d;var v=31-_t(d);c.entangledLanes|=d,c.entanglements[v]=c.entanglements[v]|1073741824|m&261930}function dt(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var v=31-_t(m),C=1<<v;C&d|c[v]&d&&(c[v]|=d),m&=~C}}function G(c,d){var m=d&-d;return m=(m&42)!==0?1:se(m),(m&(c.suspendedLanes|d))!==0?0:m}function se(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function me(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function ze(){var c=te.p;return c!==0?c:(c=window.event,c===void 0?32:K9(c.type))}function qe(c,d){var m=te.p;try{return te.p=c,d()}finally{te.p=m}}var ct=Math.random().toString(36).slice(2),Qe="__reactFiber$"+ct,et="__reactProps$"+ct,pt="__reactContainer$"+ct,it="__reactEvents$"+ct,Ct="__reactListeners$"+ct,mt="__reactHandles$"+ct,vn="__reactResources$"+ct,en="__reactMarker$"+ct;function Hn(c){delete c[Qe],delete c[et],delete c[it],delete c[Ct],delete c[mt]}function yn(c){var d=c[Qe];if(d)return d;for(var m=c.parentNode;m;){if(d=m[pt]||m[Qe]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=O9(c);c!==null;){if(m=c[Qe])return m;c=O9(c)}return d}c=m,m=c.parentNode}return null}function hr(c){if(c=c[Qe]||c[pt]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function an(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Dr(c){var d=c[vn];return d||(d=c[vn]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Jn(c){c[en]=!0}var ca=new Set,$s={};function Yr(c,d){Pe(c,d),Pe(c+"Capture",d)}function Pe(c,d){for($s[c]=d,c=0;c<d.length;c++)ca.add(d[c])}var yt=RegExp("^[: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]*$"),Ht={},xn={};function fr(c){return kn.call(xn,c)?!0:kn.call(Ht,c)?!1:yt.test(c)?xn[c]=!0:(Ht[c]=!0,!1)}function Lt(c,d,m){if(fr(d))if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var v=d.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+m)}}function Ln(c,d,m){if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+m)}}function Hr(c,d,m,v){if(v===null)c.removeAttribute(m);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(m);return}c.setAttributeNS(d,m,""+v)}}function wn(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function un(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Xa(c,d,m){var v=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var C=v.get,E=v.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return C.call(this)},set:function(D){m=""+D,E.call(this,D)}}),Object.defineProperty(c,d,{enumerable:v.enumerable}),{getValue:function(){return m},setValue:function(D){m=""+D},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function Qa(c){if(!c._valueTracker){var d=un(c)?"checked":"value";c._valueTracker=Xa(c,d,""+c[d])}}function Tu(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),v="";return c&&(v=un(c)?c.checked?"true":"false":c.value),c=v,c!==m?(d.setValue(c),!0):!1}function Yd(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var C2=/[\n"\\]/g;function hi(c){return c.replace(C2,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function o0(c,d,m,v,C,E,D,$){c.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?c.type=D:c.removeAttribute("type"),d!=null?D==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+wn(d)):c.value!==""+wn(d)&&(c.value=""+wn(d)):D!=="submit"&&D!=="reset"||c.removeAttribute("value"),d!=null?Zd(c,D,wn(d)):m!=null?Zd(c,D,wn(m)):v!=null&&c.removeAttribute("value"),C==null&&E!=null&&(c.defaultChecked=!!E),C!=null&&(c.checked=C&&typeof C!="function"&&typeof C!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?c.name=""+wn($):c.removeAttribute("name")}function _u(c,d,m,v,C,E,D,$){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(c.type=E),d!=null||m!=null){if(!(E!=="submit"&&E!=="reset"||d!=null)){Qa(c);return}m=m!=null?""+wn(m):"",d=d!=null?""+wn(d):m,$||d===c.value||(c.value=d),c.defaultValue=d}v=v??C,v=typeof v!="function"&&typeof v!="symbol"&&!!v,c.checked=$?c.checked:!!v,c.defaultChecked=!!v,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.name=D),Qa(c)}function Zd(c,d,m){d==="number"&&Yd(c.ownerDocument)===c||c.defaultValue===""+m||(c.defaultValue=""+m)}function Rs(c,d,m,v){if(c=c.options,d){d={};for(var C=0;C<m.length;C++)d["$"+m[C]]=!0;for(m=0;m<c.length;m++)C=d.hasOwnProperty("$"+c[m].value),c[m].selected!==C&&(c[m].selected=C),C&&v&&(c[m].defaultSelected=!0)}else{for(m=""+wn(m),d=null,C=0;C<c.length;C++){if(c[C].value===m){c[C].selected=!0,v&&(c[C].defaultSelected=!0);return}d!==null||c[C].disabled||(d=c[C])}d!==null&&(d.selected=!0)}}function pg(c,d,m){if(d!=null&&(d=""+wn(d),d!==c.value&&(c.value=d),m==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=m!=null?""+wn(m):""}function Xd(c,d,m,v){if(d==null){if(v!=null){if(m!=null)throw Error(r(92));if(ce(v)){if(1<v.length)throw Error(r(93));v=v[0]}m=v}m==null&&(m=""),d=m}m=wn(d),c.defaultValue=m,v=c.textContent,v===m&&v!==""&&v!==null&&(c.value=v),Qa(c)}function Pt(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var mg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zr(c,d,m){var v=d.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?v?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":v?c.setProperty(d,m):typeof m!="number"||m===0||mg.has(d)?d==="float"?c.cssFloat=m:c[d]=(""+m).trim():c[d]=m+"px"}function Un(c,d,m){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,m!=null){for(var v in m)!m.hasOwnProperty(v)||d!=null&&d.hasOwnProperty(v)||(v.indexOf("--")===0?c.setProperty(v,""):v==="float"?c.cssFloat="":c[v]="");for(var C in d)v=d[C],d.hasOwnProperty(C)&&m[C]!==v&&Zr(c,C,v)}else for(var E in d)d.hasOwnProperty(E)&&Zr(c,E,d[E])}function nc(c){if(c.indexOf("-")===-1)return!1;switch(c){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 Ja=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),a0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rc(c){return a0.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ye(){}var xt=null;function Wt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var dn=null,Er=null;function so(c){var d=hr(c);if(d&&(c=d.stateNode)){var m=c[et]||null;e:switch(c=d.stateNode,d.type){case"input":if(o0(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+hi(""+d)+'"][type="radio"]'),d=0;d<m.length;d++){var v=m[d];if(v!==c&&v.form===c.form){var C=v[et]||null;if(!C)throw Error(r(90));o0(v,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(d=0;d<m.length;d++)v=m[d],v.form===c.form&&Tu(v)}break e;case"textarea":pg(c,m.value,m.defaultValue);break e;case"select":d=m.value,d!=null&&Rs(c,!!m.multiple,d,!1)}}}var l0=!1;function gg(c,d,m){if(l0)return c(d,m);l0=!0;try{var v=c(d);return v}finally{if(l0=!1,(dn!==null||Er!==null)&&(r1(),dn&&(d=dn,c=Er,Er=dn=null,so(d),c)))for(d=0;d<c.length;d++)so(c[d])}}function c0(c,d){var m=c.stateNode;if(m===null)return null;var v=m[et]||null;if(v===null)return null;m=v[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(c=c.type,v=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!v;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,d,typeof m));return m}var el=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),k2=!1;if(el)try{var u0={};Object.defineProperty(u0,"passive",{get:function(){k2=!0}}),window.addEventListener("test",u0,u0),window.removeEventListener("test",u0,u0)}catch{k2=!1}var sc=null,E2=null,bg=null;function E7(){if(bg)return bg;var c,d=E2,m=d.length,v,C="value"in sc?sc.value:sc.textContent,E=C.length;for(c=0;c<m&&d[c]===C[c];c++);var D=m-c;for(v=1;v<=D&&d[m-v]===C[E-v];v++);return bg=C.slice(c,1<v?1-v:void 0)}function vg(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function yg(){return!0}function N7(){return!1}function pi(c){function d(m,v,C,E,D){this._reactName=m,this._targetInst=C,this.type=v,this.nativeEvent=E,this.target=D,this.currentTarget=null;for(var $ in c)c.hasOwnProperty($)&&(m=c[$],this[$]=m?m(E):E[$]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?yg:N7,this.isPropagationStopped=N7,this}return p(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=yg)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=yg)},persist:function(){},isPersistent:yg}),d}var Ru={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xg=pi(Ru),d0=p({},Ru,{view:0,detail:0}),sK=pi(d0),N2,M2,f0,wg=p({},d0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_2,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==f0&&(f0&&c.type==="mousemove"?(N2=c.screenX-f0.screenX,M2=c.screenY-f0.screenY):M2=N2=0,f0=c),N2)},movementY:function(c){return"movementY"in c?c.movementY:M2}}),M7=pi(wg),iK=p({},wg,{dataTransfer:0}),oK=pi(iK),aK=p({},d0,{relatedTarget:0}),T2=pi(aK),lK=p({},Ru,{animationName:0,elapsedTime:0,pseudoElement:0}),cK=pi(lK),uK=p({},Ru,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),dK=pi(uK),fK=p({},Ru,{data:0}),T7=pi(fK),hK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pK={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gK(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=mK[c])?!!d[c]:!1}function _2(){return gK}var bK=p({},d0,{key:function(c){if(c.key){var d=hK[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=vg(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?pK[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_2,charCode:function(c){return c.type==="keypress"?vg(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?vg(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),vK=pi(bK),yK=p({},wg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_7=pi(yK),xK=p({},d0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_2}),wK=pi(xK),SK=p({},Ru,{propertyName:0,elapsedTime:0,pseudoElement:0}),CK=pi(SK),kK=p({},wg,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),EK=pi(kK),NK=p({},Ru,{newState:0,oldState:0}),MK=pi(NK),TK=[9,13,27,32],R2=el&&"CompositionEvent"in window,h0=null;el&&"documentMode"in document&&(h0=document.documentMode);var _K=el&&"TextEvent"in window&&!h0,R7=el&&(!R2||h0&&8<h0&&11>=h0),A7=" ",O7=!1;function D7(c,d){switch(c){case"keyup":return TK.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function j7(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Qd=!1;function RK(c,d){switch(c){case"compositionend":return j7(d);case"keypress":return d.which!==32?null:(O7=!0,A7);case"textInput":return c=d.data,c===A7&&O7?null:c;default:return null}}function AK(c,d){if(Qd)return c==="compositionend"||!R2&&D7(c,d)?(c=E7(),bg=E2=sc=null,Qd=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return R7&&d.locale!=="ko"?null:d.data;default:return null}}var OK={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function I7(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!OK[c.type]:d==="textarea"}function z7(c,d,m,v){dn?Er?Er.push(v):Er=[v]:dn=v,d=u1(d,"onChange"),0<d.length&&(m=new xg("onChange","change",null,m,v),c.push({event:m,listeners:d}))}var p0=null,m0=null;function DK(c){v9(c,0)}function Sg(c){var d=an(c);if(Tu(d))return c}function L7(c,d){if(c==="change")return d}var P7=!1;if(el){var A2;if(el){var O2="oninput"in document;if(!O2){var $7=document.createElement("div");$7.setAttribute("oninput","return;"),O2=typeof $7.oninput=="function"}A2=O2}else A2=!1;P7=A2&&(!document.documentMode||9<document.documentMode)}function B7(){p0&&(p0.detachEvent("onpropertychange",F7),m0=p0=null)}function F7(c){if(c.propertyName==="value"&&Sg(m0)){var d=[];z7(d,m0,c,Wt(c)),gg(DK,d)}}function jK(c,d,m){c==="focusin"?(B7(),p0=d,m0=m,p0.attachEvent("onpropertychange",F7)):c==="focusout"&&B7()}function IK(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Sg(m0)}function zK(c,d){if(c==="click")return Sg(d)}function LK(c,d){if(c==="input"||c==="change")return Sg(d)}function PK(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Di=typeof Object.is=="function"?Object.is:PK;function g0(c,d){if(Di(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),v=Object.keys(d);if(m.length!==v.length)return!1;for(v=0;v<m.length;v++){var C=m[v];if(!kn.call(d,C)||!Di(c[C],d[C]))return!1}return!0}function H7(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function U7(c,d){var m=H7(c);c=0;for(var v;m;){if(m.nodeType===3){if(v=c+m.textContent.length,c<=d&&v>=d)return{node:m,offset:d-c};c=v}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=H7(m)}}function V7(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?V7(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function q7(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=Yd(c.document);d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=Yd(c.document)}return d}function D2(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var $K=el&&"documentMode"in document&&11>=document.documentMode,Jd=null,j2=null,b0=null,I2=!1;function G7(c,d,m){var v=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;I2||Jd==null||Jd!==Yd(v)||(v=Jd,"selectionStart"in v&&D2(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),b0&&g0(b0,v)||(b0=v,v=u1(j2,"onSelect"),0<v.length&&(d=new xg("onSelect","select",null,d,m),c.push({event:d,listeners:v}),d.target=Jd)))}function Au(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var ef={animationend:Au("Animation","AnimationEnd"),animationiteration:Au("Animation","AnimationIteration"),animationstart:Au("Animation","AnimationStart"),transitionrun:Au("Transition","TransitionRun"),transitionstart:Au("Transition","TransitionStart"),transitioncancel:Au("Transition","TransitionCancel"),transitionend:Au("Transition","TransitionEnd")},z2={},W7={};el&&(W7=document.createElement("div").style,"AnimationEvent"in window||(delete ef.animationend.animation,delete ef.animationiteration.animation,delete ef.animationstart.animation),"TransitionEvent"in window||delete ef.transitionend.transition);function Ou(c){if(z2[c])return z2[c];if(!ef[c])return c;var d=ef[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in W7)return z2[c]=d[m];return c}var K7=Ou("animationend"),Y7=Ou("animationiteration"),Z7=Ou("animationstart"),BK=Ou("transitionrun"),FK=Ou("transitionstart"),HK=Ou("transitioncancel"),X7=Ou("transitionend"),Q7=new Map,L2="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");L2.push("scrollEnd");function Po(c,d){Q7.set(c,d),Yr(d,[c])}var Cg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},io=[],tf=0,P2=0;function kg(){for(var c=tf,d=P2=tf=0;d<c;){var m=io[d];io[d++]=null;var v=io[d];io[d++]=null;var C=io[d];io[d++]=null;var E=io[d];if(io[d++]=null,v!==null&&C!==null){var D=v.pending;D===null?C.next=C:(C.next=D.next,D.next=C),v.pending=C}E!==0&&J7(m,C,E)}}function Eg(c,d,m,v){io[tf++]=c,io[tf++]=d,io[tf++]=m,io[tf++]=v,P2|=v,c.lanes|=v,c=c.alternate,c!==null&&(c.lanes|=v)}function $2(c,d,m,v){return Eg(c,d,m,v),Ng(c)}function Du(c,d){return Eg(c,null,null,d),Ng(c)}function J7(c,d,m){c.lanes|=m;var v=c.alternate;v!==null&&(v.lanes|=m);for(var C=!1,E=c.return;E!==null;)E.childLanes|=m,v=E.alternate,v!==null&&(v.childLanes|=m),E.tag===22&&(c=E.stateNode,c===null||c._visibility&1||(C=!0)),c=E,E=E.return;return c.tag===3?(E=c.stateNode,C&&d!==null&&(C=31-_t(m),c=E.hiddenUpdates,v=c[C],v===null?c[C]=[d]:v.push(d),d.lane=m|536870912),E):null}function Ng(c){if(50<$0)throw $0=0,Kw=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var nf={};function UK(c,d,m,v){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(c,d,m,v){return new UK(c,d,m,v)}function B2(c){return c=c.prototype,!(!c||!c.isReactComponent)}function tl(c,d){var m=c.alternate;return m===null?(m=ji(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&65011712,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m.refCleanup=c.refCleanup,m}function e8(c,d){c.flags&=65011714;var m=c.alternate;return m===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=m.childLanes,c.lanes=m.lanes,c.child=m.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=m.memoizedProps,c.memoizedState=m.memoizedState,c.updateQueue=m.updateQueue,c.type=m.type,d=m.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function Mg(c,d,m,v,C,E){var D=0;if(v=c,typeof c=="function")B2(c)&&(D=1);else if(typeof c=="string")D=KY(c,m,de.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case L:return c=ji(31,m,d,C),c.elementType=L,c.lanes=E,c;case x:return ju(m.children,C,E,d);case S:D=8,C|=24;break;case k:return c=ji(12,m,d,C|2),c.elementType=k,c.lanes=E,c;case _:return c=ji(13,m,d,C),c.elementType=_,c.lanes=E,c;case A:return c=ji(19,m,d,C),c.elementType=A,c.lanes=E,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case T:D=10;break e;case N:D=9;break e;case R:D=11;break e;case I:D=14;break e;case j:D=16,v=null;break e}D=29,m=Error(r(130,c===null?"null":typeof c,"")),v=null}return d=ji(D,m,d,C),d.elementType=c,d.type=v,d.lanes=E,d}function ju(c,d,m,v){return c=ji(7,c,v,d),c.lanes=m,c}function F2(c,d,m){return c=ji(6,c,null,d),c.lanes=m,c}function t8(c){var d=ji(18,null,null,0);return d.stateNode=c,d}function H2(c,d,m){return d=ji(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var n8=new WeakMap;function oo(c,d){if(typeof c=="object"&&c!==null){var m=n8.get(c);return m!==void 0?m:(d={value:c,source:d,stack:nn(d)},n8.set(c,d),d)}return{value:c,source:d,stack:nn(d)}}var rf=[],sf=0,Tg=null,v0=0,ao=[],lo=0,ic=null,ua=1,da="";function nl(c,d){rf[sf++]=v0,rf[sf++]=Tg,Tg=c,v0=d}function r8(c,d,m){ao[lo++]=ua,ao[lo++]=da,ao[lo++]=ic,ic=c;var v=ua;c=da;var C=32-_t(v)-1;v&=~(1<<C),m+=1;var E=32-_t(d)+C;if(30<E){var D=C-C%5;E=(v&(1<<D)-1).toString(32),v>>=D,C-=D,ua=1<<32-_t(d)+C|m<<C|v,da=E+c}else ua=1<<E|m<<C|v,da=c}function U2(c){c.return!==null&&(nl(c,1),r8(c,1,0))}function V2(c){for(;c===Tg;)Tg=rf[--sf],rf[sf]=null,v0=rf[--sf],rf[sf]=null;for(;c===ic;)ic=ao[--lo],ao[lo]=null,da=ao[--lo],ao[lo]=null,ua=ao[--lo],ao[lo]=null}function s8(c,d){ao[lo++]=ua,ao[lo++]=da,ao[lo++]=ic,ua=d.id,da=d.overflow,ic=c}var As=null,pr=null,mn=!1,oc=null,co=!1,q2=Error(r(519));function ac(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw y0(oo(d,c)),q2}function i8(c){var d=c.stateNode,m=c.type,v=c.memoizedProps;switch(d[Qe]=c,d[et]=v,m){case"dialog":cn("cancel",d),cn("close",d);break;case"iframe":case"object":case"embed":cn("load",d);break;case"video":case"audio":for(m=0;m<F0.length;m++)cn(F0[m],d);break;case"source":cn("error",d);break;case"img":case"image":case"link":cn("error",d),cn("load",d);break;case"details":cn("toggle",d);break;case"input":cn("invalid",d),_u(d,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":cn("invalid",d);break;case"textarea":cn("invalid",d),Xd(d,v.value,v.defaultValue,v.children)}m=v.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||d.textContent===""+m||v.suppressHydrationWarning===!0||S9(d.textContent,m)?(v.popover!=null&&(cn("beforetoggle",d),cn("toggle",d)),v.onScroll!=null&&cn("scroll",d),v.onScrollEnd!=null&&cn("scrollend",d),v.onClick!=null&&(d.onclick=Ye),d=!0):d=!1,d||ac(c,!0)}function o8(c){for(As=c.return;As;)switch(As.tag){case 5:case 31:case 13:co=!1;return;case 27:case 3:co=!0;return;default:As=As.return}}function of(c){if(c!==As)return!1;if(!mn)return o8(c),mn=!0,!1;var d=c.tag,m;if((m=d!==3&&d!==27)&&((m=d===5)&&(m=c.type,m=!(m!=="form"&&m!=="button")||c4(c.type,c.memoizedProps)),m=!m),m&&pr&&ac(c),o8(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));pr=A9(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));pr=A9(c)}else d===27?(d=pr,wc(c.type)?(c=p4,p4=null,pr=c):pr=d):pr=As?fo(c.stateNode.nextSibling):null;return!0}function Iu(){pr=As=null,mn=!1}function G2(){var c=oc;return c!==null&&(vi===null?vi=c:vi.push.apply(vi,c),oc=null),c}function y0(c){oc===null?oc=[c]:oc.push(c)}var W2=P(null),zu=null,rl=null;function lc(c,d,m){X(W2,d._currentValue),d._currentValue=m}function sl(c){c._currentValue=W2.current,H(W2)}function K2(c,d,m){for(;c!==null;){var v=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,v!==null&&(v.childLanes|=d)):v!==null&&(v.childLanes&d)!==d&&(v.childLanes|=d),c===m)break;c=c.return}}function Y2(c,d,m,v){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var E=C.dependencies;if(E!==null){var D=C.child;E=E.firstContext;e:for(;E!==null;){var $=E;E=C;for(var J=0;J<d.length;J++)if($.context===d[J]){E.lanes|=m,$=E.alternate,$!==null&&($.lanes|=m),K2(E.return,m,c),v||(D=null);break e}E=$.next}}else if(C.tag===18){if(D=C.return,D===null)throw Error(r(341));D.lanes|=m,E=D.alternate,E!==null&&(E.lanes|=m),K2(D,m,c),D=null}else D=C.child;if(D!==null)D.return=C;else for(D=C;D!==null;){if(D===c){D=null;break}if(C=D.sibling,C!==null){C.return=D.return,D=C;break}D=D.return}C=D}}function af(c,d,m,v){c=null;for(var C=d,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var D=C.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var $=C.type;Di(C.pendingProps.value,D.value)||(c!==null?c.push($):c=[$])}}else if(C===pe.current){if(D=C.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(G0):c=[G0])}C=C.return}c!==null&&Y2(d,c,m,v),d.flags|=262144}function _g(c){for(c=c.firstContext;c!==null;){if(!Di(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Lu(c){zu=c,rl=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Os(c){return a8(zu,c)}function Rg(c,d){return zu===null&&Lu(c),a8(c,d)}function a8(c,d){var m=d._currentValue;if(d={context:d,memoizedValue:m,next:null},rl===null){if(c===null)throw Error(r(308));rl=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else rl=rl.next=d;return m}var VK=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(m,v){c.push(v)}};this.abort=function(){d.aborted=!0,c.forEach(function(m){return m()})}},qK=e.unstable_scheduleCallback,GK=e.unstable_NormalPriority,Xr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Z2(){return{controller:new VK,data:new Map,refCount:0}}function x0(c){c.refCount--,c.refCount===0&&qK(GK,function(){c.controller.abort()})}var w0=null,X2=0,lf=0,cf=null;function WK(c,d){if(w0===null){var m=w0=[];X2=0,lf=e4(),cf={status:"pending",value:void 0,then:function(v){m.push(v)}}}return X2++,d.then(l8,l8),d}function l8(){if(--X2===0&&w0!==null){cf!==null&&(cf.status="fulfilled");var c=w0;w0=null,lf=0,cf=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function KK(c,d){var m=[],v={status:"pending",value:null,reason:null,then:function(C){m.push(C)}};return c.then(function(){v.status="fulfilled",v.value=d;for(var C=0;C<m.length;C++)(0,m[C])(d)},function(C){for(v.status="rejected",v.reason=C,C=0;C<m.length;C++)(0,m[C])(void 0)}),v}var c8=F.S;F.S=function(c,d){GN=Kt(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&WK(c,d),c8!==null&&c8(c,d)};var Pu=P(null);function Q2(){var c=Pu.current;return c!==null?c:ir.pooledCache}function Ag(c,d){d===null?X(Pu,Pu.current):X(Pu,d.pool)}function u8(){var c=Q2();return c===null?null:{parent:Xr._currentValue,pool:c}}var uf=Error(r(460)),J2=Error(r(474)),Og=Error(r(542)),Dg={then:function(){}};function d8(c){return c=c.status,c==="fulfilled"||c==="rejected"}function f8(c,d,m){switch(m=c[m],m===void 0?c.push(d):m!==d&&(d.then(Ye,Ye),d=m),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,p8(c),c;default:if(typeof d.status=="string")d.then(Ye,Ye);else{if(c=ir,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(v){if(d.status==="pending"){var C=d;C.status="fulfilled",C.value=v}},function(v){if(d.status==="pending"){var C=d;C.status="rejected",C.reason=v}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,p8(c),c}throw Bu=d,uf}}function $u(c){try{var d=c._init;return d(c._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(Bu=m,uf):m}}var Bu=null;function h8(){if(Bu===null)throw Error(r(459));var c=Bu;return Bu=null,c}function p8(c){if(c===uf||c===Og)throw Error(r(483))}var df=null,S0=0;function jg(c){var d=S0;return S0+=1,df===null&&(df=[]),f8(df,c,d)}function C0(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function Ig(c,d){throw d.$$typeof===g?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function m8(c){function d(he,ae){if(c){var be=he.deletions;be===null?(he.deletions=[ae],he.flags|=16):be.push(ae)}}function m(he,ae){if(!c)return null;for(;ae!==null;)d(he,ae),ae=ae.sibling;return null}function v(he){for(var ae=new Map;he!==null;)he.key!==null?ae.set(he.key,he):ae.set(he.index,he),he=he.sibling;return ae}function C(he,ae){return he=tl(he,ae),he.index=0,he.sibling=null,he}function E(he,ae,be){return he.index=be,c?(be=he.alternate,be!==null?(be=be.index,be<ae?(he.flags|=67108866,ae):be):(he.flags|=67108866,ae)):(he.flags|=1048576,ae)}function D(he){return c&&he.alternate===null&&(he.flags|=67108866),he}function $(he,ae,be,Te){return ae===null||ae.tag!==6?(ae=F2(be,he.mode,Te),ae.return=he,ae):(ae=C(ae,be),ae.return=he,ae)}function J(he,ae,be,Te){var Mt=be.type;return Mt===x?Ee(he,ae,be.props.children,Te,be.key):ae!==null&&(ae.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===j&&$u(Mt)===ae.type)?(ae=C(ae,be.props),C0(ae,be),ae.return=he,ae):(ae=Mg(be.type,be.key,be.props,null,he.mode,Te),C0(ae,be),ae.return=he,ae)}function ve(he,ae,be,Te){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==be.containerInfo||ae.stateNode.implementation!==be.implementation?(ae=H2(be,he.mode,Te),ae.return=he,ae):(ae=C(ae,be.children||[]),ae.return=he,ae)}function Ee(he,ae,be,Te,Mt){return ae===null||ae.tag!==7?(ae=ju(be,he.mode,Te,Mt),ae.return=he,ae):(ae=C(ae,be),ae.return=he,ae)}function _e(he,ae,be){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=F2(""+ae,he.mode,be),ae.return=he,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return be=Mg(ae.type,ae.key,ae.props,null,he.mode,be),C0(be,ae),be.return=he,be;case y:return ae=H2(ae,he.mode,be),ae.return=he,ae;case j:return ae=$u(ae),_e(he,ae,be)}if(ce(ae)||re(ae))return ae=ju(ae,he.mode,be,null),ae.return=he,ae;if(typeof ae.then=="function")return _e(he,jg(ae),be);if(ae.$$typeof===T)return _e(he,Rg(he,ae),be);Ig(he,ae)}return null}function ye(he,ae,be,Te){var Mt=ae!==null?ae.key:null;if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Mt!==null?null:$(he,ae,""+be,Te);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case b:return be.key===Mt?J(he,ae,be,Te):null;case y:return be.key===Mt?ve(he,ae,be,Te):null;case j:return be=$u(be),ye(he,ae,be,Te)}if(ce(be)||re(be))return Mt!==null?null:Ee(he,ae,be,Te,null);if(typeof be.then=="function")return ye(he,ae,jg(be),Te);if(be.$$typeof===T)return ye(he,ae,Rg(he,be),Te);Ig(he,be)}return null}function Se(he,ae,be,Te,Mt){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return he=he.get(be)||null,$(ae,he,""+Te,Mt);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case b:return he=he.get(Te.key===null?be:Te.key)||null,J(ae,he,Te,Mt);case y:return he=he.get(Te.key===null?be:Te.key)||null,ve(ae,he,Te,Mt);case j:return Te=$u(Te),Se(he,ae,be,Te,Mt)}if(ce(Te)||re(Te))return he=he.get(be)||null,Ee(ae,he,Te,Mt,null);if(typeof Te.then=="function")return Se(he,ae,be,jg(Te),Mt);if(Te.$$typeof===T)return Se(he,ae,be,Rg(ae,Te),Mt);Ig(ae,Te)}return null}function ft(he,ae,be,Te){for(var Mt=null,Mn=null,wt=ae,Xt=ae=0,hn=null;wt!==null&&Xt<be.length;Xt++){wt.index>Xt?(hn=wt,wt=null):hn=wt.sibling;var Tn=ye(he,wt,be[Xt],Te);if(Tn===null){wt===null&&(wt=hn);break}c&&wt&&Tn.alternate===null&&d(he,wt),ae=E(Tn,ae,Xt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn,wt=hn}if(Xt===be.length)return m(he,wt),mn&&nl(he,Xt),Mt;if(wt===null){for(;Xt<be.length;Xt++)wt=_e(he,be[Xt],Te),wt!==null&&(ae=E(wt,ae,Xt),Mn===null?Mt=wt:Mn.sibling=wt,Mn=wt);return mn&&nl(he,Xt),Mt}for(wt=v(wt);Xt<be.length;Xt++)hn=Se(wt,he,Xt,be[Xt],Te),hn!==null&&(c&&hn.alternate!==null&&wt.delete(hn.key===null?Xt:hn.key),ae=E(hn,ae,Xt),Mn===null?Mt=hn:Mn.sibling=hn,Mn=hn);return c&&wt.forEach(function(Nc){return d(he,Nc)}),mn&&nl(he,Xt),Mt}function It(he,ae,be,Te){if(be==null)throw Error(r(151));for(var Mt=null,Mn=null,wt=ae,Xt=ae=0,hn=null,Tn=be.next();wt!==null&&!Tn.done;Xt++,Tn=be.next()){wt.index>Xt?(hn=wt,wt=null):hn=wt.sibling;var Nc=ye(he,wt,Tn.value,Te);if(Nc===null){wt===null&&(wt=hn);break}c&&wt&&Nc.alternate===null&&d(he,wt),ae=E(Nc,ae,Xt),Mn===null?Mt=Nc:Mn.sibling=Nc,Mn=Nc,wt=hn}if(Tn.done)return m(he,wt),mn&&nl(he,Xt),Mt;if(wt===null){for(;!Tn.done;Xt++,Tn=be.next())Tn=_e(he,Tn.value,Te),Tn!==null&&(ae=E(Tn,ae,Xt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn);return mn&&nl(he,Xt),Mt}for(wt=v(wt);!Tn.done;Xt++,Tn=be.next())Tn=Se(wt,he,Xt,Tn.value,Te),Tn!==null&&(c&&Tn.alternate!==null&&wt.delete(Tn.key===null?Xt:Tn.key),ae=E(Tn,ae,Xt),Mn===null?Mt=Tn:Mn.sibling=Tn,Mn=Tn);return c&&wt.forEach(function(iZ){return d(he,iZ)}),mn&&nl(he,Xt),Mt}function nr(he,ae,be,Te){if(typeof be=="object"&&be!==null&&be.type===x&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case b:e:{for(var Mt=be.key;ae!==null;){if(ae.key===Mt){if(Mt=be.type,Mt===x){if(ae.tag===7){m(he,ae.sibling),Te=C(ae,be.props.children),Te.return=he,he=Te;break e}}else if(ae.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===j&&$u(Mt)===ae.type){m(he,ae.sibling),Te=C(ae,be.props),C0(Te,be),Te.return=he,he=Te;break e}m(he,ae);break}else d(he,ae);ae=ae.sibling}be.type===x?(Te=ju(be.props.children,he.mode,Te,be.key),Te.return=he,he=Te):(Te=Mg(be.type,be.key,be.props,null,he.mode,Te),C0(Te,be),Te.return=he,he=Te)}return D(he);case y:e:{for(Mt=be.key;ae!==null;){if(ae.key===Mt)if(ae.tag===4&&ae.stateNode.containerInfo===be.containerInfo&&ae.stateNode.implementation===be.implementation){m(he,ae.sibling),Te=C(ae,be.children||[]),Te.return=he,he=Te;break e}else{m(he,ae);break}else d(he,ae);ae=ae.sibling}Te=H2(be,he.mode,Te),Te.return=he,he=Te}return D(he);case j:return be=$u(be),nr(he,ae,be,Te)}if(ce(be))return ft(he,ae,be,Te);if(re(be)){if(Mt=re(be),typeof Mt!="function")throw Error(r(150));return be=Mt.call(be),It(he,ae,be,Te)}if(typeof be.then=="function")return nr(he,ae,jg(be),Te);if(be.$$typeof===T)return nr(he,ae,Rg(he,be),Te);Ig(he,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,ae!==null&&ae.tag===6?(m(he,ae.sibling),Te=C(ae,be),Te.return=he,he=Te):(m(he,ae),Te=F2(be,he.mode,Te),Te.return=he,he=Te),D(he)):m(he,ae)}return function(he,ae,be,Te){try{S0=0;var Mt=nr(he,ae,be,Te);return df=null,Mt}catch(wt){if(wt===uf||wt===Og)throw wt;var Mn=ji(29,wt,null,he.mode);return Mn.lanes=Te,Mn.return=he,Mn}}}var Fu=m8(!0),g8=m8(!1),cc=!1;function ew(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tw(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function uc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function dc(c,d,m){var v=c.updateQueue;if(v===null)return null;if(v=v.shared,(Rn&2)!==0){var C=v.pending;return C===null?d.next=d:(d.next=C.next,C.next=d),v.pending=d,d=Ng(c),J7(c,null,m),d}return Eg(c,v,d,m),Ng(c)}function k0(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194048)!==0)){var v=d.lanes;v&=c.pendingLanes,m|=v,d.lanes=m,dt(c,m)}}function nw(c,d){var m=c.updateQueue,v=c.alternate;if(v!==null&&(v=v.updateQueue,m===v)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var D={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};E===null?C=E=D:E=E.next=D,m=m.next}while(m!==null);E===null?C=E=d:E=E.next=d}else C=E=d;m={baseState:v.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:v.shared,callbacks:v.callbacks},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}var rw=!1;function E0(){if(rw){var c=cf;if(c!==null)throw c}}function N0(c,d,m,v){rw=!1;var C=c.updateQueue;cc=!1;var E=C.firstBaseUpdate,D=C.lastBaseUpdate,$=C.shared.pending;if($!==null){C.shared.pending=null;var J=$,ve=J.next;J.next=null,D===null?E=ve:D.next=ve,D=J;var Ee=c.alternate;Ee!==null&&(Ee=Ee.updateQueue,$=Ee.lastBaseUpdate,$!==D&&($===null?Ee.firstBaseUpdate=ve:$.next=ve,Ee.lastBaseUpdate=J))}if(E!==null){var _e=C.baseState;D=0,Ee=ve=J=null,$=E;do{var ye=$.lane&-536870913,Se=ye!==$.lane;if(Se?(fn&ye)===ye:(v&ye)===ye){ye!==0&&ye===lf&&(rw=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var ft=c,It=$;ye=d;var nr=m;switch(It.tag){case 1:if(ft=It.payload,typeof ft=="function"){_e=ft.call(nr,_e,ye);break e}_e=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=It.payload,ye=typeof ft=="function"?ft.call(nr,_e,ye):ft,ye==null)break e;_e=p({},_e,ye);break e;case 2:cc=!0}}ye=$.callback,ye!==null&&(c.flags|=64,Se&&(c.flags|=8192),Se=C.callbacks,Se===null?C.callbacks=[ye]:Se.push(ye))}else Se={lane:ye,tag:$.tag,payload:$.payload,callback:$.callback,next:null},Ee===null?(ve=Ee=Se,J=_e):Ee=Ee.next=Se,D|=ye;if($=$.next,$===null){if($=C.shared.pending,$===null)break;Se=$,$=Se.next,Se.next=null,C.lastBaseUpdate=Se,C.shared.pending=null}}while(!0);Ee===null&&(J=_e),C.baseState=J,C.firstBaseUpdate=ve,C.lastBaseUpdate=Ee,E===null&&(C.shared.lanes=0),gc|=D,c.lanes=D,c.memoizedState=_e}}function b8(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function v8(c,d){var m=c.callbacks;if(m!==null)for(c.callbacks=null,c=0;c<m.length;c++)b8(m[c],d)}var ff=P(null),zg=P(0);function y8(c,d){c=hl,X(zg,c),X(ff,d),hl=c|d.baseLanes}function sw(){X(zg,hl),X(ff,ff.current)}function iw(){hl=zg.current,H(ff),H(zg)}var Ii=P(null),uo=null;function fc(c){var d=c.alternate;X(Ur,Ur.current&1),X(Ii,c),uo===null&&(d===null||ff.current!==null||d.memoizedState!==null)&&(uo=c)}function ow(c){X(Ur,Ur.current),X(Ii,c),uo===null&&(uo=c)}function x8(c){c.tag===22?(X(Ur,Ur.current),X(Ii,c),uo===null&&(uo=c)):hc()}function hc(){X(Ur,Ur.current),X(Ii,Ii.current)}function zi(c){H(Ii),uo===c&&(uo=null),H(Ur)}var Ur=P(0);function Lg(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||f4(m)||h4(m)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var il=0,Yt=null,er=null,Qr=null,Pg=!1,hf=!1,Hu=!1,$g=0,M0=0,pf=null,YK=0;function jr(){throw Error(r(321))}function aw(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!Di(c[m],d[m]))return!1;return!0}function lw(c,d,m,v,C,E){return il=E,Yt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,F.H=c===null||c.memoizedState===null?rN:Cw,Hu=!1,E=m(v,C),Hu=!1,hf&&(E=S8(d,m,v,C)),w8(c),E}function w8(c){F.H=R0;var d=er!==null&&er.next!==null;if(il=0,Qr=er=Yt=null,Pg=!1,M0=0,pf=null,d)throw Error(r(300));c===null||Jr||(c=c.dependencies,c!==null&&_g(c)&&(Jr=!0))}function S8(c,d,m,v){Yt=c;var C=0;do{if(hf&&(pf=null),M0=0,hf=!1,25<=C)throw Error(r(301));if(C+=1,Qr=er=null,c.updateQueue!=null){var E=c.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}F.H=sN,E=d(m,v)}while(hf);return E}function ZK(){var c=F.H,d=c.useState()[0];return d=typeof d.then=="function"?T0(d):d,c=c.useState()[0],(er!==null?er.memoizedState:null)!==c&&(Yt.flags|=1024),d}function cw(){var c=$g!==0;return $g=0,c}function uw(c,d,m){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~m}function dw(c){if(Pg){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}Pg=!1}il=0,Qr=er=Yt=null,hf=!1,M0=$g=0,pf=null}function Qs(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qr===null?Yt.memoizedState=Qr=c:Qr=Qr.next=c,Qr}function Vr(){if(er===null){var c=Yt.alternate;c=c!==null?c.memoizedState:null}else c=er.next;var d=Qr===null?Yt.memoizedState:Qr.next;if(d!==null)Qr=d,er=c;else{if(c===null)throw Yt.alternate===null?Error(r(467)):Error(r(310));er=c,c={memoizedState:er.memoizedState,baseState:er.baseState,baseQueue:er.baseQueue,queue:er.queue,next:null},Qr===null?Yt.memoizedState=Qr=c:Qr=Qr.next=c}return Qr}function Bg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function T0(c){var d=M0;return M0+=1,pf===null&&(pf=[]),c=f8(pf,c,d),d=Yt,(Qr===null?d.memoizedState:Qr.next)===null&&(d=d.alternate,F.H=d===null||d.memoizedState===null?rN:Cw),c}function Fg(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return T0(c);if(c.$$typeof===T)return Os(c)}throw Error(r(438,String(c)))}function fw(c){var d=null,m=Yt.updateQueue;if(m!==null&&(d=m.memoCache),d==null){var v=Yt.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(d={data:v.data.map(function(C){return C.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),m===null&&(m=Bg(),Yt.updateQueue=m),m.memoCache=d,m=d.data[d.index],m===void 0)for(m=d.data[d.index]=Array(c),v=0;v<c;v++)m[v]=q;return d.index++,m}function ol(c,d){return typeof d=="function"?d(c):d}function Hg(c){var d=Vr();return hw(d,er,c)}function hw(c,d,m){var v=c.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=m;var C=c.baseQueue,E=v.pending;if(E!==null){if(C!==null){var D=C.next;C.next=E.next,E.next=D}d.baseQueue=C=E,v.pending=null}if(E=c.baseState,C===null)c.memoizedState=E;else{d=C.next;var $=D=null,J=null,ve=d,Ee=!1;do{var _e=ve.lane&-536870913;if(_e!==ve.lane?(fn&_e)===_e:(il&_e)===_e){var ye=ve.revertLane;if(ye===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),_e===lf&&(Ee=!0);else if((il&ye)===ye){ve=ve.next,ye===lf&&(Ee=!0);continue}else _e={lane:0,revertLane:ve.revertLane,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},J===null?($=J=_e,D=E):J=J.next=_e,Yt.lanes|=ye,gc|=ye;_e=ve.action,Hu&&m(E,_e),E=ve.hasEagerState?ve.eagerState:m(E,_e)}else ye={lane:_e,revertLane:ve.revertLane,gesture:ve.gesture,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},J===null?($=J=ye,D=E):J=J.next=ye,Yt.lanes|=_e,gc|=_e;ve=ve.next}while(ve!==null&&ve!==d);if(J===null?D=E:J.next=$,!Di(E,c.memoizedState)&&(Jr=!0,Ee&&(m=cf,m!==null)))throw m;c.memoizedState=E,c.baseState=D,c.baseQueue=J,v.lastRenderedState=E}return C===null&&(v.lanes=0),[c.memoizedState,v.dispatch]}function pw(c){var d=Vr(),m=d.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var v=m.dispatch,C=m.pending,E=d.memoizedState;if(C!==null){m.pending=null;var D=C=C.next;do E=c(E,D.action),D=D.next;while(D!==C);Di(E,d.memoizedState)||(Jr=!0),d.memoizedState=E,d.baseQueue===null&&(d.baseState=E),m.lastRenderedState=E}return[E,v]}function C8(c,d,m){var v=Yt,C=Vr(),E=mn;if(E){if(m===void 0)throw Error(r(407));m=m()}else m=d();var D=!Di((er||C).memoizedState,m);if(D&&(C.memoizedState=m,Jr=!0),C=C.queue,bw(N8.bind(null,v,C,c),[c]),C.getSnapshot!==d||D||Qr!==null&&Qr.memoizedState.tag&1){if(v.flags|=2048,mf(9,{destroy:void 0},E8.bind(null,v,C,m,d),null),ir===null)throw Error(r(349));E||(il&127)!==0||k8(v,d,m)}return m}function k8(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=Yt.updateQueue,d===null?(d=Bg(),Yt.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function E8(c,d,m,v){d.value=m,d.getSnapshot=v,M8(d)&&T8(c)}function N8(c,d,m){return m(function(){M8(d)&&T8(c)})}function M8(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!Di(c,m)}catch{return!0}}function T8(c){var d=Du(c,2);d!==null&&yi(d,c,2)}function mw(c){var d=Qs();if(typeof c=="function"){var m=c;if(c=m(),Hu){_n(!0);try{m()}finally{_n(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:c},d}function _8(c,d,m,v){return c.baseState=m,hw(c,er,typeof v=="function"?v:ol)}function XK(c,d,m,v,C){if(qg(c))throw Error(r(485));if(c=d.action,c!==null){var E={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){E.listeners.push(D)}};F.T!==null?m(!0):E.isTransition=!1,v(E),m=d.pending,m===null?(E.next=d.pending=E,R8(d,E)):(E.next=m.next,d.pending=m.next=E)}}function R8(c,d){var m=d.action,v=d.payload,C=c.state;if(d.isTransition){var E=F.T,D={};F.T=D;try{var $=m(C,v),J=F.S;J!==null&&J(D,$),A8(c,d,$)}catch(ve){gw(c,d,ve)}finally{E!==null&&D.types!==null&&(E.types=D.types),F.T=E}}else try{E=m(C,v),A8(c,d,E)}catch(ve){gw(c,d,ve)}}function A8(c,d,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(v){O8(c,d,v)},function(v){return gw(c,d,v)}):O8(c,d,m)}function O8(c,d,m){d.status="fulfilled",d.value=m,D8(d),c.state=m,d=c.pending,d!==null&&(m=d.next,m===d?c.pending=null:(m=m.next,d.next=m,R8(c,m)))}function gw(c,d,m){var v=c.pending;if(c.pending=null,v!==null){v=v.next;do d.status="rejected",d.reason=m,D8(d),d=d.next;while(d!==v)}c.action=null}function D8(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function j8(c,d){return d}function I8(c,d){if(mn){var m=ir.formState;if(m!==null){e:{var v=Yt;if(mn){if(pr){t:{for(var C=pr,E=co;C.nodeType!==8;){if(!E){C=null;break t}if(C=fo(C.nextSibling),C===null){C=null;break t}}E=C.data,C=E==="F!"||E==="F"?C:null}if(C){pr=fo(C.nextSibling),v=C.data==="F!";break e}}ac(v)}v=!1}v&&(d=m[0])}}return m=Qs(),m.memoizedState=m.baseState=d,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:j8,lastRenderedState:d},m.queue=v,m=eN.bind(null,Yt,v),v.dispatch=m,v=mw(!1),E=Sw.bind(null,Yt,!1,v.queue),v=Qs(),C={state:d,dispatch:null,action:c,pending:null},v.queue=C,m=XK.bind(null,Yt,C,E,m),C.dispatch=m,v.memoizedState=c,[d,m,!1]}function z8(c){var d=Vr();return L8(d,er,c)}function L8(c,d,m){if(d=hw(c,d,j8)[0],c=Hg(ol)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var v=T0(d)}catch(D){throw D===uf?Og:D}else v=d;d=Vr();var C=d.queue,E=C.dispatch;return m!==d.memoizedState&&(Yt.flags|=2048,mf(9,{destroy:void 0},QK.bind(null,C,m),null)),[v,E,c]}function QK(c,d){c.action=d}function P8(c){var d=Vr(),m=er;if(m!==null)return L8(d,m,c);Vr(),d=d.memoizedState,m=Vr();var v=m.queue.dispatch;return m.memoizedState=c,[d,v,!1]}function mf(c,d,m,v){return c={tag:c,create:m,deps:v,inst:d,next:null},d=Yt.updateQueue,d===null&&(d=Bg(),Yt.updateQueue=d),m=d.lastEffect,m===null?d.lastEffect=c.next=c:(v=m.next,m.next=c,c.next=v,d.lastEffect=c),c}function $8(){return Vr().memoizedState}function Ug(c,d,m,v){var C=Qs();Yt.flags|=c,C.memoizedState=mf(1|d,{destroy:void 0},m,v===void 0?null:v)}function Vg(c,d,m,v){var C=Vr();v=v===void 0?null:v;var E=C.memoizedState.inst;er!==null&&v!==null&&aw(v,er.memoizedState.deps)?C.memoizedState=mf(d,E,m,v):(Yt.flags|=c,C.memoizedState=mf(1|d,E,m,v))}function B8(c,d){Ug(8390656,8,c,d)}function bw(c,d){Vg(2048,8,c,d)}function JK(c){Yt.flags|=4;var d=Yt.updateQueue;if(d===null)d=Bg(),Yt.updateQueue=d,d.events=[c];else{var m=d.events;m===null?d.events=[c]:m.push(c)}}function F8(c){var d=Vr().memoizedState;return JK({ref:d,nextImpl:c}),function(){if((Rn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function H8(c,d){return Vg(4,2,c,d)}function U8(c,d){return Vg(4,4,c,d)}function V8(c,d){if(typeof d=="function"){c=c();var m=d(c);return function(){typeof m=="function"?m():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function q8(c,d,m){m=m!=null?m.concat([c]):null,Vg(4,4,V8.bind(null,d,c),m)}function vw(){}function G8(c,d){var m=Vr();d=d===void 0?null:d;var v=m.memoizedState;return d!==null&&aw(d,v[1])?v[0]:(m.memoizedState=[c,d],c)}function W8(c,d){var m=Vr();d=d===void 0?null:d;var v=m.memoizedState;if(d!==null&&aw(d,v[1]))return v[0];if(v=c(),Hu){_n(!0);try{c()}finally{_n(!1)}}return m.memoizedState=[v,d],v}function yw(c,d,m){return m===void 0||(il&1073741824)!==0&&(fn&261930)===0?c.memoizedState=d:(c.memoizedState=m,c=KN(),Yt.lanes|=c,gc|=c,m)}function K8(c,d,m,v){return Di(m,d)?m:ff.current!==null?(c=yw(c,m,v),Di(c,d)||(Jr=!0),c):(il&42)===0||(il&1073741824)!==0&&(fn&261930)===0?(Jr=!0,c.memoizedState=m):(c=KN(),Yt.lanes|=c,gc|=c,d)}function Y8(c,d,m,v,C){var E=te.p;te.p=E!==0&&8>E?E:8;var D=F.T,$={};F.T=$,Sw(c,!1,d,m);try{var J=C(),ve=F.S;if(ve!==null&&ve($,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var Ee=KK(J,v);_0(c,d,Ee,$i(c))}else _0(c,d,v,$i(c))}catch(_e){_0(c,d,{then:function(){},status:"rejected",reason:_e},$i())}finally{te.p=E,D!==null&&$.types!==null&&(D.types=$.types),F.T=D}}function eY(){}function xw(c,d,m,v){if(c.tag!==5)throw Error(r(476));var C=Z8(c).queue;Y8(c,C,d,K,m===null?eY:function(){return X8(c),m(v)})}function Z8(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:K},next:null};var m={};return d.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:m},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function X8(c){var d=Z8(c);d.next===null&&(d=c.alternate.memoizedState),_0(c,d.next.queue,{},$i())}function ww(){return Os(G0)}function Q8(){return Vr().memoizedState}function J8(){return Vr().memoizedState}function tY(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var m=$i();c=uc(m);var v=dc(d,c,m);v!==null&&(yi(v,d,m),k0(v,d,m)),d={cache:Z2()},c.payload=d;return}d=d.return}}function nY(c,d,m){var v=$i();m={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},qg(c)?tN(d,m):(m=$2(c,d,m,v),m!==null&&(yi(m,c,v),nN(m,d,v)))}function eN(c,d,m){var v=$i();_0(c,d,m,v)}function _0(c,d,m,v){var C={lane:v,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(qg(c))tN(d,C);else{var E=c.alternate;if(c.lanes===0&&(E===null||E.lanes===0)&&(E=d.lastRenderedReducer,E!==null))try{var D=d.lastRenderedState,$=E(D,m);if(C.hasEagerState=!0,C.eagerState=$,Di($,D))return Eg(c,d,C,0),ir===null&&kg(),!1}catch{}if(m=$2(c,d,C,v),m!==null)return yi(m,c,v),nN(m,d,v),!0}return!1}function Sw(c,d,m,v){if(v={lane:2,revertLane:e4(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},qg(c)){if(d)throw Error(r(479))}else d=$2(c,m,v,2),d!==null&&yi(d,c,2)}function qg(c){var d=c.alternate;return c===Yt||d!==null&&d===Yt}function tN(c,d){hf=Pg=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function nN(c,d,m){if((m&4194048)!==0){var v=d.lanes;v&=c.pendingLanes,m|=v,d.lanes=m,dt(c,m)}}var R0={readContext:Os,use:Fg,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useLayoutEffect:jr,useInsertionEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useSyncExternalStore:jr,useId:jr,useHostTransitionStatus:jr,useFormState:jr,useActionState:jr,useOptimistic:jr,useMemoCache:jr,useCacheRefresh:jr};R0.useEffectEvent=jr;var rN={readContext:Os,use:Fg,useCallback:function(c,d){return Qs().memoizedState=[c,d===void 0?null:d],c},useContext:Os,useEffect:B8,useImperativeHandle:function(c,d,m){m=m!=null?m.concat([c]):null,Ug(4194308,4,V8.bind(null,d,c),m)},useLayoutEffect:function(c,d){return Ug(4194308,4,c,d)},useInsertionEffect:function(c,d){Ug(4,2,c,d)},useMemo:function(c,d){var m=Qs();d=d===void 0?null:d;var v=c();if(Hu){_n(!0);try{c()}finally{_n(!1)}}return m.memoizedState=[v,d],v},useReducer:function(c,d,m){var v=Qs();if(m!==void 0){var C=m(d);if(Hu){_n(!0);try{m(d)}finally{_n(!1)}}}else C=d;return v.memoizedState=v.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},v.queue=c,c=c.dispatch=nY.bind(null,Yt,c),[v.memoizedState,c]},useRef:function(c){var d=Qs();return c={current:c},d.memoizedState=c},useState:function(c){c=mw(c);var d=c.queue,m=eN.bind(null,Yt,d);return d.dispatch=m,[c.memoizedState,m]},useDebugValue:vw,useDeferredValue:function(c,d){var m=Qs();return yw(m,c,d)},useTransition:function(){var c=mw(!1);return c=Y8.bind(null,Yt,c.queue,!0,!1),Qs().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,m){var v=Yt,C=Qs();if(mn){if(m===void 0)throw Error(r(407));m=m()}else{if(m=d(),ir===null)throw Error(r(349));(fn&127)!==0||k8(v,d,m)}C.memoizedState=m;var E={value:m,getSnapshot:d};return C.queue=E,B8(N8.bind(null,v,E,c),[c]),v.flags|=2048,mf(9,{destroy:void 0},E8.bind(null,v,E,m,d),null),m},useId:function(){var c=Qs(),d=ir.identifierPrefix;if(mn){var m=da,v=ua;m=(v&~(1<<32-_t(v)-1)).toString(32)+m,d="_"+d+"R_"+m,m=$g++,0<m&&(d+="H"+m.toString(32)),d+="_"}else m=YK++,d="_"+d+"r_"+m.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:ww,useFormState:I8,useActionState:I8,useOptimistic:function(c){var d=Qs();d.memoizedState=d.baseState=c;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=m,d=Sw.bind(null,Yt,!0,m),m.dispatch=d,[c,d]},useMemoCache:fw,useCacheRefresh:function(){return Qs().memoizedState=tY.bind(null,Yt)},useEffectEvent:function(c){var d=Qs(),m={impl:c};return d.memoizedState=m,function(){if((Rn&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},Cw={readContext:Os,use:Fg,useCallback:G8,useContext:Os,useEffect:bw,useImperativeHandle:q8,useInsertionEffect:H8,useLayoutEffect:U8,useMemo:W8,useReducer:Hg,useRef:$8,useState:function(){return Hg(ol)},useDebugValue:vw,useDeferredValue:function(c,d){var m=Vr();return K8(m,er.memoizedState,c,d)},useTransition:function(){var c=Hg(ol)[0],d=Vr().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:C8,useId:Q8,useHostTransitionStatus:ww,useFormState:z8,useActionState:z8,useOptimistic:function(c,d){var m=Vr();return _8(m,er,c,d)},useMemoCache:fw,useCacheRefresh:J8};Cw.useEffectEvent=F8;var sN={readContext:Os,use:Fg,useCallback:G8,useContext:Os,useEffect:bw,useImperativeHandle:q8,useInsertionEffect:H8,useLayoutEffect:U8,useMemo:W8,useReducer:pw,useRef:$8,useState:function(){return pw(ol)},useDebugValue:vw,useDeferredValue:function(c,d){var m=Vr();return er===null?yw(m,c,d):K8(m,er.memoizedState,c,d)},useTransition:function(){var c=pw(ol)[0],d=Vr().memoizedState;return[typeof c=="boolean"?c:T0(c),d]},useSyncExternalStore:C8,useId:Q8,useHostTransitionStatus:ww,useFormState:P8,useActionState:P8,useOptimistic:function(c,d){var m=Vr();return er!==null?_8(m,er,c,d):(m.baseState=c,[c,m.queue.dispatch])},useMemoCache:fw,useCacheRefresh:J8};sN.useEffectEvent=F8;function kw(c,d,m,v){d=c.memoizedState,m=m(v,d),m=m==null?d:p({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var Ew={enqueueSetState:function(c,d,m){c=c._reactInternals;var v=$i(),C=uc(v);C.payload=d,m!=null&&(C.callback=m),d=dc(c,C,v),d!==null&&(yi(d,c,v),k0(d,c,v))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var v=$i(),C=uc(v);C.tag=1,C.payload=d,m!=null&&(C.callback=m),d=dc(c,C,v),d!==null&&(yi(d,c,v),k0(d,c,v))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=$i(),v=uc(m);v.tag=2,d!=null&&(v.callback=d),d=dc(c,v,m),d!==null&&(yi(d,c,m),k0(d,c,m))}};function iN(c,d,m,v,C,E,D){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(v,E,D):d.prototype&&d.prototype.isPureReactComponent?!g0(m,v)||!g0(C,E):!0}function oN(c,d,m,v){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,v),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,v),d.state!==c&&Ew.enqueueReplaceState(d,d.state,null)}function Uu(c,d){var m=d;if("ref"in d){m={};for(var v in d)v!=="ref"&&(m[v]=d[v])}if(c=c.defaultProps){m===d&&(m=p({},m));for(var C in c)m[C]===void 0&&(m[C]=c[C])}return m}function aN(c){Cg(c)}function lN(c){console.error(c)}function cN(c){Cg(c)}function Gg(c,d){try{var m=c.onUncaughtError;m(d.value,{componentStack:d.stack})}catch(v){setTimeout(function(){throw v})}}function uN(c,d,m){try{var v=c.onCaughtError;v(m.value,{componentStack:m.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Nw(c,d,m){return m=uc(m),m.tag=3,m.payload={element:null},m.callback=function(){Gg(c,d)},m}function dN(c){return c=uc(c),c.tag=3,c}function fN(c,d,m,v){var C=m.type.getDerivedStateFromError;if(typeof C=="function"){var E=v.value;c.payload=function(){return C(E)},c.callback=function(){uN(d,m,v)}}var D=m.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(c.callback=function(){uN(d,m,v),typeof C!="function"&&(bc===null?bc=new Set([this]):bc.add(this));var $=v.stack;this.componentDidCatch(v.value,{componentStack:$!==null?$:""})})}function rY(c,d,m,v,C){if(m.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(d=m.alternate,d!==null&&af(d,m,C,!0),m=Ii.current,m!==null){switch(m.tag){case 31:case 13:return uo===null?s1():m.alternate===null&&Ir===0&&(Ir=3),m.flags&=-257,m.flags|=65536,m.lanes=C,v===Dg?m.flags|=16384:(d=m.updateQueue,d===null?m.updateQueue=new Set([v]):d.add(v),Xw(c,v,C)),!1;case 22:return m.flags|=65536,v===Dg?m.flags|=16384:(d=m.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([v])},m.updateQueue=d):(m=d.retryQueue,m===null?d.retryQueue=new Set([v]):m.add(v)),Xw(c,v,C)),!1}throw Error(r(435,m.tag))}return Xw(c,v,C),s1(),!1}if(mn)return d=Ii.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=C,v!==q2&&(c=Error(r(422),{cause:v}),y0(oo(c,m)))):(v!==q2&&(d=Error(r(423),{cause:v}),y0(oo(d,m))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,v=oo(v,m),C=Nw(c.stateNode,v,C),nw(c,C),Ir!==4&&(Ir=2)),!1;var E=Error(r(520),{cause:v});if(E=oo(E,m),P0===null?P0=[E]:P0.push(E),Ir!==4&&(Ir=2),d===null)return!0;v=oo(v,m),m=d;do{switch(m.tag){case 3:return m.flags|=65536,c=C&-C,m.lanes|=c,c=Nw(m.stateNode,v,c),nw(m,c),!1;case 1:if(d=m.type,E=m.stateNode,(m.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(bc===null||!bc.has(E))))return m.flags|=65536,C&=-C,m.lanes|=C,C=dN(C),fN(C,c,m,v),nw(m,C),!1}m=m.return}while(m!==null);return!1}var Mw=Error(r(461)),Jr=!1;function Ds(c,d,m,v){d.child=c===null?g8(d,null,m,v):Fu(d,c.child,m,v)}function hN(c,d,m,v,C){m=m.render;var E=d.ref;if("ref"in v){var D={};for(var $ in v)$!=="ref"&&(D[$]=v[$])}else D=v;return Lu(d),v=lw(c,d,m,D,E,C),$=cw(),c!==null&&!Jr?(uw(c,d,C),al(c,d,C)):(mn&&$&&U2(d),d.flags|=1,Ds(c,d,v,C),d.child)}function pN(c,d,m,v,C){if(c===null){var E=m.type;return typeof E=="function"&&!B2(E)&&E.defaultProps===void 0&&m.compare===null?(d.tag=15,d.type=E,mN(c,d,E,v,C)):(c=Mg(m.type,null,v,d,d.mode,C),c.ref=d.ref,c.return=d,d.child=c)}if(E=c.child,!Iw(c,C)){var D=E.memoizedProps;if(m=m.compare,m=m!==null?m:g0,m(D,v)&&c.ref===d.ref)return al(c,d,C)}return d.flags|=1,c=tl(E,v),c.ref=d.ref,c.return=d,d.child=c}function mN(c,d,m,v,C){if(c!==null){var E=c.memoizedProps;if(g0(E,v)&&c.ref===d.ref)if(Jr=!1,d.pendingProps=v=E,Iw(c,C))(c.flags&131072)!==0&&(Jr=!0);else return d.lanes=c.lanes,al(c,d,C)}return Tw(c,d,m,v,C)}function gN(c,d,m,v){var C=v.children,E=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((d.flags&128)!==0){if(E=E!==null?E.baseLanes|m:m,c!==null){for(v=d.child=c.child,C=0;v!==null;)C=C|v.lanes|v.childLanes,v=v.sibling;v=C&~E}else v=0,d.child=null;return bN(c,d,E,m,v)}if((m&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&Ag(d,E!==null?E.cachePool:null),E!==null?y8(d,E):sw(),x8(d);else return v=d.lanes=536870912,bN(c,d,E!==null?E.baseLanes|m:m,m,v)}else E!==null?(Ag(d,E.cachePool),y8(d,E),hc(),d.memoizedState=null):(c!==null&&Ag(d,null),sw(),hc());return Ds(c,d,C,m),d.child}function A0(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function bN(c,d,m,v,C){var E=Q2();return E=E===null?null:{parent:Xr._currentValue,pool:E},d.memoizedState={baseLanes:m,cachePool:E},c!==null&&Ag(d,null),sw(),x8(d),c!==null&&af(c,d,v,!0),d.childLanes=C,null}function Wg(c,d){return d=Yg({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function vN(c,d,m){return Fu(d,c.child,null,m),c=Wg(d,d.pendingProps),c.flags|=2,zi(d),d.memoizedState=null,c}function sY(c,d,m){var v=d.pendingProps,C=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(mn){if(v.mode==="hidden")return c=Wg(d,v),d.lanes=536870912,A0(null,c);if(ow(d),(c=pr)?(c=R9(c,co),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ic!==null?{id:ua,overflow:da}:null,retryLane:536870912,hydrationErrors:null},m=t8(c),m.return=d,d.child=m,As=d,pr=null)):c=null,c===null)throw ac(d);return d.lanes=536870912,null}return Wg(d,v)}var E=c.memoizedState;if(E!==null){var D=E.dehydrated;if(ow(d),C)if(d.flags&256)d.flags&=-257,d=vN(c,d,m);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(Jr||af(c,d,m,!1),C=(m&c.childLanes)!==0,Jr||C){if(v=ir,v!==null&&(D=G(v,m),D!==0&&D!==E.retryLane))throw E.retryLane=D,Du(c,D),yi(v,c,D),Mw;s1(),d=vN(c,d,m)}else c=E.treeContext,pr=fo(D.nextSibling),As=d,mn=!0,oc=null,co=!1,c!==null&&s8(d,c),d=Wg(d,v),d.flags|=4096;return d}return c=tl(c.child,{mode:v.mode,children:v.children}),c.ref=d.ref,d.child=c,c.return=d,c}function Kg(c,d){var m=d.ref;if(m===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(c===null||c.ref!==m)&&(d.flags|=4194816)}}function Tw(c,d,m,v,C){return Lu(d),m=lw(c,d,m,v,void 0,C),v=cw(),c!==null&&!Jr?(uw(c,d,C),al(c,d,C)):(mn&&v&&U2(d),d.flags|=1,Ds(c,d,m,C),d.child)}function yN(c,d,m,v,C,E){return Lu(d),d.updateQueue=null,m=S8(d,v,m,C),w8(c),v=cw(),c!==null&&!Jr?(uw(c,d,E),al(c,d,E)):(mn&&v&&U2(d),d.flags|=1,Ds(c,d,m,E),d.child)}function xN(c,d,m,v,C){if(Lu(d),d.stateNode===null){var E=nf,D=m.contextType;typeof D=="object"&&D!==null&&(E=Os(D)),E=new m(v,E),d.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Ew,d.stateNode=E,E._reactInternals=d,E=d.stateNode,E.props=v,E.state=d.memoizedState,E.refs={},ew(d),D=m.contextType,E.context=typeof D=="object"&&D!==null?Os(D):nf,E.state=d.memoizedState,D=m.getDerivedStateFromProps,typeof D=="function"&&(kw(d,m,D,v),E.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(D=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),D!==E.state&&Ew.enqueueReplaceState(E,E.state,null),N0(d,v,E,C),E0(),E.state=d.memoizedState),typeof E.componentDidMount=="function"&&(d.flags|=4194308),v=!0}else if(c===null){E=d.stateNode;var $=d.memoizedProps,J=Uu(m,$);E.props=J;var ve=E.context,Ee=m.contextType;D=nf,typeof Ee=="object"&&Ee!==null&&(D=Os(Ee));var _e=m.getDerivedStateFromProps;Ee=typeof _e=="function"||typeof E.getSnapshotBeforeUpdate=="function",$=d.pendingProps!==$,Ee||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($||ve!==D)&&oN(d,E,v,D),cc=!1;var ye=d.memoizedState;E.state=ye,N0(d,v,E,C),E0(),ve=d.memoizedState,$||ye!==ve||cc?(typeof _e=="function"&&(kw(d,m,_e,v),ve=d.memoizedState),(J=cc||iN(d,m,J,v,ye,ve,D))?(Ee||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(d.flags|=4194308)):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=v,d.memoizedState=ve),E.props=v,E.state=ve,E.context=D,v=J):(typeof E.componentDidMount=="function"&&(d.flags|=4194308),v=!1)}else{E=d.stateNode,tw(c,d),D=d.memoizedProps,Ee=Uu(m,D),E.props=Ee,_e=d.pendingProps,ye=E.context,ve=m.contextType,J=nf,typeof ve=="object"&&ve!==null&&(J=Os(ve)),$=m.getDerivedStateFromProps,(ve=typeof $=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==_e||ye!==J)&&oN(d,E,v,J),cc=!1,ye=d.memoizedState,E.state=ye,N0(d,v,E,C),E0();var Se=d.memoizedState;D!==_e||ye!==Se||cc||c!==null&&c.dependencies!==null&&_g(c.dependencies)?(typeof $=="function"&&(kw(d,m,$,v),Se=d.memoizedState),(Ee=cc||iN(d,m,Ee,v,ye,Se,J)||c!==null&&c.dependencies!==null&&_g(c.dependencies))?(ve||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(v,Se,J),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(v,Se,J)),typeof E.componentDidUpdate=="function"&&(d.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=1024),d.memoizedProps=v,d.memoizedState=Se),E.props=v,E.state=Se,E.context=J,v=Ee):(typeof E.componentDidUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ye===c.memoizedState||(d.flags|=1024),v=!1)}return E=v,Kg(c,d),v=(d.flags&128)!==0,E||v?(E=d.stateNode,m=v&&typeof m.getDerivedStateFromError!="function"?null:E.render(),d.flags|=1,c!==null&&v?(d.child=Fu(d,c.child,null,C),d.child=Fu(d,null,m,C)):Ds(c,d,m,C),d.memoizedState=E.state,c=d.child):c=al(c,d,C),c}function wN(c,d,m,v){return Iu(),d.flags|=256,Ds(c,d,m,v),d.child}var _w={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rw(c){return{baseLanes:c,cachePool:u8()}}function Aw(c,d,m){return c=c!==null?c.childLanes&~m:0,d&&(c|=Pi),c}function SN(c,d,m){var v=d.pendingProps,C=!1,E=(d.flags&128)!==0,D;if((D=E)||(D=c!==null&&c.memoizedState===null?!1:(Ur.current&2)!==0),D&&(C=!0,d.flags&=-129),D=(d.flags&32)!==0,d.flags&=-33,c===null){if(mn){if(C?fc(d):hc(),(c=pr)?(c=R9(c,co),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ic!==null?{id:ua,overflow:da}:null,retryLane:536870912,hydrationErrors:null},m=t8(c),m.return=d,d.child=m,As=d,pr=null)):c=null,c===null)throw ac(d);return h4(c)?d.lanes=32:d.lanes=536870912,null}var $=v.children;return v=v.fallback,C?(hc(),C=d.mode,$=Yg({mode:"hidden",children:$},C),v=ju(v,C,m,null),$.return=d,v.return=d,$.sibling=v,d.child=$,v=d.child,v.memoizedState=Rw(m),v.childLanes=Aw(c,D,m),d.memoizedState=_w,A0(null,v)):(fc(d),Ow(d,$))}var J=c.memoizedState;if(J!==null&&($=J.dehydrated,$!==null)){if(E)d.flags&256?(fc(d),d.flags&=-257,d=Dw(c,d,m)):d.memoizedState!==null?(hc(),d.child=c.child,d.flags|=128,d=null):(hc(),$=v.fallback,C=d.mode,v=Yg({mode:"visible",children:v.children},C),$=ju($,C,m,null),$.flags|=2,v.return=d,$.return=d,v.sibling=$,d.child=v,Fu(d,c.child,null,m),v=d.child,v.memoizedState=Rw(m),v.childLanes=Aw(c,D,m),d.memoizedState=_w,d=A0(null,v));else if(fc(d),h4($)){if(D=$.nextSibling&&$.nextSibling.dataset,D)var ve=D.dgst;D=ve,v=Error(r(419)),v.stack="",v.digest=D,y0({value:v,source:null,stack:null}),d=Dw(c,d,m)}else if(Jr||af(c,d,m,!1),D=(m&c.childLanes)!==0,Jr||D){if(D=ir,D!==null&&(v=G(D,m),v!==0&&v!==J.retryLane))throw J.retryLane=v,Du(c,v),yi(D,c,v),Mw;f4($)||s1(),d=Dw(c,d,m)}else f4($)?(d.flags|=192,d.child=c.child,d=null):(c=J.treeContext,pr=fo($.nextSibling),As=d,mn=!0,oc=null,co=!1,c!==null&&s8(d,c),d=Ow(d,v.children),d.flags|=4096);return d}return C?(hc(),$=v.fallback,C=d.mode,J=c.child,ve=J.sibling,v=tl(J,{mode:"hidden",children:v.children}),v.subtreeFlags=J.subtreeFlags&65011712,ve!==null?$=tl(ve,$):($=ju($,C,m,null),$.flags|=2),$.return=d,v.return=d,v.sibling=$,d.child=v,A0(null,v),v=d.child,$=c.child.memoizedState,$===null?$=Rw(m):(C=$.cachePool,C!==null?(J=Xr._currentValue,C=C.parent!==J?{parent:J,pool:J}:C):C=u8(),$={baseLanes:$.baseLanes|m,cachePool:C}),v.memoizedState=$,v.childLanes=Aw(c,D,m),d.memoizedState=_w,A0(c.child,v)):(fc(d),m=c.child,c=m.sibling,m=tl(m,{mode:"visible",children:v.children}),m.return=d,m.sibling=null,c!==null&&(D=d.deletions,D===null?(d.deletions=[c],d.flags|=16):D.push(c)),d.child=m,d.memoizedState=null,m)}function Ow(c,d){return d=Yg({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function Yg(c,d){return c=ji(22,c,null,d),c.lanes=0,c}function Dw(c,d,m){return Fu(d,c.child,null,m),c=Ow(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function CN(c,d,m){c.lanes|=d;var v=c.alternate;v!==null&&(v.lanes|=d),K2(c.return,d,m)}function jw(c,d,m,v,C,E){var D=c.memoizedState;D===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:v,tail:m,tailMode:C,treeForkCount:E}:(D.isBackwards=d,D.rendering=null,D.renderingStartTime=0,D.last=v,D.tail=m,D.tailMode=C,D.treeForkCount=E)}function kN(c,d,m){var v=d.pendingProps,C=v.revealOrder,E=v.tail;v=v.children;var D=Ur.current,$=(D&2)!==0;if($?(D=D&1|2,d.flags|=128):D&=1,X(Ur,D),Ds(c,d,v,m),v=mn?v0:0,!$&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&CN(c,m,d);else if(c.tag===19)CN(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(C){case"forwards":for(m=d.child,C=null;m!==null;)c=m.alternate,c!==null&&Lg(c)===null&&(C=m),m=m.sibling;m=C,m===null?(C=d.child,d.child=null):(C=m.sibling,m.sibling=null),jw(d,!1,C,m,E,v);break;case"backwards":case"unstable_legacy-backwards":for(m=null,C=d.child,d.child=null;C!==null;){if(c=C.alternate,c!==null&&Lg(c)===null){d.child=C;break}c=C.sibling,C.sibling=m,m=C,C=c}jw(d,!0,m,null,E,v);break;case"together":jw(d,!1,null,null,void 0,v);break;default:d.memoizedState=null}return d.child}function al(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),gc|=d.lanes,(m&d.childLanes)===0)if(c!==null){if(af(c,d,m,!1),(m&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,m=tl(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=tl(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function Iw(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&_g(c)))}function iY(c,d,m){switch(d.tag){case 3:Re(d,d.stateNode.containerInfo),lc(d,Xr,c.memoizedState.cache),Iu();break;case 27:case 5:Ze(d);break;case 4:Re(d,d.stateNode.containerInfo);break;case 10:lc(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,ow(d),null;break;case 13:var v=d.memoizedState;if(v!==null)return v.dehydrated!==null?(fc(d),d.flags|=128,null):(m&d.child.childLanes)!==0?SN(c,d,m):(fc(d),c=al(c,d,m),c!==null?c.sibling:null);fc(d);break;case 19:var C=(c.flags&128)!==0;if(v=(m&d.childLanes)!==0,v||(af(c,d,m,!1),v=(m&d.childLanes)!==0),C){if(v)return kN(c,d,m);d.flags|=128}if(C=d.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),X(Ur,Ur.current),v)break;return null;case 22:return d.lanes=0,gN(c,d,m,d.pendingProps);case 24:lc(d,Xr,c.memoizedState.cache)}return al(c,d,m)}function EN(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps)Jr=!0;else{if(!Iw(c,m)&&(d.flags&128)===0)return Jr=!1,iY(c,d,m);Jr=(c.flags&131072)!==0}else Jr=!1,mn&&(d.flags&1048576)!==0&&r8(d,v0,d.index);switch(d.lanes=0,d.tag){case 16:e:{var v=d.pendingProps;if(c=$u(d.elementType),d.type=c,typeof c=="function")B2(c)?(v=Uu(c,v),d.tag=1,d=xN(null,d,c,v,m)):(d.tag=0,d=Tw(null,d,c,v,m));else{if(c!=null){var C=c.$$typeof;if(C===R){d.tag=11,d=hN(null,d,c,v,m);break e}else if(C===I){d.tag=14,d=pN(null,d,c,v,m);break e}}throw d=le(c)||c,Error(r(306,d,""))}}return d;case 0:return Tw(c,d,d.type,d.pendingProps,m);case 1:return v=d.type,C=Uu(v,d.pendingProps),xN(c,d,v,C,m);case 3:e:{if(Re(d,d.stateNode.containerInfo),c===null)throw Error(r(387));v=d.pendingProps;var E=d.memoizedState;C=E.element,tw(c,d),N0(d,v,null,m);var D=d.memoizedState;if(v=D.cache,lc(d,Xr,v),v!==E.cache&&Y2(d,[Xr],m,!0),E0(),v=D.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:D.cache},d.updateQueue.baseState=E,d.memoizedState=E,d.flags&256){d=wN(c,d,v,m);break e}else if(v!==C){C=oo(Error(r(424)),d),y0(C),d=wN(c,d,v,m);break e}else for(c=d.stateNode.containerInfo,c.nodeType===9?c=c.body:c=c.nodeName==="HTML"?c.ownerDocument.body:c,pr=fo(c.firstChild),As=d,mn=!0,oc=null,co=!0,m=g8(d,null,v,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Iu(),v===C){d=al(c,d,m);break e}Ds(c,d,v,m)}d=d.child}return d;case 26:return Kg(c,d),c===null?(m=z9(d.type,null,d.pendingProps,null))?d.memoizedState=m:mn||(m=d.type,c=d.pendingProps,v=d1(we.current).createElement(m),v[Qe]=d,v[et]=c,js(v,m,c),Jn(v),d.stateNode=v):d.memoizedState=z9(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return Ze(d),c===null&&mn&&(v=d.stateNode=D9(d.type,d.pendingProps,we.current),As=d,co=!0,C=pr,wc(d.type)?(p4=C,pr=fo(v.firstChild)):pr=C),Ds(c,d,d.pendingProps.children,m),Kg(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&mn&&((C=v=pr)&&(v=IY(v,d.type,d.pendingProps,co),v!==null?(d.stateNode=v,As=d,pr=fo(v.firstChild),co=!1,C=!0):C=!1),C||ac(d)),Ze(d),C=d.type,E=d.pendingProps,D=c!==null?c.memoizedProps:null,v=E.children,c4(C,E)?v=null:D!==null&&c4(C,D)&&(d.flags|=32),d.memoizedState!==null&&(C=lw(c,d,ZK,null,null,m),G0._currentValue=C),Kg(c,d),Ds(c,d,v,m),d.child;case 6:return c===null&&mn&&((c=m=pr)&&(m=zY(m,d.pendingProps,co),m!==null?(d.stateNode=m,As=d,pr=null,c=!0):c=!1),c||ac(d)),null;case 13:return SN(c,d,m);case 4:return Re(d,d.stateNode.containerInfo),v=d.pendingProps,c===null?d.child=Fu(d,null,v,m):Ds(c,d,v,m),d.child;case 11:return hN(c,d,d.type,d.pendingProps,m);case 7:return Ds(c,d,d.pendingProps,m),d.child;case 8:return Ds(c,d,d.pendingProps.children,m),d.child;case 12:return Ds(c,d,d.pendingProps.children,m),d.child;case 10:return v=d.pendingProps,lc(d,d.type,v.value),Ds(c,d,v.children,m),d.child;case 9:return C=d.type._context,v=d.pendingProps.children,Lu(d),C=Os(C),v=v(C),d.flags|=1,Ds(c,d,v,m),d.child;case 14:return pN(c,d,d.type,d.pendingProps,m);case 15:return mN(c,d,d.type,d.pendingProps,m);case 19:return kN(c,d,m);case 31:return sY(c,d,m);case 22:return gN(c,d,m,d.pendingProps);case 24:return Lu(d),v=Os(Xr),c===null?(C=Q2(),C===null&&(C=ir,E=Z2(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=m),C=E),d.memoizedState={parent:v,cache:C},ew(d),lc(d,Xr,C)):((c.lanes&m)!==0&&(tw(c,d),N0(d,null,null,m),E0()),C=c.memoizedState,E=d.memoizedState,C.parent!==v?(C={parent:v,cache:v},d.memoizedState=C,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=C),lc(d,Xr,v)):(v=E.cache,lc(d,Xr,v),v!==C.cache&&Y2(d,[Xr],m,!0))),Ds(c,d,d.pendingProps.children,m),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function ll(c){c.flags|=4}function zw(c,d,m,v,C){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(C&335544128)===C)if(c.stateNode.complete)c.flags|=8192;else if(QN())c.flags|=8192;else throw Bu=Dg,J2}else c.flags&=-16777217}function NN(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!F9(d))if(QN())c.flags|=8192;else throw Bu=Dg,J2}function Zg(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?je():536870912,c.lanes|=d,yf|=d)}function O0(c,d){if(!mn)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var v=null;m!==null;)m.alternate!==null&&(v=m),m=m.sibling;v===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:v.sibling=null}}function mr(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,v=0;if(d)for(var C=c.child;C!==null;)m|=C.lanes|C.childLanes,v|=C.subtreeFlags&65011712,v|=C.flags&65011712,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)m|=C.lanes|C.childLanes,v|=C.subtreeFlags,v|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=v,c.childLanes=m,d}function oY(c,d,m){var v=d.pendingProps;switch(V2(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mr(d),null;case 1:return mr(d),null;case 3:return m=d.stateNode,v=null,c!==null&&(v=c.memoizedState.cache),d.memoizedState.cache!==v&&(d.flags|=2048),sl(Xr),Ae(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(c===null||c.child===null)&&(of(d)?ll(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,G2())),mr(d),null;case 26:var C=d.type,E=d.memoizedState;return c===null?(ll(d),E!==null?(mr(d),NN(d,E)):(mr(d),zw(d,C,null,v,m))):E?E!==c.memoizedState?(ll(d),mr(d),NN(d,E)):(mr(d),d.flags&=-16777217):(c=c.memoizedProps,c!==v&&ll(d),mr(d),zw(d,C,c,v,m)),null;case 27:if(nt(d),m=we.current,C=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(!v){if(d.stateNode===null)throw Error(r(166));return mr(d),null}c=de.current,of(d)?i8(d):(c=D9(C,v,m),d.stateNode=c,ll(d))}return mr(d),null;case 5:if(nt(d),C=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(!v){if(d.stateNode===null)throw Error(r(166));return mr(d),null}if(E=de.current,of(d))i8(d);else{var D=d1(we.current);switch(E){case 1:E=D.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:E=D.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":E=D.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":E=D.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":E=D.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof v.is=="string"?D.createElement("select",{is:v.is}):D.createElement("select"),v.multiple?E.multiple=!0:v.size&&(E.size=v.size);break;default:E=typeof v.is=="string"?D.createElement(C,{is:v.is}):D.createElement(C)}}E[Qe]=d,E[et]=v;e:for(D=d.child;D!==null;){if(D.tag===5||D.tag===6)E.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===d)break e;for(;D.sibling===null;){if(D.return===null||D.return===d)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}d.stateNode=E;e:switch(js(E,C,v),C){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ll(d)}}return mr(d),zw(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,m),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==v&&ll(d);else{if(typeof v!="string"&&d.stateNode===null)throw Error(r(166));if(c=we.current,of(d)){if(c=d.stateNode,m=d.memoizedProps,v=null,C=As,C!==null)switch(C.tag){case 27:case 5:v=C.memoizedProps}c[Qe]=d,c=!!(c.nodeValue===m||v!==null&&v.suppressHydrationWarning===!0||S9(c.nodeValue,m)),c||ac(d,!0)}else c=d1(c).createTextNode(v),c[Qe]=d,d.stateNode=c}return mr(d),null;case 31:if(m=d.memoizedState,c===null||c.memoizedState!==null){if(v=of(d),m!==null){if(c===null){if(!v)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[Qe]=d}else Iu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mr(d),c=!1}else m=G2(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=m),c=!0;if(!c)return d.flags&256?(zi(d),d):(zi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return mr(d),null;case 13:if(v=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=of(d),v!==null&&v.dehydrated!==null){if(c===null){if(!C)throw Error(r(318));if(C=d.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));C[Qe]=d}else Iu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mr(d),C=!1}else C=G2(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=C),C=!0;if(!C)return d.flags&256?(zi(d),d):(zi(d),null)}return zi(d),(d.flags&128)!==0?(d.lanes=m,d):(m=v!==null,c=c!==null&&c.memoizedState!==null,m&&(v=d.child,C=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(C=v.alternate.memoizedState.cachePool.pool),E=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(E=v.memoizedState.cachePool.pool),E!==C&&(v.flags|=2048)),m!==c&&m&&(d.child.flags|=8192),Zg(d,d.updateQueue),mr(d),null);case 4:return Ae(),c===null&&s4(d.stateNode.containerInfo),mr(d),null;case 10:return sl(d.type),mr(d),null;case 19:if(H(Ur),v=d.memoizedState,v===null)return mr(d),null;if(C=(d.flags&128)!==0,E=v.rendering,E===null)if(C)O0(v,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(E=Lg(c),E!==null){for(d.flags|=128,O0(v,!1),c=E.updateQueue,d.updateQueue=c,Zg(d,c),d.subtreeFlags=0,c=m,m=d.child;m!==null;)e8(m,c),m=m.sibling;return X(Ur,Ur.current&1|2),mn&&nl(d,v.treeForkCount),d.child}c=c.sibling}v.tail!==null&&Kt()>t1&&(d.flags|=128,C=!0,O0(v,!1),d.lanes=4194304)}else{if(!C)if(c=Lg(E),c!==null){if(d.flags|=128,C=!0,c=c.updateQueue,d.updateQueue=c,Zg(d,c),O0(v,!0),v.tail===null&&v.tailMode==="hidden"&&!E.alternate&&!mn)return mr(d),null}else 2*Kt()-v.renderingStartTime>t1&&m!==536870912&&(d.flags|=128,C=!0,O0(v,!1),d.lanes=4194304);v.isBackwards?(E.sibling=d.child,d.child=E):(c=v.last,c!==null?c.sibling=E:d.child=E,v.last=E)}return v.tail!==null?(c=v.tail,v.rendering=c,v.tail=c.sibling,v.renderingStartTime=Kt(),c.sibling=null,m=Ur.current,X(Ur,C?m&1|2:m&1),mn&&nl(d,v.treeForkCount),c):(mr(d),null);case 22:case 23:return zi(d),iw(),v=d.memoizedState!==null,c!==null?c.memoizedState!==null!==v&&(d.flags|=8192):v&&(d.flags|=8192),v?(m&536870912)!==0&&(d.flags&128)===0&&(mr(d),d.subtreeFlags&6&&(d.flags|=8192)):mr(d),m=d.updateQueue,m!==null&&Zg(d,m.retryQueue),m=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==m&&(d.flags|=2048),c!==null&&H(Pu),null;case 24:return m=null,c!==null&&(m=c.memoizedState.cache),d.memoizedState.cache!==m&&(d.flags|=2048),sl(Xr),mr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function aY(c,d){switch(V2(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return sl(Xr),Ae(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return nt(d),null;case 31:if(d.memoizedState!==null){if(zi(d),d.alternate===null)throw Error(r(340));Iu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(zi(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Iu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return H(Ur),null;case 4:return Ae(),null;case 10:return sl(d.type),null;case 22:case 23:return zi(d),iw(),c!==null&&H(Pu),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return sl(Xr),null;case 25:return null;default:return null}}function MN(c,d){switch(V2(d),d.tag){case 3:sl(Xr),Ae();break;case 26:case 27:case 5:nt(d);break;case 4:Ae();break;case 31:d.memoizedState!==null&&zi(d);break;case 13:zi(d);break;case 19:H(Ur);break;case 10:sl(d.type);break;case 22:case 23:zi(d),iw(),c!==null&&H(Pu);break;case 24:sl(Xr)}}function D0(c,d){try{var m=d.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var C=v.next;m=C;do{if((m.tag&c)===c){v=void 0;var E=m.create,D=m.inst;v=E(),D.destroy=v}m=m.next}while(m!==C)}}catch($){qn(d,d.return,$)}}function pc(c,d,m){try{var v=d.updateQueue,C=v!==null?v.lastEffect:null;if(C!==null){var E=C.next;v=E;do{if((v.tag&c)===c){var D=v.inst,$=D.destroy;if($!==void 0){D.destroy=void 0,C=d;var J=m,ve=$;try{ve()}catch(Ee){qn(C,J,Ee)}}}v=v.next}while(v!==E)}}catch(Ee){qn(d,d.return,Ee)}}function TN(c){var d=c.updateQueue;if(d!==null){var m=c.stateNode;try{v8(d,m)}catch(v){qn(c,c.return,v)}}}function _N(c,d,m){m.props=Uu(c.type,c.memoizedProps),m.state=c.memoizedState;try{m.componentWillUnmount()}catch(v){qn(c,d,v)}}function j0(c,d){try{var m=c.ref;if(m!==null){switch(c.tag){case 26:case 27:case 5:var v=c.stateNode;break;case 30:v=c.stateNode;break;default:v=c.stateNode}typeof m=="function"?c.refCleanup=m(v):m.current=v}}catch(C){qn(c,d,C)}}function fa(c,d){var m=c.ref,v=c.refCleanup;if(m!==null)if(typeof v=="function")try{v()}catch(C){qn(c,d,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(C){qn(c,d,C)}else m.current=null}function RN(c){var d=c.type,m=c.memoizedProps,v=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":m.autoFocus&&v.focus();break e;case"img":m.src?v.src=m.src:m.srcSet&&(v.srcset=m.srcSet)}}catch(C){qn(c,c.return,C)}}function Lw(c,d,m){try{var v=c.stateNode;_Y(v,c.type,m,d),v[et]=d}catch(C){qn(c,c.return,C)}}function AN(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&wc(c.type)||c.tag===4}function Pw(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||AN(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&wc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function $w(c,d,m){var v=c.tag;if(v===5||v===6)c=c.stateNode,d?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(c,d):(d=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,d.appendChild(c),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=Ye));else if(v!==4&&(v===27&&wc(c.type)&&(m=c.stateNode,d=null),c=c.child,c!==null))for($w(c,d,m),c=c.sibling;c!==null;)$w(c,d,m),c=c.sibling}function Xg(c,d,m){var v=c.tag;if(v===5||v===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(v!==4&&(v===27&&wc(c.type)&&(m=c.stateNode),c=c.child,c!==null))for(Xg(c,d,m),c=c.sibling;c!==null;)Xg(c,d,m),c=c.sibling}function ON(c){var d=c.stateNode,m=c.memoizedProps;try{for(var v=c.type,C=d.attributes;C.length;)d.removeAttributeNode(C[0]);js(d,v,m),d[Qe]=c,d[et]=m}catch(E){qn(c,c.return,E)}}var cl=!1,es=!1,Bw=!1,DN=typeof WeakSet=="function"?WeakSet:Set,Cs=null;function lY(c,d){if(c=c.containerInfo,a4=v1,c=q7(c),D2(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var v=m.getSelection&&m.getSelection();if(v&&v.rangeCount!==0){m=v.anchorNode;var C=v.anchorOffset,E=v.focusNode;v=v.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var D=0,$=-1,J=-1,ve=0,Ee=0,_e=c,ye=null;t:for(;;){for(var Se;_e!==m||C!==0&&_e.nodeType!==3||($=D+C),_e!==E||v!==0&&_e.nodeType!==3||(J=D+v),_e.nodeType===3&&(D+=_e.nodeValue.length),(Se=_e.firstChild)!==null;)ye=_e,_e=Se;for(;;){if(_e===c)break t;if(ye===m&&++ve===C&&($=D),ye===E&&++Ee===v&&(J=D),(Se=_e.nextSibling)!==null)break;_e=ye,ye=_e.parentNode}_e=Se}m=$===-1||J===-1?null:{start:$,end:J}}else m=null}m=m||{start:0,end:0}}else m=null;for(l4={focusedElem:c,selectionRange:m},v1=!1,Cs=d;Cs!==null;)if(d=Cs,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Cs=c;else for(;Cs!==null;){switch(d=Cs,E=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(m=0;m<c.length;m++)C=c[m],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&E!==null){c=void 0,m=d,C=E.memoizedProps,E=E.memoizedState,v=m.stateNode;try{var ft=Uu(m.type,C);c=v.getSnapshotBeforeUpdate(ft,E),v.__reactInternalSnapshotBeforeUpdate=c}catch(It){qn(m,m.return,It)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,m=c.nodeType,m===9)d4(c);else if(m===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":d4(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,Cs=c;break}Cs=d.return}}function jN(c,d,m){var v=m.flags;switch(m.tag){case 0:case 11:case 15:dl(c,m),v&4&&D0(5,m);break;case 1:if(dl(c,m),v&4)if(c=m.stateNode,d===null)try{c.componentDidMount()}catch(D){qn(m,m.return,D)}else{var C=Uu(m.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(C,d,c.__reactInternalSnapshotBeforeUpdate)}catch(D){qn(m,m.return,D)}}v&64&&TN(m),v&512&&j0(m,m.return);break;case 3:if(dl(c,m),v&64&&(c=m.updateQueue,c!==null)){if(d=null,m.child!==null)switch(m.child.tag){case 27:case 5:d=m.child.stateNode;break;case 1:d=m.child.stateNode}try{v8(c,d)}catch(D){qn(m,m.return,D)}}break;case 27:d===null&&v&4&&ON(m);case 26:case 5:dl(c,m),d===null&&v&4&&RN(m),v&512&&j0(m,m.return);break;case 12:dl(c,m);break;case 31:dl(c,m),v&4&&LN(c,m);break;case 13:dl(c,m),v&4&&PN(c,m),v&64&&(c=m.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(m=bY.bind(null,m),LY(c,m))));break;case 22:if(v=m.memoizedState!==null||cl,!v){d=d!==null&&d.memoizedState!==null||es,C=cl;var E=es;cl=v,(es=d)&&!E?fl(c,m,(m.subtreeFlags&8772)!==0):dl(c,m),cl=C,es=E}break;case 30:break;default:dl(c,m)}}function IN(c){var d=c.alternate;d!==null&&(c.alternate=null,IN(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Hn(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var vr=null,mi=!1;function ul(c,d,m){for(m=m.child;m!==null;)zN(c,d,m),m=m.sibling}function zN(c,d,m){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(Ar,m)}catch{}switch(m.tag){case 26:es||fa(m,d),ul(c,d,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:es||fa(m,d);var v=vr,C=mi;wc(m.type)&&(vr=m.stateNode,mi=!1),ul(c,d,m),U0(m.stateNode),vr=v,mi=C;break;case 5:es||fa(m,d);case 6:if(v=vr,C=mi,vr=null,ul(c,d,m),vr=v,mi=C,vr!==null)if(mi)try{(vr.nodeType===9?vr.body:vr.nodeName==="HTML"?vr.ownerDocument.body:vr).removeChild(m.stateNode)}catch(E){qn(m,d,E)}else try{vr.removeChild(m.stateNode)}catch(E){qn(m,d,E)}break;case 18:vr!==null&&(mi?(c=vr,T9(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,m.stateNode),Mf(c)):T9(vr,m.stateNode));break;case 4:v=vr,C=mi,vr=m.stateNode.containerInfo,mi=!0,ul(c,d,m),vr=v,mi=C;break;case 0:case 11:case 14:case 15:pc(2,m,d),es||pc(4,m,d),ul(c,d,m);break;case 1:es||(fa(m,d),v=m.stateNode,typeof v.componentWillUnmount=="function"&&_N(m,d,v)),ul(c,d,m);break;case 21:ul(c,d,m);break;case 22:es=(v=es)||m.memoizedState!==null,ul(c,d,m),es=v;break;default:ul(c,d,m)}}function LN(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Mf(c)}catch(m){qn(d,d.return,m)}}}function PN(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Mf(c)}catch(m){qn(d,d.return,m)}}function cY(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new DN),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new DN),d;default:throw Error(r(435,c.tag))}}function Qg(c,d){var m=cY(c);d.forEach(function(v){if(!m.has(v)){m.add(v);var C=vY.bind(null,c,v);v.then(C,C)}})}function gi(c,d){var m=d.deletions;if(m!==null)for(var v=0;v<m.length;v++){var C=m[v],E=c,D=d,$=D;e:for(;$!==null;){switch($.tag){case 27:if(wc($.type)){vr=$.stateNode,mi=!1;break e}break;case 5:vr=$.stateNode,mi=!1;break e;case 3:case 4:vr=$.stateNode.containerInfo,mi=!0;break e}$=$.return}if(vr===null)throw Error(r(160));zN(E,D,C),vr=null,mi=!1,E=C.alternate,E!==null&&(E.return=null),C.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)$N(d,c),d=d.sibling}var $o=null;function $N(c,d){var m=c.alternate,v=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:gi(d,c),bi(c),v&4&&(pc(3,c,c.return),D0(3,c),pc(5,c,c.return));break;case 1:gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),v&64&&cl&&(c=c.updateQueue,c!==null&&(v=c.callbacks,v!==null&&(m=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=m===null?v:m.concat(v))));break;case 26:var C=$o;if(gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),v&4){var E=m!==null?m.memoizedState:null;if(v=c.memoizedState,m===null)if(v===null)if(c.stateNode===null){e:{v=c.type,m=c.memoizedProps,C=C.ownerDocument||C;t:switch(v){case"title":E=C.getElementsByTagName("title")[0],(!E||E[en]||E[Qe]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=C.createElement(v),C.head.insertBefore(E,C.querySelector("head > title"))),js(E,v,m),E[Qe]=c,Jn(E),v=E;break e;case"link":var D=$9("link","href",C).get(v+(m.href||""));if(D){for(var $=0;$<D.length;$++)if(E=D[$],E.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&E.getAttribute("rel")===(m.rel==null?null:m.rel)&&E.getAttribute("title")===(m.title==null?null:m.title)&&E.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){D.splice($,1);break t}}E=C.createElement(v),js(E,v,m),C.head.appendChild(E);break;case"meta":if(D=$9("meta","content",C).get(v+(m.content||""))){for($=0;$<D.length;$++)if(E=D[$],E.getAttribute("content")===(m.content==null?null:""+m.content)&&E.getAttribute("name")===(m.name==null?null:m.name)&&E.getAttribute("property")===(m.property==null?null:m.property)&&E.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&E.getAttribute("charset")===(m.charSet==null?null:m.charSet)){D.splice($,1);break t}}E=C.createElement(v),js(E,v,m),C.head.appendChild(E);break;default:throw Error(r(468,v))}E[Qe]=c,Jn(E),v=E}c.stateNode=v}else B9(C,c.type,c.stateNode);else c.stateNode=P9(C,v,c.memoizedProps);else E!==v?(E===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):E.count--,v===null?B9(C,c.type,c.stateNode):P9(C,v,c.memoizedProps)):v===null&&c.stateNode!==null&&Lw(c,c.memoizedProps,m.memoizedProps)}break;case 27:gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),m!==null&&v&4&&Lw(c,c.memoizedProps,m.memoizedProps);break;case 5:if(gi(d,c),bi(c),v&512&&(es||m===null||fa(m,m.return)),c.flags&32){C=c.stateNode;try{Pt(C,"")}catch(ft){qn(c,c.return,ft)}}v&4&&c.stateNode!=null&&(C=c.memoizedProps,Lw(c,C,m!==null?m.memoizedProps:C)),v&1024&&(Bw=!0);break;case 6:if(gi(d,c),bi(c),v&4){if(c.stateNode===null)throw Error(r(162));v=c.memoizedProps,m=c.stateNode;try{m.nodeValue=v}catch(ft){qn(c,c.return,ft)}}break;case 3:if(p1=null,C=$o,$o=f1(d.containerInfo),gi(d,c),$o=C,bi(c),v&4&&m!==null&&m.memoizedState.isDehydrated)try{Mf(d.containerInfo)}catch(ft){qn(c,c.return,ft)}Bw&&(Bw=!1,BN(c));break;case 4:v=$o,$o=f1(c.stateNode.containerInfo),gi(d,c),bi(c),$o=v;break;case 12:gi(d,c),bi(c);break;case 31:gi(d,c),bi(c),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 13:gi(d,c),bi(c),c.child.flags&8192&&c.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(e1=Kt()),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 22:C=c.memoizedState!==null;var J=m!==null&&m.memoizedState!==null,ve=cl,Ee=es;if(cl=ve||C,es=Ee||J,gi(d,c),es=Ee,cl=ve,bi(c),v&8192)e:for(d=c.stateNode,d._visibility=C?d._visibility&-2:d._visibility|1,C&&(m===null||J||cl||es||Vu(c)),m=null,d=c;;){if(d.tag===5||d.tag===26){if(m===null){J=m=d;try{if(E=J.stateNode,C)D=E.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{$=J.stateNode;var _e=J.memoizedProps.style,ye=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;$.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(ft){qn(J,J.return,ft)}}}else if(d.tag===6){if(m===null){J=d;try{J.stateNode.nodeValue=C?"":J.memoizedProps}catch(ft){qn(J,J.return,ft)}}}else if(d.tag===18){if(m===null){J=d;try{var Se=J.stateNode;C?_9(Se,!0):_9(J.stateNode,!1)}catch(ft){qn(J,J.return,ft)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}v&4&&(v=c.updateQueue,v!==null&&(m=v.retryQueue,m!==null&&(v.retryQueue=null,Qg(c,m))));break;case 19:gi(d,c),bi(c),v&4&&(v=c.updateQueue,v!==null&&(c.updateQueue=null,Qg(c,v)));break;case 30:break;case 21:break;default:gi(d,c),bi(c)}}function bi(c){var d=c.flags;if(d&2){try{for(var m,v=c.return;v!==null;){if(AN(v)){m=v;break}v=v.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var C=m.stateNode,E=Pw(c);Xg(c,E,C);break;case 5:var D=m.stateNode;m.flags&32&&(Pt(D,""),m.flags&=-33);var $=Pw(c);Xg(c,$,D);break;case 3:case 4:var J=m.stateNode.containerInfo,ve=Pw(c);$w(c,ve,J);break;default:throw Error(r(161))}}catch(Ee){qn(c,c.return,Ee)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function BN(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;BN(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function dl(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)jN(c,d.alternate,d),d=d.sibling}function Vu(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:pc(4,d,d.return),Vu(d);break;case 1:fa(d,d.return);var m=d.stateNode;typeof m.componentWillUnmount=="function"&&_N(d,d.return,m),Vu(d);break;case 27:U0(d.stateNode);case 26:case 5:fa(d,d.return),Vu(d);break;case 22:d.memoizedState===null&&Vu(d);break;case 30:Vu(d);break;default:Vu(d)}c=c.sibling}}function fl(c,d,m){for(m=m&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var v=d.alternate,C=c,E=d,D=E.flags;switch(E.tag){case 0:case 11:case 15:fl(C,E,m),D0(4,E);break;case 1:if(fl(C,E,m),v=E,C=v.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(ve){qn(v,v.return,ve)}if(v=E,C=v.updateQueue,C!==null){var $=v.stateNode;try{var J=C.shared.hiddenCallbacks;if(J!==null)for(C.shared.hiddenCallbacks=null,C=0;C<J.length;C++)b8(J[C],$)}catch(ve){qn(v,v.return,ve)}}m&&D&64&&TN(E),j0(E,E.return);break;case 27:ON(E);case 26:case 5:fl(C,E,m),m&&v===null&&D&4&&RN(E),j0(E,E.return);break;case 12:fl(C,E,m);break;case 31:fl(C,E,m),m&&D&4&&LN(C,E);break;case 13:fl(C,E,m),m&&D&4&&PN(C,E);break;case 22:E.memoizedState===null&&fl(C,E,m),j0(E,E.return);break;case 30:break;default:fl(C,E,m)}d=d.sibling}}function Fw(c,d){var m=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==m&&(c!=null&&c.refCount++,m!=null&&x0(m))}function Hw(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&x0(c))}function Bo(c,d,m,v){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)FN(c,d,m,v),d=d.sibling}function FN(c,d,m,v){var C=d.flags;switch(d.tag){case 0:case 11:case 15:Bo(c,d,m,v),C&2048&&D0(9,d);break;case 1:Bo(c,d,m,v);break;case 3:Bo(c,d,m,v),C&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&x0(c)));break;case 12:if(C&2048){Bo(c,d,m,v),c=d.stateNode;try{var E=d.memoizedProps,D=E.id,$=E.onPostCommit;typeof $=="function"&&$(D,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(J){qn(d,d.return,J)}}else Bo(c,d,m,v);break;case 31:Bo(c,d,m,v);break;case 13:Bo(c,d,m,v);break;case 23:break;case 22:E=d.stateNode,D=d.alternate,d.memoizedState!==null?E._visibility&2?Bo(c,d,m,v):I0(c,d):E._visibility&2?Bo(c,d,m,v):(E._visibility|=2,gf(c,d,m,v,(d.subtreeFlags&10256)!==0||!1)),C&2048&&Fw(D,d);break;case 24:Bo(c,d,m,v),C&2048&&Hw(d.alternate,d);break;default:Bo(c,d,m,v)}}function gf(c,d,m,v,C){for(C=C&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var E=c,D=d,$=m,J=v,ve=D.flags;switch(D.tag){case 0:case 11:case 15:gf(E,D,$,J,C),D0(8,D);break;case 23:break;case 22:var Ee=D.stateNode;D.memoizedState!==null?Ee._visibility&2?gf(E,D,$,J,C):I0(E,D):(Ee._visibility|=2,gf(E,D,$,J,C)),C&&ve&2048&&Fw(D.alternate,D);break;case 24:gf(E,D,$,J,C),C&&ve&2048&&Hw(D.alternate,D);break;default:gf(E,D,$,J,C)}d=d.sibling}}function I0(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var m=c,v=d,C=v.flags;switch(v.tag){case 22:I0(m,v),C&2048&&Fw(v.alternate,v);break;case 24:I0(m,v),C&2048&&Hw(v.alternate,v);break;default:I0(m,v)}d=d.sibling}}var z0=8192;function bf(c,d,m){if(c.subtreeFlags&z0)for(c=c.child;c!==null;)HN(c,d,m),c=c.sibling}function HN(c,d,m){switch(c.tag){case 26:bf(c,d,m),c.flags&z0&&c.memoizedState!==null&&YY(m,$o,c.memoizedState,c.memoizedProps);break;case 5:bf(c,d,m);break;case 3:case 4:var v=$o;$o=f1(c.stateNode.containerInfo),bf(c,d,m),$o=v;break;case 22:c.memoizedState===null&&(v=c.alternate,v!==null&&v.memoizedState!==null?(v=z0,z0=16777216,bf(c,d,m),z0=v):bf(c,d,m));break;default:bf(c,d,m)}}function UN(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function L0(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];Cs=v,qN(v,c)}UN(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)VN(c),c=c.sibling}function VN(c){switch(c.tag){case 0:case 11:case 15:L0(c),c.flags&2048&&pc(9,c,c.return);break;case 3:L0(c);break;case 12:L0(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,Jg(c)):L0(c);break;default:L0(c)}}function Jg(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];Cs=v,qN(v,c)}UN(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:pc(8,d,d.return),Jg(d);break;case 22:m=d.stateNode,m._visibility&2&&(m._visibility&=-3,Jg(d));break;default:Jg(d)}c=c.sibling}}function qN(c,d){for(;Cs!==null;){var m=Cs;switch(m.tag){case 0:case 11:case 15:pc(8,m,d);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var v=m.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:x0(m.memoizedState.cache)}if(v=m.child,v!==null)v.return=m,Cs=v;else e:for(m=c;Cs!==null;){v=Cs;var C=v.sibling,E=v.return;if(IN(v),v===m){Cs=null;break e}if(C!==null){C.return=E,Cs=C;break e}Cs=E}}}var uY={getCacheForType:function(c){var d=Os(Xr),m=d.data.get(c);return m===void 0&&(m=c(),d.data.set(c,m)),m},cacheSignal:function(){return Os(Xr).controller.signal}},dY=typeof WeakMap=="function"?WeakMap:Map,Rn=0,ir=null,ln=null,fn=0,Vn=0,Li=null,mc=!1,vf=!1,Uw=!1,hl=0,Ir=0,gc=0,qu=0,Vw=0,Pi=0,yf=0,P0=null,vi=null,qw=!1,e1=0,GN=0,t1=1/0,n1=null,bc=null,us=0,vc=null,xf=null,pl=0,Gw=0,Ww=null,WN=null,$0=0,Kw=null;function $i(){return(Rn&2)!==0&&fn!==0?fn&-fn:F.T!==null?e4():ze()}function KN(){if(Pi===0)if((fn&536870912)===0||mn){var c=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Pi=c}else Pi=536870912;return c=Ii.current,c!==null&&(c.flags|=32),Pi}function yi(c,d,m){(c===ir&&(Vn===2||Vn===9)||c.cancelPendingCommit!==null)&&(wf(c,0),yc(c,fn,Pi,!1)),lt(c,m),((Rn&2)===0||c!==ir)&&(c===ir&&((Rn&2)===0&&(qu|=m),Ir===4&&yc(c,fn,Pi,!1)),ha(c))}function YN(c,d,m){if((Rn&6)!==0)throw Error(r(327));var v=!m&&(d&127)===0&&(d&c.expiredLanes)===0||Q(c,d),C=v?pY(c,d):Zw(c,d,!0),E=v;do{if(C===0){vf&&!v&&yc(c,d,0,!1);break}else{if(m=c.current.alternate,E&&!fY(m)){C=Zw(c,d,!1),E=!1;continue}if(C===2){if(E=d,c.errorRecoveryDisabledLanes&E)var D=0;else D=c.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){d=D;e:{var $=c;C=P0;var J=$.current.memoizedState.isDehydrated;if(J&&(wf($,D).flags|=256),D=Zw($,D,!1),D!==2){if(Uw&&!J){$.errorRecoveryDisabledLanes|=E,qu|=E,C=4;break e}E=vi,vi=C,E!==null&&(vi===null?vi=E:vi.push.apply(vi,E))}C=D}if(E=!1,C!==2)continue}}if(C===1){wf(c,0),yc(c,d,0,!0);break}e:{switch(v=c,E=C,E){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:yc(v,d,Pi,!mc);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(C=e1+300-Kt(),10<C)){if(yc(v,d,Pi,!mc),U(v,0,!0)!==0)break e;pl=d,v.timeoutHandle=N9(ZN.bind(null,v,m,vi,n1,qw,d,Pi,qu,yf,mc,E,"Throttled",-0,0),C);break e}ZN(v,m,vi,n1,qw,d,Pi,qu,yf,mc,E,null,-0,0)}}break}while(!0);ha(c)}function ZN(c,d,m,v,C,E,D,$,J,ve,Ee,_e,ye,Se){if(c.timeoutHandle=-1,_e=d.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ye},HN(d,E,_e);var ft=(E&62914560)===E?e1-Kt():(E&4194048)===E?GN-Kt():0;if(ft=ZY(_e,ft),ft!==null){pl=E,c.cancelPendingCommit=ft(s9.bind(null,c,d,E,m,v,C,D,$,J,Ee,_e,null,ye,Se)),yc(c,E,D,!ve);return}}s9(c,d,E,m,v,C,D,$,J)}function fY(c){for(var d=c;;){var m=d.tag;if((m===0||m===11||m===15)&&d.flags&16384&&(m=d.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var v=0;v<m.length;v++){var C=m[v],E=C.getSnapshot;C=C.value;try{if(!Di(E(),C))return!1}catch{return!1}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function yc(c,d,m,v){d&=~Vw,d&=~qu,c.suspendedLanes|=d,c.pingedLanes&=~d,v&&(c.warmLanes|=d),v=c.expirationTimes;for(var C=d;0<C;){var E=31-_t(C),D=1<<E;v[E]=-1,C&=~D}m!==0&&Xe(c,m,d)}function r1(){return(Rn&6)===0?(B0(0),!1):!0}function Yw(){if(ln!==null){if(Vn===0)var c=ln.return;else c=ln,rl=zu=null,dw(c),df=null,S0=0,c=ln;for(;c!==null;)MN(c.alternate,c),c=c.return;ln=null}}function wf(c,d){var m=c.timeoutHandle;m!==-1&&(c.timeoutHandle=-1,OY(m)),m=c.cancelPendingCommit,m!==null&&(c.cancelPendingCommit=null,m()),pl=0,Yw(),ir=c,ln=m=tl(c.current,null),fn=d,Vn=0,Li=null,mc=!1,vf=Q(c,d),Uw=!1,yf=Pi=Vw=qu=gc=Ir=0,vi=P0=null,qw=!1,(d&8)!==0&&(d|=d&32);var v=c.entangledLanes;if(v!==0)for(c=c.entanglements,v&=d;0<v;){var C=31-_t(v),E=1<<C;d|=c[C],v&=~E}return hl=d,kg(),m}function XN(c,d){Yt=null,F.H=R0,d===uf||d===Og?(d=h8(),Vn=3):d===J2?(d=h8(),Vn=4):Vn=d===Mw?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Li=d,ln===null&&(Ir=1,Gg(c,oo(d,c.current)))}function QN(){var c=Ii.current;return c===null?!0:(fn&4194048)===fn?uo===null:(fn&62914560)===fn||(fn&536870912)!==0?c===uo:!1}function JN(){var c=F.H;return F.H=R0,c===null?R0:c}function e9(){var c=F.A;return F.A=uY,c}function s1(){Ir=4,mc||(fn&4194048)!==fn&&Ii.current!==null||(vf=!0),(gc&134217727)===0&&(qu&134217727)===0||ir===null||yc(ir,fn,Pi,!1)}function Zw(c,d,m){var v=Rn;Rn|=2;var C=JN(),E=e9();(ir!==c||fn!==d)&&(n1=null,wf(c,d)),d=!1;var D=Ir;e:do try{if(Vn!==0&&ln!==null){var $=ln,J=Li;switch(Vn){case 8:Yw(),D=6;break e;case 3:case 2:case 9:case 6:Ii.current===null&&(d=!0);var ve=Vn;if(Vn=0,Li=null,Sf(c,$,J,ve),m&&vf){D=0;break e}break;default:ve=Vn,Vn=0,Li=null,Sf(c,$,J,ve)}}hY(),D=Ir;break}catch(Ee){XN(c,Ee)}while(!0);return d&&c.shellSuspendCounter++,rl=zu=null,Rn=v,F.H=C,F.A=E,ln===null&&(ir=null,fn=0,kg()),D}function hY(){for(;ln!==null;)t9(ln)}function pY(c,d){var m=Rn;Rn|=2;var v=JN(),C=e9();ir!==c||fn!==d?(n1=null,t1=Kt()+500,wf(c,d)):vf=Q(c,d);e:do try{if(Vn!==0&&ln!==null){d=ln;var E=Li;t:switch(Vn){case 1:Vn=0,Li=null,Sf(c,d,E,1);break;case 2:case 9:if(d8(E)){Vn=0,Li=null,n9(d);break}d=function(){Vn!==2&&Vn!==9||ir!==c||(Vn=7),ha(c)},E.then(d,d);break e;case 3:Vn=7;break e;case 4:Vn=5;break e;case 7:d8(E)?(Vn=0,Li=null,n9(d)):(Vn=0,Li=null,Sf(c,d,E,7));break;case 5:var D=null;switch(ln.tag){case 26:D=ln.memoizedState;case 5:case 27:var $=ln;if(D?F9(D):$.stateNode.complete){Vn=0,Li=null;var J=$.sibling;if(J!==null)ln=J;else{var ve=$.return;ve!==null?(ln=ve,i1(ve)):ln=null}break t}}Vn=0,Li=null,Sf(c,d,E,5);break;case 6:Vn=0,Li=null,Sf(c,d,E,6);break;case 8:Yw(),Ir=6;break e;default:throw Error(r(462))}}mY();break}catch(Ee){XN(c,Ee)}while(!0);return rl=zu=null,F.H=v,F.A=C,Rn=m,ln!==null?0:(ir=null,fn=0,kg(),Ir)}function mY(){for(;ln!==null&&!Nn();)t9(ln)}function t9(c){var d=EN(c.alternate,c,hl);c.memoizedProps=c.pendingProps,d===null?i1(c):ln=d}function n9(c){var d=c,m=d.alternate;switch(d.tag){case 15:case 0:d=yN(m,d,d.pendingProps,d.type,void 0,fn);break;case 11:d=yN(m,d,d.pendingProps,d.type.render,d.ref,fn);break;case 5:dw(d);default:MN(m,d),d=ln=e8(d,hl),d=EN(m,d,hl)}c.memoizedProps=c.pendingProps,d===null?i1(c):ln=d}function Sf(c,d,m,v){rl=zu=null,dw(d),df=null,S0=0;var C=d.return;try{if(rY(c,C,d,m,fn)){Ir=1,Gg(c,oo(m,c.current)),ln=null;return}}catch(E){if(C!==null)throw ln=C,E;Ir=1,Gg(c,oo(m,c.current)),ln=null;return}d.flags&32768?(mn||v===1?c=!0:vf||(fn&536870912)!==0?c=!1:(mc=c=!0,(v===2||v===9||v===3||v===6)&&(v=Ii.current,v!==null&&v.tag===13&&(v.flags|=16384))),r9(d,c)):i1(d)}function i1(c){var d=c;do{if((d.flags&32768)!==0){r9(d,mc);return}c=d.return;var m=oY(d.alternate,d,hl);if(m!==null){ln=m;return}if(d=d.sibling,d!==null){ln=d;return}ln=d=c}while(d!==null);Ir===0&&(Ir=5)}function r9(c,d){do{var m=aY(c.alternate,c);if(m!==null){m.flags&=32767,ln=m;return}if(m=c.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!d&&(c=c.sibling,c!==null)){ln=c;return}ln=c=m}while(c!==null);Ir=6,ln=null}function s9(c,d,m,v,C,E,D,$,J){c.cancelPendingCommit=null;do o1();while(us!==0);if((Rn&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(E=d.lanes|d.childLanes,E|=P2,Ke(c,m,E,D,$,J),c===ir&&(ln=ir=null,fn=0),xf=d,vc=c,pl=m,Gw=E,Ww=C,WN=v,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,yY(Bn,function(){return c9(),null})):(c.callbackNode=null,c.callbackPriority=0),v=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||v){v=F.T,F.T=null,C=te.p,te.p=2,D=Rn,Rn|=4;try{lY(c,d,m)}finally{Rn=D,te.p=C,F.T=v}}us=1,i9(),o9(),a9()}}function i9(){if(us===1){us=0;var c=vc,d=xf,m=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||m){m=F.T,F.T=null;var v=te.p;te.p=2;var C=Rn;Rn|=4;try{$N(d,c);var E=l4,D=q7(c.containerInfo),$=E.focusedElem,J=E.selectionRange;if(D!==$&&$&&$.ownerDocument&&V7($.ownerDocument.documentElement,$)){if(J!==null&&D2($)){var ve=J.start,Ee=J.end;if(Ee===void 0&&(Ee=ve),"selectionStart"in $)$.selectionStart=ve,$.selectionEnd=Math.min(Ee,$.value.length);else{var _e=$.ownerDocument||document,ye=_e&&_e.defaultView||window;if(ye.getSelection){var Se=ye.getSelection(),ft=$.textContent.length,It=Math.min(J.start,ft),nr=J.end===void 0?It:Math.min(J.end,ft);!Se.extend&&It>nr&&(D=nr,nr=It,It=D);var he=U7($,It),ae=U7($,nr);if(he&&ae&&(Se.rangeCount!==1||Se.anchorNode!==he.node||Se.anchorOffset!==he.offset||Se.focusNode!==ae.node||Se.focusOffset!==ae.offset)){var be=_e.createRange();be.setStart(he.node,he.offset),Se.removeAllRanges(),It>nr?(Se.addRange(be),Se.extend(ae.node,ae.offset)):(be.setEnd(ae.node,ae.offset),Se.addRange(be))}}}}for(_e=[],Se=$;Se=Se.parentNode;)Se.nodeType===1&&_e.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<_e.length;$++){var Te=_e[$];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}v1=!!a4,l4=a4=null}finally{Rn=C,te.p=v,F.T=m}}c.current=d,us=2}}function o9(){if(us===2){us=0;var c=vc,d=xf,m=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||m){m=F.T,F.T=null;var v=te.p;te.p=2;var C=Rn;Rn|=4;try{jN(c,d.alternate,d)}finally{Rn=C,te.p=v,F.T=m}}us=3}}function a9(){if(us===4||us===3){us=0,Pn();var c=vc,d=xf,m=pl,v=WN;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?us=5:(us=0,xf=vc=null,l9(c,c.pendingLanes));var C=c.pendingLanes;if(C===0&&(bc=null),me(m),d=d.stateNode,Qn&&typeof Qn.onCommitFiberRoot=="function")try{Qn.onCommitFiberRoot(Ar,d,void 0,(d.current.flags&128)===128)}catch{}if(v!==null){d=F.T,C=te.p,te.p=2,F.T=null;try{for(var E=c.onRecoverableError,D=0;D<v.length;D++){var $=v[D];E($.value,{componentStack:$.stack})}}finally{F.T=d,te.p=C}}(pl&3)!==0&&o1(),ha(c),C=c.pendingLanes,(m&261930)!==0&&(C&42)!==0?c===Kw?$0++:($0=0,Kw=c):$0=0,B0(0)}}function l9(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,x0(d)))}function o1(){return i9(),o9(),a9(),c9()}function c9(){if(us!==5)return!1;var c=vc,d=Gw;Gw=0;var m=me(pl),v=F.T,C=te.p;try{te.p=32>m?32:m,F.T=null,m=Ww,Ww=null;var E=vc,D=pl;if(us=0,xf=vc=null,pl=0,(Rn&6)!==0)throw Error(r(331));var $=Rn;if(Rn|=4,VN(E.current),FN(E,E.current,D,m),Rn=$,B0(0,!1),Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(Ar,E)}catch{}return!0}finally{te.p=C,F.T=v,l9(c,d)}}function u9(c,d,m){d=oo(m,d),d=Nw(c.stateNode,d,2),c=dc(c,d,2),c!==null&&(lt(c,2),ha(c))}function qn(c,d,m){if(c.tag===3)u9(c,c,m);else for(;d!==null;){if(d.tag===3){u9(d,c,m);break}else if(d.tag===1){var v=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(bc===null||!bc.has(v))){c=oo(m,c),m=dN(2),v=dc(d,m,2),v!==null&&(fN(m,v,d,c),lt(v,2),ha(v));break}}d=d.return}}function Xw(c,d,m){var v=c.pingCache;if(v===null){v=c.pingCache=new dY;var C=new Set;v.set(d,C)}else C=v.get(d),C===void 0&&(C=new Set,v.set(d,C));C.has(m)||(Uw=!0,C.add(m),c=gY.bind(null,c,d,m),d.then(c,c))}function gY(c,d,m){var v=c.pingCache;v!==null&&v.delete(d),c.pingedLanes|=c.suspendedLanes&m,c.warmLanes&=~m,ir===c&&(fn&m)===m&&(Ir===4||Ir===3&&(fn&62914560)===fn&&300>Kt()-e1?(Rn&2)===0&&wf(c,0):Vw|=m,yf===fn&&(yf=0)),ha(c)}function d9(c,d){d===0&&(d=je()),c=Du(c,d),c!==null&&(lt(c,d),ha(c))}function bY(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),d9(c,m)}function vY(c,d){var m=0;switch(c.tag){case 31:case 13:var v=c.stateNode,C=c.memoizedState;C!==null&&(m=C.retryLane);break;case 19:v=c.stateNode;break;case 22:v=c.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(d),d9(c,m)}function yY(c,d){return Xn(c,d)}var a1=null,Cf=null,Qw=!1,l1=!1,Jw=!1,xc=0;function ha(c){c!==Cf&&c.next===null&&(Cf===null?a1=Cf=c:Cf=Cf.next=c),l1=!0,Qw||(Qw=!0,wY())}function B0(c,d){if(!Jw&&l1){Jw=!0;do for(var m=!1,v=a1;v!==null;){if(c!==0){var C=v.pendingLanes;if(C===0)var E=0;else{var D=v.suspendedLanes,$=v.pingedLanes;E=(1<<31-_t(42|c)+1)-1,E&=C&~(D&~$),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(m=!0,m9(v,E))}else E=fn,E=U(v,v===ir?E:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(E&3)===0||Q(v,E)||(m=!0,m9(v,E));v=v.next}while(m);Jw=!1}}function xY(){f9()}function f9(){l1=Qw=!1;var c=0;xc!==0&&AY()&&(c=xc);for(var d=Kt(),m=null,v=a1;v!==null;){var C=v.next,E=h9(v,d);E===0?(v.next=null,m===null?a1=C:m.next=C,C===null&&(Cf=m)):(m=v,(c!==0||(E&3)!==0)&&(l1=!0)),v=C}us!==0&&us!==5||B0(c),xc!==0&&(xc=0)}function h9(c,d){for(var m=c.suspendedLanes,v=c.pingedLanes,C=c.expirationTimes,E=c.pendingLanes&-62914561;0<E;){var D=31-_t(E),$=1<<D,J=C[D];J===-1?(($&m)===0||($&v)!==0)&&(C[D]=ge($,d)):J<=d&&(c.expiredLanes|=$),E&=~$}if(d=ir,m=fn,m=U(c,c===d?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),v=c.callbackNode,m===0||c===d&&(Vn===2||Vn===9)||c.cancelPendingCommit!==null)return v!==null&&v!==null&&sr(v),c.callbackNode=null,c.callbackPriority=0;if((m&3)===0||Q(c,m)){if(d=m&-m,d===c.callbackPriority)return d;switch(v!==null&&sr(v),me(m)){case 2:case 8:m=$n;break;case 32:m=Bn;break;case 268435456:m=Fn;break;default:m=Bn}return v=p9.bind(null,c),m=Xn(m,v),c.callbackPriority=d,c.callbackNode=m,d}return v!==null&&v!==null&&sr(v),c.callbackPriority=2,c.callbackNode=null,2}function p9(c,d){if(us!==0&&us!==5)return c.callbackNode=null,c.callbackPriority=0,null;var m=c.callbackNode;if(o1()&&c.callbackNode!==m)return null;var v=fn;return v=U(c,c===ir?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),v===0?null:(YN(c,v,d),h9(c,Kt()),c.callbackNode!=null&&c.callbackNode===m?p9.bind(null,c):null)}function m9(c,d){if(o1())return null;YN(c,d,!0)}function wY(){DY(function(){(Rn&6)!==0?Xn(Nt,xY):f9()})}function e4(){if(xc===0){var c=lf;c===0&&(c=ke,ke<<=1,(ke&261888)===0&&(ke=256)),xc=c}return xc}function g9(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:rc(""+c)}function b9(c,d){var m=d.ownerDocument.createElement("input");return m.name=d.name,m.value=d.value,c.id&&m.setAttribute("form",c.id),d.parentNode.insertBefore(m,d),c=new FormData(c),m.parentNode.removeChild(m),c}function SY(c,d,m,v,C){if(d==="submit"&&m&&m.stateNode===C){var E=g9((C[et]||null).action),D=v.submitter;D&&(d=(d=D[et]||null)?g9(d.formAction):D.getAttribute("formAction"),d!==null&&(E=d,D=null));var $=new xg("action","action",null,v,C);c.push({event:$,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(xc!==0){var J=D?b9(C,D):new FormData(C);xw(m,{pending:!0,data:J,method:C.method,action:E},null,J)}}else typeof E=="function"&&($.preventDefault(),J=D?b9(C,D):new FormData(C),xw(m,{pending:!0,data:J,method:C.method,action:E},E,J))},currentTarget:C}]})}}for(var t4=0;t4<L2.length;t4++){var n4=L2[t4],CY=n4.toLowerCase(),kY=n4[0].toUpperCase()+n4.slice(1);Po(CY,"on"+kY)}Po(K7,"onAnimationEnd"),Po(Y7,"onAnimationIteration"),Po(Z7,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(BK,"onTransitionRun"),Po(FK,"onTransitionStart"),Po(HK,"onTransitionCancel"),Po(X7,"onTransitionEnd"),Pe("onMouseEnter",["mouseout","mouseover"]),Pe("onMouseLeave",["mouseout","mouseover"]),Pe("onPointerEnter",["pointerout","pointerover"]),Pe("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var F0="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),EY=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(F0));function v9(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var v=c[m],C=v.event;v=v.listeners;e:{var E=void 0;if(d)for(var D=v.length-1;0<=D;D--){var $=v[D],J=$.instance,ve=$.currentTarget;if($=$.listener,J!==E&&C.isPropagationStopped())break e;E=$,C.currentTarget=ve;try{E(C)}catch(Ee){Cg(Ee)}C.currentTarget=null,E=J}else for(D=0;D<v.length;D++){if($=v[D],J=$.instance,ve=$.currentTarget,$=$.listener,J!==E&&C.isPropagationStopped())break e;E=$,C.currentTarget=ve;try{E(C)}catch(Ee){Cg(Ee)}C.currentTarget=null,E=J}}}}function cn(c,d){var m=d[it];m===void 0&&(m=d[it]=new Set);var v=c+"__bubble";m.has(v)||(y9(d,c,2,!1),m.add(v))}function r4(c,d,m){var v=0;d&&(v|=4),y9(m,c,v,d)}var c1="_reactListening"+Math.random().toString(36).slice(2);function s4(c){if(!c[c1]){c[c1]=!0,ca.forEach(function(m){m!=="selectionchange"&&(EY.has(m)||r4(m,!1,c),r4(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[c1]||(d[c1]=!0,r4("selectionchange",!1,d))}}function y9(c,d,m,v){switch(K9(d)){case 2:var C=JY;break;case 8:C=eZ;break;default:C=y4}m=C.bind(null,d,m,c),C=void 0,!k2||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(C=!0),v?C!==void 0?c.addEventListener(d,m,{capture:!0,passive:C}):c.addEventListener(d,m,!0):C!==void 0?c.addEventListener(d,m,{passive:C}):c.addEventListener(d,m,!1)}function i4(c,d,m,v,C){var E=v;if((d&1)===0&&(d&2)===0&&v!==null)e:for(;;){if(v===null)return;var D=v.tag;if(D===3||D===4){var $=v.stateNode.containerInfo;if($===C)break;if(D===4)for(D=v.return;D!==null;){var J=D.tag;if((J===3||J===4)&&D.stateNode.containerInfo===C)return;D=D.return}for(;$!==null;){if(D=yn($),D===null)return;if(J=D.tag,J===5||J===6||J===26||J===27){v=E=D;continue e}$=$.parentNode}}v=v.return}gg(function(){var ve=E,Ee=Wt(m),_e=[];e:{var ye=Q7.get(c);if(ye!==void 0){var Se=xg,ft=c;switch(c){case"keypress":if(vg(m)===0)break e;case"keydown":case"keyup":Se=vK;break;case"focusin":ft="focus",Se=T2;break;case"focusout":ft="blur",Se=T2;break;case"beforeblur":case"afterblur":Se=T2;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=M7;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=oK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=wK;break;case K7:case Y7:case Z7:Se=cK;break;case X7:Se=CK;break;case"scroll":case"scrollend":Se=sK;break;case"wheel":Se=EK;break;case"copy":case"cut":case"paste":Se=dK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=_7;break;case"toggle":case"beforetoggle":Se=MK}var It=(d&4)!==0,nr=!It&&(c==="scroll"||c==="scrollend"),he=It?ye!==null?ye+"Capture":null:ye;It=[];for(var ae=ve,be;ae!==null;){var Te=ae;if(be=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||be===null||he===null||(Te=c0(ae,he),Te!=null&&It.push(H0(ae,Te,be))),nr)break;ae=ae.return}0<It.length&&(ye=new Se(ye,ft,null,m,Ee),_e.push({event:ye,listeners:It}))}}if((d&7)===0){e:{if(ye=c==="mouseover"||c==="pointerover",Se=c==="mouseout"||c==="pointerout",ye&&m!==xt&&(ft=m.relatedTarget||m.fromElement)&&(yn(ft)||ft[pt]))break e;if((Se||ye)&&(ye=Ee.window===Ee?Ee:(ye=Ee.ownerDocument)?ye.defaultView||ye.parentWindow:window,Se?(ft=m.relatedTarget||m.toElement,Se=ve,ft=ft?yn(ft):null,ft!==null&&(nr=i(ft),It=ft.tag,ft!==nr||It!==5&&It!==27&&It!==6)&&(ft=null)):(Se=null,ft=ve),Se!==ft)){if(It=M7,Te="onMouseLeave",he="onMouseEnter",ae="mouse",(c==="pointerout"||c==="pointerover")&&(It=_7,Te="onPointerLeave",he="onPointerEnter",ae="pointer"),nr=Se==null?ye:an(Se),be=ft==null?ye:an(ft),ye=new It(Te,ae+"leave",Se,m,Ee),ye.target=nr,ye.relatedTarget=be,Te=null,yn(Ee)===ve&&(It=new It(he,ae+"enter",ft,m,Ee),It.target=be,It.relatedTarget=nr,Te=It),nr=Te,Se&&ft)t:{for(It=NY,he=Se,ae=ft,be=0,Te=he;Te;Te=It(Te))be++;Te=0;for(var Mt=ae;Mt;Mt=It(Mt))Te++;for(;0<be-Te;)he=It(he),be--;for(;0<Te-be;)ae=It(ae),Te--;for(;be--;){if(he===ae||ae!==null&&he===ae.alternate){It=he;break t}he=It(he),ae=It(ae)}It=null}else It=null;Se!==null&&x9(_e,ye,Se,It,!1),ft!==null&&nr!==null&&x9(_e,nr,ft,It,!0)}}e:{if(ye=ve?an(ve):window,Se=ye.nodeName&&ye.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ye.type==="file")var Mn=L7;else if(I7(ye))if(P7)Mn=LK;else{Mn=IK;var wt=jK}else Se=ye.nodeName,!Se||Se.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?ve&&nc(ve.elementType)&&(Mn=L7):Mn=zK;if(Mn&&(Mn=Mn(c,ve))){z7(_e,Mn,m,Ee);break e}wt&&wt(c,ye,ve),c==="focusout"&&ve&&ye.type==="number"&&ve.memoizedProps.value!=null&&Zd(ye,"number",ye.value)}switch(wt=ve?an(ve):window,c){case"focusin":(I7(wt)||wt.contentEditable==="true")&&(Jd=wt,j2=ve,b0=null);break;case"focusout":b0=j2=Jd=null;break;case"mousedown":I2=!0;break;case"contextmenu":case"mouseup":case"dragend":I2=!1,G7(_e,m,Ee);break;case"selectionchange":if($K)break;case"keydown":case"keyup":G7(_e,m,Ee)}var Xt;if(R2)e:{switch(c){case"compositionstart":var hn="onCompositionStart";break e;case"compositionend":hn="onCompositionEnd";break e;case"compositionupdate":hn="onCompositionUpdate";break e}hn=void 0}else Qd?D7(c,m)&&(hn="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(hn="onCompositionStart");hn&&(R7&&m.locale!=="ko"&&(Qd||hn!=="onCompositionStart"?hn==="onCompositionEnd"&&Qd&&(Xt=E7()):(sc=Ee,E2="value"in sc?sc.value:sc.textContent,Qd=!0)),wt=u1(ve,hn),0<wt.length&&(hn=new T7(hn,c,null,m,Ee),_e.push({event:hn,listeners:wt}),Xt?hn.data=Xt:(Xt=j7(m),Xt!==null&&(hn.data=Xt)))),(Xt=_K?RK(c,m):AK(c,m))&&(hn=u1(ve,"onBeforeInput"),0<hn.length&&(wt=new T7("onBeforeInput","beforeinput",null,m,Ee),_e.push({event:wt,listeners:hn}),wt.data=Xt)),SY(_e,c,ve,m,Ee)}v9(_e,d)})}function H0(c,d,m){return{instance:c,listener:d,currentTarget:m}}function u1(c,d){for(var m=d+"Capture",v=[];c!==null;){var C=c,E=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||E===null||(C=c0(c,m),C!=null&&v.unshift(H0(c,C,E)),C=c0(c,d),C!=null&&v.push(H0(c,C,E))),c.tag===3)return v;c=c.return}return[]}function NY(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function x9(c,d,m,v,C){for(var E=d._reactName,D=[];m!==null&&m!==v;){var $=m,J=$.alternate,ve=$.stateNode;if($=$.tag,J!==null&&J===v)break;$!==5&&$!==26&&$!==27||ve===null||(J=ve,C?(ve=c0(m,E),ve!=null&&D.unshift(H0(m,ve,J))):C||(ve=c0(m,E),ve!=null&&D.push(H0(m,ve,J)))),m=m.return}D.length!==0&&c.push({event:d,listeners:D})}var MY=/\r\n?/g,TY=/\u0000|\uFFFD/g;function w9(c){return(typeof c=="string"?c:""+c).replace(MY,`
9
9
  `).replace(TY,"")}function S9(c,d){return d=w9(d),w9(c)===d}function tr(c,d,m,v,C,E){switch(m){case"children":typeof v=="string"?d==="body"||d==="textarea"&&v===""||Pt(c,v):(typeof v=="number"||typeof v=="bigint")&&d!=="body"&&Pt(c,""+v);break;case"className":Ln(c,"class",v);break;case"tabIndex":Ln(c,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":Ln(c,m,v);break;case"style":Un(c,v,E);break;case"data":if(d!=="object"){Ln(c,"data",v);break}case"src":case"href":if(v===""&&(d!=="a"||m!=="href")){c.removeAttribute(m);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){c.removeAttribute(m);break}v=rc(""+v),c.setAttribute(m,v);break;case"action":case"formAction":if(typeof v=="function"){c.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(m==="formAction"?(d!=="input"&&tr(c,d,"name",C.name,C,null),tr(c,d,"formEncType",C.formEncType,C,null),tr(c,d,"formMethod",C.formMethod,C,null),tr(c,d,"formTarget",C.formTarget,C,null)):(tr(c,d,"encType",C.encType,C,null),tr(c,d,"method",C.method,C,null),tr(c,d,"target",C.target,C,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){c.removeAttribute(m);break}v=rc(""+v),c.setAttribute(m,v);break;case"onClick":v!=null&&(c.onclick=Ye);break;case"onScroll":v!=null&&cn("scroll",c);break;case"onScrollEnd":v!=null&&cn("scrollend",c);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(m=v.__html,m!=null){if(C.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"multiple":c.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":c.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){c.removeAttribute("xlink:href");break}m=rc(""+v),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?c.setAttribute(m,""+v):c.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":v&&typeof v!="function"&&typeof v!="symbol"?c.setAttribute(m,""):c.removeAttribute(m);break;case"capture":case"download":v===!0?c.setAttribute(m,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?c.setAttribute(m,v):c.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?c.setAttribute(m,v):c.removeAttribute(m);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?c.removeAttribute(m):c.setAttribute(m,v);break;case"popover":cn("beforetoggle",c),cn("toggle",c),Lt(c,"popover",v);break;case"xlinkActuate":Hr(c,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":Hr(c,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":Hr(c,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":Hr(c,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":Hr(c,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":Hr(c,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":Hr(c,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":Hr(c,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":Hr(c,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":Lt(c,"is",v);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=Ja.get(m)||m,Lt(c,m,v))}}function o4(c,d,m,v,C,E){switch(m){case"style":Un(c,v,E);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(m=v.__html,m!=null){if(C.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"children":typeof v=="string"?Pt(c,v):(typeof v=="number"||typeof v=="bigint")&&Pt(c,""+v);break;case"onScroll":v!=null&&cn("scroll",c);break;case"onScrollEnd":v!=null&&cn("scrollend",c);break;case"onClick":v!=null&&(c.onclick=Ye);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$s.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(C=m.endsWith("Capture"),d=m.slice(2,C?m.length-7:void 0),E=c[et]||null,E=E!=null?E[m]:null,typeof E=="function"&&c.removeEventListener(d,E,C),typeof v=="function")){typeof E!="function"&&E!==null&&(m in c?c[m]=null:c.hasAttribute(m)&&c.removeAttribute(m)),c.addEventListener(d,v,C);break e}m in c?c[m]=v:v===!0?c.setAttribute(m,""):Lt(c,m,v)}}}function js(c,d,m){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":cn("error",c),cn("load",c);var v=!1,C=!1,E;for(E in m)if(m.hasOwnProperty(E)){var D=m[E];if(D!=null)switch(E){case"src":v=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tr(c,d,E,D,m,null)}}C&&tr(c,d,"srcSet",m.srcSet,m,null),v&&tr(c,d,"src",m.src,m,null);return;case"input":cn("invalid",c);var $=E=D=C=null,J=null,ve=null;for(v in m)if(m.hasOwnProperty(v)){var Ee=m[v];if(Ee!=null)switch(v){case"name":C=Ee;break;case"type":D=Ee;break;case"checked":J=Ee;break;case"defaultChecked":ve=Ee;break;case"value":E=Ee;break;case"defaultValue":$=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(r(137,d));break;default:tr(c,d,v,Ee,m,null)}}_u(c,E,$,J,ve,D,C,!1);return;case"select":cn("invalid",c),v=D=E=null;for(C in m)if(m.hasOwnProperty(C)&&($=m[C],$!=null))switch(C){case"value":E=$;break;case"defaultValue":D=$;break;case"multiple":v=$;default:tr(c,d,C,$,m,null)}d=E,m=D,c.multiple=!!v,d!=null?Rs(c,!!v,d,!1):m!=null&&Rs(c,!!v,m,!0);return;case"textarea":cn("invalid",c),E=C=v=null;for(D in m)if(m.hasOwnProperty(D)&&($=m[D],$!=null))switch(D){case"value":v=$;break;case"defaultValue":C=$;break;case"children":E=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(r(91));break;default:tr(c,d,D,$,m,null)}Xd(c,v,C,E);return;case"option":for(J in m)m.hasOwnProperty(J)&&(v=m[J],v!=null)&&(J==="selected"?c.selected=v&&typeof v!="function"&&typeof v!="symbol":tr(c,d,J,v,m,null));return;case"dialog":cn("beforetoggle",c),cn("toggle",c),cn("cancel",c),cn("close",c);break;case"iframe":case"object":cn("load",c);break;case"video":case"audio":for(v=0;v<F0.length;v++)cn(F0[v],c);break;case"image":cn("error",c),cn("load",c);break;case"details":cn("toggle",c);break;case"embed":case"source":case"link":cn("error",c),cn("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ve in m)if(m.hasOwnProperty(ve)&&(v=m[ve],v!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tr(c,d,ve,v,m,null)}return;default:if(nc(d)){for(Ee in m)m.hasOwnProperty(Ee)&&(v=m[Ee],v!==void 0&&o4(c,d,Ee,v,m,void 0));return}}for($ in m)m.hasOwnProperty($)&&(v=m[$],v!=null&&tr(c,d,$,v,m,null))}function _Y(c,d,m,v){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,E=null,D=null,$=null,J=null,ve=null,Ee=null;for(Se in m){var _e=m[Se];if(m.hasOwnProperty(Se)&&_e!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":J=_e;default:v.hasOwnProperty(Se)||tr(c,d,Se,null,v,_e)}}for(var ye in v){var Se=v[ye];if(_e=m[ye],v.hasOwnProperty(ye)&&(Se!=null||_e!=null))switch(ye){case"type":E=Se;break;case"name":C=Se;break;case"checked":ve=Se;break;case"defaultChecked":Ee=Se;break;case"value":D=Se;break;case"defaultValue":$=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,d));break;default:Se!==_e&&tr(c,d,ye,Se,v,_e)}}o0(c,D,$,J,ve,Ee,E,C);return;case"select":Se=D=$=ye=null;for(E in m)if(J=m[E],m.hasOwnProperty(E)&&J!=null)switch(E){case"value":break;case"multiple":Se=J;default:v.hasOwnProperty(E)||tr(c,d,E,null,v,J)}for(C in v)if(E=v[C],J=m[C],v.hasOwnProperty(C)&&(E!=null||J!=null))switch(C){case"value":ye=E;break;case"defaultValue":$=E;break;case"multiple":D=E;default:E!==J&&tr(c,d,C,E,v,J)}d=$,m=D,v=Se,ye!=null?Rs(c,!!m,ye,!1):!!v!=!!m&&(d!=null?Rs(c,!!m,d,!0):Rs(c,!!m,m?[]:"",!1));return;case"textarea":Se=ye=null;for($ in m)if(C=m[$],m.hasOwnProperty($)&&C!=null&&!v.hasOwnProperty($))switch($){case"value":break;case"children":break;default:tr(c,d,$,null,v,C)}for(D in v)if(C=v[D],E=m[D],v.hasOwnProperty(D)&&(C!=null||E!=null))switch(D){case"value":ye=C;break;case"defaultValue":Se=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:C!==E&&tr(c,d,D,C,v,E)}pg(c,ye,Se);return;case"option":for(var ft in m)ye=m[ft],m.hasOwnProperty(ft)&&ye!=null&&!v.hasOwnProperty(ft)&&(ft==="selected"?c.selected=!1:tr(c,d,ft,null,v,ye));for(J in v)ye=v[J],Se=m[J],v.hasOwnProperty(J)&&ye!==Se&&(ye!=null||Se!=null)&&(J==="selected"?c.selected=ye&&typeof ye!="function"&&typeof ye!="symbol":tr(c,d,J,ye,v,Se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var It in m)ye=m[It],m.hasOwnProperty(It)&&ye!=null&&!v.hasOwnProperty(It)&&tr(c,d,It,null,v,ye);for(ve in v)if(ye=v[ve],Se=m[ve],v.hasOwnProperty(ve)&&ye!==Se&&(ye!=null||Se!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,d));break;default:tr(c,d,ve,ye,v,Se)}return;default:if(nc(d)){for(var nr in m)ye=m[nr],m.hasOwnProperty(nr)&&ye!==void 0&&!v.hasOwnProperty(nr)&&o4(c,d,nr,void 0,v,ye);for(Ee in v)ye=v[Ee],Se=m[Ee],!v.hasOwnProperty(Ee)||ye===Se||ye===void 0&&Se===void 0||o4(c,d,Ee,ye,v,Se);return}}for(var he in m)ye=m[he],m.hasOwnProperty(he)&&ye!=null&&!v.hasOwnProperty(he)&&tr(c,d,he,null,v,ye);for(_e in v)ye=v[_e],Se=m[_e],!v.hasOwnProperty(_e)||ye===Se||ye==null&&Se==null||tr(c,d,_e,ye,v,Se)}function C9(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function RY(){if(typeof performance.getEntriesByType=="function"){for(var c=0,d=0,m=performance.getEntriesByType("resource"),v=0;v<m.length;v++){var C=m[v],E=C.transferSize,D=C.initiatorType,$=C.duration;if(E&&$&&C9(D)){for(D=0,$=C.responseEnd,v+=1;v<m.length;v++){var J=m[v],ve=J.startTime;if(ve>$)break;var Ee=J.transferSize,_e=J.initiatorType;Ee&&C9(_e)&&(J=J.responseEnd,D+=Ee*(J<$?1:($-ve)/(J-ve)))}if(--v,d+=8*(E+D)/(C.duration/1e3),c++,10<c)break}}if(0<c)return d/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var a4=null,l4=null;function d1(c){return c.nodeType===9?c:c.ownerDocument}function k9(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function E9(c,d){if(c===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&d==="foreignObject"?0:c}function c4(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var u4=null;function AY(){var c=window.event;return c&&c.type==="popstate"?c===u4?!1:(u4=c,!0):(u4=null,!1)}var N9=typeof setTimeout=="function"?setTimeout:void 0,OY=typeof clearTimeout=="function"?clearTimeout:void 0,M9=typeof Promise=="function"?Promise:void 0,DY=typeof queueMicrotask=="function"?queueMicrotask:typeof M9<"u"?function(c){return M9.resolve(null).then(c).catch(jY)}:N9;function jY(c){setTimeout(function(){throw c})}function wc(c){return c==="head"}function T9(c,d){var m=d,v=0;do{var C=m.nextSibling;if(c.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"||m==="/&"){if(v===0){c.removeChild(C),Mf(d);return}v--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")v++;else if(m==="html")U0(c.ownerDocument.documentElement);else if(m==="head"){m=c.ownerDocument.head,U0(m);for(var E=m.firstChild;E;){var D=E.nextSibling,$=E.nodeName;E[en]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&E.rel.toLowerCase()==="stylesheet"||m.removeChild(E),E=D}}else m==="body"&&U0(c.ownerDocument.body);m=C}while(m);Mf(d)}function _9(c,d){var m=c;c=0;do{var v=m.nextSibling;if(m.nodeType===1?d?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(d?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),v&&v.nodeType===8)if(m=v.data,m==="/$"){if(c===0)break;c--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||c++;m=v}while(m)}function d4(c){var d=c.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var m=d;switch(d=d.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":d4(m),Hn(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}c.removeChild(m)}}function IY(c,d,m,v){for(;c.nodeType===1;){var C=m;if(c.nodeName.toLowerCase()!==d.toLowerCase()){if(!v&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(v){if(!c[en])switch(d){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(E=c.getAttribute("rel"),E==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(E!==C.rel||c.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||c.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||c.getAttribute("title")!==(C.title==null?null:C.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(E=c.getAttribute("src"),(E!==(C.src==null?null:C.src)||c.getAttribute("type")!==(C.type==null?null:C.type)||c.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&E&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(d==="input"&&c.type==="hidden"){var E=C.name==null?null:""+C.name;if(C.type==="hidden"&&c.getAttribute("name")===E)return c}else return c;if(c=fo(c.nextSibling),c===null)break}return null}function zY(c,d,m){if(d==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!m||(c=fo(c.nextSibling),c===null))return null;return c}function R9(c,d){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!d||(c=fo(c.nextSibling),c===null))return null;return c}function f4(c){return c.data==="$?"||c.data==="$~"}function h4(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function LY(c,d){var m=c.ownerDocument;if(c.data==="$~")c._reactRetry=d;else if(c.data!=="$?"||m.readyState!=="loading")d();else{var v=function(){d(),m.removeEventListener("DOMContentLoaded",v)};m.addEventListener("DOMContentLoaded",v),c._reactRetry=v}}function fo(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return c}var p4=null;function A9(c){c=c.nextSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"||m==="/&"){if(d===0)return fo(c.nextSibling);d--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||d++}c=c.nextSibling}return null}function O9(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(d===0)return c;d--}else m!=="/$"&&m!=="/&"||d++}c=c.previousSibling}return null}function D9(c,d,m){switch(d=d1(m),c){case"html":if(c=d.documentElement,!c)throw Error(r(452));return c;case"head":if(c=d.head,!c)throw Error(r(453));return c;case"body":if(c=d.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function U0(c){for(var d=c.attributes;d.length;)c.removeAttributeNode(d[0]);Hn(c)}var ho=new Map,j9=new Set;function f1(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var ml=te.d;te.d={f:PY,r:$Y,D:BY,C:FY,L:HY,m:UY,X:qY,S:VY,M:GY};function PY(){var c=ml.f(),d=r1();return c||d}function $Y(c){var d=hr(c);d!==null&&d.tag===5&&d.type==="form"?X8(d):ml.r(c)}var kf=typeof document>"u"?null:document;function I9(c,d,m){var v=kf;if(v&&typeof d=="string"&&d){var C=hi(d);C='link[rel="'+c+'"][href="'+C+'"]',typeof m=="string"&&(C+='[crossorigin="'+m+'"]'),j9.has(C)||(j9.add(C),c={rel:c,crossOrigin:m,href:d},v.querySelector(C)===null&&(d=v.createElement("link"),js(d,"link",c),Jn(d),v.head.appendChild(d)))}}function BY(c){ml.D(c),I9("dns-prefetch",c,null)}function FY(c,d){ml.C(c,d),I9("preconnect",c,d)}function HY(c,d,m){ml.L(c,d,m);var v=kf;if(v&&c&&d){var C='link[rel="preload"][as="'+hi(d)+'"]';d==="image"&&m&&m.imageSrcSet?(C+='[imagesrcset="'+hi(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(C+='[imagesizes="'+hi(m.imageSizes)+'"]')):C+='[href="'+hi(c)+'"]';var E=C;switch(d){case"style":E=Ef(c);break;case"script":E=Nf(c)}ho.has(E)||(c=p({rel:"preload",href:d==="image"&&m&&m.imageSrcSet?void 0:c,as:d},m),ho.set(E,c),v.querySelector(C)!==null||d==="style"&&v.querySelector(V0(E))||d==="script"&&v.querySelector(q0(E))||(d=v.createElement("link"),js(d,"link",c),Jn(d),v.head.appendChild(d)))}}function UY(c,d){ml.m(c,d);var m=kf;if(m&&c){var v=d&&typeof d.as=="string"?d.as:"script",C='link[rel="modulepreload"][as="'+hi(v)+'"][href="'+hi(c)+'"]',E=C;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Nf(c)}if(!ho.has(E)&&(c=p({rel:"modulepreload",href:c},d),ho.set(E,c),m.querySelector(C)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(q0(E)))return}v=m.createElement("link"),js(v,"link",c),Jn(v),m.head.appendChild(v)}}}function VY(c,d,m){ml.S(c,d,m);var v=kf;if(v&&c){var C=Dr(v).hoistableStyles,E=Ef(c);d=d||"default";var D=C.get(E);if(!D){var $={loading:0,preload:null};if(D=v.querySelector(V0(E)))$.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":d},m),(m=ho.get(E))&&m4(c,m);var J=D=v.createElement("link");Jn(J),js(J,"link",c),J._p=new Promise(function(ve,Ee){J.onload=ve,J.onerror=Ee}),J.addEventListener("load",function(){$.loading|=1}),J.addEventListener("error",function(){$.loading|=2}),$.loading|=4,h1(D,d,v)}D={type:"stylesheet",instance:D,count:1,state:$},C.set(E,D)}}}function qY(c,d){ml.X(c,d);var m=kf;if(m&&c){var v=Dr(m).hoistableScripts,C=Nf(c),E=v.get(C);E||(E=m.querySelector(q0(C)),E||(c=p({src:c,async:!0},d),(d=ho.get(C))&&g4(c,d),E=m.createElement("script"),Jn(E),js(E,"link",c),m.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},v.set(C,E))}}function GY(c,d){ml.M(c,d);var m=kf;if(m&&c){var v=Dr(m).hoistableScripts,C=Nf(c),E=v.get(C);E||(E=m.querySelector(q0(C)),E||(c=p({src:c,async:!0,type:"module"},d),(d=ho.get(C))&&g4(c,d),E=m.createElement("script"),Jn(E),js(E,"link",c),m.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},v.set(C,E))}}function z9(c,d,m,v){var C=(C=we.current)?f1(C):null;if(!C)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(d=Ef(m.href),m=Dr(C).hoistableStyles,v=m.get(d),v||(v={type:"style",instance:null,count:0,state:null},m.set(d,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){c=Ef(m.href);var E=Dr(C).hoistableStyles,D=E.get(c);if(D||(C=C.ownerDocument||C,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(c,D),(E=C.querySelector(V0(c)))&&!E._p&&(D.instance=E,D.state.loading=5),ho.has(c)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},ho.set(c,m),E||WY(C,c,m,D.state))),d&&v===null)throw Error(r(528,""));return D}if(d&&v!==null)throw Error(r(529,""));return null;case"script":return d=m.async,m=m.src,typeof m=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=Nf(m),m=Dr(C).hoistableScripts,v=m.get(d),v||(v={type:"script",instance:null,count:0,state:null},m.set(d,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Ef(c){return'href="'+hi(c)+'"'}function V0(c){return'link[rel="stylesheet"]['+c+"]"}function L9(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function WY(c,d,m,v){c.querySelector('link[rel="preload"][as="style"]['+d+"]")?v.loading=1:(d=c.createElement("link"),v.preload=d,d.addEventListener("load",function(){return v.loading|=1}),d.addEventListener("error",function(){return v.loading|=2}),js(d,"link",m),Jn(d),c.head.appendChild(d))}function Nf(c){return'[src="'+hi(c)+'"]'}function q0(c){return"script[async]"+c}function P9(c,d,m){if(d.count++,d.instance===null)switch(d.type){case"style":var v=c.querySelector('style[data-href~="'+hi(m.href)+'"]');if(v)return d.instance=v,Jn(v),v;var C=p({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return v=(c.ownerDocument||c).createElement("style"),Jn(v),js(v,"style",C),h1(v,m.precedence,c),d.instance=v;case"stylesheet":C=Ef(m.href);var E=c.querySelector(V0(C));if(E)return d.state.loading|=4,d.instance=E,Jn(E),E;v=L9(m),(C=ho.get(C))&&m4(v,C),E=(c.ownerDocument||c).createElement("link"),Jn(E);var D=E;return D._p=new Promise(function($,J){D.onload=$,D.onerror=J}),js(E,"link",v),d.state.loading|=4,h1(E,m.precedence,c),d.instance=E;case"script":return E=Nf(m.src),(C=c.querySelector(q0(E)))?(d.instance=C,Jn(C),C):(v=m,(C=ho.get(E))&&(v=p({},m),g4(v,C)),c=c.ownerDocument||c,C=c.createElement("script"),Jn(C),js(C,"link",v),c.head.appendChild(C),d.instance=C);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(v=d.instance,d.state.loading|=4,h1(v,m.precedence,c));return d.instance}function h1(c,d,m){for(var v=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=v.length?v[v.length-1]:null,E=C,D=0;D<v.length;D++){var $=v[D];if($.dataset.precedence===d)E=$;else if(E!==C)break}E?E.parentNode.insertBefore(c,E.nextSibling):(d=m.nodeType===9?m.head:m,d.insertBefore(c,d.firstChild))}function m4(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.title==null&&(c.title=d.title)}function g4(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.integrity==null&&(c.integrity=d.integrity)}var p1=null;function $9(c,d,m){if(p1===null){var v=new Map,C=p1=new Map;C.set(m,v)}else C=p1,v=C.get(m),v||(v=new Map,C.set(m,v));if(v.has(c))return v;for(v.set(c,null),m=m.getElementsByTagName(c),C=0;C<m.length;C++){var E=m[C];if(!(E[en]||E[Qe]||c==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var D=E.getAttribute(d)||"";D=c+D;var $=v.get(D);$?$.push(E):v.set(D,[E])}}return v}function B9(c,d,m){c=c.ownerDocument||c,c.head.insertBefore(m,d==="title"?c.querySelector("head > title"):null)}function KY(c,d,m){if(m===1||d.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;return d.rel==="stylesheet"?(c=d.disabled,typeof d.precedence=="string"&&c==null):!0;case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function F9(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function YY(c,d,m,v){if(m.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var C=Ef(v.href),E=d.querySelector(V0(C));if(E){d=E._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(c.count++,c=m1.bind(c),d.then(c,c)),m.state.loading|=4,m.instance=E,Jn(E);return}E=d.ownerDocument||d,v=L9(v),(C=ho.get(C))&&m4(v,C),E=E.createElement("link"),Jn(E);var D=E;D._p=new Promise(function($,J){D.onload=$,D.onerror=J}),js(E,"link",v),m.instance=E}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(m,d),(d=m.state.preload)&&(m.state.loading&3)===0&&(c.count++,m=m1.bind(c),d.addEventListener("load",m),d.addEventListener("error",m))}}var b4=0;function ZY(c,d){return c.stylesheets&&c.count===0&&b1(c,c.stylesheets),0<c.count||0<c.imgCount?function(m){var v=setTimeout(function(){if(c.stylesheets&&b1(c,c.stylesheets),c.unsuspend){var E=c.unsuspend;c.unsuspend=null,E()}},6e4+d);0<c.imgBytes&&b4===0&&(b4=62500*RY());var C=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&b1(c,c.stylesheets),c.unsuspend)){var E=c.unsuspend;c.unsuspend=null,E()}},(c.imgBytes>b4?50:800)+d);return c.unsuspend=m,function(){c.unsuspend=null,clearTimeout(v),clearTimeout(C)}}:null}function m1(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)b1(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var g1=null;function b1(c,d){c.stylesheets=null,c.unsuspend!==null&&(c.count++,g1=new Map,d.forEach(XY,c),g1=null,m1.call(c))}function XY(c,d){if(!(d.state.loading&4)){var m=g1.get(c);if(m)var v=m.get(null);else{m=new Map,g1.set(c,m);for(var C=c.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<C.length;E++){var D=C[E];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(m.set(D.dataset.precedence,D),v=D)}v&&m.set(null,v)}C=d.instance,D=C.getAttribute("data-precedence"),E=m.get(D)||v,E===v&&m.set(null,C),m.set(D,C),this.count++,v=m1.bind(this),C.addEventListener("load",v),C.addEventListener("error",v),E?E.parentNode.insertBefore(C,E.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(C,c.firstChild)),d.state.loading|=4}}var G0={$$typeof:T,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function QY(c,d,m,v,C,E,D,$,J){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.hiddenUpdates=Rt(null),this.identifierPrefix=v,this.onUncaughtError=C,this.onCaughtError=E,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function H9(c,d,m,v,C,E,D,$,J,ve,Ee,_e){return c=new QY(c,d,m,D,J,ve,Ee,_e,$),d=1,E===!0&&(d|=24),E=ji(3,null,null,d),c.current=E,E.stateNode=c,d=Z2(),d.refCount++,c.pooledCache=d,d.refCount++,E.memoizedState={element:v,isDehydrated:m,cache:d},ew(E),c}function U9(c){return c?(c=nf,c):nf}function V9(c,d,m,v,C,E){C=U9(C),v.context===null?v.context=C:v.pendingContext=C,v=uc(d),v.payload={element:m},E=E===void 0?null:E,E!==null&&(v.callback=E),m=dc(c,v,d),m!==null&&(yi(m,c,d),k0(m,c,d))}function q9(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<d?m:d}}function v4(c,d){q9(c,d),(c=c.alternate)&&q9(c,d)}function G9(c){if(c.tag===13||c.tag===31){var d=Du(c,67108864);d!==null&&yi(d,c,67108864),v4(c,67108864)}}function W9(c){if(c.tag===13||c.tag===31){var d=$i();d=se(d);var m=Du(c,d);m!==null&&yi(m,c,d),v4(c,d)}}var v1=!0;function JY(c,d,m,v){var C=F.T;F.T=null;var E=te.p;try{te.p=2,y4(c,d,m,v)}finally{te.p=E,F.T=C}}function eZ(c,d,m,v){var C=F.T;F.T=null;var E=te.p;try{te.p=8,y4(c,d,m,v)}finally{te.p=E,F.T=C}}function y4(c,d,m,v){if(v1){var C=x4(v);if(C===null)i4(c,d,v,y1,m),Y9(c,v);else if(nZ(C,c,d,m,v))v.stopPropagation();else if(Y9(c,v),d&4&&-1<tZ.indexOf(c)){for(;C!==null;){var E=hr(C);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var D=rt(E.pendingLanes);if(D!==0){var $=E;for($.pendingLanes|=2,$.entangledLanes|=2;D;){var J=1<<31-_t(D);$.entanglements[1]|=J,D&=~J}ha(E),(Rn&6)===0&&(t1=Kt()+500,B0(0))}}break;case 31:case 13:$=Du(E,2),$!==null&&yi($,E,2),r1(),v4(E,2)}if(E=x4(v),E===null&&i4(c,d,v,y1,m),E===C)break;C=E}C!==null&&v.stopPropagation()}else i4(c,d,v,null,m)}}function x4(c){return c=Wt(c),w4(c)}var y1=null;function w4(c){if(y1=null,c=yn(c),c!==null){var d=i(c);if(d===null)c=null;else{var m=d.tag;if(m===13){if(c=o(d),c!==null)return c;c=null}else if(m===31){if(c=a(d),c!==null)return c;c=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null)}}return y1=c,null}function K9(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bn()){case Nt:return 2;case $n:return 8;case Bn:case En:return 32;case Fn:return 268435456;default:return 32}default:return 32}}var S4=!1,Sc=null,Cc=null,kc=null,W0=new Map,K0=new Map,Ec=[],tZ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Y9(c,d){switch(c){case"focusin":case"focusout":Sc=null;break;case"dragenter":case"dragleave":Cc=null;break;case"mouseover":case"mouseout":kc=null;break;case"pointerover":case"pointerout":W0.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":K0.delete(d.pointerId)}}function Y0(c,d,m,v,C,E){return c===null||c.nativeEvent!==E?(c={blockedOn:d,domEventName:m,eventSystemFlags:v,nativeEvent:E,targetContainers:[C]},d!==null&&(d=hr(d),d!==null&&G9(d)),c):(c.eventSystemFlags|=v,d=c.targetContainers,C!==null&&d.indexOf(C)===-1&&d.push(C),c)}function nZ(c,d,m,v,C){switch(d){case"focusin":return Sc=Y0(Sc,c,d,m,v,C),!0;case"dragenter":return Cc=Y0(Cc,c,d,m,v,C),!0;case"mouseover":return kc=Y0(kc,c,d,m,v,C),!0;case"pointerover":var E=C.pointerId;return W0.set(E,Y0(W0.get(E)||null,c,d,m,v,C)),!0;case"gotpointercapture":return E=C.pointerId,K0.set(E,Y0(K0.get(E)||null,c,d,m,v,C)),!0}return!1}function Z9(c){var d=yn(c.target);if(d!==null){var m=i(d);if(m!==null){if(d=m.tag,d===13){if(d=o(m),d!==null){c.blockedOn=d,qe(c.priority,function(){W9(m)});return}}else if(d===31){if(d=a(m),d!==null){c.blockedOn=d,qe(c.priority,function(){W9(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function x1(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var m=x4(c.nativeEvent);if(m===null){m=c.nativeEvent;var v=new m.constructor(m.type,m);xt=v,m.target.dispatchEvent(v),xt=null}else return d=hr(m),d!==null&&G9(d),c.blockedOn=m,!1;d.shift()}return!0}function X9(c,d,m){x1(c)&&m.delete(d)}function rZ(){S4=!1,Sc!==null&&x1(Sc)&&(Sc=null),Cc!==null&&x1(Cc)&&(Cc=null),kc!==null&&x1(kc)&&(kc=null),W0.forEach(X9),K0.forEach(X9)}function w1(c,d){c.blockedOn===d&&(c.blockedOn=null,S4||(S4=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rZ)))}var S1=null;function Q9(c){S1!==c&&(S1=c,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){S1===c&&(S1=null);for(var d=0;d<c.length;d+=3){var m=c[d],v=c[d+1],C=c[d+2];if(typeof v!="function"){if(w4(v||m)===null)continue;break}var E=hr(m);E!==null&&(c.splice(d,3),d-=3,xw(E,{pending:!0,data:C,method:m.method,action:v},v,C))}}))}function Mf(c){function d(J){return w1(J,c)}Sc!==null&&w1(Sc,c),Cc!==null&&w1(Cc,c),kc!==null&&w1(kc,c),W0.forEach(d),K0.forEach(d);for(var m=0;m<Ec.length;m++){var v=Ec[m];v.blockedOn===c&&(v.blockedOn=null)}for(;0<Ec.length&&(m=Ec[0],m.blockedOn===null);)Z9(m),m.blockedOn===null&&Ec.shift();if(m=(c.ownerDocument||c).$$reactFormReplay,m!=null)for(v=0;v<m.length;v+=3){var C=m[v],E=m[v+1],D=C[et]||null;if(typeof E=="function")D||Q9(m);else if(D){var $=null;if(E&&E.hasAttribute("formAction")){if(C=E,D=E[et]||null)$=D.formAction;else if(w4(C)!==null)continue}else $=D.action;typeof $=="function"?m[v+1]=$:(m.splice(v,3),v-=3),Q9(m)}}}function J9(){function c(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(D){return C=D})},focusReset:"manual",scroll:"manual"})}function d(){C!==null&&(C(),C=null),v||setTimeout(m,20)}function m(){if(!v&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,C=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(m,100),function(){v=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),C!==null&&(C(),C=null)}}}function C4(c){this._internalRoot=c}C1.prototype.render=C4.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));var m=d.current,v=$i();V9(m,v,c,d,null,null)},C1.prototype.unmount=C4.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;V9(c.current,2,null,c,null,null),r1(),d[pt]=null}};function C1(c){this._internalRoot=c}C1.prototype.unstable_scheduleHydration=function(c){if(c){var d=ze();c={blockedOn:null,target:c,priority:d};for(var m=0;m<Ec.length&&d!==0&&d<Ec[m].priority;m++);Ec.splice(m,0,c),m===0&&Z9(c)}};var eM=t.version;if(eM!=="19.2.5")throw Error(r(527,eM,"19.2.5"));te.findDOMNode=function(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=u(d),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var sZ={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var k1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!k1.isDisabled&&k1.supportsFiber)try{Ar=k1.inject(sZ),Qn=k1}catch{}}return X0.createRoot=function(c,d){if(!s(c))throw Error(r(299));var m=!1,v="",C=aN,E=lN,D=cN;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(v=d.identifierPrefix),d.onUncaughtError!==void 0&&(C=d.onUncaughtError),d.onCaughtError!==void 0&&(E=d.onCaughtError),d.onRecoverableError!==void 0&&(D=d.onRecoverableError)),d=H9(c,1,!1,null,null,m,v,null,C,E,D,J9),c[pt]=d.current,s4(c),new C4(d)},X0.hydrateRoot=function(c,d,m){if(!s(c))throw Error(r(299));var v=!1,C="",E=aN,D=lN,$=cN,J=null;return m!=null&&(m.unstable_strictMode===!0&&(v=!0),m.identifierPrefix!==void 0&&(C=m.identifierPrefix),m.onUncaughtError!==void 0&&(E=m.onUncaughtError),m.onCaughtError!==void 0&&(D=m.onCaughtError),m.onRecoverableError!==void 0&&($=m.onRecoverableError),m.formState!==void 0&&(J=m.formState)),d=H9(c,1,!0,d,m??null,v,C,J,E,D,$,J9),d.context=U9(null),m=d.current,v=$i(),v=se(v),C=uc(v),C.callback=null,dc(m,C,v),m=v,d.current.lanes=m,lt(d,m),ha(d),c[pt]=d.current,s4(c),new C1(d)},X0.version="19.2.5",X0}var uM;function pZ(){if(uM)return N4.exports;uM=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),N4.exports=hZ(),N4.exports}var mZ=pZ(),gZ=(e,t,n,r,s,i,o,a)=>{let l=document.documentElement,u=["light","dark"];function f(b){(Array.isArray(e)?e:[e]).forEach(y=>{let x=y==="class",S=x&&i?s.map(k=>i[k]||k):s;x?(l.classList.remove(...S),l.classList.add(i&&i[b]?i[b]:b)):l.setAttribute(y,b)}),p(b)}function p(b){a&&u.includes(b)&&(l.style.colorScheme=b)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let b=localStorage.getItem(t)||n,y=o&&b==="system"?g():b;f(y)}catch{}},dM=["light","dark"],HD="(prefers-color-scheme: dark)",bZ=typeof window>"u",WC=w.createContext(void 0),vZ={setTheme:e=>{},themes:[]},$y=()=>{var e;return(e=w.useContext(WC))!=null?e:vZ},yZ=e=>w.useContext(WC)?w.createElement(w.Fragment,null,e.children):w.createElement(wZ,{...e}),xZ=["light","dark"],wZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=xZ,defaultTheme:o=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:f,scriptProps:p})=>{let[g,b]=w.useState(()=>CZ(s,o)),[y,x]=w.useState(()=>g==="system"?R4():g),S=l?Object.values(l):i,k=w.useCallback(_=>{let A=_;if(!A)return;_==="system"&&n&&(A=R4());let I=l?l[A]:A,j=t?kZ(f):null,L=document.documentElement,q=ne=>{ne==="class"?(L.classList.remove(...S),I&&L.classList.add(I)):ne.startsWith("data-")&&(I?L.setAttribute(ne,I):L.removeAttribute(ne))};if(Array.isArray(a)?a.forEach(q):q(a),r){let ne=dM.includes(o)?o:null,re=dM.includes(A)?A:ne;L.style.colorScheme=re}j?.()},[f]),N=w.useCallback(_=>{let A=typeof _=="function"?_(g):_;b(A);try{localStorage.setItem(s,A)}catch{}},[g]),T=w.useCallback(_=>{let A=R4(_);x(A),g==="system"&&n&&!e&&k("system")},[g,e]);w.useEffect(()=>{let _=window.matchMedia(HD);return _.addListener(T),T(_),()=>_.removeListener(T)},[T]),w.useEffect(()=>{let _=A=>{A.key===s&&(A.newValue?b(A.newValue):N(o))};return window.addEventListener("storage",_),()=>window.removeEventListener("storage",_)},[N]),w.useEffect(()=>{k(e??g)},[e,g]);let R=w.useMemo(()=>({theme:g,setTheme:N,forcedTheme:e,resolvedTheme:g==="system"?y:g,themes:n?[...i,"system"]:i,systemTheme:n?y:void 0}),[g,N,e,y,n,i]);return w.createElement(WC.Provider,{value:R},w.createElement(SZ,{forcedTheme:e,storageKey:s,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:l,themes:i,nonce:f,scriptProps:p}),u)},SZ=w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,themes:a,nonce:l,scriptProps:u})=>{let f=JSON.stringify([n,t,i,e,a,o,r,s]).slice(1,-1);return w.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${gZ.toString()})(${f})`}})}),CZ=(e,t)=>{if(bZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},kZ=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},R4=e=>(e||(e=window.matchMedia(HD)),e.matches?"dark":"light");const UD=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const EZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const NZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const fM=e=>{const t=NZ(e);return t.charAt(0).toUpperCase()+t.slice(1)};var MZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const TZ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const _Z=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>w.createElement("svg",{ref:l,...MZ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:UD("lucide",s),...!i&&!TZ(a)&&{"aria-hidden":"true"},...a},[...o.map(([u,f])=>w.createElement(u,f)),...Array.isArray(i)?i:[i]]));const Ce=(e,t)=>{const n=w.forwardRef(({className:r,...s},i)=>w.createElement(_Z,{ref:i,iconNode:t,className:UD(`lucide-${EZ(fM(e))}`,`lucide-${e}`,r),...s}));return n.displayName=fM(e),n};const RZ=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Tl=Ce("activity",RZ);const AZ=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],OZ=Ce("archive",AZ);const DZ=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],jZ=Ce("arrow-down",DZ);const IZ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zZ=Ce("arrow-left",IZ);const LZ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],PZ=Ce("arrow-right",LZ);const $Z=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],bh=Ce("arrow-up-down",$Z);const BZ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],FZ=Ce("arrow-up",BZ);const HZ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],UZ=Ce("at-sign",HZ);const VZ=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],qZ=Ce("award",VZ);const GZ=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],WZ=Ce("badge-check",GZ);const KZ=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Fh=Ce("bell",KZ);const YZ=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],ZZ=Ce("bold",YZ);const XZ=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],QZ=Ce("book-open",XZ);const JZ=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],eX=Ce("book",JZ);const tX=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],nX=Ce("bookmark",tX);const rX=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],sX=Ce("box",rX);const iX=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],oX=Ce("briefcase",iX);const aX=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],lX=Ce("building",aX);const cX=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],KC=Ce("calendar",cX);const uX=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],VD=Ce("camera",uX);const dX=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],fX=Ce("chart-no-axes-column-increasing",dX);const hX=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],qD=Ce("chart-pie",hX);const pX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],td=Ce("check",pX);const mX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mm=Ce("chevron-down",mX);const gX=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],GD=Ce("chevron-left",gX);const bX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Pd=Ce("chevron-right",bX);const vX=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],WD=Ce("chevron-up",vX);const yX=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],xX=Ce("chevrons-up-down",yX);const wX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],KD=Ce("circle-alert",wX);const SX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],YD=Ce("circle-check",SX);const CX=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ZD=Ce("circle-check-big",CX);const kX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],EX=Ce("circle-plus",kX);const NX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],MX=Ce("circle-question-mark",NX);const TX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],_X=Ce("circle-user",TX);const RX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],AX=Ce("circle-x",RX);const OX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],DX=Ce("circle",OX);const jX=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Tf=Ce("clipboard-list",jX);const IX=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Gf=Ce("clock",IX);const zX=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],LX=Ce("cloud",zX);const PX=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],$X=Ce("code",PX);const BX=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],FX=Ce("cpu",BX);const HX=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],UX=Ce("credit-card",HX);const VX=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],YC=Ce("database",VX);const qX=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],GX=Ce("dollar-sign",qX);const WX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],XD=Ce("ellipsis",WX);const KX=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],vh=Ce("eye-off",KX);const YX=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yh=Ce("eye",YX);const ZX=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],hM=Ce("file-image",ZX);const XX=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],QX=Ce("file-plus",XX);const JX=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Qb=Ce("file-text",JX);const eQ=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],tQ=Ce("file-x",eQ);const nQ=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],pM=Ce("file",nQ);const rQ=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],sQ=Ce("flag",rQ);const iQ=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],QD=Ce("folder",iQ);const oQ=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],JD=Ce("funnel",oQ);const aQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ej=Ce("globe",aQ);const lQ=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],cQ=Ce("graduation-cap",lQ);const uQ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],dQ=Ce("grid-3x3",uQ);const fQ=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],ZC=Ce("hard-drive",fQ);const hQ=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],pQ=Ce("hash",hQ);const mQ=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],gQ=Ce("heart",mQ);const bQ=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],vQ=Ce("house",bQ);const yQ=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],xQ=Ce("image-off",yQ);const wQ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Tm=Ce("image",wQ);const SQ=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],Q0=Ce("images",SQ);const CQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],XC=Ce("info",CQ);const kQ=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],EQ=Ce("italic",kQ);const NQ=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],MQ=Ce("key",NQ);const TQ=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],tj=Ce("layers",TQ);const _Q=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],nj=Ce("layout-dashboard",_Q);const RQ=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Jb=Ce("layout-grid",RQ);const AQ=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],OQ=Ce("layout-list",AQ);const DQ=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],OS=Ce("link",DQ);const jQ=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],IQ=Ce("list-tree",jQ);const zQ=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],LQ=Ce("list",zQ);const PQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Co=Ce("loader-circle",PQ);const $Q=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],BQ=Ce("lock",$Q);const FQ=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],HQ=Ce("log-out",FQ);const UQ=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],VQ=Ce("mail",UQ);const qQ=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],GQ=Ce("map-pin",qQ);const WQ=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],KQ=Ce("map",WQ);const YQ=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ZQ=Ce("message-square",YQ);const XQ=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],QQ=Ce("mic",XQ);const JQ=[["path",{d:"M5 12h14",key:"1ays0h"}]],eJ=Ce("minus",JQ);const tJ=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],nJ=Ce("monitor-smartphone",tJ);const rJ=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],rj=Ce("monitor",rJ);const sJ=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],sj=Ce("moon",sJ);const iJ=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],oJ=Ce("music",iJ);const aJ=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],lJ=Ce("newspaper",aJ);const cJ=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],uJ=Ce("octagon-x",cJ);const dJ=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],fJ=Ce("package",dJ);const hJ=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],ij=Ce("palette",hJ);const pJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],mJ=Ce("panel-left",pJ);const gJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],bJ=Ce("panels-top-left",gJ);const vJ=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],oj=Ce("pencil",vJ);const yJ=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],xJ=Ce("percent",yJ);const wJ=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],SJ=Ce("phone",wJ);const CJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Kl=Ce("plus",CJ);const kJ=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],EJ=Ce("redo-2",kJ);const NJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],MJ=Ce("rows-2",NJ);const TJ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],_J=Ce("rows-3",TJ);const RJ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],DS=Ce("search",RJ);const AJ=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],mM=Ce("send",AJ);const OJ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_m=Ce("settings",OJ);const DJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],jJ=Ce("shield-alert",DJ);const IJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zJ=Ce("shield-check",IJ);const LJ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],aj=Ce("shield",LJ);const PJ=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],$J=Ce("shopping-bag",PJ);const BJ=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],FJ=Ce("shopping-cart",BJ);const HJ=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],UJ=Ce("sparkles",HJ);const VJ=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],qJ=Ce("star",VJ);const GJ=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],WJ=Ce("store",GJ);const KJ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],lj=Ce("sun",KJ);const YJ=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],cj=Ce("table",YJ);const ZJ=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],XJ=Ce("tag",ZJ);const QJ=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],JJ=Ce("terminal",QJ);const eee=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Hh=Ce("trash-2",eee);const tee=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],nee=Ce("trending-down",tee);const ree=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],QC=Ce("trending-up",ree);const see=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],JC=Ce("triangle-alert",see);const iee=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],oee=Ce("trophy",iee);const aee=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],lee=Ce("truck",aee);const cee=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],uee=Ce("underline",cee);const dee=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],fee=Ce("undo-2",dee);const hee=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],mp=Ce("upload",hee);const pee=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],mee=Ce("user",pee);const gee=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bee=Ce("users",gee);const vee=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],yee=Ce("video",vee);const xee=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wee=Ce("wifi-off",xee);const See=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],uj=Ce("wifi",See);const Cee=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],kee=Ce("wrench",Cee);const Eee=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ja=Ce("x",Eee);const Nee=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e6=Ce("zap",Nee);var $a=FD();const By=qC($a);function Mee(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Tee=e=>{switch(e){case"success":return Aee;case"info":return Dee;case"warning":return Oee;case"error":return jee;default:return null}},_ee=Array(12).fill(0),Ree=({visible:e,className:t})=>ie.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ie.createElement("div",{className:"sonner-spinner"},_ee.map((n,r)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Aee=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Oee=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Dee=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jee=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Iee=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zee=()=>{const[e,t]=ie.useState(document.hidden);return ie.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let jS=1;class Lee{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:jS++,o=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const a=s.then(async u=>{if(o=["resolve",u],ie.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if($ee(u)&&!u.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,y=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...y})}else if(u instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(u):n.error,g=typeof n.description=="function"?await n.description(u):n.description,y=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...y})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(u):n.success,g=typeof n.description=="function"?await n.description(u):n.description,y=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...y})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,b=typeof f=="object"&&!ie.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...b})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((u,f)=>a.then(()=>o[0]==="reject"?f(o[1]):u(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=n?.id||jS++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const xi=new Lee,Pee=(e,t)=>{const n=t?.id||jS++;return xi.addToast({title:e,...t,id:n}),n},$ee=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bee=Pee,Fee=()=>xi.toasts,Hee=()=>xi.getActiveToasts(),or=Object.assign(Bee,{success:xi.success,info:xi.info,warning:xi.warning,error:xi.error,custom:xi.custom,message:xi.message,promise:xi.promise,dismiss:xi.dismiss,loading:xi.loading},{getHistory:Fee,getToasts:Hee});Mee("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function E1(e){return e.label!==void 0}const Uee=3,Vee="24px",qee="16px",gM=4e3,Gee=356,Wee=14,Kee=45,Yee=200;function pa(...e){return e.filter(Boolean).join(" ")}function Zee(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Xee=e=>{var t,n,r,s,i,o,a,l,u;const{invert:f,toast:p,unstyled:g,interacting:b,setHeights:y,visibleToasts:x,heights:S,index:k,toasts:N,expanded:T,removeToast:R,defaultRichColors:_,closeButton:A,style:I,cancelButtonStyle:j,actionButtonStyle:L,className:q="",descriptionClassName:ne="",duration:re,position:oe,gap:le,expandByDefault:ce,classNames:F,icons:te,closeButtonAriaLabel:K="Close toast"}=e,[W,V]=ie.useState(null),[P,H]=ie.useState(null),[X,de]=ie.useState(!1),[fe,we]=ie.useState(!1),[pe,Re]=ie.useState(!1),[Ae,Ze]=ie.useState(!1),[nt,at]=ie.useState(!1),[Be,Ne]=ie.useState(0),[Jt,ut]=ie.useState(0),Ut=ie.useRef(p.duration||re||gM),nn=ie.useRef(null),kn=ie.useRef(null),Xn=k===0,sr=k+1<=x,Nn=p.type,Pn=p.dismissible!==!1,Kt=p.className||"",bn=p.descriptionClassName||"",Nt=ie.useMemo(()=>S.findIndex(U=>U.toastId===p.id)||0,[S,p.id]),$n=ie.useMemo(()=>{var U;return(U=p.closeButton)!=null?U:A},[p.closeButton,A]),Bn=ie.useMemo(()=>p.duration||re||gM,[p.duration,re]),En=ie.useRef(0),Fn=ie.useRef(0),Ts=ie.useRef(0),Kr=ie.useRef(null),[Ar,Qn]=oe.split("-"),_n=ie.useMemo(()=>S.reduce((U,Q,ge)=>ge>=Nt?U:U+Q.height,0),[S,Nt]),_t=zee(),_s=p.invert||f,Or=Nn==="loading";Fn.current=ie.useMemo(()=>Nt*le+_n,[Nt,_n]),ie.useEffect(()=>{Ut.current=Bn},[Bn]),ie.useEffect(()=>{de(!0)},[]),ie.useEffect(()=>{const U=kn.current;if(U){const Q=U.getBoundingClientRect().height;return ut(Q),y(ge=>[{toastId:p.id,height:Q,position:p.position},...ge]),()=>y(ge=>ge.filter(je=>je.toastId!==p.id))}},[y,p.id]),ie.useLayoutEffect(()=>{if(!X)return;const U=kn.current,Q=U.style.height;U.style.height="auto";const ge=U.getBoundingClientRect().height;U.style.height=Q,ut(ge),y(je=>je.find(lt=>lt.toastId===p.id)?je.map(lt=>lt.toastId===p.id?{...lt,height:ge}:lt):[{toastId:p.id,height:ge,position:p.position},...je])},[X,p.title,p.description,y,p.id,p.jsx,p.action,p.cancel]);const ht=ie.useCallback(()=>{we(!0),Ne(Fn.current),y(U=>U.filter(Q=>Q.toastId!==p.id)),setTimeout(()=>{R(p)},Yee)},[p,R,y,Fn]);ie.useEffect(()=>{if(p.promise&&Nn==="loading"||p.duration===1/0||p.type==="loading")return;let U;return T||b||_t?(()=>{if(Ts.current<En.current){const je=new Date().getTime()-En.current;Ut.current=Ut.current-je}Ts.current=new Date().getTime()})():Ut.current!==1/0&&(En.current=new Date().getTime(),U=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),ht()},Ut.current)),()=>clearTimeout(U)},[T,b,p,Nn,_t,ht]),ie.useEffect(()=>{p.delete&&(ht(),p.onDismiss==null||p.onDismiss.call(p,p))},[ht,p.delete]);function ke(){var U;if(te?.loading){var Q;return ie.createElement("div",{className:pa(F?.loader,p==null||(Q=p.classNames)==null?void 0:Q.loader,"sonner-loader"),"data-visible":Nn==="loading"},te.loading)}return ie.createElement(Ree,{className:pa(F?.loader,p==null||(U=p.classNames)==null?void 0:U.loader),visible:Nn==="loading"})}const Me=p.icon||te?.[Nn]||Tee(Nn);var Le,rt;return ie.createElement("li",{tabIndex:0,ref:kn,className:pa(q,Kt,F?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,F?.default,F?.[Nn],p==null||(n=p.classNames)==null?void 0:n[Nn]),"data-sonner-toast":"","data-rich-colors":(Le=p.richColors)!=null?Le:_,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":X,"data-promise":!!p.promise,"data-swiped":nt,"data-removed":fe,"data-visible":sr,"data-y-position":Ar,"data-x-position":Qn,"data-index":k,"data-front":Xn,"data-swiping":pe,"data-dismissible":Pn,"data-type":Nn,"data-invert":_s,"data-swipe-out":Ae,"data-swipe-direction":P,"data-expanded":!!(T||ce&&X),"data-testid":p.testId,style:{"--index":k,"--toasts-before":k,"--z-index":N.length-k,"--offset":`${fe?Be:Fn.current}px`,"--initial-height":ce?"auto":`${Jt}px`,...I,...p.style},onDragEnd:()=>{Re(!1),V(null),Kr.current=null},onPointerDown:U=>{U.button!==2&&(Or||!Pn||(nn.current=new Date,Ne(Fn.current),U.target.setPointerCapture(U.pointerId),U.target.tagName!=="BUTTON"&&(Re(!0),Kr.current={x:U.clientX,y:U.clientY})))},onPointerUp:()=>{var U,Q,ge;if(Ae||!Pn)return;Kr.current=null;const je=Number(((U=kn.current)==null?void 0:U.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((Q=kn.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((ge=nn.current)==null?void 0:ge.getTime()),Ke=W==="x"?je:Rt,Xe=Math.abs(Ke)/lt;if(Math.abs(Ke)>=Kee||Xe>.11){Ne(Fn.current),p.onDismiss==null||p.onDismiss.call(p,p),H(W==="x"?je>0?"right":"left":Rt>0?"down":"up"),ht(),Ze(!0);return}else{var dt,G;(dt=kn.current)==null||dt.style.setProperty("--swipe-amount-x","0px"),(G=kn.current)==null||G.style.setProperty("--swipe-amount-y","0px")}at(!1),Re(!1),V(null)},onPointerMove:U=>{var Q,ge,je;if(!Kr.current||!Pn||((Q=window.getSelection())==null?void 0:Q.toString().length)>0)return;const lt=U.clientY-Kr.current.y,Ke=U.clientX-Kr.current.x;var Xe;const dt=(Xe=e.swipeDirections)!=null?Xe:Zee(oe);!W&&(Math.abs(Ke)>1||Math.abs(lt)>1)&&V(Math.abs(Ke)>Math.abs(lt)?"x":"y");let G={x:0,y:0};const se=me=>1/(1.5+Math.abs(me)/20);if(W==="y"){if(dt.includes("top")||dt.includes("bottom"))if(dt.includes("top")&&lt<0||dt.includes("bottom")&&lt>0)G.y=lt;else{const me=lt*se(lt);G.y=Math.abs(me)<Math.abs(lt)?me:lt}}else if(W==="x"&&(dt.includes("left")||dt.includes("right")))if(dt.includes("left")&&Ke<0||dt.includes("right")&&Ke>0)G.x=Ke;else{const me=Ke*se(Ke);G.x=Math.abs(me)<Math.abs(Ke)?me:Ke}(Math.abs(G.x)>0||Math.abs(G.y)>0)&&at(!0),(ge=kn.current)==null||ge.style.setProperty("--swipe-amount-x",`${G.x}px`),(je=kn.current)==null||je.style.setProperty("--swipe-amount-y",`${G.y}px`)}},$n&&!p.jsx&&Nn!=="loading"?ie.createElement("button",{"aria-label":K,"data-disabled":Or,"data-close-button":!0,onClick:Or||!Pn?()=>{}:()=>{ht(),p.onDismiss==null||p.onDismiss.call(p,p)},className:pa(F?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(rt=te?.close)!=null?rt:Iee):null,(Nn||p.icon||p.promise)&&p.icon!==null&&(te?.[Nn]!==null||p.icon)?ie.createElement("div",{"data-icon":"",className:pa(F?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ke():null,p.type!=="loading"?Me:null):null,ie.createElement("div",{"data-content":"",className:pa(F?.content,p==null||(i=p.classNames)==null?void 0:i.content)},ie.createElement("div",{"data-title":"",className:pa(F?.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ie.createElement("div",{"data-description":"",className:pa(ne,bn,F?.description,p==null||(a=p.classNames)==null?void 0:a.description)},typeof p.description=="function"?p.description():p.description):null),ie.isValidElement(p.cancel)?p.cancel:p.cancel&&E1(p.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||j,onClick:U=>{E1(p.cancel)&&Pn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,U),ht())},className:pa(F?.cancelButton,p==null||(l=p.classNames)==null?void 0:l.cancelButton)},p.cancel.label):null,ie.isValidElement(p.action)?p.action:p.action&&E1(p.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:U=>{E1(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,U),!U.defaultPrevented&&ht())},className:pa(F?.actionButton,p==null||(u=p.classNames)==null?void 0:u.actionButton)},p.action.label):null)};function bM(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Qee(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",a=i?qee:Vee;function l(u){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}const Jee=ie.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:l,className:u,offset:f,mobileOffset:p,theme:g="light",richColors:b,duration:y,style:x,visibleToasts:S=Uee,toastOptions:k,dir:N=bM(),gap:T=Wee,icons:R,containerAriaLabel:_="Notifications"}=t,[A,I]=ie.useState([]),j=ie.useMemo(()=>r?A.filter(X=>X.toasterId===r):A.filter(X=>!X.toasterId),[A,r]),L=ie.useMemo(()=>Array.from(new Set([i].concat(j.filter(X=>X.position).map(X=>X.position)))),[j,i]),[q,ne]=ie.useState([]),[re,oe]=ie.useState(!1),[le,ce]=ie.useState(!1),[F,te]=ie.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=ie.useRef(null),W=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),V=ie.useRef(null),P=ie.useRef(!1),H=ie.useCallback(X=>{I(de=>{var fe;return(fe=de.find(we=>we.id===X.id))!=null&&fe.delete||xi.dismiss(X.id),de.filter(({id:we})=>we!==X.id)})},[]);return ie.useEffect(()=>xi.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{I(de=>de.map(fe=>fe.id===X.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{By.flushSync(()=>{I(de=>{const fe=de.findIndex(we=>we.id===X.id);return fe!==-1?[...de.slice(0,fe),{...de[fe],...X},...de.slice(fe+1)]:[X,...de]})})})}),[A]),ie.useEffect(()=>{if(g!=="system"){te(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:de})=>{te(de?"dark":"light")})}catch{X.addListener(({matches:fe})=>{try{te(fe?"dark":"light")}catch(we){console.error(we)}})}},[g]),ie.useEffect(()=>{A.length<=1&&oe(!1)},[A]),ie.useEffect(()=>{const X=de=>{var fe;if(o.every(Re=>de[Re]||de.code===Re)){var pe;oe(!0),(pe=K.current)==null||pe.focus()}de.code==="Escape"&&(document.activeElement===K.current||(fe=K.current)!=null&&fe.contains(document.activeElement))&&oe(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[o]),ie.useEffect(()=>{if(K.current)return()=>{V.current&&(V.current.focus({preventScroll:!0}),V.current=null,P.current=!1)}},[K.current]),ie.createElement("section",{ref:n,"aria-label":`${_} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((X,de)=>{var fe;const[we,pe]=X.split("-");return j.length?ie.createElement("ol",{key:X,dir:N==="auto"?bM():N,tabIndex:-1,ref:K,className:u,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":we,"data-x-position":pe,style:{"--front-toast-height":`${((fe=q[0])==null?void 0:fe.height)||0}px`,"--width":`${Gee}px`,"--gap":`${T}px`,...x,...Qee(f,p)},onBlur:Re=>{P.current&&!Re.currentTarget.contains(Re.relatedTarget)&&(P.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||P.current||(P.current=!0,V.current=Re.relatedTarget)},onMouseEnter:()=>oe(!0),onMouseMove:()=>oe(!0),onMouseLeave:()=>{le||oe(!1)},onDragEnd:()=>oe(!1),onPointerDown:Re=>{Re.target instanceof HTMLElement&&Re.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},j.filter(Re=>!Re.position&&de===0||Re.position===X).map((Re,Ae)=>{var Ze,nt;return ie.createElement(Xee,{key:Re.id,icons:R,index:Ae,toast:Re,defaultRichColors:b,duration:(Ze=k?.duration)!=null?Ze:y,className:k?.className,descriptionClassName:k?.descriptionClassName,invert:s,visibleToasts:S,closeButton:(nt=k?.closeButton)!=null?nt:l,interacting:le,position:X,style:k?.style,unstyled:k?.unstyled,classNames:k?.classNames,cancelButtonStyle:k?.cancelButtonStyle,actionButtonStyle:k?.actionButtonStyle,closeButtonAriaLabel:k?.closeButtonAriaLabel,removeToast:H,toasts:j.filter(at=>at.position==Re.position),heights:q.filter(at=>at.position==Re.position),setHeights:ne,expandByDefault:a,gap:T,expanded:re,swipeDirections:t.swipeDirections})})):null}))}),ete=({...e})=>{const{theme:t="system"}=$y();return h.jsx(Jee,{theme:t,className:"toaster group",icons:{success:h.jsx(YD,{className:"size-4"}),info:h.jsx(XC,{className:"size-4"}),warning:h.jsx(JC,{className:"size-4"}),error:h.jsx(uJ,{className:"size-4"}),loading:h.jsx(Co,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})};function vM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fl(...e){return t=>{let n=!1;const r=e.map(s=>{const i=vM(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():vM(e[s],null)}}}}function Gt(...e){return w.useCallback(Fl(...e),e)}function nu(e){const t=tte(e),n=w.forwardRef((r,s)=>{const{children:i,...o}=r,a=w.Children.toArray(i),l=a.find(nte);if(l){const u=l.props.children,f=a.map(p=>p===l?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:p);return h.jsx(t,{...o,ref:s,children:w.isValidElement(u)?w.cloneElement(u,void 0,f):null})}return h.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var $d=nu("Slot");function tte(e){const t=w.forwardRef((n,r)=>{const{children:s,...i}=n;if(w.isValidElement(s)){const o=ste(s),a=rte(i,s.props);return s.type!==w.Fragment&&(a.ref=r?Fl(r,o):o),w.cloneElement(s,a)}return w.Children.count(s)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dj=Symbol("radix.slottable");function fj(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=dj,t}function nte(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dj}function rte(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function ste(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ite=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=ite.reduce((e,t)=>{const n=nu(`Primitive.${t}`),r=w.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hj(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}var pj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ote="VisuallyHidden",mj=w.forwardRef((e,t)=>h.jsx(tt.span,{...e,ref:t,style:{...pj,...e.style}}));mj.displayName=ote;var ate=mj;function lte(e,t){const n=w.createContext(t),r=i=>{const{children:o,...a}=i,l=w.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function s(i){const o=w.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function ys(e,t=[]){let n=[];function r(i,o){const a=w.createContext(o),l=n.length;n=[...n,o];const u=p=>{const{scope:g,children:b,...y}=p,x=g?.[e]?.[l]||a,S=w.useMemo(()=>y,Object.values(y));return h.jsx(x.Provider,{value:S,children:b})};u.displayName=i+"Provider";function f(p,g){const b=g?.[e]?.[l]||a,y=w.useContext(b);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(o=>w.createContext(o));return function(a){const l=a?.[e]||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,cte(s,...t)]}function cte(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...a,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function t6(e){const t=e+"CollectionProvider",[n,r]=ys(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:S,children:k}=x,N=ie.useRef(null),T=ie.useRef(new Map).current;return h.jsx(s,{scope:S,itemMap:T,collectionRef:N,children:k})};o.displayName=t;const a=e+"CollectionSlot",l=nu(a),u=ie.forwardRef((x,S)=>{const{scope:k,children:N}=x,T=i(a,k),R=Gt(S,T.collectionRef);return h.jsx(l,{ref:R,children:N})});u.displayName=a;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=nu(f),b=ie.forwardRef((x,S)=>{const{scope:k,children:N,...T}=x,R=ie.useRef(null),_=Gt(S,R),A=i(f,k);return ie.useEffect(()=>(A.itemMap.set(R,{ref:R,...T}),()=>{A.itemMap.delete(R)})),h.jsx(g,{[p]:"",ref:_,children:N})});b.displayName=f;function y(x){const S=i(e+"CollectionConsumer",x);return ie.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((A,I)=>T.indexOf(A.ref.current)-T.indexOf(I.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:u,ItemSlot:b},y,r]}function Ge(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}var Gr=globalThis?.document?w.useLayoutEffect:()=>{},ute=GC[" useInsertionEffect ".trim().toString()]||Gr;function ai({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=dte({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const f=w.useRef(e!==void 0);w.useEffect(()=>{const p=f.current;p!==a&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=w.useCallback(f=>{if(a){const p=fte(f)?f(e):f;p!==e&&o.current?.(p)}else i(f)},[a,e,i,o]);return[l,u]}function dte({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),s=w.useRef(n),i=w.useRef(t);return ute(()=>{i.current=t},[t]),w.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function fte(e){return typeof e=="function"}function hte(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var xs=e=>{const{present:t,children:n}=e,r=pte(t),s=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Gt(r.ref,mte(s));return typeof n=="function"||r.isPresent?w.cloneElement(s,{ref:i}):null};xs.displayName="Presence";function pte(e){const[t,n]=w.useState(),r=w.useRef(null),s=w.useRef(e),i=w.useRef("none"),o=e?"mounted":"unmounted",[a,l]=hte(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=N1(r.current);i.current=a==="mounted"?u:"none"},[a]),Gr(()=>{const u=r.current,f=s.current;if(f!==e){const g=i.current,b=N1(u);e?l("MOUNT"):b==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&g!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Gr(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,p=b=>{const x=N1(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&x&&(l("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=b=>{b.target===t&&(i.current=N1(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function N1(e){return e?.animationName||"none"}function mte(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gte=GC[" useId ".trim().toString()]||(()=>{}),bte=0;function qr(e){const[t,n]=w.useState(gte());return Gr(()=>{n(r=>r??String(bte++))},[e]),t?`radix-${t}`:""}var Fy="Collapsible",[vte]=ys(Fy),[yte,n6]=vte(Fy),gj=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=e,[l,u]=ai({prop:r,defaultProp:s??!1,onChange:o,caller:Fy});return h.jsx(yte,{scope:n,disabled:i,contentId:qr(),open:l,onOpenToggle:w.useCallback(()=>u(f=>!f),[u]),children:h.jsx(tt.div,{"data-state":s6(l),"data-disabled":i?"":void 0,...a,ref:t})})});gj.displayName=Fy;var bj="CollapsibleTrigger",vj=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=n6(bj,n);return h.jsx(tt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":s6(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ge(e.onClick,s.onOpenToggle)})});vj.displayName=bj;var r6="CollapsibleContent",yj=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=n6(r6,e.__scopeCollapsible);return h.jsx(xs,{present:n||s.open,children:({present:i})=>h.jsx(xte,{...r,ref:t,present:i})})});yj.displayName=r6;var xte=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=n6(r6,n),[a,l]=w.useState(r),u=w.useRef(null),f=Gt(t,u),p=w.useRef(0),g=p.current,b=w.useRef(0),y=b.current,x=o.open||a,S=w.useRef(x),k=w.useRef(void 0);return w.useEffect(()=>{const N=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(N)},[]),Gr(()=>{const N=u.current;if(N){k.current=k.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const T=N.getBoundingClientRect();p.current=T.height,b.current=T.width,S.current||(N.style.transitionDuration=k.current.transitionDuration,N.style.animationName=k.current.animationName),l(r)}},[o.open,r]),h.jsx(tt.div,{"data-state":s6(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!x,...i,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:x&&s})});function s6(e){return e?"open":"closed"}var wte=gj,Ste=w.createContext(void 0);function Uh(e){const t=w.useContext(Ste);return e||t||"ltr"}function ts(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function Cte(e,t=globalThis?.document){const n=ts(e);w.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var kte="DismissableLayer",IS="dismissableLayer.update",Ete="dismissableLayer.pointerDownOutside",Nte="dismissableLayer.focusOutside",yM,xj=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vh=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=e,u=w.useContext(xj),[f,p]=w.useState(null),g=f?.ownerDocument??globalThis?.document,[,b]=w.useState({}),y=Gt(t,I=>p(I)),x=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),k=x.indexOf(S),N=f?x.indexOf(f):-1,T=u.layersWithOutsidePointerEventsDisabled.size>0,R=N>=k,_=_te(I=>{const j=I.target,L=[...u.branches].some(q=>q.contains(j));!R||L||(s?.(I),o?.(I),I.defaultPrevented||a?.())},g),A=Rte(I=>{const j=I.target;[...u.branches].some(q=>q.contains(j))||(i?.(I),o?.(I),I.defaultPrevented||a?.())},g);return Cte(I=>{N===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},g),w.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yM=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),xM(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=yM)}},[f,g,n,u]),w.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),xM())},[f,u]),w.useEffect(()=>{const I=()=>b({});return document.addEventListener(IS,I),()=>document.removeEventListener(IS,I)},[]),h.jsx(tt.div,{...l,ref:y,style:{pointerEvents:T?R?"auto":"none":void 0,...e.style},onFocusCapture:Ge(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ge(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ge(e.onPointerDownCapture,_.onPointerDownCapture)})});Vh.displayName=kte;var Mte="DismissableLayerBranch",Tte=w.forwardRef((e,t)=>{const n=w.useContext(xj),r=w.useRef(null),s=Gt(t,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(tt.div,{...e,ref:s})});Tte.displayName=Mte;function _te(e,t=globalThis?.document){const n=ts(e),r=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){wj(Ete,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rte(e,t=globalThis?.document){const n=ts(e),r=w.useRef(!1);return w.useEffect(()=>{const s=i=>{i.target&&!r.current&&wj(Nte,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xM(){const e=new CustomEvent(IS);document.dispatchEvent(e)}function wj(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?hj(s,i):s.dispatchEvent(i)}var A4="focusScope.autoFocusOnMount",O4="focusScope.autoFocusOnUnmount",wM={bubbles:!1,cancelable:!0},Ate="FocusScope",Rm=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,l]=w.useState(null),u=ts(s),f=ts(i),p=w.useRef(null),g=Gt(t,x=>l(x)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(T){if(b.paused||!a)return;const R=T.target;a.contains(R)?p.current=R:jc(p.current,{select:!0})},S=function(T){if(b.paused||!a)return;const R=T.relatedTarget;R!==null&&(a.contains(R)||jc(p.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const _ of T)_.removedNodes.length>0&&jc(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",S);const N=new MutationObserver(k);return a&&N.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),N.disconnect()}}},[r,a,b.paused]),w.useEffect(()=>{if(a){CM.add(b);const x=document.activeElement;if(!a.contains(x)){const k=new CustomEvent(A4,wM);a.addEventListener(A4,u),a.dispatchEvent(k),k.defaultPrevented||(Ote(Lte(Sj(a)),{select:!0}),document.activeElement===x&&jc(a))}return()=>{a.removeEventListener(A4,u),setTimeout(()=>{const k=new CustomEvent(O4,wM);a.addEventListener(O4,f),a.dispatchEvent(k),k.defaultPrevented||jc(x??document.body,{select:!0}),a.removeEventListener(O4,f),CM.remove(b)},0)}}},[a,u,f,b]);const y=w.useCallback(x=>{if(!n&&!r||b.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(S&&k){const N=x.currentTarget,[T,R]=Dte(N);T&&R?!x.shiftKey&&k===R?(x.preventDefault(),n&&jc(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),n&&jc(R,{select:!0})):k===N&&x.preventDefault()}},[n,r,b.paused]);return h.jsx(tt.div,{tabIndex:-1,...o,ref:g,onKeyDown:y})});Rm.displayName=Ate;function Ote(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jc(r,{select:t}),document.activeElement!==n)return}function Dte(e){const t=Sj(e),n=SM(t,e),r=SM(t.reverse(),e);return[n,r]}function Sj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function SM(e,t){for(const n of e)if(!jte(n,{upTo:t}))return n}function jte(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ite(e){return e instanceof HTMLInputElement&&"select"in e}function jc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ite(e)&&t&&e.select()}}var CM=zte();function zte(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kM(e,t),e.unshift(t)},remove(t){e=kM(e,t),e[0]?.resume()}}}function kM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Lte(e){return e.filter(t=>t.tagName!=="A")}var Pte="Portal",qh=w.forwardRef((e,t)=>{const{container:n,...r}=e,[s,i]=w.useState(!1);Gr(()=>i(!0),[]);const o=n||s&&globalThis?.document?.body;return o?By.createPortal(h.jsx(tt.div,{...r,ref:t}),o):null});qh.displayName=Pte;var D4=0;function Hy(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??EM()),document.body.insertAdjacentElement("beforeend",e[1]??EM()),D4++,()=>{D4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),D4--}},[])}function EM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ca=function(){return Ca=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ca.apply(this,arguments)};function Cj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function $te(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Rb="right-scroll-bar-position",Ab="width-before-scroll-bar",Bte="with-scroll-bars-hidden",Fte="--removed-body-scroll-bar-size";function j4(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Hte(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Ute=typeof window<"u"?w.useLayoutEffect:w.useEffect,NM=new WeakMap;function Vte(e,t){var n=Hte(null,function(r){return e.forEach(function(s){return j4(s,r)})});return Ute(function(){var r=NM.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(a){i.has(a)||j4(a,null)}),i.forEach(function(a){s.has(a)||j4(a,o)})}NM.set(n,e)},[e]),n}function qte(e){return e}function Gte(e,t){t===void 0&&(t=qte);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var l=function(){var f=o;o=[],f.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return s}function Wte(e){e===void 0&&(e={});var t=Gte(null);return t.options=Ca({async:!0,ssr:!1},e),t}var kj=function(e){var t=e.sideCar,n=Cj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Ca({},n))};kj.isSideCarExport=!0;function Kte(e,t){return e.useMedium(t),kj}var Ej=Wte(),I4=function(){},Uy=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:I4,onWheelCapture:I4,onTouchMoveCapture:I4}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,p=e.shards,g=e.sideCar,b=e.noRelative,y=e.noIsolation,x=e.inert,S=e.allowPinchZoom,k=e.as,N=k===void 0?"div":k,T=e.gapMode,R=Cj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=g,A=Vte([n,t]),I=Ca(Ca({},R),s);return w.createElement(w.Fragment,null,f&&w.createElement(_,{sideCar:Ej,removeScrollBar:u,shards:p,noRelative:b,noIsolation:y,inert:x,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:T}),o?w.cloneElement(w.Children.only(a),Ca(Ca({},I),{ref:A})):w.createElement(N,Ca({},I,{className:l,ref:A}),a))});Uy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Uy.classNames={fullWidth:Ab,zeroRight:Rb};var Yte=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yte();return t&&e.setAttribute("nonce",t),e}function Xte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Jte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zte())&&(Xte(t,n),Qte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ene=function(){var e=Jte();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nj=function(){var e=ene(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},tne={left:0,top:0,right:0,gap:0},z4=function(e){return parseInt(e||"",10)||0},nne=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[z4(n),z4(r),z4(s)]},rne=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tne;var t=nne(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])}},sne=Nj(),ah="data-scroll-locked",ine=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
10
10
  .`.concat(Bte,` {
11
11
  overflow: hidden `).concat(r,`;
@@ -72,7 +72,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
72
72
  `);return o===-1?"":s.stack.slice(o+1)})();try{if(!r.stack)r.stack=i;else if(i){const o=i.indexOf(`
73
73
  `),a=o===-1?-1:i.indexOf(`
74
74
  `,o+1),l=a===-1?"":i.slice(a+1);String(r.stack).endsWith(l)||(r.stack+=`
75
- `+i)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Nd(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Pb.assertOptions(r,{silentJSONParsing:po.transitional(po.boolean),forcedJSONParsing:po.transitional(po.boolean),clarifyTimeoutError:po.transitional(po.boolean),legacyInterceptorReqResOrdering:po.transitional(po.boolean)},!1),s!=null&&(xe.isFunction(s)?n.paramsSerializer={serialize:s}:Pb.assertOptions(s,{encode:po.function,serialize:po.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pb.assertOptions(n,{baseUrl:po.spelling("baseURL"),withXsrfToken:po.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&xe.merge(i.common,i[n.method]);i&&xe.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Mi.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;l=l&&x.synchronous;const S=n.transitional||yk;S&&S.legacyInterceptorReqResOrdering?a.unshift(x.fulfilled,x.rejected):a.push(x.fulfilled,x.rejected)});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,p=0,g;if(!l){const y=[k_.bind(this),void 0];for(y.unshift(...a),y.push(...u),g=y.length,f=Promise.resolve(n);p<g;)f=f.then(y[p++],y[p++]);return f}g=a.length;let b=n;for(;p<g;){const y=a[p++],x=a[p++];try{b=y(b)}catch(S){x.call(this,S);break}}try{f=k_.call(this,b)}catch(y){return Promise.reject(y)}for(p=0,g=u.length;p<g;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=Nd(this.defaults,t);const n=SB(t.baseURL,t.url,t.allowAbsoluteUrls);return vB(n,t.params,t.paramsSerializer)}};xe.forEach(["delete","get","head","options"],function(t){dd.prototype[t]=function(n,r){return this.request(Nd(r||{},{method:t,url:n,data:(r||{}).data}))}});xe.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Nd(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}dd.prototype[t]=n(),dd.prototype[t+"Form"]=n(!0)});let Cpe=class MB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new Xm(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new MB(function(s){t=s}),cancel:t}}};function kpe(e){return function(n){return e.apply(null,n)}}function Epe(e){return xe.isObject(e)&&e.isAxiosError===!0}const h3={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(h3).forEach(([e,t])=>{h3[t]=e});function TB(e){const t=new dd(e),n=aB(dd.prototype.request,t);return xe.extend(n,dd.prototype,t,{allOwnKeys:!0}),xe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return TB(Nd(e,s))},n}const mn=TB(Zm);mn.Axios=dd;mn.CanceledError=Xm;mn.CancelToken=Cpe;mn.isCancel=xB;mn.VERSION=NB;mn.toFormData=Nx;mn.AxiosError=zt;mn.Cancel=mn.CanceledError;mn.all=function(t){return Promise.all(t)};mn.spread=kpe;mn.isAxiosError=Epe;mn.mergeConfig=Nd;mn.AxiosHeaders=Mi;mn.formToJSON=e=>yB(xe.isHTMLForm(e)?new FormData(e):e);mn.getAdapter=EB.getAdapter;mn.HttpStatusCode=h3;mn.default=mn;const{Axios:lLe,AxiosError:cLe,CanceledError:uLe,isCancel:dLe,CancelToken:fLe,VERSION:hLe,all:pLe,Cancel:mLe,isAxiosError:gLe,spread:bLe,toFormData:vLe,AxiosHeaders:yLe,HttpStatusCode:xLe,formToJSON:wLe,getAdapter:SLe,mergeConfig:CLe}=mn,N_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M_=qP,Ud=(e,t)=>n=>{var r;if(t?.variants==null)return M_(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const f=n?.[u],p=i?.[u];if(f===null)return null;const g=N_(f)||N_(p);return s[u][g]}),a=n&&Object.entries(n).reduce((u,f)=>{let[p,g]=f;return g===void 0||(u[p]=g),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:p,className:g,...b}=f;return Object.entries(b).every(y=>{let[x,S]=y;return Array.isArray(S)?S.includes({...i,...a}[x]):{...i,...a}[x]===S})?[...u,p,g]:u},[]);return M_(e,o,l,n?.class,n?.className)},Sv=Ud("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function He({className:e,variant:t="default",size:n="default",asChild:r=!1,...s}){const i=r?$d:"button";return h.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:ee(Sv({variant:t,size:n,className:e})),...s})}function Wn({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:ee("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function xr({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function _r({className:e,...t}){return h.jsx("div",{"data-slot":"card-title",className:ee("leading-none font-semibold",e),...t})}function Xo({className:e,...t}){return h.jsx("div",{"data-slot":"card-description",className:ee("text-muted-foreground text-sm",e),...t})}function Kn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:ee("px-6",e),...t})}function br({className:e,...t}){return h.jsx(coe,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Hi({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx(_ae,{"data-slot":"separator",decorative:n,orientation:t,className:ee("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Sk({className:e,...t}){return h.jsx("div",{"data-slot":"field-group",className:ee("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...t})}const Npe=Ud("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function Qc({className:e,orientation:t="vertical",...n}){return h.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ee(Npe({orientation:t}),e),...n})}function nm({className:e,...t}){return h.jsx(br,{"data-slot":"field-label",className:ee("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),...t})}function Mpe({className:e,...t}){return h.jsx("p",{"data-slot":"field-description",className:ee("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Ck({className:e,children:t,errors:n,...r}){const s=w.useMemo(()=>{if(t)return t;if(!n?.length)return null;const i=[...new Map(n.map(o=>[o?.message,o])).values()];return i?.length==1?i[0]?.message:h.jsx("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((o,a)=>o?.message&&h.jsx("li",{children:o.message},a))})},[t,n]);return s?h.jsx("div",{role:"alert","data-slot":"field-error",className:ee("text-destructive text-sm font-normal",e),...r,children:s}):null}function pn({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:ee("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}async function Tpe(){const{data:e}=await mn.get("/auth/features");return e}function _pe(){const{data:e}=is({queryKey:["auth-features"],queryFn:Tpe,staleTime:3e5,retry:!1});return{passwordReset:e?.passwordReset??!1}}const p3="/login";let kk=null;function Rpe(){return kk}function _B(e){kk=e}function Cv(){kk=null}const Xt=mn.create({baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json"},withCredentials:!0});Xt.interceptors.request.use(e=>{const t=Rpe();return t&&(e.headers.Authorization=`Bearer ${t}`),e.data instanceof FormData&&delete e.headers["Content-Type"],e});let F1=!1,m3=[];function Ape(e){m3.push(e)}function Ope(e){m3.forEach(t=>t(e)),m3=[]}Xt.interceptors.response.use(e=>e,async e=>{const t=e.config;if(e.response?.status===401&&typeof window<"u"){const n=t?.url||"",r=n.includes("/auth/login"),s=n.includes("/auth/refresh");if(r||s)return Promise.reject(e);if(F1)return new Promise(i=>{Ape(o=>{t.headers.Authorization=`Bearer ${o}`,i(mn(t))})});F1=!0;try{const{data:i}=await mn.post("/auth/refresh",{},{withCredentials:!0}),o=i.token;return _B(o),t.headers.Authorization=`Bearer ${o}`,Ope(o),F1=!1,mn(t)}catch(i){return F1=!1,Cv(),window.location.pathname.startsWith(p3)||window.location.replace(p3),Promise.reject(i)}}return Promise.reject(e)});async function Dpe(){if(typeof window<"u"){try{await mn.post("/auth/logout",{},{withCredentials:!0})}catch(e){console.error("Logout error:",e)}Cv(),window.location.replace(p3)}}const RB=w.createContext(null);function jpe(e){try{const t=JSON.parse(atob(e.split(".")[1]));return{email:t.email??"",name:t.name??"Admin"}}catch{return null}}function Ipe({children:e}){const[t,n]=w.useState("loading"),[r,s]=w.useState(null);function i(a){_B(a),s(jpe(a)),n("authenticated")}function o(){Cv(),s(null),n("unauthenticated")}return w.useEffect(()=>{mn.post("/auth/refresh",{},{withCredentials:!0}).then(({data:a})=>i(a.token)).catch(()=>{Cv(),n("unauthenticated")})},[]),h.jsx(RB.Provider,{value:{status:t,user:r,setToken:i,clearToken:o},children:e})}function Tx(){const e=w.useContext(RB);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const zpe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,AB=8,OB=128,If={EMAIL_REQUIRED:"Inserisci l'email",EMAIL_INVALID:"Email non valida",PASSWORD_REQUIRED:"Inserisci la password",PASSWORD_TOO_SHORT:`La password deve essere almeno ${AB} caratteri`,PASSWORD_TOO_LONG:`La password non può superare i ${OB} caratteri`,CREDENTIALS_INVALID:"Email o Password errate"};function Lpe(){const e=zo(),{setToken:t}=Tx(),[n,r]=w.useState(""),[s,i]=w.useState(""),[o,a]=w.useState(!1),[l,u]=w.useState(null),[f,p]=w.useState(null),[g,b]=w.useState(!1),y=n.trim().length>0&&s.trim().length>0;return{emailValue:n,passwordValue:s,isPasswordVisible:o,emailError:l,passwordError:f,isLoading:g,isFormValid:y,handleEmailChange:T=>{r(T.target.value),u(null),p(null)},handlePasswordChange:T=>{i(T.target.value),p(null),u(null)},togglePasswordVisibility:()=>a(T=>!T),handleSubmit:async T=>{T.preventDefault();const R=n.trim(),_=s;if(u(null),p(null),!R){u(If.EMAIL_REQUIRED);return}if(!zpe.test(R)){u(If.EMAIL_INVALID);return}if(!_){p(If.PASSWORD_REQUIRED);return}if(_.length<AB){p(If.PASSWORD_TOO_SHORT);return}if(_.length>OB){p(If.PASSWORD_TOO_LONG);return}b(!0);try{const{data:A}=await mn.post("/auth/login",{email:R,password:_},{withCredentials:!0});t(A.token),b(!1),e("/",{replace:!0})}catch(A){b(!1),mn.isAxiosError(A)?A.response?.status===401?p(If.CREDENTIALS_INVALID):p("Errore durante il login. Riprova più tardi."):p("Errore di connessione. Verifica la tua connessione internet.")}}}}function Ppe(e){const{t}=kt(),{passwordReset:n}=_pe(),{className:r,...s}=e,{emailValue:i,passwordValue:o,isPasswordVisible:a,emailError:l,passwordError:u,isLoading:f,isFormValid:p,handleEmailChange:g,handlePasswordChange:b,togglePasswordVisibility:y,handleSubmit:x}=Lpe();return h.jsxs("div",{className:ee("flex flex-col gap-6",r),...s,children:[h.jsx(Wn,{className:"overflow-hidden p-0 shadow-md",children:h.jsxs(Kn,{className:"relative grid grid-cols-1 p-0 md:grid-cols-2",children:[h.jsx("img",{src:"/admin/undraw_clouds_bmtk.svg",alt:"",className:"absolute -left-30 -top-36 z-0 h-96 w-96 rotate-150 scale-x-[-1]","aria-hidden":"true"}),h.jsx("img",{src:"/admin/sol.svg",alt:"",className:"absolute right-23 -top-28 z-0 hidden h-80 w-80 md:block md:h-[29rem] md:w-[28rem]","aria-hidden":"true"}),h.jsx("form",{className:"relative z-10 flex min-h-[36rem] flex-col justify-center p-6 md:p-8",onSubmit:x,noValidate:!0,children:h.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center",children:h.jsxs(Sk,{className:"w-full max-w-sm",children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Welcome back"}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:"Login to your Beech CMS account"})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"email",children:"Email"}),h.jsx(pn,{id:"email",name:"email",type:"email",placeholder:"m@example.com",autoComplete:"username",inputMode:"email",value:i,className:ee(l?"border-destructive":""),onChange:g})]}),h.jsxs(Qc,{children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx(nm,{htmlFor:"password",children:"Password"}),n&&h.jsx(gs,{to:"/forgot-password",className:"ml-auto text-sm underline-offset-2 hover:underline",children:t("login.forgotPassword")})]}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"password",name:"password",type:a?"text":"password",autoComplete:"current-password",value:o,className:ee("pr-10",u&&"border-destructive"),onChange:b}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:y,"aria-label":t(a?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:a?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})},a?"visible":"hidden")})]}),(l||u)&&h.jsx(Ck,{children:l||u})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!p||f,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",p&&!f?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:f?t("login.signingIn"):"Login"})})]})})}),h.jsx("div",{className:"relative hidden md:block md:min-h-[36rem] md:overflow-hidden",children:h.jsx("img",{src:"/admin/undraw_enter_nwx3.svg",alt:"Illustrazione area login",className:"absolute -bottom-7 -right-28 h-full max-h-[42rem] w-full max-w-lg object-contain object-right-bottom scale-x-[-1]"})})]})}),h.jsxs(Mpe,{className:"px-6 text-center",children:["By clicking continue, you agree to our ",h.jsx("a",{href:"#",children:"Terms of Service"})," ","and ",h.jsx("a",{href:"#",children:"Privacy Policy"}),"."]})]})}const Ek={};function DB(e){return Ek[e]??null}function De(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const u=o.prototype,f=Object.keys(u);for(let p=0;p<f.length;p++){const g=f[p];g in a||(a[g]=u[g].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var l;const u=n?.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class fh extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jB extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $pe={};function su(e){return $pe}function IB(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function g3(e,t){return typeof t=="bigint"?t.toString():t}function Nk(e){return e==null}function Mk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Bpe(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(s=Number.parseInt(l[1]))}const i=n>s?n:s,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}const T_=Symbol("evaluating");function cr(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==T_)return r===void 0&&(r=T_,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Fpe(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Hpe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zB="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function __(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kv(e){if(__(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(__(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function LB(e){return kv(e)?{...e}:Array.isArray(e)?[...e]:e}const Upe=new Set(["string","number","symbol"]);function _x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vpe(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function jt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const qpe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sh(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xp(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function H1(e){return typeof e=="string"?e:e?.message}function iu(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=H1(e.inst?._zod.def?.error?.(e))??H1(t?.error?.(e))??H1(n.customError?.(e))??H1(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Tk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rm(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const PB=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,g3,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},$B=De("$ZodError",PB),BB=De("$ZodError",PB,{Parent:Error});function Gpe(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Wpe(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let o=n,a=0;for(;a<i.path.length;){const l=i.path[a];a===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(i))):o[l]=o[l]||{_errors:[]},o=o[l],a++}}};return r(e),n}const _k=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new fh;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>iu(l,i,su())));throw zB(a,s?.callee),a}return o.value},Rk=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>iu(l,i,su())));throw zB(a,s?.callee),a}return o.value},Rx=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new fh;return i.issues.length?{success:!1,error:new(e??$B)(i.issues.map(o=>iu(o,s,su())))}:{success:!0,data:i.value}},Kpe=Rx(BB),Ax=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>iu(o,s,su())))}:{success:!0,data:i.value}},Ype=Ax(BB),Zpe=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _k(e)(t,n,s)},Xpe=e=>(t,n,r)=>_k(e)(t,n,r),Qpe=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rk(e)(t,n,s)},Jpe=e=>async(t,n,r)=>Rk(e)(t,n,r),eme=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rx(e)(t,n,s)},tme=e=>(t,n,r)=>Rx(e)(t,n,r),nme=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ax(e)(t,n,s)},rme=e=>async(t,n,r)=>Ax(e)(t,n,r),sme=/^[cC][^\s-]{8,}$/,ime=/^[0-9a-z]+$/,ome=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ame=/^[0-9a-vA-V]{20}$/,lme=/^[A-Za-z0-9]{27}$/,cme=/^[a-zA-Z0-9_-]{21}$/,ume=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dme=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,R_=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fme=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hme="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pme(){return new RegExp(hme,"u")}const mme=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gme=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bme=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vme=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yme=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FB=/^[A-Za-z0-9_-]*$/,xme=/^\+[1-9]\d{6,14}$/,HB="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wme=new RegExp(`^${HB}$`);function UB(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Sme(e){return new RegExp(`^${UB(e)}$`)}function Cme(e){const t=UB({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${HB}T(?:${r})$`)}const kme=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Eme=/^-?\d+$/,VB=/^-?\d+(?:\.\d+)?$/,Nme=/^[^A-Z]*$/,Mme=/^[^a-z]*$/,Ai=De("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qB={number:"number",bigint:"bigint",object:"date"},GB=De("$ZodCheckLessThan",(e,t)=>{Ai.init(e,t);const n=qB[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),WB=De("$ZodCheckGreaterThan",(e,t)=>{Ai.init(e,t);const n=qB[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tme=De("$ZodCheckMultipleOf",(e,t)=>{Ai.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Bpe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_me=De("$ZodCheckNumberFormat",(e,t)=>{Ai.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=qpe[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=i,n&&(a.pattern=Eme)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Rme=De("$ZodCheckMaxLength",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=Tk(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Ame=De("$ZodCheckMinLength",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=Tk(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Ome=De("$ZodCheckLengthEquals",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=Tk(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ox=De("$ZodCheckStringFormat",(e,t)=>{var n,r;Ai.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dme=De("$ZodCheckRegex",(e,t)=>{Ox.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jme=De("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Nme),Ox.init(e,t)}),Ime=De("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mme),Ox.init(e,t)}),zme=De("$ZodCheckIncludes",(e,t)=>{Ai.init(e,t);const n=_x(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Lme=De("$ZodCheckStartsWith",(e,t)=>{Ai.init(e,t);const n=new RegExp(`^${_x(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Pme=De("$ZodCheckEndsWith",(e,t)=>{Ai.init(e,t);const n=new RegExp(`.*${_x(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),$me=De("$ZodCheckOverwrite",(e,t)=>{Ai.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),Bme={major:4,minor:3,patch:6},ws=De("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bme;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,l)=>{let u=sh(o),f;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;const g=o.issues.length,b=p._zod.check(o);if(b instanceof Promise&&l?.async===!1)throw new fh;if(f||b instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await b,o.issues.length!==g&&(u||(u=sh(o,g)))});else{if(o.issues.length===g)continue;u||(u=sh(o,g))}}return f?f.then(()=>o):o},i=(o,a,l)=>{if(sh(o))return o.aborted=!0,o;const u=s(a,r,l);if(u instanceof Promise){if(l.async===!1)throw new fh;return u.then(f=>e._zod.parse(f,l))}return e._zod.parse(u,l)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>i(f,o,a)):i(u,o,a)}const l=e._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new fh;return l.then(u=>s(u,r,a))}return s(l,r,a)}}cr(e,"~standard",()=>({validate:s=>{try{const i=Kpe(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ype(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Ak=De("$ZodString",(e,t)=>{ws.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kme(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Sr=De("$ZodStringFormat",(e,t)=>{Ox.init(e,t),Ak.init(e,t)}),Fme=De("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dme),Sr.init(e,t)}),Hme=De("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=R_(r))}else t.pattern??(t.pattern=R_());Sr.init(e,t)}),Ume=De("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=fme),Sr.init(e,t)}),Vme=De("$ZodURL",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qme=De("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=pme()),Sr.init(e,t)}),Gme=De("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cme),Sr.init(e,t)}),Wme=De("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=sme),Sr.init(e,t)}),Kme=De("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ime),Sr.init(e,t)}),Yme=De("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ome),Sr.init(e,t)}),Zme=De("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ame),Sr.init(e,t)}),Xme=De("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lme),Sr.init(e,t)}),Qme=De("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Cme(t)),Sr.init(e,t)}),Jme=De("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wme),Sr.init(e,t)}),ege=De("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Sme(t)),Sr.init(e,t)}),tge=De("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ume),Sr.init(e,t)}),nge=De("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mme),Sr.init(e,t),e._zod.bag.format="ipv4"}),rge=De("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gme),Sr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),sge=De("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bme),Sr.init(e,t)}),ige=De("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vme),Sr.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function KB(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const oge=De("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yme),Sr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{KB(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function age(e){if(!FB.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return KB(n)}const lge=De("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=FB),Sr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{age(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),cge=De("$ZodE164",(e,t)=>{t.pattern??(t.pattern=xme),Sr.init(e,t)});function uge(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const dge=De("$ZodJWT",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{uge(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),YB=De("$ZodNumber",(e,t)=>{ws.init(e,t),e._zod.pattern=e._zod.bag.pattern??VB,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),fge=De("$ZodNumberFormat",(e,t)=>{_me.init(e,t),YB.init(e,t)}),hge=De("$ZodUnknown",(e,t)=>{ws.init(e,t),e._zod.parse=n=>n});function A_(e,t,n){e.issues.length&&t.issues.push(...xp(n,e.issues)),t.value[n]=e.value}const pge=De("$ZodArray",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>A_(u,n,o))):A_(l,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function O_(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!sh(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>iu(o,r,su())))}),t)}const mge=De("$ZodUnion",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),cr(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),cr(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),cr(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Mk(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const l of t.options){const u=l._zod.run({value:s.value,issues:[]},i);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(l=>O_(l,s,e,i)):O_(a,s,e,i)}}),gge=De("$ZodIntersection",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([l,u])=>D_(n,l,u)):D_(n,i,o)}});function b3(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(kv(e)&&kv(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=b3(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=b3(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function D_(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),sh(e))return e;const o=b3(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const bge=De("$ZodRecord",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!kv(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const f=t.valueType._zod.run({value:s[u],issues:[]},r);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...xp(u,p.issues)),n.value[u]=p.value})):(f.issues.length&&n.issues.push(...xp(u,f.issues)),n.value[u]=f.value)}let l;for(const u in s)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&VB.test(a)&&l.issues.length){const p=t.keyType._zod.run({value:Number(a),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>iu(p,r,su())),input:a,path:[a],inst:e});continue}const f=t.valueType._zod.run({value:s[a],issues:[]},r);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...xp(a,p.issues)),n.value[l.value]=p.value})):(f.issues.length&&n.issues.push(...xp(a,f.issues)),n.value[l.value]=f.value)}}return i.length?Promise.all(i).then(()=>n):n}}),vge=De("$ZodEnum",(e,t)=>{ws.init(e,t);const n=IB(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>Upe.has(typeof s)).map(s=>typeof s=="string"?_x(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),yge=De("$ZodTransform",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new jB(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new fh;return n.value=s,n}});function j_(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ZB=De("$ZodOptional",(e,t)=>{ws.init(e,t),e._zod.optin="optional",e._zod.optout="optional",cr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),cr(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mk(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>j_(i,n.value)):j_(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),xge=De("$ZodExactOptional",(e,t)=>{ZB.init(e,t),cr(e._zod,"values",()=>t.innerType._zod.values),cr(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),wge=De("$ZodNullable",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.innerType._zod.optin),cr(e._zod,"optout",()=>t.innerType._zod.optout),cr(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mk(n.source)}|null)$`):void 0}),cr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Sge=De("$ZodDefault",(e,t)=>{ws.init(e,t),e._zod.optin="optional",cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>I_(i,t)):I_(s,t)}});function I_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Cge=De("$ZodPrefault",(e,t)=>{ws.init(e,t),e._zod.optin="optional",cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),kge=De("$ZodNonOptional",(e,t)=>{ws.init(e,t),cr(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>z_(i,e)):z_(s,e)}});function z_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ege=De("$ZodCatch",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.innerType._zod.optin),cr(e._zod,"optout",()=>t.innerType._zod.optout),cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>iu(o,r,su()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>iu(i,r,su()))},input:n.value}),n.issues=[]),n)}}),Nge=De("$ZodPipe",(e,t)=>{ws.init(e,t),cr(e._zod,"values",()=>t.in._zod.values),cr(e._zod,"optin",()=>t.in._zod.optin),cr(e._zod,"optout",()=>t.out._zod.optout),cr(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>U1(o,t.in,r)):U1(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>U1(i,t.out,r)):U1(s,t.out,r)}});function U1(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Mge=De("$ZodReadonly",(e,t)=>{ws.init(e,t),cr(e._zod,"propValues",()=>t.innerType._zod.propValues),cr(e._zod,"values",()=>t.innerType._zod.values),cr(e._zod,"optin",()=>t.innerType?._zod?.optin),cr(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(L_):L_(s)}});function L_(e){return e.value=Object.freeze(e.value),e}const Tge=De("$ZodCustom",(e,t)=>{Ai.init(e,t),ws.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>P_(i,n,r,e));P_(s,n,r,e)}});function P_(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(rm(s))}}var $_;class _ge{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rge(){return new _ge}($_=globalThis).__zod_globalRegistry??($_.__zod_globalRegistry=Rge());const wp=globalThis.__zod_globalRegistry;function Age(e,t){return new e({type:"string",...jt(t)})}function Oge(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...jt(t)})}function B_(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...jt(t)})}function Dge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...jt(t)})}function jge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...jt(t)})}function Ige(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...jt(t)})}function zge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...jt(t)})}function Lge(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...jt(t)})}function Pge(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...jt(t)})}function $ge(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...jt(t)})}function Bge(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...jt(t)})}function Fge(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...jt(t)})}function Hge(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...jt(t)})}function Uge(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...jt(t)})}function Vge(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...jt(t)})}function qge(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...jt(t)})}function Gge(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...jt(t)})}function Wge(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...jt(t)})}function Kge(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...jt(t)})}function Yge(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...jt(t)})}function Zge(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...jt(t)})}function Xge(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...jt(t)})}function Qge(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...jt(t)})}function Jge(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...jt(t)})}function e1e(e,t){return new e({type:"string",format:"date",check:"string_format",...jt(t)})}function t1e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...jt(t)})}function n1e(e,t){return new e({type:"string",format:"duration",check:"string_format",...jt(t)})}function r1e(e,t){return new e({type:"number",checks:[],...jt(t)})}function s1e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...jt(t)})}function i1e(e){return new e({type:"unknown"})}function F_(e,t){return new GB({check:"less_than",...jt(t),value:e,inclusive:!1})}function s5(e,t){return new GB({check:"less_than",...jt(t),value:e,inclusive:!0})}function H_(e,t){return new WB({check:"greater_than",...jt(t),value:e,inclusive:!1})}function i5(e,t){return new WB({check:"greater_than",...jt(t),value:e,inclusive:!0})}function U_(e,t){return new Tme({check:"multiple_of",...jt(t),value:e})}function XB(e,t){return new Rme({check:"max_length",...jt(t),maximum:e})}function Ev(e,t){return new Ame({check:"min_length",...jt(t),minimum:e})}function QB(e,t){return new Ome({check:"length_equals",...jt(t),length:e})}function o1e(e,t){return new Dme({check:"string_format",format:"regex",...jt(t),pattern:e})}function a1e(e){return new jme({check:"string_format",format:"lowercase",...jt(e)})}function l1e(e){return new Ime({check:"string_format",format:"uppercase",...jt(e)})}function c1e(e,t){return new zme({check:"string_format",format:"includes",...jt(t),includes:e})}function u1e(e,t){return new Lme({check:"string_format",format:"starts_with",...jt(t),prefix:e})}function d1e(e,t){return new Pme({check:"string_format",format:"ends_with",...jt(t),suffix:e})}function Qh(e){return new $me({check:"overwrite",tx:e})}function f1e(e){return Qh(t=>t.normalize(e))}function h1e(){return Qh(e=>e.trim())}function p1e(){return Qh(e=>e.toLowerCase())}function m1e(){return Qh(e=>e.toUpperCase())}function g1e(){return Qh(e=>Hpe(e))}function b1e(e,t,n){return new e({type:"array",element:t,...jt(n)})}function v1e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...jt(n)})}function y1e(e){const t=x1e(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(rm(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(rm(s))}},e(n.value,n)));return t}function x1e(e,t){const n=new Ai({check:"custom",...jt(t)});return n._zod.check=e,n}function JB(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wp,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Es(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,f);else{const g=o.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,g,f)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),Es(p,t,f),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&ei(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function eF(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const l=r.get(a);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,g=e.external.uri??(y=>y);if(p)return{ref:g(p)};const b=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=b,{defId:b,ref:`${g("__shared")}#/${a}/${b}`}}if(o[1]===n)return{ref:"#"};const u=`#/${a}/`,f=o[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:u+f}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:l,defId:u}=s(o);a.def={...a.schema},u&&(a.defId=u);const f=a.schema;for(const p in f)delete f[p];f.$ref=l};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
75
+ `+i)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Nd(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Pb.assertOptions(r,{silentJSONParsing:po.transitional(po.boolean),forcedJSONParsing:po.transitional(po.boolean),clarifyTimeoutError:po.transitional(po.boolean),legacyInterceptorReqResOrdering:po.transitional(po.boolean)},!1),s!=null&&(xe.isFunction(s)?n.paramsSerializer={serialize:s}:Pb.assertOptions(s,{encode:po.function,serialize:po.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pb.assertOptions(n,{baseUrl:po.spelling("baseURL"),withXsrfToken:po.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&xe.merge(i.common,i[n.method]);i&&xe.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Mi.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;l=l&&x.synchronous;const S=n.transitional||yk;S&&S.legacyInterceptorReqResOrdering?a.unshift(x.fulfilled,x.rejected):a.push(x.fulfilled,x.rejected)});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,p=0,g;if(!l){const y=[k_.bind(this),void 0];for(y.unshift(...a),y.push(...u),g=y.length,f=Promise.resolve(n);p<g;)f=f.then(y[p++],y[p++]);return f}g=a.length;let b=n;for(;p<g;){const y=a[p++],x=a[p++];try{b=y(b)}catch(S){x.call(this,S);break}}try{f=k_.call(this,b)}catch(y){return Promise.reject(y)}for(p=0,g=u.length;p<g;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=Nd(this.defaults,t);const n=SB(t.baseURL,t.url,t.allowAbsoluteUrls);return vB(n,t.params,t.paramsSerializer)}};xe.forEach(["delete","get","head","options"],function(t){dd.prototype[t]=function(n,r){return this.request(Nd(r||{},{method:t,url:n,data:(r||{}).data}))}});xe.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(Nd(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}dd.prototype[t]=n(),dd.prototype[t+"Form"]=n(!0)});let Cpe=class MB{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,a){r.reason||(r.reason=new Xm(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new MB(function(s){t=s}),cancel:t}}};function kpe(e){return function(n){return e.apply(null,n)}}function Epe(e){return xe.isObject(e)&&e.isAxiosError===!0}const h3={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(h3).forEach(([e,t])=>{h3[t]=e});function TB(e){const t=new dd(e),n=aB(dd.prototype.request,t);return xe.extend(n,dd.prototype,t,{allOwnKeys:!0}),xe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return TB(Nd(e,s))},n}const gn=TB(Zm);gn.Axios=dd;gn.CanceledError=Xm;gn.CancelToken=Cpe;gn.isCancel=xB;gn.VERSION=NB;gn.toFormData=Nx;gn.AxiosError=zt;gn.Cancel=gn.CanceledError;gn.all=function(t){return Promise.all(t)};gn.spread=kpe;gn.isAxiosError=Epe;gn.mergeConfig=Nd;gn.AxiosHeaders=Mi;gn.formToJSON=e=>yB(xe.isHTMLForm(e)?new FormData(e):e);gn.getAdapter=EB.getAdapter;gn.HttpStatusCode=h3;gn.default=gn;const{Axios:lLe,AxiosError:cLe,CanceledError:uLe,isCancel:dLe,CancelToken:fLe,VERSION:hLe,all:pLe,Cancel:mLe,isAxiosError:gLe,spread:bLe,toFormData:vLe,AxiosHeaders:yLe,HttpStatusCode:xLe,formToJSON:wLe,getAdapter:SLe,mergeConfig:CLe}=gn,N_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,M_=qP,Ud=(e,t)=>n=>{var r;if(t?.variants==null)return M_(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const f=n?.[u],p=i?.[u];if(f===null)return null;const g=N_(f)||N_(p);return s[u][g]}),a=n&&Object.entries(n).reduce((u,f)=>{let[p,g]=f;return g===void 0||(u[p]=g),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:p,className:g,...b}=f;return Object.entries(b).every(y=>{let[x,S]=y;return Array.isArray(S)?S.includes({...i,...a}[x]):{...i,...a}[x]===S})?[...u,p,g]:u},[]);return M_(e,o,l,n?.class,n?.className)},Sv=Ud("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function He({className:e,variant:t="default",size:n="default",asChild:r=!1,...s}){const i=r?$d:"button";return h.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:ee(Sv({variant:t,size:n,className:e})),...s})}function Wn({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:ee("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function xr({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function _r({className:e,...t}){return h.jsx("div",{"data-slot":"card-title",className:ee("leading-none font-semibold",e),...t})}function Xo({className:e,...t}){return h.jsx("div",{"data-slot":"card-description",className:ee("text-muted-foreground text-sm",e),...t})}function Kn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:ee("px-6",e),...t})}function br({className:e,...t}){return h.jsx(coe,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Hi({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx(_ae,{"data-slot":"separator",decorative:n,orientation:t,className:ee("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Sk({className:e,...t}){return h.jsx("div",{"data-slot":"field-group",className:ee("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...t})}const Npe=Ud("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function Qc({className:e,orientation:t="vertical",...n}){return h.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ee(Npe({orientation:t}),e),...n})}function nm({className:e,...t}){return h.jsx(br,{"data-slot":"field-label",className:ee("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),...t})}function Mpe({className:e,...t}){return h.jsx("p",{"data-slot":"field-description",className:ee("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Ck({className:e,children:t,errors:n,...r}){const s=w.useMemo(()=>{if(t)return t;if(!n?.length)return null;const i=[...new Map(n.map(o=>[o?.message,o])).values()];return i?.length==1?i[0]?.message:h.jsx("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((o,a)=>o?.message&&h.jsx("li",{children:o.message},a))})},[t,n]);return s?h.jsx("div",{role:"alert","data-slot":"field-error",className:ee("text-destructive text-sm font-normal",e),...r,children:s}):null}function pn({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:ee("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}async function Tpe(){const{data:e}=await gn.get("/auth/features");return e}function _pe(){const{data:e}=is({queryKey:["auth-features"],queryFn:Tpe,staleTime:3e5,retry:!1});return{passwordReset:e?.passwordReset??!1}}const p3="/login";let kk=null;function Rpe(){return kk}function _B(e){kk=e}function Cv(){kk=null}const Zt=gn.create({baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json"},withCredentials:!0});Zt.interceptors.request.use(e=>{const t=Rpe();return t&&(e.headers.Authorization=`Bearer ${t}`),e.data instanceof FormData&&delete e.headers["Content-Type"],e});let F1=!1,m3=[];function Ape(e){m3.push(e)}function Ope(e){m3.forEach(t=>t(e)),m3=[]}Zt.interceptors.response.use(e=>e,async e=>{const t=e.config;if(e.response?.status===401&&typeof window<"u"){const n=t?.url||"",r=n.includes("/auth/login"),s=n.includes("/auth/refresh");if(r||s)return Promise.reject(e);if(F1)return new Promise(i=>{Ape(o=>{t.headers.Authorization=`Bearer ${o}`,i(gn(t))})});F1=!0;try{const{data:i}=await gn.post("/auth/refresh",{},{withCredentials:!0}),o=i.token;return _B(o),t.headers.Authorization=`Bearer ${o}`,Ope(o),F1=!1,gn(t)}catch(i){return F1=!1,Cv(),window.location.pathname.startsWith(p3)||window.location.replace(p3),Promise.reject(i)}}return Promise.reject(e)});async function Dpe(){if(typeof window<"u"){try{await gn.post("/auth/logout",{},{withCredentials:!0})}catch(e){console.error("Logout error:",e)}Cv(),window.location.replace(p3)}}const RB=w.createContext(null);function jpe(e){try{const t=JSON.parse(atob(e.split(".")[1]));return{email:t.email??"",name:t.name??"Admin"}}catch{return null}}function Ipe({children:e}){const[t,n]=w.useState("loading"),[r,s]=w.useState(null);function i(a){_B(a),s(jpe(a)),n("authenticated")}function o(){Cv(),s(null),n("unauthenticated")}return w.useEffect(()=>{gn.post("/auth/refresh",{},{withCredentials:!0}).then(({data:a})=>i(a.token)).catch(()=>{Cv(),n("unauthenticated")})},[]),h.jsx(RB.Provider,{value:{status:t,user:r,setToken:i,clearToken:o},children:e})}function Tx(){const e=w.useContext(RB);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e}const zpe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,AB=8,OB=128,If={EMAIL_REQUIRED:"Inserisci l'email",EMAIL_INVALID:"Email non valida",PASSWORD_REQUIRED:"Inserisci la password",PASSWORD_TOO_SHORT:`La password deve essere almeno ${AB} caratteri`,PASSWORD_TOO_LONG:`La password non può superare i ${OB} caratteri`,CREDENTIALS_INVALID:"Email o Password errate"};function Lpe(){const e=zo(),{setToken:t}=Tx(),[n,r]=w.useState(""),[s,i]=w.useState(""),[o,a]=w.useState(!1),[l,u]=w.useState(null),[f,p]=w.useState(null),[g,b]=w.useState(!1),y=n.trim().length>0&&s.trim().length>0;return{emailValue:n,passwordValue:s,isPasswordVisible:o,emailError:l,passwordError:f,isLoading:g,isFormValid:y,handleEmailChange:T=>{r(T.target.value),u(null),p(null)},handlePasswordChange:T=>{i(T.target.value),p(null),u(null)},togglePasswordVisibility:()=>a(T=>!T),handleSubmit:async T=>{T.preventDefault();const R=n.trim(),_=s;if(u(null),p(null),!R){u(If.EMAIL_REQUIRED);return}if(!zpe.test(R)){u(If.EMAIL_INVALID);return}if(!_){p(If.PASSWORD_REQUIRED);return}if(_.length<AB){p(If.PASSWORD_TOO_SHORT);return}if(_.length>OB){p(If.PASSWORD_TOO_LONG);return}b(!0);try{const{data:A}=await gn.post("/auth/login",{email:R,password:_},{withCredentials:!0});t(A.token),b(!1),e("/",{replace:!0})}catch(A){b(!1),gn.isAxiosError(A)?A.response?.status===401?p(If.CREDENTIALS_INVALID):p("Errore durante il login. Riprova più tardi."):p("Errore di connessione. Verifica la tua connessione internet.")}}}}function Ppe(e){const{t}=kt(),{passwordReset:n}=_pe(),{className:r,...s}=e,{emailValue:i,passwordValue:o,isPasswordVisible:a,emailError:l,passwordError:u,isLoading:f,isFormValid:p,handleEmailChange:g,handlePasswordChange:b,togglePasswordVisibility:y,handleSubmit:x}=Lpe();return h.jsxs("div",{className:ee("flex flex-col gap-6",r),...s,children:[h.jsx(Wn,{className:"overflow-hidden p-0 shadow-md",children:h.jsxs(Kn,{className:"relative grid grid-cols-1 p-0 md:grid-cols-2",children:[h.jsx("img",{src:"/admin/undraw_clouds_bmtk.svg",alt:"",className:"absolute -left-30 -top-36 z-0 h-96 w-96 rotate-150 scale-x-[-1]","aria-hidden":"true"}),h.jsx("img",{src:"/admin/sol.svg",alt:"",className:"absolute right-23 -top-28 z-0 hidden h-80 w-80 md:block md:h-[29rem] md:w-[28rem]","aria-hidden":"true"}),h.jsx("form",{className:"relative z-10 flex min-h-[36rem] flex-col justify-center p-6 md:p-8",onSubmit:x,noValidate:!0,children:h.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center",children:h.jsxs(Sk,{className:"w-full max-w-sm",children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Welcome back"}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:"Login to your Beech CMS account"})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"email",children:"Email"}),h.jsx(pn,{id:"email",name:"email",type:"email",placeholder:"m@example.com",autoComplete:"username",inputMode:"email",value:i,className:ee(l?"border-destructive":""),onChange:g})]}),h.jsxs(Qc,{children:[h.jsxs("div",{className:"flex items-center",children:[h.jsx(nm,{htmlFor:"password",children:"Password"}),n&&h.jsx(gs,{to:"/forgot-password",className:"ml-auto text-sm underline-offset-2 hover:underline",children:t("login.forgotPassword")})]}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"password",name:"password",type:a?"text":"password",autoComplete:"current-password",value:o,className:ee("pr-10",u&&"border-destructive"),onChange:b}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:y,"aria-label":t(a?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:a?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})},a?"visible":"hidden")})]}),(l||u)&&h.jsx(Ck,{children:l||u})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!p||f,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",p&&!f?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:f?t("login.signingIn"):"Login"})})]})})}),h.jsx("div",{className:"relative hidden md:block md:min-h-[36rem] md:overflow-hidden",children:h.jsx("img",{src:"/admin/undraw_enter_nwx3.svg",alt:"Illustrazione area login",className:"absolute -bottom-7 -right-28 h-full max-h-[42rem] w-full max-w-lg object-contain object-right-bottom scale-x-[-1]"})})]})}),h.jsxs(Mpe,{className:"px-6 text-center",children:["By clicking continue, you agree to our ",h.jsx("a",{href:"#",children:"Terms of Service"})," ","and ",h.jsx("a",{href:"#",children:"Privacy Policy"}),"."]})]})}const Ek={};function DB(e){return Ek[e]??null}function De(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const u=o.prototype,f=Object.keys(u);for(let p=0;p<f.length;p++){const g=f[p];g in a||(a[g]=u[g].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var l;const u=n?.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class fh extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jB extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $pe={};function su(e){return $pe}function IB(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function g3(e,t){return typeof t=="bigint"?t.toString():t}function Nk(e){return e==null}function Mk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Bpe(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(s=Number.parseInt(l[1]))}const i=n>s?n:s,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}const T_=Symbol("evaluating");function cr(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==T_)return r===void 0&&(r=T_,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Fpe(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Hpe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zB="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function __(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kv(e){if(__(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(__(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function LB(e){return kv(e)?{...e}:Array.isArray(e)?[...e]:e}const Upe=new Set(["string","number","symbol"]);function _x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vpe(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function jt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const qpe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sh(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xp(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function H1(e){return typeof e=="string"?e:e?.message}function iu(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=H1(e.inst?._zod.def?.error?.(e))??H1(t?.error?.(e))??H1(n.customError?.(e))??H1(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Tk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rm(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const PB=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,g3,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},$B=De("$ZodError",PB),BB=De("$ZodError",PB,{Parent:Error});function Gpe(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Wpe(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let o=n,a=0;for(;a<i.path.length;){const l=i.path[a];a===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(i))):o[l]=o[l]||{_errors:[]},o=o[l],a++}}};return r(e),n}const _k=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new fh;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>iu(l,i,su())));throw zB(a,s?.callee),a}return o.value},Rk=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>iu(l,i,su())));throw zB(a,s?.callee),a}return o.value},Rx=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new fh;return i.issues.length?{success:!1,error:new(e??$B)(i.issues.map(o=>iu(o,s,su())))}:{success:!0,data:i.value}},Kpe=Rx(BB),Ax=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>iu(o,s,su())))}:{success:!0,data:i.value}},Ype=Ax(BB),Zpe=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _k(e)(t,n,s)},Xpe=e=>(t,n,r)=>_k(e)(t,n,r),Qpe=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rk(e)(t,n,s)},Jpe=e=>async(t,n,r)=>Rk(e)(t,n,r),eme=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rx(e)(t,n,s)},tme=e=>(t,n,r)=>Rx(e)(t,n,r),nme=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ax(e)(t,n,s)},rme=e=>async(t,n,r)=>Ax(e)(t,n,r),sme=/^[cC][^\s-]{8,}$/,ime=/^[0-9a-z]+$/,ome=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ame=/^[0-9a-vA-V]{20}$/,lme=/^[A-Za-z0-9]{27}$/,cme=/^[a-zA-Z0-9_-]{21}$/,ume=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dme=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,R_=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fme=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hme="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pme(){return new RegExp(hme,"u")}const mme=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gme=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bme=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vme=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yme=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FB=/^[A-Za-z0-9_-]*$/,xme=/^\+[1-9]\d{6,14}$/,HB="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wme=new RegExp(`^${HB}$`);function UB(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Sme(e){return new RegExp(`^${UB(e)}$`)}function Cme(e){const t=UB({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${HB}T(?:${r})$`)}const kme=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Eme=/^-?\d+$/,VB=/^-?\d+(?:\.\d+)?$/,Nme=/^[^A-Z]*$/,Mme=/^[^a-z]*$/,Ai=De("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qB={number:"number",bigint:"bigint",object:"date"},GB=De("$ZodCheckLessThan",(e,t)=>{Ai.init(e,t);const n=qB[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),WB=De("$ZodCheckGreaterThan",(e,t)=>{Ai.init(e,t);const n=qB[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tme=De("$ZodCheckMultipleOf",(e,t)=>{Ai.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Bpe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_me=De("$ZodCheckNumberFormat",(e,t)=>{Ai.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=qpe[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=i,n&&(a.pattern=Eme)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Rme=De("$ZodCheckMaxLength",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=Tk(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Ame=De("$ZodCheckMinLength",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=Tk(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Ome=De("$ZodCheckLengthEquals",(e,t)=>{var n;Ai.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Nk(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=Tk(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ox=De("$ZodCheckStringFormat",(e,t)=>{var n,r;Ai.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dme=De("$ZodCheckRegex",(e,t)=>{Ox.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jme=De("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Nme),Ox.init(e,t)}),Ime=De("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mme),Ox.init(e,t)}),zme=De("$ZodCheckIncludes",(e,t)=>{Ai.init(e,t);const n=_x(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Lme=De("$ZodCheckStartsWith",(e,t)=>{Ai.init(e,t);const n=new RegExp(`^${_x(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Pme=De("$ZodCheckEndsWith",(e,t)=>{Ai.init(e,t);const n=new RegExp(`.*${_x(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),$me=De("$ZodCheckOverwrite",(e,t)=>{Ai.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),Bme={major:4,minor:3,patch:6},ws=De("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bme;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,l)=>{let u=sh(o),f;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;const g=o.issues.length,b=p._zod.check(o);if(b instanceof Promise&&l?.async===!1)throw new fh;if(f||b instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await b,o.issues.length!==g&&(u||(u=sh(o,g)))});else{if(o.issues.length===g)continue;u||(u=sh(o,g))}}return f?f.then(()=>o):o},i=(o,a,l)=>{if(sh(o))return o.aborted=!0,o;const u=s(a,r,l);if(u instanceof Promise){if(l.async===!1)throw new fh;return u.then(f=>e._zod.parse(f,l))}return e._zod.parse(u,l)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>i(f,o,a)):i(u,o,a)}const l=e._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new fh;return l.then(u=>s(u,r,a))}return s(l,r,a)}}cr(e,"~standard",()=>({validate:s=>{try{const i=Kpe(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ype(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Ak=De("$ZodString",(e,t)=>{ws.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kme(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Sr=De("$ZodStringFormat",(e,t)=>{Ox.init(e,t),Ak.init(e,t)}),Fme=De("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dme),Sr.init(e,t)}),Hme=De("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=R_(r))}else t.pattern??(t.pattern=R_());Sr.init(e,t)}),Ume=De("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=fme),Sr.init(e,t)}),Vme=De("$ZodURL",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qme=De("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=pme()),Sr.init(e,t)}),Gme=De("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cme),Sr.init(e,t)}),Wme=De("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=sme),Sr.init(e,t)}),Kme=De("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ime),Sr.init(e,t)}),Yme=De("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ome),Sr.init(e,t)}),Zme=De("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ame),Sr.init(e,t)}),Xme=De("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lme),Sr.init(e,t)}),Qme=De("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Cme(t)),Sr.init(e,t)}),Jme=De("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wme),Sr.init(e,t)}),ege=De("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Sme(t)),Sr.init(e,t)}),tge=De("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ume),Sr.init(e,t)}),nge=De("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mme),Sr.init(e,t),e._zod.bag.format="ipv4"}),rge=De("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gme),Sr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),sge=De("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bme),Sr.init(e,t)}),ige=De("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vme),Sr.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function KB(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const oge=De("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yme),Sr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{KB(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function age(e){if(!FB.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return KB(n)}const lge=De("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=FB),Sr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{age(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),cge=De("$ZodE164",(e,t)=>{t.pattern??(t.pattern=xme),Sr.init(e,t)});function uge(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const dge=De("$ZodJWT",(e,t)=>{Sr.init(e,t),e._zod.check=n=>{uge(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),YB=De("$ZodNumber",(e,t)=>{ws.init(e,t),e._zod.pattern=e._zod.bag.pattern??VB,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),fge=De("$ZodNumberFormat",(e,t)=>{_me.init(e,t),YB.init(e,t)}),hge=De("$ZodUnknown",(e,t)=>{ws.init(e,t),e._zod.parse=n=>n});function A_(e,t,n){e.issues.length&&t.issues.push(...xp(n,e.issues)),t.value[n]=e.value}const pge=De("$ZodArray",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>A_(u,n,o))):A_(l,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function O_(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!sh(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>iu(o,r,su())))}),t)}const mge=De("$ZodUnion",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),cr(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),cr(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),cr(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Mk(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const l of t.options){const u=l._zod.run({value:s.value,issues:[]},i);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(l=>O_(l,s,e,i)):O_(a,s,e,i)}}),gge=De("$ZodIntersection",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([l,u])=>D_(n,l,u)):D_(n,i,o)}});function b3(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(kv(e)&&kv(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=b3(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=b3(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function D_(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),sh(e))return e;const o=b3(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const bge=De("$ZodRecord",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!kv(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const f=t.valueType._zod.run({value:s[u],issues:[]},r);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...xp(u,p.issues)),n.value[u]=p.value})):(f.issues.length&&n.issues.push(...xp(u,f.issues)),n.value[u]=f.value)}let l;for(const u in s)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&VB.test(a)&&l.issues.length){const p=t.keyType._zod.run({value:Number(a),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>iu(p,r,su())),input:a,path:[a],inst:e});continue}const f=t.valueType._zod.run({value:s[a],issues:[]},r);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...xp(a,p.issues)),n.value[l.value]=p.value})):(f.issues.length&&n.issues.push(...xp(a,f.issues)),n.value[l.value]=f.value)}}return i.length?Promise.all(i).then(()=>n):n}}),vge=De("$ZodEnum",(e,t)=>{ws.init(e,t);const n=IB(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>Upe.has(typeof s)).map(s=>typeof s=="string"?_x(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),yge=De("$ZodTransform",(e,t)=>{ws.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new jB(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new fh;return n.value=s,n}});function j_(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ZB=De("$ZodOptional",(e,t)=>{ws.init(e,t),e._zod.optin="optional",e._zod.optout="optional",cr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),cr(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mk(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>j_(i,n.value)):j_(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),xge=De("$ZodExactOptional",(e,t)=>{ZB.init(e,t),cr(e._zod,"values",()=>t.innerType._zod.values),cr(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),wge=De("$ZodNullable",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.innerType._zod.optin),cr(e._zod,"optout",()=>t.innerType._zod.optout),cr(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Mk(n.source)}|null)$`):void 0}),cr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Sge=De("$ZodDefault",(e,t)=>{ws.init(e,t),e._zod.optin="optional",cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>I_(i,t)):I_(s,t)}});function I_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Cge=De("$ZodPrefault",(e,t)=>{ws.init(e,t),e._zod.optin="optional",cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),kge=De("$ZodNonOptional",(e,t)=>{ws.init(e,t),cr(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>z_(i,e)):z_(s,e)}});function z_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ege=De("$ZodCatch",(e,t)=>{ws.init(e,t),cr(e._zod,"optin",()=>t.innerType._zod.optin),cr(e._zod,"optout",()=>t.innerType._zod.optout),cr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>iu(o,r,su()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>iu(i,r,su()))},input:n.value}),n.issues=[]),n)}}),Nge=De("$ZodPipe",(e,t)=>{ws.init(e,t),cr(e._zod,"values",()=>t.in._zod.values),cr(e._zod,"optin",()=>t.in._zod.optin),cr(e._zod,"optout",()=>t.out._zod.optout),cr(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>U1(o,t.in,r)):U1(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>U1(i,t.out,r)):U1(s,t.out,r)}});function U1(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Mge=De("$ZodReadonly",(e,t)=>{ws.init(e,t),cr(e._zod,"propValues",()=>t.innerType._zod.propValues),cr(e._zod,"values",()=>t.innerType._zod.values),cr(e._zod,"optin",()=>t.innerType?._zod?.optin),cr(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(L_):L_(s)}});function L_(e){return e.value=Object.freeze(e.value),e}const Tge=De("$ZodCustom",(e,t)=>{Ai.init(e,t),ws.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>P_(i,n,r,e));P_(s,n,r,e)}});function P_(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(rm(s))}}var $_;class _ge{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rge(){return new _ge}($_=globalThis).__zod_globalRegistry??($_.__zod_globalRegistry=Rge());const wp=globalThis.__zod_globalRegistry;function Age(e,t){return new e({type:"string",...jt(t)})}function Oge(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...jt(t)})}function B_(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...jt(t)})}function Dge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...jt(t)})}function jge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...jt(t)})}function Ige(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...jt(t)})}function zge(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...jt(t)})}function Lge(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...jt(t)})}function Pge(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...jt(t)})}function $ge(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...jt(t)})}function Bge(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...jt(t)})}function Fge(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...jt(t)})}function Hge(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...jt(t)})}function Uge(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...jt(t)})}function Vge(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...jt(t)})}function qge(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...jt(t)})}function Gge(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...jt(t)})}function Wge(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...jt(t)})}function Kge(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...jt(t)})}function Yge(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...jt(t)})}function Zge(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...jt(t)})}function Xge(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...jt(t)})}function Qge(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...jt(t)})}function Jge(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...jt(t)})}function e1e(e,t){return new e({type:"string",format:"date",check:"string_format",...jt(t)})}function t1e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...jt(t)})}function n1e(e,t){return new e({type:"string",format:"duration",check:"string_format",...jt(t)})}function r1e(e,t){return new e({type:"number",checks:[],...jt(t)})}function s1e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...jt(t)})}function i1e(e){return new e({type:"unknown"})}function F_(e,t){return new GB({check:"less_than",...jt(t),value:e,inclusive:!1})}function s5(e,t){return new GB({check:"less_than",...jt(t),value:e,inclusive:!0})}function H_(e,t){return new WB({check:"greater_than",...jt(t),value:e,inclusive:!1})}function i5(e,t){return new WB({check:"greater_than",...jt(t),value:e,inclusive:!0})}function U_(e,t){return new Tme({check:"multiple_of",...jt(t),value:e})}function XB(e,t){return new Rme({check:"max_length",...jt(t),maximum:e})}function Ev(e,t){return new Ame({check:"min_length",...jt(t),minimum:e})}function QB(e,t){return new Ome({check:"length_equals",...jt(t),length:e})}function o1e(e,t){return new Dme({check:"string_format",format:"regex",...jt(t),pattern:e})}function a1e(e){return new jme({check:"string_format",format:"lowercase",...jt(e)})}function l1e(e){return new Ime({check:"string_format",format:"uppercase",...jt(e)})}function c1e(e,t){return new zme({check:"string_format",format:"includes",...jt(t),includes:e})}function u1e(e,t){return new Lme({check:"string_format",format:"starts_with",...jt(t),prefix:e})}function d1e(e,t){return new Pme({check:"string_format",format:"ends_with",...jt(t),suffix:e})}function Qh(e){return new $me({check:"overwrite",tx:e})}function f1e(e){return Qh(t=>t.normalize(e))}function h1e(){return Qh(e=>e.trim())}function p1e(){return Qh(e=>e.toLowerCase())}function m1e(){return Qh(e=>e.toUpperCase())}function g1e(){return Qh(e=>Hpe(e))}function b1e(e,t,n){return new e({type:"array",element:t,...jt(n)})}function v1e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...jt(n)})}function y1e(e){const t=x1e(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(rm(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(rm(s))}},e(n.value,n)));return t}function x1e(e,t){const n=new Ai({check:"custom",...jt(t)});return n._zod.check=e,n}function JB(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wp,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Es(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,f);else{const g=o.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,g,f)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),Es(p,t,f),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&ei(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function eF(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const l=r.get(a);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,g=e.external.uri??(y=>y);if(p)return{ref:g(p)};const b=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=b,{defId:b,ref:`${g("__shared")}#/${a}/${b}`}}if(o[1]===n)return{ref:"#"};const u=`#/${a}/`,f=o[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:u+f}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:l,defId:u}=s(o);a.def={...a.schema},u&&(a.defId=u);const f=a.schema;for(const p in f)delete f[p];f.$ref=l};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
76
76
 
77
77
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){i(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&e.reused==="ref"){i(o);continue}}}function tF(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=e.seen.get(o);if(a.ref===null)return;const l=a.def??a.schema,u={...l},f=a.ref;if(a.ref=null,f){r(f);const g=e.seen.get(f),b=g.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(b)):Object.assign(l,b),Object.assign(l,u),o._zod.parent===f)for(const x in l)x==="$ref"||x==="allOf"||x in u||delete l[x];if(b.$ref&&g.def)for(const x in l)x==="$ref"||x==="allOf"||x in g.def&&JSON.stringify(l[x])===JSON.stringify(g.def[x])&&delete l[x]}const p=o._zod.parent;if(p&&p!==f){r(p);const g=e.seen.get(p);if(g?.schema.$ref&&(l.$ref=g.schema.$ref,g.def))for(const b in l)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(l[b])===JSON.stringify(g.def[b])&&delete l[b]}e.override({zodSchema:o,jsonSchema:l,path:a.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const o of e.seen.entries()){const a=o[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nv(t,"input",e.processors),output:Nv(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function ei(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ei(r.element,n);if(r.type==="set")return ei(r.valueType,n);if(r.type==="lazy")return ei(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ei(r.innerType,n);if(r.type==="intersection")return ei(r.left,n)||ei(r.right,n);if(r.type==="record"||r.type==="map")return ei(r.keyType,n)||ei(r.valueType,n);if(r.type==="pipe")return ei(r.in,n)||ei(r.out,n);if(r.type==="object"){for(const s in r.shape)if(ei(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(ei(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(ei(s,n))return!0;return!!(r.rest&&ei(r.rest,n))}return!1}const w1e=(e,t={})=>n=>{const r=JB({...n,processors:t});return Es(e,r),eF(r,e),tF(r,e)},Nv=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=JB({...s??{},target:i,io:t,processors:n});return Es(e,o),eF(o,e),tF(o,e)},S1e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},C1e=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=S1e[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),l&&l.size>0){const f=[...l];f.length===1?s.pattern=f[0].source:f.length>1&&(s.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},k1e=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:f}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=f,s.exclusiveMinimum=!0):s.exclusiveMinimum=f),typeof i=="number"&&(s.minimum=i,typeof f=="number"&&t.target!=="draft-04"&&(f>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof o=="number"&&(s.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof l=="number"&&(s.multipleOf=l)},E1e=(e,t,n,r)=>{},N1e=(e,t,n,r)=>{const s=e._zod.def,i=IB(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},M1e=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},T1e=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_1e=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Es(i.element,t,{...r,path:[...r.path,"items"]})},R1e=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,l)=>Es(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=o:n.anyOf=o},A1e=(e,t,n,r)=>{const s=e._zod.def,i=Es(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=Es(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=l},O1e=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,l=o._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const f=Es(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of l)s.patternProperties[p.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Es(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Es(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const f=[...u].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(s.required=f)}},D1e=(e,t,n,r)=>{const s=e._zod.def,i=Es(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},j1e=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},I1e=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},z1e=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},L1e=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},P1e=(e,t,n,r)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Es(i,t,r);const o=t.seen.get(e);o.ref=i},$1e=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},nF=(e,t,n,r)=>{const s=e._zod.def;Es(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},B1e=De("ZodISODateTime",(e,t)=>{Qme.init(e,t),Rr.init(e,t)});function F1e(e){return Jge(B1e,e)}const H1e=De("ZodISODate",(e,t)=>{Jme.init(e,t),Rr.init(e,t)});function U1e(e){return e1e(H1e,e)}const V1e=De("ZodISOTime",(e,t)=>{ege.init(e,t),Rr.init(e,t)});function q1e(e){return t1e(V1e,e)}const G1e=De("ZodISODuration",(e,t)=>{tge.init(e,t),Rr.init(e,t)});function W1e(e){return n1e(G1e,e)}const K1e=(e,t)=>{$B.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Wpe(e,n)},flatten:{value:n=>Gpe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,g3,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,g3,2)}},isEmpty:{get(){return e.issues.length===0}}})},Lo=De("ZodError",K1e,{Parent:Error}),Y1e=_k(Lo),Z1e=Rk(Lo),X1e=Rx(Lo),Q1e=Ax(Lo),J1e=Zpe(Lo),ebe=Xpe(Lo),tbe=Qpe(Lo),nbe=Jpe(Lo),rbe=eme(Lo),sbe=tme(Lo),ibe=nme(Lo),obe=rme(Lo),Ss=De("ZodType",(e,t)=>(ws.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nv(e,"input"),output:Nv(e,"output")}}),e.toJSONSchema=w1e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Fpe(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Vpe(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Y1e(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>X1e(e,n,r),e.parseAsync=async(n,r)=>Z1e(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Q1e(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>J1e(e,n,r),e.decode=(n,r)=>ebe(e,n,r),e.encodeAsync=async(n,r)=>tbe(e,n,r),e.decodeAsync=async(n,r)=>nbe(e,n,r),e.safeEncode=(n,r)=>rbe(e,n,r),e.safeDecode=(n,r)=>sbe(e,n,r),e.safeEncodeAsync=async(n,r)=>ibe(e,n,r),e.safeDecodeAsync=async(n,r)=>obe(e,n,r),e.refine=(n,r)=>e.check(eve(n,r)),e.superRefine=n=>e.check(tve(n)),e.overwrite=n=>e.check(Qh(n)),e.optional=()=>W_(e),e.exactOptional=()=>Bbe(e),e.nullable=()=>K_(e),e.nullish=()=>W_(K_(e)),e.nonoptional=n=>Wbe(e,n),e.array=()=>iF(e),e.or=n=>oF([e,n]),e.and=n=>Obe(e,n),e.transform=n=>Y_(e,Lbe(n)),e.default=n=>Ube(e,n),e.prefault=n=>qbe(e,n),e.catch=n=>Ybe(e,n),e.pipe=n=>Y_(e,n),e.readonly=()=>Qbe(e),e.describe=n=>{const r=e.clone();return wp.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return wp.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wp.get(e);const r=e.clone();return wp.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),rF=De("_ZodString",(e,t)=>{Ak.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(r,s,i)=>C1e(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(o1e(...r)),e.includes=(...r)=>e.check(c1e(...r)),e.startsWith=(...r)=>e.check(u1e(...r)),e.endsWith=(...r)=>e.check(d1e(...r)),e.min=(...r)=>e.check(Ev(...r)),e.max=(...r)=>e.check(XB(...r)),e.length=(...r)=>e.check(QB(...r)),e.nonempty=(...r)=>e.check(Ev(1,...r)),e.lowercase=r=>e.check(a1e(r)),e.uppercase=r=>e.check(l1e(r)),e.trim=()=>e.check(h1e()),e.normalize=(...r)=>e.check(f1e(...r)),e.toLowerCase=()=>e.check(p1e()),e.toUpperCase=()=>e.check(m1e()),e.slugify=()=>e.check(g1e())}),abe=De("ZodString",(e,t)=>{Ak.init(e,t),rF.init(e,t),e.email=n=>e.check(Oge(cbe,n)),e.url=n=>e.check(Lge(ube,n)),e.jwt=n=>e.check(Qge(Ebe,n)),e.emoji=n=>e.check(Pge(dbe,n)),e.guid=n=>e.check(B_(V_,n)),e.uuid=n=>e.check(Dge(V1,n)),e.uuidv4=n=>e.check(jge(V1,n)),e.uuidv6=n=>e.check(Ige(V1,n)),e.uuidv7=n=>e.check(zge(V1,n)),e.nanoid=n=>e.check($ge(fbe,n)),e.guid=n=>e.check(B_(V_,n)),e.cuid=n=>e.check(Bge(hbe,n)),e.cuid2=n=>e.check(Fge(pbe,n)),e.ulid=n=>e.check(Hge(mbe,n)),e.base64=n=>e.check(Yge(Sbe,n)),e.base64url=n=>e.check(Zge(Cbe,n)),e.xid=n=>e.check(Uge(gbe,n)),e.ksuid=n=>e.check(Vge(bbe,n)),e.ipv4=n=>e.check(qge(vbe,n)),e.ipv6=n=>e.check(Gge(ybe,n)),e.cidrv4=n=>e.check(Wge(xbe,n)),e.cidrv6=n=>e.check(Kge(wbe,n)),e.e164=n=>e.check(Xge(kbe,n)),e.datetime=n=>e.check(F1e(n)),e.date=n=>e.check(U1e(n)),e.time=n=>e.check(q1e(n)),e.duration=n=>e.check(W1e(n))});function lbe(e){return Age(abe,e)}const Rr=De("ZodStringFormat",(e,t)=>{Sr.init(e,t),rF.init(e,t)}),cbe=De("ZodEmail",(e,t)=>{Ume.init(e,t),Rr.init(e,t)}),V_=De("ZodGUID",(e,t)=>{Fme.init(e,t),Rr.init(e,t)}),V1=De("ZodUUID",(e,t)=>{Hme.init(e,t),Rr.init(e,t)}),ube=De("ZodURL",(e,t)=>{Vme.init(e,t),Rr.init(e,t)}),dbe=De("ZodEmoji",(e,t)=>{qme.init(e,t),Rr.init(e,t)}),fbe=De("ZodNanoID",(e,t)=>{Gme.init(e,t),Rr.init(e,t)}),hbe=De("ZodCUID",(e,t)=>{Wme.init(e,t),Rr.init(e,t)}),pbe=De("ZodCUID2",(e,t)=>{Kme.init(e,t),Rr.init(e,t)}),mbe=De("ZodULID",(e,t)=>{Yme.init(e,t),Rr.init(e,t)}),gbe=De("ZodXID",(e,t)=>{Zme.init(e,t),Rr.init(e,t)}),bbe=De("ZodKSUID",(e,t)=>{Xme.init(e,t),Rr.init(e,t)}),vbe=De("ZodIPv4",(e,t)=>{nge.init(e,t),Rr.init(e,t)}),ybe=De("ZodIPv6",(e,t)=>{rge.init(e,t),Rr.init(e,t)}),xbe=De("ZodCIDRv4",(e,t)=>{sge.init(e,t),Rr.init(e,t)}),wbe=De("ZodCIDRv6",(e,t)=>{ige.init(e,t),Rr.init(e,t)}),Sbe=De("ZodBase64",(e,t)=>{oge.init(e,t),Rr.init(e,t)}),Cbe=De("ZodBase64URL",(e,t)=>{lge.init(e,t),Rr.init(e,t)}),kbe=De("ZodE164",(e,t)=>{cge.init(e,t),Rr.init(e,t)}),Ebe=De("ZodJWT",(e,t)=>{dge.init(e,t),Rr.init(e,t)}),sF=De("ZodNumber",(e,t)=>{YB.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(r,s,i)=>k1e(e,r,s),e.gt=(r,s)=>e.check(H_(r,s)),e.gte=(r,s)=>e.check(i5(r,s)),e.min=(r,s)=>e.check(i5(r,s)),e.lt=(r,s)=>e.check(F_(r,s)),e.lte=(r,s)=>e.check(s5(r,s)),e.max=(r,s)=>e.check(s5(r,s)),e.int=r=>e.check(q_(r)),e.safe=r=>e.check(q_(r)),e.positive=r=>e.check(H_(0,r)),e.nonnegative=r=>e.check(i5(0,r)),e.negative=r=>e.check(F_(0,r)),e.nonpositive=r=>e.check(s5(0,r)),e.multipleOf=(r,s)=>e.check(U_(r,s)),e.step=(r,s)=>e.check(U_(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Nbe(e){return r1e(sF,e)}const Mbe=De("ZodNumberFormat",(e,t)=>{fge.init(e,t),sF.init(e,t)});function q_(e){return s1e(Mbe,e)}const Tbe=De("ZodUnknown",(e,t)=>{hge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>E1e()});function G_(){return i1e(Tbe)}const _be=De("ZodArray",(e,t)=>{pge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_1e(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(Ev(n,r)),e.nonempty=n=>e.check(Ev(1,n)),e.max=(n,r)=>e.check(XB(n,r)),e.length=(n,r)=>e.check(QB(n,r)),e.unwrap=()=>e.element});function iF(e,t){return b1e(_be,e,t)}const Rbe=De("ZodUnion",(e,t)=>{mge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>R1e(e,n,r,s),e.options=t.options});function oF(e,t){return new Rbe({type:"union",options:e,...jt(t)})}const Abe=De("ZodIntersection",(e,t)=>{gge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>A1e(e,n,r,s)});function Obe(e,t){return new Abe({type:"intersection",left:e,right:t})}const Dbe=De("ZodRecord",(e,t)=>{bge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>O1e(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function jbe(e,t,n){return new Dbe({type:"record",keyType:e,valueType:t,...jt(n)})}const v3=De("ZodEnum",(e,t)=>{vge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(r,s,i)=>N1e(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new v3({...t,checks:[],...jt(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new v3({...t,checks:[],...jt(s),entries:i})}});function Ibe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new v3({type:"enum",entries:n,...jt(t)})}const zbe=De("ZodTransform",(e,t)=>{yge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>T1e(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new jB(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(rm(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(rm(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Lbe(e){return new zbe({type:"transform",transform:e})}const Pbe=De("ZodOptional",(e,t)=>{ZB.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nF(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function W_(e){return new Pbe({type:"optional",innerType:e})}const $be=De("ZodExactOptional",(e,t)=>{xge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nF(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Bbe(e){return new $be({type:"optional",innerType:e})}const Fbe=De("ZodNullable",(e,t)=>{wge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>D1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function K_(e){return new Fbe({type:"nullable",innerType:e})}const Hbe=De("ZodDefault",(e,t)=>{Sge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>I1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ube(e,t){return new Hbe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():LB(t)}})}const Vbe=De("ZodPrefault",(e,t)=>{Cge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>z1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function qbe(e,t){return new Vbe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():LB(t)}})}const Gbe=De("ZodNonOptional",(e,t)=>{kge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>j1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Wbe(e,t){return new Gbe({type:"nonoptional",innerType:e,...jt(t)})}const Kbe=De("ZodCatch",(e,t)=>{Ege.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>L1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ybe(e,t){return new Kbe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Zbe=De("ZodPipe",(e,t)=>{Nge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>P1e(e,n,r,s),e.in=t.in,e.out=t.out});function Y_(e,t){return new Zbe({type:"pipe",in:e,out:t})}const Xbe=De("ZodReadonly",(e,t)=>{Mge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>$1e(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Qbe(e){return new Xbe({type:"readonly",innerType:e})}const Jbe=De("ZodCustom",(e,t)=>{Tge.init(e,t),Ss.init(e,t),e._zod.processJSONSchema=(n,r,s)=>M1e(e,n)});function eve(e,t={}){return v1e(Jbe,e,t)}function tve(e){return y1e(e)}const nve=1;function rve(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return t.schemaVersion===nve&&typeof t.doc=="object"&&t.doc!==null}Ibe(["draft","review","published"]);Nbe().refine(Number.isFinite,"Expected finite number");oF([jbe(lbe(),G_()),iF(G_())]);function Is(e){this.content=e}Is.prototype={constructor:Is,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,s=r.find(e),i=r.content.slice();return s==-1?i.push(n||e,t):(i[s+1]=t,n&&(i[s]=n)),new Is(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Is(n)},addToStart:function(e,t){return new Is([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Is(n)},addBefore:function(e,t,n){var r=this.remove(t),s=r.content.slice(),i=r.find(e);return s.splice(i==-1?s.length:i,0,t,n),new Is(s)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Is.from(e),e.size?new Is(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Is.from(e),e.size?new Is(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Is.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Is.from=function(e){if(e instanceof Is)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Is(t)};function aF(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let s=e.child(r),i=t.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=aF(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function lF(e,t,n,r){for(let s=e.childCount,i=t.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=e.child(--s),a=t.child(--i),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,f=Math.min(o.text.length,a.text.length);for(;u<f&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=lF(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Oe{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,s=0,i){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>t&&r(l,s+a,i||null,o)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,t-f),Math.min(l.content.size,n-f),r,s+f)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,s){let i="",o=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=u},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)s.push(t.content[i]);return new Oe(s,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],s=0;if(n>t)for(let i=0,o=0;o<n;i++){let a=this.content[i],l=o+a.nodeSize;l>t&&((o<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,t-o-1),Math.min(a.content.size,n-o-1))),r.push(a),s+=a.nodeSize),o=l}return new Oe(r,s)}cutByIndex(t,n){return t==n?Oe.empty:t==0&&n==this.content.length?this:new Oe(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[t]=n,new Oe(s,i)}addToStart(t){return new Oe([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Oe(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];t(s,r,n),r+=s.nodeSize}}findDiffStart(t,n=0){return aF(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return lF(this,t,n,r)}findIndex(t){if(t==0)return q1(0,t);if(t==this.size)return q1(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=t)return i==t?q1(n+1,i):q1(n,r);r=i}}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 Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Oe.empty;let n,r=0;for(let s=0;s<t.length;s++){let i=t[s];r+=i.nodeSize,s&&i.isText&&t[s-1].sameMarkup(i)?(n||(n=t.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Oe(n||t,r)}static from(t){if(!t)return Oe.empty;if(t instanceof Oe)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Oe([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const o5={index:0,offset:0};function q1(e,t){return o5.index=e,o5.offset=t,o5}function Mv(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Mv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Mv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let lr=class y3{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let s=0;s<t.length;s++){let i=t[s];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,s));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,s)),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;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Mv(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return y3.none;if(t instanceof y3)return[t];let n=t.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};lr.none=[];class Tv extends Error{}class Je{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=uF(this.content,t+this.openStart,n);return r&&new Je(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Je(cF(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 Je.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Je(Oe.fromJSON(t,n.content),r,s)}static maxOpen(t,n=!0){let r=0,s=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)s++;return new Je(t,r,s)}}Je.empty=new Je(Oe.empty,0,0);function cF(e,t,n){let{index:r,offset:s}=e.findIndex(t),i=e.maybeChild(r),{index:o,offset:a}=e.findIndex(n);if(s==t||i.isText){if(a!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(cF(i.content,t-s-1,n-s-1)))}function uF(e,t,n,r){let{index:s,offset:i}=e.findIndex(t),o=e.maybeChild(s);if(i==t||o.isText)return r&&!r.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=uF(o.content,t-i-1,n,o);return a&&e.replaceChild(s,o.copy(a))}function sve(e,t,n){if(n.openStart>e.depth)throw new Tv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Tv("Inconsistent open depths");return dF(e,t,n,0)}function dF(e,t,n,r){let s=e.index(r),i=e.node(r);if(s==t.index(r)&&r<e.depth-n.openStart){let o=dF(e,t,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let o=e.parent,a=o.content;return hd(o,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:o,end:a}=ive(n,e);return hd(i,hF(e,o,a,t,r))}else return hd(i,_v(e,t,r))}function fF(e,t){if(!t.type.compatibleContent(e.type))throw new Tv("Cannot join "+t.type.name+" onto "+e.type.name)}function x3(e,t,n){let r=e.node(n);return fF(r,t.node(n)),r}function fd(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ip(e,t,n,r){let s=(t||e).node(n),i=0,o=t?t.index(n):s.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(fd(e.nodeAfter,r),i++));for(let a=i;a<o;a++)fd(s.child(a),r);t&&t.depth==n&&t.textOffset&&fd(t.nodeBefore,r)}function hd(e,t){return e.type.checkContent(t),e.copy(t)}function hF(e,t,n,r,s){let i=e.depth>s&&x3(e,t,s+1),o=r.depth>s&&x3(n,r,s+1),a=[];return Ip(null,e,s,a),i&&o&&t.index(s)==n.index(s)?(fF(i,o),fd(hd(i,hF(e,t,n,r,s+1)),a)):(i&&fd(hd(i,_v(e,t,s+1)),a),Ip(t,n,s,a),o&&fd(hd(o,_v(n,r,s+1)),a)),Ip(r,null,s,a),new Oe(a)}function _v(e,t,n){let r=[];if(Ip(null,e,n,r),e.depth>n){let s=x3(e,t,n+1);fd(hd(s,_v(e,t,n+1)),r)}return Ip(t,null,n,r),new Oe(r)}function ive(e,t){let n=t.depth-e.openStart,s=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)s=t.node(i).copy(Oe.from(s));return{start:s.resolveNoCache(e.openStart+n),end:s.resolveNoCache(s.content.size-e.openEnd-n)}}class sm{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],s=t.child(n);return r?t.child(n).cut(r):s}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],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)s+=r.child(i).nodeSize;return s}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return lr.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),s=t.maybeChild(n);if(!r){let a=r;r=s,s=a}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Rv(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<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=t;;){let{index:a,offset:l}=o.content.findIndex(i),u=i-l;if(r.push(o,a,s+l),!u||(o=o.child(a),o.isText))break;i=u-1,s+=l+1}return new sm(n,r,i)}static resolveCached(t,n){let r=Z_.get(t);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else Z_.set(t,r=new ove);let s=r.elts[r.i]=sm.resolve(t,n);return r.i=(r.i+1)%ave,s}}class ove{constructor(){this.elts=[],this.i=0}}const ave=12,Z_=new WeakMap;class Rv{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const lve=Object.create(null);let zl=class w3{constructor(t,n,r,s=lr.none){this.type=t,this.attrs=n,this.marks=s,this.content=r||Oe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,s=0){this.content.nodesBetween(t,n,r,s,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,s){return this.content.textBetween(t,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Mv(this.attrs,n||t.defaultAttrs||lve)&&lr.sameSet(this.marks,r||lr.none)}copy(t=null){return t==this.content?this:new w3(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new w3(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Je.empty;let s=this.resolve(t),i=this.resolve(n),o=r?0:s.sharedDepth(n),a=s.start(o),u=s.node(o).content.cut(s.pos-a,i.pos-a);return new Je(u,s.depth-o,i.depth-o)}replace(t,n,r){return sve(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(s==t||n.isText)return n;t-=s+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(t){return sm.resolveCached(this,t)}resolveNoCache(t){return sm.resolve(this,t)}rangeHasMark(t,n,r){let s=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}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()+")"),pF(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=Oe.empty,s=0,i=r.childCount){let o=this.contentMatchAt(t).matchFragment(r,s,i),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(t).matchType(r),o=i&&i.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=lr.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!lr.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.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;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 s=Oe.fromJSON(t,n.content),i=t.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};zl.prototype.text=void 0;let cve=class S3 extends zl{constructor(t,n,r,s){if(super(t,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pF(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 S3(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new S3(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 pF(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Md{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new uve(t,n);if(r.next==null)return Md.empty;let s=mF(r);r.next&&r.err("Unexpected trailing text");let i=bve(gve(s));return vve(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(t.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let s=[this];function i(o,a){let l=o.matchFragment(t,r);if(l&&(!n||l.validEnd))return Oe.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:p}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&s.indexOf(p)==-1){s.push(p);let g=i(p,a.concat(f));if(g)return g}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(t)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:a,next:l}=i.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=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 s=0;s<r.next.length;s++)t.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),t.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+t.indexOf(r.next[o].next);return i}).join(`
78
78
  `)}}Md.empty=new Md(!0);class uve{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 mF(e){let t=[];do t.push(dve(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function dve(e){let t=[];do t.push(fve(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function fve(e){let t=mve(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=hve(e,t);else break;return t}function X_(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function hve(e,t){let n=X_(e),r=n;return e.eat(",")&&(e.next!="}"?r=X_(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function pve(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(t)&&s.push(o)}return s.length==0&&e.err("No node type or group '"+t+"' found"),s}function mve(e){if(e.eat("(")){let t=mF(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=pve(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 gve(e){let t=[[]];return s(i(e,0),n()),t;function n(){return t.push([])-1}function r(o,a,l){let u={term:l,to:a};return t[o].push(u),u}function s(o,a){o.forEach(l=>l.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=i(o.exprs[l],a);if(l==o.exprs.length-1)return u;s(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),s(i(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return s(i(o.expr,a),l),s(i(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let f=n();s(i(o.expr,l),f),l=f}if(o.max==-1)s(i(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let f=n();r(l,f),s(i(o.expr,l),f),l=f}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function gF(e,t){return t-e}function Q_(e,t){let n=[];return r(t),n.sort(gF);function r(s){let i=e[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:a,to:l}=i[o];!a&&n.indexOf(l)==-1&&r(l)}}}function bve(e){let t=Object.create(null);return n(Q_(e,0));function n(r){let s=[];r.forEach(o=>{e[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<s.length;f++)s[f][0]==a&&(u=s[f][1]);Q_(e,l).forEach(f=>{u||s.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=t[r.join(",")]=new Md(r.indexOf(e.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(gF);i.next.push({type:s[o][0],next:t[a.join(",")]||n(a)})}return i}}function vve(e,t){for(let n=0,r=[e];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let a=0;a<s.next.length;a++){let{type:l,next:u}=s.next[a];o.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function bF(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function vF(e,t){let n=Object.create(null);for(let r in e){let s=t&&t[r];if(s===void 0){let i=e[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function yF(e,t,n,r){for(let s in t)if(!(s in e))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in e){let i=e[s];i.validate&&i.validate(t[s])}}function xF(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new xve(e,r,t[r]);return n}let J_=class wF{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=xF(t,r.attrs),this.defaultAttrs=bF(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Md.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:vF(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zl(this,this.computeAttrs(t),Oe.from(n),lr.setFrom(r))}createChecked(t=null,n,r){return n=Oe.from(n),this.checkContent(n),new zl(this,this.computeAttrs(t),n,lr.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=Oe.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(Oe.empty,!0);return i?new zl(this,t,n.append(i),lr.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){yF(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:lr.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,o)=>r[i]=new wF(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");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}};function yve(e,t,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}class xve{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?yve(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dx{constructor(t,n,r,s){this.name=t,this.rank=n,this.schema=r,this.spec=s,this.attrs=xF(t,s.attrs),this.excluded=null;let i=bF(this.attrs);this.instance=i?new lr(this,i):null}create(t=null){return!t&&this.instance?this.instance:new lr(this,vF(this.attrs,t))}static compile(t,n){let r=Object.create(null),s=0;return t.forEach((i,o)=>r[i]=new Dx(i,s++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){yF(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class SF{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in t)n[s]=t[s];n.nodes=Is.from(t.nodes),n.marks=Is.from(t.marks||{}),this.nodes=J_.compile(this.spec.nodes,this),this.marks=Dx.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Md.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?eR(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:eR(this,o.split(" "))}this.nodeFromJSON=s=>zl.fromJSON(this,s),this.markFromJSON=s=>lr.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,s){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof J_){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,s)}text(t,n){let r=this.nodes.text;return new cve(r,r.defaultAttrs,t,lr.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function eR(e,t){let n=[];for(let r=0;r<t.length;r++){let s=t[r],i=e.marks[s],o=i;if(i)n.push(i);else for(let a in e.marks){let l=e.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function wve(e){return e.tag!=null}function Sve(e){return e.style!=null}class Ll{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(wve(s))this.tags.push(s);else if(Sve(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=t.nodes[s.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new nR(this,n,!1);return r.addAll(t,lr.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new nR(this,n,!0);return r.addAll(t,lr.none,n.from,n.to),Je.maxOpen(r.finish())}matchTag(t,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Eve(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(t);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(t,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],a=o.style;if(!(a.indexOf(t)!=0||o.context&&!r.matchesContext(o.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(t){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<i)break}n.splice(o,0,s)}for(let s in t.marks){let i=t.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rR(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in t.nodes){let i=t.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rR(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ll(t,Ll.schemaRules(t)))}}const CF={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},Cve={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},kF={ol:!0,ul:!0},im=1,C3=2,zp=4;function tR(e,t,n){return t!=null?(t?im:0)|(t==="full"?C3:0):e&&e.whitespace=="pre"?im|C3:n&~zp}class G1{constructor(t,n,r,s,i,o){this.type=t,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=lr.none,this.match=i||(o&zp?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Oe.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(t.type))?(this.match=r,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&im)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=Oe.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!CF.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class nR{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=tR(null,n.preserveWhitespace,0)|(r?zp:0);s?i=new G1(s.type,s.attrs,lr.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new G1(null,null,lr.none,!0,null,o):i=new G1(t.schema.topNodeType,null,lr.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,s=this.top,i=s.options&C3?"full":this.localPreserveWS||(s.options&im)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
@@ -475,7 +475,7 @@ ${n}
475
475
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t?.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const s=e.split(`
476
476
  `),[i,o]=MCe(s);if(i.length===0)return;const a=WV(i,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:a,raw:s.slice(0,o).join(`
477
477
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(_Ce,this.editor.getAttributes(oO)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Dh({find:aO,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=Dh({find:aO,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(oO)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),RCe=/^\s*(\[([( |x])?\])\s$/,YV=ls.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",In(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const s=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return cE(e,t,s)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=p=>{var g,b;a.ariaLabel=((b=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:b.call(g,p,a.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};u(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",p=>p.preventDefault()),a.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:g}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const y=n();if(typeof y!="number")return!1;const x=b.doc.nodeAt(y);return b.setNodeMarkup(y,void 0,{...x?.attrs,checked:g}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,g)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,g])=>{s.setAttribute(p,g)}),s.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(t).forEach(([p,g])=>{s.setAttribute(p,g)});let f=new Set(Object.keys(t));return{dom:s,contentDOM:l,update:p=>{if(p.type!==this.type)return!1;s.dataset.checked=p.attrs.checked,a.checked=p.attrs.checked,u(p);const g=r.extensionManager.attributes,b=Oh(p,g),y=new Set(Object.keys(b)),x=this.options.HTMLAttributes;return f.forEach(S=>{y.has(S)||(S in x?s.setAttribute(S,x[S]):s.removeAttribute(S))}),Object.entries(b).forEach(([S,k])=>{k==null?S in x?s.setAttribute(S,x[S]):s.removeAttribute(S):s.setAttribute(S,k)}),f=y,!0}}}},addInputRules(){return[Dh({find:RCe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),ZV=ls.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",In(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
478
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=i=>{const o=F3(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=F3(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});on.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push($V.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(BV.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(GV.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(KV.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(YV.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ZV.configure(this.options.taskList)),e}});var hb="&nbsp;",K5=" ",ACe=ls.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",In(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===hb||n[0].text===hb||n[0].raw===K5||n[0].text===K5)&&r.length===1&&r[0].type==="text"&&(r[0].text===hb||r[0].text===K5)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,s;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(i.length===0){const o=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n?.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?hb:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OCe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,DCe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,jCe=aa.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",In(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ad({find:OCe,type:this.type})]},addPasteRules(){return[lu({find:DCe,type:this.type})]}}),ICe=ls.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),zCe=aa.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",In(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function LCe(e={}){return new zn({view(t){return new PCe(t,e)}})}class PCe{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(s=>{let i=o=>{this[s](o)};return t.dom.addEventListener(s,i),{name:s,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,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let p=t.nodeBefore,g=t.nodeAfter;if(p||g){let b=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(b){let y=b.getBoundingClientRect(),x=p?y.bottom:y.top;p&&g&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let S=this.width/2*a;r={left:y.left,right:y.right,top:x-S,bottom:x+S}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*o;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 u,f;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,f=-pageYOffset;else{let p=l.getBoundingClientRect(),g=p.width/l.offsetWidth,b=p.height/l.offsetHeight;u=p.left-l.scrollLeft*g,f=p.top-l.scrollTop*b}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-f)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"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),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,t):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=DF(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Pr extends $t{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Pr.valid(r)?new Pr(r):$t.near(r)}content(){return Je.empty}eq(t){return t instanceof Pr&&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 Pr(t.resolve(n.pos))}getBookmark(){return new LE(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!$Ce(t)||!BCe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Pr.valid(t))return t;let s=t.pos,i=null;for(let o=t.depth;;o--){let a=t.node(o);if(n>0?t.indexAfter(o)<a.childCount:t.index(o)>0){i=a.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=n;let l=t.doc.resolve(s);if(Pr.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!St.isSelectable(i)){t=t.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=t.doc.resolve(s);if(Pr.valid(a))return a}return null}}}Pr.prototype.visible=!1;Pr.findFrom=Pr.findGapCursorFrom;$t.jsonID("gapcursor",Pr);class LE{constructor(t){this.pos=t}map(t){return new LE(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Pr.valid(n)?new Pr(n):$t.near(n)}}function XV(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function $Ce(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 s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||XV(s.type))return!0;if(s.inlineContent)return!1}}return!0}function BCe(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 s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||XV(s.type))return!0;if(s.inlineContent)return!1}}return!0}function FCe(){return new zn({props:{decorations:qCe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Pr.valid(n)?new Pr(n):null},handleClick:UCe,handleKeyDown:HCe,handleDOMEvents:{beforeinput:VCe}}})}const HCe=Xk({ArrowLeft:pb("horiz",-1),ArrowRight:pb("horiz",1),ArrowUp:pb("vert",-1),ArrowDown:pb("vert",1)});function pb(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,s,i){let o=r.selection,a=t>0?o.$to:o.$from,l=o.empty;if(o instanceof Tt){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let u=Pr.findGapCursorFrom(a,t,l);return u?(s&&s(r.tr.setSelection(new Pr(u))),!0):!1}}function UCe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Pr.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&St.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Pr(r))),!0)}function VCe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Pr))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 s=Oe.empty;for(let o=r.length-1;o>=0;o--)s=Oe.from(r[o].createAndFill(null,s));let i=e.state.tr.replace(n.pos,n.pos,new Je(s,0,0));return i.setSelection(Tt.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function qCe(e){if(!(e.selection instanceof Pr))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ar.create(e.doc,[bs.widget(e.selection.head,t,{key:"gapcursor"})])}var yy=200,Ms=function(){};Ms.prototype.append=function(t){return t.length?(t=Ms.from(t),!this.length&&t||t.length<yy&&this.leafAppend(t)||this.length<yy&&t.leafPrepend(this)||this.appendInner(t)):this};Ms.prototype.prepend=function(t){return t.length?Ms.from(t).append(this):this};Ms.prototype.appendInner=function(t){return new GCe(this,t)};Ms.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Ms.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ms.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ms.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)};Ms.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(t(i,o))},n,r),s};Ms.from=function(t){return t instanceof Ms?t:t&&t.length?new QV(t):Ms.empty};var QV=(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(s,i){return s==0&&i==this.length?this:new t(this.values.slice(s,i))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,i,o,a){for(var l=i;l<o;l++)if(s(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(s,i,o,a){for(var l=i-1;l>=o;l--)if(s(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=yy)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=yy)return new t(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ms);Ms.empty=new QV([]);var GCe=(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 r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,i,o){var a=this.left.length;if(s<a&&this.left.forEachInner(r,s,Math.min(i,a),o)===!1||i>a&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(s,a),i,o)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,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})(Ms);const WCe=500;class Go{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 s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=t.tr,a,l,u=[],f=[];return this.items.forEach((p,g)=>{if(!p.step){s||(s=this.remapping(r,g+1),i=s.maps.length),i--,f.push(p);return}if(s){f.push(new ya(p.map));let b=p.step.map(s.slice(i)),y;b&&o.maybeStep(b).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],u.push(new ya(y,void 0,void 0,u.length+f.length))),i--,y&&s.appendMap(y,i)}else o.maybeStep(p.step);if(p.selection)return a=s?p.selection.map(s.slice(i)):p.selection,l=new Go(this.items.slice(0,r).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(t,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let f=0;f<t.steps.length;f++){let p=t.steps[f].invert(t.docs[f]),g=new ya(t.mapping.maps[f],p,n),b;(b=l&&l.merge(g))&&(g=b,f?i.pop():a=a.slice(0,a.length-1)),i.push(g),n&&(o++,n=void 0),s||(l=g)}let u=o-r.depth;return u>YCe&&(a=KCe(a,u),o-=u),new Go(a.append(i),o)}remapping(t,n){let r=new om;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},t,n),r}addMaps(t){return this.eventCount==0?this:new Go(this.items.append(t.map(n=>new ya(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=t.mapping,o=t.steps.length,a=this.eventCount;this.items.forEach(g=>{g.selection&&a--},s);let l=n;this.items.forEach(g=>{let b=i.getMirror(--l);if(b==null)return;o=Math.min(o,b);let y=i.maps[b];if(g.step){let x=t.steps[b].invert(t.docs[b]),S=g.selection&&g.selection.map(i.slice(l+1,b));S&&a++,r.push(new ya(y,x,S))}else r.push(new ya(y))},s);let u=[];for(let g=n;g<o;g++)u.push(new ya(i.maps[g]));let f=this.items.slice(0,s).append(u).append(r),p=new Go(f,a);return p.emptyItemCount()>WCe&&(p=p.compress(this.items.length-r.length)),p}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,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=t)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let f=o.selection&&o.selection.map(n.slice(r));f&&i++;let p=new ya(u.invert(),l,f),g,b=s.length-1;(g=s.length&&s[b].merge(p))?s[b]=g:s.push(p)}}else o.map&&r--},this.items.length,0),new Go(Ms.from(s.reverse()),i)}}Go.empty=new Go(Ms.empty,0);function KCe(e,t){let n;return e.forEach((r,s)=>{if(r.selection&&t--==0)return n=s,!1}),e.slice(n)}class ya{constructor(t,n,r,s){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new ya(n.getMap().invert(),n,this.selection)}}}class Pc{constructor(t,n,r,s,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const YCe=20;function ZCe(e,t,n,r){let s=n.getMeta(gd),i;if(s)return s.historyState;n.getMeta(JCe)&&(e=new Pc(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(o&&o.getMeta(gd))return o.getMeta(gd).redo?new Pc(e.done.addTransform(n,void 0,r,Wb(t)),e.undone,lO(n.mapping.maps),e.prevTime,e.prevComposition):new Pc(e.done,e.undone.addTransform(n,void 0,r,Wb(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!o&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!XCe(n,e.prevRanges)),u=o?Y5(e.prevRanges,n.mapping):lO(n.mapping.maps);return new Pc(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,Wb(t)),Go.empty,u,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Pc(e.done.rebased(n,i),e.undone.rebased(n,i),Y5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Pc(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function XCe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&s>=t[i]&&(n=!0)}),n}function lO(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,s,i,o)=>t.push(i,o));return t}function Y5(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),i=t.map(e[r+1],-1);s<=i&&n.push(s,i)}return n}function QCe(e,t,n){let r=Wb(t),s=gd.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),s,r),l=new Pc(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(gd,{redo:n,historyState:l})}let Z5=!1,cO=null;function Wb(e){let t=e.plugins;if(cO!=t){Z5=!1,cO=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Z5=!0;break}}return Z5}const gd=new Zn("history"),JCe=new Zn("closeHistory");function e6e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new zn({key:gd,state:{init(){return new Pc(Go.empty,Go.empty,null,0,-1)},apply(t,n,r){return ZCe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,s=r=="historyUndo"?eq:r=="historyRedo"?tq:null;return!s||!t.editable?!1:(n.preventDefault(),s(t.state,t.dispatch))}}}})}function JV(e,t){return(n,r)=>{let s=gd.getState(n);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(r){let i=QCe(s,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const eq=JV(!1,!0),tq=JV(!0,!0);on.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new zn({key:new Zn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const s=this.options.limit;if(s==null||s===0){e=!0;return}const i=this.storage.characters({node:r.doc});if(i>s){const o=i-s,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,l);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,l=i-r,u=a-l,f=a;return t.deleteRange(u,f),!(this.storage.characters({node:t.doc})>r)}})]}});var t6e=on.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[LCe(this.options)]}});on.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new zn({key:new Zn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=t,i=[];if(!n||!r)return ar.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((l,u)=>{if(l.isText)return;if(!(s>=u&&s<=u+l.nodeSize-1))return!1;o+=1});let a=0;return e.descendants((l,u)=>{if(l.isText||!(s>=u&&s<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(bs.node(u,u+l.nodeSize,{class:this.options.className}))}),ar.create(e,i)}}})]}});var n6e=on.create({name:"gapCursor",addProseMirrorPlugins(){return[FCe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=An(bt(e,"allowGapCursor",n)))!=null?t:null}}}),uO="placeholder";function r6e(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var s6e=on.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:uO,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${r6e(this.options.dataAttribute)}`:`data-${uO}`;return[new zn({key:new Zn("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n,i=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((a,l)=>{const u=s>=l&&s<=l+a.nodeSize,f=!a.isLeaf&&qx(a);if(!a.type.isTextblock)return this.options.includeChildren;if((u||!this.options.showOnlyCurrent)&&f){const p=[this.options.emptyNodeClass];o&&p.push(this.options.emptyEditorClass);const g=bs.node(l,l+a.nodeSize,{class:p.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(g)}return this.options.includeChildren}),ar.create(t,i)}}})]}}),i6e=on.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new zn({key:new Zn("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||YH(n.selection)||e.view.dragging?null:ar.create(n.doc,[bs.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}}),o6e="skipTrailingNode";function dO({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var a6e=on.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Zn(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new zn({key:t,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:u}=o,f=t.getState(o),p=a.content.size,g=u.nodes[n];if(!s.some(b=>b.getMeta(o6e))&&f)return l.insert(p,g.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!dO({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!dO({node:o,types:r})}}})]}}),l6e=on.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>eq(e,t),redo:()=>({state:e,dispatch:t})=>tq(e,t)}},addProseMirrorPlugins(){return[e6e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),nq=on.create({name:"starterKit",addExtensions(){var e,t,n,r;const s=[];return this.options.bold!==!1&&s.push(iCe.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(eCe.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push($V.configure(this.options.bulletList)),this.options.code!==!1&&s.push(lCe.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(LV.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(dCe.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(t6e.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(n6e.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(fCe.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(hCe.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(l6e.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(PV.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(vCe.configure(this.options.italic)),this.options.listItem!==!1&&s.push(BV.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(GV.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&s.push(EU.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&s.push(KV.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(ACe.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(jCe.configure(this.options.strike)),this.options.text!==!1&&s.push(ICe.configure(this.options.text)),this.options.underline!==!1&&s.push(zCe.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(a6e.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),c6e=nq;function u6e(){return[c6e.configure({link:!1,codeBlock:{HTMLAttributes:{class:"richtext-code-block"}}}),G4e.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),Q3e.configure({katexOptions:{throwOnError:!1}}),y4e,Z4e,K4e,w4e.configure({allowBase64:!1}),aSe.configure({types:["heading","paragraph"]}),$U.configure({resizable:!1}),PU,LU,zU]}function d6e(e){if(e==null||e==="")return null;if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const t=e;if(rve(e))return t.doc;if(t.type==="doc")return e}return null}function rq(e){const t=d6e(e);if(t==null)return"";if(typeof t=="string")return t;const n=u6e();return m4e(t,n)}function vC(e){return e.normalize("NFKD").replace(/[^\w\s-]/g,"").trim().toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,15)}function l2(e){const t=e.policies?.privacy??"plain",n=t!=="plain"?"hidden":"full";return{privacy:t,visibility:e.policies?.visibility??n,search:e.policies?.search??!0,filter:e.policies?.filter??!0,sort:e.policies?.sort??!0,public:e.policies?.public??!0}}const X5=768;function f6e(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${X5-1}px)`),r=()=>{t(window.innerWidth<X5)};return n.addEventListener("change",r),t(window.innerWidth<X5),()=>n.removeEventListener("change",r)},[]),!!e}function h6e({...e}){return h.jsx(Gy,{"data-slot":"sheet",...e})}function p6e({...e}){return h.jsx(Wy,{"data-slot":"sheet-portal",...e})}function m6e({className:e,...t}){return h.jsx(Ky,{"data-slot":"sheet-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function g6e({className:e,children:t,side:n="right",showCloseButton:r=!0,...s}){return h.jsxs(p6e,{children:[h.jsx(m6e,{}),h.jsxs(Yy,{"data-slot":"sheet-content",className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...s,children:[t,r&&h.jsxs(Om,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[h.jsx(ja,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function b6e({className:e,...t}){return h.jsx("div",{"data-slot":"sheet-header",className:ee("flex flex-col gap-1.5 p-4",e),...t})}function v6e({className:e,...t}){return h.jsx(l6,{"data-slot":"sheet-title",className:ee("text-foreground font-semibold",e),...t})}function y6e({className:e,...t}){return h.jsx(c6,{"data-slot":"sheet-description",className:ee("text-muted-foreground text-sm",e),...t})}function yr({className:e,...t}){return h.jsx("div",{"data-slot":"skeleton",className:ee("bg-accent animate-pulse rounded-md",e),...t})}const x6e="sidebar_state",w6e=3600*24*7,S6e="16rem",C6e="18rem",k6e="3rem",E6e="b",sq=w.createContext(null);function c2(){const e=w.useContext(sq);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ta({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...o}){const a=f6e(),[l,u]=w.useState(!1),[f,p]=w.useState(e),g=t??f,b=w.useCallback(k=>{const N=typeof k=="function"?k(g):k;n?n(N):p(N),document.cookie=`${x6e}=${N}; path=/; max-age=${w6e}`},[n,g]),y=w.useCallback(()=>a?u(k=>!k):b(k=>!k),[a,b,u]);w.useEffect(()=>{const k=N=>{N.key===E6e&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),y())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[y]);const x=g?"expanded":"collapsed",S=w.useMemo(()=>({state:x,open:g,setOpen:b,isMobile:a,openMobile:l,setOpenMobile:u,toggleSidebar:y}),[x,g,b,a,l,u,y]);return h.jsx(sq.Provider,{value:S,children:h.jsx(o$,{delayDuration:0,children:h.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":S6e,"--sidebar-width-icon":k6e,...s},className:ee("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...o,children:i})})})}function N6e({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:o,state:a,openMobile:l,setOpenMobile:u}=c2();return n==="none"?h.jsx("div",{"data-slot":"sidebar",className:ee("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):o?h.jsx(h6e,{open:l,onOpenChange:u,...i,children:h.jsxs(g6e,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":C6e},side:e,children:[h.jsxs(b6e,{className:"sr-only",children:[h.jsx(v6e,{children:"Sidebar"}),h.jsx(y6e,{children:"Displays the mobile sidebar."})]}),h.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):h.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":a,"data-collapsible":a==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[h.jsx("div",{"data-slot":"sidebar-gap",className:ee("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),h.jsx("div",{"data-slot":"sidebar-container",className:ee("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:h.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function _a({className:e,...t}){return h.jsx("main",{"data-slot":"sidebar-inset",className:ee("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function M6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ee("flex flex-col gap-2 p-2",e),...t})}function T6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ee("flex flex-col gap-2 p-2",e),...t})}function _6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ee("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function iq({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ee("relative flex w-full min-w-0 flex-col p-2",e),...t})}function R6e({className:e,asChild:t=!1,...n}){const r=t?$d:"div";return h.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ee("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function A6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ee("w-full text-sm",e),...t})}function u2({className:e,...t}){return h.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ee("flex w-full min-w-0 flex-col gap-1",e),...t})}function d2({className:e,...t}){return h.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ee("group/menu-item relative",e),...t})}const O6e=Ud("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f2({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o}){const a=e?$d:"button",{isMobile:l,state:u}=c2(),f=h.jsx(a,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ee(O6e({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:f}),h.jsx(Va,{side:"right",align:"center",hidden:u!=="collapsed"||l,...s})]})):f}function D6e({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const s=t?$d:"button";return h.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:ee("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function j6e({className:e,...t}){return h.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ee("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function I6e({className:e,...t}){return h.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ee("group/menu-sub-item relative",e),...t})}function z6e({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...s}){const i=e?$d:"a";return h.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:ee("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})}function L6e({...e}){return h.jsx(wte,{"data-slot":"collapsible",...e})}function P6e({...e}){return h.jsx(vj,{"data-slot":"collapsible-trigger",...e})}function $6e({...e}){return h.jsx(yj,{"data-slot":"collapsible-content",...e})}function fO({items:e,groupLabel:t="Menu",className:n}){const r=to(),s=r.pathname,i=r.search;return h.jsxs(iq,{className:n,children:[h.jsx(R6e,{children:t}),h.jsx(u2,{children:e.map(o=>{const a=o.items?.length?s===o.url||s.startsWith(o.url+"/")||s.startsWith(o.url+"?"):s===o.url;return h.jsx(L6e,{asChild:!0,defaultOpen:o.isActive||a,children:h.jsxs(d2,{children:[h.jsx(f2,{asChild:!0,tooltip:o.title,isActive:a&&!o.items?.length,children:h.jsxs(gs,{to:o.url,children:[h.jsx(o.icon,{}),h.jsx("span",{children:o.title})]})}),o.items?.length?h.jsxs(h.Fragment,{children:[h.jsx(P6e,{asChild:!0,children:h.jsxs(D6e,{className:"data-[state=open]:rotate-90",children:[h.jsx(Pd,{}),h.jsx("span",{className:"sr-only",children:"Toggle"})]})}),h.jsx($6e,{children:h.jsx(j6e,{children:o.items?.map(l=>{const[u,f]=l.url.split("?"),p=f?`?${f}`:"",g=s===u&&(p===""||i===p);return h.jsx(I6e,{children:h.jsx(z6e,{asChild:!0,isActive:g,children:h.jsx(gs,{to:l.url,children:h.jsx("span",{children:l.title})})})},l.title)})})})]}):null]})},o.title)})})]})}function B6e({items:e,...t}){return h.jsx(iq,{...t,children:h.jsx(A6e,{children:h.jsx(u2,{children:e.map(n=>h.jsx(d2,{children:h.jsx(f2,{asChild:!0,size:"sm",children:h.jsxs("a",{href:n.url,children:[h.jsx(n.icon,{}),h.jsx("span",{children:n.title})]})})},n.title))})})})}function jd({className:e,size:t="default",...n}){return h.jsx(sre,{"data-slot":"avatar","data-size":t,className:ee("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",e),...n})}function vm({className:e,...t}){return h.jsx(ire,{"data-slot":"avatar-image",className:ee("aspect-square size-full",e),...t})}function Id({className:e,...t}){return h.jsx(ore,{"data-slot":"avatar-fallback",className:ee("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",e),...t})}function Ao({...e}){return h.jsx(Yie,{"data-slot":"dropdown-menu",...e})}function $f({...e}){return h.jsx(uL,{"data-slot":"dropdown-menu-portal",...e})}function Oo({...e}){return h.jsx(Zie,{"data-slot":"dropdown-menu-trigger",...e})}function Do({className:e,sideOffset:t=4,...n}){return h.jsx(uL,{children:h.jsx(Xie,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function _p({...e}){return h.jsx(Qie,{"data-slot":"dropdown-menu-group",...e})}function Ra({className:e,inset:t,variant:n="default",...r}){return h.jsx(eoe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ee("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function F6e({...e}){return h.jsx(toe,{"data-slot":"dropdown-menu-radio-group",...e})}function Q5({className:e,children:t,...n}){return h.jsxs(noe,{"data-slot":"dropdown-menu-radio-item",className:ee("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:h.jsx(roe,{children:h.jsx(DX,{className:"size-2 fill-current"})})}),t]})}function ks({className:e,inset:t,...n}){return h.jsx(Jie,{"data-slot":"dropdown-menu-label","data-inset":t,className:ee("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function ri({className:e,...t}){return h.jsx(soe,{"data-slot":"dropdown-menu-separator",className:ee("-mx-1 my-1 h-px bg-border",e),...t})}function Bf({...e}){return h.jsx(ioe,{"data-slot":"dropdown-menu-sub",...e})}function Ff({className:e,inset:t,children:n,...r}){return h.jsxs(ooe,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ee("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,h.jsx(Pd,{className:"ml-auto size-4"})]})}function Hf({className:e,...t}){return h.jsx(aoe,{"data-slot":"dropdown-menu-sub-content",className:ee("z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...t})}function H6e(e,t){return e&&e.length>=2?e.slice(0,2).toUpperCase():t&&t.length>=2?t.slice(0,2).toUpperCase():"??"}function U6e({user:e,onLogout:t}){const{isMobile:n}=c2(),r=zo(),s=H6e(e.name,e.email);return h.jsx(u2,{children:h.jsx(d2,{children:h.jsxs(Ao,{children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(f2,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[h.jsxs(jd,{className:"h-8 w-8 rounded-lg",children:[h.jsx(vm,{src:e.avatar,alt:e.name}),h.jsx(Id,{className:"rounded-lg",children:s})]}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:e.name}),h.jsx("span",{className:"truncate text-xs",children:e.email})]}),h.jsx(xX,{className:"ml-auto size-4"})]})}),h.jsxs(Do,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:n?"bottom":"right",align:"end",sideOffset:4,children:[h.jsx(ks,{className:"p-0 font-normal",children:h.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[h.jsxs(jd,{className:"h-8 w-8 rounded-lg",children:[h.jsx(vm,{src:e.avatar,alt:e.name}),h.jsx(Id,{className:"rounded-lg",children:s})]}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:e.name}),h.jsx("span",{className:"truncate text-xs",children:e.email})]})]})}),h.jsx(ri,{}),h.jsx(_p,{children:h.jsxs(Ra,{onClick:()=>r("/settings"),children:[h.jsx(WZ,{}),"Account"]})}),h.jsx(ri,{}),h.jsxs(Ra,{onClick:()=>t?.(),children:[h.jsx(HQ,{}),"Log out"]})]})]})})})}const V6e={Folder:QD,Newspaper:lJ,ShoppingBag:$J,Users:bee,MessageSquare:ZQ,Layout:bJ,UserCircle:_X,Mail:VQ,FileText:Qb,Image:Tm,Video:yee,Music:oJ,Tag:XJ,Bookmark:nX,Star:qJ,Heart:gQ,Globe:ej,Link:OS,Calendar:KC,Clock:Gf,Map:KQ,MapPin:GQ,Package:fJ,Box:sX,Archive:OZ,Database:YC,Settings:_m,Wrench:kee,Code:$X,Terminal:JJ,Book:eX,BookOpen:QZ,GraduationCap:cQ,Award:qZ,Trophy:oee,Flag:sQ,Layers:tj,Grid:dQ,List:LQ,Table:cj,BarChart:fX,PieChart:qD,TrendingUp:QC,Activity:Tl,Zap:e6,Shield:aj,Lock:BQ,Key:MQ,Bell:Fh,Phone:SJ,Camera:VD,Mic:QQ,Monitor:rj,Cpu:FX,HardDrive:ZC,Wifi:uj,Home:vQ,Building:lX,Store:WJ,Briefcase:oX,DollarSign:GX,CreditCard:UX,ShoppingCart:FJ,Truck:lee,Percent:xJ,Hash:pQ,AtSign:UZ,Info:XC,HelpCircle:MX,AlertCircle:KD,CheckCircle:ZD};function PE(e){return e&&V6e[e]||QD}function q6e(e){return[{title:"Dashboard",url:"/",icon:nj,isActive:!0},{title:e("settings.title"),url:"/settings",icon:_m,items:[{title:e("settings.tabs.profile"),url:"/settings?tab=profile"},{title:e("settings.tabs.interface"),url:"/settings?tab=interface"},{title:e("settings.tabs.security"),url:"/settings?tab=security"},{title:e("settings.tabs.storage"),url:"/settings?tab=storage"},{title:e("settings.tabs.notifications"),url:"/settings?tab=notifications"}]}]}function G6e(e,t){const n=e.filter(s=>!s.dashboard?.hidden),r=new Map;for(const s of n){const i=s.dashboard?.group??t,o=r.get(i)??[];o.push(s),r.set(i,o)}return Array.from(r.entries()).map(([s,i])=>({label:s,items:i.sort((o,a)=>(o.dashboard?.order??99)-(a.dashboard?.order??99)).map(o=>({title:o.labelPlural??o.label,url:`/content/${o.slug}`,icon:PE(o.dashboard?.icon)}))}))}const hO=[];function W6e({...e}){return h.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function K6e({className:e,...t}){return h.jsx("ol",{"data-slot":"breadcrumb-list",className:ee("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Y6e({className:e,...t}){return h.jsx("li",{"data-slot":"breadcrumb-item",className:ee("inline-flex items-center gap-1.5",e),...t})}function Z6e({asChild:e,className:t,...n}){const r=e?$d:"a";return h.jsx(r,{"data-slot":"breadcrumb-link",className:ee("hover:text-foreground transition-colors",t),...n})}function X6e({className:e,...t}){return h.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ee("text-foreground font-normal",e),...t})}function Q6e({children:e,className:t,...n}){return h.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ee("[&>svg]:size-3.5",t),...n,children:e??h.jsx(Pd,{})})}function oq({...e}){return h.jsx(Eie,{"data-slot":"context-menu",...e})}function aq({...e}){return h.jsx(Nie,{"data-slot":"context-menu-trigger",...e})}function lq({className:e,...t}){return h.jsx(Mie,{children:h.jsx(Tie,{"data-slot":"context-menu-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function ld({className:e,inset:t,variant:n="default",...r}){return h.jsx(Rie,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function J6e({className:e,inset:t,...n}){return h.jsx(_ie,{"data-slot":"context-menu-label","data-inset":t,className:ee("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function cq({className:e,...t}){return h.jsx(Aie,{"data-slot":"context-menu-separator",className:ee("bg-border -mx-1 my-1 h-px",e),...t})}function uq({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:ee("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function dq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:ee("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const eke=Ud("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function fq({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:ee(eke({variant:t,className:e})),...n})}function hq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:ee("text-lg font-medium tracking-tight",e),...t})}function pq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:ee("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function sg({...e}){return h.jsx(xoe,{"data-slot":"popover",...e})}function ig({...e}){return h.jsx(woe,{"data-slot":"popover-trigger",...e})}function og({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(Soe,{children:h.jsx(Coe,{"data-slot":"popover-content",align:t,sideOffset:n,className:ee("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}const mq=Ud("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});function gq({className:e,variant:t,size:n,...r}){return h.jsx(Hae,{"data-slot":"toggle",className:ee(mq({variant:t,size:n,className:e})),...r})}const bq=w.createContext({size:"default",variant:"default",spacing:0});function h2({className:e,variant:t,size:n,spacing:r=0,children:s,...i}){return h.jsx(Wae,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:ee("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:h.jsx(bq.Provider,{value:{variant:t,size:n,spacing:r},children:s})})}function bd({className:e,children:t,variant:n,size:r,...s}){const i=w.useContext(bq);return h.jsx(Kae,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:ee(mq({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...s,children:t})}const tke={info:XC,success:ZD,warning:JC,error:AX};function nke(){const e=ia(),[t,n]=w.useState("all"),{data:r=[],isLoading:s}=is({queryKey:["notifications"],queryFn:async()=>{const{data:S}=await Xt.get("/content/notifications");return S},refetchInterval:300*1e3,staleTime:60*1e3,refetchOnWindowFocus:!0}),i=r.map(S=>({id:S.id,title:S.title,description:S.message,icon:tke[S.type]||Fh,isNew:S.is_read===0,createdAt:new Date(S.created_at*1e3)})),o=Ei({mutationFn:async S=>{await Xt.patch(`/content/notifications/${S}/read`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),a=Ei({mutationFn:async S=>{await Xt.patch(`/content/notifications/${S}/unread`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),l=Ei({mutationFn:async S=>{await Xt.delete(`/content/notifications/${S}`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),u=Ei({mutationFn:async()=>{await Xt.post("/content/notifications/mark-all-read")},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),f=t==="new"?i.filter(S=>S.isNew):i,p=S=>{o.mutate(S)},g=S=>{a.mutate(S)},b=S=>{l.mutate(S)},y=i.some(S=>S.isNew),x=i.filter(S=>S.isNew).length;return{notifications:f,isLoading:s,filter:t,setFilter:n,hasUnreadNotifications:y,unreadCount:x,handleMarkSeen:p,handleMarkUnseen:g,handleDelete:b,handleMarkAllRead:()=>u.mutate()}}const rke=320;function ske({notifications:e,filter:t,onMarkSeen:n,onMarkUnseen:r,onDelete:s}){const{t:i}=kt();return h.jsx("div",{className:"space-y-3 p-2",children:e.length===0?h.jsx(uq,{className:"border-0 p-6",children:h.jsxs(dq,{children:[h.jsx(fq,{variant:"icon",children:h.jsx(Fh,{className:"size-6"})}),h.jsx(hq,{children:i("notifications.noNotifications")}),h.jsx(pq,{children:i(t==="new"?"notifications.noNotificationsNew":"notifications.noNotificationsAll")})]})}):e.map(o=>h.jsx(ike,{notification:o,onMarkSeen:n,onMarkUnseen:r,onDelete:s},o.id))})}function ike({notification:e,onMarkSeen:t,onMarkUnseen:n,onDelete:r}){const{t:s}=kt(),i=e.icon;return h.jsxs(oq,{modal:!1,children:[h.jsx(aq,{asChild:!0,children:h.jsxs("button",{type:"button",onClick:()=>{e.isNew&&t(e.id)},className:ee("relative flex items-center gap-3 rounded-lg border bg-card p-3 transition-colors text-left","hover:bg-muted/50",e.isNew?"cursor-pointer":"cursor-context-menu"),children:[e.isNew&&h.jsx("span",{className:"absolute right-2 top-2 inline-block size-2 shrink-0 rounded-full bg-destructive aspect-square","aria-hidden":!0}),h.jsx("div",{className:"bg-muted flex size-11 shrink-0 items-center justify-center rounded-full",children:h.jsx(i,{className:"text-muted-foreground size-5"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"font-medium",children:e.title}),h.jsx("p",{className:"text-muted-foreground line-clamp-2 text-sm",children:e.description})]})]})}),h.jsxs(lq,{children:[e.isNew?h.jsxs(ld,{onClick:()=>t(e.id),children:[h.jsx(Fh,{className:"size-4"}),s("notifications.markSeen")]}):h.jsxs(ld,{onClick:()=>n(e.id),children:[h.jsx(vh,{className:"size-4"}),s("notifications.markUnseen")]}),h.jsx(cq,{}),h.jsxs(ld,{variant:"destructive",onClick:()=>r(e.id),children:[h.jsx(Hh,{className:"size-4"}),s("notifications.delete")]})]})]})}function oke(e){const t=new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,view:globalThis,clientX:0,clientY:0});e.dispatchEvent(t)}function ake(){const{t:e}=kt(),{notifications:t,filter:n,setFilter:r,hasUnreadNotifications:s,unreadCount:i,handleMarkSeen:o,handleMarkUnseen:a,handleDelete:l,handleMarkAllRead:u}=nke(),f=w.useCallback(p=>{const g=p.currentTarget;g&&oke(g)},[]);return h.jsxs(sg,{children:[h.jsx(ig,{asChild:!0,children:h.jsxs(He,{className:"relative ml-auto h-8 w-8",variant:"ghost",size:"icon","aria-label":e("notifications.ariaLabel"),children:[h.jsx(Fh,{className:"size-4"}),s&&h.jsx("span",{className:"absolute bottom-0.5 right-0.5 size-2 rounded-full bg-destructive","aria-hidden":!0}),h.jsx("span",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:s?e("notifications.unreadCount",{count:i}):e("notifications.noUnread")})]})}),h.jsxs(og,{align:"end",side:"bottom",className:"w-80 p-0 sm:w-96",children:[h.jsxs("div",{className:"border-b px-4 py-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"font-semibold",children:e("notifications.title")}),s&&h.jsx(He,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>u(),children:e("notifications.markAllRead")})]}),h.jsxs(h2,{type:"single",value:n,onValueChange:p=>p&&r(p),variant:"outline",className:"mt-2 w-full justify-start",children:[h.jsx(bd,{value:"all",className:"flex-1",children:e("notifications.all")}),h.jsx(bd,{value:"new",className:"flex-1",children:e("notifications.new")})]})]}),h.jsx("div",{style:{height:rke},className:"overflow-y-auto overflow-x-hidden",onScroll:f,onWheel:f,children:h.jsx(ske,{notifications:t,filter:n,onMarkSeen:o,onMarkUnseen:a,onDelete:l})})]})]})}function lke(){const{t:e}=kt(),{pathname:t}=to(),[n]=wx();if(t==="/settings"){const s=n.get("tab")??"profile",i=e(`settings.tabs.${s}`,{defaultValue:s});return[{label:"Beech CMS",href:"/"},{label:e("siteHeader.settings"),href:"/settings"},{label:i}]}const r=t.match(/^\/content\/([^/]+)(?:\/(.+))?$/);if(r){const s=r[1],i=r[2],o=Object.values(Ek).find(u=>u.slug===s),a=o?.labelPlural??o?.label??s,l=[{label:"Beech CMS",href:"/"},{label:e("siteHeader.contents"),href:`/content/${s}`},{label:a,href:i?`/content/${s}`:void 0}];return i==="create"?l.push({label:e("siteHeader.new")}):i&&l.push({label:e("siteHeader.edit")}),l}return t==="/"?[{label:"Beech CMS",href:"/"},{label:"Dashboard"}]:[{label:"Beech CMS",href:"/"}]}function Aa(){const{toggleSidebar:e}=c2(),t=lke();return h.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:h.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[h.jsx(He,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:h.jsx(mJ,{})}),h.jsx(Hi,{orientation:"vertical",className:"mr-2 h-4"}),h.jsx(W6e,{className:"hidden sm:block",children:h.jsx(K6e,{children:t.map((n,r)=>{const s=r===t.length-1;return h.jsxs(w.Fragment,{children:[h.jsx(Y6e,{children:!s&&n.href?h.jsx(Z6e,{asChild:!0,children:h.jsx(gs,{to:n.href,children:n.label})}):h.jsx(X6e,{children:n.label})}),!s&&h.jsx(Q6e,{})]},r)})})}),h.jsx(ake,{})]})})}const ra={getProfile:async()=>{const{data:e}=await Xt.get("/settings/me");return e},updateProfile:async e=>{await Xt.put("/settings/profile",e)},changePassword:async e=>{await Xt.put("/settings/password",e)},updateAvatar:async e=>{await Xt.put("/settings/avatar",{avatarUrl:e})},uploadAvatar:async e=>{const t=new FormData;t.append("file",e);const{data:n}=await Xt.post("/upload",t);return n.url},getSessions:async()=>{const{data:e}=await Xt.get("/settings/sessions");return e},revokeSession:async e=>{await Xt.delete(`/settings/sessions/${e}`)},getActivity:async()=>{const{data:e}=await Xt.get("/settings/activity");return e},getStorage:async()=>{const{data:e}=await Xt.get("/settings/storage");return e},getNotifications:async()=>{const{data:e}=await Xt.get("/settings/notifications");return e},updateNotifications:async e=>{await Xt.put("/settings/notifications",e)}},Ci={all:["settings"],profile:()=>[...Ci.all,"profile"],sessions:()=>[...Ci.all,"sessions"],activity:()=>[...Ci.all,"activity"],storage:()=>[...Ci.all,"storage"],notifications:()=>[...Ci.all,"notifications"]};function vq(){return is({queryKey:Ci.profile(),queryFn:ra.getProfile,staleTime:300*1e3})}function cke(){const e=ia();return Ei({mutationFn:ra.updateProfile,onSuccess:()=>e.invalidateQueries({queryKey:Ci.profile()})})}function uke(){return Ei({mutationFn:ra.changePassword})}function dke(){const e=ia();return Ei({mutationFn:async t=>{const n=await ra.uploadAvatar(t);return await ra.updateAvatar(n),n},onSuccess:()=>e.invalidateQueries({queryKey:Ci.profile()})})}function fke(){return is({queryKey:Ci.sessions(),queryFn:ra.getSessions,staleTime:60*1e3})}function hke(){const e=ia();return Ei({mutationFn:ra.revokeSession,onSuccess:()=>e.invalidateQueries({queryKey:Ci.sessions()})})}function pke(){return is({queryKey:Ci.activity(),queryFn:ra.getActivity,staleTime:60*1e3})}function mke(){return is({queryKey:Ci.storage(),queryFn:ra.getStorage,staleTime:300*1e3})}function gke(){return is({queryKey:Ci.notifications(),queryFn:ra.getNotifications,staleTime:300*1e3})}function bke(){const e=ia();return Ei({mutationFn:t=>ra.updateNotifications(t),onSuccess:()=>e.invalidateQueries({queryKey:Ci.notifications()})})}function vke(e,t){return e?e.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2):t.slice(0,2).toUpperCase()}function yke(){const{t:e}=kt(),{data:t,isLoading:n}=vq(),r=cke(),s=uke(),i=dke(),o=w.useRef(null),[a,l]=w.useState(""),[u,f]=w.useState(""),[p,g]=w.useState(""),[b,y]=w.useState(""),[x,S]=w.useState("");w.useEffect(()=>{t&&(l(t.name??""),f(t.email))},[t]);const k=async R=>{R.preventDefault();try{await r.mutateAsync({name:a||void 0,email:u||void 0}),or.success(e("settings.profile.savedSuccess"))}catch(_){const A=_?.response?.data?.detail??e("settings.profile.savedError");or.error(A)}},N=async R=>{if(R.preventDefault(),b!==x){or.error(e("settings.profile.passwordMismatch"));return}try{await s.mutateAsync({currentPassword:p,newPassword:b}),or.success(e("settings.profile.passwordSuccess")),g(""),y(""),S("")}catch(_){const A=_?.response?.data?.detail??e("settings.profile.passwordError");or.error(A)}},T=async R=>{const _=R.target.files?.[0];if(_){try{await i.mutateAsync(_),or.success(e("settings.profile.avatarSuccess"))}catch{or.error(e("settings.profile.avatarError"))}R.target.value=""}};return n?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Co,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.profile.infoTitle")}),h.jsx(Xo,{children:e("settings.profile.infoDesc")})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:k,className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsxs(jd,{className:"size-20",children:[h.jsx(vm,{src:t?.avatarUrl??void 0}),h.jsx(Id,{className:"text-lg",children:vke(t?.name??null,t?.email??"")})]}),h.jsx("button",{type:"button",onClick:()=>o.current?.click(),disabled:i.isPending,className:"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:i.isPending?h.jsx(Co,{className:"size-5 text-white animate-spin"}):h.jsx(VD,{className:"size-5 text-white"})})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium",children:t?.name??e("settings.profile.noName")}),h.jsx("p",{className:"text-sm text-muted-foreground",children:t?.email}),h.jsx("button",{type:"button",onClick:()=>o.current?.click(),className:"text-xs text-primary mt-1 hover:underline",children:e("settings.profile.changePhoto")})]}),h.jsx("input",{ref:o,type:"file",accept:"image/*",className:"hidden",onChange:T})]}),h.jsx(Hi,{}),h.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"name",children:e("settings.profile.nameLabel")}),h.jsx(pn,{id:"name",value:a,onChange:R=>l(R.target.value),placeholder:e("settings.profile.namePlaceholder")})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"email",children:e("settings.profile.emailLabel")}),h.jsx(pn,{id:"email",type:"email",value:u,onChange:R=>f(R.target.value),placeholder:e("settings.profile.emailPlaceholder")})]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(He,{type:"submit",disabled:r.isPending,children:[r.isPending&&h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("settings.profile.saveChanges")]})})]})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.profile.passwordTitle")}),h.jsx(Xo,{children:e("settings.profile.passwordDesc")})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:N,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"current-password",children:e("settings.profile.currentPassword")}),h.jsx(pn,{id:"current-password",type:"password",value:p,onChange:R=>g(R.target.value),autoComplete:"current-password"})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"new-password",children:e("settings.profile.newPassword")}),h.jsx(pn,{id:"new-password",type:"password",value:b,onChange:R=>y(R.target.value),autoComplete:"new-password"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"confirm-password",children:e("settings.profile.confirmPassword")}),h.jsx(pn,{id:"confirm-password",type:"password",value:x,onChange:R=>S(R.target.value),autoComplete:"new-password"})]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(He,{type:"submit",variant:"outline",disabled:s.isPending,children:[s.isPending&&h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("settings.profile.updatePassword")]})})]})})]})]})}function Ul({...e}){return h.jsx(pae,{"data-slot":"select",...e})}function hu({...e}){return h.jsx(gae,{"data-slot":"select-value",...e})}function Vl({className:e,size:t="default",children:n,...r}){return h.jsxs(mae,{"data-slot":"select-trigger","data-size":t,className:ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(bae,{asChild:!0,children:h.jsx(Mm,{className:"size-4 opacity-50"})})]})}function ql({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return h.jsx(vae,{children:h.jsxs(yae,{"data-slot":"select-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[h.jsx(xke,{}),h.jsx(xae,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(wke,{})]})})}function Eo({className:e,children:t,...n}){return h.jsxs(wae,{"data-slot":"select-item",className:ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(Cae,{children:h.jsx(td,{className:"size-4"})})}),h.jsx(Sae,{children:t})]})}function xke({className:e,...t}){return h.jsx(kae,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(WD,{className:"size-4"})})}function wke({className:e,...t}){return h.jsx(Eae,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(Mm,{className:"size-4"})})}const pO="beech_rows_per_page",Ske=[{value:"it",label:"Italiano"},{value:"en",label:"English"}];function Cke(){const{theme:e,setTheme:t}=$y(),{t:n,i18n:r}=kt(),[s,i]=w.useState(()=>localStorage.getItem(pO)??"20"),[o,a]=w.useState(!1);w.useEffect(()=>{a(!0)},[]);const l=[{value:"light",label:n("settings.interface.themeLight"),icon:lj},{value:"dark",label:n("settings.interface.themeDark"),icon:sj},{value:"system",label:n("settings.interface.themeSystem"),icon:rj}],u=[{value:"10",label:n("settings.interface.rows10")},{value:"20",label:n("settings.interface.rows20")},{value:"50",label:n("settings.interface.rows50")},{value:"100",label:n("settings.interface.rows100")}],f=g=>{i(g),localStorage.setItem(pO,g),or.success(n("settings.interface.rowsSaved"))},p=g=>{r.changeLanguage(g),or.success(n(g==="it"?"settings.interface.langChangedIt":"settings.interface.langChangedEn"))};return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.themeTitle")}),h.jsx(Xo,{children:n("settings.interface.themeDesc")})]}),h.jsx(Kn,{children:h.jsx("div",{className:"grid grid-cols-3 gap-3",children:l.map(({value:g,label:b,icon:y})=>h.jsxs("button",{type:"button",onClick:()=>t(g),className:`flex flex-col items-center gap-2 rounded-lg border-2 p-4 transition-colors cursor-pointer ${o&&e===g?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[h.jsx(y,{className:"size-5 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-medium",children:b})]},g))})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.langTitle")}),h.jsx(Xo,{children:n("settings.interface.langDesc")})]}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"language",children:n("settings.interface.langLabel")}),h.jsxs(Ul,{value:r.language,onValueChange:p,children:[h.jsx(Vl,{id:"language",className:"w-full sm:w-64",children:h.jsx(hu,{})}),h.jsx(ql,{children:Ske.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]})]})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.rowsTitle")}),h.jsx(Xo,{children:n("settings.interface.rowsDesc")})]}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"rows",children:n("settings.interface.rowsLabel")}),h.jsxs(Ul,{value:s,onValueChange:f,children:[h.jsx(Vl,{id:"rows",className:"w-full sm:w-64",children:h.jsx(hu,{})}),h.jsx(ql,{children:u.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]})]})})]})]})}const kke=Ud("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border dark:border-white/20 text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function _i({className:e,variant:t="default",asChild:n=!1,...r}){const s=n?$d:"span";return h.jsx(s,{"data-slot":"badge","data-variant":t,className:ee(kke({variant:t}),e),...r})}function Gl({className:e,children:t,onScroll:n,...r}){return h.jsxs(Hoe,{"data-slot":"scroll-area",className:ee("relative",e),...r,children:[h.jsx(Uoe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",onScroll:n,children:t}),h.jsx(Eke,{}),h.jsx(Voe,{})]})}function Eke({className:e,orientation:t="vertical",...n}){return h.jsx(AL,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ee("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(IL,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function yq({...e}){return h.jsx(Une,{"data-slot":"alert-dialog",...e})}function Nke({...e}){return h.jsx(Vne,{"data-slot":"alert-dialog-trigger",...e})}function Mke({...e}){return h.jsx(qne,{"data-slot":"alert-dialog-portal",...e})}function Tke({className:e,...t}){return h.jsx(Gne,{"data-slot":"alert-dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function xq({className:e,size:t="default",...n}){return h.jsxs(Mke,{children:[h.jsx(Tke,{}),h.jsx(Wne,{"data-slot":"alert-dialog-content","data-size":t,className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...n})]})}function wq({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:ee("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Sq({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:ee("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Cq({className:e,...t}){return h.jsx(Zne,{"data-slot":"alert-dialog-title",className:ee("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function kq({className:e,...t}){return h.jsx(Xne,{"data-slot":"alert-dialog-description",className:ee("text-muted-foreground text-sm",e),...t})}function Eq({className:e,variant:t="default",size:n="default",...r}){return h.jsx(He,{variant:t,size:n,asChild:!0,children:h.jsx(Kne,{"data-slot":"alert-dialog-action",className:ee(e),...r})})}function Nq({className:e,variant:t="outline",size:n="default",...r}){return h.jsx(He,{variant:t,size:n,asChild:!0,children:h.jsx(Yne,{"data-slot":"alert-dialog-cancel",className:ee(e),...r})})}const _ke={create:"default",update:"secondary",delete:"destructive",upload:"outline"};function yC(e){return new Date(e*1e3).toLocaleString("it-IT",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Rke({session:e,onRevoke:t}){const{t:n}=kt(),[r,s]=w.useState(!1),i=async()=>{s(!0);try{await t(e.id),or.success(n("settings.security.revokeSuccess"))}catch{or.error(n("settings.security.revokeError"))}finally{s(!1)}};return h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(nJ,{className:"size-4 text-muted-foreground shrink-0"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium",children:n("settings.security.sessionActive")}),h.jsx("p",{className:"text-xs text-muted-foreground",children:n("settings.security.sessionInfo",{created:yC(e.created_at),expires:yC(e.expires_at)})})]})]}),h.jsxs(yq,{children:[h.jsx(Nke,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-destructive",children:r?h.jsx(Co,{className:"size-4 animate-spin"}):h.jsx(Hh,{className:"size-4"})})}),h.jsxs(xq,{children:[h.jsxs(wq,{children:[h.jsx(Cq,{children:n("settings.security.revokeTitle")}),h.jsx(kq,{children:n("settings.security.revokeDesc")})]}),h.jsxs(Sq,{children:[h.jsx(Nq,{children:n("common.cancel")}),h.jsx(Eq,{onClick:i,children:n("settings.security.revokeConfirm")})]})]})]})]})}function Ake({entry:e}){const{t}=kt();let n={};try{n=JSON.parse(e.details??"{}")}catch{}const r=typeof n.title=="string"?n.title:e.entity_slug??e.entity_type;return h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(_i,{variant:_ke[e.action]??"secondary",className:"shrink-0 capitalize",children:t(`settings.security.actions.${e.action}`,{defaultValue:e.action})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium truncate max-w-xs",children:r}),h.jsx("p",{className:"text-xs text-muted-foreground",children:e.entity_slug??e.entity_type})]})]}),h.jsx("span",{className:"text-xs text-muted-foreground shrink-0 ml-4",children:yC(e.created_at)})]})}function Oke(){const{t:e}=kt(),{data:t,isLoading:n}=fke(),{data:r,isLoading:s}=pke(),i=hke();return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.security.sessionsTitle")}),h.jsx(Xo,{children:e("settings.security.sessionsDesc")})]}),h.jsx(Kn,{children:n?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(o=>h.jsx(yr,{className:"h-12 w-full"},o))}):t?.length?h.jsx("div",{children:t.map(o=>h.jsx(Rke,{session:o,onRevoke:a=>i.mutateAsync(a)},o.id))}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.security.noSessions")})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.security.activityTitle")}),h.jsx(Xo,{children:e("settings.security.activityDesc")})]}),h.jsx(Kn,{children:s?h.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(o=>h.jsx(yr,{className:"h-12 w-full"},o))}):r?.length?h.jsx(Gl,{className:"h-72",children:r.map(o=>h.jsx(Ake,{entry:o},o.id))}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.security.noActivity")})})]})]})}const Lh=w.forwardRef(({className:e,value:t,indicatorClassName:n,...r},s)=>h.jsx(NL,{ref:s,className:ee("relative h-2 w-full overflow-hidden rounded-full bg-neutral-900/20 dark:bg-white/20",e),...r,children:h.jsx(Roe,{className:ee("h-full w-full flex-1 bg-neutral-900 dark:bg-white transition-all",n),style:{transform:`translateX(-${100-(t||0)}%)`}})}));Lh.displayName=NL.displayName;const Dke=1*1024*1024*1024;function J5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}const jke={"image/jpeg":"JPEG","image/png":"PNG","image/webp":"WebP","image/gif":"GIF","image/svg+xml":"SVG","application/pdf":"PDF","video/mp4":"MP4"};function Ike(e){return jke[e]??e.split("/")[1]?.toUpperCase()??"File"}function zke(){const{t:e}=kt(),{data:t,isLoading:n}=mke();if(n)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(yr,{className:"h-36 w-full"}),h.jsx(yr,{className:"h-64 w-full"})]});const r=Math.min(100,(t?.totalBytes??0)/Dke*100),s=t?.orphans.reduce((i,o)=>i+o.size_bytes,0)??0;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.storage.usageTitle")}),h.jsx(Xo,{children:e("settings.storage.usageDesc")})]}),h.jsxs(Kn,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-end justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-3xl font-bold tabular-nums",children:J5(t?.totalBytes??0)}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e("settings.storage.fileCount",{count:t?.fileCount??0})})]}),t?.orphans.length?h.jsxs(_i,{variant:"secondary",className:"mb-1",children:[t.orphans.length," orfani · ",J5(s)]}):null]}),h.jsx(Lh,{value:r,className:"h-2"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:e("settings.storage.referenceVisual")})]})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsxs(_r,{className:"flex items-center gap-2",children:[h.jsx(tQ,{className:"size-4"}),e("settings.storage.orphansTitle")]}),h.jsx(Xo,{children:e("settings.storage.orphansDesc")})]}),h.jsx(Kn,{children:t?.orphans.length?h.jsx(Gl,{className:"h-72",children:h.jsx("div",{className:"space-y-0",children:t.orphans.map(i=>h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium truncate",children:i.filename}),h.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:i.key})]}),h.jsxs("div",{className:"flex items-center gap-3 ml-4 shrink-0",children:[h.jsx(_i,{variant:"outline",children:Ike(i.mime_type)}),h.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:J5(i.size_bytes)})]})]},i.key))})}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.storage.noOrphans")})})]})]})}function Mq({className:e,size:t="default",...n}){return h.jsx(jae,{"data-slot":"switch","data-size":t,className:ee("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...n,children:h.jsx(Iae,{"data-slot":"switch-thumb",className:ee("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}function mb({id:e,label:t,description:n,checked:r,onCheckedChange:s,disabled:i}){return h.jsxs("div",{className:"flex items-center justify-between py-4",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx(br,{htmlFor:e,className:"text-sm font-medium cursor-pointer",children:t}),h.jsx("p",{className:"text-xs text-muted-foreground",children:n})]}),h.jsx(Mq,{id:e,checked:r,onCheckedChange:s,disabled:i})]})}function Lke(){const{t:e}=kt(),{data:t,isLoading:n}=gke(),r=bke(),s=async(o,a)=>{if(!t)return;const l={...t,[o]:a};try{await r.mutateAsync(l),or.success(e("settings.notifications.saved"))}catch{or.error(e("settings.notifications.error"))}};if(n)return h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(yr,{className:"h-5 w-40"}),h.jsx(yr,{className:"h-4 w-64 mt-1"})]}),h.jsx(Kn,{className:"space-y-4",children:[1,2,3,4].map(o=>h.jsx(yr,{className:"h-14 w-full"},o))})]});const i=r.isPending;return h.jsx("div",{className:"space-y-6",children:h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx(_r,{children:e("settings.notifications.title")}),h.jsx(Xo,{children:e("settings.notifications.description")})]}),i&&h.jsx(Co,{className:"size-4 animate-spin text-muted-foreground"})]})}),h.jsx(Kn,{children:h.jsxs("div",{className:"divide-y",children:[h.jsx(mb,{id:"notif-content-create",label:e("settings.notifications.contentCreate.label"),description:e("settings.notifications.contentCreate.description"),checked:t?.contentCreate??!0,onCheckedChange:o=>s("contentCreate",o),disabled:i}),h.jsx(mb,{id:"notif-content-update",label:e("settings.notifications.contentUpdate.label"),description:e("settings.notifications.contentUpdate.description"),checked:t?.contentUpdate??!0,onCheckedChange:o=>s("contentUpdate",o),disabled:i}),h.jsx(mb,{id:"notif-content-delete",label:e("settings.notifications.contentDelete.label"),description:e("settings.notifications.contentDelete.description"),checked:t?.contentDelete??!0,onCheckedChange:o=>s("contentDelete",o),disabled:i}),h.jsx(mb,{id:"notif-media-upload",label:e("settings.notifications.mediaUpload.label"),description:e("settings.notifications.mediaUpload.description"),checked:t?.mediaUpload??!1,onCheckedChange:o=>s("mediaUpload",o),disabled:i})]})})]})})}function Pke({tab:e}){switch(e){case"profile":return h.jsx(yke,{});case"interface":return h.jsx(Cke,{});case"security":return h.jsx(Oke,{});case"storage":return h.jsx(zke,{});case"notifications":return h.jsx(Lke,{})}}function $ke(){const[e]=wx(),{t}=kt(),n=e.get("tab")??"profile",r=[{id:"profile",label:t("settings.tabs.profile"),icon:mee},{id:"interface",label:t("settings.tabs.interface"),icon:ij},{id:"security",label:t("settings.tabs.security"),icon:aj},{id:"storage",label:t("settings.tabs.storage"),icon:ZC},{id:"notifications",label:t("settings.tabs.notifications"),icon:Fh}],s=r.find(o=>o.id===n)??r[0],i=s.icon;return h.jsx("div",{className:"[--header-height:calc(--spacing(14))] min-h-screen bg-neutral-50/50 dark:bg-neutral-950/50",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("main",{className:"flex flex-1 flex-col gap-0 p-6 md:p-8 lg:p-10",children:h.jsxs("div",{className:"content-area-inner",children:[h.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[h.jsx(i,{className:"size-5 text-muted-foreground shrink-0"}),h.jsx("div",{children:h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s.label})})]}),h.jsx(Pke,{tab:n})]})})})]})]})})}function $E(){return is({queryKey:["schema"],queryFn:async()=>{const{data:e}=await mn.get("/api/schema");return e},staleTime:1e3*60*5})}function Oa({...e}){const{t}=kt(),{resolvedTheme:n}=$y(),{user:r}=Tx(),{data:s}=vq(),{data:i=[]}=$E(),o={name:s?.name??r?.name??"Admin",email:s?.email??r?.email??"",avatar:s?.avatarUrl??void 0},a=G6e(i,t("sidebar.contents"));return h.jsxs(N6e,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[h.jsx(M6e,{children:h.jsx(u2,{children:h.jsx(d2,{children:h.jsx(f2,{size:"lg",asChild:!0,children:h.jsxs("a",{href:"/",children:[h.jsx("div",{className:"flex aspect-square size-10 items-center justify-center rounded-lg overflow-hidden",children:h.jsx("img",{src:n==="dark"?"/admin/beechLogoDark.svg":"/admin/BeechLogoLIght.svg",alt:"BeechCMS",className:"size-10 object-contain"})}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:"Beech CMS"}),h.jsx("span",{className:"truncate text-xs",children:"Dashboard"})]})]})})})})}),h.jsxs(_6e,{children:[h.jsx(fO,{items:q6e(t),groupLabel:t("sidebar.navigation")}),a.map((l,u)=>h.jsx(fO,{items:l.items,groupLabel:l.label,className:u===0?"mt-4":void 0},l.label)),hO.length>0&&h.jsx(B6e,{items:hO,className:"mt-auto"})]}),h.jsx(T6e,{children:h.jsx(U6e,{user:o,onLogout:Dpe})})]})}function Yc(e,t){return typeof e=="function"?e(t):e}function Qi(e,t){return n=>{t.setState(r=>({...r,[e]:Yc(n,r[e])}))}}function p2(e){return e instanceof Function}function Bke(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Tq(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=t(i);o!=null&&o.length&&r(o)})};return r(e),n}function At(e,t,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((f,p)=>r[p]!==f)))return s;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),s=t(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-u)*100)/100,g=p/16,b=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${b(p,5)} /${b(f,5)} ms`,`
478
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=i=>{const o=F3(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=F3(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});on.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push($V.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(BV.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(GV.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(KV.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(YV.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ZV.configure(this.options.taskList)),e}});var hb="&nbsp;",K5=" ",ACe=ls.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",In(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===hb||n[0].text===hb||n[0].raw===K5||n[0].text===K5)&&r.length===1&&r[0].type==="text"&&(r[0].text===hb||r[0].text===K5)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,s;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(i.length===0){const o=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n?.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?hb:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OCe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,DCe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,jCe=aa.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",In(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ad({find:OCe,type:this.type})]},addPasteRules(){return[lu({find:DCe,type:this.type})]}}),ICe=ls.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),zCe=aa.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",In(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function LCe(e={}){return new zn({view(t){return new PCe(t,e)}})}class PCe{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(s=>{let i=o=>{this[s](o)};return t.dom.addEventListener(s,i),{name:s,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,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let p=t.nodeBefore,g=t.nodeAfter;if(p||g){let b=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(b){let y=b.getBoundingClientRect(),x=p?y.bottom:y.top;p&&g&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let S=this.width/2*a;r={left:y.left,right:y.right,top:x-S,bottom:x+S}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*o;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 u,f;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,f=-pageYOffset;else{let p=l.getBoundingClientRect(),g=p.width/l.offsetWidth,b=p.height/l.offsetHeight;u=p.left-l.scrollLeft*g,f=p.top-l.scrollTop*b}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-f)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"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),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,t):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=DF(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Pr extends $t{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Pr.valid(r)?new Pr(r):$t.near(r)}content(){return Je.empty}eq(t){return t instanceof Pr&&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 Pr(t.resolve(n.pos))}getBookmark(){return new LE(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!$Ce(t)||!BCe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Pr.valid(t))return t;let s=t.pos,i=null;for(let o=t.depth;;o--){let a=t.node(o);if(n>0?t.indexAfter(o)<a.childCount:t.index(o)>0){i=a.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=n;let l=t.doc.resolve(s);if(Pr.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!St.isSelectable(i)){t=t.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=t.doc.resolve(s);if(Pr.valid(a))return a}return null}}}Pr.prototype.visible=!1;Pr.findFrom=Pr.findGapCursorFrom;$t.jsonID("gapcursor",Pr);class LE{constructor(t){this.pos=t}map(t){return new LE(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Pr.valid(n)?new Pr(n):$t.near(n)}}function XV(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function $Ce(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 s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||XV(s.type))return!0;if(s.inlineContent)return!1}}return!0}function BCe(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 s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||XV(s.type))return!0;if(s.inlineContent)return!1}}return!0}function FCe(){return new zn({props:{decorations:qCe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Pr.valid(n)?new Pr(n):null},handleClick:UCe,handleKeyDown:HCe,handleDOMEvents:{beforeinput:VCe}}})}const HCe=Xk({ArrowLeft:pb("horiz",-1),ArrowRight:pb("horiz",1),ArrowUp:pb("vert",-1),ArrowDown:pb("vert",1)});function pb(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,s,i){let o=r.selection,a=t>0?o.$to:o.$from,l=o.empty;if(o instanceof Tt){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let u=Pr.findGapCursorFrom(a,t,l);return u?(s&&s(r.tr.setSelection(new Pr(u))),!0):!1}}function UCe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Pr.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&St.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Pr(r))),!0)}function VCe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Pr))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 s=Oe.empty;for(let o=r.length-1;o>=0;o--)s=Oe.from(r[o].createAndFill(null,s));let i=e.state.tr.replace(n.pos,n.pos,new Je(s,0,0));return i.setSelection(Tt.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function qCe(e){if(!(e.selection instanceof Pr))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ar.create(e.doc,[bs.widget(e.selection.head,t,{key:"gapcursor"})])}var yy=200,Ms=function(){};Ms.prototype.append=function(t){return t.length?(t=Ms.from(t),!this.length&&t||t.length<yy&&this.leafAppend(t)||this.length<yy&&t.leafPrepend(this)||this.appendInner(t)):this};Ms.prototype.prepend=function(t){return t.length?Ms.from(t).append(this):this};Ms.prototype.appendInner=function(t){return new GCe(this,t)};Ms.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Ms.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ms.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ms.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)};Ms.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(t(i,o))},n,r),s};Ms.from=function(t){return t instanceof Ms?t:t&&t.length?new QV(t):Ms.empty};var QV=(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(s,i){return s==0&&i==this.length?this:new t(this.values.slice(s,i))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,i,o,a){for(var l=i;l<o;l++)if(s(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(s,i,o,a){for(var l=i-1;l>=o;l--)if(s(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=yy)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=yy)return new t(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ms);Ms.empty=new QV([]);var GCe=(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 r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,i,o){var a=this.left.length;if(s<a&&this.left.forEachInner(r,s,Math.min(i,a),o)===!1||i>a&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(s,a),i,o)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,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})(Ms);const WCe=500;class Go{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 s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=t.tr,a,l,u=[],f=[];return this.items.forEach((p,g)=>{if(!p.step){s||(s=this.remapping(r,g+1),i=s.maps.length),i--,f.push(p);return}if(s){f.push(new ya(p.map));let b=p.step.map(s.slice(i)),y;b&&o.maybeStep(b).doc&&(y=o.mapping.maps[o.mapping.maps.length-1],u.push(new ya(y,void 0,void 0,u.length+f.length))),i--,y&&s.appendMap(y,i)}else o.maybeStep(p.step);if(p.selection)return a=s?p.selection.map(s.slice(i)):p.selection,l=new Go(this.items.slice(0,r).append(f.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(t,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let f=0;f<t.steps.length;f++){let p=t.steps[f].invert(t.docs[f]),g=new ya(t.mapping.maps[f],p,n),b;(b=l&&l.merge(g))&&(g=b,f?i.pop():a=a.slice(0,a.length-1)),i.push(g),n&&(o++,n=void 0),s||(l=g)}let u=o-r.depth;return u>YCe&&(a=KCe(a,u),o-=u),new Go(a.append(i),o)}remapping(t,n){let r=new om;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},t,n),r}addMaps(t){return this.eventCount==0?this:new Go(this.items.append(t.map(n=>new ya(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=t.mapping,o=t.steps.length,a=this.eventCount;this.items.forEach(g=>{g.selection&&a--},s);let l=n;this.items.forEach(g=>{let b=i.getMirror(--l);if(b==null)return;o=Math.min(o,b);let y=i.maps[b];if(g.step){let x=t.steps[b].invert(t.docs[b]),S=g.selection&&g.selection.map(i.slice(l+1,b));S&&a++,r.push(new ya(y,x,S))}else r.push(new ya(y))},s);let u=[];for(let g=n;g<o;g++)u.push(new ya(i.maps[g]));let f=this.items.slice(0,s).append(u).append(r),p=new Go(f,a);return p.emptyItemCount()>WCe&&(p=p.compress(this.items.length-r.length)),p}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,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=t)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let f=o.selection&&o.selection.map(n.slice(r));f&&i++;let p=new ya(u.invert(),l,f),g,b=s.length-1;(g=s.length&&s[b].merge(p))?s[b]=g:s.push(p)}}else o.map&&r--},this.items.length,0),new Go(Ms.from(s.reverse()),i)}}Go.empty=new Go(Ms.empty,0);function KCe(e,t){let n;return e.forEach((r,s)=>{if(r.selection&&t--==0)return n=s,!1}),e.slice(n)}class ya{constructor(t,n,r,s){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new ya(n.getMap().invert(),n,this.selection)}}}class Pc{constructor(t,n,r,s,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const YCe=20;function ZCe(e,t,n,r){let s=n.getMeta(gd),i;if(s)return s.historyState;n.getMeta(JCe)&&(e=new Pc(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(o&&o.getMeta(gd))return o.getMeta(gd).redo?new Pc(e.done.addTransform(n,void 0,r,Wb(t)),e.undone,lO(n.mapping.maps),e.prevTime,e.prevComposition):new Pc(e.done,e.undone.addTransform(n,void 0,r,Wb(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!o&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!XCe(n,e.prevRanges)),u=o?Y5(e.prevRanges,n.mapping):lO(n.mapping.maps);return new Pc(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,Wb(t)),Go.empty,u,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new Pc(e.done.rebased(n,i),e.undone.rebased(n,i),Y5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Pc(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function XCe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&s>=t[i]&&(n=!0)}),n}function lO(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,s,i,o)=>t.push(i,o));return t}function Y5(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),i=t.map(e[r+1],-1);s<=i&&n.push(s,i)}return n}function QCe(e,t,n){let r=Wb(t),s=gd.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),s,r),l=new Pc(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(gd,{redo:n,historyState:l})}let Z5=!1,cO=null;function Wb(e){let t=e.plugins;if(cO!=t){Z5=!1,cO=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Z5=!0;break}}return Z5}const gd=new Zn("history"),JCe=new Zn("closeHistory");function e6e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new zn({key:gd,state:{init(){return new Pc(Go.empty,Go.empty,null,0,-1)},apply(t,n,r){return ZCe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,s=r=="historyUndo"?eq:r=="historyRedo"?tq:null;return!s||!t.editable?!1:(n.preventDefault(),s(t.state,t.dispatch))}}}})}function JV(e,t){return(n,r)=>{let s=gd.getState(n);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(r){let i=QCe(s,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const eq=JV(!1,!0),tq=JV(!0,!0);on.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new zn({key:new Zn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const s=this.options.limit;if(s==null||s===0){e=!0;return}const i=this.storage.characters({node:r.doc});if(i>s){const o=i-s,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,l);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,l=i-r,u=a-l,f=a;return t.deleteRange(u,f),!(this.storage.characters({node:t.doc})>r)}})]}});var t6e=on.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[LCe(this.options)]}});on.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new zn({key:new Zn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=t,i=[];if(!n||!r)return ar.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((l,u)=>{if(l.isText)return;if(!(s>=u&&s<=u+l.nodeSize-1))return!1;o+=1});let a=0;return e.descendants((l,u)=>{if(l.isText||!(s>=u&&s<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(bs.node(u,u+l.nodeSize,{class:this.options.className}))}),ar.create(e,i)}}})]}});var n6e=on.create({name:"gapCursor",addProseMirrorPlugins(){return[FCe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=An(bt(e,"allowGapCursor",n)))!=null?t:null}}}),uO="placeholder";function r6e(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var s6e=on.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:uO,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${r6e(this.options.dataAttribute)}`:`data-${uO}`;return[new zn({key:new Zn("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n,i=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((a,l)=>{const u=s>=l&&s<=l+a.nodeSize,f=!a.isLeaf&&qx(a);if(!a.type.isTextblock)return this.options.includeChildren;if((u||!this.options.showOnlyCurrent)&&f){const p=[this.options.emptyNodeClass];o&&p.push(this.options.emptyEditorClass);const g=bs.node(l,l+a.nodeSize,{class:p.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(g)}return this.options.includeChildren}),ar.create(t,i)}}})]}}),i6e=on.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new zn({key:new Zn("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||YH(n.selection)||e.view.dragging?null:ar.create(n.doc,[bs.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}}),o6e="skipTrailingNode";function dO({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var a6e=on.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Zn(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new zn({key:t,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:u}=o,f=t.getState(o),p=a.content.size,g=u.nodes[n];if(!s.some(b=>b.getMeta(o6e))&&f)return l.insert(p,g.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!dO({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!dO({node:o,types:r})}}})]}}),l6e=on.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>eq(e,t),redo:()=>({state:e,dispatch:t})=>tq(e,t)}},addProseMirrorPlugins(){return[e6e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),nq=on.create({name:"starterKit",addExtensions(){var e,t,n,r;const s=[];return this.options.bold!==!1&&s.push(iCe.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(eCe.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push($V.configure(this.options.bulletList)),this.options.code!==!1&&s.push(lCe.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(LV.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(dCe.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(t6e.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(n6e.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(fCe.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(hCe.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(l6e.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(PV.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(vCe.configure(this.options.italic)),this.options.listItem!==!1&&s.push(BV.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(GV.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&s.push(EU.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&s.push(KV.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(ACe.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(jCe.configure(this.options.strike)),this.options.text!==!1&&s.push(ICe.configure(this.options.text)),this.options.underline!==!1&&s.push(zCe.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(a6e.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),c6e=nq;function u6e(){return[c6e.configure({link:!1,codeBlock:{HTMLAttributes:{class:"richtext-code-block"}}}),G4e.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),Q3e.configure({katexOptions:{throwOnError:!1}}),y4e,Z4e,K4e,w4e.configure({allowBase64:!1}),aSe.configure({types:["heading","paragraph"]}),$U.configure({resizable:!1}),PU,LU,zU]}function d6e(e){if(e==null||e==="")return null;if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const t=e;if(rve(e))return t.doc;if(t.type==="doc")return e}return null}function rq(e){const t=d6e(e);if(t==null)return"";if(typeof t=="string")return t;const n=u6e();return m4e(t,n)}function vC(e){return e.normalize("NFKD").replace(/[^\w\s-]/g,"").trim().toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,15)}function l2(e){const t=e.policies?.privacy??"plain",n=t!=="plain"?"hidden":"full";return{privacy:t,visibility:e.policies?.visibility??n,search:e.policies?.search??!0,filter:e.policies?.filter??!0,sort:e.policies?.sort??!0,public:e.policies?.public??!0}}const X5=768;function f6e(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${X5-1}px)`),r=()=>{t(window.innerWidth<X5)};return n.addEventListener("change",r),t(window.innerWidth<X5),()=>n.removeEventListener("change",r)},[]),!!e}function h6e({...e}){return h.jsx(Gy,{"data-slot":"sheet",...e})}function p6e({...e}){return h.jsx(Wy,{"data-slot":"sheet-portal",...e})}function m6e({className:e,...t}){return h.jsx(Ky,{"data-slot":"sheet-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function g6e({className:e,children:t,side:n="right",showCloseButton:r=!0,...s}){return h.jsxs(p6e,{children:[h.jsx(m6e,{}),h.jsxs(Yy,{"data-slot":"sheet-content",className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...s,children:[t,r&&h.jsxs(Om,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[h.jsx(ja,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function b6e({className:e,...t}){return h.jsx("div",{"data-slot":"sheet-header",className:ee("flex flex-col gap-1.5 p-4",e),...t})}function v6e({className:e,...t}){return h.jsx(l6,{"data-slot":"sheet-title",className:ee("text-foreground font-semibold",e),...t})}function y6e({className:e,...t}){return h.jsx(c6,{"data-slot":"sheet-description",className:ee("text-muted-foreground text-sm",e),...t})}function yr({className:e,...t}){return h.jsx("div",{"data-slot":"skeleton",className:ee("bg-accent animate-pulse rounded-md",e),...t})}const x6e="sidebar_state",w6e=3600*24*7,S6e="16rem",C6e="18rem",k6e="3rem",E6e="b",sq=w.createContext(null);function c2(){const e=w.useContext(sq);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Ta({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...o}){const a=f6e(),[l,u]=w.useState(!1),[f,p]=w.useState(e),g=t??f,b=w.useCallback(k=>{const N=typeof k=="function"?k(g):k;n?n(N):p(N),document.cookie=`${x6e}=${N}; path=/; max-age=${w6e}`},[n,g]),y=w.useCallback(()=>a?u(k=>!k):b(k=>!k),[a,b,u]);w.useEffect(()=>{const k=N=>{N.key===E6e&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),y())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[y]);const x=g?"expanded":"collapsed",S=w.useMemo(()=>({state:x,open:g,setOpen:b,isMobile:a,openMobile:l,setOpenMobile:u,toggleSidebar:y}),[x,g,b,a,l,u,y]);return h.jsx(sq.Provider,{value:S,children:h.jsx(o$,{delayDuration:0,children:h.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":S6e,"--sidebar-width-icon":k6e,...s},className:ee("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...o,children:i})})})}function N6e({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:o,state:a,openMobile:l,setOpenMobile:u}=c2();return n==="none"?h.jsx("div",{"data-slot":"sidebar",className:ee("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):o?h.jsx(h6e,{open:l,onOpenChange:u,...i,children:h.jsxs(g6e,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":C6e},side:e,children:[h.jsxs(b6e,{className:"sr-only",children:[h.jsx(v6e,{children:"Sidebar"}),h.jsx(y6e,{children:"Displays the mobile sidebar."})]}),h.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):h.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":a,"data-collapsible":a==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[h.jsx("div",{"data-slot":"sidebar-gap",className:ee("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),h.jsx("div",{"data-slot":"sidebar-container",className:ee("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:h.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function _a({className:e,...t}){return h.jsx("main",{"data-slot":"sidebar-inset",className:ee("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function M6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ee("flex flex-col gap-2 p-2",e),...t})}function T6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ee("flex flex-col gap-2 p-2",e),...t})}function _6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ee("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function iq({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ee("relative flex w-full min-w-0 flex-col p-2",e),...t})}function R6e({className:e,asChild:t=!1,...n}){const r=t?$d:"div";return h.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ee("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function A6e({className:e,...t}){return h.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ee("w-full text-sm",e),...t})}function u2({className:e,...t}){return h.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ee("flex w-full min-w-0 flex-col gap-1",e),...t})}function d2({className:e,...t}){return h.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ee("group/menu-item relative",e),...t})}const O6e=Ud("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f2({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o}){const a=e?$d:"button",{isMobile:l,state:u}=c2(),f=h.jsx(a,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ee(O6e({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:f}),h.jsx(Va,{side:"right",align:"center",hidden:u!=="collapsed"||l,...s})]})):f}function D6e({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const s=t?$d:"button";return h.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:ee("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function j6e({className:e,...t}){return h.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ee("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function I6e({className:e,...t}){return h.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ee("group/menu-sub-item relative",e),...t})}function z6e({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...s}){const i=e?$d:"a";return h.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:ee("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})}function L6e({...e}){return h.jsx(wte,{"data-slot":"collapsible",...e})}function P6e({...e}){return h.jsx(vj,{"data-slot":"collapsible-trigger",...e})}function $6e({...e}){return h.jsx(yj,{"data-slot":"collapsible-content",...e})}function fO({items:e,groupLabel:t="Menu",className:n}){const r=to(),s=r.pathname,i=r.search;return h.jsxs(iq,{className:n,children:[h.jsx(R6e,{children:t}),h.jsx(u2,{children:e.map(o=>{const a=o.items?.length?s===o.url||s.startsWith(o.url+"/")||s.startsWith(o.url+"?"):s===o.url;return h.jsx(L6e,{asChild:!0,defaultOpen:o.isActive||a,children:h.jsxs(d2,{children:[h.jsx(f2,{asChild:!0,tooltip:o.title,isActive:a&&!o.items?.length,children:h.jsxs(gs,{to:o.url,children:[h.jsx(o.icon,{}),h.jsx("span",{children:o.title})]})}),o.items?.length?h.jsxs(h.Fragment,{children:[h.jsx(P6e,{asChild:!0,children:h.jsxs(D6e,{className:"data-[state=open]:rotate-90",children:[h.jsx(Pd,{}),h.jsx("span",{className:"sr-only",children:"Toggle"})]})}),h.jsx($6e,{children:h.jsx(j6e,{children:o.items?.map(l=>{const[u,f]=l.url.split("?"),p=f?`?${f}`:"",g=s===u&&(p===""||i===p);return h.jsx(I6e,{children:h.jsx(z6e,{asChild:!0,isActive:g,children:h.jsx(gs,{to:l.url,children:h.jsx("span",{children:l.title})})})},l.title)})})})]}):null]})},o.title)})})]})}function B6e({items:e,...t}){return h.jsx(iq,{...t,children:h.jsx(A6e,{children:h.jsx(u2,{children:e.map(n=>h.jsx(d2,{children:h.jsx(f2,{asChild:!0,size:"sm",children:h.jsxs("a",{href:n.url,children:[h.jsx(n.icon,{}),h.jsx("span",{children:n.title})]})})},n.title))})})})}function jd({className:e,size:t="default",...n}){return h.jsx(sre,{"data-slot":"avatar","data-size":t,className:ee("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",e),...n})}function vm({className:e,...t}){return h.jsx(ire,{"data-slot":"avatar-image",className:ee("aspect-square size-full",e),...t})}function Id({className:e,...t}){return h.jsx(ore,{"data-slot":"avatar-fallback",className:ee("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",e),...t})}function Ao({...e}){return h.jsx(Yie,{"data-slot":"dropdown-menu",...e})}function $f({...e}){return h.jsx(uL,{"data-slot":"dropdown-menu-portal",...e})}function Oo({...e}){return h.jsx(Zie,{"data-slot":"dropdown-menu-trigger",...e})}function Do({className:e,sideOffset:t=4,...n}){return h.jsx(uL,{children:h.jsx(Xie,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function _p({...e}){return h.jsx(Qie,{"data-slot":"dropdown-menu-group",...e})}function Ra({className:e,inset:t,variant:n="default",...r}){return h.jsx(eoe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ee("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function F6e({...e}){return h.jsx(toe,{"data-slot":"dropdown-menu-radio-group",...e})}function Q5({className:e,children:t,...n}){return h.jsxs(noe,{"data-slot":"dropdown-menu-radio-item",className:ee("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:h.jsx(roe,{children:h.jsx(DX,{className:"size-2 fill-current"})})}),t]})}function ks({className:e,inset:t,...n}){return h.jsx(Jie,{"data-slot":"dropdown-menu-label","data-inset":t,className:ee("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function ri({className:e,...t}){return h.jsx(soe,{"data-slot":"dropdown-menu-separator",className:ee("-mx-1 my-1 h-px bg-border",e),...t})}function Bf({...e}){return h.jsx(ioe,{"data-slot":"dropdown-menu-sub",...e})}function Ff({className:e,inset:t,children:n,...r}){return h.jsxs(ooe,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ee("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,h.jsx(Pd,{className:"ml-auto size-4"})]})}function Hf({className:e,...t}){return h.jsx(aoe,{"data-slot":"dropdown-menu-sub-content",className:ee("z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...t})}function H6e(e,t){return e&&e.length>=2?e.slice(0,2).toUpperCase():t&&t.length>=2?t.slice(0,2).toUpperCase():"??"}function U6e({user:e,onLogout:t}){const{isMobile:n}=c2(),r=zo(),s=H6e(e.name,e.email);return h.jsx(u2,{children:h.jsx(d2,{children:h.jsxs(Ao,{children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(f2,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[h.jsxs(jd,{className:"h-8 w-8 rounded-lg",children:[h.jsx(vm,{src:e.avatar,alt:e.name}),h.jsx(Id,{className:"rounded-lg",children:s})]}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:e.name}),h.jsx("span",{className:"truncate text-xs",children:e.email})]}),h.jsx(xX,{className:"ml-auto size-4"})]})}),h.jsxs(Do,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:n?"bottom":"right",align:"end",sideOffset:4,children:[h.jsx(ks,{className:"p-0 font-normal",children:h.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[h.jsxs(jd,{className:"h-8 w-8 rounded-lg",children:[h.jsx(vm,{src:e.avatar,alt:e.name}),h.jsx(Id,{className:"rounded-lg",children:s})]}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:e.name}),h.jsx("span",{className:"truncate text-xs",children:e.email})]})]})}),h.jsx(ri,{}),h.jsx(_p,{children:h.jsxs(Ra,{onClick:()=>r("/settings"),children:[h.jsx(WZ,{}),"Account"]})}),h.jsx(ri,{}),h.jsxs(Ra,{onClick:()=>t?.(),children:[h.jsx(HQ,{}),"Log out"]})]})]})})})}const V6e={Folder:QD,Newspaper:lJ,ShoppingBag:$J,Users:bee,MessageSquare:ZQ,Layout:bJ,UserCircle:_X,Mail:VQ,FileText:Qb,Image:Tm,Video:yee,Music:oJ,Tag:XJ,Bookmark:nX,Star:qJ,Heart:gQ,Globe:ej,Link:OS,Calendar:KC,Clock:Gf,Map:KQ,MapPin:GQ,Package:fJ,Box:sX,Archive:OZ,Database:YC,Settings:_m,Wrench:kee,Code:$X,Terminal:JJ,Book:eX,BookOpen:QZ,GraduationCap:cQ,Award:qZ,Trophy:oee,Flag:sQ,Layers:tj,Grid:dQ,List:LQ,Table:cj,BarChart:fX,PieChart:qD,TrendingUp:QC,Activity:Tl,Zap:e6,Shield:aj,Lock:BQ,Key:MQ,Bell:Fh,Phone:SJ,Camera:VD,Mic:QQ,Monitor:rj,Cpu:FX,HardDrive:ZC,Wifi:uj,Home:vQ,Building:lX,Store:WJ,Briefcase:oX,DollarSign:GX,CreditCard:UX,ShoppingCart:FJ,Truck:lee,Percent:xJ,Hash:pQ,AtSign:UZ,Info:XC,HelpCircle:MX,AlertCircle:KD,CheckCircle:ZD};function PE(e){return e&&V6e[e]||QD}function q6e(e){return[{title:"Dashboard",url:"/",icon:nj,isActive:!0},{title:e("settings.title"),url:"/settings",icon:_m,items:[{title:e("settings.tabs.profile"),url:"/settings?tab=profile"},{title:e("settings.tabs.interface"),url:"/settings?tab=interface"},{title:e("settings.tabs.security"),url:"/settings?tab=security"},{title:e("settings.tabs.storage"),url:"/settings?tab=storage"},{title:e("settings.tabs.notifications"),url:"/settings?tab=notifications"}]}]}function G6e(e,t){const n=e.filter(s=>!s.dashboard?.hidden),r=new Map;for(const s of n){const i=s.dashboard?.group??t,o=r.get(i)??[];o.push(s),r.set(i,o)}return Array.from(r.entries()).map(([s,i])=>({label:s,items:i.sort((o,a)=>(o.dashboard?.order??99)-(a.dashboard?.order??99)).map(o=>({title:o.labelPlural??o.label,url:`/content/${o.slug}`,icon:PE(o.dashboard?.icon)}))}))}const hO=[];function W6e({...e}){return h.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function K6e({className:e,...t}){return h.jsx("ol",{"data-slot":"breadcrumb-list",className:ee("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Y6e({className:e,...t}){return h.jsx("li",{"data-slot":"breadcrumb-item",className:ee("inline-flex items-center gap-1.5",e),...t})}function Z6e({asChild:e,className:t,...n}){const r=e?$d:"a";return h.jsx(r,{"data-slot":"breadcrumb-link",className:ee("hover:text-foreground transition-colors",t),...n})}function X6e({className:e,...t}){return h.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ee("text-foreground font-normal",e),...t})}function Q6e({children:e,className:t,...n}){return h.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ee("[&>svg]:size-3.5",t),...n,children:e??h.jsx(Pd,{})})}function oq({...e}){return h.jsx(Eie,{"data-slot":"context-menu",...e})}function aq({...e}){return h.jsx(Nie,{"data-slot":"context-menu-trigger",...e})}function lq({className:e,...t}){return h.jsx(Mie,{children:h.jsx(Tie,{"data-slot":"context-menu-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function ld({className:e,inset:t,variant:n="default",...r}){return h.jsx(Rie,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function J6e({className:e,inset:t,...n}){return h.jsx(_ie,{"data-slot":"context-menu-label","data-inset":t,className:ee("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function cq({className:e,...t}){return h.jsx(Aie,{"data-slot":"context-menu-separator",className:ee("bg-border -mx-1 my-1 h-px",e),...t})}function uq({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:ee("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function dq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:ee("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const eke=Ud("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function fq({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:ee(eke({variant:t,className:e})),...n})}function hq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:ee("text-lg font-medium tracking-tight",e),...t})}function pq({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:ee("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function sg({...e}){return h.jsx(xoe,{"data-slot":"popover",...e})}function ig({...e}){return h.jsx(woe,{"data-slot":"popover-trigger",...e})}function og({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(Soe,{children:h.jsx(Coe,{"data-slot":"popover-content",align:t,sideOffset:n,className:ee("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}const mq=Ud("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});function gq({className:e,variant:t,size:n,...r}){return h.jsx(Hae,{"data-slot":"toggle",className:ee(mq({variant:t,size:n,className:e})),...r})}const bq=w.createContext({size:"default",variant:"default",spacing:0});function h2({className:e,variant:t,size:n,spacing:r=0,children:s,...i}){return h.jsx(Wae,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:ee("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:h.jsx(bq.Provider,{value:{variant:t,size:n,spacing:r},children:s})})}function bd({className:e,children:t,variant:n,size:r,...s}){const i=w.useContext(bq);return h.jsx(Kae,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:ee(mq({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...s,children:t})}const tke={info:XC,success:ZD,warning:JC,error:AX};function nke(){const e=ia(),[t,n]=w.useState("all"),{data:r=[],isLoading:s}=is({queryKey:["notifications"],queryFn:async()=>{const{data:S}=await Zt.get("/content/notifications");return S},refetchInterval:300*1e3,staleTime:60*1e3,refetchOnWindowFocus:!0}),i=r.map(S=>({id:S.id,title:S.title,description:S.message,icon:tke[S.type]||Fh,isNew:S.is_read===0,createdAt:new Date(S.created_at*1e3)})),o=Ei({mutationFn:async S=>{await Zt.patch(`/content/notifications/${S}/read`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),a=Ei({mutationFn:async S=>{await Zt.patch(`/content/notifications/${S}/unread`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),l=Ei({mutationFn:async S=>{await Zt.delete(`/content/notifications/${S}`)},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),u=Ei({mutationFn:async()=>{await Zt.post("/content/notifications/mark-all-read")},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),f=t==="new"?i.filter(S=>S.isNew):i,p=S=>{o.mutate(S)},g=S=>{a.mutate(S)},b=S=>{l.mutate(S)},y=i.some(S=>S.isNew),x=i.filter(S=>S.isNew).length;return{notifications:f,isLoading:s,filter:t,setFilter:n,hasUnreadNotifications:y,unreadCount:x,handleMarkSeen:p,handleMarkUnseen:g,handleDelete:b,handleMarkAllRead:()=>u.mutate()}}const rke=320;function ske({notifications:e,filter:t,onMarkSeen:n,onMarkUnseen:r,onDelete:s}){const{t:i}=kt();return h.jsx("div",{className:"space-y-3 p-2",children:e.length===0?h.jsx(uq,{className:"border-0 p-6",children:h.jsxs(dq,{children:[h.jsx(fq,{variant:"icon",children:h.jsx(Fh,{className:"size-6"})}),h.jsx(hq,{children:i("notifications.noNotifications")}),h.jsx(pq,{children:i(t==="new"?"notifications.noNotificationsNew":"notifications.noNotificationsAll")})]})}):e.map(o=>h.jsx(ike,{notification:o,onMarkSeen:n,onMarkUnseen:r,onDelete:s},o.id))})}function ike({notification:e,onMarkSeen:t,onMarkUnseen:n,onDelete:r}){const{t:s}=kt(),i=e.icon;return h.jsxs(oq,{modal:!1,children:[h.jsx(aq,{asChild:!0,children:h.jsxs("button",{type:"button",onClick:()=>{e.isNew&&t(e.id)},className:ee("relative flex items-center gap-3 rounded-lg border bg-card p-3 transition-colors text-left","hover:bg-muted/50",e.isNew?"cursor-pointer":"cursor-context-menu"),children:[e.isNew&&h.jsx("span",{className:"absolute right-2 top-2 inline-block size-2 shrink-0 rounded-full bg-destructive aspect-square","aria-hidden":!0}),h.jsx("div",{className:"bg-muted flex size-11 shrink-0 items-center justify-center rounded-full",children:h.jsx(i,{className:"text-muted-foreground size-5"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"font-medium",children:e.title}),h.jsx("p",{className:"text-muted-foreground line-clamp-2 text-sm",children:e.description})]})]})}),h.jsxs(lq,{children:[e.isNew?h.jsxs(ld,{onClick:()=>t(e.id),children:[h.jsx(Fh,{className:"size-4"}),s("notifications.markSeen")]}):h.jsxs(ld,{onClick:()=>n(e.id),children:[h.jsx(vh,{className:"size-4"}),s("notifications.markUnseen")]}),h.jsx(cq,{}),h.jsxs(ld,{variant:"destructive",onClick:()=>r(e.id),children:[h.jsx(Hh,{className:"size-4"}),s("notifications.delete")]})]})]})}function oke(e){const t=new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,view:globalThis,clientX:0,clientY:0});e.dispatchEvent(t)}function ake(){const{t:e}=kt(),{notifications:t,filter:n,setFilter:r,hasUnreadNotifications:s,unreadCount:i,handleMarkSeen:o,handleMarkUnseen:a,handleDelete:l,handleMarkAllRead:u}=nke(),f=w.useCallback(p=>{const g=p.currentTarget;g&&oke(g)},[]);return h.jsxs(sg,{children:[h.jsx(ig,{asChild:!0,children:h.jsxs(He,{className:"relative ml-auto h-8 w-8",variant:"ghost",size:"icon","aria-label":e("notifications.ariaLabel"),children:[h.jsx(Fh,{className:"size-4"}),s&&h.jsx("span",{className:"absolute bottom-0.5 right-0.5 size-2 rounded-full bg-destructive","aria-hidden":!0}),h.jsx("span",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:s?e("notifications.unreadCount",{count:i}):e("notifications.noUnread")})]})}),h.jsxs(og,{align:"end",side:"bottom",className:"w-80 p-0 sm:w-96",children:[h.jsxs("div",{className:"border-b px-4 py-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"font-semibold",children:e("notifications.title")}),s&&h.jsx(He,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>u(),children:e("notifications.markAllRead")})]}),h.jsxs(h2,{type:"single",value:n,onValueChange:p=>p&&r(p),variant:"outline",className:"mt-2 w-full justify-start",children:[h.jsx(bd,{value:"all",className:"flex-1",children:e("notifications.all")}),h.jsx(bd,{value:"new",className:"flex-1",children:e("notifications.new")})]})]}),h.jsx("div",{style:{height:rke},className:"overflow-y-auto overflow-x-hidden",onScroll:f,onWheel:f,children:h.jsx(ske,{notifications:t,filter:n,onMarkSeen:o,onMarkUnseen:a,onDelete:l})})]})]})}function lke(){const{t:e}=kt(),{pathname:t}=to(),[n]=wx();if(t==="/settings"){const s=n.get("tab")??"profile",i=e(`settings.tabs.${s}`,{defaultValue:s});return[{label:"Beech CMS",href:"/"},{label:e("siteHeader.settings"),href:"/settings"},{label:i}]}const r=t.match(/^\/content\/([^/]+)(?:\/(.+))?$/);if(r){const s=r[1],i=r[2],o=Object.values(Ek).find(u=>u.slug===s),a=o?.labelPlural??o?.label??s,l=[{label:"Beech CMS",href:"/"},{label:e("siteHeader.contents"),href:`/content/${s}`},{label:a,href:i?`/content/${s}`:void 0}];return i==="create"?l.push({label:e("siteHeader.new")}):i&&l.push({label:e("siteHeader.edit")}),l}return t==="/"?[{label:"Beech CMS",href:"/"},{label:"Dashboard"}]:[{label:"Beech CMS",href:"/"}]}function Aa(){const{toggleSidebar:e}=c2(),t=lke();return h.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:h.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[h.jsx(He,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:h.jsx(mJ,{})}),h.jsx(Hi,{orientation:"vertical",className:"mr-2 h-4"}),h.jsx(W6e,{className:"hidden sm:block",children:h.jsx(K6e,{children:t.map((n,r)=>{const s=r===t.length-1;return h.jsxs(w.Fragment,{children:[h.jsx(Y6e,{children:!s&&n.href?h.jsx(Z6e,{asChild:!0,children:h.jsx(gs,{to:n.href,children:n.label})}):h.jsx(X6e,{children:n.label})}),!s&&h.jsx(Q6e,{})]},r)})})}),h.jsx(ake,{})]})})}const ra={getProfile:async()=>{const{data:e}=await Zt.get("/settings/me");return e},updateProfile:async e=>{await Zt.put("/settings/profile",e)},changePassword:async e=>{await Zt.put("/settings/password",e)},updateAvatar:async e=>{await Zt.put("/settings/avatar",{avatarUrl:e})},uploadAvatar:async e=>{const t=new FormData;t.append("file",e);const{data:n}=await Zt.post("/upload",t);return n.url},getSessions:async()=>{const{data:e}=await Zt.get("/settings/sessions");return e},revokeSession:async e=>{await Zt.delete(`/settings/sessions/${e}`)},getActivity:async()=>{const{data:e}=await Zt.get("/settings/activity");return e},getStorage:async()=>{const{data:e}=await Zt.get("/settings/storage");return e},getNotifications:async()=>{const{data:e}=await Zt.get("/settings/notifications");return e},updateNotifications:async e=>{await Zt.put("/settings/notifications",e)}},Ci={all:["settings"],profile:()=>[...Ci.all,"profile"],sessions:()=>[...Ci.all,"sessions"],activity:()=>[...Ci.all,"activity"],storage:()=>[...Ci.all,"storage"],notifications:()=>[...Ci.all,"notifications"]};function vq(){return is({queryKey:Ci.profile(),queryFn:ra.getProfile,staleTime:300*1e3})}function cke(){const e=ia();return Ei({mutationFn:ra.updateProfile,onSuccess:()=>e.invalidateQueries({queryKey:Ci.profile()})})}function uke(){return Ei({mutationFn:ra.changePassword})}function dke(){const e=ia();return Ei({mutationFn:async t=>{const n=await ra.uploadAvatar(t);return await ra.updateAvatar(n),n},onSuccess:()=>e.invalidateQueries({queryKey:Ci.profile()})})}function fke(){return is({queryKey:Ci.sessions(),queryFn:ra.getSessions,staleTime:60*1e3})}function hke(){const e=ia();return Ei({mutationFn:ra.revokeSession,onSuccess:()=>e.invalidateQueries({queryKey:Ci.sessions()})})}function pke(){return is({queryKey:Ci.activity(),queryFn:ra.getActivity,staleTime:60*1e3})}function mke(){return is({queryKey:Ci.storage(),queryFn:ra.getStorage,staleTime:300*1e3})}function gke(){return is({queryKey:Ci.notifications(),queryFn:ra.getNotifications,staleTime:300*1e3})}function bke(){const e=ia();return Ei({mutationFn:t=>ra.updateNotifications(t),onSuccess:()=>e.invalidateQueries({queryKey:Ci.notifications()})})}function vke(e,t){return e?e.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2):t.slice(0,2).toUpperCase()}function yke(){const{t:e}=kt(),{data:t,isLoading:n}=vq(),r=cke(),s=uke(),i=dke(),o=w.useRef(null),[a,l]=w.useState(""),[u,f]=w.useState(""),[p,g]=w.useState(""),[b,y]=w.useState(""),[x,S]=w.useState("");w.useEffect(()=>{t&&(l(t.name??""),f(t.email))},[t]);const k=async R=>{R.preventDefault();try{await r.mutateAsync({name:a||void 0,email:u||void 0}),or.success(e("settings.profile.savedSuccess"))}catch(_){const A=_?.response?.data?.detail??e("settings.profile.savedError");or.error(A)}},N=async R=>{if(R.preventDefault(),b!==x){or.error(e("settings.profile.passwordMismatch"));return}try{await s.mutateAsync({currentPassword:p,newPassword:b}),or.success(e("settings.profile.passwordSuccess")),g(""),y(""),S("")}catch(_){const A=_?.response?.data?.detail??e("settings.profile.passwordError");or.error(A)}},T=async R=>{const _=R.target.files?.[0];if(_){try{await i.mutateAsync(_),or.success(e("settings.profile.avatarSuccess"))}catch{or.error(e("settings.profile.avatarError"))}R.target.value=""}};return n?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Co,{className:"size-6 animate-spin text-muted-foreground"})}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.profile.infoTitle")}),h.jsx(Xo,{children:e("settings.profile.infoDesc")})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:k,className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsxs(jd,{className:"size-20",children:[h.jsx(vm,{src:t?.avatarUrl??void 0}),h.jsx(Id,{className:"text-lg",children:vke(t?.name??null,t?.email??"")})]}),h.jsx("button",{type:"button",onClick:()=>o.current?.click(),disabled:i.isPending,className:"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:i.isPending?h.jsx(Co,{className:"size-5 text-white animate-spin"}):h.jsx(VD,{className:"size-5 text-white"})})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium",children:t?.name??e("settings.profile.noName")}),h.jsx("p",{className:"text-sm text-muted-foreground",children:t?.email}),h.jsx("button",{type:"button",onClick:()=>o.current?.click(),className:"text-xs text-primary mt-1 hover:underline",children:e("settings.profile.changePhoto")})]}),h.jsx("input",{ref:o,type:"file",accept:"image/*",className:"hidden",onChange:T})]}),h.jsx(Hi,{}),h.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"name",children:e("settings.profile.nameLabel")}),h.jsx(pn,{id:"name",value:a,onChange:R=>l(R.target.value),placeholder:e("settings.profile.namePlaceholder")})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"email",children:e("settings.profile.emailLabel")}),h.jsx(pn,{id:"email",type:"email",value:u,onChange:R=>f(R.target.value),placeholder:e("settings.profile.emailPlaceholder")})]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(He,{type:"submit",disabled:r.isPending,children:[r.isPending&&h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("settings.profile.saveChanges")]})})]})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.profile.passwordTitle")}),h.jsx(Xo,{children:e("settings.profile.passwordDesc")})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:N,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"current-password",children:e("settings.profile.currentPassword")}),h.jsx(pn,{id:"current-password",type:"password",value:p,onChange:R=>g(R.target.value),autoComplete:"current-password"})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"new-password",children:e("settings.profile.newPassword")}),h.jsx(pn,{id:"new-password",type:"password",value:b,onChange:R=>y(R.target.value),autoComplete:"new-password"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"confirm-password",children:e("settings.profile.confirmPassword")}),h.jsx(pn,{id:"confirm-password",type:"password",value:x,onChange:R=>S(R.target.value),autoComplete:"new-password"})]})]}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(He,{type:"submit",variant:"outline",disabled:s.isPending,children:[s.isPending&&h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("settings.profile.updatePassword")]})})]})})]})]})}function Ul({...e}){return h.jsx(pae,{"data-slot":"select",...e})}function hu({...e}){return h.jsx(gae,{"data-slot":"select-value",...e})}function Vl({className:e,size:t="default",children:n,...r}){return h.jsxs(mae,{"data-slot":"select-trigger","data-size":t,className:ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(bae,{asChild:!0,children:h.jsx(Mm,{className:"size-4 opacity-50"})})]})}function ql({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return h.jsx(vae,{children:h.jsxs(yae,{"data-slot":"select-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...s,children:[h.jsx(xke,{}),h.jsx(xae,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(wke,{})]})})}function Eo({className:e,children:t,...n}){return h.jsxs(wae,{"data-slot":"select-item",className:ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(Cae,{children:h.jsx(td,{className:"size-4"})})}),h.jsx(Sae,{children:t})]})}function xke({className:e,...t}){return h.jsx(kae,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(WD,{className:"size-4"})})}function wke({className:e,...t}){return h.jsx(Eae,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(Mm,{className:"size-4"})})}const pO="beech_rows_per_page",Ske=[{value:"it",label:"Italiano"},{value:"en",label:"English"}];function Cke(){const{theme:e,setTheme:t}=$y(),{t:n,i18n:r}=kt(),[s,i]=w.useState(()=>localStorage.getItem(pO)??"20"),[o,a]=w.useState(!1);w.useEffect(()=>{a(!0)},[]);const l=[{value:"light",label:n("settings.interface.themeLight"),icon:lj},{value:"dark",label:n("settings.interface.themeDark"),icon:sj},{value:"system",label:n("settings.interface.themeSystem"),icon:rj}],u=[{value:"10",label:n("settings.interface.rows10")},{value:"20",label:n("settings.interface.rows20")},{value:"50",label:n("settings.interface.rows50")},{value:"100",label:n("settings.interface.rows100")}],f=g=>{i(g),localStorage.setItem(pO,g),or.success(n("settings.interface.rowsSaved"))},p=g=>{r.changeLanguage(g),or.success(n(g==="it"?"settings.interface.langChangedIt":"settings.interface.langChangedEn"))};return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.themeTitle")}),h.jsx(Xo,{children:n("settings.interface.themeDesc")})]}),h.jsx(Kn,{children:h.jsx("div",{className:"grid grid-cols-3 gap-3",children:l.map(({value:g,label:b,icon:y})=>h.jsxs("button",{type:"button",onClick:()=>t(g),className:`flex flex-col items-center gap-2 rounded-lg border-2 p-4 transition-colors cursor-pointer ${o&&e===g?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[h.jsx(y,{className:"size-5 text-muted-foreground"}),h.jsx("span",{className:"text-sm font-medium",children:b})]},g))})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.langTitle")}),h.jsx(Xo,{children:n("settings.interface.langDesc")})]}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"language",children:n("settings.interface.langLabel")}),h.jsxs(Ul,{value:r.language,onValueChange:p,children:[h.jsx(Vl,{id:"language",className:"w-full sm:w-64",children:h.jsx(hu,{})}),h.jsx(ql,{children:Ske.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]})]})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:n("settings.interface.rowsTitle")}),h.jsx(Xo,{children:n("settings.interface.rowsDesc")})]}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"rows",children:n("settings.interface.rowsLabel")}),h.jsxs(Ul,{value:s,onValueChange:f,children:[h.jsx(Vl,{id:"rows",className:"w-full sm:w-64",children:h.jsx(hu,{})}),h.jsx(ql,{children:u.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]})]})})]})]})}const kke=Ud("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border dark:border-white/20 text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function _i({className:e,variant:t="default",asChild:n=!1,...r}){const s=n?$d:"span";return h.jsx(s,{"data-slot":"badge","data-variant":t,className:ee(kke({variant:t}),e),...r})}function Gl({className:e,children:t,onScroll:n,...r}){return h.jsxs(Hoe,{"data-slot":"scroll-area",className:ee("relative",e),...r,children:[h.jsx(Uoe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",onScroll:n,children:t}),h.jsx(Eke,{}),h.jsx(Voe,{})]})}function Eke({className:e,orientation:t="vertical",...n}){return h.jsx(AL,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ee("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(IL,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function yq({...e}){return h.jsx(Une,{"data-slot":"alert-dialog",...e})}function Nke({...e}){return h.jsx(Vne,{"data-slot":"alert-dialog-trigger",...e})}function Mke({...e}){return h.jsx(qne,{"data-slot":"alert-dialog-portal",...e})}function Tke({className:e,...t}){return h.jsx(Gne,{"data-slot":"alert-dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function xq({className:e,size:t="default",...n}){return h.jsxs(Mke,{children:[h.jsx(Tke,{}),h.jsx(Wne,{"data-slot":"alert-dialog-content","data-size":t,className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...n})]})}function wq({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:ee("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Sq({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:ee("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Cq({className:e,...t}){return h.jsx(Zne,{"data-slot":"alert-dialog-title",className:ee("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function kq({className:e,...t}){return h.jsx(Xne,{"data-slot":"alert-dialog-description",className:ee("text-muted-foreground text-sm",e),...t})}function Eq({className:e,variant:t="default",size:n="default",...r}){return h.jsx(He,{variant:t,size:n,asChild:!0,children:h.jsx(Kne,{"data-slot":"alert-dialog-action",className:ee(e),...r})})}function Nq({className:e,variant:t="outline",size:n="default",...r}){return h.jsx(He,{variant:t,size:n,asChild:!0,children:h.jsx(Yne,{"data-slot":"alert-dialog-cancel",className:ee(e),...r})})}const _ke={create:"default",update:"secondary",delete:"destructive",upload:"outline"};function yC(e){return new Date(e*1e3).toLocaleString("it-IT",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Rke({session:e,onRevoke:t}){const{t:n}=kt(),[r,s]=w.useState(!1),i=async()=>{s(!0);try{await t(e.id),or.success(n("settings.security.revokeSuccess"))}catch{or.error(n("settings.security.revokeError"))}finally{s(!1)}};return h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(nJ,{className:"size-4 text-muted-foreground shrink-0"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium",children:n("settings.security.sessionActive")}),h.jsx("p",{className:"text-xs text-muted-foreground",children:n("settings.security.sessionInfo",{created:yC(e.created_at),expires:yC(e.expires_at)})})]})]}),h.jsxs(yq,{children:[h.jsx(Nke,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-destructive",children:r?h.jsx(Co,{className:"size-4 animate-spin"}):h.jsx(Hh,{className:"size-4"})})}),h.jsxs(xq,{children:[h.jsxs(wq,{children:[h.jsx(Cq,{children:n("settings.security.revokeTitle")}),h.jsx(kq,{children:n("settings.security.revokeDesc")})]}),h.jsxs(Sq,{children:[h.jsx(Nq,{children:n("common.cancel")}),h.jsx(Eq,{onClick:i,children:n("settings.security.revokeConfirm")})]})]})]})]})}function Ake({entry:e}){const{t}=kt();let n={};try{n=JSON.parse(e.details??"{}")}catch{}const r=typeof n.title=="string"?n.title:e.entity_slug??e.entity_type;return h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(_i,{variant:_ke[e.action]??"secondary",className:"shrink-0 capitalize",children:t(`settings.security.actions.${e.action}`,{defaultValue:e.action})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium truncate max-w-xs",children:r}),h.jsx("p",{className:"text-xs text-muted-foreground",children:e.entity_slug??e.entity_type})]})]}),h.jsx("span",{className:"text-xs text-muted-foreground shrink-0 ml-4",children:yC(e.created_at)})]})}function Oke(){const{t:e}=kt(),{data:t,isLoading:n}=fke(),{data:r,isLoading:s}=pke(),i=hke();return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.security.sessionsTitle")}),h.jsx(Xo,{children:e("settings.security.sessionsDesc")})]}),h.jsx(Kn,{children:n?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(o=>h.jsx(yr,{className:"h-12 w-full"},o))}):t?.length?h.jsx("div",{children:t.map(o=>h.jsx(Rke,{session:o,onRevoke:a=>i.mutateAsync(a)},o.id))}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.security.noSessions")})})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.security.activityTitle")}),h.jsx(Xo,{children:e("settings.security.activityDesc")})]}),h.jsx(Kn,{children:s?h.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(o=>h.jsx(yr,{className:"h-12 w-full"},o))}):r?.length?h.jsx(Gl,{className:"h-72",children:r.map(o=>h.jsx(Ake,{entry:o},o.id))}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.security.noActivity")})})]})]})}const Lh=w.forwardRef(({className:e,value:t,indicatorClassName:n,...r},s)=>h.jsx(NL,{ref:s,className:ee("relative h-2 w-full overflow-hidden rounded-full bg-neutral-900/20 dark:bg-white/20",e),...r,children:h.jsx(Roe,{className:ee("h-full w-full flex-1 bg-neutral-900 dark:bg-white transition-all",n),style:{transform:`translateX(-${100-(t||0)}%)`}})}));Lh.displayName=NL.displayName;const Dke=1*1024*1024*1024;function J5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}const jke={"image/jpeg":"JPEG","image/png":"PNG","image/webp":"WebP","image/gif":"GIF","image/svg+xml":"SVG","application/pdf":"PDF","video/mp4":"MP4"};function Ike(e){return jke[e]??e.split("/")[1]?.toUpperCase()??"File"}function zke(){const{t:e}=kt(),{data:t,isLoading:n}=mke();if(n)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(yr,{className:"h-36 w-full"}),h.jsx(yr,{className:"h-64 w-full"})]});const r=Math.min(100,(t?.totalBytes??0)/Dke*100),s=t?.orphans.reduce((i,o)=>i+o.size_bytes,0)??0;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(_r,{children:e("settings.storage.usageTitle")}),h.jsx(Xo,{children:e("settings.storage.usageDesc")})]}),h.jsxs(Kn,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-end justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-3xl font-bold tabular-nums",children:J5(t?.totalBytes??0)}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e("settings.storage.fileCount",{count:t?.fileCount??0})})]}),t?.orphans.length?h.jsxs(_i,{variant:"secondary",className:"mb-1",children:[t.orphans.length," orfani · ",J5(s)]}):null]}),h.jsx(Lh,{value:r,className:"h-2"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:e("settings.storage.referenceVisual")})]})]}),h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsxs(_r,{className:"flex items-center gap-2",children:[h.jsx(tQ,{className:"size-4"}),e("settings.storage.orphansTitle")]}),h.jsx(Xo,{children:e("settings.storage.orphansDesc")})]}),h.jsx(Kn,{children:t?.orphans.length?h.jsx(Gl,{className:"h-72",children:h.jsx("div",{className:"space-y-0",children:t.orphans.map(i=>h.jsxs("div",{className:"flex items-center justify-between py-3 border-b last:border-0",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-sm font-medium truncate",children:i.filename}),h.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:i.key})]}),h.jsxs("div",{className:"flex items-center gap-3 ml-4 shrink-0",children:[h.jsx(_i,{variant:"outline",children:Ike(i.mime_type)}),h.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:J5(i.size_bytes)})]})]},i.key))})}):h.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("settings.storage.noOrphans")})})]})]})}function Mq({className:e,size:t="default",...n}){return h.jsx(jae,{"data-slot":"switch","data-size":t,className:ee("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...n,children:h.jsx(Iae,{"data-slot":"switch-thumb",className:ee("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}function mb({id:e,label:t,description:n,checked:r,onCheckedChange:s,disabled:i}){return h.jsxs("div",{className:"flex items-center justify-between py-4",children:[h.jsxs("div",{className:"space-y-0.5",children:[h.jsx(br,{htmlFor:e,className:"text-sm font-medium cursor-pointer",children:t}),h.jsx("p",{className:"text-xs text-muted-foreground",children:n})]}),h.jsx(Mq,{id:e,checked:r,onCheckedChange:s,disabled:i})]})}function Lke(){const{t:e}=kt(),{data:t,isLoading:n}=gke(),r=bke(),s=async(o,a)=>{if(!t)return;const l={...t,[o]:a};try{await r.mutateAsync(l),or.success(e("settings.notifications.saved"))}catch{or.error(e("settings.notifications.error"))}};if(n)return h.jsxs(Wn,{children:[h.jsxs(xr,{children:[h.jsx(yr,{className:"h-5 w-40"}),h.jsx(yr,{className:"h-4 w-64 mt-1"})]}),h.jsx(Kn,{className:"space-y-4",children:[1,2,3,4].map(o=>h.jsx(yr,{className:"h-14 w-full"},o))})]});const i=r.isPending;return h.jsx("div",{className:"space-y-6",children:h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx(_r,{children:e("settings.notifications.title")}),h.jsx(Xo,{children:e("settings.notifications.description")})]}),i&&h.jsx(Co,{className:"size-4 animate-spin text-muted-foreground"})]})}),h.jsx(Kn,{children:h.jsxs("div",{className:"divide-y",children:[h.jsx(mb,{id:"notif-content-create",label:e("settings.notifications.contentCreate.label"),description:e("settings.notifications.contentCreate.description"),checked:t?.contentCreate??!0,onCheckedChange:o=>s("contentCreate",o),disabled:i}),h.jsx(mb,{id:"notif-content-update",label:e("settings.notifications.contentUpdate.label"),description:e("settings.notifications.contentUpdate.description"),checked:t?.contentUpdate??!0,onCheckedChange:o=>s("contentUpdate",o),disabled:i}),h.jsx(mb,{id:"notif-content-delete",label:e("settings.notifications.contentDelete.label"),description:e("settings.notifications.contentDelete.description"),checked:t?.contentDelete??!0,onCheckedChange:o=>s("contentDelete",o),disabled:i}),h.jsx(mb,{id:"notif-media-upload",label:e("settings.notifications.mediaUpload.label"),description:e("settings.notifications.mediaUpload.description"),checked:t?.mediaUpload??!1,onCheckedChange:o=>s("mediaUpload",o),disabled:i})]})})]})})}function Pke({tab:e}){switch(e){case"profile":return h.jsx(yke,{});case"interface":return h.jsx(Cke,{});case"security":return h.jsx(Oke,{});case"storage":return h.jsx(zke,{});case"notifications":return h.jsx(Lke,{})}}function $ke(){const[e]=wx(),{t}=kt(),n=e.get("tab")??"profile",r=[{id:"profile",label:t("settings.tabs.profile"),icon:mee},{id:"interface",label:t("settings.tabs.interface"),icon:ij},{id:"security",label:t("settings.tabs.security"),icon:aj},{id:"storage",label:t("settings.tabs.storage"),icon:ZC},{id:"notifications",label:t("settings.tabs.notifications"),icon:Fh}],s=r.find(o=>o.id===n)??r[0],i=s.icon;return h.jsx("div",{className:"[--header-height:calc(--spacing(14))] min-h-screen bg-neutral-50/50 dark:bg-neutral-950/50",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("main",{className:"flex flex-1 flex-col gap-0 p-6 md:p-8 lg:p-10",children:h.jsxs("div",{className:"content-area-inner",children:[h.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[h.jsx(i,{className:"size-5 text-muted-foreground shrink-0"}),h.jsx("div",{children:h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s.label})})]}),h.jsx(Pke,{tab:n})]})})})]})]})})}function $E(){return is({queryKey:["schema"],queryFn:async()=>{const{data:e}=await Zt.get("/schema");return e},staleTime:1e3*60*5})}function Oa({...e}){const{t}=kt(),{resolvedTheme:n}=$y(),{user:r}=Tx(),{data:s}=vq(),{data:i=[]}=$E(),o={name:s?.name??r?.name??"Admin",email:s?.email??r?.email??"",avatar:s?.avatarUrl??void 0},a=G6e(i,t("sidebar.contents"));return h.jsxs(N6e,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[h.jsx(M6e,{children:h.jsx(u2,{children:h.jsx(d2,{children:h.jsx(f2,{size:"lg",asChild:!0,children:h.jsxs("a",{href:"/",children:[h.jsx("div",{className:"flex aspect-square size-10 items-center justify-center rounded-lg overflow-hidden",children:h.jsx("img",{src:n==="dark"?"/admin/beechLogoDark.svg":"/admin/BeechLogoLIght.svg",alt:"BeechCMS",className:"size-10 object-contain"})}),h.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[h.jsx("span",{className:"truncate font-medium",children:"Beech CMS"}),h.jsx("span",{className:"truncate text-xs",children:"Dashboard"})]})]})})})})}),h.jsxs(_6e,{children:[h.jsx(fO,{items:q6e(t),groupLabel:t("sidebar.navigation")}),a.map((l,u)=>h.jsx(fO,{items:l.items,groupLabel:l.label,className:u===0?"mt-4":void 0},l.label)),hO.length>0&&h.jsx(B6e,{items:hO,className:"mt-auto"})]}),h.jsx(T6e,{children:h.jsx(U6e,{user:o,onLogout:Dpe})})]})}function Yc(e,t){return typeof e=="function"?e(t):e}function Qi(e,t){return n=>{t.setState(r=>({...r,[e]:Yc(n,r[e])}))}}function p2(e){return e instanceof Function}function Bke(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Tq(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=t(i);o!=null&&o.length&&r(o)})};return r(e),n}function At(e,t,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((f,p)=>r[p]!==f)))return s;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),s=t(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-u)*100)/100,g=p/16,b=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${b(p,5)} /${b(f,5)} ms`,`
479
479
  font-size: .6rem;
480
480
  font-weight: bold;
481
481
  color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return s}}function Ot(e,t,n,r){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function Fke(e,t,n,r){const s=()=>{var o;return(o=i.getValue())!=null?o:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:At(()=>[e,n,t,i],(o,a,l,u)=>({table:o,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),Ot(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(i,n,t,e)},{}),i}function Hke(e,t,n,r){var s,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(s=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,f;if(a.accessorFn?f=a.accessorFn:l&&(l.includes(".")?f=g=>{let b=g;for(const x of l.split(".")){var y;b=(y=b)==null?void 0:y[x]}return b}:f=g=>g[a.accessorKey]),!u)throw new Error;let p={id:`${String(u)}`,accessorFn:f,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:At(()=>[!0],()=>{var g;return[p,...(g=p.columns)==null?void 0:g.flatMap(b=>b.getFlatColumns())]},Ot(e.options,"debugColumns")),getLeafColumns:At(()=>[e._getOrderColumnsFn()],g=>{var b;if((b=p.columns)!=null&&b.length){let y=p.columns.flatMap(x=>x.getLeafColumns());return g(y)}return[p]},Ot(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(p,e);return p}const Fs="debugHeaders";function mO(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),o.push(l)};return a(i),o},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(i,e)}),i}const Uke={createTable:e=>{e.getHeaderGroups=At(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,o;const a=(i=r?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?i:[],l=(o=s?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?o:[],u=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(s!=null&&s.includes(p.id)));return gb(t,[...a,...u,...l],e)},Ot(e.options,Fs)),e.getCenterHeaderGroups=At(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),gb(t,n,e,"center")),Ot(e.options,Fs)),e.getLeftHeaderGroups=At(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const i=(s=r?.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return gb(t,i,e,"left")},Ot(e.options,Fs)),e.getRightHeaderGroups=At(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const i=(s=r?.map(o=>n.find(a=>a.id===o)).filter(Boolean))!=null?s:[];return gb(t,i,e,"right")},Ot(e.options,Fs)),e.getFooterGroups=At(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ot(e.options,Fs)),e.getLeftFooterGroups=At(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ot(e.options,Fs)),e.getCenterFooterGroups=At(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ot(e.options,Fs)),e.getRightFooterGroups=At(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ot(e.options,Fs)),e.getFlatHeaders=At(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ot(e.options,Fs)),e.getLeftFlatHeaders=At(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ot(e.options,Fs)),e.getCenterFlatHeaders=At(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ot(e.options,Fs)),e.getRightFlatHeaders=At(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ot(e.options,Fs)),e.getCenterLeafHeaders=At(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ot(e.options,Fs)),e.getLeftLeafHeaders=At(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ot(e.options,Fs)),e.getRightLeafHeaders=At(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ot(e.options,Fs)),e.getLeafHeaders=At(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,o,a,l,u;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(o=(a=n[0])==null?void 0:a.headers)!=null?o:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(f=>f.getLeafHeaders()).flat()},Ot(e.options,Fs))}};function gb(e,t,n,r){var s,i;let o=0;const a=function(g,b){b===void 0&&(b=1),o=Math.max(o,b),g.filter(y=>y.getIsVisible()).forEach(y=>{var x;(x=y.columns)!=null&&x.length&&a(y.columns,b+1)},0)};a(e);let l=[];const u=(g,b)=>{const y={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},x=[];g.forEach(S=>{const k=[...x].reverse()[0],N=S.column.depth===y.depth;let T,R=!1;if(N&&S.column.parent?T=S.column.parent:(T=S.column,R=!0),k&&k?.column===T)k.subHeaders.push(S);else{const _=mO(n,T,{id:[r,b,T.id,S?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${x.filter(A=>A.column===T).length}`:void 0,depth:b,index:x.length});_.subHeaders.push(S),x.push(_)}y.headers.push(S),S.headerGroup=y}),l.push(y),b>0&&u(x,b-1)},f=t.map((g,b)=>mO(n,g,{depth:o,index:b}));u(f,o-1),l.reverse();const p=g=>g.filter(y=>y.column.getIsVisible()).map(y=>{let x=0,S=0,k=[0];y.subHeaders&&y.subHeaders.length?(k=[],p(y.subHeaders).forEach(T=>{let{colSpan:R,rowSpan:_}=T;x+=R,k.push(_)})):x=1;const N=Math.min(...k);return S=S+N,y.colSpan=x,y.rowSpan=S,{colSpan:x,rowSpan:S}});return p((s=(i=l[0])==null?void 0:i.headers)!=null?s:[]),l}const m2=(e,t,n,r,s,i,o)=>{let a={id:t,index:r,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>Tq(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const f=u.getParentRow();if(!f)break;l.push(f),u=f}return l.reverse()},getAllCells:At(()=>[e.getAllLeafColumns()],l=>l.map(u=>Fke(e,a,u,u.id)),Ot(e.options,"debugRows")),_getAllCellsByColumnId:At(()=>[a.getAllCells()],l=>l.reduce((u,f)=>(u[f.column.id]=f,u),{}),Ot(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a},Vke={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},_q=(e,t,n)=>{var r,s;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(i))};_q.autoRemove=e=>Qo(e);const Rq=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Rq.autoRemove=e=>Qo(e);const Aq=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Aq.autoRemove=e=>Qo(e);const Oq=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Oq.autoRemove=e=>Qo(e);const Dq=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});Dq.autoRemove=e=>Qo(e)||!(e!=null&&e.length);const jq=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});jq.autoRemove=e=>Qo(e)||!(e!=null&&e.length);const Iq=(e,t,n)=>e.getValue(t)===n;Iq.autoRemove=e=>Qo(e);const zq=(e,t,n)=>e.getValue(t)==n;zq.autoRemove=e=>Qo(e);const BE=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};BE.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(s)?1/0:s;if(i>o){const a=i;i=o,o=a}return[i,o]};BE.autoRemove=e=>Qo(e)||Qo(e[0])&&Qo(e[1]);const Rl={includesString:_q,includesStringSensitive:Rq,equalsString:Aq,arrIncludes:Oq,arrIncludesAll:Dq,arrIncludesSome:jq,equals:Iq,weakEquals:zq,inNumberRange:BE};function Qo(e){return e==null||e===""}const qke={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Qi("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Rl.includesString:typeof r=="number"?Rl.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Rl.equals:Array.isArray(r)?Rl.arrIncludes:Rl.weakEquals},e.getFilterFn=()=>{var n,r;return p2(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Rl[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),i=r?.find(f=>f.id===e.id),o=Yc(n,i?i.value:void 0);if(gO(s,o,e)){var a;return(a=r?.filter(f=>f.id!==e.id))!=null?a:[]}const l={id:e.id,value:o};if(i){var u;return(u=r?.map(f=>f.id===e.id?l:f))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=Yc(t,s))==null?void 0:i.filter(o=>{const a=n.find(l=>l.id===o.id);if(a){const l=a.getFilterFn();if(gO(l,o.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function gO(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Gke=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),Wke=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},Kke=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},Yke=(e,t,n)=>{let r,s;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r===void 0?o>=o&&(r=s=o):(r>o&&(r=o),s<o&&(s=o)))}),[r,s]},Zke=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},Xke=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Bke(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,o)=>i-o);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},Qke=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Jke=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,eEe=(e,t)=>t.length,eS={sum:Gke,min:Wke,max:Kke,extent:Yke,mean:Zke,median:Xke,unique:Qke,uniqueCount:Jke,count:eEe},tEe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Qi("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return eS.sum;if(Object.prototype.toString.call(r)==="[object Date]")return eS.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return p2(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:eS[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function nEe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(o=>o.id===i)).filter(Boolean),...r]}const rEe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Qi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=At(n=>[Wp(t,n)],n=>n.findIndex(r=>r.id===e.id),Ot(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Wp(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Wp(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=At(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const o=[...t],a=[...s];for(;a.length&&o.length;){const l=o.shift(),u=a.findIndex(f=>f.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return nEe(i,n,r)},Ot(e.options,"debugTable"))}},tS=()=>({left:[],right:[]}),sEe={getInitialState:e=>({columnPinning:tS(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Qi("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,o;if(n==="right"){var a,l;return{left:((a=s?.left)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((l=s?.right)!=null?l:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var u,f;return{left:[...((u=s?.left)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((f=s?.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((i=s?.left)!=null?i:[]).filter(p=>!(r!=null&&r.includes(p))),right:((o=s?.right)!=null?o:[]).filter(p=>!(r!=null&&r.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,o;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:s}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),o=n.some(a=>s?.includes(a));return i?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=At(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(o=>!i.includes(o.column.id))},Ot(t.options,"debugRows")),e.getLeftVisibleCells=At(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Ot(t.options,"debugRows")),e.getRightVisibleCells=At(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Ot(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?tS():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:tS())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=At(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Ot(e.options,"debugColumns")),e.getRightLeafColumns=At(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Ot(e.options,"debugColumns")),e.getCenterLeafColumns=At(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},Ot(e.options,"debugColumns"))}};function iEe(e){return e||(typeof document<"u"?document:null)}const bb={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},nS=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),oEe={getDefaultColumnDef:()=>bb,getInitialState:e=>({columnSizing:{},columnSizingInfo:nS(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Qi("columnSizing",e),onColumnSizingInfoChange:Qi("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:bb.minSize,(r=i??e.columnDef.size)!=null?r:bb.size),(s=e.columnDef.maxSize)!=null?s:bb.maxSize)},e.getStart=At(n=>[n,Wp(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),Ot(t.options,"debugColumns")),e.getAfter=At(n=>[n,Wp(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),Ot(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var i;n+=(i=s.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r?.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),rS(i)&&i.touches&&i.touches.length>1))return;const o=e.getSize(),a=e?e.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[r.id,r.getSize()]],l=rS(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(k,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(T=>{var R,_;const A=t.options.columnResizeDirection==="rtl"?-1:1,I=(N-((R=T?.startOffset)!=null?R:0))*A,j=Math.max(I/((_=T?.startSize)!=null?_:0),-.999999);return T.columnSizingStart.forEach(L=>{let[q,ne]=L;u[q]=Math.round(Math.max(ne+ne*j,0)*100)/100}),{...T,deltaOffset:I,deltaPercentage:j}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(T=>({...T,...u})))},p=k=>f("move",k),g=k=>{f("end",k),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=iEe(n),y={moveHandler:k=>p(k.clientX),upHandler:k=>{b?.removeEventListener("mousemove",y.moveHandler),b?.removeEventListener("mouseup",y.upHandler),g(k.clientX)}},x={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),p(k.touches[0].clientX),!1),upHandler:k=>{var N;b?.removeEventListener("touchmove",x.moveHandler),b?.removeEventListener("touchend",x.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),g((N=k.touches[0])==null?void 0:N.clientX)}},S=aEe()?{passive:!1}:!1;rS(i)?(b?.addEventListener("touchmove",x.moveHandler,S),b?.addEventListener("touchend",x.upHandler,S)):(b?.addEventListener("mousemove",y.moveHandler,S),b?.addEventListener("mouseup",y.upHandler,S)),t.setColumnSizingInfo(k=>({...k,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?nS():(n=e.initialState.columnSizingInfo)!=null?n:nS())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let vb=null;function aEe(){if(typeof vb=="boolean")return vb;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return vb=e,vb}function rS(e){return e.type==="touchstart"}const lEe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Qi("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=At(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ot(t.options,"debugRows")),e.getVisibleCells=At(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Ot(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>At(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Ot(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Wp(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const cEe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},uEe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Qi("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Rl.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return p2(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Rl[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},dEe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Qi("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const o=i.split(".");r=Math.max(r,o.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[e.id]);let o={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{o[a]=!0}):o=r,n=(s=n)!=null?s:!i,!i&&n)return{...o,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=o;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},xC=0,wC=10,sS=()=>({pageIndex:xC,pageSize:wC}),fEe={getInitialState:e=>({...e,pagination:{...sS(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Qi("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=i=>Yc(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?sS():(s=e.initialState.pagination)!=null?s:sS())},e.setPageIndex=r=>{e.setPagination(s=>{let i=Yc(r,s.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?xC:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:xC)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?wC:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:wC)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,Yc(r,s.pageSize)),o=s.pageSize*s.pageIndex,a=Math.floor(o/i);return{...s,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let o=Yc(r,(i=e.options.pageCount)!=null?i:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),e.getPageOptions=At(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,o)=>o)),s},Ot(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},iS=()=>({top:[],bottom:[]}),hEe={getInitialState:e=>({rowPinning:iS(),...e}),getDefaultOptions:e=>({onRowPinningChange:Qi("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],o=s?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...o,e.id,...i]);t.setRowPinning(l=>{var u,f;if(n==="bottom"){var p,g;return{top:((p=l?.top)!=null?p:[]).filter(x=>!(a!=null&&a.has(x))),bottom:[...((g=l?.bottom)!=null?g:[]).filter(x=>!(a!=null&&a.has(x))),...Array.from(a)]}}if(n==="top"){var b,y;return{top:[...((b=l?.top)!=null?b:[]).filter(x=>!(a!=null&&a.has(x))),...Array.from(a)],bottom:((y=l?.bottom)!=null?y:[]).filter(x=>!(a!=null&&a.has(x)))}}return{top:((u=l?.top)!=null?u:[]).filter(x=>!(a!=null&&a.has(x))),bottom:((f=l?.bottom)!=null?f:[]).filter(x=>!(a!=null&&a.has(x)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),o=n.some(a=>s?.includes(a));return i?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:a}=o;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?iS():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:iS())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const a=e.getRow(o,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(o=>t.find(a=>a.id===o))).filter(Boolean).map(o=>({...o,position:r}))},e.getTopRows=At(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ot(e.options,"debugRows")),e.getBottomRows=At(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ot(e.options,"debugRows")),e.getCenterRows=At(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},Ot(e.options,"debugRows"))}},pEe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Qi("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{SC(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=At(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?oS(e,n):{rows:[],flatRows:[],rowsById:{}},Ot(e.options,"debugTable")),e.getFilteredSelectedRowModel=At(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?oS(e,n):{rows:[],flatRows:[],rowsById:{}},Ot(e.options,"debugTable")),e.getGroupedSelectedRowModel=At(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?oS(e,n):{rows:[],flatRows:[],rowsById:{}},Ot(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(i=>{var o;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const a={...i};return SC(a,e.id,n,(o=r?.selectChildren)!=null?o:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return FE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return CC(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return CC(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},SC=(e,t,n,r,s)=>{var i;const o=s.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(a=>SC(e,a.id,n,r,s))};function oS(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(o,a){return o.map(l=>{var u;const f=FE(l,n);if(f&&(r.push(l),s[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),f)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function FE(e,t){var n;return(n=t[e.id])!=null?n:!1}function CC(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(o=>{if(!(i&&!s)&&(o.getCanSelect()&&(FE(o,t)?i=!0:s=!1),o.subRows&&o.subRows.length)){const a=CC(o,t);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const kC=/([0-9]+)/gm,mEe=(e,t,n)=>Lq(pu(e.getValue(n)).toLowerCase(),pu(t.getValue(n)).toLowerCase()),gEe=(e,t,n)=>Lq(pu(e.getValue(n)),pu(t.getValue(n))),bEe=(e,t,n)=>HE(pu(e.getValue(n)).toLowerCase(),pu(t.getValue(n)).toLowerCase()),vEe=(e,t,n)=>HE(pu(e.getValue(n)),pu(t.getValue(n))),yEe=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},xEe=(e,t,n)=>HE(e.getValue(n),t.getValue(n));function HE(e,t){return e===t?0:e>t?1:-1}function pu(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Lq(e,t){const n=e.split(kC).filter(Boolean),r=t.split(kC).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),o=parseInt(s,10),a=parseInt(i,10),l=[o,a].sort();if(isNaN(l[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}return n.length-r.length}const ap={alphanumeric:mEe,alphanumericCaseSensitive:gEe,text:bEe,textCaseSensitive:vEe,datetime:yEe,basic:xEe},wEe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Qi("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ap.datetime;if(typeof i=="string"&&(r=!0,i.split(kC).length>1))return ap.alphanumeric}return r?ap.text:ap.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return p2(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ap[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(o=>{const a=o?.find(b=>b.id===e.id),l=o?.findIndex(b=>b.id===e.id);let u=[],f,p=i?n:s==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&r?a?f="toggle":f="add":o!=null&&o.length&&l!==o.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||s||(f="remove")),f==="add"){var g;u=[...o,{id:e.id,desc:p}],u.splice(0,u.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=o.map(b=>b.id===e.id?{...b,desc:p}:b):f==="remove"?u=o.filter(b=>b.id!==e.id):u=[{id:e.id,desc:p}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const i=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},SEe=[Uke,lEe,rEe,sEe,Vke,qke,cEe,uEe,wEe,tEe,dEe,fEe,hEe,pEe,oEe];function CEe(e){var t,n;const r=[...SEe,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((g,b)=>Object.assign(g,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),o=g=>s.options.mergeOptions?s.options.mergeOptions(i,g):{...i,...g};let l={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(g=>{var b;l=(b=g.getInitialState==null?void 0:g.getInitialState(l))!=null?b:l});const u=[];let f=!1;const p={_features:r,options:{...i,...e},initialState:l,_queue:g=>{u.push(g),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{s.setState(s.initialState)},setOptions:g=>{const b=Yc(g,s.options);s.options=o(b)},getState:()=>s.options.state,setState:g=>{s.options.onStateChange==null||s.options.onStateChange(g)},_getRowId:(g,b,y)=>{var x;return(x=s.options.getRowId==null?void 0:s.options.getRowId(g,b,y))!=null?x:`${y?[y.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(g,b)=>{let y=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[g];if(!y&&(y=s.getCoreRowModel().rowsById[g],!y))throw new Error;return y},_getDefaultColumnDef:At(()=>[s.options.defaultColumn],g=>{var b;return g=(b=g)!=null?b:{},{header:y=>{const x=y.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:y=>{var x,S;return(x=(S=y.renderValue())==null||S.toString==null?void 0:S.toString())!=null?x:null},...s._features.reduce((y,x)=>Object.assign(y,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...g}},Ot(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:At(()=>[s._getColumnDefs()],g=>{const b=function(y,x,S){return S===void 0&&(S=0),y.map(k=>{const N=Hke(s,k,S,x),T=k;return N.columns=T.columns?b(T.columns,N,S+1):[],N})};return b(g)},Ot(e,"debugColumns")),getAllFlatColumns:At(()=>[s.getAllColumns()],g=>g.flatMap(b=>b.getFlatColumns()),Ot(e,"debugColumns")),_getAllFlatColumnsById:At(()=>[s.getAllFlatColumns()],g=>g.reduce((b,y)=>(b[y.id]=y,b),{}),Ot(e,"debugColumns")),getAllLeafColumns:At(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(g,b)=>{let y=g.flatMap(x=>x.getLeafColumns());return b(y)},Ot(e,"debugColumns")),getColumn:g=>s._getAllFlatColumnsById()[g]};Object.assign(s,p);for(let g=0;g<s._features.length;g++){const b=s._features[g];b==null||b.createTable==null||b.createTable(s)}return s}function kEe(){return e=>At(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,o){i===void 0&&(i=0);const a=[];for(let u=0;u<s.length;u++){const f=m2(e,e._getRowId(s[u],u,o),s[u],u,i,void 0,o?.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,a.push(f),e.options.getSubRows){var l;f.originalSubRows=e.options.getSubRows(s[u],u),(l=f.originalSubRows)!=null&&l.length&&(f.subRows=r(f.originalSubRows,i+1,f))}}return a};return n.rows=r(t),n},Ot(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function EEe(){return e=>At(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(t,n,r)=>!n.rows.length||t!==!0&&!Object.keys(t??{}).length||!r?n:Pq(n),Ot(e.options,"debugTable"))}function Pq(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function NEe(e,t,n){return n.options.filterFromLeafRows?MEe(e,t,n):TEe(e,t,n)}function MEe(e,t,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const f=[];for(let g=0;g<l.length;g++){var p;let b=l[g];const y=m2(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(y.columnFilters=b.columnFilters,(p=b.subRows)!=null&&p.length&&u<o){if(y.subRows=a(b.subRows,u+1),b=y,t(b)&&!y.subRows.length){f.push(b),i[b.id]=b,s.push(b);continue}if(t(b)||y.subRows.length){f.push(b),i[b.id]=b,s.push(b);continue}}else b=y,t(b)&&(f.push(b),i[b.id]=b,s.push(b))}return f};return{rows:a(e),flatRows:s,rowsById:i}}function TEe(e,t,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const f=[];for(let g=0;g<l.length;g++){let b=l[g];if(t(b)){var p;if((p=b.subRows)!=null&&p.length&&u<o){const x=m2(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);x.subRows=a(b.subRows,u+1),b=x}f.push(b),s.push(b),i[b.id]=b}}return f};return{rows:a(e),flatRows:s,rowsById:i}}function _Ee(){return e=>At(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let g=0;g<t.flatRows.length;g++)t.flatRows[g].columnFilters={},t.flatRows[g].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(g=>{var b;const y=e.getColumn(g.id);if(!y)return;const x=y.getFilterFn();x&&s.push({id:g.id,filterFn:x,resolvedValue:(b=x.resolveFilterValue==null?void 0:x.resolveFilterValue(g.value))!=null?b:g.value})});const o=(n??[]).map(g=>g.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());r&&a&&l.length&&(o.push("__global__"),l.forEach(g=>{var b;i.push({id:g.id,filterFn:a,resolvedValue:(b=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?b:r})}));let u,f;for(let g=0;g<t.flatRows.length;g++){const b=t.flatRows[g];if(b.columnFilters={},s.length)for(let y=0;y<s.length;y++){u=s[y];const x=u.id;b.columnFilters[x]=u.filterFn(b,x,u.resolvedValue,S=>{b.columnFiltersMeta[x]=S})}if(i.length){for(let y=0;y<i.length;y++){f=i[y];const x=f.id;if(f.filterFn(b,x,f.resolvedValue,S=>{b.columnFiltersMeta[x]=S})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const p=g=>{for(let b=0;b<o.length;b++)if(g.columnFilters[o[b]]===!1)return!1;return!0};return NEe(t.rows,p,e)},Ot(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function REe(){return e=>At(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach(l=>{l.depth=0,l.parentId=void 0}),n;const r=t.filter(l=>e.getColumn(l)),s=[],i={},o=function(l,u,f){if(u===void 0&&(u=0),u>=r.length)return l.map(y=>(y.depth=u,s.push(y),i[y.id]=y,y.subRows&&(y.subRows=o(y.subRows,u+1,y.id)),y));const p=r[u],g=AEe(l,p);return Array.from(g.entries()).map((y,x)=>{let[S,k]=y,N=`${p}:${S}`;N=f?`${f}>${N}`:N;const T=o(k,u+1,N);T.forEach(A=>{A.parentId=N});const R=u?Tq(k,A=>A.subRows):k,_=m2(e,N,R[0].original,x,u,void 0,f);return Object.assign(_,{groupingColumnId:p,groupingValue:S,subRows:T,leafRows:R,getValue:A=>{if(r.includes(A)){if(_._valuesCache.hasOwnProperty(A))return _._valuesCache[A];if(k[0]){var I;_._valuesCache[A]=(I=k[0].getValue(A))!=null?I:void 0}return _._valuesCache[A]}if(_._groupingValuesCache.hasOwnProperty(A))return _._groupingValuesCache[A];const j=e.getColumn(A),L=j?.getAggregationFn();if(L)return _._groupingValuesCache[A]=L(A,R,k),_._groupingValuesCache[A]}}),T.forEach(A=>{s.push(A),i[A.id]=A}),_})},a=o(n.rows,0);return a.forEach(l=>{s.push(l),i[l.id]=l}),{rows:a,flatRows:s,rowsById:i}},Ot(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function AEe(e,t){const n=new Map;return e.reduce((r,s)=>{const i=`${s.getGroupingValue(t)}`,o=r.get(i);return o?o.push(s):r.set(i,[s]),r},n)}function OEe(e){return t=>At(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:i}=n;let{rows:o,flatRows:a,rowsById:l}=r;const u=s*i,f=u+s;o=o.slice(u,f);let p;t.options.paginateExpandedRows?p={rows:o,flatRows:a,rowsById:l}:p=Pq({rows:o,flatRows:a,rowsById:l}),p.flatRows=[];const g=b=>{p.flatRows.push(b),b.subRows.length&&b.subRows.forEach(g)};return p.rows.forEach(g),p},Ot(t.options,"debugTable"))}function DEe(){return e=>At(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(l=>{var u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),o={};i.forEach(l=>{const u=e.getColumn(l.id);u&&(o[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=l=>{const u=l.map(f=>({...f}));return u.sort((f,p)=>{for(let b=0;b<i.length;b+=1){var g;const y=i[b],x=o[y.id],S=x.sortUndefined,k=(g=y?.desc)!=null?g:!1;let N=0;if(S){const T=f.getValue(y.id),R=p.getValue(y.id),_=T===void 0,A=R===void 0;if(_||A){if(S==="first")return _?-1:1;if(S==="last")return _?1:-1;N=_&&A?0:_?S:-S}}if(N===0&&(N=x.sortingFn(f,p,y.id)),N!==0)return k&&(N*=-1),x.invertSorting&&(N*=-1),N}return f.index-p.index}),u.forEach(f=>{var p;s.push(f),(p=f.subRows)!=null&&p.length&&(f.subRows=a(f.subRows))}),u};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},Ot(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function aS(e,t){return e?jEe(e)?w.createElement(e,t):e:null}function jEe(e){return IEe(e)||typeof e=="function"||zEe(e)}function IEe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function zEe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function LEe(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=w.useState(()=>({current:CEe(t)})),[r,s]=w.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:o=>{s(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}function Uf(e,t,n){let r=n.initialDeps??[],s,i=!0;function o(){var a,l,u;let f;n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now());const p=e();if(!(p.length!==r.length||p.some((y,x)=>r[x]!==y)))return s;r=p;let b;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(b=Date.now()),s=t(...p),n.key&&((u=n.debug)!=null&&u.call(n))){const y=Math.round((Date.now()-f)*100)/100,x=Math.round((Date.now()-b)*100)/100,S=x/16,k=(N,T)=>{for(N=String(N);N.length<T;)N=" "+N;return N};console.info(`%c⏱ ${k(x,5)} /${k(y,5)} ms`,`
@@ -551,4 +551,4 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
551
551
  https://github.com/highlightjs/highlight.js/issues/2277`),fr=Pe,xn=yt),Ht===void 0&&(Ht=!0);const Lt={code:xn,language:fr};$s("before:highlight",Lt);const Ln=Lt.result?Lt.result:me(Lt.language,Lt.code,Ht);return Ln.code=Lt.code,$s("after:highlight",Ln),Ln}function me(Pe,yt,Ht,xn){const fr=Object.create(null);function Lt(Ye,xt){return Ye.keywords[xt]}function Ln(){if(!Pt.keywords){Zr.addText(Un);return}let Ye=0;Pt.keywordPatternRe.lastIndex=0;let xt=Pt.keywordPatternRe.exec(Un),Wt="";for(;xt;){Wt+=Un.substring(Ye,xt.index);const dn=Rs.case_insensitive?xt[0].toLowerCase():xt[0],Er=Lt(Pt,dn);if(Er){const[so,l0]=Er;if(Zr.addText(Wt),Wt="",fr[dn]=(fr[dn]||0)+1,fr[dn]<=Me&&(nc+=l0),so.startsWith("_"))Wt+=xt[0];else{const gg=Rs.classNameAliases[so]||so;un(xt[0],gg)}}else Wt+=xt[0];Ye=Pt.keywordPatternRe.lastIndex,xt=Pt.keywordPatternRe.exec(Un)}Wt+=Un.substring(Ye),Zr.addText(Wt)}function Hr(){if(Un==="")return;let Ye=null;if(typeof Pt.subLanguage=="string"){if(!Q[Pt.subLanguage]){Zr.addText(Un);return}Ye=me(Pt.subLanguage,Un,!0,mg[Pt.subLanguage]),mg[Pt.subLanguage]=Ye._top}else Ye=qe(Un,Pt.subLanguage.length?Pt.subLanguage:null);Pt.relevance>0&&(nc+=Ye.relevance),Zr.__addSublanguage(Ye._emitter,Ye.language)}function wn(){Pt.subLanguage!=null?Hr():Ln(),Un=""}function un(Ye,xt){Ye!==""&&(Zr.startScope(xt),Zr.addText(Ye),Zr.endScope())}function Xa(Ye,xt){let Wt=1;const dn=xt.length-1;for(;Wt<=dn;){if(!Ye._emit[Wt]){Wt++;continue}const Er=Rs.classNameAliases[Ye[Wt]]||Ye[Wt],so=xt[Wt];Er?un(so,Er):(Un=so,Ln(),Un=""),Wt++}}function Qa(Ye,xt){return Ye.scope&&typeof Ye.scope=="string"&&Zr.openNode(Rs.classNameAliases[Ye.scope]||Ye.scope),Ye.beginScope&&(Ye.beginScope._wrap?(un(Un,Rs.classNameAliases[Ye.beginScope._wrap]||Ye.beginScope._wrap),Un=""):Ye.beginScope._multi&&(Xa(Ye.beginScope,xt),Un="")),Pt=Object.create(Ye,{parent:{value:Pt}}),Pt}function Tu(Ye,xt,Wt){let dn=T(Ye.endRe,Wt);if(dn){if(Ye["on:end"]){const Er=new t(Ye);Ye["on:end"](xt,Er),Er.isMatchIgnored&&(dn=!1)}if(dn){for(;Ye.endsParent&&Ye.parent;)Ye=Ye.parent;return Ye}}if(Ye.endsWithParent)return Tu(Ye.parent,xt,Wt)}function Yd(Ye){return Pt.matcher.regexIndex===0?(Un+=Ye[0],1):(rc=!0,0)}function C2(Ye){const xt=Ye[0],Wt=Ye.rule,dn=new t(Wt),Er=[Wt.__beforeBegin,Wt["on:begin"]];for(const so of Er)if(so&&(so(Ye,dn),dn.isMatchIgnored))return Yd(xt);return Wt.skip?Un+=xt:(Wt.excludeBegin&&(Un+=xt),wn(),!Wt.returnBegin&&!Wt.excludeBegin&&(Un=xt)),Qa(Wt,Ye),Wt.returnBegin?0:xt.length}function hi(Ye){const xt=Ye[0],Wt=yt.substring(Ye.index),dn=Tu(Pt,Ye,Wt);if(!dn)return ke;const Er=Pt;Pt.endScope&&Pt.endScope._wrap?(wn(),un(xt,Pt.endScope._wrap)):Pt.endScope&&Pt.endScope._multi?(wn(),Xa(Pt.endScope,Ye)):Er.skip?Un+=xt:(Er.returnEnd||Er.excludeEnd||(Un+=xt),wn(),Er.excludeEnd&&(Un=xt));do Pt.scope&&Zr.closeNode(),!Pt.skip&&!Pt.subLanguage&&(nc+=Pt.relevance),Pt=Pt.parent;while(Pt!==dn.parent);return dn.starts&&Qa(dn.starts,Ye),Er.returnEnd?0:xt.length}function o0(){const Ye=[];for(let xt=Pt;xt!==Rs;xt=xt.parent)xt.scope&&Ye.unshift(xt.scope);Ye.forEach(xt=>Zr.openNode(xt))}let _u={};function Zd(Ye,xt){const Wt=xt&&xt[0];if(Un+=Ye,Wt==null)return wn(),0;if(_u.type==="begin"&&xt.type==="end"&&_u.index===xt.index&&Wt===""){if(Un+=yt.slice(xt.index,xt.index+1),!Rt){const dn=new Error(`0 width match regex (${Pe})`);throw dn.languageName=Pe,dn.badRule=_u.rule,dn}return 1}if(_u=xt,xt.type==="begin")return C2(xt);if(xt.type==="illegal"&&!Ht){const dn=new Error('Illegal lexeme "'+Wt+'" for mode "'+(Pt.scope||"<unnamed>")+'"');throw dn.mode=Pt,dn}else if(xt.type==="end"){const dn=hi(xt);if(dn!==ke)return dn}if(xt.type==="illegal"&&Wt==="")return Un+=`
552
552
  `,1;if(a0>1e5&&a0>xt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Un+=Wt,Wt.length}const Rs=yn(Pe);if(!Rs)throw Kt(lt.replace("{}",Pe)),new Error('Unknown language: "'+Pe+'"');const pg=Ar(Rs);let Xd="",Pt=xn||pg;const mg={},Zr=new Xe.__emitter(Xe);o0();let Un="",nc=0,Ja=0,a0=0,rc=!1;try{if(Rs.__emitTokens)Rs.__emitTokens(yt,Zr);else{for(Pt.matcher.considerAll();;){a0++,rc?rc=!1:Pt.matcher.considerAll(),Pt.matcher.lastIndex=Ja;const Ye=Pt.matcher.exec(yt);if(!Ye)break;const xt=yt.substring(Ja,Ye.index),Wt=Zd(xt,Ye);Ja=Ye.index+Wt}Zd(yt.substring(Ja))}return Zr.finalize(),Xd=Zr.toHTML(),{language:Pe,value:Xd,relevance:nc,illegal:!1,_emitter:Zr,_top:Pt}}catch(Ye){if(Ye.message&&Ye.message.includes("Illegal"))return{language:Pe,value:Or(yt),illegal:!0,relevance:0,_illegalBy:{message:Ye.message,index:Ja,context:yt.slice(Ja-100,Ja+100),mode:Ye.mode,resultSoFar:Xd},_emitter:Zr};if(Rt)return{language:Pe,value:Or(yt),illegal:!1,relevance:0,errorRaised:Ye,_emitter:Zr,_top:Pt};throw Ye}}function ze(Pe){const yt={value:Or(Pe),illegal:!1,relevance:0,_top:Ke,_emitter:new Xe.__emitter(Xe)};return yt._emitter.addText(Pe),yt}function qe(Pe,yt){yt=yt||Xe.languages||Object.keys(Q);const Ht=ze(Pe),xn=yt.filter(yn).filter(an).map(wn=>me(wn,Pe,!1));xn.unshift(Ht);const fr=xn.sort((wn,un)=>{if(wn.relevance!==un.relevance)return un.relevance-wn.relevance;if(wn.language&&un.language){if(yn(wn.language).supersetOf===un.language)return 1;if(yn(un.language).supersetOf===wn.language)return-1}return 0}),[Lt,Ln]=fr,Hr=Lt;return Hr.secondBest=Ln,Hr}function ct(Pe,yt,Ht){const xn=yt&&ge[yt]||Ht;Pe.classList.add("hljs"),Pe.classList.add(`language-${xn}`)}function Qe(Pe){let yt=null;const Ht=G(Pe);if(dt(Ht))return;if($s("before:highlightElement",{el:Pe,language:Ht}),Pe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Pe);return}if(Pe.children.length>0&&(Xe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Pe)),Xe.throwUnescapedHTML))throw new _s("One of your code blocks includes unescaped HTML.",Pe.innerHTML);yt=Pe;const xn=yt.textContent,fr=Ht?se(xn,{language:Ht,ignoreIllegals:!0}):qe(xn);Pe.innerHTML=fr.value,Pe.dataset.highlighted="yes",ct(Pe,Ht,fr.language),Pe.result={language:fr.language,re:fr.relevance,relevance:fr.relevance},fr.secondBest&&(Pe.secondBest={language:fr.secondBest.language,relevance:fr.secondBest.relevance}),$s("after:highlightElement",{el:Pe,result:fr,text:xn})}function et(Pe){Xe=ht(Xe,Pe)}const pt=()=>{mt(),Nt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function it(){mt(),Nt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ct=!1;function mt(){function Pe(){mt()}if(document.readyState==="loading"){Ct||window.addEventListener("DOMContentLoaded",Pe,!1),Ct=!0;return}document.querySelectorAll(Xe.cssSelector).forEach(Qe)}function vn(Pe,yt){let Ht=null;try{Ht=yt(U)}catch(xn){if(Kt("Language definition for '{}' could not be registered.".replace("{}",Pe)),Rt)Kt(xn);else throw xn;Ht=Ke}Ht.name||(Ht.name=Pe),Q[Pe]=Ht,Ht.rawDefinition=yt.bind(null,U),Ht.aliases&&hr(Ht.aliases,{languageName:Pe})}function en(Pe){delete Q[Pe];for(const yt of Object.keys(ge))ge[yt]===Pe&&delete ge[yt]}function Hn(){return Object.keys(Q)}function yn(Pe){return Pe=(Pe||"").toLowerCase(),Q[Pe]||Q[ge[Pe]]}function hr(Pe,{languageName:yt}){typeof Pe=="string"&&(Pe=[Pe]),Pe.forEach(Ht=>{ge[Ht.toLowerCase()]=yt})}function an(Pe){const yt=yn(Pe);return yt&&!yt.disableAutodetect}function Dr(Pe){Pe["before:highlightBlock"]&&!Pe["before:highlightElement"]&&(Pe["before:highlightElement"]=yt=>{Pe["before:highlightBlock"](Object.assign({block:yt.el},yt))}),Pe["after:highlightBlock"]&&!Pe["after:highlightElement"]&&(Pe["after:highlightElement"]=yt=>{Pe["after:highlightBlock"](Object.assign({block:yt.el},yt))})}function Jn(Pe){Dr(Pe),je.push(Pe)}function ca(Pe){const yt=je.indexOf(Pe);yt!==-1&&je.splice(yt,1)}function $s(Pe,yt){const Ht=Pe;je.forEach(function(xn){xn[Ht]&&xn[Ht](yt)})}function Yr(Pe){return Nt("10.7.0","highlightBlock will be removed entirely in v12.0"),Nt("10.7.0","Please use highlightElement now."),Qe(Pe)}Object.assign(U,{highlight:se,highlightAuto:qe,highlightAll:mt,highlightElement:Qe,highlightBlock:Yr,configure:et,initHighlighting:pt,initHighlightingOnLoad:it,registerLanguage:vn,unregisterLanguage:en,listLanguages:Hn,getLanguage:yn,registerAliases:hr,autoDetection:an,inherit:ht,addPlugin:Jn,removePlugin:ca}),U.debugMode=function(){Rt=!1},U.safeMode=function(){Rt=!0},U.versionString=_t,U.regex={concat:x,lookahead:g,either:k,optional:y,anyNumberOfTimes:b};for(const Pe in Ze)typeof Ze[Pe]=="object"&&e(Ze[Pe]);return Object.assign(U,Ze),U},rt=Le({});return rt.newInstance=()=>Le({}),wS=rt,rt.HighlightJS=rt,rt.default=rt,wS}var MAe=NAe();const tW=qC(MAe);function nW(e,t=[]){return e.flatMap(n=>{const r=[...t,...n.properties?n.properties.className:[]];return n.children?nW(n.children,r):{text:n.value,classes:r}})}function cD(e){return e.value||e.children||[]}function TAe(e){return!!tW.getLanguage(e)}function uD({doc:e,name:t,lowlight:n,defaultLanguage:r}){const s=[];return P3(e,i=>i.type.name===t).forEach(i=>{var o;let a=i.pos+1;const l=i.node.attrs.language||r,u=n.listLanguages(),f=l&&(u.includes(l)||TAe(l)||(o=n.registered)!=null&&o.call(n,l))?cD(n.highlight(l,i.node.textContent)):cD(n.highlightAuto(i.node.textContent));nW(f).forEach(p=>{const g=a+p.text.length;if(p.classes.length){const b=bs.inline(a,g,{class:p.classes.join(" ")});s.push(b)}a=g})}),ar.create(e,s)}function _Ae(e){return typeof e=="function"}function RAe({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(s=>_Ae(t[s])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new zn({key:new Zn("lowlight"),state:{init:(s,{doc:i})=>uD({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(s,i,o,a)=>{const l=o.selection.$head.parent.type.name,u=a.selection.$head.parent.type.name,f=P3(o.doc,g=>g.type.name===e),p=P3(a.doc,g=>g.type.name===e);return s.docChanged&&([l,u].includes(e)||p.length!==f.length||s.steps.some(g=>g.from!==void 0&&g.to!==void 0&&f.some(b=>b.pos>=g.from&&b.pos+b.node.nodeSize<=g.to)))?uD({doc:s.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(s.mapping,s.doc)}},props:{decorations(s){return r.getState(s)}}});return r}var AAe=LV.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...((e=this.parent)==null?void 0:e.call(this))||[],RAe({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function OAe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},b=t.optional(s)+e.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],R={type:x,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},_={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},A=[_,p,a,n,e.C_BLOCK_COMMENT_MODE,f,u],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:A.concat([{begin:/\(/,end:/\)/,keywords:R,contains:A.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:R,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,f,a,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,f,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:R,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,j,_,A,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:R,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:R},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function DAe(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=OAe(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function jAe(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(a);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},g=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${g.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],k={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],R=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:x,literal:S,built_in:[...N,...T,"set","shopt",...R,..._]},contains:[b,e.SHEBANG(),y,p,i,o,k,a,l,u,f,n]}}function IAe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},b=t.optional(s)+e.IDENT_RE+"\\s*\\(",S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[p,a,n,e.C_BLOCK_COMMENT_MODE,f,u],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:k.concat([{begin:/\(/,end:/\)/,keywords:S,contains:k.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,f,a,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,f,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(N,T,k,[p,{begin:e.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:S}}}function zAe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},b=t.optional(s)+e.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],R={type:x,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},_={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},A=[_,p,a,n,e.C_BLOCK_COMMENT_MODE,f,u],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:A.concat([{begin:/\(/,end:/\)/,keywords:R,contains:A.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:R,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,f,a,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,f,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:R,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(I,j,_,A,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:R,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:R},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function LAe(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:s.concat(i),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(f,{illegal:/\n/}),g={className:"subst",begin:/\{/,end:/\}/,keywords:o},b=e.inherit(g,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},x={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]},S=e.inherit(x,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});g.contains=[x,y,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],b.contains=[S,y,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[u,x,y,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",R={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,N,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[k,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},R]}}const PAe=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$Ae=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BAe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],FAe=[...$Ae,...BAe],HAe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),UAe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),VAe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qAe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function GAe(e){const t=e.regex,n=PAe(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+UAe.join("|")+")"},{begin:":(:)?("+VAe.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qAe.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:HAe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+FAe.join("|")+")\\b"}]}}function WAe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function KAe(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function YAe(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function ZAe(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const s={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,i,s,o,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,f=/'[^']*'/,p=t.either(l,u,f),g=t.concat(p,"(\\s*\\.\\s*",p,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:g,className:"attr",starts:{end:/$/,contains:[r,a,i,s,o,n]}}]}}var Qf="[0-9](_*[0-9])*",kb=`\\.(${Qf})`,Eb="[0-9a-fA-F](_*[0-9a-fA-F])*",dD={className:"number",variants:[{begin:`(\\b(${Qf})((${kb})|\\.)?|(${kb}))[eE][+-]?(${Qf})[fFdD]?\\b`},{begin:`\\b(${Qf})((${kb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${kb})[fFdD]?\\b`},{begin:`\\b(${Qf})[fFdD]\\b`},{begin:`\\b0[xX]((${Eb})\\.?|(${Eb})?\\.(${Eb}))[pP][+-]?(${Qf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Eb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function rW(e,t,n){return n===-1?"":e.replace(t,r=>rW(e,t,n-1))}function XAe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+rW("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,dD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},dD,u]}}const fD="[A-Za-z$_][0-9A-Za-z$_]*",QAe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],JAe=["true","false","null","undefined","NaN","Infinity"],sW=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],iW=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],oW=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eOe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tOe=[].concat(oW,sW,iW);function nOe(e){const t=e.regex,n=(K,{after:W})=>{const V="</"+K[0].slice(1);return K.input.indexOf(V,W)!==-1},r=fD,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,W)=>{const V=K[0].length+K.index,P=K.input[V];if(P==="<"||P===","){W.ignoreMatch();return}P===">"&&(n(K,{after:V})||W.ignoreMatch());let H;const X=K.input.substring(V);if(H=X.match(/^\s*=/)){W.ignoreMatch();return}if((H=X.match(/^\s+extends\s+/))&&H.index===0){W.ignoreMatch();return}}},a={$pattern:fD,keyword:QAe,literal:JAe,built_in:tOe,"variable.language":eOe},l="[0-9](_?[0-9])*",u=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,{match:/\$\d+/},p];g.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});const R=[].concat(N,g.contains),_=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(R)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...sW,...iW]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(K){return t.concat("(?!",K.join("|"),")")}const oe={match:t.concat(/\b/,re([...oW,"super","import"].map(K=>`${K}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,N,{match:/\$\d+/},p,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},oe,ne,I,ce,{match:/\$[(.]/}]}}function rOe(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Jf="[0-9](_*[0-9])*",Nb=`\\.(${Jf})`,Mb="[0-9a-fA-F](_*[0-9a-fA-F])*",sOe={className:"number",variants:[{begin:`(\\b(${Jf})((${Nb})|\\.)?|(${Nb}))[eE][+-]?(${Jf})[fFdD]?\\b`},{begin:`\\b(${Jf})((${Nb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Nb})[fFdD]?\\b`},{begin:`\\b(${Jf})[fFdD]\\b`},{begin:`\\b0[xX]((${Mb})\\.?|(${Mb})?\\.(${Mb}))[pP][+-]?(${Jf})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Mb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function iOe(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,s]}]};s.contains.push(o);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=sOe,f=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},g=p;return g.variants[1].contains=[p],p.variants[1].contains=[g],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,f,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,f],relevance:0},e.C_LINE_COMMENT_MODE,f,a,l,o,e.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
553
553
  `},u]}}const oOe=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),aOe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],lOe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],cOe=[...aOe,...lOe],uOe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),aW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),lW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),dOe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),fOe=aW.concat(lW).sort().reverse();function hOe(e){const t=oOe(e),n=fOe,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",o=[],a=[],l=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},u=function(T,R,_){return{className:T,begin:R,relevance:_}},f={$pattern:/[a-z-]+/,keyword:r,attribute:uOe.join(" ")},p={begin:"\\(",end:"\\)",contains:a,keywords:f,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const g=a.concat({begin:/\{/,end:/\}/,contains:o}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},y={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+dOe.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},x={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:a,relevance:0}},S={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:g}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+cOe.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+aW.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+lW.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:g},{begin:"!important"},t.FUNCTION_DISPATCH]},N={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[k]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,S,N,y,k,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function pOe(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function mOe(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,s,i,o]}}function gOe(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(u,{contains:[]}),g=e.inherit(f,{contains:[]});u.contains.push(g),f.contains.push(p);let b=[n,l];return[u,f,p,g].forEach(k=>{k.contains=k.contains.concat(b)}),b=b.concat(u,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,i,u,f,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},s,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function bOe(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function vOe(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},o={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},f=[e.BACKSLASH_ESCAPE,i,l],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],g=(x,S,k="\\1")=>{const N=k==="\\1"?k:t.concat(k,S);return t.concat(t.concat("(?:",x,")"),S,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,k,r)},b=(x,S,k)=>t.concat(t.concat("(?:",x,")"),S,/(?:\\.|[^\\\/])*?/,k,r),y=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:f,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:g("s|tr|y",t.either(...p,{capture:!0}))},{begin:g("s|tr|y","\\(","\\)")},{begin:g("s|tr|y","\\[","\\]")},{begin:g("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=y,o.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:y}}function yOe(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),f=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(le,ce)=>{ce.data._beginMatch=le[1]||le[2]},"on:end":(le,ce)=>{ce.data._beginMatch!==le[1]&&ce.ignoreMatch()}},g=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
554
- ]`,y={scope:"string",variants:[f,u,p,g]},x={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},S=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],N=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],R={keyword:k,literal:(le=>{const ce=[];return le.forEach(F=>{ce.push(F),F.toLowerCase()===F?ce.push(F.toUpperCase()):ce.push(F.toLowerCase())}),ce})(S),built_in:N},_=le=>le.map(ce=>ce.replace(/\|\d+$/,"")),A={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",_(N).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},I=t.concat(r,"\\b(?!\\()"),j={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),I],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),I],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[L,o,j,e.C_BLOCK_COMMENT_MODE,y,x,A]},ne={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",_(k).join("\\b|"),"|",_(N).join("\\b|"),"\\b)"),r,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(ne);const re=[L,j,e.C_BLOCK_COMMENT_MODE,y,x,A],oe={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...re]},...re,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:R,contains:[oe,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},o,ne,j,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},A,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:R,contains:["self",oe,o,j,e.C_BLOCK_COMMENT_MODE,y,x]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},y,x]}}function xOe(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function wOe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function SOe(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",b=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,y=`\\b|${r.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${b}))[eE][+-]?(${g})[jJ]?(?=${y})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${g})[jJ](?=${y})`}]},S={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,x,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,x,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,S,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,k,p]}]}}function COe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kOe(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function EOe(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},g="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},x={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},A=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:o},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);f.contains=A,x.contains=A;const q=[{begin:/^\s*=>/,starts:{end:"$",contains:A}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:A}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(q).concat(u).concat(A)}}function NOe(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:a,literal:l,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:f}},{className:"punctuation",begin:"->"},i]}}const MOe=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TOe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_Oe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ROe=[...TOe,..._Oe],AOe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),OOe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),DOe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jOe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function IOe(e){const t=MOe(e),n=DOe,r=OOe,s="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ROe.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jOe.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:AOe.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function zOe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function LOe(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=f,y=[...u,...l].filter(_=>!f.includes(_)),x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function N(_){return t.concat(/\b/,t.either(..._.map(A=>A.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:N(g),relevance:0};function R(_,{exceptions:A,when:I}={}){const j=I;return A=A||[],_.map(L=>L.match(/\|\d+$/)||A.includes(L)?L:j(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:R(y,{when:_=>_.length<3}),literal:i,type:a,built_in:p},contains:[{scope:"type",match:N(o)},T,k,x,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,S]}}function cW(e){return e?typeof e=="string"?e:e.source:null}function fp(e){return rr("(?=",e,")")}function rr(...e){return e.map(n=>cW(n)).join("")}function POe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ti(...e){return"("+(POe(e).capture?"":"?:")+e.map(r=>cW(r)).join("|")+")"}const b7=e=>rr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),$Oe=["Protocol","Type"].map(b7),hD=["init","self"].map(b7),BOe=["Any","Self"],SS=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],pD=["false","nil","true"],FOe=["assignment","associativity","higherThan","left","lowerThan","none","right"],HOe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],mD=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],uW=ti(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),dW=ti(uW,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),CS=rr(uW,dW,"*"),fW=ti(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_y=ti(fW,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ga=rr(fW,_y,"*"),Tb=rr(/[A-Z]/,_y,"*"),UOe=["attached","autoclosure",rr(/convention\(/,ti("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rr(/objc\(/,ga,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],VOe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qOe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,ti(...$Oe,...hD)],className:{2:"keyword"}},i={match:rr(/\./,ti(...SS)),relevance:0},o=SS.filter(ut=>typeof ut=="string").concat(["_|0"]),a=SS.filter(ut=>typeof ut!="string").concat(BOe).map(b7),l={variants:[{className:"keyword",match:ti(...a,...hD)}]},u={$pattern:ti(/\b\w+/,/#\w+/),keyword:o.concat(HOe),literal:pD},f=[s,i,l],p={match:rr(/\./,ti(...mD)),relevance:0},g={className:"built_in",match:rr(/\b/,ti(...mD),/(?=\()/)},b=[p,g],y={match:/->/,relevance:0},x={className:"operator",relevance:0,variants:[{match:CS},{match:`\\.(\\.|${dW})+`}]},S=[y,x],k="([0-9]_*)+",N="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},R=(ut="")=>({className:"subst",variants:[{match:rr(/\\/,ut,/[0\\tnr"']/)},{match:rr(/\\/,ut,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(ut="")=>({className:"subst",match:rr(/\\/,ut,/[\t ]*(?:[\r\n]|\r\n)/)}),A=(ut="")=>({className:"subst",label:"interpol",begin:rr(/\\/,ut,/\(/),end:/\)/}),I=(ut="")=>({begin:rr(ut,/"""/),end:rr(/"""/,ut),contains:[R(ut),_(ut),A(ut)]}),j=(ut="")=>({begin:rr(ut,/"/),end:rr(/"/,ut),contains:[R(ut),A(ut)]}),L={className:"string",variants:[I(),I("#"),I("##"),I("###"),j(),j("#"),j("##"),j("###")]},q=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:q},re=ut=>{const Ut=rr(ut,/\//),nn=rr(/\//,ut);return{begin:Ut,end:nn,contains:[...q,{scope:"comment",begin:`#(?!.*${nn})`,end:/$/}]}},oe={scope:"regexp",variants:[re("###"),re("##"),re("#"),ne]},le={match:rr(/`/,ga,/`/)},ce={className:"variable",match:/\$\d+/},F={className:"variable",match:`\\$${_y}+`},te=[le,ce,F],K={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:VOe,contains:[...S,T,L]}]}},W={scope:"keyword",match:rr(/@/,ti(...UOe),fp(ti(/\(/,/\s+/)))},V={scope:"meta",match:rr(/@/,ga)},P=[K,W,V],H={match:fp(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_y,"+")},{className:"type",match:Tb,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rr(/\s+&\s+/,fp(Tb)),relevance:0}]},X={begin:/</,end:/>/,keywords:u,contains:[...r,...f,...P,y,H]};H.contains.push(X);const de={match:rr(ga,/\s*:/),keywords:"_|0",relevance:0},fe={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",de,...r,oe,...f,...b,...S,T,L,...te,...P,H]},we={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,H]},pe={begin:ti(fp(rr(ga,/\s*:/)),fp(rr(ga,/\s+/,ga,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ga}]},Re={begin:/\(/,end:/\)/,keywords:u,contains:[pe,...r,...f,...S,T,L,...P,H,fe],endsParent:!0,illegal:/["']/},Ae={match:[/(func|macro)/,/\s+/,ti(le.match,ga,CS)],className:{1:"keyword",3:"title.function"},contains:[we,Re,t],illegal:[/\[/,/%/]},Ze={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[we,Re,t],illegal:/\[|%/},nt={match:[/operator/,/\s+/,CS],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Tb],className:{1:"keyword",3:"title"},contains:[H],keywords:[...FOe,...pD],end:/}/},Be={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ne={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Jt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ga,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[we,...f,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Tb},...f],relevance:0}]};for(const ut of L.variants){const Ut=ut.contains.find(kn=>kn.label==="interpol");Ut.keywords=u;const nn=[...f,...b,...S,T,L,...te];Ut.contains=[...nn,{begin:/\(/,end:/\)/,contains:["self",...nn]}]}return{name:"Swift",keywords:u,contains:[...r,Ae,Ze,Be,Ne,Jt,nt,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},oe,...f,...b,...S,T,L,...te,...P,H,fe]}}const Ry="[A-Za-z$_][0-9A-Za-z$_]*",hW=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],pW=["true","false","null","undefined","NaN","Infinity"],mW=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],gW=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bW=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vW=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yW=[].concat(bW,mW,gW);function GOe(e){const t=e.regex,n=(K,{after:W})=>{const V="</"+K[0].slice(1);return K.input.indexOf(V,W)!==-1},r=Ry,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,W)=>{const V=K[0].length+K.index,P=K.input[V];if(P==="<"||P===","){W.ignoreMatch();return}P===">"&&(n(K,{after:V})||W.ignoreMatch());let H;const X=K.input.substring(V);if(H=X.match(/^\s*=/)){W.ignoreMatch();return}if((H=X.match(/^\s+extends\s+/))&&H.index===0){W.ignoreMatch();return}}},a={$pattern:Ry,keyword:hW,literal:pW,built_in:yW,"variable.language":vW},l="[0-9](_?[0-9])*",u=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,{match:/\$\d+/},p];g.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});const R=[].concat(N,g.contains),_=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(R)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...mW,...gW]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(K){return t.concat("(?!",K.join("|"),")")}const oe={match:t.concat(/\b/,re([...bW,"super","import"].map(K=>`${K}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,N,{match:/\$\d+/},p,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},oe,ne,I,ce,{match:/\$[(.]/}]}}function WOe(e){const t=e.regex,n=GOe(e),r=Ry,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Ry,keyword:hW.concat(l),literal:pW,built_in:yW.concat(s),"variable.language":vW},f={className:"meta",begin:"@"+r},p=(x,S,k)=>{const N=x.contains.findIndex(T=>T.label===S);if(N===-1)throw new Error("can not find mode to replace");x.contains.splice(N,1,k)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(f);const g=n.contains.find(x=>x.scope==="attr"),b=Object.assign({},g,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,g,b]),n.contains=n.contains.concat([f,i,o,b]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",a);const y=n.contains.find(x=>x.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function KOe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),g=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,f,p,g,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[g]}]}}function YOe(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,o,s,e.QUOTE_STRING_MODE,l,u,a]}}function ZOe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function XOe(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},a=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},y={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},S=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},g,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},y,x,i,o],k=[...S];return k.pop(),k.push(a),b.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const QOe={arduino:DAe,bash:jAe,c:IAe,cpp:zAe,csharp:LAe,css:GAe,diff:WAe,go:KAe,graphql:YAe,ini:ZAe,java:XAe,javascript:nOe,json:rOe,kotlin:iOe,less:hOe,lua:pOe,makefile:mOe,markdown:gOe,objectivec:bOe,perl:vOe,php:yOe,"php-template":xOe,plaintext:wOe,python:SOe,"python-repl":COe,r:kOe,ruby:EOe,rust:NOe,scss:IOe,shell:zOe,sql:LOe,swift:qOe,typescript:WOe,vbnet:KOe,wasm:YOe,xml:ZOe,yaml:XOe},gD={},JOe="hljs-";function eDe(e){const t=tW.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:o,registered:a};function n(l,u,f){const p=f||gD,g=typeof p.prefix=="string"?p.prefix:JOe;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:tDe,classPrefix:g});const b=t.highlight(u,{ignoreIllegals:!0,language:l});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const y=b._emitter.root,x=y.data;return x.language=b.language,x.relevance=b.relevance,y}function r(l,u){const p=(u||gD).subset||s();let g=-1,b=0,y;for(;++g<p.length;){const x=p[g];if(!t.getLanguage(x))continue;const S=n(x,l,u);S.data&&S.data.relevance!==void 0&&S.data.relevance>b&&(b=S.data.relevance,y=S)}return y||{type:"root",children:[],data:{language:void 0,relevance:b}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let f;for(f in l)Object.hasOwn(l,f)&&t.registerLanguage(f,l[f])}}function o(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let f;for(f in l)if(Object.hasOwn(l,f)){const p=l[f];t.registerAliases(typeof p=="string"?p:[...p],{languageName:f})}}}function a(l){return!!t.getLanguage(l)}}class tDe{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const nDe=AAe.extend({addOptions(){return{...this.parent?.(),lowlight:eDe(QOe),defaultLanguage:null,HTMLAttributes:{class:"block-node"},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,enableTabIndentation:!1,tabSize:4}}}),rDe=VG.extend({addProseMirrorPlugins(){return[...this.parent?.()||[],new zn({props:{handleKeyDown:(e,t)=>(t.key==="Enter"&&this.editor.commands.unsetColor(),!1)}})]}}),sDe=PV.extend({addKeyboardShortcuts(){return{"Mod-Alt--":()=>this.editor.commands.insertContent({type:this.name})}}});function iDe({initialWidth:e,initialHeight:t,contentWidth:n,contentHeight:r,gridInterval:s,minWidth:i,minHeight:o,maxWidth:a,onDimensionsChange:l}){const[u,f]=w.useState({width:Math.max(e??i,i),height:Math.max(t??o,o)}),[p,g]=w.useState(1/0),[b,y]=w.useState(0),[x,S]=w.useState(u),[k,N]=w.useState(),T=w.useCallback((j,L)=>{const q=Math.max(i,Math.min(n??i,s/100*L));return Math.min(L,Math.max(j,q))},[s,n,i]),R=w.useCallback(j=>{j.preventDefault();const L=(k==="left"?b-j.pageX:j.pageX-b)*2,q=s/100*p,ne=x.width+L,re=Math.round(ne/q)*q,oe=T(re,p),le=r&&n?r/n:1;f({width:Math.max(oe,i),height:Math.max(n?oe*le:r??o,o)})},[T,k,p,b,s,r,n,x.width,i,o]),_=w.useCallback(j=>{j.preventDefault(),j.stopPropagation(),y(0),N(void 0),l?.(u)},[l,u]),A=w.useCallback(j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),f({width:Math.max(x.width,i),height:Math.max(x.height,o)}),N(void 0))},[x,i,o]),I=w.useCallback(j=>L=>{L.preventDefault(),L.stopPropagation(),g(a),S({width:Math.max(T(u.width,a),i),height:Math.max(u.height,o)}),y(L.pageX),N(j)},[a,T,u.width,u.height,i,o]);return w.useEffect(()=>{if(k)return document.addEventListener("keydown",A),document.addEventListener("pointermove",R),document.addEventListener("pointerup",_),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",_)}},[k,A,R,_]),{initiateResize:I,isResizing:!!k,updateDimensions:f,currentWidth:Math.max(u.width,i),currentHeight:Math.max(u.height,o)}}const IC=({ref:e,className:t,isResizing:n=!1,...r})=>h.jsx("div",{className:ee("absolute top-1/2 h-10 max-h-full w-1.5 -translate-y-1/2 transform cursor-col-resize rounded border border-solid border-[var(--mt-transparent-foreground)] bg-[var(--mt-bg-secondary)] p-px transition-all","opacity-0 [backdrop-filter:saturate(1.8)_blur(20px)]",{"opacity-80":n,"group-hover/node-image:opacity-80":!n},"before:absolute before:inset-y-0 before:-right-1 before:-left-1",t),ref:e,...r});IC.displayName="ResizeHandle";function oDe(){return ie.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-unzoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z"}))}function aDe(){return ie.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-zoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z"}))}function lDe(e){return typeof Element>"u"?!1:e instanceof Element}const Ay=(e,t)=>lDe(t)&&t.tagName.toUpperCase()===e,v7=e=>Ay("DIV",e)||Ay("SPAN",e),Oy=e=>Ay("IMG",e),bD=e=>e.complete&&e.naturalHeight!==0,Yb=e=>Ay("SVG",e),xW=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),cDe=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:s})=>{const i=xW({height:r,offset:n,width:s}),o=s>r?s/t:r/e;return i>1?o:i*o},vd=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:s,targetWidth:i})=>e===0||t===0?1:!n&&s!==0&&i!==0?cDe({containerHeight:e,containerWidth:t,offset:r,targetHeight:s,targetWidth:i}):xW({height:e,offset:r,width:t}),uDe=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,vD=e=>{if(e!==null){if(Oy(e))return e.currentSrc===""?void 0:e.currentSrc;if(v7(e)){const{backgroundImage:t}=window.getComputedStyle(e);if(t!=="")return uDe.exec(t)?.[1]}}},dDe=e=>{if(e!==null)return Oy(e)?e.alt:e.getAttribute("aria-label")??void 0},fDe=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:s,offset:i,targetHeight:o,targetWidth:a})=>{const l=vd({containerHeight:e,containerWidth:r,hasScalableSrc:s,offset:i,targetHeight:o,targetWidth:a});return{top:n,left:t,width:r*l,height:e*l,transform:`translate(0,0) scale(${1/l})`}},yo=({position:e,relativeNum:t})=>{const n=parseFloat(e);return e.endsWith("%")?t*n/100:n},hDe=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:s,objectFit:i,objectPosition:o,offset:a,targetHeight:l,targetWidth:u})=>{let f=i;if(f==="scale-down"&&(u<=r&&l<=e?f="none":f="contain"),f==="cover"||f==="contain"){const p=r/u,g=e/l,b=f==="cover"?Math.max(p,g):Math.min(p,g),[y="50%",x="50%"]=o.split(" "),S=yo({position:y,relativeNum:r-u*b}),k=yo({position:x,relativeNum:e-l*b}),N=vd({containerHeight:l*b,containerWidth:u*b,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{top:n+k,left:t+S,width:u*b*N,height:l*b*N,transform:`translate(0,0) scale(${1/N})`}}else if(f==="none"){const[p="50%",g="50%"]=o.split(" "),b=yo({position:p,relativeNum:r-u}),y=yo({position:g,relativeNum:e-l}),x=vd({containerHeight:l,containerWidth:u,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{top:n+y,left:t+b,width:u*x,height:l*x,transform:`translate(0,0) scale(${1/x})`}}else if(f==="fill"){const p=r/u,g=e/l,b=Math.max(p,g),y=vd({containerHeight:l*b,containerWidth:u*b,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{width:r*y,height:e*y,transform:`translate(0,0) scale(${1/y})`}}else return{}},pDe=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:s,containerWidth:i,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u})=>{if(t==="cover"||t==="contain"){const f=i/u,p=n/l,g=t==="cover"?Math.max(f,p):Math.min(f,p),[b="50%",y="50%"]=e.split(" "),x=yo({position:b,relativeNum:i-u*g}),S=yo({position:y,relativeNum:n-l*g}),k=vd({containerHeight:l*g,containerWidth:u*g,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+S,left:r+x,width:u*g*k,height:l*g*k,transform:`translate(0,0) scale(${1/k})`}}else if(t==="auto"){const[f="50%",p="50%"]=e.split(" "),g=yo({position:f,relativeNum:i-u}),b=yo({position:p,relativeNum:n-l}),y=vd({containerHeight:l,containerWidth:u,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+b,left:r+g,width:u*y,height:l*y,transform:`translate(0,0) scale(${1/y})`}}else{const[f="50%",p="50%"]=t.split(" "),g=yo({position:f,relativeNum:i}),b=yo({position:p,relativeNum:n}),y=g/u,x=b/l,S=Math.min(y,x),[k="50%",N="50%"]=e.split(" "),T=yo({position:k,relativeNum:i-u*S}),R=yo({position:N,relativeNum:n-l*S}),_=vd({containerHeight:l*S,containerWidth:u*S,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+R,left:r+T,width:u*S*_,height:l*S*_,transform:`translate(0,0) scale(${1/_})`}}},mDe=/\.svg$/i,gDe=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:s,offset:i,shouldRefresh:o,targetEl:a})=>{const l=n||t?.slice(0,18)==="data:image/svg+xml"||e||t!==void 0&&mDe.test(t),u=a.getBoundingClientRect(),f=window.getComputedStyle(a),p=s!=null&&v7(a),g=s!=null&&!p,b=s!=null&&s.naturalHeight!==0?s.naturalHeight:u.height,y=s!=null&&s.naturalWidth!==0?s.naturalWidth:u.width,x=fDe({containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,offset:i,targetHeight:b,targetWidth:y}),S=g?hDe({containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,objectFit:f.objectFit,objectPosition:f.objectPosition,offset:i,targetHeight:b,targetWidth:y}):void 0,k=p?pDe({backgroundPosition:f.backgroundPosition,backgroundSize:f.backgroundSize,containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,offset:i,targetHeight:b,targetWidth:y}):void 0,N={...x,...S,...k};if(r){const T=window.innerWidth/2,R=window.innerHeight/2,_=parseFloat(String(N.left??0))+parseFloat(String(N.width??0))/2,A=parseFloat(String(N.top??0))+parseFloat(String(N.height??0))/2,I=T-_,j=R-A;o&&(N.transitionDuration="0.01ms"),N.transform=`translate(${I}px,${j}px) scale(1)`}return N},kS=e=>{if(e==null)return{};if(Yb(e)){const{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{const r=t.getBoundingClientRect();return{height:n.height,left:r.left-n.left,top:r.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},bDe=e=>{const t="-zoom",n=["clip-path","fill","mask","marker-start","marker-mid","marker-end"],r=new Map;if(e.hasAttribute("id")){const{id:s}=e,i=s+t;r.set(s,i);const o=e;o.id=i}e.querySelectorAll("[id]").forEach(s=>{const{id:i}=s,o=i+t;r.set(i,o);const a=s;a.id=o}),r.forEach((s,i)=>{const o=`url(#${i})`,a=`url(#${s})`,l=n.map(u=>`[${u}="${o}"]`).join(", ");e.querySelectorAll(l).forEach(u=>{n.forEach(f=>{u.getAttribute(f)===o&&u.setAttribute(f,a)})})}),e.querySelectorAll("style").forEach(s=>{r.forEach((i,o)=>{const{textContent:a}=s;if(a!==""){const l=s;l.textContent=a.replaceAll(`#${o}`,`#${i}`)}})})},vDe=["img","svg",'[role="img"]',"[data-zoom]"].map(e=>`${e}:not([aria-hidden="true"])`).join(","),yD={overflow:"",width:""};function yDe(){const e=document.querySelector("[data-rmiz-portal]");if(e!=null)return e;const t=document.createElement("div");return t.setAttribute("data-rmiz-portal",""),document.body.appendChild(t),t}function xDe(e){e.preventDefault()}function wDe(e){return ie.createElement(wW,{...e})}class wW extends ie.Component{constructor(){super(...arguments),this.state={id:"",isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:"UNLOADED",shouldRefresh:!1,styleGhost:{}},this.refContent=ie.createRef(),this.refDialog=ie.createRef(),this.refModalContent=ie.createRef(),this.refModalImg=ie.createRef(),this.refWrap=ie.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=yD,this.styleModalImg={},this.handleModalStateChange=t=>{const{state:{modalState:n}}=this;t!=="LOADING"&&n==="LOADING"?(this.loadZoomImg(),window.addEventListener("resize",this.handleResize,{passive:!0}),window.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),window.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),window.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),window.addEventListener("touchcancel",this.handleTouchCancel,{passive:!0}),document.addEventListener("keydown",this.handleKeyDown,!0)):t!=="LOADED"&&n==="LOADED"?window.addEventListener("wheel",this.handleWheel,{passive:!0}):t!=="UNLOADING"&&n==="UNLOADING"?(this.ensureImgTransitionEnd(),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),document.removeEventListener("keydown",this.handleKeyDown,!0)):t!=="UNLOADED"&&n==="UNLOADED"&&(this.bodyScrollEnable(),window.removeEventListener("resize",this.handleResize),this.refModalImg.current?.removeEventListener("transitionend",this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{const t=()=>Math.random().toString(16).slice(-4);this.setState({id:t()+t()+t()})},this.setAndTrackImg=()=>{const{refContent:{current:t}}=this;t!=null&&(this.imgEl=t.querySelector(vDe),this.imgEl!==null?(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener("load",this.handleImgLoad),this.imgEl.addEventListener("click",this.handleZoom),this.state.loadedImgEl==null&&this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(n=>{const[r]=n;r?.target!==void 0&&(this.imgEl=r.target,this.setState({styleGhost:kS(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver==null&&(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:kS(this.imgEl)})}),this.contentChangeObserver.observe(t,{attributes:!0,childList:!0,subtree:!0}))):this.contentNotFoundChangeObserver==null&&(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(t,{childList:!0,subtree:!0})))},this.handleIfZoomChanged=t=>{const{props:{isZoomed:n}}=this;!t&&n?this.zoom():t&&!n&&this.unzoom()},this.handleImgLoad=()=>{const t=vD(this.imgEl);if(t==null||t==="")return;const n=new Image,{imgEl:r}=this;if(Oy(r)){const{sizes:i,srcset:o,crossOrigin:a}=r;n.sizes=i,n.srcset=o,n.crossOrigin=a}n.src=t;const s=()=>{this.setState({loadedImgEl:n,styleGhost:kS(this.imgEl)})};n.decode().then(s).catch(()=>{if(bD(n)){s();return}n.onload=s})},this.handleZoom=t=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:t})},this.handleUnzoom=t=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:t})},this.handleBtnUnzoomClick=t=>{t.preventDefault(),t.stopPropagation(),this.handleUnzoom(t)},this.handleDialogClick=t=>{(t.target===this.refModalContent.current||t.target===this.refModalImg.current)&&(t.stopPropagation(),this.handleUnzoom(t))},this.handleDialogClose=t=>{t.stopPropagation(),this.handleUnzoom(t)},this.handleKeyDown=t=>{t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.handleUnzoom(t))},this.handleWheel=t=>{t.ctrlKey||(t.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(t)}))},this.handleTouchStart=t=>{if(t.touches.length>1){this.isScaling=!0;return}const{changedTouches:n}=t,[r]=n;if(n.length===1&&r!==void 0){const{screenY:s}=r;this.touchYStart=s}},this.handleTouchMove=t=>{const n=window.visualViewport?.scale??1,{changedTouches:r}=t,[s]=r;if(this.props.canSwipeToUnzoom&&!this.isScaling&&n<=1&&this.touchYStart!=null&&s!==void 0){const{screenY:i}=s;this.touchYEnd=i;const o=Math.max(this.touchYStart,this.touchYEnd),a=Math.min(this.touchYStart,this.touchYEnd);Math.abs(o-a)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(t))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Yb(this.imgEl))&&window.getComputedStyle(this.imgEl).display!=="none",this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener("transitionend",this.handleImgTransitionEnd),this.setState({modalState:"LOADING"})},this.unzoom=()=>{this.setState({modalState:"UNLOADING"})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState==="LOADING"?this.setState({modalState:"LOADED"}):this.state.modalState==="UNLOADING"&&this.setState({shouldRefresh:!1,modalState:"UNLOADED"})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){const{transitionDuration:t}=window.getComputedStyle(this.refModalImg.current),n=parseFloat(t);if(n!==0&&!Number.isNaN(n)){const r=n*(t.endsWith("ms")?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,r)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};const{body:{clientWidth:t}}=document;document.body.style.overflow="hidden",document.body.style.width=`${t}px`},this.bodyScrollEnable=()=>{const{prevBodyAttrs:{overflow:t,width:n}}=this;document.body.style.width=n,document.body.style.overflow=t,this.prevBodyAttrs=yD},this.loadZoomImg=()=>{const{props:{zoomImg:t}}=this;if(t==null)return;const{src:n}=t;if(n!==void 0&&n!==""){const r=new Image;r.sizes=t.sizes??"",r.srcset=t.srcSet??"",r.crossOrigin=t.crossOrigin??void 0,r.src=n;const s=()=>{this.setState({isZoomImgLoaded:!0})};r.decode().then(s).catch(()=>{if(bD(r)){s();return}r.onload=s})}},this.UNSAFE_handleSvg=()=>{const{imgEl:t,refModalImg:n,styleModalImg:r}=this;if(Yb(t)){const s=t.cloneNode(!0);bDe(s),s.style.width=`${r.width??0}px`,s.style.height=`${r.height??0}px`,s.addEventListener("click",this.handleUnzoom),n.current?.firstChild?.remove(),n.current?.appendChild(s)}}}render(){const{handleBtnUnzoomClick:t,handleDialogClick:n,handleDialogClose:r,handleUnzoom:s,handleZoom:i,imgEl:o,props:{a11yNameButtonUnzoom:a,a11yNameButtonZoom:l,children:u,classDialog:f,IconUnzoom:p,IconZoom:g,isZoomed:b,wrapElement:y,ZoomContent:x,zoomImg:S,zoomMargin:k},refContent:N,refDialog:T,refModalContent:R,refModalImg:_,refWrap:A,state:{id:I,isZoomImgLoaded:j,loadedImgEl:L,modalState:q,shouldRefresh:ne,styleGhost:re}}=this,oe=`rmiz-modal-${I}`,le=`rmiz-modal-img-${I}`,ce=v7(o),F=Oy(o),te=Yb(o),K=dDe(o),W=vD(o),V=F?o.sizes:void 0,P=F?o.srcset:void 0,H=F?o.crossOrigin:void 0,X=S?.src!==void 0&&S.src!=="",de=this.hasImage(),fe=K!==void 0&&K!==""?`${l}: ${K}`:l,we=q==="LOADING"||q==="LOADED",pe=de?"found":"not-found",Re=q==="UNLOADED"||q==="UNLOADING"?"hidden":"visible",Ae={visibility:q==="UNLOADED"?"visible":"hidden"};this.styleModalImg=de&&o!==null?gDe({hasZoomImg:X,imgSrc:W,isSvg:te,isZoomed:b&&we,loadedImgEl:L,offset:k,shouldRefresh:ne,targetEl:o}):{};let Ze=null;if(de){const nt=F||ce?ie.createElement("img",{alt:K,crossOrigin:H,sizes:V,src:W,srcSet:P,...j&&q==="LOADED"?S:{},"data-rmiz-modal-img":"",height:this.styleModalImg.height??void 0,id:le,ref:_,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):te?ie.createElement("div",{"data-rmiz-modal-img":!0,ref:_,style:this.styleModalImg}):null,at=ie.createElement("button",{"aria-label":a,"data-rmiz-btn-unzoom":"",onClick:t,type:"button"},ie.createElement(p,null));Ze=x==null?ie.createElement(ie.Fragment,null,nt,at):ie.createElement(x,{buttonUnzoom:at,modalState:q,img:nt,isZoomImgLoaded:j,onUnzoom:s})}return ie.createElement(y,{"aria-owns":oe,"data-rmiz":"",ref:A},ie.createElement(y,{"data-rmiz-content":pe,ref:N,style:Ae},u),de&&ie.createElement(y,{"data-rmiz-ghost":"",style:re},ie.createElement("button",{"aria-label":fe,"data-rmiz-btn-zoom":"",onClick:i,type:"button"},ie.createElement(g,null))),de&&By.createPortal(ie.createElement("dialog",{"aria-labelledby":le,"aria-modal":"true",className:f,"data-rmiz-modal":"",id:oe,onClick:n,onClose:r,onCancel:xDe,ref:T,role:"dialog"},ie.createElement("div",{"data-rmiz-modal-overlay":Re}),ie.createElement("div",{"data-rmiz-modal-content":"",ref:R},Ze)),yDe()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!=="UNLOADED"&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener("load",this.handleImgLoad),this.imgEl?.removeEventListener("click",this.handleZoom),this.refModalImg.current?.removeEventListener("transitionend",this.handleImgTransitionEnd),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),window.removeEventListener("resize",this.handleResize),document.removeEventListener("keydown",this.handleKeyDown,!0)}componentDidUpdate(t,n){this.handleModalStateChange(n.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(t.isZoomed)}}wW.defaultProps={a11yNameButtonUnzoom:"Minimize image",a11yNameButtonZoom:"Expand image",canSwipeToUnzoom:!0,IconUnzoom:oDe,IconZoom:aDe,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:"div",zoomMargin:0};const y7=({children:e,className:t,...n})=>h.jsx("div",{className:ee("absolute top-3 right-3 flex flex-row rounded px-0.5 opacity-0 group-hover/node-image:opacity-100","border-[0.5px] bg-[var(--mt-bg-secondary)] [backdrop-filter:saturate(1.8)_blur(20px)]",t),...n,children:e});y7.displayName="ActionWrapper";const Dy=({icon:e,tooltip:t,className:n,...r})=>h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",className:ee("text-muted-foreground hover:text-foreground relative flex h-7 w-7 flex-row rounded-none p-0","bg-transparent hover:bg-transparent",n),...r,children:e})}),h.jsx(Va,{side:"bottom",children:t})]});Dy.displayName="ActionButton";const SDe=[{key:"onView",icon:h.jsx(p_e,{}),tooltip:"View image"},{key:"onDownload",icon:h.jsx(GTe,{}),tooltip:"Download image"},{key:"onCopy",icon:h.jsx(PTe,{}),tooltip:"Copy image to clipboard"},{key:"onCopyLink",icon:h.jsx(MG,{}),tooltip:"Copy image link",isLink:!0}],SW=({shouldMerge:e=!1,isLink:t=!1,...n})=>{const[r,s]=w.useState(!1),i=w.useCallback((a,l)=>{a.preventDefault(),a.stopPropagation(),l?.()},[]),o=w.useMemo(()=>SDe.filter(a=>t||!a.isLink),[t]);return h.jsx(y7,{className:ee({"opacity-100":r}),children:e?h.jsxs(Ao,{open:r,onOpenChange:s,children:[h.jsx(Oo,{asChild:!0,children:h.jsx(Dy,{icon:h.jsx(NG,{}),tooltip:"Open menu",onClick:a=>a.preventDefault()})}),h.jsx(Do,{className:"w-56",align:"end",children:o.map(({key:a,icon:l,tooltip:u})=>h.jsx(Ra,{onClick:f=>i(f,n[a]),children:h.jsxs("div",{className:"flex flex-row items-center gap-2",children:[l,h.jsx("span",{children:u})]})},a))})]}):o.map(({key:a,icon:l,tooltip:u})=>h.jsx(Dy,{icon:l,tooltip:u,onClick:f=>i(f,n[a])},a))})};SW.displayName="ImageActions";const CDe=({editor:e,node:t,src:n,onViewClick:r})=>{const s=_C(n),i=w.useCallback(()=>{r(!0)},[r]),o=w.useCallback(()=>{e.commands.downloadImage({src:t.attrs.src,alt:t.attrs.alt})},[e.commands,t.attrs.alt,t.attrs.src]),a=w.useCallback(()=>{e.commands.copyImage({src:t.attrs.src})},[e.commands,t.attrs.src]),l=w.useCallback(()=>{e.commands.copyLink({src:t.attrs.src})},[e.commands,t.attrs.src]),u=w.useCallback(()=>{e.commands.command(({tr:f,dispatch:p})=>{const{selection:g}=f,b=f.doc.nodeAt(g.from);return b&&b.type.name==="image"&&p?(f.deleteSelection(),!0):!1})},[e.commands]);return{isLink:s,onView:i,onDownload:o,onCopy:a,onCopyLink:l,onRemoveImg:u}},CW=function({className:t,...n}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:ee("animate-spin",t),...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})};CW.displayName="Spinner";const kW=w.memo(CW),EW=w.memo(()=>h.jsx("div",{className:ee("flex flex-row items-center justify-center","absolute inset-0 rounded bg-[var(--mt-overlay)] opacity-100 transition-opacity"),children:h.jsx(kW,{className:"size-7"})}));EW.displayName="ImageOverlay";const ES=600,kDe=120,xD=120,EDe=e=>({src:typeof e=="string"?e:e.src,id:typeof e=="string"?ky():e.id}),NDe=({editor:e,node:t,selected:n,updateAttributes:r})=>{const{src:s,width:i,height:o,fileName:a}=t.attrs,l=w.useRef(!1),u=w.useMemo(()=>typeof s=="string"?s:s.src,[s]),[f,p]=w.useState({src:u,isServerUploading:!1,imageLoaded:!1,isZoomed:!1,error:!1,naturalSize:{width:i,height:o}}),g=w.useRef(null),[b,y]=w.useState(null),x=w.useCallback(({width:W,height:V})=>{r({width:W,height:V})},[r]),S=f.naturalSize.width/f.naturalSize.height,k=ES*S,N=g.current?parseFloat(getComputedStyle(g.current).getPropertyValue("--editor-width")):1/0,{isLink:T,onView:R,onDownload:_,onCopy:A,onCopyLink:I,onRemoveImg:j}=CDe({editor:e,node:t,src:f.src,onViewClick:W=>p(V=>({...V,isZoomed:W}))}),{currentWidth:L,currentHeight:q,updateDimensions:ne,initiateResize:re,isResizing:oe}=iDe({initialWidth:i??f.naturalSize.width,initialHeight:o??f.naturalSize.height,contentWidth:f.naturalSize.width,contentHeight:f.naturalSize.height,gridInterval:.1,onDimensionsChange:x,minWidth:xD,minHeight:kDe,maxWidth:N>0?N:k}),le=w.useMemo(()=>L<=180,[L]),ce=w.useCallback(W=>{const V=W.target,P={width:V.naturalWidth,height:V.naturalHeight};p(H=>({...H,naturalSize:P,imageLoaded:!0})),r({width:V.width||P.width,height:V.height||P.height,alt:V.alt,title:V.title}),i||ne(H=>({...H,width:P.width}))},[i,r,ne]),F=w.useCallback(()=>{p(W=>({...W,error:!0,imageLoaded:!0}))},[]),te=w.useCallback(W=>V=>{y(W),re(W)(V)},[re]),K=w.useCallback(()=>{y(null)},[]);return w.useEffect(()=>{oe||K()},[oe,K]),w.useEffect(()=>{(async()=>{if(!u.startsWith("blob:")||l.current)return;l.current=!0;const V=e.options.extensions.find(H=>H.name==="image"),{uploadFn:P}=V?.options??{};if(!P){try{const H=await N_e(u);p(X=>({...X,src:H})),r({src:H})}catch{p(H=>({...H,error:!0}))}return}try{p(pe=>({...pe,isServerUploading:!0}));const X=await(await fetch(u)).blob(),de=new File([X],a,{type:X.type}),fe=await P(de,e),we=EDe(fe);p(pe=>({...pe,...we,isServerUploading:!1})),r(we)}catch{p(H=>({...H,error:!0,isServerUploading:!1}))}})()},[e,a,u,r]),h.jsx(NTe,{ref:g,"data-drag-handle":!0,className:"relative text-center leading-none",children:h.jsx("div",{className:"group/node-image relative mx-auto rounded-md object-contain",style:{maxWidth:`min(${k}px, 100%)`,width:L,maxHeight:ES,aspectRatio:`${f.naturalSize.width} / ${f.naturalSize.height}`},children:h.jsxs("div",{className:ee("relative flex h-full cursor-default flex-col items-center gap-2 rounded",{"outline-primary outline-2 outline-offset-1":n||oe}),children:[h.jsxs("div",{className:"h-full contain-paint",children:[h.jsxs("div",{className:"relative h-full",children:[f.isServerUploading&&!f.error&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx(kW,{className:"size-7"})}),f.error&&h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx(n_e,{className:"text-destructive size-8"}),h.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Failed to load image"})]}),h.jsx(wDe,{isZoomed:f.isZoomed,onZoomChange:()=>p(W=>({...W,isZoomed:!1})),children:h.jsx("img",{className:ee("h-auto rounded object-contain transition-shadow",{"opacity-0":!f.imageLoaded||f.error}),style:{maxWidth:`min(100%, ${k}px)`,minWidth:`${xD}px`,maxHeight:ES},width:L,height:q,src:f.src,onError:F,onLoad:ce,alt:t.attrs.alt||"",title:t.attrs.title||"",id:t.attrs.id})})]}),f.isServerUploading&&h.jsx(EW,{}),e.isEditable&&f.imageLoaded&&!f.error&&!f.isServerUploading&&h.jsxs(h.Fragment,{children:[h.jsx(IC,{onPointerDown:te("left"),className:ee("left-1",{hidden:oe&&b==="right"}),isResizing:oe&&b==="left"}),h.jsx(IC,{onPointerDown:te("right"),className:ee("right-1",{hidden:oe&&b==="left"}),isResizing:oe&&b==="right"})]})]}),f.error&&h.jsx(y7,{children:h.jsx(Dy,{icon:h.jsx(x_e,{}),tooltip:"Remove image",onClick:j})}),!oe&&!f.error&&!f.isServerUploading&&h.jsx(SW,{shouldMerge:le,isLink:T,onView:R,onDownload:_,onCopy:A,onCopyLink:I})]})})})},x7=(e,t,n)=>{const r=e instanceof Error?e:new Error("Unknown error");n?.(r,t)},MDe=e=>{const[t,n]=e.split(","),r=t.split(":")[1].split(";")[0],s=r.split("/")[1],i=atob(n),o=new Uint8Array(i.length);for(let l=0;l<i.length;l++)o[l]=i.charCodeAt(l);return{blob:new Blob([o],{type:r}),extension:s}},TDe=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch image");const n=await t.blob(),r=n.type.split(/\/|\+/)[1];return{blob:n,extension:r}},_De=async e=>e.startsWith("data:")?MDe(e):TDe(e),RDe=async(e,t,n)=>{const r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=`${t}.${n}`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)},ADe=async(e,t)=>{const{src:n,alt:r}=e,s=r||"image";try{const{blob:i,extension:o}=await _De(n);await RDe(i,s,o),t.onActionSuccess?.({...e,action:"download"})}catch(i){x7(i,{...e,action:"download"},t.onActionError)}},ODe=async(e,t)=>{const{src:n}=e;try{const s=await(await fetch(n)).blob();await navigator.clipboard.write([new ClipboardItem({[s.type]:s})]),t.onActionSuccess?.({...e,action:"copyImage"})}catch(r){x7(r,{...e,action:"copyImage"},t.onActionError)}},DDe=async(e,t)=>{const{src:n}=e;try{await navigator.clipboard.writeText(n),t.onActionSuccess?.({...e,action:"copyLink"})}catch(r){x7(r,{...e,action:"copyLink"},t.onActionError)}},jDe=mU.extend({atom:!0,addOptions(){return{...this.parent?.()||{},inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1,allowedMimeTypes:[],maxFileSize:0,uploadFn:void 0,onToggle:void 0,downloadImage:void 0,copyImage:void 0,copyLink:void 0}},addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},id:{default:null},width:{default:null},height:{default:null},fileName:{default:null}}},addCommands(){return{setImages:e=>({commands:t})=>{const[n,r]=Ey(e,{allowedMimeTypes:this.options.allowedMimeTypes,maxFileSize:this.options.maxFileSize,allowBase64:this.options.allowBase64});return r.length>0&&this.options.onValidationError&&this.options.onValidationError(r),n.length>0?t.insertContent(n.map(s=>{if(s.src instanceof File){const i=URL.createObjectURL(s.src),o=ky();return{type:this.type.name,attrs:{id:o,src:i,alt:s.alt,title:s.title,fileName:s.src.name}}}else return{type:this.type.name,attrs:{id:ky(),src:s.src,alt:s.alt,title:s.title,fileName:null}}})):!1},downloadImage:e=>()=>((this.options.downloadImage||ADe)({...e,action:"download"},this.options),!0),copyImage:e=>()=>((this.options.copyImage||ODe)({...e,action:"copyImage"},this.options),!0),copyLink:e=>()=>((this.options.copyLink||DDe)({...e,action:"copyLink"},this.options),!0),toggleImage:()=>({editor:e})=>{const t=document.createElement("input");return t.type="file",t.accept=this.options.allowedMimeTypes.join(","),t.onchange=()=>{const n=t.files;if(!n)return;const[r,s]=Ey(Array.from(n),{allowedMimeTypes:this.options.allowedMimeTypes,maxFileSize:this.options.maxFileSize,allowBase64:this.options.allowBase64});return s.length>0&&this.options.onValidationError?(this.options.onValidationError(s),!1):(r.length===0||this.options.onToggle&&this.options.onToggle(e,r,e.state.selection.from),!1)},t.click(),!0}}},onTransaction({transaction:e}){e.steps.forEach(t=>{t instanceof ms&&t.slice.size===0&&e.before.content.cut(t.from,t.to).forEach(r=>{if(r.type.name==="image"){const s=r.attrs;s.src.startsWith("blob:")&&URL.revokeObjectURL(s.src),this.options.onImageRemoved?.(s)}})})},addNodeView(){return OTe(NDe,{className:"block-node"})}}),IDe=on.create({addKeyboardShortcuts(){return{"Mod-\\":()=>this.editor.commands.unsetAllMarks()}}}),zDe=on.create({name:"resetMarksOnEnter",addKeyboardShortcuts(){return{Enter:({editor:e})=>e.isActive("bold")||e.isActive("italic")||e.isActive("strike")||e.isActive("underline")||e.isActive("code")?(e.commands.splitBlock({keepMarks:!1}),!0):!1}}}),LDe=e=>{const{key:t,editor:n,onPaste:r,onDrop:s,onValidationError:i,allowedMimeTypes:o,maxFileSize:a}=e;return new zn({key:t||new Zn("fileHandler"),props:{handleDrop(l,u){const{dataTransfer:f}=u;if(!f?.files.length)return!1;u.preventDefault(),u.stopPropagation();const p=l.posAtCoords({left:u.clientX,top:u.clientY}),[g,b]=Ey(Array.from(f.files),{allowedMimeTypes:o,maxFileSize:a,allowBase64:e.allowBase64});return b.length>0&&i&&i(b),g.length>0&&s&&s(n,g,p?.pos??0),!0},handlePaste(l,u){const{clipboardData:f}=u;if(!f?.files.length)return!1;u.preventDefault(),u.stopPropagation();const[p,g]=Ey(Array.from(f.files),{allowedMimeTypes:o,maxFileSize:a,allowBase64:e.allowBase64}),b=f.getData("text/html");return g.length>0&&i&&i(g),p.length>0&&r&&r(n,p,b),!0}}})},PDe=on.create({name:"fileHandler",addOptions(){return{allowBase64:!1,allowedMimeTypes:[],maxFileSize:0}},addProseMirrorPlugins(){return[LDe({key:new Zn(this.name),editor:this.editor,...this.options})]}});function $De(e){return/^#{1,6}\s/.test(e)||/\*\*[^*]+\*\*/.test(e)||/\*[^*]+\*/.test(e)||/\[.+\]\(.+\)/.test(e)||/^[-*+]\s/.test(e)||/^\d+\.\s/.test(e)||/^>\s/.test(e)||/`[^`]+`/.test(e)||/^```/.test(e)}const BDe=on.create({name:"markdownPaste",addProseMirrorPlugins(){const{editor:e}=this;return[new zn({key:new Zn("markdownPaste"),props:{handlePaste:(t,n)=>{const r=n.clipboardData;if(!r||r.getData("text/html"))return!1;const i=r.getData("text/plain");if(!i||!e.markdown||!$De(i))return!1;try{return e.commands.insertContent(i,{contentType:"markdown"}),n.preventDefault(),!0}catch{return!1}}}})]}});function FDe(e,t){const n=w.useRef(Date.now()),r=w.useRef(null);return w.useCallback((...s)=>{Date.now()-n.current>=t?(e(...s),n.current=Date.now()):(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...s),n.current=Date.now()},t-(Date.now()-n.current)))},[e,t])}async function HDe(e){return await new Promise(n=>setTimeout(n,3e3)),await RC(e)}const UDe=({placeholder:e,uploader:t,output:n="html"})=>[nq.configure({blockquote:{HTMLAttributes:{class:"block-node"}},bulletList:{HTMLAttributes:{class:"list-node"}},code:{HTMLAttributes:{class:"inline",spellcheck:"false"}},codeBlock:!1,dropcursor:{width:2,class:"ProseMirror-dropcursor border"},heading:{HTMLAttributes:{class:"heading-node"}},horizontalRule:!1,link:{enableClickSelection:!0,openOnClick:!1,HTMLAttributes:{class:"link"}},orderedList:{HTMLAttributes:{class:"list-node"}},paragraph:{HTMLAttributes:{class:"text-node"}}}),jDe.configure({allowedMimeTypes:["image/*"],maxFileSize:5*1024*1024,allowBase64:!0,uploadFn:async r=>t?await t(r):await HDe(r),onToggle(r,s,i){r.commands.insertContentAt(i,s.map(o=>{const a=URL.createObjectURL(o);return{type:"image",attrs:{id:ky(),src:a,alt:o.name,title:o.name,fileName:o.name}}}))},onImageRemoved({id:r,src:s}){console.log("Image removed",{id:r,src:s})},onValidationError(r){r.forEach(s=>{or.error("Image validation error",{position:"bottom-right",description:s.reason})})},onActionSuccess({action:r}){const s={copyImage:"Copy Image",copyLink:"Copy Link",download:"Download"};or.success(s[r],{position:"bottom-right",description:"Image action success"})},onActionError(r,{action:s}){const i={copyImage:"Copy Image",copyLink:"Copy Link",download:"Download"};or.error(`Failed to ${i[s]}`,{position:"bottom-right",description:r.message})}}),PDe.configure({allowBase64:!0,allowedMimeTypes:["image/*"],maxFileSize:5*1024*1024,onDrop:(r,s,i)=>{s.forEach(async o=>{const a=await RC(o);r.commands.insertContentAt(i,{type:"image",attrs:{src:a}})})},onPaste:(r,s)=>{s.forEach(async i=>{const o=await RC(i);r.commands.insertContent({type:"image",attrs:{src:o}})})},onValidationError:r=>{r.forEach(s=>{or.error("Image validation error",{position:"bottom-right",description:s.reason})})}}),rDe,UG,i6e,kRe,IDe,sDe,zDe,nDe,s6e.configure({placeholder:()=>e}),...n==="markdown"?[EAe.configure({markedOptions:{gfm:!0}}),ZV.configure({HTMLAttributes:{class:"task-list-node"}}),YV.configure({nested:!0}),iSe.configure({table:{resizable:!0,HTMLAttributes:{class:"table-node"}}}),BDe]:[]],VDe=({value:e,output:t="html",placeholder:n="",editorClassName:r,throttleDelay:s=0,onUpdate:i,onBlur:o,uploader:a,...l})=>{const u=FDe(y=>i?.(y),s),f=w.useCallback(y=>u(QO(y,t)),[t,u]),p=w.useCallback(y=>{e&&y.isEmpty&&y.commands.setContent(e,{contentType:t==="markdown"?"markdown":void 0})},[e,t]),g=w.useCallback(y=>o?.(QO(y,t)),[t,o]);return kTe({immediatelyRender:!1,extensions:UDe({placeholder:n,uploader:a,output:t}),editorProps:{attributes:{autocomplete:"off",autocorrect:"off",autocapitalize:"off",class:ee("focus:outline-hidden",r)}},onUpdate:({editor:y})=>f(y),onCreate:({editor:y})=>p(y),onBlur:({editor:y})=>g(y),...l})},qDe={top:0,left:0,bottom:0,right:0,x:0,y:0,width:0,height:0,toJSON:()=>"{}"};function GDe(e){const[t,n]=w.useState(()=>e?.getBoundingClientRect()??qDe),r=w.useCallback(()=>{if(!e)return;const s=e.getBoundingClientRect();n(i=>Math.round(i.width)===Math.round(s.width)&&Math.round(i.height)===Math.round(s.height)&&Math.round(i.x)===Math.round(s.x)&&Math.round(i.y)===Math.round(s.y)?i:s)},[e]);return w.useEffect(()=>{if(!e)return;const s=new ResizeObserver(r);return s.observe(e),window.addEventListener("click",r),window.addEventListener("resize",r),()=>{s.disconnect(),window.removeEventListener("click",r),window.removeEventListener("resize",r)}},[e,r]),t}const NW=({as:e,name:t,children:n,style:r={},...s})=>{const i=w.useRef(null),o=GDe(i.current),a={[`--${t}-width`]:`${o.width}px`,[`--${t}-height`]:`${o.height}px`};return h.jsx(e,{...s,ref:i,style:{...a,...r},children:n})};NW.displayName="MeasuredContainer";function WDe(e){const{editor:t}=r7(),n=w.useMemo(()=>e||t,[e,t]);return yG({editor:n,selector(s){return s.editor?{editor:s.editor,editorState:s.editor.state,canCommand:s.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}const KDe=({editor:e})=>h.jsx("div",{className:"border-border flex h-12 shrink-0 overflow-x-auto border-b p-2",children:h.jsxs("div",{className:"flex w-max items-center gap-px",children:[h.jsx(kG,{editor:e}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(_G,{editor:e,activeLevels:[1,2,3,4,5,6]}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(RG,{editor:e,activeActions:["bold","italic","underline","strikethrough","code","clearFormatting"],mainActionCount:4}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(DG,{editor:e}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(jG,{editor:e,activeActions:["orderedList","bulletList"],mainActionCount:0}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(IG,{editor:e,activeActions:["codeBlock","blockquote","horizontalRule"],mainActionCount:2})]})}),MW=({value:e,onChange:t,className:n,editorContentClassName:r,...s})=>{const i=VDe({value:e,onUpdate:t,...s});return i?h.jsx(v2.Provider,{value:{editor:i},children:h.jsx(YDe,{editor:i,className:n,editorContentClassName:r})}):null};MW.displayName="MinimalTiptapEditor";const YDe=({editor:e,className:t,editorContentClassName:n})=>{const{editor:r}=WDe(e);return r?h.jsxs(NW,{as:"div",name:"editor",className:ee("border-input min-data-[orientation=vertical]:h-72 flex h-auto w-full min-w-0 flex-col rounded-md border shadow-xs","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",t),children:[h.jsx(KDe,{editor:r}),h.jsx(vG,{editor:r,className:ee("minimal-tiptap-editor",n)}),h.jsx(iRe,{editor:r})]}):null};function ZDe({value:e,onChange:t,placeholder:n}){const r=w.useRef([]),s=w.useRef(e);w.useEffect(()=>{s.current=e},[e]);const i=async a=>{const l=new FormData;l.append("file",a);const{data:u}=await Xt.post("/upload",l);return r.current.push(u.url),u.url};w.useEffect(()=>()=>{const a=String(s.current||"");r.current.filter(u=>!a.includes(u)).forEach(async u=>{try{const f=u.split("/").pop();f&&await Xt.delete(`/upload/${decodeURIComponent(f)}`)}catch(f){console.error("Session image cleanup failed for:",u,f)}})},[]);const o=e??"";return h.jsx(MW,{value:o,onChange:a=>{t(typeof a=="string"?a:String(a))},className:"w-full",editorContentClassName:"p-5",output:"html",placeholder:n||"Scrivi qui il tuo contenuto...",autofocus:!1,editable:!0,editorClassName:"focus:outline-none",uploader:i})}function XDe({branch:e,value:t,onChange:n}){return h.jsx(ZDe,{value:t,onChange:r=>n(r),placeholder:`Scrivi ${e.label.toLowerCase()}...`})}const wD="image/*",QDe=8e3;function JDe(e){return e.type==="file"&&(e.multiple===!0||e.format==="asset-list")}function TW(e){try{return new URL(e).protocol==="https:"}catch{return!1}}async function eje(e){return new Promise(t=>{const n=new Image;let r=!1;const s=()=>{n.onload=null,n.onerror=null},i=a=>{r||(r=!0,s(),t(a))},o=globalThis.setTimeout(()=>i(!1),QDe);n.onload=()=>{globalThis.clearTimeout(o),i(!0)},n.onerror=()=>{globalThis.clearTimeout(o),i(!1)},n.src=e})}function tje(e){try{return JSON.parse(e)}catch{return e}}function SD(e){if(typeof e!="string")return null;const t=e.trim();return TW(t)?t:null}function hp(e){const t=typeof e=="string"?tje(e):e,n=Array.isArray(t)?t:[t],r=[];for(const s of n){if(s==null)continue;const i=SD(s);if(i){r.push(i);continue}if(typeof s=="object"&&!Array.isArray(s)){const o=SD(s.url);o&&r.push(o)}}return[...new Set(r)]}function CD(e,t){return e.includes(t)?e:[...e,t]}function nje(e,t,n){if(n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function rje(e){return e.isMultiple?e.hasAssets?"Gestisci galleria":"Aggiungi immagini":e.hasImage?"Sostituisci":"Aggiungi immagine"}function sje({branch:e,value:t,onChange:n}){const r=w.useRef(null),[s,i]=w.useState(!1),[o,a]=w.useState(!1),[l,u]=w.useState(!1),[f,p]=w.useState(!1),[g,b]=w.useState(null),[y,x]=w.useState(""),S=JDe(e),k=w.useMemo(()=>S?hp(t):[],[S,t]),N=typeof t=="string"?t:"",T=N.length>0,R=k.length>0,_=rje({isMultiple:S,hasAssets:R,hasImage:T}),A=l||f;w.useEffect(()=>{s&&(x(S?"":N),b(null),a(!1))},[s,S,N]);const I=w.useCallback(async K=>{if(!K.type.startsWith("image/")){b("Seleziona un'immagine (JPG, PNG, WebP, GIF)");return}b(null),u(!0);try{const W=new FormData;W.append("file",K);const{data:V}=await Xt.post("/upload",W);if(S){const P=hp(t);n(CD(P,V.url))}else n(V.url),i(!1)}catch(W){b(W instanceof Error?W.message:"Errore durante il caricamento")}finally{u(!1)}},[S,n,t]),j=w.useCallback(async()=>{const K=y.trim();if(!K){b("Inserisci un URL immagine pubblico");return}if(!TW(K)){b("L'URL deve iniziare con https://");return}b(null),p(!0);try{if(!await eje(K)){b("URL non renderizzabile come immagine");return}if(S){const V=hp(t);n(CD(V,K)),x("")}else n(K),i(!1)}finally{p(!1)}},[S,n,y,t]),L=w.useCallback(K=>{K.preventDefault(),a(!1);const W=K.dataTransfer.files[0];W&&I(W)},[I]),q=w.useCallback(K=>{K.preventDefault(),A||a(!0)},[A]),ne=w.useCallback(()=>{a(!1)},[]),re=w.useCallback(K=>{const W=K.target.files?.[0];W&&I(W),K.target.value=""},[I]),oe=w.useCallback(()=>{A||r.current?.click()},[A]),le=w.useCallback(()=>{n("")},[n]),ce=w.useCallback(K=>{const W=hp(t);n(W.filter((V,P)=>P!==K))},[n,t]),F=w.useCallback((K,W)=>{const V=hp(t),P=W==="up"?K-1:K+1;n(nje(V,K,P))},[n,t]),te=w.useCallback(()=>{n([]),i(!1)},[n]);return S?h.jsx("div",{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[R?h.jsx("div",{className:"grid grid-cols-2 gap-1",children:k.slice(0,4).map(K=>h.jsx("div",{className:"relative size-16 overflow-hidden rounded-md border border-input bg-muted",children:h.jsx("img",{src:K,alt:"",className:"size-full object-cover"})},K))}):h.jsx("div",{className:"flex size-16 shrink-0 items-center justify-center rounded-md border border-dashed border-input bg-muted/40",children:h.jsx(mp,{className:"size-5 text-muted-foreground"})}),h.jsx("div",{className:"flex flex-col items-start gap-2",children:h.jsxs(Ph,{open:s,onOpenChange:i,children:[h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>i(!0),children:[h.jsx(mp,{className:"size-4"}),_]}),h.jsxs($h,{children:[h.jsxs(ym,{children:[h.jsx(xm,{children:_}),h.jsx(xy,{children:"Inserisci un URL pubblico HTTPS oppure carica un file locale."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:`${e.alias}-url`,className:"text-sm font-medium",children:"Link immagine"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(pn,{id:`${e.alias}-url`,type:"url",value:y,onChange:K=>x(K.target.value),placeholder:"https://example.com/image.jpg",disabled:A}),h.jsx(He,{type:"button",variant:"secondary",onClick:()=>{j()},disabled:A,children:f?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"size-4 animate-spin"}),"Verifica..."]}):h.jsxs(h.Fragment,{children:[h.jsx(OS,{className:"size-4"}),"Aggiungi"]})})]})]}),h.jsxs("button",{type:"button",onClick:oe,onDrop:L,onDragOver:q,onDragLeave:ne,className:ee("w-full rounded-lg border-2 border-dashed p-5 text-center transition-colors","hover:border-primary/50 hover:bg-muted/50",o&&"border-primary bg-muted/50",A&&"pointer-events-none opacity-70"),children:[h.jsx("input",{ref:r,id:`${e.alias}-file`,type:"file",accept:wD,className:"hidden",onChange:re}),l?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Co,{className:"size-8 animate-spin text-muted-foreground"}),h.jsx("span",{className:"text-sm text-muted-foreground",children:"Caricamento..."})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"trascina qui il tuo file oppure selezionalo"})]}),k.length>0?h.jsx("div",{className:"max-h-52 space-y-2 overflow-y-auto rounded-md border border-input p-2",children:k.map((K,W)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-background p-2",children:[h.jsx("img",{src:K,alt:"",className:"size-10 shrink-0 rounded object-cover"}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:K}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>F(W,"up"),disabled:W===0||A,"aria-label":"Sposta su",children:h.jsx(FZ,{className:"size-4"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>F(W,"down"),disabled:W===k.length-1||A,"aria-label":"Sposta giu",children:h.jsx(jZ,{className:"size-4"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>ce(W),disabled:A,"aria-label":"Rimuovi immagine",children:h.jsx(ja,{className:"size-4"})})]})]},`${K}-${W}`))}):null,g?h.jsx("p",{className:"text-sm text-destructive",children:g}):null]}),h.jsxs(EC,{children:[k.length>0?h.jsxs(He,{type:"button",variant:"destructive",onClick:te,disabled:A,children:[h.jsx(ja,{className:"size-4"}),"Rimuovi tutte"]}):null,h.jsx(He,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:A,children:"Chiudi"})]})]})]})})]})}):h.jsx("div",{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[T?h.jsx("div",{className:"relative size-16 shrink-0 overflow-hidden rounded-md border border-input bg-muted",children:h.jsx("img",{src:N,alt:"",className:"size-full object-cover"})}):h.jsx("div",{className:"flex size-16 shrink-0 items-center justify-center rounded-md border border-dashed border-input bg-muted/40",children:h.jsx(mp,{className:"size-5 text-muted-foreground"})}),h.jsx("div",{className:"flex flex-col items-start gap-2",children:h.jsxs(Ph,{open:s,onOpenChange:i,children:[h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>i(!0),children:[h.jsx(mp,{className:"size-4"}),_]}),h.jsxs($h,{children:[h.jsxs(ym,{children:[h.jsxs(xm,{children:[_," immagine"]}),h.jsx(xy,{children:"Inserisci un URL pubblico HTTPS oppure carica un file locale."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:`${e.alias}-url`,className:"text-sm font-medium",children:"Link immagine"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(pn,{id:`${e.alias}-url`,type:"url",value:y,onChange:K=>x(K.target.value),placeholder:"https://example.com/image.jpg",disabled:A}),h.jsx(He,{type:"button",variant:"secondary",onClick:()=>{j()},disabled:A,children:f?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"size-4 animate-spin"}),"Verifica..."]}):h.jsxs(h.Fragment,{children:[h.jsx(OS,{className:"size-4"}),"Usa link"]})})]})]}),h.jsxs("button",{type:"button",onClick:oe,onDrop:L,onDragOver:q,onDragLeave:ne,className:ee("w-full rounded-lg border-2 border-dashed p-5 text-center transition-colors","hover:border-primary/50 hover:bg-muted/50",o&&"border-primary bg-muted/50",A&&"pointer-events-none opacity-70"),children:[h.jsx("input",{ref:r,id:`${e.alias}-file`,type:"file",accept:wD,className:"hidden",onChange:re}),l?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Co,{className:"size-8 animate-spin text-muted-foreground"}),h.jsx("span",{className:"text-sm text-muted-foreground",children:"Caricamento..."})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"trascina qui il tuo file oppure selezionalo"})]}),g?h.jsx("p",{className:"text-sm text-destructive",children:g}):null]}),h.jsxs(EC,{children:[T?h.jsxs(He,{type:"button",variant:"destructive",onClick:()=>{le(),i(!1)},disabled:A,children:[h.jsx(ja,{className:"size-4"}),"Rimuovi immagine"]}):null,h.jsx(He,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:A,children:"Chiudi"})]})]})]})})]})})}const ije={text:y7e,number:x7e,boolean:w7e,date:S7e,json:N7e,richtext:_7e,file:D7e},oje={text:j7e,number:I7e,boolean:z7e,date:wMe,json:EMe,richtext:XDe,file:sje};function aje(e){return ije[e]??p7e}function lje(e){return oje[e]??m7e}function _W(e){const{branch:t}=e,{visibility:n}=l2(t);if(n==="hidden")return null;const r=aje(t.type);return n==="masked"?h.jsx(r,{...e,value:"••••••••"}):h.jsx(r,{...e})}function eh(e){const{branch:t}=e,{privacy:n}=l2(t);if(n==="hash"||n==="encrypt")return h.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed px-3 py-2 text-sm text-muted-foreground",children:[h.jsx("span",{children:"••••••••"}),h.jsx("span",{className:"text-xs",children:"(campo sensibile — non modificabile)"})]});const r=lje(t.type);return h.jsx(r,{...e})}function cje({className:e,orientation:t="horizontal",...n}){return h.jsx(Pae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const uje=Ud("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function dje({className:e,variant:t="default",...n}){return h.jsx($ae,{"data-slot":"tabs-list","data-variant":t,className:ee(uje({variant:t}),e),...n})}function kD({className:e,...t}){return h.jsx(Bae,{"data-slot":"tabs-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function ED({className:e,...t}){return h.jsx(Fae,{"data-slot":"tabs-content",className:ee("flex-1 outline-none",e),...t})}function ND(e){return e.alias.startsWith("meta")}function fje(e){return e.type==="json"&&e.alias.toLowerCase().includes("tag")}function hje(e){const t=e.alias.trim().toLowerCase();return t==="title"||t==="name"}function pje(e){const t=e.branches.find(fje)??null,n=e.branches.filter(ND),r=e.branches.filter(s=>!ND(s)&&!hje(s)&&s.alias!==t?.alias);return{tagsBranch:t,seoBranches:n,mainBranches:r}}function mje(e){const t=e.find(r=>r.type==="richtext")??null,n=t?e.filter(r=>r.alias!==t.alias):e;return{richtextBranch:t,otherMainBranches:n}}function gje(e){const t=e.trim().toLowerCase();return t?["error","failed","rejected","archived"].includes(t)?"destructive":["published","active","approved","online"].includes(t)?"default":"outline":"secondary"}function w2(e){if(typeof e=="string"){const t=e.trim();if(!t)return null;try{const n=JSON.parse(t);if(n&&typeof n=="object")return w2(n)}catch{}return t}if(e&&typeof e=="object"){const t=e;return[t.url,t.src,t.path].find(r=>typeof r=="string"&&r.trim().length>0)?.trim()??null}return null}function jy(e){return typeof e=="string"?e.replaceAll(/<[^>]*>/g," ").replaceAll(/\s+/g," ").trim():typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(t=>jy(t)).join(" ").trim():e&&typeof e=="object"?Object.values(e).map(t=>jy(t)).join(" ").trim():""}function bje(e,t=50){const n=jy(e);return n?n.length<=t?n:`${n.slice(0,t).trimEnd()}…`:""}function vje(e){if(e==null||e==="")return"";const t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleDateString("it-IT",{year:"numeric",month:"short",day:"numeric"})}function yje(e,t){const n=e.status?.trim()||"—",r=t.tagsBranch?wm(e.data[t.tagsBranch.alias]):[],s=t.coverBranch?w2(e.data[t.coverBranch.alias]):null,i=t.titleBranch?jy(e.data[t.titleBranch.alias]):"",o=t.excerptBranch?bje(e.data[t.excerptBranch.alias],90):"",a=t.dateBranch?vje(e.data[t.dateBranch.alias]):"",l=i?`Apri dettaglio: ${i}`:`Apri dettaglio entry ${e.id}`;return{entryId:e.id,status:n,tags:r,imageUrl:s,title:i,excerpt:o,dateText:a,ariaLabel:l,statusVariant:gje(n)}}function xje(e,t){return t.some(n=>e.includes(n))}function RW(e){const t=e.branches,n=t.find(a=>{if(a.type!=="file")return!1;const l=a.alias.trim().toLowerCase();return xje(l,["cover","image","foto","photo"])})??null,r=t.find(a=>{const l=a.alias.trim().toLowerCase();return l==="title"||l==="name"})??null,s=t.find(a=>a.type!=="richtext"&&a.type!=="text"?!1:r?a.alias!==r.alias:!0)??null,i=t.find(a=>a.type==="date")??null,o=t.find(a=>a.type!=="json"?!1:a.alias.toLowerCase().includes("tag"))??null;return{coverBranch:n,titleBranch:r,excerptBranch:s,dateBranch:i,tagsBranch:o}}function wje(e,t){const n=e.branches.find(r=>{const s=r.alias.toLowerCase();return s==="title"||s==="name"});if(n){const r=t.data[n.alias];if(typeof r=="string"&&r.trim().length>0)return r.trim()}return t.slug?.trim()||t.id}const MD=4;function Sje({tags:e,className:t}){const[n,r]=w.useState(!1);if(e.length===0)return null;const s=e.length>MD;return h.jsxs("div",{className:ee("space-y-1.5",t),children:[h.jsx("p",{className:"text-muted-foreground text-[11px] font-medium tracking-wide uppercase",children:"Tag"}),h.jsx(wy,{tags:e,maxVisible:MD,expanded:n,onExpandedChange:r,enableToggle:!0,showCollapseBadge:!1,className:"min-w-0 gap-1.5",chipClassName:"min-w-0 max-w-[12rem] truncate font-normal",renderMoreTrigger:(i,o)=>h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"h-6 rounded-full px-2.5 text-xs",onClick:o,children:["+",i," altri"]})}),s&&n&&h.jsx(He,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>r(!1),children:"Mostra meno"})]})}function Cje(e){return e.replaceAll(/<[^>]*>/g,"").replaceAll(" "," ").trim().length===0}function kje({value:e,className:t}){const n=rq(e);return Cje(n)?h.jsx("div",{className:"text-muted-foreground text-sm",children:"—"}):h.jsx("div",{className:ee("richtext-content rounded-md bg-transparent text-sm leading-relaxed","[&_table]:w-full [&_table]:border-collapse [&_table]:text-sm","[&_th]:border [&_td]:border [&_th]:border-border [&_td]:border-border [&_th]:bg-muted/40 [&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1","[&_p]:mb-2 [&_a]:text-primary [&_a]:underline",t),dangerouslySetInnerHTML:{__html:n}})}function Eje(e){const t=e.toLowerCase().trim();return t==="published"?"bg-emerald-50 text-emerald-700 border-emerald-200/80 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-800/60":t==="draft"?"bg-amber-50 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60":["error","failed","rejected","archived"].includes(t)?"bg-red-50 text-red-700 border-red-200/80 dark:bg-red-500/10 dark:text-red-400 dark:border-red-800/60":"bg-neutral-100 text-neutral-600 border-neutral-200/80 dark:bg-neutral-800 dark:text-neutral-400"}function TD({branch:e,entry:t}){const n=e.type==="file"?w2(t.data[e.alias]):null;return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("h4",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e.label}),n?h.jsx("div",{className:"overflow-hidden rounded-xl border bg-muted/20",children:h.jsx("img",{src:n,alt:e.label,className:"h-auto max-h-[60vh] w-full object-contain"})}):h.jsx(_W,{branch:e,value:t.data[e.alias]})]})}function Nje({seed:e,entry:t,open:n,onClose:r,onEdit:s}){const{tagsBranch:i,seoBranches:o,mainBranches:a}=w.useMemo(()=>pje(e),[e]),{richtextBranch:l,otherMainBranches:u}=w.useMemo(()=>mje(a),[a]),f=w.useMemo(()=>RW(e),[e]);if(!t)return null;const p=wje(e,t),g=i?wm(t.data[i.alias]):[],b=o.length>0,y=a.length===0&&o.length>0?"seo":"content",x=f.coverBranch?w2(t.data[f.coverBranch.alias]):null,S=!!x,k=S?"h-[min(52vh,520px)] min-h-0":"h-[min(62vh,620px)] min-h-0",N=h.jsx(Gl,{className:"h-full px-6 py-4",children:h.jsxs("div",{className:"space-y-5 pr-3",children:[l&&h.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx("div",{className:"border-b border-neutral-200/80 bg-neutral-50/80 px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:border-neutral-700/50 dark:bg-neutral-800/40",children:"Contenuto principale"}),h.jsx("div",{className:"px-4 py-4",children:h.jsx(kje,{value:t.data[l.alias],className:"border-0 shadow-none"},t.id)})]}),u.length>0&&h.jsxs("div",{className:"space-y-5 px-1",children:[!l&&h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Contenuto"}),u.map((R,_)=>h.jsxs(w.Fragment,{children:[h.jsx(TD,{branch:R,entry:t}),_<u.length-1&&h.jsx(Hi,{})]},R.alias))]}),!l&&u.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Nessun campo contenuto."})]})}),T=h.jsx(Gl,{className:"h-full px-6 py-4",children:h.jsx("div",{className:"space-y-4 pr-3",children:h.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx("div",{className:"border-b border-neutral-200/80 bg-neutral-50/80 px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:border-neutral-700/50 dark:bg-neutral-800/40",children:"Metadati / SEO"}),h.jsx("div",{className:"space-y-5 px-4 py-4",children:o.map((R,_)=>h.jsxs(w.Fragment,{children:[h.jsx(TD,{branch:R,entry:t}),_<o.length-1&&h.jsx(Hi,{})]},R.alias))})]})})});return h.jsx(Ph,{open:n,onOpenChange:R=>{R||r()},children:h.jsxs($h,{showCloseButton:!0,className:"flex max-h-[min(92vh,920px)] w-full max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl","aria-describedby":void 0,children:[S&&h.jsxs("div",{className:"relative h-[200px] w-full shrink-0 overflow-hidden",children:[h.jsx("img",{src:x,alt:p||"Copertina",className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-background/80 via-background/20 to-transparent"})]}),h.jsx(ym,{className:ee("shrink-0 space-y-0 px-6 pb-4 text-left",S?"pt-3":"pt-6"),children:h.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[h.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[h.jsx(xm,{className:"text-left text-xl font-semibold leading-snug",children:p}),h.jsx(Sje,{tags:g}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-medium",children:"Stato"}),h.jsx(_i,{variant:"outline",className:ee("text-[11px] font-medium",Eje(t.status?.trim()||"")),children:t.status?.trim()||"—"})]}),t.slug!=null&&String(t.slug).trim()!==""&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,className:"text-border",children:"·"}),h.jsxs("span",{className:"break-all font-mono text-[11px]",children:["/",String(t.slug).trim()]})]})]})]}),h.jsxs(He,{type:"button",variant:"default",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>s(t.id),children:[h.jsx(oj,{className:"size-3.5"}),"Modifica"]})]})}),h.jsx(Hi,{}),b?h.jsxs(cje,{defaultValue:y,className:"flex min-h-0 flex-1 flex-col gap-0",children:[h.jsx("div",{className:"shrink-0 border-b bg-neutral-50/80 px-6 dark:bg-neutral-800/30",children:h.jsxs(dje,{variant:"line",className:"h-10 w-full justify-start gap-1 bg-transparent p-0",children:[h.jsx(kD,{value:"content",className:"text-sm",children:"Contenuto"}),h.jsx(kD,{value:"seo",className:"text-sm",children:"SEO"})]})}),h.jsx(ED,{value:"content",className:ee("mt-0 overflow-hidden",k),children:N}),h.jsx(ED,{value:"seo",className:ee("mt-0 overflow-hidden",k),children:T})]}):h.jsx("div",{className:ee("overflow-hidden",k),children:N})]})})}const Mje=["gallery-skeleton-1","gallery-skeleton-2","gallery-skeleton-3","gallery-skeleton-4","gallery-skeleton-5","gallery-skeleton-6","gallery-skeleton-7","gallery-skeleton-8"];function Tje(){return h.jsx("div",{className:"grid gap-5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 420px))"},children:Mje.map(e=>h.jsxs("div",{className:"flex h-[340px] flex-col overflow-hidden rounded-2xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx(yr,{className:"min-h-0 flex-1 rounded-none"}),h.jsxs("div",{className:"w-full shrink-0 rounded-t-2xl bg-white px-4 py-3 shadow-[0_-6px_20px_0_rgb(0,0,0,0.07)] dark:bg-neutral-900 dark:shadow-[0_-6px_20px_0_rgb(0,0,0,0.30)]",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[h.jsx(yr,{className:"h-5 w-20 rounded-full"}),h.jsx(yr,{className:"h-5 w-14 rounded-full"})]}),h.jsx(yr,{className:"h-4 w-10/12"}),h.jsx(yr,{className:"mt-1 h-3 w-7/12"}),h.jsx(yr,{className:"mt-2 h-3 w-4/12"})]})]},e))})}function _je(e,t){const[n,r]=w.useState(null),s=w.useMemo(()=>t.find(a=>a.id===n)??null,[t,n]);w.useEffect(()=>{n&&(t.some(a=>a.id===n)||r(null))},[t,n]);const i=w.useMemo(()=>RW(e),[e]),o=w.useMemo(()=>t.map(a=>yje(a,i)),[t,i]);return{peekId:n,setPeekId:r,peekEntry:s,cardModels:o}}function Rje({seed:e,data:t,isLoading:n=!1,onEdit:r}){const{setPeekId:s,peekEntry:i,cardModels:o}=_je(e,t);return n?h.jsx(Tje,{}):t.length===0?h.jsx(uq,{className:"border",children:h.jsxs(dq,{children:[h.jsx(fq,{variant:"icon",children:h.jsx(Tm,{className:"size-5"})}),h.jsx(hq,{children:"Nessun elemento da visualizzare"}),h.jsx(pq,{children:"Non ci sono contenuti disponibili per questa vista galleria."})]})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"grid gap-5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 420px))"},children:o.map(a=>h.jsx(h7e,{model:a,onOpen:s},a.entryId))}),h.jsx(Nje,{seed:e,entry:i,open:i!=null,onClose:()=>s(null),onEdit:r})]})}function Aje({open:e,onOpenChange:t,isActive:n,onOpen:r,searchTerm:s,onSearchTermChange:i,visibleFilterColumns:o,activeFiltersCountByColumn:a,onSelectColumn:l}){const{t:u}=kt();return h.jsxs(Ao,{open:e,onOpenChange:f=>{t?.(f),f&&r?.(),f||i("")},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:n?"secondary":"ghost",size:"icon-sm","aria-label":u("toolbar.filter.tooltip"),children:h.jsx(JD,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:u("toolbar.filter.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:u("toolbar.filter.label")}),h.jsx(pn,{placeholder:u("toolbar.filter.searchPlaceholder"),value:s,onChange:f=>i(f.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:o.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:u("toolbar.filter.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:o.map(f=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>l(f.columnId),children:[h.jsx("span",{className:"truncate",children:f.label}),a[f.columnId]?h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:a[f.columnId]}):null]},f.columnId))})})]})]})}function Oje({searchTerm:e,onSearchTermChange:t,filteredSortableColumns:n,sortState:r,onToggleDirection:s,onSelectColumn:i,isActive:o,onOpen:a}){const{t:l}=kt();return h.jsxs(Ao,{onOpenChange:u=>{u||t(""),u&&a?.()},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:o?"secondary":"ghost",size:"icon-sm","aria-label":l("toolbar.sort.tooltip"),children:h.jsx(bh,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:l("toolbar.sort.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:l("toolbar.sort.label")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(pn,{placeholder:l("toolbar.sort.searchPlaceholder"),value:e,onChange:u=>t(u.target.value),className:"h-8 flex-1 text-sm"}),h.jsx(He,{type:"button",variant:"outline",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":l("toolbar.sort.invertOrder"),onClick:s,disabled:!r?.columnId,children:h.jsx(bh,{className:"size-3.5"})})]}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:n.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:l("toolbar.sort.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:n.map(u=>{const f=r?.columnId===u.alias;return h.jsxs(He,{type:"button",variant:f?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>i(u.alias),children:[h.jsx("span",{className:"truncate",children:u.label}),f&&h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:r?.desc?"DESC":"ASC"})]},u.alias)})})})]})]})}function AW({type:e,value:t,onChange:n,selectOptions:r=[],availableTags:s=[],className:i="h-8 flex-1",textClassName:o="text-xs",buttonPlaceholder:a}){const{t:l}=kt(),u=l("toolbar.conditionInput.value"),f=a??l("toolbar.conditionInput.choose");switch(e){case"number":return h.jsx(pn,{type:"number",value:typeof t=="number"?String(t):"",onChange:p=>{const g=p.target.value;n(g.trim()===""?null:Number(g))},className:`${i} ${o}`.trim(),placeholder:u});case"date":return h.jsx(pn,{type:"date",value:typeof t=="string"?t:"",onChange:p=>n(p.target.value||null),className:`${i} ${o}`.trim()});case"boolean":{let p="";t===!0?p="true":t===!1&&(p="false");const g=b=>n(b==="true"?!0:b==="false"?!1:null);return h.jsxs(Ul,{value:p,onValueChange:g,children:[h.jsx(Vl,{size:"sm",className:`${i} ${o}`.trim(),children:h.jsx(hu,{placeholder:u})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"true",children:l("toolbar.conditionInput.true")}),h.jsx(Eo,{value:"false",children:l("toolbar.conditionInput.false")})]})]})}case"select":return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:`${i} justify-between ${o}`.trim(),children:[h.jsx("span",{className:"truncate",children:typeof t=="string"&&t?t:f}),h.jsx(bh,{className:"size-3.5 opacity-60"})]})}),h.jsx(Do,{align:"end",className:"w-48 p-1",children:r.map(p=>h.jsx(He,{type:"button",variant:t===p?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-start px-2 text-xs",onClick:()=>n(p),children:p},p))})]});case"tags":return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:`${i} justify-between ${o}`.trim(),children:[h.jsx("span",{className:"truncate",children:typeof t=="string"&&t?t:l("toolbar.conditionInput.tag")}),h.jsx(bh,{className:"size-3.5 opacity-60"})]})}),h.jsx(Do,{align:"end",className:"max-h-56 w-56 overflow-y-auto p-1",children:s.map(p=>h.jsx(He,{type:"button",variant:t===p?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-start px-2 text-xs",onClick:()=>n(p),children:p},p))})]});default:return h.jsx(pn,{value:typeof t=="string"?t:"",onChange:p=>n(p.target.value||null),className:`${i} ${o}`.trim(),placeholder:u})}}const Dje=["filter","sort","automation","search","settings","create"],jje=[{value:"success",label:"Successo"},{value:"warning",label:"Attenzione"},{value:"danger",label:"Critico"},{value:"info",label:"Info"},{value:"neutral",label:"Neutro"}];function Ije(e){return e==="cell"?"cell":"row"}function zje(e){return Array.isArray(e)?e.filter(t=>t==="bold"||t==="italic"||t==="underline"):[]}function Lje(e){switch(e){case"success":return"bg-emerald-500/70";case"warning":return"bg-amber-500/70";case"danger":return"bg-destructive/70";case"info":return"bg-sky-500/70";default:return"bg-muted-foreground/40"}}function Zb(){return`${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function OW(e){return e!=="is_empty"&&e!=="is_not_empty"}function DW(e,t){const n=[{value:"eq",label:t("toolbar.operators.eq")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}];return e==="number"||e==="date"?[{value:"gt",label:t("toolbar.operators.gt")},{value:"lt",label:t("toolbar.operators.lt")},{value:"gte",label:t("toolbar.operators.gte")},{value:"lte",label:t("toolbar.operators.lte")},...n]:e==="tags"?[{value:"contains",label:t("toolbar.operators.contains")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}]:e==="select"?[{value:"eq",label:t("toolbar.operators.eq")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}]:e==="text"||e==="system"?[{value:"contains",label:t("toolbar.operators.contains")},...n]:n}function Pje(e,t=[],n="Stato"){const r=[],s=t.length>0&&t.length<=8?"recommended":"other";r.push({columnId:"status",label:n,section:s});for(const i of e.branches)i.type==="boolean"?r.push({columnId:i.alias,label:i.label,section:"recommended",branchType:"boolean"}):i.type==="date"?r.push({columnId:i.alias,label:i.label,section:"recommended",branchType:"date"}):i.type==="text"&&i.options&&i.options.length>0?r.push({columnId:i.alias,label:i.label,section:"recommended"}):i.type==="text"?r.push({columnId:i.alias,label:i.label,section:"other"}):i.type==="number"&&r.push({columnId:i.alias,label:i.label,section:"other"});return r}function $je({filters:e,openPillId:t,onOpenPillChange:n,groupBy:r,activeGroupLabel:s,onGroupByChange:i,addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u,availableTagsByColumnId:f}){const{t:p}=kt();return h.jsxs("div",{className:"mb-2 flex min-h-9 flex-wrap items-center gap-2",children:[r&&h.jsxs(He,{variant:"outline",size:"sm",className:"h-8 rounded-full px-3 text-xs",onClick:()=>i?.(null),children:[h.jsx(IQ,{className:"size-3.5"}),p("toolbar.filterPills.groupedBy",{label:s}),h.jsx(ja,{className:"size-3.5 opacity-70"})]}),Object.entries(e).map(([g,b])=>h.jsx(Bje,{group:b,isOpen:t===g,onOpenChange:y=>n(y?g:null),addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u,availableTagsByColumnId:f},g))]})}function Bje({group:e,isOpen:t,onOpenChange:n,addConditionToColumn:r,removeColumnFilters:s,updateCondition:i,removeCondition:o,availableTagsByColumnId:a}){const{t:l}=kt();return h.jsxs(Ao,{open:t,onOpenChange:n,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{variant:"secondary",size:"sm",className:"h-8 rounded-full px-3 text-xs","aria-label":l("toolbar.filter.ariaLabel",{label:e.label}),children:[h.jsx("span",{className:"truncate",children:e.label}),h.jsx("span",{className:"opacity-70",children:e.conditions.length})]})}),h.jsxs(Do,{align:"start",className:"w-[420px] p-2",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[h.jsx(ks,{className:"px-0 py-0 text-xs font-medium text-muted-foreground",children:l("toolbar.filter.filtersOn",{label:e.label})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7","aria-label":l("toolbar.filter.removeColumn"),onClick:()=>s(e.columnId),children:h.jsx(Hh,{className:"size-3.5"})})]}),h.jsxs("div",{className:"space-y-2",children:[e.conditions.map(u=>{const f=DW(e.type,l),p=OW(u.op);return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ul,{value:u.op,onValueChange:g=>i(e.columnId,u.id,{op:g,value:g==="is_empty"||g==="is_not_empty"?null:u.value}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-40 text-xs",children:h.jsx(hu,{placeholder:l("toolbar.filter.operator")})}),h.jsx(ql,{children:f.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]}),p?h.jsx(AW,{type:e.type,value:u.value,onChange:g=>i(e.columnId,u.id,{value:g}),selectOptions:e.selectOptions,availableTags:a[e.columnId]??[],className:"h-8 flex-1",textClassName:"text-sm"}):h.jsx("div",{className:"h-8 flex-1"}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":l("toolbar.filter.removeCondition"),onClick:()=>o(e.columnId,u.id),children:h.jsx(ja,{className:"size-3.5"})})]},u.id)}),h.jsx(ri,{}),h.jsx("div",{className:"flex justify-center",children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>r(e.columnId),children:[h.jsx(Kl,{className:"size-4"}),l("toolbar.filter.addFilter")]})})]})]})]})}const Fje={table:cj,gallery:Jb,grid:Jb,kanban:OQ,chart:qD};function Hje({views:e,activeViewId:t,onChangeView:n,onCreateView:r}){const{t:s}=kt();return h.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[h.jsx(h2,{type:"single",value:t,onValueChange:i=>i&&n(i),variant:"outline",size:"sm",className:"gap-0",children:e.map(i=>{const o=Fje[i.type];return h.jsxs(bd,{value:i.id,"aria-label":i.label,className:"h-8 gap-1.5 px-2.5",children:[o&&h.jsx(o,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate max-w-24",children:i.label})]},i.id)})}),h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":s("toolbar.viewSwitcher.addView"),onClick:()=>r?.(),children:h.jsx(Kl,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:s("toolbar.viewSwitcher.addView")})]})]})}function Uje({isSearchOpen:e,searchValue:t,searchInputRef:n,handleSearchSubmit:r,onSearchChange:s,handleSearchBlur:i,handleSearchClose:o,handleSearchOpen:a}){const{t:l}=kt();return h.jsx("div",{className:"overflow-hidden rounded-md border border-input bg-transparent transition-[width] duration-200 ease-out",style:{width:e?192:32},children:e?h.jsxs("form",{onSubmit:r,className:"relative flex min-w-[192px] items-center",children:[h.jsx(DS,{className:"text-muted-foreground pointer-events-none absolute left-2.5 size-4 shrink-0"}),h.jsx(pn,{ref:n,type:"search",placeholder:l("toolbar.search.placeholder"),value:t,onChange:u=>s?.(u.target.value),onBlur:i,className:"h-8 w-full border-0 bg-transparent pl-8 pr-8 focus-visible:ring-0 focus-visible:ring-offset-0","aria-label":l("toolbar.search.ariaLabel")}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"absolute right-1 h-6 w-6 shrink-0","aria-label":l("toolbar.search.close"),onClick:o,children:h.jsx(ja,{className:"size-3.5"})})]}):h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":l("toolbar.search.ariaLabel"),onClick:a,children:h.jsx(DS,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:l("toolbar.search.open")})]})})}function jW(e=[]){const t=[];return e.includes("bold")&&t.push("font-bold"),e.includes("italic")&&t.push("italic"),e.includes("underline")&&t.push("underline"),t.join(" ")}function IW(e,t=[]){const n=jW(t);switch(e){case"success":return`bg-emerald-500/12 hover:bg-emerald-500/16 ${n}`.trim();case"warning":return`bg-amber-500/12 hover:bg-amber-500/16 ${n}`.trim();case"danger":return`bg-destructive/12 hover:bg-destructive/16 ${n}`.trim();case"info":return`bg-sky-500/12 hover:bg-sky-500/16 ${n}`.trim();default:return`bg-muted/35 hover:bg-muted/45 ${n}`.trim()}}function zW(e,t=[]){const n=jW(t),r="[&_[data-slot=badge]]:!text-inherit [&_[data-slot=badge]]:!bg-transparent [&_[data-slot=badge]]:!border-current";switch(e){case"success":return`font-medium text-emerald-700 dark:text-emerald-300 ${n} ${r}`.trim();case"warning":return`font-medium text-amber-800 dark:text-amber-200 ${n} ${r}`.trim();case"danger":return`font-medium text-destructive ${n} ${r}`.trim();case"info":return`font-medium text-sky-800 dark:text-sky-200 ${n} ${r}`.trim();default:return`font-medium ${n} ${r}`.trim()}}function Vje({formattableColumns:e,addConditionalFormatRule:t}){const{t:n}=kt();return h.jsxs("div",{className:"flex min-h-52 flex-col items-center justify-center gap-3 rounded-md border border-dashed",children:[h.jsx("div",{className:"text-sm text-muted-foreground",children:n("toolbar.conditionalFormats.noRules")}),h.jsx(LW,{columns:e,onSelect:t,compact:!0})]})}function qje({conditionalFormats:e,setActiveConditionalRuleId:t,setIsConditionalEditorOpen:n}){return h.jsx("div",{className:"space-y-2",children:e.map((r,s)=>h.jsxs("button",{type:"button",className:"flex h-14 w-full overflow-hidden rounded-md border text-left transition-colors hover:bg-muted/40",onClick:()=>{t(r.id),n(!0)},children:[h.jsx("div",{className:`w-1/3 ${Lje(r.tone)}`}),h.jsxs("div",{className:"flex flex-1 items-center justify-between px-3",children:[h.jsx("span",{className:"truncate text-sm",children:r.label||r.group.label}),h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["#",s+1]})]})]},r.id))})}function Gje({activeConditionalRule:e,conditionalFormats:t,updateConditionalRule:n,moveConditionalRule:r,removeConditionalRule:s,updateConditionalCondition:i,addConditionalCondition:o,removeConditionalCondition:a,updateConditionalTextStyles:l,setIsConditionalEditorOpen:u,availableTagsByColumnId:f}){const{t:p}=kt();return h.jsxs("div",{className:"space-y-2 max-h-[460px] overflow-y-auto pr-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(He,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>u(!1),children:p("toolbar.conditionalFormats.rulesList")}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:p("toolbar.conditionalFormats.editRule")})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(gq,{pressed:e.enabled,onPressedChange:g=>n(e.id,{enabled:g}),variant:"outline",size:"sm","aria-label":p("toolbar.conditionalFormats.toggleRule"),className:"h-7 w-7 px-0",children:e.enabled?h.jsx(yh,{className:"size-3.5"}):h.jsx(vh,{className:"size-3.5"})}),h.jsx(pn,{value:e.label??"",onChange:g=>n(e.id,{label:g.target.value}),className:"h-7 text-xs",placeholder:p("toolbar.conditionalFormats.ruleName")}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7",onClick:()=>r(e.id,-1),disabled:t.findIndex(g=>g.id===e.id)===0,"aria-label":p("toolbar.conditionalFormats.moveUp"),children:h.jsx(WD,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7",onClick:()=>r(e.id,1),disabled:t.findIndex(g=>g.id===e.id)===t.length-1,"aria-label":p("toolbar.conditionalFormats.moveDown"),children:h.jsx(Mm,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>s(e.id),"aria-label":p("toolbar.conditionalFormats.deleteRule"),children:h.jsx(Hh,{className:"size-3.5"})})]})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.applyTo")}),h.jsxs("div",{className:"inline-flex rounded-md border p-0.5",children:[h.jsx(He,{type:"button",size:"sm",variant:"ghost",className:e.target==="cell"?"h-7 px-3 text-xs bg-black text-white hover:bg-black/90 hover:text-white":"h-7 px-3 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>n(e.id,{target:"cell"}),children:p("toolbar.conditionalFormats.cell")}),h.jsx(He,{type:"button",size:"sm",variant:"ghost",className:e.target==="row"?"h-7 px-3 text-xs bg-black text-white hover:bg-black/90 hover:text-white":"h-7 px-3 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>n(e.id,{target:"row"}),children:p("toolbar.conditionalFormats.row")})]})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.useColorIf")}),h.jsx("div",{className:"h-8 rounded-md border bg-muted/20 px-2 text-xs flex items-center",children:h.jsx("span",{className:"truncate",children:e.group.label})})]}),h.jsx("div",{className:"flex flex-col gap-2",children:e.group.conditions.map(g=>{const b=DW(e.group.type,p),y=OW(g.op);return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ul,{value:g.op,onValueChange:x=>i(e.id,g.id,{op:x,value:x==="is_empty"||x==="is_not_empty"?null:g.value}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-36 text-xs",children:h.jsx(hu,{placeholder:p("toolbar.conditionalFormats.operator")})}),h.jsx(ql,{children:b.map(x=>h.jsx(Eo,{value:x.value,children:x.label},x.value))})]}),y?h.jsx(AW,{type:e.group.type,value:g.value,onChange:x=>i(e.id,g.id,{value:x}),selectOptions:e.group.selectOptions??[],availableTags:f[e.columnId]??[],className:"h-8 flex-1",textClassName:"text-xs"}):h.jsx("div",{className:"h-8 flex-1"}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":p("toolbar.conditionalFormats.removeCondition"),onClick:()=>a(e.id,g.id),children:h.jsx(ja,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":p("toolbar.conditionalFormats.addCondition"),onClick:()=>o(e.id),children:h.jsx(Kl,{className:"size-3.5"})})]},g.id)})}),h.jsxs("div",{className:"space-y-1 pt-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.formatStyle")}),h.jsxs("div",{className:"rounded-md border border-dashed p-2",children:[h.jsx("div",{className:`flex min-h-12 items-center rounded-md border px-3 ${e.target==="row"?IW(e.tone,e.textStyles??[]):""}`,children:h.jsx("span",{className:e.target==="cell"?zW(e.tone,e.textStyles??[]):"font-medium",children:p("toolbar.conditionalFormats.default")})}),h.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[h.jsxs(Ul,{value:e.tone,onValueChange:g=>n(e.id,{tone:g}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-40 text-xs",children:h.jsx(hu,{placeholder:p("toolbar.conditionalFormats.colorPreset")})}),h.jsx(ql,{children:jje.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]}),h.jsxs(h2,{variant:"outline",type:"multiple",value:e.textStyles??[],onValueChange:g=>l(e.id,g),children:[h.jsx(bd,{value:"bold","aria-label":p("toolbar.conditionalFormats.bold"),children:h.jsx(ZZ,{className:"size-4"})}),h.jsx(bd,{value:"italic","aria-label":p("toolbar.conditionalFormats.italic"),children:h.jsx(EQ,{className:"size-4"})}),h.jsx(bd,{value:"underline","aria-label":p("toolbar.conditionalFormats.underline"),children:h.jsx(uee,{className:"size-4"})})]})]})]})]})]})}function Wje({enabled:e,formattableColumns:t,conditionalFormats:n,activeConditionalRule:r,isConditionalEditorOpen:s,setIsConditionalEditorOpen:i,setActiveConditionalRuleId:o,addConditionalFormatRule:a,updateConditionalRule:l,updateConditionalTextStyles:u,removeConditionalRule:f,moveConditionalRule:p,updateConditionalCondition:g,addConditionalCondition:b,removeConditionalCondition:y,availableTagsByColumnId:x}){const{t:S}=kt();if(!e)return h.jsx("div",{className:"text-sm text-muted-foreground",children:S("toolbar.conditionalFormats.notAvailable")});let k;return s?r?k=h.jsx(Gje,{activeConditionalRule:r,conditionalFormats:n,updateConditionalRule:l,moveConditionalRule:p,removeConditionalRule:f,updateConditionalCondition:g,addConditionalCondition:b,removeConditionalCondition:y,updateConditionalTextStyles:u,setIsConditionalEditorOpen:i,availableTagsByColumnId:x}):k=h.jsx("div",{className:"px-0 py-6 text-center text-sm text-muted-foreground",children:S("toolbar.conditionalFormats.selectRule")}):n.length===0?k=h.jsx(Vje,{formattableColumns:t,addConditionalFormatRule:a}):k=h.jsx(qje,{conditionalFormats:n,setActiveConditionalRuleId:o,setIsConditionalEditorOpen:i}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx(ks,{className:"px-0 py-0 text-sm font-semibold text-foreground",children:"Regole dei colori condizionali"}),h.jsx(LW,{columns:t,onSelect:a})]}),h.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Le regole si applicano dall’alto verso il basso."}),h.jsx(ri,{}),k]})}function LW({columns:e,onSelect:t,compact:n=!1}){const{t:r}=kt();return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:n?"h-8":"h-8 w-8 px-0","aria-label":r("toolbar.conditionalFormats.addRule"),children:[h.jsx(Kl,{className:"size-4"}),n?r("toolbar.conditionalFormats.add"):null]})}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:r("toolbar.conditionalFormats.chooseColumn")}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:e.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:r("toolbar.conditionalFormats.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:e.map(s=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>t(s.columnId),children:[h.jsx("span",{className:"truncate",children:s.label}),h.jsx("span",{className:"text-[10px] text-muted-foreground uppercase",children:s.type})]},s.columnId))})})]})]})}function Kje({isSettingsMenuOpenEffective:e,setIsSettingsMenuOpenState:t,onOpenSettings:n,isSettingsOpen:r,commitViewName:s,setColumnSearchTerm:i,viewNameDraft:o,setViewNameDraft:a,setIsConditionalEditorOpen:l,filterColumnSearchTerm:u,setFilterColumnSearchTerm:f,visibleFilterColumns:p,addConditionToColumn:g,setOpenPillId:b,closeSettingsMenu:y,filters:x,sortColumnSearchTerm:S,setSortColumnSearchTerm:k,handleToggleSortDirection:N,sortState:T,filteredSortableColumns:R,handleSortColumnSelect:_,groupBy:A,onGroupByChange:I,recommendedGroupColumns:j,datePrecisionMode:L,applyDatePrecisionMode:q,otherGroupColumns:ne,onConditionalFormatsChange:re,formattableColumns:oe,conditionalFormats:le,activeConditionalRule:ce,isConditionalEditorOpen:F,setActiveConditionalRuleId:te,addConditionalFormatRule:K,updateConditionalRule:W,updateConditionalTextStyles:V,removeConditionalRule:P,moveConditionalRule:H,updateConditionalCondition:X,addConditionalCondition:de,removeConditionalCondition:fe,availableTagsByColumnId:we,columnVisibility:pe,onColumnVisibilityChange:Re,columnSearchTerm:Ae,filteredTableColumns:Ze,pageSize:nt,onPageSizeChange:at}){const{t:Be}=kt();return h.jsxs(Ao,{open:e,onOpenChange:Ne=>{Ne||(s(),i("")),Ne&&n?.(),r===void 0&&t(Ne)},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:e?"secondary":"ghost",size:"icon-sm","aria-label":Be("toolbar.settings.tooltip"),children:h.jsx(_m,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:Be("toolbar.settings.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64",children:[h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.title")}),h.jsx("div",{className:"px-2 pb-1.5",children:h.jsx(pn,{value:o,onChange:Ne=>a(Ne.target.value),onBlur:()=>s(),onKeyDown:Ne=>{if(Ne.key==="Enter"){Ne.preventDefault(),s();return}Ne.key.length===1&&!Ne.metaKey&&!Ne.ctrlKey&&!Ne.altKey&&Ne.stopPropagation()},className:"h-8 text-sm",placeholder:Be("toolbar.settings.viewName")})})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.quickActions")}),h.jsxs(Bf,{onOpenChange:Ne=>{Ne&&l(!1)},children:[h.jsxs(Ff,{children:[h.jsx(JD,{className:"size-4"}),Be("toolbar.settings.filter")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.filter.label")}),h.jsx(pn,{placeholder:Be("toolbar.filter.searchPlaceholder"),value:u,onChange:Ne=>f(Ne.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:p.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.filter.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:p.map(Ne=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>{g(Ne.columnId),f(""),b(Ne.columnId),y()},children:[h.jsx("span",{className:"truncate",children:Ne.label}),x[Ne.columnId]?.conditions?.length?h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:x[Ne.columnId].conditions.length}):null]},Ne.columnId))})})]})})]}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(bh,{className:"size-4"}),Be("toolbar.settings.sort")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.sort.label")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(pn,{placeholder:Be("toolbar.sort.searchPlaceholder"),value:S,onChange:Ne=>k(Ne.target.value),className:"h-8 flex-1 text-sm"}),h.jsx(He,{type:"button",variant:"outline",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":Be("toolbar.sort.invertOrder"),onClick:N,disabled:!T?.columnId,children:h.jsx(bh,{className:"size-3.5"})})]}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:R.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.sort.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:R.map(Ne=>{const Jt=T?.columnId===Ne.alias;return h.jsxs(He,{type:"button",variant:Jt?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>_(Ne.alias),children:[h.jsx("span",{className:"truncate",children:Ne.label}),Jt&&h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:T?.desc?"DESC":"ASC"})]},Ne.alias)})})})]})})]})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.layoutStyle")}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(_J,{className:"size-4"}),Be("toolbar.settings.group"),A?"...":"",A&&h.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground uppercase",children:Be("toolbar.settings.active")})]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.groupBy")}),h.jsxs(He,{type:"button",variant:A?"ghost":"secondary",size:"sm",className:"h-8 w-full justify-between px-2 text-xs",onClick:()=>{I?.(null),y()},children:[h.jsx("span",{children:Be("toolbar.settings.noGrouping")}),!A&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),j.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(ri,{className:"my-2"}),h.jsx(ks,{className:"px-0 pb-1 pt-0 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:Be("toolbar.settings.recommended")}),h.jsx("div",{className:"flex flex-col gap-1",children:j.map(Ne=>Ne.branchType==="date"?h.jsxs(Bf,{children:[h.jsxs(Ff,{className:"h-8 w-full rounded-sm px-2 text-xs data-[state=open]:bg-accent",children:[h.jsx("span",{className:"flex-1 truncate text-left",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"mr-2 size-3.5 shrink-0 text-muted-foreground"})]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-48 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.group")}),h.jsxs(F6e,{value:L,onValueChange:Jt=>{const ut=Jt||"monthYear";I?.(Ne.columnId),q(ut),y()},children:[h.jsx(Q5,{value:"day",children:Be("toolbar.settings.day")}),h.jsx(Q5,{value:"year",children:Be("toolbar.settings.year")}),h.jsx(Q5,{value:"monthYear",children:Be("toolbar.settings.month")})]})]})})]},Ne.columnId):h.jsxs(He,{type:"button",variant:A===Ne.columnId?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-between px-2 text-xs",onClick:()=>{I?.(A===Ne.columnId?null:Ne.columnId),y()},children:[h.jsx("span",{className:"truncate",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]},Ne.columnId))})]}),ne.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(ri,{className:"my-2"}),h.jsx(ks,{className:"px-0 pb-1 pt-0 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:Be("toolbar.settings.otherFields")}),h.jsx("div",{className:"px-0 pb-1 text-[10px] text-muted-foreground/70",children:Be("toolbar.settings.manyGroups")}),h.jsx("div",{className:"flex flex-col gap-1",children:ne.map(Ne=>h.jsx(He,{type:"button",variant:A===Ne.columnId?"secondary":"ghost",size:"sm",className:"h-auto min-h-8 w-full flex-col items-start gap-0 px-2 py-1.5 text-xs",onClick:()=>{I?.(A===Ne.columnId?null:Ne.columnId),y()},children:h.jsxs("div",{className:"flex w-full items-center justify-between",children:[h.jsx("span",{className:"truncate",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]})},Ne.columnId))})]})]})})]}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(ij,{className:"size-4"}),Be("toolbar.settings.conditionalColors")]}),h.jsx($f,{children:h.jsx(Hf,{className:"w-[620px] p-3",children:h.jsx(Wje,{enabled:!!re,formattableColumns:oe,conditionalFormats:le,activeConditionalRule:ce,isConditionalEditorOpen:F,setIsConditionalEditorOpen:l,setActiveConditionalRuleId:te,addConditionalFormatRule:K,updateConditionalRule:W,updateConditionalTextStyles:V,removeConditionalRule:P,moveConditionalRule:H,updateConditionalCondition:X,addConditionalCondition:de,removeConditionalCondition:fe,availableTagsByColumnId:we})})})]})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.table")}),pe&&Re&&h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(yh,{className:"size-4"}),Be("toolbar.settings.visibleColumns")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.columnVisibility")}),h.jsx(pn,{placeholder:Be("toolbar.settings.columnSearch"),value:Ae,onChange:Ne=>i(Ne.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:Ze.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.settings.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:Ze.map(Ne=>{const Jt=pe[Ne.id]??!0;return h.jsxs(He,{type:"button",variant:Jt?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>{const ut={...pe,[Ne.id]:!Jt};Re(ut)},children:[h.jsx("span",{className:"truncate",children:Ne.label}),Jt?h.jsx(yh,{className:"size-3.5 shrink-0 text-muted-foreground"}):h.jsx(vh,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},Ne.id)})})})]})})]}),nt!=null&&at&&h.jsxs(Ra,{onSelect:Ne=>Ne.preventDefault(),className:"justify-between gap-4 focus:bg-transparent focus:text-inherit data-[highlighted]:bg-transparent data-[highlighted]:text-inherit cursor-default",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(MJ,{className:"size-4"}),Be("toolbar.settings.rows")]}),h.jsxs("div",{className:"flex h-7 items-stretch",children:[h.jsx(He,{type:"button",variant:"outline",size:"icon-xs",className:"h-7 w-7 rounded-r-none border-r-0","aria-label":Be("toolbar.settings.decreaseRows"),disabled:nt<=1,onClick:Ne=>{Ne.stopPropagation(),at(Math.max(1,nt-1))},children:h.jsx(eJ,{className:"size-3"})}),h.jsx("div",{className:"flex w-9 items-center justify-center border border-input bg-background text-xs tabular-nums",children:nt}),h.jsx(He,{type:"button",variant:"outline",size:"icon-xs",className:"h-7 w-7 rounded-l-none border-l-0","aria-label":Be("toolbar.settings.increaseRows"),disabled:nt>=100,onClick:Ne=>{Ne.stopPropagation(),at(Math.min(100,nt+1))},children:h.jsx(Kl,{className:"size-3"})})]})]})]})]})]})}function Yje({searchValue:e,onSearchChange:t,onSubmitSearch:n}){const[r,s]=w.useState(!1),i=w.useRef(null);w.useEffect(()=>{r&&i.current?.focus()},[r]);const o=()=>s(!0),a=()=>{s(!1),t?.("")};return{isSearchOpen:r,searchInputRef:i,handleSearchOpen:o,handleSearchClose:a,handleSearchSubmit:f=>{f.preventDefault();const p=i.current?.value??e;n?.(p)},handleSearchBlur:()=>{!e&&!i.current?.value&&a()}}}function Zje(){const[e,t]=w.useState(""),[n,r]=w.useState(""),[s,i]=w.useState(""),[o,a]=w.useState(!1),[l,u]=w.useState(null),[f,p]=w.useState(!1);return{sortColumnSearchTerm:e,setSortColumnSearchTerm:t,filterColumnSearchTerm:n,setFilterColumnSearchTerm:r,columnSearchTerm:s,setColumnSearchTerm:i,filterMenuOpen:o,setFilterMenuOpen:a,openPillId:l,setOpenPillId:u,isSettingsMenuOpenState:f,setIsSettingsMenuOpenState:p}}function Xje({activeView:e,onRenameView:t}){const[n,r]=w.useState(e?.label??"");w.useEffect(()=>{r(e?.label??"")},[e?.id,e?.label]);const s=w.useCallback(()=>{if(!e||!t)return;const i=n.trim();!i||i===e.label||t(e.id,i)},[e,t,n]);return{viewNameDraft:n,setViewNameDraft:r,commitViewName:s}}function Qje({seed:e,sortColumnSearchTerm:t,sortState:n,onSortChange:r}){const s=w.useMemo(()=>e.branches.filter(l=>["text","number","date"].includes(l.type)&&l2(l).sort),[e.branches]),i=w.useMemo(()=>{const l=t.trim().toLowerCase();return l?s.filter(u=>u.label.toLowerCase().includes(l)):s},[t,s]);return{sortableBranches:s,filteredSortableColumns:i,handleToggleSortDirection:()=>{!r||!n?.columnId||r({columnId:n.columnId,desc:!n.desc})},handleSortColumnSelect:l=>{if(!r)return;if(n?.columnId===l){r({columnId:null,desc:!0});return}const f=n?.columnId==null?!0:n.desc;r({columnId:l,desc:f})}}}function Jje({seed:e,availableStatusOptions:t,groupBy:n,dateGroupPrecision:r,onDateGroupPrecisionChange:s}){const{t:i}=kt(),o=w.useMemo(()=>Pje(e,t,i("content.table.status")),[t,e,i]),a=w.useMemo(()=>o.filter(g=>g.section==="recommended"),[o]),l=w.useMemo(()=>o.filter(g=>g.section==="other"),[o]),u=w.useMemo(()=>n?o.find(g=>g.columnId===n)?.label??n:null,[n,o]),f=w.useMemo(()=>r.day?"day":r.year&&r.month?"monthYear":r.year&&!r.month?"year":"monthYear",[r.day,r.month,r.year]),p=w.useCallback(g=>{if(s){if(g==="day"){s({year:!1,month:!1,day:!0});return}if(g==="year"){s({year:!0,month:!1,day:!1});return}s({year:!0,month:!0,day:!1})}},[s]);return{groupableColumns:o,recommendedGroupColumns:a,otherGroupColumns:l,activeGroupLabel:u,datePrecisionMode:f,applyDatePrecisionMode:p}}function eIe({seed:e,filters:t,onFiltersChange:n,availableStatusOptions:r=[]}){const s=w.useMemo(()=>{const f=[{columnId:"slug",label:"Slug",type:"system"},{columnId:"status",label:"Stato",type:"select",selectOptions:r}];for(const p of e.branches){if(!l2(p).filter)continue;const g=p.alias;p.type==="number"?f.push({columnId:g,label:p.label,type:"number"}):p.type==="date"?f.push({columnId:g,label:p.label,type:"date"}):p.type==="boolean"?f.push({columnId:g,label:p.label,type:"boolean"}):p.type==="json"&&g.toLowerCase().includes("tag")?f.push({columnId:g,label:p.label,type:"tags"}):f.push({columnId:g,label:p.label,type:"text"})}return f},[r,e.branches]),i=w.useMemo(()=>{const f=new Set(["select","number","date","boolean","tags"]);return s.filter(p=>f.has(p.type))},[s]),o=w.useCallback(f=>{const p=s.find(S=>S.columnId===f);if(!p||!n)return;const g=t[f],b=p.type==="tags"?"contains":"eq",y={id:Zb(),op:b,value:null},x={...t,[f]:g?{...g,conditions:[...g.conditions,y]}:{columnId:f,label:p.label,type:p.type,selectOptions:p.selectOptions,conditions:[y]}};n(x)},[s,t,n]),a=w.useCallback(f=>{if(!n||!t[f])return;const p={...t};delete p[f],n(p)},[t,n]),l=w.useCallback((f,p,g)=>{if(!n)return;const b=t[f];if(!b)return;const y=b.conditions.map(x=>x.id===p?{...x,...g}:x);n({...t,[f]:{...b,conditions:y}})},[t,n]),u=w.useCallback((f,p)=>{if(!n)return;const g=t[f];if(!g)return;const b=g.conditions.filter(y=>y.id!==p);if(b.length===0){const y={...t};delete y[f],n(y);return}n({...t,[f]:{...g,conditions:b}})},[t,n]);return{filterableColumns:s,formattableColumns:i,addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u}}function tIe({viewId:e,conditionalFormatsInput:t,formattableColumns:n,onConditionalFormatsChange:r}){const[s,i]=w.useState(null),[o,a]=w.useState(!1),l=w.useCallback(R=>R.map(_=>({..._,target:Ije(_.target),textStyles:zje(_.textStyles)})).slice().sort((_,A)=>(_.priority??0)-(A.priority??0)),[]),u=w.useMemo(()=>l(t??[]),[t,l]);w.useEffect(()=>{if(u.length===0){i(null),a(!1);return}(!s||!u.some(R=>R.id===s))&&i(u[0].id)},[s,u]);const f=w.useMemo(()=>s?u.find(R=>R.id===s)??u[0]??null:u[0]??null,[s,u]),p=w.useCallback(R=>{!e||!r||r(e,R)},[r,e]),g=w.useCallback(R=>{const _=n.find(L=>L.columnId===R);if(!_)return;const A=Zb(),I=_.type==="tags"?"contains":"eq",j={id:A,enabled:!0,priority:u.length,label:_.label,columnId:R,group:{columnId:R,label:_.label,type:_.type,selectOptions:_.selectOptions,conditions:[{id:Zb(),op:I,value:null}]},tone:"warning",target:"row",textStyles:[]};p([...u,j]),i(A),a(!0)},[p,u,n]),b=w.useCallback((R,_)=>{const A=u.map(I=>I.id===R?{...I,..._}:I);p(A)},[p,u]),y=w.useCallback((R,_)=>{b(R,{textStyles:_.filter(A=>A==="bold"||A==="italic"||A==="underline")})},[b]),x=w.useCallback(R=>{const _=u.filter(A=>A.id!==R).map((A,I)=>({...A,priority:I}));p(_)},[p,u]),S=w.useCallback((R,_)=>{const A=u.findIndex(q=>q.id===R);if(A<0)return;const I=A+_;if(I<0||I>=u.length)return;const j=u.slice(),[L]=j.splice(A,1);j.splice(I,0,L),p(j.map((q,ne)=>({...q,priority:ne})))},[p,u]),k=w.useCallback((R,_,A)=>{const I=u.map(j=>{if(j.id!==R)return j;const L=j.group.conditions.map(q=>q.id===_?{...q,...A}:q);return{...j,group:{...j.group,conditions:L}}});p(I)},[p,u]),N=w.useCallback(R=>{const _=u.find(j=>j.id===R);if(!_)return;const A=_.group.type==="tags"?"contains":"eq",I=u.map(j=>j.id===R?{...j,group:{...j.group,conditions:[...j.group.conditions,{id:Zb(),op:A,value:null}]}}:j);p(I)},[p,u]),T=w.useCallback((R,_)=>{const A=u.map(I=>{if(I.id!==R)return I;const j=I.group.conditions.filter(L=>L.id!==_);return{...I,group:{...I.group,conditions:j}}}).filter(I=>I.group.conditions.length>0).map((I,j)=>({...I,priority:j}));p(A)},[p,u]);return{conditionalFormats:u,activeConditionalRule:f,activeConditionalRuleId:s,isConditionalEditorOpen:o,setActiveConditionalRuleId:i,setIsConditionalEditorOpen:a,addConditionalFormatRule:g,updateConditionalRule:b,updateConditionalTextStyles:y,removeConditionalRule:x,moveConditionalRule:S,updateConditionalCondition:k,addConditionalCondition:N,removeConditionalCondition:T}}function nIe({seed:e,views:t,activeViewId:n,onRenameView:r,isFilterActive:s,isSortActive:i,isAutomationActive:o,isSettingsOpen:a,searchValue:l="",onSearchChange:u,onSubmitSearch:f,sortState:p,onSortChange:g,filters:b={},onFiltersChange:y,availableStatusOptions:x=[],groupBy:S=null,dateGroupPrecision:k={year:!0,month:!0,day:!1},onDateGroupPrecisionChange:N,onConditionalFormatsChange:T}){const R=t.find(Nt=>Nt.id===n),{isSearchOpen:_,searchInputRef:A,handleSearchOpen:I,handleSearchClose:j,handleSearchSubmit:L,handleSearchBlur:q}=Yje({searchValue:l,onSearchChange:u,onSubmitSearch:f}),{sortColumnSearchTerm:ne,setSortColumnSearchTerm:re,filterColumnSearchTerm:oe,setFilterColumnSearchTerm:le,columnSearchTerm:ce,setColumnSearchTerm:F,filterMenuOpen:te,setFilterMenuOpen:K,openPillId:W,setOpenPillId:V,isSettingsMenuOpenState:P,setIsSettingsMenuOpenState:H}=Zje(),{viewNameDraft:X,setViewNameDraft:de,commitViewName:fe}=Xje({activeView:R,onRenameView:r}),we=w.useMemo(()=>R?.enabledTools??Dje,[R]),pe=s??Object.values(b).some(Nt=>Nt.conditions.length>0),Re=i??!!p?.columnId,Ae=o??!1,Ze=a??P,nt=()=>{a===void 0&&H(!1)},at=Nt=>we.includes(Nt),Be=Qje({seed:e,sortColumnSearchTerm:ne,sortState:p,onSortChange:g}),{filterableColumns:Ne,formattableColumns:Jt,addConditionToColumn:ut,removeColumnFilters:Ut,updateCondition:nn,removeCondition:kn}=eIe({seed:e,filters:b,onFiltersChange:y,availableStatusOptions:x}),Xn=tIe({viewId:R?.id,conditionalFormatsInput:R?.conditionalFormats,formattableColumns:Jt,onConditionalFormatsChange:T}),sr=w.useMemo(()=>[{id:"slug",label:"Slug"},{id:"status",label:"Stato"},...e.branches.map(Nt=>({id:Nt.alias,label:Nt.label}))],[e.branches]),Nn=w.useMemo(()=>{const Nt=oe.trim().toLowerCase();return Nt?Ne.filter($n=>$n.label.toLowerCase().includes(Nt)):Ne},[oe,Ne]),Pn=w.useMemo(()=>Object.fromEntries(Object.entries(b).map(([Nt,$n])=>[Nt,$n.conditions.length])),[b]),Kt=w.useMemo(()=>{const Nt=ce.trim().toLowerCase();return Nt?sr.filter($n=>$n.label.toLowerCase().includes(Nt)):sr},[ce,sr]),bn=Jje({seed:e,availableStatusOptions:x,groupBy:S,dateGroupPrecision:k,onDateGroupPrecisionChange:N});return{activeView:R,enabledTools:we,isFilterActiveEffective:pe,isSortActiveEffective:Re,isAutomationActiveEffective:Ae,isSettingsMenuOpenEffective:Ze,closeSettingsMenu:nt,isToolEnabled:at,isSearchOpen:_,searchInputRef:A,handleSearchOpen:I,handleSearchClose:j,handleSearchSubmit:L,handleSearchBlur:q,sortColumnSearchTerm:ne,setSortColumnSearchTerm:re,filterColumnSearchTerm:oe,setFilterColumnSearchTerm:le,columnSearchTerm:ce,setColumnSearchTerm:F,filterMenuOpen:te,setFilterMenuOpen:K,openPillId:W,setOpenPillId:V,isSettingsMenuOpenState:P,setIsSettingsMenuOpenState:H,viewNameDraft:X,setViewNameDraft:de,commitViewName:fe,...Be,filterableColumns:Ne,formattableColumns:Jt,addConditionToColumn:ut,removeColumnFilters:Ut,updateCondition:nn,removeCondition:kn,visibleFilterColumns:Nn,activeFiltersCountByColumn:Pn,...Xn,tableColumns:sr,filteredTableColumns:Kt,...bn}}function rIe(e){const{seed:t,views:n,children:r,filters:s={},availableTagsByColumnId:i={}}=e,{t:o}=kt(),a=nIe(e),{activeViewId:l,onChangeView:u,onCreateView:f,onRenameView:p,onCreate:g,onOpenAutomation:b,onOpenFilters:y,onOpenSort:x,onOpenSettings:S,sortState:k,onSortChange:N,onConditionalFormatsChange:T,columnVisibility:R,onColumnVisibilityChange:_,pageSize:A,onPageSizeChange:I,groupBy:j,onGroupByChange:L}=e,{activeView:q,isFilterActiveEffective:ne,isSortActiveEffective:re,isAutomationActiveEffective:oe,isSettingsMenuOpenEffective:le,closeSettingsMenu:ce,isToolEnabled:F,isSearchOpen:te,searchInputRef:K,handleSearchOpen:W,handleSearchClose:V,handleSearchSubmit:P,handleSearchBlur:H,sortColumnSearchTerm:X,setSortColumnSearchTerm:de,filterColumnSearchTerm:fe,setFilterColumnSearchTerm:we,columnSearchTerm:pe,setColumnSearchTerm:Re,filterMenuOpen:Ae,setFilterMenuOpen:Ze,openPillId:nt,setOpenPillId:at,setIsSettingsMenuOpenState:Be,viewNameDraft:Ne,setViewNameDraft:Jt,commitViewName:ut,filteredSortableColumns:Ut,handleToggleSortDirection:nn,handleSortColumnSelect:kn,addConditionToColumn:Xn,removeColumnFilters:sr,updateCondition:Nn,removeCondition:Pn,visibleFilterColumns:Kt,activeFiltersCountByColumn:bn,conditionalFormats:Nt,activeConditionalRule:$n,isConditionalEditorOpen:Bn,setActiveConditionalRuleId:En,setIsConditionalEditorOpen:Fn,addConditionalFormatRule:Ts,updateConditionalRule:Kr,updateConditionalTextStyles:Ar,removeConditionalRule:Qn,moveConditionalRule:_n,updateConditionalCondition:_t,addConditionalCondition:_s,removeConditionalCondition:Or,filteredTableColumns:ht,formattableColumns:ke,recommendedGroupColumns:Me,otherGroupColumns:Le,activeGroupLabel:rt,datePrecisionMode:U,applyDatePrecisionMode:Q}=a;if(!q)return null;const ge=Object.keys(s).length>0||!!rt;return h.jsxs("div",{"data-seed-slug":t.slug,children:[h.jsx("div",{className:"sticky top-(--header-height) z-10 bg-background/95 backdrop-blur-sm border-b",children:h.jsx(Wn,{className:"py-3 border-0 bg-transparent shadow-none rounded-none",children:h.jsxs(Kn,{className:"px-4 py-0",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0",children:[h.jsx(Hje,{views:n,activeViewId:l,onChangeView:u,onCreateView:f}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[F("filter")&&h.jsx(Aje,{open:Ae,onOpenChange:Ze,isActive:ne,onOpen:y,searchTerm:fe,onSearchTermChange:we,visibleFilterColumns:Kt,activeFiltersCountByColumn:bn,onSelectColumn:je=>{Xn(je),Ze(!1),we(""),at(je)}}),F("sort")&&h.jsx(Oje,{searchTerm:X,onSearchTermChange:de,filteredSortableColumns:Ut,sortState:k,onToggleDirection:nn,onSelectColumn:kn,isActive:re,onOpen:x}),F("automation")&&h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:oe?"secondary":"ghost",size:"icon-sm","aria-label":"Automazione",onClick:()=>b?.(),children:h.jsx(e6,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:"Automazione"})]}),F("search")&&h.jsx(Uje,{isSearchOpen:te,searchValue:e.searchValue??"",searchInputRef:K,handleSearchSubmit:P,onSearchChange:e.onSearchChange,handleSearchBlur:H,handleSearchClose:V,handleSearchOpen:W}),F("settings")&&h.jsx(Kje,{isSettingsMenuOpenEffective:le,setIsSettingsMenuOpenState:Be,onOpenSettings:S,isSettingsOpen:e.isSettingsOpen,commitViewName:ut,setColumnSearchTerm:Re,viewNameDraft:Ne,setViewNameDraft:Jt,setIsConditionalEditorOpen:Fn,filterColumnSearchTerm:fe,setFilterColumnSearchTerm:we,visibleFilterColumns:Kt,addConditionToColumn:Xn,setOpenPillId:at,closeSettingsMenu:ce,filters:s,sortColumnSearchTerm:X,setSortColumnSearchTerm:de,handleToggleSortDirection:nn,sortState:k,filteredSortableColumns:Ut,handleSortColumnSelect:kn,groupBy:j??null,onGroupByChange:L,recommendedGroupColumns:Me,datePrecisionMode:U,applyDatePrecisionMode:Q,otherGroupColumns:Le,onConditionalFormatsChange:T,formattableColumns:ke,conditionalFormats:Nt,activeConditionalRule:$n,isConditionalEditorOpen:Bn,setActiveConditionalRuleId:En,addConditionalFormatRule:Ts,updateConditionalRule:Kr,updateConditionalTextStyles:Ar,removeConditionalRule:Qn,moveConditionalRule:_n,updateConditionalCondition:_t,addConditionalCondition:_s,removeConditionalCondition:Or,availableTagsByColumnId:i,columnVisibility:R,onColumnVisibilityChange:_,columnSearchTerm:pe,filteredTableColumns:ht,pageSize:A,onPageSizeChange:I}),F("create")&&h.jsxs(He,{variant:"default",size:"sm",onClick:g,className:"gap-1.5",children:[h.jsx(Kl,{className:"size-4"}),o("siteHeader.new")]})]})]}),ge&&h.jsx("div",{className:"mt-3 pt-3 border-t",children:h.jsx($je,{filters:s,openPillId:nt,onOpenPillChange:at,groupBy:j??null,activeGroupLabel:rt??"",onGroupByChange:L,addConditionToColumn:Xn,removeColumnFilters:sr,updateCondition:Nn,removeCondition:Pn,availableTagsByColumnId:i})})]})})}),r!=null&&h.jsx("div",{className:"mt-4",children:r})]})}const w7={fetchList:async(e,t)=>(await Xt.get(`/content/${e}`,{params:{...t,filters:t.filters!=null?JSON.stringify(t.filters):void 0}})).data,fetchFacets:async e=>(await Xt.get(`/content/${e}/facets`)).data,delete:async(e,t)=>(await Xt.delete(`/content/${e}/${t}`)).data},Iy={all:["content"],lists:()=>[...Iy.all,"list"],list:(e,t)=>[...Iy.lists(),e,t]},PW={all:["facets"],bySlug:e=>[...PW.all,e]};function sIe(e,t){return is({queryKey:Iy.list(e||"",t),queryFn:()=>{if(!e)throw new Error("Slug is required");return w7.fetchList(e,t)},enabled:!!e,placeholderData:n=>n,staleTime:10*1e3})}const fg={getTotalStats:async()=>{const{data:e}=await Xt.get("/content/stats/total");return e},getCloudflareStats:async()=>{const{data:e}=await Xt.get("/content/stats/cloudflare");return e},getRecentActivity:async e=>{const{data:t}=await Xt.get("/content/stats/recent-activity",{params:{slug:e}});return t},getSystemHealth:async()=>{const{data:e}=await Xt.get("/content/stats/health");return e},getContentBreakdown:async()=>{const{data:e}=await Xt.get("/content/stats/breakdown");return e}},qi={all:["dashboard"],stats:()=>[...qi.all,"stats"],cloudflare:()=>[...qi.all,"cloudflare"],activity:()=>[...qi.all,"activity"],health:()=>[...qi.all,"health"],breakdown:()=>[...qi.all,"breakdown"]};function S7(){return is({queryKey:qi.stats(),queryFn:fg.getTotalStats,staleTime:300*1e3})}function C7(){return is({queryKey:qi.cloudflare(),queryFn:fg.getCloudflareStats,staleTime:300*1e3})}function $W(e){return is({queryKey:[...qi.activity(),e],queryFn:()=>fg.getRecentActivity(e),refetchInterval:60*1e3,staleTime:60*1e3})}function BW(){return is({queryKey:qi.health(),queryFn:fg.getSystemHealth,staleTime:300*1e3})}function iIe(){return is({queryKey:qi.breakdown(),queryFn:fg.getContentBreakdown,staleTime:300*1e3})}function oIe(e){return is({queryKey:PW.bySlug(e||""),queryFn:()=>{if(!e)throw new Error("Slug is required");return w7.fetchFacets(e)},enabled:!!e,staleTime:300*1e3,gcTime:1800*1e3})}function aIe(){const e=ia();return Ei({mutationFn:({slug:t,id:n})=>w7.delete(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Iy.all}),e.invalidateQueries({queryKey:qi.activity()})}})}function FW(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.columnId=="string"&&typeof t.label=="string"&&typeof t.type=="string"&&Array.isArray(t.conditions)}function zy(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}function Em(e){if(e==null)return null;if(typeof e=="string"){const t=e.trim();if(!t)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;const n=new Date(t);return Number.isNaN(n.getTime())?null:n.toISOString().slice(0,10)}if(typeof e=="number"){const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10)}return null}function lIe(e,t,n,r){if(n==="is_empty")return zy(e);if(n==="is_not_empty")return!zy(e);switch(t.type){case"tags":return cIe(e,n,r);case"number":return uIe(e,n,r);case"date":return dIe(e,n,r);case"boolean":return fIe(e,n,r);case"select":return hIe(e,n,r);default:return pIe(e,n,r)}}function cIe(e,t,n){const r=qE(e);return t==="contains"||t==="eq"?typeof n!="string"||!n.trim()?!0:r.includes(n):!0}function uIe(e,t,n){let r=null;typeof e=="number"?r=e:typeof e=="string"&&e.trim()!==""&&(r=Number(e));const s=typeof n=="number"?n:null;if(r==null||s==null||Number.isNaN(r)||Number.isNaN(s))return!0;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!0}}function dIe(e,t,n){const r=Em(e),s=typeof n=="string"?Em(n):null;if(!r||!s)return!0;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!0}}function fIe(e,t,n){const r=typeof e=="boolean"?e:null,s=typeof n=="boolean"?n:null;return r==null||s==null?!0:t==="eq"?r===s:!0}function hIe(e,t,n){const r=e==null?"":String(e);if(t!=="eq"||n==null)return!0;const s=String(n);return s.trim()?r.trim().toLowerCase()===s.trim().toLowerCase():!0}function pIe(e,t,n){const r=e==null?"":String(e);if(t==="contains")return typeof n!="string"||!n.trim()?!0:r.toLowerCase().includes(n.toLowerCase());if(t==="eq"){if(n==null)return!0;const s=String(n);return s.trim()?r.trim().toLowerCase()===s.trim().toLowerCase():!0}return!0}function NS(e,t){if(!FW(t))return!0;for(const n of t.conditions)if(!lIe(e,t,n.op,n.value))return!1;return!0}function mIe(e,t,n){const r=qE(e);return typeof n!="string"||!n.trim()||r.length===0?!1:t==="contains"||t==="eq"?r.includes(n):!1}function gIe(e,t,n){let r=null;typeof e=="number"?r=e:typeof e=="string"&&e.trim()!==""&&(r=Number(e));const s=typeof n=="number"?n:null;if(r==null||s==null||Number.isNaN(r)||Number.isNaN(s))return!1;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!1}}function bIe(e,t,n){const r=Em(e),s=typeof n=="string"?Em(n):null;if(!r||!s)return!1;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!1}}function vIe(e,t,n){const r=typeof e=="boolean"?e:null,s=typeof n=="boolean"?n:null;return r==null||s==null?!1:t==="eq"?r===s:!1}function yIe(e,t,n){const r=e==null?"":String(e);if(t!=="eq"||n==null)return!1;const s=String(n);return!s.trim()||!r.trim()?!1:r.trim().toLowerCase()===s.trim().toLowerCase()}function xIe(e,t,n){const r=e==null?"":String(e);if(t==="contains")return typeof n!="string"||!n.trim()||!r.trim()?!1:r.toLowerCase().includes(n.toLowerCase());if(t==="eq"){if(n==null)return!1;const s=String(n);return!s.trim()||!r.trim()?!1:r.trim().toLowerCase()===s.trim().toLowerCase()}return!1}function wIe(e,t,n,r){if(n==="is_empty")return zy(e);if(n==="is_not_empty")return!zy(e);switch(t.type){case"tags":return mIe(e,n,r);case"number":return gIe(e,n,r);case"date":return bIe(e,n,r);case"boolean":return vIe(e,n,r);case"select":return yIe(e,n,r);default:return xIe(e,n,r)}}function _D(e,t){if(!FW(t))return!1;for(const n of t.conditions)if(!wIe(e,t,n.op,n.value))return!1;return!0}const HW=20,UW=60,Ly={year:!0,month:!0,day:!1};function SIe(e,t=Ly){const n=Em(e);if(!n)return"—";const r=new Date(n+"T00:00:00");if(t.day)return r.toLocaleDateString("it-IT",{day:"2-digit",month:"long",year:"numeric"});const s=[];return t.month&&s.push(r.toLocaleDateString("it-IT",{month:"long"})),t.year&&s.push(String(r.getFullYear())),s.length?s.join(" "):String(r.getFullYear())}const CIe=(e,t)=>{let n=0,r=0;for(const s of t){const i=s.getValue(e);i===!0?n++:i===!1&&r++}return{trueCount:n,falseCount:r}};function kIe(e){if(e!=null&&typeof e=="object"&&"trueCount"in e&&"falseCount"in e){const{trueCount:t,falseCount:n}=e;return`✓ ${t} / ✗ ${n}`}return""}function EIe(e,t){return typeof e=="number"&&!Number.isNaN(e)?`Σ ${e.toLocaleString("it-IT")} · ${t} voci`:`${t} voci`}function NIe(e){const t=e.trim().toLowerCase();if(!t)return"secondary";if(["error","failed","rejected","archived"].includes(t))return"destructive";if(["published","active","approved","online"].includes(t))return"default";let n=0;for(let r=0;r<t.length;r++){const s=t.codePointAt(r);s!=null&&(n=n*31+s>>>0,s>65535&&r++)}return n%2===0?"secondary":"outline"}function RD(e,t){let n=0;for(const r of e){const s=r.data[t];if(s==null)continue;const i=String(s).length;i>n&&(n=i)}return Math.min(Math.max(n,HW),UW)}function MIe(e,t){if(t.toLowerCase().includes("tag"))return null;let r=0;for(const s of e){const i=s.data[t];if(i==null)continue;let o;if(typeof i=="string")try{o=JSON.stringify(JSON.parse(i))}catch{o=i}else o=JSON.stringify(i);o.length>r&&(r=o.length)}return Math.min(Math.max(r,HW),UW)}function TIe(e,t){return e.type==="json"?MIe(t,e.alias):(e.type==="text",RD(t,e.alias))}function _Ie(e,t,n){const r={},s=e.slice(0,n);for(const i of t.branches){const o=TIe(i,s);o!=null&&(r[i.alias]=o)}return r}function RIe(e,t,n,r,s=[],i,o=Ly){const a=[{id:"select",header:({table:f})=>h.jsx(NC,{checked:f.getIsAllPageRowsSelected()||f.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:p=>f.toggleAllPageRowsSelected(!!p),"aria-label":"Seleziona tutto"}),cell:({row:f})=>h.jsx(NC,{checked:f.getIsSelected(),onCheckedChange:p=>f.toggleSelected(!!p),"aria-label":"Seleziona riga"}),enableSorting:!1,enableHiding:!1},{id:"id",accessorFn:f=>f.id,header:"ID",cell:({row:f})=>h.jsx("span",{className:"font-mono text-xs truncate max-w-[8rem] block",title:f.original.id,children:f.original.id}),enableSorting:!1},{id:"slug",accessorFn:f=>f.slug,header:"Slug",filterFn:(f,p,g)=>NS(f.getValue(p),g),cell:({row:f})=>{const p=f.original.slug;return h.jsx("span",{className:"text-muted-foreground text-sm",children:p??"—"})},enableSorting:!1},{id:"status",accessorFn:f=>f.status,header:"Stato",filterFn:(f,p,g)=>NS(f.getValue(p),g),cell:({row:f})=>{const p=(f.original.status??"").trim()||"—",g=NIe(p);return h.jsx(_i,{variant:g,children:p})},enableSorting:!1}],l=e.branches.map(f=>{const p={accessorFn:b=>b.data[f.alias],id:f.alias,header:()=>h.jsx("div",{className:"font-medium",children:f.label}),filterFn:(b,y,x)=>NS(b.getValue(y),x)};f.type==="date"?(p.getGroupingValue=b=>SIe(b.data[f.alias],o),p.aggregationFn="count",p.aggregatedCell=({getValue:b,row:y})=>{const x=y.subRows?.length??0,S=b();return S?h.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," · ",x," ",x===1?"voce":"voci"]}):null}):f.type==="boolean"?(p.aggregationFn=CIe,p.aggregatedCell=({getValue:b})=>{const y=kIe(b());return y?h.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null}):f.type==="number"?(p.aggregationFn="sum",p.aggregatedCell=({getValue:b,row:y})=>{const x=y.subRows?.length??0;return h.jsx("span",{className:"text-xs text-muted-foreground",children:EIe(b(),x)})}):(p.aggregationFn="count",p.aggregatedCell=({row:b})=>{const y=b.subRows?.length??0;return h.jsxs("span",{className:"text-xs text-muted-foreground",children:[y," ",y===1?"voce":"voci"]})});const g=r?.[f.alias];return{...p,cell:({row:b})=>h.jsx(_W,{branch:f,value:b.original.data[f.alias],options:typeof g=="number"?{maxLength:g}:void 0})}}),u={id:"actions",enableHiding:!1,cell:({row:f})=>{const p=f.original,g=s.length>1;return h.jsx("div",{className:"text-right",children:h.jsxs(Ao,{children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{variant:"ghost",size:"icon-xs",children:[h.jsx("span",{className:"sr-only",children:"Apri menu"}),h.jsx(XD,{})]})}),h.jsxs(Do,{align:"end",className:"w-40",children:[h.jsx(ks,{children:"Azioni"}),g?h.jsx(Ra,{onClick:()=>i?.(s),className:"text-destructive focus:text-destructive",children:"Elimina"}):h.jsxs(h.Fragment,{children:[h.jsx(Ra,{onClick:()=>{navigator.clipboard.writeText(p.id).then(()=>or.success("ID copiato"),()=>or.error("Copia fallita"))},children:"Copia ID"}),h.jsx(ri,{}),h.jsx(Ra,{onClick:()=>{t(p.id)},children:"Modifica"}),h.jsx(Ra,{onClick:()=>n(p.id),className:"text-destructive focus:text-destructive",children:"Elimina"})]})]})]})})}};return[...a,...l,u]}function VW(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function AIe(){const{slug:e}=Q$(),t=zo(),{t:n}=kt(),[r,s]=w.useState(0),i=10,[o,a]=w.useState(i),[l,u]=w.useState(""),f=VW(l,300),[p,g]=w.useState([]),[b]=wx(),y=b.get("status"),[x,S]=w.useState(()=>y?{status:{columnId:"status",label:"Status",type:"select",conditions:[{id:"status-prefilter",op:"eq",value:y}],selectOptions:["draft","published"]}}:{}),[k,N]=w.useState({}),[T,R]=w.useState(!1),[_,A]=w.useState(null),[I,j]=w.useState("table"),L=e?DB(e):null,[q,ne]=w.useState(null),[re,oe]=w.useState(Ly),{data:le,isLoading:ce,error:F}=sIe(e,{page:r+1,limit:o,search:f.trim()||void 0,sortBy:p[0]?.id,sortDir:p[0]?.desc?"desc":"asc",filters:x}),{data:te}=oIe(e),{mutateAsync:K}=aIe(),W=w.useMemo(()=>le?.items??[],[le]),V=le?.total??0,P=ce,H=F?F.message:null;w.useEffect(()=>{s(0)},[e,f,p,x,o]),w.useEffect(()=>{if(!q||!L)return;L.branches.find(Me=>Me.alias===q)?.type!=="date"&&oe(Ly)},[q,L]);const[X,de]=w.useState(()=>[{id:"table",label:"table",type:"table",enabledTools:["filter","sort","automation","search","settings","create"],conditionalFormats:[]},{id:"gallery",label:"gallery",type:"gallery",enabledTools:["filter","sort","search","create"],conditionalFormats:[]}]),fe={table:n("content.list.table"),gallery:n("content.list.gallery")},we=w.useMemo(()=>X.map(ke=>({...ke,label:fe[ke.type]??ke.label})),[X,n]),pe=w.useMemo(()=>X.find(ke=>ke.id===I),[I,X]),Re=w.useCallback((ke,Me)=>{de(Le=>Le.map(rt=>rt.id===ke?{...rt,conditionalFormats:Me}:rt))},[]),Ae=w.useCallback((ke,Me)=>Me==="id"?ke.id:Me==="slug"?ke.slug:Me==="status"?ke.status:ke.data?.[Me],[]),Ze=w.useRef(new Map);w.useEffect(()=>{Ze.current.clear()},[e,W]);const nt=w.useCallback((ke,Me,Le)=>{const rt=Ae(ke,Me);if(Le!=="tags")return rt;const U=`${ke.id}::${Me}`;if(Ze.current.has(U))return Ze.current.get(U);let Q=rt;if(typeof rt=="string")try{Q=JSON.parse(rt)}catch{Q=null}return Ze.current.set(U,Q),Q},[Ae]),at=w.useMemo(()=>(pe?.conditionalFormats??[]).filter(Me=>!!Me?.enabled).slice().sort((Me,Le)=>(Me.priority??0)-(Le.priority??0)),[pe?.conditionalFormats]),Be=w.useMemo(()=>at.filter(ke=>{const Me=ke.target;return Me==="row"||Me==="cell+row"}),[at]),Ne=w.useMemo(()=>{const ke=new Map;for(const Me of at){if(Me.target==="row")continue;const rt=ke.get(Me.columnId)??[];rt.push(Me),ke.set(Me.columnId,rt)}return ke},[at]),Jt=w.useCallback(ke=>{let Me;const Le={};for(const rt of Be){const U=nt(ke,rt.columnId,rt.group.type);if(_D(U,rt.group)){Me=IW(rt.tone,rt.textStyles??[]);break}}for(const[rt,U]of Ne.entries())for(const Q of U){const ge=nt(ke,Q.columnId,Q.group.type);if(_D(ge,Q.group)){Le[rt]=zW(Q.tone,Q.textStyles??[]);break}}return{rowClassName:Me,cellClassNameByColumnId:Le}},[Ne,nt,Be]),ut=w.useCallback(ke=>{e&&t(`/content/${e}/${ke}`)},[e,t]),Ut=w.useCallback(ke=>{A([ke]),R(!0)},[]),nn=w.useCallback(ke=>{const Me=Array.from(new Set(ke)).filter(Boolean);Me.length&&(A(Me),R(!0))},[]),kn=w.useCallback(()=>{e&&t(`/content/${e}/create`)},[e,t]),Xn=w.useCallback(async()=>{if(!e||!_||_.length===0)return;const Me=(await Promise.allSettled(_.map(Le=>K({slug:e,id:Le})))).filter(Le=>Le.status==="rejected").length;if(Me>0)throw new Error(`Eliminazione parziale: ${Me} su ${_.length} fallite`);N({})},[e,_,K]),sr=w.useMemo(()=>Object.keys(k).filter(ke=>k[ke]),[k]),Nn=w.useMemo(()=>V<=0?1:Math.max(1,Math.ceil(V/o)),[o,V]),[Pn,Kt]=w.useState(()=>{const ke={};if(ke.id=!1,!L)return ke;const Me=L.branches.filter(Le=>Le.type==="json"&&(Le.alias.toLowerCase().includes("metadata")||Le.alias.toLowerCase().includes("metadati"))).map(Le=>Le.alias);for(const Le of Me)ke[Le]=!1;return ke}),bn=w.useMemo(()=>{if(!(!L||W.length===0))return _Ie(W,L,o)},[L,W,o]),Nt=w.useMemo(()=>L?RIe(L,ut,Ut,bn,sr,nn,re):[],[L,ut,Ut,bn,sr,nn,re]),$n=p[0],Bn=w.useMemo(()=>{const ke=new Set;for(const Me of W){const Le=typeof Me.status=="string"?Me.status.trim():"";Le&&ke.add(Le)}return Array.from(ke).sort((Me,Le)=>Me.localeCompare(Le,"it"))},[W]),En=w.useMemo(()=>{if(!L)return{};const ke=L.branches.filter(Le=>Le.type==="json"&&Le.alias.toLowerCase().includes("tag"));if(ke.length===0)return{};const Me={};for(const Le of ke){const rt=new Set(Le.options??[]);for(const U of W)for(const Q of qE(U.data[Le.alias]))rt.add(Q);Me[Le.alias]=Array.from(rt).sort((U,Q)=>U.localeCompare(Q,"it"))}return Me},[W,L]),Fn=w.useMemo(()=>{const ke=new Set([...Object.keys(En),...Object.keys(te?.tagsByColumnId??{})]),Me={};for(const Le of ke){const rt=new Set([...En[Le]??[],...te?.tagsByColumnId?.[Le]??[]]);Me[Le]=Array.from(rt).sort((U,Q)=>U.localeCompare(Q,"it"))}return Me},[En,te?.tagsByColumnId]),Ts=w.useMemo(()=>te?.statuses&&te.statuses.length>0?te.statuses:Bn,[te?.statuses,Bn]),Kr=w.useMemo(()=>q?[q]:[],[q]),Ar=w.useMemo(()=>!L||!q?!1:L.branches.find(Me=>Me.alias===q)?.type==="date",[q,L]),Qn=w.useMemo(()=>{if(Ar&&q){let ke;return re.day?ke="day":re.year&&!re.month?ke="year":ke="monthYear",`group:${q}:date:${ke}`}return`group:${q??"none"}`},[re.day,re.month,re.year,q,Ar]),_n=w.useMemo(()=>{const ke=[],Me=ge=>typeof ge=="string"&&ge.trim().length>0,Le=ge=>typeof ge=="number"&&!Number.isNaN(ge),rt=(ge,je)=>{switch(ge){case"boolean":return je===!0||je===!1;case"number":return Le(je);default:return Me(je)}},U=(ge,je)=>{switch(ge){case"number":return Le(je);case"date":return Me(je);default:return!1}},Q=(ge,je)=>{switch(je.op){case"is_empty":case"is_not_empty":return!0;case"contains":return Me(je.value);case"eq":return rt(ge.type,je.value);case"gt":case"gte":case"lt":case"lte":return U(ge.type,je.value);default:return!1}};for(const[ge,je]of Object.entries(x))je.conditions.some(lt=>Q(je,lt))&&ke.push({id:ge,value:je});return ke},[x]),_t=w.useCallback(ke=>{if(!ke.length){g([]);return}const[Me]=ke;g([{id:Me.id,desc:Me.desc??!1}])},[]),_s=w.useCallback(ke=>{if(!ke.columnId){g([]);return}g([{id:ke.columnId,desc:ke.desc}])},[]),Or=w.useCallback((ke,Me)=>{de(Le=>Le.map(rt=>rt.id===ke?{...rt,label:Me}:rt))},[]),ht=w.useMemo(()=>{const ke=["id"];if(!L)return ke;const Me=L.branches.filter(Le=>Le.type==="json"&&(Le.alias.toLowerCase().includes("metadata")||Le.alias.toLowerCase().includes("metadati"))).map(Le=>Le.alias);return[...ke,...Me]},[L]);return L?h.jsxs("div",{className:"[--header-height:calc(--spacing(14))] overflow-x-clip",children:[h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 min-w-0",children:h.jsxs("div",{className:"content-area-inner",children:[h.jsxs("div",{className:"mb-6",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:L.labelPlural??L.label}),h.jsxs("p",{className:"text-muted-foreground text-sm",children:['Gestisci i contenuti di tipo "',L.slug,'"']})]}),h.jsxs(rIe,{seed:L,views:we,activeViewId:I,onChangeView:j,onRenameView:Or,onConditionalFormatsChange:Re,onCreate:kn,searchValue:l,onSearchChange:u,sortState:{columnId:$n?.id??null,desc:$n?.desc??!0},onSortChange:_s,filters:x,onFiltersChange:S,availableTagsByColumnId:Fn,availableStatusOptions:Ts,pageSize:o,onPageSizeChange:ke=>{a(ke),s(0)},columnVisibility:Pn,onColumnVisibilityChange:Kt,groupBy:q,onGroupByChange:ne,dateGroupPrecision:re,onDateGroupPrecisionChange:oe,children:[H&&h.jsx("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:h.jsx("p",{className:"text-sm text-destructive",children:H})}),P&&!H&&I==="table"&&h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx("div",{className:"text-muted-foreground",children:"Caricamento..."})}),!P&&!H&&I==="table"&&h.jsx(i7e,{columns:Nt,data:W,initialHiddenColumns:ht,getRowStyles:Jt,rowSelection:k,onRowSelectionChange:N,onRowDoubleClick:ke=>ut(ke.id),grouping:Kr,onGroupingChange:ke=>ne(ke[0]??null),renderRowContextMenuContent:ke=>h.jsxs(h.Fragment,{children:[h.jsx(J6e,{children:"Azioni"}),sr.length>1?h.jsx(ld,{onSelect:()=>nn(sr),className:"text-destructive focus:text-destructive",children:"Elimina"}):h.jsxs(h.Fragment,{children:[h.jsx(ld,{onSelect:()=>{navigator.clipboard.writeText(ke.id).then(()=>or.success("ID copiato"),()=>or.error("Copia fallita"))},children:"Copia ID"}),h.jsx(cq,{}),h.jsx(ld,{onSelect:()=>ut(ke.id),children:"Modifica"}),h.jsx(ld,{onSelect:()=>Ut(ke.id),className:"text-destructive focus:text-destructive",children:"Elimina"})]})]}),pageSize:o,onPageSizeChange:ke=>{a(ke),s(0)},pageIndex:r,onPageIndexChange:s,pageCount:Nn,totalRows:V,manualPagination:!0,manualSorting:!0,manualFiltering:!0,columnVisibility:Pn,onColumnVisibilityChange:Kt,globalFilter:l,onGlobalFilterChange:u,sorting:p,onSortingChange:_t,columnFilters:_n},Qn),!H&&I==="gallery"&&h.jsx(Rje,{seed:L,data:W,isLoading:P,onEdit:ut})]})]})})})]})]}),h.jsx(u7e,{open:T,onOpenChange:R,seed:L,entryIds:_,onConfirm:Xn})]}):h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsx("div",{className:"content-area-inner",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("h2",{className:"text-lg font-semibold text-destructive",children:"Errore"}),h.jsx("p",{className:"text-sm text-destructive/90",children:H||`Seed "${e}" non trovato`})]})})})})]})]})})}async function OIe(e,t){return(await Xt.get(`/content/${e}/${t}`)).data}async function DIe(e,t){return(await Xt.post(`/content/${e}`,t)).data}async function jIe(e,t,n){return(await Xt.put(`/content/${e}/${t}`,n)).data}function IIe(e){return vC(e)}function AD(e){return e.alias.startsWith("meta")}function zIe(){return{type:"doc",content:[{type:"paragraph"}]}}function OD(){const{t:e}=kt(),{slug:t,id:n}=Q$(),r=zo(),s=!n,i=t?DB(t):null,[o,a]=w.useState(!!n),[l,u]=w.useState(null),[f,p]=w.useState({}),[g,b]=w.useState("draft"),[y,x]=w.useState(""),[S,k]=w.useState(!1),[N,T]=w.useState(!1),[R,_]=w.useState(!1),A=w.useRef(!1),I=Kfe(()=>R&&!A.current),j=w.useCallback((V,P)=>{p(H=>({...H,[V]:P})),_(!0)},[]);w.useEffect(()=>{if(!t||!n||!i)return;let V=!1;return a(!0),u(null),OIe(t,n).then(P=>{V||(p(P.data??{}),b(P.status??"draft"),x(P.slug??""))}).catch(P=>{V||u(P instanceof Error?P.message:e("content.editor.loadingError"))}).finally(()=>{V||a(!1)}),()=>{V=!0}},[t,n,i]),w.useEffect(()=>{if(!i||!s)return;const V={};i.branches.forEach(P=>{P.type==="boolean"?V[P.alias]=!1:P.type==="richtext"?V[P.alias]=zIe():V[P.alias]=""}),p(V),b("draft"),x(""),k(!1)},[i,s]);const L=w.useMemo(()=>i?.branches.find(V=>V.type==="text")?.alias,[i]),q=L?f[L]:void 0;w.useEffect(()=>{if(!s||S||L==null)return;const V=q;let P="";typeof V=="string"?P=V:V!=null&&(P=String(V));const H=IIe(P);x(H)},[s,S,L,q]);const ne=w.useMemo(()=>i?.branches.find(V=>V.type==="richtext"),[i]),re=!!ne,oe=w.useMemo(()=>i?.branches.filter(V=>V.alias!==ne?.alias&&AD(V))??[],[i,ne]),le=w.useMemo(()=>i?.branches.filter(V=>V.alias!==ne?.alias&&!AD(V))??[],[i,ne]),ce=w.useCallback(()=>{const V={};if(!i)return V;for(const P of i.branches)if(P.type==="json"&&f[P.alias]){const H=f[P.alias];if(typeof H=="string")try{V[P.alias]=JSON.parse(H)}catch{V[P.alias]=H}else V[P.alias]=H}else V[P.alias]=f[P.alias];return{slug:y.trim()||null,status:g.trim()||"draft",...V}},[i,f,y,g]),F=()=>{if(!i)return!0;for(const V of i.branches){if(V.type!=="json"||!f[V.alias])continue;const P=f[V.alias];if(typeof P=="string")try{JSON.parse(P)}catch{return or.error(e("content.editor.jsonError",{field:V.label})),!1}}return!0},te=async(V,P,H)=>{if(H){await jIe(V,H,P),or.success(e("content.editor.savedSuccess"));return}await DIe(V,P),or.success(e("content.editor.createdSuccess"))},K=async V=>{if(V.preventDefault(),!(!t||!i)&&!(!s&&!n)&&F()){T(!0);try{const P=ce();await te(t,P,s?null:n),_(!1),A.current=!0,r(`/content/${t}`)}catch(P){if(P.response?.status===409){or.error(e("content.editor.slugDuplicate"));return}or.error(P instanceof Error?P.message:e("content.editor.saveError"))}finally{T(!1)}}},W=()=>r(t?`/content/${t}`:"/");return t?i?n&&o?h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4",children:[h.jsx(yr,{className:"h-10 w-48"}),h.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-[1fr_320px] lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_400px]",children:[h.jsx(yr,{className:"min-h-[70vh] rounded-lg"}),h.jsx(yr,{className:"h-64 rounded-lg"})]})]})})]})]})}):n&&l?h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("p",{className:"text-destructive",children:l}),h.jsx(He,{variant:"outline",className:"mt-2",onClick:W,children:"Indietro"})]})})})]})]})}):h.jsxs("div",{className:"[--header-height:calc(--spacing(14))]",children:[h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("form",{className:"content-area-inner flex flex-1 flex-col",onSubmit:K,children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[h.jsxs(He,{type:"button",variant:"ghost",size:"sm",onClick:W,children:[h.jsx(zZ,{className:"mr-1 size-4"}),e("content.editor.back")]}),h.jsx("h1",{className:"text-xl font-semibold truncate pb-1",children:s?e("content.editor.newEntry",{label:i.label}):e("content.editor.editEntry",{label:i.label})}),h.jsx(He,{type:"submit",disabled:N,children:N?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("content.editor.saving")]}):e("content.editor.save")})]}),re?h.jsxs("div",{className:"grid flex-1 gap-6 md:grid-cols-[1fr_320px] lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_400px] md:min-h-0",children:[h.jsx("div",{className:"min-h-[70vh] flex flex-col rounded-lg border-0",children:h.jsx(eh,{branch:ne,value:f[ne.alias],onChange:V=>j(ne.alias,V)})}),h.jsxs("aside",{className:"flex flex-col gap-4 md:sticky md:top-[calc(var(--header-height)+1rem)] md:self-start",children:[h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.metadataSeo")})}),h.jsxs(Kn,{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-status",children:e("content.editor.status")}),h.jsxs(Ul,{value:g,onValueChange:V=>{b(V),_(!0)},children:[h.jsx(Vl,{id:"entry-status",className:"w-full",children:h.jsx(hu,{placeholder:e("content.editor.status")})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"draft",children:e("content.editor.draft")}),h.jsx(Eo,{value:"published",children:e("content.editor.published")})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-slug",children:e("content.editor.slug")}),h.jsx(pn,{id:"entry-slug",value:y,onChange:V=>{x(vC(V.target.value)),k(!0),_(!0)},maxLength:15,placeholder:e("content.editor.slugPlaceholder"),className:"font-mono text-sm"})]}),oe.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))]})]}),h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.content")})}),h.jsx(Kn,{className:"space-y-4",children:le.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]})]})]}):h.jsxs("div",{className:"mx-auto w-full max-w-2xl lg:max-w-3xl xl:max-w-4xl space-y-6",children:[h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.publication")})}),h.jsx(Kn,{className:"space-y-4",children:h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-status",children:e("content.editor.status")}),h.jsxs(Ul,{value:g,onValueChange:V=>{b(V),_(!0)},children:[h.jsx(Vl,{id:"entry-status",className:"w-full",children:h.jsx(hu,{placeholder:e("content.editor.status")})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"draft",children:e("content.editor.draft")}),h.jsx(Eo,{value:"published",children:e("content.editor.published")})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-slug",children:e("content.editor.slug")}),h.jsx(pn,{id:"entry-slug",value:y,onChange:V=>{x(vC(V.target.value)),k(!0),_(!0)},maxLength:15,placeholder:e("content.editor.slugPlaceholder"),className:"font-mono text-sm"})]})]})})]}),oe.length>0&&h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.metadataSeo")})}),h.jsx(Kn,{className:"space-y-4",children:oe.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]}),h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.content")})}),h.jsx(Kn,{className:"space-y-4",children:le.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]})]})]})})})]})]}),h.jsx(yq,{open:I.state==="blocked",children:h.jsxs(xq,{children:[h.jsxs(wq,{children:[h.jsx(Cq,{children:e("content.editor.unsavedTitle")}),h.jsx(kq,{children:e("content.editor.unsavedDesc")})]}),h.jsxs(Sq,{children:[h.jsx(Nq,{onClick:()=>I.reset?.(),children:e("content.editor.stay")}),h.jsx(Eq,{variant:"destructive",onClick:()=>I.proceed?.(),children:e("content.editor.exitWithout")})]})]})})]}):h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("p",{className:"text-destructive",children:e("content.editor.seedNotFound",{slug:t})}),h.jsx(He,{variant:"outline",className:"mt-2",onClick:W,children:e("content.editor.back")})]})})})]})]})}):h.jsx("div",{className:"flex min-h-svh items-center justify-center p-4",children:h.jsx("p",{className:"text-destructive",children:e("content.editor.slugMissing")})})}const LIe={alias:"body",label:"Corpo del testo",type:"richtext"};function PIe(){const[e,t]=w.useState("<h2>Titolo di esempio</h2><p>Scrivi qui il tuo contenuto <strong>ricco</strong>.</p><ul><li>Primo punto</li><li>Secondo punto</li></ul>");return h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"mx-auto w-full max-w-screen-2xl p-6 space-y-8",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Field Playground"}),h.jsxs("p",{className:"text-muted-foreground text-sm mt-1",children:["Pagina di test per il campo ",h.jsx("code",{className:"font-mono bg-muted px-1 py-0.5 rounded text-xs",children:"richtext"})]})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-base font-medium",children:["Edit — ",h.jsx("span",{className:"text-muted-foreground font-normal",children:'FieldEdit type="richtext"'})]}),h.jsx("div",{className:"max-w-2xl",children:h.jsx(eh,{branch:LIe,value:e,onChange:n=>t(n)})})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-base font-medium",children:["Preview — ",h.jsx("span",{className:"text-muted-foreground font-normal",children:"HTML compilato con stili applicati"})]}),h.jsx("div",{className:"richtext-content rounded-md border border-input bg-background px-4 py-3 max-w-2xl",dangerouslySetInnerHTML:{__html:e}})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-base font-medium",children:"Output HTML grezzo"}),h.jsx("pre",{className:"rounded-md border border-input bg-muted/30 px-4 py-3 text-xs font-mono whitespace-pre-wrap break-all max-w-2xl max-h-48 overflow-auto",children:e})]})]})})]})]})})}class $Ie extends w.Component{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error(`[BeechCMS] Widget "${this.props.widgetId}" crashed:`,t,n)}render(){return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-rose-300/40 bg-rose-500/5 p-4 text-center",children:[h.jsx(JC,{className:"h-5 w-5 text-rose-400"}),h.jsx("p",{className:"text-xs font-medium text-rose-400",children:"Widget non disponibile"}),h.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["ID: ",h.jsx("span",{className:"font-mono",children:this.props.widgetId})]})]}):this.props.children}}const BIe={it:ag,en:ki};function FIe(){const{data:e=[],isLoading:t}=$W(),{t:n,i18n:r}=kt(),s=BIe[r.language]??ag;return h.jsxs(Wn,{className:"col-span-2 border-none bg-background/50 backdrop-blur-sm",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-lg font-semibold",children:n("dashboard.recentActivity.title")})}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-8",children:[t?h.jsx("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:n("dashboard.recentActivity.loading")})}):e.map(i=>h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx(jd,{className:"h-9 w-9 border border-primary/10",children:h.jsx(Id,{className:"bg-primary/5 text-primary text-xs",children:(i.user_name||i.user_email).slice(0,2).toUpperCase()})}),h.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[h.jsxs("p",{className:"text-sm leading-none text-muted-foreground",children:[h.jsx("span",{className:"font-bold text-foreground",children:i.user_name||i.user_email})," ",n(`dashboard.recentActivity.actions.${i.action}`,{defaultValue:i.action})," ",h.jsx("span",{className:"font-semibold text-primary",children:i.details?.title||i.details?.name||i.entity_slug||i.entity_id})]}),h.jsx("p",{className:"text-xs text-muted-foreground/70",children:km(new Date(i.created_at*1e3),{addSuffix:!0,locale:s})})]})]},i.id)),!t&&e.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:n("dashboard.recentActivity.empty")})})]})})]})}function HIe(){const{data:e,isLoading:t}=BW();if(t||!e)return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-sm font-medium",children:"System Health"})}),h.jsx(Kn,{children:h.jsx("div",{className:"h-[120px] w-full animate-pulse rounded-lg bg-neutral-200 dark:bg-neutral-800"})})]});const n=e.status==="warning";return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50 shadow-sm transition-all hover:shadow-md",children:[h.jsxs(xr,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[h.jsxs(_r,{className:"text-sm font-medium flex items-center gap-2",children:[n?h.jsx(jJ,{className:"size-4 text-amber-500"}):h.jsx(zJ,{className:"size-4 text-emerald-500"}),"System Health"]}),h.jsx("div",{className:ee("px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",n?"bg-amber-100 text-amber-700 dark:bg-amber-500/10 dark:text-amber-400":"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400"),children:e.status})]}),h.jsxs(Kn,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsxs("div",{className:"flex items-center gap-2 text-neutral-500 dark:text-neutral-400",children:[h.jsx(YC,{className:"size-3"}),h.jsx("span",{children:"D1 Monthly Requests"})]}),h.jsxs("span",{className:"font-medium text-neutral-900 dark:text-neutral-100",children:[e.database.requests30d.toLocaleString()," / ",(e.database.limit/1e6).toFixed(0),"M"]})]}),h.jsx(Lh,{value:e.database.percentage,className:"h-1.5",indicatorClassName:ee(e.database.percentage>80?"bg-amber-500":"bg-emerald-500")})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsxs("div",{className:"flex items-center gap-2 text-neutral-500 dark:text-neutral-400",children:[h.jsx(LX,{className:"size-3"}),h.jsx("span",{children:"R2 Storage Used"})]}),h.jsxs("span",{className:"font-medium text-neutral-900 dark:text-neutral-100",children:[(e.storage.used/(1024*1024)).toFixed(1)," MB / ",(e.storage.limit/(1024*1024*1024)).toFixed(0)," GB"]})]}),h.jsx(Lh,{value:e.storage.percentage,className:"h-1.5",indicatorClassName:ee(e.storage.percentage>80?"bg-amber-500":"bg-emerald-500")})]}),h.jsxs("p",{className:"text-[10px] text-neutral-400 dark:text-neutral-500 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:["Last check: ",new Date(e.lastUpdate*1e3).toLocaleTimeString()]})]})]})}function UIe(){const{t:e}=kt(),{data:t=[],isLoading:n}=iIe();if(n)return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-sm font-medium",children:"Content Pulse"})}),h.jsx(Kn,{children:h.jsx("div",{className:"space-y-4",children:[1,2,3].map(i=>h.jsx("div",{className:"h-10 w-full animate-pulse rounded-lg bg-neutral-200 dark:bg-neutral-800"},i))})})]});const r=[...t].sort((i,o)=>o.count-i.count),s=r.reduce((i,o)=>i+o.count,0);return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50 shadow-sm transition-all hover:shadow-md",children:[h.jsxs(xr,{className:"flex flex-row items-center justify-between pb-4 space-y-0",children:[h.jsxs(_r,{className:"text-sm font-medium flex items-center gap-2",children:[h.jsx(Tl,{className:"size-4 text-emerald-500"}),"Content Pulse"]}),h.jsx(Jb,{className:"size-4 text-neutral-400"})]}),h.jsxs(Kn,{className:"",children:[h.jsx(Gl,{className:"h-[260px] pr-4",children:h.jsx("div",{className:"space-y-5",children:r.length===0?h.jsx("p",{className:"text-xs text-neutral-500 text-center py-4",children:e("dashboard.contentPulse.noContent")}):r.map(i=>{const o=s>0?i.count/s*100:0;return h.jsxs("div",{className:"group space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsx(gs,{to:`/content/${i.slug}`,className:"font-medium text-neutral-700 dark:text-neutral-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:i.label}),h.jsxs("span",{className:"text-neutral-500 tabular-nums",children:[i.count," entries"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Lh,{value:o,className:"h-1.5 flex-1",indicatorClassName:"bg-emerald-500/80 dark:bg-emerald-400/80"}),h.jsxs("span",{className:"text-[10px] text-neutral-400 w-8 text-right font-mono",children:[Math.round(o),"%"]})]})]},i.slug)})})}),h.jsxs("div",{className:"mt-6 pt-4 border-t border-neutral-100 dark:border-neutral-800 flex justify-between items-center",children:[h.jsx("span",{className:"text-[10px] text-neutral-400 uppercase tracking-tighter font-bold",children:e("dashboard.contentPulse.totalDistribution")}),h.jsxs("span",{className:"text-[10px] font-mono font-bold text-neutral-500",children:[s," items"]})]})]})]})}function VIe(){return h.jsxs(Wn,{className:"relative overflow-hidden border-none bg-primary/5 text-primary-foreground",children:[h.jsx("div",{className:"absolute -right-8 -top-8 h-32 w-32 rounded-full bg-primary/20 blur-3xl"}),h.jsx(xr,{className:"relative flex flex-row items-center justify-between pb-2 text-foreground",children:h.jsxs(_r,{className:"flex items-center gap-2 text-lg font-semibold",children:[h.jsx(UJ,{className:"h-5 w-5 text-primary"}),"Beech AI Insights"]})}),h.jsxs(Kn,{className:"relative space-y-4 text-foreground",children:[h.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Ho notato che hai creato molti contenuti nella categoria ",h.jsx("span",{className:"font-semibold text-foreground",children:'"Blog"'})," ma pochi hanno una meta description ottimizzata per la SEO."]}),h.jsxs("div",{className:"rounded-xl bg-background/50 p-3 text-sm",children:[h.jsx("p",{className:"font-medium",children:"Suggerimento:"}),h.jsx("p",{className:"text-muted-foreground",children:"Posso generare automaticamente delle descrizioni SEO per i tuoi ultimi 5 articoli."})]}),h.jsxs("button",{className:"group flex items-center gap-1 text-sm font-semibold text-primary transition-all hover:gap-2",children:["Ottimizza ora",h.jsx(PZ,{className:"h-4 w-4"})]})]})]})}function qIe({onAction:e}){const t=[{id:"new-entry",label:"Nuovo Contenuto",icon:EX,color:"text-emerald-500"},{id:"media",label:"Carica Media",icon:Tm,color:"text-blue-500"},{id:"collections",label:"Gestisci Collezioni",icon:Jb,color:"text-amber-500"},{id:"settings",label:"Configurazione",icon:_m,color:"text-slate-500"}];return h.jsxs(Wn,{className:"border-none bg-background/50 backdrop-blur-sm",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-lg font-semibold",children:"Azioni Rapide"})}),h.jsx(Kn,{className:"grid grid-cols-2 gap-4",children:t.map(n=>h.jsxs(He,{variant:"outline",className:"flex h-24 flex-col items-center justify-center gap-2 border-none bg-background/40 transition-all hover:bg-background/80 hover:scale-105",onClick:()=>e(n.id),children:[h.jsx(n.icon,{className:`h-6 w-6 ${n.color}`}),h.jsx("span",{className:"text-xs font-medium",children:n.label})]},n.id))})]})}const GIe={emerald:{icon:"from-emerald-500/20 to-emerald-400/10 text-emerald-600 dark:text-emerald-400",badge:""},blue:{icon:"from-blue-500/20 to-blue-400/10 text-blue-600 dark:text-blue-400",badge:""},violet:{icon:"from-violet-500/20 to-violet-400/10 text-violet-600 dark:text-violet-400",badge:""},amber:{icon:"from-amber-500/20 to-amber-400/10 text-amber-600 dark:text-amber-400",badge:""},rose:{icon:"from-rose-500/20 to-rose-400/10 text-rose-600 dark:text-rose-400",badge:""}};function WIe({title:e,value:t,icon:n,description:r,trend:s,accent:i="emerald"}){const o=GIe[i];return h.jsx("div",{className:ee("h-full w-full flex flex-col","rounded-2xl border border-neutral-200/80 bg-white/75 backdrop-blur-md p-5","shadow-[0_1px_3px_0_rgb(0,0,0,0.05),0_1px_2px_-1px_rgb(0,0,0,0.04)]","transition-all duration-200 hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.08)]","hover:border-neutral-300/80","dark:border-neutral-700/50 dark:bg-neutral-900/65 dark:hover:border-neutral-600/60"),children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:e}),h.jsx("p",{className:"text-2xl font-bold tracking-tight text-foreground tabular-nums",children:t}),r&&h.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground leading-snug",children:r}),s&&h.jsxs("div",{className:ee("mt-2 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold",s.isPositive?"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":"bg-rose-100 text-rose-700 dark:bg-rose-500/15 dark:text-rose-400"),children:[s.isPositive?h.jsx(QC,{className:"size-3"}):h.jsx(nee,{className:"size-3"}),s.isPositive?"+":"-",s.value,"%"]})]}),h.jsx("div",{className:ee("shrink-0 rounded-xl bg-gradient-to-br p-2.5",o.icon),children:h.jsx(n,{size:20})})]})})}function Bh({icon:e,title:t,description:n}){return h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-2 text-center",children:[h.jsx(e,{className:"size-8 text-muted-foreground/40"}),h.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:t}),n&&h.jsx("p",{className:"text-xs text-muted-foreground/70",children:n})]})}function Kd({message:e,onRetry:t}){const{t:n}=kt();return h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-3 text-center",children:[h.jsx(KD,{className:"size-8 text-destructive/60"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:e??n("dashboard.widgets.error.message")}),t&&h.jsx(He,{variant:"outline",size:"sm",onClick:t,children:n("dashboard.widgets.error.retry")})]})}const KIe={it:ag,en:ki};function DD(e){return e==="published"?"bg-emerald-50 text-emerald-700 border-emerald-200/80 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-800/60":e==="draft"?"bg-amber-50 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60":"bg-neutral-100 text-neutral-600 border-neutral-200/80 dark:bg-neutral-800 dark:text-neutral-400"}function MS(e){const t=e.data;for(const n of Object.keys(t)){const r=t[n];if(typeof r=="string"&&r.trim())return r}return e.id}const YIe=/\.(jpg|jpeg|png|webp|gif|avif|svg)(\?.*)?$/i;function ZIe(e){for(const t of Object.values(e.data))if(typeof t=="string"&&(t.startsWith("http")||YIe.test(t)))return t;return null}function zC({seedSlug:e,variant:t="list"}){const{t:n,i18n:r}=kt(),s=KIe[r.language]??ki;function i(p){return p?km(new Date(p*1e3),{addSuffix:!0,locale:s}):"—"}const{data:o,isLoading:a,isError:l,refetch:u}=is({queryKey:["widget","recent-content",e],queryFn:async()=>{const g=(await Xt.get(`/content/${e}`,{params:{limit:5,sortBy:"updated_at",sortDir:"desc"}})).data;return Array.isArray(g)?g:g.items},staleTime:180*1e3}),f=h.jsx(gs,{to:`/content/${e}`,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n("dashboard.widgets.recentContent.viewAll")});return a?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx("div",{className:"space-y-3",children:Array.from({length:4}).map((p,g)=>h.jsx(yr,{className:"h-9 w-full rounded-lg animate-pulse"},g))})}):l?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx(Kd,{onRetry:()=>u()})}):o?.length?t==="cards"?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx(Gl,{className:"h-full",children:h.jsx("div",{className:"grid grid-cols-2 gap-3 pr-2",children:o.map(p=>{const g=ZIe(p);return h.jsxs(gs,{to:`/content/${e}/${p.id}`,className:"flex flex-col rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm hover:shadow-md transition-shadow",children:[g?h.jsx("img",{src:g,alt:"",className:"h-28 w-full object-cover shrink-0"}):h.jsx("div",{className:"h-28 shrink-0 bg-muted flex items-center justify-center",children:h.jsx(hM,{className:"size-7 text-muted-foreground/30"})}),h.jsxs("div",{className:"flex flex-col flex-1 p-2",children:[h.jsx("p",{className:"text-xs font-medium line-clamp-2 flex-1",children:MS(p)}),h.jsxs("div",{className:"flex items-center justify-between gap-1 mt-auto pt-2",children:[h.jsx("span",{className:ee("text-[10px] px-1.5 py-0.5 rounded-full font-semibold border",DD(p.status)),children:p.status}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:i(p.updated_at)})]})]})]},p.id)})})})}):h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx("ul",{className:"space-y-0.5",children:o.map(p=>h.jsxs("li",{className:"group rounded-lg px-3 py-2.5 hover:bg-muted/50 transition-colors",children:[h.jsx(gs,{to:`/content/${e}/${p.id}`,className:"text-sm font-medium truncate block hover:underline decoration-primary/30 mb-1 sm:hidden",children:MS(p)}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(gs,{to:`/content/${e}/${p.id}`,className:"text-sm font-medium truncate flex-1 hover:underline decoration-primary/30 hidden sm:block",children:MS(p)}),h.jsx(_i,{className:ee("shrink-0 text-[10px] border",DD(p.status)),variant:"outline",children:p.status}),h.jsx("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums ml-auto sm:ml-0",children:i(p.updated_at)})]})]},p.id))})}):h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,children:h.jsx(Bh,{icon:hM,title:n("dashboard.widgets.recentContent.noContent"),description:n("dashboard.widgets.recentContent.noContentDesc")})})}function XIe(e){return e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function LC({seeds:e,variant:t="minimal",title:n,placeholder:r,onCreated:s}){const{t:i}=kt(),[o,a]=w.useState(""),[l,u]=w.useState(e[0]?.slug??""),[f,p]=w.useState(!1),[g,b]=w.useState(null),y=ia(),x=zo(),S=e.find(A=>A.slug===l),k=S?.displayNameAlias??"title",N=i(`dashboard.widgets.quickDraft.fieldLabels.${k}`,{defaultValue:S?.displayNameLabel??k}),{mutate:T,isPending:R}=Ei({mutationFn:async()=>({id:(await Xt.post(`/content/${l}`,{status:"draft",[k]:o})).data.id,seedSlug:l}),onSuccess:({id:A,seedSlug:I})=>{y.invalidateQueries({queryKey:["content",I]}),y.invalidateQueries({queryKey:["widget","recent-content",I]}),y.invalidateQueries({queryKey:["widget","pending-drafts",I]}),y.invalidateQueries({queryKey:qi.activity()}),s?.(A,I),p(!0),setTimeout(()=>{x(`/content/${I}/${A}`)},800)},onError:A=>{b(A.message||i("dashboard.widgets.quickDraft.errorCreating"))}});function _(A){A.preventDefault(),b(null),!(!o.trim()||!l)&&T()}return f?h.jsx(On,{children:h.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-emerald-600 dark:text-emerald-400",children:[h.jsx(YD,{className:"size-5"}),h.jsx("span",{className:"text-sm font-semibold",children:i("dashboard.widgets.quickDraft.draftCreated")})]})}):h.jsx(On,{icon:QX,title:t==="minimal"?n||i("dashboard.widgets.quickDraft.title"):void 0,children:h.jsxs("form",{onSubmit:_,className:"space-y-3",children:[t==="expanded"&&h.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:n||i("dashboard.widgets.quickDraft.createDraft")}),h.jsxs("div",{className:ee("flex gap-2",t==="expanded"?"flex-col":"flex-col sm:flex-row sm:items-center"),children:[h.jsxs("div",{className:"flex-1 space-y-1",children:[t==="expanded"&&h.jsx("label",{className:"text-xs text-muted-foreground",children:N}),h.jsx(pn,{placeholder:r||`${N}…`,value:o,onChange:A=>a(A.target.value),className:"h-8 text-sm"}),t==="expanded"&&o&&h.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["/",XIe(o)]})]}),h.jsxs("div",{className:ee("flex gap-2",t==="minimal"?"items-center sm:contents":""),children:[h.jsxs("div",{className:ee(t==="expanded"?"w-full space-y-1":"flex-1 min-w-0 sm:w-28 sm:shrink-0 sm:flex-none"),children:[t==="expanded"&&h.jsx("label",{className:"text-xs text-muted-foreground",children:i("dashboard.widgets.quickDraft.type")}),h.jsxs(Ul,{value:l,onValueChange:u,children:[h.jsx(Vl,{className:"h-8 text-sm w-full overflow-hidden",children:h.jsx("span",{className:"truncate block",children:e.find(A=>A.slug===l)?.label??i("dashboard.widgets.quickDraft.type")})}),h.jsx(ql,{children:e.map(A=>h.jsx(Eo,{value:A.slug,children:A.label},A.slug))})]})]}),t==="minimal"&&h.jsx(He,{type:"submit",size:"sm",disabled:R||!o.trim(),className:"shrink-0 h-8",children:R?"…":i("dashboard.widgets.quickDraft.create")})]})]}),t==="expanded"&&h.jsx(He,{type:"submit",size:"sm",disabled:R||!o.trim(),className:"w-full h-8",children:i(R?"dashboard.widgets.quickDraft.creating":"dashboard.widgets.quickDraft.createDraft")}),g&&h.jsx("p",{className:"text-xs text-destructive",children:g})]})})}const QIe={it:ag,en:ki};function JIe(e){for(const t of Object.values(e.data))if(typeof t=="string"&&t.trim())return t;return e.id}function PC({seedSlug:e,variant:t="list",onPublish:n}){const{t:r,i18n:s}=kt(),i=QIe[s.language]??ki,o=ia(),{data:a,isLoading:l,isError:u,refetch:f}=is({queryKey:["widget","pending-drafts",e],queryFn:async()=>{const y=(await Xt.get(`/content/${e}`,{params:{has_pending_draft:1,limit:10}})).data;return Array.isArray(y)?y:y.items},staleTime:180*1e3}),p=Ei({mutationFn:async b=>(await Xt.post(`/content/${e}/${b}/draft/publish`),b),onSuccess:()=>{o.invalidateQueries({queryKey:["widget","pending-drafts",e]}),o.invalidateQueries({queryKey:["widget","recent-content",e]}),o.invalidateQueries({queryKey:qi.activity()})}}),g=a?.length?h.jsx(_i,{className:"bg-amber-100 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60 text-xs tabular-nums",variant:"outline",children:a.length}):null;return l?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((b,y)=>h.jsx(yr,{className:"h-10 w-full animate-pulse"},y))})}):u?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx(Kd,{onRetry:()=>f()})}):t==="counter"?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 h-full text-center",children:[h.jsx("span",{className:"text-5xl font-bold tabular-nums",children:a?.length??0}),h.jsx("p",{className:"text-sm text-muted-foreground",children:r("dashboard.widgets.pendingDrafts.pendingCount")}),h.jsx(gs,{to:`/content/${e}?status=draft`,children:h.jsx(He,{variant:"outline",size:"sm",children:r("dashboard.widgets.pendingDrafts.viewAll")})})]})}):a?.length?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,action:h.jsxs("div",{className:"flex items-center gap-2",children:[g,h.jsx(gs,{to:`/content/${e}?status=draft`,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r("dashboard.widgets.pendingDrafts.viewAll")})]}),children:h.jsx(Gl,{className:"h-[260px]",children:h.jsx("ul",{className:"space-y-1 pr-2",children:a.map(b=>h.jsxs("li",{className:"rounded-lg px-2 py-2 hover:bg-muted/40 transition-colors group",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx(gs,{to:`/content/${e}/${b.id}`,className:"flex-1 text-sm font-medium truncate hover:underline text-foreground decoration-primary/30 min-w-0",children:JIe(b)}),h.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 tabular-nums hidden sm:inline",children:b.updated_at?km(new Date(b.updated_at*1e3),{addSuffix:!0,locale:i}):"—"}),h.jsxs(He,{size:"sm",variant:"default",className:"h-6 text-xs px-2 shrink-0 gap-1 opacity-70 group-hover:opacity-100 transition-opacity hidden sm:flex",disabled:p.isPending,onClick:()=>{p.mutate(b.id),n?.(b.id)},children:[h.jsx(mM,{className:"size-3"}),r("dashboard.widgets.pendingDrafts.publish")]})]}),h.jsxs("div",{className:"flex items-center justify-between gap-2 mt-1 sm:hidden",children:[h.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:b.updated_at?km(new Date(b.updated_at*1e3),{addSuffix:!0,locale:i}):"—"}),h.jsxs(He,{size:"sm",variant:"default",className:"h-6 text-xs px-2 shrink-0 gap-1",disabled:p.isPending,onClick:()=>{p.mutate(b.id),n?.(b.id)},children:[h.jsx(mM,{className:"size-3"}),r("dashboard.widgets.pendingDrafts.publish")]})]})]},b.id))})})}):h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx(Bh,{icon:Tf,title:r("dashboard.widgets.pendingDrafts.noPending")})})}function Py({variant:e="single"}){const{t}=kt(),{data:n,isLoading:r,isError:s,refetch:i}=S7();if(r)return h.jsx(On,{children:h.jsx("div",{className:"flex gap-3 h-full",children:Array.from({length:e==="trio"?3:1}).map((p,g)=>h.jsx(yr,{className:"flex-1 h-16 animate-pulse rounded-lg"},g))})});if(s)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>i()})});const{total:o,today:a,week:l,month:u}=n??{total:0,today:0,week:0,month:0};if(e==="trio"){const p=[{label:t("dashboard.widgets.publicationStats.today"),value:a,color:"text-blue-600 dark:text-blue-400",border:"border-l-blue-400/60",bg:"bg-blue-50/60 dark:bg-blue-500/10"},{label:t("dashboard.widgets.publicationStats.week"),value:l,color:"text-violet-600 dark:text-violet-400",border:"border-l-violet-400/60",bg:"bg-violet-50/60 dark:bg-violet-500/10"},{label:t("dashboard.widgets.publicationStats.month"),value:u,color:"text-emerald-600 dark:text-emerald-400",border:"border-l-emerald-400/60",bg:"bg-emerald-50/60 dark:bg-emerald-500/10"}];return h.jsx(On,{children:h.jsx("div",{className:"flex gap-2 overflow-x-auto pb-0.5 sm:grid sm:grid-cols-3 sm:overflow-visible h-full",children:p.map(({label:g,value:b,color:y,border:x,bg:S})=>h.jsxs("div",{className:ee("flex flex-col justify-center rounded-lg border-l-2 px-3 py-2 gap-0.5","min-w-[80px] shrink-0 sm:min-w-0 sm:shrink",x,S),children:[h.jsx("span",{className:ee("text-xl font-bold tabular-nums leading-none sm:text-2xl",y),children:b}),h.jsx("span",{className:"text-[10px] font-medium text-muted-foreground whitespace-nowrap",children:g})]},g))})})}const f=a>0;return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col justify-center h-full gap-1",children:[h.jsxs("div",{className:"flex items-end gap-2",children:[h.jsx("span",{className:"text-4xl font-bold tabular-nums",children:o.toLocaleString()}),h.jsxs("span",{className:ee("mb-1 flex items-center gap-0.5 text-sm font-semibold",f?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"),children:[h.jsx(QC,{className:ee("size-4",!f&&"opacity-20")}),a]})]}),h.jsx("p",{className:"text-sm text-muted-foreground",children:t("dashboard.widgets.publicationStats.totalContent")})]})})}Py.displayName="PublicationStatsWidget";function $C({variant:e="badge"}){const{data:t,isLoading:n,isError:r,refetch:s,dataUpdatedAt:i}=BW(),{data:o}=C7(),{data:a}=S7(),l=t?.status==="healthy"||t?.status==="warning";if(n)return h.jsx(On,{children:h.jsx(yr,{className:"h-10 w-full animate-pulse"})});if(r)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>s()})});const u=l??!1,f=i?new Date(i).toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}):"—";if(e==="pill-row"){const p=[{label:"API",ok:u},{label:"Storage",ok:!!o},{label:"DB",ok:typeof a?.total=="number"&&a.total>=0}];return h.jsx(On,{children:h.jsx("div",{className:"flex flex-wrap items-center gap-2 h-full",children:p.map(({label:g,ok:b})=>h.jsxs(_i,{className:ee("text-xs gap-1.5 px-2.5 py-1",b?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 border-emerald-200/80 dark:border-emerald-800/60":"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-400 border-red-200/80 dark:border-red-800/60"),variant:"outline",children:[h.jsx("span",{className:ee("size-1.5 rounded-full",b?"bg-emerald-500 shadow-[0_0_4px_rgba(34,197,94,0.6)]":"bg-red-500")}),g]},g))})})}return h.jsx(On,{children:h.jsxs("div",{className:"flex items-center gap-3 h-full",children:[h.jsxs("div",{className:"relative shrink-0",children:[h.jsx("span",{className:ee("block size-3 rounded-full",u?"bg-emerald-500":"bg-red-500")}),u&&h.jsx("span",{className:"absolute inset-0 rounded-full bg-emerald-500 animate-ping opacity-60"})]}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-semibold",children:u?"Sito online":"Errore"}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Verificato alle ",f]})]}),u?h.jsx(uj,{className:"size-4 text-emerald-500 shrink-0"}):h.jsx(wee,{className:"size-4 text-red-500 shrink-0"})]})})}const eze=10*1024*1024*1024;function _b(e){return(e/1024/1024/1024).toFixed(1)}function tze(e){return e>85?"#ef4444":e>60?"#eab308":"#22c55e"}function nze({pct:e,usedLabel:t}){const o=2*Math.PI*38,a=o-e/100*o,l=tze(e);return h.jsxs("svg",{width:"104",height:"104",viewBox:"0 0 104 104","aria-hidden":!0,children:[h.jsx("circle",{cx:52,cy:52,r:38,fill:"none",stroke:"currentColor",strokeWidth:8,className:"text-muted-foreground/15 dark:text-muted-foreground/30"}),h.jsx("circle",{cx:52,cy:52,r:38,fill:"none",stroke:l,strokeWidth:8,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:a,transform:"rotate(-90 52 52)",className:"transition-all duration-1000 ease-in-out",style:{filter:`drop-shadow(0 0 4px ${l}60)`}}),h.jsxs("text",{x:52,y:48,textAnchor:"middle",dominantBaseline:"central",fontSize:"15",fontWeight:"700",fill:l,className:"tabular-nums",children:[e,"%"]}),h.jsx("text",{x:52,y:64,textAnchor:"middle",dominantBaseline:"central",fontSize:"9",fontWeight:"500",className:"fill-muted-foreground",fill:"currentColor",style:{color:"var(--muted-foreground)"},children:t})]})}function BC({variant:e="bar",totalBytes:t=eze}){const{t:n}=kt(),{data:r,isLoading:s,isError:i,refetch:o}=C7();if(s)return h.jsx(On,{children:h.jsx(yr,{className:"h-12 w-full animate-pulse"})});if(i)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>o()})});const a=r?r.storage.used*1024*1024:0,l=Math.min(100,Math.round(a/t*100));if(!r)return h.jsx(On,{children:h.jsx(Bh,{icon:ZC,title:n("dashboard.widgets.storage.noData")})});if(e==="gauge")return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col items-center gap-2 h-full w-full xs:flex-row sm:flex-row sm:items-center sm:gap-3",children:[h.jsx("div",{className:"shrink-0",children:h.jsx(nze,{pct:l,usedLabel:n("dashboard.widgets.storage.used")})}),h.jsxs("div",{className:"flex-1 min-w-0 text-center sm:text-left",children:[h.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n("dashboard.widgets.storage.title")}),h.jsxs("p",{className:"text-base font-bold text-foreground tabular-nums leading-tight",children:[_b(a)," ",h.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"GB"})]}),h.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n("dashboard.widgets.storage.total",{total:_b(t)})})]})]})});const u=`${_b(a)} GB di ${_b(t)} GB`;return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col justify-center gap-2 h-full",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsx("span",{className:"text-muted-foreground font-medium",children:n("dashboard.widgets.storage.title")}),h.jsxs("span",{className:"font-bold tabular-nums",children:[l,"%"]})]}),h.jsx(Lh,{value:l,className:"h-1.5"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:u})]})})}function rze(e){for(const t of Object.values(e.data))if(typeof t=="string"&&(t.startsWith("http")||t.startsWith("/")))return t;return null}function sze(e){for(const t of Object.values(e.data))if(typeof t=="string"&&t.trim()&&!t.startsWith("http")&&!t.startsWith("/"))return t;return e.id}function FC({seedSlug:e="",variant:t="grid",onOpen:n}){const[r,s]=w.useState(t),{t:i}=kt(),o=ia(),a=is({queryKey:["widget","media-library"],queryFn:async()=>(await Xt.get("/content/stats/media-library",{params:{limit:12}})).data.items,staleTime:180*1e3,enabled:r==="grid"}),l=is({queryKey:["widget","media-gallery",e,"unused"],queryFn:async()=>(await Xt.get("/content/stats/unused-media",{params:{seedSlug:e,limit:12}})).data.items,staleTime:0,enabled:r==="unused"&&!!e}),u=Ei({mutationFn:async y=>{await Xt.delete(`/${encodeURIComponent(y)}`)},onSuccess:()=>{o.invalidateQueries({queryKey:["widget","media-library"]})}}),f=Ei({mutationFn:async y=>{await Xt.delete(`/content/${e}/${y}`)},onSuccess:()=>{o.invalidateQueries({queryKey:["widget","media-gallery",e]})}}),p=r==="grid"?a.isLoading:l.isLoading,g=r==="grid"?a.isError:l.isError,b=r==="grid"?a.refetch:l.refetch;return h.jsxs("div",{className:"h-full w-full flex flex-col rounded-xl border border-neutral-200/60 bg-background/50 backdrop-blur-sm shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/40 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border/40 shrink-0",children:[h.jsxs("span",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[h.jsx(Q0,{className:"size-4 text-muted-foreground"}),i("dashboard.widgets.mediaGallery.title")]}),h.jsxs("div",{className:"flex items-center gap-0.5 bg-muted/50 p-0.5 rounded-md border border-border/50",children:[h.jsx(He,{variant:r==="grid"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>s("grid"),children:i("dashboard.widgets.mediaGallery.all")}),h.jsx(He,{variant:r==="unused"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>s("unused"),children:i("dashboard.widgets.mediaGallery.unused")})]})]}),h.jsx("div",{className:"flex-1 p-3 overflow-y-auto min-h-0",children:p?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:Array.from({length:8}).map((y,x)=>h.jsx(yr,{className:"aspect-square rounded-md animate-pulse"},x))}):g?h.jsx(Kd,{onRetry:()=>b()}):r==="grid"?a.data?.length?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:a.data.map(y=>{const x=u.isPending&&u.variables===y.key,S=y.mime_type.startsWith("image/");return h.jsxs("div",{className:ee("group relative aspect-square overflow-hidden rounded-lg bg-muted/50 border border-border/50 cursor-pointer transition-all hover:ring-2 hover:ring-primary/20",x&&"opacity-50 grayscale pointer-events-none"),onClick:()=>n?.(y.key),children:[S?h.jsx("img",{src:y.url,alt:y.filename,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-110"}):h.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h.jsx(Q0,{className:"size-6 text-muted-foreground/30"})}),h.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-2 pt-6 opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx("p",{className:"text-[10px] text-white font-medium truncate",children:y.filename})})]},y.key)})}):h.jsx(Bh,{icon:Q0,title:i("dashboard.widgets.mediaGallery.emptyTitle"),description:i("dashboard.widgets.mediaGallery.emptyDesc")}):l.data?.length?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.data.map(y=>{const x=rze(y),S=sze(y),k=f.isPending&&f.variables===y.id;return h.jsxs("div",{className:ee("group relative aspect-square overflow-hidden rounded-lg bg-muted/50 border border-border/50 cursor-pointer transition-all hover:ring-2 hover:ring-primary/20",k&&"opacity-50 grayscale pointer-events-none"),children:[x?h.jsx("img",{src:x,alt:S,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-110"}):h.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h.jsx(Q0,{className:"size-6 text-muted-foreground/30"})}),h.jsxs("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-2 pt-6 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("p",{className:"text-[10px] text-white font-medium truncate mb-1.5",children:S}),h.jsxs(He,{variant:"destructive",size:"sm",className:"h-6 w-full text-[10px] gap-1 px-1.5 bg-red-600 hover:bg-red-500 border-none",onClick:N=>{N.stopPropagation(),confirm(`Eliminare definitivamente ${S}?`)&&f.mutate(y.id)},children:[h.jsx(Hh,{className:"size-3"})," Elimina"]})]})]},y.id)})}):h.jsx(Bh,{icon:Q0,title:i("dashboard.widgets.mediaGallery.allInUseTitle"),description:i("dashboard.widgets.mediaGallery.allInUseDesc")})})]})}const ize={it:ag,en:ki},oze={create:Kl,update:oj,delete:Hh,upload:mp},aze={create:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-400",update:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-400",delete:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-400",upload:"bg-violet-100 text-violet-600 dark:bg-violet-500/15 dark:text-violet-400"};function jD(e,t,n="User"){return e||t||n}function lze(e,t){const n=e||t;return n?n.slice(0,2).toUpperCase():"?"}function HC({seedSlug:e,variant:t="feed"}){const{t:n,i18n:r}=kt(),s=ize[r.language]??ki;function i(f){return f?km(new Date(f*1e3),{addSuffix:!0,locale:s}):"—"}const{data:o,isLoading:a,isError:l,refetch:u}=$W(e);if(a)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((f,p)=>h.jsxs("div",{className:"flex gap-3",children:[h.jsx(yr,{className:"size-8 shrink-0 rounded-full animate-pulse"}),h.jsx(yr,{className:"h-8 flex-1 animate-pulse"})]},p))})});if(l)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Kd,{onRetry:()=>u()})});if(!o?.length)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Bh,{icon:Tl,title:n("dashboard.widgets.activityFeed.empty")})});if(t==="compact"){const f=o.slice(0,10);return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Gl,{className:"h-full",type:"auto",children:h.jsx("ul",{className:"space-y-1 pr-3",children:f.map(p=>h.jsxs("li",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-xs text-muted-foreground truncate flex-1",children:[h.jsx("span",{className:"font-medium text-foreground",children:jD(p.user_name,p.user_email)})," ",n(`dashboard.recentActivity.actions.${p.action}`,{defaultValue:p.action})," ",h.jsx("span",{className:"font-medium text-foreground",children:p.details?.title||p.details?.name||p.entity_slug||p.entity_id})]}),h.jsx("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:i(p.created_at)})]},p.id))})})})}return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Gl,{className:"h-[180px]",type:"auto",children:h.jsx("ul",{className:"space-y-3 pr-3",children:o.map(f=>{const p=oze[f.action]??Tl,g=aze[f.action]??"bg-muted text-muted-foreground";return h.jsxs("li",{className:"flex items-start gap-3 group",children:[h.jsxs("div",{className:"relative shrink-0",children:[h.jsx(jd,{className:"size-8 border border-border/60",children:h.jsx(Id,{className:"text-[10px] bg-primary/5 text-primary font-semibold",children:lze(f.user_name,f.user_email)})}),h.jsx("span",{className:ee("absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full ring-2 ring-background",g),children:h.jsx(p,{className:"size-2.5"})})]}),h.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[h.jsxs("p",{className:"text-sm leading-snug",children:[h.jsx("span",{className:"font-semibold",children:jD(f.user_name,f.user_email)})," ",h.jsx("span",{className:"text-muted-foreground",children:n(`dashboard.recentActivity.actions.${f.action}`,{defaultValue:f.action})})," ",h.jsx("span",{className:"font-medium",children:f.details?.title||f.details?.name||f.entity_slug||f.entity_id})]}),h.jsx("p",{className:"text-xs text-muted-foreground/70",children:i(f.created_at)})]})]},f.id)})})})})}function cze({instance:e,data:t}){return h.jsx($Ie,{widgetId:e.id,children:h.jsx(uze,{instance:e,data:t})})}function uze({instance:e,data:t}){const{type:n,props:r}=e,{t:s}=kt();if(n==="stat"){const i=dze(r?.statKey,t,s);return h.jsx(WIe,{...i})}return n==="recent-activity"?h.jsx(FIe,{}):n==="system-health"?h.jsx(HIe,{}):n==="content-pulse"?h.jsx(UIe,{}):n==="ai-insights"?h.jsx(VIe,{}):n==="quick-actions"?h.jsx(qIe,{onAction:i=>console.log("[BeechCMS] Quick action:",i)}):n==="recent-content"?h.jsx(zC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onOpen:r?.onOpen}):n==="quick-draft"?h.jsx(LC,{seeds:r?.seeds??[],variant:r?.variant,onCreated:r?.onCreated}):n==="pending-drafts"?h.jsx(PC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onPublish:r?.onPublish,onOpen:r?.onOpen}):n==="publication-stats"?h.jsx(Py,{variant:r?.variant}):n==="site-status"?h.jsx($C,{variant:r?.variant}):n==="storage"?h.jsx(BC,{variant:r?.variant,totalBytes:r?.totalBytes}):n==="media-gallery"?h.jsx(FC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onOpen:r?.onOpen}):n==="activity-feed"?h.jsx(HC,{seedSlug:r?.seedSlug??"",variant:r?.variant,limit:r?.limit}):h.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center rounded-xl border-2 border-dashed border-muted p-4",children:h.jsxs("p",{className:"text-sm text-muted-foreground",children:[s("dashboard.widgetRegistry.unknown")," ",h.jsx("span",{className:"font-mono font-semibold",children:n})]})})}function dze(e,t,n){const{statsData:r,cfData:s,statsLoading:i,cfLoading:o}=t||{};switch(e){case"total":return{title:n("dashboard.widgets.stat.total.title"),value:i?"...":r?.total.toLocaleString()??"0",icon:Qb,description:n("dashboard.widgets.stat.total.description"),trend:r?.total?{value:Math.round(r.recent/r.total*100),isPositive:!0}:void 0};case"visitors":return{title:n("dashboard.widgets.stat.visitors.title"),value:o?"...":s?.visitors.value.toLocaleString()??"0",icon:ej,description:n("dashboard.widgets.stat.visitors.description"),trend:s?.visitors.trend?{value:s.visitors.trend,isPositive:s.visitors.isPositive}:void 0};case"traffic":return{title:n("dashboard.widgets.stat.traffic.title"),value:o?"...":`${s?.bandwidth.value} ${s?.bandwidth.unit}`,icon:e6,description:n("dashboard.widgets.stat.traffic.description"),trend:s?.bandwidth.trend?{value:s.bandwidth.trend,isPositive:s.bandwidth.isPositive}:void 0};case"storage":return{title:n("dashboard.widgets.storage.title"),value:o?"...":`${s?.storage.used} ${s?.storage.unit}`,icon:YC,description:o?n("common.loading"):n("dashboard.widgets.stat.storage.description",{percentage:s?.storage.percentage,total:Math.round((s?.storage.limit??0)/1024)}),trend:s?{value:s.storage.percentage,isPositive:!1}:void 0};default:return{title:"N/A",value:"0",icon:Qb}}}function fze(e){const t=[{id:"site-status",type:"site-status",x:0,y:0,span:{w:2,h:1},props:{variant:"badge"}},{id:"storage-gauge",type:"storage",x:2,y:0,span:{w:2,h:1},props:{variant:"gauge"}},{id:"pub-stats-trio",type:"publication-stats",x:4,y:0,span:{w:2,h:1},props:{variant:"trio"}}];if(e.length>0){const n=e[0],r=e.find(i=>i.slug==="articoli")?.slug??n.slug,s=e.map(i=>{const o=i.branches.find(a=>a.alias===i.displayNameAlias);return{slug:i.slug,label:i.label,displayNameAlias:i.displayNameAlias,displayNameLabel:o?.label??i.displayNameAlias}});t.push({id:"quick-draft-minimal",type:"quick-draft",x:6,y:0,span:{w:2,h:1},props:{variant:"minimal",seeds:s}},{id:"recent-content-list",type:"recent-content",x:0,y:1,span:{w:4,h:2},props:{seedSlug:r,variant:"list"}},{id:"pending-drafts-list",type:"pending-drafts",x:4,y:1,span:{w:4,h:2},props:{seedSlug:r,variant:"list"}},{id:"media-gallery-grid",type:"media-gallery",x:0,y:3,span:{w:4,h:2},props:{seedSlug:r,variant:"grid"}},{id:"activity-feed-full",type:"activity-feed",x:4,y:3,span:{w:4,h:2},props:{seedSlug:r,variant:"feed"}})}return{layout:t}}function hze(){const{t:e}=kt(),{data:t=[]}=$E(),{data:n,isLoading:r}=S7(),{data:s,isLoading:i}=C7(),{user:o}=Tx(),a=new Date().getHours(),l=a>=5&&a<12?e("dashboard.greeting.morning"):a>=12&&a<18?e("dashboard.greeting.afternoon"):a>=18&&a<22?e("dashboard.greeting.evening"):e("dashboard.greeting.night"),u=o?.name||"Admin",f={statsData:n,cfData:s,statsLoading:r,cfLoading:i};return h.jsxs("div",{className:"[--header-height:calc(--spacing(14))] overflow-x-clip min-h-screen bg-neutral-50/50 dark:bg-neutral-950/50 relative",children:[h.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none z-0",children:[h.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-emerald-500/5 rounded-full blur-[120px]"}),h.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-500/5 rounded-full blur-[120px]"})]}),h.jsxs(Ta,{className:"flex flex-col relative z-10",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("main",{className:"flex flex-1 flex-col gap-8 p-6 md:p-8 lg:p-10",children:h.jsxs("div",{className:"content-area-inner flex flex-col gap-8",children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl text-neutral-900 dark:text-neutral-100",children:[l,", ",h.jsx("span",{className:"text-primary",children:u})]}),h.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:e("dashboard.greeting.subtitle")})]}),h.jsx("div",{className:"bento-grid grid grid-cols-1 gap-6 md:grid-cols-4 lg:grid-cols-8 auto-rows-min",children:fze(t).layout.map(p=>{const b=Math.min(Math.max(1,p.span.w),8),y=Math.min(Math.max(1,p.span.h),12),x=Math.max(1,Math.ceil(b/2));return h.jsx("div",{className:"bento-cell flex flex-col",style:{"--col-span-md":x,"--col-span-lg":b,"--row-span":y},children:h.jsx(cze,{instance:p,data:f})},p.id)})})]})})})]})]})]})}function On({children:e,className:t,bare:n=!1,title:r,icon:s,action:i,contentClassName:o}){if(n)return h.jsx("div",{className:ee("h-full w-full",t),children:e});const a=!!(r||s||i);return h.jsxs("div",{className:ee("h-full w-full flex flex-col","rounded-2xl border border-neutral-200/80 bg-white/75 backdrop-blur-md overflow-hidden","shadow-[0_1px_3px_0_rgb(0,0,0,0.05),0_1px_2px_-1px_rgb(0,0,0,0.04)]","transition-all duration-200 hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.08),0_2px_4px_-1px_rgb(0,0,0,0.06)]","hover:border-neutral-300/80","dark:border-neutral-700/50 dark:bg-neutral-900/65 dark:hover:border-neutral-600/60","dark:shadow-[0_1px_3px_0_rgb(0,0,0,0.2)] dark:hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.3)]","p-5",t),children:[a&&h.jsxs("div",{className:"flex items-center justify-between mb-4 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[s&&h.jsx(s,{className:"size-4 text-muted-foreground"}),r&&h.jsx("span",{className:"text-sm font-semibold text-foreground",children:r})]}),i&&h.jsx("div",{className:"flex items-center",children:i})]}),h.jsx("div",{className:ee("flex-1 min-h-0",o),children:e})]})}function Cl({title:e,description:t,children:n}){return h.jsxs("section",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-base font-semibold text-foreground",children:e}),t&&h.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),n]})}function kl({children:e,className:t}){return h.jsx("div",{className:ee("grid gap-4",t),children:e})}function fs({label:e,h:t=120,children:n}){return h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs font-mono text-muted-foreground/70",children:e}),h.jsx("div",{style:{height:t},children:n})]})}function TS({name:e}){return h.jsx(On,{children:h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("p",{className:"text-sm font-mono text-muted-foreground/50",children:e})})})}function pze(){const{data:e=[]}=$E(),t=e.map(r=>{const s=r.branches.find(i=>i.alias===r.displayNameAlias);return{slug:r.slug,label:r.label,displayNameAlias:r.displayNameAlias,displayNameLabel:s?.label??r.displayNameAlias}}),n=t[0]?.slug??"";return h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"mx-auto w-full max-w-screen-2xl p-6 space-y-12",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Widget Lab"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Sandbox per sviluppare e ispezionare i widget prima di portarli in dashboard. Ogni sezione mostra un widget in tutte le sue varianti di dimensione."})]}),h.jsx(Cl,{title:"SiteStatusWidget",description:`type="site-status" — mostra lo stato online/offline dell'API`,children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="badge" · span w:2 h:1',children:h.jsx($C,{variant:"badge"})}),h.jsx(fs,{label:'variant="pill-row" · span w:3 h:1',children:h.jsx($C,{variant:"pill-row"})})]})}),h.jsx(Cl,{title:"StorageWidget",description:'type="storage" — utilizzo storage R2',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="gauge" · span w:2 h:1',children:h.jsx(BC,{variant:"gauge"})}),h.jsx(fs,{label:'variant="bar" · span w:3 h:1',children:h.jsx(BC,{variant:"bar"})})]})}),h.jsx(Cl,{title:"PublicationStatsWidget",description:'type="publication-stats" — contenuti pubblicati oggi / settimana / mese',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="trio" · span w:2 h:1',children:h.jsx(Py,{variant:"trio"})}),h.jsx(fs,{label:'variant="single" · span w:2 h:1',children:h.jsx(Py,{variant:"single"})})]})}),h.jsx(Cl,{title:"QuickDraftWidget",description:'type="quick-draft" — crea velocemente una bozza senza navigare',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="minimal" · span w:2 h:1',children:h.jsx(LC,{variant:"minimal",seeds:t})}),h.jsx(fs,{label:'variant="expanded" · span w:4 h:2',h:200,children:h.jsx(LC,{variant:"expanded",seeds:t})})]})}),h.jsx(Cl,{title:"RecentContentWidget",description:'type="recent-content" — lista degli ultimi contenuti modificati',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="list" · span w:4 h:2',h:280,children:h.jsx(zC,{seedSlug:n,variant:"list"})}),h.jsx(fs,{label:'variant="cards" · span w:4 h:2',h:280,children:h.jsx(zC,{seedSlug:n,variant:"cards"})})]})}),h.jsx(Cl,{title:"PendingDraftsWidget",description:'type="pending-drafts" — bozze in attesa di revisione / pubblicazione',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="counter" · span w:2 h:1',children:h.jsx(PC,{seedSlug:n,variant:"counter"})}),h.jsx(fs,{label:'variant="list" · span w:4 h:2',h:280,children:h.jsx(PC,{seedSlug:n,variant:"list"})})]})}),h.jsx(Cl,{title:"MediaGalleryWidget",description:'type="media-gallery" — anteprima griglia dei media caricati',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="grid" · span w:4 h:2',h:280,children:h.jsx(FC,{seedSlug:n,variant:"grid"})}),h.jsx(fs,{label:'variant="unused" · span w:4 h:2',h:280,children:h.jsx(FC,{seedSlug:n,variant:"unused"})})]})}),h.jsx(Cl,{title:"ActivityFeedWidget",description:'type="activity-feed" — log delle ultime azioni nel CMS',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="compact" · span w:2 h:1',children:h.jsx(HC,{variant:"compact"})}),h.jsx(fs,{label:'variant="feed" · span w:4 h:2',h:280,children:h.jsx(HC,{variant:"feed"})})]})}),h.jsx(Cl,{title:"In sviluppo",description:"Nuovi widget in costruzione — aggiungi qui i tuoi componenti prima di registrarli.",children:h.jsxs(kl,{className:"grid-cols-3",children:[h.jsx(fs,{label:"nuovo-widget-1",children:h.jsx(TS,{name:"nuovo-widget-1"})}),h.jsx(fs,{label:"nuovo-widget-2",children:h.jsx(TS,{name:"nuovo-widget-2"})}),h.jsx(fs,{label:"nuovo-widget-3",children:h.jsx(TS,{name:"nuovo-widget-3"})})]})})]})})]})]})})}function mze(){const{t:e}=kt(),t=nB(),n=Eh(t);let r=e("errorPage.unknown");n?r=t.statusText||t.data?.message||e("errorPage.unknown"):t instanceof Error&&(r=t.message);const s=n?t.status:null;return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-6",children:h.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[s&&h.jsx("span",{className:"text-6xl font-bold text-muted-foreground",children:s}),h.jsx("h1",{className:"text-xl font-semibold",children:e("errorPage.title")}),h.jsx("p",{className:"text-sm text-muted-foreground",children:r}),h.jsx(gs,{to:"/",className:"rounded-md bg-accent px-4 py-2 text-sm !text-white hover:bg-accent/90",children:e("errorPage.backHome")})]})})}const gze=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function bze(){const{t:e,i18n:t}=kt(),[n,r]=w.useState(""),[s,i]=w.useState(null),[o,a]=w.useState(!1),[l,u]=w.useState(!1),f=async p=>{p.preventDefault();const g=n.trim();if(!g){i(e("forgotPassword.emailRequired"));return}if(!gze.test(g)){i(e("forgotPassword.emailInvalid"));return}i(null),a(!0);try{await mn.post("/auth/forgot-password",{email:g,locale:t.language})}catch{}a(!1),u(!0)};return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:l?h.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("forgotPassword.successTitle")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("forgotPassword.successDesc")}),h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})]}):h.jsx("form",{onSubmit:f,noValidate:!0,children:h.jsxs(Sk,{children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("forgotPassword.title")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("forgotPassword.desc")})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"fp-email",children:"Email"}),h.jsx(pn,{id:"fp-email",type:"email",inputMode:"email",autoComplete:"email",value:n,className:ee(s?"border-destructive":""),onChange:p=>{r(p.target.value),i(null)}}),s&&h.jsx(Ck,{children:s})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!n.trim()||o,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",n.trim()&&!o?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:e(o?"forgotPassword.sending":"forgotPassword.send")})}),h.jsx("div",{className:"text-center",children:h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})})]})})})})})})}const ID=8,zD=128;function vze(){const{t:e,i18n:t}=kt(),n=zo(),[r]=wx(),s=r.get("token"),[i,o]=w.useState(""),[a,l]=w.useState(""),[u,f]=w.useState(!1),[p,g]=w.useState(!1),[b,y]=w.useState(null),[x,S]=w.useState(!1);if(!s)return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("resetPassword.invalidLinkTitle")}),h.jsx("p",{className:"text-muted-foreground text-sm",children:e("resetPassword.invalidLink")}),h.jsx(gs,{to:"/forgot-password",className:"text-sm underline-offset-2 hover:underline",children:e("resetPassword.requestNew")})]})})})})});const k=i.length>=ID&&i.length<=zD&&i===a,N=async T=>{if(T.preventDefault(),i!==a){y(e("resetPassword.mismatch"));return}if(i.length<ID){y(e("resetPassword.tooShort"));return}if(i.length>zD){y(e("resetPassword.tooLong"));return}y(null),S(!0);try{await mn.post("/auth/reset-password",{token:s,password:i,locale:t.language}),or.success(e("resetPassword.success")),n("/login",{replace:!0})}catch(R){mn.isAxiosError(R)&&R.response?.status===400?y(e("resetPassword.invalidToken")):y(e("resetPassword.genericError")),S(!1)}};return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:h.jsx("form",{onSubmit:N,noValidate:!0,children:h.jsxs(Sk,{children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("resetPassword.title")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("resetPassword.desc")})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"rp-password",children:e("resetPassword.newPassword")}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"rp-password",type:u?"text":"password",autoComplete:"new-password",value:i,className:ee("pr-10",b?"border-destructive":""),onChange:T=>{o(T.target.value),y(null)}}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:()=>f(T=>!T),"aria-label":e(u?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:u?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})})})]})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"rp-confirm",children:e("resetPassword.confirmPassword")}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"rp-confirm",type:p?"text":"password",autoComplete:"new-password",value:a,className:ee("pr-10",b?"border-destructive":""),onChange:T=>{l(T.target.value),y(null)}}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:()=>g(T=>!T),"aria-label":e(p?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:p?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})})})]}),b&&h.jsx(Ck,{children:b})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!k||x,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",k&&!x?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:e(x?"resetPassword.resetting":"resetPassword.reset")})}),h.jsx("div",{className:"text-center",children:h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})})]})})})})})})}function yze(){const e=zo(),[t,n]=w.useState(""),[r,s]=w.useState(""),[i,o]=w.useState(""),[a,l]=w.useState(""),[u,f]=w.useState(null),[p,g]=w.useState(!1);async function b(y){if(y.preventDefault(),f(null),i!==a){f("Passwords do not match.");return}if(i.length<8){f("Password must be at least 8 characters.");return}g(!0);try{await mn.post("/auth/setup",{email:r,password:i,name:t}),e("/login",{replace:!0})}catch(x){mn.isAxiosError(x)&&x.response?.data?.title?f(x.response.data.title):f("Setup failed. Please try again.")}finally{g(!1)}}return h.jsx("div",{className:"flex min-h-svh w-full items-center justify-center bg-background p-4",children:h.jsxs(Wn,{className:"w-full max-w-md",children:[h.jsxs(xr,{className:"space-y-1",children:[h.jsx(_r,{className:"text-2xl font-bold",children:"Welcome to BeechCMS"}),h.jsx(Xo,{children:"Create your admin account to get started. This screen appears only once."})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:b,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"name",children:"Name"}),h.jsx(pn,{id:"name",placeholder:"Your name",value:t,onChange:y=>n(y.target.value),autoComplete:"name"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"email",children:"Email"}),h.jsx(pn,{id:"email",type:"email",placeholder:"admin@example.com",value:r,onChange:y=>s(y.target.value),required:!0,autoComplete:"email"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"password",children:"Password"}),h.jsx(pn,{id:"password",type:"password",placeholder:"Min. 8 characters",value:i,onChange:y=>o(y.target.value),required:!0,autoComplete:"new-password"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"confirm",children:"Confirm password"}),h.jsx(pn,{id:"confirm",type:"password",placeholder:"Repeat password",value:a,onChange:y=>l(y.target.value),required:!0,autoComplete:"new-password"})]}),u&&h.jsx("p",{className:"text-sm text-destructive",children:u}),h.jsx(He,{type:"submit",className:"w-full",disabled:p,children:p?"Creating account…":"Create admin account"})]})})]})})}var LD=1,xze=.9,wze=.8,Sze=.17,_S=.1,RS=.999,Cze=.9999,kze=.99,Eze=/[\\\/_+.#"@\[\(\{&]/,Nze=/[\\\/_+.#"@\[\(\{&]/g,Mze=/[\s-]/,qW=/[\s-]/g;function UC(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?LD:kze;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var l=r.charAt(i),u=n.indexOf(l,s),f=0,p,g,b,y;u>=0;)p=UC(e,t,n,r,u+1,i+1,o),p>f&&(u===s?p*=LD:Eze.test(e.charAt(u-1))?(p*=wze,b=e.slice(s,u-1).match(Nze),b&&s>0&&(p*=Math.pow(RS,b.length))):Mze.test(e.charAt(u-1))?(p*=xze,y=e.slice(s,u-1).match(qW),y&&s>0&&(p*=Math.pow(RS,y.length))):(p*=Sze,s>0&&(p*=Math.pow(RS,u-s))),e.charAt(u)!==t.charAt(i)&&(p*=Cze)),(p<_S&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(g=UC(e,t,n,r,u+1,i+2,o),g*_S>p&&(p=g*_S)),p>f&&(f=p),u=n.indexOf(l,u+1);return o[a]=f,f}function PD(e){return e.toLowerCase().replace(qW," ")}function Tze(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,UC(e,t,PD(e),PD(t),0,0,{})}var pp='[cmdk-group=""]',AS='[cmdk-group-items=""]',_ze='[cmdk-group-heading=""]',GW='[cmdk-item=""]',$D=`${GW}:not([aria-disabled="true"])`,VC="cmdk-item-select",th="data-value",Rze=(e,t,n)=>Tze(e,t,n),WW=w.createContext(void 0),hg=()=>w.useContext(WW),KW=w.createContext(void 0),k7=()=>w.useContext(KW),YW=w.createContext(void 0),ZW=w.forwardRef((e,t)=>{let n=nh(()=>{var H,X;return{search:"",value:(X=(H=e.value)!=null?H:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=nh(()=>new Set),s=nh(()=>new Map),i=nh(()=>new Map),o=nh(()=>new Set),a=XW(e),{label:l,children:u,value:f,onValueChange:p,filter:g,shouldFilter:b,loop:y,disablePointerSelection:x=!1,vimBindings:S=!0,...k}=e,N=qr(),T=qr(),R=qr(),_=w.useRef(null),A=Fze();Ld(()=>{if(f!==void 0){let H=f.trim();n.current.value=H,I.emit()}},[f]),Ld(()=>{A(6,oe)},[]);let I=w.useMemo(()=>({subscribe:H=>(o.current.add(H),()=>o.current.delete(H)),snapshot:()=>n.current,setState:(H,X,de)=>{var fe,we,pe,Re;if(!Object.is(n.current[H],X)){if(n.current[H]=X,H==="search")re(),q(),A(1,ne);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(R);Ae?Ae.focus():(fe=document.getElementById(N))==null||fe.focus()}if(A(7,()=>{var Ae;n.current.selectedItemId=(Ae=le())==null?void 0:Ae.id,I.emit()}),de||A(5,oe),((we=a.current)==null?void 0:we.value)!==void 0){let Ae=X??"";(Re=(pe=a.current).onValueChange)==null||Re.call(pe,Ae);return}}I.emit()}},emit:()=>{o.current.forEach(H=>H())}}),[]),j=w.useMemo(()=>({value:(H,X,de)=>{var fe;X!==((fe=i.current.get(H))==null?void 0:fe.value)&&(i.current.set(H,{value:X,keywords:de}),n.current.filtered.items.set(H,L(X,de)),A(2,()=>{q(),I.emit()}))},item:(H,X)=>(r.current.add(H),X&&(s.current.has(X)?s.current.get(X).add(H):s.current.set(X,new Set([H]))),A(3,()=>{re(),q(),n.current.value||ne(),I.emit()}),()=>{i.current.delete(H),r.current.delete(H),n.current.filtered.items.delete(H);let de=le();A(4,()=>{re(),de?.getAttribute("id")===H&&ne(),I.emit()})}),group:H=>(s.current.has(H)||s.current.set(H,new Set),()=>{i.current.delete(H),s.current.delete(H)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:N,inputId:R,labelId:T,listInnerRef:_}),[]);function L(H,X){var de,fe;let we=(fe=(de=a.current)==null?void 0:de.filter)!=null?fe:Rze;return H?we(H,n.current.search,X):0}function q(){if(!n.current.search||a.current.shouldFilter===!1)return;let H=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(fe=>{let we=s.current.get(fe),pe=0;we.forEach(Re=>{let Ae=H.get(Re);pe=Math.max(Ae,pe)}),X.push([fe,pe])});let de=_.current;ce().sort((fe,we)=>{var pe,Re;let Ae=fe.getAttribute("id"),Ze=we.getAttribute("id");return((pe=H.get(Ze))!=null?pe:0)-((Re=H.get(Ae))!=null?Re:0)}).forEach(fe=>{let we=fe.closest(AS);we?we.appendChild(fe.parentElement===we?fe:fe.closest(`${AS} > *`)):de.appendChild(fe.parentElement===de?fe:fe.closest(`${AS} > *`))}),X.sort((fe,we)=>we[1]-fe[1]).forEach(fe=>{var we;let pe=(we=_.current)==null?void 0:we.querySelector(`${pp}[${th}="${encodeURIComponent(fe[0])}"]`);pe?.parentElement.appendChild(pe)})}function ne(){let H=ce().find(de=>de.getAttribute("aria-disabled")!=="true"),X=H?.getAttribute(th);I.setState("value",X||void 0)}function re(){var H,X,de,fe;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let we=0;for(let pe of r.current){let Re=(X=(H=i.current.get(pe))==null?void 0:H.value)!=null?X:"",Ae=(fe=(de=i.current.get(pe))==null?void 0:de.keywords)!=null?fe:[],Ze=L(Re,Ae);n.current.filtered.items.set(pe,Ze),Ze>0&&we++}for(let[pe,Re]of s.current)for(let Ae of Re)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(pe);break}n.current.filtered.count=we}function oe(){var H,X,de;let fe=le();fe&&(((H=fe.parentElement)==null?void 0:H.firstChild)===fe&&((de=(X=fe.closest(pp))==null?void 0:X.querySelector(_ze))==null||de.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function le(){var H;return(H=_.current)==null?void 0:H.querySelector(`${GW}[aria-selected="true"]`)}function ce(){var H;return Array.from(((H=_.current)==null?void 0:H.querySelectorAll($D))||[])}function F(H){let X=ce()[H];X&&I.setState("value",X.getAttribute(th))}function te(H){var X;let de=le(),fe=ce(),we=fe.findIndex(Re=>Re===de),pe=fe[we+H];(X=a.current)!=null&&X.loop&&(pe=we+H<0?fe[fe.length-1]:we+H===fe.length?fe[0]:fe[we+H]),pe&&I.setState("value",pe.getAttribute(th))}function K(H){let X=le(),de=X?.closest(pp),fe;for(;de&&!fe;)de=H>0?$ze(de,pp):Bze(de,pp),fe=de?.querySelector($D);fe?I.setState("value",fe.getAttribute(th)):te(H)}let W=()=>F(ce().length-1),V=H=>{H.preventDefault(),H.metaKey?W():H.altKey?K(1):te(1)},P=H=>{H.preventDefault(),H.metaKey?F(0):H.altKey?K(-1):te(-1)};return w.createElement(tt.div,{ref:t,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:H=>{var X;(X=k.onKeyDown)==null||X.call(k,H);let de=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||de))switch(H.key){case"n":case"j":{S&&H.ctrlKey&&V(H);break}case"ArrowDown":{V(H);break}case"p":case"k":{S&&H.ctrlKey&&P(H);break}case"ArrowUp":{P(H);break}case"Home":{H.preventDefault(),F(0);break}case"End":{H.preventDefault(),W();break}case"Enter":{H.preventDefault();let fe=le();if(fe){let we=new Event(VC);fe.dispatchEvent(we)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Uze},l),S2(e,H=>w.createElement(KW.Provider,{value:I},w.createElement(WW.Provider,{value:j},H))))}),Aze=w.forwardRef((e,t)=>{var n,r;let s=qr(),i=w.useRef(null),o=w.useContext(YW),a=hg(),l=XW(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ld(()=>{if(!u)return a.item(s,o?.id)},[u]);let f=QW(s,i,[e.value,e.children,i],e.keywords),p=k7(),g=Wl(A=>A.value&&A.value===f.current),b=Wl(A=>u||a.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);w.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(VC,y),()=>A.removeEventListener(VC,y)},[b,e.onSelect,e.disabled]);function y(){var A,I;x(),(I=(A=l.current).onSelect)==null||I.call(A,f.current)}function x(){p.setState("value",f.current,!0)}if(!b)return null;let{disabled:S,value:k,onSelect:N,forceMount:T,keywords:R,..._}=e;return w.createElement(tt.div,{ref:Fl(i,t),..._,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||a.getDisablePointerSelection()?void 0:x,onClick:S?void 0:y},e.children)}),Oze=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=qr(),a=w.useRef(null),l=w.useRef(null),u=qr(),f=hg(),p=Wl(b=>s||f.filter()===!1?!0:b.search?b.filtered.groups.has(o):!0);Ld(()=>f.group(o),[]),QW(o,a,[e.value,e.heading,l]);let g=w.useMemo(()=>({id:o,forceMount:s}),[s]);return w.createElement(tt.div,{ref:Fl(a,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&w.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),S2(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},w.createElement(YW.Provider,{value:g},b))))}),Dze=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=w.useRef(null),i=Wl(o=>!o.search);return!n&&!i?null:w.createElement(tt.div,{ref:Fl(s,t),...r,"cmdk-separator":"",role:"separator"})}),jze=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=k7(),o=Wl(u=>u.search),a=Wl(u=>u.selectedItemId),l=hg();return w.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),w.createElement(tt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||i.setState("search",u.target.value),n?.(u.target.value)}})}),Ize=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=w.useRef(null),o=w.useRef(null),a=Wl(u=>u.selectedItemId),l=hg();return w.useEffect(()=>{if(o.current&&i.current){let u=o.current,f=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=u.offsetHeight;f.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(tt.div,{ref:Fl(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},S2(e,u=>w.createElement("div",{ref:Fl(o,l.listInnerRef),"cmdk-list-sizer":""},u)))}),zze=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=e;return w.createElement(Gy,{open:n,onOpenChange:r},w.createElement(Wy,{container:o},w.createElement(Ky,{"cmdk-overlay":"",className:s}),w.createElement(Yy,{"aria-label":e.label,"cmdk-dialog":"",className:i},w.createElement(ZW,{ref:t,...a}))))}),Lze=w.forwardRef((e,t)=>Wl(n=>n.filtered.count===0)?w.createElement(tt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Pze=w.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return w.createElement(tt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},S2(e,o=>w.createElement("div",{"aria-hidden":!0},o)))}),Oi=Object.assign(ZW,{List:Ize,Item:Aze,Input:jze,Group:Oze,Separator:Dze,Dialog:zze,Empty:Lze,Loading:Pze});function $ze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Bze(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function XW(e){let t=w.useRef(e);return Ld(()=>{t.current=e}),t}var Ld=typeof window>"u"?w.useEffect:w.useLayoutEffect;function nh(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Wl(e){let t=k7(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function QW(e,t,n,r=[]){let s=w.useRef(),i=hg();return Ld(()=>{var o;let a=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(o=t.current)==null||o.setAttribute(th,a),s.current=a}),s}var Fze=()=>{let[e,t]=w.useState(),n=nh(()=>new Map);return Ld(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Hze(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function S2({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(Hze(t),{ref:t.ref},n(t.props.children)):n(t)}var Uze={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const JW=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi,{ref:n,className:ee("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));JW.displayName=Oi.displayName;const Vze=({children:e,...t})=>h.jsx(Ph,{...t,children:h.jsx($h,{className:"overflow-hidden p-0",children:h.jsx(JW,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),eK=w.forwardRef(({className:e,...t},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(DS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),h.jsx(Oi.Input,{ref:n,className:ee("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));eK.displayName=Oi.Input.displayName;const tK=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.List,{ref:n,className:ee("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));tK.displayName=Oi.List.displayName;const nK=w.forwardRef((e,t)=>h.jsx(Oi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));nK.displayName=Oi.Empty.displayName;const ud=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Group,{ref:n,className:ee("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ud.displayName=Oi.Group.displayName;const Xb=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Separator,{ref:n,className:ee("-mx-1 h-px bg-border",e),...t}));Xb.displayName=Oi.Separator.displayName;const wa=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Item,{ref:n,className:ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));wa.displayName=Oi.Item.displayName;const rK=({className:e,...t})=>h.jsx("span",{className:ee("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});rK.displayName="CommandShortcut";function qze(){const[e,t]=w.useState(!1),[n,r]=w.useState(["root"]),[s,i]=w.useState(""),o=n.at(-1)??"root",a=w.useCallback(u=>{r(f=>[...f,u]),i("")},[]),l=w.useCallback(()=>{r(u=>u.length<=1?u:u.slice(0,-1)),i("")},[]);return w.useEffect(()=>{const u=f=>{if(f.key==="k"&&(f.metaKey||f.ctrlKey)){f.preventDefault(),t(p=>!p);return}if(f.key==="n"&&f.altKey&&!f.metaKey&&!f.ctrlKey){f.preventDefault(),t(!0),r(["root","create"]),i("");return}if(e){if(f.key==="Backspace"&&s===""&&n.length>1){f.preventDefault(),l();return}f.key==="Escape"&&n.length>1&&(f.preventDefault(),l())}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,s,n.length,l]),w.useEffect(()=>{e||(i(""),r(["root"]))},[e]),{open:e,setOpen:t,pages:n,currentPage:o,pushPage:a,popPage:l,search:s,setSearch:i}}function Gze({seeds:e,pushPage:t,navigate:n,setOpen:r,theme:s,toggleTheme:i}){const{t:o}=kt(),a=l=>{n(l),r(!1)};return h.jsxs(h.Fragment,{children:[h.jsxs(ud,{heading:o("commandPalette.navigate"),forceMount:!0,children:[h.jsxs(wa,{onSelect:()=>a("/"),children:[h.jsx(nj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.dashboard")})]}),h.jsxs(wa,{onSelect:()=>a("/media"),children:[h.jsx(Tm,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.mediaLibrary")})]}),h.jsxs(wa,{onSelect:()=>a("/settings"),children:[h.jsx(_m,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.settings")})]})]}),h.jsx(Xb,{}),h.jsxs(ud,{heading:o("commandPalette.contents"),children:[e.slice(0,5).map(l=>{const u=PE(l.dashboard?.icon);return h.jsxs(wa,{onSelect:()=>a(`/content/${l.slug}`),keywords:[l.slug,"contenuto","lista"],children:[h.jsx(u,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.goTo",{label:l.label})})]},l.slug)}),e.length>5&&h.jsxs(wa,{onSelect:()=>t("seeds"),children:[h.jsx(tj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.allSeeds")})]})]}),h.jsx(Xb,{}),h.jsx(ud,{heading:o("commandPalette.create"),children:h.jsxs(wa,{onSelect:()=>t("create"),children:[h.jsx(Kl,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.newContent")}),h.jsxs(rK,{className:"flex items-center gap-0.5",children:[h.jsx("kbd",{className:"text-xs font-mono bg-muted text-muted-foreground px-1 rounded",children:"Alt"}),h.jsx("kbd",{className:"text-xs font-mono bg-muted text-muted-foreground px-1 rounded",children:"N"})]})]})}),h.jsx(Xb,{}),h.jsx(ud,{heading:o("commandPalette.tools"),children:h.jsxs(wa,{onSelect:i,keywords:["dark mode","light mode","tema","theme"],children:[s==="dark"?h.jsx(lj,{className:"size-4 shrink-0 text-muted-foreground"}):h.jsx(sj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.changeTheme")})]})})]})}function BD({seeds:e,navigate:t,setOpen:n,mode:r}){const{t:s}=kt(),i=s(r==="create"?"commandPalette.chooseType":"commandPalette.chooseSeed");return h.jsx(ud,{heading:i,children:e.map(o=>{const a=PE(o.dashboard?.icon);return h.jsxs(wa,{onSelect:()=>{const l=r==="create"?`/content/${o.slug}/create`:`/content/${o.slug}`;t(l),n(!1)},children:[h.jsx(a,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:o.label}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:o.slug})]})]},o.slug)})})}function Wze(e){const n=e.replace(/<(?!\/?mark\b)[^>]*>/gi,"").split(/(<mark>|<\/mark>)/gi),r=[];let s=!1,i=0;for(const o of n){if(o.toLowerCase()==="<mark>"){s=!0;continue}if(o.toLowerCase()==="</mark>"){s=!1;continue}o&&r.push(s?h.jsx("mark",{children:o},i++):o)}return r}function Kze({search:e,navigate:t,setOpen:n}){const{t:r}=kt(),s=VW(e,300),{data:i,isLoading:o}=is({queryKey:["cmd-search",s],queryFn:async()=>(await Xt.get(`/search?q=${encodeURIComponent(s)}&limit=8`)).data,enabled:s.length>=2,staleTime:3e4}),a=i?.items??[];return e.length<2?null:o?h.jsx("div",{className:"px-4 py-6 text-sm text-center text-muted-foreground",children:r("commandPalette.searching")}):h.jsxs(ud,{heading:r("commandPalette.searchResults"),children:[a.map(l=>h.jsxs(wa,{onSelect:()=>{t(`/content/${l.schema_slug}/${l.id}`),n(!1)},children:[h.jsx(Qb,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:l.title}),l.excerpt&&h.jsx("span",{className:"text-xs text-muted-foreground line-clamp-1",children:Wze(l.excerpt)}),h.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70",children:[l.schema_slug," · ",l.status]})]})]},l.id)),a.length===0&&!o&&h.jsx("div",{className:"px-4 py-6 text-sm text-center text-muted-foreground",children:r("commandPalette.noSearchResults")})]})}function Yze(){const{t:e}=kt(),t=Wl(n=>n.search);return h.jsx(nK,{children:t.length===0?e("commandPalette.noResults"):h.jsxs(h.Fragment,{children:[e("commandPalette.noResults")," ",h.jsxs("span",{className:"font-medium",children:['"',t,'"']})]})})}function Zze({pages:e,popPage:t}){return e.length<=1?null:h.jsx("div",{className:"flex items-center gap-2 px-4 pt-4 pb-0 overflow-x-auto",children:e.map((n,r)=>h.jsxs(w.Fragment,{children:[h.jsx(_i,{variant:"secondary",className:ee("cursor-pointer hover:bg-secondary/80 capitalize shrink-0",r===e.length-1&&"opacity-60 pointer-events-none"),onClick:()=>{const s=e.length-1-r;for(let i=0;i<s;i++)t()},children:n}),r<e.length-1&&h.jsx(Pd,{className:"size-3 text-muted-foreground shrink-0"})]},n+r))})}function Xze(){const{t:e}=kt(),t=zo(),{theme:n,setTheme:r}=$y(),{open:s,setOpen:i,pages:o,currentPage:a,pushPage:l,popPage:u,search:f,setSearch:p}=qze(),g=Object.values(Ek),b={root:e("commandPalette.placeholderRoot"),seeds:e("commandPalette.placeholderSeeds"),create:e("commandPalette.placeholderCreate"),"search-results":e("commandPalette.placeholderSearch")},y=w.useCallback(()=>{r(n==="dark"?"light":"dark"),i(!1)},[n,r,i]);return h.jsxs(h.Fragment,{children:[h.jsx("style",{children:"[cmdk-list]{height:var(--cmdk-list-height);transition:height 100ms ease}"}),h.jsxs(Vze,{open:s,onOpenChange:i,"aria-label":e("commandPalette.ariaLabel"),children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Zze,{pages:o,popPage:u}),h.jsx(eK,{placeholder:b[a],value:f,onValueChange:p})]}),h.jsxs(tK,{className:"max-h-[400px]",children:[h.jsx(Yze,{}),a==="root"&&h.jsx(Gze,{seeds:g,pushPage:l,navigate:t,setOpen:i,theme:n,toggleTheme:y}),a==="seeds"&&h.jsx(BD,{seeds:g,navigate:t,setOpen:i,mode:"navigate"}),a==="create"&&h.jsx(BD,{seeds:g,navigate:t,setOpen:i,mode:"create"}),a==="search-results"&&h.jsx(Kze,{search:f,seeds:g,navigate:t,setOpen:i})]}),a!=="root"&&h.jsx("div",{className:"p-3 border-t text-[10px] text-muted-foreground bg-muted/20",children:e("commandPalette.backHint")})]})]})}function Qze(){return h.jsx("div",{className:"flex min-h-svh w-full items-center justify-center bg-background",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})})}function Jze(){const e=zo();return w.useEffect(()=>{mn.get("/auth/setup").then(({data:t})=>{t.needsSetup&&e("/setup",{replace:!0})}).catch(()=>{})},[e]),h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8 lg:p-10 xl:p-12",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md md:max-w-2xl lg:max-w-4xl xl:max-w-6xl 2xl:max-w-7xl",children:h.jsx(Ppe,{})})})}function Xu({children:e}){const{status:t}=Tx();return t==="loading"?h.jsx(Qze,{}):t==="unauthenticated"?h.jsx(ihe,{to:"/login",replace:!0}):h.jsx(h.Fragment,{children:e})}function eLe(){return h.jsxs(h.Fragment,{children:[h.jsx(Xze,{}),h.jsx(ohe,{})]})}const tLe=Ohe([{element:h.jsx(eLe,{}),errorElement:h.jsx(mze,{}),children:[{path:"/login",element:h.jsx(Jze,{})},{path:"/setup",element:h.jsx(yze,{})},{path:"/forgot-password",element:h.jsx(bze,{})},{path:"/reset-password",element:h.jsx(vze,{})},{path:"/",element:h.jsx(Xu,{children:h.jsx(hze,{})})},{path:"/content/:slug/create",element:h.jsx(Xu,{children:h.jsx(OD,{})})},{path:"/content/:slug/:id",element:h.jsx(Xu,{children:h.jsx(OD,{})})},{path:"/content/:slug",element:h.jsx(Xu,{children:h.jsx(AIe,{})})},{path:"/settings",element:h.jsx(Xu,{children:h.jsx($ke,{})})},{path:"/test-fields",element:h.jsx(Xu,{children:h.jsx(PIe,{})})},{path:"/widget-lab",element:h.jsx(Xu,{children:h.jsx(pze,{})})}]}],{basename:"/admin"});function nLe(){return h.jsx(Ipe,{children:h.jsx(Vhe,{router:tLe})})}mZ.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(_ce,{client:Fce,children:h.jsx(yZ,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,enableColorScheme:!0,storageKey:"beech-theme",children:h.jsxs(o$,{children:[h.jsx(nLe,{}),h.jsx(ete,{})]})})})}));
554
+ ]`,y={scope:"string",variants:[f,u,p,g]},x={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},S=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],N=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],R={keyword:k,literal:(le=>{const ce=[];return le.forEach(F=>{ce.push(F),F.toLowerCase()===F?ce.push(F.toUpperCase()):ce.push(F.toLowerCase())}),ce})(S),built_in:N},_=le=>le.map(ce=>ce.replace(/\|\d+$/,"")),A={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",_(N).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},I=t.concat(r,"\\b(?!\\()"),j={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),I],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),I],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:R,contains:[L,o,j,e.C_BLOCK_COMMENT_MODE,y,x,A]},ne={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",_(k).join("\\b|"),"|",_(N).join("\\b|"),"\\b)"),r,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(ne);const re=[L,j,e.C_BLOCK_COMMENT_MODE,y,x,A],oe={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...re]},...re,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:R,contains:[oe,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},o,ne,j,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},A,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:R,contains:["self",oe,o,j,e.C_BLOCK_COMMENT_MODE,y,x]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},y,x]}}function xOe(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function wOe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function SOe(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",b=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,y=`\\b|${r.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${b}))[eE][+-]?(${g})[jJ]?(?=${y})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${g})[jJ](?=${y})`}]},S={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,x,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,x,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,S,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,k,p]}]}}function COe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kOe(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function EOe(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},g="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},x={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},A=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:o},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);f.contains=A,x.contains=A;const q=[{begin:/^\s*=>/,starts:{end:"$",contains:A}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:A}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(q).concat(u).concat(A)}}function NOe(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:a,literal:l,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:f}},{className:"punctuation",begin:"->"},i]}}const MOe=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TOe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_Oe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ROe=[...TOe,..._Oe],AOe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),OOe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),DOe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jOe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function IOe(e){const t=MOe(e),n=DOe,r=OOe,s="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ROe.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jOe.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:AOe.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function zOe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function LOe(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=f,y=[...u,...l].filter(_=>!f.includes(_)),x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function N(_){return t.concat(/\b/,t.either(..._.map(A=>A.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:N(g),relevance:0};function R(_,{exceptions:A,when:I}={}){const j=I;return A=A||[],_.map(L=>L.match(/\|\d+$/)||A.includes(L)?L:j(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:R(y,{when:_=>_.length<3}),literal:i,type:a,built_in:p},contains:[{scope:"type",match:N(o)},T,k,x,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,S]}}function cW(e){return e?typeof e=="string"?e:e.source:null}function fp(e){return rr("(?=",e,")")}function rr(...e){return e.map(n=>cW(n)).join("")}function POe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ti(...e){return"("+(POe(e).capture?"":"?:")+e.map(r=>cW(r)).join("|")+")"}const b7=e=>rr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),$Oe=["Protocol","Type"].map(b7),hD=["init","self"].map(b7),BOe=["Any","Self"],SS=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],pD=["false","nil","true"],FOe=["assignment","associativity","higherThan","left","lowerThan","none","right"],HOe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],mD=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],uW=ti(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),dW=ti(uW,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),CS=rr(uW,dW,"*"),fW=ti(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_y=ti(fW,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ga=rr(fW,_y,"*"),Tb=rr(/[A-Z]/,_y,"*"),UOe=["attached","autoclosure",rr(/convention\(/,ti("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rr(/objc\(/,ga,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],VOe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qOe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,ti(...$Oe,...hD)],className:{2:"keyword"}},i={match:rr(/\./,ti(...SS)),relevance:0},o=SS.filter(ut=>typeof ut=="string").concat(["_|0"]),a=SS.filter(ut=>typeof ut!="string").concat(BOe).map(b7),l={variants:[{className:"keyword",match:ti(...a,...hD)}]},u={$pattern:ti(/\b\w+/,/#\w+/),keyword:o.concat(HOe),literal:pD},f=[s,i,l],p={match:rr(/\./,ti(...mD)),relevance:0},g={className:"built_in",match:rr(/\b/,ti(...mD),/(?=\()/)},b=[p,g],y={match:/->/,relevance:0},x={className:"operator",relevance:0,variants:[{match:CS},{match:`\\.(\\.|${dW})+`}]},S=[y,x],k="([0-9]_*)+",N="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},R=(ut="")=>({className:"subst",variants:[{match:rr(/\\/,ut,/[0\\tnr"']/)},{match:rr(/\\/,ut,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(ut="")=>({className:"subst",match:rr(/\\/,ut,/[\t ]*(?:[\r\n]|\r\n)/)}),A=(ut="")=>({className:"subst",label:"interpol",begin:rr(/\\/,ut,/\(/),end:/\)/}),I=(ut="")=>({begin:rr(ut,/"""/),end:rr(/"""/,ut),contains:[R(ut),_(ut),A(ut)]}),j=(ut="")=>({begin:rr(ut,/"/),end:rr(/"/,ut),contains:[R(ut),A(ut)]}),L={className:"string",variants:[I(),I("#"),I("##"),I("###"),j(),j("#"),j("##"),j("###")]},q=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ne={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:q},re=ut=>{const Ut=rr(ut,/\//),nn=rr(/\//,ut);return{begin:Ut,end:nn,contains:[...q,{scope:"comment",begin:`#(?!.*${nn})`,end:/$/}]}},oe={scope:"regexp",variants:[re("###"),re("##"),re("#"),ne]},le={match:rr(/`/,ga,/`/)},ce={className:"variable",match:/\$\d+/},F={className:"variable",match:`\\$${_y}+`},te=[le,ce,F],K={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:VOe,contains:[...S,T,L]}]}},W={scope:"keyword",match:rr(/@/,ti(...UOe),fp(ti(/\(/,/\s+/)))},V={scope:"meta",match:rr(/@/,ga)},P=[K,W,V],H={match:fp(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_y,"+")},{className:"type",match:Tb,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rr(/\s+&\s+/,fp(Tb)),relevance:0}]},X={begin:/</,end:/>/,keywords:u,contains:[...r,...f,...P,y,H]};H.contains.push(X);const de={match:rr(ga,/\s*:/),keywords:"_|0",relevance:0},fe={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",de,...r,oe,...f,...b,...S,T,L,...te,...P,H]},we={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,H]},pe={begin:ti(fp(rr(ga,/\s*:/)),fp(rr(ga,/\s+/,ga,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ga}]},Re={begin:/\(/,end:/\)/,keywords:u,contains:[pe,...r,...f,...S,T,L,...P,H,fe],endsParent:!0,illegal:/["']/},Ae={match:[/(func|macro)/,/\s+/,ti(le.match,ga,CS)],className:{1:"keyword",3:"title.function"},contains:[we,Re,t],illegal:[/\[/,/%/]},Ze={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[we,Re,t],illegal:/\[|%/},nt={match:[/operator/,/\s+/,CS],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Tb],className:{1:"keyword",3:"title"},contains:[H],keywords:[...FOe,...pD],end:/}/},Be={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ne={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Jt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ga,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[we,...f,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Tb},...f],relevance:0}]};for(const ut of L.variants){const Ut=ut.contains.find(kn=>kn.label==="interpol");Ut.keywords=u;const nn=[...f,...b,...S,T,L,...te];Ut.contains=[...nn,{begin:/\(/,end:/\)/,contains:["self",...nn]}]}return{name:"Swift",keywords:u,contains:[...r,Ae,Ze,Be,Ne,Jt,nt,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},oe,...f,...b,...S,T,L,...te,...P,H,fe]}}const Ry="[A-Za-z$_][0-9A-Za-z$_]*",hW=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],pW=["true","false","null","undefined","NaN","Infinity"],mW=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],gW=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bW=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vW=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yW=[].concat(bW,mW,gW);function GOe(e){const t=e.regex,n=(K,{after:W})=>{const V="</"+K[0].slice(1);return K.input.indexOf(V,W)!==-1},r=Ry,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,W)=>{const V=K[0].length+K.index,P=K.input[V];if(P==="<"||P===","){W.ignoreMatch();return}P===">"&&(n(K,{after:V})||W.ignoreMatch());let H;const X=K.input.substring(V);if(H=X.match(/^\s*=/)){W.ignoreMatch();return}if((H=X.match(/^\s+extends\s+/))&&H.index===0){W.ignoreMatch();return}}},a={$pattern:Ry,keyword:hW,literal:pW,built_in:yW,"variable.language":vW},l="[0-9](_?[0-9])*",u=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},N={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,{match:/\$\d+/},p];g.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});const R=[].concat(N,g.contains),_=R.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(R)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...mW,...gW]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},ne={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(K){return t.concat("(?!",K.join("|"),")")}const oe={match:t.concat(/\b/,re([...bW,"super","import"].map(K=>`${K}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,y,x,S,N,{match:/\$\d+/},p,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},oe,ne,I,ce,{match:/\$[(.]/}]}}function WOe(e){const t=e.regex,n=GOe(e),r=Ry,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Ry,keyword:hW.concat(l),literal:pW,built_in:yW.concat(s),"variable.language":vW},f={className:"meta",begin:"@"+r},p=(x,S,k)=>{const N=x.contains.findIndex(T=>T.label===S);if(N===-1)throw new Error("can not find mode to replace");x.contains.splice(N,1,k)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(f);const g=n.contains.find(x=>x.scope==="attr"),b=Object.assign({},g,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,g,b]),n.contains=n.contains.concat([f,i,o,b]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",a);const y=n.contains.find(x=>x.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function KOe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),g=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,f,p,g,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[g]}]}}function YOe(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,o,s,e.QUOTE_STRING_MODE,l,u,a]}}function ZOe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function XOe(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},a=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},y={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},x={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},S=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},g,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},y,x,i,o],k=[...S];return k.pop(),k.push(a),b.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const QOe={arduino:DAe,bash:jAe,c:IAe,cpp:zAe,csharp:LAe,css:GAe,diff:WAe,go:KAe,graphql:YAe,ini:ZAe,java:XAe,javascript:nOe,json:rOe,kotlin:iOe,less:hOe,lua:pOe,makefile:mOe,markdown:gOe,objectivec:bOe,perl:vOe,php:yOe,"php-template":xOe,plaintext:wOe,python:SOe,"python-repl":COe,r:kOe,ruby:EOe,rust:NOe,scss:IOe,shell:zOe,sql:LOe,swift:qOe,typescript:WOe,vbnet:KOe,wasm:YOe,xml:ZOe,yaml:XOe},gD={},JOe="hljs-";function eDe(e){const t=tW.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:o,registered:a};function n(l,u,f){const p=f||gD,g=typeof p.prefix=="string"?p.prefix:JOe;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:tDe,classPrefix:g});const b=t.highlight(u,{ignoreIllegals:!0,language:l});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const y=b._emitter.root,x=y.data;return x.language=b.language,x.relevance=b.relevance,y}function r(l,u){const p=(u||gD).subset||s();let g=-1,b=0,y;for(;++g<p.length;){const x=p[g];if(!t.getLanguage(x))continue;const S=n(x,l,u);S.data&&S.data.relevance!==void 0&&S.data.relevance>b&&(b=S.data.relevance,y=S)}return y||{type:"root",children:[],data:{language:void 0,relevance:b}}}function s(){return t.listLanguages()}function i(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let f;for(f in l)Object.hasOwn(l,f)&&t.registerLanguage(f,l[f])}}function o(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let f;for(f in l)if(Object.hasOwn(l,f)){const p=l[f];t.registerAliases(typeof p=="string"?p:[...p],{languageName:f})}}}function a(l){return!!t.getLanguage(l)}}class tDe{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),s=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const nDe=AAe.extend({addOptions(){return{...this.parent?.(),lowlight:eDe(QOe),defaultLanguage:null,HTMLAttributes:{class:"block-node"},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,enableTabIndentation:!1,tabSize:4}}}),rDe=VG.extend({addProseMirrorPlugins(){return[...this.parent?.()||[],new zn({props:{handleKeyDown:(e,t)=>(t.key==="Enter"&&this.editor.commands.unsetColor(),!1)}})]}}),sDe=PV.extend({addKeyboardShortcuts(){return{"Mod-Alt--":()=>this.editor.commands.insertContent({type:this.name})}}});function iDe({initialWidth:e,initialHeight:t,contentWidth:n,contentHeight:r,gridInterval:s,minWidth:i,minHeight:o,maxWidth:a,onDimensionsChange:l}){const[u,f]=w.useState({width:Math.max(e??i,i),height:Math.max(t??o,o)}),[p,g]=w.useState(1/0),[b,y]=w.useState(0),[x,S]=w.useState(u),[k,N]=w.useState(),T=w.useCallback((j,L)=>{const q=Math.max(i,Math.min(n??i,s/100*L));return Math.min(L,Math.max(j,q))},[s,n,i]),R=w.useCallback(j=>{j.preventDefault();const L=(k==="left"?b-j.pageX:j.pageX-b)*2,q=s/100*p,ne=x.width+L,re=Math.round(ne/q)*q,oe=T(re,p),le=r&&n?r/n:1;f({width:Math.max(oe,i),height:Math.max(n?oe*le:r??o,o)})},[T,k,p,b,s,r,n,x.width,i,o]),_=w.useCallback(j=>{j.preventDefault(),j.stopPropagation(),y(0),N(void 0),l?.(u)},[l,u]),A=w.useCallback(j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),f({width:Math.max(x.width,i),height:Math.max(x.height,o)}),N(void 0))},[x,i,o]),I=w.useCallback(j=>L=>{L.preventDefault(),L.stopPropagation(),g(a),S({width:Math.max(T(u.width,a),i),height:Math.max(u.height,o)}),y(L.pageX),N(j)},[a,T,u.width,u.height,i,o]);return w.useEffect(()=>{if(k)return document.addEventListener("keydown",A),document.addEventListener("pointermove",R),document.addEventListener("pointerup",_),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",_)}},[k,A,R,_]),{initiateResize:I,isResizing:!!k,updateDimensions:f,currentWidth:Math.max(u.width,i),currentHeight:Math.max(u.height,o)}}const IC=({ref:e,className:t,isResizing:n=!1,...r})=>h.jsx("div",{className:ee("absolute top-1/2 h-10 max-h-full w-1.5 -translate-y-1/2 transform cursor-col-resize rounded border border-solid border-[var(--mt-transparent-foreground)] bg-[var(--mt-bg-secondary)] p-px transition-all","opacity-0 [backdrop-filter:saturate(1.8)_blur(20px)]",{"opacity-80":n,"group-hover/node-image:opacity-80":!n},"before:absolute before:inset-y-0 before:-right-1 before:-left-1",t),ref:e,...r});IC.displayName="ResizeHandle";function oDe(){return ie.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-unzoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z"}))}function aDe(){return ie.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-zoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z"}))}function lDe(e){return typeof Element>"u"?!1:e instanceof Element}const Ay=(e,t)=>lDe(t)&&t.tagName.toUpperCase()===e,v7=e=>Ay("DIV",e)||Ay("SPAN",e),Oy=e=>Ay("IMG",e),bD=e=>e.complete&&e.naturalHeight!==0,Yb=e=>Ay("SVG",e),xW=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),cDe=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:s})=>{const i=xW({height:r,offset:n,width:s}),o=s>r?s/t:r/e;return i>1?o:i*o},vd=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:s,targetWidth:i})=>e===0||t===0?1:!n&&s!==0&&i!==0?cDe({containerHeight:e,containerWidth:t,offset:r,targetHeight:s,targetWidth:i}):xW({height:e,offset:r,width:t}),uDe=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,vD=e=>{if(e!==null){if(Oy(e))return e.currentSrc===""?void 0:e.currentSrc;if(v7(e)){const{backgroundImage:t}=window.getComputedStyle(e);if(t!=="")return uDe.exec(t)?.[1]}}},dDe=e=>{if(e!==null)return Oy(e)?e.alt:e.getAttribute("aria-label")??void 0},fDe=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:s,offset:i,targetHeight:o,targetWidth:a})=>{const l=vd({containerHeight:e,containerWidth:r,hasScalableSrc:s,offset:i,targetHeight:o,targetWidth:a});return{top:n,left:t,width:r*l,height:e*l,transform:`translate(0,0) scale(${1/l})`}},yo=({position:e,relativeNum:t})=>{const n=parseFloat(e);return e.endsWith("%")?t*n/100:n},hDe=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:s,objectFit:i,objectPosition:o,offset:a,targetHeight:l,targetWidth:u})=>{let f=i;if(f==="scale-down"&&(u<=r&&l<=e?f="none":f="contain"),f==="cover"||f==="contain"){const p=r/u,g=e/l,b=f==="cover"?Math.max(p,g):Math.min(p,g),[y="50%",x="50%"]=o.split(" "),S=yo({position:y,relativeNum:r-u*b}),k=yo({position:x,relativeNum:e-l*b}),N=vd({containerHeight:l*b,containerWidth:u*b,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{top:n+k,left:t+S,width:u*b*N,height:l*b*N,transform:`translate(0,0) scale(${1/N})`}}else if(f==="none"){const[p="50%",g="50%"]=o.split(" "),b=yo({position:p,relativeNum:r-u}),y=yo({position:g,relativeNum:e-l}),x=vd({containerHeight:l,containerWidth:u,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{top:n+y,left:t+b,width:u*x,height:l*x,transform:`translate(0,0) scale(${1/x})`}}else if(f==="fill"){const p=r/u,g=e/l,b=Math.max(p,g),y=vd({containerHeight:l*b,containerWidth:u*b,hasScalableSrc:s,offset:a,targetHeight:l,targetWidth:u});return{width:r*y,height:e*y,transform:`translate(0,0) scale(${1/y})`}}else return{}},pDe=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:s,containerWidth:i,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u})=>{if(t==="cover"||t==="contain"){const f=i/u,p=n/l,g=t==="cover"?Math.max(f,p):Math.min(f,p),[b="50%",y="50%"]=e.split(" "),x=yo({position:b,relativeNum:i-u*g}),S=yo({position:y,relativeNum:n-l*g}),k=vd({containerHeight:l*g,containerWidth:u*g,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+S,left:r+x,width:u*g*k,height:l*g*k,transform:`translate(0,0) scale(${1/k})`}}else if(t==="auto"){const[f="50%",p="50%"]=e.split(" "),g=yo({position:f,relativeNum:i-u}),b=yo({position:p,relativeNum:n-l}),y=vd({containerHeight:l,containerWidth:u,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+b,left:r+g,width:u*y,height:l*y,transform:`translate(0,0) scale(${1/y})`}}else{const[f="50%",p="50%"]=t.split(" "),g=yo({position:f,relativeNum:i}),b=yo({position:p,relativeNum:n}),y=g/u,x=b/l,S=Math.min(y,x),[k="50%",N="50%"]=e.split(" "),T=yo({position:k,relativeNum:i-u*S}),R=yo({position:N,relativeNum:n-l*S}),_=vd({containerHeight:l*S,containerWidth:u*S,hasScalableSrc:o,offset:a,targetHeight:l,targetWidth:u});return{top:s+R,left:r+T,width:u*S*_,height:l*S*_,transform:`translate(0,0) scale(${1/_})`}}},mDe=/\.svg$/i,gDe=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:s,offset:i,shouldRefresh:o,targetEl:a})=>{const l=n||t?.slice(0,18)==="data:image/svg+xml"||e||t!==void 0&&mDe.test(t),u=a.getBoundingClientRect(),f=window.getComputedStyle(a),p=s!=null&&v7(a),g=s!=null&&!p,b=s!=null&&s.naturalHeight!==0?s.naturalHeight:u.height,y=s!=null&&s.naturalWidth!==0?s.naturalWidth:u.width,x=fDe({containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,offset:i,targetHeight:b,targetWidth:y}),S=g?hDe({containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,objectFit:f.objectFit,objectPosition:f.objectPosition,offset:i,targetHeight:b,targetWidth:y}):void 0,k=p?pDe({backgroundPosition:f.backgroundPosition,backgroundSize:f.backgroundSize,containerHeight:u.height,containerLeft:u.left,containerTop:u.top,containerWidth:u.width,hasScalableSrc:l,offset:i,targetHeight:b,targetWidth:y}):void 0,N={...x,...S,...k};if(r){const T=window.innerWidth/2,R=window.innerHeight/2,_=parseFloat(String(N.left??0))+parseFloat(String(N.width??0))/2,A=parseFloat(String(N.top??0))+parseFloat(String(N.height??0))/2,I=T-_,j=R-A;o&&(N.transitionDuration="0.01ms"),N.transform=`translate(${I}px,${j}px) scale(1)`}return N},kS=e=>{if(e==null)return{};if(Yb(e)){const{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{const r=t.getBoundingClientRect();return{height:n.height,left:r.left-n.left,top:r.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},bDe=e=>{const t="-zoom",n=["clip-path","fill","mask","marker-start","marker-mid","marker-end"],r=new Map;if(e.hasAttribute("id")){const{id:s}=e,i=s+t;r.set(s,i);const o=e;o.id=i}e.querySelectorAll("[id]").forEach(s=>{const{id:i}=s,o=i+t;r.set(i,o);const a=s;a.id=o}),r.forEach((s,i)=>{const o=`url(#${i})`,a=`url(#${s})`,l=n.map(u=>`[${u}="${o}"]`).join(", ");e.querySelectorAll(l).forEach(u=>{n.forEach(f=>{u.getAttribute(f)===o&&u.setAttribute(f,a)})})}),e.querySelectorAll("style").forEach(s=>{r.forEach((i,o)=>{const{textContent:a}=s;if(a!==""){const l=s;l.textContent=a.replaceAll(`#${o}`,`#${i}`)}})})},vDe=["img","svg",'[role="img"]',"[data-zoom]"].map(e=>`${e}:not([aria-hidden="true"])`).join(","),yD={overflow:"",width:""};function yDe(){const e=document.querySelector("[data-rmiz-portal]");if(e!=null)return e;const t=document.createElement("div");return t.setAttribute("data-rmiz-portal",""),document.body.appendChild(t),t}function xDe(e){e.preventDefault()}function wDe(e){return ie.createElement(wW,{...e})}class wW extends ie.Component{constructor(){super(...arguments),this.state={id:"",isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:"UNLOADED",shouldRefresh:!1,styleGhost:{}},this.refContent=ie.createRef(),this.refDialog=ie.createRef(),this.refModalContent=ie.createRef(),this.refModalImg=ie.createRef(),this.refWrap=ie.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=yD,this.styleModalImg={},this.handleModalStateChange=t=>{const{state:{modalState:n}}=this;t!=="LOADING"&&n==="LOADING"?(this.loadZoomImg(),window.addEventListener("resize",this.handleResize,{passive:!0}),window.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),window.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),window.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),window.addEventListener("touchcancel",this.handleTouchCancel,{passive:!0}),document.addEventListener("keydown",this.handleKeyDown,!0)):t!=="LOADED"&&n==="LOADED"?window.addEventListener("wheel",this.handleWheel,{passive:!0}):t!=="UNLOADING"&&n==="UNLOADING"?(this.ensureImgTransitionEnd(),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),document.removeEventListener("keydown",this.handleKeyDown,!0)):t!=="UNLOADED"&&n==="UNLOADED"&&(this.bodyScrollEnable(),window.removeEventListener("resize",this.handleResize),this.refModalImg.current?.removeEventListener("transitionend",this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{const t=()=>Math.random().toString(16).slice(-4);this.setState({id:t()+t()+t()})},this.setAndTrackImg=()=>{const{refContent:{current:t}}=this;t!=null&&(this.imgEl=t.querySelector(vDe),this.imgEl!==null?(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener("load",this.handleImgLoad),this.imgEl.addEventListener("click",this.handleZoom),this.state.loadedImgEl==null&&this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(n=>{const[r]=n;r?.target!==void 0&&(this.imgEl=r.target,this.setState({styleGhost:kS(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver==null&&(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:kS(this.imgEl)})}),this.contentChangeObserver.observe(t,{attributes:!0,childList:!0,subtree:!0}))):this.contentNotFoundChangeObserver==null&&(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(t,{childList:!0,subtree:!0})))},this.handleIfZoomChanged=t=>{const{props:{isZoomed:n}}=this;!t&&n?this.zoom():t&&!n&&this.unzoom()},this.handleImgLoad=()=>{const t=vD(this.imgEl);if(t==null||t==="")return;const n=new Image,{imgEl:r}=this;if(Oy(r)){const{sizes:i,srcset:o,crossOrigin:a}=r;n.sizes=i,n.srcset=o,n.crossOrigin=a}n.src=t;const s=()=>{this.setState({loadedImgEl:n,styleGhost:kS(this.imgEl)})};n.decode().then(s).catch(()=>{if(bD(n)){s();return}n.onload=s})},this.handleZoom=t=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:t})},this.handleUnzoom=t=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:t})},this.handleBtnUnzoomClick=t=>{t.preventDefault(),t.stopPropagation(),this.handleUnzoom(t)},this.handleDialogClick=t=>{(t.target===this.refModalContent.current||t.target===this.refModalImg.current)&&(t.stopPropagation(),this.handleUnzoom(t))},this.handleDialogClose=t=>{t.stopPropagation(),this.handleUnzoom(t)},this.handleKeyDown=t=>{t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.handleUnzoom(t))},this.handleWheel=t=>{t.ctrlKey||(t.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(t)}))},this.handleTouchStart=t=>{if(t.touches.length>1){this.isScaling=!0;return}const{changedTouches:n}=t,[r]=n;if(n.length===1&&r!==void 0){const{screenY:s}=r;this.touchYStart=s}},this.handleTouchMove=t=>{const n=window.visualViewport?.scale??1,{changedTouches:r}=t,[s]=r;if(this.props.canSwipeToUnzoom&&!this.isScaling&&n<=1&&this.touchYStart!=null&&s!==void 0){const{screenY:i}=s;this.touchYEnd=i;const o=Math.max(this.touchYStart,this.touchYEnd),a=Math.min(this.touchYStart,this.touchYEnd);Math.abs(o-a)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(t))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||Yb(this.imgEl))&&window.getComputedStyle(this.imgEl).display!=="none",this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener("transitionend",this.handleImgTransitionEnd),this.setState({modalState:"LOADING"})},this.unzoom=()=>{this.setState({modalState:"UNLOADING"})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState==="LOADING"?this.setState({modalState:"LOADED"}):this.state.modalState==="UNLOADING"&&this.setState({shouldRefresh:!1,modalState:"UNLOADED"})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){const{transitionDuration:t}=window.getComputedStyle(this.refModalImg.current),n=parseFloat(t);if(n!==0&&!Number.isNaN(n)){const r=n*(t.endsWith("ms")?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,r)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};const{body:{clientWidth:t}}=document;document.body.style.overflow="hidden",document.body.style.width=`${t}px`},this.bodyScrollEnable=()=>{const{prevBodyAttrs:{overflow:t,width:n}}=this;document.body.style.width=n,document.body.style.overflow=t,this.prevBodyAttrs=yD},this.loadZoomImg=()=>{const{props:{zoomImg:t}}=this;if(t==null)return;const{src:n}=t;if(n!==void 0&&n!==""){const r=new Image;r.sizes=t.sizes??"",r.srcset=t.srcSet??"",r.crossOrigin=t.crossOrigin??void 0,r.src=n;const s=()=>{this.setState({isZoomImgLoaded:!0})};r.decode().then(s).catch(()=>{if(bD(r)){s();return}r.onload=s})}},this.UNSAFE_handleSvg=()=>{const{imgEl:t,refModalImg:n,styleModalImg:r}=this;if(Yb(t)){const s=t.cloneNode(!0);bDe(s),s.style.width=`${r.width??0}px`,s.style.height=`${r.height??0}px`,s.addEventListener("click",this.handleUnzoom),n.current?.firstChild?.remove(),n.current?.appendChild(s)}}}render(){const{handleBtnUnzoomClick:t,handleDialogClick:n,handleDialogClose:r,handleUnzoom:s,handleZoom:i,imgEl:o,props:{a11yNameButtonUnzoom:a,a11yNameButtonZoom:l,children:u,classDialog:f,IconUnzoom:p,IconZoom:g,isZoomed:b,wrapElement:y,ZoomContent:x,zoomImg:S,zoomMargin:k},refContent:N,refDialog:T,refModalContent:R,refModalImg:_,refWrap:A,state:{id:I,isZoomImgLoaded:j,loadedImgEl:L,modalState:q,shouldRefresh:ne,styleGhost:re}}=this,oe=`rmiz-modal-${I}`,le=`rmiz-modal-img-${I}`,ce=v7(o),F=Oy(o),te=Yb(o),K=dDe(o),W=vD(o),V=F?o.sizes:void 0,P=F?o.srcset:void 0,H=F?o.crossOrigin:void 0,X=S?.src!==void 0&&S.src!=="",de=this.hasImage(),fe=K!==void 0&&K!==""?`${l}: ${K}`:l,we=q==="LOADING"||q==="LOADED",pe=de?"found":"not-found",Re=q==="UNLOADED"||q==="UNLOADING"?"hidden":"visible",Ae={visibility:q==="UNLOADED"?"visible":"hidden"};this.styleModalImg=de&&o!==null?gDe({hasZoomImg:X,imgSrc:W,isSvg:te,isZoomed:b&&we,loadedImgEl:L,offset:k,shouldRefresh:ne,targetEl:o}):{};let Ze=null;if(de){const nt=F||ce?ie.createElement("img",{alt:K,crossOrigin:H,sizes:V,src:W,srcSet:P,...j&&q==="LOADED"?S:{},"data-rmiz-modal-img":"",height:this.styleModalImg.height??void 0,id:le,ref:_,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):te?ie.createElement("div",{"data-rmiz-modal-img":!0,ref:_,style:this.styleModalImg}):null,at=ie.createElement("button",{"aria-label":a,"data-rmiz-btn-unzoom":"",onClick:t,type:"button"},ie.createElement(p,null));Ze=x==null?ie.createElement(ie.Fragment,null,nt,at):ie.createElement(x,{buttonUnzoom:at,modalState:q,img:nt,isZoomImgLoaded:j,onUnzoom:s})}return ie.createElement(y,{"aria-owns":oe,"data-rmiz":"",ref:A},ie.createElement(y,{"data-rmiz-content":pe,ref:N,style:Ae},u),de&&ie.createElement(y,{"data-rmiz-ghost":"",style:re},ie.createElement("button",{"aria-label":fe,"data-rmiz-btn-zoom":"",onClick:i,type:"button"},ie.createElement(g,null))),de&&By.createPortal(ie.createElement("dialog",{"aria-labelledby":le,"aria-modal":"true",className:f,"data-rmiz-modal":"",id:oe,onClick:n,onClose:r,onCancel:xDe,ref:T,role:"dialog"},ie.createElement("div",{"data-rmiz-modal-overlay":Re}),ie.createElement("div",{"data-rmiz-modal-content":"",ref:R},Ze)),yDe()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!=="UNLOADED"&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener("load",this.handleImgLoad),this.imgEl?.removeEventListener("click",this.handleZoom),this.refModalImg.current?.removeEventListener("transitionend",this.handleImgTransitionEnd),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),window.removeEventListener("resize",this.handleResize),document.removeEventListener("keydown",this.handleKeyDown,!0)}componentDidUpdate(t,n){this.handleModalStateChange(n.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(t.isZoomed)}}wW.defaultProps={a11yNameButtonUnzoom:"Minimize image",a11yNameButtonZoom:"Expand image",canSwipeToUnzoom:!0,IconUnzoom:oDe,IconZoom:aDe,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:"div",zoomMargin:0};const y7=({children:e,className:t,...n})=>h.jsx("div",{className:ee("absolute top-3 right-3 flex flex-row rounded px-0.5 opacity-0 group-hover/node-image:opacity-100","border-[0.5px] bg-[var(--mt-bg-secondary)] [backdrop-filter:saturate(1.8)_blur(20px)]",t),...n,children:e});y7.displayName="ActionWrapper";const Dy=({icon:e,tooltip:t,className:n,...r})=>h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",className:ee("text-muted-foreground hover:text-foreground relative flex h-7 w-7 flex-row rounded-none p-0","bg-transparent hover:bg-transparent",n),...r,children:e})}),h.jsx(Va,{side:"bottom",children:t})]});Dy.displayName="ActionButton";const SDe=[{key:"onView",icon:h.jsx(p_e,{}),tooltip:"View image"},{key:"onDownload",icon:h.jsx(GTe,{}),tooltip:"Download image"},{key:"onCopy",icon:h.jsx(PTe,{}),tooltip:"Copy image to clipboard"},{key:"onCopyLink",icon:h.jsx(MG,{}),tooltip:"Copy image link",isLink:!0}],SW=({shouldMerge:e=!1,isLink:t=!1,...n})=>{const[r,s]=w.useState(!1),i=w.useCallback((a,l)=>{a.preventDefault(),a.stopPropagation(),l?.()},[]),o=w.useMemo(()=>SDe.filter(a=>t||!a.isLink),[t]);return h.jsx(y7,{className:ee({"opacity-100":r}),children:e?h.jsxs(Ao,{open:r,onOpenChange:s,children:[h.jsx(Oo,{asChild:!0,children:h.jsx(Dy,{icon:h.jsx(NG,{}),tooltip:"Open menu",onClick:a=>a.preventDefault()})}),h.jsx(Do,{className:"w-56",align:"end",children:o.map(({key:a,icon:l,tooltip:u})=>h.jsx(Ra,{onClick:f=>i(f,n[a]),children:h.jsxs("div",{className:"flex flex-row items-center gap-2",children:[l,h.jsx("span",{children:u})]})},a))})]}):o.map(({key:a,icon:l,tooltip:u})=>h.jsx(Dy,{icon:l,tooltip:u,onClick:f=>i(f,n[a])},a))})};SW.displayName="ImageActions";const CDe=({editor:e,node:t,src:n,onViewClick:r})=>{const s=_C(n),i=w.useCallback(()=>{r(!0)},[r]),o=w.useCallback(()=>{e.commands.downloadImage({src:t.attrs.src,alt:t.attrs.alt})},[e.commands,t.attrs.alt,t.attrs.src]),a=w.useCallback(()=>{e.commands.copyImage({src:t.attrs.src})},[e.commands,t.attrs.src]),l=w.useCallback(()=>{e.commands.copyLink({src:t.attrs.src})},[e.commands,t.attrs.src]),u=w.useCallback(()=>{e.commands.command(({tr:f,dispatch:p})=>{const{selection:g}=f,b=f.doc.nodeAt(g.from);return b&&b.type.name==="image"&&p?(f.deleteSelection(),!0):!1})},[e.commands]);return{isLink:s,onView:i,onDownload:o,onCopy:a,onCopyLink:l,onRemoveImg:u}},CW=function({className:t,...n}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:ee("animate-spin",t),...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})};CW.displayName="Spinner";const kW=w.memo(CW),EW=w.memo(()=>h.jsx("div",{className:ee("flex flex-row items-center justify-center","absolute inset-0 rounded bg-[var(--mt-overlay)] opacity-100 transition-opacity"),children:h.jsx(kW,{className:"size-7"})}));EW.displayName="ImageOverlay";const ES=600,kDe=120,xD=120,EDe=e=>({src:typeof e=="string"?e:e.src,id:typeof e=="string"?ky():e.id}),NDe=({editor:e,node:t,selected:n,updateAttributes:r})=>{const{src:s,width:i,height:o,fileName:a}=t.attrs,l=w.useRef(!1),u=w.useMemo(()=>typeof s=="string"?s:s.src,[s]),[f,p]=w.useState({src:u,isServerUploading:!1,imageLoaded:!1,isZoomed:!1,error:!1,naturalSize:{width:i,height:o}}),g=w.useRef(null),[b,y]=w.useState(null),x=w.useCallback(({width:W,height:V})=>{r({width:W,height:V})},[r]),S=f.naturalSize.width/f.naturalSize.height,k=ES*S,N=g.current?parseFloat(getComputedStyle(g.current).getPropertyValue("--editor-width")):1/0,{isLink:T,onView:R,onDownload:_,onCopy:A,onCopyLink:I,onRemoveImg:j}=CDe({editor:e,node:t,src:f.src,onViewClick:W=>p(V=>({...V,isZoomed:W}))}),{currentWidth:L,currentHeight:q,updateDimensions:ne,initiateResize:re,isResizing:oe}=iDe({initialWidth:i??f.naturalSize.width,initialHeight:o??f.naturalSize.height,contentWidth:f.naturalSize.width,contentHeight:f.naturalSize.height,gridInterval:.1,onDimensionsChange:x,minWidth:xD,minHeight:kDe,maxWidth:N>0?N:k}),le=w.useMemo(()=>L<=180,[L]),ce=w.useCallback(W=>{const V=W.target,P={width:V.naturalWidth,height:V.naturalHeight};p(H=>({...H,naturalSize:P,imageLoaded:!0})),r({width:V.width||P.width,height:V.height||P.height,alt:V.alt,title:V.title}),i||ne(H=>({...H,width:P.width}))},[i,r,ne]),F=w.useCallback(()=>{p(W=>({...W,error:!0,imageLoaded:!0}))},[]),te=w.useCallback(W=>V=>{y(W),re(W)(V)},[re]),K=w.useCallback(()=>{y(null)},[]);return w.useEffect(()=>{oe||K()},[oe,K]),w.useEffect(()=>{(async()=>{if(!u.startsWith("blob:")||l.current)return;l.current=!0;const V=e.options.extensions.find(H=>H.name==="image"),{uploadFn:P}=V?.options??{};if(!P){try{const H=await N_e(u);p(X=>({...X,src:H})),r({src:H})}catch{p(H=>({...H,error:!0}))}return}try{p(pe=>({...pe,isServerUploading:!0}));const X=await(await fetch(u)).blob(),de=new File([X],a,{type:X.type}),fe=await P(de,e),we=EDe(fe);p(pe=>({...pe,...we,isServerUploading:!1})),r(we)}catch{p(H=>({...H,error:!0,isServerUploading:!1}))}})()},[e,a,u,r]),h.jsx(NTe,{ref:g,"data-drag-handle":!0,className:"relative text-center leading-none",children:h.jsx("div",{className:"group/node-image relative mx-auto rounded-md object-contain",style:{maxWidth:`min(${k}px, 100%)`,width:L,maxHeight:ES,aspectRatio:`${f.naturalSize.width} / ${f.naturalSize.height}`},children:h.jsxs("div",{className:ee("relative flex h-full cursor-default flex-col items-center gap-2 rounded",{"outline-primary outline-2 outline-offset-1":n||oe}),children:[h.jsxs("div",{className:"h-full contain-paint",children:[h.jsxs("div",{className:"relative h-full",children:[f.isServerUploading&&!f.error&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx(kW,{className:"size-7"})}),f.error&&h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx(n_e,{className:"text-destructive size-8"}),h.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Failed to load image"})]}),h.jsx(wDe,{isZoomed:f.isZoomed,onZoomChange:()=>p(W=>({...W,isZoomed:!1})),children:h.jsx("img",{className:ee("h-auto rounded object-contain transition-shadow",{"opacity-0":!f.imageLoaded||f.error}),style:{maxWidth:`min(100%, ${k}px)`,minWidth:`${xD}px`,maxHeight:ES},width:L,height:q,src:f.src,onError:F,onLoad:ce,alt:t.attrs.alt||"",title:t.attrs.title||"",id:t.attrs.id})})]}),f.isServerUploading&&h.jsx(EW,{}),e.isEditable&&f.imageLoaded&&!f.error&&!f.isServerUploading&&h.jsxs(h.Fragment,{children:[h.jsx(IC,{onPointerDown:te("left"),className:ee("left-1",{hidden:oe&&b==="right"}),isResizing:oe&&b==="left"}),h.jsx(IC,{onPointerDown:te("right"),className:ee("right-1",{hidden:oe&&b==="left"}),isResizing:oe&&b==="right"})]})]}),f.error&&h.jsx(y7,{children:h.jsx(Dy,{icon:h.jsx(x_e,{}),tooltip:"Remove image",onClick:j})}),!oe&&!f.error&&!f.isServerUploading&&h.jsx(SW,{shouldMerge:le,isLink:T,onView:R,onDownload:_,onCopy:A,onCopyLink:I})]})})})},x7=(e,t,n)=>{const r=e instanceof Error?e:new Error("Unknown error");n?.(r,t)},MDe=e=>{const[t,n]=e.split(","),r=t.split(":")[1].split(";")[0],s=r.split("/")[1],i=atob(n),o=new Uint8Array(i.length);for(let l=0;l<i.length;l++)o[l]=i.charCodeAt(l);return{blob:new Blob([o],{type:r}),extension:s}},TDe=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch image");const n=await t.blob(),r=n.type.split(/\/|\+/)[1];return{blob:n,extension:r}},_De=async e=>e.startsWith("data:")?MDe(e):TDe(e),RDe=async(e,t,n)=>{const r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=`${t}.${n}`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)},ADe=async(e,t)=>{const{src:n,alt:r}=e,s=r||"image";try{const{blob:i,extension:o}=await _De(n);await RDe(i,s,o),t.onActionSuccess?.({...e,action:"download"})}catch(i){x7(i,{...e,action:"download"},t.onActionError)}},ODe=async(e,t)=>{const{src:n}=e;try{const s=await(await fetch(n)).blob();await navigator.clipboard.write([new ClipboardItem({[s.type]:s})]),t.onActionSuccess?.({...e,action:"copyImage"})}catch(r){x7(r,{...e,action:"copyImage"},t.onActionError)}},DDe=async(e,t)=>{const{src:n}=e;try{await navigator.clipboard.writeText(n),t.onActionSuccess?.({...e,action:"copyLink"})}catch(r){x7(r,{...e,action:"copyLink"},t.onActionError)}},jDe=mU.extend({atom:!0,addOptions(){return{...this.parent?.()||{},inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1,allowedMimeTypes:[],maxFileSize:0,uploadFn:void 0,onToggle:void 0,downloadImage:void 0,copyImage:void 0,copyLink:void 0}},addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},id:{default:null},width:{default:null},height:{default:null},fileName:{default:null}}},addCommands(){return{setImages:e=>({commands:t})=>{const[n,r]=Ey(e,{allowedMimeTypes:this.options.allowedMimeTypes,maxFileSize:this.options.maxFileSize,allowBase64:this.options.allowBase64});return r.length>0&&this.options.onValidationError&&this.options.onValidationError(r),n.length>0?t.insertContent(n.map(s=>{if(s.src instanceof File){const i=URL.createObjectURL(s.src),o=ky();return{type:this.type.name,attrs:{id:o,src:i,alt:s.alt,title:s.title,fileName:s.src.name}}}else return{type:this.type.name,attrs:{id:ky(),src:s.src,alt:s.alt,title:s.title,fileName:null}}})):!1},downloadImage:e=>()=>((this.options.downloadImage||ADe)({...e,action:"download"},this.options),!0),copyImage:e=>()=>((this.options.copyImage||ODe)({...e,action:"copyImage"},this.options),!0),copyLink:e=>()=>((this.options.copyLink||DDe)({...e,action:"copyLink"},this.options),!0),toggleImage:()=>({editor:e})=>{const t=document.createElement("input");return t.type="file",t.accept=this.options.allowedMimeTypes.join(","),t.onchange=()=>{const n=t.files;if(!n)return;const[r,s]=Ey(Array.from(n),{allowedMimeTypes:this.options.allowedMimeTypes,maxFileSize:this.options.maxFileSize,allowBase64:this.options.allowBase64});return s.length>0&&this.options.onValidationError?(this.options.onValidationError(s),!1):(r.length===0||this.options.onToggle&&this.options.onToggle(e,r,e.state.selection.from),!1)},t.click(),!0}}},onTransaction({transaction:e}){e.steps.forEach(t=>{t instanceof ms&&t.slice.size===0&&e.before.content.cut(t.from,t.to).forEach(r=>{if(r.type.name==="image"){const s=r.attrs;s.src.startsWith("blob:")&&URL.revokeObjectURL(s.src),this.options.onImageRemoved?.(s)}})})},addNodeView(){return OTe(NDe,{className:"block-node"})}}),IDe=on.create({addKeyboardShortcuts(){return{"Mod-\\":()=>this.editor.commands.unsetAllMarks()}}}),zDe=on.create({name:"resetMarksOnEnter",addKeyboardShortcuts(){return{Enter:({editor:e})=>e.isActive("bold")||e.isActive("italic")||e.isActive("strike")||e.isActive("underline")||e.isActive("code")?(e.commands.splitBlock({keepMarks:!1}),!0):!1}}}),LDe=e=>{const{key:t,editor:n,onPaste:r,onDrop:s,onValidationError:i,allowedMimeTypes:o,maxFileSize:a}=e;return new zn({key:t||new Zn("fileHandler"),props:{handleDrop(l,u){const{dataTransfer:f}=u;if(!f?.files.length)return!1;u.preventDefault(),u.stopPropagation();const p=l.posAtCoords({left:u.clientX,top:u.clientY}),[g,b]=Ey(Array.from(f.files),{allowedMimeTypes:o,maxFileSize:a,allowBase64:e.allowBase64});return b.length>0&&i&&i(b),g.length>0&&s&&s(n,g,p?.pos??0),!0},handlePaste(l,u){const{clipboardData:f}=u;if(!f?.files.length)return!1;u.preventDefault(),u.stopPropagation();const[p,g]=Ey(Array.from(f.files),{allowedMimeTypes:o,maxFileSize:a,allowBase64:e.allowBase64}),b=f.getData("text/html");return g.length>0&&i&&i(g),p.length>0&&r&&r(n,p,b),!0}}})},PDe=on.create({name:"fileHandler",addOptions(){return{allowBase64:!1,allowedMimeTypes:[],maxFileSize:0}},addProseMirrorPlugins(){return[LDe({key:new Zn(this.name),editor:this.editor,...this.options})]}});function $De(e){return/^#{1,6}\s/.test(e)||/\*\*[^*]+\*\*/.test(e)||/\*[^*]+\*/.test(e)||/\[.+\]\(.+\)/.test(e)||/^[-*+]\s/.test(e)||/^\d+\.\s/.test(e)||/^>\s/.test(e)||/`[^`]+`/.test(e)||/^```/.test(e)}const BDe=on.create({name:"markdownPaste",addProseMirrorPlugins(){const{editor:e}=this;return[new zn({key:new Zn("markdownPaste"),props:{handlePaste:(t,n)=>{const r=n.clipboardData;if(!r||r.getData("text/html"))return!1;const i=r.getData("text/plain");if(!i||!e.markdown||!$De(i))return!1;try{return e.commands.insertContent(i,{contentType:"markdown"}),n.preventDefault(),!0}catch{return!1}}}})]}});function FDe(e,t){const n=w.useRef(Date.now()),r=w.useRef(null);return w.useCallback((...s)=>{Date.now()-n.current>=t?(e(...s),n.current=Date.now()):(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...s),n.current=Date.now()},t-(Date.now()-n.current)))},[e,t])}async function HDe(e){return await new Promise(n=>setTimeout(n,3e3)),await RC(e)}const UDe=({placeholder:e,uploader:t,output:n="html"})=>[nq.configure({blockquote:{HTMLAttributes:{class:"block-node"}},bulletList:{HTMLAttributes:{class:"list-node"}},code:{HTMLAttributes:{class:"inline",spellcheck:"false"}},codeBlock:!1,dropcursor:{width:2,class:"ProseMirror-dropcursor border"},heading:{HTMLAttributes:{class:"heading-node"}},horizontalRule:!1,link:{enableClickSelection:!0,openOnClick:!1,HTMLAttributes:{class:"link"}},orderedList:{HTMLAttributes:{class:"list-node"}},paragraph:{HTMLAttributes:{class:"text-node"}}}),jDe.configure({allowedMimeTypes:["image/*"],maxFileSize:5*1024*1024,allowBase64:!0,uploadFn:async r=>t?await t(r):await HDe(r),onToggle(r,s,i){r.commands.insertContentAt(i,s.map(o=>{const a=URL.createObjectURL(o);return{type:"image",attrs:{id:ky(),src:a,alt:o.name,title:o.name,fileName:o.name}}}))},onImageRemoved({id:r,src:s}){console.log("Image removed",{id:r,src:s})},onValidationError(r){r.forEach(s=>{or.error("Image validation error",{position:"bottom-right",description:s.reason})})},onActionSuccess({action:r}){const s={copyImage:"Copy Image",copyLink:"Copy Link",download:"Download"};or.success(s[r],{position:"bottom-right",description:"Image action success"})},onActionError(r,{action:s}){const i={copyImage:"Copy Image",copyLink:"Copy Link",download:"Download"};or.error(`Failed to ${i[s]}`,{position:"bottom-right",description:r.message})}}),PDe.configure({allowBase64:!0,allowedMimeTypes:["image/*"],maxFileSize:5*1024*1024,onDrop:(r,s,i)=>{s.forEach(async o=>{const a=await RC(o);r.commands.insertContentAt(i,{type:"image",attrs:{src:a}})})},onPaste:(r,s)=>{s.forEach(async i=>{const o=await RC(i);r.commands.insertContent({type:"image",attrs:{src:o}})})},onValidationError:r=>{r.forEach(s=>{or.error("Image validation error",{position:"bottom-right",description:s.reason})})}}),rDe,UG,i6e,kRe,IDe,sDe,zDe,nDe,s6e.configure({placeholder:()=>e}),...n==="markdown"?[EAe.configure({markedOptions:{gfm:!0}}),ZV.configure({HTMLAttributes:{class:"task-list-node"}}),YV.configure({nested:!0}),iSe.configure({table:{resizable:!0,HTMLAttributes:{class:"table-node"}}}),BDe]:[]],VDe=({value:e,output:t="html",placeholder:n="",editorClassName:r,throttleDelay:s=0,onUpdate:i,onBlur:o,uploader:a,...l})=>{const u=FDe(y=>i?.(y),s),f=w.useCallback(y=>u(QO(y,t)),[t,u]),p=w.useCallback(y=>{e&&y.isEmpty&&y.commands.setContent(e,{contentType:t==="markdown"?"markdown":void 0})},[e,t]),g=w.useCallback(y=>o?.(QO(y,t)),[t,o]);return kTe({immediatelyRender:!1,extensions:UDe({placeholder:n,uploader:a,output:t}),editorProps:{attributes:{autocomplete:"off",autocorrect:"off",autocapitalize:"off",class:ee("focus:outline-hidden",r)}},onUpdate:({editor:y})=>f(y),onCreate:({editor:y})=>p(y),onBlur:({editor:y})=>g(y),...l})},qDe={top:0,left:0,bottom:0,right:0,x:0,y:0,width:0,height:0,toJSON:()=>"{}"};function GDe(e){const[t,n]=w.useState(()=>e?.getBoundingClientRect()??qDe),r=w.useCallback(()=>{if(!e)return;const s=e.getBoundingClientRect();n(i=>Math.round(i.width)===Math.round(s.width)&&Math.round(i.height)===Math.round(s.height)&&Math.round(i.x)===Math.round(s.x)&&Math.round(i.y)===Math.round(s.y)?i:s)},[e]);return w.useEffect(()=>{if(!e)return;const s=new ResizeObserver(r);return s.observe(e),window.addEventListener("click",r),window.addEventListener("resize",r),()=>{s.disconnect(),window.removeEventListener("click",r),window.removeEventListener("resize",r)}},[e,r]),t}const NW=({as:e,name:t,children:n,style:r={},...s})=>{const i=w.useRef(null),o=GDe(i.current),a={[`--${t}-width`]:`${o.width}px`,[`--${t}-height`]:`${o.height}px`};return h.jsx(e,{...s,ref:i,style:{...a,...r},children:n})};NW.displayName="MeasuredContainer";function WDe(e){const{editor:t}=r7(),n=w.useMemo(()=>e||t,[e,t]);return yG({editor:n,selector(s){return s.editor?{editor:s.editor,editorState:s.editor.state,canCommand:s.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}const KDe=({editor:e})=>h.jsx("div",{className:"border-border flex h-12 shrink-0 overflow-x-auto border-b p-2",children:h.jsxs("div",{className:"flex w-max items-center gap-px",children:[h.jsx(kG,{editor:e}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(_G,{editor:e,activeLevels:[1,2,3,4,5,6]}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(RG,{editor:e,activeActions:["bold","italic","underline","strikethrough","code","clearFormatting"],mainActionCount:4}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(DG,{editor:e}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(jG,{editor:e,activeActions:["orderedList","bulletList"],mainActionCount:0}),h.jsx(Hi,{orientation:"vertical",className:"mx-2"}),h.jsx(IG,{editor:e,activeActions:["codeBlock","blockquote","horizontalRule"],mainActionCount:2})]})}),MW=({value:e,onChange:t,className:n,editorContentClassName:r,...s})=>{const i=VDe({value:e,onUpdate:t,...s});return i?h.jsx(v2.Provider,{value:{editor:i},children:h.jsx(YDe,{editor:i,className:n,editorContentClassName:r})}):null};MW.displayName="MinimalTiptapEditor";const YDe=({editor:e,className:t,editorContentClassName:n})=>{const{editor:r}=WDe(e);return r?h.jsxs(NW,{as:"div",name:"editor",className:ee("border-input min-data-[orientation=vertical]:h-72 flex h-auto w-full min-w-0 flex-col rounded-md border shadow-xs","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",t),children:[h.jsx(KDe,{editor:r}),h.jsx(vG,{editor:r,className:ee("minimal-tiptap-editor",n)}),h.jsx(iRe,{editor:r})]}):null};function ZDe({value:e,onChange:t,placeholder:n}){const r=w.useRef([]),s=w.useRef(e);w.useEffect(()=>{s.current=e},[e]);const i=async a=>{const l=new FormData;l.append("file",a);const{data:u}=await Zt.post("/upload",l);return r.current.push(u.url),u.url};w.useEffect(()=>()=>{const a=String(s.current||"");r.current.filter(u=>!a.includes(u)).forEach(async u=>{try{const f=u.split("/").pop();f&&await Zt.delete(`/upload/${decodeURIComponent(f)}`)}catch(f){console.error("Session image cleanup failed for:",u,f)}})},[]);const o=e??"";return h.jsx(MW,{value:o,onChange:a=>{t(typeof a=="string"?a:String(a))},className:"w-full",editorContentClassName:"p-5",output:"html",placeholder:n||"Scrivi qui il tuo contenuto...",autofocus:!1,editable:!0,editorClassName:"focus:outline-none",uploader:i})}function XDe({branch:e,value:t,onChange:n}){return h.jsx(ZDe,{value:t,onChange:r=>n(r),placeholder:`Scrivi ${e.label.toLowerCase()}...`})}const wD="image/*",QDe=8e3;function JDe(e){return e.type==="file"&&(e.multiple===!0||e.format==="asset-list")}function TW(e){try{return new URL(e).protocol==="https:"}catch{return!1}}async function eje(e){return new Promise(t=>{const n=new Image;let r=!1;const s=()=>{n.onload=null,n.onerror=null},i=a=>{r||(r=!0,s(),t(a))},o=globalThis.setTimeout(()=>i(!1),QDe);n.onload=()=>{globalThis.clearTimeout(o),i(!0)},n.onerror=()=>{globalThis.clearTimeout(o),i(!1)},n.src=e})}function tje(e){try{return JSON.parse(e)}catch{return e}}function SD(e){if(typeof e!="string")return null;const t=e.trim();return TW(t)?t:null}function hp(e){const t=typeof e=="string"?tje(e):e,n=Array.isArray(t)?t:[t],r=[];for(const s of n){if(s==null)continue;const i=SD(s);if(i){r.push(i);continue}if(typeof s=="object"&&!Array.isArray(s)){const o=SD(s.url);o&&r.push(o)}}return[...new Set(r)]}function CD(e,t){return e.includes(t)?e:[...e,t]}function nje(e,t,n){if(n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function rje(e){return e.isMultiple?e.hasAssets?"Gestisci galleria":"Aggiungi immagini":e.hasImage?"Sostituisci":"Aggiungi immagine"}function sje({branch:e,value:t,onChange:n}){const r=w.useRef(null),[s,i]=w.useState(!1),[o,a]=w.useState(!1),[l,u]=w.useState(!1),[f,p]=w.useState(!1),[g,b]=w.useState(null),[y,x]=w.useState(""),S=JDe(e),k=w.useMemo(()=>S?hp(t):[],[S,t]),N=typeof t=="string"?t:"",T=N.length>0,R=k.length>0,_=rje({isMultiple:S,hasAssets:R,hasImage:T}),A=l||f;w.useEffect(()=>{s&&(x(S?"":N),b(null),a(!1))},[s,S,N]);const I=w.useCallback(async K=>{if(!K.type.startsWith("image/")){b("Seleziona un'immagine (JPG, PNG, WebP, GIF)");return}b(null),u(!0);try{const W=new FormData;W.append("file",K);const{data:V}=await Zt.post("/upload",W);if(S){const P=hp(t);n(CD(P,V.url))}else n(V.url),i(!1)}catch(W){b(W instanceof Error?W.message:"Errore durante il caricamento")}finally{u(!1)}},[S,n,t]),j=w.useCallback(async()=>{const K=y.trim();if(!K){b("Inserisci un URL immagine pubblico");return}if(!TW(K)){b("L'URL deve iniziare con https://");return}b(null),p(!0);try{if(!await eje(K)){b("URL non renderizzabile come immagine");return}if(S){const V=hp(t);n(CD(V,K)),x("")}else n(K),i(!1)}finally{p(!1)}},[S,n,y,t]),L=w.useCallback(K=>{K.preventDefault(),a(!1);const W=K.dataTransfer.files[0];W&&I(W)},[I]),q=w.useCallback(K=>{K.preventDefault(),A||a(!0)},[A]),ne=w.useCallback(()=>{a(!1)},[]),re=w.useCallback(K=>{const W=K.target.files?.[0];W&&I(W),K.target.value=""},[I]),oe=w.useCallback(()=>{A||r.current?.click()},[A]),le=w.useCallback(()=>{n("")},[n]),ce=w.useCallback(K=>{const W=hp(t);n(W.filter((V,P)=>P!==K))},[n,t]),F=w.useCallback((K,W)=>{const V=hp(t),P=W==="up"?K-1:K+1;n(nje(V,K,P))},[n,t]),te=w.useCallback(()=>{n([]),i(!1)},[n]);return S?h.jsx("div",{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[R?h.jsx("div",{className:"grid grid-cols-2 gap-1",children:k.slice(0,4).map(K=>h.jsx("div",{className:"relative size-16 overflow-hidden rounded-md border border-input bg-muted",children:h.jsx("img",{src:K,alt:"",className:"size-full object-cover"})},K))}):h.jsx("div",{className:"flex size-16 shrink-0 items-center justify-center rounded-md border border-dashed border-input bg-muted/40",children:h.jsx(mp,{className:"size-5 text-muted-foreground"})}),h.jsx("div",{className:"flex flex-col items-start gap-2",children:h.jsxs(Ph,{open:s,onOpenChange:i,children:[h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>i(!0),children:[h.jsx(mp,{className:"size-4"}),_]}),h.jsxs($h,{children:[h.jsxs(ym,{children:[h.jsx(xm,{children:_}),h.jsx(xy,{children:"Inserisci un URL pubblico HTTPS oppure carica un file locale."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:`${e.alias}-url`,className:"text-sm font-medium",children:"Link immagine"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(pn,{id:`${e.alias}-url`,type:"url",value:y,onChange:K=>x(K.target.value),placeholder:"https://example.com/image.jpg",disabled:A}),h.jsx(He,{type:"button",variant:"secondary",onClick:()=>{j()},disabled:A,children:f?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"size-4 animate-spin"}),"Verifica..."]}):h.jsxs(h.Fragment,{children:[h.jsx(OS,{className:"size-4"}),"Aggiungi"]})})]})]}),h.jsxs("button",{type:"button",onClick:oe,onDrop:L,onDragOver:q,onDragLeave:ne,className:ee("w-full rounded-lg border-2 border-dashed p-5 text-center transition-colors","hover:border-primary/50 hover:bg-muted/50",o&&"border-primary bg-muted/50",A&&"pointer-events-none opacity-70"),children:[h.jsx("input",{ref:r,id:`${e.alias}-file`,type:"file",accept:wD,className:"hidden",onChange:re}),l?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Co,{className:"size-8 animate-spin text-muted-foreground"}),h.jsx("span",{className:"text-sm text-muted-foreground",children:"Caricamento..."})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"trascina qui il tuo file oppure selezionalo"})]}),k.length>0?h.jsx("div",{className:"max-h-52 space-y-2 overflow-y-auto rounded-md border border-input p-2",children:k.map((K,W)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-background p-2",children:[h.jsx("img",{src:K,alt:"",className:"size-10 shrink-0 rounded object-cover"}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:K}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>F(W,"up"),disabled:W===0||A,"aria-label":"Sposta su",children:h.jsx(FZ,{className:"size-4"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>F(W,"down"),disabled:W===k.length-1||A,"aria-label":"Sposta giu",children:h.jsx(jZ,{className:"size-4"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon",onClick:()=>ce(W),disabled:A,"aria-label":"Rimuovi immagine",children:h.jsx(ja,{className:"size-4"})})]})]},`${K}-${W}`))}):null,g?h.jsx("p",{className:"text-sm text-destructive",children:g}):null]}),h.jsxs(EC,{children:[k.length>0?h.jsxs(He,{type:"button",variant:"destructive",onClick:te,disabled:A,children:[h.jsx(ja,{className:"size-4"}),"Rimuovi tutte"]}):null,h.jsx(He,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:A,children:"Chiudi"})]})]})]})})]})}):h.jsx("div",{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[T?h.jsx("div",{className:"relative size-16 shrink-0 overflow-hidden rounded-md border border-input bg-muted",children:h.jsx("img",{src:N,alt:"",className:"size-full object-cover"})}):h.jsx("div",{className:"flex size-16 shrink-0 items-center justify-center rounded-md border border-dashed border-input bg-muted/40",children:h.jsx(mp,{className:"size-5 text-muted-foreground"})}),h.jsx("div",{className:"flex flex-col items-start gap-2",children:h.jsxs(Ph,{open:s,onOpenChange:i,children:[h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:()=>i(!0),children:[h.jsx(mp,{className:"size-4"}),_]}),h.jsxs($h,{children:[h.jsxs(ym,{children:[h.jsxs(xm,{children:[_," immagine"]}),h.jsx(xy,{children:"Inserisci un URL pubblico HTTPS oppure carica un file locale."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{htmlFor:`${e.alias}-url`,className:"text-sm font-medium",children:"Link immagine"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(pn,{id:`${e.alias}-url`,type:"url",value:y,onChange:K=>x(K.target.value),placeholder:"https://example.com/image.jpg",disabled:A}),h.jsx(He,{type:"button",variant:"secondary",onClick:()=>{j()},disabled:A,children:f?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"size-4 animate-spin"}),"Verifica..."]}):h.jsxs(h.Fragment,{children:[h.jsx(OS,{className:"size-4"}),"Usa link"]})})]})]}),h.jsxs("button",{type:"button",onClick:oe,onDrop:L,onDragOver:q,onDragLeave:ne,className:ee("w-full rounded-lg border-2 border-dashed p-5 text-center transition-colors","hover:border-primary/50 hover:bg-muted/50",o&&"border-primary bg-muted/50",A&&"pointer-events-none opacity-70"),children:[h.jsx("input",{ref:r,id:`${e.alias}-file`,type:"file",accept:wD,className:"hidden",onChange:re}),l?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Co,{className:"size-8 animate-spin text-muted-foreground"}),h.jsx("span",{className:"text-sm text-muted-foreground",children:"Caricamento..."})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"trascina qui il tuo file oppure selezionalo"})]}),g?h.jsx("p",{className:"text-sm text-destructive",children:g}):null]}),h.jsxs(EC,{children:[T?h.jsxs(He,{type:"button",variant:"destructive",onClick:()=>{le(),i(!1)},disabled:A,children:[h.jsx(ja,{className:"size-4"}),"Rimuovi immagine"]}):null,h.jsx(He,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:A,children:"Chiudi"})]})]})]})})]})})}const ije={text:y7e,number:x7e,boolean:w7e,date:S7e,json:N7e,richtext:_7e,file:D7e},oje={text:j7e,number:I7e,boolean:z7e,date:wMe,json:EMe,richtext:XDe,file:sje};function aje(e){return ije[e]??p7e}function lje(e){return oje[e]??m7e}function _W(e){const{branch:t}=e,{visibility:n}=l2(t);if(n==="hidden")return null;const r=aje(t.type);return n==="masked"?h.jsx(r,{...e,value:"••••••••"}):h.jsx(r,{...e})}function eh(e){const{branch:t}=e,{privacy:n}=l2(t);if(n==="hash"||n==="encrypt")return h.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed px-3 py-2 text-sm text-muted-foreground",children:[h.jsx("span",{children:"••••••••"}),h.jsx("span",{className:"text-xs",children:"(campo sensibile — non modificabile)"})]});const r=lje(t.type);return h.jsx(r,{...e})}function cje({className:e,orientation:t="horizontal",...n}){return h.jsx(Pae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const uje=Ud("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function dje({className:e,variant:t="default",...n}){return h.jsx($ae,{"data-slot":"tabs-list","data-variant":t,className:ee(uje({variant:t}),e),...n})}function kD({className:e,...t}){return h.jsx(Bae,{"data-slot":"tabs-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function ED({className:e,...t}){return h.jsx(Fae,{"data-slot":"tabs-content",className:ee("flex-1 outline-none",e),...t})}function ND(e){return e.alias.startsWith("meta")}function fje(e){return e.type==="json"&&e.alias.toLowerCase().includes("tag")}function hje(e){const t=e.alias.trim().toLowerCase();return t==="title"||t==="name"}function pje(e){const t=e.branches.find(fje)??null,n=e.branches.filter(ND),r=e.branches.filter(s=>!ND(s)&&!hje(s)&&s.alias!==t?.alias);return{tagsBranch:t,seoBranches:n,mainBranches:r}}function mje(e){const t=e.find(r=>r.type==="richtext")??null,n=t?e.filter(r=>r.alias!==t.alias):e;return{richtextBranch:t,otherMainBranches:n}}function gje(e){const t=e.trim().toLowerCase();return t?["error","failed","rejected","archived"].includes(t)?"destructive":["published","active","approved","online"].includes(t)?"default":"outline":"secondary"}function w2(e){if(typeof e=="string"){const t=e.trim();if(!t)return null;try{const n=JSON.parse(t);if(n&&typeof n=="object")return w2(n)}catch{}return t}if(e&&typeof e=="object"){const t=e;return[t.url,t.src,t.path].find(r=>typeof r=="string"&&r.trim().length>0)?.trim()??null}return null}function jy(e){return typeof e=="string"?e.replaceAll(/<[^>]*>/g," ").replaceAll(/\s+/g," ").trim():typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(t=>jy(t)).join(" ").trim():e&&typeof e=="object"?Object.values(e).map(t=>jy(t)).join(" ").trim():""}function bje(e,t=50){const n=jy(e);return n?n.length<=t?n:`${n.slice(0,t).trimEnd()}…`:""}function vje(e){if(e==null||e==="")return"";const t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleDateString("it-IT",{year:"numeric",month:"short",day:"numeric"})}function yje(e,t){const n=e.status?.trim()||"—",r=t.tagsBranch?wm(e.data[t.tagsBranch.alias]):[],s=t.coverBranch?w2(e.data[t.coverBranch.alias]):null,i=t.titleBranch?jy(e.data[t.titleBranch.alias]):"",o=t.excerptBranch?bje(e.data[t.excerptBranch.alias],90):"",a=t.dateBranch?vje(e.data[t.dateBranch.alias]):"",l=i?`Apri dettaglio: ${i}`:`Apri dettaglio entry ${e.id}`;return{entryId:e.id,status:n,tags:r,imageUrl:s,title:i,excerpt:o,dateText:a,ariaLabel:l,statusVariant:gje(n)}}function xje(e,t){return t.some(n=>e.includes(n))}function RW(e){const t=e.branches,n=t.find(a=>{if(a.type!=="file")return!1;const l=a.alias.trim().toLowerCase();return xje(l,["cover","image","foto","photo"])})??null,r=t.find(a=>{const l=a.alias.trim().toLowerCase();return l==="title"||l==="name"})??null,s=t.find(a=>a.type!=="richtext"&&a.type!=="text"?!1:r?a.alias!==r.alias:!0)??null,i=t.find(a=>a.type==="date")??null,o=t.find(a=>a.type!=="json"?!1:a.alias.toLowerCase().includes("tag"))??null;return{coverBranch:n,titleBranch:r,excerptBranch:s,dateBranch:i,tagsBranch:o}}function wje(e,t){const n=e.branches.find(r=>{const s=r.alias.toLowerCase();return s==="title"||s==="name"});if(n){const r=t.data[n.alias];if(typeof r=="string"&&r.trim().length>0)return r.trim()}return t.slug?.trim()||t.id}const MD=4;function Sje({tags:e,className:t}){const[n,r]=w.useState(!1);if(e.length===0)return null;const s=e.length>MD;return h.jsxs("div",{className:ee("space-y-1.5",t),children:[h.jsx("p",{className:"text-muted-foreground text-[11px] font-medium tracking-wide uppercase",children:"Tag"}),h.jsx(wy,{tags:e,maxVisible:MD,expanded:n,onExpandedChange:r,enableToggle:!0,showCollapseBadge:!1,className:"min-w-0 gap-1.5",chipClassName:"min-w-0 max-w-[12rem] truncate font-normal",renderMoreTrigger:(i,o)=>h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"h-6 rounded-full px-2.5 text-xs",onClick:o,children:["+",i," altri"]})}),s&&n&&h.jsx(He,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>r(!1),children:"Mostra meno"})]})}function Cje(e){return e.replaceAll(/<[^>]*>/g,"").replaceAll(" "," ").trim().length===0}function kje({value:e,className:t}){const n=rq(e);return Cje(n)?h.jsx("div",{className:"text-muted-foreground text-sm",children:"—"}):h.jsx("div",{className:ee("richtext-content rounded-md bg-transparent text-sm leading-relaxed","[&_table]:w-full [&_table]:border-collapse [&_table]:text-sm","[&_th]:border [&_td]:border [&_th]:border-border [&_td]:border-border [&_th]:bg-muted/40 [&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1","[&_p]:mb-2 [&_a]:text-primary [&_a]:underline",t),dangerouslySetInnerHTML:{__html:n}})}function Eje(e){const t=e.toLowerCase().trim();return t==="published"?"bg-emerald-50 text-emerald-700 border-emerald-200/80 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-800/60":t==="draft"?"bg-amber-50 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60":["error","failed","rejected","archived"].includes(t)?"bg-red-50 text-red-700 border-red-200/80 dark:bg-red-500/10 dark:text-red-400 dark:border-red-800/60":"bg-neutral-100 text-neutral-600 border-neutral-200/80 dark:bg-neutral-800 dark:text-neutral-400"}function TD({branch:e,entry:t}){const n=e.type==="file"?w2(t.data[e.alias]):null;return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("h4",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e.label}),n?h.jsx("div",{className:"overflow-hidden rounded-xl border bg-muted/20",children:h.jsx("img",{src:n,alt:e.label,className:"h-auto max-h-[60vh] w-full object-contain"})}):h.jsx(_W,{branch:e,value:t.data[e.alias]})]})}function Nje({seed:e,entry:t,open:n,onClose:r,onEdit:s}){const{tagsBranch:i,seoBranches:o,mainBranches:a}=w.useMemo(()=>pje(e),[e]),{richtextBranch:l,otherMainBranches:u}=w.useMemo(()=>mje(a),[a]),f=w.useMemo(()=>RW(e),[e]);if(!t)return null;const p=wje(e,t),g=i?wm(t.data[i.alias]):[],b=o.length>0,y=a.length===0&&o.length>0?"seo":"content",x=f.coverBranch?w2(t.data[f.coverBranch.alias]):null,S=!!x,k=S?"h-[min(52vh,520px)] min-h-0":"h-[min(62vh,620px)] min-h-0",N=h.jsx(Gl,{className:"h-full px-6 py-4",children:h.jsxs("div",{className:"space-y-5 pr-3",children:[l&&h.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx("div",{className:"border-b border-neutral-200/80 bg-neutral-50/80 px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:border-neutral-700/50 dark:bg-neutral-800/40",children:"Contenuto principale"}),h.jsx("div",{className:"px-4 py-4",children:h.jsx(kje,{value:t.data[l.alias],className:"border-0 shadow-none"},t.id)})]}),u.length>0&&h.jsxs("div",{className:"space-y-5 px-1",children:[!l&&h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Contenuto"}),u.map((R,_)=>h.jsxs(w.Fragment,{children:[h.jsx(TD,{branch:R,entry:t}),_<u.length-1&&h.jsx(Hi,{})]},R.alias))]}),!l&&u.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Nessun campo contenuto."})]})}),T=h.jsx(Gl,{className:"h-full px-6 py-4",children:h.jsx("div",{className:"space-y-4 pr-3",children:h.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx("div",{className:"border-b border-neutral-200/80 bg-neutral-50/80 px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground dark:border-neutral-700/50 dark:bg-neutral-800/40",children:"Metadati / SEO"}),h.jsx("div",{className:"space-y-5 px-4 py-4",children:o.map((R,_)=>h.jsxs(w.Fragment,{children:[h.jsx(TD,{branch:R,entry:t}),_<o.length-1&&h.jsx(Hi,{})]},R.alias))})]})})});return h.jsx(Ph,{open:n,onOpenChange:R=>{R||r()},children:h.jsxs($h,{showCloseButton:!0,className:"flex max-h-[min(92vh,920px)] w-full max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl","aria-describedby":void 0,children:[S&&h.jsxs("div",{className:"relative h-[200px] w-full shrink-0 overflow-hidden",children:[h.jsx("img",{src:x,alt:p||"Copertina",className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-background/80 via-background/20 to-transparent"})]}),h.jsx(ym,{className:ee("shrink-0 space-y-0 px-6 pb-4 text-left",S?"pt-3":"pt-6"),children:h.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[h.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[h.jsx(xm,{className:"text-left text-xl font-semibold leading-snug",children:p}),h.jsx(Sje,{tags:g}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-medium",children:"Stato"}),h.jsx(_i,{variant:"outline",className:ee("text-[11px] font-medium",Eje(t.status?.trim()||"")),children:t.status?.trim()||"—"})]}),t.slug!=null&&String(t.slug).trim()!==""&&h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,className:"text-border",children:"·"}),h.jsxs("span",{className:"break-all font-mono text-[11px]",children:["/",String(t.slug).trim()]})]})]})]}),h.jsxs(He,{type:"button",variant:"default",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>s(t.id),children:[h.jsx(oj,{className:"size-3.5"}),"Modifica"]})]})}),h.jsx(Hi,{}),b?h.jsxs(cje,{defaultValue:y,className:"flex min-h-0 flex-1 flex-col gap-0",children:[h.jsx("div",{className:"shrink-0 border-b bg-neutral-50/80 px-6 dark:bg-neutral-800/30",children:h.jsxs(dje,{variant:"line",className:"h-10 w-full justify-start gap-1 bg-transparent p-0",children:[h.jsx(kD,{value:"content",className:"text-sm",children:"Contenuto"}),h.jsx(kD,{value:"seo",className:"text-sm",children:"SEO"})]})}),h.jsx(ED,{value:"content",className:ee("mt-0 overflow-hidden",k),children:N}),h.jsx(ED,{value:"seo",className:ee("mt-0 overflow-hidden",k),children:T})]}):h.jsx("div",{className:ee("overflow-hidden",k),children:N})]})})}const Mje=["gallery-skeleton-1","gallery-skeleton-2","gallery-skeleton-3","gallery-skeleton-4","gallery-skeleton-5","gallery-skeleton-6","gallery-skeleton-7","gallery-skeleton-8"];function Tje(){return h.jsx("div",{className:"grid gap-5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 420px))"},children:Mje.map(e=>h.jsxs("div",{className:"flex h-[340px] flex-col overflow-hidden rounded-2xl border border-neutral-200/80 dark:border-neutral-700/50",children:[h.jsx(yr,{className:"min-h-0 flex-1 rounded-none"}),h.jsxs("div",{className:"w-full shrink-0 rounded-t-2xl bg-white px-4 py-3 shadow-[0_-6px_20px_0_rgb(0,0,0,0.07)] dark:bg-neutral-900 dark:shadow-[0_-6px_20px_0_rgb(0,0,0,0.30)]",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[h.jsx(yr,{className:"h-5 w-20 rounded-full"}),h.jsx(yr,{className:"h-5 w-14 rounded-full"})]}),h.jsx(yr,{className:"h-4 w-10/12"}),h.jsx(yr,{className:"mt-1 h-3 w-7/12"}),h.jsx(yr,{className:"mt-2 h-3 w-4/12"})]})]},e))})}function _je(e,t){const[n,r]=w.useState(null),s=w.useMemo(()=>t.find(a=>a.id===n)??null,[t,n]);w.useEffect(()=>{n&&(t.some(a=>a.id===n)||r(null))},[t,n]);const i=w.useMemo(()=>RW(e),[e]),o=w.useMemo(()=>t.map(a=>yje(a,i)),[t,i]);return{peekId:n,setPeekId:r,peekEntry:s,cardModels:o}}function Rje({seed:e,data:t,isLoading:n=!1,onEdit:r}){const{setPeekId:s,peekEntry:i,cardModels:o}=_je(e,t);return n?h.jsx(Tje,{}):t.length===0?h.jsx(uq,{className:"border",children:h.jsxs(dq,{children:[h.jsx(fq,{variant:"icon",children:h.jsx(Tm,{className:"size-5"})}),h.jsx(hq,{children:"Nessun elemento da visualizzare"}),h.jsx(pq,{children:"Non ci sono contenuti disponibili per questa vista galleria."})]})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"grid gap-5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 420px))"},children:o.map(a=>h.jsx(h7e,{model:a,onOpen:s},a.entryId))}),h.jsx(Nje,{seed:e,entry:i,open:i!=null,onClose:()=>s(null),onEdit:r})]})}function Aje({open:e,onOpenChange:t,isActive:n,onOpen:r,searchTerm:s,onSearchTermChange:i,visibleFilterColumns:o,activeFiltersCountByColumn:a,onSelectColumn:l}){const{t:u}=kt();return h.jsxs(Ao,{open:e,onOpenChange:f=>{t?.(f),f&&r?.(),f||i("")},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:n?"secondary":"ghost",size:"icon-sm","aria-label":u("toolbar.filter.tooltip"),children:h.jsx(JD,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:u("toolbar.filter.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:u("toolbar.filter.label")}),h.jsx(pn,{placeholder:u("toolbar.filter.searchPlaceholder"),value:s,onChange:f=>i(f.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:o.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:u("toolbar.filter.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:o.map(f=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>l(f.columnId),children:[h.jsx("span",{className:"truncate",children:f.label}),a[f.columnId]?h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:a[f.columnId]}):null]},f.columnId))})})]})]})}function Oje({searchTerm:e,onSearchTermChange:t,filteredSortableColumns:n,sortState:r,onToggleDirection:s,onSelectColumn:i,isActive:o,onOpen:a}){const{t:l}=kt();return h.jsxs(Ao,{onOpenChange:u=>{u||t(""),u&&a?.()},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:o?"secondary":"ghost",size:"icon-sm","aria-label":l("toolbar.sort.tooltip"),children:h.jsx(bh,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:l("toolbar.sort.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:l("toolbar.sort.label")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(pn,{placeholder:l("toolbar.sort.searchPlaceholder"),value:e,onChange:u=>t(u.target.value),className:"h-8 flex-1 text-sm"}),h.jsx(He,{type:"button",variant:"outline",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":l("toolbar.sort.invertOrder"),onClick:s,disabled:!r?.columnId,children:h.jsx(bh,{className:"size-3.5"})})]}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:n.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:l("toolbar.sort.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:n.map(u=>{const f=r?.columnId===u.alias;return h.jsxs(He,{type:"button",variant:f?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>i(u.alias),children:[h.jsx("span",{className:"truncate",children:u.label}),f&&h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:r?.desc?"DESC":"ASC"})]},u.alias)})})})]})]})}function AW({type:e,value:t,onChange:n,selectOptions:r=[],availableTags:s=[],className:i="h-8 flex-1",textClassName:o="text-xs",buttonPlaceholder:a}){const{t:l}=kt(),u=l("toolbar.conditionInput.value"),f=a??l("toolbar.conditionInput.choose");switch(e){case"number":return h.jsx(pn,{type:"number",value:typeof t=="number"?String(t):"",onChange:p=>{const g=p.target.value;n(g.trim()===""?null:Number(g))},className:`${i} ${o}`.trim(),placeholder:u});case"date":return h.jsx(pn,{type:"date",value:typeof t=="string"?t:"",onChange:p=>n(p.target.value||null),className:`${i} ${o}`.trim()});case"boolean":{let p="";t===!0?p="true":t===!1&&(p="false");const g=b=>n(b==="true"?!0:b==="false"?!1:null);return h.jsxs(Ul,{value:p,onValueChange:g,children:[h.jsx(Vl,{size:"sm",className:`${i} ${o}`.trim(),children:h.jsx(hu,{placeholder:u})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"true",children:l("toolbar.conditionInput.true")}),h.jsx(Eo,{value:"false",children:l("toolbar.conditionInput.false")})]})]})}case"select":return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:`${i} justify-between ${o}`.trim(),children:[h.jsx("span",{className:"truncate",children:typeof t=="string"&&t?t:f}),h.jsx(bh,{className:"size-3.5 opacity-60"})]})}),h.jsx(Do,{align:"end",className:"w-48 p-1",children:r.map(p=>h.jsx(He,{type:"button",variant:t===p?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-start px-2 text-xs",onClick:()=>n(p),children:p},p))})]});case"tags":return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:`${i} justify-between ${o}`.trim(),children:[h.jsx("span",{className:"truncate",children:typeof t=="string"&&t?t:l("toolbar.conditionInput.tag")}),h.jsx(bh,{className:"size-3.5 opacity-60"})]})}),h.jsx(Do,{align:"end",className:"max-h-56 w-56 overflow-y-auto p-1",children:s.map(p=>h.jsx(He,{type:"button",variant:t===p?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-start px-2 text-xs",onClick:()=>n(p),children:p},p))})]});default:return h.jsx(pn,{value:typeof t=="string"?t:"",onChange:p=>n(p.target.value||null),className:`${i} ${o}`.trim(),placeholder:u})}}const Dje=["filter","sort","automation","search","settings","create"],jje=[{value:"success",label:"Successo"},{value:"warning",label:"Attenzione"},{value:"danger",label:"Critico"},{value:"info",label:"Info"},{value:"neutral",label:"Neutro"}];function Ije(e){return e==="cell"?"cell":"row"}function zje(e){return Array.isArray(e)?e.filter(t=>t==="bold"||t==="italic"||t==="underline"):[]}function Lje(e){switch(e){case"success":return"bg-emerald-500/70";case"warning":return"bg-amber-500/70";case"danger":return"bg-destructive/70";case"info":return"bg-sky-500/70";default:return"bg-muted-foreground/40"}}function Zb(){return`${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function OW(e){return e!=="is_empty"&&e!=="is_not_empty"}function DW(e,t){const n=[{value:"eq",label:t("toolbar.operators.eq")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}];return e==="number"||e==="date"?[{value:"gt",label:t("toolbar.operators.gt")},{value:"lt",label:t("toolbar.operators.lt")},{value:"gte",label:t("toolbar.operators.gte")},{value:"lte",label:t("toolbar.operators.lte")},...n]:e==="tags"?[{value:"contains",label:t("toolbar.operators.contains")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}]:e==="select"?[{value:"eq",label:t("toolbar.operators.eq")},{value:"is_not_empty",label:t("toolbar.operators.is_not_empty")},{value:"is_empty",label:t("toolbar.operators.is_empty")}]:e==="text"||e==="system"?[{value:"contains",label:t("toolbar.operators.contains")},...n]:n}function Pje(e,t=[],n="Stato"){const r=[],s=t.length>0&&t.length<=8?"recommended":"other";r.push({columnId:"status",label:n,section:s});for(const i of e.branches)i.type==="boolean"?r.push({columnId:i.alias,label:i.label,section:"recommended",branchType:"boolean"}):i.type==="date"?r.push({columnId:i.alias,label:i.label,section:"recommended",branchType:"date"}):i.type==="text"&&i.options&&i.options.length>0?r.push({columnId:i.alias,label:i.label,section:"recommended"}):i.type==="text"?r.push({columnId:i.alias,label:i.label,section:"other"}):i.type==="number"&&r.push({columnId:i.alias,label:i.label,section:"other"});return r}function $je({filters:e,openPillId:t,onOpenPillChange:n,groupBy:r,activeGroupLabel:s,onGroupByChange:i,addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u,availableTagsByColumnId:f}){const{t:p}=kt();return h.jsxs("div",{className:"mb-2 flex min-h-9 flex-wrap items-center gap-2",children:[r&&h.jsxs(He,{variant:"outline",size:"sm",className:"h-8 rounded-full px-3 text-xs",onClick:()=>i?.(null),children:[h.jsx(IQ,{className:"size-3.5"}),p("toolbar.filterPills.groupedBy",{label:s}),h.jsx(ja,{className:"size-3.5 opacity-70"})]}),Object.entries(e).map(([g,b])=>h.jsx(Bje,{group:b,isOpen:t===g,onOpenChange:y=>n(y?g:null),addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u,availableTagsByColumnId:f},g))]})}function Bje({group:e,isOpen:t,onOpenChange:n,addConditionToColumn:r,removeColumnFilters:s,updateCondition:i,removeCondition:o,availableTagsByColumnId:a}){const{t:l}=kt();return h.jsxs(Ao,{open:t,onOpenChange:n,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{variant:"secondary",size:"sm",className:"h-8 rounded-full px-3 text-xs","aria-label":l("toolbar.filter.ariaLabel",{label:e.label}),children:[h.jsx("span",{className:"truncate",children:e.label}),h.jsx("span",{className:"opacity-70",children:e.conditions.length})]})}),h.jsxs(Do,{align:"start",className:"w-[420px] p-2",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[h.jsx(ks,{className:"px-0 py-0 text-xs font-medium text-muted-foreground",children:l("toolbar.filter.filtersOn",{label:e.label})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7","aria-label":l("toolbar.filter.removeColumn"),onClick:()=>s(e.columnId),children:h.jsx(Hh,{className:"size-3.5"})})]}),h.jsxs("div",{className:"space-y-2",children:[e.conditions.map(u=>{const f=DW(e.type,l),p=OW(u.op);return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ul,{value:u.op,onValueChange:g=>i(e.columnId,u.id,{op:g,value:g==="is_empty"||g==="is_not_empty"?null:u.value}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-40 text-xs",children:h.jsx(hu,{placeholder:l("toolbar.filter.operator")})}),h.jsx(ql,{children:f.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]}),p?h.jsx(AW,{type:e.type,value:u.value,onChange:g=>i(e.columnId,u.id,{value:g}),selectOptions:e.selectOptions,availableTags:a[e.columnId]??[],className:"h-8 flex-1",textClassName:"text-sm"}):h.jsx("div",{className:"h-8 flex-1"}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":l("toolbar.filter.removeCondition"),onClick:()=>o(e.columnId,u.id),children:h.jsx(ja,{className:"size-3.5"})})]},u.id)}),h.jsx(ri,{}),h.jsx("div",{className:"flex justify-center",children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>r(e.columnId),children:[h.jsx(Kl,{className:"size-4"}),l("toolbar.filter.addFilter")]})})]})]})]})}const Fje={table:cj,gallery:Jb,grid:Jb,kanban:OQ,chart:qD};function Hje({views:e,activeViewId:t,onChangeView:n,onCreateView:r}){const{t:s}=kt();return h.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[h.jsx(h2,{type:"single",value:t,onValueChange:i=>i&&n(i),variant:"outline",size:"sm",className:"gap-0",children:e.map(i=>{const o=Fje[i.type];return h.jsxs(bd,{value:i.id,"aria-label":i.label,className:"h-8 gap-1.5 px-2.5",children:[o&&h.jsx(o,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate max-w-24",children:i.label})]},i.id)})}),h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":s("toolbar.viewSwitcher.addView"),onClick:()=>r?.(),children:h.jsx(Kl,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:s("toolbar.viewSwitcher.addView")})]})]})}function Uje({isSearchOpen:e,searchValue:t,searchInputRef:n,handleSearchSubmit:r,onSearchChange:s,handleSearchBlur:i,handleSearchClose:o,handleSearchOpen:a}){const{t:l}=kt();return h.jsx("div",{className:"overflow-hidden rounded-md border border-input bg-transparent transition-[width] duration-200 ease-out",style:{width:e?192:32},children:e?h.jsxs("form",{onSubmit:r,className:"relative flex min-w-[192px] items-center",children:[h.jsx(DS,{className:"text-muted-foreground pointer-events-none absolute left-2.5 size-4 shrink-0"}),h.jsx(pn,{ref:n,type:"search",placeholder:l("toolbar.search.placeholder"),value:t,onChange:u=>s?.(u.target.value),onBlur:i,className:"h-8 w-full border-0 bg-transparent pl-8 pr-8 focus-visible:ring-0 focus-visible:ring-offset-0","aria-label":l("toolbar.search.ariaLabel")}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"absolute right-1 h-6 w-6 shrink-0","aria-label":l("toolbar.search.close"),onClick:o,children:h.jsx(ja,{className:"size-3.5"})})]}):h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":l("toolbar.search.ariaLabel"),onClick:a,children:h.jsx(DS,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:l("toolbar.search.open")})]})})}function jW(e=[]){const t=[];return e.includes("bold")&&t.push("font-bold"),e.includes("italic")&&t.push("italic"),e.includes("underline")&&t.push("underline"),t.join(" ")}function IW(e,t=[]){const n=jW(t);switch(e){case"success":return`bg-emerald-500/12 hover:bg-emerald-500/16 ${n}`.trim();case"warning":return`bg-amber-500/12 hover:bg-amber-500/16 ${n}`.trim();case"danger":return`bg-destructive/12 hover:bg-destructive/16 ${n}`.trim();case"info":return`bg-sky-500/12 hover:bg-sky-500/16 ${n}`.trim();default:return`bg-muted/35 hover:bg-muted/45 ${n}`.trim()}}function zW(e,t=[]){const n=jW(t),r="[&_[data-slot=badge]]:!text-inherit [&_[data-slot=badge]]:!bg-transparent [&_[data-slot=badge]]:!border-current";switch(e){case"success":return`font-medium text-emerald-700 dark:text-emerald-300 ${n} ${r}`.trim();case"warning":return`font-medium text-amber-800 dark:text-amber-200 ${n} ${r}`.trim();case"danger":return`font-medium text-destructive ${n} ${r}`.trim();case"info":return`font-medium text-sky-800 dark:text-sky-200 ${n} ${r}`.trim();default:return`font-medium ${n} ${r}`.trim()}}function Vje({formattableColumns:e,addConditionalFormatRule:t}){const{t:n}=kt();return h.jsxs("div",{className:"flex min-h-52 flex-col items-center justify-center gap-3 rounded-md border border-dashed",children:[h.jsx("div",{className:"text-sm text-muted-foreground",children:n("toolbar.conditionalFormats.noRules")}),h.jsx(LW,{columns:e,onSelect:t,compact:!0})]})}function qje({conditionalFormats:e,setActiveConditionalRuleId:t,setIsConditionalEditorOpen:n}){return h.jsx("div",{className:"space-y-2",children:e.map((r,s)=>h.jsxs("button",{type:"button",className:"flex h-14 w-full overflow-hidden rounded-md border text-left transition-colors hover:bg-muted/40",onClick:()=>{t(r.id),n(!0)},children:[h.jsx("div",{className:`w-1/3 ${Lje(r.tone)}`}),h.jsxs("div",{className:"flex flex-1 items-center justify-between px-3",children:[h.jsx("span",{className:"truncate text-sm",children:r.label||r.group.label}),h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["#",s+1]})]})]},r.id))})}function Gje({activeConditionalRule:e,conditionalFormats:t,updateConditionalRule:n,moveConditionalRule:r,removeConditionalRule:s,updateConditionalCondition:i,addConditionalCondition:o,removeConditionalCondition:a,updateConditionalTextStyles:l,setIsConditionalEditorOpen:u,availableTagsByColumnId:f}){const{t:p}=kt();return h.jsxs("div",{className:"space-y-2 max-h-[460px] overflow-y-auto pr-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(He,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>u(!1),children:p("toolbar.conditionalFormats.rulesList")}),h.jsx("span",{className:"text-[11px] text-muted-foreground",children:p("toolbar.conditionalFormats.editRule")})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(gq,{pressed:e.enabled,onPressedChange:g=>n(e.id,{enabled:g}),variant:"outline",size:"sm","aria-label":p("toolbar.conditionalFormats.toggleRule"),className:"h-7 w-7 px-0",children:e.enabled?h.jsx(yh,{className:"size-3.5"}):h.jsx(vh,{className:"size-3.5"})}),h.jsx(pn,{value:e.label??"",onChange:g=>n(e.id,{label:g.target.value}),className:"h-7 text-xs",placeholder:p("toolbar.conditionalFormats.ruleName")}),h.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7",onClick:()=>r(e.id,-1),disabled:t.findIndex(g=>g.id===e.id)===0,"aria-label":p("toolbar.conditionalFormats.moveUp"),children:h.jsx(WD,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7",onClick:()=>r(e.id,1),disabled:t.findIndex(g=>g.id===e.id)===t.length-1,"aria-label":p("toolbar.conditionalFormats.moveDown"),children:h.jsx(Mm,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>s(e.id),"aria-label":p("toolbar.conditionalFormats.deleteRule"),children:h.jsx(Hh,{className:"size-3.5"})})]})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.applyTo")}),h.jsxs("div",{className:"inline-flex rounded-md border p-0.5",children:[h.jsx(He,{type:"button",size:"sm",variant:"ghost",className:e.target==="cell"?"h-7 px-3 text-xs bg-black text-white hover:bg-black/90 hover:text-white":"h-7 px-3 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>n(e.id,{target:"cell"}),children:p("toolbar.conditionalFormats.cell")}),h.jsx(He,{type:"button",size:"sm",variant:"ghost",className:e.target==="row"?"h-7 px-3 text-xs bg-black text-white hover:bg-black/90 hover:text-white":"h-7 px-3 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>n(e.id,{target:"row"}),children:p("toolbar.conditionalFormats.row")})]})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.useColorIf")}),h.jsx("div",{className:"h-8 rounded-md border bg-muted/20 px-2 text-xs flex items-center",children:h.jsx("span",{className:"truncate",children:e.group.label})})]}),h.jsx("div",{className:"flex flex-col gap-2",children:e.group.conditions.map(g=>{const b=DW(e.group.type,p),y=OW(g.op);return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ul,{value:g.op,onValueChange:x=>i(e.id,g.id,{op:x,value:x==="is_empty"||x==="is_not_empty"?null:g.value}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-36 text-xs",children:h.jsx(hu,{placeholder:p("toolbar.conditionalFormats.operator")})}),h.jsx(ql,{children:b.map(x=>h.jsx(Eo,{value:x.value,children:x.label},x.value))})]}),y?h.jsx(AW,{type:e.group.type,value:g.value,onChange:x=>i(e.id,g.id,{value:x}),selectOptions:e.group.selectOptions??[],availableTags:f[e.columnId]??[],className:"h-8 flex-1",textClassName:"text-xs"}):h.jsx("div",{className:"h-8 flex-1"}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":p("toolbar.conditionalFormats.removeCondition"),onClick:()=>a(e.id,g.id),children:h.jsx(ja,{className:"size-3.5"})}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-xs",className:"h-8 w-8","aria-label":p("toolbar.conditionalFormats.addCondition"),onClick:()=>o(e.id),children:h.jsx(Kl,{className:"size-3.5"})})]},g.id)})}),h.jsxs("div",{className:"space-y-1 pt-1",children:[h.jsx("div",{className:"text-xs font-medium",children:p("toolbar.conditionalFormats.formatStyle")}),h.jsxs("div",{className:"rounded-md border border-dashed p-2",children:[h.jsx("div",{className:`flex min-h-12 items-center rounded-md border px-3 ${e.target==="row"?IW(e.tone,e.textStyles??[]):""}`,children:h.jsx("span",{className:e.target==="cell"?zW(e.tone,e.textStyles??[]):"font-medium",children:p("toolbar.conditionalFormats.default")})}),h.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[h.jsxs(Ul,{value:e.tone,onValueChange:g=>n(e.id,{tone:g}),children:[h.jsx(Vl,{size:"sm",className:"h-8 w-40 text-xs",children:h.jsx(hu,{placeholder:p("toolbar.conditionalFormats.colorPreset")})}),h.jsx(ql,{children:jje.map(g=>h.jsx(Eo,{value:g.value,children:g.label},g.value))})]}),h.jsxs(h2,{variant:"outline",type:"multiple",value:e.textStyles??[],onValueChange:g=>l(e.id,g),children:[h.jsx(bd,{value:"bold","aria-label":p("toolbar.conditionalFormats.bold"),children:h.jsx(ZZ,{className:"size-4"})}),h.jsx(bd,{value:"italic","aria-label":p("toolbar.conditionalFormats.italic"),children:h.jsx(EQ,{className:"size-4"})}),h.jsx(bd,{value:"underline","aria-label":p("toolbar.conditionalFormats.underline"),children:h.jsx(uee,{className:"size-4"})})]})]})]})]})]})}function Wje({enabled:e,formattableColumns:t,conditionalFormats:n,activeConditionalRule:r,isConditionalEditorOpen:s,setIsConditionalEditorOpen:i,setActiveConditionalRuleId:o,addConditionalFormatRule:a,updateConditionalRule:l,updateConditionalTextStyles:u,removeConditionalRule:f,moveConditionalRule:p,updateConditionalCondition:g,addConditionalCondition:b,removeConditionalCondition:y,availableTagsByColumnId:x}){const{t:S}=kt();if(!e)return h.jsx("div",{className:"text-sm text-muted-foreground",children:S("toolbar.conditionalFormats.notAvailable")});let k;return s?r?k=h.jsx(Gje,{activeConditionalRule:r,conditionalFormats:n,updateConditionalRule:l,moveConditionalRule:p,removeConditionalRule:f,updateConditionalCondition:g,addConditionalCondition:b,removeConditionalCondition:y,updateConditionalTextStyles:u,setIsConditionalEditorOpen:i,availableTagsByColumnId:x}):k=h.jsx("div",{className:"px-0 py-6 text-center text-sm text-muted-foreground",children:S("toolbar.conditionalFormats.selectRule")}):n.length===0?k=h.jsx(Vje,{formattableColumns:t,addConditionalFormatRule:a}):k=h.jsx(qje,{conditionalFormats:n,setActiveConditionalRuleId:o,setIsConditionalEditorOpen:i}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx(ks,{className:"px-0 py-0 text-sm font-semibold text-foreground",children:"Regole dei colori condizionali"}),h.jsx(LW,{columns:t,onSelect:a})]}),h.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Le regole si applicano dall’alto verso il basso."}),h.jsx(ri,{}),k]})}function LW({columns:e,onSelect:t,compact:n=!1}){const{t:r}=kt();return h.jsxs(Ao,{modal:!1,children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{type:"button",variant:"outline",size:"sm",className:n?"h-8":"h-8 w-8 px-0","aria-label":r("toolbar.conditionalFormats.addRule"),children:[h.jsx(Kl,{className:"size-4"}),n?r("toolbar.conditionalFormats.add"):null]})}),h.jsxs(Do,{align:"end",className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:r("toolbar.conditionalFormats.chooseColumn")}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:e.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:r("toolbar.conditionalFormats.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:e.map(s=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>t(s.columnId),children:[h.jsx("span",{className:"truncate",children:s.label}),h.jsx("span",{className:"text-[10px] text-muted-foreground uppercase",children:s.type})]},s.columnId))})})]})]})}function Kje({isSettingsMenuOpenEffective:e,setIsSettingsMenuOpenState:t,onOpenSettings:n,isSettingsOpen:r,commitViewName:s,setColumnSearchTerm:i,viewNameDraft:o,setViewNameDraft:a,setIsConditionalEditorOpen:l,filterColumnSearchTerm:u,setFilterColumnSearchTerm:f,visibleFilterColumns:p,addConditionToColumn:g,setOpenPillId:b,closeSettingsMenu:y,filters:x,sortColumnSearchTerm:S,setSortColumnSearchTerm:k,handleToggleSortDirection:N,sortState:T,filteredSortableColumns:R,handleSortColumnSelect:_,groupBy:A,onGroupByChange:I,recommendedGroupColumns:j,datePrecisionMode:L,applyDatePrecisionMode:q,otherGroupColumns:ne,onConditionalFormatsChange:re,formattableColumns:oe,conditionalFormats:le,activeConditionalRule:ce,isConditionalEditorOpen:F,setActiveConditionalRuleId:te,addConditionalFormatRule:K,updateConditionalRule:W,updateConditionalTextStyles:V,removeConditionalRule:P,moveConditionalRule:H,updateConditionalCondition:X,addConditionalCondition:de,removeConditionalCondition:fe,availableTagsByColumnId:we,columnVisibility:pe,onColumnVisibilityChange:Re,columnSearchTerm:Ae,filteredTableColumns:Ze,pageSize:nt,onPageSizeChange:at}){const{t:Be}=kt();return h.jsxs(Ao,{open:e,onOpenChange:Ne=>{Ne||(s(),i("")),Ne&&n?.(),r===void 0&&t(Ne)},children:[h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(Oo,{asChild:!0,children:h.jsx(He,{variant:e?"secondary":"ghost",size:"icon-sm","aria-label":Be("toolbar.settings.tooltip"),children:h.jsx(_m,{className:"size-4"})})})}),h.jsx(Va,{side:"top",children:Be("toolbar.settings.tooltip")})]}),h.jsxs(Do,{align:"end",className:"w-64",children:[h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.title")}),h.jsx("div",{className:"px-2 pb-1.5",children:h.jsx(pn,{value:o,onChange:Ne=>a(Ne.target.value),onBlur:()=>s(),onKeyDown:Ne=>{if(Ne.key==="Enter"){Ne.preventDefault(),s();return}Ne.key.length===1&&!Ne.metaKey&&!Ne.ctrlKey&&!Ne.altKey&&Ne.stopPropagation()},className:"h-8 text-sm",placeholder:Be("toolbar.settings.viewName")})})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.quickActions")}),h.jsxs(Bf,{onOpenChange:Ne=>{Ne&&l(!1)},children:[h.jsxs(Ff,{children:[h.jsx(JD,{className:"size-4"}),Be("toolbar.settings.filter")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.filter.label")}),h.jsx(pn,{placeholder:Be("toolbar.filter.searchPlaceholder"),value:u,onChange:Ne=>f(Ne.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:p.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.filter.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:p.map(Ne=>h.jsxs(He,{type:"button",variant:"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>{g(Ne.columnId),f(""),b(Ne.columnId),y()},children:[h.jsx("span",{className:"truncate",children:Ne.label}),x[Ne.columnId]?.conditions?.length?h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:x[Ne.columnId].conditions.length}):null]},Ne.columnId))})})]})})]}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(bh,{className:"size-4"}),Be("toolbar.settings.sort")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.sort.label")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(pn,{placeholder:Be("toolbar.sort.searchPlaceholder"),value:S,onChange:Ne=>k(Ne.target.value),className:"h-8 flex-1 text-sm"}),h.jsx(He,{type:"button",variant:"outline",size:"icon-sm",className:"h-8 w-8 shrink-0","aria-label":Be("toolbar.sort.invertOrder"),onClick:N,disabled:!T?.columnId,children:h.jsx(bh,{className:"size-3.5"})})]}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:R.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.sort.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:R.map(Ne=>{const Jt=T?.columnId===Ne.alias;return h.jsxs(He,{type:"button",variant:Jt?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>_(Ne.alias),children:[h.jsx("span",{className:"truncate",children:Ne.label}),Jt&&h.jsx("span",{className:"text-muted-foreground text-[10px] uppercase",children:T?.desc?"DESC":"ASC"})]},Ne.alias)})})})]})})]})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.layoutStyle")}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(_J,{className:"size-4"}),Be("toolbar.settings.group"),A?"...":"",A&&h.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground uppercase",children:Be("toolbar.settings.active")})]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.groupBy")}),h.jsxs(He,{type:"button",variant:A?"ghost":"secondary",size:"sm",className:"h-8 w-full justify-between px-2 text-xs",onClick:()=>{I?.(null),y()},children:[h.jsx("span",{children:Be("toolbar.settings.noGrouping")}),!A&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),j.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(ri,{className:"my-2"}),h.jsx(ks,{className:"px-0 pb-1 pt-0 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:Be("toolbar.settings.recommended")}),h.jsx("div",{className:"flex flex-col gap-1",children:j.map(Ne=>Ne.branchType==="date"?h.jsxs(Bf,{children:[h.jsxs(Ff,{className:"h-8 w-full rounded-sm px-2 text-xs data-[state=open]:bg-accent",children:[h.jsx("span",{className:"flex-1 truncate text-left",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"mr-2 size-3.5 shrink-0 text-muted-foreground"})]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-48 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.group")}),h.jsxs(F6e,{value:L,onValueChange:Jt=>{const ut=Jt||"monthYear";I?.(Ne.columnId),q(ut),y()},children:[h.jsx(Q5,{value:"day",children:Be("toolbar.settings.day")}),h.jsx(Q5,{value:"year",children:Be("toolbar.settings.year")}),h.jsx(Q5,{value:"monthYear",children:Be("toolbar.settings.month")})]})]})})]},Ne.columnId):h.jsxs(He,{type:"button",variant:A===Ne.columnId?"secondary":"ghost",size:"sm",className:"h-8 w-full justify-between px-2 text-xs",onClick:()=>{I?.(A===Ne.columnId?null:Ne.columnId),y()},children:[h.jsx("span",{className:"truncate",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]},Ne.columnId))})]}),ne.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(ri,{className:"my-2"}),h.jsx(ks,{className:"px-0 pb-1 pt-0 text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:Be("toolbar.settings.otherFields")}),h.jsx("div",{className:"px-0 pb-1 text-[10px] text-muted-foreground/70",children:Be("toolbar.settings.manyGroups")}),h.jsx("div",{className:"flex flex-col gap-1",children:ne.map(Ne=>h.jsx(He,{type:"button",variant:A===Ne.columnId?"secondary":"ghost",size:"sm",className:"h-auto min-h-8 w-full flex-col items-start gap-0 px-2 py-1.5 text-xs",onClick:()=>{I?.(A===Ne.columnId?null:Ne.columnId),y()},children:h.jsxs("div",{className:"flex w-full items-center justify-between",children:[h.jsx("span",{className:"truncate",children:Ne.label}),A===Ne.columnId&&h.jsx(td,{className:"size-3.5 shrink-0 text-muted-foreground"})]})},Ne.columnId))})]})]})})]}),h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(ij,{className:"size-4"}),Be("toolbar.settings.conditionalColors")]}),h.jsx($f,{children:h.jsx(Hf,{className:"w-[620px] p-3",children:h.jsx(Wje,{enabled:!!re,formattableColumns:oe,conditionalFormats:le,activeConditionalRule:ce,isConditionalEditorOpen:F,setIsConditionalEditorOpen:l,setActiveConditionalRuleId:te,addConditionalFormatRule:K,updateConditionalRule:W,updateConditionalTextStyles:V,removeConditionalRule:P,moveConditionalRule:H,updateConditionalCondition:X,addConditionalCondition:de,removeConditionalCondition:fe,availableTagsByColumnId:we})})})]})]}),h.jsx(ri,{}),h.jsxs(_p,{children:[h.jsx(ks,{children:Be("toolbar.settings.table")}),pe&&Re&&h.jsxs(Bf,{children:[h.jsxs(Ff,{children:[h.jsx(yh,{className:"size-4"}),Be("toolbar.settings.visibleColumns")]}),h.jsx($f,{children:h.jsxs(Hf,{className:"w-64 p-2",children:[h.jsx(ks,{className:"px-0 pb-2 pt-0 text-xs font-medium text-muted-foreground",children:Be("toolbar.settings.columnVisibility")}),h.jsx(pn,{placeholder:Be("toolbar.settings.columnSearch"),value:Ae,onChange:Ne=>i(Ne.target.value),className:"h-8 text-sm"}),h.jsx(ri,{className:"my-2"}),h.jsx("div",{className:"max-h-56 overflow-y-auto",children:Ze.length===0?h.jsx("div",{className:"py-2 text-center text-xs text-muted-foreground",children:Be("toolbar.settings.noColumns")}):h.jsx("div",{className:"flex flex-col gap-1 py-1",children:Ze.map(Ne=>{const Jt=pe[Ne.id]??!0;return h.jsxs(He,{type:"button",variant:Jt?"secondary":"ghost",size:"sm",className:"h-8 justify-between px-2 text-xs",onClick:()=>{const ut={...pe,[Ne.id]:!Jt};Re(ut)},children:[h.jsx("span",{className:"truncate",children:Ne.label}),Jt?h.jsx(yh,{className:"size-3.5 shrink-0 text-muted-foreground"}):h.jsx(vh,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},Ne.id)})})})]})})]}),nt!=null&&at&&h.jsxs(Ra,{onSelect:Ne=>Ne.preventDefault(),className:"justify-between gap-4 focus:bg-transparent focus:text-inherit data-[highlighted]:bg-transparent data-[highlighted]:text-inherit cursor-default",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(MJ,{className:"size-4"}),Be("toolbar.settings.rows")]}),h.jsxs("div",{className:"flex h-7 items-stretch",children:[h.jsx(He,{type:"button",variant:"outline",size:"icon-xs",className:"h-7 w-7 rounded-r-none border-r-0","aria-label":Be("toolbar.settings.decreaseRows"),disabled:nt<=1,onClick:Ne=>{Ne.stopPropagation(),at(Math.max(1,nt-1))},children:h.jsx(eJ,{className:"size-3"})}),h.jsx("div",{className:"flex w-9 items-center justify-center border border-input bg-background text-xs tabular-nums",children:nt}),h.jsx(He,{type:"button",variant:"outline",size:"icon-xs",className:"h-7 w-7 rounded-l-none border-l-0","aria-label":Be("toolbar.settings.increaseRows"),disabled:nt>=100,onClick:Ne=>{Ne.stopPropagation(),at(Math.min(100,nt+1))},children:h.jsx(Kl,{className:"size-3"})})]})]})]})]})]})}function Yje({searchValue:e,onSearchChange:t,onSubmitSearch:n}){const[r,s]=w.useState(!1),i=w.useRef(null);w.useEffect(()=>{r&&i.current?.focus()},[r]);const o=()=>s(!0),a=()=>{s(!1),t?.("")};return{isSearchOpen:r,searchInputRef:i,handleSearchOpen:o,handleSearchClose:a,handleSearchSubmit:f=>{f.preventDefault();const p=i.current?.value??e;n?.(p)},handleSearchBlur:()=>{!e&&!i.current?.value&&a()}}}function Zje(){const[e,t]=w.useState(""),[n,r]=w.useState(""),[s,i]=w.useState(""),[o,a]=w.useState(!1),[l,u]=w.useState(null),[f,p]=w.useState(!1);return{sortColumnSearchTerm:e,setSortColumnSearchTerm:t,filterColumnSearchTerm:n,setFilterColumnSearchTerm:r,columnSearchTerm:s,setColumnSearchTerm:i,filterMenuOpen:o,setFilterMenuOpen:a,openPillId:l,setOpenPillId:u,isSettingsMenuOpenState:f,setIsSettingsMenuOpenState:p}}function Xje({activeView:e,onRenameView:t}){const[n,r]=w.useState(e?.label??"");w.useEffect(()=>{r(e?.label??"")},[e?.id,e?.label]);const s=w.useCallback(()=>{if(!e||!t)return;const i=n.trim();!i||i===e.label||t(e.id,i)},[e,t,n]);return{viewNameDraft:n,setViewNameDraft:r,commitViewName:s}}function Qje({seed:e,sortColumnSearchTerm:t,sortState:n,onSortChange:r}){const s=w.useMemo(()=>e.branches.filter(l=>["text","number","date"].includes(l.type)&&l2(l).sort),[e.branches]),i=w.useMemo(()=>{const l=t.trim().toLowerCase();return l?s.filter(u=>u.label.toLowerCase().includes(l)):s},[t,s]);return{sortableBranches:s,filteredSortableColumns:i,handleToggleSortDirection:()=>{!r||!n?.columnId||r({columnId:n.columnId,desc:!n.desc})},handleSortColumnSelect:l=>{if(!r)return;if(n?.columnId===l){r({columnId:null,desc:!0});return}const f=n?.columnId==null?!0:n.desc;r({columnId:l,desc:f})}}}function Jje({seed:e,availableStatusOptions:t,groupBy:n,dateGroupPrecision:r,onDateGroupPrecisionChange:s}){const{t:i}=kt(),o=w.useMemo(()=>Pje(e,t,i("content.table.status")),[t,e,i]),a=w.useMemo(()=>o.filter(g=>g.section==="recommended"),[o]),l=w.useMemo(()=>o.filter(g=>g.section==="other"),[o]),u=w.useMemo(()=>n?o.find(g=>g.columnId===n)?.label??n:null,[n,o]),f=w.useMemo(()=>r.day?"day":r.year&&r.month?"monthYear":r.year&&!r.month?"year":"monthYear",[r.day,r.month,r.year]),p=w.useCallback(g=>{if(s){if(g==="day"){s({year:!1,month:!1,day:!0});return}if(g==="year"){s({year:!0,month:!1,day:!1});return}s({year:!0,month:!0,day:!1})}},[s]);return{groupableColumns:o,recommendedGroupColumns:a,otherGroupColumns:l,activeGroupLabel:u,datePrecisionMode:f,applyDatePrecisionMode:p}}function eIe({seed:e,filters:t,onFiltersChange:n,availableStatusOptions:r=[]}){const s=w.useMemo(()=>{const f=[{columnId:"slug",label:"Slug",type:"system"},{columnId:"status",label:"Stato",type:"select",selectOptions:r}];for(const p of e.branches){if(!l2(p).filter)continue;const g=p.alias;p.type==="number"?f.push({columnId:g,label:p.label,type:"number"}):p.type==="date"?f.push({columnId:g,label:p.label,type:"date"}):p.type==="boolean"?f.push({columnId:g,label:p.label,type:"boolean"}):p.type==="json"&&g.toLowerCase().includes("tag")?f.push({columnId:g,label:p.label,type:"tags"}):f.push({columnId:g,label:p.label,type:"text"})}return f},[r,e.branches]),i=w.useMemo(()=>{const f=new Set(["select","number","date","boolean","tags"]);return s.filter(p=>f.has(p.type))},[s]),o=w.useCallback(f=>{const p=s.find(S=>S.columnId===f);if(!p||!n)return;const g=t[f],b=p.type==="tags"?"contains":"eq",y={id:Zb(),op:b,value:null},x={...t,[f]:g?{...g,conditions:[...g.conditions,y]}:{columnId:f,label:p.label,type:p.type,selectOptions:p.selectOptions,conditions:[y]}};n(x)},[s,t,n]),a=w.useCallback(f=>{if(!n||!t[f])return;const p={...t};delete p[f],n(p)},[t,n]),l=w.useCallback((f,p,g)=>{if(!n)return;const b=t[f];if(!b)return;const y=b.conditions.map(x=>x.id===p?{...x,...g}:x);n({...t,[f]:{...b,conditions:y}})},[t,n]),u=w.useCallback((f,p)=>{if(!n)return;const g=t[f];if(!g)return;const b=g.conditions.filter(y=>y.id!==p);if(b.length===0){const y={...t};delete y[f],n(y);return}n({...t,[f]:{...g,conditions:b}})},[t,n]);return{filterableColumns:s,formattableColumns:i,addConditionToColumn:o,removeColumnFilters:a,updateCondition:l,removeCondition:u}}function tIe({viewId:e,conditionalFormatsInput:t,formattableColumns:n,onConditionalFormatsChange:r}){const[s,i]=w.useState(null),[o,a]=w.useState(!1),l=w.useCallback(R=>R.map(_=>({..._,target:Ije(_.target),textStyles:zje(_.textStyles)})).slice().sort((_,A)=>(_.priority??0)-(A.priority??0)),[]),u=w.useMemo(()=>l(t??[]),[t,l]);w.useEffect(()=>{if(u.length===0){i(null),a(!1);return}(!s||!u.some(R=>R.id===s))&&i(u[0].id)},[s,u]);const f=w.useMemo(()=>s?u.find(R=>R.id===s)??u[0]??null:u[0]??null,[s,u]),p=w.useCallback(R=>{!e||!r||r(e,R)},[r,e]),g=w.useCallback(R=>{const _=n.find(L=>L.columnId===R);if(!_)return;const A=Zb(),I=_.type==="tags"?"contains":"eq",j={id:A,enabled:!0,priority:u.length,label:_.label,columnId:R,group:{columnId:R,label:_.label,type:_.type,selectOptions:_.selectOptions,conditions:[{id:Zb(),op:I,value:null}]},tone:"warning",target:"row",textStyles:[]};p([...u,j]),i(A),a(!0)},[p,u,n]),b=w.useCallback((R,_)=>{const A=u.map(I=>I.id===R?{...I,..._}:I);p(A)},[p,u]),y=w.useCallback((R,_)=>{b(R,{textStyles:_.filter(A=>A==="bold"||A==="italic"||A==="underline")})},[b]),x=w.useCallback(R=>{const _=u.filter(A=>A.id!==R).map((A,I)=>({...A,priority:I}));p(_)},[p,u]),S=w.useCallback((R,_)=>{const A=u.findIndex(q=>q.id===R);if(A<0)return;const I=A+_;if(I<0||I>=u.length)return;const j=u.slice(),[L]=j.splice(A,1);j.splice(I,0,L),p(j.map((q,ne)=>({...q,priority:ne})))},[p,u]),k=w.useCallback((R,_,A)=>{const I=u.map(j=>{if(j.id!==R)return j;const L=j.group.conditions.map(q=>q.id===_?{...q,...A}:q);return{...j,group:{...j.group,conditions:L}}});p(I)},[p,u]),N=w.useCallback(R=>{const _=u.find(j=>j.id===R);if(!_)return;const A=_.group.type==="tags"?"contains":"eq",I=u.map(j=>j.id===R?{...j,group:{...j.group,conditions:[...j.group.conditions,{id:Zb(),op:A,value:null}]}}:j);p(I)},[p,u]),T=w.useCallback((R,_)=>{const A=u.map(I=>{if(I.id!==R)return I;const j=I.group.conditions.filter(L=>L.id!==_);return{...I,group:{...I.group,conditions:j}}}).filter(I=>I.group.conditions.length>0).map((I,j)=>({...I,priority:j}));p(A)},[p,u]);return{conditionalFormats:u,activeConditionalRule:f,activeConditionalRuleId:s,isConditionalEditorOpen:o,setActiveConditionalRuleId:i,setIsConditionalEditorOpen:a,addConditionalFormatRule:g,updateConditionalRule:b,updateConditionalTextStyles:y,removeConditionalRule:x,moveConditionalRule:S,updateConditionalCondition:k,addConditionalCondition:N,removeConditionalCondition:T}}function nIe({seed:e,views:t,activeViewId:n,onRenameView:r,isFilterActive:s,isSortActive:i,isAutomationActive:o,isSettingsOpen:a,searchValue:l="",onSearchChange:u,onSubmitSearch:f,sortState:p,onSortChange:g,filters:b={},onFiltersChange:y,availableStatusOptions:x=[],groupBy:S=null,dateGroupPrecision:k={year:!0,month:!0,day:!1},onDateGroupPrecisionChange:N,onConditionalFormatsChange:T}){const R=t.find(Nt=>Nt.id===n),{isSearchOpen:_,searchInputRef:A,handleSearchOpen:I,handleSearchClose:j,handleSearchSubmit:L,handleSearchBlur:q}=Yje({searchValue:l,onSearchChange:u,onSubmitSearch:f}),{sortColumnSearchTerm:ne,setSortColumnSearchTerm:re,filterColumnSearchTerm:oe,setFilterColumnSearchTerm:le,columnSearchTerm:ce,setColumnSearchTerm:F,filterMenuOpen:te,setFilterMenuOpen:K,openPillId:W,setOpenPillId:V,isSettingsMenuOpenState:P,setIsSettingsMenuOpenState:H}=Zje(),{viewNameDraft:X,setViewNameDraft:de,commitViewName:fe}=Xje({activeView:R,onRenameView:r}),we=w.useMemo(()=>R?.enabledTools??Dje,[R]),pe=s??Object.values(b).some(Nt=>Nt.conditions.length>0),Re=i??!!p?.columnId,Ae=o??!1,Ze=a??P,nt=()=>{a===void 0&&H(!1)},at=Nt=>we.includes(Nt),Be=Qje({seed:e,sortColumnSearchTerm:ne,sortState:p,onSortChange:g}),{filterableColumns:Ne,formattableColumns:Jt,addConditionToColumn:ut,removeColumnFilters:Ut,updateCondition:nn,removeCondition:kn}=eIe({seed:e,filters:b,onFiltersChange:y,availableStatusOptions:x}),Xn=tIe({viewId:R?.id,conditionalFormatsInput:R?.conditionalFormats,formattableColumns:Jt,onConditionalFormatsChange:T}),sr=w.useMemo(()=>[{id:"slug",label:"Slug"},{id:"status",label:"Stato"},...e.branches.map(Nt=>({id:Nt.alias,label:Nt.label}))],[e.branches]),Nn=w.useMemo(()=>{const Nt=oe.trim().toLowerCase();return Nt?Ne.filter($n=>$n.label.toLowerCase().includes(Nt)):Ne},[oe,Ne]),Pn=w.useMemo(()=>Object.fromEntries(Object.entries(b).map(([Nt,$n])=>[Nt,$n.conditions.length])),[b]),Kt=w.useMemo(()=>{const Nt=ce.trim().toLowerCase();return Nt?sr.filter($n=>$n.label.toLowerCase().includes(Nt)):sr},[ce,sr]),bn=Jje({seed:e,availableStatusOptions:x,groupBy:S,dateGroupPrecision:k,onDateGroupPrecisionChange:N});return{activeView:R,enabledTools:we,isFilterActiveEffective:pe,isSortActiveEffective:Re,isAutomationActiveEffective:Ae,isSettingsMenuOpenEffective:Ze,closeSettingsMenu:nt,isToolEnabled:at,isSearchOpen:_,searchInputRef:A,handleSearchOpen:I,handleSearchClose:j,handleSearchSubmit:L,handleSearchBlur:q,sortColumnSearchTerm:ne,setSortColumnSearchTerm:re,filterColumnSearchTerm:oe,setFilterColumnSearchTerm:le,columnSearchTerm:ce,setColumnSearchTerm:F,filterMenuOpen:te,setFilterMenuOpen:K,openPillId:W,setOpenPillId:V,isSettingsMenuOpenState:P,setIsSettingsMenuOpenState:H,viewNameDraft:X,setViewNameDraft:de,commitViewName:fe,...Be,filterableColumns:Ne,formattableColumns:Jt,addConditionToColumn:ut,removeColumnFilters:Ut,updateCondition:nn,removeCondition:kn,visibleFilterColumns:Nn,activeFiltersCountByColumn:Pn,...Xn,tableColumns:sr,filteredTableColumns:Kt,...bn}}function rIe(e){const{seed:t,views:n,children:r,filters:s={},availableTagsByColumnId:i={}}=e,{t:o}=kt(),a=nIe(e),{activeViewId:l,onChangeView:u,onCreateView:f,onRenameView:p,onCreate:g,onOpenAutomation:b,onOpenFilters:y,onOpenSort:x,onOpenSettings:S,sortState:k,onSortChange:N,onConditionalFormatsChange:T,columnVisibility:R,onColumnVisibilityChange:_,pageSize:A,onPageSizeChange:I,groupBy:j,onGroupByChange:L}=e,{activeView:q,isFilterActiveEffective:ne,isSortActiveEffective:re,isAutomationActiveEffective:oe,isSettingsMenuOpenEffective:le,closeSettingsMenu:ce,isToolEnabled:F,isSearchOpen:te,searchInputRef:K,handleSearchOpen:W,handleSearchClose:V,handleSearchSubmit:P,handleSearchBlur:H,sortColumnSearchTerm:X,setSortColumnSearchTerm:de,filterColumnSearchTerm:fe,setFilterColumnSearchTerm:we,columnSearchTerm:pe,setColumnSearchTerm:Re,filterMenuOpen:Ae,setFilterMenuOpen:Ze,openPillId:nt,setOpenPillId:at,setIsSettingsMenuOpenState:Be,viewNameDraft:Ne,setViewNameDraft:Jt,commitViewName:ut,filteredSortableColumns:Ut,handleToggleSortDirection:nn,handleSortColumnSelect:kn,addConditionToColumn:Xn,removeColumnFilters:sr,updateCondition:Nn,removeCondition:Pn,visibleFilterColumns:Kt,activeFiltersCountByColumn:bn,conditionalFormats:Nt,activeConditionalRule:$n,isConditionalEditorOpen:Bn,setActiveConditionalRuleId:En,setIsConditionalEditorOpen:Fn,addConditionalFormatRule:Ts,updateConditionalRule:Kr,updateConditionalTextStyles:Ar,removeConditionalRule:Qn,moveConditionalRule:_n,updateConditionalCondition:_t,addConditionalCondition:_s,removeConditionalCondition:Or,filteredTableColumns:ht,formattableColumns:ke,recommendedGroupColumns:Me,otherGroupColumns:Le,activeGroupLabel:rt,datePrecisionMode:U,applyDatePrecisionMode:Q}=a;if(!q)return null;const ge=Object.keys(s).length>0||!!rt;return h.jsxs("div",{"data-seed-slug":t.slug,children:[h.jsx("div",{className:"sticky top-(--header-height) z-10 bg-background/95 backdrop-blur-sm border-b",children:h.jsx(Wn,{className:"py-3 border-0 bg-transparent shadow-none rounded-none",children:h.jsxs(Kn,{className:"px-4 py-0",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0",children:[h.jsx(Hje,{views:n,activeViewId:l,onChangeView:u,onCreateView:f}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[F("filter")&&h.jsx(Aje,{open:Ae,onOpenChange:Ze,isActive:ne,onOpen:y,searchTerm:fe,onSearchTermChange:we,visibleFilterColumns:Kt,activeFiltersCountByColumn:bn,onSelectColumn:je=>{Xn(je),Ze(!1),we(""),at(je)}}),F("sort")&&h.jsx(Oje,{searchTerm:X,onSearchTermChange:de,filteredSortableColumns:Ut,sortState:k,onToggleDirection:nn,onSelectColumn:kn,isActive:re,onOpen:x}),F("automation")&&h.jsxs(Ha,{children:[h.jsx(Ua,{asChild:!0,children:h.jsx(He,{variant:oe?"secondary":"ghost",size:"icon-sm","aria-label":"Automazione",onClick:()=>b?.(),children:h.jsx(e6,{className:"size-4"})})}),h.jsx(Va,{side:"top",children:"Automazione"})]}),F("search")&&h.jsx(Uje,{isSearchOpen:te,searchValue:e.searchValue??"",searchInputRef:K,handleSearchSubmit:P,onSearchChange:e.onSearchChange,handleSearchBlur:H,handleSearchClose:V,handleSearchOpen:W}),F("settings")&&h.jsx(Kje,{isSettingsMenuOpenEffective:le,setIsSettingsMenuOpenState:Be,onOpenSettings:S,isSettingsOpen:e.isSettingsOpen,commitViewName:ut,setColumnSearchTerm:Re,viewNameDraft:Ne,setViewNameDraft:Jt,setIsConditionalEditorOpen:Fn,filterColumnSearchTerm:fe,setFilterColumnSearchTerm:we,visibleFilterColumns:Kt,addConditionToColumn:Xn,setOpenPillId:at,closeSettingsMenu:ce,filters:s,sortColumnSearchTerm:X,setSortColumnSearchTerm:de,handleToggleSortDirection:nn,sortState:k,filteredSortableColumns:Ut,handleSortColumnSelect:kn,groupBy:j??null,onGroupByChange:L,recommendedGroupColumns:Me,datePrecisionMode:U,applyDatePrecisionMode:Q,otherGroupColumns:Le,onConditionalFormatsChange:T,formattableColumns:ke,conditionalFormats:Nt,activeConditionalRule:$n,isConditionalEditorOpen:Bn,setActiveConditionalRuleId:En,addConditionalFormatRule:Ts,updateConditionalRule:Kr,updateConditionalTextStyles:Ar,removeConditionalRule:Qn,moveConditionalRule:_n,updateConditionalCondition:_t,addConditionalCondition:_s,removeConditionalCondition:Or,availableTagsByColumnId:i,columnVisibility:R,onColumnVisibilityChange:_,columnSearchTerm:pe,filteredTableColumns:ht,pageSize:A,onPageSizeChange:I}),F("create")&&h.jsxs(He,{variant:"default",size:"sm",onClick:g,className:"gap-1.5",children:[h.jsx(Kl,{className:"size-4"}),o("siteHeader.new")]})]})]}),ge&&h.jsx("div",{className:"mt-3 pt-3 border-t",children:h.jsx($je,{filters:s,openPillId:nt,onOpenPillChange:at,groupBy:j??null,activeGroupLabel:rt??"",onGroupByChange:L,addConditionToColumn:Xn,removeColumnFilters:sr,updateCondition:Nn,removeCondition:Pn,availableTagsByColumnId:i})})]})})}),r!=null&&h.jsx("div",{className:"mt-4",children:r})]})}const w7={fetchList:async(e,t)=>(await Zt.get(`/content/${e}`,{params:{...t,filters:t.filters!=null?JSON.stringify(t.filters):void 0}})).data,fetchFacets:async e=>(await Zt.get(`/content/${e}/facets`)).data,delete:async(e,t)=>(await Zt.delete(`/content/${e}/${t}`)).data},Iy={all:["content"],lists:()=>[...Iy.all,"list"],list:(e,t)=>[...Iy.lists(),e,t]},PW={all:["facets"],bySlug:e=>[...PW.all,e]};function sIe(e,t){return is({queryKey:Iy.list(e||"",t),queryFn:()=>{if(!e)throw new Error("Slug is required");return w7.fetchList(e,t)},enabled:!!e,placeholderData:n=>n,staleTime:10*1e3})}const fg={getTotalStats:async()=>{const{data:e}=await Zt.get("/content/stats/total");return e},getCloudflareStats:async()=>{const{data:e}=await Zt.get("/content/stats/cloudflare");return e},getRecentActivity:async e=>{const{data:t}=await Zt.get("/content/stats/recent-activity",{params:{slug:e}});return t},getSystemHealth:async()=>{const{data:e}=await Zt.get("/content/stats/health");return e},getContentBreakdown:async()=>{const{data:e}=await Zt.get("/content/stats/breakdown");return e}},qi={all:["dashboard"],stats:()=>[...qi.all,"stats"],cloudflare:()=>[...qi.all,"cloudflare"],activity:()=>[...qi.all,"activity"],health:()=>[...qi.all,"health"],breakdown:()=>[...qi.all,"breakdown"]};function S7(){return is({queryKey:qi.stats(),queryFn:fg.getTotalStats,staleTime:300*1e3})}function C7(){return is({queryKey:qi.cloudflare(),queryFn:fg.getCloudflareStats,staleTime:300*1e3})}function $W(e){return is({queryKey:[...qi.activity(),e],queryFn:()=>fg.getRecentActivity(e),refetchInterval:60*1e3,staleTime:60*1e3})}function BW(){return is({queryKey:qi.health(),queryFn:fg.getSystemHealth,staleTime:300*1e3})}function iIe(){return is({queryKey:qi.breakdown(),queryFn:fg.getContentBreakdown,staleTime:300*1e3})}function oIe(e){return is({queryKey:PW.bySlug(e||""),queryFn:()=>{if(!e)throw new Error("Slug is required");return w7.fetchFacets(e)},enabled:!!e,staleTime:300*1e3,gcTime:1800*1e3})}function aIe(){const e=ia();return Ei({mutationFn:({slug:t,id:n})=>w7.delete(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:Iy.all}),e.invalidateQueries({queryKey:qi.activity()})}})}function FW(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.columnId=="string"&&typeof t.label=="string"&&typeof t.type=="string"&&Array.isArray(t.conditions)}function zy(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}function Em(e){if(e==null)return null;if(typeof e=="string"){const t=e.trim();if(!t)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;const n=new Date(t);return Number.isNaN(n.getTime())?null:n.toISOString().slice(0,10)}if(typeof e=="number"){const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10)}return null}function lIe(e,t,n,r){if(n==="is_empty")return zy(e);if(n==="is_not_empty")return!zy(e);switch(t.type){case"tags":return cIe(e,n,r);case"number":return uIe(e,n,r);case"date":return dIe(e,n,r);case"boolean":return fIe(e,n,r);case"select":return hIe(e,n,r);default:return pIe(e,n,r)}}function cIe(e,t,n){const r=qE(e);return t==="contains"||t==="eq"?typeof n!="string"||!n.trim()?!0:r.includes(n):!0}function uIe(e,t,n){let r=null;typeof e=="number"?r=e:typeof e=="string"&&e.trim()!==""&&(r=Number(e));const s=typeof n=="number"?n:null;if(r==null||s==null||Number.isNaN(r)||Number.isNaN(s))return!0;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!0}}function dIe(e,t,n){const r=Em(e),s=typeof n=="string"?Em(n):null;if(!r||!s)return!0;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!0}}function fIe(e,t,n){const r=typeof e=="boolean"?e:null,s=typeof n=="boolean"?n:null;return r==null||s==null?!0:t==="eq"?r===s:!0}function hIe(e,t,n){const r=e==null?"":String(e);if(t!=="eq"||n==null)return!0;const s=String(n);return s.trim()?r.trim().toLowerCase()===s.trim().toLowerCase():!0}function pIe(e,t,n){const r=e==null?"":String(e);if(t==="contains")return typeof n!="string"||!n.trim()?!0:r.toLowerCase().includes(n.toLowerCase());if(t==="eq"){if(n==null)return!0;const s=String(n);return s.trim()?r.trim().toLowerCase()===s.trim().toLowerCase():!0}return!0}function NS(e,t){if(!FW(t))return!0;for(const n of t.conditions)if(!lIe(e,t,n.op,n.value))return!1;return!0}function mIe(e,t,n){const r=qE(e);return typeof n!="string"||!n.trim()||r.length===0?!1:t==="contains"||t==="eq"?r.includes(n):!1}function gIe(e,t,n){let r=null;typeof e=="number"?r=e:typeof e=="string"&&e.trim()!==""&&(r=Number(e));const s=typeof n=="number"?n:null;if(r==null||s==null||Number.isNaN(r)||Number.isNaN(s))return!1;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!1}}function bIe(e,t,n){const r=Em(e),s=typeof n=="string"?Em(n):null;if(!r||!s)return!1;switch(t){case"eq":return r===s;case"gt":return r>s;case"gte":return r>=s;case"lt":return r<s;case"lte":return r<=s;default:return!1}}function vIe(e,t,n){const r=typeof e=="boolean"?e:null,s=typeof n=="boolean"?n:null;return r==null||s==null?!1:t==="eq"?r===s:!1}function yIe(e,t,n){const r=e==null?"":String(e);if(t!=="eq"||n==null)return!1;const s=String(n);return!s.trim()||!r.trim()?!1:r.trim().toLowerCase()===s.trim().toLowerCase()}function xIe(e,t,n){const r=e==null?"":String(e);if(t==="contains")return typeof n!="string"||!n.trim()||!r.trim()?!1:r.toLowerCase().includes(n.toLowerCase());if(t==="eq"){if(n==null)return!1;const s=String(n);return!s.trim()||!r.trim()?!1:r.trim().toLowerCase()===s.trim().toLowerCase()}return!1}function wIe(e,t,n,r){if(n==="is_empty")return zy(e);if(n==="is_not_empty")return!zy(e);switch(t.type){case"tags":return mIe(e,n,r);case"number":return gIe(e,n,r);case"date":return bIe(e,n,r);case"boolean":return vIe(e,n,r);case"select":return yIe(e,n,r);default:return xIe(e,n,r)}}function _D(e,t){if(!FW(t))return!1;for(const n of t.conditions)if(!wIe(e,t,n.op,n.value))return!1;return!0}const HW=20,UW=60,Ly={year:!0,month:!0,day:!1};function SIe(e,t=Ly){const n=Em(e);if(!n)return"—";const r=new Date(n+"T00:00:00");if(t.day)return r.toLocaleDateString("it-IT",{day:"2-digit",month:"long",year:"numeric"});const s=[];return t.month&&s.push(r.toLocaleDateString("it-IT",{month:"long"})),t.year&&s.push(String(r.getFullYear())),s.length?s.join(" "):String(r.getFullYear())}const CIe=(e,t)=>{let n=0,r=0;for(const s of t){const i=s.getValue(e);i===!0?n++:i===!1&&r++}return{trueCount:n,falseCount:r}};function kIe(e){if(e!=null&&typeof e=="object"&&"trueCount"in e&&"falseCount"in e){const{trueCount:t,falseCount:n}=e;return`✓ ${t} / ✗ ${n}`}return""}function EIe(e,t){return typeof e=="number"&&!Number.isNaN(e)?`Σ ${e.toLocaleString("it-IT")} · ${t} voci`:`${t} voci`}function NIe(e){const t=e.trim().toLowerCase();if(!t)return"secondary";if(["error","failed","rejected","archived"].includes(t))return"destructive";if(["published","active","approved","online"].includes(t))return"default";let n=0;for(let r=0;r<t.length;r++){const s=t.codePointAt(r);s!=null&&(n=n*31+s>>>0,s>65535&&r++)}return n%2===0?"secondary":"outline"}function RD(e,t){let n=0;for(const r of e){const s=r.data[t];if(s==null)continue;const i=String(s).length;i>n&&(n=i)}return Math.min(Math.max(n,HW),UW)}function MIe(e,t){if(t.toLowerCase().includes("tag"))return null;let r=0;for(const s of e){const i=s.data[t];if(i==null)continue;let o;if(typeof i=="string")try{o=JSON.stringify(JSON.parse(i))}catch{o=i}else o=JSON.stringify(i);o.length>r&&(r=o.length)}return Math.min(Math.max(r,HW),UW)}function TIe(e,t){return e.type==="json"?MIe(t,e.alias):(e.type==="text",RD(t,e.alias))}function _Ie(e,t,n){const r={},s=e.slice(0,n);for(const i of t.branches){const o=TIe(i,s);o!=null&&(r[i.alias]=o)}return r}function RIe(e,t,n,r,s=[],i,o=Ly){const a=[{id:"select",header:({table:f})=>h.jsx(NC,{checked:f.getIsAllPageRowsSelected()||f.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:p=>f.toggleAllPageRowsSelected(!!p),"aria-label":"Seleziona tutto"}),cell:({row:f})=>h.jsx(NC,{checked:f.getIsSelected(),onCheckedChange:p=>f.toggleSelected(!!p),"aria-label":"Seleziona riga"}),enableSorting:!1,enableHiding:!1},{id:"id",accessorFn:f=>f.id,header:"ID",cell:({row:f})=>h.jsx("span",{className:"font-mono text-xs truncate max-w-[8rem] block",title:f.original.id,children:f.original.id}),enableSorting:!1},{id:"slug",accessorFn:f=>f.slug,header:"Slug",filterFn:(f,p,g)=>NS(f.getValue(p),g),cell:({row:f})=>{const p=f.original.slug;return h.jsx("span",{className:"text-muted-foreground text-sm",children:p??"—"})},enableSorting:!1},{id:"status",accessorFn:f=>f.status,header:"Stato",filterFn:(f,p,g)=>NS(f.getValue(p),g),cell:({row:f})=>{const p=(f.original.status??"").trim()||"—",g=NIe(p);return h.jsx(_i,{variant:g,children:p})},enableSorting:!1}],l=e.branches.map(f=>{const p={accessorFn:b=>b.data[f.alias],id:f.alias,header:()=>h.jsx("div",{className:"font-medium",children:f.label}),filterFn:(b,y,x)=>NS(b.getValue(y),x)};f.type==="date"?(p.getGroupingValue=b=>SIe(b.data[f.alias],o),p.aggregationFn="count",p.aggregatedCell=({getValue:b,row:y})=>{const x=y.subRows?.length??0,S=b();return S?h.jsxs("span",{className:"text-xs text-muted-foreground",children:[S," · ",x," ",x===1?"voce":"voci"]}):null}):f.type==="boolean"?(p.aggregationFn=CIe,p.aggregatedCell=({getValue:b})=>{const y=kIe(b());return y?h.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null}):f.type==="number"?(p.aggregationFn="sum",p.aggregatedCell=({getValue:b,row:y})=>{const x=y.subRows?.length??0;return h.jsx("span",{className:"text-xs text-muted-foreground",children:EIe(b(),x)})}):(p.aggregationFn="count",p.aggregatedCell=({row:b})=>{const y=b.subRows?.length??0;return h.jsxs("span",{className:"text-xs text-muted-foreground",children:[y," ",y===1?"voce":"voci"]})});const g=r?.[f.alias];return{...p,cell:({row:b})=>h.jsx(_W,{branch:f,value:b.original.data[f.alias],options:typeof g=="number"?{maxLength:g}:void 0})}}),u={id:"actions",enableHiding:!1,cell:({row:f})=>{const p=f.original,g=s.length>1;return h.jsx("div",{className:"text-right",children:h.jsxs(Ao,{children:[h.jsx(Oo,{asChild:!0,children:h.jsxs(He,{variant:"ghost",size:"icon-xs",children:[h.jsx("span",{className:"sr-only",children:"Apri menu"}),h.jsx(XD,{})]})}),h.jsxs(Do,{align:"end",className:"w-40",children:[h.jsx(ks,{children:"Azioni"}),g?h.jsx(Ra,{onClick:()=>i?.(s),className:"text-destructive focus:text-destructive",children:"Elimina"}):h.jsxs(h.Fragment,{children:[h.jsx(Ra,{onClick:()=>{navigator.clipboard.writeText(p.id).then(()=>or.success("ID copiato"),()=>or.error("Copia fallita"))},children:"Copia ID"}),h.jsx(ri,{}),h.jsx(Ra,{onClick:()=>{t(p.id)},children:"Modifica"}),h.jsx(Ra,{onClick:()=>n(p.id),className:"text-destructive focus:text-destructive",children:"Elimina"})]})]})]})})}};return[...a,...l,u]}function VW(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function AIe(){const{slug:e}=Q$(),t=zo(),{t:n}=kt(),[r,s]=w.useState(0),i=10,[o,a]=w.useState(i),[l,u]=w.useState(""),f=VW(l,300),[p,g]=w.useState([]),[b]=wx(),y=b.get("status"),[x,S]=w.useState(()=>y?{status:{columnId:"status",label:"Status",type:"select",conditions:[{id:"status-prefilter",op:"eq",value:y}],selectOptions:["draft","published"]}}:{}),[k,N]=w.useState({}),[T,R]=w.useState(!1),[_,A]=w.useState(null),[I,j]=w.useState("table"),L=e?DB(e):null,[q,ne]=w.useState(null),[re,oe]=w.useState(Ly),{data:le,isLoading:ce,error:F}=sIe(e,{page:r+1,limit:o,search:f.trim()||void 0,sortBy:p[0]?.id,sortDir:p[0]?.desc?"desc":"asc",filters:x}),{data:te}=oIe(e),{mutateAsync:K}=aIe(),W=w.useMemo(()=>le?.items??[],[le]),V=le?.total??0,P=ce,H=F?F.message:null;w.useEffect(()=>{s(0)},[e,f,p,x,o]),w.useEffect(()=>{if(!q||!L)return;L.branches.find(Me=>Me.alias===q)?.type!=="date"&&oe(Ly)},[q,L]);const[X,de]=w.useState(()=>[{id:"table",label:"table",type:"table",enabledTools:["filter","sort","automation","search","settings","create"],conditionalFormats:[]},{id:"gallery",label:"gallery",type:"gallery",enabledTools:["filter","sort","search","create"],conditionalFormats:[]}]),fe={table:n("content.list.table"),gallery:n("content.list.gallery")},we=w.useMemo(()=>X.map(ke=>({...ke,label:fe[ke.type]??ke.label})),[X,n]),pe=w.useMemo(()=>X.find(ke=>ke.id===I),[I,X]),Re=w.useCallback((ke,Me)=>{de(Le=>Le.map(rt=>rt.id===ke?{...rt,conditionalFormats:Me}:rt))},[]),Ae=w.useCallback((ke,Me)=>Me==="id"?ke.id:Me==="slug"?ke.slug:Me==="status"?ke.status:ke.data?.[Me],[]),Ze=w.useRef(new Map);w.useEffect(()=>{Ze.current.clear()},[e,W]);const nt=w.useCallback((ke,Me,Le)=>{const rt=Ae(ke,Me);if(Le!=="tags")return rt;const U=`${ke.id}::${Me}`;if(Ze.current.has(U))return Ze.current.get(U);let Q=rt;if(typeof rt=="string")try{Q=JSON.parse(rt)}catch{Q=null}return Ze.current.set(U,Q),Q},[Ae]),at=w.useMemo(()=>(pe?.conditionalFormats??[]).filter(Me=>!!Me?.enabled).slice().sort((Me,Le)=>(Me.priority??0)-(Le.priority??0)),[pe?.conditionalFormats]),Be=w.useMemo(()=>at.filter(ke=>{const Me=ke.target;return Me==="row"||Me==="cell+row"}),[at]),Ne=w.useMemo(()=>{const ke=new Map;for(const Me of at){if(Me.target==="row")continue;const rt=ke.get(Me.columnId)??[];rt.push(Me),ke.set(Me.columnId,rt)}return ke},[at]),Jt=w.useCallback(ke=>{let Me;const Le={};for(const rt of Be){const U=nt(ke,rt.columnId,rt.group.type);if(_D(U,rt.group)){Me=IW(rt.tone,rt.textStyles??[]);break}}for(const[rt,U]of Ne.entries())for(const Q of U){const ge=nt(ke,Q.columnId,Q.group.type);if(_D(ge,Q.group)){Le[rt]=zW(Q.tone,Q.textStyles??[]);break}}return{rowClassName:Me,cellClassNameByColumnId:Le}},[Ne,nt,Be]),ut=w.useCallback(ke=>{e&&t(`/content/${e}/${ke}`)},[e,t]),Ut=w.useCallback(ke=>{A([ke]),R(!0)},[]),nn=w.useCallback(ke=>{const Me=Array.from(new Set(ke)).filter(Boolean);Me.length&&(A(Me),R(!0))},[]),kn=w.useCallback(()=>{e&&t(`/content/${e}/create`)},[e,t]),Xn=w.useCallback(async()=>{if(!e||!_||_.length===0)return;const Me=(await Promise.allSettled(_.map(Le=>K({slug:e,id:Le})))).filter(Le=>Le.status==="rejected").length;if(Me>0)throw new Error(`Eliminazione parziale: ${Me} su ${_.length} fallite`);N({})},[e,_,K]),sr=w.useMemo(()=>Object.keys(k).filter(ke=>k[ke]),[k]),Nn=w.useMemo(()=>V<=0?1:Math.max(1,Math.ceil(V/o)),[o,V]),[Pn,Kt]=w.useState(()=>{const ke={};if(ke.id=!1,!L)return ke;const Me=L.branches.filter(Le=>Le.type==="json"&&(Le.alias.toLowerCase().includes("metadata")||Le.alias.toLowerCase().includes("metadati"))).map(Le=>Le.alias);for(const Le of Me)ke[Le]=!1;return ke}),bn=w.useMemo(()=>{if(!(!L||W.length===0))return _Ie(W,L,o)},[L,W,o]),Nt=w.useMemo(()=>L?RIe(L,ut,Ut,bn,sr,nn,re):[],[L,ut,Ut,bn,sr,nn,re]),$n=p[0],Bn=w.useMemo(()=>{const ke=new Set;for(const Me of W){const Le=typeof Me.status=="string"?Me.status.trim():"";Le&&ke.add(Le)}return Array.from(ke).sort((Me,Le)=>Me.localeCompare(Le,"it"))},[W]),En=w.useMemo(()=>{if(!L)return{};const ke=L.branches.filter(Le=>Le.type==="json"&&Le.alias.toLowerCase().includes("tag"));if(ke.length===0)return{};const Me={};for(const Le of ke){const rt=new Set(Le.options??[]);for(const U of W)for(const Q of qE(U.data[Le.alias]))rt.add(Q);Me[Le.alias]=Array.from(rt).sort((U,Q)=>U.localeCompare(Q,"it"))}return Me},[W,L]),Fn=w.useMemo(()=>{const ke=new Set([...Object.keys(En),...Object.keys(te?.tagsByColumnId??{})]),Me={};for(const Le of ke){const rt=new Set([...En[Le]??[],...te?.tagsByColumnId?.[Le]??[]]);Me[Le]=Array.from(rt).sort((U,Q)=>U.localeCompare(Q,"it"))}return Me},[En,te?.tagsByColumnId]),Ts=w.useMemo(()=>te?.statuses&&te.statuses.length>0?te.statuses:Bn,[te?.statuses,Bn]),Kr=w.useMemo(()=>q?[q]:[],[q]),Ar=w.useMemo(()=>!L||!q?!1:L.branches.find(Me=>Me.alias===q)?.type==="date",[q,L]),Qn=w.useMemo(()=>{if(Ar&&q){let ke;return re.day?ke="day":re.year&&!re.month?ke="year":ke="monthYear",`group:${q}:date:${ke}`}return`group:${q??"none"}`},[re.day,re.month,re.year,q,Ar]),_n=w.useMemo(()=>{const ke=[],Me=ge=>typeof ge=="string"&&ge.trim().length>0,Le=ge=>typeof ge=="number"&&!Number.isNaN(ge),rt=(ge,je)=>{switch(ge){case"boolean":return je===!0||je===!1;case"number":return Le(je);default:return Me(je)}},U=(ge,je)=>{switch(ge){case"number":return Le(je);case"date":return Me(je);default:return!1}},Q=(ge,je)=>{switch(je.op){case"is_empty":case"is_not_empty":return!0;case"contains":return Me(je.value);case"eq":return rt(ge.type,je.value);case"gt":case"gte":case"lt":case"lte":return U(ge.type,je.value);default:return!1}};for(const[ge,je]of Object.entries(x))je.conditions.some(lt=>Q(je,lt))&&ke.push({id:ge,value:je});return ke},[x]),_t=w.useCallback(ke=>{if(!ke.length){g([]);return}const[Me]=ke;g([{id:Me.id,desc:Me.desc??!1}])},[]),_s=w.useCallback(ke=>{if(!ke.columnId){g([]);return}g([{id:ke.columnId,desc:ke.desc}])},[]),Or=w.useCallback((ke,Me)=>{de(Le=>Le.map(rt=>rt.id===ke?{...rt,label:Me}:rt))},[]),ht=w.useMemo(()=>{const ke=["id"];if(!L)return ke;const Me=L.branches.filter(Le=>Le.type==="json"&&(Le.alias.toLowerCase().includes("metadata")||Le.alias.toLowerCase().includes("metadati"))).map(Le=>Le.alias);return[...ke,...Me]},[L]);return L?h.jsxs("div",{className:"[--header-height:calc(--spacing(14))] overflow-x-clip",children:[h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 min-w-0",children:h.jsxs("div",{className:"content-area-inner",children:[h.jsxs("div",{className:"mb-6",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:L.labelPlural??L.label}),h.jsxs("p",{className:"text-muted-foreground text-sm",children:['Gestisci i contenuti di tipo "',L.slug,'"']})]}),h.jsxs(rIe,{seed:L,views:we,activeViewId:I,onChangeView:j,onRenameView:Or,onConditionalFormatsChange:Re,onCreate:kn,searchValue:l,onSearchChange:u,sortState:{columnId:$n?.id??null,desc:$n?.desc??!0},onSortChange:_s,filters:x,onFiltersChange:S,availableTagsByColumnId:Fn,availableStatusOptions:Ts,pageSize:o,onPageSizeChange:ke=>{a(ke),s(0)},columnVisibility:Pn,onColumnVisibilityChange:Kt,groupBy:q,onGroupByChange:ne,dateGroupPrecision:re,onDateGroupPrecisionChange:oe,children:[H&&h.jsx("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:h.jsx("p",{className:"text-sm text-destructive",children:H})}),P&&!H&&I==="table"&&h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx("div",{className:"text-muted-foreground",children:"Caricamento..."})}),!P&&!H&&I==="table"&&h.jsx(i7e,{columns:Nt,data:W,initialHiddenColumns:ht,getRowStyles:Jt,rowSelection:k,onRowSelectionChange:N,onRowDoubleClick:ke=>ut(ke.id),grouping:Kr,onGroupingChange:ke=>ne(ke[0]??null),renderRowContextMenuContent:ke=>h.jsxs(h.Fragment,{children:[h.jsx(J6e,{children:"Azioni"}),sr.length>1?h.jsx(ld,{onSelect:()=>nn(sr),className:"text-destructive focus:text-destructive",children:"Elimina"}):h.jsxs(h.Fragment,{children:[h.jsx(ld,{onSelect:()=>{navigator.clipboard.writeText(ke.id).then(()=>or.success("ID copiato"),()=>or.error("Copia fallita"))},children:"Copia ID"}),h.jsx(cq,{}),h.jsx(ld,{onSelect:()=>ut(ke.id),children:"Modifica"}),h.jsx(ld,{onSelect:()=>Ut(ke.id),className:"text-destructive focus:text-destructive",children:"Elimina"})]})]}),pageSize:o,onPageSizeChange:ke=>{a(ke),s(0)},pageIndex:r,onPageIndexChange:s,pageCount:Nn,totalRows:V,manualPagination:!0,manualSorting:!0,manualFiltering:!0,columnVisibility:Pn,onColumnVisibilityChange:Kt,globalFilter:l,onGlobalFilterChange:u,sorting:p,onSortingChange:_t,columnFilters:_n},Qn),!H&&I==="gallery"&&h.jsx(Rje,{seed:L,data:W,isLoading:P,onEdit:ut})]})]})})})]})]}),h.jsx(u7e,{open:T,onOpenChange:R,seed:L,entryIds:_,onConfirm:Xn})]}):h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsx("div",{className:"content-area-inner",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("h2",{className:"text-lg font-semibold text-destructive",children:"Errore"}),h.jsx("p",{className:"text-sm text-destructive/90",children:H||`Seed "${e}" non trovato`})]})})})})]})]})})}async function OIe(e,t){return(await Zt.get(`/content/${e}/${t}`)).data}async function DIe(e,t){return(await Zt.post(`/content/${e}`,t)).data}async function jIe(e,t,n){return(await Zt.put(`/content/${e}/${t}`,n)).data}function IIe(e){return vC(e)}function AD(e){return e.alias.startsWith("meta")}function zIe(){return{type:"doc",content:[{type:"paragraph"}]}}function OD(){const{t:e}=kt(),{slug:t,id:n}=Q$(),r=zo(),s=!n,i=t?DB(t):null,[o,a]=w.useState(!!n),[l,u]=w.useState(null),[f,p]=w.useState({}),[g,b]=w.useState("draft"),[y,x]=w.useState(""),[S,k]=w.useState(!1),[N,T]=w.useState(!1),[R,_]=w.useState(!1),A=w.useRef(!1),I=Kfe(()=>R&&!A.current),j=w.useCallback((V,P)=>{p(H=>({...H,[V]:P})),_(!0)},[]);w.useEffect(()=>{if(!t||!n||!i)return;let V=!1;return a(!0),u(null),OIe(t,n).then(P=>{V||(p(P.data??{}),b(P.status??"draft"),x(P.slug??""))}).catch(P=>{V||u(P instanceof Error?P.message:e("content.editor.loadingError"))}).finally(()=>{V||a(!1)}),()=>{V=!0}},[t,n,i]),w.useEffect(()=>{if(!i||!s)return;const V={};i.branches.forEach(P=>{P.type==="boolean"?V[P.alias]=!1:P.type==="richtext"?V[P.alias]=zIe():V[P.alias]=""}),p(V),b("draft"),x(""),k(!1)},[i,s]);const L=w.useMemo(()=>i?.branches.find(V=>V.type==="text")?.alias,[i]),q=L?f[L]:void 0;w.useEffect(()=>{if(!s||S||L==null)return;const V=q;let P="";typeof V=="string"?P=V:V!=null&&(P=String(V));const H=IIe(P);x(H)},[s,S,L,q]);const ne=w.useMemo(()=>i?.branches.find(V=>V.type==="richtext"),[i]),re=!!ne,oe=w.useMemo(()=>i?.branches.filter(V=>V.alias!==ne?.alias&&AD(V))??[],[i,ne]),le=w.useMemo(()=>i?.branches.filter(V=>V.alias!==ne?.alias&&!AD(V))??[],[i,ne]),ce=w.useCallback(()=>{const V={};if(!i)return V;for(const P of i.branches)if(P.type==="json"&&f[P.alias]){const H=f[P.alias];if(typeof H=="string")try{V[P.alias]=JSON.parse(H)}catch{V[P.alias]=H}else V[P.alias]=H}else V[P.alias]=f[P.alias];return{slug:y.trim()||null,status:g.trim()||"draft",...V}},[i,f,y,g]),F=()=>{if(!i)return!0;for(const V of i.branches){if(V.type!=="json"||!f[V.alias])continue;const P=f[V.alias];if(typeof P=="string")try{JSON.parse(P)}catch{return or.error(e("content.editor.jsonError",{field:V.label})),!1}}return!0},te=async(V,P,H)=>{if(H){await jIe(V,H,P),or.success(e("content.editor.savedSuccess"));return}await DIe(V,P),or.success(e("content.editor.createdSuccess"))},K=async V=>{if(V.preventDefault(),!(!t||!i)&&!(!s&&!n)&&F()){T(!0);try{const P=ce();await te(t,P,s?null:n),_(!1),A.current=!0,r(`/content/${t}`)}catch(P){if(P.response?.status===409){or.error(e("content.editor.slugDuplicate"));return}or.error(P instanceof Error?P.message:e("content.editor.saveError"))}finally{T(!1)}}},W=()=>r(t?`/content/${t}`:"/");return t?i?n&&o?h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4",children:[h.jsx(yr,{className:"h-10 w-48"}),h.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-[1fr_320px] lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_400px]",children:[h.jsx(yr,{className:"min-h-[70vh] rounded-lg"}),h.jsx(yr,{className:"h-64 rounded-lg"})]})]})})]})]})}):n&&l?h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("p",{className:"text-destructive",children:l}),h.jsx(He,{variant:"outline",className:"mt-2",onClick:W,children:"Indietro"})]})})})]})]})}):h.jsxs("div",{className:"[--header-height:calc(--spacing(14))]",children:[h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("form",{className:"content-area-inner flex flex-1 flex-col",onSubmit:K,children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between gap-4",children:[h.jsxs(He,{type:"button",variant:"ghost",size:"sm",onClick:W,children:[h.jsx(zZ,{className:"mr-1 size-4"}),e("content.editor.back")]}),h.jsx("h1",{className:"text-xl font-semibold truncate pb-1",children:s?e("content.editor.newEntry",{label:i.label}):e("content.editor.editEntry",{label:i.label})}),h.jsx(He,{type:"submit",disabled:N,children:N?h.jsxs(h.Fragment,{children:[h.jsx(Co,{className:"mr-2 size-4 animate-spin"}),e("content.editor.saving")]}):e("content.editor.save")})]}),re?h.jsxs("div",{className:"grid flex-1 gap-6 md:grid-cols-[1fr_320px] lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_400px] md:min-h-0",children:[h.jsx("div",{className:"min-h-[70vh] flex flex-col rounded-lg border-0",children:h.jsx(eh,{branch:ne,value:f[ne.alias],onChange:V=>j(ne.alias,V)})}),h.jsxs("aside",{className:"flex flex-col gap-4 md:sticky md:top-[calc(var(--header-height)+1rem)] md:self-start",children:[h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.metadataSeo")})}),h.jsxs(Kn,{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-status",children:e("content.editor.status")}),h.jsxs(Ul,{value:g,onValueChange:V=>{b(V),_(!0)},children:[h.jsx(Vl,{id:"entry-status",className:"w-full",children:h.jsx(hu,{placeholder:e("content.editor.status")})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"draft",children:e("content.editor.draft")}),h.jsx(Eo,{value:"published",children:e("content.editor.published")})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-slug",children:e("content.editor.slug")}),h.jsx(pn,{id:"entry-slug",value:y,onChange:V=>{x(vC(V.target.value)),k(!0),_(!0)},maxLength:15,placeholder:e("content.editor.slugPlaceholder"),className:"font-mono text-sm"})]}),oe.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))]})]}),h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.content")})}),h.jsx(Kn,{className:"space-y-4",children:le.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]})]})]}):h.jsxs("div",{className:"mx-auto w-full max-w-2xl lg:max-w-3xl xl:max-w-4xl space-y-6",children:[h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.publication")})}),h.jsx(Kn,{className:"space-y-4",children:h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-status",children:e("content.editor.status")}),h.jsxs(Ul,{value:g,onValueChange:V=>{b(V),_(!0)},children:[h.jsx(Vl,{id:"entry-status",className:"w-full",children:h.jsx(hu,{placeholder:e("content.editor.status")})}),h.jsxs(ql,{children:[h.jsx(Eo,{value:"draft",children:e("content.editor.draft")}),h.jsx(Eo,{value:"published",children:e("content.editor.published")})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"entry-slug",children:e("content.editor.slug")}),h.jsx(pn,{id:"entry-slug",value:y,onChange:V=>{x(vC(V.target.value)),k(!0),_(!0)},maxLength:15,placeholder:e("content.editor.slugPlaceholder"),className:"font-mono text-sm"})]})]})})]}),oe.length>0&&h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.metadataSeo")})}),h.jsx(Kn,{className:"space-y-4",children:oe.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]}),h.jsxs(Wn,{children:[h.jsx(xr,{children:h.jsx(_r,{children:e("content.editor.content")})}),h.jsx(Kn,{className:"space-y-4",children:le.map(V=>h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:V.alias,children:V.label}),h.jsx(eh,{branch:V,value:f[V.alias],onChange:P=>j(V.alias,P)})]},V.alias))})]})]})]})})})]})]}),h.jsx(yq,{open:I.state==="blocked",children:h.jsxs(xq,{children:[h.jsxs(wq,{children:[h.jsx(Cq,{children:e("content.editor.unsavedTitle")}),h.jsx(kq,{children:e("content.editor.unsavedDesc")})]}),h.jsxs(Sq,{children:[h.jsx(Nq,{onClick:()=>I.reset?.(),children:e("content.editor.stay")}),h.jsx(Eq,{variant:"destructive",onClick:()=>I.proceed?.(),children:e("content.editor.exitWithout")})]})]})})]}):h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsx("div",{className:"flex flex-1 flex-col gap-4 p-4",children:h.jsxs("div",{className:"rounded-lg border border-destructive bg-destructive/10 p-4",children:[h.jsx("p",{className:"text-destructive",children:e("content.editor.seedNotFound",{slug:t})}),h.jsx(He,{variant:"outline",className:"mt-2",onClick:W,children:e("content.editor.back")})]})})})]})]})}):h.jsx("div",{className:"flex min-h-svh items-center justify-center p-4",children:h.jsx("p",{className:"text-destructive",children:e("content.editor.slugMissing")})})}const LIe={alias:"body",label:"Corpo del testo",type:"richtext"};function PIe(){const[e,t]=w.useState("<h2>Titolo di esempio</h2><p>Scrivi qui il tuo contenuto <strong>ricco</strong>.</p><ul><li>Primo punto</li><li>Secondo punto</li></ul>");return h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"mx-auto w-full max-w-screen-2xl p-6 space-y-8",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Field Playground"}),h.jsxs("p",{className:"text-muted-foreground text-sm mt-1",children:["Pagina di test per il campo ",h.jsx("code",{className:"font-mono bg-muted px-1 py-0.5 rounded text-xs",children:"richtext"})]})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-base font-medium",children:["Edit — ",h.jsx("span",{className:"text-muted-foreground font-normal",children:'FieldEdit type="richtext"'})]}),h.jsx("div",{className:"max-w-2xl",children:h.jsx(eh,{branch:LIe,value:e,onChange:n=>t(n)})})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-base font-medium",children:["Preview — ",h.jsx("span",{className:"text-muted-foreground font-normal",children:"HTML compilato con stili applicati"})]}),h.jsx("div",{className:"richtext-content rounded-md border border-input bg-background px-4 py-3 max-w-2xl",dangerouslySetInnerHTML:{__html:e}})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-base font-medium",children:"Output HTML grezzo"}),h.jsx("pre",{className:"rounded-md border border-input bg-muted/30 px-4 py-3 text-xs font-mono whitespace-pre-wrap break-all max-w-2xl max-h-48 overflow-auto",children:e})]})]})})]})]})})}class $Ie extends w.Component{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error(`[BeechCMS] Widget "${this.props.widgetId}" crashed:`,t,n)}render(){return this.state.hasError?h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-rose-300/40 bg-rose-500/5 p-4 text-center",children:[h.jsx(JC,{className:"h-5 w-5 text-rose-400"}),h.jsx("p",{className:"text-xs font-medium text-rose-400",children:"Widget non disponibile"}),h.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["ID: ",h.jsx("span",{className:"font-mono",children:this.props.widgetId})]})]}):this.props.children}}const BIe={it:ag,en:ki};function FIe(){const{data:e=[],isLoading:t}=$W(),{t:n,i18n:r}=kt(),s=BIe[r.language]??ag;return h.jsxs(Wn,{className:"col-span-2 border-none bg-background/50 backdrop-blur-sm",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-lg font-semibold",children:n("dashboard.recentActivity.title")})}),h.jsx(Kn,{children:h.jsxs("div",{className:"space-y-8",children:[t?h.jsx("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:n("dashboard.recentActivity.loading")})}):e.map(i=>h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx(jd,{className:"h-9 w-9 border border-primary/10",children:h.jsx(Id,{className:"bg-primary/5 text-primary text-xs",children:(i.user_name||i.user_email).slice(0,2).toUpperCase()})}),h.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[h.jsxs("p",{className:"text-sm leading-none text-muted-foreground",children:[h.jsx("span",{className:"font-bold text-foreground",children:i.user_name||i.user_email})," ",n(`dashboard.recentActivity.actions.${i.action}`,{defaultValue:i.action})," ",h.jsx("span",{className:"font-semibold text-primary",children:i.details?.title||i.details?.name||i.entity_slug||i.entity_id})]}),h.jsx("p",{className:"text-xs text-muted-foreground/70",children:km(new Date(i.created_at*1e3),{addSuffix:!0,locale:s})})]})]},i.id)),!t&&e.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:h.jsx("p",{className:"text-sm text-muted-foreground",children:n("dashboard.recentActivity.empty")})})]})})]})}function HIe(){const{data:e,isLoading:t}=BW();if(t||!e)return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-sm font-medium",children:"System Health"})}),h.jsx(Kn,{children:h.jsx("div",{className:"h-[120px] w-full animate-pulse rounded-lg bg-neutral-200 dark:bg-neutral-800"})})]});const n=e.status==="warning";return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50 shadow-sm transition-all hover:shadow-md",children:[h.jsxs(xr,{className:"flex flex-row items-center justify-between pb-2 space-y-0",children:[h.jsxs(_r,{className:"text-sm font-medium flex items-center gap-2",children:[n?h.jsx(jJ,{className:"size-4 text-amber-500"}):h.jsx(zJ,{className:"size-4 text-emerald-500"}),"System Health"]}),h.jsx("div",{className:ee("px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",n?"bg-amber-100 text-amber-700 dark:bg-amber-500/10 dark:text-amber-400":"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400"),children:e.status})]}),h.jsxs(Kn,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsxs("div",{className:"flex items-center gap-2 text-neutral-500 dark:text-neutral-400",children:[h.jsx(YC,{className:"size-3"}),h.jsx("span",{children:"D1 Monthly Requests"})]}),h.jsxs("span",{className:"font-medium text-neutral-900 dark:text-neutral-100",children:[e.database.requests30d.toLocaleString()," / ",(e.database.limit/1e6).toFixed(0),"M"]})]}),h.jsx(Lh,{value:e.database.percentage,className:"h-1.5",indicatorClassName:ee(e.database.percentage>80?"bg-amber-500":"bg-emerald-500")})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsxs("div",{className:"flex items-center gap-2 text-neutral-500 dark:text-neutral-400",children:[h.jsx(LX,{className:"size-3"}),h.jsx("span",{children:"R2 Storage Used"})]}),h.jsxs("span",{className:"font-medium text-neutral-900 dark:text-neutral-100",children:[(e.storage.used/(1024*1024)).toFixed(1)," MB / ",(e.storage.limit/(1024*1024*1024)).toFixed(0)," GB"]})]}),h.jsx(Lh,{value:e.storage.percentage,className:"h-1.5",indicatorClassName:ee(e.storage.percentage>80?"bg-amber-500":"bg-emerald-500")})]}),h.jsxs("p",{className:"text-[10px] text-neutral-400 dark:text-neutral-500 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:["Last check: ",new Date(e.lastUpdate*1e3).toLocaleTimeString()]})]})]})}function UIe(){const{t:e}=kt(),{data:t=[],isLoading:n}=iIe();if(n)return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-sm font-medium",children:"Content Pulse"})}),h.jsx(Kn,{children:h.jsx("div",{className:"space-y-4",children:[1,2,3].map(i=>h.jsx("div",{className:"h-10 w-full animate-pulse rounded-lg bg-neutral-200 dark:bg-neutral-800"},i))})})]});const r=[...t].sort((i,o)=>o.count-i.count),s=r.reduce((i,o)=>i+o.count,0);return h.jsxs(Wn,{className:"overflow-hidden border-none bg-white/50 backdrop-blur-xl dark:bg-neutral-900/50 shadow-sm transition-all hover:shadow-md",children:[h.jsxs(xr,{className:"flex flex-row items-center justify-between pb-4 space-y-0",children:[h.jsxs(_r,{className:"text-sm font-medium flex items-center gap-2",children:[h.jsx(Tl,{className:"size-4 text-emerald-500"}),"Content Pulse"]}),h.jsx(Jb,{className:"size-4 text-neutral-400"})]}),h.jsxs(Kn,{className:"",children:[h.jsx(Gl,{className:"h-[260px] pr-4",children:h.jsx("div",{className:"space-y-5",children:r.length===0?h.jsx("p",{className:"text-xs text-neutral-500 text-center py-4",children:e("dashboard.contentPulse.noContent")}):r.map(i=>{const o=s>0?i.count/s*100:0;return h.jsxs("div",{className:"group space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsx(gs,{to:`/content/${i.slug}`,className:"font-medium text-neutral-700 dark:text-neutral-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:i.label}),h.jsxs("span",{className:"text-neutral-500 tabular-nums",children:[i.count," entries"]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Lh,{value:o,className:"h-1.5 flex-1",indicatorClassName:"bg-emerald-500/80 dark:bg-emerald-400/80"}),h.jsxs("span",{className:"text-[10px] text-neutral-400 w-8 text-right font-mono",children:[Math.round(o),"%"]})]})]},i.slug)})})}),h.jsxs("div",{className:"mt-6 pt-4 border-t border-neutral-100 dark:border-neutral-800 flex justify-between items-center",children:[h.jsx("span",{className:"text-[10px] text-neutral-400 uppercase tracking-tighter font-bold",children:e("dashboard.contentPulse.totalDistribution")}),h.jsxs("span",{className:"text-[10px] font-mono font-bold text-neutral-500",children:[s," items"]})]})]})]})}function VIe(){return h.jsxs(Wn,{className:"relative overflow-hidden border-none bg-primary/5 text-primary-foreground",children:[h.jsx("div",{className:"absolute -right-8 -top-8 h-32 w-32 rounded-full bg-primary/20 blur-3xl"}),h.jsx(xr,{className:"relative flex flex-row items-center justify-between pb-2 text-foreground",children:h.jsxs(_r,{className:"flex items-center gap-2 text-lg font-semibold",children:[h.jsx(UJ,{className:"h-5 w-5 text-primary"}),"Beech AI Insights"]})}),h.jsxs(Kn,{className:"relative space-y-4 text-foreground",children:[h.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Ho notato che hai creato molti contenuti nella categoria ",h.jsx("span",{className:"font-semibold text-foreground",children:'"Blog"'})," ma pochi hanno una meta description ottimizzata per la SEO."]}),h.jsxs("div",{className:"rounded-xl bg-background/50 p-3 text-sm",children:[h.jsx("p",{className:"font-medium",children:"Suggerimento:"}),h.jsx("p",{className:"text-muted-foreground",children:"Posso generare automaticamente delle descrizioni SEO per i tuoi ultimi 5 articoli."})]}),h.jsxs("button",{className:"group flex items-center gap-1 text-sm font-semibold text-primary transition-all hover:gap-2",children:["Ottimizza ora",h.jsx(PZ,{className:"h-4 w-4"})]})]})]})}function qIe({onAction:e}){const t=[{id:"new-entry",label:"Nuovo Contenuto",icon:EX,color:"text-emerald-500"},{id:"media",label:"Carica Media",icon:Tm,color:"text-blue-500"},{id:"collections",label:"Gestisci Collezioni",icon:Jb,color:"text-amber-500"},{id:"settings",label:"Configurazione",icon:_m,color:"text-slate-500"}];return h.jsxs(Wn,{className:"border-none bg-background/50 backdrop-blur-sm",children:[h.jsx(xr,{children:h.jsx(_r,{className:"text-lg font-semibold",children:"Azioni Rapide"})}),h.jsx(Kn,{className:"grid grid-cols-2 gap-4",children:t.map(n=>h.jsxs(He,{variant:"outline",className:"flex h-24 flex-col items-center justify-center gap-2 border-none bg-background/40 transition-all hover:bg-background/80 hover:scale-105",onClick:()=>e(n.id),children:[h.jsx(n.icon,{className:`h-6 w-6 ${n.color}`}),h.jsx("span",{className:"text-xs font-medium",children:n.label})]},n.id))})]})}const GIe={emerald:{icon:"from-emerald-500/20 to-emerald-400/10 text-emerald-600 dark:text-emerald-400",badge:""},blue:{icon:"from-blue-500/20 to-blue-400/10 text-blue-600 dark:text-blue-400",badge:""},violet:{icon:"from-violet-500/20 to-violet-400/10 text-violet-600 dark:text-violet-400",badge:""},amber:{icon:"from-amber-500/20 to-amber-400/10 text-amber-600 dark:text-amber-400",badge:""},rose:{icon:"from-rose-500/20 to-rose-400/10 text-rose-600 dark:text-rose-400",badge:""}};function WIe({title:e,value:t,icon:n,description:r,trend:s,accent:i="emerald"}){const o=GIe[i];return h.jsx("div",{className:ee("h-full w-full flex flex-col","rounded-2xl border border-neutral-200/80 bg-white/75 backdrop-blur-md p-5","shadow-[0_1px_3px_0_rgb(0,0,0,0.05),0_1px_2px_-1px_rgb(0,0,0,0.04)]","transition-all duration-200 hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.08)]","hover:border-neutral-300/80","dark:border-neutral-700/50 dark:bg-neutral-900/65 dark:hover:border-neutral-600/60"),children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:e}),h.jsx("p",{className:"text-2xl font-bold tracking-tight text-foreground tabular-nums",children:t}),r&&h.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground leading-snug",children:r}),s&&h.jsxs("div",{className:ee("mt-2 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold",s.isPositive?"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":"bg-rose-100 text-rose-700 dark:bg-rose-500/15 dark:text-rose-400"),children:[s.isPositive?h.jsx(QC,{className:"size-3"}):h.jsx(nee,{className:"size-3"}),s.isPositive?"+":"-",s.value,"%"]})]}),h.jsx("div",{className:ee("shrink-0 rounded-xl bg-gradient-to-br p-2.5",o.icon),children:h.jsx(n,{size:20})})]})})}function Bh({icon:e,title:t,description:n}){return h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-2 text-center",children:[h.jsx(e,{className:"size-8 text-muted-foreground/40"}),h.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:t}),n&&h.jsx("p",{className:"text-xs text-muted-foreground/70",children:n})]})}function Kd({message:e,onRetry:t}){const{t:n}=kt();return h.jsxs("div",{className:"flex h-full min-h-[80px] flex-col items-center justify-center gap-3 text-center",children:[h.jsx(KD,{className:"size-8 text-destructive/60"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:e??n("dashboard.widgets.error.message")}),t&&h.jsx(He,{variant:"outline",size:"sm",onClick:t,children:n("dashboard.widgets.error.retry")})]})}const KIe={it:ag,en:ki};function DD(e){return e==="published"?"bg-emerald-50 text-emerald-700 border-emerald-200/80 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-800/60":e==="draft"?"bg-amber-50 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60":"bg-neutral-100 text-neutral-600 border-neutral-200/80 dark:bg-neutral-800 dark:text-neutral-400"}function MS(e){const t=e.data;for(const n of Object.keys(t)){const r=t[n];if(typeof r=="string"&&r.trim())return r}return e.id}const YIe=/\.(jpg|jpeg|png|webp|gif|avif|svg)(\?.*)?$/i;function ZIe(e){for(const t of Object.values(e.data))if(typeof t=="string"&&(t.startsWith("http")||YIe.test(t)))return t;return null}function zC({seedSlug:e,variant:t="list"}){const{t:n,i18n:r}=kt(),s=KIe[r.language]??ki;function i(p){return p?km(new Date(p*1e3),{addSuffix:!0,locale:s}):"—"}const{data:o,isLoading:a,isError:l,refetch:u}=is({queryKey:["widget","recent-content",e],queryFn:async()=>{const g=(await Zt.get(`/content/${e}`,{params:{limit:5,sortBy:"updated_at",sortDir:"desc"}})).data;return Array.isArray(g)?g:g.items},staleTime:180*1e3}),f=h.jsx(gs,{to:`/content/${e}`,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n("dashboard.widgets.recentContent.viewAll")});return a?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx("div",{className:"space-y-3",children:Array.from({length:4}).map((p,g)=>h.jsx(yr,{className:"h-9 w-full rounded-lg animate-pulse"},g))})}):l?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx(Kd,{onRetry:()=>u()})}):o?.length?t==="cards"?h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx(Gl,{className:"h-full",children:h.jsx("div",{className:"grid grid-cols-2 gap-3 pr-2",children:o.map(p=>{const g=ZIe(p);return h.jsxs(gs,{to:`/content/${e}/${p.id}`,className:"flex flex-col rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm hover:shadow-md transition-shadow",children:[g?h.jsx("img",{src:g,alt:"",className:"h-28 w-full object-cover shrink-0"}):h.jsx("div",{className:"h-28 shrink-0 bg-muted flex items-center justify-center",children:h.jsx(hM,{className:"size-7 text-muted-foreground/30"})}),h.jsxs("div",{className:"flex flex-col flex-1 p-2",children:[h.jsx("p",{className:"text-xs font-medium line-clamp-2 flex-1",children:MS(p)}),h.jsxs("div",{className:"flex items-center justify-between gap-1 mt-auto pt-2",children:[h.jsx("span",{className:ee("text-[10px] px-1.5 py-0.5 rounded-full font-semibold border",DD(p.status)),children:p.status}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:i(p.updated_at)})]})]})]},p.id)})})})}):h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,action:f,children:h.jsx("ul",{className:"space-y-0.5",children:o.map(p=>h.jsxs("li",{className:"group rounded-lg px-3 py-2.5 hover:bg-muted/50 transition-colors",children:[h.jsx(gs,{to:`/content/${e}/${p.id}`,className:"text-sm font-medium truncate block hover:underline decoration-primary/30 mb-1 sm:hidden",children:MS(p)}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(gs,{to:`/content/${e}/${p.id}`,className:"text-sm font-medium truncate flex-1 hover:underline decoration-primary/30 hidden sm:block",children:MS(p)}),h.jsx(_i,{className:ee("shrink-0 text-[10px] border",DD(p.status)),variant:"outline",children:p.status}),h.jsx("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums ml-auto sm:ml-0",children:i(p.updated_at)})]})]},p.id))})}):h.jsx(On,{title:n("dashboard.widgets.recentContent.title"),icon:Gf,children:h.jsx(Bh,{icon:hM,title:n("dashboard.widgets.recentContent.noContent"),description:n("dashboard.widgets.recentContent.noContentDesc")})})}function XIe(e){return e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function LC({seeds:e,variant:t="minimal",title:n,placeholder:r,onCreated:s}){const{t:i}=kt(),[o,a]=w.useState(""),[l,u]=w.useState(e[0]?.slug??""),[f,p]=w.useState(!1),[g,b]=w.useState(null),y=ia(),x=zo(),S=e.find(A=>A.slug===l),k=S?.displayNameAlias??"title",N=i(`dashboard.widgets.quickDraft.fieldLabels.${k}`,{defaultValue:S?.displayNameLabel??k}),{mutate:T,isPending:R}=Ei({mutationFn:async()=>({id:(await Zt.post(`/content/${l}`,{status:"draft",[k]:o})).data.id,seedSlug:l}),onSuccess:({id:A,seedSlug:I})=>{y.invalidateQueries({queryKey:["content",I]}),y.invalidateQueries({queryKey:["widget","recent-content",I]}),y.invalidateQueries({queryKey:["widget","pending-drafts",I]}),y.invalidateQueries({queryKey:qi.activity()}),s?.(A,I),p(!0),setTimeout(()=>{x(`/content/${I}/${A}`)},800)},onError:A=>{b(A.message||i("dashboard.widgets.quickDraft.errorCreating"))}});function _(A){A.preventDefault(),b(null),!(!o.trim()||!l)&&T()}return f?h.jsx(On,{children:h.jsxs("div",{className:"flex h-full items-center justify-center gap-2 text-emerald-600 dark:text-emerald-400",children:[h.jsx(YD,{className:"size-5"}),h.jsx("span",{className:"text-sm font-semibold",children:i("dashboard.widgets.quickDraft.draftCreated")})]})}):h.jsx(On,{icon:QX,title:t==="minimal"?n||i("dashboard.widgets.quickDraft.title"):void 0,children:h.jsxs("form",{onSubmit:_,className:"space-y-3",children:[t==="expanded"&&h.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:n||i("dashboard.widgets.quickDraft.createDraft")}),h.jsxs("div",{className:ee("flex gap-2",t==="expanded"?"flex-col":"flex-col sm:flex-row sm:items-center"),children:[h.jsxs("div",{className:"flex-1 space-y-1",children:[t==="expanded"&&h.jsx("label",{className:"text-xs text-muted-foreground",children:N}),h.jsx(pn,{placeholder:r||`${N}…`,value:o,onChange:A=>a(A.target.value),className:"h-8 text-sm"}),t==="expanded"&&o&&h.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["/",XIe(o)]})]}),h.jsxs("div",{className:ee("flex gap-2",t==="minimal"?"items-center sm:contents":""),children:[h.jsxs("div",{className:ee(t==="expanded"?"w-full space-y-1":"flex-1 min-w-0 sm:w-28 sm:shrink-0 sm:flex-none"),children:[t==="expanded"&&h.jsx("label",{className:"text-xs text-muted-foreground",children:i("dashboard.widgets.quickDraft.type")}),h.jsxs(Ul,{value:l,onValueChange:u,children:[h.jsx(Vl,{className:"h-8 text-sm w-full overflow-hidden",children:h.jsx("span",{className:"truncate block",children:e.find(A=>A.slug===l)?.label??i("dashboard.widgets.quickDraft.type")})}),h.jsx(ql,{children:e.map(A=>h.jsx(Eo,{value:A.slug,children:A.label},A.slug))})]})]}),t==="minimal"&&h.jsx(He,{type:"submit",size:"sm",disabled:R||!o.trim(),className:"shrink-0 h-8",children:R?"…":i("dashboard.widgets.quickDraft.create")})]})]}),t==="expanded"&&h.jsx(He,{type:"submit",size:"sm",disabled:R||!o.trim(),className:"w-full h-8",children:i(R?"dashboard.widgets.quickDraft.creating":"dashboard.widgets.quickDraft.createDraft")}),g&&h.jsx("p",{className:"text-xs text-destructive",children:g})]})})}const QIe={it:ag,en:ki};function JIe(e){for(const t of Object.values(e.data))if(typeof t=="string"&&t.trim())return t;return e.id}function PC({seedSlug:e,variant:t="list",onPublish:n}){const{t:r,i18n:s}=kt(),i=QIe[s.language]??ki,o=ia(),{data:a,isLoading:l,isError:u,refetch:f}=is({queryKey:["widget","pending-drafts",e],queryFn:async()=>{const y=(await Zt.get(`/content/${e}`,{params:{has_pending_draft:1,limit:10}})).data;return Array.isArray(y)?y:y.items},staleTime:180*1e3}),p=Ei({mutationFn:async b=>(await Zt.post(`/content/${e}/${b}/draft/publish`),b),onSuccess:()=>{o.invalidateQueries({queryKey:["widget","pending-drafts",e]}),o.invalidateQueries({queryKey:["widget","recent-content",e]}),o.invalidateQueries({queryKey:qi.activity()})}}),g=a?.length?h.jsx(_i,{className:"bg-amber-100 text-amber-700 border-amber-200/80 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-800/60 text-xs tabular-nums",variant:"outline",children:a.length}):null;return l?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((b,y)=>h.jsx(yr,{className:"h-10 w-full animate-pulse"},y))})}):u?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx(Kd,{onRetry:()=>f()})}):t==="counter"?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 h-full text-center",children:[h.jsx("span",{className:"text-5xl font-bold tabular-nums",children:a?.length??0}),h.jsx("p",{className:"text-sm text-muted-foreground",children:r("dashboard.widgets.pendingDrafts.pendingCount")}),h.jsx(gs,{to:`/content/${e}?status=draft`,children:h.jsx(He,{variant:"outline",size:"sm",children:r("dashboard.widgets.pendingDrafts.viewAll")})})]})}):a?.length?h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,action:h.jsxs("div",{className:"flex items-center gap-2",children:[g,h.jsx(gs,{to:`/content/${e}?status=draft`,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r("dashboard.widgets.pendingDrafts.viewAll")})]}),children:h.jsx(Gl,{className:"h-[260px]",children:h.jsx("ul",{className:"space-y-1 pr-2",children:a.map(b=>h.jsxs("li",{className:"rounded-lg px-2 py-2 hover:bg-muted/40 transition-colors group",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx(gs,{to:`/content/${e}/${b.id}`,className:"flex-1 text-sm font-medium truncate hover:underline text-foreground decoration-primary/30 min-w-0",children:JIe(b)}),h.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 tabular-nums hidden sm:inline",children:b.updated_at?km(new Date(b.updated_at*1e3),{addSuffix:!0,locale:i}):"—"}),h.jsxs(He,{size:"sm",variant:"default",className:"h-6 text-xs px-2 shrink-0 gap-1 opacity-70 group-hover:opacity-100 transition-opacity hidden sm:flex",disabled:p.isPending,onClick:()=>{p.mutate(b.id),n?.(b.id)},children:[h.jsx(mM,{className:"size-3"}),r("dashboard.widgets.pendingDrafts.publish")]})]}),h.jsxs("div",{className:"flex items-center justify-between gap-2 mt-1 sm:hidden",children:[h.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:b.updated_at?km(new Date(b.updated_at*1e3),{addSuffix:!0,locale:i}):"—"}),h.jsxs(He,{size:"sm",variant:"default",className:"h-6 text-xs px-2 shrink-0 gap-1",disabled:p.isPending,onClick:()=>{p.mutate(b.id),n?.(b.id)},children:[h.jsx(mM,{className:"size-3"}),r("dashboard.widgets.pendingDrafts.publish")]})]})]},b.id))})})}):h.jsx(On,{title:r("dashboard.widgets.pendingDrafts.title"),icon:Tf,children:h.jsx(Bh,{icon:Tf,title:r("dashboard.widgets.pendingDrafts.noPending")})})}function Py({variant:e="single"}){const{t}=kt(),{data:n,isLoading:r,isError:s,refetch:i}=S7();if(r)return h.jsx(On,{children:h.jsx("div",{className:"flex gap-3 h-full",children:Array.from({length:e==="trio"?3:1}).map((p,g)=>h.jsx(yr,{className:"flex-1 h-16 animate-pulse rounded-lg"},g))})});if(s)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>i()})});const{total:o,today:a,week:l,month:u}=n??{total:0,today:0,week:0,month:0};if(e==="trio"){const p=[{label:t("dashboard.widgets.publicationStats.today"),value:a,color:"text-blue-600 dark:text-blue-400",border:"border-l-blue-400/60",bg:"bg-blue-50/60 dark:bg-blue-500/10"},{label:t("dashboard.widgets.publicationStats.week"),value:l,color:"text-violet-600 dark:text-violet-400",border:"border-l-violet-400/60",bg:"bg-violet-50/60 dark:bg-violet-500/10"},{label:t("dashboard.widgets.publicationStats.month"),value:u,color:"text-emerald-600 dark:text-emerald-400",border:"border-l-emerald-400/60",bg:"bg-emerald-50/60 dark:bg-emerald-500/10"}];return h.jsx(On,{children:h.jsx("div",{className:"flex gap-2 overflow-x-auto pb-0.5 sm:grid sm:grid-cols-3 sm:overflow-visible h-full",children:p.map(({label:g,value:b,color:y,border:x,bg:S})=>h.jsxs("div",{className:ee("flex flex-col justify-center rounded-lg border-l-2 px-3 py-2 gap-0.5","min-w-[80px] shrink-0 sm:min-w-0 sm:shrink",x,S),children:[h.jsx("span",{className:ee("text-xl font-bold tabular-nums leading-none sm:text-2xl",y),children:b}),h.jsx("span",{className:"text-[10px] font-medium text-muted-foreground whitespace-nowrap",children:g})]},g))})})}const f=a>0;return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col justify-center h-full gap-1",children:[h.jsxs("div",{className:"flex items-end gap-2",children:[h.jsx("span",{className:"text-4xl font-bold tabular-nums",children:o.toLocaleString()}),h.jsxs("span",{className:ee("mb-1 flex items-center gap-0.5 text-sm font-semibold",f?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"),children:[h.jsx(QC,{className:ee("size-4",!f&&"opacity-20")}),a]})]}),h.jsx("p",{className:"text-sm text-muted-foreground",children:t("dashboard.widgets.publicationStats.totalContent")})]})})}Py.displayName="PublicationStatsWidget";function $C({variant:e="badge"}){const{data:t,isLoading:n,isError:r,refetch:s,dataUpdatedAt:i}=BW(),{data:o}=C7(),{data:a}=S7(),l=t?.status==="healthy"||t?.status==="warning";if(n)return h.jsx(On,{children:h.jsx(yr,{className:"h-10 w-full animate-pulse"})});if(r)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>s()})});const u=l??!1,f=i?new Date(i).toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}):"—";if(e==="pill-row"){const p=[{label:"API",ok:u},{label:"Storage",ok:!!o},{label:"DB",ok:typeof a?.total=="number"&&a.total>=0}];return h.jsx(On,{children:h.jsx("div",{className:"flex flex-wrap items-center gap-2 h-full",children:p.map(({label:g,ok:b})=>h.jsxs(_i,{className:ee("text-xs gap-1.5 px-2.5 py-1",b?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 border-emerald-200/80 dark:border-emerald-800/60":"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-400 border-red-200/80 dark:border-red-800/60"),variant:"outline",children:[h.jsx("span",{className:ee("size-1.5 rounded-full",b?"bg-emerald-500 shadow-[0_0_4px_rgba(34,197,94,0.6)]":"bg-red-500")}),g]},g))})})}return h.jsx(On,{children:h.jsxs("div",{className:"flex items-center gap-3 h-full",children:[h.jsxs("div",{className:"relative shrink-0",children:[h.jsx("span",{className:ee("block size-3 rounded-full",u?"bg-emerald-500":"bg-red-500")}),u&&h.jsx("span",{className:"absolute inset-0 rounded-full bg-emerald-500 animate-ping opacity-60"})]}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-semibold",children:u?"Sito online":"Errore"}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Verificato alle ",f]})]}),u?h.jsx(uj,{className:"size-4 text-emerald-500 shrink-0"}):h.jsx(wee,{className:"size-4 text-red-500 shrink-0"})]})})}const eze=10*1024*1024*1024;function _b(e){return(e/1024/1024/1024).toFixed(1)}function tze(e){return e>85?"#ef4444":e>60?"#eab308":"#22c55e"}function nze({pct:e,usedLabel:t}){const o=2*Math.PI*38,a=o-e/100*o,l=tze(e);return h.jsxs("svg",{width:"104",height:"104",viewBox:"0 0 104 104","aria-hidden":!0,children:[h.jsx("circle",{cx:52,cy:52,r:38,fill:"none",stroke:"currentColor",strokeWidth:8,className:"text-muted-foreground/15 dark:text-muted-foreground/30"}),h.jsx("circle",{cx:52,cy:52,r:38,fill:"none",stroke:l,strokeWidth:8,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:a,transform:"rotate(-90 52 52)",className:"transition-all duration-1000 ease-in-out",style:{filter:`drop-shadow(0 0 4px ${l}60)`}}),h.jsxs("text",{x:52,y:48,textAnchor:"middle",dominantBaseline:"central",fontSize:"15",fontWeight:"700",fill:l,className:"tabular-nums",children:[e,"%"]}),h.jsx("text",{x:52,y:64,textAnchor:"middle",dominantBaseline:"central",fontSize:"9",fontWeight:"500",className:"fill-muted-foreground",fill:"currentColor",style:{color:"var(--muted-foreground)"},children:t})]})}function BC({variant:e="bar",totalBytes:t=eze}){const{t:n}=kt(),{data:r,isLoading:s,isError:i,refetch:o}=C7();if(s)return h.jsx(On,{children:h.jsx(yr,{className:"h-12 w-full animate-pulse"})});if(i)return h.jsx(On,{children:h.jsx(Kd,{onRetry:()=>o()})});const a=r?r.storage.used*1024*1024:0,l=Math.min(100,Math.round(a/t*100));if(!r)return h.jsx(On,{children:h.jsx(Bh,{icon:ZC,title:n("dashboard.widgets.storage.noData")})});if(e==="gauge")return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col items-center gap-2 h-full w-full xs:flex-row sm:flex-row sm:items-center sm:gap-3",children:[h.jsx("div",{className:"shrink-0",children:h.jsx(nze,{pct:l,usedLabel:n("dashboard.widgets.storage.used")})}),h.jsxs("div",{className:"flex-1 min-w-0 text-center sm:text-left",children:[h.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n("dashboard.widgets.storage.title")}),h.jsxs("p",{className:"text-base font-bold text-foreground tabular-nums leading-tight",children:[_b(a)," ",h.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"GB"})]}),h.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n("dashboard.widgets.storage.total",{total:_b(t)})})]})]})});const u=`${_b(a)} GB di ${_b(t)} GB`;return h.jsx(On,{children:h.jsxs("div",{className:"flex flex-col justify-center gap-2 h-full",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs",children:[h.jsx("span",{className:"text-muted-foreground font-medium",children:n("dashboard.widgets.storage.title")}),h.jsxs("span",{className:"font-bold tabular-nums",children:[l,"%"]})]}),h.jsx(Lh,{value:l,className:"h-1.5"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:u})]})})}function rze(e){for(const t of Object.values(e.data))if(typeof t=="string"&&(t.startsWith("http")||t.startsWith("/")))return t;return null}function sze(e){for(const t of Object.values(e.data))if(typeof t=="string"&&t.trim()&&!t.startsWith("http")&&!t.startsWith("/"))return t;return e.id}function FC({seedSlug:e="",variant:t="grid",onOpen:n}){const[r,s]=w.useState(t),{t:i}=kt(),o=ia(),a=is({queryKey:["widget","media-library"],queryFn:async()=>(await Zt.get("/content/stats/media-library",{params:{limit:12}})).data.items,staleTime:180*1e3,enabled:r==="grid"}),l=is({queryKey:["widget","media-gallery",e,"unused"],queryFn:async()=>(await Zt.get("/content/stats/unused-media",{params:{seedSlug:e,limit:12}})).data.items,staleTime:0,enabled:r==="unused"&&!!e}),u=Ei({mutationFn:async y=>{await Zt.delete(`/${encodeURIComponent(y)}`)},onSuccess:()=>{o.invalidateQueries({queryKey:["widget","media-library"]})}}),f=Ei({mutationFn:async y=>{await Zt.delete(`/content/${e}/${y}`)},onSuccess:()=>{o.invalidateQueries({queryKey:["widget","media-gallery",e]})}}),p=r==="grid"?a.isLoading:l.isLoading,g=r==="grid"?a.isError:l.isError,b=r==="grid"?a.refetch:l.refetch;return h.jsxs("div",{className:"h-full w-full flex flex-col rounded-xl border border-neutral-200/60 bg-background/50 backdrop-blur-sm shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/40 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border/40 shrink-0",children:[h.jsxs("span",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[h.jsx(Q0,{className:"size-4 text-muted-foreground"}),i("dashboard.widgets.mediaGallery.title")]}),h.jsxs("div",{className:"flex items-center gap-0.5 bg-muted/50 p-0.5 rounded-md border border-border/50",children:[h.jsx(He,{variant:r==="grid"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>s("grid"),children:i("dashboard.widgets.mediaGallery.all")}),h.jsx(He,{variant:r==="unused"?"secondary":"ghost",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>s("unused"),children:i("dashboard.widgets.mediaGallery.unused")})]})]}),h.jsx("div",{className:"flex-1 p-3 overflow-y-auto min-h-0",children:p?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:Array.from({length:8}).map((y,x)=>h.jsx(yr,{className:"aspect-square rounded-md animate-pulse"},x))}):g?h.jsx(Kd,{onRetry:()=>b()}):r==="grid"?a.data?.length?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:a.data.map(y=>{const x=u.isPending&&u.variables===y.key,S=y.mime_type.startsWith("image/");return h.jsxs("div",{className:ee("group relative aspect-square overflow-hidden rounded-lg bg-muted/50 border border-border/50 cursor-pointer transition-all hover:ring-2 hover:ring-primary/20",x&&"opacity-50 grayscale pointer-events-none"),onClick:()=>n?.(y.key),children:[S?h.jsx("img",{src:y.url,alt:y.filename,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-110"}):h.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h.jsx(Q0,{className:"size-6 text-muted-foreground/30"})}),h.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-2 pt-6 opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx("p",{className:"text-[10px] text-white font-medium truncate",children:y.filename})})]},y.key)})}):h.jsx(Bh,{icon:Q0,title:i("dashboard.widgets.mediaGallery.emptyTitle"),description:i("dashboard.widgets.mediaGallery.emptyDesc")}):l.data?.length?h.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.data.map(y=>{const x=rze(y),S=sze(y),k=f.isPending&&f.variables===y.id;return h.jsxs("div",{className:ee("group relative aspect-square overflow-hidden rounded-lg bg-muted/50 border border-border/50 cursor-pointer transition-all hover:ring-2 hover:ring-primary/20",k&&"opacity-50 grayscale pointer-events-none"),children:[x?h.jsx("img",{src:x,alt:S,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-110"}):h.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h.jsx(Q0,{className:"size-6 text-muted-foreground/30"})}),h.jsxs("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-2 pt-6 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("p",{className:"text-[10px] text-white font-medium truncate mb-1.5",children:S}),h.jsxs(He,{variant:"destructive",size:"sm",className:"h-6 w-full text-[10px] gap-1 px-1.5 bg-red-600 hover:bg-red-500 border-none",onClick:N=>{N.stopPropagation(),confirm(`Eliminare definitivamente ${S}?`)&&f.mutate(y.id)},children:[h.jsx(Hh,{className:"size-3"})," Elimina"]})]})]},y.id)})}):h.jsx(Bh,{icon:Q0,title:i("dashboard.widgets.mediaGallery.allInUseTitle"),description:i("dashboard.widgets.mediaGallery.allInUseDesc")})})]})}const ize={it:ag,en:ki},oze={create:Kl,update:oj,delete:Hh,upload:mp},aze={create:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-400",update:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-400",delete:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-400",upload:"bg-violet-100 text-violet-600 dark:bg-violet-500/15 dark:text-violet-400"};function jD(e,t,n="User"){return e||t||n}function lze(e,t){const n=e||t;return n?n.slice(0,2).toUpperCase():"?"}function HC({seedSlug:e,variant:t="feed"}){const{t:n,i18n:r}=kt(),s=ize[r.language]??ki;function i(f){return f?km(new Date(f*1e3),{addSuffix:!0,locale:s}):"—"}const{data:o,isLoading:a,isError:l,refetch:u}=$W(e);if(a)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((f,p)=>h.jsxs("div",{className:"flex gap-3",children:[h.jsx(yr,{className:"size-8 shrink-0 rounded-full animate-pulse"}),h.jsx(yr,{className:"h-8 flex-1 animate-pulse"})]},p))})});if(l)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Kd,{onRetry:()=>u()})});if(!o?.length)return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Bh,{icon:Tl,title:n("dashboard.widgets.activityFeed.empty")})});if(t==="compact"){const f=o.slice(0,10);return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Gl,{className:"h-full",type:"auto",children:h.jsx("ul",{className:"space-y-1 pr-3",children:f.map(p=>h.jsxs("li",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-xs text-muted-foreground truncate flex-1",children:[h.jsx("span",{className:"font-medium text-foreground",children:jD(p.user_name,p.user_email)})," ",n(`dashboard.recentActivity.actions.${p.action}`,{defaultValue:p.action})," ",h.jsx("span",{className:"font-medium text-foreground",children:p.details?.title||p.details?.name||p.entity_slug||p.entity_id})]}),h.jsx("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:i(p.created_at)})]},p.id))})})})}return h.jsx(On,{title:n("dashboard.widgets.activityFeed.title"),icon:Tl,children:h.jsx(Gl,{className:"h-[180px]",type:"auto",children:h.jsx("ul",{className:"space-y-3 pr-3",children:o.map(f=>{const p=oze[f.action]??Tl,g=aze[f.action]??"bg-muted text-muted-foreground";return h.jsxs("li",{className:"flex items-start gap-3 group",children:[h.jsxs("div",{className:"relative shrink-0",children:[h.jsx(jd,{className:"size-8 border border-border/60",children:h.jsx(Id,{className:"text-[10px] bg-primary/5 text-primary font-semibold",children:lze(f.user_name,f.user_email)})}),h.jsx("span",{className:ee("absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full ring-2 ring-background",g),children:h.jsx(p,{className:"size-2.5"})})]}),h.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[h.jsxs("p",{className:"text-sm leading-snug",children:[h.jsx("span",{className:"font-semibold",children:jD(f.user_name,f.user_email)})," ",h.jsx("span",{className:"text-muted-foreground",children:n(`dashboard.recentActivity.actions.${f.action}`,{defaultValue:f.action})})," ",h.jsx("span",{className:"font-medium",children:f.details?.title||f.details?.name||f.entity_slug||f.entity_id})]}),h.jsx("p",{className:"text-xs text-muted-foreground/70",children:i(f.created_at)})]})]},f.id)})})})})}function cze({instance:e,data:t}){return h.jsx($Ie,{widgetId:e.id,children:h.jsx(uze,{instance:e,data:t})})}function uze({instance:e,data:t}){const{type:n,props:r}=e,{t:s}=kt();if(n==="stat"){const i=dze(r?.statKey,t,s);return h.jsx(WIe,{...i})}return n==="recent-activity"?h.jsx(FIe,{}):n==="system-health"?h.jsx(HIe,{}):n==="content-pulse"?h.jsx(UIe,{}):n==="ai-insights"?h.jsx(VIe,{}):n==="quick-actions"?h.jsx(qIe,{onAction:i=>console.log("[BeechCMS] Quick action:",i)}):n==="recent-content"?h.jsx(zC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onOpen:r?.onOpen}):n==="quick-draft"?h.jsx(LC,{seeds:r?.seeds??[],variant:r?.variant,onCreated:r?.onCreated}):n==="pending-drafts"?h.jsx(PC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onPublish:r?.onPublish,onOpen:r?.onOpen}):n==="publication-stats"?h.jsx(Py,{variant:r?.variant}):n==="site-status"?h.jsx($C,{variant:r?.variant}):n==="storage"?h.jsx(BC,{variant:r?.variant,totalBytes:r?.totalBytes}):n==="media-gallery"?h.jsx(FC,{seedSlug:r?.seedSlug??"",variant:r?.variant,onOpen:r?.onOpen}):n==="activity-feed"?h.jsx(HC,{seedSlug:r?.seedSlug??"",variant:r?.variant,limit:r?.limit}):h.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center rounded-xl border-2 border-dashed border-muted p-4",children:h.jsxs("p",{className:"text-sm text-muted-foreground",children:[s("dashboard.widgetRegistry.unknown")," ",h.jsx("span",{className:"font-mono font-semibold",children:n})]})})}function dze(e,t,n){const{statsData:r,cfData:s,statsLoading:i,cfLoading:o}=t||{};switch(e){case"total":return{title:n("dashboard.widgets.stat.total.title"),value:i?"...":r?.total.toLocaleString()??"0",icon:Qb,description:n("dashboard.widgets.stat.total.description"),trend:r?.total?{value:Math.round(r.recent/r.total*100),isPositive:!0}:void 0};case"visitors":return{title:n("dashboard.widgets.stat.visitors.title"),value:o?"...":s?.visitors.value.toLocaleString()??"0",icon:ej,description:n("dashboard.widgets.stat.visitors.description"),trend:s?.visitors.trend?{value:s.visitors.trend,isPositive:s.visitors.isPositive}:void 0};case"traffic":return{title:n("dashboard.widgets.stat.traffic.title"),value:o?"...":`${s?.bandwidth.value} ${s?.bandwidth.unit}`,icon:e6,description:n("dashboard.widgets.stat.traffic.description"),trend:s?.bandwidth.trend?{value:s.bandwidth.trend,isPositive:s.bandwidth.isPositive}:void 0};case"storage":return{title:n("dashboard.widgets.storage.title"),value:o?"...":`${s?.storage.used} ${s?.storage.unit}`,icon:YC,description:o?n("common.loading"):n("dashboard.widgets.stat.storage.description",{percentage:s?.storage.percentage,total:Math.round((s?.storage.limit??0)/1024)}),trend:s?{value:s.storage.percentage,isPositive:!1}:void 0};default:return{title:"N/A",value:"0",icon:Qb}}}function fze(e){const t=[{id:"site-status",type:"site-status",x:0,y:0,span:{w:2,h:1},props:{variant:"badge"}},{id:"storage-gauge",type:"storage",x:2,y:0,span:{w:2,h:1},props:{variant:"gauge"}},{id:"pub-stats-trio",type:"publication-stats",x:4,y:0,span:{w:2,h:1},props:{variant:"trio"}}];if(e.length>0){const n=e[0],r=e.find(i=>i.slug==="articoli")?.slug??n.slug,s=e.map(i=>{const o=i.branches.find(a=>a.alias===i.displayNameAlias);return{slug:i.slug,label:i.label,displayNameAlias:i.displayNameAlias,displayNameLabel:o?.label??i.displayNameAlias}});t.push({id:"quick-draft-minimal",type:"quick-draft",x:6,y:0,span:{w:2,h:1},props:{variant:"minimal",seeds:s}},{id:"recent-content-list",type:"recent-content",x:0,y:1,span:{w:4,h:2},props:{seedSlug:r,variant:"list"}},{id:"pending-drafts-list",type:"pending-drafts",x:4,y:1,span:{w:4,h:2},props:{seedSlug:r,variant:"list"}},{id:"media-gallery-grid",type:"media-gallery",x:0,y:3,span:{w:4,h:2},props:{seedSlug:r,variant:"grid"}},{id:"activity-feed-full",type:"activity-feed",x:4,y:3,span:{w:4,h:2},props:{seedSlug:r,variant:"feed"}})}return{layout:t}}function hze(){const{t:e}=kt(),{data:t=[]}=$E(),{data:n,isLoading:r}=S7(),{data:s,isLoading:i}=C7(),{user:o}=Tx(),a=new Date().getHours(),l=a>=5&&a<12?e("dashboard.greeting.morning"):a>=12&&a<18?e("dashboard.greeting.afternoon"):a>=18&&a<22?e("dashboard.greeting.evening"):e("dashboard.greeting.night"),u=o?.name||"Admin",f={statsData:n,cfData:s,statsLoading:r,cfLoading:i};return h.jsxs("div",{className:"[--header-height:calc(--spacing(14))] overflow-x-clip min-h-screen bg-neutral-50/50 dark:bg-neutral-950/50 relative",children:[h.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none z-0",children:[h.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-emerald-500/5 rounded-full blur-[120px]"}),h.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-500/5 rounded-full blur-[120px]"})]}),h.jsxs(Ta,{className:"flex flex-col relative z-10",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{className:"min-w-0",children:h.jsx("main",{className:"flex flex-1 flex-col gap-8 p-6 md:p-8 lg:p-10",children:h.jsxs("div",{className:"content-area-inner flex flex-col gap-8",children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl text-neutral-900 dark:text-neutral-100",children:[l,", ",h.jsx("span",{className:"text-primary",children:u})]}),h.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:e("dashboard.greeting.subtitle")})]}),h.jsx("div",{className:"bento-grid grid grid-cols-1 gap-6 md:grid-cols-4 lg:grid-cols-8 auto-rows-min",children:fze(t).layout.map(p=>{const b=Math.min(Math.max(1,p.span.w),8),y=Math.min(Math.max(1,p.span.h),12),x=Math.max(1,Math.ceil(b/2));return h.jsx("div",{className:"bento-cell flex flex-col",style:{"--col-span-md":x,"--col-span-lg":b,"--row-span":y},children:h.jsx(cze,{instance:p,data:f})},p.id)})})]})})})]})]})]})}function On({children:e,className:t,bare:n=!1,title:r,icon:s,action:i,contentClassName:o}){if(n)return h.jsx("div",{className:ee("h-full w-full",t),children:e});const a=!!(r||s||i);return h.jsxs("div",{className:ee("h-full w-full flex flex-col","rounded-2xl border border-neutral-200/80 bg-white/75 backdrop-blur-md overflow-hidden","shadow-[0_1px_3px_0_rgb(0,0,0,0.05),0_1px_2px_-1px_rgb(0,0,0,0.04)]","transition-all duration-200 hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.08),0_2px_4px_-1px_rgb(0,0,0,0.06)]","hover:border-neutral-300/80","dark:border-neutral-700/50 dark:bg-neutral-900/65 dark:hover:border-neutral-600/60","dark:shadow-[0_1px_3px_0_rgb(0,0,0,0.2)] dark:hover:shadow-[0_4px_12px_0_rgb(0,0,0,0.3)]","p-5",t),children:[a&&h.jsxs("div",{className:"flex items-center justify-between mb-4 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[s&&h.jsx(s,{className:"size-4 text-muted-foreground"}),r&&h.jsx("span",{className:"text-sm font-semibold text-foreground",children:r})]}),i&&h.jsx("div",{className:"flex items-center",children:i})]}),h.jsx("div",{className:ee("flex-1 min-h-0",o),children:e})]})}function Cl({title:e,description:t,children:n}){return h.jsxs("section",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-base font-semibold text-foreground",children:e}),t&&h.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),n]})}function kl({children:e,className:t}){return h.jsx("div",{className:ee("grid gap-4",t),children:e})}function fs({label:e,h:t=120,children:n}){return h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs font-mono text-muted-foreground/70",children:e}),h.jsx("div",{style:{height:t},children:n})]})}function TS({name:e}){return h.jsx(On,{children:h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("p",{className:"text-sm font-mono text-muted-foreground/50",children:e})})})}function pze(){const{data:e=[]}=$E(),t=e.map(r=>{const s=r.branches.find(i=>i.alias===r.displayNameAlias);return{slug:r.slug,label:r.label,displayNameAlias:r.displayNameAlias,displayNameLabel:s?.label??r.displayNameAlias}}),n=t[0]?.slug??"";return h.jsx("div",{className:"[--header-height:calc(--spacing(14))]",children:h.jsxs(Ta,{className:"flex flex-col",children:[h.jsx(Aa,{}),h.jsxs("div",{className:"flex flex-1",children:[h.jsx(Oa,{}),h.jsx(_a,{children:h.jsxs("div",{className:"mx-auto w-full max-w-screen-2xl p-6 space-y-12",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Widget Lab"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Sandbox per sviluppare e ispezionare i widget prima di portarli in dashboard. Ogni sezione mostra un widget in tutte le sue varianti di dimensione."})]}),h.jsx(Cl,{title:"SiteStatusWidget",description:`type="site-status" — mostra lo stato online/offline dell'API`,children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="badge" · span w:2 h:1',children:h.jsx($C,{variant:"badge"})}),h.jsx(fs,{label:'variant="pill-row" · span w:3 h:1',children:h.jsx($C,{variant:"pill-row"})})]})}),h.jsx(Cl,{title:"StorageWidget",description:'type="storage" — utilizzo storage R2',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="gauge" · span w:2 h:1',children:h.jsx(BC,{variant:"gauge"})}),h.jsx(fs,{label:'variant="bar" · span w:3 h:1',children:h.jsx(BC,{variant:"bar"})})]})}),h.jsx(Cl,{title:"PublicationStatsWidget",description:'type="publication-stats" — contenuti pubblicati oggi / settimana / mese',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="trio" · span w:2 h:1',children:h.jsx(Py,{variant:"trio"})}),h.jsx(fs,{label:'variant="single" · span w:2 h:1',children:h.jsx(Py,{variant:"single"})})]})}),h.jsx(Cl,{title:"QuickDraftWidget",description:'type="quick-draft" — crea velocemente una bozza senza navigare',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="minimal" · span w:2 h:1',children:h.jsx(LC,{variant:"minimal",seeds:t})}),h.jsx(fs,{label:'variant="expanded" · span w:4 h:2',h:200,children:h.jsx(LC,{variant:"expanded",seeds:t})})]})}),h.jsx(Cl,{title:"RecentContentWidget",description:'type="recent-content" — lista degli ultimi contenuti modificati',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="list" · span w:4 h:2',h:280,children:h.jsx(zC,{seedSlug:n,variant:"list"})}),h.jsx(fs,{label:'variant="cards" · span w:4 h:2',h:280,children:h.jsx(zC,{seedSlug:n,variant:"cards"})})]})}),h.jsx(Cl,{title:"PendingDraftsWidget",description:'type="pending-drafts" — bozze in attesa di revisione / pubblicazione',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="counter" · span w:2 h:1',children:h.jsx(PC,{seedSlug:n,variant:"counter"})}),h.jsx(fs,{label:'variant="list" · span w:4 h:2',h:280,children:h.jsx(PC,{seedSlug:n,variant:"list"})})]})}),h.jsx(Cl,{title:"MediaGalleryWidget",description:'type="media-gallery" — anteprima griglia dei media caricati',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="grid" · span w:4 h:2',h:280,children:h.jsx(FC,{seedSlug:n,variant:"grid"})}),h.jsx(fs,{label:'variant="unused" · span w:4 h:2',h:280,children:h.jsx(FC,{seedSlug:n,variant:"unused"})})]})}),h.jsx(Cl,{title:"ActivityFeedWidget",description:'type="activity-feed" — log delle ultime azioni nel CMS',children:h.jsxs(kl,{className:"grid-cols-2",children:[h.jsx(fs,{label:'variant="compact" · span w:2 h:1',children:h.jsx(HC,{variant:"compact"})}),h.jsx(fs,{label:'variant="feed" · span w:4 h:2',h:280,children:h.jsx(HC,{variant:"feed"})})]})}),h.jsx(Cl,{title:"In sviluppo",description:"Nuovi widget in costruzione — aggiungi qui i tuoi componenti prima di registrarli.",children:h.jsxs(kl,{className:"grid-cols-3",children:[h.jsx(fs,{label:"nuovo-widget-1",children:h.jsx(TS,{name:"nuovo-widget-1"})}),h.jsx(fs,{label:"nuovo-widget-2",children:h.jsx(TS,{name:"nuovo-widget-2"})}),h.jsx(fs,{label:"nuovo-widget-3",children:h.jsx(TS,{name:"nuovo-widget-3"})})]})})]})})]})]})})}function mze(){const{t:e}=kt(),t=nB(),n=Eh(t);let r=e("errorPage.unknown");n?r=t.statusText||t.data?.message||e("errorPage.unknown"):t instanceof Error&&(r=t.message);const s=n?t.status:null;return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-6",children:h.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[s&&h.jsx("span",{className:"text-6xl font-bold text-muted-foreground",children:s}),h.jsx("h1",{className:"text-xl font-semibold",children:e("errorPage.title")}),h.jsx("p",{className:"text-sm text-muted-foreground",children:r}),h.jsx(gs,{to:"/",className:"rounded-md bg-accent px-4 py-2 text-sm !text-white hover:bg-accent/90",children:e("errorPage.backHome")})]})})}const gze=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function bze(){const{t:e,i18n:t}=kt(),[n,r]=w.useState(""),[s,i]=w.useState(null),[o,a]=w.useState(!1),[l,u]=w.useState(!1),f=async p=>{p.preventDefault();const g=n.trim();if(!g){i(e("forgotPassword.emailRequired"));return}if(!gze.test(g)){i(e("forgotPassword.emailInvalid"));return}i(null),a(!0);try{await gn.post("/auth/forgot-password",{email:g,locale:t.language})}catch{}a(!1),u(!0)};return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:l?h.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("forgotPassword.successTitle")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("forgotPassword.successDesc")}),h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})]}):h.jsx("form",{onSubmit:f,noValidate:!0,children:h.jsxs(Sk,{children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("forgotPassword.title")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("forgotPassword.desc")})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"fp-email",children:"Email"}),h.jsx(pn,{id:"fp-email",type:"email",inputMode:"email",autoComplete:"email",value:n,className:ee(s?"border-destructive":""),onChange:p=>{r(p.target.value),i(null)}}),s&&h.jsx(Ck,{children:s})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!n.trim()||o,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",n.trim()&&!o?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:e(o?"forgotPassword.sending":"forgotPassword.send")})}),h.jsx("div",{className:"text-center",children:h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})})]})})})})})})}const ID=8,zD=128;function vze(){const{t:e,i18n:t}=kt(),n=zo(),[r]=wx(),s=r.get("token"),[i,o]=w.useState(""),[a,l]=w.useState(""),[u,f]=w.useState(!1),[p,g]=w.useState(!1),[b,y]=w.useState(null),[x,S]=w.useState(!1);if(!s)return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("resetPassword.invalidLinkTitle")}),h.jsx("p",{className:"text-muted-foreground text-sm",children:e("resetPassword.invalidLink")}),h.jsx(gs,{to:"/forgot-password",className:"text-sm underline-offset-2 hover:underline",children:e("resetPassword.requestNew")})]})})})})});const k=i.length>=ID&&i.length<=zD&&i===a,N=async T=>{if(T.preventDefault(),i!==a){y(e("resetPassword.mismatch"));return}if(i.length<ID){y(e("resetPassword.tooShort"));return}if(i.length>zD){y(e("resetPassword.tooLong"));return}y(null),S(!0);try{await gn.post("/auth/reset-password",{token:s,password:i,locale:t.language}),or.success(e("resetPassword.success")),n("/login",{replace:!0})}catch(R){gn.isAxiosError(R)&&R.response?.status===400?y(e("resetPassword.invalidToken")):y(e("resetPassword.genericError")),S(!1)}};return h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md",children:h.jsx(Wn,{className:"overflow-hidden shadow-md",children:h.jsx(Kn,{className:"p-6 md:p-8",children:h.jsx("form",{onSubmit:N,noValidate:!0,children:h.jsxs(Sk,{children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:e("resetPassword.title")}),h.jsx("p",{className:"text-muted-foreground text-balance text-sm",children:e("resetPassword.desc")})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"rp-password",children:e("resetPassword.newPassword")}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"rp-password",type:u?"text":"password",autoComplete:"new-password",value:i,className:ee("pr-10",b?"border-destructive":""),onChange:T=>{o(T.target.value),y(null)}}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:()=>f(T=>!T),"aria-label":e(u?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:u?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})})})]})]}),h.jsxs(Qc,{children:[h.jsx(nm,{htmlFor:"rp-confirm",children:e("resetPassword.confirmPassword")}),h.jsxs("div",{className:"relative",children:[h.jsx(pn,{id:"rp-confirm",type:p?"text":"password",autoComplete:"new-password",value:a,className:ee("pr-10",b?"border-destructive":""),onChange:T=>{l(T.target.value),y(null)}}),h.jsx(He,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute right-1 top-1/2 -translate-y-1/2 hover:bg-transparent",onClick:()=>g(T=>!T),"aria-label":e(p?"login.hidePassword":"login.showPassword"),children:h.jsx("span",{className:"inline-flex origin-center animate-[icon-swap_0.15s_ease-out]",children:p?h.jsx(vh,{className:"text-muted-foreground size-4"}):h.jsx(yh,{className:"text-muted-foreground size-4"})})})]}),b&&h.jsx(Ck,{children:b})]}),h.jsx(Qc,{children:h.jsx(He,{type:"submit",disabled:!k||x,className:ee("transition-colors duration-200 ease-out disabled:opacity-100",k&&!x?"bg-accent text-accent-foreground hover:bg-accent/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:e(x?"resetPassword.resetting":"resetPassword.reset")})}),h.jsx("div",{className:"text-center",children:h.jsx(gs,{to:"/login",className:"text-sm underline-offset-2 hover:underline",children:e("forgotPassword.backToLogin")})})]})})})})})})}function yze(){const e=zo(),[t,n]=w.useState(""),[r,s]=w.useState(""),[i,o]=w.useState(""),[a,l]=w.useState(""),[u,f]=w.useState(null),[p,g]=w.useState(!1);async function b(y){if(y.preventDefault(),f(null),i!==a){f("Passwords do not match.");return}if(i.length<8){f("Password must be at least 8 characters.");return}g(!0);try{await gn.post("/auth/setup",{email:r,password:i,name:t}),e("/login",{replace:!0})}catch(x){gn.isAxiosError(x)&&x.response?.data?.title?f(x.response.data.title):f("Setup failed. Please try again.")}finally{g(!1)}}return h.jsx("div",{className:"flex min-h-svh w-full items-center justify-center bg-background p-4",children:h.jsxs(Wn,{className:"w-full max-w-md",children:[h.jsxs(xr,{className:"space-y-1",children:[h.jsx(_r,{className:"text-2xl font-bold",children:"Welcome to BeechCMS"}),h.jsx(Xo,{children:"Create your admin account to get started. This screen appears only once."})]}),h.jsx(Kn,{children:h.jsxs("form",{onSubmit:b,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"name",children:"Name"}),h.jsx(pn,{id:"name",placeholder:"Your name",value:t,onChange:y=>n(y.target.value),autoComplete:"name"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"email",children:"Email"}),h.jsx(pn,{id:"email",type:"email",placeholder:"admin@example.com",value:r,onChange:y=>s(y.target.value),required:!0,autoComplete:"email"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"password",children:"Password"}),h.jsx(pn,{id:"password",type:"password",placeholder:"Min. 8 characters",value:i,onChange:y=>o(y.target.value),required:!0,autoComplete:"new-password"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(br,{htmlFor:"confirm",children:"Confirm password"}),h.jsx(pn,{id:"confirm",type:"password",placeholder:"Repeat password",value:a,onChange:y=>l(y.target.value),required:!0,autoComplete:"new-password"})]}),u&&h.jsx("p",{className:"text-sm text-destructive",children:u}),h.jsx(He,{type:"submit",className:"w-full",disabled:p,children:p?"Creating account…":"Create admin account"})]})})]})})}var LD=1,xze=.9,wze=.8,Sze=.17,_S=.1,RS=.999,Cze=.9999,kze=.99,Eze=/[\\\/_+.#"@\[\(\{&]/,Nze=/[\\\/_+.#"@\[\(\{&]/g,Mze=/[\s-]/,qW=/[\s-]/g;function UC(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?LD:kze;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var l=r.charAt(i),u=n.indexOf(l,s),f=0,p,g,b,y;u>=0;)p=UC(e,t,n,r,u+1,i+1,o),p>f&&(u===s?p*=LD:Eze.test(e.charAt(u-1))?(p*=wze,b=e.slice(s,u-1).match(Nze),b&&s>0&&(p*=Math.pow(RS,b.length))):Mze.test(e.charAt(u-1))?(p*=xze,y=e.slice(s,u-1).match(qW),y&&s>0&&(p*=Math.pow(RS,y.length))):(p*=Sze,s>0&&(p*=Math.pow(RS,u-s))),e.charAt(u)!==t.charAt(i)&&(p*=Cze)),(p<_S&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(g=UC(e,t,n,r,u+1,i+2,o),g*_S>p&&(p=g*_S)),p>f&&(f=p),u=n.indexOf(l,u+1);return o[a]=f,f}function PD(e){return e.toLowerCase().replace(qW," ")}function Tze(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,UC(e,t,PD(e),PD(t),0,0,{})}var pp='[cmdk-group=""]',AS='[cmdk-group-items=""]',_ze='[cmdk-group-heading=""]',GW='[cmdk-item=""]',$D=`${GW}:not([aria-disabled="true"])`,VC="cmdk-item-select",th="data-value",Rze=(e,t,n)=>Tze(e,t,n),WW=w.createContext(void 0),hg=()=>w.useContext(WW),KW=w.createContext(void 0),k7=()=>w.useContext(KW),YW=w.createContext(void 0),ZW=w.forwardRef((e,t)=>{let n=nh(()=>{var H,X;return{search:"",value:(X=(H=e.value)!=null?H:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=nh(()=>new Set),s=nh(()=>new Map),i=nh(()=>new Map),o=nh(()=>new Set),a=XW(e),{label:l,children:u,value:f,onValueChange:p,filter:g,shouldFilter:b,loop:y,disablePointerSelection:x=!1,vimBindings:S=!0,...k}=e,N=qr(),T=qr(),R=qr(),_=w.useRef(null),A=Fze();Ld(()=>{if(f!==void 0){let H=f.trim();n.current.value=H,I.emit()}},[f]),Ld(()=>{A(6,oe)},[]);let I=w.useMemo(()=>({subscribe:H=>(o.current.add(H),()=>o.current.delete(H)),snapshot:()=>n.current,setState:(H,X,de)=>{var fe,we,pe,Re;if(!Object.is(n.current[H],X)){if(n.current[H]=X,H==="search")re(),q(),A(1,ne);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(R);Ae?Ae.focus():(fe=document.getElementById(N))==null||fe.focus()}if(A(7,()=>{var Ae;n.current.selectedItemId=(Ae=le())==null?void 0:Ae.id,I.emit()}),de||A(5,oe),((we=a.current)==null?void 0:we.value)!==void 0){let Ae=X??"";(Re=(pe=a.current).onValueChange)==null||Re.call(pe,Ae);return}}I.emit()}},emit:()=>{o.current.forEach(H=>H())}}),[]),j=w.useMemo(()=>({value:(H,X,de)=>{var fe;X!==((fe=i.current.get(H))==null?void 0:fe.value)&&(i.current.set(H,{value:X,keywords:de}),n.current.filtered.items.set(H,L(X,de)),A(2,()=>{q(),I.emit()}))},item:(H,X)=>(r.current.add(H),X&&(s.current.has(X)?s.current.get(X).add(H):s.current.set(X,new Set([H]))),A(3,()=>{re(),q(),n.current.value||ne(),I.emit()}),()=>{i.current.delete(H),r.current.delete(H),n.current.filtered.items.delete(H);let de=le();A(4,()=>{re(),de?.getAttribute("id")===H&&ne(),I.emit()})}),group:H=>(s.current.has(H)||s.current.set(H,new Set),()=>{i.current.delete(H),s.current.delete(H)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:N,inputId:R,labelId:T,listInnerRef:_}),[]);function L(H,X){var de,fe;let we=(fe=(de=a.current)==null?void 0:de.filter)!=null?fe:Rze;return H?we(H,n.current.search,X):0}function q(){if(!n.current.search||a.current.shouldFilter===!1)return;let H=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(fe=>{let we=s.current.get(fe),pe=0;we.forEach(Re=>{let Ae=H.get(Re);pe=Math.max(Ae,pe)}),X.push([fe,pe])});let de=_.current;ce().sort((fe,we)=>{var pe,Re;let Ae=fe.getAttribute("id"),Ze=we.getAttribute("id");return((pe=H.get(Ze))!=null?pe:0)-((Re=H.get(Ae))!=null?Re:0)}).forEach(fe=>{let we=fe.closest(AS);we?we.appendChild(fe.parentElement===we?fe:fe.closest(`${AS} > *`)):de.appendChild(fe.parentElement===de?fe:fe.closest(`${AS} > *`))}),X.sort((fe,we)=>we[1]-fe[1]).forEach(fe=>{var we;let pe=(we=_.current)==null?void 0:we.querySelector(`${pp}[${th}="${encodeURIComponent(fe[0])}"]`);pe?.parentElement.appendChild(pe)})}function ne(){let H=ce().find(de=>de.getAttribute("aria-disabled")!=="true"),X=H?.getAttribute(th);I.setState("value",X||void 0)}function re(){var H,X,de,fe;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let we=0;for(let pe of r.current){let Re=(X=(H=i.current.get(pe))==null?void 0:H.value)!=null?X:"",Ae=(fe=(de=i.current.get(pe))==null?void 0:de.keywords)!=null?fe:[],Ze=L(Re,Ae);n.current.filtered.items.set(pe,Ze),Ze>0&&we++}for(let[pe,Re]of s.current)for(let Ae of Re)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(pe);break}n.current.filtered.count=we}function oe(){var H,X,de;let fe=le();fe&&(((H=fe.parentElement)==null?void 0:H.firstChild)===fe&&((de=(X=fe.closest(pp))==null?void 0:X.querySelector(_ze))==null||de.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function le(){var H;return(H=_.current)==null?void 0:H.querySelector(`${GW}[aria-selected="true"]`)}function ce(){var H;return Array.from(((H=_.current)==null?void 0:H.querySelectorAll($D))||[])}function F(H){let X=ce()[H];X&&I.setState("value",X.getAttribute(th))}function te(H){var X;let de=le(),fe=ce(),we=fe.findIndex(Re=>Re===de),pe=fe[we+H];(X=a.current)!=null&&X.loop&&(pe=we+H<0?fe[fe.length-1]:we+H===fe.length?fe[0]:fe[we+H]),pe&&I.setState("value",pe.getAttribute(th))}function K(H){let X=le(),de=X?.closest(pp),fe;for(;de&&!fe;)de=H>0?$ze(de,pp):Bze(de,pp),fe=de?.querySelector($D);fe?I.setState("value",fe.getAttribute(th)):te(H)}let W=()=>F(ce().length-1),V=H=>{H.preventDefault(),H.metaKey?W():H.altKey?K(1):te(1)},P=H=>{H.preventDefault(),H.metaKey?F(0):H.altKey?K(-1):te(-1)};return w.createElement(tt.div,{ref:t,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:H=>{var X;(X=k.onKeyDown)==null||X.call(k,H);let de=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||de))switch(H.key){case"n":case"j":{S&&H.ctrlKey&&V(H);break}case"ArrowDown":{V(H);break}case"p":case"k":{S&&H.ctrlKey&&P(H);break}case"ArrowUp":{P(H);break}case"Home":{H.preventDefault(),F(0);break}case"End":{H.preventDefault(),W();break}case"Enter":{H.preventDefault();let fe=le();if(fe){let we=new Event(VC);fe.dispatchEvent(we)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Uze},l),S2(e,H=>w.createElement(KW.Provider,{value:I},w.createElement(WW.Provider,{value:j},H))))}),Aze=w.forwardRef((e,t)=>{var n,r;let s=qr(),i=w.useRef(null),o=w.useContext(YW),a=hg(),l=XW(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ld(()=>{if(!u)return a.item(s,o?.id)},[u]);let f=QW(s,i,[e.value,e.children,i],e.keywords),p=k7(),g=Wl(A=>A.value&&A.value===f.current),b=Wl(A=>u||a.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);w.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(VC,y),()=>A.removeEventListener(VC,y)},[b,e.onSelect,e.disabled]);function y(){var A,I;x(),(I=(A=l.current).onSelect)==null||I.call(A,f.current)}function x(){p.setState("value",f.current,!0)}if(!b)return null;let{disabled:S,value:k,onSelect:N,forceMount:T,keywords:R,..._}=e;return w.createElement(tt.div,{ref:Fl(i,t),..._,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||a.getDisablePointerSelection()?void 0:x,onClick:S?void 0:y},e.children)}),Oze=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=qr(),a=w.useRef(null),l=w.useRef(null),u=qr(),f=hg(),p=Wl(b=>s||f.filter()===!1?!0:b.search?b.filtered.groups.has(o):!0);Ld(()=>f.group(o),[]),QW(o,a,[e.value,e.heading,l]);let g=w.useMemo(()=>({id:o,forceMount:s}),[s]);return w.createElement(tt.div,{ref:Fl(a,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&w.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),S2(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},w.createElement(YW.Provider,{value:g},b))))}),Dze=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=w.useRef(null),i=Wl(o=>!o.search);return!n&&!i?null:w.createElement(tt.div,{ref:Fl(s,t),...r,"cmdk-separator":"",role:"separator"})}),jze=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=k7(),o=Wl(u=>u.search),a=Wl(u=>u.selectedItemId),l=hg();return w.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),w.createElement(tt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||i.setState("search",u.target.value),n?.(u.target.value)}})}),Ize=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=w.useRef(null),o=w.useRef(null),a=Wl(u=>u.selectedItemId),l=hg();return w.useEffect(()=>{if(o.current&&i.current){let u=o.current,f=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=u.offsetHeight;f.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(tt.div,{ref:Fl(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},S2(e,u=>w.createElement("div",{ref:Fl(o,l.listInnerRef),"cmdk-list-sizer":""},u)))}),zze=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=e;return w.createElement(Gy,{open:n,onOpenChange:r},w.createElement(Wy,{container:o},w.createElement(Ky,{"cmdk-overlay":"",className:s}),w.createElement(Yy,{"aria-label":e.label,"cmdk-dialog":"",className:i},w.createElement(ZW,{ref:t,...a}))))}),Lze=w.forwardRef((e,t)=>Wl(n=>n.filtered.count===0)?w.createElement(tt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Pze=w.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return w.createElement(tt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},S2(e,o=>w.createElement("div",{"aria-hidden":!0},o)))}),Oi=Object.assign(ZW,{List:Ize,Item:Aze,Input:jze,Group:Oze,Separator:Dze,Dialog:zze,Empty:Lze,Loading:Pze});function $ze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Bze(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function XW(e){let t=w.useRef(e);return Ld(()=>{t.current=e}),t}var Ld=typeof window>"u"?w.useEffect:w.useLayoutEffect;function nh(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Wl(e){let t=k7(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function QW(e,t,n,r=[]){let s=w.useRef(),i=hg();return Ld(()=>{var o;let a=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(o=t.current)==null||o.setAttribute(th,a),s.current=a}),s}var Fze=()=>{let[e,t]=w.useState(),n=nh(()=>new Map);return Ld(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Hze(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function S2({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(Hze(t),{ref:t.ref},n(t.props.children)):n(t)}var Uze={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const JW=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi,{ref:n,className:ee("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));JW.displayName=Oi.displayName;const Vze=({children:e,...t})=>h.jsx(Ph,{...t,children:h.jsx($h,{className:"overflow-hidden p-0",children:h.jsx(JW,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),eK=w.forwardRef(({className:e,...t},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(DS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),h.jsx(Oi.Input,{ref:n,className:ee("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));eK.displayName=Oi.Input.displayName;const tK=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.List,{ref:n,className:ee("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));tK.displayName=Oi.List.displayName;const nK=w.forwardRef((e,t)=>h.jsx(Oi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));nK.displayName=Oi.Empty.displayName;const ud=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Group,{ref:n,className:ee("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ud.displayName=Oi.Group.displayName;const Xb=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Separator,{ref:n,className:ee("-mx-1 h-px bg-border",e),...t}));Xb.displayName=Oi.Separator.displayName;const wa=w.forwardRef(({className:e,...t},n)=>h.jsx(Oi.Item,{ref:n,className:ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));wa.displayName=Oi.Item.displayName;const rK=({className:e,...t})=>h.jsx("span",{className:ee("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});rK.displayName="CommandShortcut";function qze(){const[e,t]=w.useState(!1),[n,r]=w.useState(["root"]),[s,i]=w.useState(""),o=n.at(-1)??"root",a=w.useCallback(u=>{r(f=>[...f,u]),i("")},[]),l=w.useCallback(()=>{r(u=>u.length<=1?u:u.slice(0,-1)),i("")},[]);return w.useEffect(()=>{const u=f=>{if(f.key==="k"&&(f.metaKey||f.ctrlKey)){f.preventDefault(),t(p=>!p);return}if(f.key==="n"&&f.altKey&&!f.metaKey&&!f.ctrlKey){f.preventDefault(),t(!0),r(["root","create"]),i("");return}if(e){if(f.key==="Backspace"&&s===""&&n.length>1){f.preventDefault(),l();return}f.key==="Escape"&&n.length>1&&(f.preventDefault(),l())}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,s,n.length,l]),w.useEffect(()=>{e||(i(""),r(["root"]))},[e]),{open:e,setOpen:t,pages:n,currentPage:o,pushPage:a,popPage:l,search:s,setSearch:i}}function Gze({seeds:e,pushPage:t,navigate:n,setOpen:r,theme:s,toggleTheme:i}){const{t:o}=kt(),a=l=>{n(l),r(!1)};return h.jsxs(h.Fragment,{children:[h.jsxs(ud,{heading:o("commandPalette.navigate"),forceMount:!0,children:[h.jsxs(wa,{onSelect:()=>a("/"),children:[h.jsx(nj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.dashboard")})]}),h.jsxs(wa,{onSelect:()=>a("/media"),children:[h.jsx(Tm,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.mediaLibrary")})]}),h.jsxs(wa,{onSelect:()=>a("/settings"),children:[h.jsx(_m,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.settings")})]})]}),h.jsx(Xb,{}),h.jsxs(ud,{heading:o("commandPalette.contents"),children:[e.slice(0,5).map(l=>{const u=PE(l.dashboard?.icon);return h.jsxs(wa,{onSelect:()=>a(`/content/${l.slug}`),keywords:[l.slug,"contenuto","lista"],children:[h.jsx(u,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.goTo",{label:l.label})})]},l.slug)}),e.length>5&&h.jsxs(wa,{onSelect:()=>t("seeds"),children:[h.jsx(tj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.allSeeds")})]})]}),h.jsx(Xb,{}),h.jsx(ud,{heading:o("commandPalette.create"),children:h.jsxs(wa,{onSelect:()=>t("create"),children:[h.jsx(Kl,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.newContent")}),h.jsxs(rK,{className:"flex items-center gap-0.5",children:[h.jsx("kbd",{className:"text-xs font-mono bg-muted text-muted-foreground px-1 rounded",children:"Alt"}),h.jsx("kbd",{className:"text-xs font-mono bg-muted text-muted-foreground px-1 rounded",children:"N"})]})]})}),h.jsx(Xb,{}),h.jsx(ud,{heading:o("commandPalette.tools"),children:h.jsxs(wa,{onSelect:i,keywords:["dark mode","light mode","tema","theme"],children:[s==="dark"?h.jsx(lj,{className:"size-4 shrink-0 text-muted-foreground"}):h.jsx(sj,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:o("commandPalette.changeTheme")})]})})]})}function BD({seeds:e,navigate:t,setOpen:n,mode:r}){const{t:s}=kt(),i=s(r==="create"?"commandPalette.chooseType":"commandPalette.chooseSeed");return h.jsx(ud,{heading:i,children:e.map(o=>{const a=PE(o.dashboard?.icon);return h.jsxs(wa,{onSelect:()=>{const l=r==="create"?`/content/${o.slug}/create`:`/content/${o.slug}`;t(l),n(!1)},children:[h.jsx(a,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:o.label}),h.jsx("span",{className:"text-[10px] text-muted-foreground",children:o.slug})]})]},o.slug)})})}function Wze(e){const n=e.replace(/<(?!\/?mark\b)[^>]*>/gi,"").split(/(<mark>|<\/mark>)/gi),r=[];let s=!1,i=0;for(const o of n){if(o.toLowerCase()==="<mark>"){s=!0;continue}if(o.toLowerCase()==="</mark>"){s=!1;continue}o&&r.push(s?h.jsx("mark",{children:o},i++):o)}return r}function Kze({search:e,navigate:t,setOpen:n}){const{t:r}=kt(),s=VW(e,300),{data:i,isLoading:o}=is({queryKey:["cmd-search",s],queryFn:async()=>(await Zt.get(`/search?q=${encodeURIComponent(s)}&limit=8`)).data,enabled:s.length>=2,staleTime:3e4}),a=i?.items??[];return e.length<2?null:o?h.jsx("div",{className:"px-4 py-6 text-sm text-center text-muted-foreground",children:r("commandPalette.searching")}):h.jsxs(ud,{heading:r("commandPalette.searchResults"),children:[a.map(l=>h.jsxs(wa,{onSelect:()=>{t(`/content/${l.schema_slug}/${l.id}`),n(!1)},children:[h.jsx(Qb,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:l.title}),l.excerpt&&h.jsx("span",{className:"text-xs text-muted-foreground line-clamp-1",children:Wze(l.excerpt)}),h.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70",children:[l.schema_slug," · ",l.status]})]})]},l.id)),a.length===0&&!o&&h.jsx("div",{className:"px-4 py-6 text-sm text-center text-muted-foreground",children:r("commandPalette.noSearchResults")})]})}function Yze(){const{t:e}=kt(),t=Wl(n=>n.search);return h.jsx(nK,{children:t.length===0?e("commandPalette.noResults"):h.jsxs(h.Fragment,{children:[e("commandPalette.noResults")," ",h.jsxs("span",{className:"font-medium",children:['"',t,'"']})]})})}function Zze({pages:e,popPage:t}){return e.length<=1?null:h.jsx("div",{className:"flex items-center gap-2 px-4 pt-4 pb-0 overflow-x-auto",children:e.map((n,r)=>h.jsxs(w.Fragment,{children:[h.jsx(_i,{variant:"secondary",className:ee("cursor-pointer hover:bg-secondary/80 capitalize shrink-0",r===e.length-1&&"opacity-60 pointer-events-none"),onClick:()=>{const s=e.length-1-r;for(let i=0;i<s;i++)t()},children:n}),r<e.length-1&&h.jsx(Pd,{className:"size-3 text-muted-foreground shrink-0"})]},n+r))})}function Xze(){const{t:e}=kt(),t=zo(),{theme:n,setTheme:r}=$y(),{open:s,setOpen:i,pages:o,currentPage:a,pushPage:l,popPage:u,search:f,setSearch:p}=qze(),g=Object.values(Ek),b={root:e("commandPalette.placeholderRoot"),seeds:e("commandPalette.placeholderSeeds"),create:e("commandPalette.placeholderCreate"),"search-results":e("commandPalette.placeholderSearch")},y=w.useCallback(()=>{r(n==="dark"?"light":"dark"),i(!1)},[n,r,i]);return h.jsxs(h.Fragment,{children:[h.jsx("style",{children:"[cmdk-list]{height:var(--cmdk-list-height);transition:height 100ms ease}"}),h.jsxs(Vze,{open:s,onOpenChange:i,"aria-label":e("commandPalette.ariaLabel"),children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Zze,{pages:o,popPage:u}),h.jsx(eK,{placeholder:b[a],value:f,onValueChange:p})]}),h.jsxs(tK,{className:"max-h-[400px]",children:[h.jsx(Yze,{}),a==="root"&&h.jsx(Gze,{seeds:g,pushPage:l,navigate:t,setOpen:i,theme:n,toggleTheme:y}),a==="seeds"&&h.jsx(BD,{seeds:g,navigate:t,setOpen:i,mode:"navigate"}),a==="create"&&h.jsx(BD,{seeds:g,navigate:t,setOpen:i,mode:"create"}),a==="search-results"&&h.jsx(Kze,{search:f,seeds:g,navigate:t,setOpen:i})]}),a!=="root"&&h.jsx("div",{className:"p-3 border-t text-[10px] text-muted-foreground bg-muted/20",children:e("commandPalette.backHint")})]})]})}function Qze(){return h.jsx("div",{className:"flex min-h-svh w-full items-center justify-center bg-background",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})})}function Jze(){const e=zo();return w.useEffect(()=>{gn.get("/auth/setup").then(({data:t})=>{t.needsSetup&&e("/setup",{replace:!0})}).catch(()=>{})},[e]),h.jsx("div",{className:"flex min-h-svh w-full flex-col items-center justify-center bg-background p-4 sm:p-6 md:p-8 lg:p-10 xl:p-12",children:h.jsx("div",{className:"w-full max-w-sm sm:max-w-md md:max-w-2xl lg:max-w-4xl xl:max-w-6xl 2xl:max-w-7xl",children:h.jsx(Ppe,{})})})}function Xu({children:e}){const{status:t}=Tx();return t==="loading"?h.jsx(Qze,{}):t==="unauthenticated"?h.jsx(ihe,{to:"/login",replace:!0}):h.jsx(h.Fragment,{children:e})}function eLe(){return h.jsxs(h.Fragment,{children:[h.jsx(Xze,{}),h.jsx(ohe,{})]})}const tLe=Ohe([{element:h.jsx(eLe,{}),errorElement:h.jsx(mze,{}),children:[{path:"/login",element:h.jsx(Jze,{})},{path:"/setup",element:h.jsx(yze,{})},{path:"/forgot-password",element:h.jsx(bze,{})},{path:"/reset-password",element:h.jsx(vze,{})},{path:"/",element:h.jsx(Xu,{children:h.jsx(hze,{})})},{path:"/content/:slug/create",element:h.jsx(Xu,{children:h.jsx(OD,{})})},{path:"/content/:slug/:id",element:h.jsx(Xu,{children:h.jsx(OD,{})})},{path:"/content/:slug",element:h.jsx(Xu,{children:h.jsx(AIe,{})})},{path:"/settings",element:h.jsx(Xu,{children:h.jsx($ke,{})})},{path:"/test-fields",element:h.jsx(Xu,{children:h.jsx(PIe,{})})},{path:"/widget-lab",element:h.jsx(Xu,{children:h.jsx(pze,{})})}]}],{basename:"/admin"});function nLe(){return h.jsx(Ipe,{children:h.jsx(Vhe,{router:tLe})})}mZ.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(_ce,{client:Fce,children:h.jsx(yZ,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,enableColorScheme:!0,storageKey:"beech-theme",children:h.jsxs(o$,{children:[h.jsx(nLe,{}),h.jsx(ete,{})]})})})}));