@metron-labs/quote-react 0.1.43 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/QuickQuote.js +9 -2
- package/dist/app/stages/BasketStage.js +11 -6
- package/dist/embed/quote.js +19 -12
- package/dist/lib/boq/inputLimits.d.ts +2 -0
- package/dist/lib/boq/inputLimits.js +2 -0
- package/dist/lib/config.js +2 -1
- package/dist/styles.css +7 -0
- package/dist/util/pricing.js +3 -2
- package/package.json +1 -1
package/dist/embed/quote.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as Ua,b as X}from"./chunk-SQE76S5B.js";var dm=Ua(it=>{"use strict";function Sc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<dl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Da(e){return e.length===0?null:e[0]}function fl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>dl(l,a))c<i&&0>dl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>dl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function dl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}it.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(rm=performance,it.unstable_now=function(){return rm.now()}):(xc=Date,im=xc.now(),it.unstable_now=function(){return xc.now()-im});var rm,xc,im,Ka=[],wr=[],Yw=1,da=null,Rt=3,Cc=!1,$n=!1,Zn=!1,qc=!1,lm=typeof setTimeout=="function"?setTimeout:null,sm=typeof clearTimeout=="function"?clearTimeout:null,nm=typeof setImmediate<"u"?setImmediate:null;function ml(e){for(var t=Da(wr);t!==null;){if(t.callback===null)fl(wr);else if(t.startTime<=e)fl(wr),t.sortIndex=t.expirationTime,Sc(Ka,t);else break;t=Da(wr)}}function Ec(e){if(Zn=!1,ml(e),!$n)if(Da(Ka)!==null)$n=!0,Ai||(Ai=!0,zi());else{var t=Da(wr);t!==null&&Mc(Ec,t.startTime-e)}}var Ai=!1,Kn=-1,cm=5,um=-1;function pm(){return qc?!0:!(it.unstable_now()-um<cm)}function kc(){if(qc=!1,Ai){var e=it.unstable_now();um=e;var t=!0;try{e:{$n=!1,Zn&&(Zn=!1,sm(Kn),Kn=-1),Cc=!0;var a=Rt;try{t:{for(ml(e),da=Da(Ka);da!==null&&!(da.expirationTime>e&&pm());){var r=da.callback;if(typeof r=="function"){da.callback=null,Rt=da.priorityLevel;var i=r(da.expirationTime<=e);if(e=it.unstable_now(),typeof i=="function"){da.callback=i,ml(e),t=!0;break t}da===Da(Ka)&&fl(Ka),ml(e)}else fl(Ka);da=Da(Ka)}if(da!==null)t=!0;else{var n=Da(wr);n!==null&&Mc(Ec,n.startTime-e),t=!1}}break e}finally{da=null,Rt=a,Cc=!1}t=void 0}}finally{t?zi():Ai=!1}}}var zi;typeof nm=="function"?zi=function(){nm(kc)}:typeof MessageChannel<"u"?(Nc=new MessageChannel,om=Nc.port2,Nc.port1.onmessage=kc,zi=function(){om.postMessage(null)}):zi=function(){lm(kc,0)};var Nc,om;function Mc(e,t){Kn=lm(function(){e(it.unstable_now())},t)}it.unstable_IdlePriority=5;it.unstable_ImmediatePriority=1;it.unstable_LowPriority=4;it.unstable_NormalPriority=3;it.unstable_Profiling=null;it.unstable_UserBlockingPriority=2;it.unstable_cancelCallback=function(e){e.callback=null};it.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):cm=0<e?Math.floor(1e3/e):5};it.unstable_getCurrentPriorityLevel=function(){return Rt};it.unstable_next=function(e){switch(Rt){case 1:case 2:case 3:var t=3;break;default:t=Rt}var a=Rt;Rt=t;try{return e()}finally{Rt=a}};it.unstable_requestPaint=function(){qc=!0};it.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Rt;Rt=e;try{return t()}finally{Rt=a}};it.unstable_scheduleCallback=function(e,t,a){var r=it.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:Yw++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Sc(wr,e),Da(Ka)===null&&e===Da(wr)&&(Zn?(sm(Kn),Kn=-1):Zn=!0,Mc(Ec,a-r))):(e.sortIndex=i,Sc(Ka,e),$n||Cc||($n=!0,Ai||(Ai=!0,zi()))),e};it.unstable_shouldYield=pm;it.unstable_wrapCallback=function(e){var t=Rt;return function(){var a=Rt;Rt=t;try{return e.apply(this,arguments)}finally{Rt=a}}}});var fm=Ua((lx,mm)=>{"use strict";mm.exports=dm()});var Sm=Ua(de=>{"use strict";var Ac=Symbol.for("react.transitional.element"),Vw=Symbol.for("react.portal"),Xw=Symbol.for("react.fragment"),$w=Symbol.for("react.strict_mode"),Zw=Symbol.for("react.profiler"),Kw=Symbol.for("react.consumer"),Pw=Symbol.for("react.context"),Jw=Symbol.for("react.forward_ref"),Fw=Symbol.for("react.suspense"),Iw=Symbol.for("react.memo"),wm=Symbol.for("react.lazy"),Ww=Symbol.for("react.activity"),gm=Symbol.iterator;function e0(e){return e===null||typeof e!="object"?null:(e=gm&&e[gm]||e["@@iterator"],typeof e=="function"?e:null)}var ym={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_m=Object.assign,xm={};function Ui(e,t,a){this.props=e,this.context=t,this.refs=xm,this.updater=a||ym}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("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")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function km(){}km.prototype=Ui.prototype;function Rc(e,t,a){this.props=e,this.context=t,this.refs=xm,this.updater=a||ym}var Uc=Rc.prototype=new km;Uc.constructor=Rc;_m(Uc,Ui.prototype);Uc.isPureReactComponent=!0;var hm=Array.isArray;function zc(){}var et={H:null,A:null,T:null,S:null},Nm=Object.prototype.hasOwnProperty;function Dc(e,t,a){var r=a.ref;return{$$typeof:Ac,type:e,key:t,ref:r!==void 0?r:null,props:a}}function t0(e,t){return Dc(e.type,t,e.props)}function Bc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ac}function a0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var bm=/\/+/g;function Tc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?a0(""+e.key):t.toString(36)}function r0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(zc,zc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ri(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ac:case Vw:o=!0;break;case wm:return o=e._init,Ri(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+Tc(e,0):r,hm(i)?(a="",o!=null&&(a=o.replace(bm,"$&/")+"/"),Ri(i,t,a,"",function(p){return p})):i!=null&&(Bc(i)&&(i=t0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(bm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(hm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+Tc(r,c),o+=Ri(r,t,a,n,i);else if(c=e0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+Tc(r,c++),o+=Ri(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Ri(r0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function gl(e,t,a){if(e==null)return e;var r=[],i=0;return Ri(e,r,"","",function(n){return t.call(a,n,i++)}),r}function i0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var vm=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},n0={map:gl,forEach:function(e,t,a){gl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return gl(e,function(){t++}),t},toArray:function(e){return gl(e,function(t){return t})||[]},only:function(e){if(!Bc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=Ww;de.Children=n0;de.Component=Ui;de.Fragment=Xw;de.Profiler=Zw;de.PureComponent=Rc;de.StrictMode=$w;de.Suspense=Fw;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=et;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return et.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=_m({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Nm.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Dc(e.type,i,r)};de.createContext=function(e){return e={$$typeof:Pw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Kw,_context:e},e};de.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Nm.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Dc(e,n,i)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:Jw,render:e}};de.isValidElement=Bc;de.lazy=function(e){return{$$typeof:wm,_payload:{_status:-1,_result:e},_init:i0}};de.memo=function(e,t){return{$$typeof:Iw,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=et.T,a={};et.T=a;try{var r=e(),i=et.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(zc,vm)}catch(n){vm(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),et.T=t}};de.unstable_useCacheRefresh=function(){return et.H.useCacheRefresh()};de.use=function(e){return et.H.use(e)};de.useActionState=function(e,t,a){return et.H.useActionState(e,t,a)};de.useCallback=function(e,t){return et.H.useCallback(e,t)};de.useContext=function(e){return et.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return et.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return et.H.useEffect(e,t)};de.useEffectEvent=function(e){return et.H.useEffectEvent(e)};de.useId=function(){return et.H.useId()};de.useImperativeHandle=function(e,t,a){return et.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return et.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return et.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return et.H.useMemo(e,t)};de.useOptimistic=function(e,t){return et.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return et.H.useReducer(e,t,a)};de.useRef=function(e){return et.H.useRef(e)};de.useState=function(e){return et.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return et.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return et.H.useTransition()};de.version="19.2.3"});var Xe=Ua((cx,Cm)=>{"use strict";Cm.exports=Sm()});var Em=Ua(Bt=>{"use strict";var o0=Xe();function qm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function yr(){}var Dt={d:{f:yr,r:function(){throw Error(qm(522))},D:yr,C:yr,L:yr,m:yr,X:yr,S:yr,M:yr},p:0,findDOMNode:null},l0=Symbol.for("react.portal");function s0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Pn=o0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function hl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Bt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(qm(299));return s0(e,t,null,a)};Bt.flushSync=function(e){var t=Pn.T,a=Dt.p;try{if(Pn.T=null,Dt.p=2,e)return e()}finally{Pn.T=t,Dt.p=a,Dt.d.f()}};Bt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Dt.d.C(e,t))};Bt.prefetchDNS=function(e){typeof e=="string"&&Dt.d.D(e)};Bt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=hl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Dt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Dt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Bt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=hl(t.as,t.crossOrigin);Dt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Dt.d.M(e)};Bt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=hl(a,t.crossOrigin);Dt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Bt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=hl(t.as,t.crossOrigin);Dt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Dt.d.m(e)};Bt.requestFormReset=function(e){Dt.d.r(e)};Bt.unstable_batchedUpdates=function(e,t){return e(t)};Bt.useFormState=function(e,t,a){return Pn.H.useFormState(e,t,a)};Bt.useFormStatus=function(){return Pn.H.useHostTransitionStatus()};Bt.version="19.2.3"});var zm=Ua((px,Tm)=>{"use strict";function Mm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mm)}catch(e){console.error(e)}}Mm(),Tm.exports=Em()});var Vb=Ua(Qs=>{"use strict";var wt=fm(),ig=Xe(),c0=zm();function O(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ng(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function og(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function lg(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Am(e){if(Bo(e)!==e)throw Error(O(188))}function u0(e){var t=e.alternate;if(!t){if(t=Bo(e),t===null)throw Error(O(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return Am(i),e;if(n===r)return Am(i),t;n=n.sibling}throw Error(O(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(O(189))}}if(a.alternate!==r)throw Error(O(190))}if(a.tag!==3)throw Error(O(188));return a.stateNode.current===a?e:t}function sg(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=sg(e),t!==null)return t;e=e.sibling}return null}var rt=Object.assign,p0=Symbol.for("react.element"),bl=Symbol.for("react.transitional.element"),ro=Symbol.for("react.portal"),ji=Symbol.for("react.fragment"),cg=Symbol.for("react.strict_mode"),hu=Symbol.for("react.profiler"),ug=Symbol.for("react.consumer"),ar=Symbol.for("react.context"),pp=Symbol.for("react.forward_ref"),bu=Symbol.for("react.suspense"),vu=Symbol.for("react.suspense_list"),dp=Symbol.for("react.memo"),_r=Symbol.for("react.lazy"),wu=Symbol.for("react.activity"),d0=Symbol.for("react.memo_cache_sentinel"),Rm=Symbol.iterator;function Jn(e){return e===null||typeof e!="object"?null:(e=Rm&&e[Rm]||e["@@iterator"],typeof e=="function"?e:null)}var m0=Symbol.for("react.client.reference");function yu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===m0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ji:return"Fragment";case hu:return"Profiler";case cg:return"StrictMode";case bu:return"Suspense";case vu:return"SuspenseList";case wu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ro:return"Portal";case ar:return e.displayName||"Context";case ug:return(e._context.displayName||"Context")+".Consumer";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dp:return t=e.displayName||null,t!==null?t:yu(e.type)||"Memo";case _r:t=e._payload,e=e._init;try{return yu(e(t))}catch{}}return null}var io=Array.isArray,ue=ig.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He=c0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ri={pending:!1,data:null,method:null,action:null},_u=[],Qi=-1;function ja(e){return{current:e}}function St(e){0>Qi||(e.current=_u[Qi],_u[Qi]=null,Qi--)}function Ie(e,t){Qi++,_u[Qi]=e.current,e.current=t}var Ha=ja(null),xo=ja(null),Ar=ja(null),Jl=ja(null);function Fl(e,t){switch(Ie(Ar,t),Ie(xo,e),Ie(Ha,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qf(t),e=Tb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}St(Ha),Ie(Ha,e)}function on(){St(Ha),St(xo),St(Ar)}function xu(e){e.memoizedState!==null&&Ie(Jl,e);var t=Ha.current,a=Tb(t,e.type);t!==a&&(Ie(xo,e),Ie(Ha,a))}function Il(e){xo.current===e&&(St(Ha),St(xo)),Jl.current===e&&(St(Jl),Ro._currentValue=ri)}var Oc,Um;function Wr(e){if(Oc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Oc=t&&t[1]||"",Um=-1<a.stack.indexOf(`
|
|
1
|
+
import{a as Ua,b as V}from"./chunk-SQE76S5B.js";var fm=Ua(it=>{"use strict";function Sc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<dl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Da(e){return e.length===0?null:e[0]}function fl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>dl(l,a))c<i&&0>dl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>dl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function dl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}it.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(nm=performance,it.unstable_now=function(){return nm.now()}):(xc=Date,om=xc.now(),it.unstable_now=function(){return xc.now()-om});var nm,xc,om,Ka=[],wr=[],Xw=1,da=null,Rt=3,Cc=!1,$n=!1,Zn=!1,qc=!1,cm=typeof setTimeout=="function"?setTimeout:null,um=typeof clearTimeout=="function"?clearTimeout:null,lm=typeof setImmediate<"u"?setImmediate:null;function ml(e){for(var t=Da(wr);t!==null;){if(t.callback===null)fl(wr);else if(t.startTime<=e)fl(wr),t.sortIndex=t.expirationTime,Sc(Ka,t);else break;t=Da(wr)}}function Ec(e){if(Zn=!1,ml(e),!$n)if(Da(Ka)!==null)$n=!0,Ai||(Ai=!0,zi());else{var t=Da(wr);t!==null&&Mc(Ec,t.startTime-e)}}var Ai=!1,Kn=-1,pm=5,dm=-1;function mm(){return qc?!0:!(it.unstable_now()-dm<pm)}function kc(){if(qc=!1,Ai){var e=it.unstable_now();dm=e;var t=!0;try{e:{$n=!1,Zn&&(Zn=!1,um(Kn),Kn=-1),Cc=!0;var a=Rt;try{t:{for(ml(e),da=Da(Ka);da!==null&&!(da.expirationTime>e&&mm());){var r=da.callback;if(typeof r=="function"){da.callback=null,Rt=da.priorityLevel;var i=r(da.expirationTime<=e);if(e=it.unstable_now(),typeof i=="function"){da.callback=i,ml(e),t=!0;break t}da===Da(Ka)&&fl(Ka),ml(e)}else fl(Ka);da=Da(Ka)}if(da!==null)t=!0;else{var n=Da(wr);n!==null&&Mc(Ec,n.startTime-e),t=!1}}break e}finally{da=null,Rt=a,Cc=!1}t=void 0}}finally{t?zi():Ai=!1}}}var zi;typeof lm=="function"?zi=function(){lm(kc)}:typeof MessageChannel<"u"?(Nc=new MessageChannel,sm=Nc.port2,Nc.port1.onmessage=kc,zi=function(){sm.postMessage(null)}):zi=function(){cm(kc,0)};var Nc,sm;function Mc(e,t){Kn=cm(function(){e(it.unstable_now())},t)}it.unstable_IdlePriority=5;it.unstable_ImmediatePriority=1;it.unstable_LowPriority=4;it.unstable_NormalPriority=3;it.unstable_Profiling=null;it.unstable_UserBlockingPriority=2;it.unstable_cancelCallback=function(e){e.callback=null};it.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pm=0<e?Math.floor(1e3/e):5};it.unstable_getCurrentPriorityLevel=function(){return Rt};it.unstable_next=function(e){switch(Rt){case 1:case 2:case 3:var t=3;break;default:t=Rt}var a=Rt;Rt=t;try{return e()}finally{Rt=a}};it.unstable_requestPaint=function(){qc=!0};it.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Rt;Rt=e;try{return t()}finally{Rt=a}};it.unstable_scheduleCallback=function(e,t,a){var r=it.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:Xw++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Sc(wr,e),Da(Ka)===null&&e===Da(wr)&&(Zn?(um(Kn),Kn=-1):Zn=!0,Mc(Ec,a-r))):(e.sortIndex=i,Sc(Ka,e),$n||Cc||($n=!0,Ai||(Ai=!0,zi()))),e};it.unstable_shouldYield=mm;it.unstable_wrapCallback=function(e){var t=Rt;return function(){var a=Rt;Rt=t;try{return e.apply(this,arguments)}finally{Rt=a}}}});var hm=Ua((sx,gm)=>{"use strict";gm.exports=fm()});var qm=Ua(de=>{"use strict";var Ac=Symbol.for("react.transitional.element"),Vw=Symbol.for("react.portal"),$w=Symbol.for("react.fragment"),Zw=Symbol.for("react.strict_mode"),Kw=Symbol.for("react.profiler"),Pw=Symbol.for("react.consumer"),Jw=Symbol.for("react.context"),Fw=Symbol.for("react.forward_ref"),Iw=Symbol.for("react.suspense"),Ww=Symbol.for("react.memo"),_m=Symbol.for("react.lazy"),e0=Symbol.for("react.activity"),bm=Symbol.iterator;function t0(e){return e===null||typeof e!="object"?null:(e=bm&&e[bm]||e["@@iterator"],typeof e=="function"?e:null)}var xm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},km=Object.assign,Nm={};function Ui(e,t,a){this.props=e,this.context=t,this.refs=Nm,this.updater=a||xm}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("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")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sm(){}Sm.prototype=Ui.prototype;function Rc(e,t,a){this.props=e,this.context=t,this.refs=Nm,this.updater=a||xm}var Uc=Rc.prototype=new Sm;Uc.constructor=Rc;km(Uc,Ui.prototype);Uc.isPureReactComponent=!0;var vm=Array.isArray;function zc(){}var et={H:null,A:null,T:null,S:null},Cm=Object.prototype.hasOwnProperty;function Dc(e,t,a){var r=a.ref;return{$$typeof:Ac,type:e,key:t,ref:r!==void 0?r:null,props:a}}function a0(e,t){return Dc(e.type,t,e.props)}function Bc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ac}function r0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var wm=/\/+/g;function Tc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?r0(""+e.key):t.toString(36)}function i0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(zc,zc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ri(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ac:case Vw:o=!0;break;case _m:return o=e._init,Ri(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+Tc(e,0):r,vm(i)?(a="",o!=null&&(a=o.replace(wm,"$&/")+"/"),Ri(i,t,a,"",function(p){return p})):i!=null&&(Bc(i)&&(i=a0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(wm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(vm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+Tc(r,c),o+=Ri(r,t,a,n,i);else if(c=t0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+Tc(r,c++),o+=Ri(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Ri(i0(e),t,a,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function gl(e,t,a){if(e==null)return e;var r=[],i=0;return Ri(e,r,"","",function(n){return t.call(a,n,i++)}),r}function n0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ym=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},o0={map:gl,forEach:function(e,t,a){gl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return gl(e,function(){t++}),t},toArray:function(e){return gl(e,function(t){return t})||[]},only:function(e){if(!Bc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Activity=e0;de.Children=o0;de.Component=Ui;de.Fragment=$w;de.Profiler=Kw;de.PureComponent=Rc;de.StrictMode=Zw;de.Suspense=Iw;de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=et;de.__COMPILER_RUNTIME={__proto__:null,c:function(e){return et.H.useMemoCache(e)}};de.cache=function(e){return function(){return e.apply(null,arguments)}};de.cacheSignal=function(){return null};de.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=km({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Cm.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Dc(e.type,i,r)};de.createContext=function(e){return e={$$typeof:Jw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Pw,_context:e},e};de.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Cm.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Dc(e,n,i)};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:Fw,render:e}};de.isValidElement=Bc;de.lazy=function(e){return{$$typeof:_m,_payload:{_status:-1,_result:e},_init:n0}};de.memo=function(e,t){return{$$typeof:Ww,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=et.T,a={};et.T=a;try{var r=e(),i=et.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(zc,ym)}catch(n){ym(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),et.T=t}};de.unstable_useCacheRefresh=function(){return et.H.useCacheRefresh()};de.use=function(e){return et.H.use(e)};de.useActionState=function(e,t,a){return et.H.useActionState(e,t,a)};de.useCallback=function(e,t){return et.H.useCallback(e,t)};de.useContext=function(e){return et.H.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e,t){return et.H.useDeferredValue(e,t)};de.useEffect=function(e,t){return et.H.useEffect(e,t)};de.useEffectEvent=function(e){return et.H.useEffectEvent(e)};de.useId=function(){return et.H.useId()};de.useImperativeHandle=function(e,t,a){return et.H.useImperativeHandle(e,t,a)};de.useInsertionEffect=function(e,t){return et.H.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return et.H.useLayoutEffect(e,t)};de.useMemo=function(e,t){return et.H.useMemo(e,t)};de.useOptimistic=function(e,t){return et.H.useOptimistic(e,t)};de.useReducer=function(e,t,a){return et.H.useReducer(e,t,a)};de.useRef=function(e){return et.H.useRef(e)};de.useState=function(e){return et.H.useState(e)};de.useSyncExternalStore=function(e,t,a){return et.H.useSyncExternalStore(e,t,a)};de.useTransition=function(){return et.H.useTransition()};de.version="19.2.3"});var Ve=Ua((ux,Em)=>{"use strict";Em.exports=qm()});var Tm=Ua(Bt=>{"use strict";var l0=Ve();function Mm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function yr(){}var Dt={d:{f:yr,r:function(){throw Error(Mm(522))},D:yr,C:yr,L:yr,m:yr,X:yr,S:yr,M:yr},p:0,findDOMNode:null},s0=Symbol.for("react.portal");function c0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Pn=l0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function hl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Dt;Bt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Mm(299));return c0(e,t,null,a)};Bt.flushSync=function(e){var t=Pn.T,a=Dt.p;try{if(Pn.T=null,Dt.p=2,e)return e()}finally{Pn.T=t,Dt.p=a,Dt.d.f()}};Bt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Dt.d.C(e,t))};Bt.prefetchDNS=function(e){typeof e=="string"&&Dt.d.D(e)};Bt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=hl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Dt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Dt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Bt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=hl(t.as,t.crossOrigin);Dt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Dt.d.M(e)};Bt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=hl(a,t.crossOrigin);Dt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Bt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=hl(t.as,t.crossOrigin);Dt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Dt.d.m(e)};Bt.requestFormReset=function(e){Dt.d.r(e)};Bt.unstable_batchedUpdates=function(e,t){return e(t)};Bt.useFormState=function(e,t,a){return Pn.H.useFormState(e,t,a)};Bt.useFormStatus=function(){return Pn.H.useHostTransitionStatus()};Bt.version="19.2.3"});var Rm=Ua((dx,Am)=>{"use strict";function zm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zm)}catch(e){console.error(e)}}zm(),Am.exports=Tm()});var $b=Ua(Qs=>{"use strict";var wt=hm(),og=Ve(),u0=Rm();function O(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function lg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function sg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function cg(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Um(e){if(Bo(e)!==e)throw Error(O(188))}function p0(e){var t=e.alternate;if(!t){if(t=Bo(e),t===null)throw Error(O(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return Um(i),e;if(n===r)return Um(i),t;n=n.sibling}throw Error(O(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o){for(l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o)throw Error(O(189))}}if(a.alternate!==r)throw Error(O(190))}if(a.tag!==3)throw Error(O(188));return a.stateNode.current===a?e:t}function ug(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=ug(e),t!==null)return t;e=e.sibling}return null}var rt=Object.assign,d0=Symbol.for("react.element"),bl=Symbol.for("react.transitional.element"),ro=Symbol.for("react.portal"),ji=Symbol.for("react.fragment"),pg=Symbol.for("react.strict_mode"),hu=Symbol.for("react.profiler"),dg=Symbol.for("react.consumer"),ar=Symbol.for("react.context"),pp=Symbol.for("react.forward_ref"),bu=Symbol.for("react.suspense"),vu=Symbol.for("react.suspense_list"),dp=Symbol.for("react.memo"),_r=Symbol.for("react.lazy"),wu=Symbol.for("react.activity"),m0=Symbol.for("react.memo_cache_sentinel"),Dm=Symbol.iterator;function Jn(e){return e===null||typeof e!="object"?null:(e=Dm&&e[Dm]||e["@@iterator"],typeof e=="function"?e:null)}var f0=Symbol.for("react.client.reference");function yu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===f0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ji:return"Fragment";case hu:return"Profiler";case pg:return"StrictMode";case bu:return"Suspense";case vu:return"SuspenseList";case wu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ro:return"Portal";case ar:return e.displayName||"Context";case dg:return(e._context.displayName||"Context")+".Consumer";case pp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dp:return t=e.displayName||null,t!==null?t:yu(e.type)||"Memo";case _r:t=e._payload,e=e._init;try{return yu(e(t))}catch{}}return null}var io=Array.isArray,ue=og.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He=u0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ri={pending:!1,data:null,method:null,action:null},_u=[],Qi=-1;function ja(e){return{current:e}}function St(e){0>Qi||(e.current=_u[Qi],_u[Qi]=null,Qi--)}function Ie(e,t){Qi++,_u[Qi]=e.current,e.current=t}var Ha=ja(null),xo=ja(null),Ar=ja(null),Jl=ja(null);function Fl(e,t){switch(Ie(Ar,t),Ie(xo,e),Ie(Ha,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yf(t),e=Ab(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}St(Ha),Ie(Ha,e)}function on(){St(Ha),St(xo),St(Ar)}function xu(e){e.memoizedState!==null&&Ie(Jl,e);var t=Ha.current,a=Ab(t,e.type);t!==a&&(Ie(xo,e),Ie(Ha,a))}function Il(e){xo.current===e&&(St(Ha),St(xo)),Jl.current===e&&(St(Jl),Ro._currentValue=ri)}var Oc,Bm;function Wr(e){if(Oc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Oc=t&&t[1]||"",Bm=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Oc+e+
|
|
3
|
+
`+Oc+e+Bm}var Lc=!1;function Hc(e,t){if(!e||Lc)return"";Lc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(b){var m=b}Reflect.construct(e,[],h)}else{try{h.call()}catch(b){m=b}e.call(h.prototype)}}else{try{throw Error()}catch(b){m=b}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(b){if(b&&m&&typeof b.stack=="string")return[b.stack,m.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=r.DetermineComponentFrameRoot(),o=n[0],l=n[1];if(o&&l){var c=o.split(`
|
|
4
4
|
`),p=l.split(`
|
|
5
5
|
`);for(i=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;i<p.length&&!p[i].includes("DetermineComponentFrameRoot");)i++;if(r===c.length||i===p.length)for(r=c.length-1,i=p.length-1;1<=r&&0<=i&&c[r]!==p[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==p[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==p[i]){var d=`
|
|
6
|
-
`+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=i);break}}}finally{Lc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Wr(a):""}function
|
|
6
|
+
`+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=i);break}}}finally{Lc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Wr(a):""}function g0(e,t){switch(e.tag){case 26:case 27:case 5:return Wr(e.type);case 16:return Wr("Lazy");case 13:return e.child!==t&&t!==null?Wr("Suspense Fallback"):Wr("Suspense");case 19:return Wr("SuspenseList");case 0:case 15:return Hc(e.type,!1);case 11:return Hc(e.type.render,!1);case 1:return Hc(e.type,!0);case 31:return Wr("Activity");default:return""}}function Om(e){try{var t="",a=null;do t+=g0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
7
|
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var ku=Object.prototype.hasOwnProperty,mp=wt.unstable_scheduleCallback,jc=wt.unstable_cancelCallback,g0=wt.unstable_shouldYield,h0=wt.unstable_requestPaint,ra=wt.unstable_now,b0=wt.unstable_getCurrentPriorityLevel,pg=wt.unstable_ImmediatePriority,dg=wt.unstable_UserBlockingPriority,Wl=wt.unstable_NormalPriority,v0=wt.unstable_LowPriority,mg=wt.unstable_IdlePriority,w0=wt.log,y0=wt.unstable_setDisableYieldValue,Oo=null,ia=null;function qr(e){if(typeof w0=="function"&&y0(e),ia&&typeof ia.setStrictMode=="function")try{ia.setStrictMode(Oo,e)}catch{}}var na=Math.clz32?Math.clz32:k0,_0=Math.log,x0=Math.LN2;function k0(e){return e>>>=0,e===0?32:31-(_0(e)/x0|0)|0}var vl=256,wl=262144,yl=4194304;function ei(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ss(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=ei(r):(o&=l,o!==0?i=ei(o):a||(a=l&~e,a!==0&&(i=ei(a))))):(l=r&~n,l!==0?i=ei(l):o!==0?i=ei(o):a||(a=r&~e,a!==0&&(i=ei(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Lo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function N0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fg(){var e=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),e}function Qc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ho(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function S0(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var d=31-na(a),h=1<<d;l[d]=0,c[d]=-1;var m=p[d];if(m!==null)for(p[d]=null,d=0;d<m.length;d++){var b=m[d];b!==null&&(b.lane&=-536870913)}a&=~h}r!==0&&gg(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function gg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-na(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function hg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-na(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function bg(e,t){var a=t&-t;return a=(a&42)!==0?1:fp(a),(a&(e.suspendedLanes|t))!==0?0:a}function fp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vg(){var e=He.p;return e!==0?e:(e=window.event,e===void 0?32:Qb(e.type))}function Bm(e,t){var a=He.p;try{return He.p=e,t()}finally{He.p=a}}var Xr=Math.random().toString(36).slice(2),qt="__reactFiber$"+Xr,$t="__reactProps$"+Xr,bn="__reactContainer$"+Xr,Nu="__reactEvents$"+Xr,C0="__reactListeners$"+Xr,q0="__reactHandles$"+Xr,Om="__reactResources$"+Xr,jo="__reactMarker$"+Xr;function hp(e){delete e[qt],delete e[$t],delete e[Nu],delete e[C0],delete e[q0]}function Gi(e){var t=e[qt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[qt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=$f(e);e!==null;){if(a=e[qt])return a;e=$f(e)}return t}e=a,a=e.parentNode}return null}function vn(e){if(e=e[qt]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function no(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(O(33))}function Ii(e){var t=e[Om];return t||(t=e[Om]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[jo]=!0}var wg=new Set,yg={};function mi(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(yg[e]=t,e=0;e<t.length;e++)wg.add(t[e])}var E0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lm={},Hm={};function M0(e){return ku.call(Hm,e)?!0:ku.call(Lm,e)?!1:E0.test(e)?Hm[e]=!0:(Lm[e]=!0,!1)}function Dl(e,t,a){if(M0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function _l(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Pa(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _g(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function T0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Su(e){if(!e._valueTracker){var t=_g(e)?"checked":"value";e._valueTracker=T0(e,t,""+e[t])}}function xg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=_g(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function es(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}}var z0=/[\n"\\]/g;function ba(e){return e.replace(z0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?qu(e,o,fa(t)):a!=null?qu(e,o,fa(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+fa(l):e.removeAttribute("name")}function kg(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Su(e);return}a=a!=null?""+fa(a):"",t=t!=null?""+fa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Su(e)}function qu(e,t,a){t==="number"&&es(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Wi(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+fa(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ng(e,t,a){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+fa(a):""}function Sg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(O(92));if(io(r)){if(1<r.length)throw Error(O(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=fa(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Su(e)}function sn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var A0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function jm(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||A0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Cg(e,t,a){if(t!=null&&typeof t!="object")throw Error(O(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&jm(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&jm(e,n,t[n])}function bp(e){if(e.indexOf("-")===-1)return!1;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 R0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),U0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bl(e){return U0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rr(){}var Eu=null;function vp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,en=null;function Qm(e){var t=vn(e);if(t&&(e=t.stateNode)){var a=e[$t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ba(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[$t]||null;if(!i)throw Error(O(90));Cu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&xg(r)}break e;case"textarea":Ng(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Wi(e,!!a.multiple,t,!1)}}}var Gc=!1;function qg(e,t,a){if(Gc)return e(t,a);Gc=!0;try{var r=e(t);return r}finally{if(Gc=!1,(Yi!==null||en!==null)&&(Os(),Yi&&(t=Yi,e=en,en=Yi=null,Qm(t),e)))for(t=0;t<e.length;t++)Qm(e[t])}}function ko(e,t){var a=e.stateNode;if(a===null)return null;var r=a[$t]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(O(231,t,typeof a));return a}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mu=!1;if(sr)try{Di={},Object.defineProperty(Di,"passive",{get:function(){Mu=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Mu=!1}var Di,Er=null,wp=null,Ol=null;function Eg(){if(Ol)return Ol;var e,t=wp,a=t.length,r,i="value"in Er?Er.value:Er.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return Ol=i.slice(e,1<r?1-r:void 0)}function Ll(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xl(){return!0}function Gm(){return!1}function Zt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?xl:Gm,this.isPropagationStopped=Gm,this}return rt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=xl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=xl)},persist:function(){},isPersistent:xl}),t}var fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cs=Zt(fi),Qo=rt({},fi,{view:0,detail:0}),D0=Zt(Qo),Yc,Vc,Fn,qs=rt({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fn&&(Fn&&e.type==="mousemove"?(Yc=e.screenX-Fn.screenX,Vc=e.screenY-Fn.screenY):Vc=Yc=0,Fn=e),Yc)},movementY:function(e){return"movementY"in e?e.movementY:Vc}}),Ym=Zt(qs),B0=rt({},qs,{dataTransfer:0}),O0=Zt(B0),L0=rt({},Qo,{relatedTarget:0}),Xc=Zt(L0),H0=rt({},fi,{animationName:0,elapsedTime:0,pseudoElement:0}),j0=Zt(H0),Q0=rt({},fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),G0=Zt(Q0),Y0=rt({},fi,{data:0}),Vm=Zt(Y0),V0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$0[e])?!!t[e]:!1}function yp(){return Z0}var K0=rt({},Qo,{key:function(e){if(e.key){var t=V0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ll(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yp,charCode:function(e){return e.type==="keypress"?Ll(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ll(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P0=Zt(K0),J0=rt({},qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xm=Zt(J0),F0=rt({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yp}),I0=Zt(F0),W0=rt({},fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ey=Zt(W0),ty=rt({},qs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ay=Zt(ty),ry=rt({},fi,{newState:0,oldState:0}),iy=Zt(ry),ny=[9,13,27,32],_p=sr&&"CompositionEvent"in window,so=null;sr&&"documentMode"in document&&(so=document.documentMode);var oy=sr&&"TextEvent"in window&&!so,Mg=sr&&(!_p||so&&8<so&&11>=so),$m=" ",Zm=!1;function Tg(e,t){switch(e){case"keyup":return ny.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vi=!1;function ly(e,t){switch(e){case"compositionend":return zg(t);case"keypress":return t.which!==32?null:(Zm=!0,$m);case"textInput":return e=t.data,e===$m&&Zm?null:e;default:return null}}function sy(e,t){if(Vi)return e==="compositionend"||!_p&&Tg(e,t)?(e=Eg(),Ol=wp=Er=null,Vi=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mg&&t.locale!=="ko"?null:t.data;default:return null}}var cy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cy[e.type]:t==="textarea"}function Ag(e,t,a,r){Yi?en?en.push(r):en=[r]:Yi=r,t=vs(t,"onChange"),0<t.length&&(a=new Cs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var co=null,No=null;function uy(e){qb(e,0)}function Es(e){var t=no(e);if(xg(t))return e}function Pm(e,t){if(e==="change")return t}var Rg=!1;sr&&(sr?(Nl="oninput"in document,Nl||($c=document.createElement("div"),$c.setAttribute("oninput","return;"),Nl=typeof $c.oninput=="function"),kl=Nl):kl=!1,Rg=kl&&(!document.documentMode||9<document.documentMode));var kl,Nl,$c;function Jm(){co&&(co.detachEvent("onpropertychange",Ug),No=co=null)}function Ug(e){if(e.propertyName==="value"&&Es(No)){var t=[];Ag(t,No,e,vp(e)),qg(uy,t)}}function py(e,t,a){e==="focusin"?(Jm(),co=t,No=a,co.attachEvent("onpropertychange",Ug)):e==="focusout"&&Jm()}function dy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(No)}function my(e,t){if(e==="click")return Es(t)}function fy(e,t){if(e==="input"||e==="change")return Es(t)}function gy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var la=typeof Object.is=="function"?Object.is:gy;function So(e,t){if(la(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!ku.call(t,i)||!la(e[i],t[i]))return!1}return!0}function Fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Im(e,t){var a=Fm(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Fm(a)}}function Dg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=es(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=es(e.document)}return t}function xp(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")}var hy=sr&&"documentMode"in document&&11>=document.documentMode,Xi=null,Tu=null,uo=null,zu=!1;function Wm(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;zu||Xi==null||Xi!==es(r)||(r=Xi,"selectionStart"in r&&xp(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}),uo&&So(uo,r)||(uo=r,r=vs(Tu,"onSelect"),0<r.length&&(t=new Cs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Xi)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},Zc={},Og={};sr&&(Og=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function gi(e){if(Zc[e])return Zc[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Og)return Zc[e]=t[a];return e}var Lg=gi("animationend"),Hg=gi("animationiteration"),jg=gi("animationstart"),by=gi("transitionrun"),vy=gi("transitionstart"),wy=gi("transitioncancel"),Qg=gi("transitionend"),Gg=new Map,Au="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Au.push("scrollEnd");function Aa(e,t){Gg.set(e,t),mi(t,[e])}var ts=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ma=[],Zi=0,kp=0;function Ms(){for(var e=Zi,t=kp=Zi=0;t<e;){var a=ma[t];ma[t++]=null;var r=ma[t];ma[t++]=null;var i=ma[t];ma[t++]=null;var n=ma[t];if(ma[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&Yg(a,i,n)}}function Ts(e,t,a,r){ma[Zi++]=e,ma[Zi++]=t,ma[Zi++]=a,ma[Zi++]=r,kp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Np(e,t,a,r){return Ts(e,t,a,r),as(e)}function hi(e,t){return Ts(e,null,null,t),as(e)}function Yg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-na(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function as(e){if(50<yo)throw yo=0,Wu=null,Error(O(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function yy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=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 ta(e,t,a,r){return new yy(e,t,a,r)}function Sp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nr(e,t){var a=e.alternate;return a===null?(a=ta(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Vg(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Sp(e)&&(o=1);else if(typeof e=="string")o=k1(e,a,Ha.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case wu:return e=ta(31,a,t,i),e.elementType=wu,e.lanes=n,e;case ji:return ii(a.children,i,n,t);case cg:o=8,i|=24;break;case hu:return e=ta(12,a,t,i|2),e.elementType=hu,e.lanes=n,e;case bu:return e=ta(13,a,t,i),e.elementType=bu,e.lanes=n,e;case vu:return e=ta(19,a,t,i),e.elementType=vu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ar:o=10;break e;case ug:o=9;break e;case pp:o=11;break e;case dp:o=14;break e;case _r:o=16,r=null;break e}o=29,a=Error(O(130,e===null?"null":typeof e,"")),r=null}return t=ta(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ii(e,t,a,r){return e=ta(7,e,r,t),e.lanes=a,e}function Kc(e,t,a){return e=ta(6,e,null,t),e.lanes=a,e}function Xg(e){var t=ta(18,null,null,0);return t.stateNode=e,t}function Pc(e,t,a){return t=ta(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ef=new WeakMap;function va(e,t){if(typeof e=="object"&&e!==null){var a=ef.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Dm(t)},ef.set(e,t),t)}return{value:e,source:t,stack:Dm(t)}}var Pi=[],Ji=0,rs=null,Co=0,ga=[],ha=0,Qr=null,Ba=1,Oa="";function er(e,t){Pi[Ji++]=Co,Pi[Ji++]=rs,rs=e,Co=t}function $g(e,t,a){ga[ha++]=Ba,ga[ha++]=Oa,ga[ha++]=Qr,Qr=e;var r=Ba;e=Oa;var i=32-na(r)-1;r&=~(1<<i),a+=1;var n=32-na(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ba=1<<32-na(t)+i|a<<i|r,Oa=n+e}else Ba=1<<n|a<<i|r,Oa=e}function Cp(e){e.return!==null&&(er(e,1),$g(e,1,0))}function qp(e){for(;e===rs;)rs=Pi[--Ji],Pi[Ji]=null,Co=Pi[--Ji],Pi[Ji]=null;for(;e===Qr;)Qr=ga[--ha],ga[ha]=null,Oa=ga[--ha],ga[ha]=null,Ba=ga[--ha],ga[ha]=null}function Zg(e,t){ga[ha++]=Ba,ga[ha++]=Oa,ga[ha++]=Qr,Ba=t.id,Oa=t.overflow,Qr=e}var Et=null,at=null,Te=!1,Rr=null,wa=!1,Ru=Error(O(519));function Gr(e){var t=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(va(t,e)),Ru}function tf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[qt]=e,t[$t]=r,a){case"dialog":Ce("cancel",t),Ce("close",t);break;case"iframe":case"object":case"embed":Ce("load",t);break;case"video":case"audio":for(a=0;a<zo.length;a++)Ce(zo[a],t);break;case"source":Ce("error",t);break;case"img":case"image":case"link":Ce("error",t),Ce("load",t);break;case"details":Ce("toggle",t);break;case"input":Ce("invalid",t),kg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ce("invalid",t);break;case"textarea":Ce("invalid",t),Sg(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||Mb(t.textContent,a)?(r.popover!=null&&(Ce("beforetoggle",t),Ce("toggle",t)),r.onScroll!=null&&Ce("scroll",t),r.onScrollEnd!=null&&Ce("scrollend",t),r.onClick!=null&&(t.onclick=rr),t=!0):t=!1,t||Gr(e,!0)}function af(e){for(Et=e.return;Et;)switch(Et.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:Et=Et.return}}function Bi(e){if(e!==Et)return!1;if(!Te)return af(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ip(e.type,e.memoizedProps)),a=!a),a&&at&&Gr(e),af(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));at=Xf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));at=Xf(e)}else t===27?(t=at,$r(e.type)?(e=sp,sp=null,at=e):at=t):at=Et?_a(e.stateNode.nextSibling):null;return!0}function si(){at=Et=null,Te=!1}function Jc(){var e=Rr;return e!==null&&(Vt===null?Vt=e:Vt.push.apply(Vt,e),Rr=null),e}function qo(e){Rr===null?Rr=[e]:Rr.push(e)}var Uu=ja(null),bi=null,ir=null;function kr(e,t,a){Ie(Uu,t._currentValue),t._currentValue=a}function or(e){e._currentValue=Uu.current,St(Uu)}function Du(e,t,a){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===a)break;e=e.return}}function Bu(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Du(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(O(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Du(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function wn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(O(387));if(o=o.memoizedProps,o!==null){var l=i.type;la(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===Jl.current){if(o=i.alternate,o===null)throw Error(O(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ro):e=[Ro])}i=i.return}e!==null&&Bu(t,e,a,r),t.flags|=262144}function is(e){for(e=e.firstContext;e!==null;){if(!la(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ci(e){bi=e,ir=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Kg(bi,e)}function Sl(e,t){return bi===null&&ci(e),Kg(e,t)}function Kg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ir===null){if(e===null)throw Error(O(308));ir=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ir=ir.next=t;return a}var _y=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},xy=wt.unstable_scheduleCallback,ky=wt.unstable_NormalPriority,ht={$$typeof:ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ep(){return{controller:new _y,data:new Map,refCount:0}}function Go(e){e.refCount--,e.refCount===0&&xy(ky,function(){e.controller.abort()})}var po=null,Ou=0,cn=0,tn=null;function Ny(e,t){if(po===null){var a=po=[];Ou=0,cn=Wp(),tn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Ou++,t.then(rf,rf),t}function rf(){if(--Ou===0&&po!==null){tn!==null&&(tn.status="fulfilled");var e=po;po=null,cn=0,tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Sy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var nf=ue.S;ue.S=function(e,t){sb=ra(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ny(e,t),nf!==null&&nf(e,t)};var ni=ja(null);function Mp(){var e=ni.current;return e!==null?e:Ke.pooledCache}function jl(e,t){t===null?Ie(ni,ni.current):Ie(ni,t.pool)}function Pg(){var e=Mp();return e===null?null:{parent:ht._currentValue,pool:e}}var yn=Error(O(460)),Tp=Error(O(474)),zs=Error(O(542)),ns={then:function(){}};function of(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(rr,rr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sf(e),e;default:if(typeof t.status=="string")t.then(rr,rr);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(O(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sf(e),e}throw oi=t,yn}}function ti(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(oi=a,yn):a}}var oi=null;function lf(){if(oi===null)throw Error(O(459));var e=oi;return oi=null,e}function sf(e){if(e===yn||e===zs)throw Error(O(483))}var an=null,Eo=0;function Cl(e){var t=Eo;return Eo+=1,an===null&&(an=[]),Jg(an,e,t)}function In(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ql(e,t){throw t.$$typeof===p0?Error(O(525)):(e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fg(e){function t(f,u){if(e){var g=f.deletions;g===null?(f.deletions=[u],f.flags|=16):g.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=nr(f,u),f.index=0,f.sibling=null,f}function n(f,u,g){return f.index=g,e?(g=f.alternate,g!==null?(g=g.index,g<u?(f.flags|=67108866,u):g):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,g,v){return u===null||u.tag!==6?(u=Kc(g,f.mode,v),u.return=f,u):(u=i(u,g),u.return=f,u)}function c(f,u,g,v){var k=g.type;return k===ji?d(f,u,g.props.children,v,g.key):u!==null&&(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_r&&ti(k)===u.type)?(u=i(u,g.props),In(u,g),u.return=f,u):(u=Hl(g.type,g.key,g.props,null,f.mode,v),In(u,g),u.return=f,u)}function p(f,u,g,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=Pc(g,f.mode,v),u.return=f,u):(u=i(u,g.children||[]),u.return=f,u)}function d(f,u,g,v,k){return u===null||u.tag!==7?(u=ii(g,f.mode,v,k),u.return=f,u):(u=i(u,g),u.return=f,u)}function h(f,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Kc(""+u,f.mode,g),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case bl:return g=Hl(u.type,u.key,u.props,null,f.mode,g),In(g,u),g.return=f,g;case ro:return u=Pc(u,f.mode,g),u.return=f,u;case _r:return u=ti(u),h(f,u,g)}if(io(u)||Jn(u))return u=ii(u,f.mode,g,null),u.return=f,u;if(typeof u.then=="function")return h(f,Cl(u),g);if(u.$$typeof===ar)return h(f,Sl(f,u),g);ql(f,u)}return null}function m(f,u,g,v){var k=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return k!==null?null:l(f,u,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case bl:return g.key===k?c(f,u,g,v):null;case ro:return g.key===k?p(f,u,g,v):null;case _r:return g=ti(g),m(f,u,g,v)}if(io(g)||Jn(g))return k!==null?null:d(f,u,g,v,null);if(typeof g.then=="function")return m(f,u,Cl(g),v);if(g.$$typeof===ar)return m(f,u,Sl(f,g),v);ql(f,g)}return null}function b(f,u,g,v,k){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(g)||null,l(u,f,""+v,k);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bl:return f=f.get(v.key===null?g:v.key)||null,c(u,f,v,k);case ro:return f=f.get(v.key===null?g:v.key)||null,p(u,f,v,k);case _r:return v=ti(v),b(f,u,g,v,k)}if(io(v)||Jn(v))return f=f.get(g)||null,d(u,f,v,k,null);if(typeof v.then=="function")return b(f,u,g,Cl(v),k);if(v.$$typeof===ar)return b(f,u,g,Sl(u,v),k);ql(u,v)}return null}function w(f,u,g,v){for(var k=null,A=null,M=u,z=u=0,Y=null;M!==null&&z<g.length;z++){M.index>z?(Y=M,M=null):Y=M.sibling;var P=m(f,M,g[z],v);if(P===null){M===null&&(M=Y);break}e&&M&&P.alternate===null&&t(f,M),u=n(P,u,z),A===null?k=P:A.sibling=P,A=P,M=Y}if(z===g.length)return a(f,M),Te&&er(f,z),k;if(M===null){for(;z<g.length;z++)M=h(f,g[z],v),M!==null&&(u=n(M,u,z),A===null?k=M:A.sibling=M,A=M);return Te&&er(f,z),k}for(M=r(M);z<g.length;z++)Y=b(M,f,z,g[z],v),Y!==null&&(e&&Y.alternate!==null&&M.delete(Y.key===null?z:Y.key),u=n(Y,u,z),A===null?k=Y:A.sibling=Y,A=Y);return e&&M.forEach(function(ge){return t(f,ge)}),Te&&er(f,z),k}function E(f,u,g,v){if(g==null)throw Error(O(151));for(var k=null,A=null,M=u,z=u=0,Y=null,P=g.next();M!==null&&!P.done;z++,P=g.next()){M.index>z?(Y=M,M=null):Y=M.sibling;var ge=m(f,M,P.value,v);if(ge===null){M===null&&(M=Y);break}e&&M&&ge.alternate===null&&t(f,M),u=n(ge,u,z),A===null?k=ge:A.sibling=ge,A=ge,M=Y}if(P.done)return a(f,M),Te&&er(f,z),k;if(M===null){for(;!P.done;z++,P=g.next())P=h(f,P.value,v),P!==null&&(u=n(P,u,z),A===null?k=P:A.sibling=P,A=P);return Te&&er(f,z),k}for(M=r(M);!P.done;z++,P=g.next())P=b(M,f,z,P.value,v),P!==null&&(e&&P.alternate!==null&&M.delete(P.key===null?z:P.key),u=n(P,u,z),A===null?k=P:A.sibling=P,A=P);return e&&M.forEach(function(Ae){return t(f,Ae)}),Te&&er(f,z),k}function U(f,u,g,v){if(typeof g=="object"&&g!==null&&g.type===ji&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case bl:e:{for(var k=g.key;u!==null;){if(u.key===k){if(k=g.type,k===ji){if(u.tag===7){a(f,u.sibling),v=i(u,g.props.children),v.return=f,f=v;break e}}else if(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_r&&ti(k)===u.type){a(f,u.sibling),v=i(u,g.props),In(v,g),v.return=f,f=v;break e}a(f,u);break}else t(f,u);u=u.sibling}g.type===ji?(v=ii(g.props.children,f.mode,v,g.key),v.return=f,f=v):(v=Hl(g.type,g.key,g.props,null,f.mode,v),In(v,g),v.return=f,f=v)}return o(f);case ro:e:{for(k=g.key;u!==null;){if(u.key===k)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(f,u.sibling),v=i(u,g.children||[]),v.return=f,f=v;break e}else{a(f,u);break}else t(f,u);u=u.sibling}v=Pc(g,f.mode,v),v.return=f,f=v}return o(f);case _r:return g=ti(g),U(f,u,g,v)}if(io(g))return w(f,u,g,v);if(Jn(g)){if(k=Jn(g),typeof k!="function")throw Error(O(150));return g=k.call(g),E(f,u,g,v)}if(typeof g.then=="function")return U(f,u,Cl(g),v);if(g.$$typeof===ar)return U(f,u,Sl(f,g),v);ql(f,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(f,u.sibling),v=i(u,g),v.return=f,f=v):(a(f,u),v=Kc(g,f.mode,v),v.return=f,f=v),o(f)):a(f,u)}return function(f,u,g,v){try{Eo=0;var k=U(f,u,g,v);return an=null,k}catch(M){if(M===yn||M===zs)throw M;var A=ta(29,M,null,f.mode);return A.lanes=v,A.return=f,A}}}var ui=Fg(!0),Ig=Fg(!1),xr=!1;function zp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Le&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=as(e),Yg(e,null,a),t}return Ts(e,r,t,a),as(e)}function mo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,hg(e,a)}}function Fc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Hu=!1;function fo(){if(Hu){var e=tn;if(e!==null)throw e}}function go(e,t,a,r){Hu=!1;var i=e.updateQueue;xr=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=p:l.next=p,d.lastBaseUpdate=c))}if(n!==null){var h=i.baseState;o=0,d=p=c=null,l=n;do{var m=l.lane&-536870913,b=m!==l.lane;if(b?(Ee&m)===m:(r&m)===m){m!==0&&m===cn&&(Hu=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,E=l;m=t;var U=a;switch(E.tag){case 1:if(w=E.payload,typeof w=="function"){h=w.call(U,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,m=typeof w=="function"?w.call(U,h,m):w,m==null)break e;h=rt({},h,m);break e;case 2:xr=!0}}m=l.callback,m!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[m]:b.push(m))}else b={lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(p=d=b,c=h):d=d.next=b,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=d,n===null&&(i.shared.lanes=0),Vr|=o,e.lanes=o,e.memoizedState=h}}function Wg(e,t){if(typeof e!="function")throw Error(O(191,e));e.call(t)}function eh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Wg(a[e],t)}var un=ja(null),os=ja(0);function cf(e,t){e=dr,Ie(os,e),Ie(un,t),dr=e|t.baseLanes}function ju(){Ie(os,dr),Ie(un,un.current)}function Ap(){dr=os.current,St(un),St(os)}var sa=ja(null),ya=null;function Nr(e){var t=e.alternate;Ie(pt,pt.current&1),Ie(sa,e),ya===null&&(t===null||un.current!==null||t.memoizedState!==null)&&(ya=e)}function Qu(e){Ie(pt,pt.current),Ie(sa,e),ya===null&&(ya=e)}function th(e){e.tag===22?(Ie(pt,pt.current),Ie(sa,e),ya===null&&(ya=e)):Sr(e)}function Sr(){Ie(pt,pt.current),Ie(sa,sa.current)}function ea(e){St(sa),ya===e&&(ya=null),St(pt)}var pt=ja(0);function ls(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||op(a)||lp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cr=0,fe=null,Ze=null,ft=null,ss=!1,rn=!1,pi=!1,cs=0,Mo=0,nn=null,Cy=0;function lt(){throw Error(O(321))}function Rp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!la(e[a],t[a]))return!1;return!0}function Up(e,t,a,r,i,n){return cr=n,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ue.H=e===null||e.memoizedState===null?Ah:Xp,pi=!1,n=a(r,i),pi=!1,rn&&(n=rh(t,a,r,i)),ah(e),n}function ah(e){ue.H=To;var t=Ze!==null&&Ze.next!==null;if(cr=0,ft=Ze=fe=null,ss=!1,Mo=0,nn=null,t)throw Error(O(300));e===null||bt||(e=e.dependencies,e!==null&&is(e)&&(bt=!0))}function rh(e,t,a,r){fe=e;var i=0;do{if(rn&&(nn=null),Mo=0,rn=!1,25<=i)throw Error(O(301));if(i+=1,ft=Ze=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}ue.H=Rh,n=t(a,r)}while(rn);return n}function qy(){var e=ue.H,t=e.useState()[0];return t=typeof t.then=="function"?Yo(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(fe.flags|=1024),t}function Dp(){var e=cs!==0;return cs=0,e}function Bp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Op(e){if(ss){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ss=!1}cr=0,ft=Ze=fe=null,rn=!1,Mo=cs=0,nn=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?fe.memoizedState=ft=e:ft=ft.next=e,ft}function dt(){if(Ze===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=ft===null?fe.memoizedState:ft.next;if(t!==null)ft=t,Ze=e;else{if(e===null)throw fe.alternate===null?Error(O(467)):Error(O(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},ft===null?fe.memoizedState=ft=e:ft=ft.next=e}return ft}function As(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yo(e){var t=Mo;return Mo+=1,nn===null&&(nn=[]),e=Jg(nn,e,t),t=fe,(ft===null?t.memoizedState:ft.next)===null&&(t=t.alternate,ue.H=t===null||t.memoizedState===null?Ah:Xp),e}function Rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yo(e);if(e.$$typeof===ar)return Mt(e)}throw Error(O(438,String(e)))}function Lp(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=As(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=d0;return t.index++,a}function ur(e,t){return typeof t=="function"?t(e):t}function Ql(e){var t=dt();return Hp(t,Ze,e)}function Hp(e,t,a){var r=e.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,d=!1;do{var h=p.lane&-536870913;if(h!==p.lane?(Ee&h)===h:(cr&h)===h){var m=p.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),h===cn&&(d=!0);else if((cr&m)===m){p=p.next,m===cn&&(d=!0);continue}else h={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=h,o=n):c=c.next=h,fe.lanes|=m,Vr|=m;h=p.action,pi&&a(n,h),n=p.hasEagerState?p.eagerState:a(n,h)}else m={lane:h,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=m,o=n):c=c.next=m,fe.lanes|=h,Vr|=h;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!la(n,e.memoizedState)&&(bt=!0,d&&(a=tn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ic(e){var t=dt(),a=t.queue;if(a===null)throw Error(O(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);la(n,t.memoizedState)||(bt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function ih(e,t,a){var r=fe,i=dt(),n=Te;if(n){if(a===void 0)throw Error(O(407));a=a()}else a=t();var o=!la((Ze||i).memoizedState,a);if(o&&(i.memoizedState=a,bt=!0),i=i.queue,jp(lh.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||ft!==null&&ft.memoizedState.tag&1){if(r.flags|=2048,pn(9,{destroy:void 0},oh.bind(null,r,i,a,t),null),Ke===null)throw Error(O(349));n||(cr&127)!==0||nh(r,t,a)}return a}function nh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=As(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function oh(e,t,a,r){t.value=a,t.getSnapshot=r,sh(t)&&ch(e)}function lh(e,t,a){return a(function(){sh(t)&&ch(e)})}function sh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!la(e,a)}catch{return!0}}function ch(e){var t=hi(e,2);t!==null&&Xt(t,e,2)}function Gu(e){var t=Ot();if(typeof e=="function"){var a=e;if(e=a(),pi){qr(!0);try{a()}finally{qr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t}function uh(e,t,a,r){return e.baseState=a,Hp(e,Ze,typeof r=="function"?r:ur)}function Ey(e,t,a,r,i){if(Ds(e))throw Error(O(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};ue.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,ph(t,n)):(n.next=a.next,t.pending=a.next=n)}}function ph(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=ue.T,o={};ue.T=o;try{var l=a(i,r),c=ue.S;c!==null&&c(o,l),uf(e,t,l)}catch(p){Yu(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),ue.T=n}}else try{n=a(i,r),uf(e,t,n)}catch(p){Yu(e,t,p)}}function uf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){pf(e,t,r)},function(r){return Yu(e,t,r)}):pf(e,t,a)}function pf(e,t,a){t.status="fulfilled",t.value=a,dh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,ph(e,a)))}function Yu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,dh(t),t=t.next;while(t!==r)}e.action=null}function dh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mh(e,t){return t}function df(e,t){if(Te){var a=Ke.formState;if(a!==null){e:{var r=fe;if(Te){if(at){t:{for(var i=at,n=wa;i.nodeType!==8;){if(!n){i=null;break t}if(i=_a(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){at=_a(i.nextSibling),r=i.data==="F!";break e}}Gr(r)}r=!1}r&&(t=a[0])}}return a=Ot(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mh,lastRenderedState:t},a.queue=r,a=Mh.bind(null,fe,r),r.dispatch=a,r=Gu(!1),n=Vp.bind(null,fe,!1,r.queue),r=Ot(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=Ey.bind(null,fe,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function mf(e){var t=dt();return fh(t,Ze,e)}function fh(e,t,a){if(t=Hp(e,t,mh)[0],e=Ql(ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Yo(t)}catch(o){throw o===yn?zs:o}else r=t;t=dt();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,pn(9,{destroy:void 0},My.bind(null,i,a),null)),[r,n,e]}function My(e,t){e.action=t}function ff(e){var t=dt(),a=Ze;if(a!==null)return fh(t,a,e);dt(),t=t.memoizedState,a=dt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function pn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=As(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function gh(){return dt().memoizedState}function Gl(e,t,a,r){var i=Ot();fe.flags|=e,i.memoizedState=pn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Us(e,t,a,r){var i=dt();r=r===void 0?null:r;var n=i.memoizedState.inst;Ze!==null&&r!==null&&Rp(r,Ze.memoizedState.deps)?i.memoizedState=pn(t,n,a,r):(fe.flags|=e,i.memoizedState=pn(1|t,n,a,r))}function gf(e,t){Gl(8390656,8,e,t)}function jp(e,t){Us(2048,8,e,t)}function Ty(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=As(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function hh(e){var t=dt().memoizedState;return Ty({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(O(440));return t.impl.apply(void 0,arguments)}}function bh(e,t){return Us(4,2,e,t)}function vh(e,t){return Us(4,4,e,t)}function wh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yh(e,t,a){a=a!=null?a.concat([e]):null,Us(4,4,wh.bind(null,t,e),a)}function Qp(){}function _h(e,t){var a=dt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Rp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function xh(e,t){var a=dt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Rp(t,r[1]))return r[0];if(r=e(),pi){qr(!0);try{e()}finally{qr(!1)}}return a.memoizedState=[r,t],r}function Gp(e,t,a){return a===void 0||(cr&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=ub(),fe.lanes|=e,Vr|=e,a)}function kh(e,t,a,r){return la(a,t)?a:un.current!==null?(e=Gp(e,a,r),la(e,t)||(bt=!0),e):(cr&42)===0||(cr&1073741824)!==0&&(Ee&261930)===0?(bt=!0,e.memoizedState=a):(e=ub(),fe.lanes|=e,Vr|=e,t)}function Nh(e,t,a,r,i){var n=He.p;He.p=n!==0&&8>n?n:8;var o=ue.T,l={};ue.T=l,Vp(e,!1,t,a);try{var c=i(),p=ue.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=Sy(c,r);ho(e,t,d,oa(e))}else ho(e,t,r,oa(e))}catch(h){ho(e,t,{then:function(){},status:"rejected",reason:h},oa())}finally{He.p=n,o!==null&&l.types!==null&&(o.types=l.types),ue.T=o}}function zy(){}function Vu(e,t,a,r){if(e.tag!==5)throw Error(O(476));var i=Sh(e).queue;Nh(e,i,t,ri,a===null?zy:function(){return Ch(e),a(r)})}function Sh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ri,baseState:ri,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:ri},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ch(e){var t=Sh(e);t.next===null&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},oa())}function Yp(){return Mt(Ro)}function qh(){return dt().memoizedState}function Eh(){return dt().memoizedState}function Ay(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=Ur(a);var r=Dr(t,e,a);r!==null&&(Xt(r,t,a),mo(r,t,a)),t={cache:Ep()},e.payload=t;return}t=t.return}}function Ry(e,t,a){var r=oa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Th(t,a):(a=Np(e,t,a,r),a!==null&&(Xt(a,e,r),zh(a,t,r)))}function Mh(e,t,a){var r=oa();ho(e,t,a,r)}function ho(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Th(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,la(l,o))return Ts(e,t,i,0),Ke===null&&Ms(),!1}catch{}if(a=Np(e,t,i,r),a!==null)return Xt(a,e,r),zh(a,t,r),!0}return!1}function Vp(e,t,a,r){if(r={lane:2,revertLane:Wp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(O(479))}else t=Np(e,a,r,2),t!==null&&Xt(t,e,2)}function Ds(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Th(e,t){rn=ss=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function zh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,hg(e,a)}}var To={readContext:Mt,use:Rs,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};To.useEffectEvent=lt;var Ah={readContext:Mt,use:Rs,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:gf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Gl(4194308,4,wh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Gl(4194308,4,e,t)},useInsertionEffect:function(e,t){Gl(4,2,e,t)},useMemo:function(e,t){var a=Ot();t=t===void 0?null:t;var r=e();if(pi){qr(!0);try{e()}finally{qr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ot();if(a!==void 0){var i=a(t);if(pi){qr(!0);try{a(t)}finally{qr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ry.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Gu(e);var t=e.queue,a=Mh.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Qp,useDeferredValue:function(e,t){var a=Ot();return Gp(a,e,t)},useTransition:function(){var e=Gu(!1);return e=Nh.bind(null,fe,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,i=Ot();if(Te){if(a===void 0)throw Error(O(407));a=a()}else{if(a=t(),Ke===null)throw Error(O(349));(Ee&127)!==0||nh(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,gf(lh.bind(null,r,n,e),[e]),r.flags|=2048,pn(9,{destroy:void 0},oh.bind(null,r,n,a,t),null),a},useId:function(){var e=Ot(),t=Ke.identifierPrefix;if(Te){var a=Oa,r=Ba;a=(r&~(1<<32-na(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Cy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yp,useFormState:df,useActionState:df,useOptimistic:function(e){var t=Ot();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Vp.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lp,useCacheRefresh:function(){return Ot().memoizedState=Ay.bind(null,fe)},useEffectEvent:function(e){var t=Ot(),a={impl:e};return t.memoizedState=a,function(){if((Le&2)!==0)throw Error(O(440));return a.impl.apply(void 0,arguments)}}},Xp={readContext:Mt,use:Rs,useCallback:_h,useContext:Mt,useEffect:jp,useImperativeHandle:yh,useInsertionEffect:bh,useLayoutEffect:vh,useMemo:xh,useReducer:Ql,useRef:gh,useState:function(){return Ql(ur)},useDebugValue:Qp,useDeferredValue:function(e,t){var a=dt();return kh(a,Ze.memoizedState,e,t)},useTransition:function(){var e=Ql(ur)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:ih,useId:qh,useHostTransitionStatus:Yp,useFormState:mf,useActionState:mf,useOptimistic:function(e,t){var a=dt();return uh(a,Ze,e,t)},useMemoCache:Lp,useCacheRefresh:Eh};Xp.useEffectEvent=hh;var Rh={readContext:Mt,use:Rs,useCallback:_h,useContext:Mt,useEffect:jp,useImperativeHandle:yh,useInsertionEffect:bh,useLayoutEffect:vh,useMemo:xh,useReducer:Ic,useRef:gh,useState:function(){return Ic(ur)},useDebugValue:Qp,useDeferredValue:function(e,t){var a=dt();return Ze===null?Gp(a,e,t):kh(a,Ze.memoizedState,e,t)},useTransition:function(){var e=Ic(ur)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:ih,useId:qh,useHostTransitionStatus:Yp,useFormState:ff,useActionState:ff,useOptimistic:function(e,t){var a=dt();return Ze!==null?uh(a,Ze,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lp,useCacheRefresh:Eh};Rh.useEffectEvent=hh;function Wc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:rt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Xu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=oa(),i=Ur(r);i.payload=t,a!=null&&(i.callback=a),t=Dr(e,i,r),t!==null&&(Xt(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=oa(),i=Ur(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Dr(e,i,r),t!==null&&(Xt(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),r=Ur(a);r.tag=2,t!=null&&(r.callback=t),t=Dr(e,r,a),t!==null&&(Xt(t,e,a),mo(t,e,a))}};function hf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!So(a,r)||!So(i,n):!0}function bf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Xu.enqueueReplaceState(t,t.state,null)}function di(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=rt({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Uh(e){ts(e)}function Dh(e){console.error(e)}function Bh(e){ts(e)}function us(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function vf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function $u(e,t,a){return a=Ur(a),a.tag=3,a.payload={element:null},a.callback=function(){us(e,t)},a}function Oh(e){return e=Ur(e),e.tag=3,e}function Lh(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){vf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){vf(t,a,r),typeof i!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Uy(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&wn(t,a,i,!0),a=sa.current,a!==null){switch(a.tag){case 31:case 13:return ya===null?gs():a.alternate===null&&st===0&&(st=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),uu(e,r,i)),!1;case 22:return a.flags|=65536,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),uu(e,r,i)),!1}throw Error(O(435,a.tag))}return uu(e,r,i),gs(),!1}if(Te)return t=sa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ru&&(e=Error(O(422),{cause:r}),qo(va(e,a)))):(r!==Ru&&(t=Error(O(423),{cause:r}),qo(va(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=va(r,a),i=$u(e.stateNode,r,i),Fc(e,i),st!==4&&(st=2)),!1;var n=Error(O(520),{cause:r});if(n=va(n,a),wo===null?wo=[n]:wo.push(n),st!==4&&(st=2),t===null)return!0;r=va(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=$u(a.stateNode,r,e),Fc(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Br===null||!Br.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Oh(i),Lh(i,e,a,r),Fc(a,i),!1}a=a.return}while(a!==null);return!1}var $p=Error(O(461)),bt=!1;function Ct(e,t,a,r){t.child=e===null?Ig(t,null,a,r):ui(t,e.child,a,r)}function wf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return ci(t),r=Up(e,t,a,o,n,i),l=Dp(),e!==null&&!bt?(Bp(e,t,i),pr(e,t,i)):(Te&&l&&Cp(t),t.flags|=1,Ct(e,t,r,i),t.child)}function yf(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Sp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,Hh(e,t,n,r,i)):(e=Hl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Zp(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:So,a(o,r)&&e.ref===t.ref)return pr(e,t,i)}return t.flags|=1,e=nr(n,r),e.ref=t.ref,e.return=t,t.child=e}function Hh(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(So(n,r)&&e.ref===t.ref)if(bt=!1,t.pendingProps=r=n,Zp(e,i))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,pr(e,t,i)}return Zu(e,t,a,r,i)}function jh(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return _f(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jl(t,n!==null?n.cachePool:null),n!==null?cf(t,n):ju(),th(t);else return r=t.lanes=536870912,_f(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(jl(t,n.cachePool),cf(t,n),Sr(t),t.memoizedState=null):(e!==null&&jl(t,null),ju(),Sr(t));return Ct(e,t,i,a),t.child}function oo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _f(e,t,a,r,i){var n=Mp();return n=n===null?null:{parent:ht._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&jl(t,null),ju(),th(t),e!==null&&wn(e,t,r,!0),t.childLanes=i,null}function Yl(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xf(e,t,a){return ui(t,e.child,null,a),e=Yl(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function Dy(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(r.mode==="hidden")return e=Yl(t,r),t.lanes=536870912,oo(null,e);if(Qu(t),(e=at)?(e=Ab(e,wa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qr!==null?{id:Ba,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Xg(e),a.return=t,t.child=a,Et=t,at=null)):e=null,e===null)throw Gr(t);return t.lanes=536870912,null}return Yl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Qu(t),i)if(t.flags&256)t.flags&=-257,t=xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(O(558));else if(bt||wn(e,t,a,!1),i=(a&e.childLanes)!==0,bt||i){if(r=Ke,r!==null&&(o=bg(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Xt(r,e,o),$p;gs(),t=xf(e,t,a)}else e=n.treeContext,at=_a(o.nextSibling),Et=t,Te=!0,Rr=null,wa=!1,e!==null&&Zg(t,e),t=Yl(t,r),t.flags|=4096;return t}return e=nr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(O(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Zu(e,t,a,r,i){return ci(t),a=Up(e,t,a,r,void 0,i),r=Dp(),e!==null&&!bt?(Bp(e,t,i),pr(e,t,i)):(Te&&r&&Cp(t),t.flags|=1,Ct(e,t,a,i),t.child)}function kf(e,t,a,r,i,n){return ci(t),t.updateQueue=null,a=rh(t,r,a,i),ah(e),r=Dp(),e!==null&&!bt?(Bp(e,t,n),pr(e,t,n)):(Te&&r&&Cp(t),t.flags|=1,Ct(e,t,a,n),t.child)}function Nf(e,t,a,r,i){if(ci(t),t.stateNode===null){var n=Ki,o=a.contextType;typeof o=="object"&&o!==null&&(n=Mt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Xu,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},zp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Mt(o):Ki,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Wc(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&Xu.enqueueReplaceState(n,n.state,null),go(t,r,n,i),fo(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=di(a,l);n.props=c;var p=n.context,d=a.contextType;o=Ki,typeof d=="object"&&d!==null&&(o=Mt(d));var h=a.getDerivedStateFromProps;d=typeof h=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&bf(t,n,r,o),xr=!1;var m=t.memoizedState;n.state=m,go(t,r,n,i),fo(),p=t.memoizedState,l||m!==p||xr?(typeof h=="function"&&(Wc(t,a,h,r),p=t.memoizedState),(c=xr||hf(t,a,c,r,m,p,o))?(d||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Lu(e,t),o=t.memoizedProps,d=di(a,o),n.props=d,h=t.pendingProps,m=n.context,p=a.contextType,c=Ki,typeof p=="object"&&p!==null&&(c=Mt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==h||m!==c)&&bf(t,n,r,c),xr=!1,m=t.memoizedState,n.state=m,go(t,r,n,i),fo();var b=t.memoizedState;o!==h||m!==b||xr||e!==null&&e.dependencies!==null&&is(e.dependencies)?(typeof l=="function"&&(Wc(t,a,l,r),b=t.memoizedState),(d=xr||hf(t,a,d,r,m,b,c)||e!==null&&e.dependencies!==null&&is(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=d):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Vl(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ui(t,e.child,null,i),t.child=ui(t,null,a,i)):Ct(e,t,a,i),t.memoizedState=n.state,e=t.child):e=pr(e,t,i),e}function Sf(e,t,a,r){return si(),t.flags|=256,Ct(e,t,a,r),t.child}var eu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tu(e){return{baseLanes:e,cachePool:Pg()}}function au(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=aa),e}function Qh(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(i?Nr(t):Sr(t),(e=at)?(e=Ab(e,wa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qr!==null?{id:Ba,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Xg(e),a.return=t,t.child=a,Et=t,at=null)):e=null,e===null)throw Gr(t);return lp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(Sr(t),i=t.mode,l=ps({mode:"hidden",children:l},i),r=ii(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=tu(a),r.childLanes=au(e,o,a),t.memoizedState=eu,oo(null,r)):(Nr(t),Ku(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(Nr(t),t.flags&=-257,t=ru(e,t,a)):t.memoizedState!==null?(Sr(t),t.child=e.child,t.flags|=128,t=null):(Sr(t),l=r.fallback,i=t.mode,r=ps({mode:"visible",children:r.children},i),l=ii(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ui(t,e.child,null,a),r=t.child,r.memoizedState=tu(a),r.childLanes=au(e,o,a),t.memoizedState=eu,t=oo(null,r));else if(Nr(t),lp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(O(419)),r.stack="",r.digest=o,qo({value:r,source:null,stack:null}),t=ru(e,t,a)}else if(bt||wn(e,t,a,!1),o=(a&e.childLanes)!==0,bt||o){if(o=Ke,o!==null&&(r=bg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Xt(o,e,r),$p;op(l)||gs(),t=ru(e,t,a)}else op(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,at=_a(l.nextSibling),Et=t,Te=!0,Rr=null,wa=!1,e!==null&&Zg(t,e),t=Ku(t,r.children),t.flags|=4096);return t}return i?(Sr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=nr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=nr(p,l):(l=ii(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,oo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=tu(a):(i=l.cachePool,i!==null?(c=ht._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=Pg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=au(e,o,a),t.memoizedState=eu,oo(e.child,r)):(Nr(t),a=e.child,e=a.sibling,a=nr(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Ku(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=ta(22,e,null,t),e.lanes=0,e}function ru(e,t,a){return ui(t,e.child,null,a),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Du(e.return,t,a)}function iu(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function Gh(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=pt.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ie(pt,o),Ct(e,t,r,a),r=Te?Co:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cf(e,a,t);else if(e.tag===19)Cf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ls(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),iu(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ls(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}iu(t,!0,a,null,n,r);break;case"together":iu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function pr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Vr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(wn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,a=nr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=nr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&is(e)))}function By(e,t,a){switch(t.tag){case 3:Fl(t,t.stateNode.containerInfo),kr(t,ht,e.memoizedState.cache),si();break;case 27:case 5:xu(t);break;case 4:Fl(t,t.stateNode.containerInfo);break;case 10:kr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Nr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Qh(e,t,a):(Nr(t),e=pr(e,t,a),e!==null?e.sibling:null);Nr(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(wn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return Gh(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(pt,pt.current),r)break;return null;case 22:return t.lanes=0,jh(e,t,a,t.pendingProps);case 24:kr(t,ht,e.memoizedState.cache)}return pr(e,t,a)}function Yh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Zp(e,a)&&(t.flags&128)===0)return bt=!1,By(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Te&&(t.flags&1048576)!==0&&$g(t,Co,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ti(t.elementType),t.type=e,typeof e=="function")Sp(e)?(r=di(e,r),t.tag=1,t=Nf(null,t,e,r,a)):(t.tag=0,t=Zu(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===pp){t.tag=11,t=wf(null,t,e,r,a);break e}else if(i===dp){t.tag=14,t=yf(null,t,e,r,a);break e}}throw t=yu(e)||e,Error(O(306,t,""))}}return t;case 0:return Zu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=di(r,t.pendingProps),Nf(e,t,r,i,a);case 3:e:{if(Fl(t,t.stateNode.containerInfo),e===null)throw Error(O(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Lu(e,t),go(t,r,null,a);var o=t.memoizedState;if(r=o.cache,kr(t,ht,r),r!==n.cache&&Bu(t,[ht],a,!0),fo(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Sf(e,t,r,a);break e}else if(r!==i){i=va(Error(O(424)),t),qo(i),t=Sf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,at=_a(e.firstChild),Et=t,Te=!0,Rr=null,wa=!0,a=Ig(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(si(),r===i){t=pr(e,t,a);break e}Ct(e,t,r,a)}t=t.child}return t;case 26:return Vl(e,t),e===null?(a=Kf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,r=ws(Ar.current).createElement(a),r[qt]=t,r[$t]=e,Tt(r,a,e),Nt(r),t.stateNode=r):t.memoizedState=Kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xu(t),e===null&&Te&&(r=t.stateNode=Rb(t.type,t.pendingProps,Ar.current),Et=t,wa=!0,i=at,$r(t.type)?(sp=i,at=_a(r.firstChild)):at=i),Ct(e,t,t.pendingProps.children,a),Vl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((i=r=at)&&(r=u1(r,t.type,t.pendingProps,wa),r!==null?(t.stateNode=r,Et=t,at=_a(r.firstChild),wa=!1,i=!0):i=!1),i||Gr(t)),xu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,ip(i,n)?r=null:o!==null&&ip(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Up(e,t,qy,null,null,a),Ro._currentValue=i),Vl(e,t),Ct(e,t,r,a),t.child;case 6:return e===null&&Te&&((e=a=at)&&(a=p1(a,t.pendingProps,wa),a!==null?(t.stateNode=a,Et=t,at=null,e=!0):e=!1),e||Gr(t)),null;case 13:return Qh(e,t,a);case 4:return Fl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ui(t,null,r,a):Ct(e,t,r,a),t.child;case 11:return wf(e,t,t.type,t.pendingProps,a);case 7:return Ct(e,t,t.pendingProps,a),t.child;case 8:return Ct(e,t,t.pendingProps.children,a),t.child;case 12:return Ct(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,kr(t,t.type,r.value),Ct(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ci(t),i=Mt(i),r=r(i),t.flags|=1,Ct(e,t,r,a),t.child;case 14:return yf(e,t,t.type,t.pendingProps,a);case 15:return Hh(e,t,t.type,t.pendingProps,a);case 19:return Gh(e,t,a);case 31:return Dy(e,t,a);case 22:return jh(e,t,a,t.pendingProps);case 24:return ci(t),r=Mt(ht),e===null?(i=Mp(),i===null&&(i=Ke,n=Ep(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},zp(t),kr(t,ht,i)):((e.lanes&a)!==0&&(Lu(e,t),go(t,null,null,a),fo()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),kr(t,ht,r)):(r=n.cache,kr(t,ht,r),r!==i.cache&&Bu(t,[ht],a,!0))),Ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(O(156,t.tag))}function Ja(e){e.flags|=4}function nu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(mb())e.flags|=8192;else throw oi=ns,Tp}else e.flags&=-16777217}function qf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bb(t))if(mb())e.flags|=8192;else throw oi=ns,Tp}function El(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fg():536870912,e.lanes|=t,dn|=t)}function Wn(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Oy(e,t,a){var r=t.pendingProps;switch(qp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),or(ht),on(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Bi(t)?Ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Jc())),tt(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Ja(t),n!==null?(tt(t),qf(t,n)):(tt(t),nu(t,i,null,r,a))):n?n!==e.memoizedState?(Ja(t),tt(t),qf(t,n)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ja(t),tt(t),nu(t,i,e,r,a)),null;case 27:if(Il(t),a=Ar.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return tt(t),null}e=Ha.current,Bi(t)?tf(t,e):(e=Rb(i,r,a),t.stateNode=e,Ja(t))}return tt(t),null;case 5:if(Il(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return tt(t),null}if(n=Ha.current,Bi(t))tf(t,n);else{var o=ws(Ar.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[qt]=t,n[$t]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(Tt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ja(t)}}return tt(t),nu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(e=Ar.current,Bi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Et,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[qt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Mb(e.nodeValue,a)),e||Gr(t,!0)}else e=ws(e).createTextNode(r),e[qt]=t,t.stateNode=e}return tt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Bi(t),a!==null){if(e===null){if(!r)throw Error(O(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(557));e[qt]=t}else si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else a=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(O(558))}return tt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(O(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[qt]=t}else si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else i=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),El(t,t.updateQueue),tt(t),null);case 4:return on(),e===null&&ed(t.stateNode.containerInfo),tt(t),null;case 10:return or(t.type),tt(t),null;case 19:if(St(pt),r=t.memoizedState,r===null)return tt(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)Wn(r,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=ls(e),n!==null){for(t.flags|=128,Wn(r,!1),e=n.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Vg(a,e),a=a.sibling;return Ie(pt,pt.current&1|2),Te&&er(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ra()>ms&&(t.flags|=128,i=!0,Wn(r,!1),t.lanes=4194304)}else{if(!i)if(e=ls(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Wn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Te)return tt(t),null}else 2*ra()-r.renderingStartTime>ms&&a!==536870912&&(t.flags|=128,i=!0,Wn(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ra(),e.sibling=null,a=pt.current,Ie(pt,i?a&1|2:a&1),Te&&er(t,r.treeForkCount),e):(tt(t),null);case 22:case 23:return ea(t),Ap(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),a=t.updateQueue,a!==null&&El(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&St(ni),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),or(ht),tt(t),null;case 25:return null;case 30:return null}throw Error(O(156,t.tag))}function Ly(e,t){switch(qp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(ht),on(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Il(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(O(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(pt),null;case 4:return on(),null;case 10:return or(t.type),null;case 22:case 23:return ea(t),Ap(),e!==null&&St(ni),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return or(ht),null;case 25:return null;default:return null}}function Vh(e,t){switch(qp(t),t.tag){case 3:or(ht),on();break;case 26:case 27:case 5:Il(t);break;case 4:on();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:St(pt);break;case 10:or(t.type);break;case 22:case 23:ea(t),Ap(),e!==null&&St(ni);break;case 24:or(ht)}}function Vo(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Ge(t,t.return,l)}}function Yr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(d){Ge(i,c,d)}}}r=r.next}while(r!==n)}}catch(d){Ge(t,t.return,d)}}function Xh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{eh(t,a)}catch(r){Ge(e,e.return,r)}}}function $h(e,t,a){a.props=di(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Ge(e,t,r)}}function bo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){Ge(e,t,i)}}function La(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Ge(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Ge(e,t,i)}else a.current=null}function Zh(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){Ge(e,e.return,i)}}function ou(e,t,a){try{var r=e.stateNode;i1(r,e.type,a,t),r[$t]=t}catch(i){Ge(e,e.return,i)}}function Kh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$r(e.type)||e.tag===4}function lu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kh(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.tag===27&&$r(e.type)||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 Pu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=rr));else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Pu(e,t,a),e=e.sibling;e!==null;)Pu(e,t,a),e=e.sibling}function ds(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ds(e,t,a),e=e.sibling;e!==null;)ds(e,t,a),e=e.sibling}function Ph(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Tt(t,r,a),t[qt]=e,t[$t]=a}catch(n){Ge(e,e.return,n)}}var tr=!1,gt=!1,su=!1,Ef=typeof WeakSet=="function"?WeakSet:Set,kt=null;function Hy(e,t){if(e=e.containerInfo,ap=ks,e=Bg(e),xp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,d=0,h=e,m=null;t:for(;;){for(var b;h!==a||i!==0&&h.nodeType!==3||(l=o+i),h!==n||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(b=h.firstChild)!==null;)m=h,h=b;for(;;){if(h===e)break t;if(m===a&&++p===i&&(l=o),m===n&&++d===r&&(c=o),(b=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(rp={focusedElem:e,selectionRange:a},ks=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){switch(t=kt,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var w=di(a.type,i);e=r.getSnapshotBeforeUpdate(w,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Ge(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)np(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":np(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(O(163))}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}}function Jh(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&Vo(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Ge(a,a.return,o)}else{var i=di(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Ge(a,a.return,o)}}r&64&&Xh(a),r&512&&bo(a,a.return);break;case 3:if(Ia(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{eh(e,t)}catch(o){Ge(a,a.return,o)}}break;case 27:t===null&&r&4&&Ph(a);case 26:case 5:Ia(e,a),t===null&&r&4&&Zh(a),r&512&&bo(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&Wh(e,a);break;case 13:Ia(e,a),r&4&&eb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ky.bind(null,a),d1(e,a))));break;case 22:if(r=a.memoizedState!==null||tr,!r){t=t!==null&&t.memoizedState!==null||gt,i=tr;var n=gt;tr=r,(gt=t)&&!n?Wa(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),tr=i,gt=n}break;case 30:break;default:Ia(e,a)}}function Fh(e){var t=e.alternate;t!==null&&(e.alternate=null,Fh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&hp(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,Yt=!1;function Fa(e,t,a){for(a=a.child;a!==null;)Ih(e,t,a),a=a.sibling}function Ih(e,t,a){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(Oo,a)}catch{}switch(a.tag){case 26:gt||La(a,t),Fa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gt||La(a,t);var r=nt,i=Yt;$r(a.type)&&(nt=a.stateNode,Yt=!1),Fa(e,t,a),_o(a.stateNode),nt=r,Yt=i;break;case 5:gt||La(a,t);case 6:if(r=nt,i=Yt,nt=null,Fa(e,t,a),nt=r,Yt=i,nt!==null)if(Yt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(a.stateNode)}catch(n){Ge(a,t,n)}else try{nt.removeChild(a.stateNode)}catch(n){Ge(a,t,n)}break;case 18:nt!==null&&(Yt?(e=nt,Yf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),hn(e)):Yf(nt,a.stateNode));break;case 4:r=nt,i=Yt,nt=a.stateNode.containerInfo,Yt=!0,Fa(e,t,a),nt=r,Yt=i;break;case 0:case 11:case 14:case 15:Yr(2,a,t),gt||Yr(4,a,t),Fa(e,t,a);break;case 1:gt||(La(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&$h(a,t,r)),Fa(e,t,a);break;case 21:Fa(e,t,a);break;case 22:gt=(r=gt)||a.memoizedState!==null,Fa(e,t,a),gt=r;break;default:Fa(e,t,a)}}function Wh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hn(e)}catch(a){Ge(t,t.return,a)}}}function eb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hn(e)}catch(a){Ge(t,t.return,a)}}function jy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ef),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ef),t;default:throw Error(O(435,e.tag))}}function Ml(e,t){var a=jy(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=Py.bind(null,e,r);r.then(i,i)}})}function Qt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if($r(l.type)){nt=l.stateNode,Yt=!1;break e}break;case 5:nt=l.stateNode,Yt=!1;break e;case 3:case 4:nt=l.stateNode.containerInfo,Yt=!0;break e}l=l.return}if(nt===null)throw Error(O(160));Ih(n,o,i),nt=null,Yt=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)tb(t,e),t=t.sibling}var za=null;function tb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Gt(e),r&4&&(Yr(3,e,e.return),Vo(3,e),Yr(5,e,e.return));break;case 1:Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),r&64&&tr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=za;if(Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[jo]||n[qt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),Tt(n,r,a),n[qt]=e,Nt(n),r=n;break e;case"link":var o=Jf("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=Jf("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;default:throw Error(O(468,r))}n[qt]=e,Nt(n),r=n}e.stateNode=r}else Ff(i,e.type,e.stateNode);else e.stateNode=Pf(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?Ff(i,e.type,e.stateNode):Pf(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ou(e,e.memoizedProps,a.memoizedProps)}break;case 27:Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),a!==null&&r&4&&ou(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),e.flags&32){i=e.stateNode;try{sn(i,"")}catch(w){Ge(e,e.return,w)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,ou(e,i,a!==null?a.memoizedProps:i)),r&1024&&(su=!0);break;case 6:if(Qt(t,e),Gt(e),r&4){if(e.stateNode===null)throw Error(O(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Ge(e,e.return,w)}}break;case 3:if(Zl=null,i=za,za=ys(t.containerInfo),Qt(t,e),za=i,Gt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{hn(t.containerInfo)}catch(w){Ge(e,e.return,w)}su&&(su=!1,ab(e));break;case 4:r=za,za=ys(e.stateNode.containerInfo),Qt(t,e),Gt(e),za=r;break;case 12:Qt(t,e),Gt(e);break;case 31:Qt(t,e),Gt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 13:Qt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bs=ra()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=tr,d=gt;if(tr=p||i,gt=d||c,Qt(t,e),gt=d,tr=p,Gt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||tr||gt||ai(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;l.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(w){Ge(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(w){Ge(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?Vf(b,!0):Vf(c.stateNode,!1)}catch(w){Ge(c,c.return,w)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ml(e,a))));break;case 19:Qt(t,e),Gt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 30:break;case 21:break;default:Qt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Kh(r)){a=r;break}r=r.return}if(a==null)throw Error(O(160));switch(a.tag){case 27:var i=a.stateNode,n=lu(e);ds(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(sn(o,""),a.flags&=-33);var l=lu(e);ds(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=lu(e);Pu(e,p,c);break;default:throw Error(O(161))}}catch(d){Ge(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ab(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ab(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Jh(e,t.alternate,t),t=t.sibling}function ai(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yr(4,t,t.return),ai(t);break;case 1:La(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&$h(t,t.return,a),ai(t);break;case 27:_o(t.stateNode);case 26:case 5:La(t,t.return),ai(t);break;case 22:t.memoizedState===null&&ai(t);break;case 30:ai(t);break;default:ai(t)}e=e.sibling}}function Wa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Wa(i,n,a),Vo(4,n);break;case 1:if(Wa(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){Ge(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wg(c[i],l)}catch(p){Ge(r,r.return,p)}}a&&o&64&&Xh(n),bo(n,n.return);break;case 27:Ph(n);case 26:case 5:Wa(i,n,a),a&&r===null&&o&4&&Zh(n),bo(n,n.return);break;case 12:Wa(i,n,a);break;case 31:Wa(i,n,a),a&&o&4&&Wh(i,n);break;case 13:Wa(i,n,a),a&&o&4&&eb(i,n);break;case 22:n.memoizedState===null&&Wa(i,n,a),bo(n,n.return);break;case 30:break;default:Wa(i,n,a)}t=t.sibling}}function Kp(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Go(a))}function Pp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e))}function Ta(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rb(e,t,a,r),t=t.sibling}function rb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ta(e,t,a,r),i&2048&&Vo(9,t);break;case 1:Ta(e,t,a,r);break;case 3:Ta(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e)));break;case 12:if(i&2048){Ta(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Ge(t,t.return,c)}}else Ta(e,t,a,r);break;case 31:Ta(e,t,a,r);break;case 13:Ta(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ta(e,t,a,r):vo(e,t):n._visibility&2?Ta(e,t,a,r):(n._visibility|=2,Li(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Kp(o,t);break;case 24:Ta(e,t,a,r),i&2048&&Pp(t.alternate,t);break;default:Ta(e,t,a,r)}}function Li(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Li(n,o,l,c,i),Vo(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?Li(n,o,l,c,i):vo(n,o):(d._visibility|=2,Li(n,o,l,c,i)),i&&p&2048&&Kp(o.alternate,o);break;case 24:Li(n,o,l,c,i),i&&p&2048&&Pp(o.alternate,o);break;default:Li(n,o,l,c,i)}t=t.sibling}}function vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:vo(a,r),i&2048&&Kp(r.alternate,r);break;case 24:vo(a,r),i&2048&&Pp(r.alternate,r);break;default:vo(a,r)}t=t.sibling}}var lo=8192;function Oi(e,t,a){if(e.subtreeFlags&lo)for(e=e.child;e!==null;)ib(e,t,a),e=e.sibling}function ib(e,t,a){switch(e.tag){case 26:Oi(e,t,a),e.flags&lo&&e.memoizedState!==null&&N1(a,za,e.memoizedState,e.memoizedProps);break;case 5:Oi(e,t,a);break;case 3:case 4:var r=za;za=ys(e.stateNode.containerInfo),Oi(e,t,a),za=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=lo,lo=16777216,Oi(e,t,a),lo=r):Oi(e,t,a));break;default:Oi(e,t,a)}}function nb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function eo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];kt=r,lb(r,e)}nb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ob(e),e=e.sibling}function ob(e){switch(e.tag){case 0:case 11:case 15:eo(e),e.flags&2048&&Yr(9,e,e.return);break;case 3:eo(e);break;case 12:eo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xl(e)):eo(e);break;default:eo(e)}}function Xl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];kt=r,lb(r,e)}nb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yr(8,t,t.return),Xl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Xl(t));break;default:Xl(t)}e=e.sibling}}function lb(e,t){for(;kt!==null;){var a=kt;switch(a.tag){case 0:case 11:case 15:Yr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Go(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,kt=r;else e:for(a=e;kt!==null;){r=kt;var i=r.sibling,n=r.return;if(Fh(r),r===a){kt=null;break e}if(i!==null){i.return=n,kt=i;break e}kt=n}}}var Qy={getCacheForType:function(e){var t=Mt(ht),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Mt(ht).controller.signal}},Gy=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ke=null,qe=null,Ee=0,Qe=0,Wt=null,Mr=!1,_n=!1,Jp=!1,dr=0,st=0,Vr=0,li=0,Fp=0,aa=0,dn=0,wo=null,Vt=null,Ju=!1,Bs=0,sb=0,ms=1/0,fs=null,Br=null,vt=0,Or=null,mn=null,lr=0,Fu=0,Iu=null,cb=null,yo=0,Wu=null;function oa(){return(Le&2)!==0&&Ee!==0?Ee&-Ee:ue.T!==null?Wp():vg()}function ub(){if(aa===0)if((Ee&536870912)===0||Te){var e=wl;wl<<=1,(wl&3932160)===0&&(wl=262144),aa=e}else aa=536870912;return e=sa.current,e!==null&&(e.flags|=32),aa}function Xt(e,t,a){(e===Ke&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(fn(e,0),Tr(e,Ee,aa,!1)),Ho(e,a),((Le&2)===0||e!==Ke)&&(e===Ke&&((Le&2)===0&&(li|=a),st===4&&Tr(e,Ee,aa,!1)),Qa(e))}function pb(e,t,a){if((Le&6)!==0)throw Error(O(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Lo(e,t),i=r?Xy(e,t):cu(e,t,!0),n=r;do{if(i===0){_n&&!r&&Tr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!Yy(a)){i=cu(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=wo;var c=l.current.memoizedState.isDehydrated;if(c&&(fn(l,o).flags|=256),o=cu(l,o,!1),o!==2){if(Jp&&!c){l.errorRecoveryDisabledLanes|=n,li|=n,i=4;break e}n=Vt,Vt=i,n!==null&&(Vt===null?Vt=n:Vt.push.apply(Vt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){fn(e,0),Tr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(O(345));case 4:if((t&4194048)!==t)break;case 6:Tr(r,t,aa,!Mr);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((t&62914560)===t&&(i=Bs+300-ra(),10<i)){if(Tr(r,t,aa,!Mr),Ss(r,0,!0)!==0)break e;lr=t,r.timeoutHandle=zb(Mf.bind(null,r,a,Vt,fs,Ju,t,aa,li,dn,Mr,n,"Throttled",-0,0),i);break e}Mf(r,a,Vt,fs,Ju,t,aa,li,dn,Mr,n,null,-0,0)}}break}while(!0);Qa(e)}function Mf(e,t,a,r,i,n,o,l,c,p,d,h,m,b){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rr},ib(t,n,h);var w=(n&62914560)===n?Bs-ra():(n&4194048)===n?sb-ra():0;if(w=S1(h,w),w!==null){lr=n,e.cancelPendingCommit=w(zf.bind(null,e,t,n,a,r,i,o,l,c,d,h,null,m,b)),Tr(e,n,o,!p);return}}zf(e,t,n,a,r,i,o,l,c)}function Yy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!la(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tr(e,t,a,r){t&=~Fp,t&=~li,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-na(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&gg(e,a,t)}function Os(){return(Le&6)===0?(Xo(0,!1),!1):!0}function Ip(){if(qe!==null){if(Qe===0)var e=qe.return;else e=qe,ir=bi=null,Op(e),an=null,Eo=0,e=qe;for(;e!==null;)Vh(e.alternate,e),e=e.return;qe=null}}function fn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,l1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),lr=0,Ip(),Ke=e,qe=a=nr(e.current,null),Ee=t,Qe=0,Wt=null,Mr=!1,_n=Lo(e,t),Jp=!1,dn=aa=Fp=li=Vr=st=0,Vt=wo=null,Ju=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-na(r),n=1<<i;t|=e[i],r&=~n}return dr=t,Ms(),a}function db(e,t){fe=null,ue.H=To,t===yn||t===zs?(t=lf(),Qe=3):t===Tp?(t=lf(),Qe=4):Qe=t===$p?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,qe===null&&(st=1,us(e,va(t,e.current)))}function mb(){var e=sa.current;return e===null?!0:(Ee&4194048)===Ee?ya===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===ya:!1}function fb(){var e=ue.H;return ue.H=To,e===null?To:e}function gb(){var e=ue.A;return ue.A=Qy,e}function gs(){st=4,Mr||(Ee&4194048)!==Ee&&sa.current!==null||(_n=!0),(Vr&134217727)===0&&(li&134217727)===0||Ke===null||Tr(Ke,Ee,aa,!1)}function cu(e,t,a){var r=Le;Le|=2;var i=fb(),n=gb();(Ke!==e||Ee!==t)&&(fs=null,fn(e,t)),t=!1;var o=st;e:do try{if(Qe!==0&&qe!==null){var l=qe,c=Wt;switch(Qe){case 8:Ip(),o=6;break e;case 3:case 2:case 9:case 6:sa.current===null&&(t=!0);var p=Qe;if(Qe=0,Wt=null,Fi(e,l,c,p),a&&_n){o=0;break e}break;default:p=Qe,Qe=0,Wt=null,Fi(e,l,c,p)}}Vy(),o=st;break}catch(d){db(e,d)}while(!0);return t&&e.shellSuspendCounter++,ir=bi=null,Le=r,ue.H=i,ue.A=n,qe===null&&(Ke=null,Ee=0,Ms()),o}function Vy(){for(;qe!==null;)hb(qe)}function Xy(e,t){var a=Le;Le|=2;var r=fb(),i=gb();Ke!==e||Ee!==t?(fs=null,ms=ra()+500,fn(e,t)):_n=Lo(e,t);e:do try{if(Qe!==0&&qe!==null){t=qe;var n=Wt;t:switch(Qe){case 1:Qe=0,Wt=null,Fi(e,t,n,1);break;case 2:case 9:if(of(n)){Qe=0,Wt=null,Tf(t);break}t=function(){Qe!==2&&Qe!==9||Ke!==e||(Qe=7),Qa(e)},n.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:of(n)?(Qe=0,Wt=null,Tf(t)):(Qe=0,Wt=null,Fi(e,t,n,7));break;case 5:var o=null;switch(qe.tag){case 26:o=qe.memoizedState;case 5:case 27:var l=qe;if(o?Bb(o):l.stateNode.complete){Qe=0,Wt=null;var c=l.sibling;if(c!==null)qe=c;else{var p=l.return;p!==null?(qe=p,Ls(p)):qe=null}break t}}Qe=0,Wt=null,Fi(e,t,n,5);break;case 6:Qe=0,Wt=null,Fi(e,t,n,6);break;case 8:Ip(),st=6;break e;default:throw Error(O(462))}}$y();break}catch(d){db(e,d)}while(!0);return ir=bi=null,ue.H=r,ue.A=i,Le=a,qe!==null?0:(Ke=null,Ee=0,Ms(),st)}function $y(){for(;qe!==null&&!g0();)hb(qe)}function hb(e){var t=Yh(e.alternate,e,dr);e.memoizedProps=e.pendingProps,t===null?Ls(e):qe=t}function Tf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=kf(a,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=kf(a,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:Op(t);default:Vh(a,t),t=qe=Vg(t,dr),t=Yh(a,t,dr)}e.memoizedProps=e.pendingProps,t===null?Ls(e):qe=t}function Fi(e,t,a,r){ir=bi=null,Op(t),an=null,Eo=0;var i=t.return;try{if(Uy(e,i,t,a,Ee)){st=1,us(e,va(a,e.current)),qe=null;return}}catch(n){if(i!==null)throw qe=i,n;st=1,us(e,va(a,e.current)),qe=null;return}t.flags&32768?(Te||r===1?e=!0:_n||(Ee&536870912)!==0?e=!1:(Mr=e=!0,(r===2||r===9||r===3||r===6)&&(r=sa.current,r!==null&&r.tag===13&&(r.flags|=16384))),bb(t,e)):Ls(t)}function Ls(e){var t=e;do{if((t.flags&32768)!==0){bb(t,Mr);return}e=t.return;var a=Oy(t.alternate,t,dr);if(a!==null){qe=a;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);st===0&&(st=5)}function bb(e,t){do{var a=Ly(e.alternate,e);if(a!==null){a.flags&=32767,qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=a}while(e!==null);st=6,qe=null}function zf(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Hs();while(vt!==0);if((Le&6)!==0)throw Error(O(327));if(t!==null){if(t===e.current)throw Error(O(177));if(n=t.lanes|t.childLanes,n|=kp,S0(e,a,n,o,l,c),e===Ke&&(qe=Ke=null,Ee=0),mn=t,Or=e,lr=a,Fu=n,Iu=i,cb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jy(Wl,function(){return xb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=ue.T,ue.T=null,i=He.p,He.p=2,o=Le,Le|=4;try{Hy(e,t,a)}finally{Le=o,He.p=i,ue.T=r}}vt=1,vb(),wb(),yb()}}function vb(){if(vt===1){vt=0;var e=Or,t=mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ue.T,ue.T=null;var r=He.p;He.p=2;var i=Le;Le|=4;try{tb(t,e);var n=rp,o=Bg(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&Dg(l.ownerDocument.documentElement,l)){if(c!==null&&xp(l)){var p=c.start,d=c.end;if(d===void 0&&(d=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(d,l.value.length);else{var h=l.ownerDocument||document,m=h&&h.defaultView||window;if(m.getSelection){var b=m.getSelection(),w=l.textContent.length,E=Math.min(c.start,w),U=c.end===void 0?E:Math.min(c.end,w);!b.extend&&E>U&&(o=U,U=E,E=o);var f=Im(l,E),u=Im(l,U);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var g=h.createRange();g.setStart(f.node,f.offset),b.removeAllRanges(),E>U?(b.addRange(g),b.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),b.addRange(g))}}}}for(h=[],b=l;b=b.parentNode;)b.nodeType===1&&h.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<h.length;l++){var v=h[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}ks=!!ap,rp=ap=null}finally{Le=i,He.p=r,ue.T=a}}e.current=t,vt=2}}function wb(){if(vt===2){vt=0;var e=Or,t=mn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ue.T,ue.T=null;var r=He.p;He.p=2;var i=Le;Le|=4;try{Jh(e,t.alternate,t)}finally{Le=i,He.p=r,ue.T=a}}vt=3}}function yb(){if(vt===4||vt===3){vt=0,h0();var e=Or,t=mn,a=lr,r=cb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?vt=5:(vt=0,mn=Or=null,_b(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Br=null),gp(a),t=t.stateNode,ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(Oo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=ue.T,i=He.p,He.p=2,ue.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{ue.T=t,He.p=i}}(lr&3)!==0&&Hs(),Qa(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Wu?yo++:(yo=0,Wu=e):yo=0,Xo(0,!1)}}function _b(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Go(t)))}function Hs(){return vb(),wb(),yb(),xb()}function xb(){if(vt!==5)return!1;var e=Or,t=Fu;Fu=0;var a=gp(lr),r=ue.T,i=He.p;try{He.p=32>a?32:a,ue.T=null,a=Iu,Iu=null;var n=Or,o=lr;if(vt=0,mn=Or=null,lr=0,(Le&6)!==0)throw Error(O(331));var l=Le;if(Le|=4,ob(n.current),rb(n,n.current,o,a),Le=l,Xo(0,!1),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(Oo,n)}catch{}return!0}finally{He.p=i,ue.T=r,_b(e,t)}}function Af(e,t,a){t=va(a,t),t=$u(e.stateNode,t,2),e=Dr(e,t,2),e!==null&&(Ho(e,2),Qa(e))}function Ge(e,t,a){if(e.tag===3)Af(e,e,a);else for(;t!==null;){if(t.tag===3){Af(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Br===null||!Br.has(r))){e=va(a,e),a=Oh(2),r=Dr(t,a,2),r!==null&&(Lh(a,r,t,e),Ho(r,2),Qa(r));break}}t=t.return}}function uu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Gy;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(Jp=!0,i.add(a),e=Zy.bind(null,e,t,a),t.then(e,e))}function Zy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Ee&a)===a&&(st===4||st===3&&(Ee&62914560)===Ee&&300>ra()-Bs?(Le&2)===0&&fn(e,0):Fp|=a,dn===Ee&&(dn=0)),Qa(e)}function kb(e,t){t===0&&(t=fg()),e=hi(e,t),e!==null&&(Ho(e,t),Qa(e))}function Ky(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),kb(e,a)}function Py(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(O(314))}r!==null&&r.delete(t),kb(e,a)}function Jy(e,t){return mp(e,t)}var hs=null,Hi=null,ep=!1,bs=!1,pu=!1,zr=0;function Qa(e){e!==Hi&&e.next===null&&(Hi===null?hs=Hi=e:Hi=Hi.next=e),bs=!0,ep||(ep=!0,Iy())}function Xo(e,t){if(!pu&&bs){pu=!0;do for(var a=!1,r=hs;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-na(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Rf(r,n))}else n=Ee,n=Ss(r,r===Ke?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Lo(r,n)||(a=!0,Rf(r,n));r=r.next}while(a);pu=!1}}function Fy(){Nb()}function Nb(){bs=ep=!1;var e=0;zr!==0&&o1()&&(e=zr);for(var t=ra(),a=null,r=hs;r!==null;){var i=r.next,n=Sb(r,t);n===0?(r.next=null,a===null?hs=i:a.next=i,i===null&&(Hi=a)):(a=r,(e!==0||(n&3)!==0)&&(bs=!0)),r=i}vt!==0&&vt!==5||Xo(e,!1),zr!==0&&(zr=0)}function Sb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-na(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=N0(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=Ke,a=Ee,a=Ss(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&jc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Lo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&jc(r),gp(a)){case 2:case 8:a=dg;break;case 32:a=Wl;break;case 268435456:a=mg;break;default:a=Wl}return r=Cb.bind(null,e),a=mp(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&jc(r),e.callbackPriority=2,e.callbackNode=null,2}function Cb(e,t){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hs()&&e.callbackNode!==a)return null;var r=Ee;return r=Ss(e,e===Ke?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pb(e,r,t),Sb(e,ra()),e.callbackNode!=null&&e.callbackNode===a?Cb.bind(null,e):null)}function Rf(e,t){if(Hs())return null;pb(e,t,!0)}function Iy(){s1(function(){(Le&6)!==0?mp(pg,Fy):Nb()})}function Wp(){if(zr===0){var e=cn;e===0&&(e=vl,vl<<=1,(vl&261888)===0&&(vl=256)),zr=e}return zr}function Uf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bl(""+e)}function Df(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Wy(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=Uf((i[$t]||null).action),o=r.submitter;o&&(t=(t=o[$t]||null)?Uf(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new Cs("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(zr!==0){var c=o?Df(i,o):new FormData(i);Vu(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?Df(i,o):new FormData(i),Vu(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Tl=0;Tl<Au.length;Tl++)zl=Au[Tl],Bf=zl.toLowerCase(),Of=zl[0].toUpperCase()+zl.slice(1),Aa(Bf,"on"+Of);var zl,Bf,Of,Tl;Aa(Lg,"onAnimationEnd");Aa(Hg,"onAnimationIteration");Aa(jg,"onAnimationStart");Aa("dblclick","onDoubleClick");Aa("focusin","onFocus");Aa("focusout","onBlur");Aa(by,"onTransitionRun");Aa(vy,"onTransitionStart");Aa(wy,"onTransitionCancel");Aa(Qg,"onTransitionEnd");ln("onMouseEnter",["mouseout","mouseover"]);ln("onMouseLeave",["mouseout","mouseover"]);ln("onPointerEnter",["pointerout","pointerover"]);ln("onPointerLeave",["pointerout","pointerover"]);mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),e1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function qb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}}}}function Ce(e,t){var a=t[Nu];a===void 0&&(a=t[Nu]=new Set);var r=e+"__bubble";a.has(r)||(Eb(t,e,2,!1),a.add(r))}function du(e,t,a){var r=0;t&&(r|=4),Eb(a,e,r,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function ed(e){if(!e[Al]){e[Al]=!0,wg.forEach(function(a){a!=="selectionchange"&&(e1.has(a)||du(a,!1,e),du(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,du("selectionchange",!1,t))}}function Eb(e,t,a,r){switch(Qb(t)){case 2:var i=E1;break;case 8:i=M1;break;default:i=id}a=i.bind(null,t,a,e),i=void 0,!Mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function mu(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}qg(function(){var p=n,d=vp(a),h=[];e:{var m=Gg.get(e);if(m!==void 0){var b=Cs,w=e;switch(e){case"keypress":if(Ll(a)===0)break e;case"keydown":case"keyup":b=P0;break;case"focusin":w="focus",b=Xc;break;case"focusout":w="blur",b=Xc;break;case"beforeblur":case"afterblur":b=Xc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=Ym;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=O0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=I0;break;case Lg:case Hg:case jg:b=j0;break;case Qg:b=ey;break;case"scroll":case"scrollend":b=D0;break;case"wheel":b=ay;break;case"copy":case"cut":case"paste":b=G0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=Xm;break;case"toggle":case"beforetoggle":b=iy}var E=(t&4)!==0,U=!E&&(e==="scroll"||e==="scrollend"),f=E?m!==null?m+"Capture":null:m;E=[];for(var u=p,g;u!==null;){var v=u;if(g=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||g===null||f===null||(v=ko(u,f),v!=null&&E.push(Ao(u,v,g))),U)break;u=u.return}0<E.length&&(m=new b(m,w,null,a,d),h.push({event:m,listeners:E}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",m&&a!==Eu&&(w=a.relatedTarget||a.fromElement)&&(Gi(w)||w[bn]))break e;if((b||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,b?(w=a.relatedTarget||a.toElement,b=p,w=w?Gi(w):null,w!==null&&(U=Bo(w),E=w.tag,w!==U||E!==5&&E!==27&&E!==6)&&(w=null)):(b=null,w=p),b!==w)){if(E=Ym,v="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(E=Xm,v="onPointerLeave",f="onPointerEnter",u="pointer"),U=b==null?m:no(b),g=w==null?m:no(w),m=new E(v,u+"leave",b,a,d),m.target=U,m.relatedTarget=g,v=null,Gi(d)===p&&(E=new E(f,u+"enter",w,a,d),E.target=g,E.relatedTarget=U,v=E),U=v,b&&w)t:{for(E=t1,f=b,u=w,g=0,v=f;v;v=E(v))g++;v=0;for(var k=u;k;k=E(k))v++;for(;0<g-v;)f=E(f),g--;for(;0<v-g;)u=E(u),v--;for(;g--;){if(f===u||u!==null&&f===u.alternate){E=f;break t}f=E(f),u=E(u)}E=null}else E=null;b!==null&&Lf(h,m,b,E,!1),w!==null&&U!==null&&Lf(h,U,w,E,!0)}}e:{if(m=p?no(p):window,b=m.nodeName&&m.nodeName.toLowerCase(),b==="select"||b==="input"&&m.type==="file")var A=Pm;else if(Km(m))if(Rg)A=fy;else{A=dy;var M=py}else b=m.nodeName,!b||b.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?p&&bp(p.elementType)&&(A=Pm):A=my;if(A&&(A=A(e,p))){Ag(h,A,a,d);break e}M&&M(e,m,p),e==="focusout"&&p&&m.type==="number"&&p.memoizedProps.value!=null&&qu(m,"number",m.value)}switch(M=p?no(p):window,e){case"focusin":(Km(M)||M.contentEditable==="true")&&(Xi=M,Tu=p,uo=null);break;case"focusout":uo=Tu=Xi=null;break;case"mousedown":zu=!0;break;case"contextmenu":case"mouseup":case"dragend":zu=!1,Wm(h,a,d);break;case"selectionchange":if(hy)break;case"keydown":case"keyup":Wm(h,a,d)}var z;if(_p)e:{switch(e){case"compositionstart":var Y="onCompositionStart";break e;case"compositionend":Y="onCompositionEnd";break e;case"compositionupdate":Y="onCompositionUpdate";break e}Y=void 0}else Vi?Tg(e,a)&&(Y="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Y="onCompositionStart");Y&&(Mg&&a.locale!=="ko"&&(Vi||Y!=="onCompositionStart"?Y==="onCompositionEnd"&&Vi&&(z=Eg()):(Er=d,wp="value"in Er?Er.value:Er.textContent,Vi=!0)),M=vs(p,Y),0<M.length&&(Y=new Vm(Y,e,null,a,d),h.push({event:Y,listeners:M}),z?Y.data=z:(z=zg(a),z!==null&&(Y.data=z)))),(z=oy?ly(e,a):sy(e,a))&&(Y=vs(p,"onBeforeInput"),0<Y.length&&(M=new Vm("onBeforeInput","beforeinput",null,a,d),h.push({event:M,listeners:Y}),M.data=z)),Wy(h,e,p,a,d)}qb(h,t)})}function Ao(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vs(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=ko(e,a),i!=null&&r.unshift(Ao(e,i,n)),i=ko(e,t),i!=null&&r.push(Ao(e,i,n))),e.tag===3)return r;e=e.return}return[]}function t1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lf(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=ko(a,n),p!=null&&o.unshift(Ao(a,p,c))):i||(p=ko(a,n),p!=null&&o.push(Ao(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var a1=/\r\n?/g,r1=/\u0000|\uFFFD/g;function Hf(e){return(typeof e=="string"?e:""+e).replace(a1,`
|
|
9
|
-
`).replace(r1,"")}function Mb(e,t){return t=Hf(t),Hf(e)===t}function $e(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||sn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&sn(e,""+r);break;case"className":_l(e,"class",r);break;case"tabIndex":_l(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(e,a,r);break;case"style":Cg(e,r,n);break;case"data":if(t!=="object"){_l(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&$e(e,t,"name",i.name,i,null),$e(e,t,"formEncType",i.formEncType,i,null),$e(e,t,"formMethod",i.formMethod,i,null),$e(e,t,"formTarget",i.formTarget,i,null)):($e(e,t,"encType",i.encType,i,null),$e(e,t,"method",i.method,i,null),$e(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=rr);break;case"onScroll":r!=null&&Ce("scroll",e);break;case"onScrollEnd":r!=null&&Ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Bl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ce("beforetoggle",e),Ce("toggle",e),Dl(e,"popover",r);break;case"xlinkActuate":Pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Pa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Pa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Pa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Pa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Dl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=R0.get(a)||a,Dl(e,a,r))}}function tp(e,t,a,r,i,n){switch(a){case"style":Cg(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"children":typeof r=="string"?sn(e,r):(typeof r=="number"||typeof r=="bigint")&&sn(e,""+r);break;case"onScroll":r!=null&&Ce("scroll",e);break;case"onScrollEnd":r!=null&&Ce("scrollend",e);break;case"onClick":r!=null&&(e.onclick=rr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[$t]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Dl(e,a,r)}}}function Tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ce("error",e),Ce("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:$e(e,t,n,o,a,null)}}i&&$e(e,t,"srcSet",a.srcSet,a,null),r&&$e(e,t,"src",a.src,a,null);return;case"input":Ce("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"name":i=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":p=d;break;case"value":n=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(O(137,t));break;default:$e(e,t,r,d,a,null)}}kg(e,n,l,c,p,o,i,!1);return;case"select":Ce("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:$e(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?Wi(e,!!r,t,!1):a!=null&&Wi(e,!!r,a,!0);return;case"textarea":Ce("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(O(91));break;default:$e(e,t,o,l,a,null)}Sg(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":$e(e,t,c,r,a,null));return;case"dialog":Ce("beforetoggle",e),Ce("toggle",e),Ce("cancel",e),Ce("close",e);break;case"iframe":case"object":Ce("load",e);break;case"video":case"audio":for(r=0;r<zo.length;r++)Ce(zo[r],e);break;case"image":Ce("error",e),Ce("load",e);break;case"details":Ce("toggle",e);break;case"embed":case"source":case"link":Ce("error",e),Ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:$e(e,t,p,r,a,null)}return;default:if(bp(t)){for(d in a)a.hasOwnProperty(d)&&(r=a[d],r!==void 0&&tp(e,t,d,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&$e(e,t,l,r,a,null))}function i1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,d=null;for(b in a){var h=a[b];if(a.hasOwnProperty(b)&&h!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(b)||$e(e,t,b,null,r,h)}}for(var m in r){var b=r[m];if(h=a[m],r.hasOwnProperty(m)&&(b!=null||h!=null))switch(m){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":d=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(O(137,t));break;default:b!==h&&$e(e,t,m,b,r,h)}}Cu(e,o,l,c,p,d,n,i);return;case"select":b=o=l=m=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||$e(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":m=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&$e(e,t,i,n,r,c)}t=l,a=o,r=b,m!=null?Wi(e,!!a,m,!1):!!r!=!!a&&(t!=null?Wi(e,!!a,t,!0):Wi(e,!!a,a?[]:"",!1));return;case"textarea":b=m=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:$e(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":m=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(O(91));break;default:i!==n&&$e(e,t,o,i,r,n)}Ng(e,m,b);return;case"option":for(var w in a)m=a[w],a.hasOwnProperty(w)&&m!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:$e(e,t,w,null,r,m));for(c in r)m=r[c],b=a[c],r.hasOwnProperty(c)&&m!==b&&(m!=null||b!=null)&&(c==="selected"?e.selected=m&&typeof m!="function"&&typeof m!="symbol":$e(e,t,c,m,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)m=a[E],a.hasOwnProperty(E)&&m!=null&&!r.hasOwnProperty(E)&&$e(e,t,E,null,r,m);for(p in r)if(m=r[p],b=a[p],r.hasOwnProperty(p)&&m!==b&&(m!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(O(137,t));break;default:$e(e,t,p,m,r,b)}return;default:if(bp(t)){for(var U in a)m=a[U],a.hasOwnProperty(U)&&m!==void 0&&!r.hasOwnProperty(U)&&tp(e,t,U,void 0,r,m);for(d in r)m=r[d],b=a[d],!r.hasOwnProperty(d)||m===b||m===void 0&&b===void 0||tp(e,t,d,m,r,b);return}}for(var f in a)m=a[f],a.hasOwnProperty(f)&&m!=null&&!r.hasOwnProperty(f)&&$e(e,t,f,null,r,m);for(h in r)m=r[h],b=a[h],!r.hasOwnProperty(h)||m===b||m==null&&b==null||$e(e,t,h,m,r,b)}function jf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&jf(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var d=c.transferSize,h=c.initiatorType;d&&jf(h)&&(c=c.responseEnd,o+=d*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ap=null,rp=null;function ws(e){return e.nodeType===9?e:e.ownerDocument}function Qf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Tb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ip(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fu=null;function o1(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var zb=typeof setTimeout=="function"?setTimeout:void 0,l1=typeof clearTimeout=="function"?clearTimeout:void 0,Gf=typeof Promise=="function"?Promise:void 0,s1=typeof queueMicrotask=="function"?queueMicrotask:typeof Gf<"u"?function(e){return Gf.resolve(null).then(e).catch(c1)}:zb;function c1(e){setTimeout(function(){throw e})}function $r(e){return e==="head"}function Yf(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),hn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")_o(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,_o(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[jo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&_o(e.ownerDocument.body);a=i}while(a);hn(t)}function Vf(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function np(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":np(a),hp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function u1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[jo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=_a(e.nextSibling),e===null)break}return null}function p1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=_a(e.nextSibling),e===null))return null;return e}function Ab(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_a(e.nextSibling),e===null))return null;return e}function op(e){return e.data==="$?"||e.data==="$~"}function lp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function d1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function _a(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var sp=null;function Xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return _a(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function $f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Rb(e,t,a){switch(t=ws(a),e){case"html":if(e=t.documentElement,!e)throw Error(O(452));return e;case"head":if(e=t.head,!e)throw Error(O(453));return e;case"body":if(e=t.body,!e)throw Error(O(454));return e;default:throw Error(O(451))}}function _o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);hp(e)}var xa=new Map,Zf=new Set;function ys(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mr=He.d;He.d={f:m1,r:f1,D:g1,C:h1,L:b1,m:v1,X:y1,S:w1,M:_1};function m1(){var e=mr.f(),t=Os();return e||t}function f1(e){var t=vn(e);t!==null&&t.tag===5&&t.type==="form"?Ch(t):mr.r(e)}var xn=typeof document>"u"?null:document;function Ub(e,t,a){var r=xn;if(r&&typeof t=="string"&&t){var i=ba(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Zf.has(i)||(Zf.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Tt(t,"link",e),Nt(t),r.head.appendChild(t)))}}function g1(e){mr.D(e),Ub("dns-prefetch",e,null)}function h1(e,t){mr.C(e,t),Ub("preconnect",e,t)}function b1(e,t,a){mr.L(e,t,a);var r=xn;if(r&&e&&t){var i='link[rel="preload"][as="'+ba(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ba(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ba(a.imageSizes)+'"]')):i+='[href="'+ba(e)+'"]';var n=i;switch(t){case"style":n=gn(e);break;case"script":n=kn(e)}xa.has(n)||(e=rt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),xa.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector($o(n))||t==="script"&&r.querySelector(Zo(n))||(t=r.createElement("link"),Tt(t,"link",e),Nt(t),r.head.appendChild(t)))}}function v1(e,t){mr.m(e,t);var a=xn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ba(r)+'"][href="'+ba(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=kn(e)}if(!xa.has(n)&&(e=rt({rel:"modulepreload",href:e},t),xa.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Zo(n)))return}r=a.createElement("link"),Tt(r,"link",e),Nt(r),a.head.appendChild(r)}}}function w1(e,t,a){mr.S(e,t,a);var r=xn;if(r&&e){var i=Ii(r).hoistableStyles,n=gn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector($o(n)))l.loading=5;else{e=rt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=xa.get(n))&&td(e,a);var c=o=r.createElement("link");Nt(c),Tt(c,"link",e),c._p=new Promise(function(p,d){c.onload=p,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,$l(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function y1(e,t){mr.X(e,t);var a=xn;if(a&&e){var r=Ii(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Zo(i)),n||(e=rt({src:e,async:!0},t),(t=xa.get(i))&&ad(e,t),n=a.createElement("script"),Nt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function _1(e,t){mr.M(e,t);var a=xn;if(a&&e){var r=Ii(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Zo(i)),n||(e=rt({src:e,async:!0,type:"module"},t),(t=xa.get(i))&&ad(e,t),n=a.createElement("script"),Nt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function Kf(e,t,a,r){var i=(i=Ar.current)?ys(i):null;if(!i)throw Error(O(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=gn(a.href),a=Ii(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=gn(a.href);var n=Ii(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector($o(e)))&&!n._p&&(o.instance=n,o.state.loading=5),xa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},xa.set(e,a),n||x1(i,e,a,o.state))),t&&r===null)throw Error(O(528,""));return o}if(t&&r!==null)throw Error(O(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kn(a),a=Ii(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,e))}}function gn(e){return'href="'+ba(e)+'"'}function $o(e){return'link[rel="stylesheet"]['+e+"]"}function Db(e){return rt({},e,{"data-precedence":e.precedence,precedence:null})}function x1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",a),Nt(t),e.head.appendChild(t))}function kn(e){return'[src="'+ba(e)+'"]'}function Zo(e){return"script[async]"+e}function Pf(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ba(a.href)+'"]');if(r)return t.instance=r,Nt(r),r;var i=rt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Nt(r),Tt(r,"style",i),$l(r,a.precedence,e),t.instance=r;case"stylesheet":i=gn(a.href);var n=e.querySelector($o(i));if(n)return t.state.loading|=4,t.instance=n,Nt(n),n;r=Db(a),(i=xa.get(i))&&td(r,i),n=(e.ownerDocument||e).createElement("link"),Nt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),t.state.loading|=4,$l(n,a.precedence,e),t.instance=n;case"script":return n=kn(a.src),(i=e.querySelector(Zo(n)))?(t.instance=i,Nt(i),i):(r=a,(i=xa.get(n))&&(r=rt({},a),ad(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Nt(i),Tt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(O(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,$l(r,a.precedence,e));return t.instance}function $l(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function Jf(e,t,a){if(Zl===null){var r=new Map,i=Zl=new Map;i.set(a,r)}else i=Zl,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[jo]||n[qt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function Ff(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function k1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Bb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function N1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=gn(r.href),n=t.querySelector($o(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_s.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,Nt(n);return}n=t.ownerDocument||t,r=Db(r),(i=xa.get(i))&&td(r,i),n=n.createElement("link"),Nt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_s.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var gu=0;function S1(e,t){return e.stylesheets&&e.count===0&&Kl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&gu===0&&(gu=62500*n1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>gu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xs=null;function Kl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xs=new Map,t.forEach(C1,e),xs=null,_s.call(e))}function C1(e,t){if(!(t.state.loading&4)){var a=xs.get(e);if(a)var r=a.get(null);else{a=new Map,xs.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=_s.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ro={$$typeof:ar,Provider:null,Consumer:null,_currentValue:ri,_currentValue2:ri,_threadCount:0};function q1(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qc(0),this.hiddenUpdates=Qc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Ob(e,t,a,r,i,n,o,l,c,p,d,h){return e=new q1(e,t,a,o,c,p,d,h,l),t=1,n===!0&&(t|=24),n=ta(3,null,null,t),e.current=n,n.stateNode=e,t=Ep(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},zp(n),e}function Lb(e){return e?(e=Ki,e):Ki}function Hb(e,t,a,r,i,n){i=Lb(i),r.context===null?r.context=i:r.pendingContext=i,r=Ur(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Dr(e,r,t),a!==null&&(Xt(a,e,t),mo(a,e,t))}function If(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function rd(e,t){If(e,t),(e=e.alternate)&&If(e,t)}function jb(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Xt(t,e,67108864),rd(e,67108864)}}function Wf(e){if(e.tag===13||e.tag===31){var t=oa();t=fp(t);var a=hi(e,t);a!==null&&Xt(a,e,t),rd(e,t)}}var ks=!0;function E1(e,t,a,r){var i=ue.T;ue.T=null;var n=He.p;try{He.p=2,id(e,t,a,r)}finally{He.p=n,ue.T=i}}function M1(e,t,a,r){var i=ue.T;ue.T=null;var n=He.p;try{He.p=8,id(e,t,a,r)}finally{He.p=n,ue.T=i}}function id(e,t,a,r){if(ks){var i=cp(r);if(i===null)mu(e,t,r,Ns,a),eg(e,r);else if(z1(i,e,t,a,r))r.stopPropagation();else if(eg(e,r),t&4&&-1<T1.indexOf(e)){for(;i!==null;){var n=vn(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=ei(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-na(o);l.entanglements[1]|=c,o&=~c}Qa(n),(Le&6)===0&&(ms=ra()+500,Xo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Xt(l,n,2),Os(),rd(n,2)}if(n=cp(r),n===null&&mu(e,t,r,Ns,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else mu(e,t,r,null,a)}}function cp(e){return e=vp(e),nd(e)}var Ns=null;function nd(e){if(Ns=null,e=Gi(e),e!==null){var t=Bo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=og(t),e!==null)return e;e=null}else if(a===31){if(e=lg(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ns=e,null}function Qb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(b0()){case pg:return 2;case dg:return 8;case Wl:case v0:return 32;case mg:return 268435456;default:return 32}default:return 32}}var up=!1,Lr=null,Hr=null,jr=null,Uo=new Map,Do=new Map,Cr=[],T1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function eg(e,t){switch(e){case"focusin":case"focusout":Lr=null;break;case"dragenter":case"dragleave":Hr=null;break;case"mouseover":case"mouseout":jr=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(t.pointerId)}}function to(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=vn(t),t!==null&&jb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function z1(e,t,a,r,i){switch(t){case"focusin":return Lr=to(Lr,e,t,a,r,i),!0;case"dragenter":return Hr=to(Hr,e,t,a,r,i),!0;case"mouseover":return jr=to(jr,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Uo.set(n,to(Uo.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,Do.set(n,to(Do.get(n)||null,e,t,a,r,i)),!0}return!1}function Gb(e){var t=Gi(e.target);if(t!==null){var a=Bo(t);if(a!==null){if(t=a.tag,t===13){if(t=og(a),t!==null){e.blockedOn=t,Bm(e.priority,function(){Wf(a)});return}}else if(t===31){if(t=lg(a),t!==null){e.blockedOn=t,Bm(e.priority,function(){Wf(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=cp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Eu=r,a.target.dispatchEvent(r),Eu=null}else return t=vn(a),t!==null&&jb(t),e.blockedOn=a,!1;t.shift()}return!0}function tg(e,t,a){Pl(e)&&a.delete(t)}function A1(){up=!1,Lr!==null&&Pl(Lr)&&(Lr=null),Hr!==null&&Pl(Hr)&&(Hr=null),jr!==null&&Pl(jr)&&(jr=null),Uo.forEach(tg),Do.forEach(tg)}function Rl(e,t){e.blockedOn===t&&(e.blockedOn=null,up||(up=!0,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,A1)))}var Ul=null;function ag(e){Ul!==e&&(Ul=e,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,function(){Ul===e&&(Ul=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(nd(r||a)===null)continue;break}var n=vn(a);n!==null&&(e.splice(t,3),t-=3,Vu(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function hn(e){function t(c){return Rl(c,e)}Lr!==null&&Rl(Lr,e),Hr!==null&&Rl(Hr,e),jr!==null&&Rl(jr,e),Uo.forEach(t),Do.forEach(t);for(var a=0;a<Cr.length;a++){var r=Cr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cr.length&&(a=Cr[0],a.blockedOn===null);)Gb(a),a.blockedOn===null&&Cr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[$t]||null;if(typeof n=="function")o||ag(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[$t]||null)l=o.formAction;else if(nd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),ag(a)}}}function Yb(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function od(e){this._internalRoot=e}js.prototype.render=od.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));var a=t.current,r=oa();Hb(a,r,e,t,null,null)};js.prototype.unmount=od.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hb(e.current,2,null,e,null,null),Os(),t[bn]=null}};function js(e){this._internalRoot=e}js.prototype.unstable_scheduleHydration=function(e){if(e){var t=vg();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Cr.length&&t!==0&&t<Cr[a].priority;a++);Cr.splice(a,0,e),a===0&&Gb(e)}};var rg=ig.version;if(rg!=="19.2.3")throw Error(O(527,rg,"19.2.3"));He.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=u0(t),e=e!==null?sg(e):null,e=e===null?null:e.stateNode,e};var R1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ao=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ao.isDisabled&&ao.supportsFiber))try{Oo=ao.inject(R1),ia=ao}catch{}var ao;Qs.createRoot=function(e,t){if(!ng(e))throw Error(O(299));var a=!1,r="",i=Uh,n=Dh,o=Bh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ob(e,1,!1,null,null,a,r,null,i,n,o,Yb),e[bn]=t.current,ed(e),new od(t)};Qs.hydrateRoot=function(e,t,a){if(!ng(e))throw Error(O(299));var r=!1,i="",n=Uh,o=Dh,l=Bh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Ob(e,1,!0,t,a??null,r,i,c,n,o,l,Yb),t.context=Lb(null),a=t.current,r=oa(),r=fp(r),i=Ur(r),i.callback=null,Dr(a,i,r),a=r,t.current.lanes=a,Ho(t,a),Qa(t),e[bn]=t.current,ed(e),new js(t)};Qs.version="19.2.3"});var Zb=Ua((mx,$b)=>{"use strict";function Xb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xb)}catch(e){console.error(e)}}Xb(),$b.exports=Vb()});var Lv=Ua(Xs=>{"use strict";var Q1=Symbol.for("react.transitional.element"),G1=Symbol.for("react.fragment");function Ov(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:Q1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Xs.Fragment=G1;Xs.jsx=Ov;Xs.jsxs=Ov});var re=Ua((jk,Hv)=>{"use strict";Hv.exports=Lv()});var Aw=X(Zb());var Kb=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
|
|
8
|
+
`+r.stack}}var ku=Object.prototype.hasOwnProperty,mp=wt.unstable_scheduleCallback,jc=wt.unstable_cancelCallback,h0=wt.unstable_shouldYield,b0=wt.unstable_requestPaint,ra=wt.unstable_now,v0=wt.unstable_getCurrentPriorityLevel,mg=wt.unstable_ImmediatePriority,fg=wt.unstable_UserBlockingPriority,Wl=wt.unstable_NormalPriority,w0=wt.unstable_LowPriority,gg=wt.unstable_IdlePriority,y0=wt.log,_0=wt.unstable_setDisableYieldValue,Oo=null,ia=null;function qr(e){if(typeof y0=="function"&&_0(e),ia&&typeof ia.setStrictMode=="function")try{ia.setStrictMode(Oo,e)}catch{}}var na=Math.clz32?Math.clz32:N0,x0=Math.log,k0=Math.LN2;function N0(e){return e>>>=0,e===0?32:31-(x0(e)/k0|0)|0}var vl=256,wl=262144,yl=4194304;function ei(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ss(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=ei(r):(o&=l,o!==0?i=ei(o):a||(a=l&~e,a!==0&&(i=ei(a))))):(l=r&~n,l!==0?i=ei(l):o!==0?i=ei(o):a||(a=r&~e,a!==0&&(i=ei(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Lo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function S0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hg(){var e=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),e}function Qc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ho(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function C0(e,t,a,r,i,n){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var d=31-na(a),h=1<<d;l[d]=0,c[d]=-1;var m=p[d];if(m!==null)for(p[d]=null,d=0;d<m.length;d++){var b=m[d];b!==null&&(b.lane&=-536870913)}a&=~h}r!==0&&bg(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function bg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-na(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function vg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-na(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function wg(e,t){var a=t&-t;return a=(a&42)!==0?1:fp(a),(a&(e.suspendedLanes|t))!==0?0:a}function fp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function yg(){var e=He.p;return e!==0?e:(e=window.event,e===void 0?32:Yb(e.type))}function Lm(e,t){var a=He.p;try{return He.p=e,t()}finally{He.p=a}}var Vr=Math.random().toString(36).slice(2),qt="__reactFiber$"+Vr,$t="__reactProps$"+Vr,bn="__reactContainer$"+Vr,Nu="__reactEvents$"+Vr,q0="__reactListeners$"+Vr,E0="__reactHandles$"+Vr,Hm="__reactResources$"+Vr,jo="__reactMarker$"+Vr;function hp(e){delete e[qt],delete e[$t],delete e[Nu],delete e[q0],delete e[E0]}function Gi(e){var t=e[qt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[qt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Kf(e);e!==null;){if(a=e[qt])return a;e=Kf(e)}return t}e=a,a=e.parentNode}return null}function vn(e){if(e=e[qt]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function no(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(O(33))}function Ii(e){var t=e[Hm];return t||(t=e[Hm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[jo]=!0}var _g=new Set,xg={};function mi(e,t){ln(e,t),ln(e+"Capture",t)}function ln(e,t){for(xg[e]=t,e=0;e<t.length;e++)_g.add(t[e])}var M0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),jm={},Qm={};function T0(e){return ku.call(Qm,e)?!0:ku.call(jm,e)?!1:M0.test(e)?Qm[e]=!0:(jm[e]=!0,!1)}function Dl(e,t,a){if(T0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function _l(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Pa(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Su(e){if(!e._valueTracker){var t=kg(e)?"checked":"value";e._valueTracker=z0(e,t,""+e[t])}}function Ng(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=kg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function es(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}}var A0=/[\n"\\]/g;function ba(e){return e.replace(A0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cu(e,t,a,r,i,n,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?qu(e,o,fa(t)):a!=null?qu(e,o,fa(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+fa(l):e.removeAttribute("name")}function Sg(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Su(e);return}a=a!=null?""+fa(a):"",t=t!=null?""+fa(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Su(e)}function qu(e,t,a){t==="number"&&es(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Wi(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+fa(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Cg(e,t,a){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+fa(a):""}function qg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(O(92));if(io(r)){if(1<r.length)throw Error(O(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=fa(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Su(e)}function sn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var R0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Gm(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||R0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Eg(e,t,a){if(t!=null&&typeof t!="object")throw Error(O(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&Gm(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&Gm(e,n,t[n])}function bp(e){if(e.indexOf("-")===-1)return!1;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 U0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),D0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bl(e){return D0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rr(){}var Eu=null;function vp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,en=null;function Ym(e){var t=vn(e);if(t&&(e=t.stateNode)){var a=e[$t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ba(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var i=r[$t]||null;if(!i)throw Error(O(90));Cu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Ng(r)}break e;case"textarea":Cg(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Wi(e,!!a.multiple,t,!1)}}}var Gc=!1;function Mg(e,t,a){if(Gc)return e(t,a);Gc=!0;try{var r=e(t);return r}finally{if(Gc=!1,(Yi!==null||en!==null)&&(Os(),Yi&&(t=Yi,e=en,en=Yi=null,Ym(t),e)))for(t=0;t<e.length;t++)Ym(e[t])}}function ko(e,t){var a=e.stateNode;if(a===null)return null;var r=a[$t]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(O(231,t,typeof a));return a}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mu=!1;if(sr)try{Di={},Object.defineProperty(Di,"passive",{get:function(){Mu=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Mu=!1}var Di,Er=null,wp=null,Ol=null;function Tg(){if(Ol)return Ol;var e,t=wp,a=t.length,r,i="value"in Er?Er.value:Er.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return Ol=i.slice(e,1<r?1-r:void 0)}function Ll(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xl(){return!0}function Xm(){return!1}function Zt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?xl:Xm,this.isPropagationStopped=Xm,this}return rt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=xl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=xl)},persist:function(){},isPersistent:xl}),t}var fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cs=Zt(fi),Qo=rt({},fi,{view:0,detail:0}),B0=Zt(Qo),Yc,Xc,Fn,qs=rt({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fn&&(Fn&&e.type==="mousemove"?(Yc=e.screenX-Fn.screenX,Xc=e.screenY-Fn.screenY):Xc=Yc=0,Fn=e),Yc)},movementY:function(e){return"movementY"in e?e.movementY:Xc}}),Vm=Zt(qs),O0=rt({},qs,{dataTransfer:0}),L0=Zt(O0),H0=rt({},Qo,{relatedTarget:0}),Vc=Zt(H0),j0=rt({},fi,{animationName:0,elapsedTime:0,pseudoElement:0}),Q0=Zt(j0),G0=rt({},fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y0=Zt(G0),X0=rt({},fi,{data:0}),$m=Zt(X0),V0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Z0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z0[e])?!!t[e]:!1}function yp(){return K0}var P0=rt({},Qo,{key:function(e){if(e.key){var t=V0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ll(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yp,charCode:function(e){return e.type==="keypress"?Ll(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ll(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),J0=Zt(P0),F0=rt({},qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zm=Zt(F0),I0=rt({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yp}),W0=Zt(I0),ey=rt({},fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ty=Zt(ey),ay=rt({},qs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ry=Zt(ay),iy=rt({},fi,{newState:0,oldState:0}),ny=Zt(iy),oy=[9,13,27,32],_p=sr&&"CompositionEvent"in window,so=null;sr&&"documentMode"in document&&(so=document.documentMode);var ly=sr&&"TextEvent"in window&&!so,zg=sr&&(!_p||so&&8<so&&11>=so),Km=" ",Pm=!1;function Ag(e,t){switch(e){case"keyup":return oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function sy(e,t){switch(e){case"compositionend":return Rg(t);case"keypress":return t.which!==32?null:(Pm=!0,Km);case"textInput":return e=t.data,e===Km&&Pm?null:e;default:return null}}function cy(e,t){if(Xi)return e==="compositionend"||!_p&&Ag(e,t)?(e=Tg(),Ol=wp=Er=null,Xi=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zg&&t.locale!=="ko"?null:t.data;default:return null}}var uy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uy[e.type]:t==="textarea"}function Ug(e,t,a,r){Yi?en?en.push(r):en=[r]:Yi=r,t=vs(t,"onChange"),0<t.length&&(a=new Cs("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var co=null,No=null;function py(e){Mb(e,0)}function Es(e){var t=no(e);if(Ng(t))return e}function Fm(e,t){if(e==="change")return t}var Dg=!1;sr&&(sr?(Nl="oninput"in document,Nl||($c=document.createElement("div"),$c.setAttribute("oninput","return;"),Nl=typeof $c.oninput=="function"),kl=Nl):kl=!1,Dg=kl&&(!document.documentMode||9<document.documentMode));var kl,Nl,$c;function Im(){co&&(co.detachEvent("onpropertychange",Bg),No=co=null)}function Bg(e){if(e.propertyName==="value"&&Es(No)){var t=[];Ug(t,No,e,vp(e)),Mg(py,t)}}function dy(e,t,a){e==="focusin"?(Im(),co=t,No=a,co.attachEvent("onpropertychange",Bg)):e==="focusout"&&Im()}function my(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(No)}function fy(e,t){if(e==="click")return Es(t)}function gy(e,t){if(e==="input"||e==="change")return Es(t)}function hy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var la=typeof Object.is=="function"?Object.is:hy;function So(e,t){if(la(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var i=a[r];if(!ku.call(t,i)||!la(e[i],t[i]))return!1}return!0}function Wm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ef(e,t){var a=Wm(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wm(a)}}function Og(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Og(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=es(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=es(e.document)}return t}function xp(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")}var by=sr&&"documentMode"in document&&11>=document.documentMode,Vi=null,Tu=null,uo=null,zu=!1;function tf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;zu||Vi==null||Vi!==es(r)||(r=Vi,"selectionStart"in r&&xp(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}),uo&&So(uo,r)||(uo=r,r=vs(Tu,"onSelect"),0<r.length&&(t=new Cs("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Vi)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},Zc={},Hg={};sr&&(Hg=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function gi(e){if(Zc[e])return Zc[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Hg)return Zc[e]=t[a];return e}var jg=gi("animationend"),Qg=gi("animationiteration"),Gg=gi("animationstart"),vy=gi("transitionrun"),wy=gi("transitionstart"),yy=gi("transitioncancel"),Yg=gi("transitionend"),Xg=new Map,Au="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Au.push("scrollEnd");function Aa(e,t){Xg.set(e,t),mi(t,[e])}var ts=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ma=[],Zi=0,kp=0;function Ms(){for(var e=Zi,t=kp=Zi=0;t<e;){var a=ma[t];ma[t++]=null;var r=ma[t];ma[t++]=null;var i=ma[t];ma[t++]=null;var n=ma[t];if(ma[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&Vg(a,i,n)}}function Ts(e,t,a,r){ma[Zi++]=e,ma[Zi++]=t,ma[Zi++]=a,ma[Zi++]=r,kp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Np(e,t,a,r){return Ts(e,t,a,r),as(e)}function hi(e,t){return Ts(e,null,null,t),as(e)}function Vg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-na(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function as(e){if(50<yo)throw yo=0,Wu=null,Error(O(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function _y(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=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 ta(e,t,a,r){return new _y(e,t,a,r)}function Sp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nr(e,t){var a=e.alternate;return a===null?(a=ta(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function $g(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Hl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Sp(e)&&(o=1);else if(typeof e=="string")o=N1(e,a,Ha.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case wu:return e=ta(31,a,t,i),e.elementType=wu,e.lanes=n,e;case ji:return ii(a.children,i,n,t);case pg:o=8,i|=24;break;case hu:return e=ta(12,a,t,i|2),e.elementType=hu,e.lanes=n,e;case bu:return e=ta(13,a,t,i),e.elementType=bu,e.lanes=n,e;case vu:return e=ta(19,a,t,i),e.elementType=vu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ar:o=10;break e;case dg:o=9;break e;case pp:o=11;break e;case dp:o=14;break e;case _r:o=16,r=null;break e}o=29,a=Error(O(130,e===null?"null":typeof e,"")),r=null}return t=ta(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ii(e,t,a,r){return e=ta(7,e,r,t),e.lanes=a,e}function Kc(e,t,a){return e=ta(6,e,null,t),e.lanes=a,e}function Zg(e){var t=ta(18,null,null,0);return t.stateNode=e,t}function Pc(e,t,a){return t=ta(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var af=new WeakMap;function va(e,t){if(typeof e=="object"&&e!==null){var a=af.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Om(t)},af.set(e,t),t)}return{value:e,source:t,stack:Om(t)}}var Pi=[],Ji=0,rs=null,Co=0,ga=[],ha=0,Qr=null,Ba=1,Oa="";function er(e,t){Pi[Ji++]=Co,Pi[Ji++]=rs,rs=e,Co=t}function Kg(e,t,a){ga[ha++]=Ba,ga[ha++]=Oa,ga[ha++]=Qr,Qr=e;var r=Ba;e=Oa;var i=32-na(r)-1;r&=~(1<<i),a+=1;var n=32-na(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ba=1<<32-na(t)+i|a<<i|r,Oa=n+e}else Ba=1<<n|a<<i|r,Oa=e}function Cp(e){e.return!==null&&(er(e,1),Kg(e,1,0))}function qp(e){for(;e===rs;)rs=Pi[--Ji],Pi[Ji]=null,Co=Pi[--Ji],Pi[Ji]=null;for(;e===Qr;)Qr=ga[--ha],ga[ha]=null,Oa=ga[--ha],ga[ha]=null,Ba=ga[--ha],ga[ha]=null}function Pg(e,t){ga[ha++]=Ba,ga[ha++]=Oa,ga[ha++]=Qr,Ba=t.id,Oa=t.overflow,Qr=e}var Et=null,at=null,Te=!1,Rr=null,wa=!1,Ru=Error(O(519));function Gr(e){var t=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(va(t,e)),Ru}function rf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[qt]=e,t[$t]=r,a){case"dialog":Ce("cancel",t),Ce("close",t);break;case"iframe":case"object":case"embed":Ce("load",t);break;case"video":case"audio":for(a=0;a<zo.length;a++)Ce(zo[a],t);break;case"source":Ce("error",t);break;case"img":case"image":case"link":Ce("error",t),Ce("load",t);break;case"details":Ce("toggle",t);break;case"input":Ce("invalid",t),Sg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ce("invalid",t);break;case"textarea":Ce("invalid",t),qg(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||zb(t.textContent,a)?(r.popover!=null&&(Ce("beforetoggle",t),Ce("toggle",t)),r.onScroll!=null&&Ce("scroll",t),r.onScrollEnd!=null&&Ce("scrollend",t),r.onClick!=null&&(t.onclick=rr),t=!0):t=!1,t||Gr(e,!0)}function nf(e){for(Et=e.return;Et;)switch(Et.tag){case 5:case 31:case 13:wa=!1;return;case 27:case 3:wa=!0;return;default:Et=Et.return}}function Bi(e){if(e!==Et)return!1;if(!Te)return nf(e),Te=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||ip(e.type,e.memoizedProps)),a=!a),a&&at&&Gr(e),nf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));at=Zf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));at=Zf(e)}else t===27?(t=at,$r(e.type)?(e=sp,sp=null,at=e):at=t):at=Et?_a(e.stateNode.nextSibling):null;return!0}function si(){at=Et=null,Te=!1}function Jc(){var e=Rr;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Rr=null),e}function qo(e){Rr===null?Rr=[e]:Rr.push(e)}var Uu=ja(null),bi=null,ir=null;function kr(e,t,a){Ie(Uu,t._currentValue),t._currentValue=a}function or(e){e._currentValue=Uu.current,St(Uu)}function Du(e,t,a){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===a)break;e=e.return}}function Bu(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Du(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(O(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Du(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function wn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(O(387));if(o=o.memoizedProps,o!==null){var l=i.type;la(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===Jl.current){if(o=i.alternate,o===null)throw Error(O(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ro):e=[Ro])}i=i.return}e!==null&&Bu(t,e,a,r),t.flags|=262144}function is(e){for(e=e.firstContext;e!==null;){if(!la(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ci(e){bi=e,ir=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Jg(bi,e)}function Sl(e,t){return bi===null&&ci(e),Jg(e,t)}function Jg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ir===null){if(e===null)throw Error(O(308));ir=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ir=ir.next=t;return a}var xy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},ky=wt.unstable_scheduleCallback,Ny=wt.unstable_NormalPriority,ht={$$typeof:ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ep(){return{controller:new xy,data:new Map,refCount:0}}function Go(e){e.refCount--,e.refCount===0&&ky(Ny,function(){e.controller.abort()})}var po=null,Ou=0,cn=0,tn=null;function Sy(e,t){if(po===null){var a=po=[];Ou=0,cn=Wp(),tn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Ou++,t.then(of,of),t}function of(){if(--Ou===0&&po!==null){tn!==null&&(tn.status="fulfilled");var e=po;po=null,cn=0,tn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Cy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var lf=ue.S;ue.S=function(e,t){ub=ra(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Sy(e,t),lf!==null&&lf(e,t)};var ni=ja(null);function Mp(){var e=ni.current;return e!==null?e:Ke.pooledCache}function jl(e,t){t===null?Ie(ni,ni.current):Ie(ni,t.pool)}function Fg(){var e=Mp();return e===null?null:{parent:ht._currentValue,pool:e}}var yn=Error(O(460)),Tp=Error(O(474)),zs=Error(O(542)),ns={then:function(){}};function sf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ig(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(rr,rr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uf(e),e;default:if(typeof t.status=="string")t.then(rr,rr);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(O(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uf(e),e}throw oi=t,yn}}function ti(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(oi=a,yn):a}}var oi=null;function cf(){if(oi===null)throw Error(O(459));var e=oi;return oi=null,e}function uf(e){if(e===yn||e===zs)throw Error(O(483))}var an=null,Eo=0;function Cl(e){var t=Eo;return Eo+=1,an===null&&(an=[]),Ig(an,e,t)}function In(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ql(e,t){throw t.$$typeof===d0?Error(O(525)):(e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Wg(e){function t(f,u){if(e){var g=f.deletions;g===null?(f.deletions=[u],f.flags|=16):g.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=nr(f,u),f.index=0,f.sibling=null,f}function n(f,u,g){return f.index=g,e?(g=f.alternate,g!==null?(g=g.index,g<u?(f.flags|=67108866,u):g):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,g,v){return u===null||u.tag!==6?(u=Kc(g,f.mode,v),u.return=f,u):(u=i(u,g),u.return=f,u)}function c(f,u,g,v){var k=g.type;return k===ji?d(f,u,g.props.children,v,g.key):u!==null&&(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_r&&ti(k)===u.type)?(u=i(u,g.props),In(u,g),u.return=f,u):(u=Hl(g.type,g.key,g.props,null,f.mode,v),In(u,g),u.return=f,u)}function p(f,u,g,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=Pc(g,f.mode,v),u.return=f,u):(u=i(u,g.children||[]),u.return=f,u)}function d(f,u,g,v,k){return u===null||u.tag!==7?(u=ii(g,f.mode,v,k),u.return=f,u):(u=i(u,g),u.return=f,u)}function h(f,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Kc(""+u,f.mode,g),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case bl:return g=Hl(u.type,u.key,u.props,null,f.mode,g),In(g,u),g.return=f,g;case ro:return u=Pc(u,f.mode,g),u.return=f,u;case _r:return u=ti(u),h(f,u,g)}if(io(u)||Jn(u))return u=ii(u,f.mode,g,null),u.return=f,u;if(typeof u.then=="function")return h(f,Cl(u),g);if(u.$$typeof===ar)return h(f,Sl(f,u),g);ql(f,u)}return null}function m(f,u,g,v){var k=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return k!==null?null:l(f,u,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case bl:return g.key===k?c(f,u,g,v):null;case ro:return g.key===k?p(f,u,g,v):null;case _r:return g=ti(g),m(f,u,g,v)}if(io(g)||Jn(g))return k!==null?null:d(f,u,g,v,null);if(typeof g.then=="function")return m(f,u,Cl(g),v);if(g.$$typeof===ar)return m(f,u,Sl(f,g),v);ql(f,g)}return null}function b(f,u,g,v,k){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(g)||null,l(u,f,""+v,k);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case bl:return f=f.get(v.key===null?g:v.key)||null,c(u,f,v,k);case ro:return f=f.get(v.key===null?g:v.key)||null,p(u,f,v,k);case _r:return v=ti(v),b(f,u,g,v,k)}if(io(v)||Jn(v))return f=f.get(g)||null,d(u,f,v,k,null);if(typeof v.then=="function")return b(f,u,g,Cl(v),k);if(v.$$typeof===ar)return b(f,u,g,Sl(u,v),k);ql(u,v)}return null}function w(f,u,g,v){for(var k=null,A=null,M=u,z=u=0,G=null;M!==null&&z<g.length;z++){M.index>z?(G=M,M=null):G=M.sibling;var P=m(f,M,g[z],v);if(P===null){M===null&&(M=G);break}e&&M&&P.alternate===null&&t(f,M),u=n(P,u,z),A===null?k=P:A.sibling=P,A=P,M=G}if(z===g.length)return a(f,M),Te&&er(f,z),k;if(M===null){for(;z<g.length;z++)M=h(f,g[z],v),M!==null&&(u=n(M,u,z),A===null?k=M:A.sibling=M,A=M);return Te&&er(f,z),k}for(M=r(M);z<g.length;z++)G=b(M,f,z,g[z],v),G!==null&&(e&&G.alternate!==null&&M.delete(G.key===null?z:G.key),u=n(G,u,z),A===null?k=G:A.sibling=G,A=G);return e&&M.forEach(function(ge){return t(f,ge)}),Te&&er(f,z),k}function E(f,u,g,v){if(g==null)throw Error(O(151));for(var k=null,A=null,M=u,z=u=0,G=null,P=g.next();M!==null&&!P.done;z++,P=g.next()){M.index>z?(G=M,M=null):G=M.sibling;var ge=m(f,M,P.value,v);if(ge===null){M===null&&(M=G);break}e&&M&&ge.alternate===null&&t(f,M),u=n(ge,u,z),A===null?k=ge:A.sibling=ge,A=ge,M=G}if(P.done)return a(f,M),Te&&er(f,z),k;if(M===null){for(;!P.done;z++,P=g.next())P=h(f,P.value,v),P!==null&&(u=n(P,u,z),A===null?k=P:A.sibling=P,A=P);return Te&&er(f,z),k}for(M=r(M);!P.done;z++,P=g.next())P=b(M,f,z,P.value,v),P!==null&&(e&&P.alternate!==null&&M.delete(P.key===null?z:P.key),u=n(P,u,z),A===null?k=P:A.sibling=P,A=P);return e&&M.forEach(function(Ae){return t(f,Ae)}),Te&&er(f,z),k}function U(f,u,g,v){if(typeof g=="object"&&g!==null&&g.type===ji&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case bl:e:{for(var k=g.key;u!==null;){if(u.key===k){if(k=g.type,k===ji){if(u.tag===7){a(f,u.sibling),v=i(u,g.props.children),v.return=f,f=v;break e}}else if(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_r&&ti(k)===u.type){a(f,u.sibling),v=i(u,g.props),In(v,g),v.return=f,f=v;break e}a(f,u);break}else t(f,u);u=u.sibling}g.type===ji?(v=ii(g.props.children,f.mode,v,g.key),v.return=f,f=v):(v=Hl(g.type,g.key,g.props,null,f.mode,v),In(v,g),v.return=f,f=v)}return o(f);case ro:e:{for(k=g.key;u!==null;){if(u.key===k)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(f,u.sibling),v=i(u,g.children||[]),v.return=f,f=v;break e}else{a(f,u);break}else t(f,u);u=u.sibling}v=Pc(g,f.mode,v),v.return=f,f=v}return o(f);case _r:return g=ti(g),U(f,u,g,v)}if(io(g))return w(f,u,g,v);if(Jn(g)){if(k=Jn(g),typeof k!="function")throw Error(O(150));return g=k.call(g),E(f,u,g,v)}if(typeof g.then=="function")return U(f,u,Cl(g),v);if(g.$$typeof===ar)return U(f,u,Sl(f,g),v);ql(f,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(f,u.sibling),v=i(u,g),v.return=f,f=v):(a(f,u),v=Kc(g,f.mode,v),v.return=f,f=v),o(f)):a(f,u)}return function(f,u,g,v){try{Eo=0;var k=U(f,u,g,v);return an=null,k}catch(M){if(M===yn||M===zs)throw M;var A=ta(29,M,null,f.mode);return A.lanes=v,A.return=f,A}}}var ui=Wg(!0),eh=Wg(!1),xr=!1;function zp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Le&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=as(e),Vg(e,null,a),t}return Ts(e,r,t,a),as(e)}function mo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,vg(e,a)}}function Fc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Hu=!1;function fo(){if(Hu){var e=tn;if(e!==null)throw e}}function go(e,t,a,r){Hu=!1;var i=e.updateQueue;xr=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=p:l.next=p,d.lastBaseUpdate=c))}if(n!==null){var h=i.baseState;o=0,d=p=c=null,l=n;do{var m=l.lane&-536870913,b=m!==l.lane;if(b?(Ee&m)===m:(r&m)===m){m!==0&&m===cn&&(Hu=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,E=l;m=t;var U=a;switch(E.tag){case 1:if(w=E.payload,typeof w=="function"){h=w.call(U,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,m=typeof w=="function"?w.call(U,h,m):w,m==null)break e;h=rt({},h,m);break e;case 2:xr=!0}}m=l.callback,m!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[m]:b.push(m))}else b={lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(p=d=b,c=h):d=d.next=b,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=d,n===null&&(i.shared.lanes=0),Xr|=o,e.lanes=o,e.memoizedState=h}}function th(e,t){if(typeof e!="function")throw Error(O(191,e));e.call(t)}function ah(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)th(a[e],t)}var un=ja(null),os=ja(0);function pf(e,t){e=dr,Ie(os,e),Ie(un,t),dr=e|t.baseLanes}function ju(){Ie(os,dr),Ie(un,un.current)}function Ap(){dr=os.current,St(un),St(os)}var sa=ja(null),ya=null;function Nr(e){var t=e.alternate;Ie(pt,pt.current&1),Ie(sa,e),ya===null&&(t===null||un.current!==null||t.memoizedState!==null)&&(ya=e)}function Qu(e){Ie(pt,pt.current),Ie(sa,e),ya===null&&(ya=e)}function rh(e){e.tag===22?(Ie(pt,pt.current),Ie(sa,e),ya===null&&(ya=e)):Sr(e)}function Sr(){Ie(pt,pt.current),Ie(sa,sa.current)}function ea(e){St(sa),ya===e&&(ya=null),St(pt)}var pt=ja(0);function ls(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||op(a)||lp(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cr=0,fe=null,Ze=null,ft=null,ss=!1,rn=!1,pi=!1,cs=0,Mo=0,nn=null,qy=0;function lt(){throw Error(O(321))}function Rp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!la(e[a],t[a]))return!1;return!0}function Up(e,t,a,r,i,n){return cr=n,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ue.H=e===null||e.memoizedState===null?Uh:Vp,pi=!1,n=a(r,i),pi=!1,rn&&(n=nh(t,a,r,i)),ih(e),n}function ih(e){ue.H=To;var t=Ze!==null&&Ze.next!==null;if(cr=0,ft=Ze=fe=null,ss=!1,Mo=0,nn=null,t)throw Error(O(300));e===null||bt||(e=e.dependencies,e!==null&&is(e)&&(bt=!0))}function nh(e,t,a,r){fe=e;var i=0;do{if(rn&&(nn=null),Mo=0,rn=!1,25<=i)throw Error(O(301));if(i+=1,ft=Ze=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}ue.H=Dh,n=t(a,r)}while(rn);return n}function Ey(){var e=ue.H,t=e.useState()[0];return t=typeof t.then=="function"?Yo(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(fe.flags|=1024),t}function Dp(){var e=cs!==0;return cs=0,e}function Bp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Op(e){if(ss){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ss=!1}cr=0,ft=Ze=fe=null,rn=!1,Mo=cs=0,nn=null}function Ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?fe.memoizedState=ft=e:ft=ft.next=e,ft}function dt(){if(Ze===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=ft===null?fe.memoizedState:ft.next;if(t!==null)ft=t,Ze=e;else{if(e===null)throw fe.alternate===null?Error(O(467)):Error(O(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},ft===null?fe.memoizedState=ft=e:ft=ft.next=e}return ft}function As(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yo(e){var t=Mo;return Mo+=1,nn===null&&(nn=[]),e=Ig(nn,e,t),t=fe,(ft===null?t.memoizedState:ft.next)===null&&(t=t.alternate,ue.H=t===null||t.memoizedState===null?Uh:Vp),e}function Rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yo(e);if(e.$$typeof===ar)return Mt(e)}throw Error(O(438,String(e)))}function Lp(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=As(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=m0;return t.index++,a}function ur(e,t){return typeof t=="function"?t(e):t}function Ql(e){var t=dt();return Hp(t,Ze,e)}function Hp(e,t,a){var r=e.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,d=!1;do{var h=p.lane&-536870913;if(h!==p.lane?(Ee&h)===h:(cr&h)===h){var m=p.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),h===cn&&(d=!0);else if((cr&m)===m){p=p.next,m===cn&&(d=!0);continue}else h={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=h,o=n):c=c.next=h,fe.lanes|=m,Xr|=m;h=p.action,pi&&a(n,h),n=p.hasEagerState?p.eagerState:a(n,h)}else m={lane:h,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=m,o=n):c=c.next=m,fe.lanes|=h,Xr|=h;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!la(n,e.memoizedState)&&(bt=!0,d&&(a=tn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ic(e){var t=dt(),a=t.queue;if(a===null)throw Error(O(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);la(n,t.memoizedState)||(bt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function oh(e,t,a){var r=fe,i=dt(),n=Te;if(n){if(a===void 0)throw Error(O(407));a=a()}else a=t();var o=!la((Ze||i).memoizedState,a);if(o&&(i.memoizedState=a,bt=!0),i=i.queue,jp(ch.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||ft!==null&&ft.memoizedState.tag&1){if(r.flags|=2048,pn(9,{destroy:void 0},sh.bind(null,r,i,a,t),null),Ke===null)throw Error(O(349));n||(cr&127)!==0||lh(r,t,a)}return a}function lh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=As(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function sh(e,t,a,r){t.value=a,t.getSnapshot=r,uh(t)&&ph(e)}function ch(e,t,a){return a(function(){uh(t)&&ph(e)})}function uh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!la(e,a)}catch{return!0}}function ph(e){var t=hi(e,2);t!==null&&Vt(t,e,2)}function Gu(e){var t=Ot();if(typeof e=="function"){var a=e;if(e=a(),pi){qr(!0);try{a()}finally{qr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t}function dh(e,t,a,r){return e.baseState=a,Hp(e,Ze,typeof r=="function"?r:ur)}function My(e,t,a,r,i){if(Ds(e))throw Error(O(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};ue.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,mh(t,n)):(n.next=a.next,t.pending=a.next=n)}}function mh(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=ue.T,o={};ue.T=o;try{var l=a(i,r),c=ue.S;c!==null&&c(o,l),df(e,t,l)}catch(p){Yu(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),ue.T=n}}else try{n=a(i,r),df(e,t,n)}catch(p){Yu(e,t,p)}}function df(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){mf(e,t,r)},function(r){return Yu(e,t,r)}):mf(e,t,a)}function mf(e,t,a){t.status="fulfilled",t.value=a,fh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,mh(e,a)))}function Yu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,fh(t),t=t.next;while(t!==r)}e.action=null}function fh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gh(e,t){return t}function ff(e,t){if(Te){var a=Ke.formState;if(a!==null){e:{var r=fe;if(Te){if(at){t:{for(var i=at,n=wa;i.nodeType!==8;){if(!n){i=null;break t}if(i=_a(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){at=_a(i.nextSibling),r=i.data==="F!";break e}}Gr(r)}r=!1}r&&(t=a[0])}}return a=Ot(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:t},a.queue=r,a=zh.bind(null,fe,r),r.dispatch=a,r=Gu(!1),n=Xp.bind(null,fe,!1,r.queue),r=Ot(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=My.bind(null,fe,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function gf(e){var t=dt();return hh(t,Ze,e)}function hh(e,t,a){if(t=Hp(e,t,gh)[0],e=Ql(ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Yo(t)}catch(o){throw o===yn?zs:o}else r=t;t=dt();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,pn(9,{destroy:void 0},Ty.bind(null,i,a),null)),[r,n,e]}function Ty(e,t){e.action=t}function hf(e){var t=dt(),a=Ze;if(a!==null)return hh(t,a,e);dt(),t=t.memoizedState,a=dt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function pn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=As(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function bh(){return dt().memoizedState}function Gl(e,t,a,r){var i=Ot();fe.flags|=e,i.memoizedState=pn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Us(e,t,a,r){var i=dt();r=r===void 0?null:r;var n=i.memoizedState.inst;Ze!==null&&r!==null&&Rp(r,Ze.memoizedState.deps)?i.memoizedState=pn(t,n,a,r):(fe.flags|=e,i.memoizedState=pn(1|t,n,a,r))}function bf(e,t){Gl(8390656,8,e,t)}function jp(e,t){Us(2048,8,e,t)}function zy(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=As(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function vh(e){var t=dt().memoizedState;return zy({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(O(440));return t.impl.apply(void 0,arguments)}}function wh(e,t){return Us(4,2,e,t)}function yh(e,t){return Us(4,4,e,t)}function _h(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xh(e,t,a){a=a!=null?a.concat([e]):null,Us(4,4,_h.bind(null,t,e),a)}function Qp(){}function kh(e,t){var a=dt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Rp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Nh(e,t){var a=dt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Rp(t,r[1]))return r[0];if(r=e(),pi){qr(!0);try{e()}finally{qr(!1)}}return a.memoizedState=[r,t],r}function Gp(e,t,a){return a===void 0||(cr&1073741824)!==0&&(Ee&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=db(),fe.lanes|=e,Xr|=e,a)}function Sh(e,t,a,r){return la(a,t)?a:un.current!==null?(e=Gp(e,a,r),la(e,t)||(bt=!0),e):(cr&42)===0||(cr&1073741824)!==0&&(Ee&261930)===0?(bt=!0,e.memoizedState=a):(e=db(),fe.lanes|=e,Xr|=e,t)}function Ch(e,t,a,r,i){var n=He.p;He.p=n!==0&&8>n?n:8;var o=ue.T,l={};ue.T=l,Xp(e,!1,t,a);try{var c=i(),p=ue.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=Cy(c,r);ho(e,t,d,oa(e))}else ho(e,t,r,oa(e))}catch(h){ho(e,t,{then:function(){},status:"rejected",reason:h},oa())}finally{He.p=n,o!==null&&l.types!==null&&(o.types=l.types),ue.T=o}}function Ay(){}function Xu(e,t,a,r){if(e.tag!==5)throw Error(O(476));var i=qh(e).queue;Ch(e,i,t,ri,a===null?Ay:function(){return Eh(e),a(r)})}function qh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ri,baseState:ri,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:ri},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Eh(e){var t=qh(e);t.next===null&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},oa())}function Yp(){return Mt(Ro)}function Mh(){return dt().memoizedState}function Th(){return dt().memoizedState}function Ry(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=oa();e=Ur(a);var r=Dr(t,e,a);r!==null&&(Vt(r,t,a),mo(r,t,a)),t={cache:Ep()},e.payload=t;return}t=t.return}}function Uy(e,t,a){var r=oa();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Ah(t,a):(a=Np(e,t,a,r),a!==null&&(Vt(a,e,r),Rh(a,t,r)))}function zh(e,t,a){var r=oa();ho(e,t,a,r)}function ho(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Ah(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,la(l,o))return Ts(e,t,i,0),Ke===null&&Ms(),!1}catch{}if(a=Np(e,t,i,r),a!==null)return Vt(a,e,r),Rh(a,t,r),!0}return!1}function Xp(e,t,a,r){if(r={lane:2,revertLane:Wp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(O(479))}else t=Np(e,a,r,2),t!==null&&Vt(t,e,2)}function Ds(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Ah(e,t){rn=ss=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Rh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,vg(e,a)}}var To={readContext:Mt,use:Rs,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};To.useEffectEvent=lt;var Uh={readContext:Mt,use:Rs,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:bf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Gl(4194308,4,_h.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Gl(4194308,4,e,t)},useInsertionEffect:function(e,t){Gl(4,2,e,t)},useMemo:function(e,t){var a=Ot();t=t===void 0?null:t;var r=e();if(pi){qr(!0);try{e()}finally{qr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ot();if(a!==void 0){var i=a(t);if(pi){qr(!0);try{a(t)}finally{qr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Uy.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Gu(e);var t=e.queue,a=zh.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Qp,useDeferredValue:function(e,t){var a=Ot();return Gp(a,e,t)},useTransition:function(){var e=Gu(!1);return e=Ch.bind(null,fe,e.queue,!0,!1),Ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,i=Ot();if(Te){if(a===void 0)throw Error(O(407));a=a()}else{if(a=t(),Ke===null)throw Error(O(349));(Ee&127)!==0||lh(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,bf(ch.bind(null,r,n,e),[e]),r.flags|=2048,pn(9,{destroy:void 0},sh.bind(null,r,n,a,t),null),a},useId:function(){var e=Ot(),t=Ke.identifierPrefix;if(Te){var a=Oa,r=Ba;a=(r&~(1<<32-na(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=qy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yp,useFormState:ff,useActionState:ff,useOptimistic:function(e){var t=Ot();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Xp.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lp,useCacheRefresh:function(){return Ot().memoizedState=Ry.bind(null,fe)},useEffectEvent:function(e){var t=Ot(),a={impl:e};return t.memoizedState=a,function(){if((Le&2)!==0)throw Error(O(440));return a.impl.apply(void 0,arguments)}}},Vp={readContext:Mt,use:Rs,useCallback:kh,useContext:Mt,useEffect:jp,useImperativeHandle:xh,useInsertionEffect:wh,useLayoutEffect:yh,useMemo:Nh,useReducer:Ql,useRef:bh,useState:function(){return Ql(ur)},useDebugValue:Qp,useDeferredValue:function(e,t){var a=dt();return Sh(a,Ze.memoizedState,e,t)},useTransition:function(){var e=Ql(ur)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:oh,useId:Mh,useHostTransitionStatus:Yp,useFormState:gf,useActionState:gf,useOptimistic:function(e,t){var a=dt();return dh(a,Ze,e,t)},useMemoCache:Lp,useCacheRefresh:Th};Vp.useEffectEvent=vh;var Dh={readContext:Mt,use:Rs,useCallback:kh,useContext:Mt,useEffect:jp,useImperativeHandle:xh,useInsertionEffect:wh,useLayoutEffect:yh,useMemo:Nh,useReducer:Ic,useRef:bh,useState:function(){return Ic(ur)},useDebugValue:Qp,useDeferredValue:function(e,t){var a=dt();return Ze===null?Gp(a,e,t):Sh(a,Ze.memoizedState,e,t)},useTransition:function(){var e=Ic(ur)[0],t=dt().memoizedState;return[typeof e=="boolean"?e:Yo(e),t]},useSyncExternalStore:oh,useId:Mh,useHostTransitionStatus:Yp,useFormState:hf,useActionState:hf,useOptimistic:function(e,t){var a=dt();return Ze!==null?dh(a,Ze,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lp,useCacheRefresh:Th};Dh.useEffectEvent=vh;function Wc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:rt({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Vu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=oa(),i=Ur(r);i.payload=t,a!=null&&(i.callback=a),t=Dr(e,i,r),t!==null&&(Vt(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=oa(),i=Ur(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Dr(e,i,r),t!==null&&(Vt(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=oa(),r=Ur(a);r.tag=2,t!=null&&(r.callback=t),t=Dr(e,r,a),t!==null&&(Vt(t,e,a),mo(t,e,a))}};function vf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!So(a,r)||!So(i,n):!0}function wf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Vu.enqueueReplaceState(t,t.state,null)}function di(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=rt({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Bh(e){ts(e)}function Oh(e){console.error(e)}function Lh(e){ts(e)}function us(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function yf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function $u(e,t,a){return a=Ur(a),a.tag=3,a.payload={element:null},a.callback=function(){us(e,t)},a}function Hh(e){return e=Ur(e),e.tag=3,e}function jh(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){yf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){yf(t,a,r),typeof i!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Dy(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&wn(t,a,i,!0),a=sa.current,a!==null){switch(a.tag){case 31:case 13:return ya===null?gs():a.alternate===null&&st===0&&(st=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),uu(e,r,i)),!1;case 22:return a.flags|=65536,r===ns?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),uu(e,r,i)),!1}throw Error(O(435,a.tag))}return uu(e,r,i),gs(),!1}if(Te)return t=sa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ru&&(e=Error(O(422),{cause:r}),qo(va(e,a)))):(r!==Ru&&(t=Error(O(423),{cause:r}),qo(va(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=va(r,a),i=$u(e.stateNode,r,i),Fc(e,i),st!==4&&(st=2)),!1;var n=Error(O(520),{cause:r});if(n=va(n,a),wo===null?wo=[n]:wo.push(n),st!==4&&(st=2),t===null)return!0;r=va(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=$u(a.stateNode,r,e),Fc(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Br===null||!Br.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Hh(i),jh(i,e,a,r),Fc(a,i),!1}a=a.return}while(a!==null);return!1}var $p=Error(O(461)),bt=!1;function Ct(e,t,a,r){t.child=e===null?eh(t,null,a,r):ui(t,e.child,a,r)}function _f(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return ci(t),r=Up(e,t,a,o,n,i),l=Dp(),e!==null&&!bt?(Bp(e,t,i),pr(e,t,i)):(Te&&l&&Cp(t),t.flags|=1,Ct(e,t,r,i),t.child)}function xf(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Sp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,Qh(e,t,n,r,i)):(e=Hl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Zp(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:So,a(o,r)&&e.ref===t.ref)return pr(e,t,i)}return t.flags|=1,e=nr(n,r),e.ref=t.ref,e.return=t,t.child=e}function Qh(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(So(n,r)&&e.ref===t.ref)if(bt=!1,t.pendingProps=r=n,Zp(e,i))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,pr(e,t,i)}return Zu(e,t,a,r,i)}function Gh(e,t,a,r){var i=r.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return kf(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jl(t,n!==null?n.cachePool:null),n!==null?pf(t,n):ju(),rh(t);else return r=t.lanes=536870912,kf(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(jl(t,n.cachePool),pf(t,n),Sr(t),t.memoizedState=null):(e!==null&&jl(t,null),ju(),Sr(t));return Ct(e,t,i,a),t.child}function oo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kf(e,t,a,r,i){var n=Mp();return n=n===null?null:{parent:ht._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&jl(t,null),ju(),rh(t),e!==null&&wn(e,t,r,!0),t.childLanes=i,null}function Yl(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Nf(e,t,a){return ui(t,e.child,null,a),e=Yl(t,t.pendingProps),e.flags|=2,ea(t),t.memoizedState=null,e}function By(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(r.mode==="hidden")return e=Yl(t,r),t.lanes=536870912,oo(null,e);if(Qu(t),(e=at)?(e=Ub(e,wa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qr!==null?{id:Ba,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Zg(e),a.return=t,t.child=a,Et=t,at=null)):e=null,e===null)throw Gr(t);return t.lanes=536870912,null}return Yl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Qu(t),i)if(t.flags&256)t.flags&=-257,t=Nf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(O(558));else if(bt||wn(e,t,a,!1),i=(a&e.childLanes)!==0,bt||i){if(r=Ke,r!==null&&(o=wg(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Vt(r,e,o),$p;gs(),t=Nf(e,t,a)}else e=n.treeContext,at=_a(o.nextSibling),Et=t,Te=!0,Rr=null,wa=!1,e!==null&&Pg(t,e),t=Yl(t,r),t.flags|=4096;return t}return e=nr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(O(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Zu(e,t,a,r,i){return ci(t),a=Up(e,t,a,r,void 0,i),r=Dp(),e!==null&&!bt?(Bp(e,t,i),pr(e,t,i)):(Te&&r&&Cp(t),t.flags|=1,Ct(e,t,a,i),t.child)}function Sf(e,t,a,r,i,n){return ci(t),t.updateQueue=null,a=nh(t,r,a,i),ih(e),r=Dp(),e!==null&&!bt?(Bp(e,t,n),pr(e,t,n)):(Te&&r&&Cp(t),t.flags|=1,Ct(e,t,a,n),t.child)}function Cf(e,t,a,r,i){if(ci(t),t.stateNode===null){var n=Ki,o=a.contextType;typeof o=="object"&&o!==null&&(n=Mt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Vu,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},zp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Mt(o):Ki,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Wc(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&Vu.enqueueReplaceState(n,n.state,null),go(t,r,n,i),fo(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=di(a,l);n.props=c;var p=n.context,d=a.contextType;o=Ki,typeof d=="object"&&d!==null&&(o=Mt(d));var h=a.getDerivedStateFromProps;d=typeof h=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&wf(t,n,r,o),xr=!1;var m=t.memoizedState;n.state=m,go(t,r,n,i),fo(),p=t.memoizedState,l||m!==p||xr?(typeof h=="function"&&(Wc(t,a,h,r),p=t.memoizedState),(c=xr||vf(t,a,c,r,m,p,o))?(d||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Lu(e,t),o=t.memoizedProps,d=di(a,o),n.props=d,h=t.pendingProps,m=n.context,p=a.contextType,c=Ki,typeof p=="object"&&p!==null&&(c=Mt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==h||m!==c)&&wf(t,n,r,c),xr=!1,m=t.memoizedState,n.state=m,go(t,r,n,i),fo();var b=t.memoizedState;o!==h||m!==b||xr||e!==null&&e.dependencies!==null&&is(e.dependencies)?(typeof l=="function"&&(Wc(t,a,l,r),b=t.memoizedState),(d=xr||vf(t,a,d,r,m,b,c)||e!==null&&e.dependencies!==null&&is(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=d):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Xl(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ui(t,e.child,null,i),t.child=ui(t,null,a,i)):Ct(e,t,a,i),t.memoizedState=n.state,e=t.child):e=pr(e,t,i),e}function qf(e,t,a,r){return si(),t.flags|=256,Ct(e,t,a,r),t.child}var eu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tu(e){return{baseLanes:e,cachePool:Fg()}}function au(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=aa),e}function Yh(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(i?Nr(t):Sr(t),(e=at)?(e=Ub(e,wa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qr!==null?{id:Ba,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},a=Zg(e),a.return=t,t.child=a,Et=t,at=null)):e=null,e===null)throw Gr(t);return lp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(Sr(t),i=t.mode,l=ps({mode:"hidden",children:l},i),r=ii(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=tu(a),r.childLanes=au(e,o,a),t.memoizedState=eu,oo(null,r)):(Nr(t),Ku(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(Nr(t),t.flags&=-257,t=ru(e,t,a)):t.memoizedState!==null?(Sr(t),t.child=e.child,t.flags|=128,t=null):(Sr(t),l=r.fallback,i=t.mode,r=ps({mode:"visible",children:r.children},i),l=ii(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ui(t,e.child,null,a),r=t.child,r.memoizedState=tu(a),r.childLanes=au(e,o,a),t.memoizedState=eu,t=oo(null,r));else if(Nr(t),lp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(O(419)),r.stack="",r.digest=o,qo({value:r,source:null,stack:null}),t=ru(e,t,a)}else if(bt||wn(e,t,a,!1),o=(a&e.childLanes)!==0,bt||o){if(o=Ke,o!==null&&(r=wg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Vt(o,e,r),$p;op(l)||gs(),t=ru(e,t,a)}else op(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,at=_a(l.nextSibling),Et=t,Te=!0,Rr=null,wa=!1,e!==null&&Pg(t,e),t=Ku(t,r.children),t.flags|=4096);return t}return i?(Sr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=nr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=nr(p,l):(l=ii(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,oo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=tu(a):(i=l.cachePool,i!==null?(c=ht._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=Fg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=au(e,o,a),t.memoizedState=eu,oo(e.child,r)):(Nr(t),a=e.child,e=a.sibling,a=nr(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Ku(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=ta(22,e,null,t),e.lanes=0,e}function ru(e,t,a){return ui(t,e.child,null,a),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ef(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Du(e.return,t,a)}function iu(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function Xh(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=pt.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ie(pt,o),Ct(e,t,r,a),r=Te?Co:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ef(e,a,t);else if(e.tag===19)Ef(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ls(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),iu(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ls(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}iu(t,!0,a,null,n,r);break;case"together":iu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function pr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Xr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(wn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,a=nr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=nr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&is(e)))}function Oy(e,t,a){switch(t.tag){case 3:Fl(t,t.stateNode.containerInfo),kr(t,ht,e.memoizedState.cache),si();break;case 27:case 5:xu(t);break;case 4:Fl(t,t.stateNode.containerInfo);break;case 10:kr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Nr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Yh(e,t,a):(Nr(t),e=pr(e,t,a),e!==null?e.sibling:null);Nr(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(wn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return Xh(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(pt,pt.current),r)break;return null;case 22:return t.lanes=0,Gh(e,t,a,t.pendingProps);case 24:kr(t,ht,e.memoizedState.cache)}return pr(e,t,a)}function Vh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Zp(e,a)&&(t.flags&128)===0)return bt=!1,Oy(e,t,a);bt=(e.flags&131072)!==0}else bt=!1,Te&&(t.flags&1048576)!==0&&Kg(t,Co,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ti(t.elementType),t.type=e,typeof e=="function")Sp(e)?(r=di(e,r),t.tag=1,t=Cf(null,t,e,r,a)):(t.tag=0,t=Zu(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===pp){t.tag=11,t=_f(null,t,e,r,a);break e}else if(i===dp){t.tag=14,t=xf(null,t,e,r,a);break e}}throw t=yu(e)||e,Error(O(306,t,""))}}return t;case 0:return Zu(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=di(r,t.pendingProps),Cf(e,t,r,i,a);case 3:e:{if(Fl(t,t.stateNode.containerInfo),e===null)throw Error(O(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Lu(e,t),go(t,r,null,a);var o=t.memoizedState;if(r=o.cache,kr(t,ht,r),r!==n.cache&&Bu(t,[ht],a,!0),fo(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=qf(e,t,r,a);break e}else if(r!==i){i=va(Error(O(424)),t),qo(i),t=qf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,at=_a(e.firstChild),Et=t,Te=!0,Rr=null,wa=!0,a=eh(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(si(),r===i){t=pr(e,t,a);break e}Ct(e,t,r,a)}t=t.child}return t;case 26:return Xl(e,t),e===null?(a=Jf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Te||(a=t.type,e=t.pendingProps,r=ws(Ar.current).createElement(a),r[qt]=t,r[$t]=e,Tt(r,a,e),Nt(r),t.stateNode=r):t.memoizedState=Jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xu(t),e===null&&Te&&(r=t.stateNode=Db(t.type,t.pendingProps,Ar.current),Et=t,wa=!0,i=at,$r(t.type)?(sp=i,at=_a(r.firstChild)):at=i),Ct(e,t,t.pendingProps.children,a),Xl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((i=r=at)&&(r=p1(r,t.type,t.pendingProps,wa),r!==null?(t.stateNode=r,Et=t,at=_a(r.firstChild),wa=!1,i=!0):i=!1),i||Gr(t)),xu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,ip(i,n)?r=null:o!==null&&ip(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Up(e,t,Ey,null,null,a),Ro._currentValue=i),Xl(e,t),Ct(e,t,r,a),t.child;case 6:return e===null&&Te&&((e=a=at)&&(a=d1(a,t.pendingProps,wa),a!==null?(t.stateNode=a,Et=t,at=null,e=!0):e=!1),e||Gr(t)),null;case 13:return Yh(e,t,a);case 4:return Fl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ui(t,null,r,a):Ct(e,t,r,a),t.child;case 11:return _f(e,t,t.type,t.pendingProps,a);case 7:return Ct(e,t,t.pendingProps,a),t.child;case 8:return Ct(e,t,t.pendingProps.children,a),t.child;case 12:return Ct(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,kr(t,t.type,r.value),Ct(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ci(t),i=Mt(i),r=r(i),t.flags|=1,Ct(e,t,r,a),t.child;case 14:return xf(e,t,t.type,t.pendingProps,a);case 15:return Qh(e,t,t.type,t.pendingProps,a);case 19:return Xh(e,t,a);case 31:return By(e,t,a);case 22:return Gh(e,t,a,t.pendingProps);case 24:return ci(t),r=Mt(ht),e===null?(i=Mp(),i===null&&(i=Ke,n=Ep(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},zp(t),kr(t,ht,i)):((e.lanes&a)!==0&&(Lu(e,t),go(t,null,null,a),fo()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),kr(t,ht,r)):(r=n.cache,kr(t,ht,r),r!==i.cache&&Bu(t,[ht],a,!0))),Ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(O(156,t.tag))}function Ja(e){e.flags|=4}function nu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(gb())e.flags|=8192;else throw oi=ns,Tp}else e.flags&=-16777217}function Mf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lb(t))if(gb())e.flags|=8192;else throw oi=ns,Tp}function El(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hg():536870912,e.lanes|=t,dn|=t)}function Wn(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ly(e,t,a){var r=t.pendingProps;switch(qp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),or(ht),on(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Bi(t)?Ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Jc())),tt(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Ja(t),n!==null?(tt(t),Mf(t,n)):(tt(t),nu(t,i,null,r,a))):n?n!==e.memoizedState?(Ja(t),tt(t),Mf(t,n)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ja(t),tt(t),nu(t,i,e,r,a)),null;case 27:if(Il(t),a=Ar.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return tt(t),null}e=Ha.current,Bi(t)?rf(t,e):(e=Db(i,r,a),t.stateNode=e,Ja(t))}return tt(t),null;case 5:if(Il(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(O(166));return tt(t),null}if(n=Ha.current,Bi(t))rf(t,n);else{var o=ws(Ar.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[qt]=t,n[$t]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(Tt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ja(t)}}return tt(t),nu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(e=Ar.current,Bi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Et,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[qt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||zb(e.nodeValue,a)),e||Gr(t,!0)}else e=ws(e).createTextNode(r),e[qt]=t,t.stateNode=e}return tt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Bi(t),a!==null){if(e===null){if(!r)throw Error(O(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(557));e[qt]=t}else si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else a=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ea(t),t):(ea(t),null);if((t.flags&128)!==0)throw Error(O(558))}return tt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(O(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[qt]=t}else si(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else i=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ea(t),t):(ea(t),null)}return ea(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),El(t,t.updateQueue),tt(t),null);case 4:return on(),e===null&&ed(t.stateNode.containerInfo),tt(t),null;case 10:return or(t.type),tt(t),null;case 19:if(St(pt),r=t.memoizedState,r===null)return tt(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)Wn(r,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=ls(e),n!==null){for(t.flags|=128,Wn(r,!1),e=n.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)$g(a,e),a=a.sibling;return Ie(pt,pt.current&1|2),Te&&er(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ra()>ms&&(t.flags|=128,i=!0,Wn(r,!1),t.lanes=4194304)}else{if(!i)if(e=ls(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Wn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Te)return tt(t),null}else 2*ra()-r.renderingStartTime>ms&&a!==536870912&&(t.flags|=128,i=!0,Wn(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ra(),e.sibling=null,a=pt.current,Ie(pt,i?a&1|2:a&1),Te&&er(t,r.treeForkCount),e):(tt(t),null);case 22:case 23:return ea(t),Ap(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),a=t.updateQueue,a!==null&&El(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&St(ni),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),or(ht),tt(t),null;case 25:return null;case 30:return null}throw Error(O(156,t.tag))}function Hy(e,t){switch(qp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(ht),on(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Il(t),null;case 31:if(t.memoizedState!==null){if(ea(t),t.alternate===null)throw Error(O(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ea(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));si()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(pt),null;case 4:return on(),null;case 10:return or(t.type),null;case 22:case 23:return ea(t),Ap(),e!==null&&St(ni),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return or(ht),null;case 25:return null;default:return null}}function $h(e,t){switch(qp(t),t.tag){case 3:or(ht),on();break;case 26:case 27:case 5:Il(t);break;case 4:on();break;case 31:t.memoizedState!==null&&ea(t);break;case 13:ea(t);break;case 19:St(pt);break;case 10:or(t.type);break;case 22:case 23:ea(t),Ap(),e!==null&&St(ni);break;case 24:or(ht)}}function Xo(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Ge(t,t.return,l)}}function Yr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(d){Ge(i,c,d)}}}r=r.next}while(r!==n)}}catch(d){Ge(t,t.return,d)}}function Zh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ah(t,a)}catch(r){Ge(e,e.return,r)}}}function Kh(e,t,a){a.props=di(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Ge(e,t,r)}}function bo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(i){Ge(e,t,i)}}function La(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Ge(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Ge(e,t,i)}else a.current=null}function Ph(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(i){Ge(e,e.return,i)}}function ou(e,t,a){try{var r=e.stateNode;n1(r,e.type,a,t),r[$t]=t}catch(i){Ge(e,e.return,i)}}function Jh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$r(e.type)||e.tag===4}function lu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jh(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.tag===27&&$r(e.type)||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 Pu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=rr));else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Pu(e,t,a),e=e.sibling;e!==null;)Pu(e,t,a),e=e.sibling}function ds(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&$r(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ds(e,t,a),e=e.sibling;e!==null;)ds(e,t,a),e=e.sibling}function Fh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Tt(t,r,a),t[qt]=e,t[$t]=a}catch(n){Ge(e,e.return,n)}}var tr=!1,gt=!1,su=!1,Tf=typeof WeakSet=="function"?WeakSet:Set,kt=null;function jy(e,t){if(e=e.containerInfo,ap=ks,e=Lg(e),xp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,d=0,h=e,m=null;t:for(;;){for(var b;h!==a||i!==0&&h.nodeType!==3||(l=o+i),h!==n||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(b=h.firstChild)!==null;)m=h,h=b;for(;;){if(h===e)break t;if(m===a&&++p===i&&(l=o),m===n&&++d===r&&(c=o),(b=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(rp={focusedElem:e,selectionRange:a},ks=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){switch(t=kt,n=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var w=di(a.type,i);e=r.getSnapshotBeforeUpdate(w,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Ge(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)np(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":np(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(O(163))}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}}function Ih(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&Xo(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Ge(a,a.return,o)}else{var i=di(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Ge(a,a.return,o)}}r&64&&Zh(a),r&512&&bo(a,a.return);break;case 3:if(Ia(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{ah(e,t)}catch(o){Ge(a,a.return,o)}}break;case 27:t===null&&r&4&&Fh(a);case 26:case 5:Ia(e,a),t===null&&r&4&&Ph(a),r&512&&bo(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&tb(e,a);break;case 13:Ia(e,a),r&4&&ab(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Py.bind(null,a),m1(e,a))));break;case 22:if(r=a.memoizedState!==null||tr,!r){t=t!==null&&t.memoizedState!==null||gt,i=tr;var n=gt;tr=r,(gt=t)&&!n?Wa(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),tr=i,gt=n}break;case 30:break;default:Ia(e,a)}}function Wh(e){var t=e.alternate;t!==null&&(e.alternate=null,Wh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&hp(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,Yt=!1;function Fa(e,t,a){for(a=a.child;a!==null;)eb(e,t,a),a=a.sibling}function eb(e,t,a){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(Oo,a)}catch{}switch(a.tag){case 26:gt||La(a,t),Fa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gt||La(a,t);var r=nt,i=Yt;$r(a.type)&&(nt=a.stateNode,Yt=!1),Fa(e,t,a),_o(a.stateNode),nt=r,Yt=i;break;case 5:gt||La(a,t);case 6:if(r=nt,i=Yt,nt=null,Fa(e,t,a),nt=r,Yt=i,nt!==null)if(Yt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(a.stateNode)}catch(n){Ge(a,t,n)}else try{nt.removeChild(a.stateNode)}catch(n){Ge(a,t,n)}break;case 18:nt!==null&&(Yt?(e=nt,Vf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),hn(e)):Vf(nt,a.stateNode));break;case 4:r=nt,i=Yt,nt=a.stateNode.containerInfo,Yt=!0,Fa(e,t,a),nt=r,Yt=i;break;case 0:case 11:case 14:case 15:Yr(2,a,t),gt||Yr(4,a,t),Fa(e,t,a);break;case 1:gt||(La(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Kh(a,t,r)),Fa(e,t,a);break;case 21:Fa(e,t,a);break;case 22:gt=(r=gt)||a.memoizedState!==null,Fa(e,t,a),gt=r;break;default:Fa(e,t,a)}}function tb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hn(e)}catch(a){Ge(t,t.return,a)}}}function ab(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hn(e)}catch(a){Ge(t,t.return,a)}}function Qy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Tf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Tf),t;default:throw Error(O(435,e.tag))}}function Ml(e,t){var a=Qy(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=Jy.bind(null,e,r);r.then(i,i)}})}function Qt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if($r(l.type)){nt=l.stateNode,Yt=!1;break e}break;case 5:nt=l.stateNode,Yt=!1;break e;case 3:case 4:nt=l.stateNode.containerInfo,Yt=!0;break e}l=l.return}if(nt===null)throw Error(O(160));eb(n,o,i),nt=null,Yt=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rb(t,e),t=t.sibling}var za=null;function rb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Gt(e),r&4&&(Yr(3,e,e.return),Xo(3,e),Yr(5,e,e.return));break;case 1:Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),r&64&&tr&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var i=za;if(Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),r&4){var n=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[jo]||n[qt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),Tt(n,r,a),n[qt]=e,Nt(n),r=n;break e;case"link":var o=If("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=If("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;default:throw Error(O(468,r))}n[qt]=e,Nt(n),r=n}e.stateNode=r}else Wf(i,e.type,e.stateNode);else e.stateNode=Ff(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?Wf(i,e.type,e.stateNode):Ff(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ou(e,e.memoizedProps,a.memoizedProps)}break;case 27:Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),a!==null&&r&4&&ou(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Qt(t,e),Gt(e),r&512&&(gt||a===null||La(a,a.return)),e.flags&32){i=e.stateNode;try{sn(i,"")}catch(w){Ge(e,e.return,w)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,ou(e,i,a!==null?a.memoizedProps:i)),r&1024&&(su=!0);break;case 6:if(Qt(t,e),Gt(e),r&4){if(e.stateNode===null)throw Error(O(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Ge(e,e.return,w)}}break;case 3:if(Zl=null,i=za,za=ys(t.containerInfo),Qt(t,e),za=i,Gt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{hn(t.containerInfo)}catch(w){Ge(e,e.return,w)}su&&(su=!1,ib(e));break;case 4:r=za,za=ys(e.stateNode.containerInfo),Qt(t,e),Gt(e),za=r;break;case 12:Qt(t,e),Gt(e);break;case 31:Qt(t,e),Gt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 13:Qt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bs=ra()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=tr,d=gt;if(tr=p||i,gt=d||c,Qt(t,e),gt=d,tr=p,Gt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||tr||gt||ai(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;l.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(w){Ge(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(w){Ge(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?$f(b,!0):$f(c.stateNode,!1)}catch(w){Ge(c,c.return,w)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ml(e,a))));break;case 19:Qt(t,e),Gt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ml(e,r)));break;case 30:break;case 21:break;default:Qt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(Jh(r)){a=r;break}r=r.return}if(a==null)throw Error(O(160));switch(a.tag){case 27:var i=a.stateNode,n=lu(e);ds(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(sn(o,""),a.flags&=-33);var l=lu(e);ds(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=lu(e);Pu(e,p,c);break;default:throw Error(O(161))}}catch(d){Ge(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ib(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ib(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ih(e,t.alternate,t),t=t.sibling}function ai(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yr(4,t,t.return),ai(t);break;case 1:La(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Kh(t,t.return,a),ai(t);break;case 27:_o(t.stateNode);case 26:case 5:La(t,t.return),ai(t);break;case 22:t.memoizedState===null&&ai(t);break;case 30:ai(t);break;default:ai(t)}e=e.sibling}}function Wa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Wa(i,n,a),Xo(4,n);break;case 1:if(Wa(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){Ge(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)th(c[i],l)}catch(p){Ge(r,r.return,p)}}a&&o&64&&Zh(n),bo(n,n.return);break;case 27:Fh(n);case 26:case 5:Wa(i,n,a),a&&r===null&&o&4&&Ph(n),bo(n,n.return);break;case 12:Wa(i,n,a);break;case 31:Wa(i,n,a),a&&o&4&&tb(i,n);break;case 13:Wa(i,n,a),a&&o&4&&ab(i,n);break;case 22:n.memoizedState===null&&Wa(i,n,a),bo(n,n.return);break;case 30:break;default:Wa(i,n,a)}t=t.sibling}}function Kp(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Go(a))}function Pp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e))}function Ta(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nb(e,t,a,r),t=t.sibling}function nb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ta(e,t,a,r),i&2048&&Xo(9,t);break;case 1:Ta(e,t,a,r);break;case 3:Ta(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e)));break;case 12:if(i&2048){Ta(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Ge(t,t.return,c)}}else Ta(e,t,a,r);break;case 31:Ta(e,t,a,r);break;case 13:Ta(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ta(e,t,a,r):vo(e,t):n._visibility&2?Ta(e,t,a,r):(n._visibility|=2,Li(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Kp(o,t);break;case 24:Ta(e,t,a,r),i&2048&&Pp(t.alternate,t);break;default:Ta(e,t,a,r)}}function Li(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Li(n,o,l,c,i),Xo(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?Li(n,o,l,c,i):vo(n,o):(d._visibility|=2,Li(n,o,l,c,i)),i&&p&2048&&Kp(o.alternate,o);break;case 24:Li(n,o,l,c,i),i&&p&2048&&Pp(o.alternate,o);break;default:Li(n,o,l,c,i)}t=t.sibling}}function vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:vo(a,r),i&2048&&Kp(r.alternate,r);break;case 24:vo(a,r),i&2048&&Pp(r.alternate,r);break;default:vo(a,r)}t=t.sibling}}var lo=8192;function Oi(e,t,a){if(e.subtreeFlags&lo)for(e=e.child;e!==null;)ob(e,t,a),e=e.sibling}function ob(e,t,a){switch(e.tag){case 26:Oi(e,t,a),e.flags&lo&&e.memoizedState!==null&&S1(a,za,e.memoizedState,e.memoizedProps);break;case 5:Oi(e,t,a);break;case 3:case 4:var r=za;za=ys(e.stateNode.containerInfo),Oi(e,t,a),za=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=lo,lo=16777216,Oi(e,t,a),lo=r):Oi(e,t,a));break;default:Oi(e,t,a)}}function lb(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function eo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];kt=r,cb(r,e)}lb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sb(e),e=e.sibling}function sb(e){switch(e.tag){case 0:case 11:case 15:eo(e),e.flags&2048&&Yr(9,e,e.return);break;case 3:eo(e);break;case 12:eo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):eo(e);break;default:eo(e)}}function Vl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];kt=r,cb(r,e)}lb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yr(8,t,t.return),Vl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function cb(e,t){for(;kt!==null;){var a=kt;switch(a.tag){case 0:case 11:case 15:Yr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Go(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,kt=r;else e:for(a=e;kt!==null;){r=kt;var i=r.sibling,n=r.return;if(Wh(r),r===a){kt=null;break e}if(i!==null){i.return=n,kt=i;break e}kt=n}}}var Gy={getCacheForType:function(e){var t=Mt(ht),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Mt(ht).controller.signal}},Yy=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ke=null,qe=null,Ee=0,Qe=0,Wt=null,Mr=!1,_n=!1,Jp=!1,dr=0,st=0,Xr=0,li=0,Fp=0,aa=0,dn=0,wo=null,Xt=null,Ju=!1,Bs=0,ub=0,ms=1/0,fs=null,Br=null,vt=0,Or=null,mn=null,lr=0,Fu=0,Iu=null,pb=null,yo=0,Wu=null;function oa(){return(Le&2)!==0&&Ee!==0?Ee&-Ee:ue.T!==null?Wp():yg()}function db(){if(aa===0)if((Ee&536870912)===0||Te){var e=wl;wl<<=1,(wl&3932160)===0&&(wl=262144),aa=e}else aa=536870912;return e=sa.current,e!==null&&(e.flags|=32),aa}function Vt(e,t,a){(e===Ke&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(fn(e,0),Tr(e,Ee,aa,!1)),Ho(e,a),((Le&2)===0||e!==Ke)&&(e===Ke&&((Le&2)===0&&(li|=a),st===4&&Tr(e,Ee,aa,!1)),Qa(e))}function mb(e,t,a){if((Le&6)!==0)throw Error(O(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Lo(e,t),i=r?$y(e,t):cu(e,t,!0),n=r;do{if(i===0){_n&&!r&&Tr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!Xy(a)){i=cu(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;i=wo;var c=l.current.memoizedState.isDehydrated;if(c&&(fn(l,o).flags|=256),o=cu(l,o,!1),o!==2){if(Jp&&!c){l.errorRecoveryDisabledLanes|=n,li|=n,i=4;break e}n=Xt,Xt=i,n!==null&&(Xt===null?Xt=n:Xt.push.apply(Xt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){fn(e,0),Tr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(O(345));case 4:if((t&4194048)!==t)break;case 6:Tr(r,t,aa,!Mr);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((t&62914560)===t&&(i=Bs+300-ra(),10<i)){if(Tr(r,t,aa,!Mr),Ss(r,0,!0)!==0)break e;lr=t,r.timeoutHandle=Rb(zf.bind(null,r,a,Xt,fs,Ju,t,aa,li,dn,Mr,n,"Throttled",-0,0),i);break e}zf(r,a,Xt,fs,Ju,t,aa,li,dn,Mr,n,null,-0,0)}}break}while(!0);Qa(e)}function zf(e,t,a,r,i,n,o,l,c,p,d,h,m,b){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rr},ob(t,n,h);var w=(n&62914560)===n?Bs-ra():(n&4194048)===n?ub-ra():0;if(w=C1(h,w),w!==null){lr=n,e.cancelPendingCommit=w(Rf.bind(null,e,t,n,a,r,i,o,l,c,d,h,null,m,b)),Tr(e,n,o,!p);return}}Rf(e,t,n,a,r,i,o,l,c)}function Xy(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var i=a[r],n=i.getSnapshot;i=i.value;try{if(!la(n(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tr(e,t,a,r){t&=~Fp,t&=~li,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-na(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&bg(e,a,t)}function Os(){return(Le&6)===0?(Vo(0,!1),!1):!0}function Ip(){if(qe!==null){if(Qe===0)var e=qe.return;else e=qe,ir=bi=null,Op(e),an=null,Eo=0,e=qe;for(;e!==null;)$h(e.alternate,e),e=e.return;qe=null}}function fn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,s1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),lr=0,Ip(),Ke=e,qe=a=nr(e.current,null),Ee=t,Qe=0,Wt=null,Mr=!1,_n=Lo(e,t),Jp=!1,dn=aa=Fp=li=Xr=st=0,Xt=wo=null,Ju=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-na(r),n=1<<i;t|=e[i],r&=~n}return dr=t,Ms(),a}function fb(e,t){fe=null,ue.H=To,t===yn||t===zs?(t=cf(),Qe=3):t===Tp?(t=cf(),Qe=4):Qe=t===$p?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,qe===null&&(st=1,us(e,va(t,e.current)))}function gb(){var e=sa.current;return e===null?!0:(Ee&4194048)===Ee?ya===null:(Ee&62914560)===Ee||(Ee&536870912)!==0?e===ya:!1}function hb(){var e=ue.H;return ue.H=To,e===null?To:e}function bb(){var e=ue.A;return ue.A=Gy,e}function gs(){st=4,Mr||(Ee&4194048)!==Ee&&sa.current!==null||(_n=!0),(Xr&134217727)===0&&(li&134217727)===0||Ke===null||Tr(Ke,Ee,aa,!1)}function cu(e,t,a){var r=Le;Le|=2;var i=hb(),n=bb();(Ke!==e||Ee!==t)&&(fs=null,fn(e,t)),t=!1;var o=st;e:do try{if(Qe!==0&&qe!==null){var l=qe,c=Wt;switch(Qe){case 8:Ip(),o=6;break e;case 3:case 2:case 9:case 6:sa.current===null&&(t=!0);var p=Qe;if(Qe=0,Wt=null,Fi(e,l,c,p),a&&_n){o=0;break e}break;default:p=Qe,Qe=0,Wt=null,Fi(e,l,c,p)}}Vy(),o=st;break}catch(d){fb(e,d)}while(!0);return t&&e.shellSuspendCounter++,ir=bi=null,Le=r,ue.H=i,ue.A=n,qe===null&&(Ke=null,Ee=0,Ms()),o}function Vy(){for(;qe!==null;)vb(qe)}function $y(e,t){var a=Le;Le|=2;var r=hb(),i=bb();Ke!==e||Ee!==t?(fs=null,ms=ra()+500,fn(e,t)):_n=Lo(e,t);e:do try{if(Qe!==0&&qe!==null){t=qe;var n=Wt;t:switch(Qe){case 1:Qe=0,Wt=null,Fi(e,t,n,1);break;case 2:case 9:if(sf(n)){Qe=0,Wt=null,Af(t);break}t=function(){Qe!==2&&Qe!==9||Ke!==e||(Qe=7),Qa(e)},n.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:sf(n)?(Qe=0,Wt=null,Af(t)):(Qe=0,Wt=null,Fi(e,t,n,7));break;case 5:var o=null;switch(qe.tag){case 26:o=qe.memoizedState;case 5:case 27:var l=qe;if(o?Lb(o):l.stateNode.complete){Qe=0,Wt=null;var c=l.sibling;if(c!==null)qe=c;else{var p=l.return;p!==null?(qe=p,Ls(p)):qe=null}break t}}Qe=0,Wt=null,Fi(e,t,n,5);break;case 6:Qe=0,Wt=null,Fi(e,t,n,6);break;case 8:Ip(),st=6;break e;default:throw Error(O(462))}}Zy();break}catch(d){fb(e,d)}while(!0);return ir=bi=null,ue.H=r,ue.A=i,Le=a,qe!==null?0:(Ke=null,Ee=0,Ms(),st)}function Zy(){for(;qe!==null&&!h0();)vb(qe)}function vb(e){var t=Vh(e.alternate,e,dr);e.memoizedProps=e.pendingProps,t===null?Ls(e):qe=t}function Af(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Sf(a,t,t.pendingProps,t.type,void 0,Ee);break;case 11:t=Sf(a,t,t.pendingProps,t.type.render,t.ref,Ee);break;case 5:Op(t);default:$h(a,t),t=qe=$g(t,dr),t=Vh(a,t,dr)}e.memoizedProps=e.pendingProps,t===null?Ls(e):qe=t}function Fi(e,t,a,r){ir=bi=null,Op(t),an=null,Eo=0;var i=t.return;try{if(Dy(e,i,t,a,Ee)){st=1,us(e,va(a,e.current)),qe=null;return}}catch(n){if(i!==null)throw qe=i,n;st=1,us(e,va(a,e.current)),qe=null;return}t.flags&32768?(Te||r===1?e=!0:_n||(Ee&536870912)!==0?e=!1:(Mr=e=!0,(r===2||r===9||r===3||r===6)&&(r=sa.current,r!==null&&r.tag===13&&(r.flags|=16384))),wb(t,e)):Ls(t)}function Ls(e){var t=e;do{if((t.flags&32768)!==0){wb(t,Mr);return}e=t.return;var a=Ly(t.alternate,t,dr);if(a!==null){qe=a;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);st===0&&(st=5)}function wb(e,t){do{var a=Hy(e.alternate,e);if(a!==null){a.flags&=32767,qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=a}while(e!==null);st=6,qe=null}function Rf(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Hs();while(vt!==0);if((Le&6)!==0)throw Error(O(327));if(t!==null){if(t===e.current)throw Error(O(177));if(n=t.lanes|t.childLanes,n|=kp,C0(e,a,n,o,l,c),e===Ke&&(qe=Ke=null,Ee=0),mn=t,Or=e,lr=a,Fu=n,Iu=i,pb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fy(Wl,function(){return Nb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=ue.T,ue.T=null,i=He.p,He.p=2,o=Le,Le|=4;try{jy(e,t,a)}finally{Le=o,He.p=i,ue.T=r}}vt=1,yb(),_b(),xb()}}function yb(){if(vt===1){vt=0;var e=Or,t=mn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ue.T,ue.T=null;var r=He.p;He.p=2;var i=Le;Le|=4;try{rb(t,e);var n=rp,o=Lg(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&Og(l.ownerDocument.documentElement,l)){if(c!==null&&xp(l)){var p=c.start,d=c.end;if(d===void 0&&(d=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(d,l.value.length);else{var h=l.ownerDocument||document,m=h&&h.defaultView||window;if(m.getSelection){var b=m.getSelection(),w=l.textContent.length,E=Math.min(c.start,w),U=c.end===void 0?E:Math.min(c.end,w);!b.extend&&E>U&&(o=U,U=E,E=o);var f=ef(l,E),u=ef(l,U);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var g=h.createRange();g.setStart(f.node,f.offset),b.removeAllRanges(),E>U?(b.addRange(g),b.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),b.addRange(g))}}}}for(h=[],b=l;b=b.parentNode;)b.nodeType===1&&h.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<h.length;l++){var v=h[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}ks=!!ap,rp=ap=null}finally{Le=i,He.p=r,ue.T=a}}e.current=t,vt=2}}function _b(){if(vt===2){vt=0;var e=Or,t=mn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ue.T,ue.T=null;var r=He.p;He.p=2;var i=Le;Le|=4;try{Ih(e,t.alternate,t)}finally{Le=i,He.p=r,ue.T=a}}vt=3}}function xb(){if(vt===4||vt===3){vt=0,b0();var e=Or,t=mn,a=lr,r=pb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?vt=5:(vt=0,mn=Or=null,kb(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Br=null),gp(a),t=t.stateNode,ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(Oo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=ue.T,i=He.p,He.p=2,ue.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{ue.T=t,He.p=i}}(lr&3)!==0&&Hs(),Qa(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Wu?yo++:(yo=0,Wu=e):yo=0,Vo(0,!1)}}function kb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Go(t)))}function Hs(){return yb(),_b(),xb(),Nb()}function Nb(){if(vt!==5)return!1;var e=Or,t=Fu;Fu=0;var a=gp(lr),r=ue.T,i=He.p;try{He.p=32>a?32:a,ue.T=null,a=Iu,Iu=null;var n=Or,o=lr;if(vt=0,mn=Or=null,lr=0,(Le&6)!==0)throw Error(O(331));var l=Le;if(Le|=4,sb(n.current),nb(n,n.current,o,a),Le=l,Vo(0,!1),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(Oo,n)}catch{}return!0}finally{He.p=i,ue.T=r,kb(e,t)}}function Uf(e,t,a){t=va(a,t),t=$u(e.stateNode,t,2),e=Dr(e,t,2),e!==null&&(Ho(e,2),Qa(e))}function Ge(e,t,a){if(e.tag===3)Uf(e,e,a);else for(;t!==null;){if(t.tag===3){Uf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Br===null||!Br.has(r))){e=va(a,e),a=Hh(2),r=Dr(t,a,2),r!==null&&(jh(a,r,t,e),Ho(r,2),Qa(r));break}}t=t.return}}function uu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Yy;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(Jp=!0,i.add(a),e=Ky.bind(null,e,t,a),t.then(e,e))}function Ky(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Ee&a)===a&&(st===4||st===3&&(Ee&62914560)===Ee&&300>ra()-Bs?(Le&2)===0&&fn(e,0):Fp|=a,dn===Ee&&(dn=0)),Qa(e)}function Sb(e,t){t===0&&(t=hg()),e=hi(e,t),e!==null&&(Ho(e,t),Qa(e))}function Py(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Sb(e,a)}function Jy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(O(314))}r!==null&&r.delete(t),Sb(e,a)}function Fy(e,t){return mp(e,t)}var hs=null,Hi=null,ep=!1,bs=!1,pu=!1,zr=0;function Qa(e){e!==Hi&&e.next===null&&(Hi===null?hs=Hi=e:Hi=Hi.next=e),bs=!0,ep||(ep=!0,Wy())}function Vo(e,t){if(!pu&&bs){pu=!0;do for(var a=!1,r=hs;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-na(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Df(r,n))}else n=Ee,n=Ss(r,r===Ke?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Lo(r,n)||(a=!0,Df(r,n));r=r.next}while(a);pu=!1}}function Iy(){Cb()}function Cb(){bs=ep=!1;var e=0;zr!==0&&l1()&&(e=zr);for(var t=ra(),a=null,r=hs;r!==null;){var i=r.next,n=qb(r,t);n===0?(r.next=null,a===null?hs=i:a.next=i,i===null&&(Hi=a)):(a=r,(e!==0||(n&3)!==0)&&(bs=!0)),r=i}vt!==0&&vt!==5||Vo(e,!1),zr!==0&&(zr=0)}function qb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-na(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=S0(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=Ke,a=Ee,a=Ss(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&jc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Lo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&jc(r),gp(a)){case 2:case 8:a=fg;break;case 32:a=Wl;break;case 268435456:a=gg;break;default:a=Wl}return r=Eb.bind(null,e),a=mp(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&jc(r),e.callbackPriority=2,e.callbackNode=null,2}function Eb(e,t){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hs()&&e.callbackNode!==a)return null;var r=Ee;return r=Ss(e,e===Ke?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mb(e,r,t),qb(e,ra()),e.callbackNode!=null&&e.callbackNode===a?Eb.bind(null,e):null)}function Df(e,t){if(Hs())return null;mb(e,t,!0)}function Wy(){c1(function(){(Le&6)!==0?mp(mg,Iy):Cb()})}function Wp(){if(zr===0){var e=cn;e===0&&(e=vl,vl<<=1,(vl&261888)===0&&(vl=256)),zr=e}return zr}function Bf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bl(""+e)}function Of(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function e1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=Bf((i[$t]||null).action),o=r.submitter;o&&(t=(t=o[$t]||null)?Bf(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new Cs("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(zr!==0){var c=o?Of(i,o):new FormData(i);Xu(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?Of(i,o):new FormData(i),Xu(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Tl=0;Tl<Au.length;Tl++)zl=Au[Tl],Lf=zl.toLowerCase(),Hf=zl[0].toUpperCase()+zl.slice(1),Aa(Lf,"on"+Hf);var zl,Lf,Hf,Tl;Aa(jg,"onAnimationEnd");Aa(Qg,"onAnimationIteration");Aa(Gg,"onAnimationStart");Aa("dblclick","onDoubleClick");Aa("focusin","onFocus");Aa("focusout","onBlur");Aa(vy,"onTransitionRun");Aa(wy,"onTransitionStart");Aa(yy,"onTransitionCancel");Aa(Yg,"onTransitionEnd");ln("onMouseEnter",["mouseout","mouseover"]);ln("onMouseLeave",["mouseout","mouseover"]);ln("onPointerEnter",["pointerout","pointerover"]);ln("onPointerLeave",["pointerout","pointerover"]);mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),t1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function Mb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(d){ts(d)}i.currentTarget=null,n=c}}}}function Ce(e,t){var a=t[Nu];a===void 0&&(a=t[Nu]=new Set);var r=e+"__bubble";a.has(r)||(Tb(t,e,2,!1),a.add(r))}function du(e,t,a){var r=0;t&&(r|=4),Tb(a,e,r,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function ed(e){if(!e[Al]){e[Al]=!0,_g.forEach(function(a){a!=="selectionchange"&&(t1.has(a)||du(a,!1,e),du(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,du("selectionchange",!1,t))}}function Tb(e,t,a,r){switch(Yb(t)){case 2:var i=M1;break;case 8:i=T1;break;default:i=id}a=i.bind(null,t,a,e),i=void 0,!Mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function mu(e,t,a,r,i){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Mg(function(){var p=n,d=vp(a),h=[];e:{var m=Xg.get(e);if(m!==void 0){var b=Cs,w=e;switch(e){case"keypress":if(Ll(a)===0)break e;case"keydown":case"keyup":b=J0;break;case"focusin":w="focus",b=Vc;break;case"focusout":w="blur",b=Vc;break;case"beforeblur":case"afterblur":b=Vc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=Vm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=L0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=W0;break;case jg:case Qg:case Gg:b=Q0;break;case Yg:b=ty;break;case"scroll":case"scrollend":b=B0;break;case"wheel":b=ry;break;case"copy":case"cut":case"paste":b=Y0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=Zm;break;case"toggle":case"beforetoggle":b=ny}var E=(t&4)!==0,U=!E&&(e==="scroll"||e==="scrollend"),f=E?m!==null?m+"Capture":null:m;E=[];for(var u=p,g;u!==null;){var v=u;if(g=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||g===null||f===null||(v=ko(u,f),v!=null&&E.push(Ao(u,v,g))),U)break;u=u.return}0<E.length&&(m=new b(m,w,null,a,d),h.push({event:m,listeners:E}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",m&&a!==Eu&&(w=a.relatedTarget||a.fromElement)&&(Gi(w)||w[bn]))break e;if((b||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,b?(w=a.relatedTarget||a.toElement,b=p,w=w?Gi(w):null,w!==null&&(U=Bo(w),E=w.tag,w!==U||E!==5&&E!==27&&E!==6)&&(w=null)):(b=null,w=p),b!==w)){if(E=Vm,v="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(E=Zm,v="onPointerLeave",f="onPointerEnter",u="pointer"),U=b==null?m:no(b),g=w==null?m:no(w),m=new E(v,u+"leave",b,a,d),m.target=U,m.relatedTarget=g,v=null,Gi(d)===p&&(E=new E(f,u+"enter",w,a,d),E.target=g,E.relatedTarget=U,v=E),U=v,b&&w)t:{for(E=a1,f=b,u=w,g=0,v=f;v;v=E(v))g++;v=0;for(var k=u;k;k=E(k))v++;for(;0<g-v;)f=E(f),g--;for(;0<v-g;)u=E(u),v--;for(;g--;){if(f===u||u!==null&&f===u.alternate){E=f;break t}f=E(f),u=E(u)}E=null}else E=null;b!==null&&jf(h,m,b,E,!1),w!==null&&U!==null&&jf(h,U,w,E,!0)}}e:{if(m=p?no(p):window,b=m.nodeName&&m.nodeName.toLowerCase(),b==="select"||b==="input"&&m.type==="file")var A=Fm;else if(Jm(m))if(Dg)A=gy;else{A=my;var M=dy}else b=m.nodeName,!b||b.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?p&&bp(p.elementType)&&(A=Fm):A=fy;if(A&&(A=A(e,p))){Ug(h,A,a,d);break e}M&&M(e,m,p),e==="focusout"&&p&&m.type==="number"&&p.memoizedProps.value!=null&&qu(m,"number",m.value)}switch(M=p?no(p):window,e){case"focusin":(Jm(M)||M.contentEditable==="true")&&(Vi=M,Tu=p,uo=null);break;case"focusout":uo=Tu=Vi=null;break;case"mousedown":zu=!0;break;case"contextmenu":case"mouseup":case"dragend":zu=!1,tf(h,a,d);break;case"selectionchange":if(by)break;case"keydown":case"keyup":tf(h,a,d)}var z;if(_p)e:{switch(e){case"compositionstart":var G="onCompositionStart";break e;case"compositionend":G="onCompositionEnd";break e;case"compositionupdate":G="onCompositionUpdate";break e}G=void 0}else Xi?Ag(e,a)&&(G="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(G="onCompositionStart");G&&(zg&&a.locale!=="ko"&&(Xi||G!=="onCompositionStart"?G==="onCompositionEnd"&&Xi&&(z=Tg()):(Er=d,wp="value"in Er?Er.value:Er.textContent,Xi=!0)),M=vs(p,G),0<M.length&&(G=new $m(G,e,null,a,d),h.push({event:G,listeners:M}),z?G.data=z:(z=Rg(a),z!==null&&(G.data=z)))),(z=ly?sy(e,a):cy(e,a))&&(G=vs(p,"onBeforeInput"),0<G.length&&(M=new $m("onBeforeInput","beforeinput",null,a,d),h.push({event:M,listeners:G}),M.data=z)),e1(h,e,p,a,d)}Mb(h,t)})}function Ao(e,t,a){return{instance:e,listener:t,currentTarget:a}}function vs(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=ko(e,a),i!=null&&r.unshift(Ao(e,i,n)),i=ko(e,t),i!=null&&r.push(Ao(e,i,n))),e.tag===3)return r;e=e.return}return[]}function a1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jf(e,t,a,r,i){for(var n=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,i?(p=ko(a,n),p!=null&&o.unshift(Ao(a,p,c))):i||(p=ko(a,n),p!=null&&o.push(Ao(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var r1=/\r\n?/g,i1=/\u0000|\uFFFD/g;function Qf(e){return(typeof e=="string"?e:""+e).replace(r1,`
|
|
9
|
+
`).replace(i1,"")}function zb(e,t){return t=Qf(t),Qf(e)===t}function $e(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||sn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&sn(e,""+r);break;case"className":_l(e,"class",r);break;case"tabIndex":_l(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(e,a,r);break;case"style":Eg(e,r,n);break;case"data":if(t!=="object"){_l(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&$e(e,t,"name",i.name,i,null),$e(e,t,"formEncType",i.formEncType,i,null),$e(e,t,"formMethod",i.formMethod,i,null),$e(e,t,"formTarget",i.formTarget,i,null)):($e(e,t,"encType",i.encType,i,null),$e(e,t,"method",i.method,i,null),$e(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Bl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=rr);break;case"onScroll":r!=null&&Ce("scroll",e);break;case"onScrollEnd":r!=null&&Ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=Bl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":Ce("beforetoggle",e),Ce("toggle",e),Dl(e,"popover",r);break;case"xlinkActuate":Pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Pa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Pa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Pa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Pa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Dl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=U0.get(a)||a,Dl(e,a,r))}}function tp(e,t,a,r,i,n){switch(a){case"style":Eg(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(O(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(O(60));e.innerHTML=a}}break;case"children":typeof r=="string"?sn(e,r):(typeof r=="number"||typeof r=="bigint")&&sn(e,""+r);break;case"onScroll":r!=null&&Ce("scroll",e);break;case"onScrollEnd":r!=null&&Ce("scrollend",e);break;case"onClick":r!=null&&(e.onclick=rr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[$t]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Dl(e,a,r)}}}function Tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ce("error",e),Ce("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:$e(e,t,n,o,a,null)}}i&&$e(e,t,"srcSet",a.srcSet,a,null),r&&$e(e,t,"src",a.src,a,null);return;case"input":Ce("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"name":i=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":p=d;break;case"value":n=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(O(137,t));break;default:$e(e,t,r,d,a,null)}}Sg(e,n,l,c,p,o,i,!1);return;case"select":Ce("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:$e(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?Wi(e,!!r,t,!1):a!=null&&Wi(e,!!r,a,!0);return;case"textarea":Ce("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(O(91));break;default:$e(e,t,o,l,a,null)}qg(e,r,i,n);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":$e(e,t,c,r,a,null));return;case"dialog":Ce("beforetoggle",e),Ce("toggle",e),Ce("cancel",e),Ce("close",e);break;case"iframe":case"object":Ce("load",e);break;case"video":case"audio":for(r=0;r<zo.length;r++)Ce(zo[r],e);break;case"image":Ce("error",e),Ce("load",e);break;case"details":Ce("toggle",e);break;case"embed":case"source":case"link":Ce("error",e),Ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:$e(e,t,p,r,a,null)}return;default:if(bp(t)){for(d in a)a.hasOwnProperty(d)&&(r=a[d],r!==void 0&&tp(e,t,d,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&$e(e,t,l,r,a,null))}function n1(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,n=null,o=null,l=null,c=null,p=null,d=null;for(b in a){var h=a[b];if(a.hasOwnProperty(b)&&h!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(b)||$e(e,t,b,null,r,h)}}for(var m in r){var b=r[m];if(h=a[m],r.hasOwnProperty(m)&&(b!=null||h!=null))switch(m){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":d=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(O(137,t));break;default:b!==h&&$e(e,t,m,b,r,h)}}Cu(e,o,l,c,p,d,n,i);return;case"select":b=o=l=m=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||$e(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":m=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&$e(e,t,i,n,r,c)}t=l,a=o,r=b,m!=null?Wi(e,!!a,m,!1):!!r!=!!a&&(t!=null?Wi(e,!!a,t,!0):Wi(e,!!a,a?[]:"",!1));return;case"textarea":b=m=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:$e(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":m=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(O(91));break;default:i!==n&&$e(e,t,o,i,r,n)}Cg(e,m,b);return;case"option":for(var w in a)m=a[w],a.hasOwnProperty(w)&&m!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:$e(e,t,w,null,r,m));for(c in r)m=r[c],b=a[c],r.hasOwnProperty(c)&&m!==b&&(m!=null||b!=null)&&(c==="selected"?e.selected=m&&typeof m!="function"&&typeof m!="symbol":$e(e,t,c,m,r,b));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)m=a[E],a.hasOwnProperty(E)&&m!=null&&!r.hasOwnProperty(E)&&$e(e,t,E,null,r,m);for(p in r)if(m=r[p],b=a[p],r.hasOwnProperty(p)&&m!==b&&(m!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(O(137,t));break;default:$e(e,t,p,m,r,b)}return;default:if(bp(t)){for(var U in a)m=a[U],a.hasOwnProperty(U)&&m!==void 0&&!r.hasOwnProperty(U)&&tp(e,t,U,void 0,r,m);for(d in r)m=r[d],b=a[d],!r.hasOwnProperty(d)||m===b||m===void 0&&b===void 0||tp(e,t,d,m,r,b);return}}for(var f in a)m=a[f],a.hasOwnProperty(f)&&m!=null&&!r.hasOwnProperty(f)&&$e(e,t,f,null,r,m);for(h in r)m=r[h],b=a[h],!r.hasOwnProperty(h)||m===b||m==null&&b==null||$e(e,t,h,m,r,b)}function Gf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&Gf(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var d=c.transferSize,h=c.initiatorType;d&&Gf(h)&&(c=c.responseEnd,o+=d*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ap=null,rp=null;function ws(e){return e.nodeType===9?e:e.ownerDocument}function Yf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ab(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ip(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fu=null;function l1(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var Rb=typeof setTimeout=="function"?setTimeout:void 0,s1=typeof clearTimeout=="function"?clearTimeout:void 0,Xf=typeof Promise=="function"?Promise:void 0,c1=typeof queueMicrotask=="function"?queueMicrotask:typeof Xf<"u"?function(e){return Xf.resolve(null).then(e).catch(u1)}:Rb;function u1(e){setTimeout(function(){throw e})}function $r(e){return e==="head"}function Vf(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),hn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")_o(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,_o(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[jo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&_o(e.ownerDocument.body);a=i}while(a);hn(t)}function $f(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function np(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":np(a),hp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function p1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[jo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=_a(e.nextSibling),e===null)break}return null}function d1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=_a(e.nextSibling),e===null))return null;return e}function Ub(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_a(e.nextSibling),e===null))return null;return e}function op(e){return e.data==="$?"||e.data==="$~"}function lp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function _a(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var sp=null;function Zf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return _a(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Kf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Db(e,t,a){switch(t=ws(a),e){case"html":if(e=t.documentElement,!e)throw Error(O(452));return e;case"head":if(e=t.head,!e)throw Error(O(453));return e;case"body":if(e=t.body,!e)throw Error(O(454));return e;default:throw Error(O(451))}}function _o(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);hp(e)}var xa=new Map,Pf=new Set;function ys(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mr=He.d;He.d={f:f1,r:g1,D:h1,C:b1,L:v1,m:w1,X:_1,S:y1,M:x1};function f1(){var e=mr.f(),t=Os();return e||t}function g1(e){var t=vn(e);t!==null&&t.tag===5&&t.type==="form"?Eh(t):mr.r(e)}var xn=typeof document>"u"?null:document;function Bb(e,t,a){var r=xn;if(r&&typeof t=="string"&&t){var i=ba(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Pf.has(i)||(Pf.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Tt(t,"link",e),Nt(t),r.head.appendChild(t)))}}function h1(e){mr.D(e),Bb("dns-prefetch",e,null)}function b1(e,t){mr.C(e,t),Bb("preconnect",e,t)}function v1(e,t,a){mr.L(e,t,a);var r=xn;if(r&&e&&t){var i='link[rel="preload"][as="'+ba(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ba(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ba(a.imageSizes)+'"]')):i+='[href="'+ba(e)+'"]';var n=i;switch(t){case"style":n=gn(e);break;case"script":n=kn(e)}xa.has(n)||(e=rt({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),xa.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector($o(n))||t==="script"&&r.querySelector(Zo(n))||(t=r.createElement("link"),Tt(t,"link",e),Nt(t),r.head.appendChild(t)))}}function w1(e,t){mr.m(e,t);var a=xn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ba(r)+'"][href="'+ba(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=kn(e)}if(!xa.has(n)&&(e=rt({rel:"modulepreload",href:e},t),xa.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Zo(n)))return}r=a.createElement("link"),Tt(r,"link",e),Nt(r),a.head.appendChild(r)}}}function y1(e,t,a){mr.S(e,t,a);var r=xn;if(r&&e){var i=Ii(r).hoistableStyles,n=gn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector($o(n)))l.loading=5;else{e=rt({rel:"stylesheet",href:e,"data-precedence":t},a),(a=xa.get(n))&&td(e,a);var c=o=r.createElement("link");Nt(c),Tt(c,"link",e),c._p=new Promise(function(p,d){c.onload=p,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,$l(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function _1(e,t){mr.X(e,t);var a=xn;if(a&&e){var r=Ii(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Zo(i)),n||(e=rt({src:e,async:!0},t),(t=xa.get(i))&&ad(e,t),n=a.createElement("script"),Nt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function x1(e,t){mr.M(e,t);var a=xn;if(a&&e){var r=Ii(a).hoistableScripts,i=kn(e),n=r.get(i);n||(n=a.querySelector(Zo(i)),n||(e=rt({src:e,async:!0,type:"module"},t),(t=xa.get(i))&&ad(e,t),n=a.createElement("script"),Nt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function Jf(e,t,a,r){var i=(i=Ar.current)?ys(i):null;if(!i)throw Error(O(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=gn(a.href),a=Ii(i).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=gn(a.href);var n=Ii(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector($o(e)))&&!n._p&&(o.instance=n,o.state.loading=5),xa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},xa.set(e,a),n||k1(i,e,a,o.state))),t&&r===null)throw Error(O(528,""));return o}if(t&&r!==null)throw Error(O(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kn(a),a=Ii(i).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,e))}}function gn(e){return'href="'+ba(e)+'"'}function $o(e){return'link[rel="stylesheet"]['+e+"]"}function Ob(e){return rt({},e,{"data-precedence":e.precedence,precedence:null})}function k1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",a),Nt(t),e.head.appendChild(t))}function kn(e){return'[src="'+ba(e)+'"]'}function Zo(e){return"script[async]"+e}function Ff(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ba(a.href)+'"]');if(r)return t.instance=r,Nt(r),r;var i=rt({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Nt(r),Tt(r,"style",i),$l(r,a.precedence,e),t.instance=r;case"stylesheet":i=gn(a.href);var n=e.querySelector($o(i));if(n)return t.state.loading|=4,t.instance=n,Nt(n),n;r=Ob(a),(i=xa.get(i))&&td(r,i),n=(e.ownerDocument||e).createElement("link"),Nt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),t.state.loading|=4,$l(n,a.precedence,e),t.instance=n;case"script":return n=kn(a.src),(i=e.querySelector(Zo(n)))?(t.instance=i,Nt(i),i):(r=a,(i=xa.get(n))&&(r=rt({},a),ad(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Nt(i),Tt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(O(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,$l(r,a.precedence,e));return t.instance}function $l(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function If(e,t,a){if(Zl===null){var r=new Map,i=Zl=new Map;i.set(a,r)}else i=Zl,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[jo]||n[qt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function Wf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function N1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Lb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function S1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=gn(r.href),n=t.querySelector($o(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_s.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,Nt(n);return}n=t.ownerDocument||t,r=Ob(r),(i=xa.get(i))&&td(r,i),n=n.createElement("link"),Nt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_s.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var gu=0;function C1(e,t){return e.stylesheets&&e.count===0&&Kl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&gu===0&&(gu=62500*o1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>gu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function _s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xs=null;function Kl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xs=new Map,t.forEach(q1,e),xs=null,_s.call(e))}function q1(e,t){if(!(t.state.loading&4)){var a=xs.get(e);if(a)var r=a.get(null);else{a=new Map,xs.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=_s.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ro={$$typeof:ar,Provider:null,Consumer:null,_currentValue:ri,_currentValue2:ri,_threadCount:0};function E1(e,t,a,r,i,n,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qc(0),this.hiddenUpdates=Qc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Hb(e,t,a,r,i,n,o,l,c,p,d,h){return e=new E1(e,t,a,o,c,p,d,h,l),t=1,n===!0&&(t|=24),n=ta(3,null,null,t),e.current=n,n.stateNode=e,t=Ep(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},zp(n),e}function jb(e){return e?(e=Ki,e):Ki}function Qb(e,t,a,r,i,n){i=jb(i),r.context===null?r.context=i:r.pendingContext=i,r=Ur(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Dr(e,r,t),a!==null&&(Vt(a,e,t),mo(a,e,t))}function eg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function rd(e,t){eg(e,t),(e=e.alternate)&&eg(e,t)}function Gb(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Vt(t,e,67108864),rd(e,67108864)}}function tg(e){if(e.tag===13||e.tag===31){var t=oa();t=fp(t);var a=hi(e,t);a!==null&&Vt(a,e,t),rd(e,t)}}var ks=!0;function M1(e,t,a,r){var i=ue.T;ue.T=null;var n=He.p;try{He.p=2,id(e,t,a,r)}finally{He.p=n,ue.T=i}}function T1(e,t,a,r){var i=ue.T;ue.T=null;var n=He.p;try{He.p=8,id(e,t,a,r)}finally{He.p=n,ue.T=i}}function id(e,t,a,r){if(ks){var i=cp(r);if(i===null)mu(e,t,r,Ns,a),ag(e,r);else if(A1(i,e,t,a,r))r.stopPropagation();else if(ag(e,r),t&4&&-1<z1.indexOf(e)){for(;i!==null;){var n=vn(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=ei(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-na(o);l.entanglements[1]|=c,o&=~c}Qa(n),(Le&6)===0&&(ms=ra()+500,Vo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Vt(l,n,2),Os(),rd(n,2)}if(n=cp(r),n===null&&mu(e,t,r,Ns,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else mu(e,t,r,null,a)}}function cp(e){return e=vp(e),nd(e)}var Ns=null;function nd(e){if(Ns=null,e=Gi(e),e!==null){var t=Bo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=sg(t),e!==null)return e;e=null}else if(a===31){if(e=cg(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ns=e,null}function Yb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(v0()){case mg:return 2;case fg:return 8;case Wl:case w0:return 32;case gg:return 268435456;default:return 32}default:return 32}}var up=!1,Lr=null,Hr=null,jr=null,Uo=new Map,Do=new Map,Cr=[],z1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ag(e,t){switch(e){case"focusin":case"focusout":Lr=null;break;case"dragenter":case"dragleave":Hr=null;break;case"mouseover":case"mouseout":jr=null;break;case"pointerover":case"pointerout":Uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(t.pointerId)}}function to(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=vn(t),t!==null&&Gb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function A1(e,t,a,r,i){switch(t){case"focusin":return Lr=to(Lr,e,t,a,r,i),!0;case"dragenter":return Hr=to(Hr,e,t,a,r,i),!0;case"mouseover":return jr=to(jr,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Uo.set(n,to(Uo.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,Do.set(n,to(Do.get(n)||null,e,t,a,r,i)),!0}return!1}function Xb(e){var t=Gi(e.target);if(t!==null){var a=Bo(t);if(a!==null){if(t=a.tag,t===13){if(t=sg(a),t!==null){e.blockedOn=t,Lm(e.priority,function(){tg(a)});return}}else if(t===31){if(t=cg(a),t!==null){e.blockedOn=t,Lm(e.priority,function(){tg(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=cp(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Eu=r,a.target.dispatchEvent(r),Eu=null}else return t=vn(a),t!==null&&Gb(t),e.blockedOn=a,!1;t.shift()}return!0}function rg(e,t,a){Pl(e)&&a.delete(t)}function R1(){up=!1,Lr!==null&&Pl(Lr)&&(Lr=null),Hr!==null&&Pl(Hr)&&(Hr=null),jr!==null&&Pl(jr)&&(jr=null),Uo.forEach(rg),Do.forEach(rg)}function Rl(e,t){e.blockedOn===t&&(e.blockedOn=null,up||(up=!0,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,R1)))}var Ul=null;function ig(e){Ul!==e&&(Ul=e,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,function(){Ul===e&&(Ul=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(nd(r||a)===null)continue;break}var n=vn(a);n!==null&&(e.splice(t,3),t-=3,Xu(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function hn(e){function t(c){return Rl(c,e)}Lr!==null&&Rl(Lr,e),Hr!==null&&Rl(Hr,e),jr!==null&&Rl(jr,e),Uo.forEach(t),Do.forEach(t);for(var a=0;a<Cr.length;a++){var r=Cr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cr.length&&(a=Cr[0],a.blockedOn===null);)Xb(a),a.blockedOn===null&&Cr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[$t]||null;if(typeof n=="function")o||ig(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[$t]||null)l=o.formAction;else if(nd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),ig(a)}}}function Vb(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function od(e){this._internalRoot=e}js.prototype.render=od.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));var a=t.current,r=oa();Qb(a,r,e,t,null,null)};js.prototype.unmount=od.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qb(e.current,2,null,e,null,null),Os(),t[bn]=null}};function js(e){this._internalRoot=e}js.prototype.unstable_scheduleHydration=function(e){if(e){var t=yg();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Cr.length&&t!==0&&t<Cr[a].priority;a++);Cr.splice(a,0,e),a===0&&Xb(e)}};var ng=og.version;if(ng!=="19.2.3")throw Error(O(527,ng,"19.2.3"));He.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=p0(t),e=e!==null?ug(e):null,e=e===null?null:e.stateNode,e};var U1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:ue,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ao=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ao.isDisabled&&ao.supportsFiber))try{Oo=ao.inject(U1),ia=ao}catch{}var ao;Qs.createRoot=function(e,t){if(!lg(e))throw Error(O(299));var a=!1,r="",i=Bh,n=Oh,o=Lh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Hb(e,1,!1,null,null,a,r,null,i,n,o,Vb),e[bn]=t.current,ed(e),new od(t)};Qs.hydrateRoot=function(e,t,a){if(!lg(e))throw Error(O(299));var r=!1,i="",n=Bh,o=Oh,l=Lh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Hb(e,1,!0,t,a??null,r,i,c,n,o,l,Vb),t.context=jb(null),a=t.current,r=oa(),r=fp(r),i=Ur(r),i.callback=null,Dr(a,i,r),a=r,t.current.lanes=a,Ho(t,a),Qa(t),e[bn]=t.current,ed(e),new js(t)};Qs.version="19.2.3"});var Pb=Ua((fx,Kb)=>{"use strict";function Zb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zb)}catch(e){console.error(e)}}Zb(),Kb.exports=$b()});var jv=Ua(Vs=>{"use strict";var G1=Symbol.for("react.transitional.element"),Y1=Symbol.for("react.fragment");function Hv(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:G1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Vs.Fragment=Y1;Vs.jsx=Hv;Vs.jsxs=Hv});var re=Ua((Qk,Qv)=>{"use strict";Qv.exports=jv()});var Rw=V(Pb());var Jb=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
|
|
10
10
|
the host page. Start new selectors with :where(.app-wrapper), which scopes without
|
|
11
11
|
adding specificity, or with .app-wrapper for rules on the root itself. */
|
|
12
12
|
|
|
@@ -1133,11 +1133,18 @@ Error generating stack: `+r.message+`
|
|
|
1133
1133
|
:where(.app-wrapper) .basket-sidebar-row {
|
|
1134
1134
|
display: flex;
|
|
1135
1135
|
justify-content: space-between;
|
|
1136
|
+
align-items: baseline;
|
|
1137
|
+
/* A long label in the narrow sidebar wraps rather than running into the amount. */
|
|
1138
|
+
gap: 12px;
|
|
1136
1139
|
padding: 7px 0;
|
|
1137
1140
|
font-size: 14px;
|
|
1138
1141
|
color: var(--text-mid);
|
|
1139
1142
|
}
|
|
1140
1143
|
|
|
1144
|
+
:where(.app-wrapper) .basket-sidebar-row > :last-child {
|
|
1145
|
+
white-space: nowrap;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1141
1148
|
:where(.app-wrapper) .basket-sidebar-row--total {
|
|
1142
1149
|
border-top: 1px solid var(--border);
|
|
1143
1150
|
margin-top: 6px;
|
|
@@ -6770,11 +6777,11 @@ Error generating stack: `+r.message+`
|
|
|
6770
6777
|
width: 100%;
|
|
6771
6778
|
height: 100%;
|
|
6772
6779
|
}
|
|
6773
|
-
`;var Ye=
|
|
6774
|
-
`).map(t=>t.trim()).filter(Boolean);function
|
|
6775
|
-
`).filter(
|
|
6780
|
+
`;var Ye=V(Ve());var Gs={};function Fb(e){Gs={...e,client:e.client?.trim().toUpperCase()||void 0}}function Ra(){return Gs}function ld(){return!!Gs.apiBaseUrl}var B1=e=>e.replace(/\/$/,"");function Lt(e){let t=Gs.apiBaseUrl;return t?`${B1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Nn=V(Ve());var O1="metron:step",L1="metron_step",Ko=(0,Nn.createContext)(()=>{}),Sn=()=>(0,Nn.useContext)(Ko);function Ys(e,t){return(0,Nn.useCallback)((a,r={})=>{let i=Ra(),n=i.analytics??"all";if(n==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(O1,{detail:o,bubbles:!0,composed:!0})),i.onEvent?.(o);let l=window.dataLayer;n==="all"&&Array.isArray(l)&&l.push({event:L1,...o})},[e,t])}var Ib="boq-session-id",Wb="x-boq-session";function ev(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(Ib);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Ib,e)),e}catch{return crypto.randomUUID()}}var H1="x-boq-client";function Xs(){return Ra().client}function Ga(){let{client:e,apiKey:t}=Ra();return ld()?t?{Authorization:`Bearer ${t}`}:{}:e?{[H1]:e}:{}}function vi(){return{...ld()?{}:{[Wb]:ev()},...Ga()}}function j1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Kt(e){return j1(await e.json().catch(()=>({})))}var tv=9e4;async function av(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),tv),i;try{i=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${tv/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let n=await Kt(i);if(!i.ok||n?.error){let o=n;throw new Error(o.detail??o.message??o.error??`Server error ${i.status}`)}return n}function rv(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),av(Lt("/api/schedule"),{method:"POST",body:r,headers:vi()})}function iv(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return av(Lt(`/api/schedule/${e}${a}`),{headers:Ga()})}function nv(e,t,a,r){let i=!1,n=null,o=performance.now();return{promise:new Promise((p,d)=>{let h=async()=>{if(!i)try{let m=await e();if(i)return;if(m.status==="completed"||m.status==="failed"){console.log(`[pollJob:${r??"job"}] ${m.status} (${Math.round(performance.now()-o)}ms)`),p(m);return}a?.(),n=setTimeout(h,t)}catch(m){i||d(m)}};n=setTimeout(h,t)}),cancel:()=>{i=!0,n&&(clearTimeout(n),n=null)}}}var ca=V(Ve());var ov=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var lv=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var sv=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var cv=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var uv=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var pv=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var dv=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var mv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var fv=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var gv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var hv=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var bv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var vv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var wv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var yv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var _v=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var xv=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var kv=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Nv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var Sv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Cv=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var qv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var Ev=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Mv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Tv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var zv=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var Av=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var Rv=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var Uv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Dv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var Bv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var Ov=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Lv=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Re=e=>typeof e=="string"?e:e.src,Q1={"/decking/boards/diagonal.webp":Re(ov),"/decking/boards/no-border.webp":Re(lv),"/decking/boards/picture-frame.webp":Re(sv),"/decking/boards/straight.webp":Re(cv),"/fencing/gates/no-gate.webp":Re(uv),"/fencing/gates/single-gate.webp":Re(pv),"/fencing/gravel-board.webp":Re(dv),"/fencing/height/0.9.webp":Re(mv),"/fencing/height/1.2.webp":Re(fv),"/fencing/height/1.5.webp":Re(gv),"/fencing/height/1.8.webp":Re(hv),"/fencing/no-gravel-board.webp":Re(bv),"/quick-order/paste-list.webp":Re(vv),"/quick-order/photo-list.webp":Re(wv),"/quick-order/upload-file.webp":Re(yv),"/schedule-products/building-sand.webp":Re(_v),"/schedule-products/drywall-screws.webp":Re(xv),"/schedule-products/loft-insulation-roll.webp":Re(kv),"/schedule-products/red-multi-stock-bricks.webp":Re(Nv),"/schedule-products/scrim-tape.webp":Re(Sv),"/schedule-products/wall-ties.webp":Re(Cv),"/tool-images/architrave.webp":Re(qv),"/tool-images/brick-block.webp":Re(Ev),"/tool-images/concrete-aggregate.webp":Re(Mv),"/tool-images/decking.webp":Re(Tv),"/tool-images/fencing.webp":Re(zv),"/tool-images/insulation.webp":Re(Av),"/tool-images/paint.webp":Re(Rv),"/tool-images/paving.webp":Re(Uv),"/tool-images/plasterboard.webp":Re(Dv),"/tool-images/skirting.webp":Re(Bv),"/tool-images/timber.webp":Re(Ov),"/tool-images/truss.webp":Re(Lv)};function Pt(e){return Q1[e]??e}var sd=V(re());function Ht(){return(0,sd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,sd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var cd=V(re());function Po(){return(0,cd.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,cd.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var Cn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var Yv=(e,t)=>Cn[t].some(a=>e.toLowerCase().endsWith(a)),qn=e=>e.type.startsWith("image/")||Yv(e.name,"photo"),X1=e=>qn(e)||Yv(e.name,"schedule"),Gv=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function ud(e,t=5242880){return X1(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${Gv(e.size)} - the limit is ${Gv(t)}.`:null:`Please upload a list or image file (${[...Cn.schedule,...Cn.photo].join(", ")}).`}var V1=e=>e.split(`
|
|
6781
|
+
`).map(t=>t.trim()).filter(Boolean);function Xv(e){let t=V1(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function Vv(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let i=r.getContext("2d");if(!i)return e;i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),i.drawImage(t,0,0,r.width,r.height),t.close();let n=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!n||n.size>=e.size?e:new File([n],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var Zr=V(Ve());var Zs=V(Ve()),$s=V(re()),$1=[4,5,4],pd=4e3;function fr(){let[e,t]=(0,Zs.useState)(0);(0,Zs.useEffect)(()=>{let r=setInterval(()=>t(i=>i+1),pd);return()=>clearInterval(r)},[]);let a=0;return(0,$s.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:$1.map((r,i)=>(0,$s.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(n,o)=>(0,$s.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},i))},e)}var Jo=V(re()),Ks=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function $v(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function Zv(){let e=(0,Zr.useRef)($v(Ks.map((o,l)=>l))),t=(0,Zr.useRef)(0),[a,r]=(0,Zr.useState)(Ks[e.current[0]]),[i,n]=(0,Zr.useState)(!0);return(0,Zr.useEffect)(()=>{let o=setInterval(()=>{n(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=$v(Ks.map((l,c)=>c)),t.current=0),r(Ks[e.current[t.current]]),n(!0)},600)},pd);return()=>clearInterval(o)},[]),(0,Jo.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Jo.jsx)(fr,{}),(0,Jo.jsx)("p",{className:`banter-message${i?" is-visible":""}`,children:a})]})}var Ps=V(Ve());function Fo(e,t){let a=(0,Ps.useRef)(t);a.current=t,(0,Ps.useEffect)(()=>{if(!e)return;let r=i=>{i.key!=="Escape"||i.defaultPrevented||i.isComposing||(i.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var F=V(re()),Z1=[...Cn.schedule,...Cn.photo].join(","),K1={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]};function dd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a}){let[r,i]=(0,ca.useState)(null),n=Sn(),[o,l]=(0,ca.useState)(""),[c,p]=(0,ca.useState)(null),[d,h]=(0,ca.useState)(""),[m,b]=(0,ca.useState)(!1),[w,E]=(0,ca.useState)(!1),[U,f]=(0,ca.useState)(null),u=(0,ca.useRef)(0),g=(0,ca.useRef)(null),v=o.split(`
|
|
6782
|
+
`).filter(Y=>Y.trim()).length,k=Xv(o),A=r==="paste"?!!o:!!c;(0,ca.useEffect)(()=>{if(!c||!qn(c)){f(null);return}let Y=URL.createObjectURL(c);return f(Y),()=>URL.revokeObjectURL(Y)},[c]);let M=Y=>{n("method_selected",{method:Y}),i(Y),a(null)},z=()=>{i(null),a(null)};Fo(!!r&&!m,z);let G=Y=>{if(!Y?.length)return;if(Y.length>1)return h("Please choose one file at a time.");let ce=Y[0],ye=ud(ce,qn(ce)?1/0:void 0);if(ye)return h(ye);h(""),p(ce)},P=async Y=>{b(!0);try{await Y()}finally{b(!1)}},ge=async Y=>{try{let ce=await Vv(Y),ye=ud(ce);if(ye)throw new Error(ye);let ut=new FormData;ut.append("file",ce);let ve=await fetch(Lt("/api/schedule/extract-photo"),{method:"POST",body:ut,headers:Ga()}),Be=await Kt(ve);if(!ve.ok)throw new Error(Be?.error||Be?.message||"Failed to extract line items from image");let je=typeof Be?.text=="string"?Be.text.trim():"";if(!je)throw new Error("No line items were extracted from this image.");let Me=Array.isArray(Be?.lines)?Be.lines.filter(W=>!!(W&&typeof W=="object"&&typeof W.text=="string")):void 0;await e(je,Me,!1)}catch(ce){n("error",{stage:"photo"}),h(ce?.message||"Failed to extract line items from image")}},Ae=()=>{if(c)return n("list_submitted",{method:qn(c)?"photo":"upload"}),P(()=>qn(c)?ge(c):t(c))},De=Y=>Y.dataTransfer.types.includes("Files"),Pe=Y=>{De(Y)&&(Y.preventDefault(),u.current+=1,E(!0))},ze=Y=>{De(Y)&&(u.current-=1,u.current<=0&&(u.current=0,E(!1)))},me=Y=>{De(Y)&&(Y.preventDefault(),u.current=0,E(!1),G(Y.dataTransfer.files),M("upload"))};return(0,F.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:Pe,onDragOver:Y=>De(Y)&&Y.preventDefault(),onDragLeave:ze,onDrop:me,children:[w&&(0,F.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,F.jsxs)("div",{className:"quick-order-card",children:[(0,F.jsxs)("div",{className:"quick-order-alt",children:[(0,F.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,F.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,F.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,F.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,F.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${r==="paste"?" entry-option-card--active":""}`,onClick:()=>M("paste"),children:[(0,F.jsxs)("span",{className:"entry-option-content",children:[(0,F.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,F.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,F.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,F.jsx)("img",{className:"fill-img",src:Pt("/quick-order/paste-list.webp"),alt:""})})]}),(0,F.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${r==="upload"?" entry-option-card--active":""}`,onClick:()=>M("upload"),children:[(0,F.jsxs)("span",{className:"entry-option-content",children:[(0,F.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,F.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,F.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,F.jsx)("img",{className:"fill-img",src:Pt("/quick-order/photo-list.webp"),alt:""})})]})]})]}),r&&(0,F.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!A&&z(),children:(0,F.jsxs)("section",{className:`quick-order-workflow-modal${m?" quick-order-workflow-modal--matching":""}`,onClick:Y=>Y.stopPropagation(),children:[(0,F.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,F.jsx)("h2",{id:"quick-order-workflow-title",children:r==="paste"?"Type or paste a list":"Upload a file"}),(0,F.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:z,"aria-label":"Close",children:(0,F.jsx)(Po,{})})]}),(0,F.jsxs)("div",{className:"quick-order-panel",children:[(0,F.jsxs)("div",{className:"quick-order-body","aria-hidden":m,children:[(0,F.jsx)("div",{className:"quick-order-body-main",children:r==="paste"?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
|
|
6776
6783
|
insulated plasterboard 50mm
|
|
6777
|
-
C24 timber 4.8m`,value:o,onChange:
|
|
6784
|
+
C24 timber 4.8m`,value:o,onChange:Y=>l(Y.target.value),"aria-label":"Paste schedule line items"}),k&&(0,F.jsxs)("div",{className:"error-box",role:"alert",children:[(0,F.jsx)("strong",{children:"Error:"})," ",k]}),(0,F.jsxs)("div",{className:"quick-order-hint",children:[(0,F.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,F.jsx)("div",{className:"quick-order-actions",children:(0,F.jsxs)("button",{type:"button",className:"cta-btn",disabled:!v||!!k,onClick:()=>{n("list_submitted",{method:"paste",lines:v}),P(()=>e(o))},"aria-label":"Match pasted lines",children:[(0,F.jsx)("span",{children:"Match line items"}),(0,F.jsx)("span",{className:"arrow",children:(0,F.jsx)(Ht,{})})]})})]}):(0,F.jsxs)(F.Fragment,{children:[d&&(0,F.jsxs)("div",{className:"error-box",role:"alert",children:[(0,F.jsx)("strong",{children:"Error:"})," ",d]}),(0,F.jsxs)("div",{className:`upload-zone${c?" has-file":""}`,onClick:()=>g.current?.click(),onDragOver:Y=>Y.preventDefault(),onDrop:me,role:"button",tabIndex:0,onKeyDown:Y=>(Y.key==="Enter"||Y.key===" ")&&g.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[U?(0,F.jsx)("img",{src:U,alt:c?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,F.jsx)("div",{className:"upload-zone-icon",children:(0,F.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,F.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,F.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"upload-zone-subtext",children:c.name}),(0,F.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:Y=>{Y.stopPropagation(),p(null),h(""),g.current&&(g.current.value="")},children:"Remove"})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,F.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,F.jsx)("input",{ref:g,type:"file",accept:Z1,className:"visually-hidden",onChange:Y=>G(Y.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,F.jsx)("div",{className:"quick-order-actions",children:(0,F.jsxs)("button",{type:"button",className:"cta-btn",disabled:!c,onClick:()=>{Ae()},"aria-label":"Match uploaded items",children:[(0,F.jsx)("span",{children:"Match items"}),(0,F.jsx)("span",{className:"arrow",children:(0,F.jsx)(Ht,{})})]})})]})}),(0,F.jsx)("aside",{className:"quick-order-sidebar",children:K1[r].map((Y,ce)=>(0,F.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,F.jsx)("span",{className:"quick-order-step-dot",children:ce+1}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"quick-order-step-title",children:Y.title}),(0,F.jsx)("div",{className:"quick-order-step-desc",children:Y.desc})]})]},Y.title))})]}),m&&(0,F.jsx)("div",{className:"quick-order-matching-overlay",children:(0,F.jsx)(Zv,{})})]})]})})]})]})}var Ne=V(Ve());var md=V(re());function Kr(){return(0,md.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,md.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var wi=V(re());function fd(){return(0,wi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,wi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,wi.jsx)("path",{d:"M21 3v5h-5"}),(0,wi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,wi.jsx)("path",{d:"M3 21v-5h5"})]})}var Io=V(re());function gd({unit:e}){return(0,Io.jsx)(Io.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,Io.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Kv=V(re());function P1(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function ka(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?P1(r,t):r}function Na(e,t){let a=ka(e,t);return a?(0,Kv.jsx)(gd,{unit:a}):null}function Wo(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=ka(a[1]);return r?`per ${r}`:""}function yi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function ot(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Pv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var J1=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}],F1=[{match:["mortar"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Blue+Circle+Quality+Assured+Mortar+Mix+-+Photo.jpg"},{match:["mot type 1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/MOT+-+Photo+1.jpg"},{match:["soft sand","building sand"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Soft+Building+Sand+-+Photo+1.jpg"},{match:["cement"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/blue+circle+general+cement+bagged.jpg"},{match:["brick"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/class+B+engineering+brick+smooth+red+perforated+65mm+-+Photo+1+comp.jpg"},{match:["dense block","concrete block"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+solid+dense+concrete+block+-+Photo+1+-+1920+comp.jpg"},{match:["metal c stud","c stud"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/70mm+c+stud+angle.jpg"},{match:["timber","carcassing","sawn","c24","c16"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/47mm+x+100mm+sawn+treated+c16+-+Photo+1+1920.jpg"},{match:["osb"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/18mm+structural+OSB+-+Photo+1+comp.jpg"},{match:["dpc"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/225mm+damp+proof+course.jpg"},{match:["soil pipe","soil bend","underground","drainage"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/110mm+Soil+Pipe+Single+Socket+Black+3m+-+High+Res.jpg"},{match:["nail"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/galvanised+round+wire+nail+vertical.jpg"},{match:["retaining clip","retaining clips","insulation disc","insulation disks"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/multiple+zinc+insulation+discs.jpg"},{match:["wall tie"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Type+4+Wall+Ties+-+Photo.jpg"},{match:["loft insulation","loft roll","insulation roll"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/200mm+knauf+loft+roll+44+unwrapping.jpg"},{match:["pir insulation","insulation board","celotex","unilin","indiboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/100mm+celotex+sheet+logo.jpg"},{match:["plasterboard","wallboard"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/12.5mm+wallboard+tapered+edge+corner.jpg"},{match:["drywall screw"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/close+up+drywall+course+thread.jpg"},{match:["scrim","jointing tape","paper tape"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/50mm+scrim+tape.jpg"},{match:["adhesive","high grab","evostik","stixall","gripfill","sealant","ct1"],url:"https://res.cloudinary.com/materials-market/image/upload/c_fill,w_750/assets/product-images-final/Instant+Nails+Solvent+Free+Grab+Adhesive+White+290ml+-+Photo.jpg"}];function Ya(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),i=F1.find(o=>o.match.some(l=>r.includes(l)));if(i)return i.url;let n=J1.find(o=>o.match.some(l=>r.includes(l)));return n?Pt(n.path):r.includes("insulation")?Pv(`
|
|
6778
6785
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
|
|
6779
6786
|
<rect width="640" height="420" fill="#fbf1cf"/>
|
|
6780
6787
|
<rect x="88" y="78" width="432" height="264" rx="16" fill="#f0c43f"/>
|
|
@@ -6785,7 +6792,7 @@ C24 timber 4.8m`,value:o,onChange:G=>l(G.target.value),"aria-label":"Paste sched
|
|
|
6785
6792
|
<line x1="140" y1="240" x2="468" y2="240"/>
|
|
6786
6793
|
</g>
|
|
6787
6794
|
</svg>
|
|
6788
|
-
`):
|
|
6795
|
+
`):Pv(`
|
|
6789
6796
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
|
|
6790
6797
|
<rect width="640" height="420" fill="#edf1f5"/>
|
|
6791
6798
|
<rect x="132" y="108" width="376" height="204" rx="18" fill="#d5dde6"/>
|
|
@@ -6793,9 +6800,9 @@ C24 timber 4.8m`,value:o,onChange:G=>l(G.target.value),"aria-label":"Paste sched
|
|
|
6793
6800
|
<rect x="168" y="188" width="250" height="24" rx="12" fill="#aab5c0"/>
|
|
6794
6801
|
<rect x="168" y="232" width="220" height="24" rx="12" fill="#aab5c0"/>
|
|
6795
6802
|
</svg>
|
|
6796
|
-
`)}function Pr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var Wv=e=>(e??"").trim().toLowerCase(),F1={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Kv=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),Pv=new Set(["box","bag","pack","pallet","roll","set","tub"]),Jv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Fv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,_i=e=>{let t=Wv(e);return F1[t]??t},ct=(e,t)=>{let a=_i(e),r=_i(t);return a.length>0&&a===r},I1=(e,t)=>{let a=Wv(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},W1=e=>(e??"").split(",").map(t=>_i(t)).filter(Boolean),e_=(e,t)=>{let a=W1(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||ct(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||ct(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||ct(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Iv=(e,t)=>ct(t,"pallet")?e.itemsPerPallet??null:ct(t,"pack")?e.itemsPerPack??null:ct(t,"box")?e.itemsPerBox??null:null,t_=(e,t,a)=>{if(!ct(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!ct(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function Js(e,t){return e.reduce((a,r)=>a+(Ut(r,t).lineTotal??0),0)}function Ut(e,t){let a=e.qty,r=_i(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=_i(e.unit)||(a>0&&Kv.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?e.sellUnitsOverride??null:null,p=v=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${r}.`:v,costingMode:"review"});if(!e_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let d=null,h="review",m=e.roundingRule,b=`Quantity review required, initial request needed ${a} ${i}.`,w=1+o,E=t_(e,i,r),U=e.unitConversions?.find(v=>ct(v.requestUom,i));if(!!e.saleUnit&&(ct(i,r)||!!U||ct(i,"each")&&!Pv.has(r)))if(ct(i,r))d=a*w/n,h="direct",b=`${a} ${i}${o>0?` x ${w}`:""}`;else if(U){d=a*w/U.quantityPerSaleUnit,h="derived";let v=1/U.quantityPerSaleUnit,k=Math.round(v);b=ct(r,"each")&&U.quantityPerSaleUnit<1&&Math.abs(v-k)<1e-9?`${a} ${i}${o>0?` x ${w}`:""} x ${k} per ${i}`:`${a} ${i}${o>0?` x ${w}`:""} / ${U.quantityPerSaleUnit} ${i} per ${r}`}else ct(i,"each")&&!Pv.has(r)&&(d=a*w/n,h="derived",b=`${a} ${r}${o>0?` x ${w}`:""}`);else if(ct(i,r)&&n>0)d=a*w/n,h="direct",b=o>0?`${a} ${i} x ${w} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(ct(i,"each")&&n>0&&Kv.has(r))d=a*w/n,h="derived",b=o>0?`${a} each x ${w} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(Iv(e,i)!=null&&n>0){let v=Iv(e,i)??0;d=a*v*w/n,h="derived";let k=`${a} ${i} x ${v} each${o>0?` x ${w}`:""}`;b=n===1&&ct(r,"each")?k:`${k} / ${n} each per ${r}`}else if(E!=null)d=a*w/E,h="derived",m??(m="round_up_each"),b=`${a} m2 x ${w} / ${E} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(d=a*w/n,h="derived",b=`${a} ${i}${o>0?` x ${w}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;ct(i,"m2")&&v!=null&&v>0&&(d=a*w/v,h="derived",b=`${a} m2 x ${w} / ${v} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;ct(i,"m2")&&v!=null&&v>0?(d=a/v,h="derived",b=`${a} m2 / ${v} m2 per sell unit`):ct(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(d=a*e.itemsPerM2*w/n,h="derived",b=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${w} / ${n}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;ct(i,"m")&&v!=null&&v>0&&(d=a*w/v,h="derived",b=`${a} m x ${w} / ${v} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let v=Jv(a,i),k=Jv(e.coverageQty??0,_i(e.coverageUom));v!=null&&k!=null&&k>0&&(d=v*w/k,h="derived",b=`${a} ${i} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"){let v=Fv(a,i),k=Fv(e.coverageQty??0,_i(e.coverageUom));v!=null&&k!=null&&k>0&&(d=v*w/k,h="derived",b=`${a} ${i} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;ct(i,"m3")&&v!=null&&v>0&&(d=a/v,h="derived",b=`${a} m3 / ${v} m3 per ${r}`)}}if(d==null||!Number.isFinite(d)||d<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let u=I1(d,m),g=l?e.sellUnitsOverride??null:u;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:u,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${b} = ${u} ${r} (manually set to ${g})`:`${b} = ${g} ${r}`,costingMode:h}}var ew=()=>import("./xlsx-K4MOA2QM.js"),tl=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],a_=tl.indexOf("Line total");function r_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function tw(e){let t=await ew(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[tl],n=0;for(let c of e){let{item:p,best:d,qty:h,band:m,unmatchable:b,decision:w}=c,E=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),U=!b&&d?.price!=null?d.price*h:null;U!=null&&(n+=U),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",E,h,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",b?"-":d?.product_id??w?.selected_candidate_id??"-",b?"-":d?.description??"-",b?"-":d?.price_basis??"-",b?null:d?.price??null,U,b?"-":m,r_(c)])}i.push(Array(tl.length).fill(null));let o=Array(tl.length).fill(null);o[0]="Estimated total",o[a_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(tl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var el=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function aw(e,t){let a=await ew(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],el]:[el],o=0;for(let p of e){let d=Ut(p),h=d.lineTotal;h!=null&&(o+=h),n.push([p.productId,p.description,d.costingMode,d.requestedAmount,ka(d.requestedUnit),d.salesUnitSize,ka(d.sellUnit),d.requiredSellUnits,d.unitPrice,h])}n.push(Array(el.length).fill(null));let l=Array(el.length).fill(null);l[0]="Estimated total",l[el.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var s=X(re()),bd="__none__",al=24,i_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function ow(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var n_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function o_(e,t){if(t!==bd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function rw(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function l_(e){return e?e.replace(/_/g," "):"not stated"}function s_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Mn(e,t){if(e==null)return"-";let a=Wo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function vd(e){return e&&e.length>0?e.join(" x "):"-"}function c_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function En(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Jr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}var iw=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function u_(e){let t=new Map;return[...new Set(e.filter(gr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:iw[i%iw.length]})}),t}function gr(e){return!1}function Tn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function hd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function p_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let i=new Map(e.map(o=>[o.product_id,o])),n=r.map(o=>i.get(o)).filter(o=>o!=null);if(a&&!n.some(o=>o.product_id===a)){let o=i.get(a);o&&n.unshift(o)}return[...new Map(n.map(o=>[o.product_id,o])).values()].slice(0,5)}function Fs(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function Is(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function d_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Is(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Is(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Is(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Is(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function m_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:vd(r.measurements_mm)}),(0,s.jsx)("td",{children:Wo(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function nw({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",En(e.procurement_aliases)],["Retrieval queries",En(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",vd(e.attrs.measurements_mm)],["Stock length",c_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",En(e.installation_clues)],["System clues",En(e.system_clues)],["Component requirements",En(e.component_requirements)],["Linked group",Tn(e)||"-"],["Flags",En(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function f_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function g_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function h_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:i=!1,linkedGroupMeta:n}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;return i?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),gr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Tn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(nw,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nw,{item:e,result:a}),r&&(0,s.jsx)(f_,{item:e}),r&&(0,s.jsx)(g_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),gr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Tn(e)]}):null]}),r&&(0,s.jsx)(m_,{queries:a?.retrieval_debug??[]})]})}function b_({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:d=!1,debugEnabled:h=!1,forceReviewNote:m=!1,linkedGroupMeta:b}){let w=d||o==="detailed",E=h&&o==="detailed",U=w||m?(0,s.jsx)(h_,{item:e,decision:r,result:a,showRetrievalDebug:E,reviewOnly:m&&!w,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||d||o==="detailed"?t:p_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,g)=>{let v=u.product_id===n;return(0,s.jsxs)("tr",{className:v?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:vd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Mn(u.price,u.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(s_,{band:ow(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function wd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:d=!1}){let h=!d&&Vs()==="QZA6-MRA4",m=h?"quote":"basket",{results:b,lineItems:w,parseReport:E,timings:U}=e,[f,u]=(0,Ne.useState)({}),g=Sn(),[v,k]=(0,Ne.useState)({}),[A,M]=(0,Ne.useState)({}),[z,Y]=(0,Ne.useState)(""),[P,ge]=(0,Ne.useState)(null),[Ae,De]=(0,Ne.useState)(1),Pe=Ra().debug===!0,[ze,me]=(0,Ne.useState)("simple"),[G,ce]=(0,Ne.useState)(d?"list":"tile"),[ye,ut]=(0,Ne.useState)(!1),[ve,Be]=(0,Ne.useState)(null),[je,Me]=(0,Ne.useState)(""),[W,_e]=(0,Ne.useState)([]),[Oe,Se]=(0,Ne.useState)(!1),[Je,_t]=(0,Ne.useState)(null),[C,B]=(0,Ne.useState)(!1),[T,D]=(0,Ne.useState)(null),ee=(0,Ne.useRef)(null),[xe,we]=(0,Ne.useState)(new Set),[_,j]=(0,Ne.useState)(new Set),[L,ne]=(0,Ne.useState)(!1);(0,Ne.useEffect)(()=>{De(1)},[z,P,G]);let te=new Map(b.map(x=>[x.line_id,x])),S=u_(w),V=w.map(x=>{let H=te.get(x.line_id),he=H?.decision,mt=n_(x),Fe=f[x.line_id],It=o_(H,Fe),Ti=a[x.line_id],Qw=Fe===bd?void 0:v[x.line_id]??(Ti&&Ti.productId!==It?.product_id?rw(Ti):It),am=mt?void 0:Qw,Gw=x.qty??0;return{item:x,result:H,decision:he,unmatchable:mt,best:am,qty:Gw,band:ow(am?.scores?.overall)}}),K=Js(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),pe=0;for(let x of V){if(x.unmatchable||x.decision?.include_in_quote!==!0||!x.best)continue;let H=a[x.item.line_id];(!H||Ut(H).lineTotal==null)&&(pe+=1)}pe>0&&(K=null);let ke=x=>!x.unmatchable&&!x.best&&x.decision?.technical_classification!=="no_suitable_candidate"&&Fs(x.result).length>0,We=x=>x.best??Fs(x.result)[0],ua=V.filter(x=>!x.unmatchable&&!x.best).filter(x=>!_.has(x.item.line_id)),cl=V.filter(x=>_.has(x.item.line_id)),pa=V;if(z.trim()){let x=z.trim().toLowerCase();pa=pa.filter(H=>H.item.description_original?.toLowerCase().includes(x)||We(H)?.description?.toLowerCase().includes(x))}if(P){let x=P==="asc"?1:-1;pa=[...pa].sort((H,he)=>x*(H.item.description_original||"").localeCompare(he.item.description_original||""))}let jn=Math.max(1,Math.ceil(pa.length/al)),Ft=Math.min(Ae,jn),vr=pa.slice((Ft-1)*al,Ft*al),$a=vr.filter(x=>!x.unmatchable&&x.best),Zd=vr.filter(x=>ke(x)),Qn=vr.filter(x=>!x.unmatchable&&(x.best||ke(x))),Kd=vr.filter(x=>x.unmatchable||!x.best&&!ke(x)),J=ve?V.find(x=>x.item.line_id===ve)??null:null,Uw=!d&&!c&&!J&&ua.length>0,Gn=(0,Ne.useRef)(null),Yn=()=>{let x=ee.current;if(!x)return;let{top:H,left:he,width:mt,height:Fe}=x.getBoundingClientRect(),Ti=x.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;D({top:H,left:he,width:Ti?Ti-he:mt,height:Fe})};(0,Ne.useEffect)(()=>(window.addEventListener("scroll",Yn,!0),window.addEventListener("resize",Yn),()=>{window.removeEventListener("scroll",Yn,!0),window.removeEventListener("resize",Yn)})),(0,Ne.useEffect)(()=>{let x=H=>{Gn.current&&!H.composedPath().includes(Gn.current)&&Gn.current.removeAttribute("open")};return document.addEventListener("click",x),()=>document.removeEventListener("click",x)},[]);let qi=x=>{Be(x),Me("")},Dw=()=>{if(!ve)return;let x=a[ve];if(x){u(H=>({...H,[ve]:x.productId})),k(H=>({...H,[ve]:rw(x)}));return}u(H=>{let he={...H};return delete he[ve],he}),k(H=>{let he={...H};return delete he[ve],he})},Za=(x=!1)=>{let H=ve?a[ve]:void 0;!x&&H&&J?.best&&H.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(x||Dw(),Be(null),ne(!1))};Fo(C,()=>B(!1)),Fo(!!J&&!C,()=>Za());let Bw=x=>{if(we(H=>new Set(H).add(x)),ua.some(H=>H.item.line_id!==x)){Za(!0);return}p(),Za(!0)},Ow=x=>{if(wc(x),j(H=>new Set(H).add(x)),ua.some(H=>H.item.line_id!==x)){Za(!0);return}p(),Za(!0)},Lw=()=>{j(x=>new Set([...x,...ua.map(H=>H.item.line_id)])),p()},Pd=()=>{J?.best&&(Fd(J.item.line_id,J.best),r(Ei(J)),L?Bw(J.item.line_id):Za(!0))},Jd=Kd.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:Kd.map(x=>{let{item:H,qty:he}=x;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>qi(H.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Jr(H,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},H.line_id)})})]}):null,wc=x=>{u(H=>({...H,[x]:bd})),k(H=>({...H,[x]:void 0})),M(H=>({...H,[x]:void 0})),i(x)},yc=(x,H)=>{u(he=>({...he,[x]:H.product_id})),k(he=>({...he,[x]:H}))},Fd=(x,H)=>{H.method==="catalogue_search"&&M(he=>({...he,[x]:H}))};function nx(){g("downloaded",{type:"schedule",lines:V.length}),tw(V.map(({item:x,best:H,qty:he,band:mt,unmatchable:Fe,decision:It})=>({item:x,best:H,qty:he,band:mt,unmatchable:Fe,decision:It})))}function Ei(x){let H=x.best??Fs(x.result)[0];return Pr(H,{lineId:x.item.line_id,description:x.item.description_original,unit:x.item.unit,qty:x.qty,linkedContext:x.item.linked_group_role==="dependent"&&x.item.linked_group_id?w.filter(he=>he.linked_group_id===x.item.linked_group_id&&he.linked_group_role==="anchor").slice(0,1).map(he=>{let mt=a[he.line_id];return{line_id:he.line_id,product_id:mt?.productId??null,measurements_mm:mt?.measurementsMm??he.attrs.measurements_mm,description:mt?.description??he.description_original,qty:he.qty,unit:he.unit,role:"anchor"}}):void 0})}(0,Ne.useEffect)(()=>{if(!o){for(let x of V)!x.unmatchable&&x.best&&r(Ei(x));l()}},[o]),(0,Ne.useEffect)(()=>{for(let x of V)!a[x.item.line_id]&&!x.unmatchable&&x.best&&r(Ei(x))},[e]),(0,Ne.useEffect)(()=>{if(!ve){_e([]),_t(null),Se(!1);return}let x=je.trim();if(!x){_e([]),_t(null),Se(!1);return}let H=!1,he=window.setTimeout(async()=>{try{Se(!0),_t(null);let mt=await fetch(Lt(`/api/catalogue/search?q=${encodeURIComponent(x)}`),{headers:vi()}),Fe=await Kt(mt);if(!mt.ok)throw new Error(Fe?.error||Fe?.message||"Failed to search catalogue");H||_e(Array.isArray(Fe?.items)?Fe.items:[])}catch(mt){H||(_e([]),_t(mt?.message||"Failed to search catalogue"))}finally{H||Se(!1)}},250);return()=>{H=!0,window.clearTimeout(he)}},[je,ve]);let _c=Object.keys(a).length,Ma=je.trim(),Id=Fs(J?.result),ul=J?.decision?.technical_classification==="no_suitable_candidate"||!!J&&!J.best,Wd=J?.decision?.technical_classification!=null,em=J?.decision?.reason??(ul?"No catalogue candidate found. Refine the request or search the catalogue.":null),Hw=W.map(x=>({product_id:x.product_id,description:x.description,source_list:x.source_list,price:x.price,price_basis:x.price_basis,uoi_count:x.uoi_count??null,uoi:x.uoi,pdp_photo_url:x.pdp_photo_url??null,conversion:x.conversion,measurements_mm:x.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Vn=Ma?Hw:Id,Mi=J?A[J.item.line_id]:void 0,Xn=!Ma&&Mi&&!Vn.some(x=>x.product_id===Mi.product_id)?[...Vn,Mi]:Vn,tm=(()=>{let x=Xn.slice(0,Ma?12:3);return Ma||!Mi||x.some(H=>H.product_id===Mi.product_id)?x:[...x,Mi]})(),pl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,jw=!!J?.best&&!!a[J.item.line_id]&&!pl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${d?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${d?"":" quick-order-hero--customer"}`,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:K==null?"Calculating\u2026":ot(K)})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",h?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,"aria-label":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:h?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:K==null?"Calculating\u2026":ot(K)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ht,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Pe&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ye,onClick:()=>ut(x=>!x),children:ye?"Hide timings":"Show timings"})}),Pe&&ye&&(0,s.jsx)(d_,{...U}),!h&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[pe>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:pe})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:z,onChange:x=>Y(x.target.value),"aria-label":"Search line items"}),!d&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${G==="tile"?" is-active":""}`,"aria-pressed":G==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ce("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${G==="list"?" is-active":""}`,"aria-pressed":G==="list","aria-label":"List view",title:"List view",onClick:()=>ce("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Pe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>me(x=>x==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Gn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:i_.map(x=>{let H=P===x.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${H?" is-active":""}`,onClick:()=>{ge(H?null:x.dir),Gn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:H?"\u2713":""}),x.label]},x.dir)})})]})]})]})}),G==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Za(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:x=>x.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Za(),"aria-label":"Close product options",children:(0,s.jsx)(Po,{})}),(0,s.jsx)("div",{className:"results-review-page",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Za(),children:[(0,s.jsx)(Kr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Pe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>me(x=>x==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:je,onChange:x=>Me(x.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>wc(J.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Ya(We(J)?.description||J.item.description_original,We(J)?.product_id,We(J)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Jr(J.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[yi(J.qty)," ",Na(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Mn(J.best.price,J.best.price_basis)}):null]}):We(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:We(J)?.description}),We(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Mn(We(J)?.price??null,We(J)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),gr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(hd,{meta:S.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Tn(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?i(J.item.line_id):(J.best&&Fd(J.item.line_id,J.best),r(Ei(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[J.item.line_id]?"\u2713 Added":d?"+ Add to selection":`Add to ${m}`})})]})]}),Oe?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!Oe&&Je?(0,s.jsx)("div",{className:"results-empty-card",children:Je}):null,!Oe&&!Je&&Ma&&Vn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!Oe&&!Je?(0,s.jsx)(b_,{item:J.item,candidates:Vn,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:ze,linkedGroupMeta:gr(J.item)?S.get(J.item.linked_group_id):void 0,onPick:x=>yc(J.item.line_id,x),onClear:()=>wc(J.item.line_id),showAll:d||Pe||Ma.length>0,internal:d,debugEnabled:Pe,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Jr(J.item,w)||"Original request"})]}),em?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:ul?"Exact match not found:":"AI review:"})," ",em]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:ul?"We couldn't find a suitable product":Wd?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:ul?Id.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":Wd?`Select the option you want to add to your ${m}.`:"Search the catalogue to choose a product."})]})}),!Ma&&Xn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:tm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>yc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ya(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Mn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null,Xn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:je,onChange:x=>Me(x.target.value),"aria-label":"Search catalogue"})]}),Ma&&Oe?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ma&&!Oe&&Je?(0,s.jsx)("div",{className:"results-empty-card",children:Je}):null,Ma&&!Oe&&!Je&&Xn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ma&&!Oe&&!Je&&Xn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:tm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>yc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ya(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Mn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null]}),J.best?jw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{Pd()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${m}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${pl?" cta-btn-secondary":""}`,onClick:()=>{pl?i(J.item.line_id):Pd()},children:(0,s.jsx)("span",{children:pl?`Remove from ${m}`:`Add selected product to ${m}`})}):null,L?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>Ow(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[pa.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Qn.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Qn.map(x=>{let{item:H,best:he,qty:mt}=x,Fe=We(x),It=!he&&ke(x);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>qi(H.line_id),"aria-label":`Review match for ${Jr(H,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[It||gr(H)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[gr(H)?(0,s.jsx)(hd,{meta:S.get(H.linked_group_id)}):(0,s.jsx)("span",{}),It?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Ya(Fe?.description||H.description_original,Fe?.product_id,Fe?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Fe?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Fe.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Fe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:It?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Jr(H,w)}),gr(H)?(0,s.jsx)("div",{className:"results-row-meta",children:Tn(H)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[d&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qi(H.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[H.line_id]?i(H.line_id):r(Ei(x))},disabled:!Fe,"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})]})]},H.line_id)})})}):null,Jd]})]}):(0,s.jsxs)(s.Fragment,{children:[T&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:T,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),ze==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),ze==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:d?"Selection":h?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[pa.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:ze==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Qn.map(x=>{let{item:H,result:he,decision:mt,best:Fe}=x;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>qi(H.line_id),onMouseEnter:It=>{ee.current=It.currentTarget,Yn()},onMouseLeave:()=>{ee.current=null,D(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Jr(H,w)}),gr(H)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(hd,{meta:S.get(H.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Tn(H)})]}):null]}),(0,s.jsx)("td",{children:Fe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Fe.description,children:Fe.description}),ze==="detailed"&&mt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[l_(mt.technical_classification),mt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Fe?.price!=null?Mn(Fe.price,Fe.price_basis):"-"}),ze==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:It=>{It.stopPropagation(),a[H.line_id]?i(H.line_id):r(Ei(x))},"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})})]},H.line_id)})]})]})}),Jd]}),!J&&jn>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Ft-1)*al+1,"\u2013",Math.min(Ft*al,pa.length)," of ",pa.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>De(Ft-1),disabled:Ft===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Ft," of ",jn]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>De(Ft+1),disabled:Ft===jn,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:(_c>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>B(!0),"aria-label":"Start over",children:[(0,s.jsx)(fd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),_c>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,"aria-label":d?"View selection":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[d?"View Selection":h?"View Quote":"View Basket"," (",_c,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ht,{})})]})]})]})]}),Uw&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:ua.map(x=>{let H=xe.has(x.item.line_id),he=ke(x);return(0,s.jsx)("div",{className:`review-gate-item${H?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{ne(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(x.item,w)}),(0,s.jsx)("span",{children:x.decision?.reason||(he?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:H?"Choice made":"Choose a product"})]})},x.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Lw,children:"Skip all"}),cl.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),cl.map(x=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{j(H=>{let he=new Set(H);return he.delete(x.item.line_id),he}),ne(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(x.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${m}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},x.item.line_id))]}):null]})}),C&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",h?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>B(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{B(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var yt=X(Xe());var q=X(re()),v_=.2,rl=10,lw="Enter a valid email address so we can send your quote.",w_=(e,t)=>{let a=`${t.requestedAmount} ${ka(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${ka(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${ka(t.sellUnit,2)} per ${ka(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},y_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${ka(e.sellUnit,1)}.`;function __(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function il(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function nl({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,yt.useId)(),d=!c&&Vs()==="QZA6-MRA4",h=Object.values(e),[m,b]=(0,yt.useState)(""),[w,E]=(0,yt.useState)(!1),[U,f]=(0,yt.useState)(!1),u=Sn(),[g,v]=(0,yt.useState)(""),[k,A]=(0,yt.useState)({}),[M,z]=(0,yt.useState)({}),[Y,P]=(0,yt.useState)(1),[ge,Ae]=(0,yt.useState)({}),[De,Pe]=(0,yt.useState)(!1),[ze,me]=(0,yt.useState)("0"),G=(0,yt.useRef)(new Set);(0,yt.useEffect)(()=>{if(!r)return;for(let D of Object.values(e))Ut(D).requiredSellUnits!=null&&G.current.delete(D.lineId);let T=Object.values(e).filter(D=>D.productId!=="-"&&Ut(D).requiredSellUnits==null&&!G.current.has(D.lineId));T.length!==0&&(T.forEach(D=>G.current.add(D.lineId)),fetch(Lt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:T.map(D=>({line_id:D.lineId,product_id:D.productId,requested_description:D.requestedDescription??D.description,requested_qty:D.qty,requested_uom:D.unit||null,linked_context:D.linkedContext??[],selected_description:D.description,selected_uoi:D.uoi,selected_uoi_count:D.uoiCount,selected_conversion:{sales_uom_normalised:D.salesUomNormalised,conversion_type:D.conversionType,sales_unit_size:D.salesUnitSize,sales_unit_size_uom:D.salesUnitSizeUom,coverage_qty:D.coverageQty,coverage_uom:D.coverageUom}}))})}).then(D=>D.ok?Kt(D):null).then(D=>{let ee={};for(let xe of D?.data?.items??D?.items??[]){let we=xe?.conversion;if(!we||typeof xe?.line_id!="string")continue;let _=e[xe.line_id];ee[xe.line_id]={conversionType:we.conversion_type,requestUomsSupported:we.request_uoms_supported,salesUomNormalised:we.sales_uom_normalised,salesUnitSize:we.sales_unit_size,salesUnitSizeUom:we.sales_unit_size_uom,coverageQty:we.coverage_qty,coverageUom:we.coverage_uom,roundingRule:we.rounding_rule,conversionConfidence:we.conversion_confidence,conversionNotes:we.conversion_notes,..._?.qty===0&&Number.isFinite(we.suggested_order_qty)&&we.suggested_order_qty>0?{qty:we.suggested_order_qty,unit:we.suggested_order_uom||_.unit}:{}}}Object.keys(ee).length>0&&r(ee)}).catch(D=>console.error("Catalogue conversion resolution failed",D)))},[e,r]);function ce(T){A(D=>{let ee={...D};return delete ee[T],ee})}function ye(T,D){let ee=parseFloat(D);!isNaN(ee)&&ee>=0&&t(T,ee),ce(T)}function ut(T,D,ee){t(T,Math.max(0,D+ee)),ce(T)}function ve(T){z(D=>{let ee={...D};return delete ee[T],ee})}function Be(T,D){let ee=parseFloat(D);!isNaN(ee)&&ee>=0&&a(T,ee),ve(T)}function je(T,D,ee){a(T,Math.max(0,D+ee)),ve(T)}async function Me(){let T=m.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(T)){v(lw);return}v(""),f(!0);try{let D=await fetch(Lt("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({email:T,items:W.map(({item:ee,pricing:xe})=>{let we=xe.requiredSellUnits??xe.requestedAmount,_=xe.requiredSellUnits!=null?xe.sellUnit:xe.requestedUnit;return{product_id:ee.productId,description:ee.description,quantity:we,unit:ka(_,we),unit_price:xe.requiredSellUnits!=null?xe.unitPrice:null,line_total:xe.lineTotal}})})});if(!D.ok){let ee=await Kt(D);console.error("Quote request failed",D.status,ee?.message),v(D.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}u("quote_requested",{items:W.length,total:Math.round(Se*100)/100}),E(!0),l?.(),window.scrollTo(0,0)}catch{v("Your request couldn't be sent. Check your connection and try again.")}finally{f(!1)}}let W=h.map(T=>({item:T,pricing:Ut(T,{wasteFactorEnabled:De,wasteFactorOverride:Math.max(0,Number.parseFloat(ze)||0)/100})})),_e=Js(h,{wasteFactorEnabled:De,wasteFactorOverride:Math.max(0,Number.parseFloat(ze)||0)/100}),Oe=_e*v_,Se=_e+Oe,Je=(0,yt.useRef)({items:W.length,total:Math.round(Se*100)/100});(0,yt.useEffect)(()=>{u("basket_viewed",Je.current)},[u]);let _t=Math.max(1,Math.ceil(W.length/rl)),C=Math.min(Y,_t),B=W.slice((C-1)*rl,C*rl);return w?(0,q.jsx)("div",{className:"wizard-step entry-stage",children:(0,q.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,q.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,q.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,q.jsx)("h1",{children:"Quote requested"}),(0,q.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,q.jsx)("strong",{children:m.trim()}),", usually within one working day."]}),(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,q.jsx)("span",{children:"Start a new quote"})}),(0,q.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):(0,q.jsx)("div",{className:`wizard-step entry-stage${d?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[d&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,q.jsx)(Kr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:c?"Your Selection":d?"Request a quote":"Your Basket"}),c&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:h.length})," ",h.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":d?"Check your items & quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:h.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:c?"\u{1F4CB}":"\u{1F9FA}"}),(0,q.jsx)("p",{children:c?"Your selection is empty.":d?"Your quote request is empty.":"Your basket is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:d?"Go back to your results and add items for your quote.":"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":d?"Quote request items":"Basket items",children:B.map(({item:T,pricing:D})=>{let ee=k[T.lineId]??String(D.requestedAmount),xe=D.requestedUnit===D.sellUnit||D.costingMode==="review",we=D.requiredSellUnits==null||D.requestedAmount!==D.requiredSellUnits||D.requestedUnit!==D.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ya(T.description,T.productId,T.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:T.description}),we&&D.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ae(_=>({..._,[T.lineId]:!_[T.lineId]})),"aria-expanded":!!ge[T.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${ge[T.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(il,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(T.lineId),"aria-label":`Remove ${T.description}`,children:(0,q.jsx)(__,{})})})]}),c&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:T.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:T.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:T.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[T.salesUnitSize," ",Na(T.salesUnitSizeUom,T.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:T.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[T.coverageQty," ",Na(T.coverageUom,T.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:T.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:T.roundingRule??"-"})]})]}),T.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:T.conversionNotes})]}),D.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:"Quantity needs confirmation."})," ",y_(D)]}):we&&ge[T.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:w_(T,D)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:ee,disabled:xe,onChange:_=>A(j=>({...j,[T.lineId]:_.target.value})),onBlur:_=>ye(T.lineId,_.target.value),onKeyDown:_=>{_.key==="Enter"&&_.target.blur()},"aria-label":`${T.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:xe,onClick:()=>ut(T.lineId,parseFloat(ee)||0,1),"aria-label":`Increase ${T.description} quantity`,children:(0,q.jsx)(il,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:xe,onClick:()=>ut(T.lineId,parseFloat(ee)||0,-1),"aria-label":`Decrease ${T.description} quantity`,children:(0,q.jsx)(il,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:Na(D.requestedUnit,parseFloat(ee)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:M[T.lineId]??String(D.requiredSellUnits??""),onChange:_=>z(j=>({...j,[T.lineId]:_.target.value})),onBlur:_=>Be(T.lineId,_.target.value),onKeyDown:_=>{_.key==="Enter"&&_.target.blur()},"aria-label":`${T.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>je(T.lineId,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${T.description} order quantity`,children:(0,q.jsx)(il,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>je(T.lineId,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${T.description} order quantity`,children:(0,q.jsx)(il,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:Na(D.sellUnit,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:D.lineTotal!=null?ot(D.lineTotal):"-"}),D.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},T.lineId)})}),_t>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(C-1)*rl+1,"\u2013",Math.min(C*rl,W.length)," of ",W.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>P(C-1),disabled:C===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",C," of ",_t]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>P(C+1),disabled:C===_t,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:d?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:d?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:ot(_e)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:ot(Oe)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:d?"List price (inc. VAT)":"Total"}),(0,q.jsx)("span",{children:ot(Se)})]}),!d&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:De,onChange:T=>Pe(T.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:ze,onChange:T=>me(T.target.value),disabled:!De,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:d?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:m,onChange:T=>{b(T.target.value),d&&v("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&g===lw,"aria-describedby":d&&g?`${p}-basket-reference-error`:void 0}),d&&g&&(0,q.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:g}),d?(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Me()},disabled:U,"aria-busy":U,children:(0,q.jsx)("span",{children:U?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{u("downloaded",{type:"basket",items:h.length}),aw(h)},"aria-label":c?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:c?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),d?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,q.jsx)(Kr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var zt=X(Xe()),sw=X(re());function x_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var yd=(0,zt.createContext)(null);function Ws({children:e,onOpenBasket:t}){let[a,r]=(0,zt.useState)({}),i=(0,zt.useCallback)(m=>{r(b=>x_(b,m))},[]),n=(0,zt.useCallback)(m=>{r(b=>{let w={...b};for(let E of m)w[E.lineId]=E;return w})},[]),o=(0,zt.useCallback)(m=>{r(b=>{let w={...b};return delete w[m],w})},[]),l=(0,zt.useCallback)((m,b)=>{r(w=>w[m]?{...w,[m]:{...w[m],qty:b,sellUnitsOverride:null}}:w)},[]),c=(0,zt.useCallback)((m,b)=>{r(w=>w[m]?{...w,[m]:{...w[m],sellUnitsOverride:b}}:w)},[]),p=(0,zt.useCallback)(m=>{r(b=>{let w=!1,E={...b};for(let[U,f]of Object.entries(m))E[U]&&(E[U]={...E[U],...f},w=!0);return w?E:b})},[]),d=(0,zt.useCallback)(()=>r({}),[]),h=(0,zt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:d,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,d,t]);return(0,sw.jsx)(yd.Provider,{value:h,children:e})}function zn(){let e=(0,zt.useContext)(yd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function ec(){return(0,zt.useContext)(yd)}var Sa=X(re()),_d="metron-quick-quote";function tc(e){return(0,Sa.jsx)(Ws,{children:(0,Sa.jsx)(k_,{...e})})}function k_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,Ye.useState)("entry"),[n,o]=(0,Ye.useState)(null),[l,c]=(0,Ye.useState)(""),p=(0,Ye.useRef)(null),[d,h]=(0,Ye.useState)(0),[m,b]=(0,Ye.useState)(null),[w,E]=(0,Ye.useState)(!1),{cart:U,addToCart:f,addManyToCart:u,removeFromCart:g,updateCartQty:v,updateCartSellUnits:k,updateCartConversions:A,clearCart:M}=zn(),[z,Y]=(0,Ye.useState)(!1),P=(0,Ye.useRef)(new Map),ge=(0,Ye.useRef)(null),Ae=Ys("quick-quote",ge);(0,Ye.useEffect)(()=>{Ae("viewed")},[Ae]),(0,Ye.useEffect)(()=>{for(let W of Object.values(U))Ut(W).requiredSellUnits!=null&&P.current.delete(W.lineId);let Me=Object.values(U).filter(W=>{if(W.productId==="-"||Ut(W).requiredSellUnits!=null)return!1;let _e=`${W.productId}|${W.qty}|${W.unit}`;return P.current.get(W.lineId)===_e?!1:(P.current.set(W.lineId,_e),!0)});Me.length!==0&&fetch(Lt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:Me.map(W=>({line_id:W.lineId,product_id:W.productId,requested_description:W.requestedDescription??W.description,requested_qty:W.qty,requested_uom:W.unit||null,selected_description:W.description,selected_uoi:W.uoi,selected_uoi_count:W.uoiCount,linked_context:W.linkedContext??[],selected_conversion:{sales_uom_normalised:W.salesUomNormalised,conversion_type:W.conversionType,sales_unit_size:W.salesUnitSize,sales_unit_size_uom:W.salesUnitSizeUom,coverage_qty:W.coverageQty,coverage_uom:W.coverageUom}}))})}).then(W=>W.ok?Kt(W):null).then(W=>{let _e={};for(let Oe of W?.data?.items??W?.items??[]){let Se=Oe?.conversion;if(!Se||typeof Oe?.line_id!="string")continue;let Je=U[Oe.line_id];_e[Oe.line_id]={conversionType:Se.conversion_type,requestUomsSupported:Se.request_uoms_supported,salesUomNormalised:Se.sales_uom_normalised,salesUnitSize:Se.sales_unit_size,salesUnitSizeUom:Se.sales_unit_size_uom,coverageQty:Se.coverage_qty,coverageUom:Se.coverage_uom,roundingRule:Se.rounding_rule,conversionConfidence:Se.conversion_confidence,conversionNotes:Se.conversion_notes,...Je?.qty===0&&Number.isFinite(Se.suggested_order_qty)&&Se.suggested_order_qty>0?{qty:Se.suggested_order_qty,unit:Se.suggested_order_uom||Je.unit}:{}}}Object.keys(_e).length>0&&A(_e)}).catch(W=>console.error("Catalogue conversion resolution failed",W))},[U,A]);let[De,Pe]=(0,Ye.useState)(!1);(0,Ye.useEffect)(()=>{let Me=window.location.hash,W=null;try{W=JSON.parse(window.sessionStorage.getItem(_d)??"null")}catch{}if(W?.scheduleResult)o("schedule"),b(W.scheduleResult),E(W.reviewGateComplete),Y(W.cartSeeded),u(Object.values(W.cart)),Me==="#quote-request"?i("basket"):Me==="#matched-products"&&i("results");else if(Me==="#matched-products"||Me==="#quote-request"){let _e=new URL(window.location.href);_e.hash="",window.history.replaceState(window.history.state,"",_e)}Pe(!0)},[]),(0,Ye.useEffect)(()=>{if(De)try{m?window.sessionStorage.setItem(_d,JSON.stringify({scheduleResult:m,reviewGateComplete:w,cartSeeded:z,cart:U})):window.sessionStorage.removeItem(_d)}catch{}},[De,m,w,z,U]);let ze=(0,Ye.useCallback)(Me=>{if(typeof window>"u")return;let W=new URL(window.location.href);W.hash=Me==="basket"?"quote-request":"matched-products";let _e=Me==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");window.history[_e?"replaceState":"pushState"]({boqQuoteStage:Me},"",W)},[]),me=(0,Ye.useRef)(!1);(0,Ye.useEffect)(()=>{let Me=W=>{me.current=!1;let _e=window.location.hash;i(_e==="#quote-request"?"basket":_e==="#matched-products"&&m?"results":"entry");let Oe=W.state,Se=window.location.href;setTimeout(()=>{if(window.location.href===Se){if(_e==="#quote-request"||_e==="#matched-products"){window.history.replaceState({boqQuoteStage:_e==="#quote-request"?"basket":"results"},"",Se);return}!Oe?.turbo&&window.history.state?.turbo&&window.history.replaceState(Oe,"",Se)}})};return window.addEventListener("popstate",Me),()=>window.removeEventListener("popstate",Me)},[m]);let G=(0,Ye.useCallback)(()=>{ze("basket"),i("basket")},[ze]),ce=(0,Ye.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(me.current)return;me.current=!0,window.history.back();return}i(m?"results":"entry")},[m]),ye=(0,Ye.useRef)(r);(0,Ye.useEffect)(()=>{ye.current!==r&&(ye.current=r,window.scrollTo(0,0))},[r]);let ut=()=>{i("entry"),o(null),c(""),h(0),b(null),E(!1),M(),Y(!1)},ve=(0,Ye.useCallback)(async(Me,W,_e=!0)=>{c(""),h(0);let Oe=0,Se=()=>{Oe=Math.min(Oe+1,3),h(Oe)};try{let{jobId:Je}=await tv(Me,W,_e),{promise:_t,cancel:C}=rv(()=>av(Je),5e3,Se,"schedule");p.current=C;let B=await _t;if(B.status==="failed"||!B.result)throw new Error(B.error||"Failed to process schedule");let T=B.result.lineItems.length,D=B.result.results.filter(ee=>ee.candidates.length>0).length;Ae("results_shown",{lines:T,matched:D,unmatched:T-D}),E(!1),b(B.result),ze("results"),i("results")}catch(Je){Ae("error",{stage:"matching"}),c(Je?.message||"Failed to process schedule"),i("entry")}finally{p.current?.(),p.current=null}},[ze,Ae]),Be=(0,Ye.useCallback)(async(Me,W,_e=!0)=>{if(!Me.trim())return;o("schedule");let Oe=new File([Me],"pasted-schedule.txt",{type:"text/plain"});await ve(Oe,W,_e)},[ve]),je=(0,Ye.useCallback)(async Me=>{o("schedule"),await ve(Me)},[ve]);return(0,Sa.jsx)(Ko.Provider,{value:Ae,children:(0,Sa.jsx)("div",{ref:ge,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Ra().theme,children:(0,Sa.jsxs)("main",{className:"main-content",children:[l&&(0,Sa.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Sa.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Sa.jsx)(dd,{onPasteSchedule:Be,onUploadSchedule:je,onEntryModeChange:o}),r==="results"&&n==="schedule"&&m&&(0,Sa.jsx)(wd,{scheduleResult:m,onStartOver:ut,cart:U,onAddToCart:f,onRemoveFromCart:g,onGoToBasket:G,cartSeeded:z,onCartSeeded:()=>Y(!0),reviewGateComplete:w,onReviewGateComplete:()=>E(!0),internal:a}),r==="basket"&&(0,Sa.jsx)(nl,{cart:U,onUpdateQty:v,onUpdateSellUnits:k,onRemove:g,onBack:ce,onStartNewQuote:ut,onQuoteRequested:()=>{b(null),E(!1),Y(!1),M()},internal:a})]})})})}var Xa=X(Xe());var xi=X(Xe()),ae=X(re()),cw=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],ac=e=>Number.parseFloat(e)||0,uw=(e,t)=>ac(e)*(t==="m"?1:.3048),xd=(e,t)=>ac(e.quantity)*(2*uw(e.height,t)+uw(e.width,t)),N_=()=>({quantity:"1",width:"",height:""});function S_({profile:e}){return(0,ae.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ae.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,ae.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,xi.useState)("m"),[n,o]=(0,xi.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,xi.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,d]=(0,xi.useState)([]),[h,m]=(0,xi.useState)("ogee"),[b,w]=(0,xi.useState)("2.4"),E=(k,A,M)=>{k(z=>({...z,[A]:M}))},U=xd(n,r)+xd(l,r)+p.reduce((k,A)=>k+xd(A,r),0),f=ac(b)>0?Math.ceil(U/ac(b)):0,u=cw.find(k=>k.id===h)?.label??"",g=[{key:`architrave-${h}`,label:`Architrave (${u})`,qty:U,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(k,A,M,z)=>(0,ae.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ae.jsx)("span",{children:k}),(0,ae.jsx)("input",{"aria-label":`${k} quantity`,type:"number",min:"0",step:"1",value:A.quantity,onChange:Y=>M("quantity",Y.target.value)}),(0,ae.jsx)("input",{"aria-label":`${k} width`,type:"number",min:"0",step:"0.01",value:A.width,onChange:Y=>M("width",Y.target.value)}),(0,ae.jsx)("input",{"aria-label":`${k} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:Y=>M("height",Y.target.value)}),z?(0,ae.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:z,children:"Remove"}):null]});return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Architrave Calculator"}),(0,ae.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ae.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ae.jsx)("span",{children:"Units"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,ae.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ae.jsx)("span",{children:"Opening"}),(0,ae.jsx)("span",{children:"Qty"}),(0,ae.jsxs)("span",{children:["Width (",r,")"]}),(0,ae.jsxs)("span",{children:["Height (",r,")"]}),(0,ae.jsx)("span",{})]}),v("Single doors",n,(k,A)=>E(o,k,A)),v("Double doors",l,(k,A)=>E(c,k,A)),p.map((k,A)=>v(`Alternative door ${A+1}`,k,(M,z)=>d(Y=>Y.map((P,ge)=>ge===A?{...P,[M]:z}:P)),()=>d(M=>M.filter((z,Y)=>Y!==A)))),(0,ae.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(k=>[...k,N_()]),children:"+ Add alternative-sized door"})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ae.jsx)("div",{className:"architrave-calculator__profiles",children:cw.map(k=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===k.id?" is-selected":""}`,onClick:()=>m(k.id),children:[(0,ae.jsx)(S_,{profile:k.id}),(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ae.jsx)("div",{className:"architrave-calculator__options",children:(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Board length (m)"}),(0,ae.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Architrave needed"}),(0,ae.jsxs)("strong",{children:[U.toFixed(2)," m"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Board lengths"}),(0,ae.jsx)("strong",{children:f})]})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:U<=0,children:a})]})]})]})})}var ki=X(Xe()),se=X(re()),pw=60,dw=10,C_=.02,q_=.012,E_=.01,An=e=>Number.parseFloat(e)||0,M_=(e,t=2)=>e.toFixed(t);function Nd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ki.useState)("brick"),[n,o]=(0,ki.useState)("engineering-red"),[l,c]=(0,ki.useState)("metric"),[p,d]=(0,ki.useState)(""),[h,m]=(0,ki.useState)(""),[b,w]=(0,ki.useState)(!0),E=l==="metric"?An(p)*An(h):An(p)*An(h)*.092903,f=E*(r==="brick"?pw:dw),u=Math.ceil(f),g=E*(r==="brick"?C_:q_),v=Math.ceil(g/E_),k=l==="metric"?E:E*10.7639,A=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],M=z=>{if(z===l)return;let Y=z==="imperial"?3.28084:.3048;d((An(p)*Y).toFixed(2)),m((An(h)*Y).toFixed(2)),c(z)};return(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)("div",{className:"truss-estimator",children:[(0,se.jsxs)("div",{className:"quick-order-hero",children:[(0,se.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,se.jsx)("h1",{children:"Brick & Block Calculator"}),(0,se.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,se.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,se.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,se.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,se.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([z,Y])=>(0,se.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===z?" is-selected":""}`,onClick:()=>i(z),children:[(0,se.jsx)("div",{className:"truss-estimator__option-title",children:Y}),(0,se.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",z==="brick"?pw:dw," per m\xB2"]})]},z))})]}),r==="brick"&&(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,se.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([z,Y,P])=>(0,se.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===z?" is-selected":""}`,onClick:()=>o(z),children:[(0,se.jsx)("div",{className:"truss-estimator__option-title",children:Y}),(0,se.jsx)("div",{className:"truss-estimator__option-copy",children:P})]},z))})]}),(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,se.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,se.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>M("metric"),children:"Metric"}),(0,se.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>M("imperial"),children:"Imperial"})]}),(0,se.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:z=>d(z.target.value)})]}),(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:z=>m(z.target.value)})]})]})]}),(0,se.jsx)("div",{className:"brick-calculator__options",children:(0,se.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,se.jsx)("input",{type:"checkbox",checked:b,onChange:z=>w(z.target.checked)}),(0,se.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,se.jsxs)("div",{className:"brick-calculator__totals",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,se.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:"Wall area"}),(0,se.jsxs)("strong",{children:[M_(k)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,se.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:"Ready-mixed mortar"}),(0,se.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,se.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,se.jsxs)("div",{className:"brick-calculator__actions",children:[(0,se.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,se.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:E<=0,children:a})]})]})]})})}var hr=X(Xe());var mw=new Map;function T_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Fr(e,t,a=12,r){let i=`${e}||${t??""}||${a}||${r??""}`,n=mw.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Lt(`/api/catalogue/search?${o.toString()}`),{headers:vi()}),c=await Kt(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(T_):[];return mw.set(i,p),p}async function fw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Fr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function gw(){let e=await fetch(Lt("/api/catalogue"),{headers:vi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Kt(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var $=X(re()),z_=1.54,A_=1440,R_=25,Sd=800,U_=1500,Cd=e=>Number.parseFloat(e)||0,Rn={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function qd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=ec(),[i,n]=(0,hr.useState)("m"),[o,l]=(0,hr.useState)(""),[c,p]=(0,hr.useState)(""),[d,h]=(0,hr.useState)(""),[m,b]=(0,hr.useState)("concrete"),[w,E]=(0,hr.useState)("mot"),[U,f]=(0,hr.useState)(!1),[u,g]=(0,hr.useState)(null),v=i==="m"?1:.3048,k=Cd(o)*v*Cd(c)*v*Cd(d)*(i==="m"?.01:.0254),A=Rn[w],M=k*z_/7,z=M*A_,Y=M*2,P=M*4,ge=Math.ceil(z/R_),Ae=Math.ceil(Y*Rn["sharp-sand"].density*1e3/Sd),De=Math.ceil(P*Rn.gravel.density*1e3/Sd),Pe=Math.ceil(k*A.density*1e3/Sd),ze=m==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:ge,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Ae,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:De,productId:"6001004"}]:[{key:w,label:`${A.label} Bulk Bag (800kg)`,qty:Pe,productId:A.productId}],me=()=>{if(t){t(ze.map(ce=>({key:ce.key,label:ce.label,qty:ce.qty,unit:"each",query:ce.productId})));return}G()},G=async()=>{let ce=Date.now();f(!0),g(null);try{let ye=await Promise.all(ze.map(async ve=>{let Be=(await Fr(ve.productId)).find(je=>je.product_id===ve.productId);if(!Be)throw new Error(`${ve.label} is no longer available in this catalogue.`);return Pr(Be,{lineId:`concrete-aggregate:${ve.key}`,description:ve.label,unit:"bag",qty:ve.qty})})),ut=U_-(Date.now()-ce);ut>0&&await new Promise(ve=>window.setTimeout(ve,ut)),r?.clearCart(),r?.addManyToCart(ye),r?.openBasket()}catch(ye){g(ye instanceof Error?ye.message:"Could not add the products to your basket.")}finally{f(!1)}};return U?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Your Materials"}),(0,$.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,$.jsx)("div",{className:"truss-estimator__card",children:(0,$.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,$.jsx)(fr,{}),(0,$.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,$.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,$.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="concrete"?" is-selected":""}`,onClick:()=>b("concrete"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="aggregate"?" is-selected":""}`,onClick:()=>b("aggregate"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),m==="aggregate"&&(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,$.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Rn).map(ce=>(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===ce?" is-selected":""}`,onClick:()=>E(ce),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:Rn[ce].label}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:Rn[ce].blurb})]},ce))})]}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,$.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,$.jsx)("span",{children:"Units"}),(0,$.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,$.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metric"}),(0,$.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Imperial"})]})]}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Length (",i,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ce=>l(ce.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Width (",i,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ce=>p(ce.target.value)})]})]}),(0,$.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,$.jsxs)("span",{children:["Depth (",i==="m"?"cm":"inches",")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.1",value:d,onChange:ce=>h(ce.target.value)})]})]}),(0,$.jsxs)("div",{className:"materials-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,$.jsx)("div",{className:"materials-calculator__result-grid",children:m==="concrete"?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Cement"}),(0,$.jsxs)("strong",{children:[z.toFixed(0)," kg"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Sharp sand"}),(0,$.jsxs)("strong",{children:[Y.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"20mm aggregate"}),(0,$.jsxs)("strong",{children:[P.toFixed(2)," m\xB3"]})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:A.label}),(0,$.jsxs)("strong",{children:[k.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Approx. weight"}),(0,$.jsxs)("strong",{children:[(k*A.density).toFixed(2)," t"]})]}),(0,$.jsx)("div",{})]})}),(0,$.jsx)("p",{className:"materials-calculator__note",children:m==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),u&&(0,$.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,$.jsxs)("div",{className:"materials-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:me,disabled:k<=0||U,children:U?"Adding products\u2026":a})]})]})]})})}var Va=X(Xe());var R=X(re()),Un=12,Dn=8,rc=.56,hw=.21,Ca={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{lengthM:2.4,spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},Ni=["range","grid","pictureFrame","substructure"],D_={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},ic=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),nc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),B_=(e,t,a,r)=>{let i=ic(e,t,a),n=ic(e,t,r),o=ic(a,r,e),l=ic(a,r,t);return i===0&&nc(e,t,a)||n===0&&nc(e,t,r)||o===0&&nc(a,r,e)||l===0&&nc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Ed=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&B_(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Md({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Va.useState)(0),[n,o]=(0,Va.useState)(D_),[l,c]=(0,Va.useState)(1),[p,d]=(0,Va.useState)({x:0,y:0}),[h,m]=(0,Va.useState)(null),b=(0,Va.useRef)(null),w=(0,Va.useRef)(null),E=(0,Va.useRef)(null),U=Ni[r],f=n.range?Ca.ranges[n.range]:null,u=Un/l,g=Dn/l,v=(Un-u)/2,k=(Dn-g)/2,A=Math.max(-Un,Math.min(Un*2-u,v+p.x)),M=Math.max(-Dn,Math.min(Dn*2-g,k+p.y)),z=Number.parseFloat(n.quickLengthM),Y=Number.parseFloat(n.quickWidthM),P=z>0&&Y>0,ge=C=>Math.abs(C.reduce((B,T,D)=>{let ee=C[(D+1)%C.length];return B+T.x*ee.y-ee.x*T.y},0))/2,Ae=(C,B)=>Math.hypot(B.x-C.x,B.y-C.y),De=n.isOutlineClosed?ge(n.points):0,Pe=n.isOutlineClosed?n.points.reduce((C,B,T)=>C+Ae(B,n.points[(T+1)%n.points.length]),0):0,ze=n.isOutlineClosed?n.points.reduce((C,B,T)=>C+(n.wallSegments.has(T)?0:Ae(B,n.points[(T+1)%n.points.length])),0):0,me=n.points.reduce((C,B)=>({x:C.x+B.x/n.points.length,y:C.y+B.y/n.points.length}),{x:0,y:0}),G=n.points.length>1?(()=>{let C=n.points[0],B=n.points[1],T=Ae(C,B),D=T?-(B.y-C.y)/T:0,ee=T?(B.x-C.x)/T:0,xe=(C.x+B.x)/2,we=(C.y+B.y)/2,_=D*(xe-me.x)+ee*(we-me.y)>=0?1:-1;return{x:xe+D*rc*_,y:we+ee*rc*_}})():null,ye=(()=>{let C=n.range?Ca.ranges[n.range]:Ca.ranges.meridian,B=n.deckSizeMode==="quick"?z*Y:De,T=n.deckSizeMode==="quick"?2*(z+Y):ze,D=n.direction==="diagonal"?Ca.wastage.diagonal:Ca.wastage.straight,ee=n.pictureFrame==="yes"?Ca.pictureFrame.extraWastage:0,we=B/(C.boardWidthM+Ca.boardGapM)/C.boardLengthM,_=Math.ceil(we*(1+D+ee)),j=Math.ceil(B*30*(1+D+ee)/200),L=Ca.joist.spacingOptions.find(S=>S.id===n.joistSpacing)??Ca.joist.spacingOptions[1],ne=B/L.spacingM,te=Math.ceil(ne/Ca.joist.lengthM);return{range:C,area:B,boardCount:_,screwBoxes:j,joistLengthsNeeded:te,spacing:L}})(),ut=ye?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${ye.range.label})`,qty:ye.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ye.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ye.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],ve=()=>U==="range"?!!n.range:U==="grid"?n.deckSizeMode==="quick"?P:n.isOutlineClosed&&De>0:U==="pictureFrame"?!!n.pictureFrame&&!!n.direction:U==="substructure"?!!n.joistSpacing:!0,Be=r===Ni.length-1?a:"Next",je=(C,B,T=!1)=>{let D=E.current?.getBoundingClientRect();if(!D)return null;let ee=T?1:.25;return{x:Math.round(Math.max(A,Math.min(A+u,A+(C-D.left)/D.width*u))/ee)*ee,y:Math.round(Math.max(M,Math.min(M+g,M+(B-D.top)/D.height*g))/ee)*ee}},Me=C=>{if(n.isOutlineClosed){let T=C.target;if(T!==C.currentTarget&&!T.classList.contains("deck-outline__grid"))return;w.current={startX:C.clientX,startY:C.clientY,startViewX:A,startViewY:M},C.currentTarget.setPointerCapture(C.pointerId);return}if(n.drawMode!=="outline")return;let B=je(C.clientX,C.clientY,!0);B&&(m(null),o(T=>{let D=[...T.points,B];return Ed(D,!1)?{...T,drawError:"Edges cannot cross. Choose another corner."}:{...T,points:D,drawError:""}}))},W=(C,B)=>{if(!n.isOutlineClosed){C.stopPropagation(),B===0&&n.points.length>=3&&o(T=>({...T,isOutlineClosed:!0,drawMode:"edges"}));return}C.stopPropagation(),b.current=B,C.currentTarget.setPointerCapture(C.pointerId)},_e=C=>{if(w.current){let D=E.current?.getBoundingClientRect();if(!D)return;let ee=w.current,xe=ee.startViewX-(C.clientX-ee.startX)/D.width*u,we=ee.startViewY-(C.clientY-ee.startY)/D.height*g;d({x:xe-v,y:we-k});return}!n.isOutlineClosed&&n.drawMode==="outline"&&m(je(C.clientX,C.clientY,!0));let B=b.current;if(B===null)return;let T=je(C.clientX,C.clientY);T&&o(D=>{let ee=D.points.map((xe,we)=>we===B?T:xe);return Ed(ee,!0)?{...D,drawError:"Edges cannot cross. Move the corner to a different position."}:{...D,points:ee,drawError:""}})},Oe=C=>{w.current=null,b.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId)},Se=C=>{o(B=>{let T=new Set(B.wallSegments);return T.has(C)?T.delete(C):T.add(C),{...B,wallSegments:T}})},Je=()=>{r===0?e():i(C=>C-1)},_t=()=>{ve()&&(r===Ni.length-1?t?.(ut):i(C=>C+1))};return(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)("div",{className:"truss-estimator",children:[(0,R.jsxs)("div",{className:"quick-order-hero",children:[(0,R.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,R.jsx)("h1",{children:"Decking Calculator"}),(0,R.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,R.jsxs)("div",{className:"truss-estimator__card",children:[(0,R.jsxs)("div",{className:"truss-estimator__body",children:[U==="range"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Ca.ranges).map(([C,B])=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===C?" is-selected":""}`,onClick:()=>o(T=>({...T,range:C})),children:[(0,R.jsx)("div",{className:"truss-estimator__option-title",children:B.label}),(0,R.jsx)("div",{className:"truss-estimator__option-copy",children:B.blurb}),(0,R.jsxs)("div",{className:"truss-estimator__option-copy",children:[B.boardLengthM,"m boards"]})]},C))})]}):null,U==="grid"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,R.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,R.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(C=>({...C,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,R.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(C=>({...C,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,R.jsxs)("label",{className:"truss-estimator__field",children:[(0,R.jsx)("span",{children:"Length (m)"}),(0,R.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:C=>o(B=>({...B,quickLengthM:C.target.value}))})]}),(0,R.jsxs)("label",{className:"truss-estimator__field",children:[(0,R.jsx)("span",{children:"Width (m)"}),(0,R.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:C=>o(B=>({...B,quickWidthM:C.target.value}))})]})]}),(0,R.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),P?(0,R.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,R.jsxs)("div",{children:[(z*Y).toFixed(2)," m\xB2 deck"]}),(0,R.jsxs)("div",{children:[(2*(z+Y)).toFixed(2)," m perimeter"]})]}):null]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,R.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,R.jsxs)("div",{className:"deck-outline__summary",children:[(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Deck area"}),(0,R.jsxs)("strong",{children:[De.toFixed(2)," m\xB2"]})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Perimeter"}),(0,R.jsxs)("strong",{children:[Pe.toFixed(2)," m"]})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Wall edges"}),(0,R.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Visible edge"}),(0,R.jsxs)("strong",{children:[ze.toFixed(2)," m"]})]})]}):null,(0,R.jsxs)("div",{className:"deck-outline__actions",children:[(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(C=>({...C,points:C.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m(null),o(C=>({...C,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(C=>({...C,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,R.jsx)("div",{className:"deck-editor-layout",children:(0,R.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,R.jsxs)("div",{className:"deck-outline",children:[(0,R.jsxs)("svg",{ref:E,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${A} ${M} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:Me,onPointerMove:_e,onPointerUp:Oe,onPointerLeave:()=>{m(null),w.current||(b.current=null)},children:[(0,R.jsx)("defs",{children:(0,R.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,R.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,R.jsx)("rect",{x:-Un,y:-Dn,width:Un*3,height:Dn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,R.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(C=>`${C.x},${C.y}`).join(" ")}):null,n.isOutlineClosed?(0,R.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(C=>`${C.x},${C.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((C,B)=>{let T=n.points[n.isOutlineClosed?(B+1)%n.points.length:B+1],D=Ae(C,T),ee=D?-(T.y-C.y)/D:0,xe=D?(T.x-C.x)/D:0,we=(C.x+T.x)/2,_=(C.y+T.y)/2,j=ee*(we-me.x)+xe*(_-me.y)>=0?1:-1,L=we+ee*rc*j,ne=_+xe*rc*j;return(0,R.jsxs)("g",{children:[(0,R.jsx)("line",{className:"deck-outline__edge-hit",x1:C.x,y1:C.y,x2:T.x,y2:T.y,onClick:n.isOutlineClosed?()=>Se(B):void 0}),(0,R.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(B)?" is-wall":""}`,x1:C.x,y1:C.y,x2:T.x,y2:T.y,pointerEvents:"none"}),(0,R.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(B)?" is-wall":""}`,x:L,y:ne,textAnchor:"middle",dominantBaseline:"central",fontSize:hw/l,children:[D.toFixed(2)," m"]})]},`segment-${B}`)}):null,!n.isOutlineClosed&&n.points.length>0&&h?(()=>{let C=n.points[n.points.length-1],B=Ae(C,h);if(!B)return null;let T=-(h.y-C.y)/B,D=(h.x-C.x)/B,ee=(C.x+h.x)/2,xe=(C.y+h.y)/2;return(0,R.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,R.jsx)("line",{x1:C.x,y1:C.y,x2:h.x,y2:h.y}),(0,R.jsxs)("text",{x:ee+T*.34,y:xe+D*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:hw/l,children:[B.toFixed(2)," m"]})]})})():null,n.points.map((C,B)=>(0,R.jsx)("circle",{className:"deck-outline__point",cx:C.x,cy:C.y,r:"0.13",onPointerDown:T=>W(T,B)},`point-${B}`))]}),(0,R.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,R.jsx)("button",{type:"button",onClick:()=>c(C=>Math.max(.5,C-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,R.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,R.jsx)("button",{type:"button",onClick:()=>c(C=>Math.min(1,C+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&G?(0,R.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(G.x-A)/u*100}%`,top:`${(G.y-M)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,R.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(C=>Ed(C.points,!0)?{...C,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...C,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,R.jsxs)("div",{className:"deck-outline__supporting",children:[(0,R.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,R.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,U==="pictureFrame"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(C=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===C.id?" is-selected":""}`,onClick:()=>o(B=>({...B,pictureFrame:C.id})),children:[(0,R.jsx)("img",{className:"truss-estimator__visual-card-img",src:Pt(C.img),alt:""}),(0,R.jsx)("span",{children:C.label})]},C.id))}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(C=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===C.id?" is-selected":""}`,onClick:()=>o(B=>({...B,direction:C.id})),children:[(0,R.jsx)("img",{className:"truss-estimator__visual-card-img",src:Pt(C.img),alt:""}),(0,R.jsx)("span",{children:C.label})]},C.id))})]})]}):null,U==="substructure"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Ca.joist.spacingOptions.map(C=>(0,R.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===C.id?" is-selected":""}`,onClick:()=>o(B=>({...B,joistSpacing:C.id})),children:(0,R.jsx)("div",{className:"truss-estimator__option-title",children:C.label})},C.id))})]}):null]}),(0,R.jsxs)("div",{className:"truss-estimator__nav",children:[(0,R.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:Je,children:"Back"}),(0,R.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:_t,disabled:!ve(),children:[(0,R.jsx)("span",{children:Be}),(0,R.jsx)("span",{className:"arrow",children:(0,R.jsx)(Ht,{})})]})]})]})]})})}var Ea=X(Xe());var Q=X(re()),bw=12,vw=30,Bn=12,On=8,ww=.56,qa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Si=["range","height","gate","posts"],O_={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},oc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),lc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),L_=(e,t,a,r)=>{let i=oc(e,t,a),n=oc(e,t,r),o=oc(a,r,e),l=oc(a,r,t);return i===0&&lc(e,t,a)||n===0&&lc(e,t,r)||o===0&&lc(a,r,e)||l===0&&lc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},sc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&L_(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ea.useState)(0),[n,o]=(0,Ea.useState)(O_),l=(0,Ea.useRef)(null),c=(0,Ea.useRef)(null),[p,d]=(0,Ea.useState)(1),[h,m]=(0,Ea.useState)({x:0,y:0}),[b,w]=(0,Ea.useState)(null),E=(0,Ea.useRef)(null),U=(0,Ea.useRef)(null),f=(0,Ea.useRef)(null),u=Si[r],g=n.range?qa.ranges[n.range]:null,v=Bn/p,k=On/p,A=(Bn-v)/2,M=(On-k)/2,z=Math.max(-Bn,Math.min(Bn*2-v,A+h.x)),Y=Math.max(-On,Math.min(On*2-k,M+h.y)),P=n.boundaryPoints.reduce((_,j)=>({x:_.x+j.x/Math.max(1,n.boundaryPoints.length),y:_.y+j.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),ge=_=>{let j=new Set,L=[];return _.forEach(ne=>{let[te,S]=ne.split(",").map(Number),V=[{key:`H,${te},${S}`,type:"H",x:te,y:S},{key:`H,${te},${S+1}`,type:"H",x:te,y:S+1},{key:`V,${te},${S}`,type:"V",x:te,y:S},{key:`V,${te+1},${S}`,type:"V",x:te+1,y:S}],K=[!_.has(`${te},${S-1}`),!_.has(`${te},${S+1}`),!_.has(`${te-1},${S}`),!_.has(`${te+1},${S}`)];V.forEach((pe,ke)=>{K[ke]&&!j.has(pe.key)&&(j.add(pe.key),L.push(pe))})}),L},Ae=(_,j)=>ge(_).filter(L=>!j.has(L.key)),De=(_,j)=>Ae(_,j).length,Pe=(_,j)=>{let L={};Ae(_,j).forEach(te=>{var S,V,K,pe;te.type==="H"?((L[S=`${te.x},${te.y}`]||(L[S]=[])).push("H"),(L[V=`${te.x+1},${te.y}`]||(L[V]=[])).push("H")):((L[K=`${te.x},${te.y}`]||(L[K]=[])).push("V"),(L[pe=`${te.x},${te.y+1}`]||(L[pe]=[])).push("V"))});let ne=0;return Object.values(L).forEach(te=>{(te.length===1||te.length===2&&te[0]!==te[1]||te.length>=3)&&(ne+=1)}),ne},me=(()=>{let _=n.range?qa.ranges[n.range]:qa.ranges.boundary,j=n.height??"1.8",L=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Ft,vr,$a)=>Ft+(n.excludedBoundaryEdges.has($a)?0:Math.hypot(n.boundaryPoints[$a+1].x-vr.x,n.boundaryPoints[$a+1].y-vr.y)),0):0,ne=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||qa.gate[n.gateType].widthDefault:0,te=Math.max(0,L-ne),S=te>0?Math.ceil(te/_.panelWidthM):0,V=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,K=n.boundaryMode==="quick"?te>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,V?-1:void 0).reduce((Ft,vr,$a)=>{let Zd=$a>0&&!n.excludedBoundaryEdges.has($a-1),Qn=$a<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has($a);return Ft+(Zd||Qn?1:0)},0):0,pe=te>0?Math.ceil(te/_.panelWidthM)+1:0,ke=Math.max(0,pe-K),We=n.mountingType?qa.mounting[n.mountingType]:qa.mounting.concrete,xt=n.gateType&&n.gateType!=="none"?2:0,ua=ke+K+xt,cl=n.mountingType==="postcrete"?ua*qa.mounting.postcrete.bagsPerPost:0,pa=n.gravelBoard==="yes"?S:0;return{range:_,height:j,totalEdgeM:L,fencedLengthM:te,gateWidthM:ne,panelsCount:S,cornerPostCount:K,intermediatePostCount:ke,gatePostCount:xt,totalPostCount:ua,bagsCount:cl,gravelCount:pa,capCount:ua,mounting:We}})(),G=n.gateType&&n.gateType!=="none"?qa.gate[n.gateType].label:null,ce=Number(me.height)<=1.2?"6":"8",ye=me?[{key:`panels-${n.range??"boundary"}-${me.height}`,label:`${me.range.label} panels (${me.height}m)`,qty:me.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${ce}`,label:"Intermediate concrete posts",qty:me.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ce}`,label:"End and corner concrete posts",qty:me.cornerPostCount+me.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ce}`,label:"Timber fence posts",qty:me.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:me.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...G?[{key:"gate",label:G,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...me.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:me.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ut=()=>{if(u==="range"){let _=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&_}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},ve=r===Si.length-1?a:"Next",Be=_=>{o(j=>{let L=_(new Set(j.grid)),ne=new Set([...j.excludedEdges].filter(te=>ge(L).some(S=>S.key===te)));return{...j,grid:L,excludedEdges:ne}})},je=(_,j,L)=>{Be(ne=>{let te=`${_},${j}`;return L?ne.add(te):ne.delete(te),ne})},Me=(_,j,L,ne,te)=>{let S=_,V=j,K=Math.abs(L-_),pe=_<L?1:-1,ke=-Math.abs(ne-j),We=j<ne?1:-1,xt=K+ke;for(;je(S,V,te),!(S===L&&V===ne);){let ua=2*xt;ua>=ke&&(xt+=ke,S+=pe),ua<=K&&(xt+=K,V+=We)}},W=(_,j)=>{let L=c.current?.getBoundingClientRect();if(!L)return null;let ne=Math.floor((_-L.left)/vw),te=Math.floor((j-L.top)/vw);return ne<0||te<0||ne>=bw||te>=bw?null:{x:ne,y:te}},_e=_=>{if(n.gridMode!=="draw")return;let j=W(_.clientX,_.clientY);if(!j)return;_.preventDefault();let L=`${j.x},${j.y}`,ne=!n.grid.has(L);l.current={active:!0,paintValue:ne,lastX:j.x,lastY:j.y},_.currentTarget.setPointerCapture(_.pointerId),je(j.x,j.y,ne)},Oe=_=>{let j=l.current;if(!j?.active)return;let L=W(_.clientX,_.clientY);L&&(L.x===j.lastX&&L.y===j.lastY||(Me(j.lastX,j.lastY,L.x,L.y,j.paintValue),l.current={...j,lastX:L.x,lastY:L.y}))},Se=_=>{l.current?.active&&(l.current=null,_.currentTarget.releasePointerCapture(_.pointerId))},Je=(_,j,L=!1)=>{let ne=f.current?.getBoundingClientRect();if(!ne)return null;let te=L?1:.25;return{x:Math.round(Math.max(z,Math.min(z+v,z+(_-ne.left)/ne.width*v))/te)*te,y:Math.round(Math.max(Y,Math.min(Y+k,Y+(j-ne.top)/ne.height*k))/te)*te}},_t=_=>{if(n.boundaryClosed){let L=_.target;if(L!==_.currentTarget&&!L.classList.contains("fence-boundary__grid"))return;U.current={startX:_.clientX,startY:_.clientY,startViewX:z,startViewY:Y},_.currentTarget.setPointerCapture(_.pointerId);return}let j=Je(_.clientX,_.clientY,!0);j&&(w(null),o(L=>{let ne=[...L.boundaryPoints,j];return sc(ne,!1)?{...L}:{...L,boundaryPoints:ne}}))},C=(_,j)=>{if(_.stopPropagation(),!n.boundaryClosed){if(j!==0||n.boundaryPoints.length<3)return;o(L=>sc(L.boundaryPoints,!0)?L:{...L,boundaryPoints:[...L.boundaryPoints,L.boundaryPoints[0]],boundaryClosed:!0});return}E.current=j,_.currentTarget.setPointerCapture(_.pointerId)},B=_=>{if(U.current){let L=f.current?.getBoundingClientRect();if(!L)return;let ne=U.current,te=ne.startViewX-(_.clientX-ne.startX)/L.width*v,S=ne.startViewY-(_.clientY-ne.startY)/L.height*k;m({x:te-A,y:S-M});return}if(n.boundaryClosed||w(Je(_.clientX,_.clientY,!0)),E.current===null)return;let j=Je(_.clientX,_.clientY);j&&o(L=>{let ne=L.boundaryPoints.length>2&&L.boundaryPoints[0].x===L.boundaryPoints[L.boundaryPoints.length-1].x&&L.boundaryPoints[0].y===L.boundaryPoints[L.boundaryPoints.length-1].y,te=L.boundaryPoints.map((S,V)=>{let K=V===E.current,pe=ne&&E.current===0&&V===L.boundaryPoints.length-1;return K||pe?j:S});return sc(te,!1)?L:{...L,boundaryPoints:te}})},T=_=>{U.current=null,E.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId)},D=_=>{o(j=>{let L=new Set(j.excludedBoundaryEdges);return L.has(_)?L.delete(_):L.add(_),{...j,excludedBoundaryEdges:L}})},ee=()=>{r===0?e():i(_=>_-1)},xe=()=>{ut()&&(r===Si.length-1?t?.(ye):i(_=>_+1))},we=ge(n.grid);return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)("div",{className:"truss-estimator",children:[(0,Q.jsxs)("div",{className:"quick-order-hero",children:[(0,Q.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Q.jsx)("h1",{children:"Fencing Calculator"}),(0,Q.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,Q.jsxs)("div",{className:"truss-estimator__card",children:[(0,Q.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(qa.ranges).map(([_,j])=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===_?" is-selected":""}`,onClick:()=>o(L=>({...L,range:_})),children:[(0,Q.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,Q.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},_))})]}):null,u==="range"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,Q.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,Q.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(_=>({..._,boundaryMode:"quick"})),children:"Quick estimate"}),(0,Q.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(_=>({..._,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,Q.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,Q.jsx)("span",{children:"Total fence length (m)"}),(0,Q.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:_=>o(j=>({...j,quickLengthM:_.target.value}))})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("div",{className:"fence-boundary__toolbar",children:(0,Q.jsxs)("div",{className:"fence-boundary__actions",children:[(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(_=>({..._,boundaryPoints:_.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m({x:0,y:0}),w(null),o(_=>({..._,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(_=>({..._,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,Q.jsxs)("div",{className:"fence-boundary",children:[(0,Q.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${z} ${Y} ${v} ${k}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:_t,onPointerMove:B,onPointerUp:T,onPointerLeave:()=>{w(null),U.current||(E.current=null)},children:[(0,Q.jsx)("defs",{children:(0,Q.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,Q.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,Q.jsx)("rect",{x:-Bn,y:-On,width:Bn*3,height:On*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,Q.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(_=>`${_.x},${_.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((_,j)=>{let L=n.boundaryPoints[j+1],ne=Math.hypot(L.x-_.x,L.y-_.y),te=ne?-(L.y-_.y)/ne:0,S=ne?(L.x-_.x)/ne:0,V=(_.x+L.x)/2,K=(_.y+L.y)/2,pe=te*(V-P.x)+S*(K-P.y)>=0?1:-1,ke=V+te*ww*pe,We=K+S*ww*pe;return(0,Q.jsxs)("g",{children:[(0,Q.jsx)("line",{className:"fence-boundary__edge-hit",x1:_.x,y1:_.y,x2:L.x,y2:L.y,onClick:n.boundaryClosed?()=>D(j):void 0}),(0,Q.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x1:_.x,y1:_.y,x2:L.x,y2:L.y,pointerEvents:"none"}),(0,Q.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x:ke,y:We,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[ne.toFixed(2)," m"]})]},`fence-edge-${j}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let _=n.boundaryPoints[n.boundaryPoints.length-1],j=Math.hypot(b.x-_.x,b.y-_.y);if(!j)return null;let L=-(b.y-_.y)/j,ne=(b.x-_.x)/j,te=(_.x+b.x)/2,S=(_.y+b.y)/2;return(0,Q.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,Q.jsx)("line",{x1:_.x,y1:_.y,x2:b.x,y2:b.y}),(0,Q.jsxs)("text",{x:te+L*.34,y:S+ne*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[j.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((_,j)=>j>0&&j===n.boundaryPoints.length-1&&_.x===n.boundaryPoints[0]?.x&&_.y===n.boundaryPoints[0]?.y?null:(0,Q.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&j===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:_.x,cy:_.y,r:"0.13",onPointerDown:L=>C(L,j)},`fence-point-${j}`))]}),(0,Q.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,Q.jsx)("button",{type:"button",onClick:()=>d(_=>Math.max(.5,_-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,Q.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,Q.jsx)("button",{type:"button",onClick:()=>d(_=>Math.min(1,_+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,Q.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(_=>sc(_.boundaryPoints,!1)?_:{..._,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,Q.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,Q.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,Q.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${me.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,Q.jsxs)("div",{children:[me.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:qa.heights.map(_=>(0,Q.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===_?" is-selected":""}`,onClick:()=>o(j=>({...j,height:_})),children:(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Pt(`/fencing/height/${_}.webp`),alt:""})},_))}),(0,Q.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(_=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===_.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gravelBoard:_.id})),children:[(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Pt(_.img),alt:""}),(0,Q.jsx)("span",{children:_.label})]},_.id))})]}):null,u==="gate"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(_=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===_.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gateType:_.id,gateWidthM:_.id==="none"?"":String(qa.gate[_.id].widthDefault)})),children:[(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Pt(_.img),alt:""}),(0,Q.jsx)("span",{children:_.label})]},_.id))}),n.gateType&&n.gateType!=="none"?(0,Q.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,Q.jsx)("span",{children:"Gate width (m)"}),(0,Q.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:_=>o(j=>({...j,gateWidthM:_.target.value}))})]}):null]}):null,u==="posts"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(qa.mounting).map(([_,j])=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===_?" is-selected":""}`,onClick:()=>o(L=>({...L,mountingType:_})),children:[(0,Q.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,Q.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},_))})]}):null]}),(0,Q.jsxs)("div",{className:"truss-estimator__nav",children:[(0,Q.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ee,children:"Back"}),(0,Q.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:xe,disabled:!ut(),children:[(0,Q.jsx)("span",{children:ve}),(0,Q.jsx)("span",{className:"arrow",children:(0,Q.jsx)(Ht,{})})]})]})]})]})})}var cc=X(Xe()),be=X(re()),yw={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,cc.useState)("floor"),[n,o]=(0,cc.useState)(""),[l,c]=(0,cc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,d=yw[r],h=Math.ceil(p/d.coverage),m=[{key:`insulation-${r}`,label:`${d.product} ${d.thickness}`,qty:h,unit:d.salesUnit,query:d.product,category:"insulation"}],b=Object.entries(yw);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:b.map(([w,E])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>i(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:d.product}),(0,be.jsxs)("strong",{children:[h," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(m),disabled:p<=0,children:a})]})]})]})})}var Ln=X(Xe()),Z=X(re()),H_=10,j_=1.9*.762,Q_=1.9*1.524,uc=()=>({height:"",width:""}),pc=e=>Number.parseFloat(e)||0,_w=({height:e,width:t})=>pc(e)*pc(t);function Ad({onBack:e}){let[t,a]=(0,Ln.useState)([uc()]),[r,i]=(0,Ln.useState)([uc()]),[n,o]=(0,Ln.useState)("0"),[l,c]=(0,Ln.useState)("0"),[p,d]=(0,Ln.useState)(1),h=t.reduce((f,u)=>f+_w(u),0),m=r.reduce((f,u)=>f+_w(u),0),b=pc(n)*j_+pc(l)*Q_,w=Math.max(0,h-m-b),E=w*p/H_,U=(f,u,g,v)=>{f(k=>k.map((A,M)=>M===u?{...A,[g]:v}:A))};return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)("div",{className:"truss-estimator",children:[(0,Z.jsxs)("div",{className:"quick-order-hero",children:[(0,Z.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Z.jsx)("h1",{children:"Paint Calculator"}),(0,Z.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,Z.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,Z.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,Z.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),t.map((f,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:g=>U(a,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:g=>U(a,u,"width",g.target.value)})]}),t.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((v,k)=>k!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(f=>[...f,uc()]),children:"+ Add another wall"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),r.map((f,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:g=>U(i,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:g=>U(i,u,"width",g.target.value)})]}),r.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(g=>g.filter((v,k)=>k!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(f=>[...f,uc()]),children:"+ Add another area"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,Z.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:n,onChange:f=>o(f.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Double doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:f=>c(f.target.value)})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Number of coats"}),(0,Z.jsxs)("select",{value:p,onChange:f=>d(Number(f.target.value)),children:[(0,Z.jsx)("option",{value:"1",children:"1 coat"}),(0,Z.jsx)("option",{value:"2",children:"2 coats"}),(0,Z.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__totals",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,Z.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paintable area"}),(0,Z.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Coverage"}),(0,Z.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paint required"}),(0,Z.jsxs)("strong",{children:[E.toFixed(1)," litres"]})]})]}),(0,Z.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,Z.jsxs)("div",{className:"paint-calculator__actions",children:[(0,Z.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,Z.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var br=X(Xe()),ie=X(re()),dc=e=>Number.parseFloat(e)||0,Rd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Ud({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,br.useState)("paving"),[n,o]=(0,br.useState)("council"),[l,c]=(0,br.useState)(""),[p,d]=(0,br.useState)(""),[h,m]=(0,br.useState)("100"),[b,w]=(0,br.useState)("50"),[E,U]=(0,br.useState)(!0),[f,u]=(0,br.useState)(!0),g=dc(l)*dc(p),v=g,k=g*(dc(h)/1e3),A=g*.04,M=g*(dc(b)/1e3),z=Math.ceil(v/.36),Y=Math.ceil(v/.1),P=Math.ceil(k*1700/800),ge=Math.ceil(A*1600/800),Ae=Math.ceil(M*1600/800),De=r==="paving"?{qty:z,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Ae,unit:"bag"},Pe={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],ze=[{key:`surface-${n}`,label:Rd[r].find(G=>G.id===n)?.label??"Surface material",qty:De.qty,unit:De.unit,query:Pe,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:P,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:ge,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{className:"truss-estimator",children:[(0,ie.jsxs)("div",{className:"quick-order-hero",children:[(0,ie.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ie.jsx)("h1",{children:"Paving & Driveway Calculator"}),(0,ie.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ie.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([G,ce,ye])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===G?" is-selected":""}`,onClick:()=>{i(G),o(Rd[G][0].id)},children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:ce}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:ye})]},G))}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Finish"}),(0,ie.jsx)("select",{value:n,onChange:G=>o(G.target.value),children:Rd[r].map(G=>(0,ie.jsx)("option",{value:G.id,children:G.label},G.id))})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ie.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:G=>c(G.target.value)})]}),(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Width (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:G=>d(G.target.value)})]})]}),r==="gravel"&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Gravel depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:G=>w(G.target.value)})]}),E&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:G=>m(G.target.value)})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:E,onChange:G=>U(G.target.checked)}),(0,ie.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:f,onChange:G=>u(G.target.checked)}),(0,ie.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ie.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Surface area"}),(0,ie.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ie.jsx)("strong",{children:r==="paving"?`${z} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Ae} bulk bags`})]}),E&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"MOT Type 1"}),(0,ie.jsxs)("strong",{children:[P," bulk bags"]})]}),f&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Sharp sand"}),(0,ie.jsxs)("strong",{children:[ge," bulk bags"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ie.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ie.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ie.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(ze),disabled:g<=0,children:a})]})]})]})})}var ol=X(Xe()),oe=X(re()),G_=2.88,xw=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],kw=()=>({length:"",height:""}),Dd=e=>Number.parseFloat(e)||0;function Bd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ol.useState)([kw()]),[n,o]=(0,ol.useState)(""),[l,c]=(0,ol.useState)("standard"),[p,d]=(0,ol.useState)("screws"),h=r.reduce((A,M)=>A+Dd(M.length)*Dd(M.height),0),m=Math.max(0,h-Dd(n)),b=Math.ceil(m/G_),w=Math.ceil(m*12),E=Math.ceil(w/1e3),U=Math.ceil(m*1.2),f=Math.ceil(U/90),u=Math.ceil(m/3.5),g=xw.find(A=>A.id===l)?.label??"Standard",v=[{key:"board",label:`${g} plasterboard`,qty:b,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],k=(A,M,z)=>{i(Y=>Y.map((P,ge)=>ge===A?{...P,[M]:z}:P))};return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,oe.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,oe.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:xw.map(A=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===A.id?" is-selected":""}`,onClick:()=>c(A.id),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:A.label}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:A.blurb})]},A.id))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([A,M,z])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===A?" is-selected":""}`,onClick:()=>d(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:M}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:z})]},A))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,oe.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,oe.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,oe.jsx)("span",{children:"Surface"}),(0,oe.jsx)("span",{children:"Length (m)"}),(0,oe.jsx)("span",{children:"Height (m)"}),(0,oe.jsx)("span",{})]}),r.map((A,M)=>(0,oe.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,oe.jsxs)("span",{children:["Surface ",M+1]}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} length`,type:"number",min:"0",step:"0.01",value:A.length,onChange:z=>k(M,"length",z.target.value)}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:z=>k(M,"height",z.target.value)}),r.length>1?(0,oe.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(z=>z.filter((Y,P)=>P!==M)),children:"Remove"}):null]},`surface-${M}`)),(0,oe.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(A=>[...A,kw()]),children:"+ Add another surface"}),(0,oe.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,oe.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,oe.jsx)("small",{children:"optional"})]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:A=>o(A.target.value)})]})]}),(0,oe.jsxs)("div",{className:"materials-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Board area"}),(0,oe.jsxs)("strong",{children:[m.toFixed(2)," m\xB2"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,oe.jsx)("strong",{children:b})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,oe.jsx)("strong",{children:p==="screws"?`${w} (${E} boxes)`:`${u} bags`})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Joint tape"}),(0,oe.jsxs)("strong",{children:[U," m (",f," rolls)"]})]})]}),(0,oe.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,oe.jsxs)("div",{className:"materials-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:m<=0,children:a})]})]})]})})}var ll=X(Xe());var y=X(re()),At={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},mc=["range","pitchAndDimensions","quantityAndGirders","bracing"],Y_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function V_({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function X_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(d,h,m,b,w=8,E)=>{let U=m-d,f=b-h,u=Math.hypot(U,f)||1,g=-f/u,v=U/u,k=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:d,y1:h,x2:m,y2:b,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:d,y1:h,x2:m,y2:b,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:d-g*k,y1:h-v*k,x2:m-g*k,y2:b-v*k,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(d,h,m)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:d-7.5,y:h-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:d-4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d+4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d-4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d+4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d,cy:h,r:"1",fill:n})]},m),c=(d,h)=>(0,y.jsx)("rect",{x:d-9,y:"110",width:"18",height:"10",fill:a},h),p=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function $_({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function Nw({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Od({onBack:e}){let[t,a]=(0,ll.useState)(0),[r,i]=(0,ll.useState)(Y_),[n,o]=(0,ll.useState)(!1),[l,c]=(0,ll.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},h=(()=>{let f=r.range?At.ranges[r.range]:At.ranges.standard,u=r.pitch??"22.5",g=At.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,A=(Number.parseFloat(r.overhangMM)||0)>At.overhang.thresholdMM,M=p(),z=M+r.girderCount,Y=Number.parseFloat(r.roofLengthM)||0,P=r.treatment?At.treatment[r.treatment]:At.treatment.untreated,ge=At.estimate.ranges[r.range??"standard"],Ae=ge.supplyAt8m*Math.max(.7,v/8)*g*(1+P.surchargePct)+(A?At.overhang.surchargePerTruss:0),De=M*Ae,Pe=r.girderCount*Ae*At.estimate.girderMultiplier,ze=r.bracing==="yes"?Y*At.estimate.bracingPerMetre:0,me=De+Pe+ze+At.estimate.delivery,G=At.estimate.design+M*ge.installPerTruss+r.girderCount*40,ce=me+G,ye=ce*.2;return{range:f,count:M,girderCount:r.girderCount,overhangApplies:A,overhangUnits:z,roofLengthM:Y,treatment:P,trussSupply:De,bracingMaterials:ze,delivery:At.estimate.delivery,labour:G,subtotal:ce,vat:ye,total:ce+ye}})(),m=()=>{let f=mc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===mc.length-1?"View truss request":"Next",w=()=>{n?o(!1):t===0?e():a(f=>f-1)},E=()=>{m()&&(t===mc.length-1?(c(!1),o(!0)):a(f=>f+1))},U=()=>{let f=mc[t];return f==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(At.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(v=>({...v,range:u})),children:[(0,y.jsx)(X_,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(g=>({...g,spanMM:u.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",At.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:At.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(g=>({...g,pitch:u})),children:[(0,y.jsx)(V_,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(g=>({...g,roofLengthM:u.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:At.centresOptions.map(u=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(g=>({...g,centres:u})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(g=>({...g,bracing:u.id})),children:[(0,y.jsx)($_,{enabled:u.id==="yes"}),(0,y.jsx)("span",{children:u.label})]},u.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(Nw,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(Nw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[h.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[h.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:h.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:h.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:ot(h.trussSupply)})]}),h.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:ot(h.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:ot(h.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:ot(h.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:ot(h.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:ot(h.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:ot(h.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:U()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!m(),children:[(0,y.jsx)("span",{children:b}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Ht,{})})]})]})]})]})})}var Ci=X(Xe()),I=X(re()),qw=e=>Number.parseFloat(e)||0,fc=(e,t)=>qw(e)*(t==="m"?1:.3048),Sw=()=>({length:"",width:""}),Cw=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function Z_({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Ld({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ci.useState)("total"),[n,o]=(0,Ci.useState)("m"),[l,c]=(0,Ci.useState)(""),[p,d]=(0,Ci.useState)([Sw()]),[h,m]=(0,Ci.useState)(""),[b,w]=(0,Ci.useState)("chamfered"),E="4.2",U=r==="total"?fc(l,n):p.reduce((k,A)=>k+2*(fc(A.length,n)+fc(A.width,n)),0),f=Math.max(0,U-fc(h,n)),u=Math.ceil(f/qw(E)),g=[{key:`skirting-${b}`,label:`${Cw.find(k=>k.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],v=(k,A,M)=>{d(z=>z.map((Y,P)=>P===k?{...Y,[A]:M}:Y))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:k=>c(k.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",n,")"]}),(0,I.jsxs)("span",{children:["Width (",n,")"]}),(0,I.jsx)("span",{})]}),p.map((k,A)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",A+1]}),(0,I.jsx)("input",{"aria-label":`Room ${A+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:k.length,onChange:M=>v(A,"length",M.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${A+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:k.width,onChange:M=>v(A,"width",M.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>d(M=>M.filter((z,Y)=>Y!==A)),children:"Remove"}):null]},`room-${A}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(k=>[...k,Sw()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:k=>m(k.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:Cw.map(k=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===k.id?" is-selected":""}`,onClick:()=>w(k.id),children:[(0,I.jsx)(Z_,{profile:k.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:u})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:f<=0,children:a})]})]})]})})}var Hn=X(Xe()),le=X(re()),sl=e=>Number.parseFloat(e)||0;function Hd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Hn.useState)("studs"),[n,o]=(0,Hn.useState)(""),[l,c]=(0,Hn.useState)(""),[p,d]=(0,Hn.useState)("600"),[h,m]=(0,Hn.useState)("2.4"),b=n&&l&&p?Math.ceil(sl(l)/(sl(p)/1e3))+1:0,w=b*sl(n),E=sl(h)>0?Math.ceil(w/sl(h)):0,U=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},g={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)("div",{className:"truss-estimator",children:[(0,le.jsxs)("div",{className:"quick-order-hero",children:[(0,le.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,le.jsx)("h1",{children:"Timber Calculator"}),(0,le.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,le.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,le.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,le.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(v=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:f[v][0]}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:f[v][1]})]},v))})]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:[g.member," (m)"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:[g.overall," (m)"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsx)("span",{children:"Centres (mm)"}),(0,le.jsxs)("select",{value:p,onChange:v=>d(v.target.value),children:[(0,le.jsx)("option",{value:"300",children:"300 mm"}),(0,le.jsx)("option",{value:"400",children:"400 mm"}),(0,le.jsx)("option",{value:"450",children:"450 mm"}),(0,le.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsx)("span",{children:"Stock length (m)"}),(0,le.jsxs)("select",{value:h,onChange:v=>m(v.target.value),children:[(0,le.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,le.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,le.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,le.jsxs)("div",{className:"materials-calculator__totals",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,le.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:g.count}),(0,le.jsx)("strong",{children:b})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Linear metres"}),(0,le.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,le.jsxs)("div",{children:[(0,le.jsxs)("span",{children:[h," m lengths"]}),(0,le.jsx)("strong",{children:E})]})]}),(0,le.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,le.jsxs)("div",{className:"materials-calculator__actions",children:[(0,le.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,le.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:w<=0,children:a})]})]})]})})}var jd=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Od},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Td},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Md},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Nd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Ad},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Ld},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:kd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:qd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Bd},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:zd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Hd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Ud}];var hc=X(Xe());var Ve=X(Xe());var N=X(re()),K_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Qd={wasteFactorEnabled:!0},P_=3e3,Ew=null;function gc(e,t){let a=Wo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function J_(e){return e&&e.length>0?e.join(" x "):"-"}function Gd({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=ec(),o=`${e}~${t.map(S=>`${S.key}|${S.query}|${S.category??""}|${S.qty}`).join("~")}`,l=o!==Ew,[c,p]=(0,Ve.useState)(null),[d,h]=(0,Ve.useState)([]),[m,b]=(0,Ve.useState)(l),[w,E]=(0,Ve.useState)(null),[U,f]=(0,Ve.useState)("tile"),[u,g]=(0,Ve.useState)(null),[v,k]=(0,Ve.useState)(""),[A,M]=(0,Ve.useState)(null),[z,Y]=(0,Ve.useState)(""),[P,ge]=(0,Ve.useState)([]),[Ae,De]=(0,Ve.useState)(new Set),[Pe,ze]=(0,Ve.useState)(null),[me,G]=(0,Ve.useState)(""),[ce,ye]=(0,Ve.useState)([]),ut=(0,Ve.useRef)(null),ve=(0,Ve.useRef)(!1),Be=S=>`${e}:${S}`,je=S=>Pr(S.chosen,{lineId:Be(S.requirement.key),description:S.requirement.label,unit:S.requirement.unit,qty:S.requirement.qty}),Me=(0,Ve.useMemo)(()=>t.map(S=>`${S.key}|${S.query}|${S.category??""}`).join("~"),[t]);(0,Ve.useEffect)(()=>{let S=!1;return gw().then(V=>{S||p(V.itemCount>0)}).catch(()=>{S||p(!1)}),()=>{S=!0}},[]),(0,Ve.useEffect)(()=>{if(!a||!c)return;let S=!1,V;l&&b(!0),E(null);let K=Date.now();return(async()=>{let pe=null;try{pe=(await fw(t)).map(({requirement:We,candidates:xt})=>({requirement:We,candidates:xt,chosen:xt[0]??null}))}catch(ke){S||E(ke instanceof Error?ke.message:"Could not load products")}if(!S){if(Ew=o,l){let ke=P_-(Date.now()-K);ke>0&&await new Promise(We=>{V=window.setTimeout(We,ke)})}S||(pe&&(h(pe),!ve.current&&n&&(ve.current=!0,n.addManyToCart(pe.filter(ke=>ke.chosen).map(je)))),b(!1))}})(),()=>{S=!0,window.clearTimeout(V)}},[a,c,Me]),(0,Ve.useEffect)(()=>{if(!A)return;let S=z.trim();if(!S){ge([]);return}let V=!1,K=window.setTimeout(()=>{Fr(S).then(pe=>{V||ge(pe)}).catch(()=>{V||ge([])})},250);return()=>{V=!0,window.clearTimeout(K)}},[A,z]),(0,Ve.useEffect)(()=>{if(!Pe)return;let S=me.trim();if(!S){ye([]);return}let V=!1,K=window.setTimeout(()=>{Fr(S).then(pe=>{V||ye(pe)}).catch(()=>{V||ye([])})},250);return()=>{V=!0,window.clearTimeout(K)}},[Pe,me]);let W=(0,Ve.useMemo)(()=>{let S=v.trim().toLowerCase(),V=S?d.filter(K=>K.requirement.label.toLowerCase().includes(S)||(K.chosen?.description??"").toLowerCase().includes(S)||(K.chosen?.product_id??"").toLowerCase().includes(S)):d;return u?[...V].sort((K,pe)=>{let ke=K.requirement.label.localeCompare(pe.requirement.label);return u==="asc"?ke:-ke}):V},[d,v,u]),_e=W.filter(S=>S.chosen),Oe=W.filter(S=>!S.chosen),Se=d.filter(S=>S.chosen),Je=Se.filter(S=>S.chosen?.price==null).length,_t=Se.reduce((S,V)=>S+(Ut(je(V),Qd).lineTotal??0),0);if((0,Ve.useEffect)(()=>{i?.(_t)},[_t,i]),!a||c===!1)return null;let C=n?Se.filter(S=>n.cart[Be(S.requirement.key)]).length:0,B=Pe?d.find(S=>S.requirement.key===Pe)??null:null,D=me.trim()?ce:B?.candidates??[],ee=S=>{let V=A===S.requirement.key;M(V?null:S.requirement.key),Y(V?"":S.requirement.query)},xe=(S,V)=>{let K=d.find(pe=>pe.requirement.key===S);h(pe=>pe.map(ke=>ke.requirement.key===S?{...ke,chosen:V}:ke)),n&&K&&n.cart[Be(S)]&&n.addToCart(je({...K,chosen:V})),M(null),Y("")},we=S=>{h(V=>V.map(K=>K.requirement.key===S?{...K,chosen:null}:K)),n?.cart[Be(S)]&&n.removeFromCart(Be(S))},_=S=>{ze(S.requirement.key),G(""),ye([])},j=()=>{ze(null),G(""),ye([])},L=S=>{if(!n)return;let V=Be(S.requirement.key);n.cart[V]?n.removeFromCart(V):n.addToCart(je(S))},ne=S=>{De(V=>{let K=new Set(V);return K.has(S)?K.delete(S):K.add(S),K})},te=S=>{let V=P.length>0?P:S.candidates;return(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",value:z,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:K=>Y(K.target.value),"aria-label":`Search a product for ${S.requirement.label}`}),(0,N.jsxs)("div",{className:"estimator-products__options",children:[V.map(K=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${K.product_id===S.chosen?.product_id?" is-selected":""}`,onClick:()=>xe(S.requirement.key,K),children:[(0,N.jsx)("span",{children:K.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[K.product_id,K.price!=null&&` \xB7 ${ot(K.price)}`]})]},K.product_id)),V.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,N.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!m&&(0,N.jsxs)("div",{className:"estimator-products__head",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Matched Products"}),(0,N.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!B&&(0,N.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[Je>0&&(0,N.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,N.jsx)("strong",{children:Je})," need pricing"]}),(0,N.jsxs)("div",{className:"estimator-products__controls",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:S=>k(S.target.value),"aria-label":"Search matched products"}),(0,N.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="tile"?" is-active":""}`,"aria-pressed":U==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,N.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,N.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="list"?" is-active":""}`,"aria-pressed":U==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,N.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,N.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,N.jsxs)("details",{ref:ut,style:{position:"relative"},children:[(0,N.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,N.jsx)("div",{className:"sort-menu-panel",children:K_.map(S=>{let V=u===S.dir;return(0,N.jsxs)("button",{type:"button",className:`sort-menu-item${V?" is-active":""}`,onClick:()=>{g(V?null:S.dir),ut.current?.removeAttribute("open")},children:[(0,N.jsx)("span",{className:"sort-menu-item__check",children:V?"\u2713":""}),S.label]},S.dir)})})]})]})]})]}),B&&(0,N.jsxs)("div",{className:"results-review-page",children:[(0,N.jsxs)("div",{className:"results-review-page__top",children:[(0,N.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:j,children:[(0,N.jsx)(Kr,{}),"Back to results"]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,N.jsx)("div",{className:"results-review-searchbar",children:(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:me,onChange:S=>G(S.target.value),"aria-label":`Search a product for ${B.requirement.label}`})}),B.chosen&&(0,N.jsx)("div",{className:"results-candidate-actions",children:(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(B.requirement.key),children:"Clear selected product"})})]})]}),(0,N.jsxs)("div",{className:"results-review-page__hero",children:[(0,N.jsx)("div",{className:"results-review-page__image-wrap",children:(0,N.jsx)("img",{className:"fill-img results-review-page__image",src:Ya(B.chosen?.description||B.requirement.label,B.chosen?.product_id,B.chosen?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-review-page__summary",children:[(0,N.jsx)("h2",{children:B.requirement.label}),(0,N.jsxs)("p",{className:"results-review-page__meta",children:[yi(B.requirement.qty)," ",Na(B.requirement.unit,B.requirement.qty)]}),B.chosen?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"results-review-page__product",children:B.chosen.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[B.chosen.product_id,B.chosen.price!=null?` \xB7 ${gc(B.chosen.price,B.chosen.price_basis)}`:""]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,N.jsx)("div",{className:"results-review-page__actions",children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[Be(B.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(B),disabled:!B.chosen||!n,children:n?.cart[Be(B.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),D.length===0?(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,N.jsxs)("table",{className:"score-breakdown-table",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:"Product"}),(0,N.jsx)("th",{children:"Dims (mm)"}),(0,N.jsx)("th",{children:"Price"}),(0,N.jsx)("th",{"aria-label":"Actions"})]})}),(0,N.jsx)("tbody",{children:D.map(S=>{let V=S.product_id===B.chosen?.product_id;return(0,N.jsxs)("tr",{className:V?"score-breakdown-row--best":"",children:[(0,N.jsxs)("td",{children:[(0,N.jsx)("div",{children:S.description}),(0,N.jsx)("div",{className:"results-row-meta",children:S.product_id})]}),(0,N.jsx)("td",{children:(0,N.jsx)("span",{className:"unit-badge",children:J_(S.measurements_mm)})}),(0,N.jsx)("td",{children:S.price!=null?gc(S.price,S.price_basis):"-"}),(0,N.jsx)("td",{children:(0,N.jsxs)("label",{className:"switch-toggle",title:V?"Currently selected":"Use this candidate",children:[(0,N.jsx)("input",{type:"checkbox",checked:V,onChange:()=>{V?we(B.requirement.key):xe(B.requirement.key,S)},"aria-label":V?`${S.description} selected`:`Use ${S.description}`}),(0,N.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},S.product_id)})})]})]}),!B&&m&&(0,N.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,N.jsx)(fr,{}),(0,N.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!B&&w&&(0,N.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!B&&!m&&!w&&W.length===0&&d.length>0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!B&&!m&&!w&&U==="tile"&&_e.length>0&&(0,N.jsx)("div",{className:"results-tile-grid",children:_e.map(S=>{let{requirement:V,chosen:K}=S,pe=K?Ut(je(S),Qd):null,ke=n?!!n.cart[Be(V.key)]:!1;return(0,N.jsxs)("article",{className:"results-tile-card",children:[(0,N.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>_(S),"aria-label":`Review match for ${V.label}`,children:[(0,N.jsx)("div",{className:"results-tile-card__media",children:(0,N.jsx)("img",{className:"fill-img results-tile-card__image",src:Ya(K?.description||V.label,K?.product_id,K?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-tile-card__body",children:[K?(0,N.jsxs)("div",{className:"results-tile-card__heading",children:[(0,N.jsx)("div",{className:"results-tile-card__title",children:K.description}),(0,N.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,N.jsx)("span",{children:K.product_id}),K.price!=null?(0,N.jsx)("span",{children:gc(K.price,K.price_basis)}):null]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,N.jsxs)("div",{className:"results-tile-card__match",children:[(0,N.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,N.jsx)("div",{className:"results-tile-card__match-name",children:V.label}),(0,N.jsxs)("div",{className:"results-tile-card__meta",children:[yi(V.qty)," ",Na(V.unit,V.qty)]}),pe?.requiredSellUnits!=null?(0,N.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${ot(pe.lineTotal)}`:""]}):K?(0,N.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,N.jsxs)("div",{className:"results-tile-card__actions",children:[(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>_(S),children:"Review"}),(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(S),disabled:!K||!n,children:ke?"\u2713 Added":"+ Add"})]})]},V.key)})}),!B&&!m&&!w&&U==="list"&&_e.length>0&&(0,N.jsx)("div",{className:"bom-table-wrap",children:(0,N.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,N.jsxs)("colgroup",{children:[(0,N.jsx)("col",{style:{width:"56px"}}),(0,N.jsx)("col",{className:"col-item"}),(0,N.jsx)("col",{style:{width:"90px"}}),(0,N.jsx)("col",{style:{width:"80px"}}),(0,N.jsx)("col",{style:{width:"220px"}}),(0,N.jsx)("col",{style:{width:"110px"}})]}),(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{className:"bom-col-header",children:[(0,N.jsx)("th",{"aria-label":"Expand"}),(0,N.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,N.jsx)("tbody",{children:_e.map(S=>{let{requirement:V,chosen:K}=S,pe=K?Ut(je(S),Qd):null,ke=n?!!n.cart[Be(V.key)]:!1,We=Ae.has(V.key);return(0,N.jsxs)(Ve.Fragment,{children:[(0,N.jsxs)("tr",{className:"bom-row",children:[(0,N.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,N.jsx)("button",{type:"button",className:"link-btn",onClick:()=>ne(V.key),"aria-expanded":We,"aria-label":We?"Collapse product options":"Expand product options",children:We?"\u25BE":"\u25B8"})}),(0,N.jsxs)("td",{style:{paddingLeft:0},children:[(0,N.jsx)("div",{className:"bom-component-name",children:V.label}),pe?.requiredSellUnits!=null&&(0,N.jsxs)("div",{className:"results-row-meta",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${ot(pe.lineTotal)}`:""]})]}),(0,N.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:yi(V.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:Na(V.unit,V.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:K?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"bom-component-name",children:K.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[K.product_id,K.price!=null&&` \xB7 ${gc(K.price,K.price_basis)}`]})]}):(0,N.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(S),disabled:!K||!n,children:ke?"\u2713 Added":"+ Add"})})]}),We&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:A===V.key?te(S):(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsxs)("div",{className:"estimator-products__options",children:[S.candidates.map(xt=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${xt.product_id===K?.product_id?" is-selected":""}`,onClick:()=>xe(V.key,xt),children:[(0,N.jsx)("span",{children:xt.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[xt.product_id,xt.price!=null&&` \xB7 ${ot(xt.price)}`]})]},xt.product_id)),S.candidates.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ee(S),children:"Search the catalogue"})]})})})]},V.key)})})]})}),!B&&!m&&!w&&Oe.length>0&&(0,N.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Require Matching"}),(0,N.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,N.jsx)("div",{className:"results-unmatched-list",children:Oe.map(S=>(0,N.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>_(S),children:[(0,N.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,N.jsx)("span",{className:"results-unmatched-card__title",children:S.requirement.label}),(0,N.jsxs)("span",{className:"results-row-meta",children:[yi(S.requirement.qty)," ",Na(S.requirement.unit,S.requirement.qty)]})]}),(0,N.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},S.requirement.key))})]}),!m&&!w&&d.length>0&&(0,N.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,N.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,N.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!B&&!m&&!w&&(r||C>0)&&(0,N.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,N.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),C>0&&n&&(0,N.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,N.jsxs)("span",{children:["View Basket (",C,")"]}),(0,N.jsx)("span",{className:"arrow",children:(0,N.jsx)(Ht,{})})]})]})]})}var jt=X(re());function Yd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,hc.useState)(0),o=(0,hc.useCallback)(l=>n(l),[]);return(0,jt.jsx)(jt.Fragment,{children:(0,jt.jsxs)("div",{className:"truss-estimator",children:[(0,jt.jsxs)("div",{className:"quick-order-hero",children:[(0,jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,jt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,jt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,jt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,jt.jsx)("strong",{children:ot(i)})," Est. total"]})]}),(0,jt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,jt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,jt.jsx)(Gd,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var F_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function Mw(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let i=F_(e,r);return i?{key:r.key,productId:i,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var Vd=X(Xe());var Jt=X(re()),I_=1500;function Tw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=zn(),[i,n]=(0,Vd.useState)(!1),[o,l]=(0,Vd.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,d)=>{let h=Date.now();n(!0),l(null);try{let m=await Promise.all(p.filter(w=>w.qty>0).map(async w=>{let E=(await Fr(w.productId)).find(U=>U.product_id===w.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return Pr(E,{lineId:`${e}:${w.key}`,description:E.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:d})})),b=I_-(Date.now()-h);b>0&&await new Promise(w=>window.setTimeout(w,b)),a(),t(m),r()}catch(m){l(m instanceof Error?m.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function zw({toolTitle:e}){return(0,Jt.jsx)(Jt.Fragment,{children:(0,Jt.jsxs)("div",{className:"truss-estimator",children:[(0,Jt.jsxs)("div",{className:"quick-order-hero",children:[(0,Jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Jt.jsx)("h1",{children:"Your Materials"}),(0,Jt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Jt.jsx)("div",{className:"truss-estimator__card",children:(0,Jt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Jt.jsx)(fr,{}),(0,Jt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Ue=X(re());function bc(e){let[t,a]=(0,Xa.useState)(!1);return(0,Ue.jsx)(Ws,{onOpenBasket:()=>a(!0),children:(0,Ue.jsx)(W_,{...e,showBasket:t,onShowBasket:a})})}function W_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,Xa.useState)(null),[l,c]=(0,Xa.useState)(null),p=jd.find(z=>z.id===n),{cart:d,updateCartQty:h,updateCartSellUnits:m,updateCartConversions:b,removeFromCart:w,clearCart:E}=zn(),{adding:U,basketError:f,addToBasket:u}=Tw(p?.title??"calculator"),g=(0,Xa.useRef)(null),v=Ys("estimating-tools",g);(0,Xa.useEffect)(()=>{v("viewed")},[v]);let k=r?"basket":U?"adding":l?"review":n??"list",A=(0,Xa.useRef)(k);(0,Xa.useEffect)(()=>{A.current!==k&&(A.current=k,window.scrollTo(0,0))},[k]);let M=z=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:z.length});let Y=Mw(p.id,z);Y?u(Y,z[0]?.calculatorWasteIncluded??!1):c(z)};return(0,Ue.jsx)(Ko.Provider,{value:v,children:(0,Ue.jsx)("div",{ref:g,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:Ra().theme,children:(0,Ue.jsx)("main",{className:"main-content",children:r?(0,Ue.jsx)(nl,{cart:d,onUpdateQty:h,onUpdateSellUnits:m,onResolveConversions:b,onRemove:w,onBack:()=>i(!1),onStartNewQuote:()=>{E(),o(null),c(null),i(!1)},internal:a}):U&&p?(0,Ue.jsx)(zw,{toolTitle:p.title}):p?(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)("div",{hidden:l!==null,children:(0,Ue.jsx)(p.Component,{onBack:()=>o(null),onReview:M})}),f&&(0,Ue.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,Ue.jsx)(Yd,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Ue.jsx)(Ue.Fragment,{children:(0,Ue.jsxs)("div",{className:"quick-order-card",children:[(0,Ue.jsxs)("div",{className:"quick-order-hero",children:[(0,Ue.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Ue.jsx)("h1",{children:"Estimating Tools"}),(0,Ue.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Ue.jsxs)("div",{className:"quick-order-alt",children:[(0,Ue.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Ue.jsx)("div",{className:"estimator-tools-grid",children:jd.map(z=>(0,Ue.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:z.id}),o(z.id),c(null)},children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Ue.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Pt(z.imageUrl),alt:""})}),(0,Ue.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__title",children:z.title}),(0,Ue.jsx)("span",{className:"estimator-tool-card__desc",children:z.desc})]})]},z.id))})]})]})})})})})}var vc=X(re());function Xd({config:e,children:t}){return Pb(e),(0,vc.jsx)(vc.Fragment,{children:t})}var $d=X(re()),ex="https://api.metronlabs.ai",tx=["client","api-key","api-url","theme","hide-header","analytics"],ax=["all","events-only","none"];function Rw(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.43",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
|
|
6803
|
+
`)}function Pr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty,linkedContext:t.linkedContext}}var ew=e=>(e??"").trim().toLowerCase(),I1={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},hd=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),Jv=new Set(["box","bag","pack","pallet","roll","set","tub"]),Fv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Iv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,_i=e=>{let t=ew(e);return I1[t]??t},ct=(e,t)=>{let a=_i(e),r=_i(t);return a.length>0&&a===r},W1=(e,t)=>{let a=ew(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},e_=e=>(e??"").split(",").map(t=>_i(t)).filter(Boolean),t_=(e,t)=>{let a=e_(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||ct(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||ct(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||ct(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Wv=(e,t)=>ct(t,"pallet")?e.itemsPerPallet??null:ct(t,"pack")?e.itemsPerPack??null:ct(t,"box")?e.itemsPerBox??null:null,a_=(e,t,a)=>{if(!ct(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!ct(r[3],a))return null;let i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function Js(e,t){return e.reduce((a,r)=>a+(Ut(r,t).lineTotal??0),0)}function Ut(e,t){let a=e.qty,r=_i(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=_i(e.unit)||(a>0&&hd.has(r)?r:"-"),n=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?hd.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=v=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${r}.`:v,costingMode:"review"});if(!t_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let d=null,h="review",m=e.roundingRule,b=`Quantity review required, initial request needed ${a} ${i}.`,w=1+o,E=a_(e,i,r),U=e.unitConversions?.find(v=>ct(v.requestUom,i));if(!!e.saleUnit&&(ct(i,r)||!!U||ct(i,"each")&&!Jv.has(r)))if(ct(i,r))d=a*w/n,h="direct",b=`${a} ${i}${o>0?` x ${w}`:""}`;else if(U){d=a*w/U.quantityPerSaleUnit,h="derived";let v=1/U.quantityPerSaleUnit,k=Math.round(v);b=ct(r,"each")&&U.quantityPerSaleUnit<1&&Math.abs(v-k)<1e-9?`${a} ${i}${o>0?` x ${w}`:""} x ${k} per ${i}`:`${a} ${i}${o>0?` x ${w}`:""} / ${U.quantityPerSaleUnit} ${i} per ${r}`}else ct(i,"each")&&!Jv.has(r)&&(d=a*w/n,h="derived",b=`${a} ${r}${o>0?` x ${w}`:""}`);else if(ct(i,r)&&n>0)d=a*w/n,h="direct",b=o>0?`${a} ${i} x ${w} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(ct(i,"each")&&n>0&&hd.has(r))d=a*w/n,h="derived",b=o>0?`${a} each x ${w} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(Wv(e,i)!=null&&n>0){let v=Wv(e,i)??0;d=a*v*w/n,h="derived";let k=`${a} ${i} x ${v} each${o>0?` x ${w}`:""}`;b=n===1&&ct(r,"each")?k:`${k} / ${n} each per ${r}`}else if(E!=null)d=a*w/E,h="derived",m??(m="round_up_each"),b=`${a} m2 x ${w} / ${E} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(d=a*w/n,h="derived",b=`${a} ${i}${o>0?` x ${w}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;ct(i,"m2")&&v!=null&&v>0&&(d=a*w/v,h="derived",b=`${a} m2 x ${w} / ${v} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;ct(i,"m2")&&v!=null&&v>0?(d=a/v,h="derived",b=`${a} m2 / ${v} m2 per sell unit`):ct(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(d=a*e.itemsPerM2*w/n,h="derived",b=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${w} / ${n}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;ct(i,"m")&&v!=null&&v>0&&(d=a*w/v,h="derived",b=`${a} m x ${w} / ${v} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let v=Fv(a,i),k=Fv(e.coverageQty??0,_i(e.coverageUom));v!=null&&k!=null&&k>0&&(d=v*w/k,h="derived",b=`${a} ${i} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"){let v=Iv(a,i),k=Iv(e.coverageQty??0,_i(e.coverageUom));v!=null&&k!=null&&k>0&&(d=v*w/k,h="derived",b=`${a} ${i} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;ct(i,"m3")&&v!=null&&v>0&&(d=a/v,h="derived",b=`${a} m3 / ${v} m3 per ${r}`)}}if(d==null||!Number.isFinite(d)||d<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let u=W1(d,m),g=l?c:u;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:u,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${b} = ${u} ${r} (manually set to ${g})`:`${b} = ${g} ${r}`,costingMode:h}}var tw=()=>import("./xlsx-K4MOA2QM.js"),tl=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],r_=tl.indexOf("Line total");function i_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function aw(e){let t=await tw(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[tl],n=0;for(let c of e){let{item:p,best:d,qty:h,band:m,unmatchable:b,decision:w}=c,E=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),U=!b&&d?.price!=null?d.price*h:null;U!=null&&(n+=U),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",E,h,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",b?"-":d?.product_id??w?.selected_candidate_id??"-",b?"-":d?.description??"-",b?"-":d?.price_basis??"-",b?null:d?.price??null,U,b?"-":m,i_(c)])}i.push(Array(tl.length).fill(null));let o=Array(tl.length).fill(null);o[0]="Estimated total",o[r_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(tl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var el=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function rw(e,t){let a=await tw(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],el]:[el],o=0;for(let p of e){let d=Ut(p),h=d.lineTotal;h!=null&&(o+=h),n.push([p.productId,p.description,d.costingMode,d.requestedAmount,ka(d.requestedUnit),d.salesUnitSize,ka(d.sellUnit),d.requiredSellUnits,d.unitPrice,h])}n.push(Array(el.length).fill(null));let l=Array(el.length).fill(null);l[0]="Estimated total",l[el.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${i}.xlsx`:`basket-${i}.xlsx`)}var s=V(re()),vd="__none__",al=24,n_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function lw(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var o_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function l_(e,t){if(t!==vd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id)}}function iw(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function s_(e){return e?e.replace(/_/g," "):"not stated"}function c_({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Mn(e,t){if(e==null)return"-";let a=Wo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function wd(e){return e&&e.length>0?e.join(" x "):"-"}function u_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function En(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Jr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}var nw=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function p_(e){let t=new Map;return[...new Set(e.filter(gr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:nw[i%nw.length]})}),t}function gr(e){return!1}function Tn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function bd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function d_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let i=new Map(e.map(o=>[o.product_id,o])),n=r.map(o=>i.get(o)).filter(o=>o!=null);if(a&&!n.some(o=>o.product_id===a)){let o=i.get(a);o&&n.unshift(o)}return[...new Map(n.map(o=>[o.product_id,o])).values()].slice(0,5)}function Fs(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function Is(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function m_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Is(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Is(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Is(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Is(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function f_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,i)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:wd(r.measurements_mm)}),(0,s.jsx)("td",{children:Wo(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function ow({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",En(e.procurement_aliases)],["Retrieval queries",En(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",wd(e.attrs.measurements_mm)],["Stock length",u_(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",En(e.installation_clues)],["System clues",En(e.system_clues)],["Component requirements",En(e.component_requirements)],["Linked group",Tn(e)||"-"],["Flags",En(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([i,n])=>(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function g_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function h_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,i])=>(0,s.jsxs)(Ne.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function b_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:i=!1,linkedGroupMeta:n}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;return i?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),gr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Tn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(ow,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ow,{item:e,result:a}),r&&(0,s.jsx)(g_,{item:e}),r&&(0,s.jsx)(h_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),gr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",n?`Link ${n.token} - `:"",Tn(e)]}):null]}),r&&(0,s.jsx)(f_,{queries:a?.retrieval_debug??[]})]})}function v_({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:d=!1,debugEnabled:h=!1,forceReviewNote:m=!1,linkedGroupMeta:b}){let w=d||o==="detailed",E=h&&o==="detailed",U=w||m?(0,s.jsx)(b_,{item:e,decision:r,result:a,showRetrievalDebug:E,reviewOnly:m&&!w,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||d||o==="detailed"?t:d_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:f.map((u,g)=>{let v=u.product_id===n;return(0,s.jsxs)("tr",{className:v?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:wd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Mn(u.price,u.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(c_,{band:lw(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(u)},"aria-label":v?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function yd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:d=!1}){let h=!d&&Xs()==="QZA6-MRA4",m=h?"quote":"basket",{results:b,lineItems:w,parseReport:E,timings:U}=e,[f,u]=(0,Ne.useState)({}),g=Sn(),[v,k]=(0,Ne.useState)({}),[A,M]=(0,Ne.useState)({}),[z,G]=(0,Ne.useState)(""),[P,ge]=(0,Ne.useState)(null),[Ae,De]=(0,Ne.useState)(1),Pe=Ra().debug===!0,[ze,me]=(0,Ne.useState)("simple"),[Y,ce]=(0,Ne.useState)(d?"list":"tile"),[ye,ut]=(0,Ne.useState)(!1),[ve,Be]=(0,Ne.useState)(null),[je,Me]=(0,Ne.useState)(""),[W,_e]=(0,Ne.useState)([]),[Oe,Se]=(0,Ne.useState)(!1),[Je,_t]=(0,Ne.useState)(null),[q,B]=(0,Ne.useState)(!1),[T,D]=(0,Ne.useState)(null),ee=(0,Ne.useRef)(null),[xe,we]=(0,Ne.useState)(new Set),[_,j]=(0,Ne.useState)(new Set),[L,ne]=(0,Ne.useState)(!1);(0,Ne.useEffect)(()=>{De(1)},[z,P,Y]);let te=new Map(b.map(x=>[x.line_id,x])),C=p_(w),X=w.map(x=>{let H=te.get(x.line_id),he=H?.decision,mt=o_(x),Fe=f[x.line_id],It=l_(H,Fe),Ti=a[x.line_id],Gw=Fe===vd?void 0:v[x.line_id]??(Ti&&Ti.productId!==It?.product_id?iw(Ti):It),im=mt?void 0:Gw,Yw=x.qty??0;return{item:x,result:H,decision:he,unmatchable:mt,best:im,qty:Yw,band:lw(im?.scores?.overall)}}),K=Js(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),pe=0;for(let x of X){if(x.unmatchable||x.decision?.include_in_quote!==!0||!x.best)continue;let H=a[x.item.line_id];(!H||Ut(H).lineTotal==null)&&(pe+=1)}pe>0&&(K=null);let ke=x=>!x.unmatchable&&!x.best&&x.decision?.technical_classification!=="no_suitable_candidate"&&Fs(x.result).length>0,We=x=>x.best??Fs(x.result)[0],ua=X.filter(x=>!x.unmatchable&&!x.best).filter(x=>!_.has(x.item.line_id)),cl=X.filter(x=>_.has(x.item.line_id)),pa=X;if(z.trim()){let x=z.trim().toLowerCase();pa=pa.filter(H=>H.item.description_original?.toLowerCase().includes(x)||We(H)?.description?.toLowerCase().includes(x))}if(P){let x=P==="asc"?1:-1;pa=[...pa].sort((H,he)=>x*(H.item.description_original||"").localeCompare(he.item.description_original||""))}let jn=Math.max(1,Math.ceil(pa.length/al)),Ft=Math.min(Ae,jn),vr=pa.slice((Ft-1)*al,Ft*al),$a=vr.filter(x=>!x.unmatchable&&x.best),Pd=vr.filter(x=>ke(x)),Qn=vr.filter(x=>!x.unmatchable&&(x.best||ke(x))),Jd=vr.filter(x=>x.unmatchable||!x.best&&!ke(x)),J=ve?X.find(x=>x.item.line_id===ve)??null:null,Dw=!d&&!c&&!J&&ua.length>0,Gn=(0,Ne.useRef)(null),Yn=()=>{let x=ee.current;if(!x)return;let{top:H,left:he,width:mt,height:Fe}=x.getBoundingClientRect(),Ti=x.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;D({top:H,left:he,width:Ti?Ti-he:mt,height:Fe})};(0,Ne.useEffect)(()=>(window.addEventListener("scroll",Yn,!0),window.addEventListener("resize",Yn),()=>{window.removeEventListener("scroll",Yn,!0),window.removeEventListener("resize",Yn)})),(0,Ne.useEffect)(()=>{let x=H=>{Gn.current&&!H.composedPath().includes(Gn.current)&&Gn.current.removeAttribute("open")};return document.addEventListener("click",x),()=>document.removeEventListener("click",x)},[]);let qi=x=>{Be(x),Me("")},Bw=()=>{if(!ve)return;let x=a[ve];if(x){u(H=>({...H,[ve]:x.productId})),k(H=>({...H,[ve]:iw(x)}));return}u(H=>{let he={...H};return delete he[ve],he}),k(H=>{let he={...H};return delete he[ve],he})},Za=(x=!1)=>{let H=ve?a[ve]:void 0;!x&&H&&J?.best&&H.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(x||Bw(),Be(null),ne(!1))};Fo(q,()=>B(!1)),Fo(!!J&&!q,()=>Za());let Ow=x=>{if(we(H=>new Set(H).add(x)),ua.some(H=>H.item.line_id!==x)){Za(!0);return}p(),Za(!0)},Lw=x=>{if(wc(x),j(H=>new Set(H).add(x)),ua.some(H=>H.item.line_id!==x)){Za(!0);return}p(),Za(!0)},Hw=()=>{j(x=>new Set([...x,...ua.map(H=>H.item.line_id)])),p()},Fd=()=>{J?.best&&(Wd(J.item.line_id,J.best),r(Ei(J)),L?Ow(J.item.line_id):Za(!0))},Id=Jd.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:Jd.map(x=>{let{item:H,qty:he}=x;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>qi(H.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Jr(H,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},H.line_id)})})]}):null,wc=x=>{u(H=>({...H,[x]:vd})),k(H=>({...H,[x]:void 0})),M(H=>({...H,[x]:void 0})),i(x)},yc=(x,H)=>{u(he=>({...he,[x]:H.product_id})),k(he=>({...he,[x]:H}))},Wd=(x,H)=>{H.method==="catalogue_search"&&M(he=>({...he,[x]:H}))};function ox(){g("downloaded",{type:"schedule",lines:X.length}),aw(X.map(({item:x,best:H,qty:he,band:mt,unmatchable:Fe,decision:It})=>({item:x,best:H,qty:he,band:mt,unmatchable:Fe,decision:It})))}function Ei(x){let H=x.best??Fs(x.result)[0];return Pr(H,{lineId:x.item.line_id,description:x.item.description_original,unit:x.item.unit,qty:x.qty,linkedContext:x.item.linked_group_role==="dependent"&&x.item.linked_group_id?w.filter(he=>he.linked_group_id===x.item.linked_group_id&&he.linked_group_role==="anchor").slice(0,1).map(he=>{let mt=a[he.line_id];return{line_id:he.line_id,product_id:mt?.productId??null,measurements_mm:mt?.measurementsMm??he.attrs.measurements_mm,description:mt?.description??he.description_original,qty:he.qty,unit:he.unit,role:"anchor"}}):void 0})}(0,Ne.useEffect)(()=>{if(!o){for(let x of X)!x.unmatchable&&x.best&&r(Ei(x));l()}},[o]),(0,Ne.useEffect)(()=>{for(let x of X)!a[x.item.line_id]&&!x.unmatchable&&x.best&&r(Ei(x))},[e]),(0,Ne.useEffect)(()=>{if(!ve){_e([]),_t(null),Se(!1);return}let x=je.trim();if(!x){_e([]),_t(null),Se(!1);return}let H=!1,he=window.setTimeout(async()=>{try{Se(!0),_t(null);let mt=await fetch(Lt(`/api/catalogue/search?q=${encodeURIComponent(x)}`),{headers:vi()}),Fe=await Kt(mt);if(!mt.ok)throw new Error(Fe?.error||Fe?.message||"Failed to search catalogue");H||_e(Array.isArray(Fe?.items)?Fe.items:[])}catch(mt){H||(_e([]),_t(mt?.message||"Failed to search catalogue"))}finally{H||Se(!1)}},250);return()=>{H=!0,window.clearTimeout(he)}},[je,ve]);let _c=Object.keys(a).length,Ma=je.trim(),em=Fs(J?.result),ul=J?.decision?.technical_classification==="no_suitable_candidate"||!!J&&!J.best,tm=J?.decision?.technical_classification!=null,am=J?.decision?.reason??(ul?"No catalogue candidate found. Refine the request or search the catalogue.":null),jw=W.map(x=>({product_id:x.product_id,description:x.description,source_list:x.source_list,price:x.price,price_basis:x.price_basis,uoi_count:x.uoi_count??null,uoi:x.uoi,pdp_photo_url:x.pdp_photo_url??null,conversion:x.conversion,measurements_mm:x.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Xn=Ma?jw:em,Mi=J?A[J.item.line_id]:void 0,Vn=!Ma&&Mi&&!Xn.some(x=>x.product_id===Mi.product_id)?[...Xn,Mi]:Xn,rm=(()=>{let x=Vn.slice(0,Ma?12:3);return Ma||!Mi||x.some(H=>H.product_id===Mi.product_id)?x:[...x,Mi]})(),pl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,Qw=!!J?.best&&!!a[J.item.line_id]&&!pl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${d?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${d?"":" quick-order-hero--customer"}`,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:K==null?"Calculating\u2026":ot(K)})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",h?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,"aria-label":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:h?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:K==null?"Calculating\u2026":ot(K)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ht,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Pe&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ye,onClick:()=>ut(x=>!x),children:ye?"Hide timings":"Show timings"})}),Pe&&ye&&(0,s.jsx)(m_,{...U}),!h&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[pe>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:pe})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:z,onChange:x=>G(x.target.value),"aria-label":"Search line items"}),!d&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${Y==="tile"?" is-active":""}`,"aria-pressed":Y==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ce("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${Y==="list"?" is-active":""}`,"aria-pressed":Y==="list","aria-label":"List view",title:"List view",onClick:()=>ce("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Pe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>me(x=>x==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Gn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:n_.map(x=>{let H=P===x.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${H?" is-active":""}`,onClick:()=>{ge(H?null:x.dir),Gn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:H?"\u2713":""}),x.label]},x.dir)})})]})]})]})}),Y==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Za(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:x=>x.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Za(),"aria-label":"Close product options",children:(0,s.jsx)(Po,{})}),(0,s.jsx)("div",{className:"results-review-page",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>Za(),children:[(0,s.jsx)(Kr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Pe&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>me(x=>x==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:je,onChange:x=>Me(x.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>wc(J.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Ya(We(J)?.description||J.item.description_original,We(J)?.product_id,We(J)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Jr(J.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[yi(J.qty)," ",Na(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Mn(J.best.price,J.best.price_basis)}):null]}):We(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:We(J)?.description}),We(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Mn(We(J)?.price??null,We(J)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),gr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(bd,{meta:C.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Tn(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?i(J.item.line_id):(J.best&&Wd(J.item.line_id,J.best),r(Ei(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[J.item.line_id]?"\u2713 Added":d?"+ Add to selection":`Add to ${m}`})})]})]}),Oe?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!Oe&&Je?(0,s.jsx)("div",{className:"results-empty-card",children:Je}):null,!Oe&&!Je&&Ma&&Xn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!Oe&&!Je?(0,s.jsx)(v_,{item:J.item,candidates:Xn,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:ze,linkedGroupMeta:gr(J.item)?C.get(J.item.linked_group_id):void 0,onPick:x=>yc(J.item.line_id,x),onClear:()=>wc(J.item.line_id),showAll:d||Pe||Ma.length>0,internal:d,debugEnabled:Pe,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Jr(J.item,w)||"Original request"})]}),am?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:ul?"Exact match not found:":"AI review:"})," ",am]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:ul?"We couldn't find a suitable product":tm?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:ul?em.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":tm?`Select the option you want to add to your ${m}.`:"Search the catalogue to choose a product."})]})}),!Ma&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:rm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>yc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ya(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Mn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null,Vn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:je,onChange:x=>Me(x.target.value),"aria-label":"Search catalogue"})]}),Ma&&Oe?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ma&&!Oe&&Je?(0,s.jsx)("div",{className:"results-empty-card",children:Je}):null,Ma&&!Oe&&!Je&&Vn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ma&&!Oe&&!Je&&Vn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:rm.map(x=>{let H=x.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${H?" is-selected":""}`,onClick:()=>yc(J.item.line_id,x),"aria-pressed":H,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ya(x.description,x.product_id,x.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:x.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:x.price!=null?`\xA3${Mn(x.price,x.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:H?"Selected":"Choose"})]},x.product_id)})}):null]}),J.best?Qw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{Fd()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${m}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${pl?" cta-btn-secondary":""}`,onClick:()=>{pl?i(J.item.line_id):Fd()},children:(0,s.jsx)("span",{children:pl?`Remove from ${m}`:`Add selected product to ${m}`})}):null,L?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>Lw(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[pa.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Qn.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Qn.map(x=>{let{item:H,best:he,qty:mt}=x,Fe=We(x),It=!he&&ke(x);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>qi(H.line_id),"aria-label":`Review match for ${Jr(H,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[It||gr(H)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[gr(H)?(0,s.jsx)(bd,{meta:C.get(H.linked_group_id)}):(0,s.jsx)("span",{}),It?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Ya(Fe?.description||H.description_original,Fe?.product_id,Fe?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Fe?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Fe.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Fe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:It?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Jr(H,w)}),gr(H)?(0,s.jsx)("div",{className:"results-row-meta",children:Tn(H)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[d&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qi(H.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[H.line_id]?i(H.line_id):r(Ei(x))},disabled:!Fe,"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})]})]},H.line_id)})})}):null,Id]})]}):(0,s.jsxs)(s.Fragment,{children:[T&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:T,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),ze==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),ze==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:d?"Selection":h?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[pa.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:ze==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Qn.map(x=>{let{item:H,result:he,decision:mt,best:Fe}=x;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>qi(H.line_id),onMouseEnter:It=>{ee.current=It.currentTarget,Yn()},onMouseLeave:()=>{ee.current=null,D(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Jr(H,w)}),gr(H)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(bd,{meta:C.get(H.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Tn(H)})]}):null]}),(0,s.jsx)("td",{children:Fe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Fe.description,children:Fe.description}),ze==="detailed"&&mt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[s_(mt.technical_classification),mt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Fe?.price!=null?Mn(Fe.price,Fe.price_basis):"-"}),ze==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[H.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:It=>{It.stopPropagation(),a[H.line_id]?i(H.line_id):r(Ei(x))},"aria-label":a[H.line_id]?d?"Remove from selection":`Remove from ${m}`:d?"Add to selection":`Add to ${m}`,children:a[H.line_id]?"\u2713 Added":d?"+ Add":`Add to ${m}`})})]},H.line_id)})]})]})}),Id]}),!J&&jn>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Ft-1)*al+1,"\u2013",Math.min(Ft*al,pa.length)," of ",pa.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>De(Ft-1),disabled:Ft===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Ft," of ",jn]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>De(Ft+1),disabled:Ft===jn,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:(_c>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>B(!0),"aria-label":"Start over",children:[(0,s.jsx)(fd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),_c>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,"aria-label":d?"View selection":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[d?"View Selection":h?"View Quote":"View Basket"," (",_c,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ht,{})})]})]})]})]}),Dw&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:ua.map(x=>{let H=xe.has(x.item.line_id),he=ke(x);return(0,s.jsx)("div",{className:`review-gate-item${H?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{ne(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(x.item,w)}),(0,s.jsx)("span",{children:x.decision?.reason||(he?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:H?"Choice made":"Choose a product"})]})},x.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Hw,children:"Skip all"}),cl.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),cl.map(x=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{j(H=>{let he=new Set(H);return he.delete(x.item.line_id),he}),ne(!0),qi(x.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Jr(x.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${m}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},x.item.line_id))]}):null]})}),q&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",h?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>B(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{B(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var yt=V(Ve());var S=V(re()),w_=.2,rl=10,sw="Enter a valid email address so we can send your quote.",y_=(e,t)=>{let a=`${t.requestedAmount} ${ka(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${ka(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(n=>n.requestUom===t.requestedUnit);return i&&i.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${ka(t.sellUnit,2)} per ${ka(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},__=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${ka(e.sellUnit,1)}.`;function x_(){return(0,S.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,S.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,S.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,S.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,S.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function il(){return(0,S.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,S.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function nl({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,yt.useId)(),d=!c&&Xs()==="QZA6-MRA4",h=Object.values(e),[m,b]=(0,yt.useState)(""),[w,E]=(0,yt.useState)(!1),[U,f]=(0,yt.useState)(!1),u=Sn(),[g,v]=(0,yt.useState)(""),[k,A]=(0,yt.useState)({}),[M,z]=(0,yt.useState)({}),[G,P]=(0,yt.useState)(1),[ge,Ae]=(0,yt.useState)({}),[De,Pe]=(0,yt.useState)(!1),[ze,me]=(0,yt.useState)("0"),Y=(0,yt.useRef)(new Set);(0,yt.useEffect)(()=>{if(!r)return;for(let D of Object.values(e))Ut(D).requiredSellUnits!=null&&Y.current.delete(D.lineId);let T=Object.values(e).filter(D=>D.productId!=="-"&&Ut(D).requiredSellUnits==null&&!Y.current.has(D.lineId));T.length!==0&&(T.forEach(D=>Y.current.add(D.lineId)),fetch(Lt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:T.map(D=>({line_id:D.lineId,product_id:D.productId,requested_description:D.requestedDescription??D.description,requested_qty:D.qty,requested_uom:D.unit||null,linked_context:D.linkedContext??[],selected_description:D.description,selected_uoi:D.uoi,selected_uoi_count:D.uoiCount,selected_conversion:{sales_uom_normalised:D.salesUomNormalised,conversion_type:D.conversionType,sales_unit_size:D.salesUnitSize,sales_unit_size_uom:D.salesUnitSizeUom,coverage_qty:D.coverageQty,coverage_uom:D.coverageUom}}))})}).then(D=>D.ok?Kt(D):null).then(D=>{let ee={};for(let xe of D?.data?.items??D?.items??[]){let we=xe?.conversion;if(!we||typeof xe?.line_id!="string")continue;let _=e[xe.line_id];ee[xe.line_id]={conversionType:we.conversion_type,requestUomsSupported:we.request_uoms_supported,salesUomNormalised:we.sales_uom_normalised,salesUnitSize:we.sales_unit_size,salesUnitSizeUom:we.sales_unit_size_uom,coverageQty:we.coverage_qty,coverageUom:we.coverage_uom,roundingRule:we.rounding_rule,conversionConfidence:we.conversion_confidence,conversionNotes:we.conversion_notes,..._?.qty===0&&Number.isFinite(we.suggested_order_qty)&&we.suggested_order_qty>0?{qty:we.suggested_order_qty,unit:we.suggested_order_uom||_.unit}:{}}}Object.keys(ee).length>0&&r(ee)}).catch(D=>console.error("Catalogue conversion resolution failed",D)))},[e,r]);function ce(T){A(D=>{let ee={...D};return delete ee[T],ee})}function ye(T,D){let ee=parseFloat(D);!isNaN(ee)&&ee>=0&&t(T,Math.min(ee,1e5)),ce(T)}function ut(T,D,ee){t(T,Math.min(1e5,Math.max(0,D+ee))),ce(T)}function ve(T){z(D=>{let ee={...D};return delete ee[T],ee})}function Be(T,D){let ee=parseFloat(D);!isNaN(ee)&&ee>=0&&a(T,Math.min(ee,1e5)),ve(T)}function je(T,D,ee){a(T,Math.min(1e5,Math.max(0,D+ee))),ve(T)}async function Me(){let T=m.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(T)){v(sw);return}v(""),f(!0);try{let D=await fetch(Lt("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({email:T,items:W.map(({item:ee,pricing:xe})=>{let we=xe.requiredSellUnits??xe.requestedAmount,_=xe.requiredSellUnits!=null?xe.sellUnit:xe.requestedUnit;return{product_id:ee.productId,description:ee.description,quantity:we,unit:ka(_,we),unit_price:xe.requiredSellUnits!=null?xe.unitPrice:null,line_total:xe.lineTotal}})})});if(!D.ok){let ee=await Kt(D);console.error("Quote request failed",D.status,ee?.message),v(D.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}u("quote_requested",{items:W.length,total:Math.round(Se*100)/100}),E(!0),l?.(),window.scrollTo(0,0)}catch{v("Your request couldn't be sent. Check your connection and try again.")}finally{f(!1)}}let W=h.map(T=>({item:T,pricing:Ut(T,{wasteFactorEnabled:De,wasteFactorOverride:Math.max(0,Number.parseFloat(ze)||0)/100})})),_e=Js(h,{wasteFactorEnabled:De,wasteFactorOverride:Math.max(0,Number.parseFloat(ze)||0)/100}),Oe=_e*w_,Se=_e+Oe,Je=(0,yt.useRef)({items:W.length,total:Math.round(Se*100)/100});(0,yt.useEffect)(()=>{u("basket_viewed",Je.current)},[u]);let _t=Math.max(1,Math.ceil(W.length/rl)),q=Math.min(G,_t),B=W.slice((q-1)*rl,q*rl);return w?(0,S.jsx)("div",{className:"wizard-step entry-stage",children:(0,S.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,S.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,S.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,S.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,S.jsx)("h1",{children:"Quote requested"}),(0,S.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,S.jsx)("strong",{children:m.trim()}),", usually within one working day."]}),(0,S.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,S.jsx)("span",{children:"Start a new quote"})}),(0,S.jsx)("p",{className:"quote-request-sent-note",children:"Nothing is charged until you approve the quote."})]})}):!c&&h.length===0?(0,S.jsx)("div",{className:"wizard-step entry-stage",children:(0,S.jsxs)("div",{className:"quote-request-sent",children:[(0,S.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,S.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,S.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,S.jsx)("h1",{children:d?"Your quote request is empty":"Your basket is empty"}),(0,S.jsx)("p",{children:d?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,S.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,S.jsx)("span",{children:"Back to start"})})]})}):(0,S.jsx)("div",{className:`wizard-step entry-stage${d?" basket-layout--qza6-mra4":""}`,children:(0,S.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,S.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,S.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,S.jsxs)("div",{className:"basket-hero-copy",children:[d&&(0,S.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,S.jsx)(Kr,{}),(0,S.jsx)("span",{children:"Back to results"})]}),(0,S.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,S.jsx)("h1",{children:c?"Your Selection":d?"Request a quote":"Your Basket"}),c&&(0,S.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,S.jsx)("strong",{children:h.length})," ",h.length===1?"item":"items"]})]}),(0,S.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":d?"Check your items & quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,S.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:h.length===0?(0,S.jsxs)("div",{className:"quick-order-history-empty",children:[(0,S.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,S.jsx)("p",{children:"Your selection is empty."}),(0,S.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,S.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,S.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,S.jsx)("span",{children:"Back to Results"})})})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"basket-layout",children:[(0,S.jsxs)("div",{className:"basket-main",children:[(0,S.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":d?"Quote request items":"Basket items",children:B.map(({item:T,pricing:D})=>{let ee=k[T.lineId]??String(D.requestedAmount),xe=D.requestedUnit===D.sellUnit||D.costingMode==="review",we=D.requiredSellUnits==null||D.requestedAmount!==D.requiredSellUnits||D.requestedUnit!==D.sellUnit;return(0,S.jsxs)("article",{className:"basket-card",children:[(0,S.jsxs)("div",{className:"basket-card-top",children:[(0,S.jsx)("img",{className:"basket-card-thumb",src:Ya(T.description,T.productId,T.pdpPhotoUrl),alt:"",width:48,height:48}),(0,S.jsxs)("div",{className:"basket-card-info",children:[(0,S.jsx)("div",{className:"bom-component-name",children:T.description}),we&&D.costingMode!=="review"&&(0,S.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ae(_=>({..._,[T.lineId]:!_[T.lineId]})),"aria-expanded":!!ge[T.lineId],children:["How we calculated this",(0,S.jsx)("span",{className:`basket-calc-toggle-chevron${ge[T.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,S.jsx)(il,{})})]})]}),(0,S.jsx)("div",{className:"basket-card-actions",children:(0,S.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(T.lineId),"aria-label":`Remove ${T.description}`,children:(0,S.jsx)(x_,{})})})]}),c&&(0,S.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,S.jsxs)("dl",{className:"results-detail-grid",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Conversion type"}),(0,S.jsx)("dd",{children:T.conversionType??"-"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Conversion confidence"}),(0,S.jsx)("dd",{children:T.conversionConfidence??"-"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Sales unit"}),(0,S.jsx)("dd",{children:T.salesUnitSize!=null?(0,S.jsxs)(S.Fragment,{children:[T.salesUnitSize," ",Na(T.salesUnitSizeUom,T.salesUnitSize)]}):"-"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Coverage"}),(0,S.jsx)("dd",{children:T.coverageQty!=null?(0,S.jsxs)(S.Fragment,{children:[T.coverageQty," ",Na(T.coverageUom,T.coverageQty)]}):"-"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Waste factor"}),(0,S.jsx)("dd",{children:T.wasteFactorDefault??"-"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{children:"Rounding rule"}),(0,S.jsx)("dd",{children:T.roundingRule??"-"})]})]}),T.conversionNotes&&(0,S.jsx)("p",{className:"results-rerank-note",children:T.conversionNotes})]}),D.costingMode==="review"?(0,S.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,S.jsx)("strong",{children:"Quantity needs confirmation."})," ",__(D)]}):we&&ge[T.lineId]?(0,S.jsx)("p",{className:"basket-calc-text",children:y_(T,D)}):null,(0,S.jsxs)("div",{className:"basket-card-stats",children:[(0,S.jsxs)("div",{className:"basket-stat",children:[(0,S.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,S.jsxs)("div",{className:"basket-stat-value",children:[(0,S.jsxs)("div",{className:"basket-qty-field",children:[(0,S.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:ee,disabled:xe,onChange:_=>A(j=>({...j,[T.lineId]:_.target.value})),onBlur:_=>ye(T.lineId,_.target.value),onKeyDown:_=>{_.key==="Enter"&&_.target.blur()},"aria-label":`${T.description} requested quantity`}),(0,S.jsxs)("div",{className:"basket-qty-arrows",children:[(0,S.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:xe,onClick:()=>ut(T.lineId,parseFloat(ee)||0,1),"aria-label":`Increase ${T.description} quantity`,children:(0,S.jsx)(il,{})}),(0,S.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:xe,onClick:()=>ut(T.lineId,parseFloat(ee)||0,-1),"aria-label":`Decrease ${T.description} quantity`,children:(0,S.jsx)(il,{})})]})]}),(0,S.jsx)("span",{className:"basket-metric-unit",children:Na(D.requestedUnit,parseFloat(ee)||0)})]})]}),(0,S.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,S.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,S.jsxs)("div",{className:"basket-stat-value",children:[(0,S.jsxs)("div",{className:"basket-qty-field",children:[(0,S.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:M[T.lineId]??String(D.requiredSellUnits??""),onChange:_=>z(j=>({...j,[T.lineId]:_.target.value})),onBlur:_=>Be(T.lineId,_.target.value),onKeyDown:_=>{_.key==="Enter"&&_.target.blur()},"aria-label":`${T.description} order quantity`}),(0,S.jsxs)("div",{className:"basket-qty-arrows",children:[(0,S.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>je(T.lineId,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${T.description} order quantity`,children:(0,S.jsx)(il,{})}),(0,S.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>je(T.lineId,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${T.description} order quantity`,children:(0,S.jsx)(il,{})})]})]}),(0,S.jsx)("span",{className:"basket-metric-unit",children:Na(D.sellUnit,parseFloat(M[T.lineId]??String(D.requiredSellUnits??"0"))||0)})]})]}),(0,S.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,S.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,S.jsxs)("div",{className:"basket-stat-value",children:[(0,S.jsx)("strong",{children:D.lineTotal!=null?ot(D.lineTotal):"-"}),D.lineTotal!=null&&(0,S.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},T.lineId)})}),_t>1&&(0,S.jsxs)("div",{className:"results-pagination",children:[(0,S.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(q-1)*rl+1,"\u2013",Math.min(q*rl,W.length)," of ",W.length]}),(0,S.jsxs)("div",{className:"results-pagination-controls",children:[(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>P(q-1),disabled:q===1,children:"Previous"}),(0,S.jsxs)("span",{className:"results-pagination-page",children:["Page ",q," of ",_t]}),(0,S.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>P(q+1),disabled:q===_t,children:"Next"})]})]})]}),(0,S.jsxs)("aside",{className:"basket-sidebar",children:[(0,S.jsx)("div",{className:"basket-sidebar-title",children:d?"Quote request summary":"Order summary"}),(0,S.jsxs)("div",{className:"basket-sidebar-row",children:[(0,S.jsx)("span",{children:d?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,S.jsx)("span",{children:ot(_e)})]}),(0,S.jsxs)("div",{className:"basket-sidebar-row",children:[(0,S.jsx)("span",{children:"VAT (20%)"}),(0,S.jsx)("span",{children:ot(Oe)})]}),(0,S.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,S.jsx)("span",{children:d?"List price (inc.\xA0VAT)":"Total"}),(0,S.jsx)("span",{children:ot(Se)})]}),!d&&(0,S.jsx)("div",{className:"basket-summary-waste",children:(0,S.jsxs)("div",{className:"basket-waste-control",children:[(0,S.jsxs)("label",{className:"basket-global-waste",children:[(0,S.jsx)("input",{type:"checkbox",checked:De,onChange:T=>Pe(T.target.checked)}),(0,S.jsx)("span",{children:"Add waste factor"})]}),(0,S.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,S.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:ze,onChange:T=>me(T.target.value),disabled:!De,"aria-label":"Waste factor percent"}),(0,S.jsx)("span",{children:"%"})]})]})}),(0,S.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:d?"Enter email for your sharper quote":"Your reference (optional)"}),(0,S.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:m,onChange:T=>{b(T.target.value),d&&v("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&g===sw,"aria-describedby":d&&g?`${p}-basket-reference-error`:void 0}),d&&g&&(0,S.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:g}),d?(0,S.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{Me()},disabled:U,"aria-busy":U,children:(0,S.jsx)("span",{children:U?"Sending\u2026":"Request our best quote"})}):(0,S.jsx)("button",{className:"cta-btn",onClick:()=>{u("downloaded",{type:"basket",items:h.length}),rw(h)},"aria-label":c?"Download selection":"Download basket",children:(0,S.jsx)("span",{children:c?"Download Quote":"Buy Now"})}),(0,S.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,S.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),d?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,S.jsx)("div",{className:"btn-row results-actions",children:(0,S.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,S.jsx)(Kr,{}),(0,S.jsx)("span",{children:"Back to results"})]})})]})})]})})}var zt=V(Ve()),cw=V(re());function k_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var xd=(0,zt.createContext)(null);function Ws({children:e,onOpenBasket:t}){let[a,r]=(0,zt.useState)({}),i=(0,zt.useCallback)(m=>{r(b=>k_(b,m))},[]),n=(0,zt.useCallback)(m=>{r(b=>{let w={...b};for(let E of m)w[E.lineId]=E;return w})},[]),o=(0,zt.useCallback)(m=>{r(b=>{let w={...b};return delete w[m],w})},[]),l=(0,zt.useCallback)((m,b)=>{r(w=>w[m]?{...w,[m]:{...w[m],qty:b,sellUnitsOverride:null}}:w)},[]),c=(0,zt.useCallback)((m,b)=>{r(w=>w[m]?{...w,[m]:{...w[m],sellUnitsOverride:b}}:w)},[]),p=(0,zt.useCallback)(m=>{r(b=>{let w=!1,E={...b};for(let[U,f]of Object.entries(m))E[U]&&(E[U]={...E[U],...f},w=!0);return w?E:b})},[]),d=(0,zt.useCallback)(()=>r({}),[]),h=(0,zt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:d,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,d,t]);return(0,cw.jsx)(xd.Provider,{value:h,children:e})}function zn(){let e=(0,zt.useContext)(xd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function ec(){return(0,zt.useContext)(xd)}var Sa=V(re()),kd="metron-quick-quote";function tc(e){return(0,Sa.jsx)(Ws,{children:(0,Sa.jsx)(N_,{...e})})}function N_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,Ye.useState)("entry"),[n,o]=(0,Ye.useState)(null),[l,c]=(0,Ye.useState)(""),p=(0,Ye.useRef)(null),[d,h]=(0,Ye.useState)(0),[m,b]=(0,Ye.useState)(null),[w,E]=(0,Ye.useState)(!1),{cart:U,addToCart:f,addManyToCart:u,removeFromCart:g,updateCartQty:v,updateCartSellUnits:k,updateCartConversions:A,clearCart:M}=zn(),[z,G]=(0,Ye.useState)(!1),P=(0,Ye.useRef)(new Map),ge=(0,Ye.useRef)(null),Ae=Ys("quick-quote",ge);(0,Ye.useEffect)(()=>{Ae("viewed")},[Ae]),(0,Ye.useEffect)(()=>{for(let W of Object.values(U))Ut(W).requiredSellUnits!=null&&P.current.delete(W.lineId);let Me=Object.values(U).filter(W=>{if(W.productId==="-"||Ut(W).requiredSellUnits!=null)return!1;let _e=`${W.productId}|${W.qty}|${W.unit}`;return P.current.get(W.lineId)===_e?!1:(P.current.set(W.lineId,_e),!0)});Me.length!==0&&fetch(Lt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:Me.map(W=>({line_id:W.lineId,product_id:W.productId,requested_description:W.requestedDescription??W.description,requested_qty:W.qty,requested_uom:W.unit||null,selected_description:W.description,selected_uoi:W.uoi,selected_uoi_count:W.uoiCount,linked_context:W.linkedContext??[],selected_conversion:{sales_uom_normalised:W.salesUomNormalised,conversion_type:W.conversionType,sales_unit_size:W.salesUnitSize,sales_unit_size_uom:W.salesUnitSizeUom,coverage_qty:W.coverageQty,coverage_uom:W.coverageUom}}))})}).then(W=>W.ok?Kt(W):null).then(W=>{let _e={};for(let Oe of W?.data?.items??W?.items??[]){let Se=Oe?.conversion;if(!Se||typeof Oe?.line_id!="string")continue;let Je=U[Oe.line_id];_e[Oe.line_id]={conversionType:Se.conversion_type,requestUomsSupported:Se.request_uoms_supported,salesUomNormalised:Se.sales_uom_normalised,salesUnitSize:Se.sales_unit_size,salesUnitSizeUom:Se.sales_unit_size_uom,coverageQty:Se.coverage_qty,coverageUom:Se.coverage_uom,roundingRule:Se.rounding_rule,conversionConfidence:Se.conversion_confidence,conversionNotes:Se.conversion_notes,...Je?.qty===0&&Number.isFinite(Se.suggested_order_qty)&&Se.suggested_order_qty>0?{qty:Se.suggested_order_qty,unit:Se.suggested_order_uom||Je.unit}:{}}}Object.keys(_e).length>0&&A(_e)}).catch(W=>console.error("Catalogue conversion resolution failed",W))},[U,A]);let[De,Pe]=(0,Ye.useState)(!1);(0,Ye.useEffect)(()=>{let Me=window.location.hash,W=null;try{W=JSON.parse(window.sessionStorage.getItem(kd)??"null")}catch{}if(W?.scheduleResult)o("schedule"),b(W.scheduleResult),E(W.reviewGateComplete),G(W.cartSeeded),u(Object.values(W.cart)),Me==="#quote-request"?i("basket"):Me==="#matched-products"&&i("results");else if(Me==="#matched-products"||Me==="#quote-request"){let _e=new URL(window.location.href);_e.hash="",window.history.replaceState(window.history.state,"",_e)}Pe(!0)},[]),(0,Ye.useEffect)(()=>{if(De)try{m?window.sessionStorage.setItem(kd,JSON.stringify({scheduleResult:m,reviewGateComplete:w,cartSeeded:z,cart:U})):window.sessionStorage.removeItem(kd)}catch{}},[De,m,w,z,U]);let ze=(0,Ye.useCallback)(Me=>{if(typeof window>"u")return;let W=new URL(window.location.href);W.hash=Me==="basket"?"quote-request":"matched-products";let _e=Me==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");window.history[_e?"replaceState":"pushState"]({boqQuoteStage:Me},"",W)},[]),me=(0,Ye.useRef)(!1);(0,Ye.useEffect)(()=>{let Me=W=>{me.current=!1;let _e=window.location.hash;_e==="#quote-request"?i("basket"):_e==="#matched-products"&&m?(o("schedule"),i("results")):i("entry");let Oe=W.state,Se=window.location.href;setTimeout(()=>{if(window.location.href===Se){if(_e==="#quote-request"||_e==="#matched-products"){window.history.replaceState({boqQuoteStage:_e==="#quote-request"?"basket":"results"},"",Se);return}!Oe?.turbo&&window.history.state?.turbo&&window.history.replaceState(Oe,"",Se)}})};return window.addEventListener("popstate",Me),()=>window.removeEventListener("popstate",Me)},[m]);let Y=(0,Ye.useCallback)(()=>{ze("basket"),i("basket")},[ze]),ce=(0,Ye.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(me.current)return;me.current=!0,window.history.back();return}i(m?"results":"entry")},[m]),ye=(0,Ye.useRef)(r);(0,Ye.useEffect)(()=>{ye.current!==r&&(ye.current=r,window.scrollTo(0,0))},[r]);let ut=()=>{i("entry"),o(null),c(""),h(0),b(null),E(!1),M(),G(!1)},ve=(0,Ye.useCallback)(async(Me,W,_e=!0)=>{c(""),h(0);let Oe=0,Se=()=>{Oe=Math.min(Oe+1,3),h(Oe)};try{let{jobId:Je}=await rv(Me,W,_e),{promise:_t,cancel:q}=nv(()=>iv(Je),5e3,Se,"schedule");p.current=q;let B=await _t;if(B.status==="failed"||!B.result)throw new Error(B.error||"Failed to process schedule");let T=B.result.lineItems.length,D=B.result.results.filter(ee=>ee.candidates.length>0).length;Ae("results_shown",{lines:T,matched:D,unmatched:T-D}),M(),G(!1),E(!1),b(B.result),ze("results"),i("results")}catch(Je){Ae("error",{stage:"matching"}),c(Je?.message||"Failed to process schedule"),i("entry")}finally{p.current?.(),p.current=null}},[ze,Ae,M]),Be=(0,Ye.useCallback)(async(Me,W,_e=!0)=>{if(!Me.trim())return;o("schedule");let Oe=new File([Me],"pasted-schedule.txt",{type:"text/plain"});await ve(Oe,W,_e)},[ve]),je=(0,Ye.useCallback)(async Me=>{o("schedule"),await ve(Me)},[ve]);return(0,Sa.jsx)(Ko.Provider,{value:Ae,children:(0,Sa.jsx)("div",{ref:ge,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Ra().theme,children:(0,Sa.jsxs)("main",{className:"main-content",children:[l&&(0,Sa.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Sa.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Sa.jsx)(dd,{onPasteSchedule:Be,onUploadSchedule:je,onEntryModeChange:o}),r==="results"&&n==="schedule"&&m&&(0,Sa.jsx)(yd,{scheduleResult:m,onStartOver:ut,cart:U,onAddToCart:f,onRemoveFromCart:g,onGoToBasket:Y,cartSeeded:z,onCartSeeded:()=>G(!0),reviewGateComplete:w,onReviewGateComplete:()=>E(!0),internal:a}),r==="basket"&&(0,Sa.jsx)(nl,{cart:U,onUpdateQty:v,onUpdateSellUnits:k,onRemove:g,onBack:ce,onStartNewQuote:ut,onQuoteRequested:()=>{b(null),E(!1),G(!1),M()},internal:a})]})})})}var Va=V(Ve());var xi=V(Ve()),ae=V(re()),uw=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],ac=e=>Number.parseFloat(e)||0,pw=(e,t)=>ac(e)*(t==="m"?1:.3048),Nd=(e,t)=>ac(e.quantity)*(2*pw(e.height,t)+pw(e.width,t)),S_=()=>({quantity:"1",width:"",height:""});function C_({profile:e}){return(0,ae.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ae.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,ae.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Sd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,xi.useState)("m"),[n,o]=(0,xi.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,xi.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,d]=(0,xi.useState)([]),[h,m]=(0,xi.useState)("ogee"),[b,w]=(0,xi.useState)("2.4"),E=(k,A,M)=>{k(z=>({...z,[A]:M}))},U=Nd(n,r)+Nd(l,r)+p.reduce((k,A)=>k+Nd(A,r),0),f=ac(b)>0?Math.ceil(U/ac(b)):0,u=uw.find(k=>k.id===h)?.label??"",g=[{key:`architrave-${h}`,label:`Architrave (${u})`,qty:U,unit:"m",query:`${u} architrave`,category:"architrave"}],v=(k,A,M,z)=>(0,ae.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ae.jsx)("span",{children:k}),(0,ae.jsx)("input",{"aria-label":`${k} quantity`,type:"number",min:"0",step:"1",value:A.quantity,onChange:G=>M("quantity",G.target.value)}),(0,ae.jsx)("input",{"aria-label":`${k} width`,type:"number",min:"0",step:"0.01",value:A.width,onChange:G=>M("width",G.target.value)}),(0,ae.jsx)("input",{"aria-label":`${k} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:G=>M("height",G.target.value)}),z?(0,ae.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:z,children:"Remove"}):null]});return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Architrave Calculator"}),(0,ae.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ae.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ae.jsx)("span",{children:"Units"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,ae.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ae.jsx)("span",{children:"Opening"}),(0,ae.jsx)("span",{children:"Qty"}),(0,ae.jsxs)("span",{children:["Width (",r,")"]}),(0,ae.jsxs)("span",{children:["Height (",r,")"]}),(0,ae.jsx)("span",{})]}),v("Single doors",n,(k,A)=>E(o,k,A)),v("Double doors",l,(k,A)=>E(c,k,A)),p.map((k,A)=>v(`Alternative door ${A+1}`,k,(M,z)=>d(G=>G.map((P,ge)=>ge===A?{...P,[M]:z}:P)),()=>d(M=>M.filter((z,G)=>G!==A)))),(0,ae.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(k=>[...k,S_()]),children:"+ Add alternative-sized door"})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ae.jsx)("div",{className:"architrave-calculator__profiles",children:uw.map(k=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===k.id?" is-selected":""}`,onClick:()=>m(k.id),children:[(0,ae.jsx)(C_,{profile:k.id}),(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ae.jsx)("div",{className:"architrave-calculator__options",children:(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Board length (m)"}),(0,ae.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Architrave needed"}),(0,ae.jsxs)("strong",{children:[U.toFixed(2)," m"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Board lengths"}),(0,ae.jsx)("strong",{children:f})]})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:U<=0,children:a})]})]})]})})}var ki=V(Ve()),se=V(re()),dw=60,mw=10,q_=.02,E_=.012,M_=.01,An=e=>Number.parseFloat(e)||0,T_=(e,t=2)=>e.toFixed(t);function Cd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ki.useState)("brick"),[n,o]=(0,ki.useState)("engineering-red"),[l,c]=(0,ki.useState)("metric"),[p,d]=(0,ki.useState)(""),[h,m]=(0,ki.useState)(""),[b,w]=(0,ki.useState)(!0),E=l==="metric"?An(p)*An(h):An(p)*An(h)*.092903,f=E*(r==="brick"?dw:mw),u=Math.ceil(f),g=E*(r==="brick"?q_:E_),v=Math.ceil(g/M_),k=l==="metric"?E:E*10.7639,A=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],M=z=>{if(z===l)return;let G=z==="imperial"?3.28084:.3048;d((An(p)*G).toFixed(2)),m((An(h)*G).toFixed(2)),c(z)};return(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)("div",{className:"truss-estimator",children:[(0,se.jsxs)("div",{className:"quick-order-hero",children:[(0,se.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,se.jsx)("h1",{children:"Brick & Block Calculator"}),(0,se.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,se.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,se.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,se.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,se.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([z,G])=>(0,se.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===z?" is-selected":""}`,onClick:()=>i(z),children:[(0,se.jsx)("div",{className:"truss-estimator__option-title",children:G}),(0,se.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",z==="brick"?dw:mw," per m\xB2"]})]},z))})]}),r==="brick"&&(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,se.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([z,G,P])=>(0,se.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===z?" is-selected":""}`,onClick:()=>o(z),children:[(0,se.jsx)("div",{className:"truss-estimator__option-title",children:G}),(0,se.jsx)("div",{className:"truss-estimator__option-copy",children:P})]},z))})]}),(0,se.jsxs)("div",{className:"brick-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,se.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,se.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>M("metric"),children:"Metric"}),(0,se.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>M("imperial"),children:"Imperial"})]}),(0,se.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:z=>d(z.target.value)})]}),(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:z=>m(z.target.value)})]})]})]}),(0,se.jsx)("div",{className:"brick-calculator__options",children:(0,se.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,se.jsx)("input",{type:"checkbox",checked:b,onChange:z=>w(z.target.checked)}),(0,se.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,se.jsxs)("div",{className:"brick-calculator__totals",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,se.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:"Wall area"}),(0,se.jsxs)("strong",{children:[T_(k)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,se.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:"Ready-mixed mortar"}),(0,se.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,se.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,se.jsxs)("div",{className:"brick-calculator__actions",children:[(0,se.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,se.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(A),disabled:E<=0,children:a})]})]})]})})}var hr=V(Ve());var fw=new Map;function z_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Fr(e,t,a=12,r){let i=`${e}||${t??""}||${a}||${r??""}`,n=fw.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Lt(`/api/catalogue/search?${o.toString()}`),{headers:vi()}),c=await Kt(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(z_):[];return fw.set(i,p),p}async function gw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Fr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function hw(){let e=await fetch(Lt("/api/catalogue"),{headers:vi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Kt(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var $=V(re()),A_=1.54,R_=1440,U_=25,qd=800,D_=1500,Ed=e=>Number.parseFloat(e)||0,Rn={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function Md({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=ec(),[i,n]=(0,hr.useState)("m"),[o,l]=(0,hr.useState)(""),[c,p]=(0,hr.useState)(""),[d,h]=(0,hr.useState)(""),[m,b]=(0,hr.useState)("concrete"),[w,E]=(0,hr.useState)("mot"),[U,f]=(0,hr.useState)(!1),[u,g]=(0,hr.useState)(null),v=i==="m"?1:.3048,k=Ed(o)*v*Ed(c)*v*Ed(d)*(i==="m"?.01:.0254),A=Rn[w],M=k*A_/7,z=M*R_,G=M*2,P=M*4,ge=Math.ceil(z/U_),Ae=Math.ceil(G*Rn["sharp-sand"].density*1e3/qd),De=Math.ceil(P*Rn.gravel.density*1e3/qd),Pe=Math.ceil(k*A.density*1e3/qd),ze=m==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:ge,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Ae,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:De,productId:"6001004"}]:[{key:w,label:`${A.label} Bulk Bag (800kg)`,qty:Pe,productId:A.productId}],me=()=>{if(t){t(ze.map(ce=>({key:ce.key,label:ce.label,qty:ce.qty,unit:"each",query:ce.productId})));return}Y()},Y=async()=>{let ce=Date.now();f(!0),g(null);try{let ye=await Promise.all(ze.map(async ve=>{let Be=(await Fr(ve.productId)).find(je=>je.product_id===ve.productId);if(!Be)throw new Error(`${ve.label} is no longer available in this catalogue.`);return Pr(Be,{lineId:`concrete-aggregate:${ve.key}`,description:ve.label,unit:"bag",qty:ve.qty})})),ut=D_-(Date.now()-ce);ut>0&&await new Promise(ve=>window.setTimeout(ve,ut)),r?.clearCart(),r?.addManyToCart(ye),r?.openBasket()}catch(ye){g(ye instanceof Error?ye.message:"Could not add the products to your basket.")}finally{f(!1)}};return U?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Your Materials"}),(0,$.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,$.jsx)("div",{className:"truss-estimator__card",children:(0,$.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,$.jsx)(fr,{}),(0,$.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,$.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,$.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="concrete"?" is-selected":""}`,onClick:()=>b("concrete"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="aggregate"?" is-selected":""}`,onClick:()=>b("aggregate"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),m==="aggregate"&&(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,$.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Rn).map(ce=>(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===ce?" is-selected":""}`,onClick:()=>E(ce),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:Rn[ce].label}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:Rn[ce].blurb})]},ce))})]}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,$.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,$.jsx)("span",{children:"Units"}),(0,$.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,$.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metric"}),(0,$.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Imperial"})]})]}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Length (",i,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:ce=>l(ce.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Width (",i,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:ce=>p(ce.target.value)})]})]}),(0,$.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,$.jsxs)("span",{children:["Depth (",i==="m"?"cm":"inches",")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.1",value:d,onChange:ce=>h(ce.target.value)})]})]}),(0,$.jsxs)("div",{className:"materials-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,$.jsx)("div",{className:"materials-calculator__result-grid",children:m==="concrete"?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Cement"}),(0,$.jsxs)("strong",{children:[z.toFixed(0)," kg"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Sharp sand"}),(0,$.jsxs)("strong",{children:[G.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"20mm aggregate"}),(0,$.jsxs)("strong",{children:[P.toFixed(2)," m\xB3"]})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:A.label}),(0,$.jsxs)("strong",{children:[k.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Approx. weight"}),(0,$.jsxs)("strong",{children:[(k*A.density).toFixed(2)," t"]})]}),(0,$.jsx)("div",{})]})}),(0,$.jsx)("p",{className:"materials-calculator__note",children:m==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),u&&(0,$.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,$.jsxs)("div",{className:"materials-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:me,disabled:k<=0||U,children:U?"Adding products\u2026":a})]})]})]})})}var Xa=V(Ve());var R=V(re()),Un=12,Dn=8,rc=.56,bw=.21,Ca={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{lengthM:2.4,spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},Ni=["range","grid","pictureFrame","substructure"],B_={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},ic=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),nc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),O_=(e,t,a,r)=>{let i=ic(e,t,a),n=ic(e,t,r),o=ic(a,r,e),l=ic(a,r,t);return i===0&&nc(e,t,a)||n===0&&nc(e,t,r)||o===0&&nc(a,r,e)||l===0&&nc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Td=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&O_(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Xa.useState)(0),[n,o]=(0,Xa.useState)(B_),[l,c]=(0,Xa.useState)(1),[p,d]=(0,Xa.useState)({x:0,y:0}),[h,m]=(0,Xa.useState)(null),b=(0,Xa.useRef)(null),w=(0,Xa.useRef)(null),E=(0,Xa.useRef)(null),U=Ni[r],f=n.range?Ca.ranges[n.range]:null,u=Un/l,g=Dn/l,v=(Un-u)/2,k=(Dn-g)/2,A=Math.max(-Un,Math.min(Un*2-u,v+p.x)),M=Math.max(-Dn,Math.min(Dn*2-g,k+p.y)),z=Number.parseFloat(n.quickLengthM),G=Number.parseFloat(n.quickWidthM),P=z>0&&G>0,ge=q=>Math.abs(q.reduce((B,T,D)=>{let ee=q[(D+1)%q.length];return B+T.x*ee.y-ee.x*T.y},0))/2,Ae=(q,B)=>Math.hypot(B.x-q.x,B.y-q.y),De=n.isOutlineClosed?ge(n.points):0,Pe=n.isOutlineClosed?n.points.reduce((q,B,T)=>q+Ae(B,n.points[(T+1)%n.points.length]),0):0,ze=n.isOutlineClosed?n.points.reduce((q,B,T)=>q+(n.wallSegments.has(T)?0:Ae(B,n.points[(T+1)%n.points.length])),0):0,me=n.points.reduce((q,B)=>({x:q.x+B.x/n.points.length,y:q.y+B.y/n.points.length}),{x:0,y:0}),Y=n.points.length>1?(()=>{let q=n.points[0],B=n.points[1],T=Ae(q,B),D=T?-(B.y-q.y)/T:0,ee=T?(B.x-q.x)/T:0,xe=(q.x+B.x)/2,we=(q.y+B.y)/2,_=D*(xe-me.x)+ee*(we-me.y)>=0?1:-1;return{x:xe+D*rc*_,y:we+ee*rc*_}})():null,ye=(()=>{let q=n.range?Ca.ranges[n.range]:Ca.ranges.meridian,B=n.deckSizeMode==="quick"?z*G:De,T=n.deckSizeMode==="quick"?2*(z+G):ze,D=n.direction==="diagonal"?Ca.wastage.diagonal:Ca.wastage.straight,ee=n.pictureFrame==="yes"?Ca.pictureFrame.extraWastage:0,we=B/(q.boardWidthM+Ca.boardGapM)/q.boardLengthM,_=Math.ceil(we*(1+D+ee)),j=Math.ceil(B*30*(1+D+ee)/200),L=Ca.joist.spacingOptions.find(C=>C.id===n.joistSpacing)??Ca.joist.spacingOptions[1],ne=B/L.spacingM,te=Math.ceil(ne/Ca.joist.lengthM);return{range:q,area:B,boardCount:_,screwBoxes:j,joistLengthsNeeded:te,spacing:L}})(),ut=ye?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${ye.range.label})`,qty:ye.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ye.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ye.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],ve=()=>U==="range"?!!n.range:U==="grid"?n.deckSizeMode==="quick"?P:n.isOutlineClosed&&De>0:U==="pictureFrame"?!!n.pictureFrame&&!!n.direction:U==="substructure"?!!n.joistSpacing:!0,Be=r===Ni.length-1?a:"Next",je=(q,B,T=!1)=>{let D=E.current?.getBoundingClientRect();if(!D)return null;let ee=T?1:.25;return{x:Math.round(Math.max(A,Math.min(A+u,A+(q-D.left)/D.width*u))/ee)*ee,y:Math.round(Math.max(M,Math.min(M+g,M+(B-D.top)/D.height*g))/ee)*ee}},Me=q=>{if(n.isOutlineClosed){let T=q.target;if(T!==q.currentTarget&&!T.classList.contains("deck-outline__grid"))return;w.current={startX:q.clientX,startY:q.clientY,startViewX:A,startViewY:M},q.currentTarget.setPointerCapture(q.pointerId);return}if(n.drawMode!=="outline")return;let B=je(q.clientX,q.clientY,!0);B&&(m(null),o(T=>{let D=[...T.points,B];return Td(D,!1)?{...T,drawError:"Edges cannot cross. Choose another corner."}:{...T,points:D,drawError:""}}))},W=(q,B)=>{if(!n.isOutlineClosed){q.stopPropagation(),B===0&&n.points.length>=3&&o(T=>({...T,isOutlineClosed:!0,drawMode:"edges"}));return}q.stopPropagation(),b.current=B,q.currentTarget.setPointerCapture(q.pointerId)},_e=q=>{if(w.current){let D=E.current?.getBoundingClientRect();if(!D)return;let ee=w.current,xe=ee.startViewX-(q.clientX-ee.startX)/D.width*u,we=ee.startViewY-(q.clientY-ee.startY)/D.height*g;d({x:xe-v,y:we-k});return}!n.isOutlineClosed&&n.drawMode==="outline"&&m(je(q.clientX,q.clientY,!0));let B=b.current;if(B===null)return;let T=je(q.clientX,q.clientY);T&&o(D=>{let ee=D.points.map((xe,we)=>we===B?T:xe);return Td(ee,!0)?{...D,drawError:"Edges cannot cross. Move the corner to a different position."}:{...D,points:ee,drawError:""}})},Oe=q=>{w.current=null,b.current=null,q.currentTarget.hasPointerCapture(q.pointerId)&&q.currentTarget.releasePointerCapture(q.pointerId)},Se=q=>{o(B=>{let T=new Set(B.wallSegments);return T.has(q)?T.delete(q):T.add(q),{...B,wallSegments:T}})},Je=()=>{r===0?e():i(q=>q-1)},_t=()=>{ve()&&(r===Ni.length-1?t?.(ut):i(q=>q+1))};return(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)("div",{className:"truss-estimator",children:[(0,R.jsxs)("div",{className:"quick-order-hero",children:[(0,R.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,R.jsx)("h1",{children:"Decking Calculator"}),(0,R.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,R.jsxs)("div",{className:"truss-estimator__card",children:[(0,R.jsxs)("div",{className:"truss-estimator__body",children:[U==="range"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Ca.ranges).map(([q,B])=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===q?" is-selected":""}`,onClick:()=>o(T=>({...T,range:q})),children:[(0,R.jsx)("div",{className:"truss-estimator__option-title",children:B.label}),(0,R.jsx)("div",{className:"truss-estimator__option-copy",children:B.blurb}),(0,R.jsxs)("div",{className:"truss-estimator__option-copy",children:[B.boardLengthM,"m boards"]})]},q))})]}):null,U==="grid"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,R.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,R.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(q=>({...q,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,R.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(q=>({...q,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,R.jsxs)("label",{className:"truss-estimator__field",children:[(0,R.jsx)("span",{children:"Length (m)"}),(0,R.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:q=>o(B=>({...B,quickLengthM:q.target.value}))})]}),(0,R.jsxs)("label",{className:"truss-estimator__field",children:[(0,R.jsx)("span",{children:"Width (m)"}),(0,R.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:q=>o(B=>({...B,quickWidthM:q.target.value}))})]})]}),(0,R.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),P?(0,R.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,R.jsxs)("div",{children:[(z*G).toFixed(2)," m\xB2 deck"]}),(0,R.jsxs)("div",{children:[(2*(z+G)).toFixed(2)," m perimeter"]})]}):null]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,R.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,R.jsxs)("div",{className:"deck-outline__summary",children:[(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Deck area"}),(0,R.jsxs)("strong",{children:[De.toFixed(2)," m\xB2"]})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Perimeter"}),(0,R.jsxs)("strong",{children:[Pe.toFixed(2)," m"]})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Wall edges"}),(0,R.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"Visible edge"}),(0,R.jsxs)("strong",{children:[ze.toFixed(2)," m"]})]})]}):null,(0,R.jsxs)("div",{className:"deck-outline__actions",children:[(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(q=>({...q,points:q.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m(null),o(q=>({...q,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,R.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(q=>({...q,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,R.jsx)("div",{className:"deck-editor-layout",children:(0,R.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,R.jsxs)("div",{className:"deck-outline",children:[(0,R.jsxs)("svg",{ref:E,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${A} ${M} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:Me,onPointerMove:_e,onPointerUp:Oe,onPointerLeave:()=>{m(null),w.current||(b.current=null)},children:[(0,R.jsx)("defs",{children:(0,R.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,R.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,R.jsx)("rect",{x:-Un,y:-Dn,width:Un*3,height:Dn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,R.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(q=>`${q.x},${q.y}`).join(" ")}):null,n.isOutlineClosed?(0,R.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(q=>`${q.x},${q.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((q,B)=>{let T=n.points[n.isOutlineClosed?(B+1)%n.points.length:B+1],D=Ae(q,T),ee=D?-(T.y-q.y)/D:0,xe=D?(T.x-q.x)/D:0,we=(q.x+T.x)/2,_=(q.y+T.y)/2,j=ee*(we-me.x)+xe*(_-me.y)>=0?1:-1,L=we+ee*rc*j,ne=_+xe*rc*j;return(0,R.jsxs)("g",{children:[(0,R.jsx)("line",{className:"deck-outline__edge-hit",x1:q.x,y1:q.y,x2:T.x,y2:T.y,onClick:n.isOutlineClosed?()=>Se(B):void 0}),(0,R.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(B)?" is-wall":""}`,x1:q.x,y1:q.y,x2:T.x,y2:T.y,pointerEvents:"none"}),(0,R.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(B)?" is-wall":""}`,x:L,y:ne,textAnchor:"middle",dominantBaseline:"central",fontSize:bw/l,children:[D.toFixed(2)," m"]})]},`segment-${B}`)}):null,!n.isOutlineClosed&&n.points.length>0&&h?(()=>{let q=n.points[n.points.length-1],B=Ae(q,h);if(!B)return null;let T=-(h.y-q.y)/B,D=(h.x-q.x)/B,ee=(q.x+h.x)/2,xe=(q.y+h.y)/2;return(0,R.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,R.jsx)("line",{x1:q.x,y1:q.y,x2:h.x,y2:h.y}),(0,R.jsxs)("text",{x:ee+T*.34,y:xe+D*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:bw/l,children:[B.toFixed(2)," m"]})]})})():null,n.points.map((q,B)=>(0,R.jsx)("circle",{className:"deck-outline__point",cx:q.x,cy:q.y,r:"0.13",onPointerDown:T=>W(T,B)},`point-${B}`))]}),(0,R.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,R.jsx)("button",{type:"button",onClick:()=>c(q=>Math.max(.5,q-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,R.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,R.jsx)("button",{type:"button",onClick:()=>c(q=>Math.min(1,q+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&Y?(0,R.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(Y.x-A)/u*100}%`,top:`${(Y.y-M)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,R.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(q=>Td(q.points,!0)?{...q,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...q,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,R.jsxs)("div",{className:"deck-outline__supporting",children:[(0,R.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,R.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,U==="pictureFrame"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(q=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===q.id?" is-selected":""}`,onClick:()=>o(B=>({...B,pictureFrame:q.id})),children:[(0,R.jsx)("img",{className:"truss-estimator__visual-card-img",src:Pt(q.img),alt:""}),(0,R.jsx)("span",{children:q.label})]},q.id))}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(q=>(0,R.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===q.id?" is-selected":""}`,onClick:()=>o(B=>({...B,direction:q.id})),children:[(0,R.jsx)("img",{className:"truss-estimator__visual-card-img",src:Pt(q.img),alt:""}),(0,R.jsx)("span",{children:q.label})]},q.id))})]})]}):null,U==="substructure"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,R.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,R.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,R.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,R.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Ca.joist.spacingOptions.map(q=>(0,R.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===q.id?" is-selected":""}`,onClick:()=>o(B=>({...B,joistSpacing:q.id})),children:(0,R.jsx)("div",{className:"truss-estimator__option-title",children:q.label})},q.id))})]}):null]}),(0,R.jsxs)("div",{className:"truss-estimator__nav",children:[(0,R.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:Je,children:"Back"}),(0,R.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:_t,disabled:!ve(),children:[(0,R.jsx)("span",{children:Be}),(0,R.jsx)("span",{className:"arrow",children:(0,R.jsx)(Ht,{})})]})]})]})]})})}var Ea=V(Ve());var Q=V(re()),vw=12,ww=30,Bn=12,On=8,yw=.56,qa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Si=["range","height","gate","posts"],L_={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},oc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),lc=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),H_=(e,t,a,r)=>{let i=oc(e,t,a),n=oc(e,t,r),o=oc(a,r,e),l=oc(a,r,t);return i===0&&lc(e,t,a)||n===0&&lc(e,t,r)||o===0&&lc(a,r,e)||l===0&&lc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},sc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&H_(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function Ad({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ea.useState)(0),[n,o]=(0,Ea.useState)(L_),l=(0,Ea.useRef)(null),c=(0,Ea.useRef)(null),[p,d]=(0,Ea.useState)(1),[h,m]=(0,Ea.useState)({x:0,y:0}),[b,w]=(0,Ea.useState)(null),E=(0,Ea.useRef)(null),U=(0,Ea.useRef)(null),f=(0,Ea.useRef)(null),u=Si[r],g=n.range?qa.ranges[n.range]:null,v=Bn/p,k=On/p,A=(Bn-v)/2,M=(On-k)/2,z=Math.max(-Bn,Math.min(Bn*2-v,A+h.x)),G=Math.max(-On,Math.min(On*2-k,M+h.y)),P=n.boundaryPoints.reduce((_,j)=>({x:_.x+j.x/Math.max(1,n.boundaryPoints.length),y:_.y+j.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),ge=_=>{let j=new Set,L=[];return _.forEach(ne=>{let[te,C]=ne.split(",").map(Number),X=[{key:`H,${te},${C}`,type:"H",x:te,y:C},{key:`H,${te},${C+1}`,type:"H",x:te,y:C+1},{key:`V,${te},${C}`,type:"V",x:te,y:C},{key:`V,${te+1},${C}`,type:"V",x:te+1,y:C}],K=[!_.has(`${te},${C-1}`),!_.has(`${te},${C+1}`),!_.has(`${te-1},${C}`),!_.has(`${te+1},${C}`)];X.forEach((pe,ke)=>{K[ke]&&!j.has(pe.key)&&(j.add(pe.key),L.push(pe))})}),L},Ae=(_,j)=>ge(_).filter(L=>!j.has(L.key)),De=(_,j)=>Ae(_,j).length,Pe=(_,j)=>{let L={};Ae(_,j).forEach(te=>{var C,X,K,pe;te.type==="H"?((L[C=`${te.x},${te.y}`]||(L[C]=[])).push("H"),(L[X=`${te.x+1},${te.y}`]||(L[X]=[])).push("H")):((L[K=`${te.x},${te.y}`]||(L[K]=[])).push("V"),(L[pe=`${te.x},${te.y+1}`]||(L[pe]=[])).push("V"))});let ne=0;return Object.values(L).forEach(te=>{(te.length===1||te.length===2&&te[0]!==te[1]||te.length>=3)&&(ne+=1)}),ne},me=(()=>{let _=n.range?qa.ranges[n.range]:qa.ranges.boundary,j=n.height??"1.8",L=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Ft,vr,$a)=>Ft+(n.excludedBoundaryEdges.has($a)?0:Math.hypot(n.boundaryPoints[$a+1].x-vr.x,n.boundaryPoints[$a+1].y-vr.y)),0):0,ne=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||qa.gate[n.gateType].widthDefault:0,te=Math.max(0,L-ne),C=te>0?Math.ceil(te/_.panelWidthM):0,X=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,K=n.boundaryMode==="quick"?te>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,X?-1:void 0).reduce((Ft,vr,$a)=>{let Pd=$a>0&&!n.excludedBoundaryEdges.has($a-1),Qn=$a<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has($a);return Ft+(Pd||Qn?1:0)},0):0,pe=te>0?Math.ceil(te/_.panelWidthM)+1:0,ke=Math.max(0,pe-K),We=n.mountingType?qa.mounting[n.mountingType]:qa.mounting.concrete,xt=n.gateType&&n.gateType!=="none"?2:0,ua=ke+K+xt,cl=n.mountingType==="postcrete"?ua*qa.mounting.postcrete.bagsPerPost:0,pa=n.gravelBoard==="yes"?C:0;return{range:_,height:j,totalEdgeM:L,fencedLengthM:te,gateWidthM:ne,panelsCount:C,cornerPostCount:K,intermediatePostCount:ke,gatePostCount:xt,totalPostCount:ua,bagsCount:cl,gravelCount:pa,capCount:ua,mounting:We}})(),Y=n.gateType&&n.gateType!=="none"?qa.gate[n.gateType].label:null,ce=Number(me.height)<=1.2?"6":"8",ye=me?[{key:`panels-${n.range??"boundary"}-${me.height}`,label:`${me.range.label} panels (${me.height}m)`,qty:me.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${ce}`,label:"Intermediate concrete posts",qty:me.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ce}`,label:"End and corner concrete posts",qty:me.cornerPostCount+me.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ce}`,label:"Timber fence posts",qty:me.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:me.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...Y?[{key:"gate",label:Y,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...me.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:me.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],ut=()=>{if(u==="range"){let _=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&_}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},ve=r===Si.length-1?a:"Next",Be=_=>{o(j=>{let L=_(new Set(j.grid)),ne=new Set([...j.excludedEdges].filter(te=>ge(L).some(C=>C.key===te)));return{...j,grid:L,excludedEdges:ne}})},je=(_,j,L)=>{Be(ne=>{let te=`${_},${j}`;return L?ne.add(te):ne.delete(te),ne})},Me=(_,j,L,ne,te)=>{let C=_,X=j,K=Math.abs(L-_),pe=_<L?1:-1,ke=-Math.abs(ne-j),We=j<ne?1:-1,xt=K+ke;for(;je(C,X,te),!(C===L&&X===ne);){let ua=2*xt;ua>=ke&&(xt+=ke,C+=pe),ua<=K&&(xt+=K,X+=We)}},W=(_,j)=>{let L=c.current?.getBoundingClientRect();if(!L)return null;let ne=Math.floor((_-L.left)/ww),te=Math.floor((j-L.top)/ww);return ne<0||te<0||ne>=vw||te>=vw?null:{x:ne,y:te}},_e=_=>{if(n.gridMode!=="draw")return;let j=W(_.clientX,_.clientY);if(!j)return;_.preventDefault();let L=`${j.x},${j.y}`,ne=!n.grid.has(L);l.current={active:!0,paintValue:ne,lastX:j.x,lastY:j.y},_.currentTarget.setPointerCapture(_.pointerId),je(j.x,j.y,ne)},Oe=_=>{let j=l.current;if(!j?.active)return;let L=W(_.clientX,_.clientY);L&&(L.x===j.lastX&&L.y===j.lastY||(Me(j.lastX,j.lastY,L.x,L.y,j.paintValue),l.current={...j,lastX:L.x,lastY:L.y}))},Se=_=>{l.current?.active&&(l.current=null,_.currentTarget.releasePointerCapture(_.pointerId))},Je=(_,j,L=!1)=>{let ne=f.current?.getBoundingClientRect();if(!ne)return null;let te=L?1:.25;return{x:Math.round(Math.max(z,Math.min(z+v,z+(_-ne.left)/ne.width*v))/te)*te,y:Math.round(Math.max(G,Math.min(G+k,G+(j-ne.top)/ne.height*k))/te)*te}},_t=_=>{if(n.boundaryClosed){let L=_.target;if(L!==_.currentTarget&&!L.classList.contains("fence-boundary__grid"))return;U.current={startX:_.clientX,startY:_.clientY,startViewX:z,startViewY:G},_.currentTarget.setPointerCapture(_.pointerId);return}let j=Je(_.clientX,_.clientY,!0);j&&(w(null),o(L=>{let ne=[...L.boundaryPoints,j];return sc(ne,!1)?{...L}:{...L,boundaryPoints:ne}}))},q=(_,j)=>{if(_.stopPropagation(),!n.boundaryClosed){if(j!==0||n.boundaryPoints.length<3)return;o(L=>sc(L.boundaryPoints,!0)?L:{...L,boundaryPoints:[...L.boundaryPoints,L.boundaryPoints[0]],boundaryClosed:!0});return}E.current=j,_.currentTarget.setPointerCapture(_.pointerId)},B=_=>{if(U.current){let L=f.current?.getBoundingClientRect();if(!L)return;let ne=U.current,te=ne.startViewX-(_.clientX-ne.startX)/L.width*v,C=ne.startViewY-(_.clientY-ne.startY)/L.height*k;m({x:te-A,y:C-M});return}if(n.boundaryClosed||w(Je(_.clientX,_.clientY,!0)),E.current===null)return;let j=Je(_.clientX,_.clientY);j&&o(L=>{let ne=L.boundaryPoints.length>2&&L.boundaryPoints[0].x===L.boundaryPoints[L.boundaryPoints.length-1].x&&L.boundaryPoints[0].y===L.boundaryPoints[L.boundaryPoints.length-1].y,te=L.boundaryPoints.map((C,X)=>{let K=X===E.current,pe=ne&&E.current===0&&X===L.boundaryPoints.length-1;return K||pe?j:C});return sc(te,!1)?L:{...L,boundaryPoints:te}})},T=_=>{U.current=null,E.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId)},D=_=>{o(j=>{let L=new Set(j.excludedBoundaryEdges);return L.has(_)?L.delete(_):L.add(_),{...j,excludedBoundaryEdges:L}})},ee=()=>{r===0?e():i(_=>_-1)},xe=()=>{ut()&&(r===Si.length-1?t?.(ye):i(_=>_+1))},we=ge(n.grid);return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)("div",{className:"truss-estimator",children:[(0,Q.jsxs)("div",{className:"quick-order-hero",children:[(0,Q.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Q.jsx)("h1",{children:"Fencing Calculator"}),(0,Q.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,Q.jsxs)("div",{className:"truss-estimator__card",children:[(0,Q.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(qa.ranges).map(([_,j])=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===_?" is-selected":""}`,onClick:()=>o(L=>({...L,range:_})),children:[(0,Q.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,Q.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},_))})]}):null,u==="range"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,Q.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,Q.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(_=>({..._,boundaryMode:"quick"})),children:"Quick estimate"}),(0,Q.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(_=>({..._,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,Q.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,Q.jsx)("span",{children:"Total fence length (m)"}),(0,Q.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:_=>o(j=>({...j,quickLengthM:_.target.value}))})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)("div",{className:"fence-boundary__toolbar",children:(0,Q.jsxs)("div",{className:"fence-boundary__actions",children:[(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(_=>({..._,boundaryPoints:_.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m({x:0,y:0}),w(null),o(_=>({..._,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,Q.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(_=>({..._,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,Q.jsxs)("div",{className:"fence-boundary",children:[(0,Q.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${z} ${G} ${v} ${k}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:_t,onPointerMove:B,onPointerUp:T,onPointerLeave:()=>{w(null),U.current||(E.current=null)},children:[(0,Q.jsx)("defs",{children:(0,Q.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,Q.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,Q.jsx)("rect",{x:-Bn,y:-On,width:Bn*3,height:On*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,Q.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(_=>`${_.x},${_.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((_,j)=>{let L=n.boundaryPoints[j+1],ne=Math.hypot(L.x-_.x,L.y-_.y),te=ne?-(L.y-_.y)/ne:0,C=ne?(L.x-_.x)/ne:0,X=(_.x+L.x)/2,K=(_.y+L.y)/2,pe=te*(X-P.x)+C*(K-P.y)>=0?1:-1,ke=X+te*yw*pe,We=K+C*yw*pe;return(0,Q.jsxs)("g",{children:[(0,Q.jsx)("line",{className:"fence-boundary__edge-hit",x1:_.x,y1:_.y,x2:L.x,y2:L.y,onClick:n.boundaryClosed?()=>D(j):void 0}),(0,Q.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x1:_.x,y1:_.y,x2:L.x,y2:L.y,pointerEvents:"none"}),(0,Q.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(j)?" is-excluded":""}`,x:ke,y:We,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[ne.toFixed(2)," m"]})]},`fence-edge-${j}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let _=n.boundaryPoints[n.boundaryPoints.length-1],j=Math.hypot(b.x-_.x,b.y-_.y);if(!j)return null;let L=-(b.y-_.y)/j,ne=(b.x-_.x)/j,te=(_.x+b.x)/2,C=(_.y+b.y)/2;return(0,Q.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,Q.jsx)("line",{x1:_.x,y1:_.y,x2:b.x,y2:b.y}),(0,Q.jsxs)("text",{x:te+L*.34,y:C+ne*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[j.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((_,j)=>j>0&&j===n.boundaryPoints.length-1&&_.x===n.boundaryPoints[0]?.x&&_.y===n.boundaryPoints[0]?.y?null:(0,Q.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&j===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:_.x,cy:_.y,r:"0.13",onPointerDown:L=>q(L,j)},`fence-point-${j}`))]}),(0,Q.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,Q.jsx)("button",{type:"button",onClick:()=>d(_=>Math.max(.5,_-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,Q.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,Q.jsx)("button",{type:"button",onClick:()=>d(_=>Math.min(1,_+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,Q.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(_=>sc(_.boundaryPoints,!1)?_:{..._,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,Q.jsx)("div",{className:"truss-estimator__grid-hint",children:n.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,Q.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,Q.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${me.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,Q.jsxs)("div",{children:[me.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:qa.heights.map(_=>(0,Q.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===_?" is-selected":""}`,onClick:()=>o(j=>({...j,height:_})),children:(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Pt(`/fencing/height/${_}.webp`),alt:""})},_))}),(0,Q.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(_=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===_.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gravelBoard:_.id})),children:[(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Pt(_.img),alt:""}),(0,Q.jsx)("span",{children:_.label})]},_.id))})]}):null,u==="gate"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(_=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===_.id?" is-selected":""}`,onClick:()=>o(j=>({...j,gateType:_.id,gateWidthM:_.id==="none"?"":String(qa.gate[_.id].widthDefault)})),children:[(0,Q.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Pt(_.img),alt:""}),(0,Q.jsx)("span",{children:_.label})]},_.id))}),n.gateType&&n.gateType!=="none"?(0,Q.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,Q.jsx)("span",{children:"Gate width (m)"}),(0,Q.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:_=>o(j=>({...j,gateWidthM:_.target.value}))})]}):null]}):null,u==="posts"?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Si.length]}),(0,Q.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,Q.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,Q.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(qa.mounting).map(([_,j])=>(0,Q.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===_?" is-selected":""}`,onClick:()=>o(L=>({...L,mountingType:_})),children:[(0,Q.jsx)("div",{className:"truss-estimator__option-title",children:j.label}),(0,Q.jsx)("div",{className:"truss-estimator__option-copy",children:j.blurb})]},_))})]}):null]}),(0,Q.jsxs)("div",{className:"truss-estimator__nav",children:[(0,Q.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ee,children:"Back"}),(0,Q.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:xe,disabled:!ut(),children:[(0,Q.jsx)("span",{children:ve}),(0,Q.jsx)("span",{className:"arrow",children:(0,Q.jsx)(Ht,{})})]})]})]})]})})}var cc=V(Ve()),be=V(re()),_w={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function Rd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,cc.useState)("floor"),[n,o]=(0,cc.useState)(""),[l,c]=(0,cc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,d=_w[r],h=Math.ceil(p/d.coverage),m=[{key:`insulation-${r}`,label:`${d.product} ${d.thickness}`,qty:h,unit:d.salesUnit,query:d.product,category:"insulation"}],b=Object.entries(_w);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:b.map(([w,E])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>i(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:d.product}),(0,be.jsxs)("strong",{children:[h," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(m),disabled:p<=0,children:a})]})]})]})})}var Ln=V(Ve()),Z=V(re()),j_=10,Q_=1.9*.762,G_=1.9*1.524,uc=()=>({height:"",width:""}),pc=e=>Number.parseFloat(e)||0,xw=({height:e,width:t})=>pc(e)*pc(t);function Ud({onBack:e}){let[t,a]=(0,Ln.useState)([uc()]),[r,i]=(0,Ln.useState)([uc()]),[n,o]=(0,Ln.useState)("0"),[l,c]=(0,Ln.useState)("0"),[p,d]=(0,Ln.useState)(1),h=t.reduce((f,u)=>f+xw(u),0),m=r.reduce((f,u)=>f+xw(u),0),b=pc(n)*Q_+pc(l)*G_,w=Math.max(0,h-m-b),E=w*p/j_,U=(f,u,g,v)=>{f(k=>k.map((A,M)=>M===u?{...A,[g]:v}:A))};return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)("div",{className:"truss-estimator",children:[(0,Z.jsxs)("div",{className:"quick-order-hero",children:[(0,Z.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Z.jsx)("h1",{children:"Paint Calculator"}),(0,Z.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,Z.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,Z.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,Z.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),t.map((f,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:g=>U(a,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:g=>U(a,u,"width",g.target.value)})]}),t.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((v,k)=>k!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(f=>[...f,uc()]),children:"+ Add another wall"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,Z.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,Z.jsx)("span",{}),(0,Z.jsx)("span",{children:"Height (m)"}),(0,Z.jsx)("span",{children:"Width (m)"}),(0,Z.jsx)("span",{})]}),r.map((f,u)=>(0,Z.jsxs)("div",{className:"paint-calculator__row",children:[(0,Z.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:f.height,onChange:g=>U(i,u,"height",g.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,Z.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:f.width,onChange:g=>U(i,u,"width",g.target.value)})]}),r.length>1?(0,Z.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(g=>g.filter((v,k)=>k!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,Z.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(f=>[...f,uc()]),children:"+ Add another area"})]}),(0,Z.jsxs)("div",{className:"paint-calculator__section",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,Z.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:n,onChange:f=>o(f.target.value)})]}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Double doors"}),(0,Z.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:f=>c(f.target.value)})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,Z.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,Z.jsxs)("label",{className:"truss-estimator__field",children:[(0,Z.jsx)("span",{children:"Number of coats"}),(0,Z.jsxs)("select",{value:p,onChange:f=>d(Number(f.target.value)),children:[(0,Z.jsx)("option",{value:"1",children:"1 coat"}),(0,Z.jsx)("option",{value:"2",children:"2 coats"}),(0,Z.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,Z.jsxs)("div",{className:"paint-calculator__totals",children:[(0,Z.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,Z.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paintable area"}),(0,Z.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Coverage"}),(0,Z.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,Z.jsxs)("div",{children:[(0,Z.jsx)("span",{children:"Paint required"}),(0,Z.jsxs)("strong",{children:[E.toFixed(1)," litres"]})]})]}),(0,Z.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,Z.jsxs)("div",{className:"paint-calculator__actions",children:[(0,Z.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,Z.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var br=V(Ve()),ie=V(re()),dc=e=>Number.parseFloat(e)||0,Dd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Bd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,br.useState)("paving"),[n,o]=(0,br.useState)("council"),[l,c]=(0,br.useState)(""),[p,d]=(0,br.useState)(""),[h,m]=(0,br.useState)("100"),[b,w]=(0,br.useState)("50"),[E,U]=(0,br.useState)(!0),[f,u]=(0,br.useState)(!0),g=dc(l)*dc(p),v=g,k=g*(dc(h)/1e3),A=g*.04,M=g*(dc(b)/1e3),z=Math.ceil(v/.36),G=Math.ceil(v/.1),P=Math.ceil(k*1700/800),ge=Math.ceil(A*1600/800),Ae=Math.ceil(M*1600/800),De=r==="paving"?{qty:z,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Ae,unit:"bag"},Pe={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],ze=[{key:`surface-${n}`,label:Dd[r].find(Y=>Y.id===n)?.label??"Surface material",qty:De.qty,unit:De.unit,query:Pe,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:P,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:ge,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{className:"truss-estimator",children:[(0,ie.jsxs)("div",{className:"quick-order-hero",children:[(0,ie.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ie.jsx)("h1",{children:"Paving & Driveway Calculator"}),(0,ie.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ie.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([Y,ce,ye])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===Y?" is-selected":""}`,onClick:()=>{i(Y),o(Dd[Y][0].id)},children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:ce}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:ye})]},Y))}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Finish"}),(0,ie.jsx)("select",{value:n,onChange:Y=>o(Y.target.value),children:Dd[r].map(Y=>(0,ie.jsx)("option",{value:Y.id,children:Y.label},Y.id))})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ie.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:Y=>c(Y.target.value)})]}),(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Width (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:Y=>d(Y.target.value)})]})]}),r==="gravel"&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Gravel depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:Y=>w(Y.target.value)})]}),E&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:Y=>m(Y.target.value)})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:E,onChange:Y=>U(Y.target.checked)}),(0,ie.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:f,onChange:Y=>u(Y.target.checked)}),(0,ie.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ie.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Surface area"}),(0,ie.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ie.jsx)("strong",{children:r==="paving"?`${z} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Ae} bulk bags`})]}),E&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"MOT Type 1"}),(0,ie.jsxs)("strong",{children:[P," bulk bags"]})]}),f&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Sharp sand"}),(0,ie.jsxs)("strong",{children:[ge," bulk bags"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ie.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ie.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ie.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(ze),disabled:g<=0,children:a})]})]})]})})}var ol=V(Ve()),oe=V(re()),Y_=2.88,kw=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],Nw=()=>({length:"",height:""}),Od=e=>Number.parseFloat(e)||0;function Ld({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ol.useState)([Nw()]),[n,o]=(0,ol.useState)(""),[l,c]=(0,ol.useState)("standard"),[p,d]=(0,ol.useState)("screws"),h=r.reduce((A,M)=>A+Od(M.length)*Od(M.height),0),m=Math.max(0,h-Od(n)),b=Math.ceil(m/Y_),w=Math.ceil(m*12),E=Math.ceil(w/1e3),U=Math.ceil(m*1.2),f=Math.ceil(U/90),u=Math.ceil(m/3.5),g=kw.find(A=>A.id===l)?.label??"Standard",v=[{key:"board",label:`${g} plasterboard`,qty:b,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],k=(A,M,z)=>{i(G=>G.map((P,ge)=>ge===A?{...P,[M]:z}:P))};return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,oe.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,oe.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:kw.map(A=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===A.id?" is-selected":""}`,onClick:()=>c(A.id),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:A.label}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:A.blurb})]},A.id))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([A,M,z])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===A?" is-selected":""}`,onClick:()=>d(A),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:M}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:z})]},A))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,oe.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,oe.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,oe.jsx)("span",{children:"Surface"}),(0,oe.jsx)("span",{children:"Length (m)"}),(0,oe.jsx)("span",{children:"Height (m)"}),(0,oe.jsx)("span",{})]}),r.map((A,M)=>(0,oe.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,oe.jsxs)("span",{children:["Surface ",M+1]}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} length`,type:"number",min:"0",step:"0.01",value:A.length,onChange:z=>k(M,"length",z.target.value)}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} height`,type:"number",min:"0",step:"0.01",value:A.height,onChange:z=>k(M,"height",z.target.value)}),r.length>1?(0,oe.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(z=>z.filter((G,P)=>P!==M)),children:"Remove"}):null]},`surface-${M}`)),(0,oe.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(A=>[...A,Nw()]),children:"+ Add another surface"}),(0,oe.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,oe.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,oe.jsx)("small",{children:"optional"})]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:A=>o(A.target.value)})]})]}),(0,oe.jsxs)("div",{className:"materials-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Board area"}),(0,oe.jsxs)("strong",{children:[m.toFixed(2)," m\xB2"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,oe.jsx)("strong",{children:b})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,oe.jsx)("strong",{children:p==="screws"?`${w} (${E} boxes)`:`${u} bags`})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Joint tape"}),(0,oe.jsxs)("strong",{children:[U," m (",f," rolls)"]})]})]}),(0,oe.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,oe.jsxs)("div",{className:"materials-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:m<=0,children:a})]})]})]})})}var ll=V(Ve());var y=V(re()),At={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},mc=["range","pitchAndDimensions","quantityAndGirders","bracing"],X_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function V_({degrees:e}){let a=e*Math.PI/180,i=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function $_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(d,h,m,b,w=8,E)=>{let U=m-d,f=b-h,u=Math.hypot(U,f)||1,g=-f/u,v=U/u,k=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:d,y1:h,x2:m,y2:b,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:d,y1:h,x2:m,y2:b,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:d-g*k,y1:h-v*k,x2:m-g*k,y2:b-v*k,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(d,h,m)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:d-7.5,y:h-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:d-4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d+4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d-4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d+4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:d,cy:h,r:"1",fill:n})]},m),c=(d,h)=>(0,y.jsx)("rect",{x:d-9,y:"110",width:"18",height:"10",fill:a},h),p=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function Z_({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function Sw({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Hd({onBack:e}){let[t,a]=(0,ll.useState)(0),[r,i]=(0,ll.useState)(X_),[n,o]=(0,ll.useState)(!1),[l,c]=(0,ll.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},h=(()=>{let f=r.range?At.ranges[r.range]:At.ranges.standard,u=r.pitch??"22.5",g=At.pitchMultipliers[u],v=(Number.parseFloat(r.spanMM)||0)/1e3,A=(Number.parseFloat(r.overhangMM)||0)>At.overhang.thresholdMM,M=p(),z=M+r.girderCount,G=Number.parseFloat(r.roofLengthM)||0,P=r.treatment?At.treatment[r.treatment]:At.treatment.untreated,ge=At.estimate.ranges[r.range??"standard"],Ae=ge.supplyAt8m*Math.max(.7,v/8)*g*(1+P.surchargePct)+(A?At.overhang.surchargePerTruss:0),De=M*Ae,Pe=r.girderCount*Ae*At.estimate.girderMultiplier,ze=r.bracing==="yes"?G*At.estimate.bracingPerMetre:0,me=De+Pe+ze+At.estimate.delivery,Y=At.estimate.design+M*ge.installPerTruss+r.girderCount*40,ce=me+Y,ye=ce*.2;return{range:f,count:M,girderCount:r.girderCount,overhangApplies:A,overhangUnits:z,roofLengthM:G,treatment:P,trussSupply:De,bracingMaterials:ze,delivery:At.estimate.delivery,labour:Y,subtotal:ce,vat:ye,total:ce+ye}})(),m=()=>{let f=mc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===mc.length-1?"View truss request":"Next",w=()=>{n?o(!1):t===0?e():a(f=>f-1)},E=()=>{m()&&(t===mc.length-1?(c(!1),o(!0)):a(f=>f+1))},U=()=>{let f=mc[t];return f==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(At.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(v=>({...v,range:u})),children:[(0,y.jsx)($_,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},u))})]}):f==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>i(g=>({...g,spanMM:u.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>i(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",At.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:At.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(g=>({...g,pitch:u})),children:[(0,y.jsx)(V_,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>i(g=>({...g,roofLengthM:u.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:At.centresOptions.map(u=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>i(g=>({...g,centres:u})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>i(g=>({...g,bracing:u.id})),children:[(0,y.jsx)(Z_,{enabled:u.id==="yes"}),(0,y.jsx)("span",{children:u.label})]},u.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(Sw,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>i(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(Sw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[h.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[h.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:h.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:h.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:ot(h.trussSupply)})]}),h.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:ot(h.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:ot(h.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:ot(h.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:ot(h.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:ot(h.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:ot(h.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:U()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!m(),children:[(0,y.jsx)("span",{children:b}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Ht,{})})]})]})]})]})})}var Ci=V(Ve()),I=V(re()),Ew=e=>Number.parseFloat(e)||0,fc=(e,t)=>Ew(e)*(t==="m"?1:.3048),Cw=()=>({length:"",width:""}),qw=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function K_({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function jd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ci.useState)("total"),[n,o]=(0,Ci.useState)("m"),[l,c]=(0,Ci.useState)(""),[p,d]=(0,Ci.useState)([Cw()]),[h,m]=(0,Ci.useState)(""),[b,w]=(0,Ci.useState)("chamfered"),E="4.2",U=r==="total"?fc(l,n):p.reduce((k,A)=>k+2*(fc(A.length,n)+fc(A.width,n)),0),f=Math.max(0,U-fc(h,n)),u=Math.ceil(f/Ew(E)),g=[{key:`skirting-${b}`,label:`${qw.find(k=>k.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],v=(k,A,M)=>{d(z=>z.map((G,P)=>P===k?{...G,[A]:M}:G))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>i("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",n,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:k=>c(k.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",n,")"]}),(0,I.jsxs)("span",{children:["Width (",n,")"]}),(0,I.jsx)("span",{})]}),p.map((k,A)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",A+1]}),(0,I.jsx)("input",{"aria-label":`Room ${A+1} length in ${n}`,type:"number",min:"0",step:"0.01",value:k.length,onChange:M=>v(A,"length",M.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${A+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:k.width,onChange:M=>v(A,"width",M.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>d(M=>M.filter((z,G)=>G!==A)),children:"Remove"}):null]},`room-${A}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>d(k=>[...k,Cw()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",n,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:k=>m(k.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:qw.map(k=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===k.id?" is-selected":""}`,onClick:()=>w(k.id),children:[(0,I.jsx)(K_,{profile:k.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[f.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:u})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:f<=0,children:a})]})]})]})})}var Hn=V(Ve()),le=V(re()),sl=e=>Number.parseFloat(e)||0;function Qd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Hn.useState)("studs"),[n,o]=(0,Hn.useState)(""),[l,c]=(0,Hn.useState)(""),[p,d]=(0,Hn.useState)("600"),[h,m]=(0,Hn.useState)("2.4"),b=n&&l&&p?Math.ceil(sl(l)/(sl(p)/1e3))+1:0,w=b*sl(n),E=sl(h)>0?Math.ceil(w/sl(h)):0,U=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},g={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)("div",{className:"truss-estimator",children:[(0,le.jsxs)("div",{className:"quick-order-hero",children:[(0,le.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,le.jsx)("h1",{children:"Timber Calculator"}),(0,le.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,le.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,le.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,le.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(v=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:f[v][0]}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:f[v][1]})]},v))})]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:[g.member," (m)"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsxs)("span",{children:[g.overall," (m)"]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,le.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsx)("span",{children:"Centres (mm)"}),(0,le.jsxs)("select",{value:p,onChange:v=>d(v.target.value),children:[(0,le.jsx)("option",{value:"300",children:"300 mm"}),(0,le.jsx)("option",{value:"400",children:"400 mm"}),(0,le.jsx)("option",{value:"450",children:"450 mm"}),(0,le.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,le.jsxs)("label",{className:"truss-estimator__field",children:[(0,le.jsx)("span",{children:"Stock length (m)"}),(0,le.jsxs)("select",{value:h,onChange:v=>m(v.target.value),children:[(0,le.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,le.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,le.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,le.jsxs)("div",{className:"materials-calculator__totals",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,le.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:g.count}),(0,le.jsx)("strong",{children:b})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Linear metres"}),(0,le.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,le.jsxs)("div",{children:[(0,le.jsxs)("span",{children:[h," m lengths"]}),(0,le.jsx)("strong",{children:E})]})]}),(0,le.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,le.jsxs)("div",{className:"materials-calculator__actions",children:[(0,le.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,le.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:w<=0,children:a})]})]})]})})}var Gd=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Hd},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:Ad},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:zd},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Cd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Ud},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:jd},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Sd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Md},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Ld},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:Rd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:Qd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Bd}];var hc=V(Ve());var Xe=V(Ve());var N=V(re()),P_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Yd={wasteFactorEnabled:!0},J_=3e3,Mw=null;function gc(e,t){let a=Wo(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function F_(e){return e&&e.length>0?e.join(" x "):"-"}function Xd({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=ec(),o=`${e}~${t.map(C=>`${C.key}|${C.query}|${C.category??""}|${C.qty}`).join("~")}`,l=o!==Mw,[c,p]=(0,Xe.useState)(null),[d,h]=(0,Xe.useState)([]),[m,b]=(0,Xe.useState)(l),[w,E]=(0,Xe.useState)(null),[U,f]=(0,Xe.useState)("tile"),[u,g]=(0,Xe.useState)(null),[v,k]=(0,Xe.useState)(""),[A,M]=(0,Xe.useState)(null),[z,G]=(0,Xe.useState)(""),[P,ge]=(0,Xe.useState)([]),[Ae,De]=(0,Xe.useState)(new Set),[Pe,ze]=(0,Xe.useState)(null),[me,Y]=(0,Xe.useState)(""),[ce,ye]=(0,Xe.useState)([]),ut=(0,Xe.useRef)(null),ve=(0,Xe.useRef)(!1),Be=C=>`${e}:${C}`,je=C=>Pr(C.chosen,{lineId:Be(C.requirement.key),description:C.requirement.label,unit:C.requirement.unit,qty:C.requirement.qty}),Me=(0,Xe.useMemo)(()=>t.map(C=>`${C.key}|${C.query}|${C.category??""}`).join("~"),[t]);(0,Xe.useEffect)(()=>{let C=!1;return hw().then(X=>{C||p(X.itemCount>0)}).catch(()=>{C||p(!1)}),()=>{C=!0}},[]),(0,Xe.useEffect)(()=>{if(!a||!c)return;let C=!1,X;l&&b(!0),E(null);let K=Date.now();return(async()=>{let pe=null;try{pe=(await gw(t)).map(({requirement:We,candidates:xt})=>({requirement:We,candidates:xt,chosen:xt[0]??null}))}catch(ke){C||E(ke instanceof Error?ke.message:"Could not load products")}if(!C){if(Mw=o,l){let ke=J_-(Date.now()-K);ke>0&&await new Promise(We=>{X=window.setTimeout(We,ke)})}C||(pe&&(h(pe),!ve.current&&n&&(ve.current=!0,n.addManyToCart(pe.filter(ke=>ke.chosen).map(je)))),b(!1))}})(),()=>{C=!0,window.clearTimeout(X)}},[a,c,Me]),(0,Xe.useEffect)(()=>{if(!A)return;let C=z.trim();if(!C){ge([]);return}let X=!1,K=window.setTimeout(()=>{Fr(C).then(pe=>{X||ge(pe)}).catch(()=>{X||ge([])})},250);return()=>{X=!0,window.clearTimeout(K)}},[A,z]),(0,Xe.useEffect)(()=>{if(!Pe)return;let C=me.trim();if(!C){ye([]);return}let X=!1,K=window.setTimeout(()=>{Fr(C).then(pe=>{X||ye(pe)}).catch(()=>{X||ye([])})},250);return()=>{X=!0,window.clearTimeout(K)}},[Pe,me]);let W=(0,Xe.useMemo)(()=>{let C=v.trim().toLowerCase(),X=C?d.filter(K=>K.requirement.label.toLowerCase().includes(C)||(K.chosen?.description??"").toLowerCase().includes(C)||(K.chosen?.product_id??"").toLowerCase().includes(C)):d;return u?[...X].sort((K,pe)=>{let ke=K.requirement.label.localeCompare(pe.requirement.label);return u==="asc"?ke:-ke}):X},[d,v,u]),_e=W.filter(C=>C.chosen),Oe=W.filter(C=>!C.chosen),Se=d.filter(C=>C.chosen),Je=Se.filter(C=>C.chosen?.price==null).length,_t=Se.reduce((C,X)=>C+(Ut(je(X),Yd).lineTotal??0),0);if((0,Xe.useEffect)(()=>{i?.(_t)},[_t,i]),!a||c===!1)return null;let q=n?Se.filter(C=>n.cart[Be(C.requirement.key)]).length:0,B=Pe?d.find(C=>C.requirement.key===Pe)??null:null,D=me.trim()?ce:B?.candidates??[],ee=C=>{let X=A===C.requirement.key;M(X?null:C.requirement.key),G(X?"":C.requirement.query)},xe=(C,X)=>{let K=d.find(pe=>pe.requirement.key===C);h(pe=>pe.map(ke=>ke.requirement.key===C?{...ke,chosen:X}:ke)),n&&K&&n.cart[Be(C)]&&n.addToCart(je({...K,chosen:X})),M(null),G("")},we=C=>{h(X=>X.map(K=>K.requirement.key===C?{...K,chosen:null}:K)),n?.cart[Be(C)]&&n.removeFromCart(Be(C))},_=C=>{ze(C.requirement.key),Y(""),ye([])},j=()=>{ze(null),Y(""),ye([])},L=C=>{if(!n)return;let X=Be(C.requirement.key);n.cart[X]?n.removeFromCart(X):n.addToCart(je(C))},ne=C=>{De(X=>{let K=new Set(X);return K.has(C)?K.delete(C):K.add(C),K})},te=C=>{let X=P.length>0?P:C.candidates;return(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",value:z,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:K=>G(K.target.value),"aria-label":`Search a product for ${C.requirement.label}`}),(0,N.jsxs)("div",{className:"estimator-products__options",children:[X.map(K=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${K.product_id===C.chosen?.product_id?" is-selected":""}`,onClick:()=>xe(C.requirement.key,K),children:[(0,N.jsx)("span",{children:K.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[K.product_id,K.price!=null&&` \xB7 ${ot(K.price)}`]})]},K.product_id)),X.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,N.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!m&&(0,N.jsxs)("div",{className:"estimator-products__head",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Matched Products"}),(0,N.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!B&&(0,N.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[Je>0&&(0,N.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,N.jsx)("strong",{children:Je})," need pricing"]}),(0,N.jsxs)("div",{className:"estimator-products__controls",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:C=>k(C.target.value),"aria-label":"Search matched products"}),(0,N.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="tile"?" is-active":""}`,"aria-pressed":U==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,N.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,N.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="list"?" is-active":""}`,"aria-pressed":U==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,N.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,N.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,N.jsxs)("details",{ref:ut,style:{position:"relative"},children:[(0,N.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,N.jsx)("div",{className:"sort-menu-panel",children:P_.map(C=>{let X=u===C.dir;return(0,N.jsxs)("button",{type:"button",className:`sort-menu-item${X?" is-active":""}`,onClick:()=>{g(X?null:C.dir),ut.current?.removeAttribute("open")},children:[(0,N.jsx)("span",{className:"sort-menu-item__check",children:X?"\u2713":""}),C.label]},C.dir)})})]})]})]})]}),B&&(0,N.jsxs)("div",{className:"results-review-page",children:[(0,N.jsxs)("div",{className:"results-review-page__top",children:[(0,N.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:j,children:[(0,N.jsx)(Kr,{}),"Back to results"]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,N.jsx)("div",{className:"results-review-searchbar",children:(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:me,onChange:C=>Y(C.target.value),"aria-label":`Search a product for ${B.requirement.label}`})}),B.chosen&&(0,N.jsx)("div",{className:"results-candidate-actions",children:(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>we(B.requirement.key),children:"Clear selected product"})})]})]}),(0,N.jsxs)("div",{className:"results-review-page__hero",children:[(0,N.jsx)("div",{className:"results-review-page__image-wrap",children:(0,N.jsx)("img",{className:"fill-img results-review-page__image",src:Ya(B.chosen?.description||B.requirement.label,B.chosen?.product_id,B.chosen?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-review-page__summary",children:[(0,N.jsx)("h2",{children:B.requirement.label}),(0,N.jsxs)("p",{className:"results-review-page__meta",children:[yi(B.requirement.qty)," ",Na(B.requirement.unit,B.requirement.qty)]}),B.chosen?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"results-review-page__product",children:B.chosen.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[B.chosen.product_id,B.chosen.price!=null?` \xB7 ${gc(B.chosen.price,B.chosen.price_basis)}`:""]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,N.jsx)("div",{className:"results-review-page__actions",children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[Be(B.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(B),disabled:!B.chosen||!n,children:n?.cart[Be(B.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),D.length===0?(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,N.jsxs)("table",{className:"score-breakdown-table",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:"Product"}),(0,N.jsx)("th",{children:"Dims (mm)"}),(0,N.jsx)("th",{children:"Price"}),(0,N.jsx)("th",{"aria-label":"Actions"})]})}),(0,N.jsx)("tbody",{children:D.map(C=>{let X=C.product_id===B.chosen?.product_id;return(0,N.jsxs)("tr",{className:X?"score-breakdown-row--best":"",children:[(0,N.jsxs)("td",{children:[(0,N.jsx)("div",{children:C.description}),(0,N.jsx)("div",{className:"results-row-meta",children:C.product_id})]}),(0,N.jsx)("td",{children:(0,N.jsx)("span",{className:"unit-badge",children:F_(C.measurements_mm)})}),(0,N.jsx)("td",{children:C.price!=null?gc(C.price,C.price_basis):"-"}),(0,N.jsx)("td",{children:(0,N.jsxs)("label",{className:"switch-toggle",title:X?"Currently selected":"Use this candidate",children:[(0,N.jsx)("input",{type:"checkbox",checked:X,onChange:()=>{X?we(B.requirement.key):xe(B.requirement.key,C)},"aria-label":X?`${C.description} selected`:`Use ${C.description}`}),(0,N.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},C.product_id)})})]})]}),!B&&m&&(0,N.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,N.jsx)(fr,{}),(0,N.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!B&&w&&(0,N.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!B&&!m&&!w&&W.length===0&&d.length>0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!B&&!m&&!w&&U==="tile"&&_e.length>0&&(0,N.jsx)("div",{className:"results-tile-grid",children:_e.map(C=>{let{requirement:X,chosen:K}=C,pe=K?Ut(je(C),Yd):null,ke=n?!!n.cart[Be(X.key)]:!1;return(0,N.jsxs)("article",{className:"results-tile-card",children:[(0,N.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>_(C),"aria-label":`Review match for ${X.label}`,children:[(0,N.jsx)("div",{className:"results-tile-card__media",children:(0,N.jsx)("img",{className:"fill-img results-tile-card__image",src:Ya(K?.description||X.label,K?.product_id,K?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-tile-card__body",children:[K?(0,N.jsxs)("div",{className:"results-tile-card__heading",children:[(0,N.jsx)("div",{className:"results-tile-card__title",children:K.description}),(0,N.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,N.jsx)("span",{children:K.product_id}),K.price!=null?(0,N.jsx)("span",{children:gc(K.price,K.price_basis)}):null]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,N.jsxs)("div",{className:"results-tile-card__match",children:[(0,N.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,N.jsx)("div",{className:"results-tile-card__match-name",children:X.label}),(0,N.jsxs)("div",{className:"results-tile-card__meta",children:[yi(X.qty)," ",Na(X.unit,X.qty)]}),pe?.requiredSellUnits!=null?(0,N.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${ot(pe.lineTotal)}`:""]}):K?(0,N.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,N.jsxs)("div",{className:"results-tile-card__actions",children:[(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>_(C),children:"Review"}),(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(C),disabled:!K||!n,children:ke?"\u2713 Added":"+ Add"})]})]},X.key)})}),!B&&!m&&!w&&U==="list"&&_e.length>0&&(0,N.jsx)("div",{className:"bom-table-wrap",children:(0,N.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,N.jsxs)("colgroup",{children:[(0,N.jsx)("col",{style:{width:"56px"}}),(0,N.jsx)("col",{className:"col-item"}),(0,N.jsx)("col",{style:{width:"90px"}}),(0,N.jsx)("col",{style:{width:"80px"}}),(0,N.jsx)("col",{style:{width:"220px"}}),(0,N.jsx)("col",{style:{width:"110px"}})]}),(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{className:"bom-col-header",children:[(0,N.jsx)("th",{"aria-label":"Expand"}),(0,N.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,N.jsx)("tbody",{children:_e.map(C=>{let{requirement:X,chosen:K}=C,pe=K?Ut(je(C),Yd):null,ke=n?!!n.cart[Be(X.key)]:!1,We=Ae.has(X.key);return(0,N.jsxs)(Xe.Fragment,{children:[(0,N.jsxs)("tr",{className:"bom-row",children:[(0,N.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,N.jsx)("button",{type:"button",className:"link-btn",onClick:()=>ne(X.key),"aria-expanded":We,"aria-label":We?"Collapse product options":"Expand product options",children:We?"\u25BE":"\u25B8"})}),(0,N.jsxs)("td",{style:{paddingLeft:0},children:[(0,N.jsx)("div",{className:"bom-component-name",children:X.label}),pe?.requiredSellUnits!=null&&(0,N.jsxs)("div",{className:"results-row-meta",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${ot(pe.lineTotal)}`:""]})]}),(0,N.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:yi(X.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:Na(X.unit,X.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:K?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"bom-component-name",children:K.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[K.product_id,K.price!=null&&` \xB7 ${gc(K.price,K.price_basis)}`]})]}):(0,N.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${ke?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>L(C),disabled:!K||!n,children:ke?"\u2713 Added":"+ Add"})})]}),We&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:A===X.key?te(C):(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsxs)("div",{className:"estimator-products__options",children:[C.candidates.map(xt=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${xt.product_id===K?.product_id?" is-selected":""}`,onClick:()=>xe(X.key,xt),children:[(0,N.jsx)("span",{children:xt.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[xt.product_id,xt.price!=null&&` \xB7 ${ot(xt.price)}`]})]},xt.product_id)),C.candidates.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ee(C),children:"Search the catalogue"})]})})})]},X.key)})})]})}),!B&&!m&&!w&&Oe.length>0&&(0,N.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Require Matching"}),(0,N.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,N.jsx)("div",{className:"results-unmatched-list",children:Oe.map(C=>(0,N.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>_(C),children:[(0,N.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,N.jsx)("span",{className:"results-unmatched-card__title",children:C.requirement.label}),(0,N.jsxs)("span",{className:"results-row-meta",children:[yi(C.requirement.qty)," ",Na(C.requirement.unit,C.requirement.qty)]})]}),(0,N.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},C.requirement.key))})]}),!m&&!w&&d.length>0&&(0,N.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,N.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,N.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!B&&!m&&!w&&(r||q>0)&&(0,N.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,N.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),q>0&&n&&(0,N.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,N.jsxs)("span",{children:["View Basket (",q,")"]}),(0,N.jsx)("span",{className:"arrow",children:(0,N.jsx)(Ht,{})})]})]})]})}var jt=V(re());function Vd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,hc.useState)(0),o=(0,hc.useCallback)(l=>n(l),[]);return(0,jt.jsx)(jt.Fragment,{children:(0,jt.jsxs)("div",{className:"truss-estimator",children:[(0,jt.jsxs)("div",{className:"quick-order-hero",children:[(0,jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,jt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,jt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,jt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,jt.jsx)("strong",{children:ot(i)})," Est. total"]})]}),(0,jt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,jt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,jt.jsx)(Xd,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var I_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function Tw(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let i=I_(e,r);return i?{key:r.key,productId:i,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var $d=V(Ve());var Jt=V(re()),W_=1500;function zw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=zn(),[i,n]=(0,$d.useState)(!1),[o,l]=(0,$d.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,d)=>{let h=Date.now();n(!0),l(null);try{let m=await Promise.all(p.filter(w=>w.qty>0).map(async w=>{let E=(await Fr(w.productId)).find(U=>U.product_id===w.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return Pr(E,{lineId:`${e}:${w.key}`,description:E.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:d})})),b=W_-(Date.now()-h);b>0&&await new Promise(w=>window.setTimeout(w,b)),a(),t(m),r()}catch(m){l(m instanceof Error?m.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function Aw({toolTitle:e}){return(0,Jt.jsx)(Jt.Fragment,{children:(0,Jt.jsxs)("div",{className:"truss-estimator",children:[(0,Jt.jsxs)("div",{className:"quick-order-hero",children:[(0,Jt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Jt.jsx)("h1",{children:"Your Materials"}),(0,Jt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Jt.jsx)("div",{className:"truss-estimator__card",children:(0,Jt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Jt.jsx)(fr,{}),(0,Jt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Ue=V(re());function bc(e){let[t,a]=(0,Va.useState)(!1);return(0,Ue.jsx)(Ws,{onOpenBasket:()=>a(!0),children:(0,Ue.jsx)(ex,{...e,showBasket:t,onShowBasket:a})})}function ex({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,Va.useState)(null),[l,c]=(0,Va.useState)(null),p=Gd.find(z=>z.id===n),{cart:d,updateCartQty:h,updateCartSellUnits:m,updateCartConversions:b,removeFromCart:w,clearCart:E}=zn(),{adding:U,basketError:f,addToBasket:u}=zw(p?.title??"calculator"),g=(0,Va.useRef)(null),v=Ys("estimating-tools",g);(0,Va.useEffect)(()=>{v("viewed")},[v]);let k=r?"basket":U?"adding":l?"review":n??"list",A=(0,Va.useRef)(k);(0,Va.useEffect)(()=>{A.current!==k&&(A.current=k,window.scrollTo(0,0))},[k]);let M=z=>{if(!p)return;v("estimate_completed",{calculator:p.id,lines:z.length});let G=Tw(p.id,z);G?u(G,z[0]?.calculatorWasteIncluded??!1):c(z)};return(0,Ue.jsx)(Ko.Provider,{value:v,children:(0,Ue.jsx)("div",{ref:g,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:Ra().theme,children:(0,Ue.jsx)("main",{className:"main-content",children:r?(0,Ue.jsx)(nl,{cart:d,onUpdateQty:h,onUpdateSellUnits:m,onResolveConversions:b,onRemove:w,onBack:()=>i(!1),onStartNewQuote:()=>{E(),o(null),c(null),i(!1)},internal:a}):U&&p?(0,Ue.jsx)(Aw,{toolTitle:p.title}):p?(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)("div",{hidden:l!==null,children:(0,Ue.jsx)(p.Component,{onBack:()=>o(null),onReview:M})}),f&&(0,Ue.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,Ue.jsx)(Vd,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Ue.jsx)(Ue.Fragment,{children:(0,Ue.jsxs)("div",{className:"quick-order-card",children:[(0,Ue.jsxs)("div",{className:"quick-order-hero",children:[(0,Ue.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Ue.jsx)("h1",{children:"Estimating Tools"}),(0,Ue.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Ue.jsxs)("div",{className:"quick-order-alt",children:[(0,Ue.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Ue.jsx)("div",{className:"estimator-tools-grid",children:Gd.map(z=>(0,Ue.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{v("calculator_selected",{calculator:z.id}),o(z.id),c(null)},children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Ue.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Pt(z.imageUrl),alt:""})}),(0,Ue.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__title",children:z.title}),(0,Ue.jsx)("span",{className:"estimator-tool-card__desc",children:z.desc})]})]},z.id))})]})]})})})})})}var vc=V(re());function Zd({config:e,children:t}){return Fb(e),(0,vc.jsx)(vc.Fragment,{children:t})}var Kd=V(re()),tx="https://api.metronlabs.ai",ax=["client","api-key","api-url","theme","hide-header","analytics"],rx=["all","events-only","none"];function Uw(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.44",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
|
|
6797
6804
|
:host > div { all: initial; display: block; }
|
|
6798
|
-
${
|
|
6805
|
+
${Jb}`,this.shadowRoot.replaceChildren(n,i),this.root=(0,Rw.createRoot)(i)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let i=this.getAttribute("client")??void 0,n=this.getAttribute("api-key")??void 0;(!i||!n)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||tx,client:i,apiKey:n,theme:nx(e,this.getAttribute("theme")),analytics:ix(this.getAttribute("analytics"))};this.root.render((0,Kd.jsx)(Zd,{config:o,children:(0,Kd.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=ax,a))}function ix(e){return rx.find(t=>t===e)??"all"}function nx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}Uw("metron-labs-quick-quote",tc);Uw("metron-labs-estimating-tools",bc);
|
|
6799
6806
|
/*! Bundled license information:
|
|
6800
6807
|
|
|
6801
6808
|
scheduler/cjs/scheduler.production.js:
|