function Vy(t,e){for(var r=0;ri[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function r(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=r(a);fetch(a.href,l)}})();var Za=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zc={exports:{}},Fa={},Gc={exports:{}},Ze={};var km;function F1(){if(km)return Ze;km=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=w&&T[w]||T["@@iterator"],typeof T=="function"?T:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function b(T,Q,ue){this.props=T,this.context=Q,this.refs=_,this.updater=ue||x}b.prototype.isReactComponent={},b.prototype.setState=function(T,Q){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,Q,"setState")},b.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function P(){}P.prototype=b.prototype;function N(T,Q,ue){this.props=T,this.context=Q,this.refs=_,this.updater=ue||x}var F=N.prototype=new P;F.constructor=N,S(F,b.prototype),F.isPureReactComponent=!0;var L=Array.isArray,k=Object.prototype.hasOwnProperty,I={current:null},X={key:!0,ref:!0,__self:!0,__source:!0};function re(T,Q,ue){var pe,Le={},qe=null,Ce=null;if(Q!=null)for(pe in Q.ref!==void 0&&(Ce=Q.ref),Q.key!==void 0&&(qe=""+Q.key),Q)k.call(Q,pe)&&!X.hasOwnProperty(pe)&&(Le[pe]=Q[pe]);var Ge=arguments.length-2;if(Ge===1)Le.children=ue;else if(1>>1,Q=H[T];if(0>>1;Ta(Le,K))qea(Ce,Le)?(H[T]=Ce,H[qe]=K,T=qe):(H[T]=Le,H[pe]=K,T=pe);else if(qea(Ce,K))H[T]=Ce,H[qe]=K,T=qe;else break e}}return W}function a(H,W){var K=H.sortIndex-W.sortIndex;return K!==0?K:H.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var d=Date,f=d.now();t.unstable_now=function(){return d.now()-f}}var m=[],p=[],v=1,w=null,y=3,x=!1,S=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(H){for(var W=r(p);W!==null;){if(W.callback===null)i(p);else if(W.startTime<=H)i(p),W.sortIndex=W.expirationTime,e(m,W);else break;W=r(p)}}function L(H){if(_=!1,F(H),!S)if(r(m)!==null)S=!0,R(k);else{var W=r(p);W!==null&&G(L,W.startTime-H)}}function k(H,W){S=!1,_&&(_=!1,P(re),re=-1),x=!0;var K=y;try{for(F(W),w=r(m);w!==null&&(!(w.expirationTime>W)||H&&!Oe());){var T=w.callback;if(typeof T=="function"){w.callback=null,y=w.priorityLevel;var Q=T(w.expirationTime<=W);W=t.unstable_now(),typeof Q=="function"?w.callback=Q:w===r(m)&&i(m),F(W)}else i(m);w=r(m)}if(w!==null)var ue=!0;else{var pe=r(p);pe!==null&&G(L,pe.startTime-W),ue=!1}return ue}finally{w=null,y=K,x=!1}}var I=!1,X=null,re=-1,de=5,Z=-1;function Oe(){return!(t.unstable_now()-ZH||125T?(H.sortIndex=K,e(p,H),r(m)===null&&H===r(p)&&(_?(P(re),re=-1):_=!0,G(L,K-T))):(H.sortIndex=Q,e(m,H),S||x||(S=!0,R(k))),H},t.unstable_shouldYield=Oe,t.unstable_wrapCallback=function(H){var W=y;return function(){var K=y;y=W;try{return H.apply(this,arguments)}finally{y=K}}}})(Xc)),Xc}var Om;function V1(){return Om||(Om=1,Yc.exports=U1()),Yc.exports}var Rm;function B1(){if(Rm)return Nn;Rm=1;var t=po(),e=V1();function r(n){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+n,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,p=/^[: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]*$/,v={},w={};function y(n){return m.call(w,n)?!0:m.call(v,n)?!1:p.test(n)?w[n]=!0:(v[n]=!0,!1)}function x(n,s,o,c){if(o!==null&&o.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return c?!1:o!==null?!o.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function S(n,s,o,c){if(s===null||typeof s>"u"||x(n,s,o,c))return!0;if(c)return!1;if(o!==null)switch(o.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function _(n,s,o,c,h,g,j){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=o,this.propertyName=n,this.type=s,this.sanitizeURL=g,this.removeEmptyString=j}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){b[n]=new _(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var s=n[0];b[s]=new _(s,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){b[n]=new _(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){b[n]=new _(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){b[n]=new _(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){b[n]=new _(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){b[n]=new _(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){b[n]=new _(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){b[n]=new _(n,5,!1,n.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function N(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var s=n.replace(P,N);b[s]=new _(s,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var s=n.replace(P,N);b[s]=new _(s,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var s=n.replace(P,N);b[s]=new _(s,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){b[n]=new _(n,1,!1,n.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){b[n]=new _(n,1,!1,n.toLowerCase(),null,!0,!0)});function F(n,s,o,c){var h=b.hasOwnProperty(s)?b[s]:null;(h!==null?h.type!==0:c||!(2C||h[j]!==g[C]){var O=` `+h[j].replace(" at new "," at ");return n.displayName&&O.includes("")&&(O=O.replace("",n.displayName)),O}while(1<=j&&0<=C);break}}}finally{ue=!1,Error.prepareStackTrace=o}return(n=n?n.displayName||n.name:"")?Q(n):""}function Le(n){switch(n.tag){case 5:return Q(n.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return n=pe(n.type,!1),n;case 11:return n=pe(n.type.render,!1),n;case 1:return n=pe(n.type,!0),n;default:return""}}function qe(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case X:return"Fragment";case I:return"Portal";case de:return"Profiler";case re:return"StrictMode";case ve:return"Suspense";case me:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Oe:return(n.displayName||"Context")+".Consumer";case Z:return(n._context.displayName||"Context")+".Provider";case J:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case M:return s=n.displayName||null,s!==null?s:qe(n.type)||"Memo";case R:s=n._payload,n=n._init;try{return qe(n(s))}catch{}}return null}function Ce(n){var s=n.type;switch(n.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=s.render,n=n.displayName||n.name||"",s.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qe(s);case 8:return s===re?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ge(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function et(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Rt(n){var s=et(n)?"checked":"value",o=Object.getOwnPropertyDescriptor(n.constructor.prototype,s),c=""+n[s];if(!n.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,g=o.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return h.call(this)},set:function(j){c=""+j,g.call(this,j)}}),Object.defineProperty(n,s,{enumerable:o.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function yn(n){n._valueTracker||(n._valueTracker=Rt(n))}function Tr(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var o=s.getValue(),c="";return n&&(c=et(n)?n.checked?"true":"false":n.value),n=c,n!==o?(s.setValue(n),!0):!1}function Jn(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Lr(n,s){var o=s.checked;return K({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??n._wrapperState.initialChecked})}function ui(n,s){var o=s.defaultValue==null?"":s.defaultValue,c=s.checked!=null?s.checked:s.defaultChecked;o=Ge(s.value!=null?s.value:o),n._wrapperState={initialChecked:c,initialValue:o,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Yr(n,s){s=s.checked,s!=null&&F(n,"checked",s,!1)}function Ms(n,s){Yr(n,s);var o=Ge(s.value),c=s.type;if(o!=null)c==="number"?(o===0&&n.value===""||n.value!=o)&&(n.value=""+o):n.value!==""+o&&(n.value=""+o);else if(c==="submit"||c==="reset"){n.removeAttribute("value");return}s.hasOwnProperty("value")?Xr(n,s.type,o):s.hasOwnProperty("defaultValue")&&Xr(n,s.type,Ge(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(n.defaultChecked=!!s.defaultChecked)}function Ar(n,s,o){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var c=s.type;if(!(c!=="submit"&&c!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+n._wrapperState.initialValue,o||s===n.value||(n.value=s),n.defaultValue=s}o=n.name,o!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,o!==""&&(n.name=o)}function Xr(n,s,o){(s!=="number"||Jn(n.ownerDocument)!==n)&&(o==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+o&&(n.defaultValue=""+o))}var pr=Array.isArray;function vn(n,s,o,c){if(n=n.options,s){s={};for(var h=0;h"+s.valueOf().toString()+"",s=le.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;s.firstChild;)n.appendChild(s.firstChild)}});function ce(n,s){if(s){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=s;return}}n.textContent=s}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},We=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(n){We.forEach(function(s){s=s+n.charAt(0).toUpperCase()+n.substring(1),Ae[s]=Ae[n]})});function St(n,s,o){return s==null||typeof s=="boolean"||s===""?"":o||typeof s!="number"||s===0||Ae.hasOwnProperty(n)&&Ae[n]?(""+s).trim():s+"px"}function Tt(n,s){n=n.style;for(var o in s)if(s.hasOwnProperty(o)){var c=o.indexOf("--")===0,h=St(o,s[o],c);o==="float"&&(o="cssFloat"),c?n.setProperty(o,h):n[o]=h}}var Ft=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $n(n,s){if(s){if(Ft[n]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function Ir(n,s){if(n.indexOf("-")===-1)return typeof s.is=="string";switch(n){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 Mr=null;function es(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Fr=null,mr=null,Tn=null;function Yn(n){if(n=ja(n)){if(typeof Fr!="function")throw Error(r(280));var s=n.stateNode;s&&(s=zo(s),Fr(n.stateNode,n.type,s))}}function yo(n){mr?Tn?Tn.push(n):Tn=[n]:mr=n}function Fe(){if(mr){var n=mr,s=Tn;if(Tn=mr=null,Yn(n),s)for(n=0;n>>=0,n===0?32:31-(Xx(n)/e0|0)|0}var jo=64,_o=4194304;function sa(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function So(n,s){var o=n.pendingLanes;if(o===0)return 0;var c=0,h=n.suspendedLanes,g=n.pingedLanes,j=o&268435455;if(j!==0){var C=j&~h;C!==0?c=sa(C):(g&=j,g!==0&&(c=sa(g)))}else j=o&~h,j!==0?c=sa(j):g!==0&&(c=sa(g));if(c===0)return 0;if(s!==0&&s!==c&&(s&h)===0&&(h=c&-c,g=s&-s,h>=g||h===16&&(g&4194240)!==0))return s;if((c&4)!==0&&(c|=o&16),s=n.entangledLanes,s!==0)for(n=n.entanglements,s&=c;0o;o++)s.push(n);return s}function ia(n,s,o){n.pendingLanes|=s,s!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,s=31-er(s),n[s]=o}function s0(n,s){var o=n.pendingLanes&~s;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=s,n.mutableReadLanes&=s,n.entangledLanes&=s,s=n.entanglements;var c=n.eventTimes;for(n=n.expirationTimes;0=ha),vh=" ",xh=!1;function wh(n,s){switch(n){case"keyup":return T0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bh(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var fi=!1;function A0(n,s){switch(n){case"compositionend":return bh(s);case"keypress":return s.which!==32?null:(xh=!0,vh);case"textInput":return n=s.data,n===vh&&xh?null:n;default:return null}}function I0(n,s){if(fi)return n==="compositionend"||!Pu&&wh(n,s)?(n=fh(),Po=_u=is=null,fi=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:o,offset:s-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Eh(o)}}function Oh(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?Oh(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Rh(){for(var n=window,s=Jn();s instanceof n.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)n=s.contentWindow;else break;s=Jn(n.document)}return s}function Tu(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}function q0(n){var s=Rh(),o=n.focusedElem,c=n.selectionRange;if(s!==o&&o&&o.ownerDocument&&Oh(o.ownerDocument.documentElement,o)){if(c!==null&&Tu(o)){if(s=c.start,n=c.end,n===void 0&&(n=s),"selectionStart"in o)o.selectionStart=s,o.selectionEnd=Math.min(n,o.value.length);else if(n=(s=o.ownerDocument||document)&&s.defaultView||window,n.getSelection){n=n.getSelection();var h=o.textContent.length,g=Math.min(c.start,h);c=c.end===void 0?g:Math.min(c.end,h),!n.extend&&g>c&&(h=c,c=g,g=h),h=Ph(o,g);var j=Ph(o,c);h&&j&&(n.rangeCount!==1||n.anchorNode!==h.node||n.anchorOffset!==h.offset||n.focusNode!==j.node||n.focusOffset!==j.offset)&&(s=s.createRange(),s.setStart(h.node,h.offset),n.removeAllRanges(),g>c?(n.addRange(s),n.extend(j.node,j.offset)):(s.setEnd(j.node,j.offset),n.addRange(s)))}}for(s=[],n=o;n=n.parentNode;)n.nodeType===1&&s.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,hi=null,Lu=null,ya=null,Au=!1;function Th(n,s,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Au||hi==null||hi!==Jn(c)||(c=hi,"selectionStart"in c&&Tu(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ya&&ga(ya,c)||(ya=c,c=Fo(Lu,"onSelect"),0vi||(n.current=Wu[vi],Wu[vi]=null,vi--)}function ft(n,s){vi++,Wu[vi]=n.current,n.current=s}var us={},Qt=ls(us),bn=ls(!1),zs=us;function xi(n,s){var o=n.type.contextTypes;if(!o)return us;var c=n.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===s)return c.__reactInternalMemoizedMaskedChildContext;var h={},g;for(g in o)h[g]=s[g];return c&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=s,n.__reactInternalMemoizedMaskedChildContext=h),h}function jn(n){return n=n.childContextTypes,n!=null}function Uo(){pt(bn),pt(Qt)}function Kh(n,s,o){if(Qt.current!==us)throw Error(r(168));ft(Qt,s),ft(bn,o)}function Qh(n,s,o){var c=n.stateNode;if(s=s.childContextTypes,typeof c.getChildContext!="function")return o;c=c.getChildContext();for(var h in c)if(!(h in s))throw Error(r(108,Ce(n)||"Unknown",h));return K({},o,c)}function Vo(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||us,zs=Qt.current,ft(Qt,n),ft(bn,bn.current),!0}function Zh(n,s,o){var c=n.stateNode;if(!c)throw Error(r(169));o?(n=Qh(n,s,zs),c.__reactInternalMemoizedMergedChildContext=n,pt(bn),pt(Qt),ft(Qt,n)):pt(bn),ft(bn,o)}var $r=null,Bo=!1,Ku=!1;function Gh(n){$r===null?$r=[n]:$r.push(n)}function n1(n){Bo=!0,Gh(n)}function cs(){if(!Ku&&$r!==null){Ku=!0;var n=0,s=ut;try{var o=$r;for(ut=1;n>=j,h-=j,zr=1<<32-er(s)+h|o<Me?(Bt=Te,Te=null):Bt=Te.sibling;var nt=Y(U,Te,B[Me],se);if(nt===null){Te===null&&(Te=Bt);break}n&&Te&&nt.alternate===null&&s(U,Te),A=g(nt,A,Me),Re===null?Se=nt:Re.sibling=nt,Re=nt,Te=Bt}if(Me===B.length)return o(U,Te),gt&&Vs(U,Me),Se;if(Te===null){for(;MeMe?(Bt=Te,Te=null):Bt=Te.sibling;var xs=Y(U,Te,nt.value,se);if(xs===null){Te===null&&(Te=Bt);break}n&&Te&&xs.alternate===null&&s(U,Te),A=g(xs,A,Me),Re===null?Se=xs:Re.sibling=xs,Re=xs,Te=Bt}if(nt.done)return o(U,Te),gt&&Vs(U,Me),Se;if(Te===null){for(;!nt.done;Me++,nt=B.next())nt=te(U,nt.value,se),nt!==null&&(A=g(nt,A,Me),Re===null?Se=nt:Re.sibling=nt,Re=nt);return gt&&Vs(U,Me),Se}for(Te=c(U,Te);!nt.done;Me++,nt=B.next())nt=he(Te,U,Me,nt.value,se),nt!==null&&(n&&nt.alternate!==null&&Te.delete(nt.key===null?Me:nt.key),A=g(nt,A,Me),Re===null?Se=nt:Re.sibling=nt,Re=nt);return n&&Te.forEach(function(M1){return s(U,M1)}),gt&&Vs(U,Me),Se}function Ot(U,A,B,se){if(typeof B=="object"&&B!==null&&B.type===X&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case k:e:{for(var Se=B.key,Re=A;Re!==null;){if(Re.key===Se){if(Se=B.type,Se===X){if(Re.tag===7){o(U,Re.sibling),A=h(Re,B.props.children),A.return=U,U=A;break e}}else if(Re.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===R&&np(Se)===Re.type){o(U,Re.sibling),A=h(Re,B.props),A.ref=_a(U,Re,B),A.return=U,U=A;break e}o(U,Re);break}else s(U,Re);Re=Re.sibling}B.type===X?(A=Gs(B.props.children,U.mode,se,B.key),A.return=U,U=A):(se=yl(B.type,B.key,B.props,null,U.mode,se),se.ref=_a(U,A,B),se.return=U,U=se)}return j(U);case I:e:{for(Re=B.key;A!==null;){if(A.key===Re)if(A.tag===4&&A.stateNode.containerInfo===B.containerInfo&&A.stateNode.implementation===B.implementation){o(U,A.sibling),A=h(A,B.children||[]),A.return=U,U=A;break e}else{o(U,A);break}else s(U,A);A=A.sibling}A=qc(B,U.mode,se),A.return=U,U=A}return j(U);case R:return Re=B._init,Ot(U,A,Re(B._payload),se)}if(pr(B))return be(U,A,B,se);if(W(B))return _e(U,A,B,se);Ko(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,A!==null&&A.tag===6?(o(U,A.sibling),A=h(A,B),A.return=U,U=A):(o(U,A),A=Bc(B,U.mode,se),A.return=U,U=A),j(U)):o(U,A)}return Ot}var _i=rp(!0),sp=rp(!1),Qo=ls(null),Zo=null,Si=null,Xu=null;function ec(){Xu=Si=Zo=null}function tc(n){var s=Qo.current;pt(Qo),n._currentValue=s}function nc(n,s,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),n===o)break;n=n.return}}function ki(n,s){Zo=n,Xu=Si=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&s)!==0&&(_n=!0),n.firstContext=null)}function Vn(n){var s=n._currentValue;if(Xu!==n)if(n={context:n,memoizedValue:s,next:null},Si===null){if(Zo===null)throw Error(r(308));Si=n,Zo.dependencies={lanes:0,firstContext:n}}else Si=Si.next=n;return s}var Bs=null;function rc(n){Bs===null?Bs=[n]:Bs.push(n)}function ip(n,s,o,c){var h=s.interleaved;return h===null?(o.next=o,rc(s)):(o.next=h.next,h.next=o),s.interleaved=o,Vr(n,c)}function Vr(n,s){n.lanes|=s;var o=n.alternate;for(o!==null&&(o.lanes|=s),o=n,n=n.return;n!==null;)n.childLanes|=s,o=n.alternate,o!==null&&(o.childLanes|=s),o=n,n=n.return;return o.tag===3?o.stateNode:null}var ds=!1;function sc(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ap(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Br(n,s){return{eventTime:n,lane:s,tag:0,payload:null,callback:null,next:null}}function fs(n,s,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var h=c.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),c.pending=s,Vr(n,o)}return h=c.interleaved,h===null?(s.next=s,rc(c)):(s.next=h.next,h.next=s),c.interleaved=s,Vr(n,o)}function Go(n,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194240)!==0)){var c=s.lanes;c&=n.pendingLanes,o|=c,s.lanes=o,vu(n,o)}}function op(n,s){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var h=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var j={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?h=g=j:g=g.next=j,o=o.next}while(o!==null);g===null?h=g=s:g=g.next=s}else h=g=s;o={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,effects:c.effects},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=s:n.next=s,o.lastBaseUpdate=s}function Jo(n,s,o,c){var h=n.updateQueue;ds=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,C=h.shared.pending;if(C!==null){h.shared.pending=null;var O=C,q=O.next;O.next=null,j===null?g=q:j.next=q,j=O;var ee=n.alternate;ee!==null&&(ee=ee.updateQueue,C=ee.lastBaseUpdate,C!==j&&(C===null?ee.firstBaseUpdate=q:C.next=q,ee.lastBaseUpdate=O))}if(g!==null){var te=h.baseState;j=0,ee=q=O=null,C=g;do{var Y=C.lane,he=C.eventTime;if((c&Y)===Y){ee!==null&&(ee=ee.next={eventTime:he,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var be=n,_e=C;switch(Y=s,he=o,_e.tag){case 1:if(be=_e.payload,typeof be=="function"){te=be.call(he,te,Y);break e}te=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=_e.payload,Y=typeof be=="function"?be.call(he,te,Y):be,Y==null)break e;te=K({},te,Y);break e;case 2:ds=!0}}C.callback!==null&&C.lane!==0&&(n.flags|=64,Y=h.effects,Y===null?h.effects=[C]:Y.push(C))}else he={eventTime:he,lane:Y,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ee===null?(q=ee=he,O=te):ee=ee.next=he,j|=Y;if(C=C.next,C===null){if(C=h.shared.pending,C===null)break;Y=C,C=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);if(ee===null&&(O=te),h.baseState=O,h.firstBaseUpdate=q,h.lastBaseUpdate=ee,s=h.shared.interleaved,s!==null){h=s;do j|=h.lane,h=h.next;while(h!==s)}else g===null&&(h.shared.lanes=0);Ws|=j,n.lanes=j,n.memoizedState=te}}function lp(n,s,o){if(n=s.effects,s.effects=null,n!==null)for(s=0;so?o:4,n(!0);var c=uc.transition;uc.transition={};try{n(!1),s()}finally{ut=o,uc.transition=c}}function Cp(){return Bn().memoizedState}function a1(n,s,o){var c=gs(n);if(o={lane:c,action:o,hasEagerState:!1,eagerState:null,next:null},Ep(n))Pp(s,o);else if(o=ip(n,s,o,c),o!==null){var h=on();ar(o,n,c,h),Op(o,s,c)}}function o1(n,s,o){var c=gs(n),h={lane:c,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ep(n))Pp(s,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var j=s.lastRenderedState,C=g(j,o);if(h.hasEagerState=!0,h.eagerState=C,tr(C,j)){var O=s.interleaved;O===null?(h.next=h,rc(s)):(h.next=O.next,O.next=h),s.interleaved=h;return}}catch{}o=ip(n,s,h,c),o!==null&&(h=on(),ar(o,n,c,h),Op(o,s,c))}}function Ep(n){var s=n.alternate;return n===bt||s!==null&&s===bt}function Pp(n,s){Ca=el=!0;var o=n.pending;o===null?s.next=s:(s.next=o.next,o.next=s),n.pending=s}function Op(n,s,o){if((o&4194240)!==0){var c=s.lanes;c&=n.pendingLanes,o|=c,s.lanes=o,vu(n,o)}}var rl={readContext:Vn,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},l1={readContext:Vn,useCallback:function(n,s){return wr().memoizedState=[n,s===void 0?null:s],n},useContext:Vn,useEffect:xp,useImperativeHandle:function(n,s,o){return o=o!=null?o.concat([n]):null,tl(4194308,4,jp.bind(null,s,n),o)},useLayoutEffect:function(n,s){return tl(4194308,4,n,s)},useInsertionEffect:function(n,s){return tl(4,2,n,s)},useMemo:function(n,s){var o=wr();return s=s===void 0?null:s,n=n(),o.memoizedState=[n,s],n},useReducer:function(n,s,o){var c=wr();return s=o!==void 0?o(s):s,c.memoizedState=c.baseState=s,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:s},c.queue=n,n=n.dispatch=a1.bind(null,bt,n),[c.memoizedState,n]},useRef:function(n){var s=wr();return n={current:n},s.memoizedState=n},useState:yp,useDebugValue:gc,useDeferredValue:function(n){return wr().memoizedState=n},useTransition:function(){var n=yp(!1),s=n[0];return n=i1.bind(null,n[1]),wr().memoizedState=n,[s,n]},useMutableSource:function(){},useSyncExternalStore:function(n,s,o){var c=bt,h=wr();if(gt){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),Vt===null)throw Error(r(349));(Hs&30)!==0||fp(c,s,o)}h.memoizedState=o;var g={value:o,getSnapshot:s};return h.queue=g,xp(pp.bind(null,c,g,n),[n]),c.flags|=2048,Oa(9,hp.bind(null,c,g,o,s),void 0,null),o},useId:function(){var n=wr(),s=Vt.identifierPrefix;if(gt){var o=Ur,c=zr;o=(c&~(1<<32-er(c)-1)).toString(32)+o,s=":"+s+"R"+o,o=Ea++,0<\/script>",n=n.removeChild(n.firstChild)):typeof c.is=="string"?n=j.createElement(o,{is:c.is}):(n=j.createElement(o),o==="select"&&(j=n,c.multiple?j.multiple=!0:c.size&&(j.size=c.size))):n=j.createElementNS(n,o),n[vr]=s,n[ba]=c,Gp(n,s,!1,!1),s.stateNode=n;e:{switch(j=Ir(o,c),o){case"dialog":ht("cancel",n),ht("close",n),h=c;break;case"iframe":case"object":case"embed":ht("load",n),h=c;break;case"video":case"audio":for(h=0;hOi&&(s.flags|=128,c=!0,Ra(g,!1),s.lanes=4194304)}else{if(!c)if(n=Yo(j),n!==null){if(s.flags|=128,c=!0,o=n.updateQueue,o!==null&&(s.updateQueue=o,s.flags|=4),Ra(g,!0),g.tail===null&&g.tailMode==="hidden"&&!j.alternate&&!gt)return Gt(s),null}else 2*Pt()-g.renderingStartTime>Oi&&o!==1073741824&&(s.flags|=128,c=!0,Ra(g,!1),s.lanes=4194304);g.isBackwards?(j.sibling=s.child,s.child=j):(o=g.last,o!==null?o.sibling=j:s.child=j,g.last=j)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Pt(),s.sibling=null,o=wt.current,ft(wt,c?o&1|2:o&1),s):(Gt(s),null);case 22:case 23:return zc(),c=s.memoizedState!==null,n!==null&&n.memoizedState!==null!==c&&(s.flags|=8192),c&&(s.mode&1)!==0?(Mn&1073741824)!==0&&(Gt(s),s.subtreeFlags&6&&(s.flags|=8192)):Gt(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function g1(n,s){switch(Zu(s),s.tag){case 1:return jn(s.type)&&Uo(),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Ni(),pt(bn),pt(Qt),lc(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 5:return ac(s),null;case 13:if(pt(wt),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ji()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return pt(wt),null;case 4:return Ni(),null;case 10:return tc(s.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var ol=!1,Jt=!1,y1=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Ei(n,s){var o=n.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(c){kt(n,s,c)}else o.current=null}function Ec(n,s,o){try{o()}catch(c){kt(n,s,c)}}var Xp=!1;function v1(n,s){if(zu=Co,n=Rh(),Tu(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var j=0,C=-1,O=-1,q=0,ee=0,te=n,Y=null;t:for(;;){for(var he;te!==o||h!==0&&te.nodeType!==3||(C=j+h),te!==g||c!==0&&te.nodeType!==3||(O=j+c),te.nodeType===3&&(j+=te.nodeValue.length),(he=te.firstChild)!==null;)Y=te,te=he;for(;;){if(te===n)break t;if(Y===o&&++q===h&&(C=j),Y===g&&++ee===c&&(O=j),(he=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=he}o=C===-1||O===-1?null:{start:C,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(Uu={focusedElem:n,selectionRange:o},Co=!1,xe=s;xe!==null;)if(s=xe,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,xe=n;else for(;xe!==null;){s=xe;try{var be=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var _e=be.memoizedProps,Ot=be.memoizedState,U=s.stateNode,A=U.getSnapshotBeforeUpdate(s.elementType===s.type?_e:rr(s.type,_e),Ot);U.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var B=s.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(se){kt(s,s.return,se)}if(n=s.sibling,n!==null){n.return=s.return,xe=n;break}xe=s.return}return be=Xp,Xp=!1,be}function Ta(n,s,o){var c=s.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&n)===n){var g=h.destroy;h.destroy=void 0,g!==void 0&&Ec(s,o,g)}h=h.next}while(h!==c)}}function ll(n,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&n)===n){var c=o.create;o.destroy=c()}o=o.next}while(o!==s)}}function Pc(n){var s=n.ref;if(s!==null){var o=n.stateNode;n.tag,n=o,typeof s=="function"?s(n):s.current=n}}function em(n){var s=n.alternate;s!==null&&(n.alternate=null,em(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&(delete s[vr],delete s[ba],delete s[Hu],delete s[e1],delete s[t1])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function tm(n){return n.tag===5||n.tag===3||n.tag===4}function nm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||tm(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Oc(n,s,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?o.nodeType===8?o.parentNode.insertBefore(n,s):o.insertBefore(n,s):(o.nodeType===8?(s=o.parentNode,s.insertBefore(n,o)):(s=o,s.appendChild(n)),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=$o));else if(c!==4&&(n=n.child,n!==null))for(Oc(n,s,o),n=n.sibling;n!==null;)Oc(n,s,o),n=n.sibling}function Rc(n,s,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?o.insertBefore(n,s):o.appendChild(n);else if(c!==4&&(n=n.child,n!==null))for(Rc(n,s,o),n=n.sibling;n!==null;)Rc(n,s,o),n=n.sibling}var Ht=null,sr=!1;function hs(n,s,o){for(o=o.child;o!==null;)rm(n,s,o),o=o.sibling}function rm(n,s,o){if(yr&&typeof yr.onCommitFiberUnmount=="function")try{yr.onCommitFiberUnmount(bo,o)}catch{}switch(o.tag){case 5:Jt||Ei(o,s);case 6:var c=Ht,h=sr;Ht=null,hs(n,s,o),Ht=c,sr=h,Ht!==null&&(sr?(n=Ht,o=o.stateNode,n.nodeType===8?n.parentNode.removeChild(o):n.removeChild(o)):Ht.removeChild(o.stateNode));break;case 18:Ht!==null&&(sr?(n=Ht,o=o.stateNode,n.nodeType===8?qu(n.parentNode,o):n.nodeType===1&&qu(n,o),ca(n)):qu(Ht,o.stateNode));break;case 4:c=Ht,h=sr,Ht=o.stateNode.containerInfo,sr=!0,hs(n,s,o),Ht=c,sr=h;break;case 0:case 11:case 14:case 15:if(!Jt&&(c=o.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var g=h,j=g.destroy;g=g.tag,j!==void 0&&((g&2)!==0||(g&4)!==0)&&Ec(o,s,j),h=h.next}while(h!==c)}hs(n,s,o);break;case 1:if(!Jt&&(Ei(o,s),c=o.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=o.memoizedProps,c.state=o.memoizedState,c.componentWillUnmount()}catch(C){kt(o,s,C)}hs(n,s,o);break;case 21:hs(n,s,o);break;case 22:o.mode&1?(Jt=(c=Jt)||o.memoizedState!==null,hs(n,s,o),Jt=c):hs(n,s,o);break;default:hs(n,s,o)}}function sm(n){var s=n.updateQueue;if(s!==null){n.updateQueue=null;var o=n.stateNode;o===null&&(o=n.stateNode=new y1),s.forEach(function(c){var h=C1.bind(null,n,c);o.has(c)||(o.add(c),c.then(h,h))})}}function ir(n,s){var o=s.deletions;if(o!==null)for(var c=0;ch&&(h=j),c&=~g}if(c=h,c=Pt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*w1(c/1960))-c,10n?16:n,ms===null)var c=!1;else{if(n=ms,ms=null,hl=0,(tt&6)!==0)throw Error(r(331));var h=tt;for(tt|=4,xe=n.current;xe!==null;){var g=xe,j=g.child;if((xe.flags&16)!==0){var C=g.deletions;if(C!==null){for(var O=0;OPt()-Ac?Qs(n,0):Lc|=o),kn(n,s)}function ym(n,s){s===0&&((n.mode&1)===0?s=1:(s=_o,_o<<=1,(_o&130023424)===0&&(_o=4194304)));var o=on();n=Vr(n,s),n!==null&&(ia(n,s,o),kn(n,o))}function N1(n){var s=n.memoizedState,o=0;s!==null&&(o=s.retryLane),ym(n,o)}function C1(n,s){var o=0;switch(n.tag){case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(o=h.retryLane);break;case 19:c=n.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(s),ym(n,o)}var vm;vm=function(n,s,o){if(n!==null)if(n.memoizedProps!==s.pendingProps||bn.current)_n=!0;else{if((n.lanes&o)===0&&(s.flags&128)===0)return _n=!1,p1(n,s,o);_n=(n.flags&131072)!==0}else _n=!1,gt&&(s.flags&1048576)!==0&&Jh(s,Ho,s.index);switch(s.lanes=0,s.tag){case 2:var c=s.type;al(n,s),n=s.pendingProps;var h=xi(s,Qt.current);ki(s,o),h=dc(null,s,c,n,h,o);var g=fc();return s.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,jn(c)?(g=!0,Vo(s)):g=!1,s.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,sc(s),h.updater=sl,s.stateNode=h,h._reactInternals=s,vc(s,c,n,o),s=jc(null,s,c,!0,g,o)):(s.tag=0,gt&&g&&Qu(s),an(null,s,h,o),s=s.child),s;case 16:c=s.elementType;e:{switch(al(n,s),n=s.pendingProps,h=c._init,c=h(c._payload),s.type=c,h=s.tag=P1(c),n=rr(c,n),h){case 0:s=bc(null,s,c,n,o);break e;case 1:s=qp(null,s,c,n,o);break e;case 11:s=$p(null,s,c,n,o);break e;case 14:s=zp(null,s,c,rr(c.type,n),o);break e}throw Error(r(306,c,""))}return s;case 0:return c=s.type,h=s.pendingProps,h=s.elementType===c?h:rr(c,h),bc(n,s,c,h,o);case 1:return c=s.type,h=s.pendingProps,h=s.elementType===c?h:rr(c,h),qp(n,s,c,h,o);case 3:e:{if(Hp(s),n===null)throw Error(r(387));c=s.pendingProps,g=s.memoizedState,h=g.element,ap(n,s),Jo(s,c,null,o);var j=s.memoizedState;if(c=j.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:j.cache,pendingSuspenseBoundaries:j.pendingSuspenseBoundaries,transitions:j.transitions},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){h=Ci(Error(r(423)),s),s=Wp(n,s,c,o,h);break e}else if(c!==h){h=Ci(Error(r(424)),s),s=Wp(n,s,c,o,h);break e}else for(In=os(s.stateNode.containerInfo.firstChild),An=s,gt=!0,nr=null,o=sp(s,null,c,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ji(),c===h){s=qr(n,s,o);break e}an(n,s,c,o)}s=s.child}return s;case 5:return up(s),n===null&&Ju(s),c=s.type,h=s.pendingProps,g=n!==null?n.memoizedProps:null,j=h.children,Vu(c,h)?j=null:g!==null&&Vu(c,g)&&(s.flags|=32),Bp(n,s),an(n,s,j,o),s.child;case 6:return n===null&&Ju(s),null;case 13:return Kp(n,s,o);case 4:return ic(s,s.stateNode.containerInfo),c=s.pendingProps,n===null?s.child=_i(s,null,c,o):an(n,s,c,o),s.child;case 11:return c=s.type,h=s.pendingProps,h=s.elementType===c?h:rr(c,h),$p(n,s,c,h,o);case 7:return an(n,s,s.pendingProps,o),s.child;case 8:return an(n,s,s.pendingProps.children,o),s.child;case 12:return an(n,s,s.pendingProps.children,o),s.child;case 10:e:{if(c=s.type._context,h=s.pendingProps,g=s.memoizedProps,j=h.value,ft(Qo,c._currentValue),c._currentValue=j,g!==null)if(tr(g.value,j)){if(g.children===h.children&&!bn.current){s=qr(n,s,o);break e}}else for(g=s.child,g!==null&&(g.return=s);g!==null;){var C=g.dependencies;if(C!==null){j=g.child;for(var O=C.firstContext;O!==null;){if(O.context===c){if(g.tag===1){O=Br(-1,o&-o),O.tag=2;var q=g.updateQueue;if(q!==null){q=q.shared;var ee=q.pending;ee===null?O.next=O:(O.next=ee.next,ee.next=O),q.pending=O}}g.lanes|=o,O=g.alternate,O!==null&&(O.lanes|=o),nc(g.return,o,s),C.lanes|=o;break}O=O.next}}else if(g.tag===10)j=g.type===s.type?null:g.child;else if(g.tag===18){if(j=g.return,j===null)throw Error(r(341));j.lanes|=o,C=j.alternate,C!==null&&(C.lanes|=o),nc(j,o,s),j=g.sibling}else j=g.child;if(j!==null)j.return=g;else for(j=g;j!==null;){if(j===s){j=null;break}if(g=j.sibling,g!==null){g.return=j.return,j=g;break}j=j.return}g=j}an(n,s,h.children,o),s=s.child}return s;case 9:return h=s.type,c=s.pendingProps.children,ki(s,o),h=Vn(h),c=c(h),s.flags|=1,an(n,s,c,o),s.child;case 14:return c=s.type,h=rr(c,s.pendingProps),h=rr(c.type,h),zp(n,s,c,h,o);case 15:return Up(n,s,s.type,s.pendingProps,o);case 17:return c=s.type,h=s.pendingProps,h=s.elementType===c?h:rr(c,h),al(n,s),s.tag=1,jn(c)?(n=!0,Vo(s)):n=!1,ki(s,o),Tp(s,c,h),vc(s,c,h,o),jc(null,s,c,!0,n,o);case 19:return Zp(n,s,o);case 22:return Vp(n,s,o)}throw Error(r(156,s.tag))};function xm(n,s){return Yf(n,s)}function E1(n,s,o,c){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(n,s,o,c){return new E1(n,s,o,c)}function Vc(n){return n=n.prototype,!(!n||!n.isReactComponent)}function P1(n){if(typeof n=="function")return Vc(n)?1:0;if(n!=null){if(n=n.$$typeof,n===J)return 11;if(n===M)return 14}return 2}function vs(n,s){var o=n.alternate;return o===null?(o=Hn(n.tag,s,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=s,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&14680064,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,s=n.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o}function yl(n,s,o,c,h,g){var j=2;if(c=n,typeof n=="function")Vc(n)&&(j=1);else if(typeof n=="string")j=5;else e:switch(n){case X:return Gs(o.children,h,g,s);case re:j=8,h|=8;break;case de:return n=Hn(12,o,s,h|2),n.elementType=de,n.lanes=g,n;case ve:return n=Hn(13,o,s,h),n.elementType=ve,n.lanes=g,n;case me:return n=Hn(19,o,s,h),n.elementType=me,n.lanes=g,n;case G:return vl(o,h,g,s);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Z:j=10;break e;case Oe:j=9;break e;case J:j=11;break e;case M:j=14;break e;case R:j=16,c=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return s=Hn(j,o,s,h),s.elementType=n,s.type=c,s.lanes=g,s}function Gs(n,s,o,c){return n=Hn(7,n,c,s),n.lanes=o,n}function vl(n,s,o,c){return n=Hn(22,n,c,s),n.elementType=G,n.lanes=o,n.stateNode={isHidden:!1},n}function Bc(n,s,o){return n=Hn(6,n,null,s),n.lanes=o,n}function qc(n,s,o){return s=Hn(4,n.children!==null?n.children:[],n.key,s),s.lanes=o,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}function O1(n,s,o,c,h){this.tag=s,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yu(0),this.expirationTimes=yu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yu(0),this.identifierPrefix=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Hc(n,s,o,c,h,g,j,C,O){return n=new O1(n,s,o,C,O),s===1?(s=1,g===!0&&(s|=8)):s=0,g=Hn(3,null,null,s),n.current=g,g.stateNode=n,g.memoizedState={element:c,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},sc(g),n}function R1(n,s,o){var c=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Jc.exports=B1(),Jc.exports}var Lm;function q1(){if(Lm)return kl;Lm=1;var t=By();return kl.createRoot=t.createRoot,kl.hydrateRoot=t.hydrateRoot,kl}var H1=q1();const W1=iu(H1);var ed={exports:{}},td={};var Am;function K1(){if(Am)return td;Am=1;var t=po();function e(w,y){return w===y&&(w!==0||1/w===1/y)||w!==w&&y!==y}var r=typeof Object.is=="function"?Object.is:e,i=t.useState,a=t.useEffect,l=t.useLayoutEffect,d=t.useDebugValue;function f(w,y){var x=y(),S=i({inst:{value:x,getSnapshot:y}}),_=S[0].inst,b=S[1];return l(function(){_.value=x,_.getSnapshot=y,m(_)&&b({inst:_})},[w,x,y]),a(function(){return m(_)&&b({inst:_}),w(function(){m(_)&&b({inst:_})})},[w]),d(x),x}function m(w){var y=w.getSnapshot;w=w.value;try{var x=y();return!r(w,x)}catch{return!0}}function p(w,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return td.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,td}var Im;function qy(){return Im||(Im=1,ed.exports=K1()),ed.exports}qy();var nd={exports:{}},rd={};var Mm;function Q1(){if(Mm)return rd;Mm=1;var t=po(),e=qy();function r(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var i=typeof Object.is=="function"?Object.is:r,a=e.useSyncExternalStore,l=t.useRef,d=t.useEffect,f=t.useMemo,m=t.useDebugValue;return rd.useSyncExternalStoreWithSelector=function(p,v,w,y,x){var S=l(null);if(S.current===null){var _={hasValue:!1,value:null};S.current=_}else _=S.current;S=f(function(){function P(I){if(!N){if(N=!0,F=I,I=y(I),x!==void 0&&_.hasValue){var X=_.value;if(x(X,I))return L=X}return L=I}if(X=L,i(F,I))return X;var re=y(I);return x!==void 0&&x(X,re)?(F=I,X):(F=I,L=re)}var N=!1,F,L,k=w===void 0?null:w;return[function(){return P(v())},k===null?void 0:function(){return P(k())}]},[v,w,y,x]);var b=a(p,S[0],S[1]);return d(function(){_.hasValue=!0,_.value=b},[b]),m(b),b},rd}var Fm;function Z1(){return Fm||(Fm=1,nd.exports=Q1()),nd.exports}var G1=Z1(),Hy=By();const J1=iu(Hy);function Y1(t){t()}let Wy=Y1;const X1=t=>Wy=t,ew=()=>Wy,Dm=Symbol.for("react-redux-context"),$m=typeof globalThis<"u"?globalThis:{};function tw(){var t;if(!$.createContext)return{};const e=(t=$m[Dm])!=null?t:$m[Dm]=new Map;let r=e.get($.createContext);return r||(r=$.createContext(null),e.set($.createContext,r)),r}const Rs=tw();function gf(t=Rs){return function(){return $.useContext(t)}}const Ky=gf(),nw=()=>{throw new Error("uSES not initialized!")};let Qy=nw;const rw=t=>{Qy=t},sw=(t,e)=>t===e;function iw(t=Rs){const e=t===Rs?Ky:gf(t);return function(i,a={}){const{equalityFn:l=sw,stabilityCheck:d=void 0,noopCheck:f=void 0}=typeof a=="function"?{equalityFn:a}:a,{store:m,subscription:p,getServerState:v,stabilityCheck:w,noopCheck:y}=e();$.useRef(!0);const x=$.useCallback({[i.name](_){return i(_)}}[i.name],[i,w,d]),S=Qy(p.addNestedSub,m.getState,v||m.getState,x,l);return $.useDebugValue(S),S}}const aw=iw();var sd={exports:{}},ot={};var zm;function ow(){if(zm)return ot;zm=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,a=t?Symbol.for("react.strict_mode"):60108,l=t?Symbol.for("react.profiler"):60114,d=t?Symbol.for("react.provider"):60109,f=t?Symbol.for("react.context"):60110,m=t?Symbol.for("react.async_mode"):60111,p=t?Symbol.for("react.concurrent_mode"):60111,v=t?Symbol.for("react.forward_ref"):60112,w=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,x=t?Symbol.for("react.memo"):60115,S=t?Symbol.for("react.lazy"):60116,_=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,P=t?Symbol.for("react.responder"):60118,N=t?Symbol.for("react.scope"):60119;function F(k){if(typeof k=="object"&&k!==null){var I=k.$$typeof;switch(I){case e:switch(k=k.type,k){case m:case p:case i:case l:case a:case w:return k;default:switch(k=k&&k.$$typeof,k){case f:case v:case S:case x:case d:return k;default:return I}}case r:return I}}}function L(k){return F(k)===p}return ot.AsyncMode=m,ot.ConcurrentMode=p,ot.ContextConsumer=f,ot.ContextProvider=d,ot.Element=e,ot.ForwardRef=v,ot.Fragment=i,ot.Lazy=S,ot.Memo=x,ot.Portal=r,ot.Profiler=l,ot.StrictMode=a,ot.Suspense=w,ot.isAsyncMode=function(k){return L(k)||F(k)===m},ot.isConcurrentMode=L,ot.isContextConsumer=function(k){return F(k)===f},ot.isContextProvider=function(k){return F(k)===d},ot.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===e},ot.isForwardRef=function(k){return F(k)===v},ot.isFragment=function(k){return F(k)===i},ot.isLazy=function(k){return F(k)===S},ot.isMemo=function(k){return F(k)===x},ot.isPortal=function(k){return F(k)===r},ot.isProfiler=function(k){return F(k)===l},ot.isStrictMode=function(k){return F(k)===a},ot.isSuspense=function(k){return F(k)===w},ot.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===i||k===p||k===l||k===a||k===w||k===y||typeof k=="object"&&k!==null&&(k.$$typeof===S||k.$$typeof===x||k.$$typeof===d||k.$$typeof===f||k.$$typeof===v||k.$$typeof===b||k.$$typeof===P||k.$$typeof===N||k.$$typeof===_)},ot.typeOf=F,ot}var Um;function lw(){return Um||(Um=1,sd.exports=ow()),sd.exports}var id,Vm;function uw(){if(Vm)return id;Vm=1;var t=lw(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};l[t.ForwardRef]=i,l[t.Memo]=a;function d(S){return t.isMemo(S)?a:l[S.$$typeof]||e}var f=Object.defineProperty,m=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,v=Object.getOwnPropertyDescriptor,w=Object.getPrototypeOf,y=Object.prototype;function x(S,_,b){if(typeof _!="string"){if(y){var P=w(_);P&&P!==y&&x(S,P,b)}var N=m(_);p&&(N=N.concat(p(_)));for(var F=d(S),L=d(_),k=0;k{let i=e;for(;i;)i.callback(),i=i.next})},get(){let i=[],a=e;for(;a;)i.push(a),a=a.next;return i},subscribe(i){let a=!0,l=r={callback:i,next:null,prev:r};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:r=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}const Hm={notify(){},get:()=>[]};function hw(t,e){let r,i=Hm,a=0,l=!1;function d(_){v();const b=i.subscribe(_);let P=!1;return()=>{P||(P=!0,b(),w())}}function f(){i.notify()}function m(){S.onStateChange&&S.onStateChange()}function p(){return l}function v(){a++,r||(r=t.subscribe(m),i=fw())}function w(){a--,r&&a===0&&(r(),r=void 0,i.clear(),i=Hm)}function y(){l||(l=!0,v())}function x(){l&&(l=!1,w())}const S={addNestedSub:d,notifyNestedSubs:f,handleChangeWrapper:m,isSubscribed:p,trySubscribe:y,tryUnsubscribe:x,getListeners:()=>i};return S}const pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mw=pw?$.useLayoutEffect:$.useEffect;function gw({store:t,context:e,children:r,serverState:i,stabilityCheck:a="once",noopCheck:l="once"}){const d=$.useMemo(()=>{const p=hw(t);return{store:t,subscription:p,getServerState:i?()=>i:void 0,stabilityCheck:a,noopCheck:l}},[t,i,a,l]),f=$.useMemo(()=>t.getState(),[t]);mw(()=>{const{subscription:p}=d;return p.onStateChange=p.notifyNestedSubs,p.trySubscribe(),f!==t.getState()&&p.notifyNestedSubs(),()=>{p.tryUnsubscribe(),p.onStateChange=void 0}},[d,f]);const m=e||Rs;return $.createElement(m.Provider,{value:d},r)}function Zy(t=Rs){const e=t===Rs?Ky:gf(t);return function(){const{store:i}=e();return i}}const yw=Zy();function vw(t=Rs){const e=t===Rs?yw:Zy(t);return function(){return e().dispatch}}const xw=vw();rw(G1.useSyncExternalStoreWithSelector);X1(Hy.unstable_batchedUpdates);function eo(){return eo=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function yf(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function bw(){return Math.random().toString(36).substr(2,8)}function Km(t,e){return{usr:t.state,key:t.key,idx:e}}function Od(t,e,r,i){return r===void 0&&(r=null),eo({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Yi(e):e,{state:r,key:e&&e.key||i||bw()})}function Fl(t){let{pathname:e="/",search:r="",hash:i=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Yi(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function jw(t,e,r,i){i===void 0&&(i={});let{window:a=document.defaultView,v5Compat:l=!1}=i,d=a.history,f=ks.Pop,m=null,p=v();p==null&&(p=0,d.replaceState(eo({},d.state,{idx:p}),""));function v(){return(d.state||{idx:null}).idx}function w(){f=ks.Pop;let b=v(),P=b==null?null:b-p;p=b,m&&m({action:f,location:_.location,delta:P})}function y(b,P){f=ks.Push;let N=Od(_.location,b,P);p=v()+1;let F=Km(N,p),L=_.createHref(N);try{d.pushState(F,"",L)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;a.location.assign(L)}l&&m&&m({action:f,location:_.location,delta:1})}function x(b,P){f=ks.Replace;let N=Od(_.location,b,P);p=v();let F=Km(N,p),L=_.createHref(N);d.replaceState(F,"",L),l&&m&&m({action:f,location:_.location,delta:0})}function S(b){let P=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof b=="string"?b:Fl(b);return N=N.replace(/ $/,"%20"),Et(P,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,P)}let _={get action(){return f},get location(){return t(a,d)},listen(b){if(m)throw new Error("A history only accepts one active listener");return a.addEventListener(Wm,w),m=b,()=>{a.removeEventListener(Wm,w),m=null}},createHref(b){return e(a,b)},createURL:S,encodeLocation(b){let P=S(b);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:y,replace:x,go(b){return d.go(b)}};return _}var Qm;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Qm||(Qm={}));function _w(t,e,r){return r===void 0&&(r="/"),Sw(t,e,r)}function Sw(t,e,r,i){let a=typeof e=="string"?Yi(e):e,l=Ui(a.pathname||"/",r);if(l==null)return null;let d=Gy(t);kw(d);let f=null;for(let m=0;f==null&&m{let m={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};m.relativePath.startsWith("/")&&(Et(m.relativePath.startsWith(i),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(i.length));let p=Ns([i,m.relativePath]),v=r.concat(m);l.children&&l.children.length>0&&(Et(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),Gy(l.children,e,v,p)),!(l.path==null&&!l.index)&&e.push({path:p,score:Tw(p,l.index),routesMeta:v})};return t.forEach((l,d)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))a(l,d);else for(let m of Jy(l.path))a(l,d,m)}),e}function Jy(t){let e=t.split("/");if(e.length===0)return[];let[r,...i]=e,a=r.endsWith("?"),l=r.replace(/\?$/,"");if(i.length===0)return a?[l,""]:[l];let d=Jy(i.join("/")),f=[];return f.push(...d.map(m=>m===""?l:[l,m].join("/"))),a&&f.push(...d),f.map(m=>t.startsWith("/")&&m===""?"/":m)}function kw(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:Lw(e.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}const Nw=/^:[\w-]+$/,Cw=3,Ew=2,Pw=1,Ow=10,Rw=-2,Zm=t=>t==="*";function Tw(t,e){let r=t.split("/"),i=r.length;return r.some(Zm)&&(i+=Rw),e&&(i+=Ew),r.filter(a=>!Zm(a)).reduce((a,l)=>a+(Nw.test(l)?Cw:l===""?Pw:Ow),i)}function Lw(t,e){return t.length===e.length&&t.slice(0,-1).every((i,a)=>i===e[a])?t[t.length-1]-e[e.length-1]:0}function Aw(t,e,r){let{routesMeta:i}=t,a={},l="/",d=[];for(let f=0;f{let{paramName:y,isOptional:x}=v;if(y==="*"){let _=f[w]||"";d=l.slice(0,l.length-_.length).replace(/(.)\/+$/,"$1")}const S=f[w];return x&&!S?p[y]=void 0:p[y]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:d,pattern:t}}function Iw(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),yf(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m)=>(i.push({paramName:f,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),i]}function Mw(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yf(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Ui(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,i=t.charAt(r);return i&&i!=="/"?null:t.slice(r)||"/"}const Fw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dw=t=>Fw.test(t);function $w(t,e){e===void 0&&(e="/");let{pathname:r,search:i="",hash:a=""}=typeof t=="string"?Yi(t):t,l;if(r)if(Dw(r))l=r;else{if(r.includes("//")){let d=r;r=r.replace(/\/\/+/g,"/"),yf(!1,"Pathnames cannot have embedded double slashes - normalizing "+(d+" -> "+r))}r.startsWith("/")?l=Gm(r.substring(1),"/"):l=Gm(r,e)}else l=e;return{pathname:l,search:Vw(i),hash:Bw(a)}}function Gm(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function od(t,e,r,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zw(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Yy(t,e){let r=zw(t);return e?r.map((i,a)=>a===r.length-1?i.pathname:i.pathnameBase):r.map(i=>i.pathnameBase)}function Xy(t,e,r,i){i===void 0&&(i=!1);let a;typeof t=="string"?a=Yi(t):(a=eo({},t),Et(!a.pathname||!a.pathname.includes("?"),od("?","pathname","search",a)),Et(!a.pathname||!a.pathname.includes("#"),od("#","pathname","hash",a)),Et(!a.search||!a.search.includes("#"),od("#","search","hash",a)));let l=t===""||a.pathname==="",d=l?"/":a.pathname,f;if(d==null)f=r;else{let w=e.length-1;if(!i&&d.startsWith("..")){let y=d.split("/");for(;y[0]==="..";)y.shift(),w-=1;a.pathname=y.join("/")}f=w>=0?e[w]:"/"}let m=$w(a,f),p=d&&d!=="/"&&d.endsWith("/"),v=(l||d===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(p||v)&&(m.pathname+="/"),m}const Ns=t=>t.join("/").replace(/\/\/+/g,"/"),Uw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Vw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Bw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function qw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ev=["post","put","patch","delete"];new Set(ev);const Hw=["get",...ev];new Set(Hw);function no(){return no=Object.assign?Object.assign.bind():function(t){for(var e=1;e{f.current=!0}),$.useCallback(function(p,v){if(v===void 0&&(v={}),!f.current)return;if(typeof p=="number"){i.go(p);return}let w=Xy(p,JSON.parse(d),l,v.relative==="path");t==null&&e!=="/"&&(w.pathname=w.pathname==="/"?e:Ns([e,w.pathname])),(v.replace?i.replace:i.push)(w,v.state,v)},[e,i,d,l,t])}const Qw=$.createContext(null);function Zw(t){let e=$.useContext(Jr).outlet;return e&&$.createElement(Qw.Provider,{value:t},e)}function fr(){let{matches:t}=$.useContext(Jr),e=t[t.length-1];return e?e.params:{}}function lu(t,e){let{relative:r}=e===void 0?{}:e,{future:i}=$.useContext(Is),{matches:a}=$.useContext(Jr),{pathname:l}=Xi(),d=JSON.stringify(Yy(a,i.v7_relativeSplatPath));return $.useMemo(()=>Xy(t,JSON.parse(d),l,r==="path"),[t,d,l,r])}function Gw(t,e){return Jw(t,e)}function Jw(t,e,r,i){mo()||Et(!1);let{navigator:a}=$.useContext(Is),{matches:l}=$.useContext(Jr),d=l[l.length-1],f=d?d.params:{};d&&d.pathname;let m=d?d.pathnameBase:"/";d&&d.route;let p=Xi(),v;if(e){var w;let b=typeof e=="string"?Yi(e):e;m==="/"||(w=b.pathname)!=null&&w.startsWith(m)||Et(!1),v=b}else v=p;let y=v.pathname||"/",x=y;if(m!=="/"){let b=m.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(b.length).join("/")}let S=_w(t,{pathname:x}),_=nb(S&&S.map(b=>Object.assign({},b,{params:Object.assign({},f,b.params),pathname:Ns([m,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?m:Ns([m,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),l,r,i);return e&&_?$.createElement(ou.Provider,{value:{location:no({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:ks.Pop}},_):_}function Yw(){let t=ab(),e=qw(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return $.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},e),r?$.createElement("pre",{style:a},r):null,null)}const Xw=$.createElement(Yw,null);class eb extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?$.createElement(Jr.Provider,{value:this.props.routeContext},$.createElement(nv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tb(t){let{routeContext:e,match:r,children:i}=t,a=$.useContext(au);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),$.createElement(Jr.Provider,{value:e},i)}function nb(t,e,r,i){var a;if(e===void 0&&(e=[]),r===void 0&&(r=null),i===void 0&&(i=null),t==null){var l;if(!r)return null;if(r.errors)t=r.matches;else if((l=i)!=null&&l.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let d=t,f=(a=r)==null?void 0:a.errors;if(f!=null){let v=d.findIndex(w=>w.route.id&&f?.[w.route.id]!==void 0);v>=0||Et(!1),d=d.slice(0,Math.min(d.length,v+1))}let m=!1,p=-1;if(r&&i&&i.v7_partialHydration)for(let v=0;v=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((v,w,y)=>{let x,S=!1,_=null,b=null;r&&(x=f&&w.route.id?f[w.route.id]:void 0,_=w.route.errorElement||Xw,m&&(p<0&&y===0?(lb("route-fallback"),S=!0,b=null):p===y&&(S=!0,b=w.route.hydrateFallbackElement||null)));let P=e.concat(d.slice(0,y+1)),N=()=>{let F;return x?F=_:S?F=b:w.route.Component?F=$.createElement(w.route.Component,null):w.route.element?F=w.route.element:F=v,$.createElement(tb,{match:w,routeContext:{outlet:v,matches:P,isDataRoute:r!=null},children:F})};return r&&(w.route.ErrorBoundary||w.route.errorElement||y===0)?$.createElement(eb,{location:r.location,revalidation:r.revalidation,component:_,error:x,children:N(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):N()},null)}var sv=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(sv||{}),iv=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(iv||{});function rb(t){let e=$.useContext(au);return e||Et(!1),e}function sb(t){let e=$.useContext(tv);return e||Et(!1),e}function ib(t){let e=$.useContext(Jr);return e||Et(!1),e}function av(t){let e=ib(),r=e.matches[e.matches.length-1];return r.route.id||Et(!1),r.route.id}function ab(){var t;let e=$.useContext(nv),r=sb(),i=av();return e!==void 0?e:(t=r.errors)==null?void 0:t[i]}function ob(){let{router:t}=rb(sv.UseNavigateStable),e=av(iv.UseNavigateStable),r=$.useRef(!1);return rv(()=>{r.current=!0}),$.useCallback(function(a,l){l===void 0&&(l={}),r.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,no({fromRouteId:e},l)))},[t,e])}const Jm={};function lb(t,e,r){Jm[t]||(Jm[t]=!0)}function ub(t,e){t?.v7_startTransition,t?.v7_relativeSplatPath}function cb(t){return Zw(t.context)}function ln(t){Et(!1)}function db(t){let{basename:e="/",children:r=null,location:i,navigationType:a=ks.Pop,navigator:l,static:d=!1,future:f}=t;mo()&&Et(!1);let m=e.replace(/^\/*/,"/"),p=$.useMemo(()=>({basename:m,navigator:l,static:d,future:no({v7_relativeSplatPath:!1},f)}),[m,f,l,d]);typeof i=="string"&&(i=Yi(i));let{pathname:v="/",search:w="",hash:y="",state:x=null,key:S="default"}=i,_=$.useMemo(()=>{let b=Ui(v,m);return b==null?null:{location:{pathname:b,search:w,hash:y,state:x,key:S},navigationType:a}},[m,v,w,y,x,S,a]);return _==null?null:$.createElement(Is.Provider,{value:p},$.createElement(ou.Provider,{children:r,value:_}))}function fb(t){let{children:e,location:r}=t;return Gw(Rd(e),r)}new Promise(()=>{});function Rd(t,e){e===void 0&&(e=[]);let r=[];return $.Children.forEach(t,(i,a)=>{if(!$.isValidElement(i))return;let l=[...e,a];if(i.type===$.Fragment){r.push.apply(r,Rd(i.props.children,l));return}i.type!==ln&&Et(!1),!i.props.index||!i.props.children||Et(!1);let d={id:i.props.id||l.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=Rd(i.props.children,l)),r.push(d)}),r}function Dl(){return Dl=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[a]=t[a]);return r}function hb(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function pb(t,e){return t.button===0&&(!e||e==="_self")&&!hb(t)}const mb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yb="6";try{window.__reactRouterVersion=yb}catch{}const vb=$.createContext({isTransitioning:!1}),xb="startTransition",Ym=z1[xb];function wb(t){let{basename:e,children:r,future:i,window:a}=t,l=$.useRef();l.current==null&&(l.current=ww({window:a,v5Compat:!0}));let d=l.current,[f,m]=$.useState({action:d.action,location:d.location}),{v7_startTransition:p}=i||{},v=$.useCallback(w=>{p&&Ym?Ym(()=>m(w)):m(w)},[m,p]);return $.useLayoutEffect(()=>d.listen(v),[d,v]),$.useEffect(()=>ub(i),[i]),$.createElement(db,{basename:e,children:r,location:f.location,navigationType:f.action,navigator:d,future:i})}const bb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_b=$.forwardRef(function(e,r){let{onClick:i,relative:a,reloadDocument:l,replace:d,state:f,target:m,to:p,preventScrollReset:v,viewTransition:w}=e,y=ov(e,mb),{basename:x}=$.useContext(Is),S,_=!1;if(typeof p=="string"&&jb.test(p)&&(S=p,bb))try{let F=new URL(window.location.href),L=p.startsWith("//")?new URL(F.protocol+p):new URL(p),k=Ui(L.pathname,x);L.origin===F.origin&&k!=null?p=k+L.search+L.hash:_=!0}catch{}let b=Ww(p,{relative:a}),P=Nb(p,{replace:d,state:f,target:m,preventScrollReset:v,relative:a,viewTransition:w});function N(F){i&&i(F),F.defaultPrevented||P(F)}return $.createElement("a",Dl({},y,{href:S||b,onClick:_||l?i:N,ref:r,target:m}))}),Sb=$.forwardRef(function(e,r){let{"aria-current":i="page",caseSensitive:a=!1,className:l="",end:d=!1,style:f,to:m,viewTransition:p,children:v}=e,w=ov(e,gb),y=lu(m,{relative:w.relative}),x=Xi(),S=$.useContext(tv),{navigator:_,basename:b}=$.useContext(Is),P=S!=null&&Cb(y)&&p===!0,N=_.encodeLocation?_.encodeLocation(y).pathname:y.pathname,F=x.pathname,L=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(F=F.toLowerCase(),L=L?L.toLowerCase():null,N=N.toLowerCase()),L&&b&&(L=Ui(L,b)||L);const k=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let I=F===N||!d&&F.startsWith(N)&&F.charAt(k)==="/",X=L!=null&&(L===N||!d&&L.startsWith(N)&&L.charAt(N.length)==="/"),re={isActive:I,isPending:X,isTransitioning:P},de=I?i:void 0,Z;typeof l=="function"?Z=l(re):Z=[l,I?"active":null,X?"pending":null,P?"transitioning":null].filter(Boolean).join(" ");let Oe=typeof f=="function"?f(re):f;return $.createElement(_b,Dl({},w,{"aria-current":de,className:Z,ref:r,style:Oe,to:m,viewTransition:p}),typeof v=="function"?v(re):v)});var Td;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Td||(Td={}));var Xm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Xm||(Xm={}));function kb(t){let e=$.useContext(au);return e||Et(!1),e}function Nb(t,e){let{target:r,replace:i,state:a,preventScrollReset:l,relative:d,viewTransition:f}=e===void 0?{}:e,m=mn(),p=Xi(),v=lu(t,{relative:d});return $.useCallback(w=>{if(pb(w,r)){w.preventDefault();let y=i!==void 0?i:Fl(p)===Fl(v);m(t,{replace:y,state:a,preventScrollReset:l,relative:d,viewTransition:f})}},[p,m,v,i,a,r,t,l,d,f])}function Cb(t,e){e===void 0&&(e={});let r=$.useContext(vb);r==null&&Et(!1);let{basename:i}=kb(Td.useViewTransitionState),a=lu(t,{relative:e.relative});if(!r.isTransitioning)return!1;let l=Ui(r.currentLocation.pathname,i)||r.currentLocation.pathname,d=Ui(r.nextLocation.pathname,i)||r.nextLocation.pathname;return to(a.pathname,d)!=null||to(a.pathname,l)!=null}var ea=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Eb=class extends ea{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vf=new Eb,Pb={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ob=class{#e=Pb;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Xs=new Ob;function Rb(t){setTimeout(t,0)}var Tb=typeof window>"u"||"Deno"in globalThis;function un(){}function Lb(t,e){return typeof t=="function"?t(e):t}function Ld(t){return typeof t=="number"&&t>=0&&t!==1/0}function lv(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Cs(t,e){return typeof t=="function"?t(e):t}function Fn(t,e){return typeof t=="function"?t(e):t}function eg(t,e){const{type:r="all",exact:i,fetchStatus:a,predicate:l,queryKey:d,stale:f}=t;if(d){if(i){if(e.queryHash!==xf(d,e.options))return!1}else if(!ro(e.queryKey,d))return!1}if(r!=="all"){const m=e.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||a&&a!==e.state.fetchStatus||l&&!l(e))}function tg(t,e){const{exact:r,status:i,predicate:a,mutationKey:l}=t;if(l){if(!e.options.mutationKey)return!1;if(r){if(ti(e.options.mutationKey)!==ti(l))return!1}else if(!ro(e.options.mutationKey,l))return!1}return!(i&&e.state.status!==i||a&&!a(e))}function xf(t,e){return(e?.queryKeyHashFn||ti)(t)}function ti(t){return JSON.stringify(t,(e,r)=>Ad(r)?Object.keys(r).sort().reduce((i,a)=>(i[a]=r[a],i),{}):r)}function ro(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>ro(t[r],e[r])):!1}var Ab=Object.prototype.hasOwnProperty;function uv(t,e,r=0){if(t===e)return t;if(r>500)return e;const i=ng(t)&&ng(e);if(!i&&!(Ad(t)&&Ad(e)))return e;const l=(i?t:Object.keys(t)).length,d=i?e:Object.keys(e),f=d.length,m=i?new Array(f):{};let p=0;for(let v=0;v{Xs.setTimeout(e,t)})}function Id(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?uv(t,e):e}function Mb(t,e,r=0){const i=[...t,e];return r&&i.length>r?i.slice(1):i}function Fb(t,e,r=0){const i=[e,...t];return r&&i.length>r?i.slice(0,-1):i}var wf=Symbol();function cv(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===wf?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function bf(t,e){return typeof t=="function"?t(...e):!!t}function Db(t,e,r){let i=!1,a;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(a??=e(),i||(i=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),t}var so=(()=>{let t=()=>Tb;return{isServer(){return t()},setIsServer(e){t=e}}})();function Md(){let t,e;const r=new Promise((a,l)=>{t=a,e=l});r.status="pending",r.catch(()=>{});function i(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{i({status:"fulfilled",value:a}),t(a)},r.reject=a=>{i({status:"rejected",reason:a}),e(a)},r}var $b=Rb;function zb(){let t=[],e=0,r=f=>{f()},i=f=>{f()},a=$b;const l=f=>{e?t.push(f):a(()=>{r(f)})},d=()=>{const f=t;t=[],f.length&&a(()=>{i(()=>{f.forEach(m=>{r(m)})})})};return{batch:f=>{let m;e++;try{m=f()}finally{e--,e||d()}return m},batchCalls:f=>(...m)=>{l(()=>{f(...m)})},schedule:l,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{a=f}}}var zt=zb(),Ub=class extends ea{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#e}},zl=new Ub;function Vb(t){return Math.min(1e3*2**t,3e4)}function dv(t){return(t??"online")==="online"?zl.isOnline():!0}var Fd=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function fv(t){let e=!1,r=0,i;const a=Md(),l=()=>a.status!=="pending",d=_=>{if(!l()){const b=new Fd(_);y(b),t.onCancel?.(b)}},f=()=>{e=!0},m=()=>{e=!1},p=()=>vf.isFocused()&&(t.networkMode==="always"||zl.isOnline())&&t.canRun(),v=()=>dv(t.networkMode)&&t.canRun(),w=_=>{l()||(i?.(),a.resolve(_))},y=_=>{l()||(i?.(),a.reject(_))},x=()=>new Promise(_=>{i=b=>{(l()||p())&&_(b)},t.onPause?.()}).then(()=>{i=void 0,l()||t.onContinue?.()}),S=()=>{if(l())return;let _;const b=r===0?t.initialPromise:void 0;try{_=b??t.fn()}catch(P){_=Promise.reject(P)}Promise.resolve(_).then(w).catch(P=>{if(l())return;const N=t.retry??(so.isServer()?0:3),F=t.retryDelay??Vb,L=typeof F=="function"?F(r,P):F,k=N===!0||typeof N=="number"&&rp()?void 0:x()).then(()=>{e?y(P):S()})})};return{promise:a,status:()=>a.status,cancel:d,continue:()=>(i?.(),a),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?S():x().then(S),a)}}var hv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ld(this.gcTime)&&(this.#e=Xs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(so.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Xs.clearTimeout(this.#e),this.#e=void 0)}};function Bb(t){return{onFetch:(e,r)=>{const i=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,l=e.state.data?.pages||[],d=e.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const w=S=>{Db(S,()=>e.signal,()=>v=!0)},y=cv(e.options,e.fetchOptions),x=async(S,_,b)=>{if(v)return Promise.reject(e.signal.reason);if(_==null&&S.pages.length)return Promise.resolve(S);const N=(()=>{const I={client:e.client,queryKey:e.queryKey,pageParam:_,direction:b?"backward":"forward",meta:e.options.meta};return w(I),I})(),F=await y(N),{maxPages:L}=e.options,k=b?Fb:Mb;return{pages:k(S.pages,F,L),pageParams:k(S.pageParams,_,L)}};if(a&&l.length){const S=a==="backward",_=S?qb:sg,b={pages:l,pageParams:d},P=_(i,b);f=await x(b,P,S)}else{const S=t??l.length;do{const _=m===0?d[0]??i.initialPageParam:sg(i,f);if(m>0&&_==null)break;f=await x(f,_),m++}while(me.options.persister?.(p,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=p}}}function sg(t,{pages:e,pageParams:r}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,r[i],r):void 0}function qb(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var Hb=class extends hv{#e;#t;#n;#r;#i;#s;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#r=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=ag(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(t){if(this.options={...this.#o,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=ag(this.options);e.data!==void 0&&(this.setState(ig(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){const r=Id(this.state.data,t,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Fn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Cs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lv(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#a||this.#c()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},a=()=>{const m=cv(this.options,e),v=(()=>{const w={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(w),w})();return this.#a=!1,this.options.persister?this.options.persister(m,v,this):m(v)},d=(()=>{const m={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:a};return i(m),m})();(this.#e==="infinite"?Bb(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#l({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=fv({initialPromise:e?.initialPromise,fn:d.fetchFn,onCancel:m=>{m instanceof Fd&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#l({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const m=await this.#s.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Fd){if(m.silent)return this.#s.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(t){const e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...pv(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...ig(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function pv(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dv(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ig(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ag(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,i=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Wb=class extends ea{constructor(t,e){super(),this.options=e,this.#e=t,this.#a=null,this.#o=Md(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#s;#o;#a;#c;#l;#p;#d;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),og(this.#t,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#b(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#t.setOptions(this.options),e._defaulted&&!$l(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&lg(this.#t,r,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==r||Fn(this.options.enabled,this.#t)!==Fn(e.enabled,this.#t)||Cs(this.options.staleTime,this.#t)!==Cs(e.staleTime,this.#t))&&this.#g();const a=this.#y();i&&(this.#t!==r||Fn(this.options.enabled,this.#t)!==Fn(e.enabled,this.#t)||a!==this.#u)&&this.#v(a)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),r=this.createResult(e,t);return Qb(this,r)&&(this.#r=r,this.#s=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),r=this.#e.getQueryCache().build(this.#e,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(t){this.#j();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(un)),e}#g(){this.#w();const t=Cs(this.options.staleTime,this.#t);if(so.isServer()||this.#r.isStale||!Ld(t))return;const r=lv(this.#r.dataUpdatedAt,t)+1;this.#d=Xs.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#b(),this.#u=t,!(so.isServer()||Fn(this.options.enabled,this.#t)===!1||!Ld(this.#u)||this.#u===0)&&(this.#f=Xs.setInterval(()=>{(this.options.refetchIntervalInBackground||vf.isFocused())&&this.#h()},this.#u))}#x(){this.#g(),this.#v(this.#y())}#w(){this.#d!==void 0&&(Xs.clearTimeout(this.#d),this.#d=void 0)}#b(){this.#f!==void 0&&(Xs.clearInterval(this.#f),this.#f=void 0)}createResult(t,e){const r=this.#t,i=this.options,a=this.#r,l=this.#i,d=this.#s,m=t!==r?t.state:this.#n,{state:p}=t;let v={...p},w=!1,y;if(e._optimisticResults){const re=this.hasListeners(),de=!re&&og(t,e),Z=re&&lg(t,r,e,i);(de||Z)&&(v={...v,...pv(p.data,t.options)}),e._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:_}=v;y=v.data;let b=!1;if(e.placeholderData!==void 0&&y===void 0&&_==="pending"){let re;a?.isPlaceholderData&&e.placeholderData===d?.placeholderData?(re=a.data,b=!0):re=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,re!==void 0&&(_="success",y=Id(a?.data,re,e),w=!0)}if(e.select&&y!==void 0&&!b)if(a&&y===l?.data&&e.select===this.#c)y=this.#l;else try{this.#c=e.select,y=e.select(y),y=Id(a?.data,y,e),this.#l=y,this.#a=null}catch(re){this.#a=re}this.#a&&(x=this.#a,y=this.#l,S=Date.now(),_="error");const P=v.fetchStatus==="fetching",N=_==="pending",F=_==="error",L=N&&P,k=y!==void 0,X={status:_,fetchStatus:v.fetchStatus,isPending:N,isSuccess:_==="success",isError:F,isInitialLoading:L,isLoading:L,data:y,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:P,isRefetching:P&&!N,isLoadingError:F&&!k,isPaused:v.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:F&&k,isStale:jf(t,e),refetch:this.refetch,promise:this.#o,isEnabled:Fn(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const re=X.data!==void 0,de=X.status==="error"&&!re,Z=ve=>{de?ve.reject(X.error):re&&ve.resolve(X.data)},Oe=()=>{const ve=this.#o=X.promise=Md();Z(ve)},J=this.#o;switch(J.status){case"pending":t.queryHash===r.queryHash&&Z(J);break;case"fulfilled":(de||X.data!==J.value)&&Oe();break;case"rejected":(!de||X.error!==J.reason)&&Oe();break}}return X}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#p=this.#t),$l(e,t))return;this.#r=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!this.#m.size)return!0;const l=new Set(a??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(d=>{const f=d;return this.#r[f]!==t[f]&&l.has(f)})};this.#_({listeners:r()})}#j(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#_(t){zt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Kb(t,e){return Fn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Fn(e.retryOnMount,t)===!1)}function og(t,e){return Kb(t,e)||t.state.data!==void 0&&Dd(t,e,e.refetchOnMount)}function Dd(t,e,r){if(Fn(e.enabled,t)!==!1&&Cs(e.staleTime,t)!=="static"){const i=typeof r=="function"?r(t):r;return i==="always"||i!==!1&&jf(t,e)}return!1}function lg(t,e,r,i){return(t!==e||Fn(i.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&jf(t,r)}function jf(t,e){return Fn(e.enabled,t)!==!1&&t.isStaleByTime(Cs(e.staleTime,t))}function Qb(t,e){return!$l(t.getCurrentResult(),e)}var Zb=class extends hv{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||mv(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=fv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,d)=>{this.#i({type:"failed",failureCount:l,error:d})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",a=!this.#r.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);const d=await this.options.onMutate?.(t,r);d!==this.state.context&&this.#i({type:"pending",context:d,variables:t,isPaused:a})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,t,this.state.context,this,r),await this.options.onSuccess?.(l,t,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,t,this.state.context,r),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,t,this.state.context,this,r)}catch(d){Promise.reject(d)}try{await this.options.onError?.(l,t,this.state.context,r)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,l,t,this.state.context,r)}catch(d){Promise.reject(d)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(t){const e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),zt.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function mv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gb=class extends ea{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,r){const i=new Zb({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:r});return this.add(i),i}add(t){this.#e.add(t);const e=Nl(t);if(typeof e=="string"){const r=this.#t.get(e);r?r.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Nl(t);if(typeof e=="string"){const r=this.#t.get(e);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Nl(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Nl(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){zt.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(r=>tg(e,r))}findAll(t={}){return this.getAll().filter(e=>tg(t,e))}notify(t){zt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return zt.batch(()=>Promise.all(t.map(e=>e.continue().catch(un))))}};function Nl(t){return t.options.scope?.id}var Jb=class extends ea{#e;#t=void 0;#n;#r;constructor(e,r){super(),this.#e=e,this.setOptions(r),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const r=this.options;this.options=this.#e.defaultMutationOptions(e),$l(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&ti(r.mutationKey)!==ti(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#s(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#s()}mutate(e,r){return this.#r=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){const e=this.#n?.state??mv();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#s(e){zt.batch(()=>{if(this.#r&&this.hasListeners()){const r=this.#t.variables,i=this.#t.context,a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,r,i,a)}catch(l){Promise.reject(l)}try{this.#r.onSettled?.(e.data,null,r,i,a)}catch(l){Promise.reject(l)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,r,i,a)}catch(l){Promise.reject(l)}try{this.#r.onSettled?.(void 0,e.error,r,i,a)}catch(l){Promise.reject(l)}}}this.listeners.forEach(r=>{r(this.#t)})})}},Yb=class extends ea{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){const i=e.queryKey,a=e.queryHash??xf(i,e);let l=this.get(a);return l||(l=new Hb({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(r=>eg(e,r))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(r=>eg(t,r)):e}notify(t){zt.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xb=class{#e;#t;#n;#r;#i;#s;#o;#a;constructor(t={}){this.#e=t.queryCache||new Yb,this.#t=t.mutationCache||new Gb,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=vf.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=zl.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=this.#e.build(this,e),i=r.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Cs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:r})=>{const i=r.data;return[e,i]})}setQueryData(t,e,r){const i=this.defaultQueryOptions({queryKey:t}),l=this.#e.get(i.queryHash)?.state.data,d=Lb(e,l);if(d!==void 0)return this.#e.build(this,i).setData(d,{...r,manual:!0})}setQueriesData(t,e,r){return zt.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,r)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;zt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=this.#e;return zt.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},i=zt.batch(()=>this.#e.findAll(t).map(a=>a.cancel(r)));return Promise.all(i).then(un).catch(un)}invalidateQueries(t,e={}){return zt.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},i=zt.batch(()=>this.#e.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let l=a.fetch(void 0,r);return r.throwOnError||(l=l.catch(un)),a.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(un)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=this.#e.build(this,e);return r.isStaleByTime(Cs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(un).catch(un)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(un).catch(un)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return zl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(ti(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],r={};return e.forEach(i=>{ro(t,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(t,e){this.#i.set(ti(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],r={};return e.forEach(i=>{ro(t,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=xf(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===wf&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},gv=$.createContext(void 0),Kt=t=>{const e=$.useContext(gv);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ej=({client:t,children:e})=>($.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),u.jsx(gv.Provider,{value:t,children:e})),yv=$.createContext(!1),tj=()=>$.useContext(yv);yv.Provider;function nj(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rj=$.createContext(nj()),sj=()=>$.useContext(rj),ij=(t,e,r)=>{const i=r?.state.error&&typeof t.throwOnError=="function"?bf(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))},aj=t=>{$.useEffect(()=>{t.clearReset()},[t])},oj=({result:t,errorResetBoundary:e,throwOnError:r,query:i,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||bf(r,[t.error,i])),lj=t=>{if(t.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...a)=>r(i(...a)):r(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},uj=(t,e)=>t.isLoading&&t.isFetching&&!e,cj=(t,e)=>t?.suspense&&e.isPending,ug=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function dj(t,e,r){const i=tj(),a=sj(),l=Kt(),d=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=l.getQueryCache().get(d.queryHash);d._optimisticResults=i?"isRestoring":"optimistic",lj(d),ij(d,a,f),aj(a);const m=!l.getQueryCache().get(d.queryHash),[p]=$.useState(()=>new e(l,d)),v=p.getOptimisticResult(d),w=!i&&t.subscribed!==!1;if($.useSyncExternalStore($.useCallback(y=>{const x=w?p.subscribe(zt.batchCalls(y)):un;return p.updateResult(),x},[p,w]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),$.useEffect(()=>{p.setOptions(d)},[d,p]),cj(d,v))throw ug(d,p,a);if(oj({result:v,errorResetBoundary:a,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!so.isServer()&&uj(v,i)&&(m?ug(d,p,a):f?.promise)?.catch(un).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?v:p.trackResult(v)}function On(t,e){return dj(t,Wb)}function gn(t,e){const r=Kt(),[i]=$.useState(()=>new Jb(r,t));$.useEffect(()=>{i.setOptions(t)},[i,t]);const a=$.useSyncExternalStore($.useCallback(d=>i.subscribe(zt.batchCalls(d)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=$.useCallback((d,f)=>{i.mutate(d,f).catch(un)},[i]);if(a.error&&bf(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}var fj=t=>{switch(t){case"success":return mj;case"info":return yj;case"warning":return gj;case"error":return vj;default:return null}},hj=Array(12).fill(0),pj=({visible:t,className:e})=>ne.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ne.createElement("div",{className:"sonner-spinner"},hj.map((r,i)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),mj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),gj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),yj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),vj=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),xj=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),wj=()=>{let[t,e]=ne.useState(document.hidden);return ne.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},$d=1,bj=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...i}=t,a=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:$d++,l=this.toasts.find(f=>f.id===a),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(f=>f.id===a?(this.publish({...f,...t,id:a,title:r}),{...f,...t,id:a,dismissible:d,title:r}):f):this.addToast({title:r,...i,dismissible:d,id:a}),a},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let i=t instanceof Promise?t:t(),a=r!==void 0,l,d=i.then(async m=>{if(l=["resolve",m],ne.isValidElement(m))a=!1,this.create({id:r,type:"default",message:m});else if(_j(m)&&!m.ok){a=!1;let p=typeof e.error=="function"?await e.error(`HTTP error! status: ${m.status}`):e.error,v=typeof e.description=="function"?await e.description(`HTTP error! status: ${m.status}`):e.description;this.create({id:r,type:"error",message:p,description:v})}else if(e.success!==void 0){a=!1;let p=typeof e.success=="function"?await e.success(m):e.success,v=typeof e.description=="function"?await e.description(m):e.description;this.create({id:r,type:"success",message:p,description:v})}}).catch(async m=>{if(l=["reject",m],e.error!==void 0){a=!1;let p=typeof e.error=="function"?await e.error(m):e.error,v=typeof e.description=="function"?await e.description(m):e.description;this.create({id:r,type:"error",message:p,description:v})}}).finally(()=>{var m;a&&(this.dismiss(r),r=void 0),(m=e.finally)==null||m.call(e)}),f=()=>new Promise((m,p)=>d.then(()=>l[0]==="reject"?p(l[1]):m(l[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,e)=>{let r=e?.id||$d++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Cn=new bj,jj=(t,e)=>{let r=e?.id||$d++;return Cn.addToast({title:t,...e,id:r}),r},_j=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Sj=jj,kj=()=>Cn.toasts,Nj=()=>Cn.getActiveToasts(),jt=Object.assign(Sj,{success:Cn.success,info:Cn.info,warning:Cn.warning,error:Cn.error,custom:Cn.custom,message:Cn.message,promise:Cn.promise,dismiss:Cn.dismiss,loading:Cn.loading},{getHistory:kj,getToasts:Nj});function Cj(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}Cj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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 Cl(t){return t.label!==void 0}var Ej=3,Pj="32px",Oj="16px",cg=4e3,Rj=356,Tj=14,Lj=20,Aj=200;function or(...t){return t.filter(Boolean).join(" ")}function Ij(t){let[e,r]=t.split("-"),i=[];return e&&i.push(e),r&&i.push(r),i}var Mj=t=>{var e,r,i,a,l,d,f,m,p,v,w;let{invert:y,toast:x,unstyled:S,interacting:_,setHeights:b,visibleToasts:P,heights:N,index:F,toasts:L,expanded:k,removeToast:I,defaultRichColors:X,closeButton:re,style:de,cancelButtonStyle:Z,actionButtonStyle:Oe,className:J="",descriptionClassName:ve="",duration:me,position:M,gap:R,loadingIcon:G,expandByDefault:H,classNames:W,icons:K,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:Q}=t,[ue,pe]=ne.useState(null),[Le,qe]=ne.useState(null),[Ce,Ge]=ne.useState(!1),[et,Rt]=ne.useState(!1),[yn,Tr]=ne.useState(!1),[Jn,Lr]=ne.useState(!1),[ui,Yr]=ne.useState(!1),[Ms,Ar]=ne.useState(0),[Xr,pr]=ne.useState(0),vn=ne.useRef(x.duration||me||cg),Fs=ne.useRef(null),Rn=ne.useRef(null),E=F===0,z=F+1<=P,V=x.type,oe=x.dismissible!==!1,le=x.className||"",ae=x.descriptionClassName||"",ce=ne.useMemo(()=>N.findIndex(Fe=>Fe.toastId===x.id)||0,[N,x.id]),Ae=ne.useMemo(()=>{var Fe;return(Fe=x.closeButton)!=null?Fe:re},[x.closeButton,re]),We=ne.useMemo(()=>x.duration||me||cg,[x.duration,me]),St=ne.useRef(0),Tt=ne.useRef(0),Ft=ne.useRef(0),$n=ne.useRef(null),[Ir,Mr]=M.split("-"),es=ne.useMemo(()=>N.reduce((Fe,at,ct)=>ct>=ce?Fe:Fe+at.height,0),[N,ce]),Fr=wj(),mr=x.invert||y,Tn=V==="loading";Tt.current=ne.useMemo(()=>ce*R+es,[ce,es]),ne.useEffect(()=>{vn.current=We},[We]),ne.useEffect(()=>{Ge(!0)},[]),ne.useEffect(()=>{let Fe=Rn.current;if(Fe){let at=Fe.getBoundingClientRect().height;return pr(at),b(ct=>[{toastId:x.id,height:at,position:x.position},...ct]),()=>b(ct=>ct.filter(sn=>sn.toastId!==x.id))}},[b,x.id]),ne.useLayoutEffect(()=>{if(!Ce)return;let Fe=Rn.current,at=Fe.style.height;Fe.style.height="auto";let ct=Fe.getBoundingClientRect().height;Fe.style.height=at,pr(ct),b(sn=>sn.find(xn=>xn.toastId===x.id)?sn.map(xn=>xn.toastId===x.id?{...xn,height:ct}:xn):[{toastId:x.id,height:ct,position:x.position},...sn])},[Ce,x.title,x.description,b,x.id]);let Yn=ne.useCallback(()=>{Rt(!0),Ar(Tt.current),b(Fe=>Fe.filter(at=>at.toastId!==x.id)),setTimeout(()=>{I(x)},Aj)},[x,I,b,Tt]);ne.useEffect(()=>{if(x.promise&&V==="loading"||x.duration===1/0||x.type==="loading")return;let Fe;return k||_||Q&&Fr?(()=>{if(Ft.current{var at;(at=x.onAutoClose)==null||at.call(x,x),Yn()},vn.current)),()=>clearTimeout(Fe)},[k,_,x,V,Q,Fr,Yn]),ne.useEffect(()=>{x.delete&&Yn()},[Yn,x.delete]);function yo(){var Fe,at,ct;return K!=null&&K.loading?ne.createElement("div",{className:or(W?.loader,(Fe=x?.classNames)==null?void 0:Fe.loader,"sonner-loader"),"data-visible":V==="loading"},K.loading):G?ne.createElement("div",{className:or(W?.loader,(at=x?.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":V==="loading"},G):ne.createElement(pj,{className:or(W?.loader,(ct=x?.classNames)==null?void 0:ct.loader),visible:V==="loading"})}return ne.createElement("li",{tabIndex:0,ref:Rn,className:or(J,le,W?.toast,(e=x?.classNames)==null?void 0:e.toast,W?.default,W?.[V],(r=x?.classNames)==null?void 0:r[V]),"data-sonner-toast":"","data-rich-colors":(i=x.richColors)!=null?i:X,"data-styled":!(x.jsx||x.unstyled||S),"data-mounted":Ce,"data-promise":!!x.promise,"data-swiped":ui,"data-removed":et,"data-visible":z,"data-y-position":Ir,"data-x-position":Mr,"data-index":F,"data-front":E,"data-swiping":yn,"data-dismissible":oe,"data-type":V,"data-invert":mr,"data-swipe-out":Jn,"data-swipe-direction":Le,"data-expanded":!!(k||H&&Ce),style:{"--index":F,"--toasts-before":F,"--z-index":L.length-F,"--offset":`${et?Ms:Tt.current}px`,"--initial-height":H?"auto":`${Xr}px`,...de,...x.style},onDragEnd:()=>{Tr(!1),pe(null),$n.current=null},onPointerDown:Fe=>{Tn||!oe||(Fs.current=new Date,Ar(Tt.current),Fe.target.setPointerCapture(Fe.pointerId),Fe.target.tagName!=="BUTTON"&&(Tr(!0),$n.current={x:Fe.clientX,y:Fe.clientY}))},onPointerUp:()=>{var Fe,at,ct,sn;if(Jn||!oe)return;$n.current=null;let xn=Number(((Fe=Rn.current)==null?void 0:Fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wn=Number(((at=Rn.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xn=new Date().getTime()-((ct=Fs.current)==null?void 0:ct.getTime()),qt=ue==="x"?xn:wn,gr=Math.abs(qt)/Xn;if(Math.abs(qt)>=Lj||gr>.11){Ar(Tt.current),(sn=x.onDismiss)==null||sn.call(x,x),qe(ue==="x"?xn>0?"right":"left":wn>0?"down":"up"),Yn(),Lr(!0),Yr(!1);return}Tr(!1),pe(null)},onPointerMove:Fe=>{var at,ct,sn,xn;if(!$n.current||!oe||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;let wn=Fe.clientY-$n.current.y,Xn=Fe.clientX-$n.current.x,qt=(ct=t.swipeDirections)!=null?ct:Ij(M);!ue&&(Math.abs(Xn)>1||Math.abs(wn)>1)&&pe(Math.abs(Xn)>Math.abs(wn)?"x":"y");let gr={x:0,y:0};ue==="y"?(qt.includes("top")||qt.includes("bottom"))&&(qt.includes("top")&&wn<0||qt.includes("bottom")&&wn>0)&&(gr.y=wn):ue==="x"&&(qt.includes("left")||qt.includes("right"))&&(qt.includes("left")&&Xn<0||qt.includes("right")&&Xn>0)&&(gr.x=Xn),(Math.abs(gr.x)>0||Math.abs(gr.y)>0)&&Yr(!0),(sn=Rn.current)==null||sn.style.setProperty("--swipe-amount-x",`${gr.x}px`),(xn=Rn.current)==null||xn.style.setProperty("--swipe-amount-y",`${gr.y}px`)}},Ae&&!x.jsx?ne.createElement("button",{"aria-label":T,"data-disabled":Tn,"data-close-button":!0,onClick:Tn||!oe?()=>{}:()=>{var Fe;Yn(),(Fe=x.onDismiss)==null||Fe.call(x,x)},className:or(W?.closeButton,(a=x?.classNames)==null?void 0:a.closeButton)},(l=K?.close)!=null?l:xj):null,x.jsx||$.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:ne.createElement(ne.Fragment,null,V||x.icon||x.promise?ne.createElement("div",{"data-icon":"",className:or(W?.icon,(d=x?.classNames)==null?void 0:d.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||yo():null,x.type!=="loading"?x.icon||K?.[V]||fj(V):null):null,ne.createElement("div",{"data-content":"",className:or(W?.content,(f=x?.classNames)==null?void 0:f.content)},ne.createElement("div",{"data-title":"",className:or(W?.title,(m=x?.classNames)==null?void 0:m.title)},typeof x.title=="function"?x.title():x.title),x.description?ne.createElement("div",{"data-description":"",className:or(ve,ae,W?.description,(p=x?.classNames)==null?void 0:p.description)},typeof x.description=="function"?x.description():x.description):null),$.isValidElement(x.cancel)?x.cancel:x.cancel&&Cl(x.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||Z,onClick:Fe=>{var at,ct;Cl(x.cancel)&&oe&&((ct=(at=x.cancel).onClick)==null||ct.call(at,Fe),Yn())},className:or(W?.cancelButton,(v=x?.classNames)==null?void 0:v.cancelButton)},x.cancel.label):null,$.isValidElement(x.action)?x.action:x.action&&Cl(x.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||Oe,onClick:Fe=>{var at,ct;Cl(x.action)&&((ct=(at=x.action).onClick)==null||ct.call(at,Fe),!Fe.defaultPrevented&&Yn())},className:or(W?.actionButton,(w=x?.classNames)==null?void 0:w.actionButton)},x.action.label):null))};function dg(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Fj(t,e){let r={};return[t,e].forEach((i,a)=>{let l=a===1,d=l?"--mobile-offset":"--offset",f=l?Oj:Pj;function m(p){["top","right","bottom","left"].forEach(v=>{r[`${d}-${v}`]=typeof p=="number"?`${p}px`:p})}typeof i=="number"||typeof i=="string"?m(i):typeof i=="object"?["top","right","bottom","left"].forEach(p=>{i[p]===void 0?r[`${d}-${p}`]=f:r[`${d}-${p}`]=typeof i[p]=="number"?`${i[p]}px`:i[p]}):m(f)}),r}var Dj=$.forwardRef(function(t,e){let{invert:r,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:d,className:f,offset:m,mobileOffset:p,theme:v="light",richColors:w,duration:y,style:x,visibleToasts:S=Ej,toastOptions:_,dir:b=dg(),gap:P=Tj,loadingIcon:N,icons:F,containerAriaLabel:L="Notifications",pauseWhenPageIsHidden:k}=t,[I,X]=ne.useState([]),re=ne.useMemo(()=>Array.from(new Set([i].concat(I.filter(Q=>Q.position).map(Q=>Q.position)))),[I,i]),[de,Z]=ne.useState([]),[Oe,J]=ne.useState(!1),[ve,me]=ne.useState(!1),[M,R]=ne.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ne.useRef(null),H=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ne.useRef(null),K=ne.useRef(!1),T=ne.useCallback(Q=>{X(ue=>{var pe;return(pe=ue.find(Le=>Le.id===Q.id))!=null&&pe.delete||Cn.dismiss(Q.id),ue.filter(({id:Le})=>Le!==Q.id)})},[]);return ne.useEffect(()=>Cn.subscribe(Q=>{if(Q.dismiss){X(ue=>ue.map(pe=>pe.id===Q.id?{...pe,delete:!0}:pe));return}setTimeout(()=>{J1.flushSync(()=>{X(ue=>{let pe=ue.findIndex(Le=>Le.id===Q.id);return pe!==-1?[...ue.slice(0,pe),{...ue[pe],...Q},...ue.slice(pe+1)]:[Q,...ue]})})})}),[]),ne.useEffect(()=>{if(v!=="system"){R(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R("dark"):R("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:ue})=>{R(ue?"dark":"light")})}catch{Q.addListener(({matches:pe})=>{try{R(pe?"dark":"light")}catch(Le){console.error(Le)}})}},[v]),ne.useEffect(()=>{I.length<=1&&J(!1)},[I]),ne.useEffect(()=>{let Q=ue=>{var pe,Le;a.every(qe=>ue[qe]||ue.code===qe)&&(J(!0),(pe=G.current)==null||pe.focus()),ue.code==="Escape"&&(document.activeElement===G.current||(Le=G.current)!=null&&Le.contains(document.activeElement))&&J(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[a]),ne.useEffect(()=>{if(G.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,K.current=!1)}},[G.current]),ne.createElement("section",{ref:e,"aria-label":`${L} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((Q,ue)=>{var pe;let[Le,qe]=Q.split("-");return I.length?ne.createElement("ol",{key:Q,dir:b==="auto"?dg():b,tabIndex:-1,ref:G,className:f,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":Le,"data-lifted":Oe&&I.length>1&&!l,"data-x-position":qe,style:{"--front-toast-height":`${((pe=de[0])==null?void 0:pe.height)||0}px`,"--width":`${Rj}px`,"--gap":`${P}px`,...x,...Fj(m,p)},onBlur:Ce=>{K.current&&!Ce.currentTarget.contains(Ce.relatedTarget)&&(K.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:Ce=>{Ce.target instanceof HTMLElement&&Ce.target.dataset.dismissible==="false"||K.current||(K.current=!0,W.current=Ce.relatedTarget)},onMouseEnter:()=>J(!0),onMouseMove:()=>J(!0),onMouseLeave:()=>{ve||J(!1)},onDragEnd:()=>J(!1),onPointerDown:Ce=>{Ce.target instanceof HTMLElement&&Ce.target.dataset.dismissible==="false"||me(!0)},onPointerUp:()=>me(!1)},I.filter(Ce=>!Ce.position&&ue===0||Ce.position===Q).map((Ce,Ge)=>{var et,Rt;return ne.createElement(Mj,{key:Ce.id,icons:F,index:Ge,toast:Ce,defaultRichColors:w,duration:(et=_?.duration)!=null?et:y,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:S,closeButton:(Rt=_?.closeButton)!=null?Rt:d,interacting:ve,position:Q,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,removeToast:T,toasts:I.filter(yn=>yn.position==Ce.position),heights:de.filter(yn=>yn.position==Ce.position),setHeights:Z,expandByDefault:l,gap:P,loadingIcon:N,expanded:Oe,pauseWhenPageIsHidden:k,swipeDirections:t.swipeDirections})})):null}))});const $e=t=>typeof t=="string",Da=()=>{let t,e;const r=new Promise((i,a)=>{t=i,e=a});return r.resolve=t,r.reject=e,r},fg=t=>t==null?"":""+t,$j=(t,e,r)=>{t.forEach(i=>{e[i]&&(r[i]=e[i])})},zj=/###/g,hg=t=>t&&t.indexOf("###")>-1?t.replace(zj,"."):t,pg=t=>!t||$e(t),Ga=(t,e,r)=>{const i=$e(e)?e.split("."):e;let a=0;for(;a{const{obj:i,k:a}=Ga(t,e,Object);if(i!==void 0||e.length===1){i[a]=r;return}let l=e[e.length-1],d=e.slice(0,e.length-1),f=Ga(t,d,Object);for(;f.obj===void 0&&d.length;)l=`${d[d.length-1]}.${l}`,d=d.slice(0,d.length-1),f=Ga(t,d,Object),f&&f.obj&&typeof f.obj[`${f.k}.${l}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${l}`]=r},Uj=(t,e,r,i)=>{const{obj:a,k:l}=Ga(t,e,Object);a[l]=a[l]||[],a[l].push(r)},Ul=(t,e)=>{const{obj:r,k:i}=Ga(t,e);if(r)return r[i]},Vj=(t,e,r)=>{const i=Ul(t,r);return i!==void 0?i:Ul(e,r)},vv=(t,e,r)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?$e(t[i])||t[i]instanceof String||$e(e[i])||e[i]instanceof String?r&&(t[i]=e[i]):vv(t[i],e[i],r):t[i]=e[i]);return t},Ti=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Bj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const qj=t=>$e(t)?t.replace(/[&<>"'\/]/g,e=>Bj[e]):t;class Hj{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const Wj=[" ",",","?","!",";"],Kj=new Hj(20),Qj=(t,e,r)=>{e=e||"",r=r||"";const i=Wj.filter(d=>e.indexOf(d)<0&&r.indexOf(d)<0);if(i.length===0)return!0;const a=Kj.getRegExp(`(${i.map(d=>d==="?"?"\\?":d).join("|")})`);let l=!a.test(t);if(!l){const d=t.indexOf(r);d>0&&!a.test(t.substring(0,d))&&(l=!0)}return l},zd=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const i=e.split(r);let a=t;for(let l=0;l-1&&mt&&t.replace("_","-"),Zj={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Bl{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||Zj,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),i=0;i{this.observers[i]||(this.observers[i]=new Map);const a=this.observers[i].get(r)||0;this.observers[i].set(r,a+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a{let[f,m]=d;for(let p=0;p{let[f,m]=d;for(let p=0;p1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,d=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;e.indexOf(".")>-1?f=e.split("."):(f=[e,r],i&&(Array.isArray(i)?f.push(...i):$e(i)&&l?f.push(...i.split(l)):f.push(i)));const m=Ul(this.data,f);return!m&&!r&&!i&&e.indexOf(".")>-1&&(e=f[0],r=f[1],i=f.slice(2).join(".")),m||!d||!$e(i)?m:zd(this.data&&this.data[e]&&this.data[e][r],i,l)}addResource(e,r,i,a){let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const d=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=[e,r];i&&(f=f.concat(d?i.split(d):i)),e.indexOf(".")>-1&&(f=e.split("."),a=r,r=f[1]),this.addNamespaces(r),mg(this.data,f,a),l.silent||this.emit("added",e,r,i,a)}addResources(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const l in i)($e(i[l])||Array.isArray(i[l]))&&this.addResource(e,r,l,i[l],{silent:!0});a.silent||this.emit("added",e,r,i)}addResourceBundle(e,r,i,a,l){let d=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},f=[e,r];e.indexOf(".")>-1&&(f=e.split("."),a=i,i=r,r=f[1]),this.addNamespaces(r);let m=Ul(this.data,f)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),a?vv(m,i,l):m={...m,...i},mg(this.data,f,m),d.silent||this.emit("added",e,r,i)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,r)}:this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(a=>r[a]&&Object.keys(r[a]).length>0)}toJSON(){return this.data}}var xv={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,i,a){return t.forEach(l=>{this.processors[l]&&(e=this.processors[l].process(e,r,i,a))}),e}};const yg={};class ql extends uu{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),$j(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Cr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const i=this.resolve(e,r);return i&&i.res!==void 0}extractFromKey(e,r){let i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=r.ns||this.options.defaultNS||[];const d=i&&e.indexOf(i)>-1,f=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Qj(e,i,a);if(d&&!f){const m=e.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:e,namespaces:$e(l)?[l]:l};const p=e.split(i);(i!==a||i===a&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),e=p.join(a)}return{key:e,namespaces:$e(l)?[l]:l}}translate(e,r,i){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,l=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:d,namespaces:f}=this.extractFromKey(e[e.length-1],r),m=f[f.length-1],p=r.lng||this.language,v=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(v){const L=r.nsSeparator||this.options.nsSeparator;return a?{res:`${m}${L}${d}`,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(r)}:`${m}${L}${d}`}return a?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(r)}:d}const w=this.resolve(e,r);let y=w&&w.res;const x=w&&w.usedKey||d,S=w&&w.exactUsedKey||d,_=Object.prototype.toString.apply(y),b=["[object Number]","[object Function]","[object RegExp]"],P=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,F=!$e(y)&&typeof y!="boolean"&&typeof y!="number";if(N&&y&&F&&b.indexOf(_)<0&&!($e(P)&&Array.isArray(y))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,y,{...r,ns:f}):`key '${d} (${this.language})' returned an object instead of string.`;return a?(w.res=L,w.usedParams=this.getUsedParamsDetails(r),w):L}if(l){const L=Array.isArray(y),k=L?[]:{},I=L?S:x;for(const X in y)if(Object.prototype.hasOwnProperty.call(y,X)){const re=`${I}${l}${X}`;k[X]=this.translate(re,{...r,joinArrays:!1,ns:f}),k[X]===re&&(k[X]=y[X])}y=k}}else if(N&&$e(P)&&Array.isArray(y))y=y.join(P),y&&(y=this.extendTranslation(y,e,r,i));else{let L=!1,k=!1;const I=r.count!==void 0&&!$e(r.count),X=ql.hasDefaultValue(r),re=I?this.pluralResolver.getSuffix(p,r.count,r):"",de=r.ordinal&&I?this.pluralResolver.getSuffix(p,r.count,{ordinal:!1}):"",Z=I&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),Oe=Z&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${re}`]||r[`defaultValue${de}`]||r.defaultValue;!this.isValidLookup(y)&&X&&(L=!0,y=Oe),this.isValidLookup(y)||(k=!0,y=d);const ve=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:y,me=X&&Oe!==y&&this.options.updateMissing;if(k||L||me){if(this.logger.log(me?"updateKey":"missingKey",p,m,d,me?Oe:y),l){const H=this.resolve(d,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const R=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&R&&R[0])for(let H=0;H{const T=X&&K!==y?K:ve;this.options.missingKeyHandler?this.options.missingKeyHandler(H,m,W,T,me,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,m,W,T,me,r),this.emit("missingKey",H,m,W,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&I?M.forEach(H=>{const W=this.pluralResolver.getSuffixes(H,r);Z&&r[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(K=>{G([H],d+K,r[`defaultValue${K}`]||Oe)})}):G(M,d,Oe))}y=this.extendTranslation(y,e,r,w,i),k&&y===d&&this.options.appendNamespaceToMissingKey&&(y=`${m}:${d}`),(k||L)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?y=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}:${d}`:d,L?y:void 0):y=this.options.parseMissingKeyHandler(y))}return a?(w.res=y,w.usedParams=this.getUsedParamsDetails(r),w):y}extendTranslation(e,r,i,a,l){var d=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const p=$e(e)&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(p){const y=e.match(this.interpolator.nestingRegexp);v=y&&y.length}let w=i.replace&&!$e(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(w={...this.options.interpolation.defaultVariables,...w}),e=this.interpolator.interpolate(e,w,i.lng||this.language||a.usedLng,i),p){const y=e.match(this.interpolator.nestingRegexp),x=y&&y.length;v1&&arguments[1]!==void 0?arguments[1]:{},i,a,l,d,f;return $e(e)&&(e=[e]),e.forEach(m=>{if(this.isValidLookup(i))return;const p=this.extractFromKey(m,r),v=p.key;a=v;let w=p.namespaces;this.options.fallbackNS&&(w=w.concat(this.options.fallbackNS));const y=r.count!==void 0&&!$e(r.count),x=y&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),S=r.context!==void 0&&($e(r.context)||typeof r.context=="number")&&r.context!=="",_=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);w.forEach(b=>{this.isValidLookup(i)||(f=b,!yg[`${_[0]}-${b}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(f)&&(yg[`${_[0]}-${b}`]=!0,this.logger.warn(`key "${a}" for languages "${_.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),_.forEach(P=>{if(this.isValidLookup(i))return;d=P;const N=[v];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(N,v,P,b,r);else{let L;y&&(L=this.pluralResolver.getSuffix(P,r.count,r));const k=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(N.push(v+L),r.ordinal&&L.indexOf(I)===0&&N.push(v+L.replace(I,this.options.pluralSeparator)),x&&N.push(v+k)),S){const X=`${v}${this.options.contextSeparator}${r.context}`;N.push(X),y&&(N.push(X+L),r.ordinal&&L.indexOf(I)===0&&N.push(X+L.replace(I,this.options.pluralSeparator)),x&&N.push(X+k))}}let F;for(;F=N.pop();)this.isValidLookup(i)||(l=F,i=this.getResource(P,b,F,r))}))})}),{res:i,usedKey:a,exactUsedKey:l,usedLng:d,usedNS:f}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,i,a):this.resourceStore.getResource(e,r,i,a)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!$e(e.replace);let a=i?e.replace:e;if(i&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!i){a={...a};for(const l of r)delete a[l]}return a}static hasDefaultValue(e){const r="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&r===i.substring(0,r.length)&&e[i]!==void 0)return!0;return!1}}const ld=t=>t.charAt(0).toUpperCase()+t.slice(1);class vg{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Cr.create("languageUtils")}getScriptPartFromCode(e){if(e=Vl(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Vl(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if($e(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let a=Intl.getCanonicalLocales(e)[0];if(a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a)return a}catch{}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map(a=>a.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=ld(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=ld(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=ld(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(i=>{if(r)return;const a=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(a))&&(r=a)}),!r&&this.options.supportedLngs&&e.forEach(i=>{if(r)return;const a=this.getLanguagePartFromCode(i);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(l=>{if(l===a)return l;if(!(l.indexOf("-")<0&&a.indexOf("-")<0)&&(l.indexOf("-")>0&&a.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===a||l.indexOf(a)===0&&a.length>1))return l})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),$e(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let i=e[r];return i||(i=e[this.getScriptPartFromCode(r)]),i||(i=e[this.formatLanguageCode(r)]),i||(i=e[this.getLanguagePartFromCode(r)]),i||(i=e.default),i||[]}toResolveHierarchy(e,r){const i=this.getFallbackCodes(r||this.options.fallbackLng||[],e),a=[],l=d=>{d&&(this.isSupportedCode(d)?a.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return $e(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(e))):$e(e)&&l(this.formatLanguageCode(e)),i.forEach(d=>{a.indexOf(d)<0&&l(this.formatLanguageCode(d))}),a}}let Gj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Jj={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const Yj=["v1","v2","v3"],Xj=["v4"],xg={zero:0,one:1,two:2,few:3,many:4,other:5},e_=()=>{const t={};return Gj.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:Jj[e.fc]}})}),t};class t_{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=Cr.create("pluralResolver"),(!this.options.compatibilityJSON||Xj.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=e_(),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const i=Vl(e==="dev"?"en":e),a=r.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:a});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let d;try{d=new Intl.PluralRules(i,{type:a})}catch{if(!e.match(/-|_/))return;const m=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(m,r)}return this.pluralRulesCache[l]=d,d}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(a=>`${r}${a}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,r);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((a,l)=>xg[a]-xg[l]).map(a=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a}`):i.numbers.map(a=>this.getSuffix(e,a,r)):[]}getSuffix(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(e,i);return a?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${a.select(r)}`:this.getSuffixRetroCompatible(a,r):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,r){const i=e.noAbs?e.plurals(r):e.plurals(Math.abs(r));let a=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const l=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:l():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?l():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!Yj.includes(this.options.compatibilityJSON)}}const wg=function(t,e,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=Vj(t,e,r);return!l&&a&&$e(r)&&(l=zd(t,r,i),l===void 0&&(l=zd(e,r,i))),l},ud=t=>t.replace(/\$/g,"$$$$");class n_{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Cr.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:i,useRawValueToEscape:a,prefix:l,prefixEscaped:d,suffix:f,suffixEscaped:m,formatSeparator:p,unescapeSuffix:v,unescapePrefix:w,nestingPrefix:y,nestingPrefixEscaped:x,nestingSuffix:S,nestingSuffixEscaped:_,nestingOptionsSeparator:b,maxReplaces:P,alwaysFormat:N}=e.interpolation;this.escape=r!==void 0?r:qj,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=l?Ti(l):d||"{{",this.suffix=f?Ti(f):m||"}}",this.formatSeparator=p||",",this.unescapePrefix=v?"":w||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=y?Ti(y):x||Ti("$t("),this.nestingSuffix=S?Ti(S):_||Ti(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=P||1e3,this.alwaysFormat=N!==void 0?N:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,i)=>r&&r.source===i?(r.lastIndex=0,r):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,r,i,a){let l,d,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=x=>{if(x.indexOf(this.formatSeparator)<0){const P=wg(r,m,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(P,void 0,i,{...a,...r,interpolationkey:x}):P}const S=x.split(this.formatSeparator),_=S.shift().trim(),b=S.join(this.formatSeparator).trim();return this.format(wg(r,m,_,this.options.keySeparator,this.options.ignoreJSONStructure),b,i,{...a,...r,interpolationkey:_})};this.resetRegExp();const v=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,w=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>ud(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?ud(this.escape(x)):ud(x)}].forEach(x=>{for(f=0;l=x.regex.exec(e);){const S=l[1].trim();if(d=p(S),d===void 0)if(typeof v=="function"){const b=v(e,l,a);d=$e(b)?b:""}else if(a&&Object.prototype.hasOwnProperty.call(a,S))d="";else if(w){d=l[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),d="";else!$e(d)&&!this.useRawValueToEscape&&(d=fg(d));const _=x.safeValue(d);if(e=e.replace(l[0],_),w?(x.regex.lastIndex+=d.length,x.regex.lastIndex-=l[0].length):x.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),e}nest(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,l,d;const f=(m,p)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const w=m.split(new RegExp(`${v}[ ]*{`));let y=`{${w[1]}`;m=w[0],y=this.interpolate(y,d);const x=y.match(/'/g),S=y.match(/"/g);(x&&x.length%2===0&&!S||S.length%2!==0)&&(y=y.replace(/'/g,'"'));try{d=JSON.parse(y),p&&(d={...p,...d})}catch(_){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,_),`${m}${v}${y}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,m};for(;a=this.nestingRegexp.exec(e);){let m=[];d={...i},d=d.replace&&!$e(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;let p=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const v=a[1].split(this.formatSeparator).map(w=>w.trim());a[1]=v.shift(),m=v,p=!0}if(l=r(f.call(this,a[1].trim(),d),d),l&&a[0]===e&&!$e(l))return l;$e(l)||(l=fg(l)),l||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),l=""),p&&(l=m.reduce((v,w)=>this.format(v,w,i.lng,{...i,interpolationkey:a[1].trim()}),l.trim())),e=e.replace(a[0],l),this.regexp.lastIndex=0}return e}}const r_=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const a=i[1].substring(0,i[1].length-1);e==="currency"&&a.indexOf(":")<0?r.currency||(r.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?r.range||(r.range=a.trim()):a.split(";").forEach(d=>{if(d){const[f,...m]=d.split(":"),p=m.join(":").trim().replace(/^'+|'+$/g,""),v=f.trim();r[v]||(r[v]=p),p==="false"&&(r[v]=!1),p==="true"&&(r[v]=!0),isNaN(p)||(r[v]=parseInt(p,10))}})}return{formatName:e,formatOptions:r}},Li=t=>{const e={};return(r,i,a)=>{let l=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(l={...l,[a.interpolationkey]:void 0});const d=i+JSON.stringify(l);let f=e[d];return f||(f=t(Vl(i),a),e[d]=f),f(r)}};class s_{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Cr.create("formatter"),this.options=e,this.formats={number:Li((r,i)=>{const a=new Intl.NumberFormat(r,{...i});return l=>a.format(l)}),currency:Li((r,i)=>{const a=new Intl.NumberFormat(r,{...i,style:"currency"});return l=>a.format(l)}),datetime:Li((r,i)=>{const a=new Intl.DateTimeFormat(r,{...i});return l=>a.format(l)}),relativetime:Li((r,i)=>{const a=new Intl.RelativeTimeFormat(r,{...i});return l=>a.format(l,i.range||"day")}),list:Li((r,i)=>{const a=new Intl.ListFormat(r,{...i});return l=>a.format(l)})},this.init(e)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Li(r)}format(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const l=r.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(f=>f.indexOf(")")>-1)){const f=l.findIndex(m=>m.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,f)].join(this.formatSeparator)}return l.reduce((f,m)=>{const{formatName:p,formatOptions:v}=r_(m);if(this.formats[p]){let w=f;try{const y=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},x=y.locale||y.lng||a.locale||a.lng||i;w=this.formats[p](f,x,{...v,...a,...y})}catch(y){this.logger.warn(y)}return w}else this.logger.warn(`there was no format function for ${p}`);return f},e)}}const i_=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class a_ extends uu{constructor(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=i,this.languageUtils=i.languageUtils,this.options=a,this.logger=Cr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,a.backend,a)}queueLoad(e,r,i,a){const l={},d={},f={},m={};return e.forEach(p=>{let v=!0;r.forEach(w=>{const y=`${p}|${w}`;!i.reload&&this.store.hasResourceBundle(p,w)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?d[y]===void 0&&(d[y]=!0):(this.state[y]=1,v=!1,d[y]===void 0&&(d[y]=!0),l[y]===void 0&&(l[y]=!0),m[w]===void 0&&(m[w]=!0)))}),v||(f[p]=!0)}),(Object.keys(l).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(l),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(m)}}loaded(e,r,i){const a=e.split("|"),l=a[0],d=a[1];r&&this.emit("failedLoading",l,d,r),!r&&i&&this.store.addResourceBundle(l,d,i,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&i&&(this.state[e]=0);const f={};this.queue.forEach(m=>{Uj(m.loaded,[l],d),i_(m,e),r&&m.errors.push(r),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(p=>{f[p]||(f[p]={});const v=m.loaded[p];v.length&&v.forEach(w=>{f[p][w]===void 0&&(f[p][w]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.done)}read(e,r,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:i,tried:a,wait:l,callback:d});return}this.readingCalls++;const f=(p,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const w=this.waitingReads.shift();this.read(w.lng,w.ns,w.fcName,w.tried,w.wait,w.callback)}if(p&&v&&a{this.read.call(this,e,r,i,a+1,l*2,d)},l);return}d(p,v)},m=this.backend[i].bind(this.backend);if(m.length===2){try{const p=m(e,r);p&&typeof p.then=="function"?p.then(v=>f(null,v)).catch(f):f(null,p)}catch(p){f(p)}return}return m(e,r,f)}prepareLoading(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();$e(e)&&(e=this.languageUtils.toResolveHierarchy(e)),$e(r)&&(r=[r]);const l=this.queueLoad(e,r,i,a);if(!l.toLoad.length)return l.pending.length||a(),null;l.toLoad.forEach(d=>{this.loadOne(d)})}load(e,r,i){this.prepareLoading(e,r,{},i)}reload(e,r,i){this.prepareLoading(e,r,{reload:!0},i)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),a=i[0],l=i[1];this.read(a,l,"read",void 0,void 0,(d,f)=>{d&&this.logger.warn(`${r}loading namespace ${l} for language ${a} failed`,d),!d&&f&&this.logger.log(`${r}loaded namespace ${l} for language ${a}`,f),this.loaded(e,d,f)})}saveMissing(e,r,i,a,l){let d=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},f=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${i}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){const m={...d,isUpdate:l},p=this.backend.create.bind(this.backend);if(p.length<6)try{let v;p.length===5?v=p(e,r,i,a,m):v=p(e,r,i,a),v&&typeof v.then=="function"?v.then(w=>f(null,w)).catch(f):f(null,v)}catch(v){f(v)}else p(e,r,i,a,f,m)}!e||!e[0]||this.store.addResource(e[0],r,i,a)}}}const bg=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),$e(t[1])&&(e.defaultValue=t[1]),$e(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(i=>{e[i]=r[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),jg=t=>($e(t.ns)&&(t.ns=[t.ns]),$e(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),$e(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),El=()=>{},o_=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class io extends uu{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=jg(e),this.services={},this.logger=Cr,this.modules={external:[]},o_(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(i=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&($e(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const a=bg();this.options={...a,...this.options,...jg(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const l=v=>v?typeof v=="function"?new v:v:null;if(!this.options.isClone){this.modules.logger?Cr.init(l(this.modules.logger),this.options):Cr.init(null,this.options);let v;this.modules.formatter?v=this.modules.formatter:typeof Intl<"u"&&(v=s_);const w=new vg(this.options);this.store=new gg(this.options.resources,this.options);const y=this.services;y.logger=Cr,y.resourceStore=this.store,y.languageUtils=w,y.pluralResolver=new t_(w,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),v&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(y.formatter=l(v),y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new n_(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new a_(l(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",function(x){for(var S=arguments.length,_=new Array(S>1?S-1:0),b=1;b1?S-1:0),b=1;b{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,i||(i=El),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const v=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);v.length>0&&v[0]!=="dev"&&(this.options.lng=v[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(v=>{this[v]=function(){return e.store[v](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(v=>{this[v]=function(){return e.store[v](...arguments),e}});const m=Da(),p=()=>{const v=(w,y)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(y),i(w,y)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return v(null,this.t.bind(this));this.changeLanguage(this.options.lng,v)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),m}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:El;const a=$e(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],d=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&l.indexOf(p)<0&&l.push(p)})};a?d(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>d(m)),this.options.preload&&this.options.preload.forEach(f=>d(f)),this.services.backendConnector.load(l,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(f)})}else i(null)}reloadResources(e,r,i){const a=Da();return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),i||(i=El),this.services.backendConnector.reload(e,r,l=>{a.resolve(),i(l)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&xv.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,r){var i=this;this.isLanguageChangingTo=e;const a=Da();this.emit("languageChanging",e);const l=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},d=(m,p)=>{p?(l(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,a.resolve(function(){return i.t(...arguments)}),r&&r(m,function(){return i.t(...arguments)})},f=m=>{!e&&!m&&this.services.languageDetector&&(m=[]);const p=$e(m)?m:this.services.languageUtils.getBestMatchFromCodes(m);p&&(this.language||l(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(p)),this.loadResources(p,v=>{d(v,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(e),a}getFixedT(e,r,i){var a=this;const l=function(d,f){let m;if(typeof f!="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),w=2;w`${m.keyPrefix}${y}${S}`):x=m.keyPrefix?`${m.keyPrefix}${y}${d}`:d,a.t(x,m)};return $e(e)?l.lng=e:l.lngs=e,l.ns=r,l.keyPrefix=i,l}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=r.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(f,m)=>{const p=this.services.backendConnector.state[`${f}|${m}`];return p===-1||p===0||p===2};if(r.precheck){const f=r.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(i,e)&&(!a||d(l,e)))}loadNamespaces(e,r){const i=Da();return this.options.ns?($e(e)&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{i.resolve(),r&&r(a)}),i):(r&&r(),Promise.resolve())}loadLanguages(e,r){const i=Da();$e(e)&&(e=[e]);const a=this.options.preload||[],l=e.filter(d=>a.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return l.length?(this.options.preload=a.concat(l),this.loadResources(d=>{i.resolve(),r&&r(d)}),i):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new vg(bg());return r.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new io(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:El;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},l=new io(a);return(e.debug!==void 0||e.prefix!==void 0)&&(l.logger=l.logger.clone(e)),["store","services","language"].forEach(f=>{l[f]=this[f]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},i&&(l.store=new gg(this.store.data,a),l.services.resourceStore=l.store),l.translator=new ql(l.services,a),l.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),v=1;v()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}};function Sg(t,e,r){t.loadNamespaces(e,wv(t,r))}function kg(t,e,r,i){typeof r=="string"&&(r=[r]),r.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,wv(t,i))}function u_(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=e.languages[0],a=e.options?e.options.fallbackLng:!1,l=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const d=(f,m)=>{const p=e.services.backendConnector.state[`${f}|${m}`];return p===-1||p===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!d(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(i,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||d(i,t)&&(!a||d(l,t)))}function c_(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(Ud("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:r.lng,precheck:(a,l)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!l(a.isLanguageChangingTo,t))return!1}}):u_(t,e,r)}const d_=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,f_={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},h_=t=>f_[t],p_=t=>t.replace(d_,h_);let Vd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:p_};function m_(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vd={...Vd,...t}}function g_(){return Vd}let bv;function y_(t){bv=t}function v_(){return bv}const x_={type:"3rdParty",init(t){m_(t.options.react),y_(t)}},w_=$.createContext();class b_{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const j_=(t,e)=>{const r=$.useRef();return $.useEffect(()=>{r.current=t},[t,e]),r.current};function oi(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:r}=e,{i18n:i,defaultNS:a}=$.useContext(w_)||{},l=r||i||v_();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new b_),!l){Ud("You will need to pass in an i18next instance by using initReactI18next");const F=(k,I)=>typeof I=="string"?I:I&&typeof I=="object"&&typeof I.defaultValue=="string"?I.defaultValue:Array.isArray(k)?k[k.length-1]:k,L=[F,{},!1];return L.t=F,L.i18n={},L.ready=!1,L}l.options.react&&l.options.react.wait!==void 0&&Ud("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...g_(),...l.options.react,...e},{useSuspense:f,keyPrefix:m}=d;let p=a||l.options&&l.options.defaultNS;p=typeof p=="string"?[p]:p||["translation"],l.reportNamespaces.addUsedNamespaces&&l.reportNamespaces.addUsedNamespaces(p);const v=(l.isInitialized||l.initializedStoreOnce)&&p.every(F=>c_(F,l,d));function w(){return l.getFixedT(e.lng||null,d.nsMode==="fallback"?p:p[0],m)}const[y,x]=$.useState(w);let S=p.join();e.lng&&(S=`${e.lng}${S}`);const _=j_(S),b=$.useRef(!0);$.useEffect(()=>{const{bindI18n:F,bindI18nStore:L}=d;b.current=!0,!v&&!f&&(e.lng?kg(l,e.lng,p,()=>{b.current&&x(w)}):Sg(l,p,()=>{b.current&&x(w)})),v&&_&&_!==S&&b.current&&x(w);function k(){b.current&&x(w)}return F&&l&&l.on(F,k),L&&l&&l.store.on(L,k),()=>{b.current=!1,F&&l&&F.split(" ").forEach(I=>l.off(I,k)),L&&l&&L.split(" ").forEach(I=>l.store.off(I,k))}},[l,S]);const P=$.useRef(!0);$.useEffect(()=>{b.current&&!P.current&&x(w),P.current=!1},[l,m]);const N=[y,l,v];if(N.t=y,N.i18n=l,N.ready=v,v||!v&&!f)return N;throw new Promise(F=>{e.lng?kg(l,e.lng,p,()=>F()):Sg(l,p,()=>F())})}function __(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ao(t){"@babel/helpers - typeof";return ao=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ao(t)}function S_(t,e){if(ao(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e);if(ao(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jv(t){var e=S_(t,"string");return ao(e)=="symbol"?e:e+""}function k_(t,e){for(var r=0;r0){var f=a.maxAge-0;if(Number.isNaN(f))throw new Error("maxAge should be a Number");d+="; Max-Age=".concat(Math.floor(f))}if(a.domain){if(!Ng.test(a.domain))throw new TypeError("option domain is invalid");d+="; Domain=".concat(a.domain)}if(a.path){if(!Ng.test(a.path))throw new TypeError("option path is invalid");d+="; Path=".concat(a.path)}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+="; Expires=".concat(a.expires.toUTCString())}if(a.httpOnly&&(d+="; HttpOnly"),a.secure&&(d+="; Secure"),a.sameSite){var m=typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite;switch(m){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return d},Cg={create:function(e,r,i,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(l.expires=new Date,l.expires.setTime(l.expires.getTime()+i*60*1e3)),a&&(l.domain=a),document.cookie=O_(e,encodeURIComponent(r),l)},read:function(e){for(var r="".concat(e,"="),i=document.cookie.split(";"),a=0;a-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var a=i.substring(1),l=a.split("&"),d=0;d0){var m=l[d].substring(0,f);m===e.lookupQuerystring&&(r=l[d].substring(f+1))}}}return r}},$a=null,Eg=function(){if($a!==null)return $a;try{$a=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{$a=!1}return $a},L_={name:"localStorage",lookup:function(e){var r;if(e.lookupLocalStorage&&Eg()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(r=i)}return r},cacheUserLanguage:function(e,r){r.lookupLocalStorage&&Eg()&&window.localStorage.setItem(r.lookupLocalStorage,e)}},za=null,Pg=function(){if(za!==null)return za;try{za=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{za=!1}return za},A_={name:"sessionStorage",lookup:function(e){var r;if(e.lookupSessionStorage&&Pg()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(r=i)}return r},cacheUserLanguage:function(e,r){r.lookupSessionStorage&&Pg()&&window.sessionStorage.setItem(r.lookupSessionStorage,e)}},I_={name:"navigator",lookup:function(e){var r=[];if(typeof navigator<"u"){if(navigator.languages)for(var i=0;i0?r:void 0}},M_={name:"htmlTag",lookup:function(e){var r,i=e.htmlTag||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},F_={name:"path",lookup:function(e){var r;if(typeof window<"u"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof i[e.lookupFromPathIndex]!="string")return;r=i[e.lookupFromPathIndex].replace("/","")}else r=i[0].replace("/","")}return r}},D_={name:"subdomain",lookup:function(e){var r=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,i=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[r]}},Sv=!1;try{document.cookie,Sv=!0}catch{}var kv=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Sv||kv.splice(1,1);function $_(){return{order:kv,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}var Nv=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};__(this,t),this.type="languageDetector",this.detectors={},this.init(e,r)}return N_(t,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r||{languageUtils:{}},this.options=P_(i,this.options||{},$_()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(l){return l.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(R_),this.addDetector(T_),this.addDetector(L_),this.addDetector(A_),this.addDetector(I_),this.addDetector(M_),this.addDetector(F_),this.addDetector(D_)}},{key:"addDetector",value:function(r){return this.detectors[r.name]=r,this}},{key:"detect",value:function(r){var i=this;r||(r=this.options.order);var a=[];return r.forEach(function(l){if(i.detectors[l]){var d=i.detectors[l].lookup(i.options);d&&typeof d=="string"&&(d=[d]),d&&(a=a.concat(d))}}),a=a.map(function(l){return i.options.convertDetectedLanguage(l)}),this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}},{key:"cacheUserLanguage",value:function(r,i){var a=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||i.forEach(function(l){a.detectors[l]&&a.detectors[l].cacheUserLanguage(r,a.options)}))}}])})();Nv.type="languageDetector";function Bd(t){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bd(t)}function Cv(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Bd(XMLHttpRequest))==="object"}function z_(t){return!!t&&typeof t.then=="function"}function U_(t){return z_(t)?t:Promise.resolve(t)}function V_(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pl={exports:{}},Ol={exports:{}},Og;function B_(){return Og||(Og=1,(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Za<"u"&&Za,i=(function(){function l(){this.fetch=!1,this.DOMException=r.DOMException}return l.prototype=r,new l})();(function(l){(function(d){var f=typeof l<"u"&&l||typeof self<"u"&&self||typeof f<"u"&&f,m={searchParams:"URLSearchParams"in f,iterable:"Symbol"in f&&"iterator"in Symbol,blob:"FileReader"in f&&"Blob"in f&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in f,arrayBuffer:"ArrayBuffer"in f};function p(M){return M&&DataView.prototype.isPrototypeOf(M)}if(m.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(M){return M&&v.indexOf(Object.prototype.toString.call(M))>-1};function y(M){if(typeof M!="string"&&(M=String(M)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(M)||M==="")throw new TypeError('Invalid character in header field name: "'+M+'"');return M.toLowerCase()}function x(M){return typeof M!="string"&&(M=String(M)),M}function S(M){var R={next:function(){var G=M.shift();return{done:G===void 0,value:G}}};return m.iterable&&(R[Symbol.iterator]=function(){return R}),R}function _(M){this.map={},M instanceof _?M.forEach(function(R,G){this.append(G,R)},this):Array.isArray(M)?M.forEach(function(R){this.append(R[0],R[1])},this):M&&Object.getOwnPropertyNames(M).forEach(function(R){this.append(R,M[R])},this)}_.prototype.append=function(M,R){M=y(M),R=x(R);var G=this.map[M];this.map[M]=G?G+", "+R:R},_.prototype.delete=function(M){delete this.map[y(M)]},_.prototype.get=function(M){return M=y(M),this.has(M)?this.map[M]:null},_.prototype.has=function(M){return this.map.hasOwnProperty(y(M))},_.prototype.set=function(M,R){this.map[y(M)]=x(R)},_.prototype.forEach=function(M,R){for(var G in this.map)this.map.hasOwnProperty(G)&&M.call(R,this.map[G],G,this)},_.prototype.keys=function(){var M=[];return this.forEach(function(R,G){M.push(G)}),S(M)},_.prototype.values=function(){var M=[];return this.forEach(function(R){M.push(R)}),S(M)},_.prototype.entries=function(){var M=[];return this.forEach(function(R,G){M.push([G,R])}),S(M)},m.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function b(M){if(M.bodyUsed)return Promise.reject(new TypeError("Already read"));M.bodyUsed=!0}function P(M){return new Promise(function(R,G){M.onload=function(){R(M.result)},M.onerror=function(){G(M.error)}})}function N(M){var R=new FileReader,G=P(R);return R.readAsArrayBuffer(M),G}function F(M){var R=new FileReader,G=P(R);return R.readAsText(M),G}function L(M){for(var R=new Uint8Array(M),G=new Array(R.length),H=0;H-1?R:M}function de(M,R){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var G=R.body;if(M instanceof de){if(M.bodyUsed)throw new TypeError("Already read");this.url=M.url,this.credentials=M.credentials,R.headers||(this.headers=new _(M.headers)),this.method=M.method,this.mode=M.mode,this.signal=M.signal,!G&&M._bodyInit!=null&&(G=M._bodyInit,M.bodyUsed=!0)}else this.url=String(M);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new _(R.headers)),this.method=re(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&G)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(G),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var H=/([?&])_=[^&]*/;if(H.test(this.url))this.url=this.url.replace(H,"$1_="+new Date().getTime());else{var W=/\?/;this.url+=(W.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}de.prototype.clone=function(){return new de(this,{body:this._bodyInit})};function Z(M){var R=new FormData;return M.trim().split("&").forEach(function(G){if(G){var H=G.split("="),W=H.shift().replace(/\+/g," "),K=H.join("=").replace(/\+/g," ");R.append(decodeURIComponent(W),decodeURIComponent(K))}}),R}function Oe(M){var R=new _,G=M.replace(/\r?\n[\t ]+/g," ");return G.split("\r").map(function(H){return H.indexOf(` `)===0?H.substr(1,H.length):H}).forEach(function(H){var W=H.split(":"),K=W.shift().trim();if(K){var T=W.join(":").trim();R.append(K,T)}}),R}I.call(de.prototype);function J(M,R){if(!(this instanceof J))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new _(R.headers),this.url=R.url||"",this._initBody(M)}I.call(J.prototype),J.prototype.clone=function(){return new J(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},J.error=function(){var M=new J(null,{status:0,statusText:""});return M.type="error",M};var ve=[301,302,303,307,308];J.redirect=function(M,R){if(ve.indexOf(R)===-1)throw new RangeError("Invalid status code");return new J(null,{status:R,headers:{location:M}})},d.DOMException=f.DOMException;try{new d.DOMException}catch{d.DOMException=function(R,G){this.message=R,this.name=G;var H=Error(R);this.stack=H.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function me(M,R){return new Promise(function(G,H){var W=new de(M,R);if(W.signal&&W.signal.aborted)return H(new d.DOMException("Aborted","AbortError"));var K=new XMLHttpRequest;function T(){K.abort()}K.onload=function(){var ue={status:K.status,statusText:K.statusText,headers:Oe(K.getAllResponseHeaders()||"")};ue.url="responseURL"in K?K.responseURL:ue.headers.get("X-Request-URL");var pe="response"in K?K.response:K.responseText;setTimeout(function(){G(new J(pe,ue))},0)},K.onerror=function(){setTimeout(function(){H(new TypeError("Network request failed"))},0)},K.ontimeout=function(){setTimeout(function(){H(new TypeError("Network request failed"))},0)},K.onabort=function(){setTimeout(function(){H(new d.DOMException("Aborted","AbortError"))},0)};function Q(ue){try{return ue===""&&f.location.href?f.location.href:ue}catch{return ue}}K.open(W.method,Q(W.url),!0),W.credentials==="include"?K.withCredentials=!0:W.credentials==="omit"&&(K.withCredentials=!1),"responseType"in K&&(m.blob?K.responseType="blob":m.arrayBuffer&&W.headers.get("Content-Type")&&W.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(K.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof _)?Object.getOwnPropertyNames(R.headers).forEach(function(ue){K.setRequestHeader(ue,x(R.headers[ue]))}):W.headers.forEach(function(ue,pe){K.setRequestHeader(pe,ue)}),W.signal&&(W.signal.addEventListener("abort",T),K.onreadystatechange=function(){K.readyState===4&&W.signal.removeEventListener("abort",T)}),K.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return me.polyfill=!0,f.fetch||(f.fetch=me,f.Headers=_,f.Request=de,f.Response=J),d.Headers=_,d.Request=de,d.Response=J,d.fetch=me,d})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var a=r.fetch?r:i;e=a.fetch,e.default=a.fetch,e.fetch=a.fetch,e.Headers=a.Headers,e.Request=a.Request,e.Response=a.Response,t.exports=e})(Ol,Ol.exports)),Ol.exports}var Rg;function q_(){return Rg||(Rg=1,(function(t,e){var r=typeof fetch=="function"?fetch:void 0;if(typeof Za<"u"&&Za.fetch?r=Za.fetch:typeof window<"u"&&window.fetch&&(r=window.fetch),typeof V_<"u"&&typeof window>"u"){var i=r||B_();i.default&&(i=i.default),e.default=i,t.exports=e.default}})(Pl,Pl.exports)),Pl.exports}var Ev=q_();const Pv=iu(Ev),Tg=Vy({__proto__:null,default:Pv},[Ev]);function Lg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,i)}return r}function Ag(t){for(var e=1;e"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(l["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),i&&(l["Content-Type"]="application/json");var d=typeof e.requestOptions=="function"?e.requestOptions(i):e.requestOptions,f=Ag({method:i?"POST":"GET",body:i?e.stringify(i):void 0,headers:l},Mg?{}:d),m=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Ig(r,f,a,m)}catch(p){if(!d||Object.keys(d).length===0||!p.message||p.message.indexOf("not implemented")<0)return a(p);try{Object.keys(d).forEach(function(v){delete f[v]}),Ig(r,f,a,m),Mg=!0}catch(v){a(v)}}},Z_=function(e,r,i,a){i&&ni(i)==="object"&&(i=qd("",i).slice(1)),e.queryStringParams&&(r=qd(r,e.queryStringParams));try{var l;oo?l=new oo:l=new Hl("MSXML2.XMLHTTP.3.0"),l.open(i?"POST":"GET",r,1),e.crossDomain||l.setRequestHeader("X-Requested-With","XMLHttpRequest"),l.withCredentials=!!e.withCredentials,i&&l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.overrideMimeType&&l.overrideMimeType("application/json");var d=e.customHeaders;if(d=typeof d=="function"?d():d,d)for(var f in d)l.setRequestHeader(f,d[f]);l.onreadystatechange=function(){l.readyState>3&&a(l.status>=400?l.statusText:null,{status:l.status,data:l.responseText})},l.send(i)}catch(m){console&&console.log(m)}},G_=function(e,r,i,a){if(typeof i=="function"&&(a=i,i=void 0),a=a||function(){},Ts&&r.indexOf("file:")!==0)return Q_(e,r,i,a);if(Cv()||typeof ActiveXObject=="function")return Z_(e,r,i,a);a(new Error("No fetch and no xhr implementation found!"))};function Vi(t){"@babel/helpers - typeof";return Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vi(t)}function Fg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,i)}return r}function cd(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};J_(this,t),this.services=e,this.options=r,this.allOptions=i,this.type="backend",this.init(e,r,i)}return X_(t,[{key:"init",value:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=r,this.options=cd(cd(cd({},tS()),this.options||{}),a),this.allOptions=l,this.services&&this.options.reloadInterval){var d=setInterval(function(){return i.reload()},this.options.reloadInterval);Vi(d)==="object"&&typeof d.unref=="function"&&d.unref()}}},{key:"readMulti",value:function(r,i,a){this._readAny(r,r,i,i,a)}},{key:"read",value:function(r,i,a){this._readAny([r],r,[i],i,a)}},{key:"_readAny",value:function(r,i,a,l,d){var f=this,m=this.options.loadPath;typeof this.options.loadPath=="function"&&(m=this.options.loadPath(r,a)),m=U_(m),m.then(function(p){if(!p)return d(null,{});var v=f.services.interpolator.interpolate(p,{lng:r.join("+"),ns:a.join("+")});f.loadUrl(v,d,i,l)})}},{key:"loadUrl",value:function(r,i,a,l){var d=this,f=typeof a=="string"?[a]:a,m=typeof l=="string"?[l]:l,p=this.options.parseLoadPayload(f,m);this.options.request(this.options,r,p,function(v,w){if(w&&(w.status>=500&&w.status<600||!w.status))return i("failed loading "+r+"; status code: "+w.status,!0);if(w&&w.status>=400&&w.status<500)return i("failed loading "+r+"; status code: "+w.status,!1);if(!w&&v&&v.message){var y=v.message.toLowerCase(),x=["failed","fetch","network","load"].find(function(b){return y.indexOf(b)>-1});if(x)return i("failed loading "+r+": "+v.message,!0)}if(v)return i(v,!1);var S,_;try{typeof w.data=="string"?S=d.options.parse(w.data,a,l):S=w.data}catch{_="failed parsing "+r+" to json"}if(_)return i(_,!1);i(null,S)})}},{key:"create",value:function(r,i,a,l,d){var f=this;if(this.options.addPath){typeof r=="string"&&(r=[r]);var m=this.options.parsePayload(i,a,l),p=0,v=[],w=[];r.forEach(function(y){var x=f.options.addPath;typeof f.options.addPath=="function"&&(x=f.options.addPath(y,i));var S=f.services.interpolator.interpolate(x,{lng:y,ns:i});f.options.request(f.options,S,m,function(_,b){p+=1,v.push(_),w.push(b),p===r.length&&typeof d=="function"&&d(v,w)})})}}},{key:"reload",value:function(){var r=this,i=this.services,a=i.backendConnector,l=i.languageUtils,d=i.logger,f=a.language;if(!(f&&f.toLowerCase()==="cimode")){var m=[],p=function(w){var y=l.toResolveHierarchy(w);y.forEach(function(x){m.indexOf(x)<0&&m.push(x)})};p(f),this.allOptions.preload&&this.allOptions.preload.forEach(function(v){return p(v)}),m.forEach(function(v){r.allOptions.ns.forEach(function(w){a.read(v,w,"read",null,null,function(y,x){y&&d.warn("loading namespace ".concat(w," for language ").concat(v," failed"),y),!y&&x&&d.log("loaded namespace ".concat(w," for language ").concat(v),x),a.loaded("".concat(v,"|").concat(w),y,x)})})})}}}])})();Tv.type="backend";rn.use(Tv).use(Nv).use(x_).init({fallbackLng:"en",ns:["common","pages"],defaultNS:"common",backend:{loadPath:"/static/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},react:{useSuspense:!1}});var nS={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 rS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pe=(t,e)=>{const r=$.forwardRef(({color:i="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:d,children:f,...m},p)=>$.createElement("svg",{ref:p,...nS,width:a,height:a,stroke:i,strokeWidth:d?Number(l)*24/Number(a):l,className:`lucide lucide-${rS(t)}`,...m},[...e.map(([v,w])=>$.createElement(v,w)),...(Array.isArray(f)?f:[f])||[]]));return r.displayName=`${t}`,r},sS=Pe("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),fn=Pe("AlertCircle",[["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"}]]),iS=Pe("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Zn=Pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Lv=Pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),aS=Pe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]),oS=Pe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]),lS=Pe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),Av=Pe("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]),_f=Pe("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Dg=Pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),uS=Pe("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Hd=Pe("ClipboardCheck",[["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:"m9 14 2 2 4-4",key:"df797q"}]]),Iv=Pe("Clipboard",[["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"}]]),cS=Pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),Sf=Pe("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),dS=Pe("Database",[["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"}]]),Mv=Pe("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),fS=Pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Wd=Pe("FileJson",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),hS=Pe("FileSearch",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v3",key:"am10z3"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M5 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"ychnub"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}]]),pS=Pe("FileSpreadsheet",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M14 17h2",key:"10kma7"}]]),Fv=Pe("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),mS=Pe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),gS=Pe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),kf=Pe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),yS=Pe("Globe",[["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"}]]),vS=Pe("Highlighter",[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]),xS=Pe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),Dv=Pe("Layers3",[["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:"8b97xw"}],["path",{d:"m6.08 9.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1e5n1m"}],["path",{d:"m6.08 14.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1iwflc"}]]),wS=Pe("LayoutDashboard",[["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"}]]),bS=Pe("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),jS=Pe("Link",[["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"}]]),Nf=Pe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]),dr=Pe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),_S=Pe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),Cf=Pe("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),$v=Pe("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),ri=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),zv=Pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),$g=Pe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),Uv=Pe("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Vv=Pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),SS=Pe("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),kS=Pe("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),Bv=Pe("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),NS=Pe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]),CS=Pe("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),ES=Pe("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),Kd=Pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),PS=Pe("UploadCloud",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]]),OS=Pe("XCircle",[["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"}]]),zg=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ur(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i3?e.i-4:e.i:Array.isArray(t)?1:Ef(t)?2:Pf(t)?3:0}function Di(t,e){return ta(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function RS(t,e){return ta(t)===2?t.get(e):t[e]}function qv(t,e,r){var i=ta(t);i===2?t.set(e,r):i===3?t.add(r):t[e]=r}function Hv(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Ef(t){return FS&&t instanceof Map}function Pf(t){return DS&&t instanceof Set}function Js(t){return t.o||t.t}function Of(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Kv(t);delete e[yt];for(var r=$i(e),i=0;i1&&(t.set=t.add=t.clear=t.delete=TS),Object.freeze(t),e&&si(t,(function(r,i){return Rf(i,!0)}),!0)),t}function TS(){ur(2)}function Tf(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Er(t){var e=Jd[t];return e||ur(18,t),e}function LS(t,e){Jd[t]||(Jd[t]=e)}function Qd(){return lo}function dd(t,e){e&&(Er("Patches"),t.u=[],t.s=[],t.v=e)}function Wl(t){Zd(t),t.p.forEach(AS),t.p=null}function Zd(t){t===lo&&(lo=t.l)}function Ug(t){return lo={p:[],l:lo,h:t,m:!0,_:0}}function AS(t){var e=t[yt];e.i===0||e.i===1?e.j():e.g=!0}function fd(t,e){e._=e.p.length;var r=e.p[0],i=t!==void 0&&t!==r;return e.h.O||Er("ES5").S(e,t,i),i?(r[yt].P&&(Wl(e),ur(4)),Zr(t)&&(t=Kl(e,t),e.l||Ql(e,t)),e.u&&Er("Patches").M(r[yt].t,t,e.u,e.s)):t=Kl(e,r,[]),Wl(e),e.u&&e.v(e.u,e.s),t!==Wv?t:void 0}function Kl(t,e,r){if(Tf(e))return e;var i=e[yt];if(!i)return si(e,(function(f,m){return Vg(t,i,e,f,m,r)}),!0),e;if(i.A!==t)return e;if(!i.P)return Ql(t,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var a=i.i===4||i.i===5?i.o=Of(i.k):i.o,l=a,d=!1;i.i===3&&(l=new Set(a),a.clear(),d=!0),si(l,(function(f,m){return Vg(t,i,a,f,m,r,d)})),Ql(t,a,!1),r&&t.u&&Er("Patches").N(i,r,t.u,t.s)}return i.o}function Vg(t,e,r,i,a,l,d){if(Ls(a)){var f=Kl(t,a,l&&e&&e.i!==3&&!Di(e.R,i)?l.concat(i):void 0);if(qv(r,i,f),!Ls(f))return;t.m=!1}else d&&r.add(a);if(Zr(a)&&!Tf(a)){if(!t.h.D&&t._<1)return;Kl(t,a),e&&e.A.l||Ql(t,a)}}function Ql(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Rf(e,r)}function hd(t,e){var r=t[yt];return(r?Js(r):t)[e]}function Bg(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Object.getPrototypeOf(r)}}function Ss(t){t.P||(t.P=!0,t.l&&Ss(t.l))}function pd(t){t.o||(t.o=Of(t.t))}function Gd(t,e,r){var i=Ef(e)?Er("MapSet").F(e,r):Pf(e)?Er("MapSet").T(e,r):t.O?(function(a,l){var d=Array.isArray(a),f={i:d?1:0,A:l?l.A:Qd(),P:!1,I:!1,R:{},l,t:a,k:null,o:null,j:null,C:!1},m=f,p=uo;d&&(m=[f],p=Wa);var v=Proxy.revocable(m,p),w=v.revoke,y=v.proxy;return f.k=y,f.j=w,y})(e,r):Er("ES5").J(e,r);return(r?r.A:Qd()).p.push(i),i}function IS(t){return Ls(t)||ur(22,t),(function e(r){if(!Zr(r))return r;var i,a=r[yt],l=ta(r);if(a){if(!a.P&&(a.i<4||!Er("ES5").K(a)))return a.t;a.I=!0,i=qg(r,l),a.I=!1}else i=qg(r,l);return si(i,(function(d,f){a&&RS(a.t,d)===f||qv(i,d,e(f))})),l===3?new Set(i):i})(t)}function qg(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Of(t)}function MS(){function t(l,d){var f=a[l];return f?f.enumerable=d:a[l]=f={configurable:!0,enumerable:d,get:function(){var m=this[yt];return uo.get(m,l)},set:function(m){var p=this[yt];uo.set(p,l,m)}},f}function e(l){for(var d=l.length-1;d>=0;d--){var f=l[d][yt];if(!f.P)switch(f.i){case 5:i(f)&&Ss(f);break;case 4:r(f)&&Ss(f)}}}function r(l){for(var d=l.t,f=l.k,m=$i(f),p=m.length-1;p>=0;p--){var v=m[p];if(v!==yt){var w=d[v];if(w===void 0&&!Di(d,v))return!0;var y=f[v],x=y&&y[yt];if(x?x.t!==w:!Hv(y,w))return!0}}var S=!!d[yt];return m.length!==$i(d).length+(S?0:1)}function i(l){var d=l.k;if(d.length!==l.t.length)return!0;var f=Object.getOwnPropertyDescriptor(d,d.length-1);if(f&&!f.get)return!0;for(var m=0;m1?P-1:0),F=1;F1?v-1:0),y=1;y=0;a--){var l=i[a];if(l.path.length===0&&l.op==="replace"){r=l.value;break}}a>-1&&(i=i.slice(a+1));var d=Er("Patches").$;return Ls(r)?d(r,i):this.produce(r,(function(f){return d(f,i)}))},t})(),Dn=new zS,Qv=Dn.produce;Dn.produceWithPatches.bind(Dn);Dn.setAutoFreeze.bind(Dn);Dn.setUseProxies.bind(Dn);Dn.applyPatches.bind(Dn);Dn.createDraft.bind(Dn);Dn.finishDraft.bind(Dn);function US(t,e,r){return(e=jv(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,i)}return r}function Zg(t){for(var e=1;e"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Yt(1));return r(Zv)(t,e)}if(typeof t!="function")throw new Error(Yt(2));var a=t,l=e,d=[],f=d,m=!1;function p(){f===d&&(f=d.slice())}function v(){if(m)throw new Error(Yt(3));return l}function w(_){if(typeof _!="function")throw new Error(Yt(4));if(m)throw new Error(Yt(5));var b=!0;return p(),f.push(_),function(){if(b){if(m)throw new Error(Yt(6));b=!1,p();var N=f.indexOf(_);f.splice(N,1),d=null}}}function y(_){if(!VS(_))throw new Error(Yt(7));if(typeof _.type>"u")throw new Error(Yt(8));if(m)throw new Error(Yt(9));try{m=!0,l=a(l,_)}finally{m=!1}for(var b=d=f,P=0;P"u")throw new Error(Yt(12));if(typeof r(void 0,{type:Zl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function qS(t){for(var e=Object.keys(t),r={},i=0;i"u")throw p&&p.type,new Error(Yt(14));w[x]=b,v=v||b!==_}return v=v||l.length!==Object.keys(m).length,v?w:m}}function Gl(){for(var t=arguments.length,e=new Array(t),r=0;r0&&l[l.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]{t.sidebarOpen=!t.sidebarOpen},setCurrentStep:(t,e)=>{t.currentStep=e.payload},setSelectedProject:(t,e)=>{t.selectedProjectId=e.payload},setLoading:(t,e)=>{t.isLoading=e.payload},showNotification:(t,e)=>{t.notification=e.payload},clearNotification:t=>{t.notification={type:null,message:""}}}}),{toggleSidebar:yk}=Xv.actions,vk=Xv.reducer;function ex(t){var e,r,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e{const e=bk(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:d=>{const f=d.split(Mf);return f[0]===""&&f.length!==1&&f.shift(),nx(f,e)||wk(d)},getConflictingClassGroupIds:(d,f)=>{const m=r[d]||[];return f&&i[d]?[...m,...i[d]]:m}}},nx=(t,e)=>{if(t.length===0)return e.classGroupId;const r=t[0],i=e.nextPart.get(r),a=i?nx(t.slice(1),i):void 0;if(a)return a;if(e.validators.length===0)return;const l=t.join(Mf);return e.validators.find(({validator:d})=>d(l))?.classGroupId},ty=/^\[(.+)\]$/,wk=t=>{if(ty.test(t)){const e=ty.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},bk=t=>{const{theme:e,prefix:r}=t,i={nextPart:new Map,validators:[]};return _k(Object.entries(t.classGroups),r).forEach(([l,d])=>{ef(d,i,l,e)}),i},ef=(t,e,r,i)=>{t.forEach(a=>{if(typeof a=="string"){const l=a===""?e:ny(e,a);l.classGroupId=r;return}if(typeof a=="function"){if(jk(a)){ef(a(i),e,r,i);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([l,d])=>{ef(d,ny(e,l),r,i)})})},ny=(t,e)=>{let r=t;return e.split(Mf).forEach(i=>{r.nextPart.has(i)||r.nextPart.set(i,{nextPart:new Map,validators:[]}),r=r.nextPart.get(i)}),r},jk=t=>t.isThemeGetter,_k=(t,e)=>e?t.map(([r,i])=>{const a=i.map(l=>typeof l=="string"?e+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([d,f])=>[e+d,f])):l);return[r,a]}):t,Sk=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,i=new Map;const a=(l,d)=>{r.set(l,d),e++,e>t&&(e=0,i=r,r=new Map)};return{get(l){let d=r.get(l);if(d!==void 0)return d;if((d=i.get(l))!==void 0)return a(l,d),d},set(l,d){r.has(l)?r.set(l,d):a(l,d)}}},rx="!",kk=t=>{const{separator:e,experimentalParseClassName:r}=t,i=e.length===1,a=e[0],l=e.length,d=f=>{const m=[];let p=0,v=0,w;for(let b=0;bv?w-v:void 0;return{modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:_}};return r?f=>r({className:f,parseClassName:d}):d},Nk=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(i=>{i[0]==="["?(e.push(...r.sort(),i),r=[]):r.push(i)}),e.push(...r.sort()),e},Ck=t=>({cache:Sk(t.cacheSize),parseClassName:kk(t),...xk(t)}),Ek=/\s+/,Pk=(t,e)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:a}=e,l=[],d=t.trim().split(Ek);let f="";for(let m=d.length-1;m>=0;m-=1){const p=d[m],{modifiers:v,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:x}=r(p);let S=!!x,_=i(S?y.substring(0,x):y);if(!_){if(!S){f=p+(f.length>0?" "+f:f);continue}if(_=i(y),!_){f=p+(f.length>0?" "+f:f);continue}S=!1}const b=Nk(v).join(":"),P=w?b+rx:b,N=P+_;if(l.includes(N))continue;l.push(N);const F=a(_,S);for(let L=0;L0?" "+f:f)}return f};function Ok(){let t=0,e,r,i="";for(;t{if(typeof t=="string")return t;let e,r="";for(let i=0;iw(v),t());return r=Ck(p),i=r.cache.get,a=r.cache.set,l=f,f(m)}function f(m){const p=i(m);if(p)return p;const v=Pk(m,r);return a(m,v),v}return function(){return l(Ok.apply(null,arguments))}}const mt=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},ix=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tk=/^\d+\/\d+$/,Lk=new Set(["px","full","screen"]),Ak=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ik=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Mk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wr=t=>zi(t)||Lk.has(t)||Tk.test(t),ws=t=>na(t,"length",Wk),zi=t=>!!t&&!Number.isNaN(Number(t)),vd=t=>na(t,"number",zi),Ua=t=>!!t&&Number.isInteger(Number(t)),$k=t=>t.endsWith("%")&&zi(t.slice(0,-1)),He=t=>ix.test(t),bs=t=>Ak.test(t),zk=new Set(["length","size","percentage"]),Uk=t=>na(t,zk,ax),Vk=t=>na(t,"position",ax),Bk=new Set(["image","url"]),qk=t=>na(t,Bk,Qk),Hk=t=>na(t,"",Kk),Va=()=>!0,na=(t,e,r)=>{const i=ix.exec(t);return i?i[1]?typeof e=="string"?i[1]===e:e.has(i[1]):r(i[2]):!1},Wk=t=>Ik.test(t)&&!Mk.test(t),ax=()=>!1,Kk=t=>Fk.test(t),Qk=t=>Dk.test(t),Zk=()=>{const t=mt("colors"),e=mt("spacing"),r=mt("blur"),i=mt("brightness"),a=mt("borderColor"),l=mt("borderRadius"),d=mt("borderSpacing"),f=mt("borderWidth"),m=mt("contrast"),p=mt("grayscale"),v=mt("hueRotate"),w=mt("invert"),y=mt("gap"),x=mt("gradientColorStops"),S=mt("gradientColorStopPositions"),_=mt("inset"),b=mt("margin"),P=mt("opacity"),N=mt("padding"),F=mt("saturate"),L=mt("scale"),k=mt("sepia"),I=mt("skew"),X=mt("space"),re=mt("translate"),de=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],Oe=()=>["auto",He,e],J=()=>[He,e],ve=()=>["",Wr,ws],me=()=>["auto",zi,He],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",He],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[zi,He];return{cacheSize:500,separator:":",theme:{colors:[Va],spacing:[Wr,ws],blur:["none","",bs,He],brightness:T(),borderColor:[t],borderRadius:["none","","full",bs,He],borderSpacing:J(),borderWidth:ve(),contrast:T(),grayscale:W(),hueRotate:T(),invert:W(),gap:J(),gradientColorStops:[t],gradientColorStopPositions:[$k,ws],inset:Oe(),margin:Oe(),opacity:T(),padding:J(),saturate:T(),scale:T(),sepia:W(),skew:T(),space:J(),translate:J()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[bs]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),He]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:de()}],"overscroll-x":[{"overscroll-x":de()}],"overscroll-y":[{"overscroll-y":de()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ua,He]}],basis:[{basis:Oe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Ua,He]}],"grid-cols":[{"grid-cols":[Va]}],"col-start-end":[{col:["auto",{span:["full",Ua,He]},He]}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":[Va]}],"row-start-end":[{row:["auto",{span:[Ua,He]},He]}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[X]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[X]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,e]}],"min-w":[{"min-w":[He,e,"min","max","fit"]}],"max-w":[{"max-w":[He,e,"none","full","min","max","fit","prose",{screen:[bs]},bs]}],h:[{h:[He,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,e,"auto","min","max","fit"]}],"font-size":[{text:["base",bs,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vd]}],"font-family":[{font:[Va]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",zi,vd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wr,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wr,ws]}],"underline-offset":[{"underline-offset":["auto",Wr,He]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:J()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),Vk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Uk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},qk]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[f]}],"border-w-x":[{"border-x":[f]}],"border-w-y":[{"border-y":[f]}],"border-w-s":[{"border-s":[f]}],"border-w-e":[{"border-e":[f]}],"border-w-t":[{"border-t":[f]}],"border-w-r":[{"border-r":[f]}],"border-w-b":[{"border-b":[f]}],"border-w-l":[{"border-l":[f]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...R(),"hidden"]}],"divide-x":[{"divide-x":[f]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[f]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:R()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[Wr,He]}],"outline-w":[{outline:[Wr,ws]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Wr,ws]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",bs,Hk]}],"shadow-color":[{shadow:[Va]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[i]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",bs,He]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[w]}],saturate:[{saturate:[F]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[F]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[Ua,He]}],"translate-x":[{"translate-x":[re]}],"translate-y":[{"translate-y":[re]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":J()}],"scroll-mx":[{"scroll-mx":J()}],"scroll-my":[{"scroll-my":J()}],"scroll-ms":[{"scroll-ms":J()}],"scroll-me":[{"scroll-me":J()}],"scroll-mt":[{"scroll-mt":J()}],"scroll-mr":[{"scroll-mr":J()}],"scroll-mb":[{"scroll-mb":J()}],"scroll-ml":[{"scroll-ml":J()}],"scroll-p":[{"scroll-p":J()}],"scroll-px":[{"scroll-px":J()}],"scroll-py":[{"scroll-py":J()}],"scroll-ps":[{"scroll-ps":J()}],"scroll-pe":[{"scroll-pe":J()}],"scroll-pt":[{"scroll-pt":J()}],"scroll-pr":[{"scroll-pr":J()}],"scroll-pb":[{"scroll-pb":J()}],"scroll-pl":[{"scroll-pl":J()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Wr,ws,vd]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Gk=Rk(Zk);function _t(...t){return Gk(tx(t))}const ry=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,sy=tx,ox=(t,e)=>r=>{var i;if(e?.variants==null)return sy(t,r?.class,r?.className);const{variants:a,defaultVariants:l}=e,d=Object.keys(a).map(p=>{const v=r?.[p],w=l?.[p];if(v===null)return null;const y=ry(v)||ry(w);return a[p][y]}),f=r&&Object.entries(r).reduce((p,v)=>{let[w,y]=v;return y===void 0||(p[w]=y),p},{}),m=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((p,v)=>{let{class:w,className:y,...x}=v;return Object.entries(x).every(S=>{let[_,b]=S;return Array.isArray(b)?b.includes({...l,...f}[_]):{...l,...f}[_]===b})?[...p,w,y]:p},[]);return sy(t,d,m,r?.class,r?.className)},lx=ox("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ee=$.forwardRef(({className:t,variant:e,size:r,...i},a)=>u.jsx("button",{ref:a,className:_t(lx({variant:e,size:r}),t),...i}));Ee.displayName="Button";var st;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const l={};for(const d of a)l[d]=d;return l},t.getValidEnumValues=a=>{const l=t.objectKeys(a).filter(f=>typeof a[a[f]]!="number"),d={};for(const f of l)d[f]=a[f];return t.objectValues(d)},t.objectValues=a=>t.objectKeys(a).map(function(l){return a[l]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&l.push(d);return l},t.find=(a,l)=>{for(const d of a)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function i(a,l=" | "){return a.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(st||(st={}));var iy;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(iy||(iy={}));const je=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_s=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},ie=st.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Gr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(l){return l.message},i={_errors:[]},a=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(a);else if(d.code==="invalid_return_type")a(d.returnTypeError);else if(d.code==="invalid_arguments")a(d.argumentsError);else if(d.path.length===0)i._errors.push(r(d));else{let f=i,m=0;for(;mr.message){const r={},i=[];for(const a of this.issues)if(a.path.length>0){const l=a.path[0];r[l]=r[l]||[],r[l].push(e(a))}else i.push(e(a));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}}Gr.create=t=>new Gr(t);const tf=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===je.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,st.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${st.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${st.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${st.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:st.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,st.assertNever(t)}return{message:r}};let Jk=tf;function Yk(){return Jk}const Xk=t=>{const{data:e,path:r,errorMaps:i,issueData:a}=t,l=[...r,...a.path||[]],d={...a,path:l};if(a.message!==void 0)return{...a,path:l,message:a.message};let f="";const m=i.filter(p=>!!p).slice().reverse();for(const p of m)f=p(d,{data:e,defaultError:f}).message;return{...a,path:l,message:f}};function fe(t,e){const r=Yk(),i=Xk({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===tf?void 0:tf].filter(a=>!!a)});t.common.issues.push(i)}class hn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const i=[];for(const a of r){if(a.status==="aborted")return ze;a.status==="dirty"&&e.dirty(),i.push(a.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){const i=[];for(const a of r){const l=await a.key,d=await a.value;i.push({key:l,value:d})}return hn.mergeObjectSync(e,i)}static mergeObjectSync(e,r){const i={};for(const a of r){const{key:l,value:d}=a;if(l.status==="aborted"||d.status==="aborted")return ze;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||a.alwaysSet)&&(i[l.value]=d.value)}return{status:e.value,value:i}}}const ze=Object.freeze({status:"aborted"}),Ka=t=>({status:"dirty",value:t}),Gn=t=>({status:"valid",value:t}),ay=t=>t.status==="aborted",oy=t=>t.status==="dirty",qi=t=>t.status==="valid",Jl=t=>typeof Promise<"u"&&t instanceof Promise;var ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ke||(ke={}));class Or{constructor(e,r,i,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ly=(t,e)=>{if(qi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Gr(t.common.issues);return this._error=r,this._error}}};function Ke(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:i,description:a}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(d,f)=>{const{message:m}=t;return d.code==="invalid_enum_value"?{message:m??f.defaultError}:typeof f.data>"u"?{message:m??i??f.defaultError}:d.code!=="invalid_type"?{message:f.defaultError}:{message:m??r??f.defaultError}},description:a}}class Je{get description(){return this._def.description}_getType(e){return _s(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:_s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new hn,ctx:{common:e.parent.common,data:e.data,parsedType:_s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Jl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){const i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_s(e)},a=this._parseSync({data:e,path:i.path,parent:i});return ly(i,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_s(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return qi(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>qi(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){const i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){const i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_s(e)},a=this._parse({data:e,path:i.path,parent:i}),l=await(Jl(a)?a:Promise.resolve(a));return ly(i,l)}refine(e,r){const i=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,l)=>{const d=e(a),f=()=>l.addIssue({code:ie.custom,...i(a)});return typeof Promise<"u"&&d instanceof Promise?d.then(m=>m?!0:(f(),!1)):d?!0:(f(),!1)})}refinement(e,r){return this._refinement((i,a)=>e(i)?!0:(a.addIssue(typeof r=="function"?r(i,a):r),!1))}_refinement(e){return new Ki({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Os.create(this,this._def)}nullable(){return Qi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pr.create(this)}promise(){return nu.create(this,this._def)}or(e){return Xl.create([this,e],this._def)}and(e){return eu.create(this,e,this._def)}transform(e){return new Ki({...Ke(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new lf({...Ke(this._def),innerType:this,defaultValue:r,typeName:De.ZodDefault})}brand(){return new jN({typeName:De.ZodBranded,type:this,...Ke(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new uf({...Ke(this._def),innerType:this,catchValue:r,typeName:De.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ff.create(this,e)}readonly(){return cf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const eN=/^c[^\s-]{8,}$/i,tN=/^[0-9a-z]+$/,nN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sN=/^[a-z0-9_-]{21}$/i,iN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,aN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xd;const uN=/^(?:(?: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])$/,cN=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,dN=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fN=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ux="((\\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])))",mN=new RegExp(`^${ux}$`);function cx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function gN(t){return new RegExp(`^${cx(t)}$`)}function yN(t){let e=`${ux}T${cx(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function vN(t,e){return!!((e==="v4"||!e)&&uN.test(t)||(e==="v6"||!e)&&dN.test(t))}function xN(t,e){if(!iN.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(i));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function wN(t,e){return!!((e==="v4"||!e)&&cN.test(t)||(e==="v6"||!e)&&fN.test(t))}class Kr extends Je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const l=this._getOrReturnCtx(e);return fe(l,{code:ie.invalid_type,expected:je.string,received:l.parsedType}),ze}const i=new hn;let a;for(const l of this._def.checks)if(l.kind==="min")e.data.lengthl.value&&(a=this._getOrReturnCtx(e,a),fe(a,{code:ie.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const d=e.data.length>l.value,f=e.data.lengthe.test(a),{validation:r,code:ie.invalid_string,...ke.errToObj(i)})}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ke.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ke.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ke.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ke.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ke.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ke.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ke.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ke.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ke.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ke.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ke.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ke.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ke.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ke.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ke.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ke.errToObj(r)})}nonempty(e){return this.min(1,ke.errToObj(e))}trim(){return new Kr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Kr({checks:[],typeName:De.ZodString,coerce:t?.coerce??!1,...Ke(t)});function bN(t,e){const r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,a=r>i?r:i,l=Number.parseInt(t.toFixed(a).replace(".","")),d=Number.parseInt(e.toFixed(a).replace(".",""));return l%d/10**a}class Hi extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==je.number){const l=this._getOrReturnCtx(e);return fe(l,{code:ie.invalid_type,expected:je.number,received:l.parsedType}),ze}let i;const a=new hn;for(const l of this._def.checks)l.kind==="int"?st.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.invalid_type,expected:"integer",received:"float",message:l.message}),a.dirty()):l.kind==="min"?(l.inclusive?e.datal.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),a.dirty()):l.kind==="multipleOf"?bN(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.not_multiple_of,multipleOf:l.value,message:l.message}),a.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.not_finite,message:l.message}),a.dirty()):st.assertNever(l);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ke.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ke.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ke.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ke.toString(r))}setLimit(e,r,i,a){return new Hi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:ke.toString(a)}]})}_addCheck(e){return new Hi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&st.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.valuenew Hi({checks:[],typeName:De.ZodNumber,coerce:t?.coerce||!1,...Ke(t)});class co extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==je.bigint)return this._getInvalidInput(e);let i;const a=new hn;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.datal.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),a.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),fe(i,{code:ie.not_multiple_of,multipleOf:l.value,message:l.message}),a.dirty()):st.assertNever(l);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return fe(r,{code:ie.invalid_type,expected:je.bigint,received:r.parsedType}),ze}gte(e,r){return this.setLimit("min",e,!0,ke.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ke.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ke.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ke.toString(r))}setLimit(e,r,i,a){return new co({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:ke.toString(a)}]})}_addCheck(e){return new co({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew co({checks:[],typeName:De.ZodBigInt,coerce:t?.coerce??!1,...Ke(t)});class nf extends Je{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.boolean,received:i.parsedType}),ze}return Gn(e.data)}}nf.create=t=>new nf({typeName:De.ZodBoolean,coerce:t?.coerce||!1,...Ke(t)});class Yl extends Je{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){const l=this._getOrReturnCtx(e);return fe(l,{code:ie.invalid_type,expected:je.date,received:l.parsedType}),ze}if(Number.isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return fe(l,{code:ie.invalid_date}),ze}const i=new hn;let a;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()l.value&&(a=this._getOrReturnCtx(e,a),fe(a,{code:ie.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):st.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yl({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ke.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ke.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Yl({checks:[],coerce:t?.coerce||!1,typeName:De.ZodDate,...Ke(t)});class uy extends Je{_parse(e){if(this._getType(e)!==je.symbol){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.symbol,received:i.parsedType}),ze}return Gn(e.data)}}uy.create=t=>new uy({typeName:De.ZodSymbol,...Ke(t)});class cy extends Je{_parse(e){if(this._getType(e)!==je.undefined){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.undefined,received:i.parsedType}),ze}return Gn(e.data)}}cy.create=t=>new cy({typeName:De.ZodUndefined,...Ke(t)});class rf extends Je{_parse(e){if(this._getType(e)!==je.null){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.null,received:i.parsedType}),ze}return Gn(e.data)}}rf.create=t=>new rf({typeName:De.ZodNull,...Ke(t)});class dy extends Je{constructor(){super(...arguments),this._any=!0}_parse(e){return Gn(e.data)}}dy.create=t=>new dy({typeName:De.ZodAny,...Ke(t)});class sf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gn(e.data)}}sf.create=t=>new sf({typeName:De.ZodUnknown,...Ke(t)});class As extends Je{_parse(e){const r=this._getOrReturnCtx(e);return fe(r,{code:ie.invalid_type,expected:je.never,received:r.parsedType}),ze}}As.create=t=>new As({typeName:De.ZodNever,...Ke(t)});class fy extends Je{_parse(e){if(this._getType(e)!==je.undefined){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.void,received:i.parsedType}),ze}return Gn(e.data)}}fy.create=t=>new fy({typeName:De.ZodVoid,...Ke(t)});class Pr extends Je{_parse(e){const{ctx:r,status:i}=this._processInputParams(e),a=this._def;if(r.parsedType!==je.array)return fe(r,{code:ie.invalid_type,expected:je.array,received:r.parsedType}),ze;if(a.exactLength!==null){const d=r.data.length>a.exactLength.value,f=r.data.lengtha.maxLength.value&&(fe(r,{code:ie.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((d,f)=>a.type._parseAsync(new Or(r,d,r.path,f)))).then(d=>hn.mergeArray(i,d));const l=[...r.data].map((d,f)=>a.type._parseSync(new Or(r,d,r.path,f)));return hn.mergeArray(i,l)}get element(){return this._def.type}min(e,r){return new Pr({...this._def,minLength:{value:e,message:ke.toString(r)}})}max(e,r){return new Pr({...this._def,maxLength:{value:e,message:ke.toString(r)}})}length(e,r){return new Pr({...this._def,exactLength:{value:e,message:ke.toString(r)}})}nonempty(e){return this.min(1,e)}}Pr.create=(t,e)=>new Pr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...Ke(e)});function Fi(t){if(t instanceof Mt){const e={};for(const r in t.shape){const i=t.shape[r];e[r]=Os.create(Fi(i))}return new Mt({...t._def,shape:()=>e})}else return t instanceof Pr?new Pr({...t._def,type:Fi(t.element)}):t instanceof Os?Os.create(Fi(t.unwrap())):t instanceof Qi?Qi.create(Fi(t.unwrap())):t instanceof ii?ii.create(t.items.map(e=>Fi(e))):t}class Mt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=st.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==je.object){const p=this._getOrReturnCtx(e);return fe(p,{code:ie.invalid_type,expected:je.object,received:p.parsedType}),ze}const{status:i,ctx:a}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),f=[];if(!(this._def.catchall instanceof As&&this._def.unknownKeys==="strip"))for(const p in a.data)d.includes(p)||f.push(p);const m=[];for(const p of d){const v=l[p],w=a.data[p];m.push({key:{status:"valid",value:p},value:v._parse(new Or(a,w,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof As){const p=this._def.unknownKeys;if(p==="passthrough")for(const v of f)m.push({key:{status:"valid",value:v},value:{status:"valid",value:a.data[v]}});else if(p==="strict")f.length>0&&(fe(a,{code:ie.unrecognized_keys,keys:f}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const v of f){const w=a.data[v];m.push({key:{status:"valid",value:v},value:p._parse(new Or(a,w,a.path,v)),alwaysSet:v in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const v of m){const w=await v.key,y=await v.value;p.push({key:w,value:y,alwaysSet:v.alwaysSet})}return p}).then(p=>hn.mergeObjectSync(i,p)):hn.mergeObjectSync(i,m)}get shape(){return this._def.shape()}strict(e){return ke.errToObj,new Mt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{const a=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:ke.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Mt({...this._def,unknownKeys:"strip"})}passthrough(){return new Mt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Mt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Mt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Mt({...this._def,catchall:e})}pick(e){const r={};for(const i of st.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new Mt({...this._def,shape:()=>r})}omit(e){const r={};for(const i of st.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new Mt({...this._def,shape:()=>r})}deepPartial(){return Fi(this)}partial(e){const r={};for(const i of st.objectKeys(this.shape)){const a=this.shape[i];e&&!e[i]?r[i]=a:r[i]=a.optional()}return new Mt({...this._def,shape:()=>r})}required(e){const r={};for(const i of st.objectKeys(this.shape))if(e&&!e[i])r[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Os;)l=l._def.innerType;r[i]=l}return new Mt({...this._def,shape:()=>r})}keyof(){return dx(st.objectKeys(this.shape))}}Mt.create=(t,e)=>new Mt({shape:()=>t,unknownKeys:"strip",catchall:As.create(),typeName:De.ZodObject,...Ke(e)});Mt.strictCreate=(t,e)=>new Mt({shape:()=>t,unknownKeys:"strict",catchall:As.create(),typeName:De.ZodObject,...Ke(e)});Mt.lazycreate=(t,e)=>new Mt({shape:t,unknownKeys:"strip",catchall:As.create(),typeName:De.ZodObject,...Ke(e)});class Xl extends Je{_parse(e){const{ctx:r}=this._processInputParams(e),i=this._def.options;function a(l){for(const f of l)if(f.result.status==="valid")return f.result;for(const f of l)if(f.result.status==="dirty")return r.common.issues.push(...f.ctx.common.issues),f.result;const d=l.map(f=>new Gr(f.ctx.common.issues));return fe(r,{code:ie.invalid_union,unionErrors:d}),ze}if(r.common.async)return Promise.all(i.map(async l=>{const d={...r,common:{...r.common,issues:[]},parent:null};return{result:await l._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(a);{let l;const d=[];for(const m of i){const p={...r,common:{...r.common,issues:[]},parent:null},v=m._parseSync({data:r.data,path:r.path,parent:p});if(v.status==="valid")return v;v.status==="dirty"&&!l&&(l={result:v,ctx:p}),p.common.issues.length&&d.push(p.common.issues)}if(l)return r.common.issues.push(...l.ctx.common.issues),l.result;const f=d.map(m=>new Gr(m));return fe(r,{code:ie.invalid_union,unionErrors:f}),ze}}get options(){return this._def.options}}Xl.create=(t,e)=>new Xl({options:t,typeName:De.ZodUnion,...Ke(e)});function af(t,e){const r=_s(t),i=_s(e);if(t===e)return{valid:!0,data:t};if(r===je.object&&i===je.object){const a=st.objectKeys(e),l=st.objectKeys(t).filter(f=>a.indexOf(f)!==-1),d={...t,...e};for(const f of l){const m=af(t[f],e[f]);if(!m.valid)return{valid:!1};d[f]=m.data}return{valid:!0,data:d}}else if(r===je.array&&i===je.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let l=0;l{if(ay(l)||ay(d))return ze;const f=af(l.value,d.value);return f.valid?((oy(l)||oy(d))&&r.dirty(),{status:r.value,value:f.data}):(fe(i,{code:ie.invalid_intersection_types}),ze)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,d])=>a(l,d)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}eu.create=(t,e,r)=>new eu({left:t,right:e,typeName:De.ZodIntersection,...Ke(r)});class ii extends Je{_parse(e){const{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==je.array)return fe(i,{code:ie.invalid_type,expected:je.array,received:i.parsedType}),ze;if(i.data.lengththis._def.items.length&&(fe(i,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const l=[...i.data].map((d,f)=>{const m=this._def.items[f]||this._def.rest;return m?m._parse(new Or(i,d,i.path,f)):null}).filter(d=>!!d);return i.common.async?Promise.all(l).then(d=>hn.mergeArray(r,d)):hn.mergeArray(r,l)}get items(){return this._def.items}rest(e){return new ii({...this._def,rest:e})}}ii.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ii({items:t,typeName:De.ZodTuple,rest:null,...Ke(e)})};class tu extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==je.object)return fe(i,{code:ie.invalid_type,expected:je.object,received:i.parsedType}),ze;const a=[],l=this._def.keyType,d=this._def.valueType;for(const f in i.data)a.push({key:l._parse(new Or(i,f,i.path,f)),value:d._parse(new Or(i,i.data[f],i.path,f)),alwaysSet:f in i.data});return i.common.async?hn.mergeObjectAsync(r,a):hn.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof Je?new tu({keyType:e,valueType:r,typeName:De.ZodRecord,...Ke(i)}):new tu({keyType:Kr.create(),valueType:e,typeName:De.ZodRecord,...Ke(r)})}}class hy extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==je.map)return fe(i,{code:ie.invalid_type,expected:je.map,received:i.parsedType}),ze;const a=this._def.keyType,l=this._def.valueType,d=[...i.data.entries()].map(([f,m],p)=>({key:a._parse(new Or(i,f,i.path,[p,"key"])),value:l._parse(new Or(i,m,i.path,[p,"value"]))}));if(i.common.async){const f=new Map;return Promise.resolve().then(async()=>{for(const m of d){const p=await m.key,v=await m.value;if(p.status==="aborted"||v.status==="aborted")return ze;(p.status==="dirty"||v.status==="dirty")&&r.dirty(),f.set(p.value,v.value)}return{status:r.value,value:f}})}else{const f=new Map;for(const m of d){const p=m.key,v=m.value;if(p.status==="aborted"||v.status==="aborted")return ze;(p.status==="dirty"||v.status==="dirty")&&r.dirty(),f.set(p.value,v.value)}return{status:r.value,value:f}}}}hy.create=(t,e,r)=>new hy({valueType:e,keyType:t,typeName:De.ZodMap,...Ke(r)});class fo extends Je{_parse(e){const{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==je.set)return fe(i,{code:ie.invalid_type,expected:je.set,received:i.parsedType}),ze;const a=this._def;a.minSize!==null&&i.data.sizea.maxSize.value&&(fe(i,{code:ie.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const l=this._def.valueType;function d(m){const p=new Set;for(const v of m){if(v.status==="aborted")return ze;v.status==="dirty"&&r.dirty(),p.add(v.value)}return{status:r.value,value:p}}const f=[...i.data.values()].map((m,p)=>l._parse(new Or(i,m,i.path,p)));return i.common.async?Promise.all(f).then(m=>d(m)):d(f)}min(e,r){return new fo({...this._def,minSize:{value:e,message:ke.toString(r)}})}max(e,r){return new fo({...this._def,maxSize:{value:e,message:ke.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}fo.create=(t,e)=>new fo({valueType:t,minSize:null,maxSize:null,typeName:De.ZodSet,...Ke(e)});class py extends Je{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}py.create=(t,e)=>new py({getter:t,typeName:De.ZodLazy,...Ke(e)});class of extends Je{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return fe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:e.data}}get value(){return this._def.value}}of.create=(t,e)=>new of({value:t,typeName:De.ZodLiteral,...Ke(e)});function dx(t,e){return new Wi({values:t,typeName:De.ZodEnum,...Ke(e)})}class Wi extends Je{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),i=this._def.values;return fe(r,{expected:st.joinValues(i),received:r.parsedType,code:ie.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),i=this._def.values;return fe(r,{received:r.data,code:ie.invalid_enum_value,options:i}),ze}return Gn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Wi.create(e,{...this._def,...r})}exclude(e,r=this._def){return Wi.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}}Wi.create=dx;class my extends Je{_parse(e){const r=st.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==je.string&&i.parsedType!==je.number){const a=st.objectValues(r);return fe(i,{expected:st.joinValues(a),received:i.parsedType,code:ie.invalid_type}),ze}if(this._cache||(this._cache=new Set(st.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=st.objectValues(r);return fe(i,{received:i.data,code:ie.invalid_enum_value,options:a}),ze}return Gn(e.data)}get enum(){return this._def.values}}my.create=(t,e)=>new my({values:t,typeName:De.ZodNativeEnum,...Ke(e)});class nu extends Je{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==je.promise&&r.common.async===!1)return fe(r,{code:ie.invalid_type,expected:je.promise,received:r.parsedType}),ze;const i=r.parsedType===je.promise?r.data:Promise.resolve(r.data);return Gn(i.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}nu.create=(t,e)=>new nu({type:t,typeName:De.ZodPromise,...Ke(e)});class Ki extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:i}=this._processInputParams(e),a=this._def.effect||null,l={addIssue:d=>{fe(i,d),d.fatal?r.abort():r.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),a.type==="preprocess"){const d=a.transform(i.data,l);if(i.common.async)return Promise.resolve(d).then(async f=>{if(r.value==="aborted")return ze;const m=await this._def.schema._parseAsync({data:f,path:i.path,parent:i});return m.status==="aborted"?ze:m.status==="dirty"||r.value==="dirty"?Ka(m.value):m});{if(r.value==="aborted")return ze;const f=this._def.schema._parseSync({data:d,path:i.path,parent:i});return f.status==="aborted"?ze:f.status==="dirty"||r.value==="dirty"?Ka(f.value):f}}if(a.type==="refinement"){const d=f=>{const m=a.refinement(f,l);if(i.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(i.common.async===!1){const f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return f.status==="aborted"?ze:(f.status==="dirty"&&r.dirty(),d(f.value),{status:r.value,value:f.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(f=>f.status==="aborted"?ze:(f.status==="dirty"&&r.dirty(),d(f.value).then(()=>({status:r.value,value:f.value}))))}if(a.type==="transform")if(i.common.async===!1){const d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!qi(d))return ze;const f=a.transform(d.value,l);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:f}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(d=>qi(d)?Promise.resolve(a.transform(d.value,l)).then(f=>({status:r.value,value:f})):ze);st.assertNever(a)}}Ki.create=(t,e,r)=>new Ki({schema:t,typeName:De.ZodEffects,effect:e,...Ke(r)});Ki.createWithPreprocess=(t,e,r)=>new Ki({schema:e,effect:{type:"preprocess",transform:t},typeName:De.ZodEffects,...Ke(r)});class Os extends Je{_parse(e){return this._getType(e)===je.undefined?Gn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Os.create=(t,e)=>new Os({innerType:t,typeName:De.ZodOptional,...Ke(e)});class Qi extends Je{_parse(e){return this._getType(e)===je.null?Gn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qi.create=(t,e)=>new Qi({innerType:t,typeName:De.ZodNullable,...Ke(e)});class lf extends Je{_parse(e){const{ctx:r}=this._processInputParams(e);let i=r.data;return r.parsedType===je.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}lf.create=(t,e)=>new lf({innerType:t,typeName:De.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ke(e)});class uf extends Je{_parse(e){const{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Jl(a)?a.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Gr(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Gr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}uf.create=(t,e)=>new uf({innerType:t,typeName:De.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ke(e)});class gy extends Je{_parse(e){if(this._getType(e)!==je.nan){const i=this._getOrReturnCtx(e);return fe(i,{code:ie.invalid_type,expected:je.nan,received:i.parsedType}),ze}return{status:"valid",value:e.data}}}gy.create=t=>new gy({typeName:De.ZodNaN,...Ke(t)});class jN extends Je{_parse(e){const{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ff extends Je{_parse(e){const{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?ze:l.status==="dirty"?(r.dirty(),Ka(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?ze:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(e,r){return new Ff({in:e,out:r,typeName:De.ZodPipeline})}}class cf extends Je{_parse(e){const r=this._def.innerType._parse(e),i=a=>(qi(a)&&(a.value=Object.freeze(a.value)),a);return Jl(r)?r.then(a=>i(a)):i(r)}unwrap(){return this._def.innerType}}cf.create=(t,e)=>new cf({innerType:t,typeName:De.ZodReadonly,...Ke(e)});var De;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(De||(De={}));const D=Kr.create,Ne=Hi.create,Rr=nf.create,Df=rf.create,dn=sf.create;As.create;const it=Pr.create,Be=Mt.create,nn=Xl.create;eu.create;ii.create;const li=tu.create,fx=of.create,hx=Wi.create;nu.create;Os.create;Qi.create;class yy extends Error{constructor(e,r,i,a){super(`${e} ${r} - ${a}`),this.status=e,this.statusText=r,this.body=i,this.url=a,this.name="ApiError"}status;statusText;body;url}function _N(t,e){if(!e)return t;const r=new URLSearchParams;for(const[a,l]of Object.entries(e))l!=null&&r.append(a,String(l));const i=r.toString();return i?`${t}?${i}`:t}async function Ba(t,e,r={}){const{body:i,query:a,headers:l,...d}=r,f=_N(t,a),m={...d,headers:{Accept:"application/json",...i!==void 0?{"Content-Type":"application/json"}:{},...l},body:i!==void 0?JSON.stringify(i):void 0},p=await fetch(f,m),w=(p.headers.get("content-type")??"").includes("application/json")&&p.status!==204?await p.json():await p.text();if(!p.ok)throw new yy(p.status,p.statusText,w,f);const y=e.safeParse(w);if(!y.success)throw new yy(p.status,"Response schema mismatch",{issues:y.error.issues,raw:w},f);return y.data}const rt={get:(t,e,r)=>Ba(t,e,{...r,method:"GET"}),post:(t,e,r,i)=>Ba(t,e,{...i,method:"POST",body:r}),put:(t,e,r,i)=>Ba(t,e,{...i,method:"PUT",body:r}),patch:(t,e,r,i)=>Ba(t,e,{...i,method:"PATCH",body:r}),delete:(t,e,r)=>Ba(t,e,{...r,method:"DELETE"})},SN=Be({id:nn([D(),Ne()]).transform(String),name:D(),domain:D(),created_at:D(),updated_at:D()}),kN=it(SN),NN=Be({id:nn([D(),Ne()]).transform(String),name:D(),type:D(),base_url:D().nullable().optional(),trust_level:nn([D(),Ne()]).nullable().optional(),respect_robots_txt:Rr().nullable().optional(),rate_limit_per_minute:Ne().nullable().optional()}),CN=Be({id:nn([D(),Ne()]).transform(String),name:D(),domain:D(),config:dn().optional(),sources:it(NN).default([])}),vy=Be({id:nn([D(),Ne()]).transform(String),name:D(),domain:D()}),$f={list:()=>rt.get("/projects",kN),detail:t=>rt.get(`/projects/${encodeURIComponent(t)}`,CN),create:t=>rt.post("/projects",vy,t),createInline:t=>rt.post("/projects/inline",vy,t)},Ie={projects:{all:["projects"],list:()=>[...Ie.projects.all,"list"],detail:t=>[...Ie.projects.all,"detail",t]},domains:{all:["domains"],list:()=>[...Ie.domains.all,"list"]},ontology:{all:["ontology"],byDomain:t=>[...Ie.ontology.all,"byDomain",t]},crawl:{all:["crawl"],job:t=>[...Ie.crawl.all,"job",t]},research:{all:["research"],sessions:t=>[...Ie.research.all,"sessions",t],session:t=>[...Ie.research.all,"session",t]},entities:{all:["entities"],list:(t,e)=>[...Ie.entities.all,"list",t,e??"*"]},claims:{all:["claims"],list:(t,e,r)=>[...Ie.claims.all,"list",t,e??"*",r??"*"]},platform:{all:["platform"],pipeline:t=>[...Ie.platform.all,"pipeline",t],extractionLogs:(t,e)=>[...Ie.platform.all,"extractionLogs",t,e],registry:t=>[...Ie.platform.all,"registry",t],proposals:(t,e)=>[...Ie.platform.all,"proposals",t,e],triples:(t,e,r)=>[...Ie.platform.all,"triples",t,e,r],graph:(t,e,r,i,a)=>[...Ie.platform.all,"graph",t,e,r,i,a],exportJson:(t,e,r,i)=>[...Ie.platform.all,"exportJson",t,e,r,i]}};function px(){return On({queryKey:Ie.projects.list(),queryFn:()=>$f.list()})}function hr(t){return On({queryKey:Ie.projects.detail(t??""),queryFn:()=>$f.detail(t),enabled:!!t})}function EN(){const t=Kt();return gn({mutationFn:e=>$f.createInline(e),onSuccess:()=>{t.invalidateQueries({queryKey:Ie.projects.all})}})}const PN=[{to:"/",labelKey:"nav.dashboard",label:"Dashboard",icon:wS},{to:"/onboard",labelKey:"nav.onboard",label:"New Project",icon:PS},{projectPath:"sources",labelKey:"nav.sources",label:"Source Explorer",icon:SS},{projectPath:"crawl",labelKey:"nav.crawl",label:"Seed Crawl",icon:sS},{projectPath:"pipeline",labelKey:"nav.pipeline",label:"Build Pipeline",icon:Dv},{projectPath:"analysis",labelKey:"nav.analysis",label:"Page Analysis",icon:Uv},{projectPath:"schema",labelKey:"nav.schema",label:"Schema Designer",icon:Bv},{projectPath:"editor",labelKey:"nav.editor",label:"Entity Manager",icon:Cf},{projectPath:"review",labelKey:"nav.review",label:"Claim Review",icon:Nf},{projectPath:"quality",labelKey:"nav.quality",label:"Quality Inspector",icon:Hd},{projectPath:"graph",labelKey:"nav.graph",label:"Graph View",icon:kf},{projectPath:"export",labelKey:"nav.export",label:"Export / API",icon:Sf},{projectPath:"research",labelKey:"nav.research",label:"Graph Research",icon:Av}],mx=["/sources/:projectId","/crawl/:projectId","/pipeline/:projectId","/analysis/:projectId","/schema/:projectId","/research/:projectId","/editor/:projectId","/review/:projectId","/quality/:projectId","/graph/:projectId","/export/:projectId"];function ON(t){for(const e of mx){const r=to({path:e,end:!1},t);if(r?.params.projectId)return r.params.projectId}}function RN(t){for(const e of mx)if(to({path:e,end:!1},t)?.params.projectId)return e.split("/")[1]}function TN(){const{t}=oi(),e=aw(w=>w.ui.sidebarOpen),r=xw(),i=Xi(),a=mn(),l=ON(i.pathname),d=RN(i.pathname),{data:f}=px(),m=f?.[0]?.name,p=!l||!f||f.some(w=>w.name===l),v=p?l??m:m;return $.useEffect(()=>{if(l&&f&&!p){const w=d&&m?`/${d}/${encodeURIComponent(m)}`:"/";a(w,{replace:!0})}},[m,a,f,p,l,d]),u.jsxs("div",{className:"flex min-h-screen bg-background text-foreground",children:[u.jsxs("aside",{className:_t("border-r bg-card transition-all duration-200 ease-out",e?"w-60":"w-16"),children:[u.jsxs("div",{className:"flex h-14 items-center justify-between px-4 border-b",children:[e&&u.jsx("span",{className:"text-sm font-semibold",children:t("app.title","Ontology Builder")}),u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>r(yk()),"aria-label":t("nav.toggleSidebar","Toggle sidebar"),children:u.jsx(_S,{className:"h-4 w-4"})})]}),e&&u.jsxs("div",{className:"border-b px-4 py-3",children:[u.jsx("p",{className:"text-xs text-muted-foreground",children:t("nav.currentProject","Current project")}),u.jsx("p",{className:"mt-1 truncate text-sm font-medium",children:v??t("nav.noProjectSelected","Select a project")})]}),u.jsx("nav",{className:"flex flex-col gap-1 p-2",children:PN.map(({to:w,projectPath:y,labelKey:x,label:S,icon:_})=>{const b=w??(v?`/${y}/${encodeURIComponent(v)}`:void 0);return b?u.jsxs(Sb,{to:b,end:b==="/",className:({isActive:P})=>_t("flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",P?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[u.jsx(_,{className:"h-4 w-4 flex-shrink-0"}),e&&u.jsx("span",{children:t(x,S)})]},x):u.jsxs("div",{className:"flex cursor-not-allowed items-center gap-3 rounded-md px-3 py-2 text-sm text-muted-foreground/50",title:t("nav.selectProjectFirst","Select a project from the dashboard first"),children:[u.jsx(_,{className:"h-4 w-4 flex-shrink-0"}),e&&u.jsx("span",{children:t(x,S)})]},x)})})]}),u.jsxs("div",{className:"flex flex-1 flex-col",children:[u.jsx("header",{className:"flex h-14 items-center justify-between border-b bg-card px-6",children:u.jsx("h1",{className:"text-sm font-medium text-muted-foreground",children:t("app.subtitle","AI-powered ontology construction")})}),u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx(cb,{})})]})]})}var go=t=>t.type==="checkbox",ei=t=>t instanceof Date,cn=t=>t==null;const gx=t=>typeof t=="object";var Nt=t=>!cn(t)&&!Array.isArray(t)&&gx(t)&&!ei(t),LN=t=>Nt(t)&&t.target?go(t.target)?t.target.checked:t.target.value:t,AN=(t,e)=>e.split(".").some((r,i,a)=>!isNaN(Number(r))&&t.has(a.slice(0,i).join("."))),IN=t=>{const e=t.constructor&&t.constructor.prototype;return Nt(e)&&e.hasOwnProperty("isPrototypeOf")},zf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function At(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(zf&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Nt(t)&&IN(t)))return t;const i=r?[]:Object.create(Object.getPrototypeOf(t));for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=At(t[a]));return i}var cu=t=>/^\w*$/.test(t),vt=t=>t===void 0,Uf=t=>Array.isArray(t)?t.filter(Boolean):[],Vf=t=>Uf(t.replace(/["|']|\]/g,"").split(/\.|\[/)),we=(t,e,r)=>{if(!e||!Nt(t))return r;const a=(cu(e)?[e]:Vf(e)).reduce((l,d)=>cn(l)?void 0:l[d],t);return vt(a)||a===t?vt(t[e])?r:t[e]:a},kr=t=>typeof t=="boolean",Kn=t=>typeof t=="function",dt=(t,e,r)=>{let i=-1;const a=cu(e)?[e]:Vf(e),l=a.length,d=l-1;for(;++i{const a={};for(const l in t)Object.defineProperty(a,l,{get:()=>{const d=l;return e._proxyFormState[d]!==cr.all&&(e._proxyFormState[d]=!i||cr.all),t[d]}});return a};const DN=typeof window<"u"?ne.useLayoutEffect:ne.useEffect;var en=t=>typeof t=="string",$N=(t,e,r,i,a)=>en(t)?(i&&e.watch.add(t),we(r,t,a)):Array.isArray(t)?t.map(l=>(i&&e.watch.add(l),we(r,l))):(i&&(e.watchAll=!0),r),df=t=>cn(t)||!gx(t);function Nr(t,e,r=new WeakSet){if(t===e)return!0;if(df(t)||df(e))return Object.is(t,e);if(ei(t)&&ei(e))return Object.is(t.getTime(),e.getTime());const i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const l of i){const d=t[l];if(!(l in e))return!1;if(l!=="ref"){const f=e[l];if(ei(d)&&ei(f)||(Nt(d)||Array.isArray(d))&&(Nt(f)||Array.isArray(f))?!Nr(d,f,r):!Object.is(d,f))return!1}}return!0}const zN=ne.createContext(null);zN.displayName="HookFormContext";var vx=(t,e,r,i,a)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[i]:a||!0}}:{},Ja=t=>Array.isArray(t)?t:[t],xy=()=>{let t=[];return{get observers(){return t},next:a=>{for(const l of t)l.next&&l.next(a)},subscribe:a=>(t.push(a),{unsubscribe:()=>{t=t.filter(l=>l!==a)}}),unsubscribe:()=>{t=[]}}};function xx(t,e){const r={};for(const i in t)if(t.hasOwnProperty(i)){const a=t[i],l=e[i];if(a&&Nt(a)&&l){const d=xx(a,l);Nt(d)&&(r[i]=d)}else t[i]&&(r[i]=l)}return r}var Xt=t=>Nt(t)&&!Object.keys(t).length,Bf=t=>t.type==="file",ru=t=>{if(!zf)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},wx=t=>t.type==="select-multiple",qf=t=>t.type==="radio",UN=t=>qf(t)||go(t),bd=t=>ru(t)&&t.isConnected;function VN(t,e){const r=e.slice(0,-1).length;let i=0;for(;i{for(const e in t)if(Kn(t[e]))return!0;return!1};function bx(t){return Array.isArray(t)||Nt(t)&&!qN(t)}function ff(t,e={}){for(const r in t){const i=t[r];bx(i)?(e[r]=Array.isArray(i)?[]:{},ff(i,e[r])):vt(i)||(e[r]=!0)}return e}function hf(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const e=t.map(r=>hf(r));return e.some(r=>r!==void 0)?e:void 0}if(Nt(t)){const e={};for(const r in t){const i=hf(t[r]);vt(i)||(e[r]=i)}return Object.keys(e).length?e:void 0}}}function Qa(t,e,r){r||(r=ff(e));for(const i in t){const a=t[i];if(bx(a))vt(e)||df(r[i])?r[i]=ff(a,Array.isArray(a)?[]:{}):Qa(a,cn(e)?{}:e[i],r[i]);else{const l=e[i];r[i]=!Nr(a,l)}}return hf(r)||{}}const wy={value:!1,isValid:!1},by={value:!0,isValid:!0};var jx=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!vt(t[0].attributes.value)?vt(t[0].value)||t[0].value===""?by:{value:t[0].value,isValid:!0}:by:wy}return wy},_x=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:i})=>vt(t)?t:e?t===""?NaN:t&&+t:r&&en(t)?new Date(t):i?i(t):t;const jy={isValid:!1,value:null};var Sx=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,jy):jy;function _y(t){const e=t.ref;return Bf(e)?e.files:qf(e)?Sx(t.refs).value:wx(e)?[...e.selectedOptions].map(({value:r})=>r):go(e)?jx(t.refs).value:_x(vt(e.value)?t.ref.value:e.value,t)}var HN=(t,e,r,i)=>{const a={};for(const l of t){const d=we(e,l);d&&dt(a,l,d._f)}return{criteriaMode:r,names:[...t],fields:a,shouldUseNativeValidation:i}},su=t=>t instanceof RegExp,qa=t=>vt(t)?t:su(t)?t.source:Nt(t)?su(t.value)?t.value.source:t.value:t,Sy=t=>({isOnSubmit:!t||t===cr.onSubmit,isOnBlur:t===cr.onBlur,isOnChange:t===cr.onChange,isOnAll:t===cr.all,isOnTouch:t===cr.onTouched});const ky="AsyncFunction";var WN=t=>!!t&&!!t.validate&&!!(Kn(t.validate)&&t.validate.constructor.name===ky||Nt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===ky)),KN=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),Ny=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(i=>t.startsWith(i)&&/^\.\w+/.test(t.slice(i.length))));const Ya=(t,e,r,i)=>{for(const a of r||Object.keys(t)){const l=we(t,a);if(l){const{_f:d,...f}=l;if(d){if(d.refs&&d.refs[0]&&e(d.refs[0],a)&&!i)return!0;if(d.ref&&e(d.ref,d.name)&&!i)return!0;if(Ya(f,e))break}else if(Nt(f)&&Ya(f,e))break}}};function Cy(t,e,r){const i=we(t,r);if(i||cu(r))return{error:i,name:r};const a=r.split(".");for(;a.length;){const l=a.join("."),d=we(e,l),f=we(t,l);if(d&&!Array.isArray(d)&&r!==l)return{name:r};if(f&&f.type)return{name:l,error:f};if(f&&f.root&&f.root.type)return{name:`${l}.root`,error:f.root};a.pop()}return{name:r}}var QN=(t,e,r,i)=>{r(t);const{name:a,...l}=t;return Xt(l)||i&&Object.keys(l).length>=Object.keys(e).length||Object.keys(l).find(d=>e[d]===(!i||cr.all))},ZN=(t,e,r)=>!t||!e||t===e||Ja(t).some(i=>i&&(r?i===e:i.startsWith(e)||e.startsWith(i))),GN=(t,e,r,i,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(e||t):(r?i.isOnBlur:a.isOnBlur)?!t:(r?i.isOnChange:a.isOnChange)?t:!0,JN=(t,e)=>!Uf(we(t,e)).length&&It(t,e),YN=(t,e,r)=>{const i=Ja(we(t,r));return dt(i,yx,e[r]),dt(t,r,i),t};function Ey(t,e,r="validate"){if(en(t)||Array.isArray(t)&&t.every(en)||kr(t)&&!t)return{type:r,message:en(t)?t:"",ref:e}}var Ii=t=>Nt(t)&&!su(t)?t:{value:t,message:""},Py=async(t,e,r,i,a,l)=>{const{ref:d,refs:f,required:m,maxLength:p,minLength:v,min:w,max:y,pattern:x,validate:S,name:_,valueAsNumber:b,mount:P}=t._f,N=we(r,_);if(!P||e.has(_))return{};const F=f?f[0]:d,L=J=>{a&&F.reportValidity&&(F.setCustomValidity(kr(J)?"":J||""),F.reportValidity())},k={},I=qf(d),X=go(d),re=I||X,de=(b||Bf(d))&&vt(d.value)&&vt(N)||ru(d)&&d.value===""||N===""||Array.isArray(N)&&!N.length||b&&typeof N=="number"&&isNaN(N),Z=vx.bind(null,_,i,k),Oe=(J,ve,me,M=lr.maxLength,R=lr.minLength)=>{const G=J?ve:me;k[_]={type:J?M:R,message:G,ref:d,...Z(J?M:R,G)}};if(l?!Array.isArray(N)||!N.length:m&&(!re&&(de||cn(N))||kr(N)&&!N||X&&!jx(f).isValid||I&&!Sx(f).isValid)){const{value:J,message:ve}=en(m)?{value:!!m,message:m}:Ii(m);if(J&&(k[_]={type:lr.required,message:ve,ref:F,...Z(lr.required,ve)},!i))return L(ve),k}if(!de&&(!cn(w)||!cn(y))){let J,ve;const me=Ii(y),M=Ii(w);if(!cn(N)&&!isNaN(N)){const R=d.valueAsNumber||N&&+N;cn(me.value)||(J=R>me.value),cn(M.value)||(ve=Rnew Date(new Date().toDateString()+" "+K),H=d.type=="time",W=d.type=="week";en(me.value)&&N&&(J=H?G(N)>G(me.value):W?N>me.value:R>new Date(me.value)),en(M.value)&&N&&(ve=H?G(N)+J.value,M=!cn(ve.value)&&N.length<+ve.value;if((me||M)&&(Oe(me,J.message,ve.message),!i))return L(k[_].message),k}if(x&&!de&&en(N)){const{value:J,message:ve}=Ii(x);if(su(J)&&!N.match(J)&&(k[_]={type:lr.pattern,message:ve,ref:d,...Z(lr.pattern,ve)},!i))return L(ve),k}if(S){if(Kn(S)){const J=await S(N,r),ve=Ey(J,F);if(ve&&(k[_]={...ve,...Z(lr.validate,ve.message)},!i))return L(ve.message),k}else if(Nt(S)){let J={};for(const ve in S){if(!Xt(J)&&!i)break;const me=Ey(await S[ve](N,r),F,ve);me&&(J={...me,...Z(ve,me.message)},L(me.message),i&&(k[_]=J))}if(!Xt(J)&&(k[_]={ref:F,...J},!i))return k}}return L(!0),k};const XN={mode:cr.onSubmit,reValidateMode:cr.onChange,shouldFocusError:!0},kx={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function eC(t={}){let e={...XN,...t},r={...At(kx),isLoading:Kn(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},i={},a=Nt(e.defaultValues)||Nt(e.values)?At(e.defaultValues||e.values)||{}:{},l=e.shouldUnregister?{}:At(a),d={action:!1,mount:!1,watch:!1,keepIsValid:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},m,p=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={...v};let y={...w};const x={array:xy(),state:xy()},S=e.criteriaMode===cr.all,_=E=>z=>{clearTimeout(p),p=setTimeout(E,z)},b=async E=>{if(!d.keepIsValid&&!e.disabled&&(w.isValid||y.isValid||E)){let z;e.resolver?(z=Xt((await de()).errors),P()):z=await J({fields:i,onlyCheckValid:!0,eventType:Ai.VALID}),z!==r.isValid&&x.state.next({isValid:z})}},P=(E,z)=>{!e.disabled&&(w.isValidating||w.validatingFields||y.isValidating||y.validatingFields)&&((E||Array.from(f.mount)).forEach(V=>{V&&(z?dt(r.validatingFields,V,z):It(r.validatingFields,V))}),x.state.next({validatingFields:r.validatingFields,isValidating:!Xt(r.validatingFields)}))},N=()=>{r.dirtyFields=Qa(a,l)},F=(E,z=[],V,oe,le=!0,ae=!0)=>{if(oe&&V&&!e.disabled){if(d.action=!0,ae&&Array.isArray(we(i,E))){const ce=V(we(i,E),oe.argA,oe.argB);le&&dt(i,E,ce)}if(ae&&Array.isArray(we(r.errors,E))){const ce=V(we(r.errors,E),oe.argA,oe.argB);le&&dt(r.errors,E,ce),JN(r.errors,E)}if((w.touchedFields||y.touchedFields)&&ae&&Array.isArray(we(r.touchedFields,E))){const ce=V(we(r.touchedFields,E),oe.argA,oe.argB);le&&dt(r.touchedFields,E,ce)}(w.dirtyFields||y.dirtyFields)&&N(),x.state.next({name:E,isDirty:me(E,z),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(l,E,z)},L=(E,z)=>{dt(r.errors,E,z),x.state.next({errors:r.errors})},k=E=>{r.errors=E,x.state.next({errors:r.errors,isValid:!1})},I=(E,z,V,oe)=>{const le=we(i,E);if(le){const ae=vt(we(l,E)),ce=we(l,E,vt(V)?we(a,E):V);vt(ce)||oe&&oe.defaultChecked||z?dt(l,E,z?ce:_y(le._f)):G(E,ce),d.mount&&!d.action&&(b(),ae&&r.isDirty&&(w.isDirty||y.isDirty)&&(me()||(r.isDirty=!1,x.state.next({...r}))))}},X=(E,z,V,oe,le)=>{let ae=!1,ce=!1;const Ae={name:E};if(!e.disabled){if(!V||oe){(w.isDirty||y.isDirty)&&(ce=r.isDirty,r.isDirty=Ae.isDirty=me(),ae=ce!==Ae.isDirty);const We=Nr(we(a,E),z);ce=!!we(r.dirtyFields,E),We?It(r.dirtyFields,E):dt(r.dirtyFields,E,!0),Ae.dirtyFields=r.dirtyFields,ae=ae||(w.dirtyFields||y.dirtyFields)&&ce!==!We}if(V){const We=we(r.touchedFields,E);We||(dt(r.touchedFields,E,V),Ae.touchedFields=r.touchedFields,ae=ae||(w.touchedFields||y.touchedFields)&&We!==V)}ae&&le&&x.state.next(Ae)}return ae?Ae:{}},re=(E,z,V,oe)=>{const le=we(r.errors,E),ae=(w.isValid||y.isValid)&&kr(z)&&r.isValid!==z;if(e.delayError&&V?(m=_(()=>L(E,V)),m(e.delayError)):(clearTimeout(p),m=null,V?dt(r.errors,E,V):It(r.errors,E)),(V?!Nr(le,V):le)||!Xt(oe)||ae){const ce={...oe,...ae&&kr(z)?{isValid:z}:{},errors:r.errors,name:E};r={...r,...ce},x.state.next(ce)}},de=async E=>(P(E,!0),await e.resolver(l,e.context,HN(E||f.mount,i,e.criteriaMode,e.shouldUseNativeValidation))),Z=async E=>{const{errors:z}=await de(E);if(P(E),E)for(const V of E){const oe=we(z,V);oe?dt(r.errors,V,oe):It(r.errors,V)}else r.errors=z;return z},Oe=async({name:E,eventType:z})=>{if(t.validate){const V=await t.validate({formValues:l,formState:r,name:E,eventType:z});if(Nt(V))for(const oe in V)V[oe]&&Ce(`${wd}.${oe}`,{message:en(V.message)?V.message:"",type:lr.validate});else en(V)||!V?Ce(wd,{message:V||"",type:lr.validate}):qe(wd);return V}return!0},J=async({fields:E,onlyCheckValid:z,name:V,eventType:oe,context:le={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(le.runRootValidation=!0,!await Oe({name:V,eventType:oe})&&(le.valid=!1,z)))return le.valid;for(const ae in E){const ce=E[ae];if(ce){const{_f:Ae,...We}=ce;if(Ae){const St=f.array.has(Ae.name),Tt=ce._f&&WN(ce._f);Tt&&w.validatingFields&&P([Ae.name],!0);const Ft=await Py(ce,f.disabled,l,S,e.shouldUseNativeValidation&&!z,St);if(Tt&&w.validatingFields&&P([Ae.name]),Ft[Ae.name]&&(le.valid=!1,z)||(!z&&(we(Ft,Ae.name)?St?YN(r.errors,Ft,Ae.name):dt(r.errors,Ae.name,Ft[Ae.name]):It(r.errors,Ae.name)),t.shouldUseNativeValidation&&Ft[Ae.name]))break}!Xt(We)&&await J({context:le,onlyCheckValid:z,fields:We,name:ae,eventType:oe})}}return le.valid},ve=()=>{for(const E of f.unMount){const z=we(i,E);z&&(z._f.refs?z._f.refs.every(V=>!bd(V)):!bd(z._f.ref))&&yn(E)}f.unMount=new Set},me=(E,z)=>!e.disabled&&(E&&z&&dt(l,E,z),!Nr(pe(),a)),M=(E,z,V)=>$N(E,f,{...d.mount?l:vt(z)?a:en(E)?{[E]:z}:z},V,z),R=E=>Uf(we(d.mount?l:a,E,e.shouldUnregister?we(a,E,[]):[])),G=(E,z,V={})=>{const oe=we(i,E);let le=z;if(oe){const ae=oe._f;ae&&(!ae.disabled&&dt(l,E,_x(z,ae)),le=ru(ae.ref)&&cn(z)?"":z,wx(ae.ref)?[...ae.ref.options].forEach(ce=>ce.selected=le.includes(ce.value)):ae.refs?go(ae.ref)?ae.refs.forEach(ce=>{(!ce.defaultChecked||!ce.disabled)&&(Array.isArray(le)?ce.checked=!!le.find(Ae=>Ae===ce.value):ce.checked=le===ce.value||!!le)}):ae.refs.forEach(ce=>ce.checked=ce.value===le):Bf(ae.ref)?ae.ref.value="":(ae.ref.value=le,ae.ref.type||x.state.next({name:E,values:At(l)})))}(V.shouldDirty||V.shouldTouch)&&X(E,le,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&ue(E)},H=(E,z,V)=>{for(const oe in z){if(!z.hasOwnProperty(oe))return;const le=z[oe],ae=E+"."+oe,ce=we(i,ae);(f.array.has(E)||Nt(le)||ce&&!ce._f)&&!ei(le)?H(ae,le,V):G(ae,le,V)}},W=(E,z,V={})=>{const oe=we(i,E),le=f.array.has(E),ae=At(z),ce=we(l,E),Ae=Nr(ce,ae);if(dt(l,E,ae),le)x.array.next({name:E,values:At(l)}),(w.isDirty||w.dirtyFields||y.isDirty||y.dirtyFields)&&V.shouldDirty&&(N(),x.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:me(E,ae)}));else{const We=Array.isArray(ae)&&!ae.length||Xt(ae);!oe||oe._f||cn(ae)||We?G(E,ae,V):H(E,ae,V)}if(!Ae){const We=Ny(E,f);x.state.next({...We&&r,name:d.mount||We?E:void 0,values:At(l)})}},K=E=>{const z=Kn(E)?E(l):E;Nr(l,z)||(l={...l,...z},x.state.next({...r,values:l}))},T=async E=>{d.mount=!0;const z=E.target;let V=z.name,oe=!0;const le=we(i,V),ae=We=>{oe=Number.isNaN(We)||ei(We)&&isNaN(We.getTime())||Nr(We,we(l,V,We))},ce=Sy(e.mode),Ae=Sy(e.reValidateMode);if(le){let We,St;const Tt=z.type?_y(le._f):LN(E),Ft=E.type===Ai.BLUR||E.type===Ai.FOCUS_OUT,$n=!KN(le._f)&&!t.validate&&!e.resolver&&!we(r.errors,V)&&!le._f.deps||GN(Ft,we(r.touchedFields,V),r.isSubmitted,Ae,ce),Ir=Ny(V,f,Ft);dt(l,V,Tt),Ft?(!z||!z.readOnly)&&(le._f.onBlur&&le._f.onBlur(E),m&&m(0)):le._f.onChange&&le._f.onChange(E);const Mr=X(V,Tt,Ft),es=!Xt(Mr)||Ir;if(!Ft&&x.state.next({name:V,type:E.type,values:At(l)}),$n)return(w.isValid||y.isValid)&&(e.mode==="onBlur"?Ft&&b():Ft||b()),es&&x.state.next({name:V,...Ir?{}:Mr});if(!e.resolver&&t.validate&&await Oe({name:V,eventType:E.type}),!Ft&&Ir&&x.state.next({...r}),e.resolver){const{errors:Fr}=await de([V]);if(P([V]),ae(Tt),oe){const mr=Cy(r.errors,i,V),Tn=Cy(Fr,i,mr.name||V);We=Tn.error,V=Tn.name,St=Xt(Fr)}}else P([V],!0),We=(await Py(le,f.disabled,l,S,e.shouldUseNativeValidation))[V],P([V]),ae(Tt),oe&&(We?St=!1:(w.isValid||y.isValid)&&(St=await J({fields:i,onlyCheckValid:!0,name:V,eventType:E.type})));oe&&(le._f.deps&&(!Array.isArray(le._f.deps)||le._f.deps.length>0)&&ue(le._f.deps),re(V,St,We,Mr))}},Q=(E,z)=>{if(we(r.errors,z)&&E.focus)return E.focus(),1},ue=async(E,z={})=>{let V,oe;const le=Ja(E);if(e.resolver){const ae=await Z(vt(E)?E:le);V=Xt(ae),oe=E?!le.some(ce=>we(ae,ce)):V}else E?(oe=(await Promise.all(le.map(async ae=>{const ce=we(i,ae);return await J({fields:ce&&ce._f?{[ae]:ce}:ce,eventType:Ai.TRIGGER})}))).every(Boolean),!(!oe&&!r.isValid)&&b()):oe=V=await J({fields:i,name:E,eventType:Ai.TRIGGER});return x.state.next({...!en(E)||(w.isValid||y.isValid)&&V!==r.isValid?{}:{name:E},...e.resolver||!E?{isValid:V}:{},errors:r.errors}),z.shouldFocus&&!oe&&Ya(i,Q,E?le:f.mount),oe},pe=(E,z)=>{let V={...d.mount?l:a};return z&&(V=xx(z.dirtyFields?r.dirtyFields:r.touchedFields,V)),vt(E)?V:en(E)?we(V,E):E.map(oe=>we(V,oe))},Le=(E,z)=>({invalid:!!we((z||r).errors,E),isDirty:!!we((z||r).dirtyFields,E),error:we((z||r).errors,E),isValidating:!!we(r.validatingFields,E),isTouched:!!we((z||r).touchedFields,E)}),qe=E=>{const z=E?Ja(E):void 0;z?.forEach(V=>It(r.errors,V)),z?z.forEach(V=>{x.state.next({name:V,errors:r.errors})}):x.state.next({errors:{}})},Ce=(E,z,V)=>{const oe=(we(i,E,{_f:{}})._f||{}).ref,le=we(r.errors,E)||{},{ref:ae,message:ce,type:Ae,...We}=le;dt(r.errors,E,{...We,...z,ref:oe}),x.state.next({name:E,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&oe&&oe.focus&&oe.focus()},Ge=(E,z)=>Kn(E)?x.state.subscribe({next:V=>"values"in V&&E(V.values||M(void 0,z),V)}):M(E,z,!0),et=E=>x.state.subscribe({next:z=>{if(ZN(E.name,z.name,E.exact)&&QN(z,E.formState||w,vn,E.reRenderRoot)){const V={...l};E.callback({values:V,...r,...z,defaultValues:a})}}}).unsubscribe,Rt=E=>(d.mount=!0,y={...y,...E.formState},et({...E,formState:{...v,...E.formState}})),yn=(E,z={})=>{for(const V of E?Ja(E):f.mount)f.mount.delete(V),f.array.delete(V),z.keepValue||(It(i,V),It(l,V)),!z.keepError&&It(r.errors,V),!z.keepDirty&&It(r.dirtyFields,V),!z.keepTouched&&It(r.touchedFields,V),!z.keepIsValidating&&It(r.validatingFields,V),!e.shouldUnregister&&!z.keepDefaultValue&&It(a,V);x.state.next({values:At(l)}),x.state.next({...r,...z.keepDirty?{isDirty:me()}:{}}),!z.keepIsValid&&b()},Tr=({disabled:E,name:z})=>{if(kr(E)&&d.mount||E||f.disabled.has(z)){const le=f.disabled.has(z)!==!!E;E?f.disabled.add(z):f.disabled.delete(z),le&&d.mount&&!d.action&&b()}},Jn=(E,z={})=>{let V=we(i,E);const oe=kr(z.disabled)||kr(e.disabled),le=!f.registerName.has(E)&&V&&V._f&&!V._f.mount;return dt(i,E,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:E}},name:E,mount:!0,...z}}),f.mount.add(E),V&&!le?Tr({disabled:kr(z.disabled)?z.disabled:e.disabled,name:E}):I(E,!0,z.value),{...oe?{disabled:z.disabled||e.disabled}:{},...e.progressive?{required:!!z.required,min:qa(z.min),max:qa(z.max),minLength:qa(z.minLength),maxLength:qa(z.maxLength),pattern:qa(z.pattern)}:{},name:E,onChange:T,onBlur:T,ref:ae=>{if(ae){f.registerName.add(E),Jn(E,z),f.registerName.delete(E),V=we(i,E);const ce=vt(ae.value)&&ae.querySelectorAll&&ae.querySelectorAll("input,select,textarea")[0]||ae,Ae=UN(ce),We=V._f.refs||[];if(Ae?We.find(St=>St===ce):ce===V._f.ref)return;dt(i,E,{_f:{...V._f,...Ae?{refs:[...We.filter(bd),ce,...Array.isArray(we(a,E))?[{}]:[]],ref:{type:ce.type,name:E}}:{ref:ce}}}),I(E,!1,void 0,ce)}else V=we(i,E,{}),V._f&&(V._f.mount=!1),(e.shouldUnregister||z.shouldUnregister)&&!(AN(f.array,E)&&d.action)&&f.unMount.add(E)}}},Lr=()=>e.shouldFocusError&&Ya(i,Q,f.mount),ui=E=>{kr(E)&&(x.state.next({disabled:E}),Ya(i,(z,V)=>{const oe=we(i,V);oe&&(z.disabled=oe._f.disabled||E,Array.isArray(oe._f.refs)&&oe._f.refs.forEach(le=>{le.disabled=oe._f.disabled||E}))},0,!1))},Yr=(E,z)=>async V=>{let oe;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let le=At(l);if(x.state.next({isSubmitting:!0}),e.resolver){const{errors:ae,values:ce}=await de();P(),r.errors=ae,le=At(ce)}else await J({fields:i,eventType:Ai.SUBMIT});if(f.disabled.size)for(const ae of f.disabled)It(le,ae);if(It(r.errors,yx),Xt(r.errors)){x.state.next({errors:{}});try{await E(le,V)}catch(ae){oe=ae}}else z&&await z({...r.errors},V),Lr(),setTimeout(Lr);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xt(r.errors)&&!oe,submitCount:r.submitCount+1,errors:r.errors}),oe)throw oe},Ms=(E,z={})=>{we(i,E)&&(vt(z.defaultValue)?W(E,At(we(a,E))):(W(E,z.defaultValue),dt(a,E,At(z.defaultValue))),z.keepTouched||It(r.touchedFields,E),z.keepDirty||(It(r.dirtyFields,E),r.isDirty=z.defaultValue?me(E,At(we(a,E))):me()),z.keepError||(It(r.errors,E),w.isValid&&b()),x.state.next({...r}))},Ar=(E,z={})=>{const V=E?At(E):a,oe=At(V),le=Xt(E),ae=le?a:oe;if(z.keepDefaultValues||(a=V),!z.keepValues){if(z.keepDirtyValues){const ce=new Set([...f.mount,...Object.keys(Qa(a,l))]);for(const Ae of Array.from(ce)){const We=we(r.dirtyFields,Ae),St=we(l,Ae),Tt=we(ae,Ae);We&&!vt(St)?dt(ae,Ae,St):!We&&!vt(Tt)&&W(Ae,Tt)}}else{if(zf&&vt(E))for(const ce of f.mount){const Ae=we(i,ce);if(Ae&&Ae._f){const We=Array.isArray(Ae._f.refs)?Ae._f.refs[0]:Ae._f.ref;if(ru(We)){const St=We.closest("form");if(St){St.reset();break}}}}if(z.keepFieldsRef)for(const ce of f.mount)W(ce,we(ae,ce));else i={}}l=e.shouldUnregister?z.keepDefaultValues?At(a):{}:At(ae),x.array.next({values:{...ae}}),x.state.next({values:{...ae}})}f={mount:z.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!w.isValid||!!z.keepIsValid||!!z.keepDirtyValues||!e.shouldUnregister&&!Xt(ae),d.watch=!!e.shouldUnregister,d.keepIsValid=!!z.keepIsValid,d.action=!1,z.keepErrors||(r.errors={}),x.state.next({submitCount:z.keepSubmitCount?r.submitCount:0,isDirty:le?!1:z.keepDirty?r.isDirty:!!(z.keepDefaultValues&&!Nr(E,a)),isSubmitted:z.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:le?{}:z.keepDirtyValues?z.keepDefaultValues&&l?Qa(a,l):r.dirtyFields:z.keepDefaultValues&&E?Qa(a,E):z.keepDirty?r.dirtyFields:{},touchedFields:z.keepTouched?r.touchedFields:{},errors:z.keepErrors?r.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Xr=(E,z)=>Ar(Kn(E)?E(l):E,{...e.resetOptions,...z}),pr=(E,z={})=>{const V=we(i,E),oe=V&&V._f;if(oe){const le=oe.refs?oe.refs[0]:oe.ref;le.focus&&setTimeout(()=>{le.focus(),z.shouldSelect&&Kn(le.select)&&le.select()})}},vn=E=>{r={...r,...E}},Rn={control:{register:Jn,unregister:yn,getFieldState:Le,handleSubmit:Yr,setError:Ce,_subscribe:et,_runSchema:de,_updateIsValidating:P,_focusError:Lr,_getWatch:M,_getDirty:me,_setValid:b,_setFieldArray:F,_setDisabledField:Tr,_setErrors:k,_getFieldArray:R,_reset:Ar,_resetDefaultValues:()=>Kn(e.defaultValues)&&e.defaultValues().then(E=>{Xr(E,e.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:ve,_disableForm:ui,_subjects:x,_proxyFormState:w,get _fields(){return i},get _formValues(){return l},get _state(){return d},set _state(E){d=E},get _defaultValues(){return a},get _names(){return f},set _names(E){f=E},get _formState(){return r},get _options(){return e},set _options(E){e={...e,...E}}},subscribe:Rt,trigger:ue,register:Jn,handleSubmit:Yr,watch:Ge,setValue:W,setValues:K,getValues:pe,reset:Xr,resetField:Ms,clearErrors:qe,unregister:yn,setError:Ce,setFocus:pr,getFieldState:Le};return{...Rn,formControl:Rn}}function Zi(t={}){const e=ne.useRef(void 0),r=ne.useRef(void 0),[i,a]=ne.useState(()=>({...At(kx),isLoading:Kn(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Kn(t.defaultValues)?void 0:t.defaultValues}));if(!e.current)if(t.formControl)e.current={...t.formControl,formState:i},t.defaultValues&&!Kn(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:d,...f}=eC(t);e.current={...f,formState:i}}const l=e.current.control;return l._options=t,DN(()=>{const d=l._subscribe({formState:l._proxyFormState,callback:()=>a({...l._formState}),reRenderRoot:!0});return a(f=>({...f,isReady:!0})),l._formState.isReady=!0,d},[l]),ne.useEffect(()=>l._disableForm(t.disabled),[l,t.disabled]),ne.useEffect(()=>{t.mode&&(l._options.mode=t.mode),t.reValidateMode&&(l._options.reValidateMode=t.reValidateMode)},[l,t.mode,t.reValidateMode]),ne.useEffect(()=>{t.errors&&(l._setErrors(t.errors),l._focusError())},[l,t.errors]),ne.useEffect(()=>{t.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,t.shouldUnregister]),ne.useEffect(()=>{if(l._proxyFormState.isDirty){const d=l._getDirty();d!==i.isDirty&&l._subjects.state.next({isDirty:d})}},[l,i.isDirty]),ne.useEffect(()=>{var d;t.values&&!Nr(t.values,r.current)?(l._reset(t.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((d=l._options.resetOptions)===null||d===void 0)&&d.keepIsValid||l._setValid(),r.current=t.values,a(f=>({...f}))):l._resetDefaultValues()},[l,t.values]),ne.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),e.current.formState=ne.useMemo(()=>FN(i,l),[l,i]),e.current}const Oy=(t,e,r)=>{if(t&&"reportValidity"in t){const i=we(r,e);t.setCustomValidity(i&&i.message||""),t.reportValidity()}},Nx=(t,e)=>{for(const r in e.fields){const i=e.fields[r];i&&i.ref&&"reportValidity"in i.ref?Oy(i.ref,r,t):i.refs&&i.refs.forEach(a=>Oy(a,r,t))}},tC=(t,e)=>{e.shouldUseNativeValidation&&Nx(t,e);const r={};for(const i in t){const a=we(e.fields,i),l=Object.assign(t[i]||{},{ref:a&&a.ref});if(nC(e.names||Object.keys(t),i)){const d=Object.assign({},we(r,i));dt(d,"root",l),dt(r,i,d)}else dt(r,i,l)}return r},nC=(t,e)=>t.some(r=>r.startsWith(e+"."));var rC=function(t,e){for(var r={};t.length;){var i=t[0],a=i.code,l=i.message,d=i.path.join(".");if(!r[d])if("unionErrors"in i){var f=i.unionErrors[0].errors[0];r[d]={message:f.message,type:f.code}}else r[d]={message:l,type:a};if("unionErrors"in i&&i.unionErrors.forEach(function(v){return v.errors.forEach(function(w){return t.push(w)})}),e){var m=r[d].types,p=m&&m[i.code];r[d]=vx(d,e,r,a,p?[].concat(p,i.message):i.message)}t.shift()}return r},Gi=function(t,e,r){return r===void 0&&(r={}),function(i,a,l){try{return Promise.resolve((function(d,f){try{var m=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](i,e)).then(function(p){return l.shouldUseNativeValidation&&Nx({},l),{errors:{},values:r.raw?i:p}})}catch(p){return f(p)}return m&&m.then?m.then(void 0,f):m})(0,function(d){if((function(f){return Array.isArray(f?.errors)})(d))return{values:{},errors:tC(rC(d.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw d}))}catch(d){return Promise.reject(d)}}};const ge=$.forwardRef(({className:t,...e},r)=>u.jsx("div",{ref:r,className:_t("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));ge.displayName="Card";const Ue=$.forwardRef(({className:t,...e},r)=>u.jsx("div",{ref:r,className:_t("flex flex-col space-y-1.5 p-6",t),...e}));Ue.displayName="CardHeader";const Ve=$.forwardRef(({className:t,...e},r)=>u.jsx("h3",{ref:r,className:_t("text-lg font-semibold leading-none tracking-tight",t),...e}));Ve.displayName="CardTitle";const Qe=$.forwardRef(({className:t,...e},r)=>u.jsx("p",{ref:r,className:_t("text-sm text-muted-foreground",t),...e}));Qe.displayName="CardDescription";const ye=$.forwardRef(({className:t,...e},r)=>u.jsx("div",{ref:r,className:_t("p-6 pt-0",t),...e}));ye.displayName="CardContent";const sC=$.forwardRef(({className:t,...e},r)=>u.jsx("div",{ref:r,className:_t("flex items-center p-6 pt-0",t),...e}));sC.displayName="CardFooter";const xt=$.forwardRef(({className:t,type:e="text",...r},i)=>u.jsx("input",{type:e,ref:i,className:_t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...r}));xt.displayName="Input";const Ye=$.forwardRef(({className:t,...e},r)=>u.jsx("label",{ref:r,className:_t("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...e}));Ye.displayName="Label";function pn({className:t,...e}){return u.jsx("div",{className:_t("animate-pulse rounded-md bg-muted",t),...e})}const iC=Be({domain:D(),entity_types:it(D()),predicates:it(D()),attribute_count:Ne().int()}),aC=it(iC),oC={list:()=>rt.get("/domains",aC)},lC=Be({domain:D(),entity_types:it(D()),predicates:it(D()),attributes:it(D()),aliases:li(D(),D()).default({})}),uC={get:t=>rt.get(`/ontology/${encodeURIComponent(t)}`,lC)};function cC(){return On({queryKey:Ie.domains.list(),queryFn:()=>oC.list(),staleTime:1e3*60*30})}function Cx(t){return On({queryKey:Ie.ontology.byDomain(t??""),queryFn:()=>uC.get(t),enabled:!!t,staleTime:1e3*60*30})}const dC=/^[a-zA-Z0-9_-]+$/,fC=Be({project_name:D().min(2,"최소 2자 이상").max(64,"최대 64자").regex(dC,"영문/숫자/_/- 만 허용"),domain:D().min(1,"도메인을 선택하세요")});function hC(){const t=mn(),{t:e}=oi(),{data:r,isLoading:i,isError:a,error:l,refetch:d}=cC(),f=EN(),{register:m,handleSubmit:p,watch:v,setValue:w,formState:{errors:y,isSubmitting:x}}=Zi({resolver:Gi(fC),defaultValues:{project_name:"",domain:""}}),S=v("domain"),_=async b=>{const P=r?.find(N=>N.domain===b.domain);try{const N=await f.mutateAsync({project_name:b.project_name,domain:b.domain,target_entities:P?.entity_types??[]});jt.success(e("onboarding.created","프로젝트가 생성되었습니다: {{name}}",{name:N.name})),t(`/sources/${N.name}`)}catch(N){jt.error(e("onboarding.createFailed","생성 실패: {{msg}}",{msg:N.message}))}};return u.jsxs("div",{className:"mx-auto max-w-3xl px-6 py-10",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t("/"),"aria-label":e("common.back","이전"),children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:e("onboarding.title","새 프로젝트 만들기")})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:e("onboarding.formTitle","온톨로지 도메인 선택")}),u.jsx(Qe,{children:e("onboarding.formDesc","어떤 종류의 온톨로지를 구축할지 도메인을 선택하고 프로젝트 이름을 정해주세요.")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:p(_),className:"space-y-6",noValidate:!0,children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{htmlFor:"project_name",children:e("onboarding.projectName","프로젝트 이름")}),u.jsx(xt,{id:"project_name",placeholder:"my_perfume_project","aria-invalid":!!y.project_name,...m("project_name")}),y.project_name&&u.jsx("p",{className:"text-sm text-destructive",children:y.project_name.message}),u.jsx("p",{className:"text-xs text-muted-foreground",children:e("onboarding.projectNameHint","영문, 숫자, _ , - 만 사용 (2~64자)")})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ye,{children:e("onboarding.domain","도메인")}),a&&u.jsx(ge,{className:"border-destructive",children:u.jsxs(ye,{className:"flex items-center justify-between gap-3 py-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),u.jsx("span",{children:l.message})]}),u.jsx(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>d(),children:e("common.retry","다시 시도")})]})}),i&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((b,P)=>u.jsx(pn,{className:"h-24"},P))}),r&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:r.map(b=>{const P=S===b.domain;return u.jsxs("button",{type:"button",onClick:()=>w("domain",b.domain,{shouldValidate:!0}),className:_t("rounded-lg border bg-card p-4 text-left transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",P&&"border-primary bg-accent/60"),children:[u.jsx("div",{className:"mb-1 font-semibold capitalize",children:b.domain}),u.jsx("div",{className:"text-xs text-muted-foreground",children:e("onboarding.domainSummary",{entities:b.entity_types.length,predicates:b.predicates.length,defaultValue:"엔티티 {{entities}}종 · 관계 {{predicates}}개"})}),u.jsxs("div",{className:"mt-2 line-clamp-2 text-xs text-muted-foreground/70",children:[b.entity_types.slice(0,5).join(", "),b.entity_types.length>5&&" …"]})]},b.domain)})}),y.domain&&u.jsx("p",{className:"text-sm text-destructive",children:y.domain.message})]}),u.jsxs("div",{className:"flex justify-end gap-3 border-t pt-4",children:[u.jsx(Ee,{type:"button",variant:"outline",onClick:()=>t("/"),disabled:x||f.isPending,children:e("common.cancel","취소")}),u.jsxs(Ee,{type:"submit",disabled:x||f.isPending,children:[f.isPending&&u.jsx(dr,{className:"h-4 w-4 animate-spin"}),e("onboarding.submit","프로젝트 만들기")]})]})]})})]})]})}const pC=Be({id:nn([D(),Ne()]).transform(String),name:D(),type:D(),base_url:D().nullable().optional(),trust_level:Ne().nullable().optional(),respect_robots_txt:Rr().nullable().optional(),rate_limit_per_minute:Ne().nullable().optional()}),mC=Be({ok:Rr(),deleted:D()}),Ex={create:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/sources`,pC,e),delete:(t,e)=>rt.delete(`/projects/${encodeURIComponent(t)}/sources/${encodeURIComponent(e)}`,mC)};function gC(t){const e=Kt();return gn({mutationFn:r=>Ex.create(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.projects.detail(t)})}})}function yC(t){const e=Kt();return gn({mutationFn:r=>Ex.delete(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.projects.detail(t)})}})}const Px=["official","review","blog","news","community","unknown"],vC=Be({name:D().min(2,"최소 2자 이상").max(64,"최대 64자").regex(/^[a-zA-Z0-9_-]+$/,"영문/숫자/_/-만 허용"),type:hx(Px),base_url:D().url("올바른 URL 형식이 아닙니다").or(fx("")).optional(),trust_level:Ne({invalid_type_error:"0~1 사이의 숫자"}).min(0).max(1),rate_limit_per_minute:Ne({invalid_type_error:"양의 정수"}).int().min(1).max(600),respect_robots_txt:Rr()});function xC(){const t=mn(),{projectId:e}=fr(),{t:r}=oi(),i=e??"",{data:a,isLoading:l,isError:d,error:f,refetch:m}=hr(i),p=gC(i),v=yC(i),{register:w,handleSubmit:y,reset:x,formState:{errors:S,isSubmitting:_}}=Zi({resolver:Gi(vC),defaultValues:{name:"",type:"official",base_url:"",trust_level:.7,rate_limit_per_minute:30,respect_robots_txt:!0}}),b=async N=>{try{await p.mutateAsync({...N,base_url:N.base_url||null}),jt.success(r("sources.added","소스가 추가되었습니다: {{name}}",{name:N.name})),x()}catch(F){jt.error(r("sources.addFailed","추가 실패: {{msg}}",{msg:F.message}))}},P=async N=>{if(confirm(r("sources.confirmDelete","정말 '{{name}}' 소스를 삭제하시겠습니까?",{name:N})))try{await v.mutateAsync(N),jt.success(r("sources.deleted","소스가 삭제되었습니다: {{name}}",{name:N}))}catch(F){jt.error(r("sources.deleteFailed","삭제 실패: {{msg}}",{msg:F.message}))}};return u.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-10",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t("/"),"aria-label":r("common.back","이전"),children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r("sources.title","참고 소스 설정")}),a&&u.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.name," ",u.jsxs("span",{className:"capitalize text-muted-foreground/70",children:["· ",a.domain]})]})]}),u.jsxs(Ee,{onClick:()=>t(`/crawl/${i}`),disabled:!a||(a.sources?.length??0)===0,children:[r("sources.next","크롤 진행"),u.jsx(Lv,{className:"h-4 w-4"})]})]}),d&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center justify-between gap-3 py-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),u.jsx("span",{children:f.message})]}),u.jsx(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>m(),children:r("common.retry","다시 시도")})]})}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_360px]",children:[u.jsx("section",{children:u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("sources.listTitle","등록된 소스")}),u.jsx(Qe,{children:r("sources.listDesc","프로젝트 온톨로지 구축에 사용할 참고 사이트 목록")})]}),u.jsxs(ye,{children:[l&&u.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((N,F)=>u.jsx(pn,{className:"h-16"},F))}),a&&a.sources.length===0&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:r("sources.empty","아직 등록된 소스가 없습니다. 오른쪽 폼에서 추가하세요.")}),a&&a.sources.length>0&&u.jsx("ul",{className:"divide-y",children:a.sources.map(N=>u.jsxs("li",{className:"flex items-center justify-between gap-4 py-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:N.name}),u.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",children:N.type}),typeof N.trust_level=="number"&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[r("sources.trust","신뢰도")," ",N.trust_level.toFixed(2)]})]}),N.base_url&&u.jsxs("a",{href:N.base_url,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[u.jsx(Mv,{className:"h-3 w-3"}),N.base_url]})]}),u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>P(N.name),disabled:v.isPending,"aria-label":r("sources.delete","삭제"),children:u.jsx(Kd,{className:"h-4 w-4 text-destructive"})})]},N.id))})]})]})}),u.jsx("aside",{children:u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("sources.addTitle","소스 추가")}),u.jsx(Qe,{children:r("sources.addDesc","참고할 사이트 정보를 입력하세요")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:y(b),className:"space-y-4",noValidate:!0,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"src_name",children:r("sources.name","이름")}),u.jsx(xt,{id:"src_name",placeholder:"official_brand_site",...w("name")}),S.name&&u.jsx("p",{className:"text-xs text-destructive",children:S.name.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"src_type",children:r("sources.type","타입")}),u.jsx("select",{id:"src_type",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",...w("type"),children:Px.map(N=>u.jsx("option",{value:N,children:N},N))})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"src_url",children:r("sources.baseUrl","Base URL")}),u.jsx(xt,{id:"src_url",placeholder:"https://example.com",type:"url",...w("base_url")}),S.base_url&&u.jsx("p",{className:"text-xs text-destructive",children:S.base_url.message})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"src_trust",children:r("sources.trust","신뢰도")}),u.jsx(xt,{id:"src_trust",type:"number",step:"0.05",min:0,max:1,...w("trust_level",{valueAsNumber:!0})}),S.trust_level&&u.jsx("p",{className:"text-xs text-destructive",children:S.trust_level.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"src_rate",children:r("sources.rateLimit","rate/분")}),u.jsx(xt,{id:"src_rate",type:"number",min:1,max:600,...w("rate_limit_per_minute",{valueAsNumber:!0})}),S.rate_limit_per_minute&&u.jsx("p",{className:"text-xs text-destructive",children:S.rate_limit_per_minute.message})]})]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...w("respect_robots_txt")}),u.jsx("span",{children:r("sources.respectRobots","robots.txt 준수")})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:_||p.isPending,children:[p.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(ri,{className:"h-4 w-4"}),r("sources.add","소스 추가")]})]})})]})})]})]})}const En=$.forwardRef(({className:t,children:e,...r},i)=>u.jsx("select",{ref:i,className:_t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e}));En.displayName="Select";const Ji=$.forwardRef(({className:t,value:e=0,max:r=100,indeterminate:i,...a},l)=>{const d=Math.min(100,Math.max(0,e/r*100));return u.jsx("div",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":i?void 0:e,className:_t("relative h-2 w-full overflow-hidden rounded-full bg-secondary",t),...a,children:u.jsx("div",{className:_t("h-full bg-primary transition-all",i&&"w-1/3 animate-pulse"),style:i?void 0:{width:`${d}%`}})})});Ji.displayName="Progress";const wC=ox("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800",warning:"border-transparent bg-yellow-100 text-yellow-800"}},defaultVariants:{variant:"default"}});function Xe({className:t,variant:e,...r}){return u.jsx("span",{className:_t(wC({variant:e}),t),...r})}const bC=nn([D(),Ne()]).transform(String),Ry=Be({url:D().optional(),status:D().optional(),page_type:D().optional(),title:D().nullable().optional(),error:D().nullable().optional()}).passthrough(),jC=Be({seed_url:D().optional(),visited_count:Ne().optional(),analyzed_count:Ne().optional(),queued_count:Ne().optional(),skipped_count:Ne().optional(),errors:it(D()).optional(),pages:it(Ry).optional(),latest_page:Ry.optional()}).passthrough(),jd=Be({job_id:bC,status:D(),url:D().nullable().optional(),error:D().nullable().optional(),scheduled_at:D().nullable().optional(),started_at:D().nullable().optional(),finished_at:D().nullable().optional(),progress:jC.default({}),request:li(D(),dn()).default({})}),_C=new Set(["completed","failed","canceled"]);function Ox(t){return _C.has(t)}const Hf={startByProject:t=>rt.post("/crawl-site/by-project",jd,t),getJob:t=>rt.get(`/crawl-site/jobs/${encodeURIComponent(t)}`,jd),cancel:t=>rt.post(`/crawl-site/jobs/${encodeURIComponent(t)}/cancel`,jd)},Ty=2e3;function SC(){const t=Kt();return gn({mutationFn:e=>Hf.startByProject(e),onSuccess:e=>{t.setQueryData(Ie.crawl.job(e.job_id),e)}})}function kC(t){return On({queryKey:Ie.crawl.job(t??""),queryFn:()=>Hf.getJob(t),enabled:!!t,refetchInterval:e=>{const r=e.state.data;return r&&Ox(r.status)?!1:Ty},refetchIntervalInBackground:!1})}function NC(){const t=Kt();return gn({mutationFn:e=>Hf.cancel(e),onSuccess:e=>{t.setQueryData(Ie.crawl.job(e.job_id),e)}})}const CC=Be({source_name:D().min(1,"소스를 선택하세요"),url:D().url("올바른 URL 형식이 아닙니다"),max_depth:Ne().int().min(0).max(10),max_pages:Ne().int().min(1).max(500),same_domain_only:Rr()});function EC(t){switch(t){case"completed":return"success";case"failed":return"destructive";case"canceled":return"secondary";case"cancel_requested":return"warning";case"running":case"pending":return"default";default:return"outline"}}function PC({status:t}){return u.jsx(Xe,{variant:EC(t),children:t})}function OC(){const t=mn(),{projectId:e}=fr(),{t:r}=oi(),i=e??"",{data:a,isLoading:l,isError:d,error:f,refetch:m}=hr(i),[p,v]=$.useState(null),{data:w}=kC(p),y=SC(),x=NC(),{register:S,handleSubmit:_,setValue:b,watch:P,formState:{errors:N,isSubmitting:F}}=Zi({resolver:Gi(CC),defaultValues:{source_name:"",url:"",max_depth:2,max_pages:30,same_domain_only:!0}}),L=async H=>{try{const W=await y.mutateAsync({project_name:i,...H});v(W.job_id),jt.success(r("crawl.started","크롤이 시작되었습니다 (job #{{id}})",{id:W.job_id}))}catch(W){jt.error(r("crawl.startFailed","시작 실패: {{msg}}",{msg:W.message}))}},k=async()=>{if(p)try{await x.mutateAsync(p),jt.info(r("crawl.cancelRequested","취소 요청됨"))}catch(H){jt.error(r("crawl.cancelFailed","취소 실패: {{msg}}",{msg:H.message}))}},I=a?.sources??[],X=P("source_name"),re=I.find(H=>H.name===X),de=w?.progress,Z=de?.visited_count??0,Oe=de?.queued_count??0,J=de?.analyzed_count??0,ve=de?.errors??[],me=P("max_pages"),M=w&&me?Math.min(100,Z/me*100):0,R=w?Ox(w.status):!1,G=w&&!R;return u.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-10",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":r("common.back","이전"),children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:r("crawl.title","시드 크롤")}),a&&u.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.name,u.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",a.domain]})]})]}),R&&w?.status==="completed"&&u.jsxs(Ee,{onClick:()=>t(`/pipeline/${i}`),children:[r("crawl.review","파이프라인 확인"),u.jsx(Lv,{className:"h-4 w-4"})]})]}),d&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center justify-between gap-3 py-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),u.jsx("span",{children:f.message})]}),u.jsx(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>m(),children:r("common.retry","다시 시도")})]})}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[420px_1fr]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("crawl.formTitle","크롤 설정")}),u.jsx(Qe,{children:r("crawl.formDesc","시드 URL에서 시작해 링크를 따라가며 정보를 추출합니다")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:_(L),className:"space-y-4",noValidate:!0,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"source_name",children:r("crawl.source","참고 소스")}),l?u.jsx(pn,{className:"h-10"}):u.jsxs(En,{id:"source_name",...S("source_name"),onChange:H=>{const W=H.target.value,K=I.find(T=>T.name===W);b("source_name",W,{shouldValidate:!0,shouldDirty:!0}),b("url",K?.base_url??"",{shouldValidate:!!K?.base_url,shouldDirty:!0})},children:[u.jsx("option",{value:"",children:r("crawl.pickSource","소스를 선택하세요...")}),I.map(H=>u.jsxs("option",{value:H.name,children:[H.name," (",H.type,")"]},H.id))]}),I.length===0&&!l&&u.jsxs("p",{className:"text-xs text-muted-foreground",children:[r("crawl.noSources","등록된 소스가 없습니다. 먼저 참고 소스를 추가하세요.")," ",u.jsx("button",{type:"button",className:"text-primary underline",onClick:()=>t(`/sources/${i}`),children:r("crawl.addSource","소스 추가")})]}),N.source_name&&u.jsx("p",{className:"text-xs text-destructive",children:N.source_name.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"url",children:r("crawl.seedUrl","시드 URL")}),u.jsx(xt,{id:"url",placeholder:re?.base_url??"https://example.com/start",...S("url")}),N.url&&u.jsx("p",{className:"text-xs text-destructive",children:N.url.message})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"max_depth",children:r("crawl.maxDepth","최대 깊이")}),u.jsx(xt,{id:"max_depth",type:"number",min:0,max:10,...S("max_depth",{valueAsNumber:!0})}),N.max_depth&&u.jsx("p",{className:"text-xs text-destructive",children:N.max_depth.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"max_pages",children:r("crawl.maxPages","최대 페이지")}),u.jsx(xt,{id:"max_pages",type:"number",min:1,max:500,...S("max_pages",{valueAsNumber:!0})}),N.max_pages&&u.jsx("p",{className:"text-xs text-destructive",children:N.max_pages.message})]})]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...S("same_domain_only")}),u.jsx("span",{children:r("crawl.sameDomainOnly","동일 도메인만 따라가기")})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:F||y.isPending||!!G,children:[y.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx($v,{className:"h-4 w-4"}),r("crawl.start","크롤 시작")]})]})})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:r("crawl.progressTitle","진행 상태")}),w&&u.jsxs(Qe,{className:"flex items-center gap-2",children:[u.jsxs("span",{children:["job #",w.job_id]}),u.jsx(PC,{status:w.status})]})]}),G&&u.jsxs(Ee,{variant:"outline",size:"sm",onClick:k,disabled:x.isPending,children:[u.jsx(aS,{className:"h-4 w-4"}),r("crawl.cancel","취소")]})]})}),u.jsxs(ye,{children:[!w&&u.jsxs("div",{className:"flex flex-col items-center gap-3 py-12 text-center text-muted-foreground",children:[u.jsx(yS,{className:"h-12 w-12 opacity-40"}),u.jsx("p",{children:r("crawl.idleHint","왼쪽에서 시드 URL을 입력하고 시작하세요")})]}),w&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center justify-between text-sm",children:[u.jsxs("span",{className:"text-muted-foreground",children:[r("crawl.visited","방문")," ",Z," / ",me]}),u.jsxs("span",{className:"text-muted-foreground",children:[r("crawl.queued","대기")," ",Oe," ·"," ",r("crawl.analyzed","분석")," ",J]})]}),u.jsx(Ji,{value:M,indeterminate:G&&Z===0})]}),w.url&&u.jsxs("div",{className:"rounded-md bg-secondary/30 px-3 py-2 text-xs",children:[u.jsx("div",{className:"text-muted-foreground",children:r("crawl.seedUrl","시드 URL")}),u.jsx("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",className:"break-all text-foreground hover:underline",children:w.url})]}),de?.latest_page&&u.jsxs("div",{className:"rounded-md border bg-background px-3 py-2 text-xs",children:[u.jsx("div",{className:"mb-1 text-muted-foreground",children:r("crawl.latestPage","최근 페이지")}),u.jsx("div",{className:"truncate font-medium",children:de.latest_page.title||de.latest_page.url}),de.latest_page.page_type&&u.jsx(Xe,{variant:"outline",className:"mt-1",children:de.latest_page.page_type})]}),w.error&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive bg-destructive/5 px-3 py-2 text-sm text-destructive",children:[u.jsx(OS,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),u.jsx("span",{children:w.error})]}),ve.length>0&&u.jsxs("details",{className:"rounded-md border bg-background",children:[u.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium",children:r("crawl.errorsCount","에러 {{count}}건",{count:ve.length})}),u.jsx("ul",{className:"max-h-40 overflow-y-auto px-4 py-2 text-xs text-muted-foreground",children:ve.map((H,W)=>u.jsx("li",{className:"border-b py-1 last:border-0",children:H},W))})]}),R&&w.status==="completed"&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700",children:[u.jsx(_f,{className:"h-4 w-4"}),r("crawl.doneHint","크롤 완료. 구축 파이프라인으로 이동하세요.")]})]})]})]})]})]})}const ho=$.forwardRef(({className:t,...e},r)=>u.jsx("textarea",{ref:r,className:_t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e}));ho.displayName="Textarea";const pf=nn([D(),Ne()]).transform(String),RC=Be({job_id:pf.optional(),project_id:pf.optional(),project_name:D().optional(),goal:D().optional(),status:D().optional(),started_at:D().nullable().optional(),finished_at:D().nullable().optional(),steps_taken:Ne().optional(),pages_visited:Ne().optional(),entities_found:Ne().optional(),claims_added:Ne().optional(),error:D().nullable().optional()}).passthrough(),Rx=Be({job_id:pf,status:D().optional(),goal:D().nullable().optional(),seed_url:D().nullable().optional(),started_at:D().nullable().optional(),finished_at:D().nullable().optional(),steps_taken:Ne().nullable().optional(),pages_visited:Ne().nullable().optional(),entities_found:Ne().nullable().optional()}).passthrough(),TC=it(Rx),LC=Rx.extend({trace:it(li(D(),dn())).optional()}),Tx={startByProject:t=>rt.post("/research/run/by-project",RC,t),listSessions:(t,e=25)=>rt.get(`/projects/${encodeURIComponent(t)}/research/sessions`,TC,{query:{limit:e}}),getSession:t=>rt.get(`/research/sessions/${encodeURIComponent(t)}`,LC)};function AC(t){const e=Kt();return gn({mutationFn:r=>Tx.startByProject(r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.research.sessions(t)})}})}function IC(t,e=25){return On({queryKey:Ie.research.sessions(t),queryFn:()=>Tx.listSessions(t,e),enabled:!!t})}const MC=Be({source_name:D().min(1,"소스를 선택하세요"),url:D().url("올바른 URL 형식이 아닙니다").or(fx("")).optional(),goal:D().min(3,"최소 3자").max(500,"최대 500자"),max_depth:Ne().int().min(0).max(10),max_steps:Ne().int().min(1).max(50),max_branch:Ne().int().min(1).max(30),min_relevance:Ne().min(0).max(1),same_domain_only:Rr()});function FC(t){switch(t){case"completed":return"success";case"failed":return"destructive";case"canceled":return"secondary";case"running":case"pending":return"default";default:return"outline"}}function DC(){const t=mn(),{projectId:e}=fr(),{t:r}=oi(),i=e??"",{data:a,isLoading:l,isError:d,error:f,refetch:m}=hr(i),p=IC(i),v=AC(i),[w,y]=$.useState(null),{register:x,handleSubmit:S,setValue:_,formState:{errors:b,isSubmitting:P}}=Zi({resolver:Gi(MC),defaultValues:{source_name:"",url:"",goal:"Semantic ontology exploration",max_depth:2,max_steps:12,max_branch:8,min_relevance:.35,same_domain_only:!0}}),N=async L=>{try{y(null);const k=await v.mutateAsync({project_name:i,source_name:L.source_name,url:L.url||void 0,goal:L.goal,max_depth:L.max_depth,max_steps:L.max_steps,max_branch:L.max_branch,min_relevance:L.min_relevance,same_domain_only:L.same_domain_only});y(k),jt.success(r("research.completed","자율 연구가 완료되었습니다"))}catch(k){jt.error(r("research.failed","실패: {{msg}}",{msg:k.message}))}},F=a?.sources??[];return u.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-10",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":r("common.back","이전"),children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Av,{className:"h-6 w-6 text-primary"}),r("research.title","자율 연구")]}),a&&u.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.name,u.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",a.domain]})]})]})]}),d&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center justify-between gap-3 py-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),u.jsx("span",{children:f.message})]}),u.jsx(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>m(),children:r("common.retry","다시 시도")})]})}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[460px_1fr]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(ES,{className:"h-5 w-5"}),r("research.formTitle","자율 연구 설정")]}),u.jsx(Qe,{children:r("research.formDesc","AI가 시드에서 시작해 스스로 링크를 따라가며 온톨로지를 확장합니다")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:S(N),className:"space-y-4",noValidate:!0,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"source_name",children:r("research.source","참고 소스")}),l?u.jsx(pn,{className:"h-10"}):u.jsxs(En,{id:"source_name",...x("source_name"),onChange:L=>_("source_name",L.target.value,{shouldValidate:!0}),children:[u.jsx("option",{value:"",children:r("research.pickSource","소스를 선택하세요...")}),F.map(L=>u.jsxs("option",{value:L.name,children:[L.name," (",L.type,")"]},L.id))]}),b.source_name&&u.jsx("p",{className:"text-xs text-destructive",children:b.source_name.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"goal",children:r("research.goal","목표")}),u.jsx(ho,{id:"goal",rows:2,placeholder:r("research.goalPlaceholder","예: 인기 브랜드 향수의 노트 구성과 시즌 추천 정보 수집"),...x("goal")}),b.goal&&u.jsx("p",{className:"text-xs text-destructive",children:b.goal.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs(Ye,{htmlFor:"url",children:[r("research.seedUrl","시드 URL")," ",u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",r("research.optional","선택"),")"]})]}),u.jsx(xt,{id:"url",placeholder:"https://example.com/start",...x("url")}),b.url&&u.jsx("p",{className:"text-xs text-destructive",children:b.url.message})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"max_steps",children:r("research.maxSteps","최대 단계")}),u.jsx(xt,{id:"max_steps",type:"number",min:1,max:50,...x("max_steps",{valueAsNumber:!0})}),b.max_steps&&u.jsx("p",{className:"text-xs text-destructive",children:b.max_steps.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"max_branch",children:r("research.maxBranch","분기 폭")}),u.jsx(xt,{id:"max_branch",type:"number",min:1,max:30,...x("max_branch",{valueAsNumber:!0})}),b.max_branch&&u.jsx("p",{className:"text-xs text-destructive",children:b.max_branch.message})]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"max_depth",children:r("research.maxDepth","최대 깊이")}),u.jsx(xt,{id:"max_depth",type:"number",min:0,max:10,...x("max_depth",{valueAsNumber:!0})})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"min_relevance",children:r("research.minRelevance","최소 관련도")}),u.jsx(xt,{id:"min_relevance",type:"number",step:"0.05",min:0,max:1,...x("min_relevance",{valueAsNumber:!0})})]})]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-input",...x("same_domain_only")}),u.jsx("span",{children:r("research.sameDomainOnly","동일 도메인만 탐색")})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:P||v.isPending,children:[v.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(CS,{className:"h-4 w-4"}),r("research.start","자율 연구 시작")]}),v.isPending&&u.jsx("p",{className:"text-xs text-muted-foreground",children:r("research.runningHint","장시간 걸릴 수 있습니다. 완료될 때까지 페이지를 닫지 마세요.")})]})})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("research.resultTitle","최근 결과")}),u.jsx(Qe,{children:r("research.resultDesc","이번 세션에서 실행된 연구의 결과")})]}),u.jsxs(ye,{children:[!w&&!v.isPending&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:r("research.idleHint","왼쪽에서 자율 연구를 시작하면 결과가 여기에 표시됩니다")}),v.isPending&&u.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center text-muted-foreground",children:[u.jsx(dr,{className:"h-8 w-8 animate-spin text-primary"}),u.jsx("p",{children:r("research.runningTitle","AI가 연구 중입니다...")})]}),w&&!v.isPending&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-700",children:[u.jsx(_f,{className:"h-4 w-4"}),r("research.doneHint","완료")]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm sm:grid-cols-4",children:[u.jsx(Rl,{label:r("research.stepsTaken","단계"),value:w.steps_taken}),u.jsx(Rl,{label:r("research.pagesVisited","페이지"),value:w.pages_visited}),u.jsx(Rl,{label:r("research.entitiesFound","엔티티"),value:w.entities_found}),u.jsx(Rl,{label:r("research.claimsAdded","클레임"),value:w.claims_added})]}),w.error&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive bg-destructive/5 px-3 py-2 text-sm text-destructive",children:[u.jsx(fn,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),u.jsx("span",{children:w.error})]}),u.jsxs("details",{className:"rounded-md border bg-background",children:[u.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium",children:r("research.rawResult","원시 응답 JSON")}),u.jsx("pre",{className:"max-h-64 overflow-auto px-4 py-2 text-xs text-muted-foreground",children:JSON.stringify(w,null,2)})]})]})]})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(xS,{className:"h-5 w-5"}),r("research.historyTitle","세션 이력")]}),u.jsx(Qe,{children:r("research.historyDesc","이 프로젝트의 자율 연구 세션 기록")})]}),u.jsxs(ye,{children:[p.isLoading&&u.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((L,k)=>u.jsx(pn,{className:"h-12"},k))}),p.data&&p.data.length===0&&u.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:r("research.historyEmpty","아직 실행된 세션이 없습니다")}),p.data&&p.data.length>0&&u.jsx("ul",{className:"divide-y",children:p.data.map(L=>u.jsxs("li",{className:"flex items-center justify-between gap-3 py-3 text-sm",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:"font-medium",children:["#",L.job_id]}),L.status&&u.jsx(Xe,{variant:FC(L.status),children:L.status})]}),L.goal&&u.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:L.goal})]}),u.jsxs("div",{className:"text-right text-xs text-muted-foreground",children:[typeof L.pages_visited=="number"&&u.jsxs("div",{children:[L.pages_visited," ",r("research.pages","페이지")]}),L.started_at&&u.jsx("div",{children:new Date(L.started_at).toLocaleString()})]})]},L.job_id))})]})]})]})]})]})}function Rl({label:t,value:e}){return u.jsxs("div",{className:"rounded-md border bg-background px-3 py-2",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 text-xl font-semibold",children:typeof e=="number"?e:"—"})]})}const Lx=$.createContext(null);function Ax(){const t=$.useContext(Lx);if(!t)throw new Error("Tabs primitives must be used within ");return t}function $C({value:t,onValueChange:e,className:r,children:i}){return u.jsx(Lx.Provider,{value:{value:t,onChange:e},children:u.jsx("div",{className:_t("flex flex-col gap-3",r),children:i})})}function zC({className:t,children:e}){return u.jsx("div",{role:"tablist",className:_t("inline-flex h-10 items-center justify-start gap-1 rounded-md bg-muted p-1 text-muted-foreground",t),children:e})}function _d({value:t,children:e,className:r}){const i=Ax(),a=i.value===t;return u.jsx("button",{role:"tab",type:"button","aria-selected":a,onClick:()=>i.onChange(t),className:_t("inline-flex items-center justify-center whitespace-nowrap rounded px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",a?"bg-background text-foreground shadow-sm":"hover:text-foreground",r),children:e})}function Sd({value:t,children:e,className:r}){return Ax().value!==t?null:u.jsx("div",{role:"tabpanel",className:_t("focus-visible:outline-none",r),children:e})}const Ix=nn([D(),Ne()]).transform(String),Mx=Be({id:Ix,type:D(),name:D(),metadata:li(D(),dn()).default({})}),UC=it(Mx),VC=Be({created:Ne(),entities:it(Be({id:Ix,type:D(),name:D()}))}),Fx=Be({ok:Rr(),deleted:nn([D(),Ne()])}),du={list:(t,e,r=200)=>rt.get(`/projects/${encodeURIComponent(t)}/entities`,UC,{query:{limit:r,...e?{entity_type:e}:{}}}),create:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/entities`,Mx,e),bulkCreate:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/entities/bulk`,VC,e),delete:(t,e)=>rt.delete(`/projects/${encodeURIComponent(t)}/entities/${e}`,Fx)};function Dx(t,e){return On({queryKey:Ie.entities.list(t,e),queryFn:()=>du.list(t,e),enabled:!!t})}function BC(t){const e=Kt();return gn({mutationFn:r=>du.create(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.entities.all})}})}function qC(t){const e=Kt();return gn({mutationFn:r=>du.bulkCreate(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.entities.all})}})}function HC(t){const e=Kt();return gn({mutationFn:r=>du.delete(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.entities.all}),e.invalidateQueries({queryKey:Ie.claims.all})}})}const Wf=nn([D(),Ne()]).transform(String),WC=Be({id:Wf,subject:D().optional(),subject_type:D().optional(),predicate:D(),object:D().nullable().optional(),object_type:D().nullable().optional(),object_value:dn().nullable().optional(),source:D().nullable().optional(),page_url:D().nullable().optional(),confidence:Ne().optional(),confidence_reason:D().nullable().optional(),status:D().optional(),evidence_text:D().nullable().optional(),evidence_summary:D().nullable().optional(),page_type:D().nullable().optional(),source_zone:D().nullable().optional(),source_selector:D().nullable().optional(),extraction_method:D().nullable().optional(),validation_status:D().nullable().optional(),graph_merge_status:D().nullable().optional(),graph_merge_reason:D().nullable().optional(),confidence_breakdown:li(D(),dn()).nullable().optional(),review_required:Rr().nullable().optional(),review_reason:D().nullable().optional(),conflict_status:D().nullable().optional(),source_history:it(dn()).optional(),last_seen_at:D().optional()}).passthrough(),KC=it(WC),QC=Be({id:Wf,subject_entity_id:nn([D(),Ne()]).transform(String),predicate:D(),object_entity_id:nn([D(),Ne(),Df()]).nullable().optional(),object_value:dn().nullable().optional(),confidence:Ne(),status:D()}),ZC=Be({ok:Rr(),claim_id:Wf,status:D()}),fu={list:(t,e={})=>rt.get(`/projects/${encodeURIComponent(t)}/claims`,KC,{query:{limit:e.limit??100,include_candidates:e.includeCandidates,status:e.status}}),create:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/claims`,QC,e),delete:(t,e)=>rt.delete(`/projects/${encodeURIComponent(t)}/claims/${e}`,Fx),updateStatus:(t,e)=>rt.patch(`/claims/${encodeURIComponent(String(t))}/status`,ZC,e)};function hu(t,e={}){return On({queryKey:Ie.claims.list(t,e.status,e.limit),queryFn:()=>fu.list(t,{status:e.status,includeCandidates:e.includeCandidates,limit:e.limit}),enabled:!!t})}function GC(t){const e=Kt();return gn({mutationFn:r=>fu.create(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.claims.all})}})}function JC(t){const e=Kt();return gn({mutationFn:r=>fu.delete(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.claims.all})}})}function YC(t){const e=Kt();return gn({mutationFn:({claimId:r,status:i,reason:a})=>fu.updateStatus(r,{status:i,reason:a}),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.claims.all}),e.invalidateQueries({queryKey:Ie.platform.all}),e.invalidateQueries({queryKey:Ie.platform.pipeline(t)})}})}const XC=Be({entity_type:D().min(1,"타입을 선택하세요"),name:D().min(1,"이름을 입력하세요").max(240)}),e2=Be({source_name:D().min(1,"소스를 선택하세요"),subject_entity_id:Ne().int().min(1,"주어 엔티티 선택"),predicate:D().min(1,"술어를 선택하세요"),object_kind:hx(["entity","value"]),object_entity_id:Ne().int().nullable().optional(),object_value:D().optional(),confidence:Ne().min(0).max(1)});function t2(){const t=mn(),{projectId:e}=fr(),{t:r}=oi(),i=e??"",[a,l]=$.useState("entities"),{data:d,isLoading:f,isError:m,error:p,refetch:v}=hr(i),{data:w}=Cx(d?.domain),y=Dx(i),x=hu(i,{includeCandidates:!0}),S=BC(i),_=qC(i),b=HC(i),P=GC(i),N=JC(i),F=d?.sources??[],L=$.useMemo(()=>w?.entity_types?.length?w.entity_types:["Entity","Concept","Attribute"],[w]),k=$.useMemo(()=>w?.predicates?.length?w.predicates:["hasAttribute","relatedTo","sameAs"],[w]),I=Zi({resolver:Gi(XC),defaultValues:{entity_type:"",name:""}}),X=async R=>{try{await S.mutateAsync({entity_type:R.entity_type,name:R.name}),jt.success(r("editor.entityAdded","엔티티가 추가되었습니다: {{name}}",{name:R.name})),I.reset({entity_type:R.entity_type,name:""})}catch(G){jt.error(r("editor.entityAddFailed","추가 실패: {{msg}}",{msg:G.message}))}},re=Zi({resolver:Gi(e2),defaultValues:{source_name:"",subject_entity_id:0,predicate:"",object_kind:"entity",object_entity_id:null,object_value:"",confidence:1}}),de=re.watch("object_kind"),Z=async R=>{try{await P.mutateAsync({source_name:R.source_name,subject_entity_id:R.subject_entity_id,predicate:R.predicate,object_entity_id:R.object_kind==="entity"?R.object_entity_id:null,object_value:R.object_kind==="value"?R.object_value:void 0,confidence:R.confidence}),jt.success(r("editor.claimAdded","클레임이 추가되었습니다")),re.reset({...re.getValues(),object_entity_id:null,object_value:""})}catch(G){jt.error(r("editor.claimAddFailed","추가 실패: {{msg}}",{msg:G.message}))}},[Oe,J]=$.useState(JSON.stringify({entities:[{entity_type:"Entity",name:"Example A"},{entity_type:"Entity",name:"Example B"}]},null,2)),[ve,me]=$.useState(null),M=async()=>{me(null);try{const R=JSON.parse(Oe),G=Array.isArray(R.entities)?R.entities:Array.isArray(R)?R:null;if(!G||G.length===0)throw new Error("최상위에 entities 배열이 있어야 합니다");const H=G.map((K,T)=>{if(typeof K!="object"||K===null||typeof K.entity_type!="string"||typeof K.name!="string")throw new Error(`항목 [${T}]에 entity_type/name 문자열이 필요합니다`);return{entity_type:K.entity_type,name:K.name,metadata:typeof K.metadata=="object"&&K.metadata!==null?K.metadata:{}}}),W=await _.mutateAsync({entities:H});jt.success(r("editor.bulkAdded","{{count}}개 엔티티가 추가되었습니다",{count:W.created}))}catch(R){me(R.message)}};return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-10",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/sources/${i}`),"aria-label":r("common.back","이전"),children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Cf,{className:"h-6 w-6 text-primary"}),r("editor.title","온톨로지 직접 편집")]}),d&&u.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.name,u.jsxs("span",{className:"capitalize text-muted-foreground/70",children:[" ","· ",d.domain]})]})]})]}),m&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center justify-between gap-3 py-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),u.jsx("span",{children:p.message})]}),u.jsx(Ee,{variant:"outline",size:"sm",type:"button",onClick:()=>v(),children:r("common.retry","다시 시도")})]})}),u.jsxs($C,{value:a,onValueChange:R=>l(R),children:[u.jsxs(zC,{children:[u.jsxs(_d,{value:"entities",children:[r("editor.entitiesTab","엔티티")," (",y.data?.length??0,")"]}),u.jsxs(_d,{value:"claims",children:[u.jsx(bS,{className:"mr-1 h-4 w-4"}),r("editor.claimsTab","클레임")," (",x.data?.length??0,")"]}),u.jsxs(_d,{value:"bulk",children:[u.jsx(Wd,{className:"mr-1 h-4 w-4"}),r("editor.bulkTab","JSON 일괄 입력")]})]}),u.jsx(Sd,{value:"entities",children:u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[380px_1fr]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("editor.addEntity","엔티티 추가")}),u.jsx(Qe,{children:r("editor.addEntityDesc","온톨로지 도메인의 entity_types 중에서 선택")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:I.handleSubmit(X),className:"space-y-3",noValidate:!0,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.entityType","타입")}),u.jsxs(En,{...I.register("entity_type"),children:[u.jsx("option",{value:"",children:r("editor.pickType","타입 선택...")}),L.map(R=>u.jsx("option",{value:R,children:R},R))]}),I.formState.errors.entity_type&&u.jsx("p",{className:"text-xs text-destructive",children:I.formState.errors.entity_type.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.entityName","이름")}),u.jsx(xt,{placeholder:"Chanel No.5",...I.register("name")}),I.formState.errors.name&&u.jsx("p",{className:"text-xs text-destructive",children:I.formState.errors.name.message})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:S.isPending,children:[S.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(ri,{className:"h-4 w-4"}),r("editor.add","추가")]})]})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("editor.entitiesList","엔티티 목록")}),u.jsx(Qe,{children:y.data?r("editor.entityCount","{{count}}개",{count:y.data.length}):r("dashboard.loadFailed","")})]}),u.jsxs(ye,{children:[y.isLoading&&u.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((R,G)=>u.jsx(pn,{className:"h-10"},G))}),y.data&&y.data.length===0&&u.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:r("editor.entitiesEmpty","아직 등록된 엔티티가 없습니다")}),y.data&&y.data.length>0&&u.jsx("ul",{className:"max-h-[600px] divide-y overflow-y-auto",children:y.data.map(R=>u.jsxs("li",{className:"flex items-center justify-between gap-3 py-2 text-sm",children:[u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Xe,{variant:"outline",children:R.type}),u.jsx("span",{className:"truncate font-medium",children:R.name})]})}),u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>{confirm(r("editor.confirmDeleteEntity","엔티티 '{{name}}'을 삭제하시겠습니까?",{name:R.name}))&&b.mutate(R.id)},disabled:b.isPending,children:u.jsx(Kd,{className:"h-4 w-4 text-destructive"})})]},R.id))})]})]})]})}),u.jsx(Sd,{value:"claims",children:u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[420px_1fr]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("editor.addClaim","클레임 추가")}),u.jsx(Qe,{children:r("editor.addClaimDesc","주어-술어-목적어 형태로 직접 입력")})]}),u.jsx(ye,{children:u.jsxs("form",{onSubmit:re.handleSubmit(Z),className:"space-y-3",noValidate:!0,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.source","소스")}),u.jsxs(En,{...re.register("source_name"),children:[u.jsx("option",{value:"",children:r("editor.pickSource","소스 선택...")}),F.map(R=>u.jsx("option",{value:R.name,children:R.name},R.id))]}),re.formState.errors.source_name&&u.jsx("p",{className:"text-xs text-destructive",children:re.formState.errors.source_name.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.subject","주어 (Subject)")}),u.jsxs(En,{...re.register("subject_entity_id",{valueAsNumber:!0}),children:[u.jsx("option",{value:0,children:r("editor.pickSubject","엔티티 선택...")}),y.data?.map(R=>u.jsxs("option",{value:R.id,children:["[",R.type,"] ",R.name]},R.id))]}),re.formState.errors.subject_entity_id&&u.jsx("p",{className:"text-xs text-destructive",children:re.formState.errors.subject_entity_id.message})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.predicate","술어 (Predicate)")}),u.jsxs(En,{...re.register("predicate"),children:[u.jsx("option",{value:"",children:r("editor.pickPredicate","술어 선택...")}),k.map(R=>u.jsx("option",{value:R,children:R},R))]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.objectKind","목적어 유형")}),u.jsxs(En,{...re.register("object_kind"),children:[u.jsx("option",{value:"entity",children:r("editor.objectEntity","다른 엔티티")}),u.jsx("option",{value:"value",children:r("editor.objectValue","리터럴 값")})]})]}),de==="entity"?u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.objectEntity","목적 엔티티")}),u.jsxs(En,{...re.register("object_entity_id",{valueAsNumber:!0,setValueAs:R=>R===""||R===null||R===void 0?null:Number(R)}),children:[u.jsx("option",{value:"",children:r("editor.pickObject","엔티티 선택...")}),y.data?.map(R=>u.jsxs("option",{value:R.id,children:["[",R.type,"] ",R.name]},R.id))]})]}):u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.objectValue","값")}),u.jsx(xt,{placeholder:"2024-01-15 또는 임의 문자열",...re.register("object_value")})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{children:r("editor.confidence","신뢰도")}),u.jsx(xt,{type:"number",step:"0.05",min:0,max:1,...re.register("confidence",{valueAsNumber:!0})})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:P.isPending,children:[P.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(ri,{className:"h-4 w-4"}),r("editor.add","추가")]})]})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("editor.claimsList","클레임 목록")}),u.jsx(Qe,{children:x.data&&r("editor.claimCount","{{count}}개",{count:x.data.length})})]}),u.jsxs(ye,{children:[x.isLoading&&u.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((R,G)=>u.jsx(pn,{className:"h-12"},G))}),x.data&&x.data.length===0&&u.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:r("editor.claimsEmpty","아직 등록된 클레임이 없습니다")}),x.data&&x.data.length>0&&u.jsx("ul",{className:"max-h-[600px] divide-y overflow-y-auto",children:x.data.map(R=>u.jsxs("li",{className:"flex items-start justify-between gap-3 py-3 text-sm",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"font-medium",children:R.subject??"?"}),u.jsx(Xe,{variant:"secondary",children:R.predicate}),u.jsx("span",{className:"font-medium",children:R.object??String(R.object_value??"—")})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[r("editor.source","소스"),": ",R.source??"—"]}),typeof R.confidence=="number"&&u.jsxs("span",{children:[r("editor.confidence","신뢰도"),":"," ",R.confidence.toFixed(2)]}),R.status&&u.jsx(Xe,{variant:"outline",children:R.status})]})]}),u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>{confirm(r("editor.confirmDeleteClaim","클레임을 삭제하시겠습니까?"))&&N.mutate(R.id)},children:u.jsx(Kd,{className:"h-4 w-4 text-destructive"})})]},R.id))})]})]})]})}),u.jsx(Sd,{value:"bulk",children:u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:r("editor.bulkTitle","JSON 일괄 입력")}),u.jsx(Qe,{children:r("editor.bulkDesc","{ entities: [{ entity_type, name, metadata? }] } 형태의 JSON")})]}),u.jsxs(ye,{className:"space-y-3",children:[u.jsx(ho,{value:Oe,onChange:R=>J(R.target.value),rows:12,className:"font-mono text-xs"}),ve&&u.jsx("p",{className:"text-sm text-destructive",children:ve}),u.jsxs(Ee,{onClick:M,disabled:_.isPending||f,children:[_.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(Wd,{className:"h-4 w-4"}),r("editor.bulkSubmit","일괄 추가")]})]})]})})]})]})}function Ct(t,e="-"){if(t==null||t==="")return e;if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)){const r=t.map(i=>Ct(i,"")).filter(Boolean);return r.length?r.join(", "):e}if(typeof t=="object"){const r=t;for(const a of["label","name","title","value","text","display","canonical_name"])if(r[a]!==void 0&&r[a]!==null)return Ct(r[a],e);const i=Object.entries(r).filter(([,a])=>a!=null&&a!=="").slice(0,4).map(([a,l])=>`${a}: ${Ct(l,"")}`).filter(a=>!a.endsWith(": "));return i.length?i.join(" · "):e}return String(t)}function tn(t,e="-"){return typeof t!="number"||Number.isNaN(t)?e:`${Math.round(t*100)}%`}function ai(t,e="-"){if(typeof t!="string"||!t)return e;const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function Ys(t){switch((t??"").toLowerCase()){case"validated_claim":return"approved";case"rejected":return"rejected";case"active":case"candidate_claim":case"rule_candidate":return"candidate";default:return t||"candidate"}}function Ly(t){switch(Ys(t)){case"approved":return"success";case"rejected":return"destructive";case"candidate":return"warning";default:return"outline"}}function n2(t){return typeof t.confidence!="number"?"unknown":t.confidence>=.9?"auto-approve candidate":t.confidence>=.7?"normal review":"priority review"}function Ay(t){return Ct(t.object??t.object_value)}function r2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),a=hu(r,{includeCandidates:!0,limit:300}),l=YC(r),[d,f]=$.useState("all"),[m,p]=$.useState(""),[v,w]=$.useState(null),y=$.useMemo(()=>{const b=m.trim().toLowerCase();return(a.data??[]).filter(P=>d!=="all"&&Ys(P.status)!==d?!1:b?[P.subject,P.predicate,Ay(P),P.evidence_text,P.page_url,P.source].map(N=>Ct(N,"").toLowerCase()).some(N=>N.includes(b)):!0)},[a.data,m,d]),x=$.useMemo(()=>y.find(b=>b.id===v)??y[0],[y,v]),S=$.useMemo(()=>{const b=a.data??[];return{total:b.length,candidate:b.filter(P=>Ys(P.status)==="candidate").length,approved:b.filter(P=>Ys(P.status)==="approved").length,rejected:b.filter(P=>Ys(P.status)==="rejected").length}},[a.data]),_=async(b,P)=>{try{await l.mutateAsync({claimId:b.id,status:P,reason:P==="rejected"?"Rejected from Claim Review":"Updated from Claim Review"}),jt.success(`Claim ${P}`)}catch(N){jt.error(N.message)}};return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/schema/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Nf,{className:"h-6 w-6 text-primary"}),"Claim Review"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," · 후보, 승인, 반려 상태 분리 검토"]})]}),u.jsx(Ee,{onClick:()=>t(`/quality/${r}`),children:"Quality Inspector"})]}),a.isError&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),a.error.message]})}),u.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-4",children:[u.jsx(Tl,{label:"Total",value:S.total}),u.jsx(Tl,{label:"Candidate",value:S.candidate}),u.jsx(Tl,{label:"Approved",value:S.approved}),u.jsx(Tl,{label:"Rejected",value:S.rejected})]}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_420px]",children:[u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:"Review Queue"}),u.jsx(Qe,{children:"신뢰도, 출처, 생성 방식, 검증 결과를 함께 확인합니다."})]}),u.jsxs("div",{className:"flex min-w-0 flex-wrap gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Vv,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),u.jsx(xt,{value:m,onChange:b=>p(b.target.value),className:"w-56 pl-9",placeholder:"Search claims"})]}),u.jsxs("div",{className:"relative",children:[u.jsx(mS,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),u.jsxs(En,{value:d,onChange:b=>f(b.target.value),className:"w-40 pl-9",children:[u.jsx("option",{value:"all",children:"All"}),u.jsx("option",{value:"candidate",children:"Candidate"}),u.jsx("option",{value:"approved",children:"Approved"}),u.jsx("option",{value:"rejected",children:"Rejected"})]})]})]})]})}),u.jsxs(ye,{children:[a.isLoading&&u.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((b,P)=>u.jsx(pn,{className:"h-24"},P))}),!a.isLoading&&y.length===0&&u.jsx("p",{className:"py-10 text-center text-sm text-muted-foreground",children:"조건에 맞는 클레임이 없습니다."}),u.jsx("div",{className:"space-y-3",children:y.map(b=>u.jsx("article",{className:"rounded-md border bg-background p-4",children:u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[u.jsxs("button",{type:"button",onClick:()=>w(b.id),className:"min-w-0 flex-1 text-left",children:[u.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[u.jsx(Xe,{variant:Ly(b.status),children:Ys(b.status)}),u.jsx(Xe,{variant:"secondary",children:b.predicate}),u.jsx("span",{className:"text-xs text-muted-foreground",children:n2(b)})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-medium",children:Ct(b.subject)}),u.jsx("span",{className:"text-muted-foreground",children:"->"}),u.jsx("span",{className:"font-medium",children:Ay(b)})]}),u.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:["Confidence ",tn(b.confidence)]}),u.jsxs("span",{children:["Source ",Ct(b.source)]}),u.jsxs("span",{children:["Evidence ",b.evidence_text?"yes":"missing"]}),u.jsxs("span",{children:["Method ",Ct(b.extraction_method)]})]})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsxs(Ee,{variant:"outline",size:"sm",onClick:()=>w(b.id),children:[u.jsx(fS,{className:"h-4 w-4"}),"Detail"]}),u.jsxs(Ee,{variant:"outline",size:"sm",onClick:()=>_(b,"validated_claim"),disabled:l.isPending,children:[u.jsx(Dg,{className:"h-4 w-4"}),"Approve"]}),u.jsxs(Ee,{variant:"outline",size:"sm",onClick:()=>_(b,"rejected"),disabled:l.isPending,children:[u.jsx(zg,{className:"h-4 w-4"}),"Reject"]})]})]})},b.id))})]})]}),u.jsx("aside",{className:"lg:sticky lg:top-4 lg:self-start",children:u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Claim Detail"}),u.jsx(Qe,{children:"근거, 출처, 검증 결과, 히스토리"})]}),u.jsxs(ye,{children:[!x&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"클레임을 선택하세요."}),x&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(Xe,{variant:Ly(x.status),children:Ys(x.status)}),u.jsx(Xe,{variant:"outline",children:tn(x.confidence)}),x.review_required&&u.jsx(Xe,{variant:"warning",children:"review required"})]}),u.jsx(jr,{label:"Subject",value:x.subject}),u.jsx(jr,{label:"Subject Type",value:x.subject_type}),u.jsx(jr,{label:"Predicate",value:x.predicate}),u.jsx(jr,{label:"Object",value:x.object??x.object_value}),u.jsx(jr,{label:"Source",value:x.source}),u.jsx(jr,{label:"Source URL",value:x.page_url}),u.jsx(jr,{label:"Page Type",value:x.page_type}),u.jsx(jr,{label:"Created By",value:x.extraction_method}),u.jsx(jr,{label:"Validation",value:x.validation_status??x.graph_merge_status}),x.graph_merge_reason&&u.jsx(jr,{label:"Graph Reason",value:x.graph_merge_reason}),x.evidence_text&&u.jsxs("section",{children:[u.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Evidence Text"}),u.jsx("div",{className:"rounded-md bg-yellow-50 px-3 py-2 text-sm leading-relaxed text-yellow-950",children:x.evidence_text})]}),x.confidence_breakdown&&u.jsxs("section",{children:[u.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Confidence Breakdown"}),u.jsx("pre",{className:"max-h-44 overflow-auto rounded-md bg-secondary/30 p-3 text-xs",children:JSON.stringify(x.confidence_breakdown,null,2)})]}),x.source_history&&x.source_history.length>0&&u.jsxs("section",{children:[u.jsx("h3",{className:"mb-2 text-sm font-medium",children:"Source History"}),u.jsx("pre",{className:"max-h-44 overflow-auto rounded-md bg-secondary/30 p-3 text-xs",children:JSON.stringify(x.source_history,null,2)})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2",children:[u.jsxs(Ee,{onClick:()=>_(x,"validated_claim"),disabled:l.isPending,children:[u.jsx(Dg,{className:"h-4 w-4"}),"Approve"]}),u.jsxs(Ee,{variant:"outline",onClick:()=>_(x,"rejected"),disabled:l.isPending,children:[u.jsx(zg,{className:"h-4 w-4"}),"Reject"]})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Last seen ",ai(x.last_seen_at)]})]})]})]})})]})]})}function Tl({label:t,value:e}){return u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 text-2xl font-semibold",children:e.toLocaleString()})]})})}function jr({label:t,value:e}){return u.jsxs("div",{className:"rounded-md border bg-background px-3 py-2 text-sm",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 break-words font-medium",children:Ct(e)})]})}const Pn=nn([D(),Ne()]).transform(String),Qr=li(D(),dn()),s2=Be({key:D(),count:Ne().default(0),extra:Qr.optional()}).passthrough(),i2=Be({stages:it(s2).default([]),entity_types:it(Be({type:D(),count:Ne()})).default([]),recent_pages:it(Be({id:Pn,url:D(),title:D().nullable().optional(),status_code:Ne().nullable().optional(),page_type:D().nullable().optional(),fetched_at:D().nullable().optional()}).passthrough()).default([]),recent_claims:it(Be({id:Pn,subject:D().nullable().optional(),predicate:D(),confidence:Ne().optional(),status:D().optional(),last_seen_at:D().nullable().optional()}).passthrough()).default([])}).passthrough(),a2=Be({id:Pn,page_url:D().nullable().optional(),extractor_name:D(),provider:D(),error:D().nullable().optional(),created_at:D(),validation:dn().optional(),page_context:dn().optional(),candidate_count:Ne().default(0),raw_output:dn().optional()}).passthrough(),o2=Be({entity_types:it(Be({id:Pn,name:D(),domain:D().optional(),description:D().nullable().optional(),status:D().optional(),version:D().optional(),confidence:Ne().optional(),metadata:Qr.optional()}).passthrough()).default([]),relation_types:it(Be({id:Pn,name:D(),domain:D().optional(),description:D().nullable().optional(),allowed_subject_types:it(D()).default([]),allowed_object_types:it(D()).default([]),allowed_page_types:it(D()).default([]),allowed_source_zones:it(D()).default([]),semantic_constraints:Qr.default({}),confidence_rules:Qr.default({}),status:D().optional(),version:D().optional(),confidence:Ne().optional(),metadata:Qr.optional()}).passthrough()).default([])}).passthrough(),l2=Be({id:Pn,proposal_type:D(),name:D(),reason:D().nullable().optional(),evidence:D().nullable().optional(),status:D(),confidence:Ne().optional(),metadata:Qr.optional(),updated_at:D().nullable().optional()}).passthrough(),u2=Be({id:Pn,claim_id:nn([D(),Ne(),Df()]).nullable().optional(),subject:D().nullable().optional(),subject_type:D().nullable().optional(),predicate:D(),object:D().nullable().optional(),object_type:D().nullable().optional(),object_value:dn().nullable().optional(),value_type:D().optional(),status:D().optional(),confidence:Ne().optional(),support_count:Ne().optional(),metadata:Qr.optional(),last_seen_at:D().nullable().optional()}).passthrough(),c2=Be({id:Pn,name:D(),type:D().optional(),canonical_name:D().nullable().optional(),metadata:Qr.optional()}).passthrough(),d2=Be({claim_id:Pn,source:Pn,target:nn([D(),Ne(),Df()]).nullable().optional(),target_value:dn().nullable().optional(),predicate:D(),status:D().optional(),confidence:Ne().optional(),last_seen_at:D().nullable().optional(),metadata:Qr.optional(),object:Be({id:Pn,name:D()}).nullable().optional()}).passthrough(),f2=Be({nodes:it(c2).default([]),edges:it(d2).default([])}).passthrough(),h2=Be({project:D(),status:D(),count:Ne(),claims:it(li(D(),dn())).default([])}).passthrough(),p2=Be({ok:Rr().optional(),stage:D(),action:D(),route:D().optional(),message:D().optional(),job_id:Pn.optional(),status:D().optional()}).passthrough(),m2=Be({id:Pn,name:D(),domain:D().optional(),status:D().optional()}).passthrough(),g2=Be({id:Pn,name:D(),domain:D().optional(),status:D().optional()}).passthrough(),Qn={pipeline:t=>rt.get(`/projects/${encodeURIComponent(t)}/pipeline`,i2),extractionLogs:(t,e=50)=>rt.get(`/projects/${encodeURIComponent(t)}/extraction-logs`,it(a2),{query:{limit:e}}),registry:t=>rt.get(`/projects/${encodeURIComponent(t)}/ontology/registry`,o2),proposals:(t,e=100)=>rt.get(`/projects/${encodeURIComponent(t)}/ontology/proposals`,it(l2),{query:{limit:e}}),triples:(t,e,r=200)=>rt.get(`/projects/${encodeURIComponent(t)}/ontology/triples`,it(u2),{query:{status:e,limit:r}}),graphNeighborhood:(t,e={})=>rt.get(`/projects/${encodeURIComponent(t)}/graph/neighborhood`,f2,{query:{entity_id:e.entityId,limit:e.limit??200,include_candidates:e.includeCandidates,status:e.status}}),exportJson:(t,e={})=>rt.get(`/projects/${encodeURIComponent(t)}/export`,h2,{query:{format:"json",status:e.status??"validated_claim",include_evidence:e.includeEvidence??!0,limit:e.limit??1e3}}),exportUrl:(t,e,r="validated_claim",i=!0,a=1e3)=>{const l=new URLSearchParams({format:e,status:r,include_evidence:String(i),limit:String(a)});return`/projects/${encodeURIComponent(t)}/export?${l.toString()}`},rerunStage:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/pipeline/rerun`,p2,{stage:e}),createSchemaEntityType:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/schema/entity-types`,m2,e),createSchemaRelationType:(t,e)=>rt.post(`/projects/${encodeURIComponent(t)}/schema/relation-types`,g2,e)};function Kf(t){return On({queryKey:Ie.platform.pipeline(t),queryFn:()=>Qn.pipeline(t),enabled:!!t})}function y2(t,e=50){return On({queryKey:Ie.platform.extractionLogs(t,e),queryFn:()=>Qn.extractionLogs(t,e),enabled:!!t})}function $x(t){return On({queryKey:Ie.platform.registry(t),queryFn:()=>Qn.registry(t),enabled:!!t})}function v2(t,e=100){return On({queryKey:Ie.platform.proposals(t,e),queryFn:()=>Qn.proposals(t,e),enabled:!!t})}function x2(t,e={}){const r=e.entityId==null?"*":String(e.entityId),i=e.status??"*",a=e.limit??200;return On({queryKey:Ie.platform.graph(t,r,!!e.includeCandidates,i,a),queryFn:()=>Qn.graphNeighborhood(t,e),enabled:!!t})}function w2(t,e={}){const r=e.status??"validated_claim",i=e.includeEvidence??!0,a=e.limit??1e3;return On({queryKey:Ie.platform.exportJson(t,r,i,a),queryFn:()=>Qn.exportJson(t,{status:r,includeEvidence:i,limit:a}),enabled:!!t})}function b2(t){const e=Kt();return gn({mutationFn:r=>Qn.rerunStage(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.platform.pipeline(t)})}})}function j2(t){const e=Kt();return gn({mutationFn:r=>Qn.createSchemaEntityType(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.platform.registry(t)})}})}function _2(t){const e=Kt();return gn({mutationFn:r=>Qn.createSchemaRelationType(t,r),onSuccess:()=>{e.invalidateQueries({queryKey:Ie.platform.registry(t)})}})}function S2(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function k2(){const t=mn(),{t:e}=oi(),{data:r,isLoading:i,isError:a,error:l,refetch:d}=px();return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-10",children:[u.jsxs("div",{className:"mb-8 flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e("dashboard.title","Ontology Builder")}),u.jsx("p",{className:"mt-2 text-muted-foreground",children:e("dashboard.subtitle","Build and manage domain ontologies with AI-powered extraction")})]}),u.jsxs(Ee,{onClick:()=>t("/onboard"),children:[u.jsx(ri,{className:"h-4 w-4"}),e("dashboard.newProject","New Project")]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[u.jsx("h2",{className:"text-lg font-semibold",children:e("dashboard.projects","Projects")}),r&&u.jsx("span",{className:"text-sm text-muted-foreground",children:e("dashboard.projectCount","{{count}} total",{count:r.length})})]}),i&&u.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:3}).map((f,m)=>u.jsx(pn,{className:"h-32"},m))}),a&&u.jsxs(ge,{className:"border-destructive",children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2 text-destructive",children:[u.jsx(fn,{className:"h-5 w-5"}),e("dashboard.loadFailed","Failed to load projects")]}),u.jsx(Qe,{children:l.message})]}),u.jsx(ye,{children:u.jsx(Ee,{variant:"outline",onClick:()=>d(),children:e("common.retry","Retry")})})]}),r&&r.length===0&&u.jsx(ge,{children:u.jsxs(ye,{className:"flex flex-col items-center gap-4 py-12 text-center",children:[u.jsx(gS,{className:"h-12 w-12 text-muted-foreground"}),u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",children:e("dashboard.empty.title","No projects yet")}),u.jsx("p",{className:"text-sm text-muted-foreground",children:e("dashboard.empty.hint","Create your first project to start building an ontology")})]}),u.jsxs(Ee,{onClick:()=>t("/onboard"),children:[u.jsx(ri,{className:"h-4 w-4"}),e("dashboard.newProject","New Project")]})]})}),r&&r.length>0&&u.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:r.map(f=>u.jsx(N2,{project:f,onOpen:t},f.id))})]})]})}function N2({project:t,onOpen:e}){const r=Kf(t.name),i=r.data?.stages.find(p=>p.key==="claims"),a=r.data?.stages.find(p=>p.key==="validated"),l=r.data?.stages.find(p=>p.key==="crawled"),d=i?.count??0,f=a?.count??0,m=d>0?f/d:0;return u.jsxs(ge,{role:"button",tabIndex:0,onClick:()=>e(`/sources/${t.name}`),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&e(`/sources/${t.name}`)},className:"cursor-pointer transition-colors hover:bg-accent/40",children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:t.name}),u.jsx(Qe,{children:t.domain})]}),u.jsxs(ye,{children:[u.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[u.jsx(kd,{label:"Pages",value:l?.count??0}),u.jsx(kd,{label:"Claims",value:d}),u.jsx(kd,{label:"Approved",value:tn(m)})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx(cS,{className:"h-3 w-3"}),S2(t.updated_at)]})]})]})}function kd({label:t,value:e}){return u.jsxs("div",{className:"rounded-md border bg-background px-2 py-1",children:[u.jsx("div",{className:"text-muted-foreground",children:t}),u.jsx("div",{className:"font-semibold",children:typeof e=="number"?e.toLocaleString():e})]})}const C2=new Set(["human-review","ontology-commit","export"]);function Wn(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function E2(t){switch(t){case"done":return"success";case"running":return"default";case"issue":return"warning";default:return"outline"}}function P2(t){return t.key==="human-review"?"Open review":t.key==="ontology-commit"?"Open graph":t.key==="export"?"Open export":"Rerun"}function O2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),a=Kf(r),l=b2(r),[d,f]=$.useState(null),m=$.useMemo(()=>{const y=a.data?.stages??[],x=new Map(y.map(Z=>[Z.key,Z])),S=Wn(x.get("crawled")?.count),_=Wn(x.get("extracted")?.count),b=Wn(x.get("extracted")?.extra?.events),P=Wn(x.get("extracted")?.extra?.errors),N=x.get("claims")?.extra??{},F=Wn(x.get("claims")?.count),L=Wn(x.get("validated")?.count),k=Wn(N.rejected),I=Wn(N.active)+Wn(N.rule_candidate)+Wn(N.candidate_claim),X=Wn(x.get("graph")?.count),re=Wn(x.get("graph")?.extra?.entities),de=a.data?.recent_pages.filter(Z=>Z.page_type).length??0;return[{key:"source-crawl",name:"Source Crawl",description:"Fetch source HTML, metadata, and in-domain links.",count:S,target:Math.max(S,1),status:S>0?"done":"waiting"},{key:"page-clean",name:"Page Clean",description:"Normalize page text and remove repeated UI noise.",count:S,target:Math.max(S,1),status:S>0?"done":"waiting"},{key:"page-classification",name:"Page Classification",description:"Classify product, brand, review, and supporting pages.",count:de,target:Math.max(S,1),status:de>0?"done":S>0?"running":"waiting"},{key:"entity-extraction",name:"Entity Extraction",description:"Extract candidate entities from typed pages.",count:re,target:Math.max(re,1),status:re>0?"done":_>0?"running":"waiting",extra:`${b} extraction events`},{key:"claim-generation",name:"Claim Generation",description:"Turn entities and page evidence into relation claims.",count:F,target:Math.max(F,1),status:F>0?"done":re>0?"running":"waiting"},{key:"deduplication",name:"Deduplication",description:"Collapse repeated entities and duplicate relation claims.",count:Math.max(F-I,0),target:Math.max(F,1),status:F>0?"done":"waiting"},{key:"validation",name:"Validation",description:"Check schema fit, evidence quality, and conflicts.",count:Math.max(F-I,0),target:Math.max(F,1),status:P>0?"issue":F>0?"done":"waiting",extra:P>0?`${P} errors`:void 0},{key:"human-review",name:"Human Review",description:"Approve, reject, or send uncertain claims back for cleanup.",count:L+k,target:Math.max(F,1),status:L+k>0?"done":F>0?"running":"waiting",extra:`${L} approved / ${k} rejected`},{key:"ontology-commit",name:"Ontology Commit",description:"Project accepted claims into the graph triple store.",count:X,target:Math.max(L,1),status:X>0?"done":L>0?"running":"waiting"},{key:"export",name:"Export",description:"Prepare JSON, CSV, Turtle, and API access for downstream use.",count:X,target:Math.max(X,1),status:X>0?"done":"waiting"}]},[a.data]),p=m.filter(y=>y.status==="done").length,v=m.length?p/m.length*100:0;async function w(y){f(null);try{const x=await l.mutateAsync(y.key);if(x.action==="navigate"&&x.route){t(x.route);return}f({tone:"success",text:x.job_id!=null?`Started job #${x.job_id} for ${y.name}.`:x.message??`${y.name} action completed.`}),a.refetch()}catch(x){f({tone:"error",text:x instanceof Error?x.message:"Stage action failed."})}}return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/crawl/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Dv,{className:"h-6 w-6 text-primary"}),"Build Pipeline"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," pipeline status and recovery actions"]})]}),u.jsxs(Ee,{variant:"outline",onClick:()=>a.refetch(),children:[u.jsx($g,{className:"h-4 w-4"}),"Refresh"]})]}),d&&u.jsx(ge,{className:d.tone==="error"?"mb-6 border-destructive":"mb-6 border-green-200",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm",children:[u.jsx(fn,{className:"h-4 w-4"}),d.text]})}),a.isError&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),a.error.message]})}),u.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-4",children:[u.jsx(Ll,{icon:dS,label:"Collected pages",value:a.data?.stages.find(y=>y.key==="crawled")?.count}),u.jsx(Ll,{icon:hS,label:"Extraction pages",value:a.data?.stages.find(y=>y.key==="extracted")?.count}),u.jsx(Ll,{icon:Nf,label:"Claims",value:a.data?.stages.find(y=>y.key==="claims")?.count}),u.jsx(Ll,{icon:_f,label:"Overall",value:tn(v/100)})]}),u.jsxs(ge,{className:"mb-6",children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:"Ontology Build Flow"}),u.jsx(Qe,{children:"The ten major build stages, current counts, and recovery entry points."})]}),u.jsxs(Xe,{variant:"outline",children:[p,"/",m.length," complete"]})]})}),u.jsxs(ye,{children:[u.jsx(Ji,{value:v,className:"mb-5"}),a.isLoading?u.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((y,x)=>u.jsx(pn,{className:"h-20"},x))}):u.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:m.map((y,x)=>{const S=y.target>0?Math.min(100,y.count/y.target*100):0,_=C2.has(y.key);return u.jsxs("article",{className:"rounded-md border bg-background p-4",children:[u.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Step ",x+1]}),u.jsx("h3",{className:"font-semibold",children:y.name}),u.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:y.description})]}),u.jsx(Xe,{variant:E2(y.status),children:y.status})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Ji,{value:S,className:"h-2"}),u.jsxs("span",{className:"w-16 text-right text-xs text-muted-foreground",children:[Math.round(S),"%"]})]}),u.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[u.jsxs("div",{children:[u.jsxs("span",{children:[y.count.toLocaleString()," items"]}),y.extra&&u.jsxs("span",{children:[" / ",y.extra]})]}),u.jsxs(Ee,{size:"sm",variant:_?"outline":"secondary",disabled:!r||l.isPending,onClick:()=>w(y),children:[_?u.jsx(Mv,{className:"h-3.5 w-3.5"}):u.jsx($g,{className:"h-3.5 w-3.5"}),l.isPending?"Working":P2(y)]})]})]},y.key)})})]})]}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Recent Pages"}),u.jsx(Qe,{children:"Most recently collected and typed pages."})]}),u.jsx(ye,{children:u.jsxs("ul",{className:"divide-y",children:[(a.data?.recent_pages??[]).map(y=>u.jsxs("li",{className:"py-3 text-sm",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Xe,{variant:"outline",children:y.page_type??"unknown"}),u.jsx("span",{className:"truncate font-medium",children:y.title||y.url})]}),u.jsx("div",{className:"mt-1 truncate text-xs text-muted-foreground",children:y.url}),u.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:ai(y.fetched_at)})]},y.id)),a.data?.recent_pages.length===0&&u.jsx("li",{className:"py-6 text-center text-sm text-muted-foreground",children:"No collected pages yet."})]})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Recent Claims"}),u.jsx(Qe,{children:"Latest relation claims from the build flow."})]}),u.jsx(ye,{children:u.jsxs("ul",{className:"divide-y",children:[(a.data?.recent_claims??[]).map(y=>u.jsxs("li",{className:"py-3 text-sm",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx($v,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"truncate font-medium",children:y.subject||"-"}),u.jsx(Xe,{variant:"secondary",children:y.predicate})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs text-muted-foreground",children:[u.jsx("span",{children:tn(y.confidence)}),u.jsx("span",{children:y.status}),u.jsx("span",{children:ai(y.last_seen_at)})]})]},y.id)),a.data?.recent_claims.length===0&&u.jsx("li",{className:"py-6 text-center text-sm text-muted-foreground",children:"No claims have been generated yet."})]})})]})]})]})}function Ll({icon:t,label:e,value:r}){return u.jsx(ge,{children:u.jsxs(ye,{className:"flex items-center justify-between gap-4 py-4",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:e}),u.jsx("div",{className:"mt-1 text-2xl font-semibold",children:typeof r=="number"?r.toLocaleString():r??"-"})]}),u.jsx(t,{className:"h-5 w-5 text-muted-foreground"})]})})}function Xa(t){return typeof t=="object"&&t!==null?t:{}}function Iy(...t){for(const e of t)if(typeof e=="string"&&e.trim())return e;return""}function R2(t){const e=Xa(t?.raw_output),r=e.candidate_claims;if(Array.isArray(r))return r;const a=Xa(e.validation).candidate_claims;return Array.isArray(a)?a:[]}function T2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),a=y2(r,100),l=hu(r,{includeCandidates:!0,limit:300}),[d,f]=$.useState(null),m=$.useMemo(()=>{const _=a.data??[];return _.find(b=>b.id===d)??_[0]},[a.data,d]),p=$.useMemo(()=>m?.page_url?(l.data??[]).filter(_=>_.page_url===m.page_url):[],[l.data,m?.page_url]),v=Xa(m?.page_context),w=Xa(m?.raw_output),y=Xa(w.page_context),x=Iy(v.clean_text,v.cleaned_text,v.text,y.clean_text,y.cleaned_text,y.text),S=Iy(v.html,v.raw_html,y.html,y.raw_html);return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/pipeline/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Uv,{className:"h-6 w-6 text-primary"}),"Page Analysis"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," · 추출 근거와 페이지 분석 로그"]})]}),u.jsx(Ee,{variant:"outline",onClick:()=>a.refetch(),children:"Refresh"})]}),(a.isError||l.isError)&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),a.error?.message??l.error?.message]})}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[360px_1fr]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Analysis Runs"}),u.jsx(Qe,{children:"페이지별 추출 실행 기록과 오류 상태"})]}),u.jsxs(ye,{children:[a.isLoading&&u.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((_,b)=>u.jsx(pn,{className:"h-16"},b))}),a.data?.length===0&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"아직 분석 로그가 없습니다. 먼저 크롤을 실행하세요."}),u.jsx("ul",{className:"max-h-[720px] divide-y overflow-y-auto",children:(a.data??[]).map(_=>u.jsx("li",{className:"py-2",children:u.jsxs("button",{type:"button",onClick:()=>f(_.id),className:"w-full rounded-md px-3 py-2 text-left transition-colors hover:bg-accent/10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-sm font-medium",children:_.page_url??`run #${_.id}`}),u.jsx(Xe,{variant:_.error?"destructive":"success",children:_.error?"error":"ok"})]}),u.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx("span",{children:_.extractor_name}),u.jsx("span",{children:_.provider}),u.jsxs("span",{children:[_.candidate_count," candidates"]})]}),u.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:ai(_.created_at)})]})},_.id))})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:"Selected Page"}),u.jsx(Qe,{children:m?.page_url??"분석 로그를 선택하세요"})]}),m&&u.jsx(Xe,{variant:m.error?"destructive":"outline",children:m.provider})]})}),u.jsxs(ye,{children:[!m&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"표시할 페이지 분석 결과가 없습니다."}),m&&u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(Nd,{label:"Extractor",value:m.extractor_name}),u.jsx(Nd,{label:"Candidates",value:String(m.candidate_count)}),u.jsx(Nd,{label:"Validation",value:Ct(m.validation)})]}),m?.error&&u.jsx("div",{className:"mt-4 rounded-md border border-destructive bg-destructive/5 px-3 py-2 text-sm text-destructive",children:m.error})]})]}),u.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(Fv,{className:"h-5 w-5"}),"Cleaned Text"]}),u.jsx(Qe,{children:"AI 분석에 투입된 정제 본문"})]}),u.jsx(ye,{children:u.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded-md bg-secondary/30 p-3 text-xs leading-relaxed",children:x||"정제 본문이 저장되어 있지 않습니다."})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(Sf,{className:"h-5 w-5"}),"Raw Context"]}),u.jsx(Qe,{children:"원문 HTML 또는 분석 입력 컨텍스트"})]}),u.jsx(ye,{children:u.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded-md bg-secondary/30 p-3 text-xs leading-relaxed",children:S||JSON.stringify(v||y,null,2)})})]})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Extracted Claims"}),u.jsx(Qe,{children:"같은 페이지에서 생성된 클레임과 근거 문장"})]}),u.jsxs(ye,{children:[l.isLoading&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(dr,{className:"h-4 w-4 animate-spin"}),"클레임을 불러오는 중"]}),u.jsxs("div",{className:"space-y-3",children:[p.map(_=>u.jsxs("article",{className:"rounded-md border p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-medium",children:Ct(_.subject)}),u.jsx(Xe,{variant:"secondary",children:_.predicate}),u.jsx("span",{className:"font-medium",children:Ct(_.object??_.object_value)}),u.jsx(Xe,{variant:"outline",children:tn(_.confidence)})]}),_.evidence_text&&u.jsxs("div",{className:"mt-3 rounded-md bg-yellow-50 px-3 py-2 text-sm text-yellow-950",children:[u.jsx(vS,{className:"mr-1 inline h-4 w-4"}),_.evidence_text]})]},_.id)),!l.isLoading&&p.length===0&&u.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"이 페이지 URL과 연결된 클레임이 없습니다."})]})]})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Candidate Payload"}),u.jsx(Qe,{children:"추출기가 반환한 후보 원본 일부"})]}),u.jsx(ye,{children:u.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-secondary/30 p-3 text-xs",children:JSON.stringify(R2(m),null,2)})})]})]})]})]})}function Nd({label:t,value:e}){return u.jsxs("div",{className:"rounded-md border bg-background px-3 py-2",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:e||"-"})]})}function My(t){return t.split(",").map(e=>e.trim()).filter(Boolean)}function L2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),a=Cx(i?.domain),l=$x(r),d=v2(r,100),f=j2(r),m=_2(r),[p,v]=$.useState(""),[w,y]=$.useState(""),[x,S]=$.useState(""),[_,b]=$.useState(""),[P,N]=$.useState(""),[F,L]=$.useState(""),k=$.useMemo(()=>new Set(a.data?.entity_types??[]),[a.data?.entity_types]),I=$.useMemo(()=>new Set((l.data?.entity_types??[]).map(Z=>Z.name.toLowerCase())),[l.data?.entity_types]),X=(a.data?.entity_types??[]).filter(Z=>!I.has(Z.toLowerCase())),re=async Z=>{if(Z.preventDefault(),!!p.trim())try{await f.mutateAsync({name:p.trim(),domain:i?.domain??"generic",description:w.trim()||null}),jt.success("Entity type saved"),v(""),y("")}catch(Oe){jt.error(Oe.message)}},de=async Z=>{if(Z.preventDefault(),!!x.trim())try{await m.mutateAsync({name:x.trim(),domain:i?.domain??"generic",description:F.trim()||null,allowed_subject_types:My(_),allowed_object_types:My(P),min_confidence:.8}),jt.success("Predicate rule saved"),S(""),b(""),N(""),L("")}catch(Oe){jt.error(Oe.message)}};return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/analysis/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Bv,{className:"h-6 w-6 text-primary"}),"Schema Designer"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," · 엔티티 타입과 Predicate 규칙 관리"]})]}),u.jsx(Ee,{variant:"outline",onClick:()=>l.refetch(),children:"Refresh"})]}),(l.isError||a.isError||d.isError)&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),l.error?.message??a.error?.message??d.error?.message]})}),u.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-4",children:[u.jsx(Al,{label:"Entity types",value:l.data?.entity_types.length}),u.jsx(Al,{label:"Predicates",value:l.data?.relation_types.length}),u.jsx(Al,{label:"Schema proposals",value:d.data?.length}),u.jsx(Al,{label:"Domain coverage",value:a.data?.entity_types.length?tn(1-X.length/a.data.entity_types.length):"-"})]}),u.jsxs("div",{className:"grid gap-6 xl:grid-cols-[380px_1fr]",children:[u.jsxs("div",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(oS,{className:"h-5 w-5"}),"Entity Type"]}),u.jsx(Qe,{children:"AI가 생성할 수 있는 개체 종류를 명시합니다."})]}),u.jsx(ye,{children:u.jsxs("form",{className:"space-y-3",onSubmit:re,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"entityName",children:"Name"}),u.jsx(xt,{id:"entityName",value:p,onChange:Z=>v(Z.target.value),placeholder:"Product"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"entityDescription",children:"Description"}),u.jsx(ho,{id:"entityDescription",value:w,onChange:Z=>y(Z.target.value),rows:2,placeholder:"상품 또는 서비스 개체"})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:f.isPending,children:[f.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(ri,{className:"h-4 w-4"}),"Save entity type"]})]})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(kf,{className:"h-5 w-5"}),"Predicate Rule"]}),u.jsx(Qe,{children:"주어/목적어 타입과 최소 신뢰도 기준을 정의합니다."})]}),u.jsx(ye,{children:u.jsxs("form",{className:"space-y-3",onSubmit:de,children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"relationName",children:"Predicate"}),u.jsx(xt,{id:"relationName",value:x,onChange:Z=>S(Z.target.value),placeholder:"hasBrand"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"subjectTypes",children:"Subject types"}),u.jsx(xt,{id:"subjectTypes",value:_,onChange:Z=>b(Z.target.value),placeholder:"Product, Perfume"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"objectTypes",children:"Object types"}),u.jsx(xt,{id:"objectTypes",value:P,onChange:Z=>N(Z.target.value),placeholder:"Brand"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Ye,{htmlFor:"relationDescription",children:"Description"}),u.jsx(ho,{id:"relationDescription",value:F,onChange:Z=>L(Z.target.value),rows:2,placeholder:"상품이 특정 브랜드에 속함"})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:m.isPending,children:[m.isPending?u.jsx(dr,{className:"h-4 w-4 animate-spin"}):u.jsx(ri,{className:"h-4 w-4"}),"Save predicate rule"]})]})})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Registered Entity Types"}),u.jsx(Qe,{children:"프로젝트 스키마 레지스트리에 저장된 타입"})]}),u.jsx(ye,{children:l.isLoading?u.jsx(pn,{className:"h-32"}):u.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:(l.data?.entity_types??[]).map(Z=>u.jsxs("article",{className:"rounded-md border p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"font-medium",children:Z.name}),u.jsx(Xe,{variant:k.has(Z.name)?"success":"outline",children:Z.domain??"generic"})]}),u.jsx("p",{className:"mt-2 line-clamp-2 text-sm text-muted-foreground",children:Z.description||Ct(Z.metadata)})]},Z.id))})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Predicate Rules"}),u.jsx(Qe,{children:"허용 관계와 타입 제약. 검증 단계에서 활용됩니다."})]}),u.jsx(ye,{children:u.jsxs("div",{className:"space-y-3",children:[(l.data?.relation_types??[]).map(Z=>u.jsxs("article",{className:"rounded-md border p-4",children:[u.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:Z.name}),u.jsx(Xe,{variant:"outline",children:Z.status??"active"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:tn(Z.confidence)})]}),u.jsxs("div",{className:"grid gap-3 text-sm md:grid-cols-2",children:[u.jsx(Fy,{label:"Subject",values:Z.allowed_subject_types}),u.jsx(Fy,{label:"Object",values:Z.allowed_object_types})]}),u.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:Z.description||Ct(Z.semantic_constraints)})]},Z.id)),l.data?.relation_types.length===0&&u.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"등록된 Predicate 규칙이 없습니다."})]})})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Schema Proposals"}),u.jsx(Qe,{children:"추출 중 발견된 스키마 보강 후보"})]}),u.jsx(ye,{children:u.jsxs("ul",{className:"divide-y",children:[(d.data??[]).map(Z=>u.jsxs("li",{className:"py-3 text-sm",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Xe,{variant:"secondary",children:Z.proposal_type}),u.jsx("span",{className:"font-medium",children:Z.name}),u.jsx(Xe,{variant:"outline",children:Z.status})]}),u.jsx("p",{className:"mt-1 text-muted-foreground",children:Z.reason||Z.evidence||"-"}),u.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:ai(Z.updated_at)})]},Z.id)),d.data?.length===0&&u.jsx("li",{className:"py-6 text-center text-sm text-muted-foreground",children:"현재 스키마 제안이 없습니다."})]})})]})]})]})]})}function Al({label:t,value:e}){return u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 text-2xl font-semibold",children:typeof e=="number"?e.toLocaleString():e??"-"})]})})}function Fy({label:t,values:e}){return u.jsxs("div",{children:[u.jsx("div",{className:"mb-1 text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"flex flex-wrap gap-1",children:e.length?e.map(r=>u.jsx(Xe,{variant:"outline",children:r},r)):u.jsx("span",{className:"text-xs text-muted-foreground",children:"Any"})})]})}const A2=new Set(["valid","ok","passed","clean"]),I2=new Set(["merged","active","synced","ok","ready"]),Dy=new Set(["value","keyword","name","item","product","brand","accord","note","unknown"]);function zx(t){switch(t){case"high":return"destructive";case"medium":return"warning";default:return"outline"}}function _r(t){return Ct(t).trim().toLowerCase().replace(/\s+/g," ")}function Ux(t){return Ct(t.object??t.object_value)}function M2(t){const e=t.value_type;return typeof e=="string"&&e.trim()?e.trim():void 0}function F2(t){return`${t.subject??""}|${t.predicate}|${Ux(t)}`.toLowerCase()}function Il(t,e){if(!e)return!1;const r=e.toLowerCase();return t.some(i=>i.toLowerCase()===r)}function js(t){return t.length?t.join(", "):"-"}function D2(t,e){if(t)for(const r of e){const i=t[r];if(typeof i=="number"&&Number.isFinite(i))return i}}function $2(t){return D2(t?.confidence_rules,["min_confidence","minimum_confidence","minConfidence"])??.7}function z2(t){if(!t)return;const e=new Date(t).getTime();if(Number.isFinite(e))return(Date.now()-e)/864e5}function U2(t,e,r){const i=[],a=new Map,l=new Map,d=new Set,f=new Map,m=new Map;r.forEach(p=>{m.set(p.name.toLowerCase(),p)});for(const p of e){const v=_r(p.name);if(!v)continue;const w=l.get(v)??[];w.push(p),l.set(v,w),f.set(v,p.type)}for(const p of t){const v=Ux(p),w=`${Ct(p.subject)} ${p.predicate} ${v}`,y=m.get(p.predicate.toLowerCase()),x=p.subject_type??f.get(_r(p.subject)),S=p.object_type??f.get(_r(v))??M2(p),_=p.evidence_text?.trim()??"",b=p.page_url?.trim()??"";if(y||i.push({id:`unknown-predicate-${p.id}`,type:"unknown_predicate",severity:"medium",title:"Predicate is not registered",detail:`${p.predicate} is missing from the ontology registry.`,target:w}),!b||!_?i.push({id:`source-${p.id}`,type:"missing_source",severity:"high",title:"Source or evidence is missing",detail:"Every claim should carry both page URL and evidence text.",target:w}):_.length<24&&i.push({id:`thin-evidence-${p.id}`,type:"thin_evidence",severity:"medium",title:"Evidence snippet is too thin",detail:"The supporting text is short enough to be ambiguous.",target:w}),_&&p.subject&&v){const X=_.toLowerCase(),re=_r(p.subject),de=_r(v),Z=re.length>2&&X.includes(re),Oe=de.length>2&&X.includes(de);!Z&&!Oe&&i.push({id:`evidence-alignment-${p.id}`,type:"weak_evidence_alignment",severity:"low",title:"Evidence does not mention the relation terms",detail:"The snippet may support the page generally, but not this exact relation.",target:w})}const P=$2(y);typeof p.confidence!="number"?i.push({id:`confidence-missing-${p.id}`,type:"missing_confidence",severity:"medium",title:"Confidence is missing",detail:"Claims need confidence for review prioritization.",target:w}):p.confidence180&&i.push({id:`stale-${p.id}`,type:"stale_claim",severity:"medium",title:"Claim is stale",detail:`Last observed ${Math.round(N)} days ago.`,target:w});const F=_r(p.subject),L=_r(v);(Dy.has(F)||F.length<=1)&&i.push({id:`generic-subject-${p.id}`,type:"generic_subject",severity:"medium",title:"Subject label is too generic",detail:"Generic entity labels should be normalized before graph commit.",target:w}),(Dy.has(L)||L.length<=1)&&i.push({id:`generic-object-${p.id}`,type:"generic_object",severity:"low",title:"Object label is too generic",detail:"The object value may need a more specific entity or literal label.",target:w});const k=F2(p),I=a.get(k);I?i.push({id:`duplicate-claim-${p.id}`,type:"duplicate_claim",severity:I.status!==p.status?"medium":"low",title:"Duplicate relation claim",detail:`Claim #${I.id} already has the same subject, predicate, and object.`,target:w}):a.set(k,p),p.subject&&d.add(_r(p.subject)),v&&d.add(_r(v))}for(const p of l.values())p.length>1&&i.push({id:`duplicate-entity-${p[0].id}`,type:"duplicate_entity",severity:"medium",title:"Duplicate entity candidate",detail:`${p.length} entities share the same normalized name.`,target:p[0].name});for(const p of e){const v=_r(p.name);d.has(v)||i.push({id:`isolated-${p.id}`,type:"isolated_entity",severity:"low",title:"Entity is isolated",detail:"No relation currently connects to this entity in the loaded claim set.",target:`[${p.type}] ${p.name}`}),["entity","unknown","unknown_entity"].includes(p.type.toLowerCase())&&i.push({id:`generic-entity-type-${p.id}`,type:"generic_entity_type",severity:"low",title:"Entity type is generic",detail:"The entity should be assigned to a domain-specific type.",target:`[${p.type}] ${p.name}`})}return i}function V2(t){const e=new Map;return t.forEach(r=>{e.set(r.type,(e.get(r.type)??0)+1)}),Array.from(e.entries()).map(([r,i])=>({type:r,count:i})).sort((r,i)=>i.count-r.count)}function B2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),a=hu(r,{includeCandidates:!0,limit:300}),l=Dx(r,void 0),d=$x(r),f=Kf(r),m=$.useMemo(()=>U2(a.data??[],l.data??[],d.data?.relation_types??[]),[a.data,l.data,d.data?.relation_types]),p=m.filter(k=>k.severity==="high").length,v=m.filter(k=>k.severity==="medium").length,w=m.filter(k=>k.severity==="low").length,y=Math.max(0,Math.round(100-p*10-v*5-w*1.5)),x=V2(m),S=new Set((d.data?.relation_types??[]).map(k=>k.name)),_=Array.from(new Set((a.data??[]).map(k=>k.predicate).filter(k=>!S.has(k)))),b=(a.data??[]).filter(k=>["validated_claim","rejected"].includes(k.status??"")).length,P=a.data?.length?b/a.data.length:0,N=m.filter(k=>["unknown_predicate","subject_type_mismatch","object_type_mismatch","page_type_mismatch","source_zone_mismatch","schema_violation"].includes(k.type)).length,F=m.filter(k=>["missing_source","thin_evidence","weak_evidence_alignment"].includes(k.type)).length,L=m.slice(0,250);return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/review/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Hd,{className:"h-6 w-6 text-primary"}),"Quality Inspector"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," schema, evidence, duplicate, and graph readiness checks."]})]}),u.jsx(Ee,{variant:"outline",onClick:()=>{a.refetch(),l.refetch(),d.refetch(),f.refetch()},children:"Refresh"})]}),(a.isError||l.isError||d.isError)&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),a.error?.message??l.error?.message??d.error?.message]})}),u.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-5",children:[u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Quality score"}),u.jsx("div",{className:"mt-1 text-3xl font-semibold",children:y}),u.jsx(Ji,{value:y,className:"mt-3"})]})}),u.jsx(Ml,{label:"High",value:p,tone:"high"}),u.jsx(Ml,{label:"Medium",value:v,tone:"medium"}),u.jsx(Ml,{label:"Low",value:w,tone:"low"}),u.jsx(Ml,{label:"Review rate",value:tn(P)})]}),u.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_360px]",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsx(Ve,{children:"Validation Issues"}),m.length>L.length&&u.jsxs(Xe,{variant:"outline",children:["Showing ",L.length," of ",m.length]})]}),u.jsx(Qe,{children:"Rule-based warnings generated from claim evidence and ontology registry constraints."})]}),u.jsxs(ye,{children:[(a.isLoading||l.isLoading||d.isLoading)&&u.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((k,I)=>u.jsx(pn,{className:"h-20"},I))}),!a.isLoading&&!l.isLoading&&!d.isLoading&&m.length===0&&u.jsxs("div",{className:"flex flex-col items-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[u.jsx(Hd,{className:"h-10 w-10 opacity-50"}),"No quality warnings were found in the loaded scope."]}),u.jsx("div",{className:"space-y-3",children:L.map(k=>u.jsxs("article",{className:"rounded-md border p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Xe,{variant:zx(k.severity),children:k.severity}),u.jsx(Xe,{variant:"outline",children:k.type}),u.jsx("span",{className:"font-medium",children:k.title})]}),u.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:k.detail}),u.jsx("div",{className:"mt-2 rounded-md bg-secondary/30 px-3 py-2 text-sm",children:k.target})]},k.id))})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(kS,{className:"h-5 w-5"}),"Schema Coverage"]}),u.jsx(Qe,{children:"Predicate and type coverage against the ontology registry."})]}),u.jsxs(ye,{className:"space-y-3",children:[u.jsx(Mi,{label:"Relation rules",value:S.size}),u.jsx(Mi,{label:"Schema warnings",value:N}),u.jsx(Mi,{label:"Evidence warnings",value:F}),u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{children:"Unknown predicates"}),u.jsx(Xe,{variant:_.length?"warning":"success",children:_.length})]}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[_.map(k=>u.jsx(Xe,{variant:"outline",children:k},k)),_.length===0&&u.jsx("span",{className:"text-sm text-muted-foreground",children:"All loaded predicates are registered."})]})]})]}),u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(jS,{className:"h-5 w-5"}),"Graph Readiness"]}),u.jsx(Qe,{children:"Build output ready for graph and exports."})]}),u.jsxs(ye,{className:"space-y-3",children:[u.jsx(Mi,{label:"Collected pages",value:f.data?.stages.find(k=>k.key==="crawled")?.count??0}),u.jsx(Mi,{label:"Approved claims",value:f.data?.stages.find(k=>k.key==="validated")?.count??0}),u.jsx(Mi,{label:"Graph triples",value:f.data?.stages.find(k=>k.key==="graph")?.count??0})]})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(iS,{className:"h-5 w-5"}),"Issue Mix"]})}),u.jsx(ye,{children:u.jsxs("ul",{className:"space-y-2 text-sm",children:[x.slice(0,8).map(k=>u.jsxs("li",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[u.jsx("span",{children:k.type}),u.jsx("span",{className:"font-medium",children:k.count})]},k.type)),x.length===0&&u.jsx("li",{className:"py-4 text-center text-muted-foreground",children:"No issues in the loaded scope."})]})})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsx(Ve,{children:"Recommended Actions"})}),u.jsx(ye,{children:u.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[p>0&&u.jsx("li",{children:"Resolve missing evidence, type violations, and conflicts before export."}),v>0&&u.jsx("li",{children:"Review stale claims, thin evidence, duplicate relations, and missing rule fields."}),_.length>0&&u.jsx("li",{children:"Add missing predicate rules in Schema Designer."}),y>=90&&u.jsx("li",{children:"The ontology is ready for graph inspection and Export/API handoff."})]})})]})]})]})]})}function Ml({label:t,value:e,tone:r}){return u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-2xl font-semibold",children:e}),r&&u.jsx(Xe,{variant:zx(r),children:r})]})]})})}function Mi({label:t,value:e}){return u.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:t}),u.jsx("span",{className:"font-medium",children:e.toLocaleString()})]})}const $y=["#2563eb","#059669","#d97706","#7c3aed","#db2777","#0891b2","#4b5563","#dc2626"];function mf(t,e){const r=Math.max(e.indexOf(t),0);return $y[r%$y.length]}function q2(t,e,r){const i=r.search.trim().toLowerCase(),a=Array.from(new Set(t.map(S=>S.type||"Entity").concat("Literal"))).sort(),l=new Map;t.forEach(S=>{const _=S.type||"Entity";l.set(String(S.id),{id:String(S.id),name:S.name,type:_,x:0,y:0,radius:18,color:mf(_,a),source:"entity",raw:S})});const d=[];e.forEach(S=>{const _=S.confidence??0;if(_r.entityType&&S.type!==r.entityType?!1:i?S.name.toLowerCase().includes(i)||S.type.toLowerCase().includes(i):!0);const m=new Set(f.map(S=>S.id)),p=d.filter(S=>m.has(S.source)&&m.has(S.target)),v=new Set;p.forEach(S=>{v.add(S.source),v.add(S.target)}),(r.predicate||r.minConfidence>0||i)&&(f=f.filter(S=>v.has(S.id)));const w=430,y=300,x=Math.max(160,Math.min(260,f.length*13));return f.forEach((S,_)=>{const b=Math.PI*2*_/Math.max(f.length,1);S.x=w+Math.cos(b)*x,S.y=y+Math.sin(b)*x}),{nodes:f,edges:p,types:a}}function H2(t,e){const r=e.find(a=>a.id===t.source),i=e.find(a=>a.id===t.target);return{source:r,target:i}}function W2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),[a,l]=$.useState("validated_claim"),[d,f]=$.useState(!0),[m,p]=$.useState(""),[v,w]=$.useState(""),[y,x]=$.useState(""),[S,_]=$.useState(0),[b,P]=$.useState(null),N=x2(r,{includeCandidates:d&&a==="validated_claim",limit:300,status:d&&a==="validated_claim"?void 0:a}),F=$.useMemo(()=>Array.from(new Set((N.data?.edges??[]).map(I=>I.predicate))).sort(),[N.data?.edges]),L=$.useMemo(()=>q2(N.data?.nodes??[],N.data?.edges??[],{search:m,predicate:v,entityType:y,minConfidence:S}),[y,N.data?.edges,N.data?.nodes,S,v,m]),k=L.edges.length?L.edges.reduce((I,X)=>I+X.confidence,0)/L.edges.length:0;return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/quality/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Cf,{className:"h-6 w-6 text-primary"}),"Graph View"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," relation graph, candidates, and edge evidence."]})]}),u.jsxs(Ee,{variant:"outline",onClick:()=>N.refetch(),children:[u.jsx(zv,{className:"h-4 w-4"}),"Refresh"]})]}),N.isError&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),N.error.message]})}),u.jsxs("div",{className:"mb-4 grid gap-3 xl:grid-cols-[1fr_180px_180px_180px_220px]",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Vv,{className:"pointer-events-none absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),u.jsx(xt,{value:m,onChange:I=>p(I.target.value),className:"pl-9",placeholder:"Search node or type"})]}),u.jsxs(En,{value:y,onChange:I=>x(I.target.value),children:[u.jsx("option",{value:"",children:"All types"}),L.types.map(I=>u.jsx("option",{value:I,children:I},I))]}),u.jsxs(En,{value:v,onChange:I=>w(I.target.value),children:[u.jsx("option",{value:"",children:"All predicates"}),F.map(I=>u.jsx("option",{value:I,children:I},I))]}),u.jsxs(En,{value:a,onChange:I=>l(I.target.value),children:[u.jsx("option",{value:"validated_claim",children:"Validated"}),u.jsx("option",{value:"candidate_claim",children:"Candidate"}),u.jsx("option",{value:"rule_candidate",children:"Rule candidate"}),u.jsx("option",{value:"active",children:"Active"}),u.jsx("option",{value:"all",children:"All statuses"})]}),u.jsxs("label",{className:"flex items-center gap-2 rounded-md border px-3 text-sm",children:[u.jsx("input",{type:"checkbox",checked:d,disabled:a!=="validated_claim",onChange:I=>f(I.target.checked)}),"Blend candidates"]})]}),u.jsxs("div",{className:"mb-6 rounded-md border px-4 py-3",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between text-sm",children:[u.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[u.jsx(NS,{className:"h-4 w-4"}),"Minimum confidence"]}),u.jsx("span",{children:tn(S)})]}),u.jsx("input",{type:"range",min:0,max:1,step:.05,value:S,onChange:I=>_(Number(I.target.value)),className:"w-full"})]}),u.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1fr_360px]",children:[u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:"Ontology Network"}),u.jsxs(Qe,{children:[L.nodes.length," nodes / ",L.edges.length," edges shown"]})]}),u.jsx("div",{className:"flex flex-wrap gap-2",children:L.types.slice(0,8).map(I=>u.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[u.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:mf(I,L.types)}}),I]},I))})]})}),u.jsx(ye,{children:N.isLoading?u.jsx(pn,{className:"h-[640px]"}):L.nodes.length===0?u.jsxs("div",{className:"flex h-[500px] flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground",children:[u.jsx(kf,{className:"h-12 w-12 opacity-50"}),"No graph is available for the current filters."]}):u.jsxs("svg",{viewBox:"0 0 860 600",className:"h-[640px] w-full rounded-md border bg-secondary/20",role:"img","aria-label":"Ontology graph",children:[u.jsx("defs",{children:u.jsx("marker",{id:"arrow",markerWidth:"10",markerHeight:"10",refX:"10",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:u.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#64748b"})})}),L.edges.map(I=>{const{source:X,target:re}=H2(I,L.nodes);if(!X||!re)return null;const de=(X.x+re.x)/2,Z=(X.y+re.y)/2;return u.jsxs("g",{className:"cursor-pointer",onClick:()=>P(I),children:[u.jsx("line",{x1:X.x,y1:X.y,x2:re.x,y2:re.y,stroke:"#64748b",strokeWidth:1+I.confidence*3,strokeOpacity:"0.65",markerEnd:"url(#arrow)"}),u.jsx("text",{x:de,y:Z,textAnchor:"middle",className:"fill-slate-600 text-[10px]",children:I.predicate})]},I.id)}),L.nodes.map(I=>u.jsxs("g",{className:"cursor-pointer",onClick:()=>P(I),children:[u.jsx("circle",{cx:I.x,cy:I.y,r:I.radius,fill:I.color,stroke:b&&"id"in b&&b.id===I.id?"#111827":"#ffffff",strokeWidth:"2"}),u.jsx("text",{x:I.x,y:I.y+I.radius+14,textAnchor:"middle",className:"fill-slate-800 text-[11px] font-medium",children:I.name.length>24?`${I.name.slice(0,24)}...`:I.name})]},I.id))]})})]}),u.jsxs("aside",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsx(Ve,{children:"Selection"}),u.jsx(Qe,{children:"Click a node or edge to inspect it."})]}),u.jsxs(ye,{children:[!b&&u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Nothing selected."}),b&&"predicate"in b&&u.jsxs("div",{className:"space-y-3",children:[u.jsx(Xe,{variant:"secondary",children:b.predicate}),u.jsx(Sr,{label:"Claim",value:`#${b.id}`}),u.jsx(Sr,{label:"Status",value:b.raw.status}),u.jsx(Sr,{label:"Confidence",value:tn(b.confidence)}),u.jsx(Sr,{label:"Object",value:b.raw.object?.name??b.raw.target_value}),u.jsx(Sr,{label:"Last seen",value:ai(b.raw.last_seen_at)}),u.jsx(Sr,{label:"Metadata",value:Ct(b.raw.metadata)})]}),b&&!("predicate"in b)&&u.jsxs("div",{className:"space-y-3",children:[u.jsx(Xe,{variant:"outline",children:b.type}),u.jsx(Sr,{label:"Name",value:b.name}),u.jsx(Sr,{label:"Source",value:b.source}),u.jsx(Sr,{label:"Canonical",value:b.raw?.canonical_name}),u.jsx(Sr,{label:"Metadata",value:Ct(b.raw?.metadata)})]})]})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsx(Ve,{children:"Graph Health"})}),u.jsxs(ye,{className:"space-y-3",children:[u.jsx(Cd,{label:"Visible nodes",value:L.nodes.length}),u.jsx(Cd,{label:"Visible edges",value:L.edges.length}),u.jsx(Cd,{label:"Avg confidence",value:L.edges.length?tn(k):"-"}),u.jsx(Ji,{value:k*100})]})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(uS,{className:"h-5 w-5"}),"Predicate Counts"]})}),u.jsx(ye,{children:u.jsxs("ul",{className:"space-y-2 text-sm",children:[F.map(I=>{const X=(N.data?.edges??[]).filter(re=>re.predicate===I).length;return u.jsxs("li",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[u.jsx("span",{children:I}),u.jsx("span",{className:"font-medium",children:X})]},I)}),F.length===0&&u.jsx("li",{className:"py-4 text-center text-muted-foreground",children:"No predicates found."})]})})]})]})]})]})}function Sr({label:t,value:e}){return u.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:t}),u.jsx("div",{className:"mt-1 break-words font-medium",children:Ct(e)})]})}function Cd({label:t,value:e}){return u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:t}),u.jsx("span",{className:"font-medium",children:typeof e=="number"?e.toLocaleString():e})]})}const zy=[{value:"validated_claim",label:"Validated claims"},{value:"active",label:"Active claims"},{value:"candidate_claim",label:"Candidate claims"},{value:"rule_candidate",label:"Rule candidates"},{value:"rejected",label:"Rejected claims"},{value:"all",label:"All statuses"}];function Ha(t,e){return Ct(t[e])}function K2(){const t=mn(),{projectId:e}=fr(),r=e??"",{data:i}=hr(r),[a,l]=$.useState("validated_claim"),[d,f]=$.useState(!0),[m,p]=$.useState(1e3),[v,w]=$.useState(null),y=w2(r,{status:a,includeEvidence:d,limit:m}),x=$.useMemo(()=>({json:Qn.exportUrl(r,"json",a,d,m),csv:Qn.exportUrl(r,"csv",a,d,m),turtle:Qn.exportUrl(r,"turtle",a,d,m)}),[d,m,r,a]),_=`${typeof window<"u"&&window.location?.origin?window.location.origin:""}${x.json}`,b=`curl -L "${_}"`,P=`const response = await fetch("${x.json}"); const ontology = await response.json();`,N=y.data?.claims.slice(0,8)??[],F=y.data?.claims.length?y.data.claims.reduce((k,I)=>{const X=I.confidence;return k+(typeof X=="number"?X:0)},0)/y.data.claims.length:0;async function L(k,I){try{await navigator.clipboard.writeText(k),w(I),window.setTimeout(()=>w(null),1600)}catch{w("failed")}}return u.jsxs("div",{className:"mx-auto max-w-7xl px-6 py-8",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(Ee,{variant:"ghost",size:"icon",onClick:()=>t(`/graph/${r}`),"aria-label":"Back",children:u.jsx(Zn,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight",children:[u.jsx(Sf,{className:"h-6 w-6 text-primary"}),"Export / API Center"]}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:[i?.name??r," exports, endpoint settings, and integration snippets."]})]}),u.jsxs(Ee,{variant:"outline",onClick:()=>y.refetch(),children:[u.jsx(zv,{className:"h-4 w-4"}),"Refresh"]})]}),y.isError&&u.jsx(ge,{className:"mb-6 border-destructive",children:u.jsxs(ye,{className:"flex items-center gap-2 py-4 text-sm text-destructive",children:[u.jsx(fn,{className:"h-4 w-4"}),y.error.message]})}),u.jsxs("div",{className:"mb-6 grid gap-3 lg:grid-cols-[220px_180px_1fr_180px]",children:[u.jsx(En,{value:a,onChange:k=>l(k.target.value),children:zy.map(k=>u.jsx("option",{value:k.value,children:k.label},k.value))}),u.jsx(xt,{type:"number",min:1,max:5e3,value:m,onChange:k=>p(Math.max(1,Math.min(5e3,Number(k.target.value)||1))),"aria-label":"Export row limit"}),u.jsxs("label",{className:"flex items-center gap-2 rounded-md border px-3 text-sm",children:[u.jsx("input",{type:"checkbox",checked:d,onChange:k=>f(k.target.checked)}),"Include evidence text"]}),u.jsxs(Xe,{variant:"outline",className:"justify-center py-2",children:[y.data?.count??0," rows"]})]}),u.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-3",children:[u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Export rows"}),u.jsx("div",{className:"mt-1 text-3xl font-semibold",children:(y.data?.count??0).toLocaleString()})]})}),u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Status scope"}),u.jsx("div",{className:"mt-1 text-lg font-semibold",children:zy.find(k=>k.value===a)?.label})]})}),u.jsx(ge,{children:u.jsxs(ye,{className:"py-4",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg confidence"}),u.jsx("div",{className:"mt-1 text-3xl font-semibold",children:tn(F)})]})})]}),u.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1fr_380px]",children:[u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx(Ve,{children:"Export Preview"}),u.jsx(Qe,{children:"First rows from the JSON export endpoint."})]}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(Ed,{href:x.json,icon:Wd,label:"JSON"}),u.jsx(Ed,{href:x.csv,icon:pS,label:"CSV"}),u.jsx(Ed,{href:x.turtle,icon:Fv,label:"Turtle"})]})]})}),u.jsx(ye,{children:y.isLoading?u.jsx("div",{className:"space-y-3",children:Array.from({length:5}).map((k,I)=>u.jsx(pn,{className:"h-16"},I))}):N.length===0?u.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"No export rows match the current settings."}):u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left text-sm",children:[u.jsx("thead",{className:"border-b text-xs text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-2 pr-3",children:"Claim"}),u.jsx("th",{className:"py-2 pr-3",children:"Subject"}),u.jsx("th",{className:"py-2 pr-3",children:"Predicate"}),u.jsx("th",{className:"py-2 pr-3",children:"Object"}),u.jsx("th",{className:"py-2 pr-3",children:"Confidence"}),u.jsx("th",{className:"py-2 pr-3",children:"Last seen"})]})}),u.jsx("tbody",{className:"divide-y",children:N.map((k,I)=>u.jsxs("tr",{children:[u.jsxs("td",{className:"py-3 pr-3 font-medium",children:["#",Ha(k,"claim_id")]}),u.jsx("td",{className:"max-w-[180px] truncate py-3 pr-3",children:Ha(k,"subject")}),u.jsx("td",{className:"py-3 pr-3",children:u.jsx(Xe,{variant:"secondary",children:Ha(k,"predicate")})}),u.jsx("td",{className:"max-w-[220px] truncate py-3 pr-3",children:Ha(k,"object")}),u.jsx("td",{className:"py-3 pr-3",children:typeof k.confidence=="number"?tn(k.confidence):"-"}),u.jsx("td",{className:"py-3 pr-3",children:ai(typeof k.last_seen_at=="string"?k.last_seen_at:void 0)})]},`${Ha(k,"claim_id")}-${I}`))})]})})})]}),u.jsxs("aside",{className:"space-y-6",children:[u.jsxs(ge,{children:[u.jsxs(Ue,{children:[u.jsxs(Ve,{className:"flex items-center gap-2",children:[u.jsx(lS,{className:"h-5 w-5"}),"API Endpoint"]}),u.jsx(Qe,{children:"Same settings as the preview."})]}),u.jsxs(ye,{className:"space-y-3",children:[u.jsx(Vx,{value:_}),u.jsxs(Ee,{variant:"outline",className:"w-full",onClick:()=>L(_,"endpoint"),children:[u.jsx(Iv,{className:"h-4 w-4"}),v==="endpoint"?"Copied":"Copy endpoint"]})]})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsx(Ve,{children:"Integration Snippets"})}),u.jsxs(ye,{className:"space-y-4",children:[u.jsx(Uy,{title:"cURL",value:b,copied:v==="curl",onCopy:()=>L(b,"curl")}),u.jsx(Uy,{title:"JavaScript",value:P,copied:v==="fetch",onCopy:()=>L(P,"fetch")})]})]}),u.jsxs(ge,{children:[u.jsx(Ue,{children:u.jsx(Ve,{children:"Formats"})}),u.jsxs(ye,{className:"space-y-2 text-sm",children:[u.jsx(Pd,{label:"JSON",detail:"API-first claim objects with evidence."}),u.jsx(Pd,{label:"CSV",detail:"Spreadsheet-friendly rows for review."}),u.jsx(Pd,{label:"Turtle",detail:"RDF triples for semantic graph tools."})]})]})]})]})]})}function Ed({href:t,icon:e,label:r}){return u.jsxs("a",{href:t,className:_t(lx({variant:"outline",size:"sm"})),children:[u.jsx(e,{className:"h-4 w-4"}),r]})}function Vx({value:t}){return u.jsx("pre",{className:"max-h-40 overflow-auto rounded-md bg-secondary/40 p-3 text-xs",children:u.jsx("code",{children:t})})}function Uy({title:t,value:e,copied:r,onCopy:i}){return u.jsxs("div",{className:"rounded-md border p-3",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-sm font-medium",children:t}),u.jsxs(Ee,{variant:"ghost",size:"sm",onClick:i,children:[u.jsx(Iv,{className:"h-4 w-4"}),r?"Copied":"Copy"]})]}),u.jsx(Vx,{value:e})]})}function Pd({label:t,detail:e}){return u.jsxs("div",{className:"rounded-md border px-3 py-2",children:[u.jsx("div",{className:"font-medium",children:t}),u.jsx("div",{className:"text-xs text-muted-foreground",children:e})]})}function Q2(){return u.jsx(fb,{children:u.jsxs(ln,{element:u.jsx(TN,{}),children:[u.jsx(ln,{path:"/",element:u.jsx(k2,{})}),u.jsx(ln,{path:"/onboard",element:u.jsx(hC,{})}),u.jsx(ln,{path:"/sources/:projectId",element:u.jsx(xC,{})}),u.jsx(ln,{path:"/crawl/:projectId",element:u.jsx(OC,{})}),u.jsx(ln,{path:"/pipeline/:projectId",element:u.jsx(O2,{})}),u.jsx(ln,{path:"/analysis/:projectId",element:u.jsx(T2,{})}),u.jsx(ln,{path:"/schema/:projectId",element:u.jsx(L2,{})}),u.jsx(ln,{path:"/research/:projectId",element:u.jsx(DC,{})}),u.jsx(ln,{path:"/editor/:projectId",element:u.jsx(t2,{})}),u.jsx(ln,{path:"/review/:projectId",element:u.jsx(r2,{})}),u.jsx(ln,{path:"/quality/:projectId",element:u.jsx(B2,{})}),u.jsx(ln,{path:"/graph/:projectId",element:u.jsx(W2,{})}),u.jsx(ln,{path:"/export/:projectId",element:u.jsx(K2,{})})]})})}const Bx={name:"",domain:"",format:null,fileName:null,rawText:""},Z2={draft:Bx,isDirty:!1},G2=Af({name:"ontology",initialState:Z2,reducers:{updateDraft:(t,e)=>{t.draft={...t.draft,...e.payload},t.isDirty=!0},resetDraft:t=>{t.draft=Bx,t.isDirty=!1},markClean:t=>{t.isDirty=!1}}}),J2=G2.reducer,Y2={activeJobId:null,expandedStep:null,showLogs:!0,autoScrollLogs:!0},X2=Af({name:"crawl",initialState:Y2,reducers:{setActiveJob:(t,e)=>{t.activeJobId=e.payload},expandStep:(t,e)=>{t.expandedStep=e.payload},toggleLogs:t=>{t.showLogs=!t.showLogs},setAutoScroll:(t,e)=>{t.autoScrollLogs=e.payload}}}),eE=X2.reducer,tE=ak({reducer:{ontology:J2,crawl:eE,ui:vk}}),nE=new Xb({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:1}}});W1.createRoot(document.getElementById("root")).render(u.jsx(ne.StrictMode,{children:u.jsx(gw,{store:tE,children:u.jsx(ej,{client:nE,children:u.jsxs(wb,{basename:"/static/",children:[u.jsx(Q2,{}),u.jsx(Dj,{position:"top-right"})]})})})})); //# sourceMappingURL=index-B9qLr-xp.js.map