function Wd(e,t){for(var n=0;nr[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function Hd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ru={exports:{}},Ul={},lu={exports:{}},F={};/** * @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 Pr=Symbol.for("react.element"),Qd=Symbol.for("react.portal"),Kd=Symbol.for("react.fragment"),bd=Symbol.for("react.strict_mode"),Gd=Symbol.for("react.profiler"),Yd=Symbol.for("react.provider"),Xd=Symbol.for("react.context"),Zd=Symbol.for("react.forward_ref"),Jd=Symbol.for("react.suspense"),ef=Symbol.for("react.memo"),tf=Symbol.for("react.lazy"),Mo=Symbol.iterator;function nf(e){return e===null||typeof e!="object"?null:(e=Mo&&e[Mo]||e["@@iterator"],typeof e=="function"?e:null)}var su={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iu=Object.assign,ou={};function Mn(e,t,n){this.props=e,this.context=t,this.refs=ou,this.updater=n||su}Mn.prototype.isReactComponent={};Mn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Mn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function au(){}au.prototype=Mn.prototype;function Ii(e,t,n){this.props=e,this.context=t,this.refs=ou,this.updater=n||su}var Mi=Ii.prototype=new au;Mi.constructor=Ii;iu(Mi,Mn.prototype);Mi.isPureReactComponent=!0;var Fo=Array.isArray,uu=Object.prototype.hasOwnProperty,Fi={current:null},cu={key:!0,ref:!0,__self:!0,__source:!0};function du(e,t,n){var r,l={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)uu.call(t,r)&&!cu.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,X=C[V];if(0>>1;Vl(ss,I))$tl(Or,ss)?(C[V]=Or,C[$t]=I,V=$t):(C[V]=ss,C[Ot]=I,V=Ot);else if($tl(Or,I))C[V]=Or,C[$t]=I,V=$t;else break e}}return z}function l(C,z){var I=C.sortIndex-z.sortIndex;return I!==0?I:C.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],c=[],g=1,m=null,v=3,w=!1,d=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(C){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=C)r(c),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(c)}}function x(C){if(j=!1,p(C),!d)if(n(u)!==null)d=!0,tn(S);else{var z=n(c);z!==null&&T(x,z.startTime-C)}}function S(C,z){d=!1,j&&(j=!1,h(E),E=-1),w=!0;var I=v;try{for(p(z),m=n(u);m!==null&&(!(m.expirationTime>z)||C&&!ee());){var V=m.callback;if(typeof V=="function"){m.callback=null,v=m.priorityLevel;var X=V(m.expirationTime<=z);z=e.unstable_now(),typeof X=="function"?m.callback=X:m===n(u)&&r(u),p(z)}else r(u);m=n(u)}if(m!==null)var Fr=!0;else{var Ot=n(c);Ot!==null&&T(x,Ot.startTime-z),Fr=!1}return Fr}finally{m=null,v=I,w=!1}}var _=!1,P=null,E=-1,O=5,L=-1;function ee(){return!(e.unstable_now()-LC||125V?(C.sortIndex=I,t(c,C),n(u)===null&&C===n(c)&&(j?(h(E),E=-1):j=!0,T(x,I-V))):(C.sortIndex=X,t(u,C),d||w||(d=!0,tn(S))),C},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(C){var z=v;return function(){var I=v;v=z;try{return C.apply(this,arguments)}finally{v=I}}}})(vu);gu.exports=vu;var mf=gu.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 gf=y,Pe=mf;function N(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"),Fs=Object.prototype.hasOwnProperty,vf=/^[: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]*$/,$o={},Do={};function yf(e){return Fs.call(Do,e)?!0:Fs.call($o,e)?!1:vf.test(e)?Do[e]=!0:($o[e]=!0,!1)}function xf(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 jf(e,t,n,r){if(t===null||typeof t>"u"||xf(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 xe(e,t,n,r,l,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ce={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ce[e]=new xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ce[t]=new xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ce[e]=new xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ce[e]=new xe(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){ce[e]=new xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ce[e]=new xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ce[e]=new xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ce[e]=new xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ce[e]=new xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var $i=/[\-:]([a-z])/g;function Di(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($i,Di);ce[t]=new xe(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($i,Di);ce[t]=new xe(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($i,Di);ce[t]=new xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ce[e]=new xe(e,1,!1,e.toLowerCase(),null,!1,!1)});ce.xlinkHref=new xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ce[e]=new xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ui(e,t,n,r){var l=ce.hasOwnProperty(t)?ce[t]:null;(l!==null?l.type!==0:r||!(2a||l[o]!==s[a]){var u=` `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{as=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gn(e):""}function wf(e){switch(e.tag){case 5:return Gn(e.type);case 16:return Gn("Lazy");case 13:return Gn("Suspense");case 19:return Gn("SuspenseList");case 0:case 2:case 15:return e=us(e.type,!1),e;case 11:return e=us(e.type.render,!1),e;case 1:return e=us(e.type,!0),e;default:return""}}function Us(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 on:return"Fragment";case sn:return"Portal";case Os:return"Profiler";case Ai:return"StrictMode";case $s:return"Suspense";case Ds:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ju:return(e.displayName||"Context")+".Consumer";case xu:return(e._context.displayName||"Context")+".Provider";case Bi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vi:return t=e.displayName||null,t!==null?t:Us(e.type)||"Memo";case ut:t=e._payload,e=e._init;try{return Us(e(t))}catch{}}return null}function Nf(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 Us(t);case 8:return t===Ai?"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 Et(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kf(e){var t=Nu(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 l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ur(e){e._valueTracker||(e._valueTracker=kf(e))}function ku(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Nu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fl(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 As(e,t){var n=t.checked;return b({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ao(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Et(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 Su(e,t){t=t.checked,t!=null&&Ui(e,"checked",t,!1)}function Bs(e,t){Su(e,t);var n=Et(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")?Vs(e,t.type,n):t.hasOwnProperty("defaultValue")&&Vs(e,t.type,Et(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bo(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 Vs(e,t,n){(t!=="number"||fl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ur(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jn={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},Sf=["Webkit","ms","Moz","O"];Object.keys(Jn).forEach(function(e){Sf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jn[t]=Jn[e]})});function Pu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jn.hasOwnProperty(e)&&Jn[e]?(""+t).trim():t+"px"}function Ru(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Pu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ef=b({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 Hs(e,t){if(t){if(Ef[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Qs(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 Ks=null;function qi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bs=null,xn=null,jn=null;function Wo(e){if(e=Tr(e)){if(typeof bs!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Wl(t),bs(e.stateNode,e.type,t))}}function Lu(e){xn?jn?jn.push(e):jn=[e]:xn=e}function Tu(){if(xn){var e=xn,t=jn;if(jn=xn=null,Wo(e),t)for(e=0;e>>=0,e===0?32:31-(Of(e)/$f|0)|0}var Br=64,Vr=4194304;function Xn(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 gl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Xn(a):(s&=o,s!==0&&(r=Xn(s)))}else o=n&~l,o!==0?r=Xn(o):s!==0&&(r=Xn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&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 Rr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Be(t),e[t]=n}function Bf(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=tr),Jo=" ",ea=!1;function Xu(e,t){switch(e){case"keyup":return mp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var an=!1;function vp(e,t){switch(e){case"compositionend":return Zu(t);case"keypress":return t.which!==32?null:(ea=!0,Jo);case"textInput":return e=t.data,e===Jo&&ea?null:e;default:return null}}function yp(e,t){if(an)return e==="compositionend"||!Xi&&Xu(e,t)?(e=Gu(),rl=bi=pt=null,an=!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=la(n)}}function nc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rc(){for(var e=window,t=fl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fl(e.document)}return t}function Zi(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 _p(e){var t=rc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&nc(n.ownerDocument.documentElement,n)){if(r!==null&&Zi(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 l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=sa(n,s);var o=sa(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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,un=null,ei=null,rr=null,ti=!1;function ia(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||un==null||un!==fl(r)||(r=un,"selectionStart"in r&&Zi(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}),rr&&mr(rr,r)||(rr=r,r=xl(ei,"onSelect"),0fn||(e.current=oi[fn],oi[fn]=null,fn--)}function B(e,t){fn++,oi[fn]=e.current,e.current=t}var Ct={},me=Rt(Ct),Ne=Rt(!1),Kt=Ct;function Cn(e,t){var n=e.type.contextTypes;if(!n)return Ct;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ke(e){return e=e.childContextTypes,e!=null}function wl(){W(Ne),W(me)}function pa(e,t,n){if(me.current!==Ct)throw Error(N(168));B(me,t),B(Ne,n)}function fc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(N(108,Nf(e)||"Unknown",l));return b({},n,r)}function Nl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ct,Kt=me.current,B(me,e),B(Ne,Ne.current),!0}function ha(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=fc(e,t,Kt),r.__reactInternalMemoizedMergedChildContext=e,W(Ne),W(me),B(me,e)):W(Ne),B(Ne,n)}var Xe=null,Hl=!1,ks=!1;function pc(e){Xe===null?Xe=[e]:Xe.push(e)}function Up(e){Hl=!0,pc(e)}function Lt(){if(!ks&&Xe!==null){ks=!0;var e=0,t=A;try{var n=Xe;for(A=1;e>=o,l-=o,Ze=1<<32-Be(t)+l|n<E?(O=P,P=null):O=P.sibling;var L=v(h,P,p[E],x);if(L===null){P===null&&(P=O);break}e&&P&&L.alternate===null&&t(h,P),f=s(L,f,E),_===null?S=L:_.sibling=L,_=L,P=O}if(E===p.length)return n(h,P),H&&Dt(h,E),S;if(P===null){for(;EE?(O=P,P=null):O=P.sibling;var ee=v(h,P,L.value,x);if(ee===null){P===null&&(P=O);break}e&&P&&ee.alternate===null&&t(h,P),f=s(ee,f,E),_===null?S=ee:_.sibling=ee,_=ee,P=O}if(L.done)return n(h,P),H&&Dt(h,E),S;if(P===null){for(;!L.done;E++,L=p.next())L=m(h,L.value,x),L!==null&&(f=s(L,f,E),_===null?S=L:_.sibling=L,_=L);return H&&Dt(h,E),S}for(P=r(h,P);!L.done;E++,L=p.next())L=w(P,h,E,L.value,x),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?E:L.key),f=s(L,f,E),_===null?S=L:_.sibling=L,_=L);return e&&P.forEach(function(oe){return t(h,oe)}),H&&Dt(h,E),S}function k(h,f,p,x){if(typeof p=="object"&&p!==null&&p.type===on&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Dr:e:{for(var S=p.key,_=f;_!==null;){if(_.key===S){if(S=p.type,S===on){if(_.tag===7){n(h,_.sibling),f=l(_,p.props.children),f.return=h,h=f;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ut&&va(S)===_.type){n(h,_.sibling),f=l(_,p.props),f.ref=Wn(h,_,p),f.return=h,h=f;break e}n(h,_);break}else t(h,_);_=_.sibling}p.type===on?(f=Qt(p.props.children,h.mode,x,p.key),f.return=h,h=f):(x=dl(p.type,p.key,p.props,null,h.mode,x),x.ref=Wn(h,f,p),x.return=h,h=x)}return o(h);case sn:e:{for(_=p.key;f!==null;){if(f.key===_)if(f.tag===4&&f.stateNode.containerInfo===p.containerInfo&&f.stateNode.implementation===p.implementation){n(h,f.sibling),f=l(f,p.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ts(p,h.mode,x),f.return=h,h=f}return o(h);case ut:return _=p._init,k(h,f,_(p._payload),x)}if(Yn(p))return d(h,f,p,x);if(Un(p))return j(h,f,p,x);Gr(h,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,p),f.return=h,h=f):(n(h,f),f=Ls(p,h.mode,x),f.return=h,h=f),o(h)):n(h,f)}return k}var Pn=vc(!0),yc=vc(!1),El=Rt(null),Cl=null,mn=null,no=null;function ro(){no=mn=Cl=null}function lo(e){var t=El.current;W(El),e._currentValue=t}function ci(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 Nn(e,t){Cl=e,no=mn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(we=!0),e.firstContext=null)}function Fe(e){var t=e._currentValue;if(no!==e)if(e={context:e,memoizedValue:t,next:null},mn===null){if(Cl===null)throw Error(N(308));mn=e,Cl.dependencies={lanes:0,firstContext:e}}else mn=mn.next=e;return t}var Bt=null;function so(e){Bt===null?Bt=[e]:Bt.push(e)}function xc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,so(t)):(n.next=l.next,l.next=n),t.interleaved=n,rt(e,r)}function rt(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 ct=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jc(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 et(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,rt(e,n)}return l=r.interleaved,l===null?(t.next=t,so(r)):(t.next=l.next,l.next=t),r.interleaved=t,rt(e,n)}function sl(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,Hi(e,n)}}function ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,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 _l(e,t,n,r){var l=e.updateQueue;ct=!1;var s=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==o&&(a===null?g.firstBaseUpdate=c:a.next=c,g.lastBaseUpdate=u))}if(s!==null){var m=l.baseState;o=0,g=c=u=null,a=s;do{var v=a.lane,w=a.eventTime;if((r&v)===v){g!==null&&(g=g.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var d=e,j=a;switch(v=t,w=n,j.tag){case 1:if(d=j.payload,typeof d=="function"){m=d.call(w,m,v);break e}m=d;break e;case 3:d.flags=d.flags&-65537|128;case 0:if(d=j.payload,v=typeof d=="function"?d.call(w,m,v):d,v==null)break e;m=b({},m,v);break e;case 2:ct=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,v=l.effects,v===null?l.effects=[a]:v.push(a))}else w={eventTime:w,lane:v,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(c=g=w,u=m):g=g.next=w,o|=v;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;v=a,a=v.next,v.next=null,l.lastBaseUpdate=v,l.shared.pending=null}}while(!0);if(g===null&&(u=m),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=g,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Yt|=o,e.lanes=o,e.memoizedState=m}}function xa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Es.transition;Es.transition={};try{e(!1),t()}finally{A=n,Es.transition=r}}function $c(){return Oe().memoizedState}function qp(e,t,n){var r=Nt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dc(e))Uc(t,n);else if(n=xc(e,t,n,r),n!==null){var l=ve();Ve(n,e,r,l),Ac(n,t,r)}}function Wp(e,t,n){var r=Nt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dc(e))Uc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(l.hasEagerState=!0,l.eagerState=a,qe(a,o)){var u=t.interleaved;u===null?(l.next=l,so(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=xc(e,t,l,r),n!==null&&(l=ve(),Ve(n,e,r,l),Ac(n,t,r))}}function Dc(e){var t=e.alternate;return e===K||t!==null&&t===K}function Uc(e,t){lr=Rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ac(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hi(e,n)}}var Ll={readContext:Fe,useCallback:fe,useContext:fe,useEffect:fe,useImperativeHandle:fe,useInsertionEffect:fe,useLayoutEffect:fe,useMemo:fe,useReducer:fe,useRef:fe,useState:fe,useDebugValue:fe,useDeferredValue:fe,useTransition:fe,useMutableSource:fe,useSyncExternalStore:fe,useId:fe,unstable_isNewReconciler:!1},Hp={readContext:Fe,useCallback:function(e,t){return He().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:wa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ol(4194308,4,zc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ol(4194308,4,e,t)},useInsertionEffect:function(e,t){return ol(4,2,e,t)},useMemo:function(e,t){var n=He();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=He();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=qp.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=He();return e={current:e},t.memoizedState=e},useState:ja,useDebugValue:mo,useDeferredValue:function(e){return He().memoizedState=e},useTransition:function(){var e=ja(!1),t=e[0];return e=Vp.bind(null,e[1]),He().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=K,l=He();if(H){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),ie===null)throw Error(N(349));Gt&30||Sc(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,wa(Cc.bind(null,r,s,e),[e]),r.flags|=2048,kr(9,Ec.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=He(),t=ie.identifierPrefix;if(H){var n=Je,r=Ze;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Qe]=t,e[yr]=r,Yc(e,t,!1,!1),t.stateNode=e;e:{switch(o=Qs(n,r),n){case"dialog":q("cancel",e),q("close",e),l=r;break;case"iframe":case"object":case"embed":q("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,Hn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Pl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!H)return pe(t),null}else 2*Z()-s.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,Hn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Z(),t.sibling=null,n=Q.current,B(Q,r?n&1|2:n&1),t):(pe(t),null);case 22:case 23:return wo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ee&1073741824&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function Jp(e,t){switch(eo(t),t.tag){case 1:return ke(t.type)&&wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rn(),W(Ne),W(me),uo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ao(t),null;case 13:if(W(Q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));_n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(Q),null;case 4:return Rn(),null;case 10:return lo(t.type._context),null;case 22:case 23:return wo(),null;case 24:return null;default:return null}}var Xr=!1,he=!1,eh=typeof WeakSet=="function"?WeakSet:Set,R=null;function gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){G(e,t,r)}else n.current=null}function xi(e,t,n){try{n()}catch(r){G(e,t,r)}}var za=!1;function th(e,t){if(ni=vl,e=rc(),Zi(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 l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,g=0,m=e,v=null;t:for(;;){for(var w;m!==n||l!==0&&m.nodeType!==3||(a=o+l),m!==s||r!==0&&m.nodeType!==3||(u=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(w=m.firstChild)!==null;)v=m,m=w;for(;;){if(m===e)break t;if(v===n&&++c===l&&(a=o),v===s&&++g===r&&(u=o),(w=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=w}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ri={focusedElem:e,selectionRange:n},vl=!1,R=t;R!==null;)if(t=R,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,R=e;else for(;R!==null;){t=R;try{var d=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var j=d.memoizedProps,k=d.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?j:De(t.type,j),k);h.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(x){G(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,R=e;break}R=t.return}return d=za,za=!1,d}function sr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&xi(t,n,s)}l=l.next}while(l!==r)}}function bl(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 ji(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 Jc(e){var t=e.alternate;t!==null&&(e.alternate=null,Jc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qe],delete t[yr],delete t[ii],delete t[$p],delete t[Dp])),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 ed(e){return e.tag===5||e.tag===3||e.tag===4}function Ia(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ed(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 wi(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=jl));else if(r!==4&&(e=e.child,e!==null))for(wi(e,t,n),e=e.sibling;e!==null;)wi(e,t,n),e=e.sibling}function Ni(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(Ni(e,t,n),e=e.sibling;e!==null;)Ni(e,t,n),e=e.sibling}var ae=null,Ue=!1;function ot(e,t,n){for(n=n.child;n!==null;)td(e,t,n),n=n.sibling}function td(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount=="function")try{Ke.onCommitFiberUnmount(Al,n)}catch{}switch(n.tag){case 5:he||gn(n,t);case 6:var r=ae,l=Ue;ae=null,ot(e,t,n),ae=r,Ue=l,ae!==null&&(Ue?(e=ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ae.removeChild(n.stateNode));break;case 18:ae!==null&&(Ue?(e=ae,n=n.stateNode,e.nodeType===8?Ns(e.parentNode,n):e.nodeType===1&&Ns(e,n),pr(e)):Ns(ae,n.stateNode));break;case 4:r=ae,l=Ue,ae=n.stateNode.containerInfo,Ue=!0,ot(e,t,n),ae=r,Ue=l;break;case 0:case 11:case 14:case 15:if(!he&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&xi(n,t,o),l=l.next}while(l!==r)}ot(e,t,n);break;case 1:if(!he&&(gn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){G(n,t,a)}ot(e,t,n);break;case 21:ot(e,t,n);break;case 22:n.mode&1?(he=(r=he)||n.memoizedState!==null,ot(e,t,n),he=r):ot(e,t,n);break;default:ot(e,t,n)}}function Ma(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eh),t.forEach(function(r){var l=ch.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function $e(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~s}if(r=l,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rh(r/1960))-r,10e?16:e,ht===null)var r=!1;else{if(e=ht,ht=null,Il=0,$&6)throw Error(N(331));var l=$;for($|=4,R=e.current;R!==null;){var s=R,o=s.child;if(R.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uZ()-xo?Ht(e,0):yo|=n),Se(e,t)}function ud(e,t){t===0&&(e.mode&1?(t=Vr,Vr<<=1,!(Vr&130023424)&&(Vr=4194304)):t=1);var n=ve();e=rt(e,t),e!==null&&(Rr(e,t,n),Se(e,n))}function uh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ud(e,n)}function ch(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),ud(e,n)}var cd;cd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ne.current)we=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return we=!1,Xp(e,t,n);we=!!(e.flags&131072)}else we=!1,H&&t.flags&1048576&&hc(t,Sl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;al(e,t),e=t.pendingProps;var l=Cn(t,me.current);Nn(t,n),l=fo(null,t,r,e,l,n);var s=po();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ke(r)?(s=!0,Nl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,io(t),l.updater=Kl,t.stateNode=l,l._reactInternals=t,fi(t,r,e,n),t=mi(null,t,r,!0,s,n)):(t.tag=0,H&&s&&Ji(t),ge(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(al(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=fh(r),e=De(r,e),l){case 0:t=hi(null,t,r,e,n);break e;case 1:t=Ra(null,t,r,e,n);break e;case 11:t=_a(null,t,r,e,n);break e;case 14:t=Pa(null,t,r,De(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:De(r,l),hi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:De(r,l),Ra(e,t,r,l,n);case 3:e:{if(Kc(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,l=s.element,jc(e,t),_l(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Ln(Error(N(423)),t),t=La(e,t,r,n,l);break e}else if(r!==l){l=Ln(Error(N(424)),t),t=La(e,t,r,n,l);break e}else for(Ce=xt(t.stateNode.containerInfo.firstChild),_e=t,H=!0,Ae=null,n=yc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_n(),r===l){t=lt(e,t,n);break e}ge(e,t,r,n)}t=t.child}return t;case 5:return wc(t),e===null&&ui(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,o=l.children,li(r,l)?o=null:s!==null&&li(r,s)&&(t.flags|=32),Qc(e,t),ge(e,t,o,n),t.child;case 6:return e===null&&ui(t),null;case 13:return bc(e,t,n);case 4:return oo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pn(t,null,r,n):ge(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:De(r,l),_a(e,t,r,l,n);case 7:return ge(e,t,t.pendingProps,n),t.child;case 8:return ge(e,t,t.pendingProps.children,n),t.child;case 12:return ge(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,o=l.value,B(El,r._currentValue),r._currentValue=o,s!==null)if(qe(s.value,o)){if(s.children===l.children&&!Ne.current){t=lt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=et(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ci(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(N(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ci(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ge(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=Fe(l),r=r(l),t.flags|=1,ge(e,t,r,n),t.child;case 14:return r=t.type,l=De(r,t.pendingProps),l=De(r.type,l),Pa(e,t,r,l,n);case 15:return Wc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:De(r,l),al(e,t),t.tag=1,ke(r)?(e=!0,Nl(t)):e=!1,Nn(t,n),Bc(t,r,l),fi(t,r,l,n),mi(null,t,r,!0,e,n);case 19:return Gc(e,t,n);case 22:return Hc(e,t,n)}throw Error(N(156,t.tag))};function dd(e,t){return Du(e,t)}function dh(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 Ie(e,t,n,r){return new dh(e,t,n,r)}function ko(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fh(e){if(typeof e=="function")return ko(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Bi)return 11;if(e===Vi)return 14}return 2}function kt(e,t){var n=e.alternate;return n===null?(n=Ie(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 dl(e,t,n,r,l,s){var o=2;if(r=e,typeof e=="function")ko(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case on:return Qt(n.children,l,s,t);case Ai:o=8,l|=8;break;case Os:return e=Ie(12,n,t,l|2),e.elementType=Os,e.lanes=s,e;case $s:return e=Ie(13,n,t,l),e.elementType=$s,e.lanes=s,e;case Ds:return e=Ie(19,n,t,l),e.elementType=Ds,e.lanes=s,e;case wu:return Yl(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xu:o=10;break e;case ju:o=9;break e;case Bi:o=11;break e;case Vi:o=14;break e;case ut:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=Ie(o,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Qt(e,t,n,r){return e=Ie(7,e,r,t),e.lanes=n,e}function Yl(e,t,n,r){return e=Ie(22,e,r,t),e.elementType=wu,e.lanes=n,e.stateNode={isHidden:!1},e}function Ls(e,t,n){return e=Ie(6,e,null,t),e.lanes=n,e}function Ts(e,t,n){return t=Ie(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ph(e,t,n,r,l){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=ds(0),this.expirationTimes=ds(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ds(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function So(e,t,n,r,l,s,o,a,u){return e=new ph(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ie(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},io(s),e}function hh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(md)}catch(e){console.error(e)}}md(),mu.exports=Re;var xh=mu.exports,Va=xh;Ms.createRoot=Va.createRoot,Ms.hydrateRoot=Va.hydrateRoot;/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Po(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wh(){return Math.random().toString(36).substr(2,8)}function Wa(e,t){return{usr:e.state,key:e.key,idx:t}}function _i(e,t,n,r){return n===void 0&&(n=null),Er({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$n(t):t,{state:n,key:t&&t.key||r||wh()})}function Ol(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function $n(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Nh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:s=!1}=r,o=l.history,a=mt.Pop,u=null,c=g();c==null&&(c=0,o.replaceState(Er({},o.state,{idx:c}),""));function g(){return(o.state||{idx:null}).idx}function m(){a=mt.Pop;let k=g(),h=k==null?null:k-c;c=k,u&&u({action:a,location:j.location,delta:h})}function v(k,h){a=mt.Push;let f=_i(j.location,k,h);c=g()+1;let p=Wa(f,c),x=j.createHref(f);try{o.pushState(p,"",x)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;l.location.assign(x)}s&&u&&u({action:a,location:j.location,delta:1})}function w(k,h){a=mt.Replace;let f=_i(j.location,k,h);c=g();let p=Wa(f,c),x=j.createHref(f);o.replaceState(p,"",x),s&&u&&u({action:a,location:j.location,delta:0})}function d(k){let h=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof k=="string"?k:Ol(k);return f=f.replace(/ $/,"%20"),Y(h,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,h)}let j={get action(){return a},get location(){return e(l,o)},listen(k){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(qa,m),u=k,()=>{l.removeEventListener(qa,m),u=null}},createHref(k){return t(l,k)},createURL:d,encodeLocation(k){let h=d(k);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:v,replace:w,go(k){return o.go(k)}};return j}var Ha;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ha||(Ha={}));function kh(e,t,n){return n===void 0&&(n="/"),Sh(e,t,n)}function Sh(e,t,n,r){let l=typeof t=="string"?$n(t):t,s=zn(l.pathname||"/",n);if(s==null)return null;let o=gd(e);Eh(o);let a=null,u=Oh(s);for(let c=0;a==null&&c{let u={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(Y(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=St([r,u.relativePath]),g=n.concat(u);s.children&&s.children.length>0&&(Y(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),gd(s.children,t,g,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:zh(c,s.index),routesMeta:g})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))l(s,o);else for(let u of vd(s.path))l(s,o,u)}),t}function vd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let o=vd(r.join("/")),a=[];return a.push(...o.map(u=>u===""?s:[s,u].join("/"))),l&&a.push(...o),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function Eh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ih(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ch=/^:[\w-]+$/,_h=3,Ph=2,Rh=1,Lh=10,Th=-2,Qa=e=>e==="*";function zh(e,t){let n=e.split("/"),r=n.length;return n.some(Qa)&&(r+=Th),t&&(r+=Ph),n.filter(l=>!Qa(l)).reduce((l,s)=>l+(Ch.test(s)?_h:s===""?Rh:Lh),r)}function Ih(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Mh(e,t,n){let{routesMeta:r}=e,l={},s="/",o=[];for(let a=0;a{let{paramName:v,isOptional:w}=g;if(v==="*"){let j=a[m]||"";o=s.slice(0,s.length-j.length).replace(/(.)\/+$/,"$1")}const d=a[m];return w&&!d?c[v]=void 0:c[v]=(d||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function Fh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Po(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Oh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Po(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function zn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const $h=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dh=e=>$h.test(e);function Uh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?$n(e):e,s;if(n)if(Dh(n))s=n;else{if(n.includes("//")){let o=n;n=jd(n),Po(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=Ka(n.substring(1),"/"):s=Ka(n,t)}else s=t;return{pathname:s,search:Vh(r),hash:qh(l)}}function Ka(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function zs(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ah(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yd(e,t){let n=Ah(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xd(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=$n(e):(l=Er({},e),Y(!l.pathname||!l.pathname.includes("?"),zs("?","pathname","search",l)),Y(!l.pathname||!l.pathname.includes("#"),zs("#","pathname","hash",l)),Y(!l.search||!l.search.includes("#"),zs("#","search","hash",l)));let s=e===""||l.pathname==="",o=s?"/":l.pathname,a;if(o==null)a=n;else{let m=t.length-1;if(!r&&o.startsWith("..")){let v=o.split("/");for(;v[0]==="..";)v.shift(),m-=1;l.pathname=v.join("/")}a=m>=0?t[m]:"/"}let u=Uh(l,a),c=o&&o!=="/"&&o.endsWith("/"),g=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||g)&&(u.pathname+="/"),u}const jd=e=>e.replace(/\/\/+/g,"/"),St=e=>jd(e.join("/")),Bh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Wh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const wd=["post","put","patch","delete"];new Set(wd);const Hh=["get",...wd];new Set(Hh);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Cr(){return Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,g){if(g===void 0&&(g={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let m=xd(c,JSON.parse(o),s,g.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:St([t,m.pathname])),(g.replace?r.replace:r.push)(m,g.state,g)},[t,r,o,s,e])}function Ed(){let{matches:e}=y.useContext(zt),t=e[e.length-1];return t?t.params:{}}function ls(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Tt),{matches:l}=y.useContext(zt),{pathname:s}=It(),o=JSON.stringify(yd(l,r.v7_relativeSplatPath));return y.useMemo(()=>xd(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function bh(e,t){return Gh(e,t)}function Gh(e,t,n,r){Ir()||Y(!1);let{navigator:l}=y.useContext(Tt),{matches:s}=y.useContext(zt),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let c=It(),g;if(t){var m;let k=typeof t=="string"?$n(t):t;u==="/"||(m=k.pathname)!=null&&m.startsWith(u)||Y(!1),g=k}else g=c;let v=g.pathname||"/",w=v;if(u!=="/"){let k=u.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let d=kh(e,{pathname:w}),j=em(d&&d.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:St([u,l.encodeLocation?l.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?u:St([u,l.encodeLocation?l.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),s,n,r);return t&&j?y.createElement(ns.Provider,{value:{location:Cr({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:mt.Pop}},j):j}function Yh(){let e=lm(),t=Wh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:l},n):null,null)}const Xh=y.createElement(Yh,null);class Zh extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(zt.Provider,{value:this.props.routeContext},y.createElement(kd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Jh(e){let{routeContext:t,match:n,children:r}=e,l=y.useContext(ts);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(zt.Provider,{value:t},r)}function em(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let g=o.findIndex(m=>m.route.id&&(a==null?void 0:a[m.route.id])!==void 0);g>=0||Y(!1),o=o.slice(0,Math.min(o.length,g+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let g=0;g=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((g,m,v)=>{let w,d=!1,j=null,k=null;n&&(w=a&&m.route.id?a[m.route.id]:void 0,j=m.route.errorElement||Xh,u&&(c<0&&v===0?(im("route-fallback"),d=!0,k=null):c===v&&(d=!0,k=m.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,v+1)),f=()=>{let p;return w?p=j:d?p=k:m.route.Component?p=y.createElement(m.route.Component,null):m.route.element?p=m.route.element:p=g,y.createElement(Jh,{match:m,routeContext:{outlet:g,matches:h,isDataRoute:n!=null},children:p})};return n&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?y.createElement(Zh,{location:n.location,revalidation:n.revalidation,component:j,error:w,children:f(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):f()},null)}var Cd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Cd||{}),_d=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(_d||{});function tm(e){let t=y.useContext(ts);return t||Y(!1),t}function nm(e){let t=y.useContext(Nd);return t||Y(!1),t}function rm(e){let t=y.useContext(zt);return t||Y(!1),t}function Pd(e){let t=rm(),n=t.matches[t.matches.length-1];return n.route.id||Y(!1),n.route.id}function lm(){var e;let t=y.useContext(kd),n=nm(),r=Pd();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sm(){let{router:e}=tm(Cd.UseNavigateStable),t=Pd(_d.UseNavigateStable),n=y.useRef(!1);return Sd(()=>{n.current=!0}),y.useCallback(function(l,s){s===void 0&&(s={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Cr({fromRouteId:t},s)))},[e,t])}const ba={};function im(e,t,n){ba[e]||(ba[e]=!0)}function om(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ge(e){Y(!1)}function am(e){let{basename:t="/",children:n=null,location:r,navigationType:l=mt.Pop,navigator:s,static:o=!1,future:a}=e;Ir()&&Y(!1);let u=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:u,navigator:s,static:o,future:Cr({v7_relativeSplatPath:!1},a)}),[u,a,s,o]);typeof r=="string"&&(r=$n(r));let{pathname:g="/",search:m="",hash:v="",state:w=null,key:d="default"}=r,j=y.useMemo(()=>{let k=zn(g,u);return k==null?null:{location:{pathname:k,search:m,hash:v,state:w,key:d},navigationType:l}},[u,g,m,v,w,d,l]);return j==null?null:y.createElement(Tt.Provider,{value:c},y.createElement(ns.Provider,{children:n,value:j}))}function um(e){let{children:t,location:n}=e;return bh(Ri(t),n)}new Promise(()=>{});function Ri(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,l)=>{if(!y.isValidElement(r))return;let s=[...t,l];if(r.type===y.Fragment){n.push.apply(n,Ri(r.props.children,s));return}r.type!==Ge&&Y(!1),!r.props.index||!r.props.children||Y(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Ri(r.props.children,s)),n.push(o)}),n}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function fm(e,t){let n=Li(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(s=>{n.append(l,s)})}),n}const pm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],hm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],mm="6";try{window.__reactRouterVersion=mm}catch{}const gm=y.createContext({isTransitioning:!1}),vm="startTransition",Ga=af[vm];function ym(e){let{basename:t,children:n,future:r,window:l}=e,s=y.useRef();s.current==null&&(s.current=jh({window:l,v5Compat:!0}));let o=s.current,[a,u]=y.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},g=y.useCallback(m=>{c&&Ga?Ga(()=>u(m)):u(m)},[u,c]);return y.useLayoutEffect(()=>o.listen(g),[o,g]),y.useEffect(()=>om(r),[r]),y.createElement(am,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const xm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,D=y.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:s,replace:o,state:a,target:u,to:c,preventScrollReset:g,viewTransition:m}=t,v=Rd(t,pm),{basename:w}=y.useContext(Tt),d,j=!1;if(typeof c=="string"&&jm.test(c)&&(d=c,xm))try{let p=new URL(window.location.href),x=c.startsWith("//")?new URL(p.protocol+c):new URL(c),S=zn(x.pathname,w);x.origin===p.origin&&S!=null?c=S+x.search+x.hash:j=!0}catch{}let k=Qh(c,{relative:l}),h=Nm(c,{replace:o,state:a,target:u,preventScrollReset:g,relative:l,viewTransition:m});function f(p){r&&r(p),p.defaultPrevented||h(p)}return y.createElement("a",$l({},v,{href:d||k,onClick:j||s?r:f,ref:n,target:u}))}),qt=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:s="",end:o=!1,style:a,to:u,viewTransition:c,children:g}=t,m=Rd(t,hm),v=ls(u,{relative:m.relative}),w=It(),d=y.useContext(Nd),{navigator:j,basename:k}=y.useContext(Tt),h=d!=null&&km(v)&&c===!0,f=j.encodeLocation?j.encodeLocation(v).pathname:v.pathname,p=w.pathname,x=d&&d.navigation&&d.navigation.location?d.navigation.location.pathname:null;l||(p=p.toLowerCase(),x=x?x.toLowerCase():null,f=f.toLowerCase()),x&&k&&(x=zn(x,k)||x);const S=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let _=p===f||!o&&p.startsWith(f)&&p.charAt(S)==="/",P=x!=null&&(x===f||!o&&x.startsWith(f)&&x.charAt(f.length)==="/"),E={isActive:_,isPending:P,isTransitioning:h},O=_?r:void 0,L;typeof s=="function"?L=s(E):L=[s,_?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let ee=typeof a=="function"?a(E):a;return y.createElement(D,$l({},m,{"aria-current":O,className:L,ref:n,style:ee,to:u,viewTransition:c}),typeof g=="function"?g(E):g)});var Ti;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ti||(Ti={}));var Ya;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ya||(Ya={}));function wm(e){let t=y.useContext(ts);return t||Y(!1),t}function Nm(e,t){let{target:n,replace:r,state:l,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,u=rs(),c=It(),g=ls(e,{relative:o});return y.useCallback(m=>{if(dm(m,n)){m.preventDefault();let v=r!==void 0?r:Ol(c)===Ol(g);u(e,{replace:v,state:l,preventScrollReset:s,relative:o,viewTransition:a})}},[c,u,g,r,l,n,e,s,o,a])}function Ro(e){let t=y.useRef(Li(e)),n=y.useRef(!1),r=It(),l=y.useMemo(()=>fm(r.search,n.current?null:t.current),[r.search]),s=rs(),o=y.useCallback((a,u)=>{const c=Li(typeof a=="function"?a(l):a);n.current=!0,s("?"+c,u)},[s,l]);return[l,o]}function km(e,t){t===void 0&&(t={});let n=y.useContext(gm);n==null&&Y(!1);let{basename:r}=wm(Ti.useViewTransitionState),l=ls(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=zn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=zn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Pi(l.pathname,o)!=null||Pi(l.pathname,s)!=null}function J({size:e=20,children:t,...n}){return i.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...n,children:t})}function Ld(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M3 10.5 12 3l9 7.5"}),i.jsx("path",{d:"M5.5 9.5V20a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V9.5"}),i.jsx("path",{d:"M9.5 21v-6h5v6"})]})}function Sm(e){return i.jsxs(J,{...e,children:[i.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5"})]})}function Em(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M4 9.5 5.4 4h13.2L20 9.5"}),i.jsx("path",{d:"M4 9.5a2.6 2.6 0 0 0 5.3 0 2.65 2.65 0 0 0 5.4 0 2.6 2.6 0 0 0 5.3 0"}),i.jsx("path",{d:"M5 12.5V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7.5"}),i.jsx("path",{d:"M9.5 21v-5.5h5V21"})]})}function _r(e){return i.jsxs(J,{...e,children:[i.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),i.jsx("path",{d:"m20.5 20.5-4.9-4.9"})]})}function Cm(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M4 7h10M18 7h2"}),i.jsx("circle",{cx:"16",cy:"7",r:"2"}),i.jsx("path",{d:"M4 17h2M10 17h10"}),i.jsx("circle",{cx:"8",cy:"17",r:"2"})]})}function Td(e){return i.jsx(J,{...e,children:i.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function zi(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M4.5 12h15"}),i.jsx("path",{d:"m13.5 6 6 6-6 6"})]})}function Dl(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M13.5 5H19v5.5"}),i.jsx("path",{d:"M19 5 10.5 13.5"}),i.jsx("path",{d:"M19 13.5V19H5V5h5.5"})]})}function Mr(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M5.5 20.5C5.5 11.5 10 4.5 20 4.5c0 10-5.5 14-14.5 16z"}),i.jsx("path",{d:"M5.5 20.5C8 15 11.5 11 16 8.5"})]})}function _m(e){return i.jsxs(J,{...e,children:[i.jsx("circle",{cx:"12",cy:"12",r:"9"}),i.jsx("path",{d:"M12 7.5V13"}),i.jsx("path",{d:"M12 16.5h.01"})]})}function zd(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M12 21s-7-5.5-7-11a7 7 0 0 1 14 0c0 5.5-7 11-7 11z"}),i.jsx("circle",{cx:"12",cy:"10",r:"2.5"})]})}function Pm(e){return i.jsx(J,{...e,children:i.jsx("path",{d:"M12 3.5s6.5 7.2 6.5 11.3a6.5 6.5 0 0 1-13 0C5.5 10.7 12 3.5 12 3.5z"})})}function Rm(e){return i.jsx(J,{...e,children:i.jsx("path",{d:"m8.5 4-5 3 2 4 2.5-1V20h8v-10l2.5 1 2-4-5-3a3.5 3.5 0 0 1-7 0z"})})}function Lm(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M7 4h10l4 5.5L12 20.5 3 9.5 7 4z"}),i.jsx("path",{d:"M3 9.5h18M12 20.5 8.5 9.5 12 4l3.5 5.5L12 20.5z"})]})}function Tm(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M12 3a9 9 0 1 0 0 18c1.4 0 2.2-.9 2.2-2 0-1-.7-1.4-.7-2.3 0-.9.8-1.7 2-1.7h1.7A3.8 3.8 0 0 0 21 11.2C21 6.7 16.9 3 12 3z"}),i.jsx("circle",{cx:"7.5",cy:"10.5",r:"0.5",fill:"currentColor"}),i.jsx("circle",{cx:"11",cy:"7.5",r:"0.5",fill:"currentColor"}),i.jsx("circle",{cx:"15.5",cy:"8.5",r:"0.5",fill:"currentColor"})]})}function zm(e){return i.jsx(J,{...e,children:i.jsx("path",{d:"M12 3.5 14 9.5l6 2-6 2-2 6-2-6-6-2 6-2 2-6z"})})}function Im(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M12 3c1.2 1.6 2 2.7 2 3.8a2 2 0 0 1-4 0C10 5.7 10.8 4.6 12 3z"}),i.jsx("path",{d:"M8.5 11h7V21h-7V11z"})]})}function Mm(e){return i.jsxs(J,{...e,children:[i.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4.5"}),i.jsx("circle",{cx:"12",cy:"12",r:"3.6"}),i.jsx("circle",{cx:"16.9",cy:"7.1",r:"0.55",fill:"currentColor"})]})}function Fm(e){return i.jsx(J,{...e,children:i.jsx("path",{d:"M13.5 20.5v-6.8h2.6l.4-3.1h-3V8.5c0-.9.45-1.6 1.7-1.6h1.5v-2.8c-.65-.1-1.4-.2-2.2-.2-2.3 0-3.9 1.4-3.9 4v2.7H8v3.1h2.6v6.8"})})}function Xa(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M12 3.5v11"}),i.jsx("path",{d:"m7.5 10 4.5 4.5 4.5-4.5"}),i.jsx("path",{d:"M4.5 19.5h15"})]})}function Om(e){return i.jsxs(J,{...e,children:[i.jsx("path",{d:"M3.5 3.5h8l9 9-8 8-9-9v-8z"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.2"})]})}const $m=[{keywords:["érable","erable","miel","aliment","gourmand","épicerie","epicerie","café","cafe","thé","the ","boisson"],icon:Mr},{keywords:["beauté","beaute","soin","savon","cosmét","cosmet","corps"],icon:Pm},{keywords:["maison","déco","deco","cuisine","meuble"],icon:Ld},{keywords:["vêtement","vetement","mode","accessoire","textile"],icon:Rm},{keywords:["bijou","joaill"],icon:Lm},{keywords:["art","papeterie","illustration","création","creation"],icon:Tm},{keywords:["bougie","chandelle","ambiance"],icon:Im},{keywords:["enfant","jouet","bébé","bebe"],icon:zm}];function Id(e,t=16){const n=e.toLowerCase(),r=$m.find(s=>s.keywords.some(o=>n.includes(o))),l=(r==null?void 0:r.icon)??Om;return i.jsx(l,{size:t})}function Dm(){const[e,t]=y.useState(!1),[n,r]=y.useState(""),l=y.useRef(null),s=rs(),o=It();y.useEffect(()=>{t(!1)},[o.pathname,o.search]),y.useEffect(()=>{if(!e)return;document.body.style.overflow="hidden";const u=window.setTimeout(()=>{var g;return(g=l.current)==null?void 0:g.focus()},60),c=g=>{g.key==="Escape"&&t(!1)};return window.addEventListener("keydown",c),()=>{document.body.style.overflow="",window.clearTimeout(u),window.removeEventListener("keydown",c)}},[e]);function a(u){u.preventDefault();const c=n.trim();t(!1),r(""),s(c?`/produits?q=${encodeURIComponent(c)}`:"/produits")}return i.jsxs(i.Fragment,{children:[e&&i.jsxs("div",{className:"search-overlay",role:"dialog","aria-modal":"true","aria-label":"Recherche",children:[i.jsxs("div",{className:"search-overlay-bar",children:[i.jsxs("form",{className:"search-overlay-form",onSubmit:a,role:"search",children:[i.jsx("span",{className:"search-overlay-icon","aria-hidden":"true",children:i.jsx(_r,{size:18})}),i.jsx("input",{ref:l,type:"search",value:n,onChange:u=>r(u.target.value),placeholder:"Rechercher un produit québécois…","aria-label":"Rechercher",enterKeyHint:"search"})]}),i.jsx("button",{type:"button",className:"search-overlay-close",onClick:()=>t(!1),"aria-label":"Fermer la recherche",children:i.jsx(Td,{size:22})})]}),i.jsx("p",{className:"search-overlay-hint",children:"Produits fabriqués, conçus et vendus au Québec."})]}),i.jsxs("nav",{className:"bottom-nav","aria-label":"Navigation mobile",children:[i.jsxs(qt,{to:"/",end:!0,className:"bottom-nav-item",children:[i.jsx(Ld,{size:22}),i.jsx("span",{children:"Accueil"})]}),i.jsxs(qt,{to:"/produits",className:"bottom-nav-item",children:[i.jsx(Sm,{size:22}),i.jsx("span",{children:"Produits"})]}),i.jsxs(qt,{to:"/boutiques",className:"bottom-nav-item",children:[i.jsx(Em,{size:22}),i.jsx("span",{children:"Boutiques"})]}),i.jsxs("button",{type:"button",className:e?"bottom-nav-item active":"bottom-nav-item",onClick:()=>t(!0),"aria-label":"Ouvrir la recherche",children:[i.jsx(_r,{size:22}),i.jsx("span",{children:"Recherche"})]})]})]})}function Md({compact:e=!1,placeholder:t="Rechercher un produit québécois…",initialValue:n="",inputId:r,shortcutHint:l=!1}){const[s,o]=y.useState(n),[a,u]=y.useState(!1),c=rs();function g(m){m.preventDefault();const v=s.trim();c(v?`/produits?q=${encodeURIComponent(v)}`:"/produits")}return i.jsxs("form",{className:e?"searchbar searchbar-compact":"searchbar",onSubmit:g,role:"search",children:[i.jsxs("div",{className:"searchbar-field",children:[i.jsx("span",{className:"searchbar-icon","aria-hidden":"true",children:i.jsx(_r,{size:e?16:18})}),i.jsx("input",{id:r,type:"search",value:s,onChange:m=>o(m.target.value),onFocus:()=>u(!0),onBlur:()=>u(!1),placeholder:t,"aria-label":"Rechercher",enterKeyHint:"search"}),l&&!a&&s===""&&i.jsx("kbd",{className:"searchbar-kbd","aria-hidden":"true",children:"/"})]}),!e&&i.jsx("button",{type:"submit","aria-label":"Lancer la recherche",children:"Rechercher"})]})}const In={A:"Fabriqué au Québec",B:"Conçu au Québec",C:"Détaillant québécois",D:"Mixte",E:"À vérifier"},Lo=["A","B","C","D","E"],Mt="/fabri/".replace(/\/$/,"");async function en(e,t){const n=await fetch(e,{signal:t});if(!n.ok)throw new Error(`API ${n.status} — ${e}`);return await n.json()}function Fd(e){const t=new URLSearchParams;for(const[r,l]of Object.entries(e))l!=null&&`${l}`.length>0&&t.set(r,`${l}`);const n=t.toString();return n?`?${n}`:""}function To(e={},t){return en(`${Mt}/api/products${Fd({...e})}`,t)}function Um(e,t){return en(`${Mt}/api/products/${encodeURIComponent(e)}`,t)}function Am(e={},t){return en(`${Mt}/api/stores${Fd({region:e.region,q:e.q,with_products:e.with_products?"true":void 0})}`,t)}function Bm(e,t){return en(`${Mt}/api/stores/${encodeURIComponent(e)}`,t)}function zo(e){return en(`${Mt}/api/facets`,e)}function Vm(e){return en(`${Mt}/api/stats`,e)}function qm(e){return en(`${Mt}/api/stats/extended`,e)}const Wm=new Intl.NumberFormat("fr-CA",{style:"currency",currency:"CAD"});function ne(e){return e==null||Number.isNaN(e)?"":Wm.format(e)}const Hm=new Intl.NumberFormat("fr-CA",{style:"currency",currency:"CAD",maximumFractionDigits:0});function Kn(e){return e==null||Number.isNaN(e)?"":Hm.format(e)}const Qm=new Intl.NumberFormat("fr-CA");function M(e){return e==null||Number.isNaN(e)?"0":Qm.format(e)}const rn=new Intl.RelativeTimeFormat("fr-CA",{numeric:"auto"});function Km(e){if(e==null||e==="")return null;let t;if(typeof e=="number")t=e>1e12?e:e*1e3;else{const l=Date.parse(e);if(!Number.isNaN(l))t=l;else{const s=Number(e);if(Number.isNaN(s))return null;t=s>1e12?s:s*1e3}}if(!Number.isFinite(t)||t<=0)return null;const n=Math.round((t-Date.now())/1e3),r=Math.abs(n);return r<60?rn.format(n,"second"):r<3600?rn.format(Math.round(n/60),"minute"):r<86400?rn.format(Math.round(n/3600),"hour"):r<86400*30?rn.format(Math.round(n/86400),"day"):r<86400*365?rn.format(Math.round(n/(86400*30)),"month"):rn.format(Math.round(n/(86400*365)),"year")}function Od(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function bm(e){return e==="A"||e==="B"||e==="C"||e==="D"||e==="E"}function Dn({origin:e,withLabel:t=!1}){if(!bm(e))return null;const n=In[e];return i.jsxs("span",{className:`origin-badge origin-${e}`,title:n,children:[i.jsx("span",{className:"origin-badge-letter",children:e}),t&&i.jsx("span",{className:"origin-badge-label",children:n})]})}const Gm={A:"Produits fabriqués au Québec, par des artisans ou des entreprises d’ici.",B:"Produits conçus au Québec, dont la fabrication peut se faire ailleurs.",C:"Boutique québécoise qui vend des produits d’origines diverses.",D:"Catalogue mixte : une partie des produits est fabriquée ou conçue au Québec.",E:"Origine en cours de vérification par notre équipe."};function Ym(){return i.jsxs("div",{className:"page about",children:[i.jsx("h1",{children:"À propos de Fabri-Ka"}),i.jsxs("div",{className:"about-content",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Fabri-Ka"})," agrège les catalogues publics des boutiques en ligne québécoises pour offrir un seul point d'entrée vers les produits d'ici. Pensez-y comme un moteur de recherche dédié aux produits québécois : on rassemble, on classe, on met en valeur."]}),i.jsxs("p",{children:["Chaque produit affiché sur Fabri-Ka ",i.jsx("strong",{children:"renvoie directement vers la boutique d'origine"}),". Aucune vente n'est effectuée sur Fabri-Ka : les prix, les stocks et les transactions appartiennent entièrement aux boutiques sources. Nous ne prélevons aucune commission et nous ne modifions aucune donnée commerciale."]}),i.jsx("h2",{children:"La classification A–E"}),i.jsx("p",{children:"Pour vous aider à magasiner selon vos valeurs, chaque boutique est classée selon l'origine de ses produits :"}),i.jsx("ul",{className:"about-origins",children:Lo.map(e=>i.jsxs("li",{children:[i.jsx(Dn,{origin:e}),i.jsxs("div",{children:[i.jsx("strong",{children:In[e]}),i.jsx("p",{children:Gm[e]})]})]},e))}),i.jsx("h2",{children:"Contact"}),i.jsxs("p",{children:["Vous êtes une boutique québécoise et souhaitez être ajoutée (ou retirée) ? Une erreur de classification ? Écrivez-nous :"," ",i.jsx("a",{href:"mailto:contact@spboucher.ai",children:"contact@spboucher.ai"})]})]})]})}function _t({variant:e="empty",title:t,message:n,children:r}){return i.jsxs("div",{className:`empty-state empty-state-${e}`,children:[i.jsx("span",{className:"empty-state-icon","aria-hidden":"true",children:e==="error"?i.jsx(_m,{size:28}):i.jsx(Mr,{size:28})}),t&&i.jsx("h2",{className:"empty-state-title",children:t}),i.jsx("p",{children:n}),r&&i.jsx("div",{className:"empty-state-action",children:r})]})}const Xm=[{value:"recent",label:"Plus récents"},{value:"price_asc",label:"Prix croissant"},{value:"price_desc",label:"Prix décroissant"},{value:"title",label:"Titre (A–Z)"}];function $d(e){return(e.q?1:0)+(e.category?1:0)+(e.region?1:0)+e.origins.length+(e.priceMin?1:0)+(e.priceMax?1:0)}function Dd({facets:e,values:t,onChange:n,idPrefix:r=""}){const[l,s]=y.useState(t.q),o=y.useRef(void 0),a=y.useRef(!0);y.useEffect(()=>{s(t.q)},[t.q]),y.useEffect(()=>{if(a.current){a.current=!1;return}return window.clearTimeout(o.current),o.current=window.setTimeout(()=>{l!==t.q&&n({q:l})},300),()=>window.clearTimeout(o.current)},[l]);function u(c){const g=t.origins.includes(c)?t.origins.filter(m=>m!==c):[...t.origins,c];n({origins:g})}return i.jsxs("div",{className:"filters-body",children:[i.jsxs("div",{className:"filter-group",children:[i.jsx("label",{className:"filter-label",htmlFor:`${r}filter-search`,children:"Recherche"}),i.jsx("input",{id:`${r}filter-search`,type:"search",value:l,onChange:c=>s(c.target.value),placeholder:"Mot-clé…"})]}),i.jsxs("div",{className:"filter-group",children:[i.jsx("span",{className:"filter-label",children:"Catégories"}),i.jsxs("ul",{className:"filter-category-list",children:[i.jsx("li",{children:i.jsx("button",{type:"button",className:t.category===""?"active":"",onClick:()=>n({category:""}),children:"Toutes"})}),((e==null?void 0:e.categories)??[]).map(c=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:t.category===c.key?"active":"",onClick:()=>n({category:t.category===c.key?"":c.key}),children:[i.jsx("span",{children:c.label}),i.jsx("span",{className:"filter-count",children:M(c.n)})]})},c.key))]})]}),i.jsxs("div",{className:"filter-group",children:[i.jsx("label",{className:"filter-label",htmlFor:`${r}filter-region`,children:"Région"}),i.jsxs("select",{id:`${r}filter-region`,value:t.region,onChange:c=>n({region:c.target.value}),children:[i.jsx("option",{value:"",children:"Toutes les régions"}),((e==null?void 0:e.all_regions)??[]).map(c=>i.jsx("option",{value:c,children:c},c))]})]}),i.jsxs("div",{className:"filter-group",children:[i.jsx("span",{className:"filter-label",children:"Origine"}),Lo.map(c=>i.jsxs("label",{className:"filter-checkbox",children:[i.jsx("input",{type:"checkbox",checked:t.origins.includes(c),onChange:()=>u(c)}),i.jsx("span",{className:`origin-badge origin-${c}`,children:i.jsx("span",{className:"origin-badge-letter",children:c})}),i.jsx("span",{children:In[c]})]},c))]}),i.jsxs("div",{className:"filter-group",children:[i.jsx("span",{className:"filter-label",children:"Prix"}),i.jsxs("div",{className:"filter-price-row",children:[i.jsx("input",{type:"number",min:"0",inputMode:"decimal",placeholder:"Min","aria-label":"Prix minimum",value:t.priceMin,onChange:c=>n({priceMin:c.target.value})}),i.jsx("span",{"aria-hidden":"true",children:"–"}),i.jsx("input",{type:"number",min:"0",inputMode:"decimal",placeholder:"Max","aria-label":"Prix maximum",value:t.priceMax,onChange:c=>n({priceMax:c.target.value})})]})]}),i.jsxs("div",{className:"filter-group",children:[i.jsx("label",{className:"filter-label",htmlFor:`${r}filter-sort`,children:"Trier par"}),i.jsx("select",{id:`${r}filter-sort`,value:t.sort||"recent",onChange:c=>n({sort:c.target.value}),children:Xm.map(c=>i.jsx("option",{value:c.value,children:c.label},c.value))})]})]})}function Zm({facets:e,values:t,onChange:n,onReset:r}){const l=$d(t);return i.jsxs("aside",{className:"filters","aria-label":"Filtres",children:[i.jsxs("div",{className:"filters-title-row",children:[i.jsx("span",{className:"filters-title",children:"Filtres"}),l>0&&i.jsxs("button",{type:"button",className:"filters-reset-link",onClick:r,children:["Réinitialiser (",l,")"]})]}),i.jsx(Dd,{facets:e,values:t,onChange:n,idPrefix:"side-"})]})}function Jm({open:e,facets:t,values:n,total:r,onChange:l,onReset:s,onClose:o}){return y.useEffect(()=>{if(!e)return;document.body.style.overflow="hidden";const a=u=>{u.key==="Escape"&&o()};return window.addEventListener("keydown",a),()=>{document.body.style.overflow="",window.removeEventListener("keydown",a)}},[e,o]),e?i.jsxs("div",{className:"sheet-root",children:[i.jsx("div",{className:"sheet-backdrop",onClick:o,"aria-hidden":"true"}),i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Filtres",children:[i.jsx("div",{className:"sheet-handle","aria-hidden":"true"}),i.jsxs("header",{className:"sheet-header",children:[i.jsx("h2",{children:"Filtres"}),i.jsx("button",{type:"button",className:"sheet-close",onClick:o,"aria-label":"Fermer les filtres",children:i.jsx(Td,{size:20})})]}),i.jsx("div",{className:"sheet-content",children:i.jsx(Dd,{facets:t,values:n,onChange:l,idPrefix:"sheet-"})}),i.jsxs("footer",{className:"sheet-footer",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:s,children:"Réinitialiser"}),i.jsx("button",{type:"button",className:"btn btn-primary",onClick:o,children:r!==null?`Voir ${M(r)} produit${r===1?"":"s"}`:"Voir les produits"})]})]})]}):null}function Ud({page:e,perPage:t,total:n,onPageChange:r}){const l=Math.max(1,Math.ceil(n/Math.max(1,t)));return l<=1?null:i.jsxs("nav",{className:"pagination","aria-label":"Pagination",children:[i.jsx("button",{type:"button",disabled:e<=1,onClick:()=>r(e-1),children:"← Précédent"}),i.jsxs("span",{className:"pagination-info",children:["Page ",e," sur ",l]}),i.jsx("button",{type:"button",disabled:e>=l,onClick:()=>r(e+1),children:"Suivant →"})]})}function Io({product:e}){const[t,n]=y.useState(!1),r=e.images.length>0?e.images[0]:null,l=r!==null&&!t;return i.jsxs(D,{to:`/produits/${encodeURIComponent(e.uid)}`,className:"card product-card",children:[i.jsxs("div",{className:"product-card-media",children:[l?i.jsx("img",{src:r,alt:e.title,loading:"lazy",decoding:"async",onError:()=>n(!0)}):i.jsx("div",{className:"image-placeholder","aria-hidden":"true",children:i.jsx(Mr,{size:30})}),i.jsx("span",{className:"product-card-badge",children:i.jsx(Dn,{origin:e.origin_class})})]}),i.jsxs("div",{className:"product-card-body",children:[i.jsx("h3",{className:"product-card-title",children:e.title}),i.jsxs("div",{className:"product-card-price",children:[e.price!==null?i.jsx("span",{className:"price-chip",children:ne(e.price)}):i.jsx("span",{className:"price-chip price-chip-muted",children:"Prix variable"}),e.compare_at_price!==null&&e.price!==null&&e.compare_at_price>e.price&&i.jsx("s",{className:"price-compare",children:ne(e.compare_at_price)})]}),i.jsxs("p",{className:"product-card-store",children:[e.store_name,e.store_region?` · ${e.store_region}`:""]})]})]})}function Ad({products:e,emptyMessage:t="Aucun produit trouvé",onReset:n}){return e.length===0?i.jsx(_t,{message:t,children:n&&i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:n,children:"Réinitialiser les filtres"})}):i.jsx("div",{className:"product-grid",children:e.map(r=>i.jsx(Io,{product:r},r.uid))})}function U({width:e="100%",height:t="1rem",radius:n="8px",className:r=""}){return i.jsx("span",{className:`skeleton ${r}`,style:{width:e,height:t,borderRadius:n,display:"block"},"aria-hidden":"true"})}function Bd(){return i.jsxs("div",{className:"card product-card product-card-skeleton",children:[i.jsx(U,{height:"auto",radius:"10px",className:"skeleton-square"}),i.jsxs("div",{className:"product-card-body",children:[i.jsx(U,{height:"0.85rem",width:"90%"}),i.jsx(U,{height:"0.85rem",width:"60%"}),i.jsx(U,{height:"1.1rem",width:"40%"})]})]})}function Vd({count:e=10}){return i.jsx("div",{className:"product-grid",children:Array.from({length:e},(t,n)=>i.jsx(Bd,{},n))})}function eg({count:e=6}){return i.jsx("div",{className:"rail-track",children:Array.from({length:e},(t,n)=>i.jsx("div",{className:"rail-item",children:i.jsx(Bd,{})},n))})}const Za=24;function tg(){const[e,t]=Ro(),[n,r]=y.useState(null),[l,s]=y.useState(null),[o,a]=y.useState(!0),[u,c]=y.useState(null),[g,m]=y.useState(!1),[v,w]=y.useState(!1),d=y.useMemo(()=>({q:e.get("q")??"",category:e.get("category")??"",region:e.get("region")??"",origins:(e.get("origin")??"").split(",").filter(E=>E.length>0),priceMin:e.get("price_min")??"",priceMax:e.get("price_max")??"",sort:e.get("sort")??"recent"}),[e]),j=Math.max(1,parseInt(e.get("page")??"1",10)||1),k=$d(d),[h,f]=y.useState(d.q),p=y.useRef(void 0);y.useEffect(()=>{f(d.q)},[d.q]),y.useEffect(()=>{const E=()=>w(window.scrollY>24);return E(),window.addEventListener("scroll",E,{passive:!0}),()=>window.removeEventListener("scroll",E)},[]),y.useEffect(()=>{const E=new AbortController;return zo(E.signal).then(r).catch(()=>{}),()=>E.abort()},[]),y.useEffect(()=>{const E=new AbortController;return a(!0),c(null),To({q:d.q||void 0,category:d.category||void 0,region:d.region||void 0,origin:d.origins.length>0?d.origins.join(","):void 0,price_min:d.priceMin||void 0,price_max:d.priceMax||void 0,sort:d.sort||"recent",page:j,per_page:Za},E.signal).then(O=>{s(O),a(!1)}).catch(O=>{O instanceof DOMException&&O.name==="AbortError"||(c("Impossible de charger les produits. Réessayez plus tard."),a(!1))}),()=>E.abort()},[d,j]);const x=y.useCallback((E,O=!0)=>{t(L=>{const ee=new URLSearchParams(L),oe={...d,...E},de=(it,Ft)=>{Ft?ee.set(it,Ft):ee.delete(it)};return de("q",oe.q),de("category",oe.category),de("region",oe.region),de("origin",oe.origins.join(",")),de("price_min",oe.priceMin),de("price_max",oe.priceMax),de("sort",oe.sort!=="recent"?oe.sort:""),O&&ee.delete("page"),ee},{replace:!0})},[t,d]),S=y.useCallback(()=>{t(new URLSearchParams,{replace:!0})},[t]),_=y.useCallback(E=>{t(O=>{const L=new URLSearchParams(O);return E>1?L.set("page",String(E)):L.delete("page"),L}),window.scrollTo({top:0,behavior:"smooth"})},[t]);function P(E){f(E),window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x({q:E})},300)}return i.jsxs("div",{className:"page catalog",children:[i.jsx("div",{className:v?"catalog-searchbar catalog-searchbar-shrunk":"catalog-searchbar",children:i.jsxs("div",{className:"catalog-searchbar-field",children:[i.jsx("span",{className:"searchbar-icon","aria-hidden":"true",children:i.jsx(_r,{size:17})}),i.jsx("input",{type:"search",value:h,onChange:E=>P(E.target.value),placeholder:"Rechercher un produit…","aria-label":"Rechercher un produit",enterKeyHint:"search"})]})}),i.jsxs("div",{className:"catalog-layout",children:[i.jsx(Zm,{facets:n,values:d,onChange:x,onReset:S}),i.jsxs("div",{className:"catalog-main",children:[i.jsxs("div",{className:"catalog-header",children:[i.jsx("h1",{children:"Produits"}),l&&!o&&i.jsxs("p",{className:"catalog-count",children:[M(l.total)," produit",l.total===1?"":"s"]})]}),o?i.jsx(Vd,{count:Za}):u?i.jsx(_t,{variant:"error",message:u,children:i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>x({}),children:"Réessayer"})}):i.jsxs(i.Fragment,{children:[i.jsx(Ad,{products:(l==null?void 0:l.items)??[],onReset:S}),l&&i.jsx(Ud,{page:l.page,perPage:l.per_page,total:l.total,onPageChange:_})]})]})]}),i.jsxs("button",{type:"button",className:"filter-fab",onClick:()=>m(!0),"aria-haspopup":"dialog",children:[i.jsx(Cm,{size:18}),"Filtres",k>0&&i.jsx("span",{className:"filter-fab-badge",children:k})]}),i.jsx(Jm,{open:g,facets:n,values:d,total:l?l.total:null,onChange:x,onReset:S,onClose:()=>m(!1)})]})}function Wt({value:e}){const[t,n]=y.useState(0);return y.useEffect(()=>{if(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){n(e);return}let r=0;const l=900,s=performance.now(),o=a=>{const u=Math.min(1,(a-s)/l),c=1-Math.pow(1-u,3);n(Math.round(e*c)),u<1&&(r=requestAnimationFrame(o))};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[e]),i.jsx(i.Fragment,{children:M(t)})}function ng({title:e,query:t,seeAllHref:n}){const[r,l]=y.useState(null),[s,o]=y.useState(!1);return y.useEffect(()=>{const a=new AbortController;return l(null),o(!1),To({per_page:12,...t},a.signal).then(u=>l(u.items)).catch(u=>{u instanceof DOMException&&u.name==="AbortError"||(o(!0),l([]))}),()=>a.abort()},[JSON.stringify(t)]),s||r!==null&&r.length===0?null:i.jsxs("section",{className:"rail",children:[i.jsxs("header",{className:"section-header",children:[i.jsx("h2",{children:e}),n&&i.jsxs(D,{className:"section-see-all",to:n,children:["Tout voir ",i.jsx(zi,{size:15})]})]}),r===null?i.jsx(eg,{count:6}):i.jsx("div",{className:"rail-track",children:r.map(a=>i.jsx("div",{className:"rail-item",children:i.jsx(Io,{product:a})},a.uid))})]})}function Is(e,t){if(!e)return;const n=e.categories.find(r=>t.some(l=>r.key.toLowerCase().includes(l)||r.label.toLowerCase().includes(l)));return n==null?void 0:n.key}function rg(){const[e,t]=y.useState(null),[n,r]=y.useState(null);y.useEffect(()=>{const u=new AbortController;return Vm(u.signal).then(t).catch(()=>{}),zo(u.signal).then(r).catch(()=>{}),()=>u.abort()},[]);const l=[{title:"Nouveautés",seeAllHref:"/produits?sort=recent"}],s=Is(n,["érable","erable","miel"]);s&&l.push({title:"Érable & miel",category:s,seeAllHref:`/produits?category=${encodeURIComponent(s)}`});const o=Is(n,["beauté","beaute","soins"]);o&&l.push({title:"Beauté & soins",category:o,seeAllHref:`/produits?category=${encodeURIComponent(o)}`});const a=Is(n,["maison","déco","deco"]);return a&&l.push({title:"Maison & déco",category:a,seeAllHref:`/produits?category=${encodeURIComponent(a)}`}),i.jsxs("div",{className:"page home",children:[i.jsxs("section",{className:"hero",children:[i.jsx("p",{className:"hero-eyebrow",children:"Le répertoire des produits d'ici"}),i.jsxs("h1",{className:"hero-title",children:["Tous les produits québécois.",i.jsx("br",{}),i.jsx("em",{children:"Un seul endroit."})]}),i.jsx("p",{className:"hero-sub",children:"Fabri-Ka rassemble les catalogues des boutiques en ligne d'ici — fabriqué, conçu et vendu au Québec."}),i.jsx("div",{className:"hero-search",children:i.jsx(Md,{})}),i.jsx("div",{className:"hero-stats",children:e?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stat",children:[i.jsx("span",{className:"stat-number",children:i.jsx(Wt,{value:e.totals.products})}),i.jsx("span",{className:"stat-label",children:"Produits"})]}),i.jsxs("div",{className:"stat",children:[i.jsx("span",{className:"stat-number",children:i.jsx(Wt,{value:e.totals.stores_live})}),i.jsx("span",{className:"stat-label",children:"Boutiques"})]}),i.jsxs("div",{className:"stat",children:[i.jsx("span",{className:"stat-number",children:i.jsx(Wt,{value:e.totals.regions})}),i.jsx("span",{className:"stat-label",children:"Régions"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx(U,{width:"90px",height:"3rem"}),i.jsx(U,{width:"90px",height:"3rem"}),i.jsx(U,{width:"90px",height:"3rem"})]})}),i.jsxs(D,{className:"hero-stats-link",to:"/stats",children:["Statistiques ",i.jsx(zi,{size:14})]})]}),i.jsxs("section",{className:"home-categories","aria-label":"Catégories",children:[i.jsxs("header",{className:"section-header",children:[i.jsx("h2",{children:"Parcourir par catégorie"}),i.jsxs(D,{className:"section-see-all",to:"/produits",children:["Tout le catalogue ",i.jsx(zi,{size:15})]})]}),i.jsx("div",{className:"category-chips",children:n?n.categories.map(u=>i.jsxs(D,{className:"chip",to:`/produits?category=${encodeURIComponent(u.key)}`,children:[i.jsx("span",{className:"chip-icon","aria-hidden":"true",children:Id(u.label)}),u.label,i.jsx("span",{className:"chip-count",children:M(u.n)})]},u.key)):i.jsxs(i.Fragment,{children:[i.jsx(U,{width:"110px",height:"2.5rem",radius:"999px"}),i.jsx(U,{width:"140px",height:"2.5rem",radius:"999px"}),i.jsx(U,{width:"120px",height:"2.5rem",radius:"999px"}),i.jsx(U,{width:"100px",height:"2.5rem",radius:"999px"})]})})]}),l.map(u=>i.jsx(ng,{title:u.title,query:u.category?{category:u.category,per_page:12}:{sort:"recent",per_page:12},seeAllHref:u.seeAllHref},u.title))]})}function lg(){return i.jsx("div",{className:"page",children:i.jsxs("div",{className:"notfound",children:[i.jsx("h1",{children:"404"}),i.jsx(_t,{message:"Cette page n'existe pas — mais nos produits québécois, oui.",children:i.jsx(D,{className:"btn btn-primary",to:"/",children:"Retour à l'accueil"})})]})})}const Ja=["#234438","#C4532E","#8A6D3B","#5B5B8A","#A94525","#3E6253"];function sg(e){let t=0;for(let n=0;na(n)})});const c=Ja[sg(e)%Ja.length],g=(t.trim().charAt(0)||"F").toUpperCase();return i.jsx("span",{className:`${u} store-logo-fallback`,style:{background:c},role:"img","aria-label":`Logo ${t}`,children:g})}const ig=280;function og(){const{uid:e}=Ed(),[t,n]=y.useState(null),[r,l]=y.useState(!1),[s,o]=y.useState(0),[a,u]=y.useState(!1),c=y.useRef(null);y.useEffect(()=>{if(!e)return;const h=new AbortController;return n(null),l(!1),o(0),u(!1),Um(e,h.signal).then(n).catch(f=>{f instanceof DOMException&&f.name==="AbortError"||l(!0)}),window.scrollTo({top:0}),()=>h.abort()},[e]);function g(h){const f=h.currentTarget;if(f.clientWidth===0)return;const p=Math.round(f.scrollLeft/f.clientWidth);p!==s&&o(p)}function m(h){const f=c.current;f&&(f.scrollTo({left:h*f.clientWidth,behavior:"smooth"}),o(h))}if(r)return i.jsx("div",{className:"page",children:i.jsx(_t,{message:"Produit introuvable.",children:i.jsx(D,{className:"btn btn-secondary",to:"/produits",children:"Retour aux produits"})})});if(!t)return i.jsx("div",{className:"page",children:i.jsxs("div",{className:"product-detail",children:[i.jsx("div",{className:"product-detail-gallery",children:i.jsx(U,{height:"auto",radius:"8px",className:"skeleton-square"})}),i.jsxs("div",{className:"product-detail-info",children:[i.jsx(U,{height:"2.2rem",width:"80%"}),i.jsx(U,{height:"1.6rem",width:"30%"}),i.jsx(U,{height:"1rem",width:"100%"}),i.jsx(U,{height:"1rem",width:"90%"}),i.jsx(U,{height:"3rem",width:"60%",radius:"8px"})]})]})});const v=t.images,w=t.compare_at_price!==null&&t.price!==null&&t.compare_at_price>t.price,d=In[t.origin_class]??"",j=t.description??"",k=j.length>ig;return i.jsxs("div",{className:"page page-product-detail",children:[i.jsxs("nav",{className:"breadcrumb","aria-label":"Fil d'Ariane",children:[i.jsx(D,{to:"/produits",children:"Produits"}),t.category&&i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":"true",children:"/"}),i.jsx(D,{to:`/produits?category=${encodeURIComponent(t.category)}`,children:t.category})]})]}),i.jsxs("div",{className:"product-detail",children:[i.jsx("div",{className:"product-detail-gallery",children:v.length>0?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pd-track",ref:c,onScroll:g,"aria-label":`Images du produit (${v.length})`,children:v.map((h,f)=>i.jsx("div",{className:"pd-slide",children:i.jsx(ag,{src:h,alt:f===0?t.title:"",eager:f===0})},`${h}-${f}`))}),v.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pd-dots","aria-hidden":"true",children:v.map((h,f)=>i.jsx("span",{className:f===s?"pd-dot pd-dot-active":"pd-dot"},f))}),i.jsx("div",{className:"product-detail-thumbs",children:v.map((h,f)=>i.jsx("button",{type:"button",className:f===s?"thumb thumb-active":"thumb",onClick:()=>m(f),"aria-label":`Image ${f+1}`,children:i.jsx("img",{src:h,alt:"",loading:"lazy"})},`${h}-${f}`))})]})]}):i.jsx("div",{className:"pd-track",children:i.jsx("div",{className:"pd-slide",children:i.jsx("div",{className:"image-placeholder","aria-hidden":"true",children:i.jsx(Mr,{size:44})})})})}),i.jsxs("div",{className:"product-detail-info",children:[i.jsxs("div",{className:"product-detail-badges",children:[i.jsx(Dn,{origin:t.origin_class,withLabel:!0}),!t.available&&i.jsx("span",{className:"unavailable-badge",children:"Non disponible"})]}),i.jsx("h1",{className:"product-detail-title",children:t.title}),i.jsxs("div",{className:"product-detail-price",children:[t.price!==null?i.jsxs("span",{className:"price-chip price-chip-lg",children:[ne(t.price),t.price_max!==null&&t.price_max>t.price&&` – ${ne(t.price_max)}`]}):i.jsx("span",{className:"price-chip price-chip-muted",children:"Prix affiché en boutique"}),w&&i.jsx("s",{className:"price-compare",children:ne(t.compare_at_price)})]}),j&&i.jsxs("div",{className:"product-detail-description-wrap",children:[i.jsx("p",{className:k&&!a?"product-detail-description product-detail-description-clamped":"product-detail-description",children:j}),k&&i.jsx("button",{type:"button",className:"desc-toggle",onClick:()=>u(h=>!h),"aria-expanded":a,children:a?"Réduire":"Lire la suite"})]}),i.jsxs("dl",{className:"product-detail-meta",children:[t.vendor&&i.jsxs("div",{children:[i.jsx("dt",{children:"Marque"}),i.jsx("dd",{children:t.vendor})]}),t.category&&i.jsxs("div",{children:[i.jsx("dt",{children:"Catégorie"}),i.jsx("dd",{children:t.category})]}),t.product_type&&i.jsxs("div",{children:[i.jsx("dt",{children:"Type"}),i.jsx("dd",{children:t.product_type})]}),d&&i.jsxs("div",{children:[i.jsx("dt",{children:"Origine"}),i.jsx("dd",{children:d})]})]}),t.tags.length>0&&i.jsx("div",{className:"tag-list",children:t.tags.map(h=>i.jsx("span",{className:"tag",children:h},h))}),i.jsxs("a",{className:"btn btn-primary btn-cta",href:t.url,target:"_blank",rel:"noopener noreferrer",children:["Voir chez ",t.store_name," ",i.jsx(Dl,{size:16})]}),i.jsxs("div",{className:"card store-info-card",children:[i.jsx("span",{className:"filter-label",children:"Boutique"}),i.jsxs("div",{className:"store-info-row",children:[i.jsx(Sn,{storeId:t.store_id,name:t.store_name,size:"sm"}),i.jsxs("div",{className:"store-info-text",children:[i.jsx(D,{to:`/boutiques/${encodeURIComponent(t.store_id)}`,className:"store-info-name",children:t.store_name}),i.jsx("p",{className:"store-info-location",children:[t.store_city,t.store_region].filter(Boolean).join(", ")||"Québec"})]})]})]})]})]}),t.related.length>0&&i.jsxs("section",{className:"rail",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Produits similaires"})}),i.jsx("div",{className:"rail-track",children:t.related.map(h=>i.jsx("div",{className:"rail-item",children:i.jsx(Io,{product:h})},h.uid))})]}),i.jsxs("div",{className:"pd-cta-bar",children:[i.jsx("div",{className:"pd-cta-price",children:t.price!==null?i.jsx("span",{className:"price-chip",children:ne(t.price)}):i.jsx("span",{className:"price-chip price-chip-muted",children:"Prix en boutique"})}),i.jsxs("a",{className:"btn btn-primary pd-cta-btn",href:t.url,target:"_blank",rel:"noopener noreferrer",children:["Voir chez ",t.store_name," ",i.jsx(Dl,{size:15})]})]})]})}function ag({src:e,alt:t,eager:n}){const[r,l]=y.useState(!1);return r?i.jsx("div",{className:"image-placeholder","aria-hidden":"true",children:i.jsx(Mr,{size:44})}):i.jsx("img",{src:e,alt:t,loading:n?"eager":"lazy",onError:()=>l(!0)})}const ug="Fabri-Ka — Tous les produits québécois. Un seul endroit.",qd=new Intl.NumberFormat("fr-CA",{style:"percent",maximumFractionDigits:1});function ln(e,t){return t?qd.format(e/t):""}const cg=new Intl.DateTimeFormat("fr-CA",{day:"numeric",month:"short"});function bn(e){const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:cg.format(t)}const dg={"0-10":"Moins de 10 $","10-25":"10 – 25 $","25-50":"25 – 50 $","50-100":"50 – 100 $","100-250":"100 – 250 $","250-1000":"250 – 1 000 $","1000+":"1 000 $ et plus"},eu=`${Mt}/api/report.pdf`,tu="Rapport de marché complet — PDF, mise à jour en continu",at={"en stock":{label:"En stock",slug:"stock",order:0},rupture:{label:"En rupture",slug:"rupture",order:1},inconnu:{label:"Inconnu",slug:"inconnu",order:2}};function fg({points:e}){const t=[...e].sort((p,x)=>p.day.localeCompare(x.day)),n=640,r=200,l=8,s=26,o=26,a=n-l*2,u=r-s-o,c=r-o,g=Math.max(...t.map(p=>p.n),1),m=Math.min(...t.map(p=>p.n)),v=p=>l+(t.length>1?p*a/(t.length-1):a/2),w=p=>s+(1-p/g)*u,d=t.map((p,x)=>`${x===0?"M":"L"}${v(x).toFixed(1)},${w(p.n).toFixed(1)}`).join(" "),j=`${d} L${v(t.length-1).toFixed(1)},${c} L${v(0).toFixed(1)},${c} Z`,k=t.findIndex(p=>p.n===g),h=t.findIndex(p=>p.n===m),f=p=>Math.min(n-30,Math.max(30,p));return i.jsx("figure",{className:"stats-growth-figure",children:i.jsxs("svg",{viewBox:`0 0 ${n} ${r}`,className:"stats-growth-svg",role:"img","aria-label":`Produits ajoutés par jour, du ${bn(t[0].day)} au ${bn(t[t.length-1].day)}. Maximum ${M(g)}, minimum ${M(m)}.`,children:[i.jsx("line",{x1:l,y1:c,x2:n-l,y2:c,className:"stats-growth-baseline"}),i.jsx("path",{d:j,className:"stats-growth-area"}),i.jsx("path",{d,className:"stats-growth-line"}),i.jsx("circle",{cx:v(k),cy:w(g),r:3.5,className:"stats-growth-dot"}),i.jsx("text",{x:f(v(k)),y:w(g)-9,textAnchor:"middle",className:"stats-growth-label",children:M(g)}),h!==k&&i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:v(h),cy:w(m),r:3,className:"stats-growth-dot stats-growth-dot-min"}),i.jsx("text",{x:f(v(h)),y:Math.min(w(m)+16,c-4),textAnchor:"middle",className:"stats-growth-label",children:M(m)})]}),i.jsx("text",{x:l,y:r-8,className:"stats-growth-axis",children:bn(t[0].day)}),i.jsx("text",{x:n-l,y:r-8,textAnchor:"end",className:"stats-growth-axis",children:bn(t[t.length-1].day)}),t.map((p,x)=>i.jsx("circle",{cx:v(x),cy:w(p.n),r:9,fill:"transparent",children:i.jsx("title",{children:`${bn(p.day)} — ${M(p.n)} produit${p.n>1?"s":""}`})},p.day))]})})}function pg(){const[e,t]=y.useState(null),[n,r]=y.useState(!1);y.useEffect(()=>{const d=new AbortController;return qm(d.signal).then(t).catch(j=>{j instanceof DOMException&&j.name==="AbortError"||r(!0)}),window.scrollTo({top:0}),()=>d.abort()},[]),y.useEffect(()=>(document.title="Statistiques — Fabri-Ka",()=>{document.title=ug}),[]);const l=y.useMemo(()=>new Intl.DateTimeFormat("fr-CA",{dateStyle:"long"}).format(new Date),[]);if(n)return i.jsx("div",{className:"page stats",children:i.jsx(_t,{variant:"error",title:"Statistiques indisponibles",message:"Impossible de charger les statistiques pour le moment. Réessayez dans quelques instants.",children:i.jsx(D,{className:"btn btn-secondary",to:"/",children:"Retour à l'accueil"})})});const s=e==null?void 0:e.totals,o=e?Math.max(...e.price_buckets.map(d=>d.n),1):1,a=e?Math.max(...e.by_region.map(d=>d.products),1):1,u=e?Lo.flatMap(d=>{const j=e.by_origin.find(k=>k.key===d);return j&&(j.products>0||j.stores>0)?[{key:d,stat:j}]:[]}):[],c=u.reduce((d,j)=>d+j.stat.products,0),g=e?Math.max(...e.by_category.map(d=>d.products),1):1,m=e?[...e.availability].filter(d=>at[d.key]).sort((d,j)=>at[d.key].order-at[j.key].order):[],v=m.reduce((d,j)=>d+j.n,0),w=e&&s?[{label:"Produits avec image",value:e.coverage.with_image,total:s.products},{label:"Produits avec description",value:e.coverage.with_desc,total:s.products},{label:"Boutiques avec logo",value:e.coverage.with_logo,total:s.stores_registry},{label:"Boutiques géolocalisées",value:e.coverage.with_region,total:s.stores_registry}].map(d=>({...d,pct:d.total?d.value/d.total:0})):[];return i.jsxs("div",{className:"page stats",children:[i.jsxs("section",{className:"stats-hero",children:[i.jsx("p",{className:"hero-eyebrow",children:"Statistiques"}),i.jsxs("h1",{className:"stats-hero-title",children:["Le Québec qui vend en ligne, ",i.jsx("em",{children:"en chiffres."})]}),i.jsxs("p",{className:"stats-hero-sub",children:["Portrait généré à partir des catalogues publics agrégés par Fabri-Ka — données au ",l,", recalculées en continu. Chaque chiffre est vivant : il se met à jour à mesure que les boutiques se synchronisent. Pour le détail complet, téléchargez le rapport de marché."]}),i.jsxs("div",{className:"stats-hero-actions",children:[i.jsxs("a",{className:"btn btn-primary stats-report-btn",href:eu,download:!0,children:[i.jsx(Xa,{size:18}),"Télécharger le rapport PDF"]}),i.jsx("span",{className:"stats-report-hint",children:tu})]})]}),i.jsx("section",{className:"stats-kpis","aria-label":"Chiffres clés",children:s?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:i.jsx(Wt,{value:s.products})}),i.jsx("span",{className:"stats-kpi-label",children:"Produits"}),i.jsxs("span",{className:"stats-kpi-sub",children:[M(s.products_priced)," avec prix affiché"]})]}),i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:i.jsx(Wt,{value:s.stores_live})}),i.jsx("span",{className:"stats-kpi-label",children:"Boutiques actives"}),i.jsxs("span",{className:"stats-kpi-sub",children:[ln(s.stores_live,s.stores_registry)||"—"," ","du registre"]})]}),i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:i.jsx(Wt,{value:s.stores_registry})}),i.jsx("span",{className:"stats-kpi-label",children:"Boutiques au registre"}),i.jsx("span",{className:"stats-kpi-sub",children:"boutiques suivies"})]}),i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:i.jsx(Wt,{value:s.regions})}),i.jsx("span",{className:"stats-kpi-label",children:"Régions"}),i.jsx("span",{className:"stats-kpi-sub",children:"du Québec couvertes"})]}),i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:ne(s.price_median)||"—"}),i.jsx("span",{className:"stats-kpi-label",children:"Prix médian"}),i.jsxs("span",{className:"stats-kpi-sub",children:["sur ",M(s.products_priced)," produits"]})]}),i.jsxs("div",{className:"stats-kpi",children:[i.jsx("span",{className:"stats-kpi-value",children:ne(s.price_avg)||"—"}),i.jsx("span",{className:"stats-kpi-label",children:"Prix moyen"}),i.jsx("span",{className:"stats-kpi-sub",children:"panier type"})]})]}):Array.from({length:6},(d,j)=>i.jsxs("div",{className:"stats-kpi",children:[i.jsx(U,{width:"80px",height:"2rem"}),i.jsx(U,{width:"110px",height:"0.8rem"}),i.jsx(U,{width:"90px",height:"0.7rem"})]},j))}),e?i.jsxs(i.Fragment,{children:[e.newest.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Nouveautés du marché",children:[i.jsxs("header",{className:"section-header",children:[i.jsx("h2",{children:"Nouveautés du marché"}),i.jsx(D,{className:"section-see-all",to:"/produits?sort=recent",children:"Voir les récents"})]}),i.jsx("div",{className:"stats-newest-rail",children:e.newest.map(d=>i.jsxs(D,{className:"card stats-newest-card",to:`/produits/${encodeURIComponent(d.uid)}`,children:[i.jsx("span",{className:"stats-newest-chip",children:d.category_label||"Divers"}),i.jsx("span",{className:"stats-newest-title",children:d.title}),i.jsxs("span",{className:"stats-newest-foot",children:[i.jsx("span",{className:"stats-newest-price",children:ne(d.price)||"Prix n.d."}),i.jsx("span",{className:"stats-newest-store",children:d.store_name})]})]},d.uid))})]}),e.price_buckets.length>0&&s&&i.jsxs("section",{className:"stats-section","aria-label":"Répartition des prix",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Répartition des prix"})}),i.jsxs("p",{className:"stats-section-note",children:[M(s.products_priced)," produits avec prix affiché."]}),i.jsx("div",{className:"stats-bars",children:e.price_buckets.map(d=>i.jsxs("div",{className:"stats-bar-row",children:[i.jsx("span",{className:"stats-bar-name",children:dg[d.bucket]??d.bucket}),i.jsx("span",{className:"stats-bar-track",children:i.jsx("span",{className:"stats-bar-fill stats-bar-fill-terracotta",style:{width:`${d.n/o*100}%`}})}),i.jsxs("span",{className:"stats-bar-value",children:[M(d.n),i.jsx("em",{children:ln(d.n,s.products_priced)})]})]},d.bucket))}),i.jsxs("p",{className:"stats-hist-caption",children:["Prix médian"," ",i.jsx("strong",{children:ne(s.price_median)||"—"})," · prix moyen ",i.jsx("strong",{children:ne(s.price_avg)||"—"})]})]}),e.by_category.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Catégories",children:[i.jsxs("header",{className:"section-header",children:[i.jsx("h2",{children:"Par catégorie"}),i.jsx(D,{className:"section-see-all",to:"/produits",children:"Tout le catalogue"})]}),i.jsx("div",{className:"stats-cat-table-wrap",children:i.jsxs("table",{className:"stats-cat-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Catégorie"}),i.jsx("th",{className:"num",children:"Produits ↓"}),i.jsx("th",{className:"num",children:"Boutiques"}),i.jsx("th",{className:"num",children:"Prix médian"}),i.jsx("th",{className:"num",children:"Prix moyen"}),i.jsx("th",{className:"num",children:"Fourchette"})]})}),i.jsx("tbody",{children:e.by_category.map(d=>i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx(D,{className:"stats-cat-link",to:`/produits?category=${encodeURIComponent(d.key)}`,children:d.label})}),i.jsx("td",{className:"num stats-cat-prod",children:i.jsxs("span",{className:"stats-cat-prod-inner",children:[i.jsx("span",{className:"stats-cat-prod-bar","aria-hidden":"true",children:i.jsx("span",{className:"stats-cat-prod-fill",style:{width:`${d.products/g*100}%`}})}),i.jsx("span",{className:"stats-cat-prod-n",children:M(d.products)})]})}),i.jsx("td",{className:"num",children:M(d.stores)}),i.jsx("td",{className:"num",children:ne(d.price_median)||"—"}),i.jsx("td",{className:"num",children:ne(d.price_avg)||"—"}),i.jsx("td",{className:"num stats-cat-range",children:d.price_min!==null&&d.price_max!==null?`${Kn(d.price_min)} – ${Kn(d.price_max)}`:"—"})]},d.key))})]})}),i.jsx("div",{className:"stats-cat-cards",children:e.by_category.map(d=>i.jsxs(D,{className:"card stats-cat-card",to:`/produits?category=${encodeURIComponent(d.key)}`,children:[i.jsxs("div",{className:"stats-cat-card-head",children:[i.jsx("strong",{children:d.label}),i.jsxs("span",{className:"stats-cat-card-count",children:[M(d.products)," produits"]})]}),i.jsxs("dl",{className:"stats-cat-card-grid",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Boutiques"}),i.jsx("dd",{children:M(d.stores)})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Prix médian"}),i.jsx("dd",{children:ne(d.price_median)||"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Prix moyen"}),i.jsx("dd",{children:ne(d.price_avg)||"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Fourchette"}),i.jsx("dd",{children:d.price_min!==null&&d.price_max!==null?`${Kn(d.price_min)} – ${Kn(d.price_max)}`:"—"})]})]})]},d.key))})]}),e.by_region.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Régions",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Par région"})}),i.jsx("div",{className:"stats-regions",children:e.by_region.map(d=>i.jsxs("div",{className:"stats-region-row",children:[i.jsxs("div",{className:"stats-region-head",children:[i.jsx(D,{className:"stats-region-name",to:`/produits?region=${encodeURIComponent(d.key)}`,children:d.key}),i.jsxs("span",{className:"stats-region-meta",children:[M(d.stores)," boutique",d.stores>1?"s":"",d.price_avg!==null&&` · prix moyen ${Kn(d.price_avg)}`]})]}),i.jsxs("div",{className:"stats-bar-row stats-bar-row-flat",children:[i.jsx("span",{className:"stats-bar-track",children:i.jsx("span",{className:"stats-bar-fill stats-bar-fill-pine",style:{width:`${d.products/a*100}%`}})}),i.jsx("span",{className:"stats-bar-value",children:M(d.products)})]})]},d.key))})]}),e.growth.length>1&&i.jsxs("section",{className:"stats-section","aria-label":"Croissance",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Produits ajoutés par jour (30 jours)"})}),i.jsx(fg,{points:e.growth})]}),u.length>0&&c>0&&i.jsxs("section",{className:"stats-section","aria-label":"Origine",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Par origine"})}),i.jsx("div",{className:"stats-origin-bar",role:"img","aria-label":u.map(d=>`${In[d.key]} : ${M(d.stat.products)} produits`).join(" · "),children:u.filter(d=>d.stat.products>0).map(d=>{const j=d.stat.products/c*100;return i.jsx("span",{className:`stats-origin-seg origin-${d.key}`,style:{width:`${j}%`},title:`${In[d.key]} — ${M(d.stat.products)} produits (${ln(d.stat.products,c)})`,children:j>=6&&i.jsx("span",{className:"stats-origin-seg-letter",children:d.key})},d.key)})}),i.jsx("ul",{className:"stats-origin-legend",children:u.map(d=>i.jsxs("li",{children:[i.jsx(Dn,{origin:d.key,withLabel:!0}),i.jsxs("span",{className:"stats-origin-legend-counts",children:[M(d.stat.stores)," boutique",d.stat.stores>1?"s":""," ·"," ",M(d.stat.products)," produits",c>0&&d.stat.products>0&&` (${ln(d.stat.products,c)})`]})]},d.key))})]}),e.by_platform.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Plateformes",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Plateformes"})}),i.jsx("div",{className:"stats-platforms",children:e.by_platform.map(d=>i.jsxs("span",{className:"stats-platform-chip",children:[i.jsx("strong",{children:d.key})," × ",M(d.stores)," boutique",d.stores>1?"s":""," (",M(d.products)," produits)"]},d.key))})]}),m.length>0&&v>0&&i.jsxs("section",{className:"stats-section","aria-label":"Disponibilité",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Disponibilité"})}),i.jsx("div",{className:"stats-avail-bar",role:"img","aria-label":m.map(d=>`${at[d.key].label} : ${M(d.n)} produits`).join(" · "),children:m.filter(d=>d.n>0).map(d=>i.jsx("span",{className:`stats-avail-seg stats-avail-${at[d.key].slug}`,style:{width:`${d.n/v*100}%`},title:`${at[d.key].label} — ${M(d.n)} (${ln(d.n,v)})`},d.key))}),i.jsx("ul",{className:"stats-avail-legend",children:m.map(d=>i.jsxs("li",{children:[i.jsx("span",{className:`stats-avail-dot stats-avail-${at[d.key].slug}`,"aria-hidden":"true"}),i.jsxs("span",{children:[at[d.key].label," ",i.jsx("strong",{children:M(d.n)})," ",i.jsx("em",{children:ln(d.n,v)})]})]},d.key))})]}),w.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Complétude des données",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Complétude des données"})}),i.jsx("div",{className:"stats-coverage",children:w.map(d=>i.jsxs("div",{className:"stats-meter",children:[i.jsxs("div",{className:"stats-meter-head",children:[i.jsx("span",{className:"stats-meter-label",children:d.label}),i.jsx("span",{className:"stats-meter-pct",children:qd.format(d.pct)})]}),i.jsx("span",{className:"stats-meter-track",children:i.jsx("span",{className:"stats-meter-fill",style:{width:`${d.pct*100}%`}})}),i.jsxs("span",{className:"stats-meter-sub",children:[M(d.value)," / ",M(d.total)]})]},d.label))})]}),i.jsxs("div",{className:"stats-columns",children:[e.top_stores.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Top boutiques",children:[i.jsxs("header",{className:"section-header",children:[i.jsx("h2",{children:"Top boutiques"}),i.jsx(D,{className:"section-see-all",to:"/boutiques",children:"Toutes les boutiques"})]}),i.jsx("ol",{className:"stats-top-stores",children:e.top_stores.map((d,j)=>i.jsxs("li",{children:[i.jsx("span",{className:"stats-rank",children:j+1}),i.jsx(Sn,{storeId:d.id,name:d.name,logoUrl:d.logo_url,size:"sm"}),i.jsxs("span",{className:"stats-top-store-id",children:[i.jsx(D,{to:`/boutiques/${encodeURIComponent(d.id)}`,children:d.name}),d.region&&i.jsx("span",{className:"stats-top-store-region",children:d.region})]}),i.jsx("span",{className:"stats-top-store-count",children:M(d.products)})]},d.id))})]}),e.most_expensive.length>0&&i.jsxs("section",{className:"stats-section","aria-label":"Produits les plus chers",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Les plus chers"})}),i.jsx("p",{className:"stats-section-note",children:"Le grand luxe made in Québec — véridique, promis."}),i.jsx("ol",{className:"stats-expensive",children:e.most_expensive.map(d=>i.jsxs("li",{children:[i.jsxs(D,{className:"stats-expensive-link",to:`/produits/${encodeURIComponent(d.uid)}`,children:[i.jsx("span",{className:"stats-expensive-title",children:d.title}),i.jsx("span",{className:"stats-expensive-store",children:d.store_name})]}),i.jsx("span",{className:"stats-expensive-price",children:ne(d.price)})]},d.uid))})]})]})]}):i.jsxs("div",{className:"stats-loading","aria-hidden":"true",children:[i.jsx(U,{height:"220px",radius:"12px"}),i.jsx(U,{height:"320px",radius:"12px"}),i.jsx(U,{height:"220px",radius:"12px"})]}),i.jsxs("section",{className:"stats-report-footer","aria-label":"Rapport de marché",children:[i.jsxs("a",{className:"btn btn-secondary stats-report-btn",href:eu,download:!0,children:[i.jsx(Xa,{size:18}),"Télécharger le rapport PDF"]}),i.jsx("span",{className:"stats-report-hint",children:tu})]})]})}const hg=24,mg="Fabri-Ka — Tous les produits québécois. Un seul endroit.",gg=[{value:"recent",label:"Plus récents"},{value:"price_asc",label:"Prix croissant"},{value:"price_desc",label:"Prix décroissant"},{value:"title",label:"Ordre alphabétique"}];function vg(){const{id:e}=Ed(),[t,n]=Ro(),[r,l]=y.useState(null),[s,o]=y.useState(!1),[a,u]=y.useState(null),[c,g]=y.useState(!0),[m,v]=y.useState(!1),w=Math.max(1,parseInt(t.get("page")??"1",10)||1),d=t.get("q")??"",j=t.get("tri")??"recent",[k,h]=y.useState(d),f=y.useRef(void 0);y.useEffect(()=>{h(d)},[d]),y.useEffect(()=>{if(!e)return;const T=new AbortController;return l(null),o(!1),v(!1),Bm(e,T.signal).then(l).catch(C=>{C instanceof DOMException&&C.name==="AbortError"||o(!0)}),window.scrollTo({top:0}),()=>T.abort()},[e]),y.useEffect(()=>(r&&(document.title=`${r.name} — Fabri-Ka`),()=>{document.title=mg}),[r]);const p=(r==null?void 0:r.cover_url)??null;y.useEffect(()=>{if(!p)return;let T=!1;const C=new Image;return C.onload=()=>{T||v(!0)},C.src=p,()=>{T=!0}},[p]),y.useEffect(()=>{if(!e)return;const T=new AbortController;return g(!0),To({store:e,q:d||void 0,sort:j,page:w,per_page:hg},T.signal).then(C=>{u(C),g(!1)}).catch(C=>{C instanceof DOMException&&C.name==="AbortError"||(u(null),g(!1))}),()=>T.abort()},[e,d,j,w]);const x=y.useMemo(()=>T=>{n(C=>{const z=new URLSearchParams(C),I=T.q??d,V=T.sort??j,X=T.page??1;return I?z.set("q",I):z.delete("q"),V&&V!=="recent"?z.set("tri",V):z.delete("tri"),X>1?z.set("page",String(X)):z.delete("page"),z},{replace:T.page===void 0})},[n,d,j]);function S(T){h(T),window.clearTimeout(f.current),f.current=window.setTimeout(()=>x({q:T}),300)}function _(T){var C;x({page:T}),(C=document.getElementById("store-catalogue"))==null||C.scrollIntoView({behavior:"smooth",block:"start"})}if(s)return i.jsx("div",{className:"page",children:i.jsx(_t,{message:"Boutique introuvable.",children:i.jsx(D,{className:"btn btn-secondary",to:"/boutiques",children:"Retour aux boutiques"})})});const P=r!=null&&r.socials&&!Array.isArray(r.socials)?r.socials:{},E=P.instagram,O=P.facebook,L=r==null?void 0:r.product_stats,ee=r?[r.city,r.region].filter(Boolean).join(", ")||"Québec":"",oe=Km((r==null?void 0:r.last_sync)??null),de=L&&L.price_min!==null&&L.price_max!==null?L.price_min===L.price_max?ne(L.price_min):`${ne(L.price_min)} – ${ne(L.price_max)}`:null,it=((r==null?void 0:r.category_breakdown)??[]).filter(T=>T.key!==null&&T.key!==""&&T.n>0),Ft=(r==null?void 0:r.similar)??[],tn=!!(p&&m);return i.jsxs("div",{className:"page page-store-detail",children:[i.jsxs("nav",{className:"breadcrumb","aria-label":"Fil d'Ariane",children:[i.jsx(D,{to:"/boutiques",children:"Boutiques"}),i.jsx("span",{"aria-hidden":"true",children:"/"}),i.jsx("span",{children:(r==null?void 0:r.name)??"…"})]}),r?i.jsxs(i.Fragment,{children:[i.jsxs("header",{className:tn?"store-hero store-hero-covered":"store-hero",children:[i.jsxs("div",{className:"store-hero-cover","aria-hidden":"true",children:[tn&&i.jsx("div",{className:"store-hero-cover-img",style:{backgroundImage:`url("${p}")`}}),i.jsx("div",{className:"store-hero-scrim"})]}),i.jsxs("div",{className:"store-hero-body",children:[i.jsx(Sn,{storeId:r.id,name:r.name,logoUrl:r.logo_url,size:"lg",ring:!0,className:"store-hero-logo"}),i.jsx("h1",{className:"store-hero-name",children:r.name}),i.jsxs("div",{className:"store-hero-chips",children:[i.jsxs("span",{className:"store-hero-chip",children:[i.jsx(zd,{size:14}),ee]}),i.jsx(Dn,{origin:r.origin_class,withLabel:!0})]}),i.jsxs("div",{className:"store-hero-actions",children:[i.jsxs("a",{className:"btn btn-primary store-hero-cta",href:r.url,target:"_blank",rel:"noopener noreferrer",children:["Visiter la boutique ",i.jsx(Dl,{size:16})]}),E&&i.jsx("a",{className:"store-social-link",href:E,target:"_blank",rel:"noopener noreferrer","aria-label":`Instagram de ${r.name}`,title:"Instagram",children:i.jsx(Mm,{size:19})}),O&&i.jsx("a",{className:"store-social-link",href:O,target:"_blank",rel:"noopener noreferrer","aria-label":`Facebook de ${r.name}`,title:"Facebook",children:i.jsx(Fm,{size:19})}),i.jsx("span",{className:"store-hero-domain",children:Od(r.url)})]})]})]}),(r.description_meta||r.origin_evidence)&&i.jsxs("section",{className:"store-about",children:[r.description_meta&&i.jsx("p",{className:"store-about-text",children:r.description_meta}),r.origin_evidence&&i.jsxs("blockquote",{className:"store-evidence",children:["« ",r.origin_evidence," »"]})]}),i.jsxs("section",{className:"store-stats","aria-label":"Statistiques de la boutique",children:[i.jsxs("div",{className:"store-stat-tile",children:[i.jsx("span",{className:"store-stat-value",children:M((L==null?void 0:L.n)??r.product_count)}),i.jsxs("span",{className:"store-stat-label",children:["Produit",((L==null?void 0:L.n)??r.product_count)===1?"":"s"," en ligne"]})]}),de&&i.jsxs("div",{className:"store-stat-tile",children:[i.jsx("span",{className:"store-stat-value store-stat-value-sm",children:de}),i.jsx("span",{className:"store-stat-label",children:"Fourchette de prix"})]}),i.jsxs("div",{className:"store-stat-tile",children:[i.jsx("span",{className:"store-stat-value store-stat-value-sm",children:r.region||"Québec"}),i.jsx("span",{className:"store-stat-label",children:r.platform?`Région · ${r.platform}`:"Région"})]}),oe&&i.jsxs("div",{className:"store-stat-tile",children:[i.jsx("span",{className:"store-stat-value store-stat-value-sm",children:oe}),i.jsx("span",{className:"store-stat-label",children:"Dernière synchro"})]})]}),it.length>0&&i.jsx("section",{className:"store-categories","aria-label":"Catégories de la boutique",children:i.jsx("div",{className:"category-chips",children:it.map(T=>i.jsxs(D,{className:"chip",to:`/produits?store=${encodeURIComponent(r.id)}&category=${encodeURIComponent(T.key)}`,children:[i.jsx("span",{className:"chip-icon",children:Id(T.label)}),T.label,i.jsx("span",{className:"chip-count",children:M(T.n)})]},T.key))})})]}):i.jsxs("div",{className:"store-hero",children:[i.jsx("div",{className:"store-hero-cover","aria-hidden":"true",children:i.jsx("div",{className:"store-hero-scrim"})}),i.jsxs("div",{className:"store-hero-body",children:[i.jsx(U,{height:"72px",width:"72px",radius:"50%"}),i.jsx(U,{height:"2.2rem",width:"55%"}),i.jsx(U,{height:"1rem",width:"35%"})]})]}),i.jsxs("section",{className:"store-detail-products",id:"store-catalogue",children:[i.jsx("div",{className:"section-header",children:i.jsxs("h2",{children:["Catalogue",a&&!c&&i.jsxs(i.Fragment,{children:[" (",M(a.total),")"]})]})}),i.jsxs("div",{className:"store-catalogue-toolbar",children:[i.jsxs("div",{className:"store-catalogue-search",children:[i.jsx("span",{className:"searchbar-icon",children:i.jsx(_r,{size:17})}),i.jsx("input",{type:"search",value:k,onChange:T=>S(T.target.value),placeholder:"Chercher dans la boutique…","aria-label":"Chercher dans la boutique"})]}),i.jsx("select",{value:j,onChange:T=>x({sort:T.target.value}),"aria-label":"Trier les produits",children:gg.map(T=>i.jsx("option",{value:T.value,children:T.label},T.value))})]}),c?i.jsx(Vd,{count:12}):i.jsxs(i.Fragment,{children:[i.jsx(Ad,{products:(a==null?void 0:a.items)??[],emptyMessage:d?"Aucun produit ne correspond à cette recherche dans la boutique":"Aucun produit trouvé pour cette boutique"}),a&&i.jsx(Ud,{page:a.page,perPage:a.per_page,total:a.total,onPageChange:_})]})]}),Ft.length>0&&i.jsxs("section",{className:"rail store-similar",children:[i.jsx("header",{className:"section-header",children:i.jsx("h2",{children:"Boutiques similaires"})}),i.jsx("div",{className:"rail-track",children:Ft.map(T=>i.jsxs(D,{to:`/boutiques/${encodeURIComponent(T.id)}`,className:"card store-mini-card",children:[i.jsx(Sn,{storeId:T.id,name:T.name,logoUrl:T.logo_url,size:"sm"}),i.jsxs("span",{className:"store-mini-body",children:[i.jsx("span",{className:"store-mini-name",children:T.name}),i.jsxs("span",{className:"store-mini-meta",children:[T.region||"Québec"," · ",M(T.product_count)," produit",T.product_count===1?"":"s"]})]})]},T.id))})]}),r&&i.jsxs("div",{className:"store-cta-bar",children:[i.jsxs("div",{className:"store-cta-id",children:[i.jsx(Sn,{storeId:r.id,name:r.name,logoUrl:r.logo_url,size:"sm"}),i.jsx("span",{className:"store-cta-name",children:r.name})]}),i.jsxs("a",{className:"btn btn-primary store-cta-btn",href:r.url,target:"_blank",rel:"noopener noreferrer",children:["Visiter la boutique ",i.jsx(Dl,{size:15})]})]})]})}function yg({store:e}){return i.jsxs(D,{to:`/boutiques/${encodeURIComponent(e.id)}`,className:"card store-card",children:[i.jsxs("div",{className:"store-card-top",children:[i.jsx(Sn,{storeId:e.id,name:e.name,logoUrl:e.logo_url,size:"md"}),i.jsxs("div",{className:"store-card-heading",children:[i.jsx("h3",{className:"store-card-name",children:e.name}),i.jsx("p",{className:"store-card-domain",children:Od(e.url)})]}),i.jsx(Dn,{origin:e.origin_class})]}),i.jsxs("p",{className:"store-card-location",children:[i.jsx(zd,{size:14}),[e.city,e.region].filter(Boolean).join(", ")||"Québec"]}),i.jsxs("div",{className:"store-card-meta",children:[e.platform&&i.jsx("span",{className:"platform-badge",children:e.platform}),i.jsxs("span",{className:"store-card-count",children:[M(e.product_count)," produit",e.product_count===1?"":"s"]})]})]})}function xg(){const[e,t]=Ro(),[n,r]=y.useState(null),[l,s]=y.useState(null),[o,a]=y.useState(!0),[u,c]=y.useState(!1),g=e.get("region")??"",m=e.get("q")??"",v=e.get("avec_produits")!=="0",[w,d]=y.useState(m),j=y.useRef(void 0);y.useEffect(()=>{d(m)},[m]),y.useEffect(()=>{const p=new AbortController;return zo(p.signal).then(r).catch(()=>{}),()=>p.abort()},[]),y.useEffect(()=>{const p=new AbortController;return a(!0),c(!1),Am({region:g||void 0,q:m||void 0,with_products:v},p.signal).then(x=>{s(x),a(!1)}).catch(x=>{x instanceof DOMException&&x.name==="AbortError"||(c(!0),a(!1))}),()=>p.abort()},[g,m,v]);const k=y.useMemo(()=>p=>{t(x=>{const S=new URLSearchParams(x),_=p.region??g,P=p.q??m,E=p.withProducts??v;return _?S.set("region",_):S.delete("region"),P?S.set("q",P):S.delete("q"),E?S.delete("avec_produits"):S.set("avec_produits","0"),S},{replace:!0})},[t,g,m,v]);function h(p){d(p),window.clearTimeout(j.current),j.current=window.setTimeout(()=>k({q:p}),300)}const f=y.useMemo(()=>[...(l==null?void 0:l.items)??[]].sort((p,x)=>x.product_count-p.product_count),[l]);return i.jsxs("div",{className:"page stores",children:[i.jsxs("div",{className:"page-header",children:[i.jsx("h1",{children:"Boutiques"}),l&&!o&&i.jsxs("p",{className:"catalog-count",children:[M(l.total)," boutique",l.total===1?"":"s"]})]}),i.jsxs("div",{className:"stores-toolbar",children:[i.jsx("input",{type:"search",value:w,onChange:p=>h(p.target.value),placeholder:"Rechercher une boutique…","aria-label":"Rechercher une boutique"}),i.jsxs("select",{value:g,onChange:p=>k({region:p.target.value}),"aria-label":"Filtrer par région",children:[i.jsx("option",{value:"",children:"Toutes les régions"}),((n==null?void 0:n.all_regions)??[]).map(p=>i.jsx("option",{value:p,children:p},p))]}),i.jsxs("label",{className:"toggle",children:[i.jsx("input",{type:"checkbox",checked:v,onChange:p=>k({withProducts:p.target.checked})}),i.jsx("span",{children:"Avec produits"})]})]}),o?i.jsx("div",{className:"store-grid",children:Array.from({length:8},(p,x)=>i.jsxs("div",{className:"card store-card",children:[i.jsxs("div",{className:"store-card-top",children:[i.jsx(U,{height:"44px",width:"44px",radius:"50%"}),i.jsx("div",{className:"store-card-heading",children:i.jsx(U,{height:"1.3rem",width:"70%"})})]}),i.jsx(U,{height:"0.9rem",width:"50%"}),i.jsx(U,{height:"0.9rem",width:"60%"})]},x))}):u?i.jsx(_t,{variant:"error",message:"Impossible de charger les boutiques. Réessayez plus tard."}):f.length===0?i.jsx(_t,{message:"Aucune boutique trouvée",children:i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>t(new URLSearchParams,{replace:!0}),children:"Réinitialiser les filtres"})}):i.jsx("div",{className:"store-grid",children:f.map(p=>i.jsx(yg,{store:p},p.id))})]})}const nu="header-search-input";function jg(){const e=It();return y.useEffect(()=>{function t(n){if(n.key!=="/"||n.metaKey||n.ctrlKey||n.altKey)return;const r=n.target,l=(r==null?void 0:r.tagName)??"";if(l==="INPUT"||l==="TEXTAREA"||l==="SELECT"||r!=null&&r.isContentEditable)return;const s=document.getElementById(nu);s instanceof HTMLInputElement&&(n.preventDefault(),s.focus(),s.select())}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),i.jsx("header",{className:"site-header",children:i.jsxs("div",{className:"site-header-inner",children:[i.jsxs(D,{to:"/",className:"logo","aria-label":"Fabri-Ka — Accueil",children:["Fabri",i.jsx("span",{className:"logo-dot",children:"·"}),"Ka"]}),i.jsxs("nav",{className:"site-nav","aria-label":"Navigation principale",children:[i.jsx(qt,{to:"/produits",children:"Produits"}),i.jsx(qt,{to:"/boutiques",children:"Boutiques"}),i.jsx(qt,{to:"/stats",children:"Stats"}),i.jsx(qt,{to:"/a-propos",children:"À propos"})]}),i.jsx("div",{className:"site-header-search",children:i.jsx(Md,{compact:!0,shortcutHint:!0,inputId:nu,initialValue:e.pathname==="/produits"?new URLSearchParams(e.search).get("q")??"":"",placeholder:"Rechercher…"},e.pathname+e.search)})]})})}function wg(){return i.jsxs("footer",{className:"site-footer",children:[i.jsxs("div",{className:"site-footer-inner",children:[i.jsxs("div",{className:"footer-brand",children:[i.jsxs("span",{className:"logo logo-footer",children:["Fabri",i.jsx("span",{className:"logo-dot",children:"·"}),"Ka"]}),i.jsx("p",{children:"Tous les produits québécois. Un seul endroit."})]}),i.jsxs("nav",{className:"footer-col","aria-label":"Explorer",children:[i.jsx("span",{className:"footer-col-title",children:"Explorer"}),i.jsx(D,{to:"/produits",children:"Produits"}),i.jsx(D,{to:"/boutiques",children:"Boutiques"}),i.jsx(D,{to:"/produits?sort=recent",children:"Nouveautés"}),i.jsx(D,{to:"/stats",children:"Stats"})]}),i.jsxs("nav",{className:"footer-col","aria-label":"Fabri-Ka",children:[i.jsx("span",{className:"footer-col-title",children:"Fabri-Ka"}),i.jsx(D,{to:"/a-propos",children:"À propos"}),i.jsx("a",{href:"mailto:contact@spboucher.ai",children:"Contact"})]})]}),i.jsx("p",{className:"footer-legal",children:"© 2026 Simon-Pierre Boucher — Fabri-Ka agrège des catalogues publics; les prix et disponibilités appartiennent aux boutiques sources."})]})}function Ng(){return i.jsxs("div",{className:"app",children:[i.jsx(jg,{}),i.jsx("main",{className:"site-main",children:i.jsxs(um,{children:[i.jsx(Ge,{path:"/",element:i.jsx(rg,{})}),i.jsx(Ge,{path:"/produits",element:i.jsx(tg,{})}),i.jsx(Ge,{path:"/produits/:uid",element:i.jsx(og,{})}),i.jsx(Ge,{path:"/boutiques",element:i.jsx(xg,{})}),i.jsx(Ge,{path:"/boutiques/:id",element:i.jsx(vg,{})}),i.jsx(Ge,{path:"/stats",element:i.jsx(pg,{})}),i.jsx(Ge,{path:"/a-propos",element:i.jsx(Ym,{})}),i.jsx(Ge,{path:"*",element:i.jsx(lg,{})})]})}),i.jsx(wg,{}),i.jsx(Dm,{})]})}Ms.createRoot(document.getElementById("root")).render(i.jsx(pu.StrictMode,{children:i.jsx(ym,{basename:"/fabri/".replace(/\/$/,""),children:i.jsx(Ng,{})})}));