(function(de,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(de=typeof globalThis<"u"?globalThis:de||self,de.ReactProductSliderUserTarget=oe())})(this,function(){"use strict";var Dm=Object.defineProperty;var lf=de=>{throw TypeError(de)};var Om=(de,oe,je)=>oe in de?Dm(de,oe,{enumerable:!0,configurable:!0,writable:!0,value:je}):de[oe]=je;var ft=(de,oe,je)=>Om(de,typeof oe!="symbol"?oe+"":oe,je),vu=(de,oe,je)=>oe.has(de)||lf("Cannot "+je);var m=(de,oe,je)=>(vu(de,oe,"read from private field"),je?je.call(de):oe.get(de)),ne=(de,oe,je)=>oe.has(de)?lf("Cannot add the same private member more than once"):oe instanceof WeakSet?oe.add(de):oe.set(de,je),V=(de,oe,je,re)=>(vu(de,oe,"write to private field"),re?re.call(de,je):oe.set(de,je),je),ce=(de,oe,je)=>(vu(de,oe,"access private method"),je);var bs=(de,oe,je,re)=>({set _(Ii){V(de,oe,Ii,je)},get _(){return m(de,oe,re)}});var On,on,sr,na,lr,un,or,ra,zn,ia,ur,ar,Ct,Ke,Kr,Fn,Ot,ln,sa,Qt,la,Ht,Je,In,Bt,Dn,oa,mt,Gr,ua,Le,an,cn,cr,dr,dn,fr,hr,aa,st,ue,Yr,be,Mn,pr,Vt,Xr,mr,yr,An,Un,fn,vr,ye,Fi,gu,wu,Su,ku,Cu,_u,Pu,of,ca,Cl;var de={exports:{}},oe={},je={exports:{}},re={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ii;function uf(){if(Ii)return re;Ii=1;var u=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),v=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),C=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),x=Symbol.iterator;function E(y){return y===null||typeof y!="object"?null:(y=x&&y[x]||y["@@iterator"],typeof y=="function"?y:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,U={};function H(y,R,ie){this.props=y,this.context=R,this.refs=U,this.updater=ie||O}H.prototype.isReactComponent={},H.prototype.setState=function(y,R){if(typeof y!="object"&&typeof y!="function"&&y!=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,y,R,"setState")},H.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function G(){}G.prototype=H.prototype;function Y(y,R,ie){this.props=y,this.context=R,this.refs=U,this.updater=ie||O}var b=Y.prototype=new G;b.constructor=Y,Q(b,H.prototype),b.isPureReactComponent=!0;var K=Array.isArray,te=Object.prototype.hasOwnProperty,ae={current:null},ve={key:!0,ref:!0,__self:!0,__source:!0};function J(y,R,ie){var se,he={},pe=null,Se=null;if(R!=null)for(se in R.ref!==void 0&&(Se=R.ref),R.key!==void 0&&(pe=""+R.key),R)te.call(R,se)&&!ve.hasOwnProperty(se)&&(he[se]=R[se]);var ge=arguments.length-2;if(ge===1)he.children=ie;else if(1>>1,R=F[y];if(0>>1;yf(he,M))pef(Se,he)?(F[y]=Se,F[pe]=M,y=pe):(F[y]=he,F[se]=M,y=se);else if(pef(Se,M))F[y]=Se,F[pe]=M,y=pe;else break e}}return X}function f(F,X){var M=F.sortIndex-X.sortIndex;return M!==0?M:F.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var w=performance;u.unstable_now=function(){return w.now()}}else{var v=Date,T=v.now();u.unstable_now=function(){return v.now()-T}}var L=[],C=[],_=1,x=null,E=3,O=!1,Q=!1,U=!1,H=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(F){for(var X=o(C);X!==null;){if(X.callback===null)c(C);else if(X.startTime<=F)c(C),X.sortIndex=X.expirationTime,s(L,X);else break;X=o(C)}}function K(F){if(U=!1,b(F),!Q)if(o(L)!==null)Q=!0,tt(te);else{var X=o(C);X!==null&&Pe(K,X.startTime-F)}}function te(F,X){Q=!1,U&&(U=!1,G(J),J=-1),O=!0;var M=E;try{for(b(X),x=o(L);x!==null&&(!(x.expirationTime>X)||F&&!qt());){var y=x.callback;if(typeof y=="function"){x.callback=null,E=x.priorityLevel;var R=y(x.expirationTime<=X);X=u.unstable_now(),typeof R=="function"?x.callback=R:x===o(L)&&c(L),b(X)}else c(L);x=o(L)}if(x!==null)var ie=!0;else{var se=o(C);se!==null&&Pe(K,se.startTime-X),ie=!1}return ie}finally{x=null,E=M,O=!1}}var ae=!1,ve=null,J=-1,Ne=5,lt=-1;function qt(){return!(u.unstable_now()-ltF||125y?(F.sortIndex=M,s(C,F),o(L)===null&&F===o(C)&&(U?(G(J),J=-1):U=!0,Pe(K,M-y))):(F.sortIndex=R,s(L,F),Q||O||(Q=!0,tt(te))),F},u.unstable_shouldYield=qt,u.unstable_wrapCallback=function(F){var X=E;return function(){var M=E;E=X;try{return F.apply(this,arguments)}finally{E=M}}}}(nl)),nl}var Tu;function df(){return Tu||(Tu=1,tl.exports=cf()),tl.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ru;function ff(){if(Ru)return it;Ru=1;var u=le,s=df();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L=Object.prototype.hasOwnProperty,C=/^[: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]*$/,_={},x={};function E(e){return L.call(x,e)?!0:L.call(_,e)?!1:C.test(e)?x[e]=!0:(_[e]=!0,!1)}function O(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Q(e,t,n,r){if(t===null||typeof t>"u"||O(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function U(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var H={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){H[e]=new U(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];H[t]=new U(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){H[e]=new U(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){H[e]=new U(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){H[e]=new U(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){H[e]=new U(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){H[e]=new U(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){H[e]=new U(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){H[e]=new U(e,5,!1,e.toLowerCase(),null,!1,!1)});var G=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(G,Y);H[t]=new U(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(G,Y);H[t]=new U(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(G,Y);H[t]=new U(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){H[e]=new U(e,1,!1,e.toLowerCase(),null,!1,!1)}),H.xlinkHref=new U("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){H[e]=new U(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=H.hasOwnProperty(t)?H[t]:null;(i!==null?i.type!==0:r||!(2d||i[a]!==l[d]){var h=` `+i[a].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=a&&0<=d);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function he(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ve:return"Fragment";case ae:return"Portal";case Ne:return"Profiler";case J:return"StrictMode";case et:return"Suspense";case Be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qt:return(e.displayName||"Context")+".Consumer";case lt:return(e._context.displayName||"Context")+".Provider";case He:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _t:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case tt:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}function Se(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(t);case 8:return t===J?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yt(e){var t=xe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bi(e){e._valueTracker||(e._valueTracker=yt(e))}function da(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _l(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fa(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ge(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ha(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Pl(e,t){ha(e,t);var n=ge(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xl(e,t.type,n):t.hasOwnProperty("defaultValue")&&xl(e,t.type,ge(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pa(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function xl(e,t,n){(t!=="number"||Vi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qr=Array.isArray;function gr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jr={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},Ih=["Webkit","ms","Moz","O"];Object.keys(Jr).forEach(function(e){Ih.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jr[t]=Jr[e]})});function Sa(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jr.hasOwnProperty(e)&&Jr[e]?(""+t).trim():t+"px"}function ka(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Sa(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Mh=M({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 Tl(e,t){if(t){if(Mh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function Rl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jl=null;function Ll(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dl=null,wr=null,Sr=null;function Ca(e){if(e=Si(e)){if(typeof Dl!="function")throw Error(o(280));var t=e.stateNode;t&&(t=ps(t),Dl(e.stateNode,e.type,t))}}function _a(e){wr?Sr?Sr.push(e):Sr=[e]:wr=e}function Pa(){if(wr){var e=wr,t=Sr;if(Sr=wr=null,Ca(e),t)for(e=0;e>>=0,e===0?32:31-(Yh(e)/Xh|0)|0}var qi=64,Zi=4194304;function ni(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ji(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var d=a&~i;d!==0?r=ni(d):(l&=a,l!==0&&(r=ni(l)))}else a=n&~i,a!==0?r=ni(a):l!==0&&(r=ni(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ri(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function bh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=di),Ja=" ",ba=!1;function ec(e,t){switch(e){case"keyup":return Np.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function Rp(e,t){switch(e){case"compositionend":return tc(t);case"keypress":return t.which!==32?null:(ba=!0,Ja);case"textInput":return e=t.data,e===Ja&&ba?null:e;default:return null}}function jp(e,t){if(_r)return e==="compositionend"||!ql&&ec(e,t)?(e=Ka(),rs=Vl=vn=null,_r=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=uc(n)}}function cc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dc(){for(var e=window,t=Vi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vi(e.document)}return t}function bl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Up(e){var t=dc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cc(n.ownerDocument.documentElement,n)){if(r!==null&&bl(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=ac(n,l);var a=ac(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Pr=null,eo=null,mi=null,to=!1;function fc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;to||Pr==null||Pr!==Vi(r)||(r=Pr,"selectionStart"in r&&bl(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mi&&pi(mi,r)||(mi=r,r=ds(eo,"onSelect"),0Rr||(e.current=po[Rr],po[Rr]=null,Rr--)}function ke(e,t){Rr++,po[Rr]=e.current,e.current=t}var kn={},Ge=Sn(kn),ot=Sn(!1),Bn=kn;function jr(e,t){var n=e.type.contextTypes;if(!n)return kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ut(e){return e=e.childContextTypes,e!=null}function ms(){_e(ot),_e(Ge)}function Nc(e,t,n){if(Ge.current!==kn)throw Error(o(168));ke(Ge,t),ke(ot,n)}function Tc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(o(108,Se(e)||"Unknown",i));return M({},n,r)}function ys(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kn,Bn=Ge.current,ke(Ge,e),ke(ot,ot.current),!0}function Rc(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=Tc(e,t,Bn),r.__reactInternalMemoizedMergedChildContext=e,_e(ot),_e(Ge),ke(Ge,e)):_e(ot),ke(ot,n)}var Jt=null,vs=!1,mo=!1;function jc(e){Jt===null?Jt=[e]:Jt.push(e)}function Zp(e){vs=!0,jc(e)}function Cn(){if(!mo&&Jt!==null){mo=!0;var e=0,t=we;try{var n=Jt;for(we=1;e>=a,i-=a,bt=1<<32-zt(t)+i|n<ee?($e=Z,Z=null):$e=Z.sibling;var me=N(g,Z,S[ee],z);if(me===null){Z===null&&(Z=$e);break}e&&Z&&me.alternate===null&&t(g,Z),p=l(me,p,ee),q===null?W=me:q.sibling=me,q=me,Z=$e}if(ee===S.length)return n(g,Z),Ee&&Wn(g,ee),W;if(Z===null){for(;eeee?($e=Z,Z=null):$e=Z.sibling;var Ln=N(g,Z,me.value,z);if(Ln===null){Z===null&&(Z=$e);break}e&&Z&&Ln.alternate===null&&t(g,Z),p=l(Ln,p,ee),q===null?W=Ln:q.sibling=Ln,q=Ln,Z=$e}if(me.done)return n(g,Z),Ee&&Wn(g,ee),W;if(Z===null){for(;!me.done;ee++,me=S.next())me=D(g,me.value,z),me!==null&&(p=l(me,p,ee),q===null?W=me:q.sibling=me,q=me);return Ee&&Wn(g,ee),W}for(Z=r(g,Z);!me.done;ee++,me=S.next())me=I(Z,g,ee,me.value,z),me!==null&&(e&&me.alternate!==null&&Z.delete(me.key===null?ee:me.key),p=l(me,p,ee),q===null?W=me:q.sibling=me,q=me);return e&&Z.forEach(function(Lm){return t(g,Lm)}),Ee&&Wn(g,ee),W}function ze(g,p,S,z){if(typeof S=="object"&&S!==null&&S.type===ve&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case te:e:{for(var W=S.key,q=p;q!==null;){if(q.key===W){if(W=S.type,W===ve){if(q.tag===7){n(g,q.sibling),p=i(q,S.props.children),p.return=g,g=p;break e}}else if(q.elementType===W||typeof W=="object"&&W!==null&&W.$$typeof===tt&&Ic(W)===q.type){n(g,q.sibling),p=i(q,S.props),p.ref=ki(g,q,S),p.return=g,g=p;break e}n(g,q);break}else t(g,q);q=q.sibling}S.type===ve?(p=bn(S.props.children,g.mode,z,S.key),p.return=g,g=p):(z=Ws(S.type,S.key,S.props,null,g.mode,z),z.ref=ki(g,p,S),z.return=g,g=z)}return a(g);case ae:e:{for(q=S.key;p!==null;){if(p.key===q)if(p.tag===4&&p.stateNode.containerInfo===S.containerInfo&&p.stateNode.implementation===S.implementation){n(g,p.sibling),p=i(p,S.children||[]),p.return=g,g=p;break e}else{n(g,p);break}else t(g,p);p=p.sibling}p=fu(S,g.mode,z),p.return=g,g=p}return a(g);case tt:return q=S._init,ze(g,p,q(S._payload),z)}if(qr(S))return $(g,p,S,z);if(X(S))return B(g,p,S,z);ks(g,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,p!==null&&p.tag===6?(n(g,p.sibling),p=i(p,S),p.return=g,g=p):(n(g,p),p=du(S,g.mode,z),p.return=g,g=p),a(g)):n(g,p)}return ze}var zr=Mc(!0),Ac=Mc(!1),Cs=Sn(null),_s=null,Fr=null,ko=null;function Co(){ko=Fr=_s=null}function _o(e){var t=Cs.current;_e(Cs),e._currentValue=t}function Po(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ir(e,t){_s=e,ko=Fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(at=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(ko!==e)if(e={context:e,memoizedValue:t,next:null},Fr===null){if(_s===null)throw Error(o(308));Fr=e,_s.dependencies={lanes:0,firstContext:e}}else Fr=Fr.next=e;return t}var Kn=null;function xo(e){Kn===null?Kn=[e]:Kn.push(e)}function Uc(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,xo(t)):(n.next=i.next,i.next=n),t.interleaved=n,tn(e,r)}function tn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $c(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function nn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,tn(e,n)}return i=r.interleaved,i===null?(t.next=t,xo(r)):(t.next=i.next,i.next=t),r.interleaved=t,tn(e,n)}function Ps(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ul(e,n)}}function Qc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xs(e,t,n,r){var i=e.updateQueue;_n=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,d=i.shared.pending;if(d!==null){i.shared.pending=null;var h=d,k=h.next;h.next=null,a===null?l=k:a.next=k,a=h;var j=e.alternate;j!==null&&(j=j.updateQueue,d=j.lastBaseUpdate,d!==a&&(d===null?j.firstBaseUpdate=k:d.next=k,j.lastBaseUpdate=h))}if(l!==null){var D=i.baseState;a=0,j=k=h=null,d=l;do{var N=d.lane,I=d.eventTime;if((r&N)===N){j!==null&&(j=j.next={eventTime:I,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var $=e,B=d;switch(N=t,I=n,B.tag){case 1:if($=B.payload,typeof $=="function"){D=$.call(I,D,N);break e}D=$;break e;case 3:$.flags=$.flags&-65537|128;case 0:if($=B.payload,N=typeof $=="function"?$.call(I,D,N):$,N==null)break e;D=M({},D,N);break e;case 2:_n=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,N=i.effects,N===null?i.effects=[d]:N.push(d))}else I={eventTime:I,lane:N,tag:d.tag,payload:d.payload,callback:d.callback,next:null},j===null?(k=j=I,h=D):j=j.next=I,a|=N;if(d=d.next,d===null){if(d=i.shared.pending,d===null)break;N=d,d=N.next,N.next=null,i.lastBaseUpdate=N,i.shared.pending=null}}while(!0);if(j===null&&(h=D),i.baseState=h,i.firstBaseUpdate=k,i.lastBaseUpdate=j,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);Xn|=a,e.lanes=a,e.memoizedState=D}}function Hc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Lo.transition;Lo.transition={};try{e(!1),t()}finally{we=n,Lo.transition=r}}function od(){return Nt().memoizedState}function tm(e,t,n){var r=Tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ud(e))ad(t,n);else if(n=Uc(e,t,n,r),n!==null){var i=rt();$t(n,e,r,i),cd(n,t,r)}}function nm(e,t,n){var r=Tn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ud(e))ad(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,d=l(a,n);if(i.hasEagerState=!0,i.eagerState=d,Ft(d,a)){var h=t.interleaved;h===null?(i.next=i,xo(t)):(i.next=h.next,h.next=i),t.interleaved=i;return}}catch{}finally{}n=Uc(e,t,i,r),n!==null&&(i=rt(),$t(n,e,r,i),cd(n,t,r))}}function ud(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ad(e,t){xi=Ts=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ul(e,n)}}var Ls={readContext:Et,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},rm={readContext:Et,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:bc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rs(4194308,4,nd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rs(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=tm.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:Zc,useDebugValue:Ao,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=Zc(!1),t=e[0];return e=em.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,i=Yt();if(Ee){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ue===null)throw Error(o(349));Yn&30||Kc(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,bc(Yc.bind(null,r,l,e),[e]),r.flags|=2048,Ti(9,Gc.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Yt(),t=Ue.identifierPrefix;if(Ee){var n=en,r=bt;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ei++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Kt]=t,e[wi]=r,jd(e,t,!1,!1),t.stateNode=e;e:{switch(a=Rl(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),i=r;break;case"iframe":case"object":case"embed":Ce("load",e),i=r;break;case"video":case"audio":for(i=0;iQr&&(t.flags|=128,r=!0,Ri(l,!1),t.lanes=4194304)}else{if(!r)if(e=Es(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Ee)return Xe(t),null}else 2*Oe()-l.renderingStartTime>Qr&&n!==1073741824&&(t.flags|=128,r=!0,Ri(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Oe(),t.sibling=null,n=Te.current,ke(Te,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return uu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?St&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function dm(e,t){switch(vo(t),t.tag){case 1:return ut(t.type)&&ms(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mr(),_e(ot),_e(Ge),jo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return To(t),null;case 13:if(_e(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(Te),null;case 4:return Mr(),null;case 10:return _o(t.type._context),null;case 22:case 23:return uu(),null;case 24:return null;default:return null}}var Fs=!1,qe=!1,fm=typeof WeakSet=="function"?WeakSet:Set,A=null;function Ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(e,t,r)}else n.current=null}function qo(e,t,n){try{n()}catch(r){De(e,t,r)}}var Od=!1;function hm(e,t){if(oo=ts,e=dc(),bl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,d=-1,h=-1,k=0,j=0,D=e,N=null;t:for(;;){for(var I;D!==n||i!==0&&D.nodeType!==3||(d=a+i),D!==l||r!==0&&D.nodeType!==3||(h=a+r),D.nodeType===3&&(a+=D.nodeValue.length),(I=D.firstChild)!==null;)N=D,D=I;for(;;){if(D===e)break t;if(N===n&&++k===i&&(d=a),N===l&&++j===r&&(h=a),(I=D.nextSibling)!==null)break;D=N,N=D.parentNode}D=I}n=d===-1||h===-1?null:{start:d,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(uo={focusedElem:e,selectionRange:n},ts=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var $=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if($!==null){var B=$.memoizedProps,ze=$.memoizedState,g=t.stateNode,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?B:Mt(t.type,B),ze);g.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(z){De(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return $=Od,Od=!1,$}function ji(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&qo(t,n,l)}i=i.next}while(i!==r)}}function Is(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[wi],delete t[ho],delete t[Xp],delete t[qp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fd(e){return e.tag===5||e.tag===3||e.tag===4}function Id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hs));else if(r!==4&&(e=e.child,e!==null))for(Jo(e,t,n),e=e.sibling;e!==null;)Jo(e,t,n),e=e.sibling}function bo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bo(e,t,n),e=e.sibling;e!==null;)bo(e,t,n),e=e.sibling}var Ve=null,At=!1;function xn(e,t,n){for(n=n.child;n!==null;)Md(e,t,n),n=n.sibling}function Md(e,t,n){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Xi,n)}catch{}switch(n.tag){case 5:qe||Ur(n,t);case 6:var r=Ve,i=At;Ve=null,xn(e,t,n),Ve=r,At=i,Ve!==null&&(At?(e=Ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ve.removeChild(n.stateNode));break;case 18:Ve!==null&&(At?(e=Ve,n=n.stateNode,e.nodeType===8?fo(e.parentNode,n):e.nodeType===1&&fo(e,n),ui(e)):fo(Ve,n.stateNode));break;case 4:r=Ve,i=At,Ve=n.stateNode.containerInfo,At=!0,xn(e,t,n),Ve=r,At=i;break;case 0:case 11:case 14:case 15:if(!qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&qo(n,t,a),i=i.next}while(i!==r)}xn(e,t,n);break;case 1:if(!qe&&(Ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){De(n,t,d)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,xn(e,t,n),qe=r):xn(e,t,n);break;default:xn(e,t,n)}}function Ad(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fm),t.forEach(function(r){var i=Cm.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~l}if(r=i,r=Oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mm(r/1960))-r,10e?16:e,Nn===null)var r=!1;else{if(e=Nn,Nn=null,Qs=0,fe&6)throw Error(o(331));var i=fe;for(fe|=4,A=e.current;A!==null;){var l=A,a=l.child;if(A.flags&16){var d=l.deletions;if(d!==null){for(var h=0;hOe()-nu?Zn(e,0):tu|=n),dt(e,t)}function Zd(e,t){t===0&&(e.mode&1?(t=Zi,Zi<<=1,!(Zi&130023424)&&(Zi=4194304)):t=1);var n=rt();e=tn(e,t),e!==null&&(ri(e,t,n),dt(e,n))}function km(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zd(e,n)}function Cm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}r!==null&&r.delete(t),Zd(e,n)}var Jd;Jd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return at=!1,am(e,t,n);at=!!(e.flags&131072)}else at=!1,Ee&&t.flags&1048576&&Lc(t,ws,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zs(e,t),e=t.pendingProps;var i=jr(t,Ge.current);Ir(t,n),i=Oo(null,t,r,e,i,n);var l=zo();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(r)?(l=!0,ys(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Eo(t),i.updater=Ds,t.stateNode=i,i._reactInternals=t,$o(t,r,e,n),t=Vo(null,t,r,!0,l,n)):(t.tag=0,Ee&&l&&yo(t),nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zs(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Pm(r),e=Mt(r,e),i){case 0:t=Bo(null,t,r,e,n);break e;case 1:t=Pd(null,t,r,e,n);break e;case 11:t=wd(null,t,r,e,n);break e;case 14:t=Sd(null,t,r,Mt(r.type,e),n);break e}throw Error(o(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),Bo(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),Pd(e,t,r,i,n);case 3:e:{if(xd(t),e===null)throw Error(o(387));r=t.pendingProps,l=t.memoizedState,i=l.element,$c(e,t),xs(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Ar(Error(o(423)),t),t=Ed(e,t,r,n,i);break e}else if(r!==i){i=Ar(Error(o(424)),t),t=Ed(e,t,r,n,i);break e}else for(wt=wn(t.stateNode.containerInfo.firstChild),gt=t,Ee=!0,It=null,n=Ac(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Or(),r===i){t=rn(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return Bc(t),e===null&&wo(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,ao(r,i)?a=null:l!==null&&ao(r,l)&&(t.flags|=32),_d(e,t),nt(e,t,a,n),t.child;case 6:return e===null&&wo(t),null;case 13:return Nd(e,t,n);case 4:return No(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zr(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),wd(e,t,r,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,ke(Cs,r._currentValue),r._currentValue=a,l!==null)if(Ft(l.value,a)){if(l.children===i.children&&!ot.current){t=rn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var d=l.dependencies;if(d!==null){a=l.child;for(var h=d.firstContext;h!==null;){if(h.context===r){if(l.tag===1){h=nn(-1,n&-n),h.tag=2;var k=l.updateQueue;if(k!==null){k=k.shared;var j=k.pending;j===null?h.next=h:(h.next=j.next,j.next=h),k.pending=h}}l.lanes|=n,h=l.alternate,h!==null&&(h.lanes|=n),Po(l.return,n,t),d.lanes|=n;break}h=h.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(o(341));a.lanes|=n,d=a.alternate,d!==null&&(d.lanes|=n),Po(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ir(t,n),i=Et(i),r=r(i),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,i=Mt(r,t.pendingProps),i=Mt(r.type,i),Sd(e,t,r,i,n);case 15:return kd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),zs(e,t),t.tag=1,ut(r)?(e=!0,ys(t)):e=!1,Ir(t,n),fd(t,r,i),$o(t,r,i,n),Vo(null,t,r,!0,e,n);case 19:return Rd(e,t,n);case 22:return Cd(e,t,n)}throw Error(o(156,t.tag))};function bd(e,t){return Da(e,t)}function _m(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rt(e,t,n,r){return new _m(e,t,n,r)}function cu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pm(e){if(typeof e=="function")return cu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===He)return 11;if(e===_t)return 14}return 2}function jn(e,t){var n=e.alternate;return n===null?(n=Rt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ws(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")cu(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ve:return bn(n.children,i,l,t);case J:a=8,i|=8;break;case Ne:return e=Rt(12,n,t,i|2),e.elementType=Ne,e.lanes=l,e;case et:return e=Rt(13,n,t,i),e.elementType=et,e.lanes=l,e;case Be:return e=Rt(19,n,t,i),e.elementType=Be,e.lanes=l,e;case Pe:return Ks(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lt:a=10;break e;case qt:a=9;break e;case He:a=11;break e;case _t:a=14;break e;case tt:a=16,r=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=Rt(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function bn(e,t,n,r){return e=Rt(7,e,r,t),e.lanes=n,e}function Ks(e,t,n,r){return e=Rt(22,e,r,t),e.elementType=Pe,e.lanes=n,e.stateNode={isHidden:!1},e}function du(e,t,n){return e=Rt(6,e,null,t),e.lanes=n,e}function fu(e,t,n){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xm(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Al(0),this.expirationTimes=Al(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Al(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hu(e,t,n,r,i,l,a,d,h){return e=new xm(e,t,n,d,h),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Rt(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Eo(l),e}function Em(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ju)}catch(u){console.error(u)}}ju(),Eu.exports=ff();var hf=Eu.exports,Lu=hf;el.createRoot=Lu.createRoot,el.hydrateRoot=Lu.hydrateRoot;var Br=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(u){return this.listeners.add(u),this.onSubscribe(),()=>{this.listeners.delete(u),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},er=typeof window>"u"||"Deno"in globalThis;function kt(){}function pf(u,s){return typeof u=="function"?u(s):u}function rl(u){return typeof u=="number"&&u>=0&&u!==1/0}function Du(u,s){return Math.max(u+(s||0)-Date.now(),0)}function tr(u,s){return typeof u=="function"?u(s):u}function jt(u,s){return typeof u=="function"?u(s):u}function Ou(u,s){const{type:o="all",exact:c,fetchStatus:f,predicate:w,queryKey:v,stale:T}=u;if(v){if(c){if(s.queryHash!==il(v,s.options))return!1}else if(!Wr(s.queryKey,v))return!1}if(o!=="all"){const L=s.isActive();if(o==="active"&&!L||o==="inactive"&&L)return!1}return!(typeof T=="boolean"&&s.isStale()!==T||f&&f!==s.state.fetchStatus||w&&!w(s))}function zu(u,s){const{exact:o,status:c,predicate:f,mutationKey:w}=u;if(w){if(!s.options.mutationKey)return!1;if(o){if(Vr(s.options.mutationKey)!==Vr(w))return!1}else if(!Wr(s.options.mutationKey,w))return!1}return!(c&&s.state.status!==c||f&&!f(s))}function il(u,s){return((s==null?void 0:s.queryKeyHashFn)||Vr)(u)}function Vr(u){return JSON.stringify(u,(s,o)=>ll(o)?Object.keys(o).sort().reduce((c,f)=>(c[f]=o[f],c),{}):o)}function Wr(u,s){return u===s?!0:typeof u!=typeof s?!1:u&&s&&typeof u=="object"&&typeof s=="object"?!Object.keys(s).some(o=>!Wr(u[o],s[o])):!1}function Fu(u,s){if(u===s)return u;const o=Iu(u)&&Iu(s);if(o||ll(u)&&ll(s)){const c=o?u:Object.keys(u),f=c.length,w=o?s:Object.keys(s),v=w.length,T=o?[]:{};let L=0;for(let C=0;C{setTimeout(s,u)})}function ol(u,s,o){return typeof o.structuralSharing=="function"?o.structuralSharing(u,s):o.structuralSharing!==!1?Fu(u,s):s}function yf(u,s,o=0){const c=[...u,s];return o&&c.length>o?c.slice(1):c}function vf(u,s,o=0){const c=[s,...u];return o&&c.length>o?c.slice(0,-1):c}var Au=Symbol();function Uu(u,s){return!u.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!u.queryFn||u.queryFn===Au?()=>Promise.reject(new Error(`Missing queryFn: '${u.queryHash}'`)):u.queryFn}var gf=(na=class extends Br{constructor(){super();ne(this,On);ne(this,on);ne(this,sr);V(this,sr,s=>{if(!er&&window.addEventListener){const o=()=>s();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){m(this,on)||this.setEventListener(m(this,sr))}onUnsubscribe(){var s;this.hasListeners()||((s=m(this,on))==null||s.call(this),V(this,on,void 0))}setEventListener(s){var o;V(this,sr,s),(o=m(this,on))==null||o.call(this),V(this,on,s(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(s){m(this,On)!==s&&(V(this,On,s),this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(o=>{o(s)})}isFocused(){var s;return typeof m(this,On)=="boolean"?m(this,On):((s=globalThis.document)==null?void 0:s.visibilityState)!=="hidden"}},On=new WeakMap,on=new WeakMap,sr=new WeakMap,na),ul=new gf,wf=(ra=class extends Br{constructor(){super();ne(this,lr,!0);ne(this,un);ne(this,or);V(this,or,s=>{if(!er&&window.addEventListener){const o=()=>s(!0),c=()=>s(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",c)}}})}onSubscribe(){m(this,un)||this.setEventListener(m(this,or))}onUnsubscribe(){var s;this.hasListeners()||((s=m(this,un))==null||s.call(this),V(this,un,void 0))}setEventListener(s){var o;V(this,or,s),(o=m(this,un))==null||o.call(this),V(this,un,s(this.setOnline.bind(this)))}setOnline(s){m(this,lr)!==s&&(V(this,lr,s),this.listeners.forEach(c=>{c(s)}))}isOnline(){return m(this,lr)}},lr=new WeakMap,un=new WeakMap,or=new WeakMap,ra),Mi=new wf;function Sf(u){return Math.min(1e3*2**u,3e4)}function $u(u){return(u??"online")==="online"?Mi.isOnline():!0}var Qu=class{constructor(u){this.revert=u==null?void 0:u.revert,this.silent=u==null?void 0:u.silent}};function al(u){return u instanceof Qu}function Hu(u){let s=!1,o=0,c=!1,f,w,v;const T=new Promise((G,Y)=>{w=G,v=Y}),L=G=>{var Y;c||(Q(new Qu(G)),(Y=u.abort)==null||Y.call(u))},C=()=>{s=!0},_=()=>{s=!1},x=()=>ul.isFocused()&&(u.networkMode==="always"||Mi.isOnline())&&u.canRun(),E=()=>$u(u.networkMode)&&u.canRun(),O=G=>{var Y;c||(c=!0,(Y=u.onSuccess)==null||Y.call(u,G),f==null||f(),w(G))},Q=G=>{var Y;c||(c=!0,(Y=u.onError)==null||Y.call(u,G),f==null||f(),v(G))},U=()=>new Promise(G=>{var Y;f=b=>{(c||x())&&G(b)},(Y=u.onPause)==null||Y.call(u)}).then(()=>{var G;f=void 0,c||(G=u.onContinue)==null||G.call(u)}),H=()=>{if(c)return;let G;const Y=o===0?u.initialPromise:void 0;try{G=Y??u.fn()}catch(b){G=Promise.reject(b)}Promise.resolve(G).then(O).catch(b=>{var J;if(c)return;const K=u.retry??(er?0:3),te=u.retryDelay??Sf,ae=typeof te=="function"?te(o,b):te,ve=K===!0||typeof K=="number"&&ox()?void 0:U()).then(()=>{s?Q(b):H()})})};return{promise:T,cancel:L,continue:()=>(f==null||f(),T),cancelRetry:C,continueRetry:_,canStart:E,start:()=>(E()?H():U().then(H),T)}}function kf(){let u=[],s=0,o=E=>{E()},c=E=>{E()},f=E=>setTimeout(E,0);const w=E=>{f=E},v=E=>{let O;s++;try{O=E()}finally{s--,s||C()}return O},T=E=>{s?u.push(E):f(()=>{o(E)})},L=E=>(...O)=>{T(()=>{E(...O)})},C=()=>{const E=u;u=[],E.length&&f(()=>{c(()=>{E.forEach(O=>{o(O)})})})};return{batch:v,batchCalls:L,schedule:T,setNotifyFunction:E=>{o=E},setBatchNotifyFunction:E=>{c=E},setScheduler:w}}var Qe=kf(),Bu=(ia=class{constructor(){ne(this,zn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rl(this.gcTime)&&V(this,zn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(u){this.gcTime=Math.max(this.gcTime||0,u??(er?1/0:5*60*1e3))}clearGcTimeout(){m(this,zn)&&(clearTimeout(m(this,zn)),V(this,zn,void 0))}},zn=new WeakMap,ia),Cf=(sa=class extends Bu{constructor(s){super();ne(this,Ot);ne(this,ur);ne(this,ar);ne(this,Ct);ne(this,Ke);ne(this,Kr);ne(this,Fn);V(this,Fn,!1),V(this,Kr,s.defaultOptions),this.setOptions(s.options),this.observers=[],V(this,Ct,s.cache),this.queryKey=s.queryKey,this.queryHash=s.queryHash,V(this,ur,s.state||_f(this.options)),this.state=m(this,ur),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var s;return(s=m(this,Ke))==null?void 0:s.promise}setOptions(s){this.options={...m(this,Kr),...s},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&m(this,Ct).remove(this)}setData(s,o){const c=ol(this.state.data,s,this.options);return ce(this,Ot,ln).call(this,{data:c,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),c}setState(s,o){ce(this,Ot,ln).call(this,{type:"setState",state:s,setStateOptions:o})}cancel(s){var c,f;const o=(c=m(this,Ke))==null?void 0:c.promise;return(f=m(this,Ke))==null||f.cancel(s),o?o.then(kt).catch(kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(m(this,ur))}isActive(){return this.observers.some(s=>jt(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(s=0){return this.state.isInvalidated||this.state.data===void 0||!Du(this.state.dataUpdatedAt,s)}onFocus(){var o;const s=this.observers.find(c=>c.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(o=m(this,Ke))==null||o.continue()}onOnline(){var o;const s=this.observers.find(c=>c.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(o=m(this,Ke))==null||o.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),m(this,Ct).notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(o=>o!==s),this.observers.length||(m(this,Ke)&&(m(this,Fn)?m(this,Ke).cancel({revert:!0}):m(this,Ke).cancelRetry()),this.scheduleGc()),m(this,Ct).notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Ot,ln).call(this,{type:"invalidate"})}fetch(s,o){var L,C,_;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(m(this,Ke))return m(this,Ke).continueRetry(),m(this,Ke).promise}if(s&&this.setOptions(s),!this.options.queryFn){const x=this.observers.find(E=>E.options.queryFn);x&&this.setOptions(x.options)}const c=new AbortController,f=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(V(this,Fn,!0),c.signal)})},w=()=>{const x=Uu(this.options,o),E={queryKey:this.queryKey,meta:this.meta};return f(E),V(this,Fn,!1),this.options.persister?this.options.persister(x,E,this):x(E)},v={fetchOptions:o,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:w};f(v),(L=this.options.behavior)==null||L.onFetch(v,this),V(this,ar,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((C=v.fetchOptions)==null?void 0:C.meta))&&ce(this,Ot,ln).call(this,{type:"fetch",meta:(_=v.fetchOptions)==null?void 0:_.meta});const T=x=>{var E,O,Q,U;al(x)&&x.silent||ce(this,Ot,ln).call(this,{type:"error",error:x}),al(x)||((O=(E=m(this,Ct).config).onError)==null||O.call(E,x,this),(U=(Q=m(this,Ct).config).onSettled)==null||U.call(Q,this.state.data,x,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return V(this,Ke,Hu({initialPromise:o==null?void 0:o.initialPromise,fn:v.fetchFn,abort:c.abort.bind(c),onSuccess:x=>{var E,O,Q,U;if(x===void 0){T(new Error(`${this.queryHash} data is undefined`));return}this.setData(x),(O=(E=m(this,Ct).config).onSuccess)==null||O.call(E,x,this),(U=(Q=m(this,Ct).config).onSettled)==null||U.call(Q,x,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:T,onFail:(x,E)=>{ce(this,Ot,ln).call(this,{type:"failed",failureCount:x,error:E})},onPause:()=>{ce(this,Ot,ln).call(this,{type:"pause"})},onContinue:()=>{ce(this,Ot,ln).call(this,{type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode,canRun:()=>!0})),m(this,Ke).start()}},ur=new WeakMap,ar=new WeakMap,Ct=new WeakMap,Ke=new WeakMap,Kr=new WeakMap,Fn=new WeakMap,Ot=new WeakSet,ln=function(s){const o=c=>{switch(s.type){case"failed":return{...c,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...Vu(c.data,this.options),fetchMeta:s.meta??null};case"success":return{...c,data:s.data,dataUpdateCount:c.dataUpdateCount+1,dataUpdatedAt:s.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const f=s.error;return al(f)&&f.revert&&m(this,ar)?{...m(this,ar),fetchStatus:"idle"}:{...c,error:f,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error"};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...s.state}}};this.state=o(this.state),Qe.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),m(this,Ct).notify({query:this,type:"updated",action:s})})},sa);function Vu(u,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$u(s.networkMode)?"fetching":"paused",...u===void 0&&{error:null,status:"pending"}}}function _f(u){const s=typeof u.initialData=="function"?u.initialData():u.initialData,o=s!==void 0,c=o?typeof u.initialDataUpdatedAt=="function"?u.initialDataUpdatedAt():u.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:o?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Pf=(la=class extends Br{constructor(s={}){super();ne(this,Qt);this.config=s,V(this,Qt,new Map)}build(s,o,c){const f=o.queryKey,w=o.queryHash??il(f,o);let v=this.get(w);return v||(v=new Cf({cache:this,queryKey:f,queryHash:w,options:s.defaultQueryOptions(o),state:c,defaultOptions:s.getQueryDefaults(f)}),this.add(v)),v}add(s){m(this,Qt).has(s.queryHash)||(m(this,Qt).set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const o=m(this,Qt).get(s.queryHash);o&&(s.destroy(),o===s&&m(this,Qt).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Qe.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return m(this,Qt).get(s)}getAll(){return[...m(this,Qt).values()]}find(s){const o={exact:!0,...s};return this.getAll().find(c=>Ou(o,c))}findAll(s={}){const o=this.getAll();return Object.keys(s).length>0?o.filter(c=>Ou(s,c)):o}notify(s){Qe.batch(()=>{this.listeners.forEach(o=>{o(s)})})}onFocus(){Qe.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Qe.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},Qt=new WeakMap,la),xf=(oa=class extends Bu{constructor(s){super();ne(this,Bt);ne(this,Ht);ne(this,Je);ne(this,In);this.mutationId=s.mutationId,V(this,Je,s.mutationCache),V(this,Ht,[]),this.state=s.state||Ef(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){m(this,Ht).includes(s)||(m(this,Ht).push(s),this.clearGcTimeout(),m(this,Je).notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){V(this,Ht,m(this,Ht).filter(o=>o!==s)),this.scheduleGc(),m(this,Je).notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){m(this,Ht).length||(this.state.status==="pending"?this.scheduleGc():m(this,Je).remove(this))}continue(){var s;return((s=m(this,In))==null?void 0:s.continue())??this.execute(this.state.variables)}async execute(s){var f,w,v,T,L,C,_,x,E,O,Q,U,H,G,Y,b,K,te,ae,ve;V(this,In,Hu({fn:()=>this.options.mutationFn?this.options.mutationFn(s):Promise.reject(new Error("No mutationFn found")),onFail:(J,Ne)=>{ce(this,Bt,Dn).call(this,{type:"failed",failureCount:J,error:Ne})},onPause:()=>{ce(this,Bt,Dn).call(this,{type:"pause"})},onContinue:()=>{ce(this,Bt,Dn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>m(this,Je).canRun(this)}));const o=this.state.status==="pending",c=!m(this,In).canStart();try{if(!o){ce(this,Bt,Dn).call(this,{type:"pending",variables:s,isPaused:c}),await((w=(f=m(this,Je).config).onMutate)==null?void 0:w.call(f,s,this));const Ne=await((T=(v=this.options).onMutate)==null?void 0:T.call(v,s));Ne!==this.state.context&&ce(this,Bt,Dn).call(this,{type:"pending",context:Ne,variables:s,isPaused:c})}const J=await m(this,In).start();return await((C=(L=m(this,Je).config).onSuccess)==null?void 0:C.call(L,J,s,this.state.context,this)),await((x=(_=this.options).onSuccess)==null?void 0:x.call(_,J,s,this.state.context)),await((O=(E=m(this,Je).config).onSettled)==null?void 0:O.call(E,J,null,this.state.variables,this.state.context,this)),await((U=(Q=this.options).onSettled)==null?void 0:U.call(Q,J,null,s,this.state.context)),ce(this,Bt,Dn).call(this,{type:"success",data:J}),J}catch(J){try{throw await((G=(H=m(this,Je).config).onError)==null?void 0:G.call(H,J,s,this.state.context,this)),await((b=(Y=this.options).onError)==null?void 0:b.call(Y,J,s,this.state.context)),await((te=(K=m(this,Je).config).onSettled)==null?void 0:te.call(K,void 0,J,this.state.variables,this.state.context,this)),await((ve=(ae=this.options).onSettled)==null?void 0:ve.call(ae,void 0,J,s,this.state.context)),J}finally{ce(this,Bt,Dn).call(this,{type:"error",error:J})}}finally{m(this,Je).runNext(this)}}},Ht=new WeakMap,Je=new WeakMap,In=new WeakMap,Bt=new WeakSet,Dn=function(s){const o=c=>{switch(s.type){case"failed":return{...c,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...c,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:s.error,failureCount:c.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=o(this.state),Qe.batch(()=>{m(this,Ht).forEach(c=>{c.onMutationUpdate(s)}),m(this,Je).notify({mutation:this,type:"updated",action:s})})},oa);function Ef(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nf=(ua=class extends Br{constructor(s={}){super();ne(this,mt);ne(this,Gr);this.config=s,V(this,mt,new Map),V(this,Gr,Date.now())}build(s,o,c){const f=new xf({mutationCache:this,mutationId:++bs(this,Gr)._,options:s.defaultMutationOptions(o),state:c});return this.add(f),f}add(s){const o=Ai(s),c=m(this,mt).get(o)??[];c.push(s),m(this,mt).set(o,c),this.notify({type:"added",mutation:s})}remove(s){var c;const o=Ai(s);if(m(this,mt).has(o)){const f=(c=m(this,mt).get(o))==null?void 0:c.filter(w=>w!==s);f&&(f.length===0?m(this,mt).delete(o):m(this,mt).set(o,f))}this.notify({type:"removed",mutation:s})}canRun(s){var c;const o=(c=m(this,mt).get(Ai(s)))==null?void 0:c.find(f=>f.state.status==="pending");return!o||o===s}runNext(s){var c;const o=(c=m(this,mt).get(Ai(s)))==null?void 0:c.find(f=>f!==s&&f.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}clear(){Qe.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}getAll(){return[...m(this,mt).values()].flat()}find(s){const o={exact:!0,...s};return this.getAll().find(c=>zu(o,c))}findAll(s={}){return this.getAll().filter(o=>zu(s,o))}notify(s){Qe.batch(()=>{this.listeners.forEach(o=>{o(s)})})}resumePausedMutations(){const s=this.getAll().filter(o=>o.state.isPaused);return Qe.batch(()=>Promise.all(s.map(o=>o.continue().catch(kt))))}},mt=new WeakMap,Gr=new WeakMap,ua);function Ai(u){var s;return((s=u.options.scope)==null?void 0:s.id)??String(u.mutationId)}function Tf(u){return{onFetch:(s,o)=>{const c=async()=>{var Q,U,H,G,Y;const f=s.options,w=(H=(U=(Q=s.fetchOptions)==null?void 0:Q.meta)==null?void 0:U.fetchMore)==null?void 0:H.direction,v=((G=s.state.data)==null?void 0:G.pages)||[],T=((Y=s.state.data)==null?void 0:Y.pageParams)||[],L={pages:[],pageParams:[]};let C=!1;const _=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(s.signal.aborted?C=!0:s.signal.addEventListener("abort",()=>{C=!0}),s.signal)})},x=Uu(s.options,s.fetchOptions),E=async(b,K,te)=>{if(C)return Promise.reject();if(K==null&&b.pages.length)return Promise.resolve(b);const ae={queryKey:s.queryKey,pageParam:K,direction:te?"backward":"forward",meta:s.options.meta};_(ae);const ve=await x(ae),{maxPages:J}=s.options,Ne=te?vf:yf;return{pages:Ne(b.pages,ve,J),pageParams:Ne(b.pageParams,K,J)}};let O;if(w&&v.length){const b=w==="backward",K=b?Rf:Wu,te={pages:v,pageParams:T},ae=K(f,te);O=await E(te,ae,b)}else{O=await E(L,T[0]??f.initialPageParam);const b=u??v.length;for(let K=1;K{var f,w;return(w=(f=s.options).persister)==null?void 0:w.call(f,c,{queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},o)}:s.fetchFn=c}}}function Wu(u,{pages:s,pageParams:o}){const c=s.length-1;return s.length>0?u.getNextPageParam(s[c],s,o[c],o):void 0}function Rf(u,{pages:s,pageParams:o}){var c;return s.length>0?(c=u.getPreviousPageParam)==null?void 0:c.call(u,s[0],s,o[0],o):void 0}var jf=(aa=class{constructor(u={}){ne(this,Le);ne(this,an);ne(this,cn);ne(this,cr);ne(this,dr);ne(this,dn);ne(this,fr);ne(this,hr);V(this,Le,u.queryCache||new Pf),V(this,an,u.mutationCache||new Nf),V(this,cn,u.defaultOptions||{}),V(this,cr,new Map),V(this,dr,new Map),V(this,dn,0)}mount(){bs(this,dn)._++,m(this,dn)===1&&(V(this,fr,ul.subscribe(async u=>{u&&(await this.resumePausedMutations(),m(this,Le).onFocus())})),V(this,hr,Mi.subscribe(async u=>{u&&(await this.resumePausedMutations(),m(this,Le).onOnline())})))}unmount(){var u,s;bs(this,dn)._--,m(this,dn)===0&&((u=m(this,fr))==null||u.call(this),V(this,fr,void 0),(s=m(this,hr))==null||s.call(this),V(this,hr,void 0))}isFetching(u){return m(this,Le).findAll({...u,fetchStatus:"fetching"}).length}isMutating(u){return m(this,an).findAll({...u,status:"pending"}).length}getQueryData(u){var o;const s=this.defaultQueryOptions({queryKey:u});return(o=m(this,Le).get(s.queryHash))==null?void 0:o.state.data}ensureQueryData(u){const s=this.getQueryData(u.queryKey);if(s===void 0)return this.fetchQuery(u);{const o=this.defaultQueryOptions(u),c=m(this,Le).build(this,o);return u.revalidateIfStale&&c.isStaleByTime(tr(o.staleTime,c))&&this.prefetchQuery(o),Promise.resolve(s)}}getQueriesData(u){return m(this,Le).findAll(u).map(({queryKey:s,state:o})=>{const c=o.data;return[s,c]})}setQueryData(u,s,o){const c=this.defaultQueryOptions({queryKey:u}),f=m(this,Le).get(c.queryHash),w=f==null?void 0:f.state.data,v=pf(s,w);if(v!==void 0)return m(this,Le).build(this,c).setData(v,{...o,manual:!0})}setQueriesData(u,s,o){return Qe.batch(()=>m(this,Le).findAll(u).map(({queryKey:c})=>[c,this.setQueryData(c,s,o)]))}getQueryState(u){var o;const s=this.defaultQueryOptions({queryKey:u});return(o=m(this,Le).get(s.queryHash))==null?void 0:o.state}removeQueries(u){const s=m(this,Le);Qe.batch(()=>{s.findAll(u).forEach(o=>{s.remove(o)})})}resetQueries(u,s){const o=m(this,Le),c={type:"active",...u};return Qe.batch(()=>(o.findAll(u).forEach(f=>{f.reset()}),this.refetchQueries(c,s)))}cancelQueries(u={},s={}){const o={revert:!0,...s},c=Qe.batch(()=>m(this,Le).findAll(u).map(f=>f.cancel(o)));return Promise.all(c).then(kt).catch(kt)}invalidateQueries(u={},s={}){return Qe.batch(()=>{if(m(this,Le).findAll(u).forEach(c=>{c.invalidate()}),u.refetchType==="none")return Promise.resolve();const o={...u,type:u.refetchType??u.type??"active"};return this.refetchQueries(o,s)})}refetchQueries(u={},s){const o={...s,cancelRefetch:(s==null?void 0:s.cancelRefetch)??!0},c=Qe.batch(()=>m(this,Le).findAll(u).filter(f=>!f.isDisabled()).map(f=>{let w=f.fetch(void 0,o);return o.throwOnError||(w=w.catch(kt)),f.state.fetchStatus==="paused"?Promise.resolve():w}));return Promise.all(c).then(kt)}fetchQuery(u){const s=this.defaultQueryOptions(u);s.retry===void 0&&(s.retry=!1);const o=m(this,Le).build(this,s);return o.isStaleByTime(tr(s.staleTime,o))?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(u){return this.fetchQuery(u).then(kt).catch(kt)}fetchInfiniteQuery(u){return u.behavior=Tf(u.pages),this.fetchQuery(u)}prefetchInfiniteQuery(u){return this.fetchInfiniteQuery(u).then(kt).catch(kt)}resumePausedMutations(){return Mi.isOnline()?m(this,an).resumePausedMutations():Promise.resolve()}getQueryCache(){return m(this,Le)}getMutationCache(){return m(this,an)}getDefaultOptions(){return m(this,cn)}setDefaultOptions(u){V(this,cn,u)}setQueryDefaults(u,s){m(this,cr).set(Vr(u),{queryKey:u,defaultOptions:s})}getQueryDefaults(u){const s=[...m(this,cr).values()];let o={};return s.forEach(c=>{Wr(u,c.queryKey)&&(o={...o,...c.defaultOptions})}),o}setMutationDefaults(u,s){m(this,dr).set(Vr(u),{mutationKey:u,defaultOptions:s})}getMutationDefaults(u){const s=[...m(this,dr).values()];let o={};return s.forEach(c=>{Wr(u,c.mutationKey)&&(o={...o,...c.defaultOptions})}),o}defaultQueryOptions(u){if(u._defaulted)return u;const s={...m(this,cn).queries,...this.getQueryDefaults(u.queryKey),...u,_defaulted:!0};return s.queryHash||(s.queryHash=il(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.enabled!==!0&&s.queryFn===Au&&(s.enabled=!1),s}defaultMutationOptions(u){return u!=null&&u._defaulted?u:{...m(this,cn).mutations,...(u==null?void 0:u.mutationKey)&&this.getMutationDefaults(u.mutationKey),...u,_defaulted:!0}}clear(){m(this,Le).clear(),m(this,an).clear()}},Le=new WeakMap,an=new WeakMap,cn=new WeakMap,cr=new WeakMap,dr=new WeakMap,dn=new WeakMap,fr=new WeakMap,hr=new WeakMap,aa),Lf=(ca=class extends Br{constructor(s,o){super();ne(this,ye);ne(this,st);ne(this,ue);ne(this,Yr);ne(this,be);ne(this,Mn);ne(this,pr);ne(this,Vt);ne(this,Xr);ne(this,mr);ne(this,yr);ne(this,An);ne(this,Un);ne(this,fn);ne(this,vr,new Set);this.options=o,V(this,st,s),V(this,Vt,null),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(m(this,ue).addObserver(this),Ku(m(this,ue),this.options)?ce(this,ye,Fi).call(this):this.updateResult(),ce(this,ye,ku).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cl(m(this,ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cl(m(this,ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,ye,Cu).call(this),ce(this,ye,_u).call(this),m(this,ue).removeObserver(this)}setOptions(s,o){const c=this.options,f=m(this,ue);if(this.options=m(this,st).defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,m(this,ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,ye,Pu).call(this),m(this,ue).setOptions(this.options),c._defaulted&&!sl(this.options,c)&&m(this,st).getQueryCache().notify({type:"observerOptionsUpdated",query:m(this,ue),observer:this});const w=this.hasListeners();w&&Gu(m(this,ue),f,this.options,c)&&ce(this,ye,Fi).call(this),this.updateResult(o),w&&(m(this,ue)!==f||jt(this.options.enabled,m(this,ue))!==jt(c.enabled,m(this,ue))||tr(this.options.staleTime,m(this,ue))!==tr(c.staleTime,m(this,ue)))&&ce(this,ye,gu).call(this);const v=ce(this,ye,wu).call(this);w&&(m(this,ue)!==f||jt(this.options.enabled,m(this,ue))!==jt(c.enabled,m(this,ue))||v!==m(this,fn))&&ce(this,ye,Su).call(this,v)}getOptimisticResult(s){const o=m(this,st).getQueryCache().build(m(this,st),s),c=this.createResult(o,s);return Of(this,c)&&(V(this,be,c),V(this,pr,this.options),V(this,Mn,m(this,ue).state)),c}getCurrentResult(){return m(this,be)}trackResult(s,o){const c={};return Object.keys(s).forEach(f=>{Object.defineProperty(c,f,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(f),o==null||o(f),s[f])})}),c}trackProp(s){m(this,vr).add(s)}getCurrentQuery(){return m(this,ue)}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const o=m(this,st).defaultQueryOptions(s),c=m(this,st).getQueryCache().build(m(this,st),o);return c.isFetchingOptimistic=!0,c.fetch().then(()=>this.createResult(c,o))}fetch(s){return ce(this,ye,Fi).call(this,{...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),m(this,be)))}createResult(s,o){var ve;const c=m(this,ue),f=this.options,w=m(this,be),v=m(this,Mn),T=m(this,pr),C=s!==c?s.state:m(this,Yr),{state:_}=s;let x={..._},E=!1,O;if(o._optimisticResults){const J=this.hasListeners(),Ne=!J&&Ku(s,o),lt=J&&Gu(s,c,o,f);(Ne||lt)&&(x={...x,...Vu(_.data,s.options)}),o._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:Q,errorUpdatedAt:U,status:H}=x;if(o.select&&x.data!==void 0)if(w&&x.data===(v==null?void 0:v.data)&&o.select===m(this,Xr))O=m(this,mr);else try{V(this,Xr,o.select),O=o.select(x.data),O=ol(w==null?void 0:w.data,O,o),V(this,mr,O),V(this,Vt,null)}catch(J){V(this,Vt,J)}else O=x.data;if(o.placeholderData!==void 0&&O===void 0&&H==="pending"){let J;if(w!=null&&w.isPlaceholderData&&o.placeholderData===(T==null?void 0:T.placeholderData))J=w.data;else if(J=typeof o.placeholderData=="function"?o.placeholderData((ve=m(this,yr))==null?void 0:ve.state.data,m(this,yr)):o.placeholderData,o.select&&J!==void 0)try{J=o.select(J),V(this,Vt,null)}catch(Ne){V(this,Vt,Ne)}J!==void 0&&(H="success",O=ol(w==null?void 0:w.data,J,o),E=!0)}m(this,Vt)&&(Q=m(this,Vt),O=m(this,mr),U=Date.now(),H="error");const G=x.fetchStatus==="fetching",Y=H==="pending",b=H==="error",K=Y&&G,te=O!==void 0;return{status:H,fetchStatus:x.fetchStatus,isPending:Y,isSuccess:H==="success",isError:b,isInitialLoading:K,isLoading:K,data:O,dataUpdatedAt:x.dataUpdatedAt,error:Q,errorUpdatedAt:U,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>C.dataUpdateCount||x.errorUpdateCount>C.errorUpdateCount,isFetching:G,isRefetching:G&&!Y,isLoadingError:b&&!te,isPaused:x.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:b&&te,isStale:dl(s,o),refetch:this.refetch}}updateResult(s){const o=m(this,be),c=this.createResult(m(this,ue),this.options);if(V(this,Mn,m(this,ue).state),V(this,pr,this.options),m(this,Mn).data!==void 0&&V(this,yr,m(this,ue)),sl(c,o))return;V(this,be,c);const f={},w=()=>{if(!o)return!0;const{notifyOnChangeProps:v}=this.options,T=typeof v=="function"?v():v;if(T==="all"||!T&&!m(this,vr).size)return!0;const L=new Set(T??m(this,vr));return this.options.throwOnError&&L.add("error"),Object.keys(m(this,be)).some(C=>{const _=C;return m(this,be)[_]!==o[_]&&L.has(_)})};(s==null?void 0:s.listeners)!==!1&&w()&&(f.listeners=!0),ce(this,ye,of).call(this,{...f,...s})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,ye,ku).call(this)}},st=new WeakMap,ue=new WeakMap,Yr=new WeakMap,be=new WeakMap,Mn=new WeakMap,pr=new WeakMap,Vt=new WeakMap,Xr=new WeakMap,mr=new WeakMap,yr=new WeakMap,An=new WeakMap,Un=new WeakMap,fn=new WeakMap,vr=new WeakMap,ye=new WeakSet,Fi=function(s){ce(this,ye,Pu).call(this);let o=m(this,ue).fetch(this.options,s);return s!=null&&s.throwOnError||(o=o.catch(kt)),o},gu=function(){ce(this,ye,Cu).call(this);const s=tr(this.options.staleTime,m(this,ue));if(er||m(this,be).isStale||!rl(s))return;const c=Du(m(this,be).dataUpdatedAt,s)+1;V(this,An,setTimeout(()=>{m(this,be).isStale||this.updateResult()},c))},wu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(m(this,ue)):this.options.refetchInterval)??!1},Su=function(s){ce(this,ye,_u).call(this),V(this,fn,s),!(er||jt(this.options.enabled,m(this,ue))===!1||!rl(m(this,fn))||m(this,fn)===0)&&V(this,Un,setInterval(()=>{(this.options.refetchIntervalInBackground||ul.isFocused())&&ce(this,ye,Fi).call(this)},m(this,fn)))},ku=function(){ce(this,ye,gu).call(this),ce(this,ye,Su).call(this,ce(this,ye,wu).call(this))},Cu=function(){m(this,An)&&(clearTimeout(m(this,An)),V(this,An,void 0))},_u=function(){m(this,Un)&&(clearInterval(m(this,Un)),V(this,Un,void 0))},Pu=function(){const s=m(this,st).getQueryCache().build(m(this,st),this.options);if(s===m(this,ue))return;const o=m(this,ue);V(this,ue,s),V(this,Yr,s.state),this.hasListeners()&&(o==null||o.removeObserver(this),s.addObserver(this))},of=function(s){Qe.batch(()=>{s.listeners&&this.listeners.forEach(o=>{o(m(this,be))}),m(this,st).getQueryCache().notify({query:m(this,ue),type:"observerResultsUpdated"})})},ca);function Df(u,s){return jt(s.enabled,u)!==!1&&u.state.data===void 0&&!(u.state.status==="error"&&s.retryOnMount===!1)}function Ku(u,s){return Df(u,s)||u.state.data!==void 0&&cl(u,s,s.refetchOnMount)}function cl(u,s,o){if(jt(s.enabled,u)!==!1){const c=typeof o=="function"?o(u):o;return c==="always"||c!==!1&&dl(u,s)}return!1}function Gu(u,s,o,c){return(u!==s||jt(c.enabled,u)===!1)&&(!o.suspense||u.state.status!=="error")&&dl(u,o)}function dl(u,s){return jt(s.enabled,u)!==!1&&u.isStaleByTime(tr(s.staleTime,u))}function Of(u,s){return!sl(u.getCurrentResult(),s)}var Yu=le.createContext(void 0),zf=u=>{const s=le.useContext(Yu);if(u)return u;if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},Ff=({client:u,children:s})=>(le.useEffect(()=>(u.mount(),()=>{u.unmount()}),[u]),P.jsx(Yu.Provider,{value:u,children:s})),Xu=le.createContext(!1),If=()=>le.useContext(Xu);Xu.Provider;function Mf(){let u=!1;return{clearReset:()=>{u=!1},reset:()=>{u=!0},isReset:()=>u}}var Af=le.createContext(Mf()),Uf=()=>le.useContext(Af);function $f(u,s){return typeof u=="function"?u(...s):!!u}var Qf=(u,s)=>{(u.suspense||u.throwOnError)&&(s.isReset()||(u.retryOnMount=!1))},Hf=u=>{le.useEffect(()=>{u.clearReset()},[u])},Bf=({result:u,errorResetBoundary:s,throwOnError:o,query:c})=>u.isError&&!s.isReset()&&!u.isFetching&&c&&$f(o,[u.error,c]),Vf=u=>{u.suspense&&typeof u.staleTime!="number"&&(u.staleTime=1e3)},Wf=(u,s)=>(u==null?void 0:u.suspense)&&s.isPending,Kf=(u,s,o)=>s.fetchOptimistic(u).catch(()=>{o.clearReset()});function Gf(u,s,o){var C,_,x,E;const c=zf(o),f=If(),w=Uf(),v=c.defaultQueryOptions(u);(_=(C=c.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||_.call(C,v),v._optimisticResults=f?"isRestoring":"optimistic",Vf(v),Qf(v,w),Hf(w);const[T]=le.useState(()=>new s(c,v)),L=T.getOptimisticResult(v);if(le.useSyncExternalStore(le.useCallback(O=>{const Q=f?()=>{}:T.subscribe(Qe.batchCalls(O));return T.updateResult(),Q},[T,f]),()=>T.getCurrentResult(),()=>T.getCurrentResult()),le.useEffect(()=>{T.setOptions(v,{listeners:!1})},[v,T]),Wf(v,L))throw Kf(v,T,w);if(Bf({result:L,errorResetBoundary:w,throwOnError:v.throwOnError,query:c.getQueryCache().get(v.queryHash)}))throw L.error;return(E=(x=c.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||E.call(x,v,L),v.notifyOnChangeProps?L:T.trackResult(L)}function fl(u,s){return Gf(u,Lf,s)}var Yf=function(){return null};const Xf=({itemsMaxCount:u,sliderMaxWidth:s})=>{let o=!0;return u===void 0&&(console.error("[SliderProduct]: itemsMaxCount is required"),o=!1),s===void 0&&(console.error("[SliderProduct]: sliderMaxWidth is required"),o=!1),o},Lt={wrap:"_wrap_ip60s_1",viewport:"_viewport_ip60s_8",grayBackground:"_grayBackground_ip60s_12",container:"_container_ip60s_25",arrowWrap:"_arrowWrap_ip60s_33",arrowNext:"_arrowNext_ip60s_38",arrowPrev:"_arrowPrev_ip60s_39",disabled:"_disabled_ip60s_83"},ht={wrap:"_wrap_wc4dm_1",image:"_image_wc4dm_17",title:"_title_wc4dm_32",content:"_content_wc4dm_49",price:"_price_wc4dm_65",rental:"_rental_wc4dm_73",unit:"_unit_wc4dm_80"},qf={image:"_image_ox479_1"},Zf="https://cdn1.idek.cz/img/2711ac4e3e85e0ac6233b02388095dbb.webp",qu=({src:u,alt:s,resolutionList:o})=>{u??(u=Zf);const c=[...o],f=c.shift();return P.jsxs("picture",{className:"r-image",children:[c.map(({width:w,height:v,maxWidth:T},L)=>P.jsx("source",{media:T?`(max-width: ${T}px)`:void 0,srcSet:u.replace(".webp",`_ew${w}_eh${v}.webp`),type:"image/webp",width:w,height:v},L)),P.jsx("img",{className:qf.image,src:u.replace(".webp",`_ew${f==null?void 0:f.width}_eh${f==null?void 0:f.height}.webp`),width:f==null?void 0:f.width,height:f==null?void 0:f.height,alt:s})]})},nr={labels:"_labels_bytsx_1",recommended:"_recommended_bytsx_12",isRecent:"_isRecent_bytsx_13",isFeatured:"_isFeatured_bytsx_14",isWhileStockLast:"_isWhileStockLast_bytsx_15",generousSeason:"_generousSeason_bytsx_35"},Jf={cz:{stocksLast:"Do vyprodání zásob",recommended:"Doporučujeme",isRecent:"Novinka",isFeatured:"Akce"},sk:{stocksLast:"Do vypredania zásob",recommended:"Odporúčame",isRecent:"Novinka",isFeatured:"Akcia"}};/*! js-cookie v3.0.5 | MIT */function Ui(u){for(var s=1;s"u")){v=Ui({},s,v),typeof v.expires=="number"&&(v.expires=new Date(Date.now()+v.expires*864e5)),v.expires&&(v.expires=v.expires.toUTCString()),f=encodeURIComponent(f).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var T="";for(var L in v)v[L]&&(T+="; "+L,v[L]!==!0&&(T+="="+v[L].split(";")[0]));return document.cookie=f+"="+u.write(w,f)+T}}function c(f){if(!(typeof document>"u"||arguments.length&&!f)){for(var w=document.cookie?document.cookie.split("; "):[],v={},T=0;Tasync function(o,c={}){const f=rh(u,o,c.search);c=ih(c);const w=await fetch(f.toString(),c);return new eh(w)};function th(){const u=pl.get("dek_eshop_token");if(!u)throw new Error("DEK Eshop token was not found.");return new Headers({Authorization:"Bearer "+u})}function nh(){const u=pl.get("dek_config");if(!u)throw new Error("DEK Config was not found.");const s=atob(u);return JSON.parse(s)}function rh(u=void 0,s,o=void 0){const c=nh(),f=u?c.api.hasOwnProperty(u)?c.api[u]:u:c.api.base,w=new URL(f+s);return o&&(w.search=o.toString()),w}function ih(u){const s={...u},o=new Headers(s.headers);return s.headers=th(),o.forEach((c,f)=>{var w;(w=s.headers)==null||w.set(f,c)}),s}function sh(u){if(!u.ok&&u.status>=500)throw new yl(u);if(!u.ok&&u.status>=400&&u.status<500)throw new ml(u);return u}const $n=class $n{};ft($n,"add",({message:s,type:o})=>{dispatchEvent(new CustomEvent("ES_ADD_MESSAGE_FLASH",{detail:{message:s,type:o}}))}),ft($n,"addByError",s=>{const o=s;console.error(o),o instanceof ml||o instanceof yl?(o instanceof ml&&$n.add({message:`Nastala neočekávaná klientská chyba. (${o.status})`,type:"error"}),o instanceof yl&&$n.add({message:`Nastala neočekávaná serverová chyba. (${o.status})`,type:"error"})):$n.add({message:"Nastala neočekávaná chyba.",type:"error"})});let rr=$n;class ir{static getConfig(){if(!this.config){const s=pl.get("dek_config");if(s===void 0)throw new Error("Config not found");try{const o=atob(s);this.config=JSON.parse(o)}catch(o){throw console.error(o),rr.add({type:"error",message:"Nepodařilo se načíst konfiguraci."}),new Error("Config is not valid")}}return this.config}static getShopId(){const s=this.getConfig().shopId;return s==="dek"?"dek_cz":s}static getLang(){switch(this.getShopId()){case"dek_cz":case"argos_cz":return"cz";case"dek_sk":return"sk";default:return"cz"}}static getSearchCompany(){switch(this.getShopId()){case"dek_cz":return"cz";case"dek_sk":return"sk";case"argos_cz":return"argos";default:return"cz"}}static getEmail(){return this.getConfig().email}static getBranchCode(){return this.getConfig().branchCode}static getBranchTitle(){return this.getConfig().branchTitle}static getApiBase(){return this.getConfig().api.base}static getApiSearch(){return this.getConfig().api.search}static isDev(){return this.getConfig().isDev}}ft(ir,"config");const lh=({product:u})=>{const s=ir.getLang(),o=Jf[s],c=()=>{switch(!0){case u.availability.isWhileStockLast:return P.jsx("div",{className:nr.isWhileStockLast,children:o.stocksLast});case u.detail.isFeatured:return P.jsx("div",{className:nr.isFeatured,children:o.isFeatured});case u.detail.isRecommended:return P.jsx("div",{className:nr.recommended,children:o.recommended});case u.detail.isRecent:return P.jsx("div",{className:nr.isRecent,children:o.isRecent});case!0:return null}};return P.jsxs("div",{className:`r-product-label ${nr.labels}`,children:[c(),u.detail.seasonPointsText&&P.jsxs("div",{className:nr.generousSeason,children:[P.jsx("img",{src:"https://cdn1.idek.cz/file/plus-white-a6e119fe.svg",width:22,height:22}),P.jsx("div",{children:u.detail.seasonPointsText})]})]})},Zu={icons:"_icons_4p8mm_1"},oh={cz:{hasVariants:"Více variant",hasGift:"Dárek k nákupu",hasPpl:"Doprava PPL"},sk:{hasVariants:"Viac variantov",hasGift:"Darček na nákup",hasPpl:"Doprava PPL"}},Ju=({product:u})=>{const s=ir.getLang(),o=oh[s];if(u.type==="eshop")return P.jsxs("div",{className:`r-product-icon ${Zu.icons}`,children:[u.detail.hasVariant&&P.jsx("img",{title:o.hasVariants,alt:o.hasVariants,src:"https://cdn1.idek.cz/img/a32ef0de7bf6d55e5b00748dfe951840_rw24.png",width:24,height:24}),u.detail.hasGift&&P.jsx("img",{alt:o.hasGift,title:o.hasGift,src:"https://cdn1.idek.cz/img/13ac7588db7f1b49cbce256f5abd255f_rw24.png",width:24,height:24}),u.detail.hasPpl&&P.jsx("img",{title:o.hasPpl,alt:o.hasPpl,src:"https://cdn1.idek.cz/img/8c6599f32f6f4d9cbc8d20951dba4952_rw24.jpg",width:24,height:24})]});if(u.type==="rental")return P.jsx("div",{className:`r-product-icon ${Zu.icons}`})};class $i{static async getProductEshopByCode(s,o){if(Array.isArray(s)||(s=[s]),s.length===0)return[];const c=vl(),f=[];f.push(...s.map(v=>["codes",v])),f.push(...o.map(v=>["parts",v]));const w=new URLSearchParams(f);try{return await(await c("/product/get-products-eshop-by-codes",{search:w})).toJson()}catch(v){rr.addByError(v)}return[]}static async getProductRentalByCode(s,o){if(Array.isArray(s)||(s=[s]),s.length===0)return[];const c=vl(),f=[];f.push(...s.map(v=>["codes",v])),f.push(...o.map(v=>["parts",v]));const w=new URLSearchParams(f);try{return await(await c("/product/get-products-rental-by-codes",{search:w})).toJson()}catch(v){rr.addByError(v)}return[]}}const uh=(u,s,o=!0)=>{const c=u.split("|");if(c.length!==3&&c.length!==4)return console.warn(`Daný text "${u}" nemá správný formát`),o?`${s} ${u}`:u;let f,w,v,T;c.length===3?([w,v,T]=c.map(C=>C.trim()),f=T):[f,w,v,T]=c.map(C=>C.trim());let L=T;return s===0&&(L=f),s===1&&(L=w),s>=2&&s<=4&&(L=v),o?`${s} ${L}`:L};class pt{static formatPrice(s,o){const c=new Intl.NumberFormat("cs-CZ",{style:"currency",currency:o}).format(s);return o==="EUR"?c.replace("€","EUR"):c.toString()}static formatUnit(s){return s.replace("m2","m²").replace("m3","m³")}static formatQuantity(s){return(Number(s)===s&&s%1!==0?s.toFixed(2):s).toLocaleString().replace(".",",")}static calculateQuantityUnitEshopToSales(s,o){const c=o.isPackagePrimary?s*1e6*(o.unitsInPackage*1e6)/1e12:s;return{unitPrimary:s,unitSecondary:o.isPackagePrimary?c:s,unitSales:c,unitPackage:o.isPackagePrimary?s:c}}static calculateQuantityUnitEshop(s,o){return pt.calculateQuantityUnitEshopToSales(s,o)}static calculateQuantityUnitEshopToPrimary(s,o){const c=o.isPackagePrimary?s*1e12/(o.unitsInPackage*1e6)/1e6:s;return{unitPrimary:c,unitSecondary:o.isPackagePrimary?s:c,unitSales:s,unitPackage:o.isPackagePrimary?c:s}}static calculateQuantityPriceEshop(s,o){const c=Math.round(o.priceNoVatPrimary*s*100)/100,f=Math.round(c*o.vat/100*100)/100,w=Math.round((c+f)*100)/100;return{priceNoVatPrimary:c,priceVatPrimary:w}}static getAvailabilityStatusByBranchCode(s,o,c){switch(s.availabilityBranchCode){case"P00":case"P01":case"P05":case"P06":return{showButton:!0,color:"green",buttonText:c,buttonColor:"green"};case"P02":case"P07":case"P08":case"P10":return{showButton:!1,color:"red"};case"P04":return{showButton:!0,color:"red",buttonText:o,buttonColor:"blue"};case"P03":return{showButton:!0,color:"blue",buttonText:o,buttonColor:"blue"};case"P09":return{showButton:!1,color:"gray"};default:return{showButton:!0,color:"blue",buttonText:o,buttonColor:"blue"}}}static addToCartEshop(s,o,c,f){window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_ESHOP",{detail:{code:s,quantitySales:o,unitSales:c,eventInvoker:f}}))}static addToCartRental(s){const{unionCode:o,quantity:c,date:f,hasGuarantee:w,typeOfRental:v,eventInvoker:T}=s;window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_RENTAL",{detail:{unionCode:o,quantity:c,quantitySales:c,dateFrom:f.from,dateTo:f.to,withGuarantee:w,typeOfRental:v,eventInvoker:T}}))}static async getProductEshopByCode(s,o){return $i.getProductEshopByCode(s,o)}static async getProductRentalByCode(s,o){return $i.getProductRentalByCode(s,o)}static calculateSeasonPoints(s,o){if(s.season===null||s.season===void 0)return 0;const c=s.season;if(c.rewardFor==="Quantity")return Math.floor(o/c.requiredQuantity)*c.rewardPoints;if(c.rewardFor==="Price"){const f=s.price.priceNoVatSales*o;return Math.floor(f/c.requiredQuantity)*c.rewardPoints}return 0}static getNumberOfDaysByTypeOfRental(s,o){if(o==="HalfDay")return"4 hodiny";const c=Math.ceil((s.to.getTime()-s.from.getTime())/864e5),f=w=>uh(ir.getLang()==="sk"?"deň | dni | dní":"den | dny | dní",w);return f(o==="FullDay"?c:c+1)}}const gl={cz:{toCart:"Do košíku",demand:"Poptat",labelAddToCart:(u,s)=>P.jsxs(P.Fragment,{children:["do košíku přidáte"," ",P.jsxs("strong",{children:[pt.formatQuantity(u)," ",pt.formatUnit(s)]})]}),addToCart:"Přidat",addedToCart:"Přidáno",unit:u=>`za ${u}`,withDPH:"s DPH"},sk:{toCart:"Do košíka",demand:"Poptať",labelAddToCart:(u,s)=>P.jsxs(P.Fragment,{children:["do košíka pridáte"," ",P.jsxs("strong",{children:[pt.formatQuantity(u)," ",pt.formatUnit(s)]})]}),addToCart:"Pridať",addedToCart:"Pridané",unit:u=>`za ${u}`,withDPH:"s DPH"}},Ze={container:"_container_uou1y_1",inputs:"_inputs_uou1y_11",quantity:"_quantity_uou1y_17",button:"_button_uou1y_25",row:"_row_uou1y_28",compact:"_compact_uou1y_33",price:"_price_uou1y_40",addToCart:"_addToCart_uou1y_52",loading:"_loading_uou1y_65",spin:"_spin_uou1y_1",input:"_input_uou1y_11",alreadyInCart:"_alreadyInCart_uou1y_94",slide:"_slide_uou1y_108"},ah={event:"recobox",recobox_pagetype:"modal_cart",recobox_boxName:"mohlo_by_se_vam_hodit"},bu=u=>{window.dataLayer??(window.dataLayer=[]),window.dataLayer.push({...ah,recobox_action:"add_to_cart",recobox_product_id:u})};let ch=(Cl=class{},ft(Cl,"getFormSize",s=>s?`dek-form-width--${s}`:""),Cl);const wl=({onChange:u,children:s,disabled:o,size:c,state:f,type:w,onChangeLazy:v,onBlur:T,...L})=>{const C=le.useId(),_=Q=>{if(!u)return;const{value:U}=Q.target;if(w==="number"){u(Number(U)||Number.NaN,Q);return}u(U,Q)},x=Q=>{if(v){const{value:U}=Q.target;if(w==="number"){v(Number(U)||Number.NaN,Q);return}v(U,Q)}T==null||T(Q)},E=ch.getFormSize(c),O=[E];return f&&O.push(f.level),P.jsxs(P.Fragment,{children:[s&&P.jsx("label",{htmlFor:C,children:s}),P.jsx("input",{id:C,role:"textbox",disabled:o,className:O.join(" "),onChange:_,onBlur:x,type:w,...L}),f&&!o&&f.message&&P.jsx("div",{className:`input-${f.level} ${E}`,children:f.message})]})},dh=u=>{const{type:s}=u;if(s==="compact")return P.jsx(hh,{...u});if(s==="slide")return P.jsx(ph,{...u});if(s==="long")return P.jsx(fh,{...u})},fh=({lang:u,product:s})=>{const{availability:o,code:c,price:f,unit:w}=s,{addToCartEshop:v,calculateQuantityPriceEshop:T,calculateQuantityUnitEshopToSales:L,formatPrice:C,formatUnit:_,getAvailabilityStatusByBranchCode:x}=pt,E=gl[u],O=le.useRef(null),[Q,U]=le.useState({unitPrimary:w.minimumCountUnitPrimary,unitSecondary:w.unitsInPackage,unitSales:w.minimumCountUnitSales}),[H,G]=le.useState({priceVatPrimary:f.priceVatPrimary}),Y=te=>{te=te{var te;v(c,Q.unitSales,w.unitSales,"long"),(te=O.current)==null||te.blur()},K=x(o,E.demand,E.toCart);return K.showButton?P.jsxs("div",{className:`r-add-to-cart-eshop-long ${Ze.container}`,children:[P.jsxs("div",{className:Ze.inputs,children:[P.jsxs("div",{className:Ze.quantity,children:[P.jsx(wl,{onChange:Y,type:"number",min:"1",value:Q.unitPrimary,autoComplete:"off"}),P.jsx("label",{children:_(w.unitPrimary)})]}),P.jsx("button",{type:"button",ref:O,role:"button",className:`dek-button-${K.buttonColor} ${Ze.button}`,onClick:b,children:K.buttonText})]}),w.isPackagePrimary&&P.jsx("div",{className:Ze.row,children:E.labelAddToCart(Q.unitSecondary,w.unitSecondary)}),P.jsxs("div",{className:Ze.row,children:[P.jsx("strong",{children:C(H.priceVatPrimary,f.currencyCode)})," ","celkem s DPH"]})]}):P.jsx("div",{className:`r-add-to-cart-eshop-long ${Ze.container}`})},hh=({lang:u,product:s})=>{const{code:o,unit:c}=s,{addToCartEshop:f,calculateQuantityPriceEshop:w,calculateQuantityUnitEshopToSales:v,formatPrice:T}=pt,L=gl[u],[C,_]=le.useState({unitPrimary:c.minimumCountUnitPrimary,unitSecondary:c.unitsInPackage,unitSales:c.minimumCountUnitSales}),[x,E]=le.useState(!1),[O,Q]=le.useState(!1),[U,H]=le.useState(s.price.priceVatPrimary),G=K=>{K=K{Q(!0),window.addEventListener("ES_ADD_TO_CART_ESHOP_AFTER",b),f(o,C.unitSales,c.unitSales,"compact")},b=K=>{s.code===K.detail.code&&(Q(!1),E(K.detail.isSuccess),K.detail.isSuccess&&bu(o),window.removeEventListener("ES_ADD_TO_CART_ESHOP_AFTER",b))};return P.jsxs("div",{className:`r-add-to-cart-eshop-compact ${Ze.compact}`,children:[P.jsxs("div",{className:Ze.price,children:[P.jsx("strong",{children:T(U,s.price.currencyCode)}),P.jsxs("div",{children:[L.unit(s.unit.unitPrimary)," ",L.withDPH]})]}),P.jsx("div",{className:Ze.addToCart,children:x?P.jsxs("div",{className:Ze.alreadyInCart,children:[P.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),P.jsx("span",{children:L.addedToCart})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:Ze.input,children:[P.jsx(wl,{type:"number",min:1,defaultValue:C.unitPrimary,onChange:G,disabled:O}),s.unit.unitPrimary]}),P.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:Y,disabled:O,children:[O&&P.jsx("span",{className:Ze.loading}),L.addToCart]})]})})]})},ph=({lang:u,product:s})=>{const o=gl[u],c=()=>{const f=s.unit.isPackagePrimary?s.unit.minimumCountUnitSales:s.unit.minimumCountUnitPrimary;pt.addToCartEshop(s.code,f,s.unit.unitSales,"slide")};return P.jsx("div",{className:`r-add-to-cart-eshop-slide ${Ze.slide}`,children:P.jsx("button",{type:"button",role:"button",onClick:c,className:`dek-button-green dek-button-small ${Ze.button}`,children:o.toCart})})},Sl={cz:{toDetail:"Detail zapůjčení",unit:u=>`za ${u}`,withDPH:"s DPH",addToCart:"Přidat",addedToCart:"Přidáno"},sk:{toDetail:"Detail zapožičania",unit:u=>`za ${u}`,withDPH:"s DPH",addToCart:"Pridať",addedToCart:"Pridané"}},Dt={container:"_container_1t3c4_1",topDivider:"_topDivider_1t3c4_4",button:"_button_1t3c4_9",compact:"_compact_1t3c4_16",price:"_price_1t3c4_23",addToCart:"_addToCart_1t3c4_35",loading:"_loading_1t3c4_48",spin:"_spin_1t3c4_1",input:"_input_1t3c4_68",alreadyInCart:"_alreadyInCart_1t3c4_77"},mh=(u,s)=>`/produkty/detail/${u}${s?`-${s}`:""}`,kl=(u,s)=>`/pujcovna/detail/${u.replace("|","/")}${s?`-${s}`:""}`,yh=u=>{const{type:s}=u;if(s==="compact")return P.jsx(wh,{...u});if(s==="long")return P.jsx(gh,{...u});if(s==="slide")return P.jsx(vh,{...u})},vh=({product:u,lang:s})=>{const o=Sl[s];return P.jsx("div",{className:`r-add-to-cart-rental-slide ${Dt.container}`,children:P.jsx("a",{role:"button",className:`dek-button dek-button-green dek-button-small ${Dt.button}`,href:kl(u.code,u.detail.slug),children:o.toDetail})})},gh=({product:u,lang:s})=>{const o=Sl[s];return P.jsx("div",{className:`r-add-to-cart-rental-long ${Dt.container} ${Dt.topDivider}`,children:P.jsx("a",{role:"button",className:`dek-button dek-button-green ${Dt.button}`,href:kl(u.code,u.detail.slug),children:o.toDetail})})},wh=({product:u,lang:s,date:o,hasGuarantee:c,typeOfRental:f})=>{const{formatPrice:w}=pt,v=Sl[s],[T,L]=le.useState(1),[C,_]=le.useState(u.detail.priceVatOrigin),[x,E]=le.useState(!1),[O,Q]=le.useState(!1),U=Y=>{L(Y),_(Y*u.detail.priceVatOrigin)},H=()=>{Q(!0),window.addEventListener("ES_ADD_TO_CART_RENTAL_AFTER",G),pt.addToCartRental({unionCode:u.code,quantity:T,date:o,hasGuarantee:c,typeOfRental:f,eventInvoker:"compact"})},G=Y=>{u.code===Y.detail.unionCode&&(Q(!1),E(Y.detail.isSuccess),Y.detail.isSuccess&&bu(u.code),window.removeEventListener("ES_ADD_TO_CART_RENTAL_AFTER",G))};return P.jsxs("div",{className:`r-add-to-cart-rental-compact ${Dt.compact}`,children:[P.jsxs("div",{className:Dt.price,children:[P.jsx("strong",{children:w(C,u.detail.currencyCode)}),P.jsxs("div",{children:[v.unit(u.detail.unitPrice)," ",v.withDPH]})]}),P.jsx("div",{className:Dt.addToCart,children:x?P.jsxs("div",{className:Dt.alreadyInCart,children:[P.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),P.jsx("span",{children:v.addedToCart})]}):P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:Dt.input,children:[P.jsx(wl,{type:"number",min:1,defaultValue:T,onChange:U,disabled:O}),u.detail.unitQuantity]}),P.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:H,disabled:O,children:[O&&P.jsx("span",{className:Dt.loading}),v.addToCart]})]})})]})},Sh=({product:u,showAddToCartButton:s,lang:o})=>{const c=[{width:225,height:135},{width:320,height:192,maxWidth:680},{width:225,height:135,maxWidth:490},{width:170,height:170,maxWidth:370}];if(u.type==="eshop")return P.jsx(kh,{product:u,lang:o,resolutionList:c,showAddToCartButton:s});if(u.type==="rental")return P.jsx(Ch,{product:u,lang:o,resolutionList:c,showAddToCartButton:s})},kh=({product:u,lang:s,resolutionList:o,showAddToCartButton:c})=>{const f=mh(u.code,u.detail.slug),w=pt.formatPrice(u.price.priceVatPrimary,u.price.currencyCode).split(",");return P.jsxs("div",{className:`r-product-preview-slide ${ht.wrap}`,children:[P.jsxs("a",{href:f,className:ht.image,children:[P.jsx(lh,{product:u}),P.jsx(Ju,{product:u}),P.jsx(qu,{src:u.detail.image,alt:u.detail.title,resolutionList:o})]}),P.jsxs("div",{className:ht.content,children:[P.jsxs("a",{href:f,children:[P.jsx("span",{className:ht.title,children:u.detail.title}),P.jsxs("div",{children:[P.jsxs("div",{className:ht.price,children:[w[0],P.jsxs("span",{children:[",",w[1]]})]}),P.jsxs("div",{className:ht.unit,children:["cena za"," ",u.unit.unitPrimary," ","s DPH"]})]})]}),c&&P.jsx(dh,{lang:s,product:u,type:"slide"})]})]})},Ch=({product:u,lang:s,resolutionList:o,showAddToCartButton:c})=>{const f=kl(u.code,u.detail.slug),w=pt.formatPrice(u.detail.priceNoVatOrigin,u.detail.currencyCode).split(",");return P.jsxs("div",{className:`r-product-preview-slide ${ht.wrap} ${ht.rental}`,children:[P.jsxs("a",{href:f,className:ht.image,children:[P.jsx(Ju,{product:u}),P.jsx(qu,{src:u.detail.image,alt:u.detail.title,resolutionList:o})]}),P.jsxs("div",{className:ht.content,children:[P.jsxs("a",{href:f,children:[P.jsx("span",{className:ht.title,children:u.detail.title}),P.jsxs("div",{children:[P.jsxs("div",{className:ht.price,children:[w[0],P.jsxs("span",{children:[",",w[1]]})]}),P.jsxs("div",{className:ht.unit,children:["cena za"," ",u.detail.unitPrice," ","s DPH"]})]})]}),c&&P.jsx(yh,{type:"slide",lang:s,product:u})]})]})};let Qi,Hi;const ea=u=>{const s=u.touches[0];Qi=s.clientX,Hi=s.clientY},_h=(u,s)=>{var v,T,L,C;if(!Qi||!Hi)return;const o=u.touches[0].clientX,c=u.touches[0].clientY,f=Qi-o,w=Hi-c;Math.abs(f)>Math.abs(w)?f>0?(v=s.onRight)==null||v.call(s):(T=s.onLeft)==null||T.call(s):w>0?(L=s.onDown)==null||L.call(s):(C=s.onUp)==null||C.call(s),Qi=void 0,Hi=void 0},Ph=(u,s)=>{le.useEffect(()=>{if(u==null)return;const o=c=>_h(c,s);return u.addEventListener("touchstart",ea,!1),u.addEventListener("touchmove",o,!1),()=>{u.removeEventListener("touchstart",ea,!1),u.removeEventListener("touchmove",o,!1)}},[u,s])},ta=u=>{const{productList:s,sliderMaxWidth:o,itemsMaxCount:c,hasGrayBackground:f,showAddToCart:w,loadingState:v}=u,T=ir.getLang(),L=le.useRef(null),C=le.useRef(null),_=le.useRef(null),[x,E]=le.useState(0),[O,Q]=le.useState(0),[U,H]=le.useState(!1),[G,Y]=le.useState(0);le.useEffect(()=>{const He=()=>{if(!L.current||!C.current||!_.current||!s)return;const et=L.current.offsetWidth??0,Be=C.current.offsetWidth??0,_t=et-Be,Pe=(o-_t)/c,F=Math.floor(Be/Pe),X=Be/F,M=X*s.length;E(M),Q(Be/Math.floor(Be/X)),H(!0),Y(0)};return He(),window.addEventListener("resize",He),()=>{window.removeEventListener("resize",He)}},[o,c,s]);const b=L.current?L.current.offsetWidth:0,K=C.current?C.current.offsetWidth:0,te=b-K,ae=Math.abs(G)+K{ae&&Y(G-K)},Ne=()=>{ve&&Y(G+K)},lt=(te/2+12)*-1,qt=lt;return Ph(C.current,{onRight:J,onLeft:Ne}),v?P.jsx("div",{className:`r-slider-product ${Lt.wrap} ${f?Lt.grayBackground:""}`,style:{maxWidth:o},children:P.jsx("div",{className:Lt.viewport,children:P.jsx("div",{className:`${Lt.container} loading`,style:{transform:`translateX(${G}px)`,width:o,height:300}})})}):P.jsxs("div",{ref:L,className:`r-slider-product ${Lt.wrap} ${f?Lt.grayBackground:""}`,style:{maxWidth:o},children:[P.jsxs("div",{className:Lt.arrowWrap,children:[ve&&P.jsx("div",{className:Lt.arrowPrev,style:{left:qt},onClick:Ne}),ae&&P.jsx("div",{className:Lt.arrowNext,style:{right:lt},onClick:J})]}),P.jsx("div",{ref:C,className:Lt.viewport,children:P.jsx("div",{ref:_,className:Lt.container,style:{transform:`translateX(${G}px)`,width:x},children:U&&s.map(He=>P.jsx("div",{style:{width:O},children:P.jsx(Sh,{product:He,lang:T,showAddToCartButton:w})},He.code))})})]})};(function(){var u=/\[object (Boolean|Number|String|Function|Array|Date|RegExp|Arguments)\]/;function s(C){return C==null?String(C):(C=u.exec(Object.prototype.toString.call(Object(C))))?C[1].toLowerCase():"object"}function o(C,_){return Object.prototype.hasOwnProperty.call(Object(C),_)}function c(C){if(!C||s(C)!="object"||C.nodeType||C==C.window)return!1;try{if(C.constructor&&!o(C,"constructor")&&!o(C.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(var _ in C);return _===void 0||o(C,_)}function f(C,_){var x={},E=x;C=C.split(".");for(var O=0;Othis.showMessageFlash(o)),this}addHandlerMessageError(s,o){return this.addHandlerMessage(s,{message:o,type:"error"}),this}createDefaultMessage(s){return{message:`Nastala neočekávaná chyba při požadavku na server: ${s}`,type:"error"}}async run(){const s=this.response.clone(),o=this.hasHandlers(this.statusCode,this.statusWildCard);if(o&&await this.runHandlers(this.statusCode,this.statusWildCard,s),!o&&this.statusCode>=400){const c=this.createDefaultMessage(this.statusCode);await this.showMessageFlash(c)}}hasHandlers(s,o){return this.handlerList[s]!==void 0||!!this.handlerList[o]}async runHandlers(s,o,c){var f,w;if(this.hasHandlers(s,o)){(f=this.handlerList)[s]??(f[s]=[]),(w=this.handlerList)[o]??(w[o]=[]);for(const v of this.handlerList[s])v&&await v(c.clone());for(const v of this.handlerList[o])v&&await v(c.clone())}}async showMessageFlash(s){rr.add(s)}}const Eh="6682bb8f11e5033d357e8f6f",Nh={3:"667bfe4bed72c377f239df32",5:"667bfe7edb522e854d477246",6:"667bfed80d7c5faafbdb4b93",22:"667bfe7edb522e854d477240",31:"667bfc511995e7a169eae95c"},Th=u=>u!==void 0?Nh[u]:Eh,Rh=async u=>(await Lh(u?`lastVisitedProductsAtSection_${u}`:"lastVisitedProductsAll")).exponea.filter(o=>o!=="None")??[],jh=async u=>{const s=Th(u);if(!s)return[];const c=await vl()(`/product/get-best-seller-product-code-eshop-list?analysisId=${s}`),f=[],w=new xh(c.response);if(w.addHandler("2xx",async v=>{f.push(...await v.json())}),ir.isDev()){const v="Nastala neočekávaná chyba při načítání produktů pro ReactProductSliderUserTarget.";w.addHandlerMessageError("4xx",v).addHandlerMessageError("5xx",v)}else w.addHandler("4xx",void 0).addHandler("5xx",void 0);return await w.run(),[...new Set(f)]},Lh=async u=>{if(window.dataLayer===void 0)return console.warn("[ReactProductSliderUserTarget]: dataLayer not found"),{event:u,exponea:[]};const o=window.dataLayer.find(c=>c.event===u);return o!==void 0?o:new Promise(c=>{const f=setTimeout(()=>{console.warn(`[ReactProductSliderUserTarget]: dataLayer event '${u}' not found`),c({event:u,exponea:[]})},1e3);new DataLayerHelper(window.dataLayer,{listener:(w,v)=>{"event"in v&&v.event===u&&(clearTimeout(f),c(v))},listenToPast:!0})})},Dh=({sectionId:u,...s})=>{const o=Xf({...s}),c=fl({queryKey:["dataLayerProductCodeList",u],queryFn:async()=>Rh(u),enabled:o}),f=fl({queryKey:["fillOutProductCodeList",u],queryFn:async()=>jh(u),enabled:o}),w=[];c.isSuccess&&w.push(...c.data),f.isSuccess&&w.push(...f.data);const v=Array.from(new Set(w)).splice(0,14),T=fl({queryKey:["productList",v],queryFn:async()=>Oh(v),enabled:o&&!c.isLoading&&!f.isLoading&&v.length>0}),L=P.jsx("div",{className:"r-a-product-slider-user-target",children:P.jsx(ta,{...s,loadingState:!0})});return o?c.isLoading||f.isLoading?L:v.length<=0?null:T.isLoading?L:T.isSuccess?P.jsx("div",{className:"r-a-product-slider-user-target",children:P.jsx(ta,{productList:T.data,...s})}):null:null},Oh=async u=>{const s=u.filter(w=>w.length===10),o=u.filter(w=>w.length===7),c=await $i.getProductEshopByCode(s,["detail","availability","price","unit"]),f=await $i.getProductRentalByCode(o,["detail","price"]);return[...c,...f].filter(Boolean)},zh=new jf({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,retry:!1}}});function Fh(u,s){el.createRoot(document.getElementById(u)).render(P.jsx(le.StrictMode,{children:P.jsxs(Ff,{client:zh,children:[P.jsx(Dh,{...s}),P.jsx(Yf,{})]})}))}return Fh}); //# sourceMappingURL=index.umd.cjs.map