| 1 |
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N={current:null},P={transition:null},te={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function ne(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,e.act=ne,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},e.unstable_act=ne,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&ee(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ee(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function ee(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.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`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ee(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);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.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),te=Symbol.for(`react.offscreen`),ne=Symbol.iterator;function F(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var I=Object.assign,re;function ie(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``}return` |
| 2 |
`+re+e}var ae=!1;function oe(e,t){if(!e||ae)return``;ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(` |
| 3 |
`),a=r.stack.split(` |
| 4 |
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=` |
| 5 |
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ae=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ie(e):``}function se(e){switch(e.tag){case 5:return ie(e.type);case 16:return ie(`Lazy`);case 13:return ie(`Suspense`);case 19:return ie(`SuspenseList`);case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return``}}function ce(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case ee:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}function le(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ce(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function L(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ue(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function de(e){var t=ue(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fe(e){e._valueTracker||=de(e)}function pe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ue(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function me(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function he(e,t){var n=t.checked;return I({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ge(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=L(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function _e(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function ve(e,t){_e(e,t);var n=L(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?be(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&be(e,t.type,L(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ye(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function be(e,t,n){(t!==`number`||me(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var xe=Array.isArray;function Se(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+L(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ce(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return I({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function we(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(xe(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:L(n)}}function Te(e,t){var n=L(t.value),r=L(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Ee(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function De(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Oe(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?De(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var ke,Ae=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(ke||=document.createElement(`div`),ke.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=ke.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function je(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Me={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ne=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Me).forEach(function(e){Ne.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Me[t]=Me[e]})});function Pe(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Me.hasOwnProperty(e)&&Me[e]?(``+t).trim():t+`px`}function Fe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Pe(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ie=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Le(e,t){if(t){if(Ie[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Re(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var ze=null;function Be(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,He=null,Ue=null;function We(e){if(e=Li(e)){if(typeof Ve!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=zi(t),Ve(e.stateNode,e.type,t))}}function Ge(e){He?Ue?Ue.push(e):Ue=[e]:He=e}function Ke(){if(He){var e=He,t=Ue;if(Ue=He=null,We(e),t)for(e=0;e<t.length;e++)We(t[e])}}function R(e,t){return e(t)}function qe(){}var Je=!1;function Ye(e,t,n){if(Je)return e(t,n);Je=!0;try{return R(e,t,n)}finally{Je=!1,(He!==null||Ue!==null)&&(qe(),Ke())}}function Xe(e,t){var n=e.stateNode;if(n===null)return null;var i=zi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Ze=!1;if(c)try{var Qe={};Object.defineProperty(Qe,"passive",{get:function(){Ze=!0}}),window.addEventListener(`test`,Qe,Qe),window.removeEventListener(`test`,Qe,Qe)}catch{Ze=!1}function $e(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var et=!1,tt=null,nt=!1,rt=null,it={onError:function(e){et=!0,tt=e}};function at(e,t,n,r,i,a,o,s,c){et=!1,tt=null,$e.apply(it,arguments)}function ot(e,t,n,i,a,o,s,c,l){if(at.apply(this,arguments),et){if(et){var u=tt;et=!1,tt=null}else throw Error(r(198));nt||(nt=!0,rt=u)}}function st(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ct(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 lt(e){if(st(e)!==e)throw Error(r(188))}function ut(e){var t=e.alternate;if(!t){if(t=st(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return lt(a),e;if(o===i)return lt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function dt(e){return e=ut(e),e===null?null:ft(e)}function ft(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ft(e);if(t!==null)return t;e=e.sibling}return null}var pt=n.unstable_scheduleCallback,mt=n.unstable_cancelCallback,ht=n.unstable_shouldYield,gt=n.unstable_requestPaint,z=n.unstable_now,_t=n.unstable_getCurrentPriorityLevel,vt=n.unstable_ImmediatePriority,yt=n.unstable_UserBlockingPriority,bt=n.unstable_NormalPriority,xt=n.unstable_LowPriority,St=n.unstable_IdlePriority,Ct=null,wt=null;function Tt(e){if(wt&&typeof wt.onCommitFiberRoot==`function`)try{wt.onCommitFiberRoot(Ct,e,void 0,(e.current.flags&128)==128)}catch{}}var Et=Math.clz32?Math.clz32:Ot,B=Math.log,Dt=Math.LN2;function Ot(e){return e>>>=0,e===0?32:31-(B(e)/Dt|0)|0}var kt=64,At=4194304;function jt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function V(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=jt(a))):r=jt(s)}else o=n&~i,o===0?a!==0&&(r=jt(a)):r=jt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Et(t),i=1<<n,r|=e[n],t&=~i;return r}function Mt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Mt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Pt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Ft(){var e=kt;return kt<<=1,!(kt&4194240)&&(kt=64),e}function It(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Et(t),e[t]=n}function Rt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Et(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function zt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var H=0;function Bt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Vt,Ht,Ut,Wt,Gt,Kt=!1,qt=[],Jt=null,Yt=null,Xt=null,Zt=new Map,Qt=new Map,$t=[],en=`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 submit`.split(` `);function tn(e,t){switch(e){case`focusin`:case`focusout`:Jt=null;break;case`dragenter`:case`dragleave`:Yt=null;break;case`mouseover`:case`mouseout`:Xt=null;break;case`pointerover`:case`pointerout`:Zt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Qt.delete(t.pointerId)}}function nn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Li(t),t!==null&&Ht(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rn(e,t,n,r,i){switch(t){case`focusin`:return Jt=nn(Jt,e,t,n,r,i),!0;case`dragenter`:return Yt=nn(Yt,e,t,n,r,i),!0;case`mouseover`:return Xt=nn(Xt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Zt.set(a,nn(Zt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Qt.set(a,nn(Qt.get(a)||null,e,t,n,r,i)),!0}return!1}function an(e){var t=Ii(e.target);if(t!==null){var n=st(t);if(n!==null){if(t=n.tag,t===13){if(t=ct(n),t!==null){e.blockedOn=t,Gt(e.priority,function(){Ut(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function on(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_n(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ze=r,n.target.dispatchEvent(r),ze=null}else return t=Li(n),t!==null&&Ht(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){on(e)&&n.delete(t)}function cn(){Kt=!1,Jt!==null&&on(Jt)&&(Jt=null),Yt!==null&&on(Yt)&&(Yt=null),Xt!==null&&on(Xt)&&(Xt=null),Zt.forEach(sn),Qt.forEach(sn)}function ln(e,t){e.blockedOn===t&&(e.blockedOn=null,Kt||(Kt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cn)))}function un(e){function t(t){return ln(t,e)}if(0<qt.length){ln(qt[0],e);for(var n=1;n<qt.length;n++){var r=qt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Jt!==null&&ln(Jt,e),Yt!==null&&ln(Yt,e),Xt!==null&&ln(Xt,e),Zt.forEach(t),Qt.forEach(t),n=0;n<$t.length;n++)r=$t[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$t.length&&(n=$t[0],n.blockedOn===null);)an(n),n.blockedOn===null&&$t.shift()}var dn=C.ReactCurrentBatchConfig,fn=!0;function pn(e,t,n,r){var i=H,a=dn.transition;dn.transition=null;try{H=1,hn(e,t,n,r)}finally{H=i,dn.transition=a}}function mn(e,t,n,r){var i=H,a=dn.transition;dn.transition=null;try{H=4,hn(e,t,n,r)}finally{H=i,dn.transition=a}}function hn(e,t,n,r){if(fn){var i=_n(e,t,n,r);if(i===null)ci(e,t,r,gn,n),tn(e,r);else if(rn(i,e,t,n,r))r.stopPropagation();else if(tn(e,r),t&4&&-1<en.indexOf(e)){for(;i!==null;){var a=Li(i);if(a!==null&&Vt(a),a=_n(e,t,n,r),a===null&&ci(e,t,r,gn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ci(e,t,r,null,n)}}var gn=null;function _n(e,t,n,r){if(gn=null,e=Be(r),e=Ii(e),e!==null)if(t=st(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ct(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gn=e,null}function vn(e){switch(e){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`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 1;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`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(_t()){case vt:return 1;case yt:return 4;case bt:case xt:return 16;case St:return 536870912;default:return 16}default:return 16}}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function U(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 W(){return!0}function Cn(){return!1}function wn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?W:Cn,this.isPropagationStopped=Cn,this}return I(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=W)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=W)},persist:function(){},isPersistent:W}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},En=wn(Tn),Dn=I({},Tn,{view:0,detail:0}),On=wn(Dn),kn,An,jn,Mn=I({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Un,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!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Nn=wn(Mn),Pn=wn(I({},Mn,{dataTransfer:0})),Fn=wn(I({},Dn,{relatedTarget:0})),In=wn(I({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0})),Ln=wn(I({},Tn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Rn=wn(I({},Tn,{data:0})),zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Bn={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`},Vn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vn[e])?!!t[e]:!1}function Un(){return Hn}var Wn=wn(I({},Dn,{key:function(e){if(e.key){var t=zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=U(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Bn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Un,charCode:function(e){return e.type===`keypress`?U(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?U(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Gn=wn(I({},Mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Kn=wn(I({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Un})),qn=wn(I({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jn=wn(I({},Mn,{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})),Yn=[9,13,27,32],Xn=c&&`CompositionEvent`in window,Zn=null;c&&`documentMode`in document&&(Zn=document.documentMode);var Qn=c&&`TextEvent`in window&&!Zn,$n=c&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=Sn(),xn=bn=yn=null,ir=!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 $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){Ge(r),t=ui(t,`onChange`),0<t.length&&(n=new En(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){ri(e,0)}function pr(e){if(pe(Ri(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(c){var gr;if(c){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,Be(e)),Ye(fr,t)}}function xr(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function Sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Cr(e,t){if(e===`click`)return pr(t)}function wr(e,t){if(e===`input`||e===`change`)return pr(t)}function Tr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Er=typeof Object.is==`function`?Object.is:Tr;function Dr(e,t){if(Er(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Er(e[i],t[i]))return!1}return!0}function Or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kr(e,t){var n=Or(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(){for(var e=window,t=me();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=me(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Nr(e){var t=jr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ar(n.ownerDocument.documentElement,n)){if(r!==null&&Mr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=kr(n,a);var o=kr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Pr=c&&`documentMode`in document&&11>=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==me(r)||(r=Fr,`selectionStart`in r&&Mr(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}),Lr&&Dr(Lr,r)||(Lr=r,r=ui(Ir,`onSelect`),0<r.length&&(t=new En(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Fr)))}function Br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:Br(`Animation`,`AnimationEnd`),animationiteration:Br(`Animation`,`AnimationIteration`),animationstart:Br(`Animation`,`AnimationStart`),transitionend:Br(`Transition`,`TransitionEnd`)},Hr={},Ur={};c&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionend`),Yr=new Map,Xr=`abort auxClick 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(` `);function Zr(e,t){Yr.set(e,t),o(t,[e])}for(var Qr=0;Qr<Xr.length;Qr++){var $r=Xr[Qr];Zr($r.toLowerCase(),`on`+($r[0].toUpperCase()+$r.slice(1)))}Zr(Gr,`onAnimationEnd`),Zr(Kr,`onAnimationIteration`),Zr(qr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Jr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ei=`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(` `),ti=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ei));function ni(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,ot(r,t,void 0,e),e.currentTarget=null}function ri(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ni(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ni(i,s,l),a=c}}}if(nt)throw e=rt,nt=!1,rt=null,e}function G(e,t){var n=t[Ni];n===void 0&&(n=t[Ni]=new Set);var r=e+`__bubble`;n.has(r)||(si(t,e,2,!1),n.add(r))}function ii(e,t,n){var r=0;t&&(r|=4),si(n,e,r,t)}var ai=`_reactListening`+Math.random().toString(36).slice(2);function oi(e){if(!e[ai]){e[ai]=!0,i.forEach(function(t){t!==`selectionchange`&&(ti.has(t)||ii(t,!1,e),ii(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ai]||(t[ai]=!0,ii(`selectionchange`,!1,t))}}function si(e,t,n,r){switch(vn(t)){case 1:var i=pn;break;case 4:i=mn;break;default:i=hn}n=i.bind(null,t,n,e),i=void 0,!Ze||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ci(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ii(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ye(function(){var r=a,i=Be(n),o=[];a:{var s=Yr.get(e);if(s!==void 0){var c=En,l=e;switch(e){case`keypress`:if(U(n)===0)break a;case`keydown`:case`keyup`:c=Wn;break;case`focusin`:l=`focus`,c=Fn;break;case`focusout`:l=`blur`,c=Fn;break;case`beforeblur`:case`afterblur`:c=Fn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Nn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Pn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Kn;break;case Gr:case Kr:case qr:c=In;break;case Jr:c=qn;break;case`scroll`:c=On;break;case`wheel`:c=Jn;break;case`copy`:case`cut`:case`paste`:c=Ln;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Gn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Xe(p,f),h!=null&&u.push(li(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==ze&&(l=n.relatedTarget||n.fromElement)&&(Ii(l)||l[Mi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ii(l):null,l!==null&&(d=st(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Nn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Gn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Ri(c),m=l==null?s:Ri(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ii(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=di(m))p++;for(m=0,h=f;h;h=di(h))m++;for(;0<p-m;)u=di(u),p--;for(;0<m-p;)f=di(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=di(u),f=di(f)}u=null}else u=null;c!==null&&fi(o,s,c,u,!1),l!==null&&d!==null&&fi(o,d,l,u,!0)}}a:{if(s=r?Ri(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=mr;else if(cr(s))if(hr)g=wr;else{g=Sr;var _=xr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Cr);if(g&&=g(e,r)){lr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&be(s,`number`,s.value)}switch(_=r?Ri(r):window,e){case`focusin`:(cr(_)||_.contentEditable===`true`)&&(Fr=_,Ir=r,Lr=null);break;case`focusout`:Lr=Ir=Fr=null;break;case`mousedown`:Rr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Rr=!1,zr(o,n,i);break;case`selectionchange`:if(Pr)break;case`keydown`:case`keyup`:zr(o,n,i)}var v;if(Xn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else ir?nr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&($n&&n.locale!==`ko`&&(ir||y!==`onCompositionStart`?y===`onCompositionEnd`&&ir&&(v=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,ir=!0)),_=ui(r,y),0<_.length&&(y=new Rn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=rr(n),v!==null&&(y.data=v)))),(v=Qn?ar(e,n):or(e,n))&&(r=ui(r,`onBeforeInput`),0<r.length&&(i=new Rn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ri(o,t)})}function li(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ui(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Xe(e,n),a!=null&&r.unshift(li(e,a,i)),a=Xe(e,t),a!=null&&r.push(li(e,a,i))),e=e.return}return r}function di(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Xe(n,a),c!=null&&o.unshift(li(n,c,s))):i||(c=Xe(n,a),c!=null&&o.push(li(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var pi=/\r\n?/g,mi=/\u0000|\uFFFD/g;function hi(e){return(typeof e==`string`?e:``+e).replace(pi,` |
| 6 |
`).replace(mi,``)}function gi(e,t,n){if(t=hi(t),hi(e)!==t&&n)throw Error(r(425))}function _i(){}var vi=null,yi=null;function bi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xi=typeof setTimeout==`function`?setTimeout:void 0,Si=typeof clearTimeout==`function`?clearTimeout:void 0,Ci=typeof Promise==`function`?Promise:void 0,wi=typeof queueMicrotask==`function`?queueMicrotask:Ci===void 0?xi:function(e){return Ci.resolve(null).then(e).catch(Ti)};function Ti(e){setTimeout(function(){throw e})}function Ei(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),un(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);un(t)}function Di(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===`$?`)break;if(t===`/$`)return null}}return e}function Oi(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var ki=Math.random().toString(36).slice(2),Ai=`__reactFiber$`+ki,ji=`__reactProps$`+ki,Mi=`__reactContainer$`+ki,Ni=`__reactEvents$`+ki,Pi=`__reactListeners$`+ki,Fi=`__reactHandles$`+ki;function Ii(e){var t=e[Ai];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mi]||n[Ai]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Oi(e);e!==null;){if(n=e[Ai])return n;e=Oi(e)}return t}e=n,n=e.parentNode}return null}function Li(e){return e=e[Ai]||e[Mi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ri(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function zi(e){return e[ji]||null}var Bi=[],Vi=-1;function Hi(e){return{current:e}}function K(e){0>Vi||(e.current=Bi[Vi],Bi[Vi]=null,Vi--)}function q(e,t){Vi++,Bi[Vi]=e.current,e.current=t}var Ui={},Wi=Hi(Ui),Gi=Hi(!1),Ki=Ui;function qi(e,t){var n=e.type.contextTypes;if(!n)return Ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ji(e){return e=e.childContextTypes,e!=null}function Yi(){K(Gi),K(Wi)}function Xi(e,t,n){if(Wi.current!==Ui)throw Error(r(168));q(Wi,t),q(Gi,n)}function Zi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,le(e)||`Unknown`,a));return I({},n,i)}function Qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ui,Ki=Wi.current,q(Wi,e),q(Gi,Gi.current),!0}function $i(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Zi(e,t,Ki),i.__reactInternalMemoizedMergedChildContext=e,K(Gi),K(Wi),q(Wi,e)):K(Gi),q(Gi,n)}var ea=null,ta=!1,na=!1;function ra(e){ea===null?ea=[e]:ea.push(e)}function ia(e){ta=!0,ra(e)}function aa(){if(!na&&ea!==null){na=!0;var e=0,t=H;try{var n=ea;for(H=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ea=null,ta=!1}catch(t){throw ea!==null&&(ea=ea.slice(e+1)),pt(vt,aa),t}finally{H=t,na=!1}}return null}var oa=[],sa=0,ca=null,la=0,ua=[],da=0,fa=null,pa=1,ma=``;function ha(e,t){oa[sa++]=la,oa[sa++]=ca,ca=e,la=t}function ga(e,t,n){ua[da++]=pa,ua[da++]=ma,ua[da++]=fa,fa=e;var r=pa;e=ma;var i=32-Et(r)-1;r&=~(1<<i),n+=1;var a=32-Et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,pa=1<<32-Et(t)+i|n<<i|r,ma=a+e}else pa=1<<a|n<<i|r,ma=e}function _a(e){e.return!==null&&(ha(e,1),ga(e,1,0))}function va(e){for(;e===ca;)ca=oa[--sa],oa[sa]=null,la=oa[--sa],oa[sa]=null;for(;e===fa;)fa=ua[--da],ua[da]=null,ma=ua[--da],ua[da]=null,pa=ua[--da],ua[da]=null}var ya=null,ba=null,J=!1,xa=null;function Sa(e,t){var n=Kl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ca(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ya=e,ba=Di(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ya=e,ba=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=fa===null?null:{id:pa,overflow:ma},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ya=e,ba=null,!0);default:return!1}}function wa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ta(e){if(J){var t=ba;if(t){var n=t;if(!Ca(e,t)){if(wa(e))throw Error(r(418));t=Di(n.nextSibling);var i=ya;t&&Ca(e,t)?Sa(i,n):(e.flags=e.flags&-4097|2,J=!1,ya=e)}}else{if(wa(e))throw Error(r(418));e.flags=e.flags&-4097|2,J=!1,ya=e}}}function Ea(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ya=e}function Da(e){if(e!==ya)return!1;if(!J)return Ea(e),J=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!bi(e.type,e.memoizedProps)),t&&=ba){if(wa(e))throw Oa(),Error(r(418));for(;t;)Sa(e,t),t=Di(t.nextSibling)}if(Ea(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){ba=Di(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}ba=null}}else ba=ya?Di(e.stateNode.nextSibling):null;return!0}function Oa(){for(var e=ba;e;)e=Di(e.nextSibling)}function ka(){ba=ya=null,J=!1}function Aa(e){xa===null?xa=[e]:xa.push(e)}var ja=C.ReactCurrentBatchConfig;function Ma(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Na(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Pa(e){var t=e._init;return t(e._payload)}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=Yl(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=$l(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===P&&Pa(i)===t.type)?(r=a(t,n.props),r.ref=Ma(e,t,n),r.return=e,r):(r=Xl(n.type,n.key,n.props,null,e.mode,r),r.ref=Ma(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=eu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Zl(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=$l(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=Xl(t.type,t.key,t.props,null,e.mode,n),n.ref=Ma(e,null,t),n.return=e,n;case T:return t=eu(t,e.mode,n),t.return=e,t;case P:var r=t._init;return f(e,r(t._payload),n)}if(xe(t)||F(t))return t=Zl(t,e.mode,n,null),t.return=e,t;Na(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case P:return i=n._init,p(e,t,i(n._payload),r)}if(xe(n)||F(n))return i===null?d(e,t,n,r,null):null;Na(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case P:var a=r._init;return m(e,t,n,a(r._payload),i)}if(xe(r)||F(r))return e=e.get(n)||null,d(t,e,r,i,null);Na(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),J&&ha(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return J&&ha(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),J&&ha(r,h),l}function g(a,s,c,l){var u=F(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),J&&ha(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return J&&ha(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),J&&ha(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===P&&Pa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ma(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Ma(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case P:return l=i._init,_(e,r,l(i._payload),o)}if(xe(i))return h(e,r,i,o);if(F(i))return g(e,r,i,o);Na(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ia=Fa(!0),La=Fa(!1),Ra=Hi(null),za=null,Ba=null,Va=null;function Ha(){Va=Ba=za=null}function Ua(e){var t=Ra.current;K(Ra),e._currentValue=t}function Wa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ga(e,t){za=e,Va=Ba=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ka(e){var t=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:t,next:null},Ba===null){if(za===null)throw Error(r(308));Ba=e,za.dependencies={lanes:0,firstContext:e}}else Ba=Ba.next=e;return t}var qa=null;function Ja(e){qa===null?qa=[e]:qa.push(e)}function Ya(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ja(t)):(n.next=i.next,i.next=n),t.interleaved=n,Xa(e,r)}function Xa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Za=!1;function Qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $a(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function eo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function to(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Xa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ja(r)):(t.next=i.next,i.next=t),r.interleaved=t,Xa(e,n)}function no(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}function ro(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function io(e,t,n,r){var i=e.updateQueue;Za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=I({},d,f);break a;case 2:Za=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function ao(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var oo={},so=Hi(oo),co=Hi(oo),lo=Hi(oo);function Y(e){if(e===oo)throw Error(r(174));return e}function uo(e,t){switch(q(lo,t),q(co,e),q(so,oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Oe(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Oe(t,e)}K(so),q(so,t)}function fo(){K(so),K(co),K(lo)}function po(e){Y(lo.current);var t=Y(so.current),n=Oe(t,e.type);t!==n&&(q(co,e),q(so,n))}function mo(e){co.current===e&&(K(so),K(co))}var X=Hi(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 go=[];function _o(){for(var e=0;e<go.length;e++)go[e]._workInProgressVersionPrimary=null;go.length=0}var vo=C.ReactCurrentDispatcher,yo=C.ReactCurrentBatchConfig,bo=0,Z=null,xo=null,So=null,Co=!1,wo=!1,To=0,Eo=0;function Do(){throw Error(r(321))}function Oo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Er(e[n],t[n]))return!1;return!0}function ko(e,t,n,i,a,o){if(bo=o,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vo.current=e===null||e.memoizedState===null?fs:ps,e=n(i,a),wo){o=0;do{if(wo=!1,To=0,25<=o)throw Error(r(301));o+=1,So=xo=null,t.updateQueue=null,vo.current=ms,e=n(i,a)}while(wo)}if(vo.current=ds,t=xo!==null&&xo.next!==null,bo=0,So=xo=Z=null,Co=!1,t)throw Error(r(300));return e}function Ao(){var e=To!==0;return To=0,e}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return So===null?Z.memoizedState=So=e:So=So.next=e,So}function Mo(){if(xo===null){var e=Z.alternate;e=e===null?null:e.memoizedState}else e=xo.next;var t=So===null?Z.memoizedState:So.next;if(t!==null)So=t,xo=e;else{if(e===null)throw Error(r(310));xo=e,e={memoizedState:xo.memoizedState,baseState:xo.baseState,baseQueue:xo.baseQueue,queue:xo.queue,next:null},So===null?Z.memoizedState=So=e:So=So.next=e}return So}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){var t=Mo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=xo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((bo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Z.lanes|=d,Jc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Er(i,t.memoizedState)||(Ms=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Z.lanes|=o,Jc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Er(o,t.memoizedState)||(Ms=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Io(){}function Lo(e,t){var n=Z,i=Mo(),a=t(),o=!Er(i.memoizedState,a);if(o&&(i.memoizedState=a,Ms=!0),i=i.queue,Yo(Bo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||So!==null&&So.memoizedState.tag&1){if(n.flags|=2048,Wo(9,zo.bind(null,n,i,a,t),void 0,null),Vc===null)throw Error(r(349));bo&30||Ro(n,t,a)}return a}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Z.updateQueue,t===null?(t={lastEffect:null,stores:null},Z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Er(e,n)}catch{return!0}}function Ho(e){var t=Xa(e,1);t!==null&&ml(t,e,1,-1)}function Uo(e){var t=jo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t.queue=e,e=e.dispatch=ss.bind(null,Z,e),[t.memoizedState,e]}function Wo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Z.updateQueue,t===null?(t={lastEffect:null,stores:null},Z.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Go(){return Mo().memoizedState}function Ko(e,t,n,r){var i=jo();Z.flags|=e,i.memoizedState=Wo(1|t,n,void 0,r===void 0?null:r)}function qo(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=void 0;if(xo!==null){var o=xo.memoizedState;if(a=o.destroy,r!==null&&Oo(r,o.deps)){i.memoizedState=Wo(t,n,a,r);return}}Z.flags|=e,i.memoizedState=Wo(1|t,n,a,r)}function Jo(e,t){return Ko(8390656,8,e,t)}function Yo(e,t){return qo(2048,8,e,t)}function Xo(e,t){return qo(4,2,e,t)}function Zo(e,t){return qo(4,4,e,t)}function Qo(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $o(e,t,n){return n=n==null?null:n.concat([e]),qo(4,4,Qo.bind(null,t,e),n)}function es(){}function ts(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Oo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ns(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Oo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rs(e,t,n){return bo&21?(Er(n,t)||(n=Ft(),Z.lanes|=n,Jc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ms=!0),e.memoizedState=n)}function is(e,t){var n=H;H=n!==0&&4>n?n:4,e(!0);var r=yo.transition;yo.transition={};try{e(!1),t()}finally{H=n,yo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ya(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o)){var c=t.interleaved;c===null?(i.next=i,Ja(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ya(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zt(e,n)}}var ds={readContext:Ka,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ka,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ka,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Z,a=jo();if(J){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));bo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(J){var n=ma,r=pa;n=(r&~(1<<32-Et(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Eo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ps={readContext:Ka,useCallback:ts,useContext:Ka,useEffect:Yo,useImperativeHandle:$o,useInsertionEffect:Xo,useLayoutEffect:Zo,useMemo:ns,useReducer:Po,useRef:Go,useState:function(){return Po(No)},useDebugValue:es,useDeferredValue:function(e){return rs(Mo(),xo.memoizedState,e)},useTransition:function(){return[Po(No)[0],Mo().memoizedState]},useMutableSource:Io,useSyncExternalStore:Lo,useId:as,unstable_isNewReconciler:!1},ms={readContext:Ka,useCallback:ts,useContext:Ka,useEffect:Yo,useImperativeHandle:$o,useInsertionEffect:Xo,useLayoutEffect:Zo,useMemo:ns,useReducer:Fo,useRef:Go,useState:function(){return Fo(No)},useDebugValue:es,useDeferredValue:function(e){var t=Mo();return xo===null?t.memoizedState=e:rs(t,xo.memoizedState,e)},useTransition:function(){return[Fo(No)[0],Mo().memoizedState]},useMutableSource:Io,useSyncExternalStore:Lo,useId:as,unstable_isNewReconciler:!1};function hs(e,t){if(e&&e.defaultProps){for(var n in t=I({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:I({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _s={isMounted:function(e){return(e=e._reactInternals)?st(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fl(),i=pl(e),a=eo(r,i);a.payload=t,n!=null&&(a.callback=n),t=to(e,a,i),t!==null&&(ml(t,e,i,r),no(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fl(),i=pl(e),a=eo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=to(e,a,i),t!==null&&(ml(t,e,i,r),no(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fl(),r=pl(e),i=eo(n,r);i.tag=2,t!=null&&(i.callback=t),t=to(e,i,r),t!==null&&(ml(t,e,r,n),no(t,e,r))}};function vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(i,a):!0}function ys(e,t,n){var r=!1,i=Ui,a=t.contextType;return typeof a==`object`&&a?a=Ka(a):(i=Ji(t)?Ki:Wi.current,r=t.contextTypes,a=(r=r!=null)?qi(e,i):Ui),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_s,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function bs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_s.enqueueReplaceState(t,t.state,null)}function xs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Qa(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ka(a):(a=Ji(t)?Ki:Wi.current,i.context=qi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(gs(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&_s.enqueueReplaceState(i,i.state,null),io(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ss(e,t){try{var n=``,r=t;do n+=se(r),r=r.return;while(r);var i=n}catch(e){i=` |
| 7 |
Error generating stack: `+e.message+` |
| 8 |
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Cs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ws(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ts=typeof WeakMap==`function`?WeakMap:Map;function Es(e,t,n){n=eo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nl||(nl=!0,rl=r),ws(e,t)},n}function Ds(e,t,n){n=eo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ws(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){ws(e,t),typeof r!=`function`&&(il===null?il=new Set([this]):il.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Os(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ts;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(n)||(i.add(n),e=zl.bind(null,e,t,n),t.then(e,e))}function ks(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function As(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=eo(-1,1),t.tag=2,to(n,t,1))),n.lanes|=1),e)}var js=C.ReactCurrentOwner,Ms=!1;function Ns(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function Ps(e,t,n,r,i){n=n.render;var a=t.ref;return Ga(t,i),r=ko(e,t,n,r,a,i),n=Ao(),e!==null&&!Ms?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ec(e,t,i)):(J&&n&&_a(t),t.flags|=1,Ns(e,t,r,i),t.child)}function Fs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Is(e,t,a,r,i)):(e=Xl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Dr:n,n(o,r)&&e.ref===t.ref)return ec(e,t,i)}return t.flags|=1,e=Yl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Is(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref)if(Ms=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ms=!0);else return t.lanes=e.lanes,ec(e,t,i)}return zs(e,t,n,r,i)}function Ls(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},q(Gc,Wc),Wc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,q(Gc,Wc),Wc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,q(Gc,Wc),Wc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),q(Gc,Wc),Wc|=r;return Ns(e,t,i,n),t.child}function Rs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zs(e,t,n,r,i){var a=Ji(n)?Ki:Wi.current;return a=qi(t,a),Ga(t,i),n=ko(e,t,n,r,a,i),r=Ao(),e!==null&&!Ms?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ec(e,t,i)):(J&&r&&_a(t),t.flags|=1,Ns(e,t,n,i),t.child)}function Bs(e,t,n,r,i){if(Ji(n)){var a=!0;Qi(t)}else a=!1;if(Ga(t,i),t.stateNode===null)$s(e,t),ys(t,n,r),xs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ka(l):(l=Ji(n)?Ki:Wi.current,l=qi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&bs(t,o,r,l),Za=!1;var f=t.memoizedState;o.state=f,io(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Gi.current||Za?(typeof u==`function`&&(gs(t,n,u,r),c=t.memoizedState),(s=Za||vs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,$a(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:hs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ka(c):(c=Ji(n)?Ki:Wi.current,c=qi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&bs(t,o,r,c),Za=!1,f=t.memoizedState,o.state=f,io(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Gi.current||Za?(typeof p==`function`&&(gs(t,n,p,r),m=t.memoizedState),(l=Za||vs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Vs(e,t,n,r,a,i)}function Vs(e,t,n,r,i,a){Rs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&$i(t,n,!1),ec(e,t,a);r=t.stateNode,js.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ia(t,e.child,null,a),t.child=Ia(t,null,s,a)):Ns(e,t,s,a),t.memoizedState=r.state,i&&$i(t,n,!0),t.child}function Hs(e){var t=e.stateNode;t.pendingContext?Xi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Xi(e,t.context,!1),uo(e,t.containerInfo)}function Us(e,t,n,r,i){return ka(),Aa(i),t.flags|=256,Ns(e,t,n,r),t.child}var Ws={dehydrated:null,treeContext:null,retryLane:0};function Gs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ks(e,t,n){var r=t.pendingProps,i=X.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),q(X,i&1),e===null)return Ta(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ql(o,r,0,null),e=Zl(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Gs(n),t.memoizedState=Ws,e):qs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Ys(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Yl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Zl(a,o,n,null),a.flags|=2):a=Yl(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Gs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ws,r}return a=e.child,e=a.sibling,r=Yl(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function qs(e,t){return t=Ql({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Js(e,t,n,r){return r!==null&&Aa(r),Ia(t,e.child,null,n),e=qs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ys(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Cs(Error(r(422))),Js(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=Ql({mode:`visible`,children:i.children},a,0,null),o=Zl(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ia(t,e.child,null,s),t.child.memoizedState=Gs(s),t.memoizedState=Ws,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Js(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Cs(o,i,void 0),Js(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ms||c){if(i=Vc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Xa(e,a),ml(i,e,a,-1))}return Ol(),i=Cs(Error(r(421))),Js(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Vl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,ba=Di(a.nextSibling),ya=t,J=!0,xa=null,e!==null&&(ua[da++]=pa,ua[da++]=ma,ua[da++]=fa,pa=e.id,ma=e.overflow,fa=t),t=qs(t,i.children),t.flags|=4096,t)}function Xs(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wa(e.return,t,n)}function Zs(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Qs(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ns(e,t,r.children,n),r=X.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xs(e,n,t);else if(e.tag===19)Xs(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(q(X,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Zs(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Zs(t,!0,n,null,a);break;case`together`:Zs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $s(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Yl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tc(e,t,n){switch(t.tag){case 3:Hs(t),ka();break;case 5:po(t);break;case 1:Ji(t.type)&&Qi(t);break;case 4:uo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;q(Ra,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(q(X,X.current&1),e=ec(e,t,n),e===null?null:e.sibling):Ks(e,t,n):(q(X,X.current&1),t.flags|=128,null);q(X,X.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Qs(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),q(X,X.current),r)break;return null;case 22:case 23:return t.lanes=0,Ls(e,t,n)}return ec(e,t,n)}var nc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},rc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Y(so.current);var o=null;switch(n){case`input`:i=he(e,i),r=he(e,r),o=[];break;case`select`:i=I({},i,{value:void 0}),r=I({},r,{value:void 0}),o=[];break;case`textarea`:i=Ce(e,i),r=Ce(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=_i)}Le(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&G(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},ic=function(e,t,n,r){n!==r&&(t.flags|=4)};function ac(e,t){if(!J)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function oc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function sc(e,t,n){var i=t.pendingProps;switch(va(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return oc(t),null;case 1:return Ji(t.type)&&Yi(),oc(t),null;case 3:return i=t.stateNode,fo(),K(Gi),K(Wi),_o(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Da(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xa!==null&&(vl(xa),xa=null))),oc(t),null;case 5:mo(t);var o=Y(lo.current);if(n=t.type,e!==null&&t.stateNode!=null)rc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return oc(t),null}if(e=Y(so.current),Da(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ai]=t,i[ji]=s,e=(t.mode&1)!=0,n){case`dialog`:G(`cancel`,i),G(`close`,i);break;case`iframe`:case`object`:case`embed`:G(`load`,i);break;case`video`:case`audio`:for(o=0;o<ei.length;o++)G(ei[o],i);break;case`source`:G(`error`,i);break;case`img`:case`image`:case`link`:G(`error`,i),G(`load`,i);break;case`details`:G(`toggle`,i);break;case`input`:ge(i,s),G(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},G(`invalid`,i);break;case`textarea`:we(i,s),G(`invalid`,i)}for(var c in Le(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&gi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&gi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&G(`scroll`,i)}switch(n){case`input`:fe(i),ye(i,s,!0);break;case`textarea`:fe(i),Ee(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=_i)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=De(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ai]=t,e[ji]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Re(n,i),n){case`dialog`:G(`cancel`,e),G(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:G(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ei.length;o++)G(ei[o],e);o=i;break;case`source`:G(`error`,e),o=i;break;case`img`:case`image`:case`link`:G(`error`,e),G(`load`,e),o=i;break;case`details`:G(`toggle`,e),o=i;break;case`input`:ge(e,i),o=he(e,i),G(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=I({},i,{value:void 0}),G(`invalid`,e);break;case`textarea`:we(e,i),o=Ce(e,i),G(`invalid`,e);break;default:o=i}for(s in Le(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Fe(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ae(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&je(e,u):typeof u==`number`&&je(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&G(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:fe(e),ye(e,i,!1);break;case`textarea`:fe(e),Ee(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+L(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Se(e,!!i.multiple,i.defaultValue,!0):Se(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=_i)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return oc(t),null;case 6:if(e&&t.stateNode!=null)ic(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=Y(lo.current),Y(so.current),Da(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ai]=t,(s=i.nodeValue!==n)&&(e=ya,e!==null))switch(e.tag){case 3:gi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&gi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ai]=t,t.stateNode=i}return oc(t),null;case 13:if(K(X),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(J&&ba!==null&&t.mode&1&&!(t.flags&128))Oa(),ka(),t.flags|=98560,s=!1;else if(s=Da(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ai]=t}else ka(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;oc(t),s=!1}else xa!==null&&(vl(xa),xa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||X.current&1?Kc===0&&(Kc=3):Ol())),t.updateQueue!==null&&(t.flags|=4),oc(t),null);case 4:return fo(),e===null&&oi(t.stateNode.containerInfo),oc(t),null;case 10:return Ua(t.type._context),oc(t),null;case 17:return Ji(t.type)&&Yi(),oc(t),null;case 19:if(K(X),s=t.memoizedState,s===null)return oc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)ac(s,!1);else{if(Kc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=ho(e),c!==null){for(t.flags|=128,ac(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(X,X.current&1|2),t.child}e=e.sibling}s.tail!==null&&z()>el&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=ho(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!J)return oc(t),null}else 2*z()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=z(),t.sibling=null,n=X.current,q(X,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(va(t),t.tag){case 1:return Ji(t.type)&&Yi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fo(),K(Gi),K(Wi),_o(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mo(t),null;case 13:if(K(X),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(X),null;case 4:return fo(),null;case 10:return Ua(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(vi=fn,e=jr(),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(yi={focusedElem:e,selectionRange:n},fn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ai],delete t[ji],delete t[Ni],delete t[Pi],delete t[Fi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_i));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount==`function`)try{wt.onCommitFiberUnmount(Ct,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?Ei(e.parentNode,n):e.nodeType===1&&Ei(e,n),un(e)):Ei(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:wc=c.stateNode,Tc=!1;break a;case 3:wc=c.stateNode.containerInfo,Tc=!0;break a;case 4:wc=c.stateNode.containerInfo,Tc=!0;break a}c=c.return}if(wc===null)throw Error(r(160));Dc(o,s,a),wc=null,Tc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Rl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ac(t,e),t=t.sibling}function Ac(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kc(t,e),jc(e),i&4){try{gc(3,e,e.return),_c(3,e)}catch(t){Rl(e,e.return,t)}try{gc(5,e,e.return)}catch(t){Rl(e,e.return,t)}}break;case 1:kc(t,e),jc(e),i&512&&n!==null&&fc(n,n.return);break;case 5:if(kc(t,e),jc(e),i&512&&n!==null&&fc(n,n.return),e.flags&32){var a=e.stateNode;try{je(a,``)}catch(t){Rl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&_e(a,o),Re(c,s);var u=Re(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Fe(a,f):d===`dangerouslySetInnerHTML`?Ae(a,f):d===`children`?je(a,f):S(a,d,f,u)}switch(c){case`input`:ve(a,o);break;case`textarea`:Te(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Se(a,!!o.multiple,o.multiple?[]:``,!1):Se(a,!!o.multiple,o.defaultValue,!0)):Se(a,!!o.multiple,m,!1)}a[ji]=o}catch(t){Rl(e,e.return,t)}}break;case 6:if(kc(t,e),jc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Rl(e,e.return,t)}}break;case 3:if(kc(t,e),jc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(t){Rl(e,e.return,t)}break;case 4:kc(t,e),jc(e);break;case 13:kc(t,e),jc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||($c=z())),i&4&&Oc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(uc=(u=uc)||d,kc(t,e),uc=u):kc(t,e),jc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Q=e,d=e.child;d!==null;){for(f=Q=d;Q!==null;){switch(p=Q,m=p.child,p.tag){case 0:case 11:case 14:case 15:gc(4,p,p.return);break;case 1:fc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Rl(i,n,e)}}break;case 5:fc(p,p.return);break;case 22:if(p.memoizedState!==null){Fc(f);continue}}m===null?Fc(f):(m.return=p,Q=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Pe(`display`,s))}catch(t){Rl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Rl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:kc(t,e),jc(e),i&4&&Oc(e);break;case 21:break;default:kc(t,e),jc(e)}}function jc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(bc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(je(a,``),i.flags&=-33),Cc(e,xc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Sc(e,xc(e),o);break;default:throw Error(r(161))}}catch(t){Rl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mc(e,t,n){Q=e,Nc(e,t,n)}function Nc(e,t,n){for(var r=(e.mode&1)!=0;Q!==null;){var i=Q,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||lc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||uc;s=lc;var l=uc;if(lc=o,(uc=c)&&!l)for(Q=i;Q!==null;)o=Q,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Ic(i):(c.return=o,Q=c);for(;a!==null;)Q=a,Nc(a,t,n),a=a.sibling;Q=i,lc=s,uc=l}Pc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Q=a):Pc(e,t,n)}}function Pc(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:uc||_c(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!uc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:hs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ao(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ao(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&un(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}uc||t.flags&512&&vc(t)}catch(e){Rl(t,t.return,e)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Fc(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Ic(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{_c(4,t)}catch(e){Rl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Rl(t,i,e)}}var a=t.return;try{vc(t)}catch(e){Rl(t,a,e)}break;case 5:var o=t.return;try{vc(t)}catch(e){Rl(t,o,e)}}}catch(e){Rl(t,t.return,e)}if(t===e){Q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Q=s;break}Q=t.return}}var Lc=Math.ceil,Rc=C.ReactCurrentDispatcher,zc=C.ReactCurrentOwner,Bc=C.ReactCurrentBatchConfig,$=0,Vc=null,Hc=null,Uc=0,Wc=0,Gc=Hi(0),Kc=0,qc=null,Jc=0,Yc=0,Xc=0,Zc=null,Qc=null,$c=0,el=1/0,tl=null,nl=!1,rl=null,il=null,al=!1,ol=null,sl=0,cl=0,ll=null,ul=-1,dl=0;function fl(){return $&6?z():ul===-1?ul=z():ul}function pl(e){return e.mode&1?$&2&&Uc!==0?Uc&-Uc:ja.transition===null?(e=H,e===0?(e=window.event,e=e===void 0?16:vn(e.type),e):e):(dl===0&&(dl=Ft()),dl):1}function ml(e,t,n,i){if(50<cl)throw cl=0,ll=null,Error(r(185));Lt(e,n,i),(!($&2)||e!==Vc)&&(e===Vc&&(!($&2)&&(Yc|=n),Kc===4&&bl(e,Uc)),hl(e,i),n===1&&$===0&&!(t.mode&1)&&(el=z()+500,ta&&aa()))}function hl(e,t){var n=e.callbackNode;Nt(e,t);var r=V(e,e===Vc?Uc:0);if(r===0)n!==null&&mt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mt(n),t===1)e.tag===0?ia(xl.bind(null,e)):ra(xl.bind(null,e)),wi(function(){!($&6)&&aa()}),n=null;else{switch(Bt(r)){case 1:n=vt;break;case 4:n=yt;break;case 16:n=bt;break;case 536870912:n=St;break;default:n=bt}n=Wl(n,gl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gl(e,t){if(ul=-1,dl=0,$&6)throw Error(r(327));var n=e.callbackNode;if(Il()&&e.callbackNode!==n)return null;var i=V(e,e===Vc?Uc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=kl(e,i);else{t=i;var a=$;$|=2;var o=Dl();(Vc!==e||Uc!==t)&&(tl=null,el=z()+500,Tl(e,t));do try{jl();break}catch(t){El(e,t)}while(1);Ha(),Rc.current=o,$=a,Hc===null?(Vc=null,Uc=0,t=Kc):t=0}if(t!==0){if(t===2&&(a=Pt(e),a!==0&&(i=a,t=_l(e,a))),t===1)throw n=qc,Tl(e,0),bl(e,i),hl(e,z()),n;if(t===6)bl(e,i);else{if(a=e.current.alternate,!(i&30)&&!yl(a)&&(t=kl(e,i),t===2&&(o=Pt(e),o!==0&&(i=o,t=_l(e,o))),t===1))throw n=qc,Tl(e,0),bl(e,i),hl(e,z()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Pl(e,Qc,tl);break;case 3:if(bl(e,i),(i&130023424)===i&&(t=$c+500-z(),10<t)){if(V(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){fl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=xi(Pl.bind(null,e,Qc,tl),t);break}Pl(e,Qc,tl);break;case 4:if(bl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Et(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=z()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10<i){e.timeoutHandle=xi(Pl.bind(null,e,Qc,tl),i);break}Pl(e,Qc,tl);break;case 5:Pl(e,Qc,tl);break;default:throw Error(r(329))}}}return hl(e,z()),e.callbackNode===n?gl.bind(null,e):null}function _l(e,t){var n=Zc;return e.current.memoizedState.isDehydrated&&(Tl(e,t).flags|=256),e=kl(e,t),e!==2&&(t=Qc,Qc=n,t!==null&&vl(t)),e}function vl(e){Qc===null?Qc=e:Qc.push.apply(Qc,e)}function yl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Er(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 bl(e,t){for(t&=~Xc,t&=~Yc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Et(t),r=1<<n;e[n]=-1,t&=~r}}function xl(e){if($&6)throw Error(r(327));Il();var t=V(e,0);if(!(t&1))return hl(e,z()),null;var n=kl(e,t);if(e.tag!==0&&n===2){var i=Pt(e);i!==0&&(t=i,n=_l(e,i))}if(n===1)throw n=qc,Tl(e,0),bl(e,t),hl(e,z()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pl(e,Qc,tl),hl(e,z()),null}function Sl(e,t){var n=$;$|=1;try{return e(t)}finally{$=n,$===0&&(el=z()+500,ta&&aa())}}function Cl(e){ol!==null&&ol.tag===0&&!($&6)&&Il();var t=$;$|=1;var n=Bc.transition,r=H;try{if(Bc.transition=null,H=1,e)return e()}finally{H=r,Bc.transition=n,$=t,!($&6)&&aa()}}function wl(){Wc=Gc.current,K(Gc)}function Tl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Si(n)),Hc!==null)for(n=Hc.return;n!==null;){var r=n;switch(va(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yi();break;case 3:fo(),K(Gi),K(Wi),_o();break;case 5:mo(r);break;case 4:fo();break;case 13:K(X);break;case 19:K(X);break;case 10:Ua(r.type._context);break;case 22:case 23:wl()}n=n.return}if(Vc=e,Hc=e=Yl(e.current,null),Uc=Wc=t,Kc=0,qc=null,Xc=Yc=Jc=0,Qc=Zc=null,qa!==null){for(t=0;t<qa.length;t++)if(n=qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}qa=null}return e}function El(e,t){do{var n=Hc;try{if(Ha(),vo.current=ds,Co){for(var i=Z.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Co=!1}if(bo=0,So=xo=Z=null,wo=!1,To=0,zc.current=null,n===null||n.return===null){Kc=1,qc=t,Hc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Uc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=ks(s);if(m!==null){m.flags&=-257,As(m,s,c,o,t),m.mode&1&&Os(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Os(o,u,t),Ol();break a}l=Error(r(426))}}else if(J&&c.mode&1){var _=ks(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),As(_,s,c,o,t),Aa(Ss(l,c));break a}}o=l=Ss(l,c),Kc!==4&&(Kc=2),Zc===null?Zc=[o]:Zc.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Es(o,l,t);ro(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(il===null||!il.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ds(o,c,t);ro(o,x);break a}}o=o.return}while(o!==null)}Nl(n)}catch(e){t=e,Hc===n&&n!==null&&(Hc=n=n.return);continue}break}while(1)}function Dl(){var e=Rc.current;return Rc.current=ds,e===null?ds:e}function Ol(){(Kc===0||Kc===3||Kc===2)&&(Kc=4),Vc===null||!(Jc&268435455)&&!(Yc&268435455)||bl(Vc,Uc)}function kl(e,t){var n=$;$|=2;var i=Dl();(Vc!==e||Uc!==t)&&(tl=null,Tl(e,t));do try{Al();break}catch(t){El(e,t)}while(1);if(Ha(),$=n,Rc.current=i,Hc!==null)throw Error(r(261));return Vc=null,Uc=0,Kc}function Al(){for(;Hc!==null;)Ml(Hc)}function jl(){for(;Hc!==null&&!ht();)Ml(Hc)}function Ml(e){var t=Ul(e.alternate,e,Wc);e.memoizedProps=e.pendingProps,t===null?Nl(e):Hc=t,zc.current=null}function Nl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=cc(n,t),n!==null){n.flags&=32767,Hc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Kc=6,Hc=null;return}}else if(n=sc(n,t,Wc),n!==null){Hc=n;return}if(t=t.sibling,t!==null){Hc=t;return}Hc=t=e}while(t!==null);Kc===0&&(Kc=5)}function Pl(e,t,n){var r=H,i=Bc.transition;try{Bc.transition=null,H=1,Fl(e,t,n,r)}finally{Bc.transition=i,H=r}return null}function Fl(e,t,n,i){do Il();while(ol!==null);if($&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Rt(e,o),e===Vc&&(Hc=Vc=null,Uc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||al||(al=!0,Wl(bt,function(){return Il(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Bc.transition,Bc.transition=null;var s=H;H=1;var c=$;$|=4,zc.current=null,hc(e,n),Ac(n,e),Nr(yi),fn=!!vi,yi=vi=null,e.current=n,Mc(n,e,a),gt(),$=c,H=s,Bc.transition=o}else e.current=n;if(al&&(al=!1,ol=e,sl=a),o=e.pendingLanes,o===0&&(il=null),Tt(n.stateNode,i),hl(e,z()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(nl)throw nl=!1,e=rl,rl=null,e;return sl&1&&e.tag!==0&&Il(),o=e.pendingLanes,o&1?e===ll?cl++:(cl=0,ll=e):cl=0,aa(),null}function Il(){if(ol!==null){var e=Bt(sl),t=Bc.transition,n=H;try{if(Bc.transition=null,H=16>e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Q=u;Q!==null;){var d=Q;switch(d.tag){case 0:case 11:case 15:gc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Q=f;else for(;Q!==null;){d=Q;var p=d.sibling,m=d.return;if(yc(d),d===u){Q=null;break}if(p!==null){p.return=m,Q=p;break}Q=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Q=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Q=s;else b:for(;Q!==null;){if(o=Q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:gc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Q=v;break b}Q=o.return}}var y=e.current;for(Q=y;Q!==null;){s=Q;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Q=b;else b:for(s=y;Q!==null;){if(c=Q,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:_c(9,c)}}catch(e){Rl(c,c.return,e)}if(c===s){Q=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Q=x;break b}Q=c.return}}if($=a,aa(),wt&&typeof wt.onPostCommitFiberRoot==`function`)try{wt.onPostCommitFiberRoot(Ct,e)}catch{}i=!0}return i}finally{H=n,Bc.transition=t}}return!1}function Ll(e,t,n){t=Ss(n,t),t=Es(e,t,1),e=to(e,t,1),t=fl(),e!==null&&(Lt(e,1,t),hl(e,t))}function Rl(e,t,n){if(e.tag===3)Ll(e,e,n);else for(;t!==null;){if(t.tag===3){Ll(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(il===null||!il.has(r))){e=Ss(n,e),e=Ds(t,e,1),t=to(t,e,1),e=fl(),t!==null&&(Lt(t,1,e),hl(t,e));break}}t=t.return}}function zl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=fl(),e.pingedLanes|=e.suspendedLanes&n,Vc===e&&(Uc&n)===n&&(Kc===4||Kc===3&&(Uc&130023424)===Uc&&500>z()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=At,At<<=1,!(At&130023424)&&(At=4194304)):t=1);var n=fl();e=Xa(e,t),e!==null&&(Lt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,J&&t.flags&1048576&&ga(t,la,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=qi(t,Wi.current);Ga(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ji(i)?(o=!0,Qi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qa(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,J&&o&&_a(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,$a(e,t),io(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ba=Di(t.stateNode.containerInfo.firstChild),ya=t,J=!0,xa=null,n=La(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return po(t),e===null&&Ta(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,bi(i,a)?s=null:o!==null&&bi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Ta(t),null;case 13:return Ks(e,t,n);case 4:return uo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ia(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,q(Ra,i._currentValue),i._currentValue=s,o!==null)if(Er(o.value,s)){if(o.children===a.children&&!Gi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=eo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Wa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ga(t,n),a=Ka(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Ji(i)?(e=!0,Qi(t)):e=!1,Ga(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return pt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=Kl(19,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case N:s=14;break a;case P:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=te,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=It(0),this.expirationTimes=It(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=It(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qa(a),e}function ru(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function iu(e){if(!e)return Ui;e=e._reactInternals;a:{if(st(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Ji(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Ji(n))return Zi(e,n,t)}return t}function au(e,t,n,r,i,a,o,s,c){return e=nu(n,r,!0,e,i,a,o,s,c),e.context=iu(null),n=e.current,r=fl(),i=pl(n),a=eo(r,i),a.callback=t??null,to(n,a,i),e.current.lanes=i,Lt(e,i,r),hl(e,r),e}function ou(e,t,n,r){var i=t.current,a=fl(),o=pl(i);return n=iu(n),t.context===null?t.context=n:t.pendingContext=n,t=eo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=to(i,t,o),e!==null&&(ml(e,i,o,a),no(e,i,o)),o}function su(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lu(e,t){cu(e,t),(e=e.alternate)&&cu(e,t)}function uu(){return null}var du=typeof reportError==`function`?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}pu.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));ou(e,t,null,null)},pu.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cl(function(){ou(null,e,null,null)}),t[Mi]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$t.length&&t!==0&&t<$t[n].priority;n++);$t.splice(n,0,e),n===0&&an(e)}};function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function gu(){}function _u(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=su(o);a.call(e)}}var o=au(t,r,e,0,null,!1,!1,``,gu);return e._reactRootContainer=o,e[Mi]=o.current,oi(e.nodeType===8?e.parentNode:e),Cl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=su(c);s.call(e)}}var c=nu(e,0,!1,null,null,!1,!1,``,gu);return e._reactRootContainer=c,e[Mi]=c.current,oi(e.nodeType===8?e.parentNode:e),Cl(function(){ou(t,c,n,r)}),c}function vu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=su(o);s.call(e)}}ou(t,o,e,i)}else o=_u(n,t,e,i,r);return su(o)}Vt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jt(t.pendingLanes);n!==0&&(zt(t,n|1),hl(t,z()),!($&6)&&(el=z()+500,aa()))}break;case 13:Cl(function(){var t=Xa(e,1);t!==null&&ml(t,e,1,fl())}),lu(e,1)}},Ht=function(e){if(e.tag===13){var t=Xa(e,134217728);t!==null&&ml(t,e,134217728,fl()),lu(e,134217728)}},Ut=function(e){if(e.tag===13){var t=pl(e),n=Xa(e,t);n!==null&&ml(n,e,t,fl()),lu(e,t)}},Wt=function(){return H},Gt=function(e,t){var n=H;try{return H=e,t()}finally{H=n}},Ve=function(e,t,n){switch(t){case`input`:if(ve(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=zi(i);if(!a)throw Error(r(90));pe(i),ve(i,a)}}}break;case`textarea`:Te(e,n);break;case`select`:t=n.value,t!=null&&Se(e,!!n.multiple,t,!1)}},R=Sl,qe=Cl;var yu={usingClientEntryPoint:!1,Events:[Li,Ri,zi,Ge,Ke,Sl]},bu={findFiberByHostInstance:Ii,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},xu={bundleType:bu.bundleType,version:bu.version,rendererPackageName:bu.rendererPackageName,rendererConfig:bu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dt(e),e===null?null:e.stateNode},findFiberByHostInstance:bu.findFiberByHostInstance||uu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{Ct=Su.inject(xu),wt=Su}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mu(t))throw Error(r(200));return ru(e,t,null,n)},e.createRoot=function(e,t){if(!mu(e))throw Error(r(299));var n=!1,i=``,a=du;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nu(e,1,!1,null,null,n,!1,i,a),e[Mi]=t.current,oi(e.nodeType===8?e.parentNode:e),new fu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=dt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Cl(e)},e.hydrate=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!mu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=du;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=au(t,null,e,1,n??null,a,!1,o,s),e[Mi]=t.current,oi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new pu(t)},e.render=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!hu(e))throw Error(r(40));return e._reactRootContainer?(Cl(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[Mi]=null})}),!0):!1},e.unstable_batchedUpdates=Sl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!hu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return vu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),v={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},y=c(u()),b=(0,y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,y.createElement)(`svg`,{ref:c,...v,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:_(`lucide`,i),...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),x=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(b,{ref:i,iconNode:t,className:_(`lucide-${g(e)}`,n),...r}));return n.displayName=`${e}`,n},S=x(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),C=x(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),w=x(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),T=x(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),E=x(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),D=x(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),O=x(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),k=x(`CalendarCheck`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m9 16 2 2 4-4`,key:`19s6y9`}]]),A=x(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),j=x(`ChartColumn`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),M=x(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ee=x(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),N=x(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),P=x(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),te=x(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ne=x(`ChevronsLeft`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),F=x(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),I=x(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),re=x(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ie=x(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),ae=x(`Cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),oe=x(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),se=x(`CornerDownLeft`,[[`polyline`,{points:`9 10 4 15 9 20`,key:`r3jprv`}],[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}]]),ce=x(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),le=x(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),L=x(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ue=x(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),de=x(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fe=x(`FileLock2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v1`,key:`jmtmu2`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`5`,x:`2`,y:`13`,rx:`1`,key:`10y5wo`}],[`path`,{d:`M8 13v-2a2 2 0 1 0-4 0v2`,key:`1pdxzg`}]]),pe=x(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),me=x(`FileX`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),he=x(`Filter`,[[`polygon`,{points:`22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3`,key:`1yg77f`}]]),ge=x(`Flame`,[[`path`,{d:`M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z`,key:`96xj49`}]]),_e=x(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ve=x(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ye=x(`GitCompare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),be=x(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),xe=x(`HardDrive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),Se=x(`HeartPulse`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}],[`path`,{d:`M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`1uw2ng`}]]),Ce=x(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),we=x(`ImagePlus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Te=x(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ee=x(`Import`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m8 11 4 4 4-4`,key:`1dohi6`}],[`path`,{d:`M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4`,key:`1ywtjm`}]]),De=x(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Oe=x(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),ke=x(`Layers`,[[`path`,{d:`m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z`,key:`8b97xw`}],[`path`,{d:`m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65`,key:`dd6zsq`}],[`path`,{d:`m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65`,key:`ep9fru`}]]),Ae=x(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),je=x(`LifeBuoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),Me=x(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Ne=x(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Pe=x(`Lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Fe=x(`Menu`,[[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}],[`line`,{x1:`4`,x2:`20`,y1:`6`,y2:`6`,key:`1owob3`}],[`line`,{x1:`4`,x2:`20`,y1:`18`,y2:`18`,key:`yk5zj1`}]]),Ie=x(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),Le=x(`Monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Re=x(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),ze=x(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Be=x(`PencilLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}],[`path`,{d:`m15 5 3 3`,key:`1w25hb`}]]),Ve=x(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),He=x(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Ue=x(`PlugZap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),We=x(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Ge=x(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ke=x(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),R=x(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),qe=x(`Replace`,[[`path`,{d:`M14 4a2 2 0 0 1 2-2`,key:`1w2hp7`}],[`path`,{d:`M16 10a2 2 0 0 1-2-2`,key:`shjach`}],[`path`,{d:`M20 2a2 2 0 0 1 2 2`,key:`188mtx`}],[`path`,{d:`M22 8a2 2 0 0 1-2 2`,key:`ddf4tu`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a3 3 0 0 1 3-3h1`,key:`3y3t5z`}],[`rect`,{x:`2`,y:`14`,width:`8`,height:`8`,rx:`2`,key:`4rksxw`}]]),Je=x(`Rocket`,[[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z`,key:`m3kijz`}],[`path`,{d:`m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z`,key:`1fmvmk`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0`,key:`1f8sc4`}],[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}]]),Ye=x(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Xe=x(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Ze=x(`Rss`,[[`path`,{d:`M4 11a9 9 0 0 1 9 9`,key:`pv89mb`}],[`path`,{d:`M4 4a16 16 0 0 1 16 16`,key:`k0647b`}],[`circle`,{cx:`5`,cy:`19`,r:`1`,key:`bfqh0e`}]]),Qe=x(`Scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),$e=x(`ScrollText`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),et=x(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),tt=x(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),nt=x(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),rt=x(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),it=x(`Shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),at=x(`SlidersHorizontal`,[[`line`,{x1:`21`,x2:`14`,y1:`4`,y2:`4`,key:`obuewd`}],[`line`,{x1:`10`,x2:`3`,y1:`4`,y2:`4`,key:`1q6298`}],[`line`,{x1:`21`,x2:`12`,y1:`12`,y2:`12`,key:`1iu8h1`}],[`line`,{x1:`8`,x2:`3`,y1:`12`,y2:`12`,key:`ntss68`}],[`line`,{x1:`21`,x2:`16`,y1:`20`,y2:`20`,key:`14d8ph`}],[`line`,{x1:`12`,x2:`3`,y1:`20`,y2:`20`,key:`m0wm8r`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`6`,key:`14e1ph`}],[`line`,{x1:`8`,x2:`8`,y1:`10`,y2:`14`,key:`1i6ji0`}],[`line`,{x1:`16`,x2:`16`,y1:`18`,y2:`22`,key:`1lctlv`}]]),ot=x(`SlidersVertical`,[[`line`,{x1:`4`,x2:`4`,y1:`21`,y2:`14`,key:`1p332r`}],[`line`,{x1:`4`,x2:`4`,y1:`10`,y2:`3`,key:`gb41h5`}],[`line`,{x1:`12`,x2:`12`,y1:`21`,y2:`12`,key:`hf2csr`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`3`,key:`1kfi7u`}],[`line`,{x1:`20`,x2:`20`,y1:`21`,y2:`16`,key:`1lhrwl`}],[`line`,{x1:`20`,x2:`20`,y1:`12`,y2:`3`,key:`16vvfq`}],[`line`,{x1:`2`,x2:`6`,y1:`14`,y2:`14`,key:`1uebub`}],[`line`,{x1:`10`,x2:`14`,y1:`8`,y2:`8`,key:`1yglbp`}],[`line`,{x1:`18`,x2:`22`,y1:`16`,y2:`16`,key:`1jxqpz`}]]),st=x(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),ct=x(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),lt=x(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ut=x(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),dt=x(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ft=x(`Tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),pt=x(`Timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),mt=x(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ht=x(`TrendingUp`,[[`polyline`,{points:`22 7 13.5 15.5 8.5 10.5 2 17`,key:`126l90`}],[`polyline`,{points:`16 7 22 7 22 13`,key:`kwv8wd`}]]),gt=x(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),z=x(`Type`,[[`polyline`,{points:`4 7 4 4 20 4 20 7`,key:`1nosan`}],[`line`,{x1:`9`,x2:`15`,y1:`20`,y2:`20`,key:`swin9y`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),_t=x(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),vt=x(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),yt=x(`Webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),bt=x(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),xt=x(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),St=x(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Ct=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),wt=o(((e,t)=>{t.exports=Ct()})),Tt=c(m(),1),Et=h(),B=wt(),Dt={Activity:S,BarChart3:j,CalendarClock:A,Clock:ie,Cloud:ae,Database:ce,Eye:de,FileX:me,Filter:he,Gauge:_e,Globe:be,HardDrive:xe,HeartPulse:Se,Image:Te,Import:Ee,KeyRound:Oe,Layers:ke,LayoutDashboard:Ae,LifeBuoy:je,Lightbulb:Me,Network:ze,Replace:qe,Rss:Ze,Scissors:Qe,Search:et,Server:tt,Settings:nt,Shield:rt,Shrink:it,Sliders:ot,Sparkles:ct,Square:lt,Tag:ft,Trash2:mt,TrendingUp:ht,Type:z,Wand2:vt,Webhook:yt,Wrench:bt,Zap:St};function Ot({name:e,size:t=15,className:n}){return(0,B.jsx)(Dt[e]??lt,{size:t,className:n})}function kt({label:e,hint:t,children:n,disabled:r=!1}){let[i,a]=(0,y.useState)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(null),c=(0,y.useRef)(null);if((0,y.useEffect)(()=>()=>{s.current&&window.clearTimeout(s.current),c.current&&window.clearTimeout(c.current)},[]),r)return n;let l=e=>{o.current=e;let t=n.ref;typeof t==`function`?t(e):t&&typeof t==`object`&&(t.current=e)},u=()=>{if(!o.current)return;let e=o.current.getBoundingClientRect();a({top:e.top+e.height/2,left:e.right+8})},d=()=>{c.current&&=(window.clearTimeout(c.current),null),!s.current&&(s.current=window.setTimeout(()=>{u(),s.current=null},200))},f=()=>{s.current&&=(window.clearTimeout(s.current),null),c.current=window.setTimeout(()=>{a(null),c.current=null},60)},p=n.props;return(0,B.jsxs)(B.Fragment,{children:[(0,y.cloneElement)(n,{ref:l,onMouseEnter:e=>{d(),p.onMouseEnter?.(e)},onMouseLeave:e=>{f(),p.onMouseLeave?.(e)},onFocus:e=>{d(),p.onFocus?.(e)},onBlur:e=>{f(),p.onBlur?.(e)},title:void 0}),i&&typeof document<`u`&&(0,Tt.createPortal)((0,B.jsxs)(`div`,{role:`tooltip`,style:{position:`fixed`,top:i.top,left:i.left,transform:`translateY(-50%)`,zIndex:60,pointerEvents:`none`},className:`whitespace-nowrap rounded-md bg-neutral-900 dark:bg-neutral-800 text-white text-[11px] px-2 py-1 shadow-md border border-neutral-800 dark:border-neutral-700`,children:[(0,B.jsx)(`span`,{className:`block`,children:e}),t&&(0,B.jsx)(`span`,{className:`block text-[10px] text-neutral-400 mt-0.5`,children:t})]}),document.getElementById(`xspeed-app`)??document.body)]})}var At=`xspeed`;function jt(){return typeof window>`u`?null:window.wp?.i18n??null}function V(e,t=At){let n=jt();return n?n.__(e,t):e}function Mt(e,t,n,r=At){let i=jt();return i?i._n(e,t,n,r):n===1?e:t}function Nt(e,...t){let n=jt();if(n)return n.sprintf(e,...t);let r=0;return e.replace(/%[sd]/g,()=>String(t[r++]??``))}var Pt=[{slug:`pagespeed`,label:`PageSpeed`,icon:`Gauge`,description:`Run Google PageSpeed Insights audits without leaving the dashboard. Scores + CWV cached 24h.`,teaser:`pagespeed`,embedded:!0},{slug:`recommendations`,label:`Recommendations`,icon:`Lightbulb`,description:`Rule-based engine surfaces the 5 things most likely to improve your score.`,teaser:`recommendations`,embedded:!0},{slug:`rum`,label:`Real-User Monitoring`,icon:`Eye`,description:`Sample LCP / FCP / CLS / INP / TTFB from real visitors. Per-URL percentile charts.`,teaser:`rum`,embedded:!0},{slug:`images`,label:`Image Optimization`,icon:`Replace`,description:`Convert new JPEG/PNG uploads to WebP and AVIF; serve modern formats to supporting browsers.`,teaser:`webp-avif`,embedded:!0},{slug:`cloudflare-apo`,label:`Cloudflare APO`,icon:`Zap`,description:`Toggle Automatic Platform Optimization, edge cache level, and TTL. No separate dashboard.`,teaser:`cloudflare-apo`,embedded:!0},{slug:`feed-cache`,label:`Feed Caching`,icon:`Rss`,description:`Cache RSS / Atom / comment feeds so polling aggregators skip a full render. Correct feed content-type preserved; purges on new posts.`,teaser:`feed-cache`,embedded:!0},{slug:`cache-404`,label:`404 Caching`,icon:`FileX`,description:`Serve one cached 404 so bot / scanner floods on unknown URLs don't each cost a render. Short-lived, shared entry, purged on publish.`,teaser:`cache-404`,embedded:!0},{slug:`search-cache`,label:`Search Caching`,icon:`Search`,description:`Cache internal search-results pages (/?s=…) so popular repeated searches skip a full query + render. Keyed per term, short-lived, purged on publish.`,teaser:`search-cache`,embedded:!0},{slug:`rest-cache`,label:`REST API Cache`,icon:`Webhook`,description:`Cache read-only REST responses with a TTL you set per route — built for headless sites and app backends. Auth'd and write requests never cache.`,teaser:`rest-cache`,embedded:!0},{slug:`maintenance-cache`,label:`Maintenance`,icon:`Wrench`,description:`Skip caching while the site is in maintenance / coming-soon mode, and auto-purge when it goes live again.`,teaser:null,embedded:!0},{slug:`prewarm-schedule`,label:`On a Schedule`,icon:`CalendarClock`,description:`Warm target URLs ahead of posts, sales, and campaigns so the spike hits a warm cache. One-off, recurring, and auto-warm on scheduled-post publish.`,teaser:`prewarm-schedule`,embedded:!0},{slug:`predictive-warm`,label:`Auto (AI)`,icon:`TrendingUp`,description:`Proactively warm the hottest URLs — ranked by real traffic, recency, and content — so popular and about-to-be-popular pages always serve from cache.`,teaser:`predictive-warm`,embedded:!0},{slug:`brotli-compression`,label:`Brotli`,icon:`Shrink`,description:`Serve Brotli where supported — smaller than GZIP — with automatic GZIP fallback.`,teaser:`brotli`,embedded:!0},{slug:`custom-rules`,label:`Custom Cache Rules`,icon:`Filter`,description:`Bypass cache or override expiry by URL glob, post type, category, tag, or author.`,teaser:`custom-rules`,embedded:!0},{slug:`analytics`,label:`Analytics`,icon:`BarChart3`,description:`Hit-ratio trends, slowest URLs from RUM samples, recent activity timeline.`,teaser:`analytics`,embedded:!0},{slug:`critical-css`,label:`Critical CSS`,icon:`Sparkles`,description:`Inline above-the-fold styles, defer the rest. Pluggable generator endpoint.`,teaser:`critical-css`,embedded:!0},{slug:`unused-css`,label:`Unused CSS`,icon:`Scissors`,description:`Per-URL pruned stylesheet inlined; original <link> tags stripped.`,teaser:`unused-css`,embedded:!0},{slug:`license`,label:`License`,icon:`KeyRound`,description:`Activate xSpeed Pro and manage automatic updates.`,teaser:null},{slug:`white-label`,label:`Branding`,icon:`Tag`,description:`Rebrand the dashboard chrome — name, footer credit, hide help links.`,teaser:`white-label`},{slug:`multisite`,label:`Multisite`,icon:`Network`,description:`One dashboard across every site in a WP Multisite network with network-wide purge.`,teaser:`multisite`},{slug:`ai-provider`,label:`AI Provider`,icon:`Sparkles`,description:`Connect OpenAI, Anthropic, Gemini, or OpenRouter once — every Pro AI feature shares the connection.`,teaser:null},{slug:`smart-predict`,label:`Speculation Rules`,icon:`Wand2`,description:`Predict each visitor's next page and prefetch it via Chrome's Speculation Rules API.`,teaser:null,embedded:!0},{slug:`performance-health`,label:`Performance Health`,icon:`HeartPulse`,description:`Core Web Vitals health monitor with AI anomaly detection and a 7-day regression baseline.`,teaser:null,embedded:!0},{slug:`smart-image`,label:`AI Suggestions`,icon:`Sparkles`,description:`AI-recommended format + quality settings, applied into Image Optimization in one click.`,teaser:null,embedded:!0},{slug:`adaptive-cache`,label:`Adaptive Cache`,icon:`Lightbulb`,description:`AI-tuned cache TTL based on 24-hour traffic patterns, applied into the Cache module in one click.`,teaser:null}],Ft=new Set(Pt.filter(e=>e.embedded).map(e=>e.slug)),It=[{id:`cache`,label:V(`Cache`),icon:`Zap`,description:V(`Page, object and browser caching, plus preload.`),slugs:[`cache`,`preloader`,`browser-cache`,`object-cache`,`cache-coverage`,`adaptive-cache`]},{id:`performance`,label:V(`Optimization`),icon:`Gauge`,description:V(`Minify, compress, lazy-load, fonts and hints.`),slugs:[`minify`,`gzip`,`lazy`,`resource-hints`,`fonts`,`bloat`,`heartbeat`]},{id:`network`,label:V(`Network`),icon:`Network`,description:V(`CDN and Cloudflare edge delivery.`),slugs:[`cdn`,`cloudflare`]},{id:`insights`,label:V(`Health & insights`),icon:`HeartPulse`,description:V(`Speed score, diagnostics and analytics.`),slugs:[`health`,`score`]},{id:`tools`,label:V(`Tools`),icon:`Sliders`,description:V(`Database cleanup, migration and logs.`),slugs:[`database`,`migration`,`logs`]},{id:`ai-agents`,label:V(`AI & agents`),icon:`Sparkles`,description:V(`Hub, MCP access, AI provider and privacy.`),slugs:[`ai-provider`,`mcp`,`ai-privacy`]},{id:`settings`,label:V(`Settings`),icon:`Settings`,description:V(`License, branding, multisite and support.`),slugs:[`license`,`white-label`,`multisite`,`support`]}],Lt=It.map(e=>e.id);function Rt(e){return It.find(t=>t.id===e)}function zt(e){return It.find(t=>t.slugs.includes(e))?.id}function H(e,t=!0){let n=new Map(e.map(e=>[e.slug,e])),r=new Set,i=[];for(let e of It){let t=[];for(let i of e.slugs){let e=n.get(i);e&&(t.push(e),r.add(i))}t.length>0&&i.push({id:e.id,label:e.label,icon:e.icon,modules:t,leaf:e.leaf})}let a=e.filter(e=>!r.has(e.slug)&&!Ft.has(e.slug));return a.length>0&&i.push({id:`other`,label:`Other`,icon:`Square`,modules:a}),i}var Bt=`overview`,Vt={},Ht=`xspeed:panels-changed`,Ut=`xspeed:tier-changed`,Wt=`xspeed:branding-changed`;function Gt(e){return Vt[e]}function Kt(){typeof window>`u`||window.XSpeedPro||(window.XSpeedPro={panels:Vt,registerPanel(e,t){Vt[e]=t,window.dispatchEvent(new CustomEvent(Ht,{detail:{slug:e}}))},setTier(e){let t=window.XSpeedConfig;t&&(t.tier=e),window.dispatchEvent(new CustomEvent(Ut,{detail:{tier:e}}))},setBranding(e){let t=window.XSpeedConfig;t&&(t.branding=e),window.dispatchEvent(new CustomEvent(Wt,{detail:{branding:e}}))}})}function qt(){let[e,t]=(0,y.useState)(0);return(0,y.useEffect)(()=>{let e=()=>t(e=>e+1);return window.addEventListener(Ht,e),()=>window.removeEventListener(Ht,e)},[]),e}var Jt={name:`xSpeed Cache`,footer_credit:null,hide_help_links:!1,logo_svg:null};function Yt(){let e=window.XSpeedConfig?.branding;return e?{...Jt,...e}:Jt}function Xt(){let[e,t]=(0,y.useState)(Yt);return(0,y.useEffect)(()=>{let e=()=>t(Yt());return window.addEventListener(Wt,e),()=>window.removeEventListener(Wt,e)},[]),e}function Zt(){return typeof window>`u`?`free`:window.XSpeedConfig?.tier??`free`}function Qt(){if(typeof window>`u`)return`not_installed`;let e=window.XSpeedConfig;return e?.proState?e.proState:en()?`active`:`not_installed`}function $t(){let[e,t]=(0,y.useState)(Zt);return(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(Zt());return window.addEventListener(Ut,e),()=>window.removeEventListener(Ut,e)},[]),e}function en(){let e=Zt();return e===`pro`||e===`trial`}function tn(){let[e,t]=(0,y.useState)(Qt);return(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(Qt());return window.addEventListener(Ut,e),()=>window.removeEventListener(Ut,e)},[]),e}var nn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-12.5%20-6.2%2084.8%2084.8'%20fill='currentColor'%3e%3cpath%20d='M48.5785%2036.0175C49.1085%2036.0095%2049.5752%2036.0326%2050.0151%2036.0942C54.5584%2036.7301%2058.2798%2040.0242%2059.4625%2044.4568C59.8495%2045.9073%2059.8483%2047.7319%2059.8483%2051.3252C59.8483%2054.5498%2059.8493%2056.1876%2059.5156%2057.5401C58.4986%2061.6597%2055.2818%2064.8767%2051.1621%2065.8935C49.8096%2066.2274%2048.172%2066.2263%2044.9472%2066.2263H27.605L22.8577%2071.3378C21.8413%2072.432%2020.213%2072.6993%2018.9001%2071.9875C17.5872%2071.2756%2016.9228%2069.765%2017.2853%2068.3162L17.8083%2066.2257C14.8099%2066.2255%2012.5338%2066.2195%2010.7131%2066.0664C8.85549%2065.9102%207.46018%2065.6005%206.24471%2064.9812C4.09536%2063.8861%202.34772%2062.1383%201.25248%2059.989C0.62595%2058.7594%200.316091%2057.3455%200.16153%2055.4551C0.00710842%2053.5663%200.00702338%2051.1895%200.00690304%2048.0317L0.00662692%2040.2236H7.48311L26.4898%2040.3834C27.4111%2040.3913%2028.0706%2041.2763%2027.8149%2042.1614L20.2426%2068.3463C20.0955%2068.8549%2020.7483%2069.2025%2021.088%2068.7964L48.4749%2036.0666L48.5152%2036.0183L48.5785%2036.0175Z'/%3e%3cpath%20d='M40.3093%201.07568C41.635%20-0.187017%2043.6612%20-0.357074%2045.1792%200.666468C46.697%201.6902%2047.2986%203.63244%2046.6249%205.33481L46.2831%206.19741C49.6878%206.2672%2051.8385%206.51454%2053.6049%207.41454C55.7543%208.50975%2057.502%2010.2577%2058.5972%2012.4071C59.2237%2013.6367%2059.5337%2015.0508%2059.6881%2016.9412C59.8424%2018.8301%2059.8422%2021.207%2059.8422%2024.3649V32.521H51.6809L33.5137%2032.4287C32.5191%2032.4236%2031.8506%2031.4069%2032.2405%2030.4918L43.3822%204.34465C43.5955%203.84378%2042.9544%203.42105%2042.5781%203.8145L10.4605%2037.4094L10.0645%2037.4315L10.0607%2037.4317H10.0568C4.50287%2037.4325%202.60655e-05%2032.9302%206.13307e-08%2027.3763V21.8001C2.87832e-08%2017.8963%20-0.00154013%2015.9137%200.48597%2014.2963C1.59122%2010.6297%204.46019%207.76069%208.12674%206.65549C9.74417%206.16799%2011.7267%206.16952%2015.6306%206.16952H34.9617L40.3093%201.07568Z'/%3e%3c/svg%3e`;function rn({className:e=`w-6 h-6 rounded shrink-0`,onDark:t=!1}){let n=Xt(),r=n.logo_svg?.trim(),i=n.name||`xSpeed Cache`,[a,o]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{o(!1)},[r]),r&&!a?r.startsWith(`<svg`)?(0,B.jsx)(`span`,{className:`inline-flex items-center justify-center ${e}`,role:`img`,"aria-label":i,dangerouslySetInnerHTML:{__html:r}}):(0,B.jsx)(`img`,{src:r,alt:i,className:e,onError:()=>o(!0)}):(0,B.jsx)(`img`,{src:nn,alt:i,className:`${e} ${t?`invert`:`dark:invert`}`})}var an=`(min-width: 768px)`;function on({activeGroup:e,onNavigate:t,onUpgrade:n,onManageLicense:r,modules:i=[],collapsed:a=!1,onToggleCollapse:o,mobileOpen:s=!1,onCloseMobile:c}){let l=Xt(),u=tn(),[d,f]=(0,y.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!0:window.matchMedia(an).matches);(0,y.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(an),t=()=>f(e.matches);return t(),typeof e.addEventListener==`function`?(e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)):(e.addListener?.(t),()=>e.removeListener?.(t))},[]),(0,y.useEffect)(()=>{if(!s||!c)return;let e=e=>{e.key===`Escape`&&c()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s,c]);let p=e=>e.reduce((e,t)=>e+ +(i.find(e=>e.slug===t)?.active===!0),0),m=e=>e.reduce((e,t)=>e+ +(typeof i.find(e=>e.slug===t)?.active==`boolean`),0),h=`group flex items-center gap-3 w-full min-h-9 overflow-hidden whitespace-nowrap rounded-control px-3 py-2 text-[13.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40`,g=(e,t)=>(0,B.jsx)(kt,{label:e,disabled:!a,children:t}),_=`flex items-center gap-2.5 w-full min-h-9 overflow-hidden whitespace-nowrap rounded-control px-3 py-2 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40`,v=e=>{t(e),c?.()},b=e=>()=>{e(),c?.()};return(0,B.jsxs)(B.Fragment,{children:[s&&(0,B.jsx)(`button`,{type:`button`,"aria-label":V(`Close navigation`),onClick:c,className:`md:hidden fixed inset-x-0 bottom-0 top-[var(--wp-admin--admin-bar--height,46px)] z-40 bg-black/50`}),(0,B.jsxs)(`aside`,{...!d&&!s?{inert:``}:{},className:`group/rail relative shrink-0 flex flex-col text-rail-text transition-[width] duration-200 |
| 9 |
max-md:fixed max-md:top-[var(--wp-admin--admin-bar--height,46px)] max-md:bottom-0 max-md:left-0 max-md:z-50 max-md:w-60 max-md:transition-transform |
| 10 |
${s?`max-md:translate-x-0`:`max-md:-translate-x-full`} |
| 11 |
${a?`md:w-16`:`md:w-60`}`,style:{background:`linear-gradient(180deg, var(--rail-top), var(--rail-bottom))`},children:[(0,B.jsxs)(`div`,{className:`h-14 shrink-0 flex items-center gap-2.5 overflow-hidden whitespace-nowrap px-4 border-b`,style:{borderColor:`var(--rail-edge)`},children:[(0,B.jsx)(rn,{className:`w-6 h-6 rounded shrink-0`,onDark:!0}),(0,B.jsx)(`span`,{className:`font-display font-semibold text-[15px] text-white truncate transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`}`,children:l.name}),c&&(0,B.jsx)(`button`,{type:`button`,onClick:c,"aria-label":V(`Close navigation`),className:`md:hidden ml-auto shrink-0 inline-flex items-center justify-center w-8 h-8 rounded-control text-rail-text hover:text-white hover:bg-white/[.06] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40`,children:(0,B.jsx)(xt,{size:16,"aria-hidden":`true`})})]}),o&&(0,B.jsx)(`button`,{type:`button`,onClick:o,"aria-label":V(a?`Expand sidebar`:`Collapse sidebar`),"aria-expanded":!a,title:V(a?`Expand sidebar`:`Collapse sidebar`),className:`hidden md:flex absolute top-1/2 -right-3 z-10 -translate-y-1/2 w-6 h-6 items-center justify-center rounded-full border border-line bg-paper text-ink-soft !shadow-md opacity-0 pointer-events-none transition-opacity duration-150 hover:text-ink group-hover/rail:opacity-100 group-hover/rail:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:(0,B.jsx)(ne,{size:14,"aria-hidden":`true`,className:`transition-transform duration-200 ${a?`rotate-180`:``}`})}),(0,B.jsxs)(`nav`,{"aria-label":V(`Primary`),className:`flex-1 overflow-y-auto p-3 space-y-1`,children:[g(V(`Overview`),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>v(Bt),"aria-current":e===`overview`?`page`:void 0,className:e===`overview`?`${h} bg-primary text-on-primary shadow-primary-glow`:`${h} text-rail-text hover:text-white hover:bg-white/[.06]`,children:[(0,B.jsx)(Ae,{size:16,className:`shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`flex-1 text-left truncate transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`}`,children:V(`Overview`)})]})),(0,B.jsx)(`div`,{className:`pt-2`}),It.map(t=>{let n=e===t.id,r=p(t.slugs),i=m(t.slugs),o=r>0?i===1?`${r} ${V(`of`)} ${i} ${V(`module on`)}`:`${r} ${V(`of`)} ${i} ${V(`modules on`)}`:void 0;return(0,B.jsx)(kt,{label:t.label,hint:o,disabled:!a,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>v(t.id),"aria-current":n?`page`:void 0,className:n?`${h} bg-primary text-on-primary shadow-primary-glow`:`${h} text-rail-text hover:text-white hover:bg-white/[.06]`,children:[(0,B.jsx)(Ot,{name:t.icon,size:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`flex-1 text-left truncate transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`}`,children:t.label}),r>0&&(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] tabular-nums transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`} ${n?`text-on-primary`:`text-rail-text`}`,title:i===1?`${r} ${V(`of`)} ${i} ${V(`module on`)}`:`${r} ${V(`of`)} ${i} ${V(`modules on`)}`,children:r})]})},t.id)})]}),(0,B.jsx)(`div`,{className:`p-3 border-t`,style:{borderColor:`var(--rail-edge)`},children:u===`active`?(0,B.jsx)(kt,{label:V(`Pro Licensed`),hint:V(`Manage your license`),disabled:!a,children:(0,B.jsxs)(`button`,{type:`button`,onClick:b(r),title:a?void 0:V(`Manage your license`),className:`${_} text-rail-text hover:text-white hover:bg-white/[.06]`,children:[(0,B.jsx)(E,{size:15,className:`shrink-0 text-success`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`flex-1 text-left transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`}`,children:V(`Pro Licensed`)}),(0,B.jsx)(T,{size:14,className:`shrink-0 transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-50`}`,"aria-hidden":`true`})]})}):(0,B.jsx)(kt,{label:V(u===`unlicensed`?`Activate License`:`Upgrade to Pro`),disabled:!a,children:(0,B.jsxs)(`button`,{type:`button`,onClick:b(u===`unlicensed`?r:n),className:`${_} text-white bg-white/[.06] hover:bg-white/[.1]`,children:[u===`unlicensed`?(0,B.jsx)(Oe,{size:15,className:`shrink-0 text-primary`,"aria-hidden":`true`}):(0,B.jsx)(Pe,{size:15,className:`shrink-0 text-primary`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`flex-1 text-left transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-100`}`,children:V(u===`unlicensed`?`Activate License`:`Upgrade to Pro`)}),(0,B.jsx)(T,{size:14,className:`shrink-0 transition-opacity duration-200 ${a?`md:opacity-0`:`opacity-70`}`,"aria-hidden":`true`})]})})})]})]})}var sn=`xspeed-sidebar-collapsed`;function cn(){let[e,t]=(0,y.useState)(()=>{try{return localStorage.getItem(sn)===`1`}catch{return!1}});return(0,y.useEffect)(()=>{try{localStorage.setItem(sn,e?`1`:`0`)}catch{}},[e]),{collapsed:e,toggle:()=>t(e=>!e)}}function ln({checked:e,onChange:t,size:n=`md`,label:r=`Toggle`,disabled:i=!1}){let a=n===`lg`?{track:`w-11 h-6`,dot:`w-5 h-5`,tx:`translate-x-[22px]`,off:`translate-x-0.5`}:n===`sm`?{track:`w-7 h-4`,dot:`w-3 h-3`,tx:`translate-x-[14px]`,off:`translate-x-0.5`}:{track:`w-9 h-5`,dot:`w-4 h-4`,tx:`translate-x-[18px]`,off:`translate-x-0.5`};return(0,B.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e?`true`:`false`,"aria-label":r,title:r,onClick:()=>t(!e),disabled:i,className:`relative inline-flex shrink-0 ${a.track} items-center rounded-full transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 ${e?`bg-primary`:`bg-line-strong`} ${i?`opacity-60 cursor-not-allowed`:``}`,children:(0,B.jsx)(`span`,{className:`inline-block ${a.dot} transform rounded-full bg-white shadow-sm transition-transform duration-150 ${e?a.tx:a.off}`})})}function un(e){return e?.replaceable?e.label?{title:V(`Take over the page cache from %s?`).replace(`%s`,e.label),body:V(`%s currently owns the page-cache file. xSpeed will replace it and serve the cached pages itself.`).replace(`%s`,e.label),confirmLabel:V(`Take over and enable`)}:{title:V(`Replace the existing cache file?`),body:V(`Another page-cache file is already in wp-content. xSpeed will replace it with its own to serve cached pages.`),confirmLabel:V(`Replace and enable`)}:null}function dn({enabled:e,onChange:t,busy:n=!1,ready:r=!0,dropin:i=null}){let[a,o]=(0,y.useState)(`disable`),[s,c]=(0,y.useState)(null),l=(0,y.useRef)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(null),p=(0,y.useId)(),m=s!==null,h=un(i),g=m&&a===`install`&&h!==null,_=e=>{let t=l.current;if(!t)return;f.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let n=t.getBoundingClientRect();o(e),c({top:n.bottom+6,right:Math.max(8,window.innerWidth-n.right)})};return(0,y.useEffect)(()=>{if(!m)return;d.current?.focus();let e=e=>{!u.current?.contains(e.target)&&!l.current?.contains(e.target)&&c(null)},t=e=>{e.key===`Escape`&&c(null)},n=()=>c(null);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n),f.current?.focus?.(),f.current=null}},[m]),(0,y.useEffect)(()=>{c(t=>t===null?t:(g?e:!e)?null:t)},[e,g]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{ref:l,className:`hidden sm:inline-flex items-center gap-2 px-3 py-1.5 text-[12.5px] text-ink-soft transition-colors ${n||!r?`opacity-60`:``}`,children:[(0,B.jsx)(ln,{checked:r&&e,onChange:e=>{if(!(n||!r)){if(!e){_(`disable`);return}h?_(`install`):t(!0)}},size:`sm`,label:V(r?e?`Turn caching off`:`Turn caching on`:`Caching — loading`)}),(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:V(`Caching`)})]}),m&&(a!==`install`||g)&&typeof document<`u`&&(0,Tt.createPortal)((0,B.jsx)(`div`,{ref:u,role:`alertdialog`,"aria-labelledby":p,style:{position:`fixed`,top:s.top,right:s.right,zIndex:60},className:`w-[min(19rem,calc(100vw-2rem))] rounded-md border shadow-md p-3 ${g?`border-line bg-info-tint`:`border-danger/30 bg-danger-tint`}`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[g?(0,B.jsx)(pe,{size:15,className:`text-info shrink-0 mt-0.5`,"aria-hidden":`true`}):(0,B.jsx)(gt,{size:15,className:`text-danger shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{id:p,className:`text-[12.5px] font-medium ${g?`text-on-tint`:`text-ink`}`,children:g?h.title:V(`Turn caching off?`)}),(0,B.jsx)(`p`,{className:`mt-1 text-[12px] leading-relaxed text-ink-soft`,children:g?h.body:V(`Every page will be served uncached until you turn it back on.`)}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,B.jsx)(`button`,{ref:d,type:`button`,onClick:()=>{c(null),t(!!g)},className:`h-8 px-3 rounded-md text-[12px] font-medium ${g?`text-on-primary`:`text-white`} transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 ${g?`bg-primary hover:bg-primary-hover focus-visible:ring-primary`:`bg-danger hover:brightness-110 focus-visible:ring-danger`}`,children:g?h.confirmLabel:V(`Turn off`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>c(null),className:`h-8 px-3 rounded-md text-[12px] border bg-paper transition-colors focus-visible:outline-none focus-visible:ring-2 ${g?`border-line text-ink hover:bg-panel focus-visible:ring-primary`:`border-line text-ink hover:bg-panel focus-visible:ring-danger`}`,children:V(`Cancel`)})]})]})]})}),document.getElementById(`xspeed-app`)??document.body)]})}var fn=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||``)?`⌘K`:`Ctrl K`;function pn({crumb:e,onOpenSearch:t,onOpenNav:n,onPurge:r,onToggleCache:i,onConnectHub:a,purging:o=!1,purgeOutcome:s=null,cacheEnabled:c=!1,cacheBusy:l=!1,cacheReady:u=!0,cacheDropin:d=null,hubConnected:f=!1,theme:p,onToggleTheme:m}){return(0,B.jsxs)(`header`,{className:`sticky top-0 z-30 h-14 shrink-0 flex items-center justify-between gap-3 px-4 sm:px-6 border-b border-line bg-paper`,children:[(0,B.jsxs)(`nav`,{"aria-label":V(`Breadcrumb`),className:`flex items-center gap-2 min-w-0`,children:[n&&(0,B.jsx)(`button`,{type:`button`,onClick:n,"aria-label":V(`Open navigation`),className:`md:hidden shrink-0 -ml-1 inline-flex items-center justify-center w-8 h-8 rounded-control text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:(0,B.jsx)(Fe,{size:18,"aria-hidden":`true`})}),e.backLabel&&(0,B.jsxs)(`button`,{type:`button`,onClick:e.onBack,className:`inline-flex items-center gap-1 shrink-0 rounded-control px-2 py-1 text-[13px] text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsx)(N,{size:15,"aria-hidden":`true`}),e.backLabel]}),e.backLabel&&(0,B.jsx)(`span`,{className:`text-faint shrink-0`,"aria-hidden":`true`,children:`/`}),(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium text-ink`,children:e.current})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":V(`Search`),"aria-keyshortcuts":`Meta+K Control+K`,className:`inline-flex items-center gap-2 rounded-control border border-line px-2.5 py-1.5 text-[12.5px] text-muted hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsx)(et,{size:14,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`hidden md:inline`,children:V(`Search`)}),(0,B.jsx)(`kbd`,{className:`hidden md:inline-flex items-center h-[18px] px-1 rounded text-[10px] font-medium bg-panel text-muted`,children:fn})]}),(0,B.jsx)(dn,{enabled:c,onChange:i,busy:l,ready:u,dropin:d}),(0,B.jsx)(mn,{onPurge:r,purging:o,outcome:o?null:s}),(0,B.jsxs)(`button`,{type:`button`,onClick:a,className:`hidden sm:inline-flex items-center gap-1.5 rounded-pill px-3 py-1.5 text-[12.5px] text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsx)(ae,{size:14,"aria-hidden":`true`}),V(f?`Hub connected`:`Connect Hub`),f&&(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:m,"aria-label":V(p===`dark`?`Switch to light mode`:`Switch to dark mode`),className:`inline-flex items-center justify-center w-8 h-8 rounded-control text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:p===`dark`?(0,B.jsx)(dt,{size:16,"aria-hidden":`true`}):(0,B.jsx)(Re,{size:16,"aria-hidden":`true`})})]})]})}function mn({onPurge:e,purging:t,outcome:n}){let r=n===`partial`||n===`failed`,i=V(n===`cleared`?`Cleared`:n===`empty`?`Already empty`:n===`partial`?`Partly cleared`:n===`failed`?`Purge failed`:`Purge all`);return(0,B.jsxs)(`button`,{type:`button`,onClick:e,disabled:t,"aria-busy":t||void 0,className:`inline-flex items-center justify-center gap-2 rounded-control border px-3 py-1.5 text-[13px] font-medium transition-colors disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 ${r?`border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 text-amber-900 dark:text-amber-100`:`border-transparent bg-primary text-on-primary shadow-primary-glow hover:bg-primary-hover`}`,children:[n===null?(0,B.jsx)(R,{size:14,className:t?`xspeed-anim-spin animate-spin`:``,"aria-hidden":`true`}):r?(0,B.jsx)(gt,{size:14,className:`xspeed-anim-pop text-amber-600 dark:text-amber-400`,"aria-hidden":`true`},n):(0,B.jsx)(M,{size:14,className:`xspeed-anim-pop`,"aria-hidden":`true`},n),i]})}function hn(e){return e.locked?`locked`:typeof e.active==`boolean`?e.active?`on`:`off`:null}function gn({state:e}){return e===`locked`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-pill px-2 py-0.5 text-[11px] font-medium bg-primary-tint text-primary`,children:[(0,B.jsx)(Pe,{size:11,"aria-hidden":`true`}),` `,V(`Pro`)]}):e===`on`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-[11px] font-medium bg-success-tint text-success`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),` `,V(`On`)]}):e===`off`?(0,B.jsx)(`span`,{className:`rounded-pill px-2 py-0.5 text-[11px] font-medium bg-panel text-muted`,children:V(`Off`)}):null}function _n({groupId:e,modules:t,onOpen:n}){let r=Rt(e);if(!r)return null;let i=r.slugs.map(e=>{if(e===`logs`)return{slug:e,label:V(`Logs`),description:V(`Recent cache and settings activity.`),icon:`Activity`,state:null};let n=t.find(t=>t.slug===e);return n?{slug:e,label:n.label??e,description:n.description??``,icon:n.icon??`Square`,state:hn(n)}:null}).filter(e=>e!==null),a=i.filter(e=>e.state!==null).length,o=i.filter(e=>e.state===`on`).length;return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:r.label}),(0,B.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-3 flex-wrap`,children:[(0,B.jsx)(`h1`,{className:`font-display text-[22px] font-semibold text-ink`,children:r.description??r.label}),a>0&&(0,B.jsxs)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:[o,` `,V(`of`),` `,a,` `,V(`on`)]})]}),(0,B.jsx)(`div`,{className:`mt-5 grid gap-4 grid-cols-[repeat(auto-fill,minmax(260px,1fr))]`,children:i.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e.slug),className:`text-left rounded-card border border-line bg-paper p-4 transition-all hover:border-line-strong hover:-translate-y-0.5 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`inline-flex items-center justify-center w-9 h-9 rounded-control bg-panel text-ink-soft`,children:e.icon===`Activity`?(0,B.jsx)(S,{size:17}):(0,B.jsx)(Ot,{name:e.icon,size:17})}),(0,B.jsx)(gn,{state:e.state})]}),(0,B.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold text-ink`,children:e.label}),e.description&&(0,B.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-soft line-clamp-2`,children:e.description})]},e.slug))})]})}function vn({title:e,body:t}){let[n,r]=(0,y.useState)(null),i=(0,y.useRef)(null),a=(0,y.useRef)(null),o=(0,y.useId)(),s=n!==null,c=()=>{let e=i.current;if(!e)return;let t=e.getBoundingClientRect();r({top:t.bottom+6,left:t.left})};return(0,y.useEffect)(()=>{if(!s)return;let e=e=>{!a.current?.contains(e.target)&&!i.current?.contains(e.target)&&r(null)},t=e=>{e.key===`Escape`&&r(null)},n=()=>r(null);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[s]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{ref:i,type:`button`,onClick:()=>s?r(null):c(),"aria-expanded":s,"aria-label":e?`Info: ${e}`:`More information`,className:`inline-flex items-center justify-center text-neutral-400 hover:text-accent dark:hover:text-primary transition-colors align-middle`,children:(0,B.jsx)(De,{size:14})}),s&&typeof document<`u`&&(0,Tt.createPortal)((0,B.jsxs)(`div`,{ref:a,role:`dialog`,"aria-labelledby":e?o:void 0,style:{position:`fixed`,top:n.top,left:n.left,zIndex:60},className:`w-[min(20rem,calc(100vw-2rem))] rounded-md bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 shadow-md p-3`,children:[e&&(0,B.jsx)(`div`,{id:o,className:`text-[12px] font-medium text-neutral-900 dark:text-neutral-50 mb-1`,children:e}),(0,B.jsx)(`p`,{className:`text-[12px] leading-relaxed text-neutral-600 dark:text-neutral-400`,children:t})]}),document.getElementById(`xspeed-app`)??document.body)]})}function yn(e){return e.locked?`locked`:typeof e.active==`boolean`?e.active?`on`:`off`:null}function bn({state:e}){return e===`locked`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-primary-tint text-primary`,children:[(0,B.jsx)(Pe,{size:12,"aria-hidden":`true`}),` `,V(`Pro`)]}):e===`on`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-success-tint text-success`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),` `,V(`On`)]}):e===`off`?(0,B.jsx)(`span`,{className:`rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-panel text-muted`,children:V(`Off`)}):null}function xn({module:e,eyebrow:t}){return(0,B.jsxs)(`div`,{children:[t&&(0,B.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:t}),(0,B.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 flex-wrap`,children:[(0,B.jsx)(`h1`,{className:`font-display text-[22px] font-semibold text-ink`,children:e.label}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,B.jsx)(bn,{state:yn(e)}),e.active_reason&&typeof e.active==`boolean`&&!e.locked&&(0,B.jsx)(vn,{title:e.active===!0?V(`Why this is on`):V(`Why this is off`),body:e.active_reason})]})]}),e.description&&(0,B.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-soft max-w-2xl`,children:e.description})]})}var Sn=window.XSpeedConfig;async function U(e,t={}){let n=await fetch(`${Sn.restUrl}${e}`,{...t,headers:{"Content-Type":`application/json`,"X-WP-Nonce":Sn.nonce,...t.headers||{}},credentials:`same-origin`});if(!n.ok)throw Error(`HTTP ${n.status}`);return n.json()}var W={request:(e,t={})=>U(e,t),getStatus:()=>U(`/status`),getSettings:()=>U(`/settings`),getModules:()=>U(`/modules`),getBranding:()=>U(`/branding`),updateSettings:e=>U(`/settings`,{method:`POST`,body:JSON.stringify(e)}),toggleCache:e=>U(`/cache/toggle`,{method:`POST`,body:JSON.stringify({enabled:e})}),purge:()=>U(`/cache/purge`,{method:`POST`}),preload:()=>U(`/preloader/start`,{method:`POST`}),getRecommendations:()=>U(`/recommendations`),applyRecommendation:e=>U(`/recommendations/apply`,{method:`POST`,body:JSON.stringify({id:e})}),getProAudit:()=>U(`/audit/pro`),getActivity:()=>U(`/activity`),mobileEqualityProbe:()=>U(`/cache/mobile-probe`,{method:`POST`}),dismissMobileReview:()=>U(`/cache/mobile-review-dismiss`,{method:`POST`}),onboardingApply:e=>U(`/onboarding/apply`,{method:`POST`,body:JSON.stringify(e)}),onboardingComplete:()=>U(`/onboarding/complete`,{method:`POST`}),getModuleSettings:e=>U(`/${e}/`),updateModuleSettings:(e,t)=>U(`/${e}/`,{method:`POST`,body:JSON.stringify(t)})};function Cn(e){return Math.round(Number(e??0)).toLocaleString()}function wn(e){let t=Number(e??0),n=t<=1?t*100:t;return`${Math.round(n)}%`}function Tn(e){let t=Math.max(0,Math.floor(Date.now()/1e3)-Number(e||0));if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function En(e){let t=Number(e??0);if(t<=0)return`0 KB`;let n=[`B`,`KB`,`MB`,`GB`,`TB`],r=Math.min(n.length-1,Math.floor(Math.log(t)/Math.log(1024))),i=t/1024**r;return`${r>=2?Math.round(i*10)/10:Math.round(i)} ${n[r]}`}function Dn(e){switch(e){case`success`:return`bg-success`;case`warn`:return`bg-warning`;case`error`:return`bg-danger`;default:return`bg-line-strong`}}function On(){let[e,t]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!0;return W.getActivity().then(n=>{e&&t(n.activity??[])}).catch(()=>{e&&t([])}),()=>{e=!1}},[]),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:V(`Tools`)}),(0,B.jsx)(`h1`,{className:`mt-1 font-display text-[22px] font-semibold text-ink`,children:V(`Logs`)}),(0,B.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-soft`,children:V(`Recent cache and settings activity on this site.`)}),(0,B.jsx)(`div`,{className:`mt-5 rounded-card border border-line bg-paper overflow-hidden`,children:e===null?(0,B.jsxs)(`div`,{className:`p-4 space-y-2`,"aria-busy":`true`,children:[(0,B.jsx)(`span`,{className:`block h-4 rounded bg-panel animate-pulse`}),(0,B.jsx)(`span`,{className:`block h-4 w-2/3 rounded bg-panel animate-pulse`})]}):e.length===0?(0,B.jsx)(`div`,{className:`p-8 text-center text-[13px] text-muted`,children:V(`No activity recorded yet.`)}):(0,B.jsx)(`ul`,{className:`divide-y divide-line`,children:e.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Dn(e.severity)}`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13.5px] text-ink`,children:e.message}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted tabular-nums font-mono`,children:Tn(e.ts)})]},`${e.ts}-${t}`))})})]})}function kn(){return(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center gap-5 px-6`,role:`status`,"aria-label":V(`Loading`),children:[(0,B.jsx)(rn,{className:`w-12 h-12 rounded-card shrink-0 motion-safe:animate-pulse`}),(0,B.jsxs)(`div`,{className:`w-full max-w-[220px] space-y-2.5`,children:[(0,B.jsx)(`div`,{className:`h-3 rounded bg-line motion-safe:animate-pulse mx-auto w-1/2`}),(0,B.jsx)(`div`,{className:`h-2.5 rounded bg-panel motion-safe:animate-pulse w-full`}),(0,B.jsx)(`div`,{className:`h-2.5 rounded bg-panel motion-safe:animate-pulse w-5/6 mx-auto`})]}),(0,B.jsx)(`span`,{className:`sr-only`,children:V(`Loading…`)})]})}function An({message:e,urgent:t=!1,sweep:n=!1,sweepKey:r}){return(0,B.jsxs)(`div`,{role:t?`alert`:`status`,"aria-live":t?`assertive`:`polite`,"aria-atomic":`true`,className:`fixed bottom-6 left-1/2 -translate-x-1/2 overflow-hidden bg-neutral-900 dark:bg-neutral-50 text-white dark:text-neutral-900 text-[13px] px-4 py-2 rounded shadow-sm z-50`,children:[e,n&&(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`xspeed-anim-drain absolute left-0 bottom-0 h-0.5 w-full bg-primary`},r)]})}function jn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}var Mn=e=>/[.!?]$/.test(e.trim())?e.trim():`${e.trim()}.`;function Nn(e){let t=e?.types?Object.entries(e.types):[];if(t.length===0)return{outcome:`cleared`,message:V(`Cache purged`),urgent:!1,ms:2e3};let n=e?.types.page,r=n?.status===`cleared`,i=t.filter(([e,t])=>e!==`page`&&t.status===`cleared`).map(([,e])=>e.label),a=t.filter(([,e])=>e.status===`failed`).map(([,e])=>e);if(a.length>0){let e=a.map(e=>Mn(Nt(V(`%s: %s`),e.label,e.reason.trim()||V(`the purge was refused`)))).join(` `);return r||i.length>0?{outcome:`partial`,message:`${V(`Cache partly cleared.`)} ${e}`,urgent:!0,ms:1e4}:{outcome:`failed`,message:`${V(`Purge failed.`)} ${e}`,urgent:!0,ms:1e4}}let o=i.length>0?Nt(V(`Also cleared: %s.`),i.join(`, `)):``;if(!r)return i.length>0?{outcome:`cleared`,message:Nt(V(`Cleared: %s.`),i.join(`, `)),urgent:!1,ms:4e3}:{outcome:`empty`,message:V(`There was nothing to clear.`),urgent:!1,ms:4e3};let s=n.entries;if(s===0&&i.length===0)return{outcome:`empty`,message:V(`The cache was already empty, so there was nothing to clear.`),urgent:!1,ms:4e3};let c;return c=s===0?V(`The page cache was already empty.`):s===null?V(`Cache cleared.`):n.bytes?Nt(Mt(`Cache cleared: %d file (%s).`,`Cache cleared: %d files (%s).`,s),s,jn(n.bytes)):Nt(Mt(`Cache cleared: %d file.`,`Cache cleared: %d files.`,s),s),{outcome:`cleared`,message:o?`${c} ${o}`:c,urgent:!1,ms:4e3}}function Pn(e){if(!e.module)return`#`;let t=`#${e.module}`;e.subtab&&(t+=`/${e.subtab}`);let n=[];return e.focus&&n.push(`focus=${encodeURIComponent(e.focus)}`),e.suggest!==void 0&&e.suggest!==null&&n.push(`suggest=${encodeURIComponent(String(e.suggest))}`),n.length>0&&(t+=`?${n.join(`&`)}`),t}function Fn(e){let[t=``,n=``]=(e||``).replace(/^#/,``).split(`?`),[r=``,i=``]=t.split(`/`),a={module:r};i&&(a.subtab=i);for(let e of n.split(`&`)){if(!e)continue;let t=e.indexOf(`=`);if(t<0)continue;let n=e.slice(0,t),r=decodeURIComponent(e.slice(t+1));n===`focus`&&r&&(a.focus=r),n===`suggest`&&r!==``&&(a.suggest=r)}return a}function In(e){if(!e)return null;let t=e.indexOf(`:`);return t<=0||t===e.length-1?null:{module:e.slice(0,t),field:e.slice(t+1)}}var Ln={info:{border:`border-line`,bg:`bg-info-tint`,iconColor:`text-info`,titleColor:`text-on-tint`,bodyColor:`text-ink-soft`,preBorder:`border-line`,preBg:`bg-paper`,preText:`text-ink`,copyBtnBorder:`border-line-strong`,copyBtnBg:`bg-paper`,copyBtnText:`text-primary`,copyBtnHover:`hover:bg-panel`,Icon:De},warn:{border:`border-amber-200 dark:border-amber-900/60`,bg:`bg-amber-50 dark:bg-amber-950/40`,iconColor:`text-amber-600 dark:text-amber-400`,titleColor:`text-amber-900 dark:text-amber-200`,bodyColor:`text-amber-800/90 dark:text-amber-200/80`,preBorder:`border-amber-200 dark:border-amber-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-amber-300 dark:border-amber-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-amber-800 dark:text-amber-200`,copyBtnHover:`hover:bg-amber-100 dark:hover:bg-amber-900/40`,Icon:gt},danger:{border:`border-red-200 dark:border-red-900/60`,bg:`bg-red-50 dark:bg-red-950/40`,iconColor:`text-red-600 dark:text-red-400`,titleColor:`text-red-900 dark:text-red-200`,bodyColor:`text-red-800/90 dark:text-red-200/80`,preBorder:`border-red-200 dark:border-red-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-red-300 dark:border-red-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-red-800 dark:text-red-200`,copyBtnHover:`hover:bg-red-100 dark:hover:bg-red-900/40`,Icon:F},success:{border:`border-emerald-200 dark:border-emerald-900/60`,bg:`bg-emerald-50 dark:bg-emerald-950/40`,iconColor:`text-emerald-600 dark:text-emerald-400`,titleColor:`text-emerald-900 dark:text-emerald-200`,bodyColor:`text-emerald-800/90 dark:text-emerald-200/80`,preBorder:`border-emerald-200 dark:border-emerald-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-emerald-300 dark:border-emerald-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-emerald-800 dark:text-emerald-200`,copyBtnHover:`hover:bg-emerald-100 dark:hover:bg-emerald-900/40`,Icon:I}};function Rn({tone:e,title:t,body:n,snippet:r,action:i}){let a=Ln[e],[o,s]=(0,y.useState)(!1);return(0,B.jsx)(`div`,{className:`border ${a.border} ${a.bg} rounded-lg p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(a.Icon,{size:16,className:`${a.iconColor} shrink-0 mt-0.5`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`font-medium ${a.titleColor} text-[13px]`,children:t}),n&&(0,B.jsx)(`p`,{className:`text-[12px] ${a.bodyColor} mt-1`,children:n}),r&&(0,B.jsxs)(`div`,{className:`mt-3 relative`,children:[(0,B.jsx)(`pre`,{className:`text-[11px] font-mono ${a.preBg} border ${a.preBorder} rounded p-3 overflow-x-auto whitespace-pre ${a.preText}`,children:r}),(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{r&&(await navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),1500))},className:`absolute top-2 right-2 flex items-center gap-1 text-[11px] px-2 py-1 rounded border ${a.copyBtnBorder} ${a.copyBtnBg} ${a.copyBtnText} ${a.copyBtnHover} transition-colors`,children:[o?(0,B.jsx)(M,{size:11}):(0,B.jsx)(oe,{size:11}),o?`Copied`:`Copy`]})]}),i&&(0,B.jsxs)(`a`,{href:Pn(i),className:`mt-3 inline-flex items-center gap-1.5 text-[12px] px-2.5 py-1 rounded border ${a.copyBtnBorder} ${a.copyBtnBg} ${a.copyBtnText} ${a.copyBtnHover} transition-colors`,children:[i.label,(0,B.jsx)(w,{size:12})]})]})]})})}function zn(){return window.wp?.media}function Bn({value:e,onChange:t,label:n}){let r=zn(),i=()=>{if(!r)return;let e=r({title:n,button:{text:`Use this image`},library:{type:`image`},multiple:!1});e.on(`select`,()=>{let n=e.state().get(`selection`).first();n&&t(n.toJSON().url)}),e.open()};return r?(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`img`,{src:e,alt:n,className:`w-8 h-8 rounded object-contain border border-neutral-200 dark:border-neutral-700 bg-white`}),(0,B.jsx)(`button`,{type:`button`,onClick:i,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors`,children:`Change`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":`Remove ${n}`,className:`text-neutral-400 hover:text-red-600 dark:hover:text-red-400 transition-colors`,children:(0,B.jsx)(xt,{size:14})})]}):(0,B.jsxs)(`button`,{type:`button`,onClick:i,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors inline-flex items-center gap-1.5`,children:[(0,B.jsx)(we,{size:13}),`Select image`]})}):(0,B.jsx)(`input`,{type:`url`,value:e??``,onChange:e=>t(e.target.value),className:`w-56`,"aria-label":n,placeholder:`https://…`})}function Vn({constant:e,overridden:t,busy:n,onOverride:r,onRevert:i}){return t?(0,B.jsxs)(`div`,{className:`mt-0.5 inline-flex items-center gap-1.5 text-[12px] text-ink-soft flex-wrap`,children:[(0,B.jsx)(Be,{className:`w-3.5 h-3.5 shrink-0`,"aria-hidden":`true`}),(0,B.jsxs)(`span`,{children:[V(`Your value is used instead of`),` `,(0,B.jsx)(`code`,{className:`font-mono text-[11px] text-ink bg-canvas border border-line rounded px-1 py-px`,children:e}),` `,V(`from wp-config.php`)]}),i&&(0,B.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:`inline-flex items-center gap-1 text-[12px] text-ink-soft hover:text-ink underline underline-offset-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:[(0,B.jsx)(Ye,{className:`w-3 h-3`,"aria-hidden":`true`}),V(`Use the host value`)]})]}):(0,B.jsxs)(`div`,{className:`mt-0.5 inline-flex items-center gap-1.5 text-[12px] text-ink-soft`,children:[(0,B.jsx)(fe,{className:`w-3.5 h-3.5 shrink-0`,"aria-hidden":`true`}),(0,B.jsxs)(`span`,{children:[V(`Defined in wp-config.php as`),` `,(0,B.jsx)(`code`,{className:`font-mono text-[11px] text-ink bg-canvas border border-line rounded px-1 py-px`,children:e})]}),r&&(0,B.jsx)(`button`,{type:`button`,onClick:r,disabled:n,"aria-label":V(`Manage this setting here instead`),title:V(`Manage this setting here instead`),className:`inline-flex items-center justify-center text-ink-soft hover:text-primary transition-colors align-middle disabled:opacity-60 disabled:cursor-not-allowed`,children:(0,B.jsx)(Be,{size:13})})]})}var Hn={danger:{card:`border-red-200 dark:border-red-900/60 bg-red-50 dark:bg-red-950/40`,icon:`text-red-600 dark:text-red-400`,title:`text-red-900 dark:text-red-200`,body:`text-red-800/90 dark:text-red-200/80`,confirm:`!border-red-600 dark:!border-red-500 bg-red-600 dark:bg-red-500 text-white hover:bg-red-700 hover:!border-red-700 dark:hover:bg-red-600`,secondary:`!border-red-300 dark:!border-red-800 bg-white dark:bg-neutral-900 text-red-800 dark:text-red-200 hover:bg-red-100 dark:hover:bg-red-900/40`,alt:`!border-red-300 dark:!border-red-800 bg-white dark:bg-neutral-900 text-red-900 dark:text-red-100 hover:bg-red-100 dark:hover:bg-red-900/40`},warn:{card:`border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40`,icon:`text-amber-600 dark:text-amber-400`,title:`text-amber-900 dark:text-amber-200`,body:`text-amber-800/90 dark:text-amber-200/80`,confirm:`!border-amber-600 dark:!border-amber-500 bg-amber-600 dark:bg-amber-500 text-white hover:bg-amber-700 hover:!border-amber-700 dark:hover:bg-amber-600`,secondary:`!border-amber-300 dark:!border-amber-800 bg-white dark:bg-neutral-900 text-amber-800 dark:text-amber-200 hover:bg-amber-100 dark:hover:bg-amber-900/40`,alt:`!border-amber-300 dark:!border-amber-800 bg-white dark:bg-neutral-900 text-amber-900 dark:text-amber-100 hover:bg-amber-100 dark:hover:bg-amber-900/40`}};function Un({title:e,body:t,confirmLabel:n,cancelLabel:r=`Cancel`,busy:i=!1,onConfirm:a,onCancel:o,altLabel:s,onAlt:c,tone:l=`danger`}){let u=Hn[l];return(0,B.jsx)(`div`,{role:`alertdialog`,"aria-labelledby":`xspeed-inline-confirm-title`,className:`border ${u.card} rounded-lg p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(gt,{size:16,className:`${u.icon} shrink-0 mt-0.5`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{id:`xspeed-inline-confirm-title`,className:`font-medium ${u.title} text-[13px]`,children:e}),t&&(0,B.jsx)(`p`,{className:`text-[12px] ${u.body} mt-1`,children:t}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid ${u.confirm} transition-colors disabled:opacity-50`,children:[i&&(0,B.jsx)(Ne,{size:12,className:`animate-spin`}),n]}),s&&c&&(0,B.jsx)(`button`,{type:`button`,onClick:c,disabled:i,style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid ${u.alt} font-medium transition-colors disabled:opacity-50`,children:s}),(0,B.jsx)(`button`,{type:`button`,onClick:o,disabled:i,style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid ${u.secondary} transition-colors disabled:opacity-50`,children:r})]})]})]})})}function Wn({constant:e,busy:t,onConfirm:n,onCancel:r}){return(0,B.jsx)(Un,{tone:`warn`,title:V(`Manage this setting here?`),body:(0,B.jsxs)(B.Fragment,{children:[V(`This value comes from`),` `,(0,B.jsx)(`code`,{className:`font-mono text-[11px]`,children:e}),` `,V(`in wp-config.php — usually written by your host. If you manage it here, later changes your host makes to it will be ignored.`),` `,V(`On a managed host (xCloud, Cloudways and similar), changing it in their control panel is usually the better route. You can revert at any time.`)]}),confirmLabel:V(`Manage here`),busy:t,onConfirm:n,onCancel:r})}var Gn={ok:`bg-success`,warn:`bg-warning`,fail:`bg-danger`,info:`bg-line-strong`};function Kn({tone:e,label:t,labelAfter:n,detail:r,trailing:i,first:a=!1}){return(0,B.jsxs)(`div`,{className:`flex items-start gap-3 px-4 sm:px-5 py-3.5 ${a?``:`border-t border-line`}`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full mt-1.5 shrink-0 ${Gn[e]}`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-[13px] font-medium text-ink`,children:[(0,B.jsx)(`span`,{children:t}),n]}),r!=null&&r!==``&&(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:r})]}),i&&(0,B.jsx)(`div`,{className:`shrink-0`,children:i})]})}function qn({content:e,tone:t=`neutral`}){let[n,r]=(0,y.useState)(!1);return(0,B.jsxs)(`div`,{className:`relative rounded ${t===`amber`?`bg-white dark:bg-neutral-900 border border-amber-200 dark:border-amber-900/60`:t===`blue`?`bg-primary-tint border border-line`:`bg-neutral-50 dark:bg-neutral-950 border border-neutral-200 dark:border-neutral-800`}`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),window.setTimeout(()=>r(!1),1800)}catch{}},className:`absolute top-2 right-2 inline-flex items-center gap-1 text-[11px] px-2 py-1 rounded border border-neutral-300 dark:border-neutral-700 bg-white/90 dark:bg-neutral-800/90 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-700 transition-colors`,"aria-label":n?`Snippet copied`:`Copy snippet`,children:[n?(0,B.jsx)(M,{size:12}):(0,B.jsx)(oe,{size:12}),n?`Copied`:`Copy`]}),(0,B.jsx)(`pre`,{className:`text-[11px] font-mono p-3 pr-16 overflow-x-auto whitespace-pre text-neutral-800 dark:text-neutral-200`,children:e})]})}function Jn(e){if(!e)return`Never`;let t=Math.floor(Date.now()/1e3)-e;return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}var Yn={info:`bg-neutral-300 dark:bg-neutral-600`,warn:`bg-amber-500`,error:`bg-red-500`,success:`bg-emerald-500`};function Xn({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null);if((0,y.useEffect)(()=>{W.getModuleSettings(`health`).then(n).catch(e=>i(e instanceof Error?e.message:`Failed to load`))},[]),r)return(0,B.jsx)(`div`,{className:`text-[12px] text-red-600 dark:text-red-400`,children:r});if(!t)return(0,B.jsx)(`div`,{className:`text-[13px] text-neutral-500 dark:text-neutral-400`,children:`Loading…`});let{checks:a,stats:o,buckets:s,activity:c}=t;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(Zn,{stats:o,buckets:s}),(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:a.map((e,t)=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(Kn,{first:t===0,tone:e.tone,label:e.label,detail:e.detail,labelAfter:e.id===`static_rewrite_nginx`?(0,B.jsx)(vn,{title:`Good to know`,body:`You added this snippet to your nginx config yourself, so it's yours to manage — xSpeed never touches it. If you ever need to uninstall xSpeed, just remove this snippet from your nginx config first to keep everything tidy and your server running happily.`}):void 0}),e.snippet&&(0,B.jsx)(`div`,{className:`px-4 pb-4 pt-1 border-b border-neutral-200 dark:border-neutral-800 last:border-b-0`,children:(0,B.jsx)(qn,{content:e.snippet})})]},e.id))}),(0,B.jsx)($n,{activity:c})]})}function Zn({stats:e,buckets:t}){let n=e.hits_24h+e.misses_24h,r=n>0?Math.round(e.hit_ratio*100):0;return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:`Hit ratio · 24h`}),(0,B.jsx)(S,{size:14,className:`text-neutral-400 dark:text-neutral-500`})]}),(0,B.jsxs)(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[(0,B.jsx)(`div`,{className:`text-[28px] font-semibold text-neutral-900 dark:text-neutral-50 leading-none`,children:n>0?`${r}%`:`—`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:n>0?`${e.hits_24h} hits · ${e.misses_24h} misses`:`No traffic captured in the last 24h yet.`})]}),(0,B.jsx)(Qn,{buckets:t})]})}function Qn({buckets:e}){if(!e.length)return(0,B.jsx)(`div`,{className:`h-8`});let t=Math.max(1,...e.map(e=>e.hits+e.misses)),n=480/Math.max(e.length-1,1),r=e.map((e,r)=>{let i=32-(e.hits+e.misses)/t*28-2;return`${(r*n).toFixed(1)},${i.toFixed(1)}`}).join(` `);return(0,B.jsx)(`svg`,{viewBox:`0 0 480 32`,preserveAspectRatio:`none`,className:`w-full h-8 text-accent`,role:`img`,"aria-label":V(`24-hour cache request volume`),children:(0,B.jsx)(`polyline`,{points:r,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function $n({activity:e}){return e.length===0?(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-5 text-center text-[13px] text-neutral-500 dark:text-neutral-400`,children:`No activity yet.`}):(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-3 border-b border-neutral-200 dark:border-neutral-800`,children:[(0,B.jsx)(`div`,{className:`font-medium text-[13px] text-neutral-900 dark:text-neutral-50`,children:`Recent activity`}),(0,B.jsxs)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:[`Most recent `,e.length,` event`,e.length===1?``:`s`,` captured by the cache engine.`]})]}),(0,B.jsx)(`ul`,{className:`divide-y divide-neutral-200 dark:divide-neutral-800`,children:e.map((e,t)=>(0,B.jsxs)(`li`,{className:`px-4 sm:px-5 py-3 flex items-start gap-3`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full mt-2 shrink-0 ${Yn[e.severity]}`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-baseline justify-between gap-3`,children:[(0,B.jsx)(`div`,{className:`text-[13px] text-neutral-700 dark:text-neutral-300 min-w-0 truncate`,children:e.message}),(0,B.jsx)(`div`,{className:`text-[11px] text-neutral-500 dark:text-neutral-400 shrink-0`,children:Jn(e.ts)})]})]},`${e.ts}-${t}`))})]})}var er=52,tr=2*Math.PI*er;function nr({percent:e,label:t}){let n=Math.max(0,Math.min(100,Math.round(e))),[r,i]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let e=window.requestAnimationFrame(()=>i(!0));return()=>window.cancelAnimationFrame(e)},[]);let a=r?tr*(1-n/100):tr;return(0,B.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,role:`img`,"aria-label":`${t}: ${n}%`,children:[(0,B.jsxs)(`svg`,{width:`128`,height:`128`,viewBox:`0 0 128 128`,children:[(0,B.jsx)(`circle`,{cx:`64`,cy:`64`,r:er,fill:`none`,stroke:`var(--panel)`,strokeWidth:`10`}),(0,B.jsx)(`circle`,{cx:`64`,cy:`64`,r:er,fill:`none`,stroke:`var(--primary)`,strokeWidth:`10`,strokeLinecap:`round`,strokeDasharray:tr,strokeDashoffset:a,transform:`rotate(-90 64 64)`,style:{transition:`stroke-dashoffset 900ms ease-out`}})]}),(0,B.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center`,children:[(0,B.jsxs)(`span`,{className:`font-display text-[26px] font-semibold text-ink tabular-nums`,children:[n,`%`]}),(0,B.jsx)(`span`,{className:`text-[11px] text-muted`,children:t})]})]})}function rr({getModule:e}){let t=window.XSpeedConfig?.bootstrap,n=t?.status?.stats,r=t?.settings?.cache_enabled===!0,i=parseInt(wn(n?.hit_ratio),10)||0,a=t=>e?.(t)?.active===!0,o=[r,a(`object-cache`),a(`browser-cache`),a(`preloader`)],s=Math.round(o.filter(Boolean).length/o.length*100),c=(n?.hits_24h??0)+(n?.misses_24h??0),l=[{label:V(`Cache coverage`),value:`${s}%`,hint:V(`of cache features on`)},{label:V(`Cached pages`),value:Cn(n?.cached_pages),hint:V(`served without PHP`)},{label:V(`Cache size`),value:En(n?.cache_size),hint:V(`on disk`)},{label:V(`Requests (24h)`),value:Cn(c),hint:V(`hits + misses`)}];return(0,B.jsx)(`section`,{className:`rounded-card border border-line bg-paper p-5`,"aria-label":V(`Health summary`),children:(0,B.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-6`,children:[(0,B.jsx)(nr,{percent:i,label:V(`Hit ratio`)}),(0,B.jsx)(`div`,{className:`flex-1 grid grid-cols-2 lg:grid-cols-4 gap-4 w-full`,children:l.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft`,children:e.label}),(0,B.jsx)(`p`,{className:`mt-0.5 font-display text-[20px] font-semibold text-ink tabular-nums`,children:e.value}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted`,children:e.hint})]},e.label))})]})})}function ir({items:e,value:t,onChange:n,idBase:r}){let i=(0,y.useId)(),a=r??i;function o(r){let i=e.findIndex(e=>e.key===t);if(i===-1)return;let a=e[(i+r+e.length)%e.length];n(a.key)}return(0,B.jsx)(`div`,{role:`tablist`,className:`flex items-center gap-1 border-b border-neutral-200 dark:border-neutral-800`,onKeyDown:e=>{e.key===`ArrowRight`?(e.preventDefault(),o(1)):e.key===`ArrowLeft`&&(e.preventDefault(),o(-1))},children:e.map(e=>{let r=e.key===t;return(0,B.jsx)(`button`,{id:or(a,e.key),role:`tab`,type:`button`,"aria-selected":r,"aria-controls":sr(a,e.key),tabIndex:r?0:-1,onClick:()=>n(e.key),className:`text-[12px] px-3 py-1.5 -mb-px border-b-2 transition-colors ${r?`border-accent text-neutral-900 dark:text-neutral-50 font-medium`:`border-transparent text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200`}`,children:(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e.label,e.locked&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Pe,{size:11,className:`shrink-0 text-on-tint`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`sr-only`,children:V(`Pro`)})]})]})},e.key)})})}function ar({children:e,className:t,active:n,idBase:r}){let i=(0,y.useRef)(null);return(0,y.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=e.offsetHeight;if(t>0&&(e.style.minHeight=`${t}px`),typeof ResizeObserver>`u`){e.style.minHeight=``;return}let n=!1,r=()=>{n||(n=!0,window.clearTimeout(o),a.disconnect(),i.current&&(i.current.style.minHeight=``))},a=new ResizeObserver(()=>{e.scrollHeight>=t&&r()});a.observe(e);let o=window.setTimeout(r,600);return()=>{window.clearTimeout(o),a.disconnect(),i.current&&(i.current.style.minHeight=``)}},[n]),(0,B.jsx)(`div`,{ref:i,className:t,...r&&n?{role:`tabpanel`,id:sr(r,n),"aria-labelledby":or(r,n),tabIndex:0}:{},children:e})}function or(e,t){return`xspeed-tab-${e}-${t}`}function sr(e,t){return`xspeed-tabpanel-${e}-${t}`}var cr=`https://xspeedcache.com/pricing/`,lr=`admin.php?page=xspeed#/settings/license`,ur={"critical-css":{id:`critical-css`,icon:`Sparkles`,title:`Critical CSS`,body:`Inline above-the-fold styles and defer the rest. Cuts first paint on theme-heavy pages by 30-60%.`},"unused-css":{id:`unused-css`,icon:`Scissors`,title:`Remove Unused CSS`,body:`Per-URL pruned stylesheet inlined; original <link> tags stripped. Pairs with Critical CSS.`},"webp-avif":{id:`webp-avif`,icon:`Replace`,title:`Auto WebP / AVIF on upload`,body:`New JPEG/PNG uploads get .webp + .avif siblings; browsers that support modern formats get them automatically.`},"cloudflare-apo":{id:`cloudflare-apo`,icon:`Zap`,title:`Cloudflare APO + edge cache`,body:`Toggle Automatic Platform Optimization right from here, set edge cache TTL, no separate dashboard.`},"feed-cache":{id:`feed-cache`,icon:`Rss`,title:`Feed caching`,body:`Cache RSS / Atom / comment feeds so aggregators polling your feed skip a full render — with the correct feed content-type preserved and auto-purge on new posts.`},"cache-404":{id:`cache-404`,icon:`FileX`,title:`404 caching`,body:`Serve one short-lived cached 404 so bot and scanner floods on nonexistent URLs don't each trigger a full render. Shared entry, correct 404 status, purged when you publish.`},"search-cache":{id:`search-cache`,icon:`Search`,title:`Search caching`,body:`Cache internal search-results pages (/?s=…) so popular repeated searches skip a full query + render. Keyed per term, short-lived, and purged when you publish new content.`},"rest-cache":{id:`rest-cache`,icon:`Webhook`,title:`REST API per-route cache`,body:`Cache read-only REST responses with a TTL you set per route — ideal for headless front-ends and app backends. Authenticated and write requests are never cached.`},"prewarm-schedule":{id:`prewarm-schedule`,icon:`CalendarClock`,title:`Scheduled prewarming`,body:`Warm target URLs ahead of a post going live, a sale, or a campaign so the traffic spike hits a warm cache. One-off, recurring, and auto-warm when a scheduled post publishes.`},"predictive-warm":{id:`predictive-warm`,icon:`TrendingUp`,title:`Predictive warming`,body:`Proactively warm the pages most likely to be visited next — ranked by real traffic, recency, and content — so your hottest URLs are always served from cache, not a cold render.`},brotli:{id:`brotli`,icon:`Shrink`,title:`Brotli compression`,body:`Serve Brotli where the browser and server support it — typically 15-25% smaller than GZIP — with automatic GZIP fallback.`},rum:{id:`rum`,icon:`Eye`,title:`Real-User Monitoring`,body:`See actual LCP / CLS / INP from your visitors’ browsers, not synthetic Lighthouse. Per-URL percentiles.`},pagespeed:{id:`pagespeed`,icon:`Gauge`,title:`PageSpeed Insights, in-dashboard`,body:`Run Google PSI on any URL without leaving xSpeed. Scores + Core Web Vitals + cached for 24h.`},recommendations:{id:`recommendations`,icon:`Lightbulb`,title:`Smart recommendations`,body:`Pro audits your current settings + server state and surfaces the 5 things most likely to move your score.`},analytics:{id:`analytics`,icon:`BarChart3`,title:`Per-URL cache analytics`,body:`Slowest pages, hit-ratio chart, recent activity timeline. Powered by the RUM data you’re already collecting.`},migration:{id:`migration`,icon:`Import`,title:`One-click migration`,body:`Import settings from WP Rocket, W3 Total Cache, or WP Super Cache. No manual reconfiguration.`},"white-label":{id:`white-label`,icon:`Tag`,title:`White-label dashboard`,body:`Rebrand the plugin name, footer credit, and help links for client work.`},multisite:{id:`multisite`,icon:`Network`,title:`Multisite network view`,body:`One dashboard across every site in your network with per-site cache state and network-wide purge.`},"custom-rules":{id:`custom-rules`,icon:`Filter`,title:`Pattern-based cache rules`,body:`Bypass cache or override expiry by URL glob, post type, category, tag, or author — beyond per-post settings.`}};function dr({icon:e,title:t,description:n,teaser:r}){let i=r?ur[r]:null,a=tn()===`unlicensed`,o={card:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-on-tint bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`};return(0,B.jsx)(`div`,{className:`border rounded-card p-4 sm:p-5 ${o.card}`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border flex items-center justify-center ${o.iconWrap}`,children:(0,B.jsx)(Ot,{name:e,size:17})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,B.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:t}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-1.5 py-0.5 ${o.badge}`,children:[a?(0,B.jsx)(Oe,{size:9}):(0,B.jsx)(Pe,{size:9}),(0,B.jsx)(`span`,{children:V(a?`License`:`Pro`)})]})]}),n&&(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:n}),i&&(0,B.jsx)(`p`,{className:`text-[12px] text-muted mt-2 leading-relaxed`,children:i.body}),a?(0,B.jsxs)(`a`,{href:lr,className:`inline-flex items-center gap-1.5 mt-3 px-3 py-1.5 rounded-md text-[12px] font-medium transition-colors ${o.cta}`,children:[V(`Activate your license`),(0,B.jsx)(w,{size:12})]}):(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-3 px-3 py-1.5 rounded-md text-[12px] font-medium transition-colors ${o.cta}`,children:[V(`Upgrade to Pro`),(0,B.jsx)(w,{size:12})]})]})]})})}function fr({panel:e,slug:t,getModule:n,onSaved:r,title:i,description:a,icon:o}){qt();let s=$t(),c=Pt.find(e=>e.slug===t),l=(0,B.jsx)(dr,{icon:o??c?.icon??`Sparkles`,title:i??c?.label??t,description:a??c?.description,teaser:c?.teaser??void 0});if(s!==`pro`&&s!==`trial`)return l;let u=n?.(t);if(!u)return l;let d=e?Gt(e):void 0;return d?(0,B.jsx)(d,{module:u,onSaved:r}):e?l:(0,B.jsx)(Ma,{module:u,onSaved:r})}var pr={"ai-provider":{id:`ai-provider`,title:`One AI connection, every AI feature`,subtitle:`Connect OpenAI, Anthropic, Gemini, or OpenRouter once — every Pro AI feature shares the same key, no per-feature setup.`,icon:`Sparkles`,mock:{kind:`toggles`,rows:[{label:`OpenAI`,on:!0,stat:`connected`},{label:`Anthropic`,on:!1,stat:`available`},{label:`Google Gemini`,on:!1,stat:`available`},{label:`OpenRouter`,on:!1,stat:`available`}]},points:[{icon:`Sparkles`,text:`Connect one provider; Speculation Rules, AI Suggestions, and Adaptive Cache all use it.`},{icon:`Lock`,text:`Your key stays on your server — stored in wp-config or the database, never shipped to us.`},{icon:`Check`,text:`Swap providers any time without reconfiguring each feature.`}]},"adaptive-cache":{id:`adaptive-cache`,title:`Cache TTL that tunes itself`,subtitle:`xSpeed reads your last 24 hours of traffic and recommends the cache lifetime that balances freshness against hit-rate — applied in one click.`,icon:`Lightbulb`,mock:{kind:`chart`,headline:`+18%`,headlineNote:`projected hit-rate at the suggested TTL`,bars:[{label:`Now`,value:71},{label:`Suggested`,value:89}]},points:[{icon:`Lightbulb`,text:`AI-tuned TTL from real 24-hour traffic patterns — no more guessing a number.`},{icon:`Check`,text:`Review the recommendation, then apply it into the Cache module in one click.`}]},"coverage-what":{id:`coverage-what`,title:`Cache more than HTML pages`,subtitle:`Page Cache serves anonymous HTML. Pro extends that to the requests that quietly cost you the most renders.`,icon:`Layers`,mock:{kind:`toggles`,rows:[{label:`404 Caching`,on:!0,stat:`3,180 bot hits absorbed`},{label:`Search Caching`,on:!0,stat:`/?s= results cached`}]},points:[{icon:`FileX`,text:`Serve one shared cached 404 so scanner floods stop costing a render each.`},{icon:`Search`,text:`Cache internal search pages (/?s=…), keyed per term, purged on publish.`},{icon:`ShieldCheck`,text:`Correct status codes preserved; auto-purge when you publish new content.`}]},"coverage-beyond":{id:`coverage-beyond`,title:`Cache feeds & API responses`,subtitle:`Aggregators and headless front-ends hammer endpoints Page Cache never touches. Pro caches those too.`,icon:`Rss`,mock:{kind:`toggles`,rows:[{label:`Feed Caching (RSS / Atom)`,on:!0,stat:`content-type preserved`},{label:`REST API Cache`,on:!0,stat:`per-route TTL`}]},points:[{icon:`Rss`,text:`Cache RSS / Atom / comment feeds so polling aggregators skip a full render.`},{icon:`Webhook`,text:`Cache read-only REST routes with a TTL you set — built for headless sites.`},{icon:`Lock`,text:`Authenticated and write requests are never cached.`}]},"coverage-rules":{id:`coverage-rules`,title:`Bypass & override by rule`,subtitle:`Go past per-post toggles: shape caching with patterns, and stand down cleanly during maintenance.`,icon:`Filter`,mock:{kind:`code`,code:[`BYPASS /cart/* (never cache)`,`BYPASS post_type=product when logged in`,`EXPIRE /blog/* override → 12h`,`MAINT. coming-soon mode → skip + auto-purge on go-live`]},points:[{icon:`Filter`,text:`Bypass or override expiry by URL glob, post type, category, tag, or author.`},{icon:`Wrench`,text:`Skip caching in maintenance / coming-soon mode, auto-purge when live again.`}]},"media-formats":{id:`media-formats`,title:`Modern image formats, automatically`,subtitle:`Every new upload gets lighter WebP + AVIF siblings, served to the browsers that support them.`,icon:`Replace`,mock:{kind:`formats`,badges:[`JPEG`,`WebP`,`AVIF`],headline:`−62%`,headlineNote:`typical transfer saved vs original JPEG`},points:[{icon:`Replace`,text:`New JPEG/PNG uploads get .webp + .avif siblings generated automatically.`},{icon:`Zap`,text:`Browsers that support modern formats get them; others fall back cleanly.`}]},"media-smart":{id:`media-smart`,title:`AI-tuned image settings`,subtitle:`Let xSpeed recommend the format and quality for each image, then apply it into Image Optimization in one click.`,icon:`Sparkles`,mock:{kind:`toggles`,rows:[{label:`hero.jpg → AVIF @ 72`,on:!0,stat:`−240 KB`},{label:`logo.png → WebP lossless`,on:!0,stat:`−31 KB`}]},points:[{icon:`Sparkles`,text:`AI recommends the best format + quality per image, not a blanket setting.`},{icon:`Check`,text:`Review the suggestions, then apply them all with one click.`}]},"compression-brotli":{id:`compression-brotli`,title:`Brotli compression`,subtitle:`Smaller than GZIP where the browser supports it — with automatic GZIP fallback everywhere else.`,icon:`Shrink`,mock:{kind:`chart`,headline:`−21%`,headlineNote:`smaller responses vs GZIP (typical)`,bars:[{label:`None`,value:100},{label:`GZIP`,value:34},{label:`Brotli`,value:27}]},points:[{icon:`Shrink`,text:`Serve Brotli where the browser and server support it — typically 15–25% smaller.`},{icon:`ShieldCheck`,text:`Automatic GZIP fallback, so nothing breaks on older clients.`}]},"cssjs-critical":{id:`cssjs-critical`,title:`Inline critical CSS, defer the rest`,subtitle:`Send only the styles the first screen needs up front so the page paints without waiting on the full stylesheet.`,icon:`Sparkles`,mock:{kind:`chart`,headline:`−48%`,headlineNote:`render-blocking CSS on first paint`,bars:[{label:`Before`,value:100},{label:`Critical`,value:52}]},points:[{icon:`Sparkles`,text:`Inline above-the-fold CSS and defer the rest — cuts first paint 30–60%.`},{icon:`Gauge`,text:`Pluggable generator endpoint; regenerates when your theme changes.`}]},"cssjs-unused":{id:`cssjs-unused`,title:`Strip the CSS a page never uses`,subtitle:`Most themes ship one giant stylesheet for the whole site. Pro serves each URL only the rules it actually needs.`,icon:`Scissors`,mock:{kind:`chart`,headline:`−71%`,headlineNote:`stylesheet bytes on a typical post`,bars:[{label:`Full CSS`,value:100},{label:`Pruned`,value:29}]},points:[{icon:`Scissors`,text:`Per-URL pruned stylesheet inlined; original <link> tags stripped.`},{icon:`Sparkles`,text:`Pairs with Critical CSS for the smallest possible first paint.`}]},"health-pagespeed":{id:`health-pagespeed`,title:`Real scores, in your dashboard`,subtitle:`Run Google PageSpeed on any URL and watch Core Web Vitals from real visitors — without leaving xSpeed.`,icon:`Gauge`,mock:{kind:`chart`,headline:`98`,headlineNote:`PageSpeed score · mobile`,bars:[{label:`LCP`,value:92},{label:`CLS`,value:99},{label:`INP`,value:95}]},points:[{icon:`Gauge`,text:`Run Google PSI on any URL — scores + Core Web Vitals, cached 24h.`},{icon:`Eye`,text:`Real-User Monitoring: LCP / CLS / INP from actual visitors, per-URL percentiles.`},{icon:`HeartPulse`,text:`Performance Health flags regressions against a 7-day baseline.`}]},"hints-speculation":{id:`hints-speculation`,title:`Prefetch the next page, before the click`,subtitle:`xSpeed predicts where each visitor is headed and quietly prefetches it via Chrome’s Speculation Rules API — so the next page feels instant.`,icon:`Wand2`,mock:{kind:`toggles`,rows:[{label:`Prefetch on hover / viewport`,on:!0,stat:`eager`},{label:`Prerender top predicted page`,on:!0,stat:`moderate`}]},points:[{icon:`Wand2`,text:`Predict each visitor’s next page and prefetch it via Speculation Rules.`},{icon:`Zap`,text:`The next navigation feels instant — the page is already there.`}]},"network-cloudflare":{id:`network-cloudflare`,title:`Drive Cloudflare from here`,subtitle:`Toggle Automatic Platform Optimization and edge cache without a second dashboard.`,icon:`Zap`,mock:{kind:`toggles`,rows:[{label:`Automatic Platform Optimization`,on:!0,stat:`edge HTML cache`},{label:`Edge cache TTL`,on:!0,stat:`4 hours`}]},points:[{icon:`Zap`,text:`Toggle APO, set edge cache level and TTL from inside xSpeed.`},{icon:`RefreshCw`,text:`Edge purge stays in sync with your local cache purges.`}]},"preloader-scheduled":{id:`preloader-scheduled`,title:`Warm the cache before the traffic`,subtitle:`Schedule warm-ups around launches, sales, and scheduled posts so the spike hits a warm cache — never a cold render.`,icon:`CalendarClock`,mock:{kind:`toggles`,rows:[{label:`Nightly full-site warm`,on:!0,stat:`02:00`},{label:`On scheduled-post publish`,on:!0,stat:`auto`},{label:`One-off: /black-friday`,on:!0,stat:`Fri 08:00`}]},points:[{icon:`CalendarClock`,text:`Warm target URLs ahead of a post, sale, or campaign going live.`},{icon:`RefreshCw`,text:`One-off, recurring, and auto-warm when a scheduled post publishes.`}]},"preloader-predictive":{id:`preloader-predictive`,title:`Keep the hottest pages always warm`,subtitle:`Let xSpeed rank your URLs by real traffic, recency, and content, and warm the ones most likely to be hit next.`,icon:`TrendingUp`,mock:{kind:`toggles`,rows:[{label:`/pricing`,on:!0,stat:`rank #1 · warm`},{label:`/blog/new-release`,on:!0,stat:`rank #2 · warm`},{label:`/features`,on:!0,stat:`rank #3 · warm`}]},points:[{icon:`TrendingUp`,text:`Proactively warm the pages most likely to be visited next.`},{icon:`BarChart3`,text:`Ranked by real traffic, recency, and content — no manual list to maintain.`}]},"health-visitors":{id:`health-visitors`,title:`Measure real visitors, not lab tests`,subtitle:`A lightweight beacon samples Core Web Vitals from your actual visitors’ browsers — the numbers Google ranks on.`,icon:`Eye`,mock:{kind:`chart`,headline:`p75`,headlineNote:`real-user Core Web Vitals`,bars:[{label:`LCP`,value:88},{label:`CLS`,value:96},{label:`INP`,value:91}]},points:[{icon:`Eye`,text:`Sample LCP / FCP / CLS / INP / TTFB from real visitors, per-URL percentiles.`},{icon:`BarChart3`,text:`See which pages actually feel slow — powered by the data you already collect.`}]}};function mr(e){return pr[e]}function hr({id:e}){let t=mr(e),n=tn()===`unlicensed`;if(!t)return null;let r={frame:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-on-tint bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`,accent:`text-primary`,check:`text-primary`};return(0,B.jsxs)(`div`,{className:`border rounded-card overflow-hidden ${r.frame}`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3 p-4 sm:p-5 pb-3`,children:[(0,B.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border flex items-center justify-center ${r.iconWrap}`,children:(0,B.jsx)(Ot,{name:t.icon,size:17})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,B.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:t.title}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-1.5 py-0.5 ${r.badge}`,children:[n?(0,B.jsx)(Oe,{size:9}):(0,B.jsx)(Pe,{size:9}),(0,B.jsx)(`span`,{children:V(n?`License`:`Pro`)})]})]}),(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:t.subtitle})]})]}),(0,B.jsx)(`div`,{className:`px-4 sm:px-5`,children:(0,B.jsx)(gr,{mock:t.mock,accent:r.accent})}),(0,B.jsxs)(`div`,{className:`p-4 sm:p-5 pt-4`,children:[(0,B.jsx)(`ul`,{className:`space-y-2`,children:t.points.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(M,{size:15,className:`shrink-0 mt-0.5 ${r.check}`,strokeWidth:2.5}),(0,B.jsx)(`span`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:e.text})]},t))}),n?(0,B.jsxs)(`a`,{href:lr,className:`inline-flex items-center gap-1.5 mt-4 px-3.5 py-2 rounded-md text-[12px] font-medium transition-colors ${r.cta}`,children:[V(`Activate your license`),(0,B.jsx)(w,{size:12})]}):(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-4 px-3.5 py-2 rounded-md text-[12px] font-medium transition-colors ${r.cta}`,children:[V(`Upgrade to Pro`),(0,B.jsx)(w,{size:12})]})]})]})}function gr({mock:e,accent:t}){return(0,B.jsxs)(`div`,{className:`relative rounded-card border border-line bg-panel p-3.5 overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1 rounded-full bg-paper border border-line px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-faint`,children:[(0,B.jsx)(Pe,{size:8}),V(`Preview`)]}),(0,B.jsxs)(`div`,{"aria-hidden":`true`,className:`select-none`,children:[e.kind===`toggles`&&(0,B.jsx)(_r,{mock:e,accent:t}),e.kind===`chart`&&(0,B.jsx)(vr,{mock:e,accent:t}),e.kind===`code`&&(0,B.jsx)(yr,{mock:e}),e.kind===`formats`&&(0,B.jsx)(br,{mock:e,accent:t})]})]})}function _r({mock:e,accent:t}){return(0,B.jsx)(`div`,{className:`space-y-2`,children:(e.rows??[]).map((e,n)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md bg-paper border border-line px-3 py-2`,children:[(0,B.jsx)(`span`,{className:`relative inline-flex shrink-0 w-9 h-5 items-center rounded-full ${e.on?`bg-primary`:`bg-line-strong`}`,children:(0,B.jsx)(`span`,{className:`inline-block w-4 h-4 rounded-full bg-white shadow-sm transform ${e.on?`translate-x-[18px]`:`translate-x-0.5`}`})}),(0,B.jsx)(`span`,{className:`text-[12px] font-medium text-ink flex-1 min-w-0 truncate`,children:e.label}),e.stat&&(0,B.jsx)(`span`,{className:`text-[11px] font-medium tabular-nums ${t}`,children:e.stat})]},n))})}function vr({mock:e,accent:t}){let n=e.bars??[];return(0,B.jsxs)(`div`,{className:`flex items-end gap-4`,children:[e.headline&&(0,B.jsxs)(`div`,{className:`shrink-0`,children:[(0,B.jsx)(`div`,{className:`text-[26px] font-bold leading-none tabular-nums ${t}`,children:e.headline}),e.headlineNote&&(0,B.jsx)(`div`,{className:`text-[10px] text-muted mt-1 max-w-[130px] leading-snug`,children:e.headlineNote})]}),(0,B.jsx)(`div`,{className:`flex-1 flex items-end justify-around gap-2 h-[64px]`,children:n.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-1 flex-1 h-full justify-end`,children:[(0,B.jsx)(`div`,{className:`w-full rounded-t ${t===n.length-1?`bg-primary`:`bg-line-strong`}`,style:{height:`${Math.max(6,e.value)}%`}}),(0,B.jsx)(`span`,{className:`text-[9px] text-muted truncate max-w-full`,children:e.label})]},t))})]})}function yr({mock:e}){return(0,B.jsx)(`div`,{className:`font-mono text-[11px] leading-relaxed text-ink-soft space-y-0.5 overflow-x-auto`,children:(e.code??[]).map((e,t)=>(0,B.jsx)(`div`,{className:`whitespace-pre`,children:e},t))})}function br({mock:e,accent:t}){let n=e.badges??[];return(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:n.map((e,t)=>{let r=t===n.length-1;return(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`rounded-md border px-2 py-1 text-[11px] font-semibold ${r?`border-primary/40 bg-primary/10 text-primary`:`border-line bg-paper text-muted`}`,children:e}),!r&&(0,B.jsx)(`span`,{className:`text-faint text-[11px]`,children:`→`})]},t)})}),e.headline&&(0,B.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,B.jsx)(`div`,{className:`text-[22px] font-bold leading-none tabular-nums ${t}`,children:e.headline}),e.headlineNote&&(0,B.jsx)(`div`,{className:`text-[10px] text-muted mt-1 max-w-[130px] leading-snug`,children:e.headlineNote})]})]})}function xr({demo:e,children:t}){return en()?(0,B.jsx)(B.Fragment,{children:t}):(0,B.jsx)(hr,{id:e})}var Sr=[{key:`cache`,label:`Overview`},{key:`visitors`,label:`Visitors`,locked:!0},{key:`pagespeed`,label:`PageSpeed`,locked:!0}],Cr=`cache`,wr=new Set(Sr.map(e=>e.key));function Tr({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),o=a===`pro`||a===`trial`,s=Sr.map(e=>({...e,locked:e.locked&&!o})),c=n&&wr.has(n)?n:Cr;return(0,y.useEffect)(()=>{n&&!wr.has(n)&&r?.(Cr)},[n,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(rr,{getModule:i}),(0,B.jsx)(fr,{panel:`RecommendationsPanel`,slug:`recommendations`,getModule:i,onSaved:t}),(0,B.jsx)(ir,{items:s,value:c,onChange:e=>r?.(e),idBase:`health`}),(0,B.jsxs)(ar,{active:c,idBase:`health`,children:[c===`cache`&&(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(Xn,{module:e}),(0,B.jsx)(fr,{panel:`AnalyticsPanel`,slug:`analytics`,getModule:i,onSaved:t})]}),c===`visitors`&&(0,B.jsx)(xr,{demo:`health-visitors`,children:(0,B.jsx)(`div`,{className:`space-y-5`,children:(0,B.jsx)(fr,{panel:`RumPanel`,slug:`rum`,getModule:i,onSaved:t})})}),c===`pagespeed`&&(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(fr,{panel:`PageSpeedPanel`,slug:`pagespeed`,getModule:i,onSaved:t}),(0,B.jsx)(fr,{panel:`PerformanceHealthPanel`,slug:`performance-health`,getModule:i,onSaved:t})]})]})]})}function Er({state:e}){let[t,n]=(0,y.useState)(null),r=(0,y.useRef)(`saving`);if((e===`saving`||e===`saved`||e===`failed`)&&(r.current=e),(0,y.useEffect)(()=>{if(typeof document>`u`)return;let e=document.getElementById(`xspeed-toast-host`);if(!e){let t=document.getElementById(`xspeed-app`);if(!t)return;e=document.createElement(`div`),e.id=`xspeed-toast-host`,t.appendChild(e)}n(e)},[]),!t)return null;let i=e!==`idle`,a=e===`saved`||e===`idle`&&r.current===`saved`,o=e===`failed`||e===`idle`&&r.current===`failed`;return(0,Tt.createPortal)((0,B.jsx)(`div`,{"aria-hidden":!i,className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-50 pointer-events-none transition-opacity duration-150 ${i?`opacity-100`:`opacity-0`}`,children:(0,B.jsx)(`div`,{role:o?`alert`:`status`,"aria-live":o?`assertive`:`polite`,"aria-atomic":`true`,className:`flex items-center gap-2 px-4 py-2 rounded-full border shadow-md text-[12px] font-medium ${o?`bg-rose-50 dark:bg-rose-950/60 border-rose-200 dark:border-rose-800 text-rose-700 dark:text-rose-300`:a?`bg-emerald-50 dark:bg-emerald-950/60 border-emerald-200 dark:border-emerald-800 text-emerald-700 dark:text-emerald-300`:`bg-white dark:bg-neutral-900 border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-300`}`,children:o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(gt,{size:14,className:`text-rose-600 dark:text-rose-400`}),(0,B.jsx)(`span`,{children:V(`Save failed — your change was not saved`)})]}):a?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(M,{size:14,className:`text-emerald-600 dark:text-emerald-400`}),(0,B.jsx)(`span`,{children:V(`Settings saved`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ne,{size:13,className:`animate-spin text-neutral-400 dark:text-neutral-500`}),(0,B.jsx)(`span`,{children:V(`Saving changes…`)})]})})}),t)}var Dr=1500,Or=5e3;function kr({saving:e,error:t}){let[n,r]=(0,y.useState)(`idle`),i=(0,y.useRef)(`idle`),a=(0,y.useRef)(!1),o=(0,y.useRef)(null);(0,y.useEffect)(()=>{i.current=n},[n]);let s=(0,y.useRef)(t);return(0,y.useEffect)(()=>{s.current=t},[t]),(0,y.useEffect)(()=>{if(e){i.current!==`saved`&&(o.current&&=(window.clearTimeout(o.current),null),r(`saving`)),a.current=!0;return}if(a.current){a.current=!1;let e=!!s.current;r(e?`failed`:`saved`),o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{r(`idle`),o.current=null},e?Or:Dr)}},[e,t]),(0,y.useEffect)(()=>()=>{o.current&&window.clearTimeout(o.current)},[]),(0,B.jsx)(Er,{state:n})}function Ar(e,t,n){let r={...t},i=!1,a=new Set([...Object.keys(t),...Object.keys(n),...Object.keys(e)]);for(let o of a)jr(n[o],e[o])?Object.prototype.hasOwnProperty.call(t,o)?r[o]=t[o]:r[o]=n[o]:(r[o]=n[o],i=!0);return{next:r,dirty:i}}function jr(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0||typeof e!=`object`||typeof t!=`object`)return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Mr(e,t,n){return e.dependsOn?Nr(e.dependsOn,t,n,new Set):!0}function Nr(e,t,n,r){if(`all`in e)return e.all.every(e=>Nr(e,t,n,r));if(`any`in e)return e.any.some(e=>Nr(e,t,n,r));if(r.has(e.field))return!0;let i=n[e.field];if(i?.dependsOn){let a=new Set(r);if(a.add(e.field),!Nr(i.dependsOn,t,n,a))return!1}let a=t[e.field];return Object.prototype.hasOwnProperty.call(e,`value`)?a===e.value:!!a}function Pr(e,t,n){return(0,y.useMemo)(()=>Object.entries(e).filter(([r,i])=>Mr(i,t,e)&&(n?n(r,i):!0)),[e,t])}var Fr=4e3;function Ir({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(null),m=(0,y.useRef)(null),h=(0,y.useRef)(!0),g=(0,y.useRef)(JSON.stringify(e.settings)),_=(0,y.useRef)(n);(0,y.useEffect)(()=>{_.current=n},[n]),(0,y.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await W.request(`/preloader/status`);e||a(t)}catch{}};t();let n=window.setInterval(()=>{i?.running&&t()},Fr);return()=>{e=!0,window.clearInterval(n)}},[i?.running]),(0,y.useEffect)(()=>{if(h.current){h.current=!1;return}if(JSON.stringify(n)!==g.current)return m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(async()=>{s(!0),d(null),l(null);let i=n;try{let{next:n,dirty:a}=Ar(i,await W.updateModuleSettings(e.slug,i),_.current);r(n),g.current=a?``:JSON.stringify(n),t?.(n)}catch(e){l(e instanceof Error?e.message:`Save failed`),d(e instanceof Error?e.message:`Save failed`)}finally{s(!1)}},600),()=>{m.current&&window.clearTimeout(m.current)}},[n,e.slug]);let v=(e,t)=>r(n=>({...n,[e]:t})),b=Pr(e.schema,n);return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(Lr,{state:i,enabled:!!n.enabled,percent:i&&i.total>0?Math.round(i.processed/i.total*100):0,actioning:f,onStart:async()=>{p(`start`),l(null);try{a(await W.request(`/preloader/start`,{method:`POST`}))}catch(e){l(e instanceof Error?e.message:`Failed to start`)}finally{p(null)}},onStop:async()=>{p(`stop`);try{a(await W.request(`/preloader/stop`,{method:`POST`}))}catch(e){l(e instanceof Error?e.message:`Failed to stop`)}finally{p(null)}}}),c&&(0,B.jsx)(Rn,{tone:`danger`,title:`Preloader error`,body:c}),(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:b.map(([e,t],r)=>(0,B.jsx)(Rr,{fieldKey:e,spec:t,value:n[e],onChange:t=>v(e,t),first:r===0},e))}),(0,B.jsx)(kr,{saving:o,error:u})]})}function Lr({state:e,enabled:t,percent:n,actioning:r,onStart:i,onStop:a}){let o=!!e?.running,s=!!(e&&(e.total>0||e.finished_at>0)),c=e?.sitemap_error??``,l=e?.source===`fallback`,u=!!c&&!l&&e?.total===0;return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4 mb-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${o?`bg-accent animate-pulse`:t?`bg-emerald-500`:`bg-neutral-300 dark:bg-neutral-600`}`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:o?`Crawling…`:u?`Couldn't start`:t?`Ready`:`Disabled`}),(0,B.jsx)(`div`,{className:`text-[12px] ${u?`text-amber-700 dark:text-amber-400`:`text-neutral-500 dark:text-neutral-400`}`,children:e?u?c:s?`${e.processed} / ${e.total} URLs warmed${e.errors.length>0?` · ${e.errors.length} error${e.errors.length===1?``:`s`}`:``}`:t?`No crawl yet. Hit "Start now" to warm the cache.`:`Enable below, then start a crawl.`:`Loading…`}),l&&(0,B.jsx)(`div`,{className:`text-[12px] text-amber-700 dark:text-amber-400 mt-0.5`,children:o?`Warming from site content — the sitemap couldn’t be read.`:`Warmed from site content — the sitemap couldn’t be read.`})]})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:o?(0,B.jsxs)(`button`,{type:`button`,onClick:a,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,B.jsx)(lt,{size:13}),`Stop`]}):(0,B.jsxs)(`button`,{type:`button`,onClick:i,disabled:!t||r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r===`start`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(He,{size:13}),`Start now`]})})]}),(o||s)&&e&&e.total>0&&(0,B.jsxs)(`div`,{className:`mt-3`,children:[(0,B.jsx)(`div`,{className:`h-1.5 w-full bg-neutral-100 dark:bg-neutral-800 rounded-full overflow-hidden`,children:(0,B.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${n}%`}})}),e.last_url&&(0,B.jsxs)(`div`,{className:`mt-2 text-[11px] text-neutral-500 dark:text-neutral-400 font-mono truncate`,children:[`Last: `,e.last_url]})]})]})}function Rr({fieldKey:e,spec:t,value:n,onChange:r,first:i}){let a=t.label??e;return(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex items-center justify-between gap-3 sm:gap-4 ${i?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a}),t.description&&(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:zr(t,n,r,a)})]})}function zr(e,t,n,r){switch(e.type){case`bool`:return(0,B.jsx)(ln,{checked:!!t,onChange:n,label:r});case`int`:return(0,B.jsx)(`input`,{type:`number`,min:e.min,max:e.max,value:t==null?``:Number(t),onChange:e=>n(Number(e.target.value)),className:`w-20 text-right`,"aria-label":r});case`enum`:return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`}`,children:a},r)})});case`string`:case`url`:return(0,B.jsx)(`input`,{type:e.type===`url`?`url`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-56`,"aria-label":r});default:return Ia(e,t,n,r)}}var Br=Object.fromEntries(Pt.map(e=>[e.slug,e.label]));function Vr(e,t){let{module:n,getModule:r,isPro:i,subtab:a}=t,o=(0,y.useMemo)(()=>e.map(e=>{let t;return t=e.self?n.tab_label??n.label??e.slug:r?.(e.slug)?.label??Br[e.slug]??e.slug,{key:e.key,label:t,locked:!!e.pro&&!i}}),[e,n,r,i]);return{items:o,active:a&&o.some(e=>e.key===a)?a:e[0]?.key??``}}var Hr=[{key:`manual`,slug:`preloader`,self:!0},{key:`scheduled`,slug:`prewarm-schedule`,panel:`PrewarmSchedulePanel`,pro:!0},{key:`predictive`,slug:`predictive-warm`,panel:`PredictiveWarmPanel`,pro:!0}];function Ur({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),{items:o,active:s}=Vr(Hr,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(Hr[0].key)},[n,o,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`preloader`}),(0,B.jsxs)(ar,{active:s,idBase:`preloader`,children:[s===`manual`&&(0,B.jsx)(Ir,{module:e,onSaved:t}),s===`scheduled`&&(0,B.jsx)(xr,{demo:`preloader-scheduled`,children:(0,B.jsx)(fr,{panel:`PrewarmSchedulePanel`,slug:`prewarm-schedule`,getModule:i,onSaved:t})}),s===`predictive`&&(0,B.jsx)(xr,{demo:`preloader-predictive`,children:(0,B.jsx)(fr,{panel:`PredictiveWarmPanel`,slug:`predictive-warm`,getModule:i,onSaved:t})})]})]})}function Wr({id:e}){if($t()!==`free`)return null;let t=ur[e];return t?(0,B.jsxs)(`div`,{className:`relative overflow-hidden border border-line bg-primary-tint rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`absolute top-3 right-3 flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium text-on-tint`,children:[(0,B.jsx)(Pe,{size:11,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:V(`Pro`)})]}),(0,B.jsxs)(`div`,{className:`flex items-start gap-3 pr-12`,children:[(0,B.jsx)(`span`,{className:`shrink-0 mt-0.5 text-warning`,children:(0,B.jsx)(Ot,{name:t.icon,size:18})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`text-[14px] font-medium text-ink`,children:t.title}),(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft mt-1 leading-relaxed`,children:t.body}),(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 mt-2.5 text-[12px] font-medium text-primary hover:text-primary-hover transition-colors`,children:[t.cta??V(`Learn more about Pro`),(0,B.jsx)(w,{size:12})]})]})]})]}):(typeof console<`u`&&console.warn(`[xSpeed] Unknown ProTeaser id: "${String(e)}"`),null)}function Gr({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)({}),[c,l]=(0,y.useState)({}),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(null),[v,b]=(0,y.useState)(!1),[x,S]=(0,y.useState)(!1),C=(0,y.useRef)(null),w=(0,y.useRef)(!0),T=(0,y.useRef)(JSON.stringify(e.settings)),E=(0,y.useRef)(n);(0,y.useEffect)(()=>{E.current=n},[n]);let D=async()=>{d(`scan`),p(null);try{let e=await W.request(`/database/scan`);a(e.scan),s(e.labels)}catch(e){p(e instanceof Error?e.message:`Scan failed`)}finally{d(null)}};(0,y.useEffect)(()=>{D()},[]),(0,y.useEffect)(()=>{if(w.current){w.current=!1;return}if(JSON.stringify(n)!==T.current)return C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(async()=>{S(!0),h(null),p(null);let i=n;try{let{next:n,dirty:a}=Ar(i,await W.updateModuleSettings(e.slug,i),E.current);r(n),T.current=a?``:JSON.stringify(n),t?.(n)}catch(e){p(e instanceof Error?e.message:`Save failed`),h(e instanceof Error?e.message:`Save failed`)}finally{S(!1)}},600),()=>{C.current&&window.clearTimeout(C.current)}},[n,e.slug]);let O=(e,t)=>r(n=>({...n,[e]:t})),k=(0,y.useMemo)(()=>Object.keys(c).filter(e=>c[e]&&(i?.[e]?.count??0)>0),[c,i]),A=(0,y.useMemo)(()=>k.reduce((e,t)=>e+(i?.[t]?.count??0),0),[k,i]),j=e=>l(t=>({...t,[e]:!t[e]})),M=()=>{if(!i)return;let e={};Object.entries(i).forEach(([t,n])=>{n.count>0&&(e[t]=!0)}),l(e)},ee=()=>l({}),N=async()=>{if(k.length!==0){b(!1),d(`clean`),p(null),_(null);try{let e=await W.request(`/database/clean`,{method:`POST`,body:JSON.stringify({types:k})});a(e.scan);let t=Object.values(e.cleaned).reduce((e,t)=>e+t,0);_(`Removed ${t.toLocaleString()} row${t===1?``:`s`}.`),l({})}catch(e){p(e instanceof Error?e.message:`Cleanup failed`)}finally{d(null)}}},P=async()=>{d(`optimize`),p(null),_(null);try{let e=await W.request(`/database/optimize`,{method:`POST`}),t=Object.keys(e.optimized).length;_(`Optimized ${t} table${t===1?``:`s`}.`)}catch(e){p(e instanceof Error?e.message:`Optimize failed`)}finally{d(null)}},te=(0,y.useMemo)(()=>Object.entries(e.schema),[e.schema]),ne=i?Object.entries(i):[],F=ne.reduce((e,[,t])=>e+t.count,0);return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4 mb-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(ce,{size:18,className:`text-primary shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`Database bloat`}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:i?F===0?`Nothing to clean — your database is tidy.`:`${F.toLocaleString()} row${F===1?``:`s`} across ${ne.filter(([,e])=>e.count>0).length} categor${ne.filter(([,e])=>e.count>0).length===1?`y`:`ies`}`:`Scanning…`})]})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:D,disabled:u!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,B.jsx)(R,{size:13,className:u===`scan`?`animate-spin`:``}),`Rescan`]})})]}),ne.length>0&&(0,B.jsx)(`div`,{className:`border border-line rounded overflow-hidden`,children:ne.map(([e,t],n)=>{let r=!!c[e],i=t.count===0;return(0,B.jsxs)(`label`,{className:`flex items-center justify-between gap-3 px-3 py-2.5 cursor-pointer ${n===0?``:`border-t border-line`} ${i?`opacity-50 cursor-not-allowed`:`hover:bg-panel/40`}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r,disabled:i,onChange:()=>j(e),className:`accent-primary`}),(0,B.jsx)(`span`,{className:`text-[13px] text-ink truncate`,children:o[e]??t.label})]}),(0,B.jsx)(`span`,{className:`text-[12px] tabular-nums text-muted shrink-0`,children:t.count.toLocaleString()})]},e)})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 mt-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:M,className:`text-primary hover:underline`,disabled:!i||F===0,children:`Select all`}),(0,B.jsx)(`span`,{className:`text-line-strong`,children:`·`}),(0,B.jsx)(`button`,{type:`button`,onClick:ee,className:`text-muted hover:underline`,disabled:k.length===0,children:`Clear`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:P,disabled:u!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,B.jsx)(St,{size:13,className:u===`optimize`?`animate-pulse`:``}),`Optimize tables`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>b(!0),disabled:u!==null||k.length===0,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[u===`clean`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(mt,{size:13}),`Clean selected`,A>0?` (${A.toLocaleString()})`:``]})]})]}),v&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Un,{title:`Permanently delete ${A.toLocaleString()} row${A===1?``:`s`}?`,body:`This removes the selected rows from your database. It can't be undone — take a backup first if you're unsure.`,confirmLabel:`Delete rows`,busy:u===`clean`,onConfirm:N,onCancel:()=>b(!1)})}),u===`clean`&&(0,B.jsx)(`div`,{className:`mt-3 h-1.5 rounded-pill bg-panel overflow-hidden`,role:`progressbar`,"aria-label":V(`Cleaning`),children:(0,B.jsx)(`div`,{className:`h-full w-full rounded-pill xspeed-anim-sweep`,style:{backgroundImage:`linear-gradient(90deg, var(--primary) 0%, #5BD6CE 50%, var(--primary) 100%)`}})})]}),f&&(0,B.jsx)(Rn,{tone:`danger`,title:`Database error`,body:f}),g&&!f&&(0,B.jsx)(Rn,{tone:`success`,title:`Done`,body:g}),te.length>0&&(0,B.jsx)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:te.map(([e,t],r)=>(0,B.jsx)(Kr,{fieldKey:e,spec:t,value:n[e],labels:o,onChange:t=>O(e,t),first:r===0},e))}),(0,B.jsx)(kr,{saving:x,error:m}),(0,B.jsx)(Wr,{id:`migration`})]})}function Kr({fieldKey:e,spec:t,value:n,labels:r,onChange:i,first:a}){let o=t.label??e,s=e===`included_types`;return(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 ${a?``:`border-t border-line`}`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 sm:gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:o}),t.description&&(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:t.description})]}),!s&&(0,B.jsx)(`div`,{className:`shrink-0`,children:Jr(t,n,i,o)})]}),s&&Object.keys(r).length>0&&(0,B.jsx)(qr,{value:Array.isArray(n)?n:[],labels:r,onChange:i})]})}function qr({value:e,labels:t,onChange:n}){let r=t=>{n(e.includes(t)?e.filter(e=>e!==t):[...e,t])};return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-3`,children:Object.entries(t).map(([t,n])=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(t),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${e.includes(t)?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:n},t))})}function Jr(e,t,n,r){switch(e.type){case`bool`:return(0,B.jsx)(ln,{checked:!!t,onChange:n,label:r});case`enum`:return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:a},r)})});default:return Ia(e,t,n,r)}}function Yr({module:e,onSaved:t,getModule:n}){let[r,i]=(0,y.useState)(e.settings),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),_=(0,y.useRef)(null),v=(0,y.useRef)(!0),b=(0,y.useRef)(JSON.stringify(e.settings)),x=(0,y.useRef)(r);(0,y.useEffect)(()=>{x.current=r},[r]),(0,y.useEffect)(()=>{if(v.current){v.current=!1;return}if(JSON.stringify(r)!==b.current)return _.current&&window.clearTimeout(_.current),_.current=window.setTimeout(async()=>{g(!0),f(null),u(null);let n=r;try{let{next:r,dirty:a}=Ar(n,await W.updateModuleSettings(e.slug,n),x.current);i(r),b.current=a?``:JSON.stringify(r),t?.(r)}catch(e){u(e instanceof Error?e.message:`Save failed`),f(e instanceof Error?e.message:`Save failed`)}finally{g(!1)}},600),()=>{_.current&&window.clearTimeout(_.current)}},[r,e.slug]);let S=(e,t)=>i(n=>({...n,[e]:t})),C=async(e,t,n=`POST`,r)=>{c(e),u(null),m(null);try{let i=await W.request(t,{method:n,body:r?JSON.stringify(r):void 0});t===`/cloudflare/verify`&&o(i),i.ok?m(`Cloudflare: ${Xr(e)} succeeded.`):u(i.body?.message||`Cloudflare API returned HTTP ${i.status}.`)}catch(e){u(e instanceof Error?e.message:`Request failed`)}finally{c(null)}},w=String(r.auth_method??`token`),T=!!r.enabled,E=Pr(e.schema,r,e=>!(e===`auto_purge_on_update`||w===`token`&&(e===`email`||e===`api_key`)||w===`key`&&e===`api_token`)),D=e.schema?.auto_purge_on_update;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:`Connection`}),(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[a?.ok?(0,B.jsx)(I,{size:18,className:`text-emerald-500 shrink-0`}):a?(0,B.jsx)(F,{size:18,className:`text-rose-500 shrink-0`}):(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-neutral-300 dark:bg-neutral-600 shrink-0 ml-2`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a?.ok?`Connected: ${a.body.result?.name??`zone`}`:a?`Verification failed`:`Not verified yet`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:a?.ok?`Plan: ${a.body.result?.plan?.name??`unknown`}`:T?`Fill in credentials below, then click Verify.`:`Enable the integration below to enter credentials.`})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>C(`verify`,`/cloudflare/verify`),disabled:s!==null||!T,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed shrink-0`,children:[(0,B.jsx)(R,{size:13,className:s===`verify`?`animate-spin`:``}),`Verify`]})]}),E.map(([e,t])=>(0,B.jsx)(Zr,{fieldKey:e,spec:t,value:r[e],onChange:t=>S(e,t),first:!1},e))]})]}),l&&(0,B.jsx)(Rn,{tone:`danger`,title:`Cloudflare error`,body:l}),p&&!l&&(0,B.jsx)(Rn,{tone:`success`,title:`Done`,body:p}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:`Actions`}),(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex items-start justify-between gap-3 sm:gap-4 ${T?``:`opacity-60`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Purge Cloudflare edge`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:T?`Clear everything Cloudflare has cached for your zone.`:`Connect your zone above to run purges.`})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>C(`purge`,`/cloudflare/purge`),disabled:s!==null||!T,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[s===`purge`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(mt,{size:13}),`Purge Cloudflare`]})})]}),(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 border-t border-neutral-200 dark:border-neutral-800 flex items-start justify-between gap-3 sm:gap-4 ${T?``:`opacity-60`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Development mode`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:T?`Temporarily bypasses Cloudflare's cache (~3 hours) so you see changes immediately.`:`Connect your zone above to toggle dev mode.`})]}),(0,B.jsxs)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>C(`devon`,`/cloudflare/dev-mode`,`POST`,{on:!0}),disabled:s!==null||!T,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:[s===`devon`?(0,B.jsx)(R,{size:12,className:`inline animate-spin mr-1`}):null,`Turn on`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>C(`devoff`,`/cloudflare/dev-mode`,`POST`,{on:!1}),disabled:s!==null||!T,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:[s===`devoff`?(0,B.jsx)(R,{size:12,className:`inline animate-spin mr-1`}):null,`Turn off`]})]})]})]})]}),D&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:`Purge behavior`}),(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:(0,B.jsxs)(`div`,{"data-field-anchor":`cloudflare:auto_purge_on_update`,className:`xspeed-field px-4 sm:px-5 py-4 flex items-start justify-between gap-3 sm:gap-4 ${T?``:`opacity-60`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:D.label??`Auto-purge Cloudflare on xSpeed purge`}),(0,B.jsxs)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:[D.description,!T&&` Enable the integration above to change this.`]})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:(0,B.jsx)(ln,{checked:!!(r.auto_purge_on_update??D.default),onChange:e=>S(`auto_purge_on_update`,e),label:D.label??`Auto-purge Cloudflare on xSpeed purge`,disabled:!T})})]})})]}),(0,B.jsx)(kr,{saving:h,error:d}),(0,B.jsxs)(`div`,{className:`pt-2`,children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:`Automatic Platform Optimization`}),(0,B.jsx)(xr,{demo:`network-cloudflare`,children:(0,B.jsx)(fr,{panel:`CloudflareApoPanel`,slug:`cloudflare-apo`,getModule:n,onSaved:t})})]})]})}function Xr(e){switch(e){case`verify`:return`verify`;case`purge`:return`purge`;case`devon`:return`dev mode on`;case`devoff`:return`dev mode off`;default:return`action`}}function Zr({fieldKey:e,spec:t,value:n,onChange:r,first:i}){let a=t.label??e;return(0,B.jsxs)(`div`,{"data-field-anchor":`cloudflare:${e}`,className:`xspeed-field px-4 sm:px-5 py-4 flex items-start justify-between gap-3 sm:gap-4 ${i?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a}),t.description&&(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:Qr(t,n,r,a)})]})}function Qr(e,t,n,r){switch(e.type){case`bool`:return(0,B.jsx)(ln,{checked:!!t,onChange:n,label:r});case`enum`:return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`}`,children:a},r)})});case`string`:return(0,B.jsx)(`input`,{type:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-64`,autoComplete:`off`,"aria-label":r});default:return Ia(e,t,n,r)}}function $r({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(e.setting_origins??{}),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(``),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(null),[v,b]=(0,y.useState)(null),[x,S]=(0,y.useState)(null),[C,w]=(0,y.useState)(!1),[T,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(!1),k=(0,y.useRef)(null),A=(0,y.useRef)(!0),j=(0,y.useRef)(JSON.stringify(e.settings)),M=(0,y.useRef)(n);(0,y.useEffect)(()=>{M.current=n},[n]);let ee=(0,y.useRef)(!0);(0,y.useEffect)(()=>(ee.current=!0,()=>{ee.current=!1}),[]);let N=async()=>{p(`detect`),h(null);try{let[e,t,n]=await Promise.all([W.request(`/object-cache/detect`),W.request(`/object-cache/snippet`),W.request(`/object-cache/origins`).catch(()=>null)]);l(e),d(t.snippet),n&&a(n)}catch(e){h(e instanceof Error?e.message:`Detection failed`)}finally{p(null)}};(0,y.useEffect)(()=>{N()},[]),(0,y.useEffect)(()=>{if(A.current){A.current=!1;return}if(JSON.stringify(n)!==j.current)return k.current&&window.clearTimeout(k.current),k.current=window.setTimeout(async()=>{O(!0),_(null),h(null);let i=n,a=!1;try{let{next:n,dirty:o}=Ar(i,await W.updateModuleSettings(e.slug,i),M.current);r(n),j.current=o?``:JSON.stringify(n),t?.(n),a=!0}catch(e){h(e instanceof Error?e.message:`Save failed`),_(e instanceof Error?e.message:`Save failed`)}finally{O(!1)}if(a)try{d((await W.request(`/object-cache/snippet`)).snippet)}catch(e){let t=e instanceof Error?e.message:``;h(t?`Could not refresh the wp-config snippet (${t}). Your settings were saved.`:`Could not refresh the wp-config snippet. Your settings were saved.`)}},600),()=>{k.current&&window.clearTimeout(k.current)}},[n,e.slug]);let P=(e,t)=>r(n=>({...n,[e]:t})),te=async(e,t)=>{s(e),h(null);try{let n=await W.request(`/object-cache/override`,{method:`POST`,body:JSON.stringify({field:e,override:t})});if(a(n.origins??{}),n.settings&&r(t=>{let r=n.settings[e];if(r===void 0||Object.is(r,t[e]))return t;let i={...t,[e]:r};return JSON.stringify(t)===j.current&&(j.current=JSON.stringify(i)),i}),b(t?`This setting is now managed here.`:`Reverted to the value in wp-config.php.`),!t)try{let e=await W.request(`/object-cache/detect`);ee.current&&l(e)}catch{}}catch(e){h(e instanceof Error?e.message:String(e))}finally{s(null)}},ne=async()=>{p(`flush`),h(null),b(null);try{b((await W.request(`/object-cache/flush`,{method:`POST`})).ok?`Object cache flushed.`:`Flush returned false — cache backend may not be active.`)}catch(e){h(e instanceof Error?e.message:`Flush failed`)}finally{p(null)}},re=async()=>{p(`test`),h(null),b(null),S(null);try{let e=await W.request(`/object-cache/test-connection`,{method:`POST`,body:JSON.stringify(n)});S(e),e.ok||h(e.message)}catch(e){h(e instanceof Error?e.message:`Connection test failed`)}finally{p(null)}},ie=async()=>{p(`enable`),h(null),b(null),w(!1);try{let e=await W.request(`/object-cache/enable`,{method:`POST`,body:JSON.stringify(n)});S(e.test??null),e.ok?(b(e.message),l(e.detect)):(h(e.message),e.steps.drop_in&&!e.steps.wp_config&&w(!0)),await N()}catch(e){h(e instanceof Error?e.message:`Enable failed`)}finally{p(null)}},ae=async()=>{p(`disable`),h(null),b(null);try{b((await W.request(`/object-cache/disable`,{method:`POST`})).message),S(null),w(!1),await N()}catch(e){h(e instanceof Error?e.message:`Disable failed`)}finally{p(null)}},se=async()=>{try{await navigator.clipboard.writeText(u),E(!0),window.setTimeout(()=>E(!1),1500)}catch{h(`Clipboard write blocked — select + copy the snippet manually.`)}},ce=String(n.backend??`redis`),le=(0,y.useMemo)(()=>Object.entries(e.schema),[e.schema]).filter(([e])=>!(ce===`redis`&&(e===`memcached_host`||e===`memcached_port`)||ce===`memcached`&&(e===`redis_host`||e===`redis_port`||e===`redis_user`||e===`redis_password`||e===`redis_database`))),L=!!c?.drop_in_installed&&!c?.drop_in_is_ours,ue=c?L?{tone:`warn`,label:`Managed by ${c.drop_in_label||`another plugin`}`,sub:`Another plugin owns wp-content/object-cache.php. Remove it there before enabling xSpeed’s object cache.`}:c.write_probe&&!c.write_probe.ok?{tone:`warn`,label:`Connected, but storing nothing`,sub:`${c.write_probe.message} Writes are being refused, so nothing is cached. Check the Cache Key Prefix, or use the host’s value.`}:c.wp_cache_active?{tone:`ok`,label:`Active: ${c.drop_in_label||c.backend}`,sub:`Backend: ${c.backend}`}:{tone:`warn`,label:`No persistent object cache`,sub:`WordPress is using its built-in in-memory cache (resets every request).`}:null;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[ue?.tone===`ok`?(0,B.jsx)(I,{size:18,className:`text-emerald-500 shrink-0`}):ue?.tone===`warn`?(0,B.jsx)(F,{size:18,className:`text-amber-500 shrink-0`}):(0,B.jsx)(tt,{size:18,className:`text-neutral-400 shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:ue?ue.label:`Detecting…`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:ue?.sub??``})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:N,disabled:f!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,B.jsx)(R,{size:13,className:f===`detect`?`animate-spin`:``}),`Re-detect`]}),c?.drop_in_is_ours&&(0,B.jsxs)(`button`,{type:`button`,onClick:ne,disabled:f!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[f===`flush`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(mt,{size:13}),`Flush`]})]})]}),c&&(()=>{let e=ce===`redis`?!!c.class_available.Redis:!!(c.class_available.Memcached||c.class_available.Memcache);return(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-[12px]`,children:[(0,B.jsxs)(`span`,{className:`px-2 py-0.5 rounded border border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300 whitespace-nowrap`,children:[ce===`redis`?`Redis`:`Memcached`,` ready`]}),(0,B.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400`,children:e?`Native ${ce===`redis`?`phpredis`:`memcached`} extension detected — fastest path.`:`xSpeed uses its built-in client — no extension to install.`})]})})()]}),m&&(0,B.jsx)(Rn,{tone:`danger`,title:`Error`,body:m}),v&&!m&&(0,B.jsx)(Rn,{tone:`success`,title:`Done`,body:v}),(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50 flex items-center gap-2`,children:[(0,B.jsx)(St,{size:15,className:`text-accent`}),`One-click setup`]}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:L?`${c?.drop_in_label||`Another plugin`} owns the object-cache drop-in. xSpeed will not overwrite or remove another plugin's file — turn its object cache off there first.`:c?.drop_in_is_ours?`Object cache is installed. Disable to remove the drop-in and clean wp-config.php.`:`Test the ${ce} connection, then enable — xSpeed writes the drop-in and wp-config.php for you. No manual steps.`}),x&&(0,B.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 text-[12px] px-2 py-1 rounded ${x.ok?`bg-emerald-50 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300`:`bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300`}`,children:[x.ok?(0,B.jsx)(I,{size:13}):(0,B.jsx)(F,{size:13}),x.message,x.latency_ms!=null&&x.ok?` (${x.latency_ms} ms)`:``]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:re,"data-field-anchor":`object-cache:connection_test`,disabled:f!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[f===`test`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(We,{size:13}),`Test connection`]}),L?null:c?.drop_in_is_ours?(0,B.jsxs)(`button`,{type:`button`,onClick:ae,disabled:f!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-red-300 dark:border-red-800 text-red-700 dark:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50`,children:[f===`disable`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(Ge,{size:13}),`Disable`]}):(0,B.jsxs)(`button`,{type:`button`,onClick:ie,disabled:f!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[f===`enable`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(Ge,{size:13}),`Enable object cache`]})]})]})}),(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:le.map(([e,t],r)=>(0,B.jsx)(ei,{fieldKey:e,spec:t,value:n[e],onChange:t=>P(e,t),origin:i[e],overrideBusy:o===e,onSetOverride:t=>te(e,t),first:r===0},e))}),C&&(0,B.jsxs)(`div`,{className:`border border-amber-200 dark:border-amber-800 bg-amber-50/40 dark:bg-amber-900/10 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Manual step needed — wp-config.php isn’t writable`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:`The drop-in was installed, but xSpeed couldn’t edit wp-config.php automatically. Paste this above the “That’s all, stop editing!” comment to finish.`})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:se,disabled:!u,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[T?(0,B.jsx)(I,{size:13,className:`text-emerald-500`}):(0,B.jsx)(oe,{size:13}),T?`Copied`:`Copy`]})]}),(0,B.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono whitespace-pre-wrap break-all bg-neutral-50 dark:bg-neutral-950 text-neutral-700 dark:text-neutral-300 border border-neutral-200 dark:border-neutral-800 rounded p-3 max-h-72 overflow-auto`,children:u||`// Adjust the settings above to generate a snippet.`})]}),(0,B.jsx)(kr,{saving:D,error:g})]})}function ei({fieldKey:e,spec:t,value:n,onChange:r,origin:i,overrideBusy:a,onSetOverride:o,first:s}){let c=t.label??e,l=i?.source===`constant`?i.constant:null,u=i?.overriding??null,[d,f]=(0,y.useState)(!1);return(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 ${s?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 sm:gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:c}),t.description&&(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description}),(l||u)&&(0,B.jsx)(Vn,{constant:l??u,overridden:!l,busy:a,onOverride:o?()=>f(!0):void 0,onRevert:o?()=>o(!1):void 0})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:ti(t,n,r,c,!!l)})]}),d&&l&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Wn,{constant:l,busy:a,onConfirm:()=>{f(!1),o?.(!0)},onCancel:()=>f(!1)})})]})}function ti(e,t,n,r,i=!1){switch(e.type){case`bool`:return(0,B.jsx)(ln,{checked:!!t,onChange:n,label:r,disabled:i});case`enum`:return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let a=t===r,o=e.option_labels?.[r]??r;return(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:i,className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${a?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`} ${i?`opacity-60 cursor-not-allowed`:``}`,children:o},r)})});case`string`:return(0,B.jsx)(`input`,{type:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),disabled:i,className:`w-56${i?` opacity-60 cursor-not-allowed`:``}`,autoComplete:`off`,"aria-label":r});default:return Ia(e,t,n,r,i)}}var ni=`xspeed_migration_applied_${typeof window<`u`?window.location.host:``}`;function ri(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(ni),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function G(e){if(!(typeof window>`u`))try{window.localStorage.setItem(ni,JSON.stringify(e))}catch{}}var ii={cache:`Page Cache`,minify:`Minify`,lazy:`Lazy Load`,preloader:`Preloader`,"browser-cache":`Browser Cache`,"object-cache":`Object Cache`},ai={cache_enabled:`Enable caching`,cache_expiry:`Cache lifetime (hours)`,mobile_separate:`Separate mobile cache`,excluded_urls:`Excluded URLs`,excluded_cookies:`Excluded cookies`,bypass_user_agents:`Bypass user agents`,ignored_query_params:`Ignored query params`,minify_html:`Minify HTML`,minify_css:`Minify CSS`,minify_js:`Minify JS`,lazy_images:`Lazy-load images`,lazy_iframes:`Lazy-load iframes`,lazy_videos:`Lazy-load videos`,enabled:`Enabled`,schedule:`Schedule`};function oi(e){return ai[e]??e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var si=new Set([`redis_password`,`memcached_password`,`object_password`,`api_key`,`api_token`,`cloudflare_api_token`,`license_key`]);function ci(e){return si.has(e)||/(password|secret|token|api_key)$/i.test(e)}function li(e){return typeof e==`boolean`?e?`On`:`Off`:Array.isArray(e)?e.length?`${e.length} item${e.length===1?``:`s`}: ${e.join(`, `)}`:`—`:e==null||e===``?`—`:String(e)}function ui(e,t){return ci(e)?t==null||t===``?`—`:`•••••••• (hidden)`:li(t)}function di({patch:e,title:t}){return(0,B.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,B.jsx)(`div`,{className:`text-[11px] font-medium text-muted uppercase tracking-wider`,children:t}),Object.entries(e).map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-card overflow-hidden bg-panel`,children:[(0,B.jsx)(`div`,{className:`px-4 pt-2.5 pb-1.5 text-[12px] font-semibold text-ink`,children:ii[e]??oi(e)}),Object.entries(t).map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-4 py-2`,children:[(0,B.jsx)(`span`,{className:`text-[12px] text-muted shrink-0`,children:oi(e)}),(0,B.jsx)(`span`,{className:`text-[12px] text-ink text-right truncate`,title:ui(e,t),children:ui(e,t)})]},e))]},e))]})}function fi(e){let t=$t(),n=t===`pro`||t===`trial`,[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)({}),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)([]),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)({}),[T,E]=(0,y.useState)(null),[D,O]=(0,y.useState)(()=>ri()),[k,A]=(0,y.useState)(null);(0,y.useEffect)(()=>{G(D)},[D]);let[j,M]=(0,y.useState)(``),[ee,N]=(0,y.useState)(null),[P,te]=(0,y.useState)(null),[ne,F]=(0,y.useState)(null),[re,ie]=(0,y.useState)(null),[ae,oe]=(0,y.useState)(!1),se=async({keepError:e=!1}={})=>{u({source:`*`,op:`status`}),e||g(null);try{i((await W.request(`/migration/status`)).sources)}catch(e){g(e instanceof Error?e.message:`Status check failed`)}finally{u(null)}},ce=async()=>{try{x((await W.request(`/migration-pro/profiles`)).profiles)}catch{x([])}};(0,y.useEffect)(()=>{se(),n&&ce()},[n]);let L=async e=>{u({source:e,op:`preview`}),g(null);try{let t=await W.request(`/migration/preview`,{method:`POST`,body:JSON.stringify({source:e})});o(n=>({...n,[e]:t.patch})),c(n=>({...n,[e]:t.notes??[]}))}catch(e){g(e instanceof Error?e.message:`Preview failed`)}finally{u(null)}},fe=e=>{e.active?v(e):pe(e.id,!1)},pe=async(e,t)=>{v(null),u({source:e,op:`apply`}),g(null),m(null);try{let n=await W.request(`/migration/apply`,{method:`POST`,body:JSON.stringify({source:e,deactivate_source:t})}),r=n.source_label||`the source plugin`,i=`Note that ${r} is still active: running two page caches at once makes them fight over the cache drop-in and can break caching for both. Deactivate it from the Plugins screen once you have checked the import.`,a=Object.entries(n.results).filter(([,e])=>!e.ok).map(([e,t])=>`${e}: ${t.message||`could not be applied`}`);if(a.length>0){let e=n.deactivated?` ${r} has been deactivated so the two caching plugins don't conflict.`:n.refused_message?` ${n.refused_message}`:` ${i}`;g(`Imported settings from ${r}, but ${a.length===1?`one setting group`:`${a.length} setting groups`} could not be applied — ${a.join(`; `)}. Everything else was imported.${e}`)}else f(t=>[...t,e]),m({title:`Imported settings from ${r}`,body:n.deactivated?`Your ${r} settings are now active in xSpeed, and ${r} has been deactivated so the two caching plugins don't conflict. Review the imported values in the panels and re-enable anything you want to tweak.`:n.refused_message?`${n.refused_message} ${i}`:`Your ${r} settings are now active in xSpeed. Review the imported values in the panels. ${i}`});se({keepError:a.length>0})}catch(e){g(e instanceof Error?e.message:`Apply failed`)}finally{u(null)}},me=async e=>{if(S[e]){C(t=>{let n={...t};return delete n[e],n});return}E({id:e,op:`preview`}),g(null);try{let t=await W.request(`/migration-pro/profiles/preview`,{method:`POST`,body:JSON.stringify({profile:e})});C(n=>({...n,[e]:t.patch}))}catch(e){g(e instanceof Error?e.message:`Preview failed`)}finally{E(null)}},he=e=>A(e),ge=async e=>{A(null),E({id:e,op:`apply`}),g(null);try{await W.request(`/migration-pro/profiles/apply`,{method:`POST`,body:JSON.stringify({profile:e})}),O(t=>t.includes(e)?t:[...t,e])}catch(e){g(e instanceof Error?e.message:`Apply failed`)}finally{E(null)}},_e=async()=>{te(`export`),g(null),F(null);try{let e=await W.request(`/migration-pro/profile/export`),t=JSON.stringify(e.profile,null,2),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`xspeed-profile.json`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),F(`Profile exported — saved as xspeed-profile.json.`)}catch(e){g(e instanceof Error?e.message:`Export failed`)}finally{te(null)}},ve=e=>{let t=e instanceof Error?e.message:``;return/422|format|profile|parse|json/i.test(t)||!t?`That doesn’t look like an xSpeed profile. Paste the JSON from an exported profile, or choose a .json file.`:t},ye=async()=>{if(j.trim()){te(`preview`),ie(null),F(null),N(null);try{N((await W.request(`/migration-pro/profile/import/preview`,{method:`POST`,body:JSON.stringify({profile:j.trim()})})).patch)}catch(e){ie(ve(e))}finally{te(null)}}},be=()=>{j.trim()&&(ie(null),oe(!0))},xe=async()=>{oe(!1),te(`apply`),ie(null),F(null);try{let e=await W.request(`/migration-pro/profile/import/apply`,{method:`POST`,body:JSON.stringify({profile:j.trim()})}),t=Object.keys(e.results).length;F(`Imported — applied settings to ${t} module${t===1?``:`s`}.`),N(null),M(``)}catch(e){ie(ve(e))}finally{te(null)}},Se=e=>{let t=new FileReader;t.onload=()=>M(String(t.result??``)),t.readAsText(e)};return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(Ee,{size:18,className:`text-primary shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`Migrate from another plugin`}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Read settings from a detected caching plugin and apply the equivalent xSpeed configuration.`})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>se(),disabled:l!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,B.jsx)(R,{size:13,className:l?.op===`status`?`animate-spin`:``}),`Re-scan`]})]})}),h&&(0,B.jsx)(Rn,{tone:`danger`,title:`Migration error`,body:h}),p&&(0,B.jsx)(Rn,{tone:`success`,title:p.title,body:p.body}),r?.map(e=>{let t=d.includes(e.id)||e.imported,n=a[e.id],r=e.mapped_count,i=`${r} ${r===1?`setting`:`settings`}`,o=t?`Imported${e.active?``:` · plugin deactivated`}`:e.detected?`Detected — imports ${i}`:`Not installed (or settings not present)`;return(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${t||e.detected?`bg-success`:`bg-line-strong`}`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:e.label}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:o})]})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:t?(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 text-success font-medium`,children:[(0,B.jsx)(I,{size:14}),`Imported`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>L(e.id),disabled:!e.detected||l!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[l?.source===e.id&&l?.op===`preview`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(de,{size:13}),`Preview`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>fe(e),disabled:!e.detected||l!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[l?.source===e.id&&l?.op===`apply`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(w,{size:13}),`Import`]})]})})]}),_?.id===e.id&&(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(Un,{title:`How should xSpeed handle ${e.label}?`,body:(0,B.jsxs)(B.Fragment,{children:[`The `,i,` are imported either way. Running two page caches breaks both, so switching `,e.label,` off is recommended — its settings stay saved.`]}),confirmLabel:`Import & switch to xSpeed`,altLabel:`Import settings only`,cancelLabel:`Cancel`,busy:l?.source===e.id&&l?.op===`apply`,onConfirm:()=>pe(e.id,!0),onAlt:()=>pe(e.id,!1),onCancel:()=>v(null)})}),n&&(0,B.jsx)(di,{patch:n,title:`Translation preview`}),n&&(s[e.id]?.length??0)>0&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Rn,{tone:`warn`,title:`Some values could not be imported exactly`,body:s[e.id].join(` `)})})]},e.id)}),(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(vt,{size:18,className:`text-primary shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:`One-click cache profiles`}),!n&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Pe,{size:12,className:`text-on-tint shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`sr-only`,children:V(`Pro`)})]})]}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Apply a curated, best-practice xSpeed setup for your site type — no manual tuning.`})]})]}),n?b===null?(0,B.jsx)(`div`,{className:`mt-4 text-[12px] text-muted text-center py-4`,children:`Loading…`}):b.length===0?(0,B.jsx)(`div`,{className:`mt-4 text-[12px] text-muted text-center py-4`,children:`No profiles available.`}):(0,B.jsx)(`div`,{className:`mt-4 space-y-3`,children:b.map(e=>{let t=D.includes(e.id),n=S[e.id],r=!!n,i=k?.id===e.id;return(0,B.jsxs)(`div`,{className:`border border-line rounded-card p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:e.label}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:e.description})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>me(e.id),disabled:T!==null,"aria-expanded":r?`true`:`false`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40`,children:[T?.id===e.id&&T?.op===`preview`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):r?(0,B.jsx)(ue,{size:13}):(0,B.jsx)(de,{size:13}),r?`Hide preview`:`Preview`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>he(e),disabled:T!==null||t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[T?.id===e.id&&T?.op===`apply`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):t?(0,B.jsx)(I,{size:13}):(0,B.jsx)(w,{size:13}),t?`Applied`:`Apply`]})]})]}),n&&(0,B.jsx)(di,{patch:n,title:`Will set`}),i&&(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(Un,{title:`Apply the "${e.label}" profile?`,body:(0,B.jsxs)(B.Fragment,{children:[`This overwrites your site-wide cache settings (cache lifetime, exclusions, minify & lazy options) with the `,e.label,` preset. Your existing safety exclusions are kept. You can re-tune anything afterward in each panel.`]}),confirmLabel:`Apply profile`,cancelLabel:`Cancel`,busy:T?.id===e.id&&T?.op===`apply`,onConfirm:()=>ge(e.id),onCancel:()=>A(null)})})]},e.id)})}):(0,B.jsx)(`div`,{className:`mt-4 rounded-card border border-dashed border-line-strong px-4 py-3 text-[12px] text-muted`,children:`Curated one-click profiles (Blog, WooCommerce, Membership, LMS, News) and portable save\xA0&\xA0share are a Pro feature. Activate Pro to unlock them here.`})]}),n&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(le,{size:18,className:`text-primary shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`Save & share your config`}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Export this site’s xSpeed settings as a portable profile, then import it on another site.`})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:_e,disabled:P!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 shrink-0`,children:[P===`export`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(le,{size:13}),`Export profile`]})]}),(0,B.jsxs)(`div`,{className:`mt-3 text-[11px] text-muted leading-snug`,children:[`For your security, API keys, tokens, and other secrets are `,(0,B.jsx)(`strong`,{children:`excluded`}),` from the exported file — re-enter them manually on the destination site after importing.`]}),ne&&!re&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Rn,{tone:`success`,title:`Done`,body:ne})}),(0,B.jsxs)(`div`,{className:`mt-5`,children:[(0,B.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted mb-1`,children:`Import a profile`}),(0,B.jsx)(`textarea`,{rows:4,value:j,onChange:e=>{M(e.target.value),N(null)},placeholder:V(`Paste an xSpeed profile JSON here, or choose a .json file below.`),className:`w-full font-mono text-[11px]`,"aria-label":V(`Profile JSON to import`)}),(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors cursor-pointer`,children:[(0,B.jsx)(_t,{size:13}),`Choose file`,(0,B.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&Se(t)}})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:ye,disabled:P!==null||!j.trim(),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40`,children:[P===`preview`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(de,{size:13}),`Preview`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:be,disabled:P!==null||!j.trim(),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[P===`apply`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(w,{size:13}),`Import & apply`]})]}),re&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Rn,{tone:`danger`,title:`Import error`,body:re})}),ae&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Un,{title:`Apply this imported profile?`,body:(0,B.jsx)(B.Fragment,{children:`This overwrites your site-wide xSpeed settings with the values in the imported profile (cache lifetime, exclusions, minify & lazy options, …). Secrets aren’t included — re-enter them after. You can re-tune anything afterward in each panel.`}),confirmLabel:`Import & apply`,cancelLabel:`Cancel`,busy:P===`apply`,onConfirm:xe,onCancel:()=>oe(!1)})}),ee&&(0,B.jsx)(di,{patch:ee,title:`Will import`})]})]})]})}function pi({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),l=Xt(),u=String(e.settings.support_url??`https://xspeedcache.com/support/`),d=async()=>{i(!0),o(null);try{n(await W.request(`/support/snapshot`))}catch(e){o(e instanceof Error?e.message:`Snapshot failed`)}finally{i(!1)}};return(0,y.useEffect)(()=>{d()},[]),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(je,{size:18,className:`text-accent shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Help & Support`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:`Open a ticket with your system snapshot already attached so we can help faster.`})]})]}),!l.hide_help_links&&(0,B.jsxs)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors`,children:[(0,B.jsx)(L,{size:13}),`Open ticket`]})]})}),a&&(0,B.jsx)(Rn,{tone:`danger`,title:`Support snapshot error`,body:a}),(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`System snapshot`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:`Paste this into your support ticket. License key is masked — first 4 + last 4 only.`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:d,disabled:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,B.jsx)(R,{size:13,className:r?`animate-spin`:``}),`Refresh`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{if(t)try{await navigator.clipboard.writeText(t.markdown),c(!0),window.setTimeout(()=>c(!1),1500)}catch{o(`Clipboard blocked. Select the text below and copy manually.`)}},disabled:!t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[s?(0,B.jsx)(I,{size:13,className:`text-emerald-500`}):(0,B.jsx)(oe,{size:13}),s?`Copied`:`Copy markdown`]})]})]}),t?(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2 text-[12px]`,children:Object.entries(t.snapshot).map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex justify-between gap-3 border-b border-neutral-100 dark:border-neutral-800 pb-1`,children:[(0,B.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400 font-mono`,children:e}),(0,B.jsx)(`span`,{className:`text-neutral-900 dark:text-neutral-100 text-right truncate font-mono`,children:Array.isArray(t)?t.join(`, `):typeof t==`boolean`?t?`yes`:`no`:String(t)})]},e))}):(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 italic`,children:`Loading snapshot…`})]}),(()=>{let e=l.footer_credit?.trim();return e?(0,B.jsx)(`div`,{className:`text-[11px] text-neutral-400 dark:text-neutral-500 text-center pt-1`,children:e}):l.hide_help_links?null:(0,B.jsxs)(`div`,{className:`text-[11px] text-neutral-400 dark:text-neutral-500 text-center pt-1`,children:[`Built by`,` `,(0,B.jsx)(`a`,{href:`https://wpdeveloper.com`,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-accent`,children:`WPDeveloper`})]})})()]})}function mi(e){let t=Math.max(0,Math.floor(Date.now()/1e3)-e);return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function hi(){let[e,t]=(0,y.useState)(!1),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),c=async()=>{a(!0);try{r(await W.request(`/mcp/activity?limit=50`))}catch{r({entries:[],summary:{total:0,failed:0,last_ts:0,top_tool:``}})}finally{a(!1)}};(0,y.useEffect)(()=>{e&&n===null&&c()},[e]);let l=async()=>{a(!0);try{r(await W.request(`/mcp/activity/clear`,{method:`POST`}))}finally{a(!1),s(!1)}},u=n?.summary,d=n?.entries??[];return(0,B.jsxs)(`div`,{className:`mt-4 rounded-card border border-line`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(e=>!e),"aria-expanded":e,className:`flex w-full items-center gap-2 px-3 py-2.5 text-left`,children:[e?(0,B.jsx)(ee,{size:14,className:`text-faint`}):(0,B.jsx)(P,{size:14,className:`text-faint`}),(0,B.jsx)($e,{size:14,className:`text-muted`}),(0,B.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:`Activity log`}),u&&u.total>0&&(0,B.jsxs)(`span`,{className:`text-[11px] text-faint`,children:[u.total,` call`,u.total===1?``:`s`,u.failed>0&&(0,B.jsxs)(`span`,{className:`text-danger`,children:[` · `,u.failed,` failed`]})]}),(0,B.jsx)(`span`,{className:`ml-auto text-[11px] text-faint`,children:`what the AI did`})]}),e&&(0,B.jsxs)(`div`,{className:`border-t border-line px-3 py-3`,children:[(0,B.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,B.jsx)(`p`,{className:`text-[11px] text-muted`,children:`Every tool call an assistant dispatched to this site, newest first.`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:c,disabled:i,"aria-label":V(`Refresh activity log`),className:`rounded border border-line p-1.5 text-muted hover:bg-panel disabled:opacity-40`,children:(0,B.jsx)(R,{size:12,className:i?`animate-spin`:``})}),d.length>0&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>o?l():s(!0),onBlur:()=>s(!1),disabled:i,className:`rounded border px-2 py-1 text-[11px] disabled:opacity-40 ${o?`border-danger text-danger`:`border-line text-muted hover:bg-panel`}`,children:o?`Confirm clear`:`Clear`})]})]}),d.length===0?(0,B.jsx)(`p`,{className:`py-4 text-center text-[12px] text-faint`,children:n===null?`Loading…`:`No tool calls recorded yet.`}):(0,B.jsx)(`ul`,{className:`space-y-1`,children:d.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md bg-panel/50 px-2.5 py-1.5`,children:[e.ok?(0,B.jsx)(I,{size:13,className:`mt-0.5 shrink-0 text-success`,"aria-label":V(`succeeded`)}):(0,B.jsx)(re,{size:13,className:`mt-0.5 shrink-0 text-danger`,"aria-label":V(`failed`)}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`code`,{className:`text-[12px] font-medium text-ink`,children:e.tool}),e.scope===`read`?(0,B.jsx)(de,{size:11,className:`text-faint`,"aria-label":V(`read-only call`)}):(0,B.jsx)(Ve,{size:11,className:`text-warning`,"aria-label":V(`write call`)})]}),e.args!==``&&(0,B.jsx)(`div`,{className:`truncate text-[11px] text-muted`,children:e.args}),e.error!==``&&(0,B.jsx)(`div`,{className:`text-[11px] text-danger`,children:e.error})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] tabular-nums text-faint`,children:mi(e.ts)})]},`${e.ts}-${e.tool}-${t}`))})]})]})}function gi({active:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(!1),p=async()=>{i(`load`),o(null);try{n(await W.request(`/mcp/hub`))}catch(e){o(e instanceof Error?e.message:`Failed to load xSpeed Hub status.`)}finally{i(null),u(!0)}},m=async(e=!1)=>{try{let t=e?{headers:{"X-XSpeed-Reconcile":`1`}}:{};n(await W.request(`/mcp/hub`,t))}catch{}};(0,y.useEffect)(()=>{e&&!l&&r!==`load`&&p()},[e]),(0,y.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e&&l&&m(!0)};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[e,l]);let h=async()=>{i(`token`),o(null);try{n(await W.request(`/mcp/hub/token`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Could not generate a token.`)}finally{i(null)}},g=async()=>{c(!1),i(`disconnect`),o(null);try{n(await W.request(`/mcp/hub/disconnect`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Disconnect failed.`)}finally{i(null)}};if(!l)return(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-faint py-6`,children:[(0,B.jsx)(R,{size:13,className:`animate-spin`}),` Loading xSpeed Hub…`]});let _=!!t?.attached,v=(()=>{let e=t?.attach_url;if(!e||typeof window>`u`)return e;try{let t=new URL(e),n=new URL(window.location.href);return n.searchParams.set(`xspeed_connected`,`1`),t.searchParams.set(`return_url`,n.toString()),t.toString()}catch{return e}})(),b=!!t?.site_token;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(O,{size:18,className:`text-primary shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`xSpeed Hub`}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Control caching on all your sites from one AI connection.`})]})]}),_&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-success shrink-0`,children:[(0,B.jsx)(I,{size:14}),`Connected`]})]}),_&&(0,B.jsxs)(`div`,{className:`rounded-md border border-line bg-success-tint px-3 py-2.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,B.jsxs)(`p`,{className:`text-[12px] text-ink-soft`,children:[`This site is managed at xSpeed Hub`,t?.account_email?(0,B.jsxs)(B.Fragment,{children:[` — signed in as `,(0,B.jsx)(`strong`,{children:t.account_email})]}):``,`.`]}),(0,B.jsxs)(`a`,{href:t?.hub_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors shrink-0`,children:[(0,B.jsx)(L,{size:13}),` Go to dashboard`]})]}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2 text-[12px]`,children:[[`1`,`Connect this site`,`One click — sign in and approve`],[`2`,`Connect AI once`,`Add one connection from your xSpeed Hub dashboard`],[`3`,`Control every site`,`“Purge cache on acme” — done`]].map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`rounded-md border border-line bg-panel px-3 py-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium text-ink`,children:[(0,B.jsx)(`span`,{className:`inline-flex h-4 w-4 items-center justify-center rounded-full bg-primary text-on-primary text-[10px]`,children:e}),t]}),(0,B.jsx)(`div`,{className:`text-muted mt-0.5`,children:n})]},e))}),a&&(0,B.jsx)(Rn,{tone:`danger`,title:`xSpeed Hub error`,body:a}),!_&&(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors`,children:[(0,B.jsx)(ct,{size:13}),` Connect via xSpeed Hub`]}),(0,B.jsx)(`p`,{className:`text-[12px] text-muted`,children:`One click — sign in to your account and approve. No token to copy.`})]}),!_&&(0,B.jsxs)(`div`,{className:`border-t border-line pt-3`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>{b||h(),f(e=>!e)},className:`flex items-center gap-1.5 text-[12px] text-muted hover:text-ink`,children:[(0,B.jsx)(Oe,{size:12}),`Can't redirect? Add with a token instead`]}),d&&(0,B.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,B.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[`Paste this site's URL + token into the`,` `,(0,B.jsxs)(`a`,{href:t?.add_site_url,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline inline-flex items-center gap-0.5`,children:[`Add site form `,(0,B.jsx)(L,{size:11})]}),` `,`on xspeedcache.com.`]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:`Site URL`}),(0,B.jsx)(qn,{content:t?.site_url??``})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:`Token`}),(0,B.jsx)(qn,{content:t?.site_token??``,tone:`blue`})]}),(0,B.jsx)(`p`,{className:`text-[12px] text-muted`,children:`Same token as your MCP connection — treat it like a password.`})]})]}),_&&(0,B.jsx)(`div`,{className:`border-t border-line pt-3`,children:s?(0,B.jsx)(Un,{title:`Disconnect this site from xSpeed Hub?`,body:`This clears the hub link on this site. To fully cut off the hub's access, also Rotate the token above so its stored copy stops working.`,confirmLabel:`Disconnect`,busy:r===`disconnect`,onConfirm:g,onCancel:()=>c(!1)}):(0,B.jsxs)(`button`,{type:`button`,onClick:()=>c(!0),disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-danger hover:bg-danger-tint transition-colors disabled:opacity-50`,children:[(0,B.jsx)(Ge,{size:13}),` Disconnect from Hub`]})})]})}var _i=!1;function vi({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(`cli`),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(null),h=async()=>{i(`load`),o(null);try{n(await W.request(`/mcp/connection`))}catch(e){o(e instanceof Error?e.message:`Failed to load MCP status.`)}finally{i(null)}};(0,y.useEffect)(()=>{h()},[]);let g=async()=>{i(`connect`),o(null);try{n(await W.request(`/mcp/connect`,{method:`POST`,body:JSON.stringify({read_only:s})}))}catch(e){o(e instanceof Error?e.message:`Could not connect to xSpeed MCP.`)}finally{i(null)}},_=async()=>{m(null),i(`rotate`),o(null);try{n(await W.request(`/mcp/rotate`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Token rotation failed.`)}finally{i(null)}},v=async()=>{m(null),i(`disconnect`),o(null);try{n(await W.request(`/mcp/disconnect`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Disconnect failed.`)}finally{i(null)}},b=!!t?.connected;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[b?(0,B.jsx)(I,{size:18,className:`text-success shrink-0`}):(0,B.jsx)(Ge,{size:18,className:`text-faint shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-ink`,children:[b?`Connected`:`Not connected`,_i]}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Control this site's cache from Claude and other MCP-compatible AI agents.`})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:h,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,B.jsx)(R,{size:13,className:r===`load`?`animate-spin`:``}),`Refresh`]}),b?(0,B.jsxs)(B.Fragment,{children:[_i,(0,B.jsxs)(`button`,{type:`button`,onClick:()=>m(`rotate`),disabled:r!==null||p!==null,title:`Mint a fresh token and invalidate the current one`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[r===`rotate`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(Xe,{size:13}),`Rotate`]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>m(`disconnect`),disabled:r!==null||p!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-danger hover:bg-danger-tint transition-colors disabled:opacity-50`,children:[r===`disconnect`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(Ge,{size:13}),`Disconnect`]})]}):(0,B.jsxs)(`button`,{type:`button`,onClick:g,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r===`connect`?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(ct,{size:13}),`Connect`]})]})]}),_i]}),p===`rotate`&&(0,B.jsx)(Un,{title:`Rotate the MCP token?`,body:`A fresh token is minted and the current one is invalidated immediately. Any AI agent using the old token stops working until you paste the new one.`,confirmLabel:`Rotate token`,busy:r===`rotate`,onConfirm:_,onCancel:()=>m(null)}),p===`disconnect`&&(0,B.jsx)(Un,{title:`Disconnect MCP?`,body:`This revokes the token and every OAuth grant immediately — any AI agent using this site stops working until you reconnect.`,confirmLabel:`Disconnect`,busy:r===`disconnect`,onConfirm:v,onCancel:()=>m(null)}),a&&(0,B.jsx)(Rn,{tone:`danger`,title:`MCP error`,body:a}),t&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5 space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`Add this MCP server to your AI client`}),(0,B.jsxs)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:[`Pick the format your client uses. The token travels in an`,` `,(0,B.jsx)(`code`,{className:`font-mono text-[11px]`,children:`Authorization`}),` header, so it never lands in a URL or server log.`]})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-1 border-b border-line`,children:[[`cli`,`Claude Code (CLI)`],[`json`,`JSON config`],[`prompt`,`AI prompt`],[`oauth`,`Remote (OAuth)`]].map(([e,t])=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`flex items-center gap-1.5 text-[12px] px-3 py-1.5 -mb-px border-b-2 transition-colors ${l===e?`border-primary text-ink font-medium`:`border-transparent text-muted hover:text-ink`}`,children:t},e))}),!b&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel px-3 py-2 text-[12px] text-muted`,children:[(0,B.jsx)(ct,{size:14,className:`mt-0.5 shrink-0 text-primary`}),(0,B.jsxs)(`span`,{children:[`Click `,(0,B.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Connect`}),` `,`above to mint this site's token, then copy your connection config here.`]})]}),l===`cli`&&b&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Run this once in your terminal — it registers xSpeed with Claude Code:`}),(0,B.jsx)(qn,{content:t.config.cli,tone:`blue`})]}),l===`json`&&b&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Add this to your client's MCP config (e.g. Claude Desktop's config file):`}),(0,B.jsx)(qn,{content:t.config.json,tone:`blue`})]}),l===`prompt`&&b&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line bg-warning-tint px-3 py-2 text-[12px] text-warning`,children:[(0,B.jsx)(gt,{size:14,className:`mt-0.5 shrink-0`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{className:`font-semibold`,children:`Not recommended.`}),` This pastes your token into a chat, so the AI provider may see and store it. Prefer the`,` `,(0,B.jsx)(`strong`,{className:`font-medium`,children:`Claude Code (CLI)`}),`,`,` `,(0,B.jsx)(`strong`,{className:`font-medium`,children:`JSON config`}),`, or`,` `,(0,B.jsx)(`strong`,{className:`font-medium`,children:`Remote (OAuth)`}),` methods, which keep the token out of the conversation.`]})]}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Paste this to your AI agent so it knows what it's connected to and how to act:`}),(0,B.jsx)(qn,{content:t.ai_prompt})]}),l===`oauth`&&b&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:`For clients that connect by URL only (e.g. claude.ai connectors). Paste just the server URL — no token field:`}),(0,B.jsx)(qn,{content:t.mcp_endpoint,tone:`blue`}),(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-[12px] text-muted pt-1`,children:[(0,B.jsx)(`span`,{className:`text-primary shrink-0`,children:`•`}),(0,B.jsxs)(`span`,{children:[`No token needed. Your client opens a browser page where you`,` `,(0,B.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`approve access`}),` `,`(you must be signed in here as an administrator). Approval grants the same`,` `,t.read_only?`read-only`:`read & write`,` access as the token above.`]})]})]}),b&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2 text-[12px] text-muted pt-1`,children:[(0,B.jsx)(`span`,{className:`text-warning shrink-0`,children:`•`}),(0,B.jsxs)(`span`,{children:[`Treat the token like a password — it lets an AI control this site.`,` `,(0,B.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Rotate`}),` `,`if it may have leaked;`,` `,(0,B.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Disconnect`}),` `,`to revoke entirely.`,t.scopes.length>0&&(0,B.jsxs)(B.Fragment,{children:[` Granted scopes: `,t.scopes.join(`, `),`.`]})]})]})]}),b&&t&&t.tools.length>0&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),"aria-expanded":d?`true`:`false`,className:`flex w-full items-center gap-2 rounded text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1`,children:[d?(0,B.jsx)(ee,{size:16,className:`shrink-0 text-muted`}):(0,B.jsx)(P,{size:16,className:`shrink-0 text-muted`}),(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:`Tools your AI agent can call`}),(0,B.jsxs)(`span`,{className:`text-[12px] text-faint`,children:[`(`,t.tools.length,`)`]})]}),d&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-2`,children:t.read_only?(0,B.jsxs)(B.Fragment,{children:[`This is a `,(0,B.jsx)(`strong`,{className:`font-medium`,children:`read-only`}),` connection, so the`,` `,(0,B.jsx)(`span`,{className:`text-warning`,children:`write`}),` tools below are refused.`]}):(0,B.jsx)(B.Fragment,{children:`Each tool maps to an xSpeed action. Write tools can change this site.`})}),(0,B.jsx)(`ul`,{className:`mt-3 divide-y divide-line`,children:t.tools.map(e=>(0,B.jsxs)(`li`,{className:`flex items-start gap-3 py-2`,children:[(0,B.jsx)(`code`,{className:`font-mono text-[11px] text-ink shrink-0 mt-0.5`,children:e.name}),(0,B.jsx)(`span`,{className:`shrink-0 mt-0.5 text-[10px] font-medium px-1.5 py-0.5 rounded ${e.write?`bg-warning-tint text-warning`:`bg-panel text-muted`}`,children:e.write?`write`:`read`}),(0,B.jsx)(`span`,{className:`text-[12px] text-muted`,children:e.description})]},e.name))})]})]}),!b&&t!==null&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:`What your AI agent can do`}),(0,B.jsxs)(`div`,{className:`text-[12px] text-muted mt-1`,children:[`Once connected, your AI can read cache status & stats, purge the cache, toggle caching on or off, and read or change module settings — all scoped to this site.`,_i,` `,`Rotate or disconnect any time to revoke access.`]})]}),(0,B.jsx)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:(0,B.jsx)(gi,{active:!0})}),(0,B.jsx)(hi,{})]})}var yi=[{key:`gzip`,slug:`gzip`,self:!0},{key:`brotli`,slug:`brotli-compression`,pro:!0}];function bi({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),{items:o,active:s}=Vr(yi,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(yi[0].key)},[n,o,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`compression`}),(0,B.jsxs)(ar,{active:s,idBase:`compression`,children:[s===`gzip`&&(0,B.jsx)(Ma,{module:e,onSaved:t,hoistedNotices:!0}),s===`brotli`&&(0,B.jsx)(xr,{demo:`compression-brotli`,children:(0,B.jsx)(fr,{slug:`brotli-compression`,getModule:i,onSaved:t})})]})]})}var xi=[{key:`minify`,slug:`minify`,self:!0},{key:`critical`,slug:`critical-css`,panel:`CriticalCssPanel`,pro:!0},{key:`unused`,slug:`unused-css`,panel:`UnusedCssPanel`,pro:!0}];function Si({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),{items:o,active:s}=Vr(xi,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(xi[0].key)},[n,o,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`cssjs`}),(0,B.jsxs)(ar,{active:s,idBase:`cssjs`,children:[s===`minify`&&(0,B.jsx)(Ma,{module:e,onSaved:t,hoistedNotices:!0}),s===`critical`&&(0,B.jsx)(xr,{demo:`cssjs-critical`,children:(0,B.jsx)(fr,{panel:`CriticalCssPanel`,slug:`critical-css`,getModule:i,onSaved:t})}),s===`unused`&&(0,B.jsx)(xr,{demo:`cssjs-unused`,children:(0,B.jsx)(fr,{panel:`UnusedCssPanel`,slug:`unused-css`,getModule:i,onSaved:t})})]})]})}var Ci=[{key:`lazy`,slug:`lazy`,self:!0},{key:`images`,slug:`images`,panel:`ImagesPanel`,pro:!0},{key:`smart`,slug:`smart-image`,panel:`SmartImagePanel`,pro:!0}];function wi({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),{items:o,active:s}=Vr(Ci,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(Ci[0].key)},[n,o,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`media`}),(0,B.jsxs)(ar,{active:s,idBase:`media`,children:[s===`lazy`&&(0,B.jsx)(Ma,{module:e,onSaved:t}),s===`images`&&(0,B.jsx)(xr,{demo:`media-formats`,children:(0,B.jsx)(fr,{panel:`ImagesPanel`,slug:`images`,getModule:i,onSaved:t})}),s===`smart`&&(0,B.jsx)(xr,{demo:`media-smart`,children:(0,B.jsx)(fr,{panel:`SmartImagePanel`,slug:`smart-image`,getModule:i,onSaved:t})})]})]})}var Ti=[{key:`hints`,slug:`resource-hints`,self:!0},{key:`speculation`,slug:`smart-predict`,panel:`SmartPredictPanel`,pro:!0}];function Ei({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=$t(),{items:o,active:s}=Vr(Ti,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(Ti[0].key)},[n,o,r]),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`resource-hints`}),(0,B.jsxs)(ar,{active:s,idBase:`resource-hints`,children:[s===`hints`&&(0,B.jsx)(Ma,{module:e,onSaved:t}),s===`speculation`&&(0,B.jsx)(xr,{demo:`hints-speculation`,children:(0,B.jsx)(fr,{panel:`SmartPredictPanel`,slug:`smart-predict`,getModule:i,onSaved:t})})]})]})}var Di=[{key:`coverage`,label:`What to cache`,locked:!0},{key:`beyond`,label:`Feeds & API`,locked:!0},{key:`rules`,label:`Rules & bypass`,locked:!0}],Oi=`coverage`,ki=new Set(Di.map(e=>e.key));function Ai({getModule:e,onSaved:t,subtab:n,onSubtabChange:r}){let i=$t(),a=i===`pro`||i===`trial`,o=Di.map(e=>({...e,locked:e.locked&&!a})),s=n&&ki.has(n)?n:Oi;return(0,y.useEffect)(()=>{n&&!ki.has(n)&&r?.(Oi)},[n,r]),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(ir,{items:o,value:s,onChange:e=>r?.(e),idBase:`cache-extras`}),(0,B.jsxs)(ar,{active:s,idBase:`cache-extras`,children:[s===`coverage`&&(a?(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(fr,{slug:`cache-404`,getModule:e,onSaved:t}),(0,B.jsx)(fr,{slug:`search-cache`,getModule:e,onSaved:t})]}):(0,B.jsx)(hr,{id:`coverage-what`})),s===`beyond`&&(a?(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(fr,{slug:`feed-cache`,getModule:e,onSaved:t}),(0,B.jsx)(fr,{panel:`RestCachePanel`,slug:`rest-cache`,getModule:e,onSaved:t})]}):(0,B.jsx)(hr,{id:`coverage-beyond`})),s===`rules`&&(a?(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(fr,{panel:`CustomRulesPanel`,slug:`custom-rules`,getModule:e,onSaved:t}),(0,B.jsx)(fr,{panel:`MaintenanceCachePanel`,slug:`maintenance-cache`,getModule:e,onSaved:t})]}):(0,B.jsx)(hr,{id:`coverage-rules`}))]})]})}function ji({onSaved:e,subtab:t,onSubtabChange:n,getModule:r}){return(0,B.jsx)(Ai,{getModule:e=>r?.(e),subtab:t,onSubtabChange:n,onSaved:e})}var Mi=0,Ni=null,Pi=null;function Fi(e){(0,y.useEffect)(()=>{if(!e)return;let t=document.getElementById(`wpbody`);if(t){if(Mi===0){Ni=t.style.position,Pi=t.style.top;let e=t.getBoundingClientRect().top;t.style.position=`static`;let n=e-t.getBoundingClientRect().top;t.style.position=`relative`,t.style.top=n?`${n}px`:``}return Mi+=1,()=>{--Mi,Mi===0&&(t.style.position=Ni??``,t.style.top=Pi??``,Ni=null,Pi=null)}}},[e])}function Ii({open:e,onClose:t,title:n,children:r,dismissible:i=!0,labelledBy:a,variant:o=`center`,size:s=`md`}){let c=(0,y.useRef)(null),l=(0,y.useRef)(null),u=(0,y.useCallback)(()=>{i&&t()},[i,t]);if((0,y.useEffect)(()=>{if(!e)return;l.current=document.activeElement;let t=window.requestAnimationFrame(()=>{(c.current?.querySelector(Li)??c.current)?.focus()});return()=>{window.cancelAnimationFrame(t);let e=l.current;e&&e.isConnected&&e.focus()}},[e]),(0,y.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&(e.stopPropagation(),u())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,u]),(0,y.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]),Fi(e),!e)return null;let d=e=>{if(e.key!==`Tab`)return;let t=c.current?.querySelectorAll(Li);if(!t||t.length===0)return;let n=t[0],r=t[t.length-1];!n||!r||(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},f=o===`drawer`,p={md:`max-w-md`,lg:`max-w-2xl`,xl:`max-w-4xl`,workspace:`max-w-5xl`}[s];return(0,Tt.createPortal)((0,B.jsxs)(`div`,{className:f?`fixed inset-0 z-[100000] flex items-stretch justify-end pt-[var(--wp-admin--admin-bar--height,32px)]`:`fixed inset-0 z-[100000] flex items-center justify-center p-4`,onMouseDown:e=>{c.current&&!c.current.contains(e.target)&&u()},children:[(0,B.jsx)(`div`,{className:`fixed inset-0 bg-black/40`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{ref:c,role:`dialog`,"aria-modal":`true`,"aria-label":a?void 0:n,"aria-labelledby":a,tabIndex:-1,onKeyDown:d,className:f?`relative flex h-full w-full ${p} flex-col overflow-hidden rounded-l-card border-l border-y border-line bg-paper shadow-xl focus:outline-none`:`relative w-full ${p} rounded-card border border-line bg-paper shadow-xl focus:outline-none`,children:[(0,B.jsxs)(`div`,{className:f?`flex items-start gap-3 border-b border-line px-5 py-4 shrink-0`:`flex items-start gap-3 px-5 pt-5`,children:[(0,B.jsx)(`h2`,{className:`flex-1 text-[15px] font-medium text-ink`,children:n}),i&&(0,B.jsx)(`button`,{type:`button`,onClick:t,"aria-label":V(`Close`),className:`-mr-1 -mt-1 shrink-0 rounded p-1 text-muted hover:text-ink hover:bg-panel transition-colors`,children:(0,B.jsx)(xt,{size:16})})]}),(0,B.jsx)(`div`,{className:f?`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`:`px-5 pb-5 pt-3`,children:r})]})]}),document.getElementById(`xspeed-app`)??document.body)}var Li=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,Ri=typeof window<`u`?window.XSpeedConfig?.bootstrap?.hub??null:null,zi=Ri,Bi=Ri!=null,Vi=!1,Hi=!1,K=new Set;function q(e){zi=e,Bi=!0,K.forEach(e=>e())}function Ui(e){return K.add(e),()=>K.delete(e)}function Wi({active:e=!0,initial:t}={}){let n=(0,y.useSyncExternalStore)(Ui,()=>zi),r=(0,y.useSyncExternalStore)(Ui,()=>Bi),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),c=(0,y.useCallback)(async()=>{if(!Vi){Vi=!0,a(`load`),s(null);try{q(await W.request(`/mcp/hub`))}catch(e){s(e instanceof Error?e.message:`Failed to load xSpeed Hub status.`)}finally{Vi=!1,a(null)}}},[]),l=(0,y.useCallback)(async(e=!1)=>{try{let t=e?{headers:{"X-XSpeed-Reconcile":`1`}}:{};q(await W.request(`/mcp/hub`,t))}catch{}},[]),u=(0,y.useCallback)(async()=>{a(`token`),s(null);try{q(await W.request(`/mcp/hub/token`,{method:`POST`}))}catch(e){s(e instanceof Error?e.message:`Could not generate a token.`)}finally{a(null)}},[]),d=(0,y.useCallback)(async()=>{a(`disconnect`),s(null);try{q(await W.request(`/mcp/hub/disconnect`,{method:`POST`}))}catch(e){s(e instanceof Error?e.message:`Disconnect failed.`)}finally{a(null)}},[]);return(0,y.useEffect)(()=>{if(!(Hi||!e)){if(Hi=!0,t!=null&&!Bi){q(t);return}c()}},[e]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=new URL(window.location.href);e.searchParams.get(`xspeed_connected`)===`1`&&(l(!0),e.searchParams.delete(`xspeed_connected`),e.searchParams.delete(`xspeed_hub_nonce`),e.searchParams.delete(`xspeed_hub_email`),window.history.replaceState(null,``,e.toString()))},[]),(0,y.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e&&r&&l(!0)};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[e,r,l]),{status:n,connectUrl:(()=>{let e=n?.attach_url;if(!e||typeof window>`u`)return e;try{let t=new URL(e),n=new URL(window.location.href);return n.searchParams.set(`xspeed_connected`,`1`),t.searchParams.set(`return_url`,n.toString()),t.toString()}catch{return e}})(),busy:i,error:o,loaded:r,attached:!!n?.attached,hasToken:!!n?.site_token,load:c,reload:l,generateToken:u,disconnect:d,setError:s}}var Gi=[`not_connected`,`unauthorized`];function Ki(e){return e!==void 0&&Gi.includes(e)}function qi({open:e,onClose:t,onConnected:n,local:r=!1}){let{connectUrl:i,attached:a,busy:o,error:s,generateToken:c}=Wi({active:e}),l=o===`token`,[u,d]=(0,y.useState)(!1),f=(0,y.useRef)(!1);(0,y.useEffect)(()=>{e||(d(!1),f.current=!1)},[e]),(0,y.useEffect)(()=>{if(!e||!a||!u||f.current)return;f.current=!0;let r=window.setTimeout(()=>{n(),t()},900);return()=>window.clearTimeout(r)},[e,a,u,n,t]);let p=async()=>{d(!0);let e=i||await c();e&&window.open(e,`_blank`,`noopener`)};return(0,B.jsx)(Ii,{open:e,onClose:t,title:V(`Run a GTmetrix test`),children:a&&u?(0,B.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-[13px] text-ink`,children:[(0,B.jsx)(M,{size:16,className:`text-success`}),V(`Connected — starting your test…`)]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(_e,{size:18,className:`mt-0.5 shrink-0 text-accent`}),(0,B.jsxs)(`div`,{className:`space-y-2 text-[13px] leading-relaxed text-ink-soft`,children:[(0,B.jsx)(`p`,{children:V(`Connect this site to xSpeed Hub to run GTmetrix tests from here.`)}),(0,B.jsx)(`p`,{className:`text-muted`,children:V(`It takes a few seconds.`)})]})]}),r&&(0,B.jsxs)(`div`,{className:`mt-3 flex gap-2 rounded border border-line bg-panel px-3 py-2 text-[12px] text-muted`,children:[(0,B.jsx)(De,{size:14,className:`mt-0.5 shrink-0`}),(0,B.jsx)(`span`,{children:V(`This site looks local, so it may not be reachable for testing. Your own GTmetrix API key works either way — see the settings below.`)})]}),s&&(0,B.jsx)(`p`,{className:`mt-3 text-[12px] text-danger`,children:s}),(0,B.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:t,className:`rounded px-3 py-1.5 text-[13px] text-muted hover:text-ink hover:bg-panel transition-colors`,children:V(`Not now`)}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>void p(),disabled:l,className:`inline-flex items-center gap-1.5 rounded bg-accent px-3 py-1.5 text-[13px] text-white hover:bg-primary-hover transition-colors disabled:opacity-50`,children:[l?(0,B.jsx)(Ne,{size:13,className:`animate-spin`}):(0,B.jsx)(L,{size:13}),V(u?`Waiting for connection…`:`Connect`)]})]}),u&&(0,B.jsx)(`p`,{className:`mt-2 text-right text-[11px] text-muted`,children:V(`Finish in the tab that opened, then come back here.`)})]})})}function Ji(e){return e===null?`stroke-line`:e>=90?`stroke-success`:e>=50?`stroke-warning`:`stroke-danger`}function Yi(e){return e===null?`text-faint`:e>=90?`text-success`:e>=50?`text-warning`:`text-danger`}function Xi({score:e,size:t=64,label:n,thickness:r=2.5}){let i={width:t,height:t},a=e===null?null:Math.max(0,Math.min(100,e));return(0,B.jsxs)(`div`,{className:`relative shrink-0`,style:i,role:`img`,"aria-label":n??(a===null?V(`No score measured yet`):`${V(`Performance score`)}: ${a} ${V(`out of 100`)}`),children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 36 36`,className:`-rotate-90`,style:i,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`18`,cy:`18`,r:`15.9155`,fill:`none`,strokeWidth:r,className:`stroke-line`}),a!==null&&(0,B.jsx)(`circle`,{cx:`18`,cy:`18`,r:`15.9155`,fill:`none`,strokeWidth:r,strokeLinecap:`round`,strokeDasharray:`${a}, 100`,className:Ji(a)})]}),(0,B.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center font-semibold tabular-nums ${Yi(a)}`,style:{fontSize:Math.round(t*.34)},"aria-hidden":`true`,children:a===null?`—`:a})]})}var Zi={speed:`Core Web Vitals`,delivery:`Server & caching`,assets:`Assets`,stack:`Platform`},Qi=5e3;function $i({label:e,d:t}){let n=t.score??0,r=n>=90?`bg-success`:n>=50?`bg-warning`:`bg-danger`;return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-baseline justify-between text-[12px]`,children:[(0,B.jsx)(`span`,{className:`text-ink-soft`,children:e}),(0,B.jsxs)(`span`,{className:`text-muted tabular-nums`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-ink`,children:t.score??`—`}),t.weight!==null&&(0,B.jsxs)(`span`,{className:`text-[11px]`,children:[` `,`· `,t.earned??`—`,`/`,t.weight,` `,V(`pts`)]})]})]}),(0,B.jsx)(`div`,{className:`mt-1 h-1.5 rounded-pill bg-panel overflow-hidden`,children:(0,B.jsx)(`div`,{className:`h-full rounded-pill ${r}`,style:{width:`${Math.max(0,Math.min(100,n))}%`}})})]})}function ea(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(``),o=(0,y.useRef)(null),s=(0,y.useRef)(!0),c=(0,y.useCallback)(async()=>{try{let e=await W.request(`/score/scan-status`);if(!s.current)return;t(e),e.status===`running`?o.current=setTimeout(c,Qi):r(!1)}catch{if(!s.current)return;r(!1),t(e=>e&&e.status===`running`?{...e,status:`idle`}:e)}},[]);(0,y.useEffect)(()=>(s.current=!0,c(),()=>{s.current=!1,o.current&&clearTimeout(o.current)}),[c]);let l=async()=>{r(!0),a(``);try{await W.request(`/score/scan`,{method:`POST`,body:JSON.stringify({fresh:!0})}),o.current=setTimeout(c,Qi)}catch(e){a(e instanceof Error?e.message:V(`The scan could not be started.`)),r(!1)}},u=e?.latest??null,d=e?.status===`running`||n,f=e?.visibility===`private`&&e?.private_supported===!0;return(0,B.jsxs)(`section`,{className:`rounded-card border border-line bg-paper p-5`,"aria-label":V(`xSpeed Scan`),children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0`,children:[(0,B.jsx)(`span`,{className:`inline-flex items-center justify-center w-8 h-8 rounded-lg bg-primary-tint text-primary shrink-0`,"aria-hidden":`true`,children:(0,B.jsx)(Ke,{size:17})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h3`,{className:`font-display text-[15px] font-semibold text-ink`,children:V(`xSpeed Scan`)}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[12px] text-ink-soft`,children:V(`A full graded report: Core Web Vitals, caching, assets and platform.`)})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:l,disabled:d,className:`shrink-0 inline-flex items-center gap-2 rounded-control bg-primary px-3.5 py-2 text-[13px] font-medium text-on-primary hover:opacity-90 disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[d?(0,B.jsx)(Ne,{size:14,className:`animate-spin`,"aria-hidden":`true`}):(0,B.jsx)(Ke,{size:14,"aria-hidden":`true`}),V(d?`Scanning…`:u?`Scan again`:`Run a scan`)]})]}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg p-2.5 text-[12px] ${f?`bg-success-tint text-success`:`bg-panel text-ink-soft`}`,children:[f?(0,B.jsx)(Pe,{size:13,className:`mt-0.5 shrink-0`,"aria-hidden":`true`}):(0,B.jsx)(be,{size:13,className:`mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:V(f?`Connected to xSpeed Hub — this report stays unlisted, not published under your domain.`:`This report will be publicly visible at xspeedcache.com, listed under your domain. Connect xSpeed Hub to keep your reports unlisted.`)})]}),i&&(0,B.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-danger-tint p-2.5 text-[12px] text-danger`,children:[(0,B.jsx)(gt,{size:13,className:`mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:i})]}),d&&e?.step&&(0,B.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[e.step,`…`]}),u&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-lg border border-line p-4`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-4`,children:(()=>{let e=u.measured.lighthouse_desktop,t=u.measured.lighthouse,n=e??t;return n===null?(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Xi,{score:u.score,size:64,thickness:3.5}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`text-[13px] font-semibold text-ink`,children:[V(`Grade`),` `,u.grade||`—`]}),(0,B.jsx)(`div`,{className:`text-[11px] text-muted`,children:V(`xSpeed Scan, out of 100`)})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Xi,{score:n,size:64,thickness:3.5}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] font-semibold text-ink`,children:[e===null?(0,B.jsx)(st,{size:13,"aria-hidden":`true`,className:`text-muted`}):(0,B.jsx)(Le,{size:13,"aria-hidden":`true`,className:`text-muted`}),V(e===null?`Mobile`:`Desktop`)]}),(0,B.jsx)(`div`,{className:`text-[11px] text-muted`,children:V(`Lighthouse performance, out of 100`)})]})]}),(0,B.jsxs)(`div`,{className:`text-[12px] text-muted`,children:[e!==null&&t!==null&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(st,{size:12,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`font-semibold text-ink tabular-nums`,children:t}),(0,B.jsx)(`span`,{children:V(`mobile`)})]}),(0,B.jsxs)(`div`,{className:`mt-0.5 text-[11px]`,children:[V(`Grade`),` `,u.grade||`—`,` · `,V(`xSpeed Scan`),` `,u.score??`—`,`/100`]})]})]})})()}),u.partial&&(0,B.jsx)(`p`,{className:`mt-3 text-[12px] text-warning`,children:V(`Partial scan — some checks could not run, so the score covers less than the full rubric.`)}),(0,B.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:Object.entries(u.dimensions).map(([e,t])=>(0,B.jsx)($i,{label:V(Zi[e]??e),d:t},e))}),u.fixes.length>0&&(0,B.jsxs)(`div`,{className:`mt-5`,children:[(0,B.jsxs)(`h4`,{className:`text-[12px] font-semibold text-ink`,children:[V(`What to fix next`),(0,B.jsx)(`span`,{className:`ml-1.5 font-normal text-muted`,children:V(`ranked by points recovered`)})]}),(0,B.jsx)(`ul`,{className:`mt-2 divide-y divide-line`,children:u.fixes.map(e=>(0,B.jsxs)(`li`,{className:`py-2 flex items-start gap-3`,children:[(0,B.jsxs)(`span`,{className:`shrink-0 mt-0.5 rounded-pill bg-primary-tint px-1.5 py-0.5 text-[11px] font-semibold text-primary tabular-nums`,children:[`+`,e.recoverable]}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-[12px] font-medium text-ink`,children:e.name}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted`,children:e.evidence}),e.remediation&&(0,B.jsx)(`p`,{className:`mt-0.5 text-[11px] text-ink-soft`,children:e.remediation})]})]},e.id))})]}),u.report_url&&(0,B.jsxs)(`a`,{href:u.report_url,target:`_blank`,rel:`noopener noreferrer`,className:`mt-4 inline-flex items-center gap-1 text-[12px] font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded-sm`,children:[V(`Full report`),(0,B.jsx)(L,{size:12,"aria-hidden":`true`})]})]})]})}var ta=e=>e?.status===`queued`||e?.status===`running`;function na(e,t){return V(`%1$d of %2$d left`).replace(`%1$d`,String(e)).replace(`%2$d`,String(t))}var ra=[{key:`lcp`,label:`LCP`,unit:`ms`,title:`Largest Contentful Paint — when the main content finished rendering`},{key:`fcp`,label:`FCP`,unit:`ms`,title:`First Contentful Paint — when the first text or image appeared`},{key:`tbt`,label:`TBT`,unit:`ms`,title:`Total Blocking Time — how long the page was unresponsive to input`},{key:`cls`,label:`CLS`,unit:`raw`,title:`Cumulative Layout Shift — how much the page moved while loading`},{key:`si`,label:`SI`,unit:`ms`,title:`Speed Index — how quickly the page visibly filled in`},{key:`ttfb`,label:`TTFB`,unit:`ms`,title:`Time to First Byte — how long the server took to respond`}];function ia(e,t,n){let r=n[e];return t==null||!r?`unknown`:t<=r.good?`good`:t<=r.poor?`needs-improvement`:`poor`}var aa={good:`bg-success`,"needs-improvement":`bg-warning`,poor:`bg-danger`,unknown:`bg-line-strong`};function oa(e,t){return e==null?`—`:t===`raw`?e.toFixed(3):`${Math.round(e)} ms`}function sa({runs:e}){let t=e.filter(e=>e.ok&&typeof e.score==`number`).slice(0,12).reverse().map(e=>e.score);if(t.length<2)return null;let n=t.map((e,n)=>`${n/(t.length-1)*120},${28-e/100*28}`).join(` `),r=t[0]??0,i=(t[t.length-1]??0)-r;return(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`svg`,{width:120,height:28,viewBox:`0 0 120 28`,"aria-hidden":`true`,className:`overflow-visible`,children:(0,B.jsx)(`polyline`,{points:n,fill:`none`,strokeWidth:`1.5`,className:i>=0?`stroke-success`:`stroke-danger`,strokeLinejoin:`round`,strokeLinecap:`round`})}),(0,B.jsxs)(`span`,{className:`text-[11px] tabular-nums ${i>0?`text-success`:i<0?`text-danger`:`text-muted`}`,title:V(`Change across the runs shown`),children:[i>0?`+`:``,i===0?V(`no change`):i]})]})}function ca(e){let t=Math.floor(Date.now()/1e3)-e;return t<60?V(`just now`):t<3600?`${Math.floor(t/60)}m ${V(`ago`)}`:t<86400?`${Math.floor(t/3600)}h ${V(`ago`)}`:`${Math.floor(t/86400)}d ${V(`ago`)}`}function la({module:e,onSaved:t,subtab:n,onSubtabChange:r}){let[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)([]),w=(0,y.useRef)(null),T=e.settings?.provider===`gtmetrix`&&typeof e.settings?.gtmetrix_api_key==`string`&&e.settings.gtmetrix_api_key!==``,E=p?.available===!0&&(p.quota?.remaining??0)>0,D=!T&&(p?.available===!0||(p?Ki(p.reason):!1)),O=(0,y.useCallback)(async()=>{try{a(await W.request(`/score/history`))}catch{a({runs:[],latest:null,thresholds:{}})}},[]);(0,y.useEffect)(()=>{O()},[O]);let k=(0,y.useCallback)(async()=>{try{let e=await W.request(`/score/hub-status`);m(e),g(e.runs?.[0]??null)}catch{m({available:!1})}},[]);(0,y.useEffect)(()=>{k()},[k]);let A=(0,y.useCallback)(async()=>{try{if(!(await W.request(`/score/status`)).pending){l(!1),await O();return}f.current=window.setTimeout(()=>void A(),6e3)}catch(e){l(!1),d(e instanceof Error?e.message:V(`Could not check the test status.`))}},[O]);(0,y.useEffect)(()=>()=>{f.current&&window.clearTimeout(f.current)},[]);let j=(0,y.useCallback)(async()=>{try{let e=await W.request(`/score/hub-status`);m(e);let t=e.runs?.[0]??null;if(g(t),ta(t)){w.current=window.setTimeout(()=>void j(),5e3);return}t?.status===`error`&&t.error&&d(t.error),await O()}catch{await O()}},[O]);(0,y.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current)},[]);let M=(0,y.useCallback)(async()=>{v(!0),d(null);try{let e=await W.request(`/score/hub-test`,{method:`POST`,body:JSON.stringify({})});g(e.run),m(t=>t&&{...t,quota:e.quota??t.quota}),w.current=window.setTimeout(()=>void j(),5e3)}catch(e){d(e instanceof Error?e.message:V(`The test could not be started.`))}finally{v(!1)}},[j]),ee=(0,y.useCallback)(()=>{if(p?.available){M();return}x(!0)},[p?.available,M]),N=async()=>{s(!0),d(null);try{let e=await W.request(`/score/run`,{method:`POST`,body:JSON.stringify({})});e.pending?(l(!0),f.current=window.setTimeout(()=>void A(),6e3)):(await O(),!e.ok&&e.error&&d(e.error))}catch(e){d(e instanceof Error?e.message:V(`The test could not be started.`))}finally{s(!1)}},P=i?.latest??null,te=i?.thresholds??{},ne=(n||`scan`)===`settings`?`test`:n||`scan`,F=r??(()=>{}),I={...e,schema:Object.fromEntries(Object.entries(e.schema).filter(([,e])=>!e.hidden))};return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(ir,{idBase:`score`,value:ne,onChange:F,items:[{key:`scan`,label:V(`xSpeed Scan`)},{key:`test`,label:V(`Speed test`)}]}),ne===`scan`&&(0,B.jsx)(ea,{}),(0,B.jsxs)(`div`,{className:ne===`test`?`border border-line bg-paper rounded-lg p-4 sm:p-5`:`hidden`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(_e,{size:18,className:`text-accent shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:V(`Performance score`)}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:P?`${P.provider===`gtmetrix`?`GTmetrix`:`PageSpeed Insights`} · ${ca(P.ts)}`:V(D?`Performance score and Core Web Vitals.`:`No audit run yet.`)})]})]}),D?(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[p?.quota&&(0,B.jsx)(`span`,{className:`text-[11px] text-muted`,title:V(`Free tests included with your plan`),children:na(p.quota.remaining,p.quota.limit)}),(0,B.jsxs)(`button`,{type:`button`,onClick:ee,disabled:_||ta(h)||p?.available===!0&&!E,title:p?.available&&(p.quota?.remaining??0)===0?V(`You have used this month’s free tests.`):V(`Run a GTmetrix test on this site`),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-50`,children:[(_||ta(h))&&(0,B.jsx)(R,{size:13,className:`animate-spin`}),ta(h)?V(`Testing…`):V(`Test with GTmetrix`)]})]}):(0,B.jsxs)(`button`,{type:`button`,onClick:N,disabled:o||c,title:V(`Nothing is sent anywhere until you press this.`),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-50`,children:[(o||c)&&(0,B.jsx)(R,{size:13,className:`animate-spin`}),V(c?`Running…`:`Test now`)]})]}),u&&(0,B.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 text-[12px] text-danger`,children:[(0,B.jsx)(gt,{size:13,className:`mt-0.5 shrink-0`}),(0,B.jsx)(`span`,{children:u})]}),P&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-lg border border-line p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Xi,{score:P.score,size:64}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[12px] font-medium text-ink`,children:V(`Performance`)}),(0,B.jsx)(`div`,{className:`text-[11px] text-muted`,children:P.strategy||V(`score out of 100`)})]})]}),(0,B.jsx)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-4 gap-y-2 sm:grid-cols-3`,children:ra.map(e=>{let t=P.metrics?.[e.key]??null,n=ia(e.key,t,te);return(0,B.jsxs)(`div`,{className:`min-w-0`,title:e.title,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${aa[n]}`}),(0,B.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-muted`,children:e.label})]}),(0,B.jsx)(`div`,{className:`mt-0.5 text-[14px] font-medium tabular-nums text-ink`,children:oa(t,e.unit)})]},e.key)})})]}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-line pt-3 text-[11px] text-muted`,children:[P.url&&(0,B.jsx)(`span`,{className:`truncate max-w-[22rem]`,children:P.url}),P.report_url&&(0,B.jsxs)(`a`,{href:P.report_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 hover:text-accent`,children:[V(`View on GTmetrix`),(0,B.jsx)(L,{size:11})]})]})]}),P?.opportunities&&P.opportunities.length>0&&(0,B.jsxs)(`div`,{className:`mt-4 border-t border-line pt-3`,children:[(0,B.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[12px] font-medium text-ink`,children:[(0,B.jsx)(Me,{size:13,className:`text-accent`}),V(`What to improve`)]}),(0,B.jsx)(`ul`,{className:`space-y-1`,children:P.opportunities.slice(0,6).map(e=>(0,B.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3 text-[12px] text-ink-soft`,children:[(0,B.jsx)(`span`,{className:`min-w-0`,children:e.title}),e.metrics.length>0&&(0,B.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-faint`,children:e.metrics.join(` · `)})]},e.id))})]}),P?.issues&&P.issues.length>0&&(0,B.jsx)(`ul`,{className:`mt-4 space-y-1`,children:P.issues.slice(0,3).map(e=>(0,B.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3 text-[12px] text-ink-soft`,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),(0,B.jsxs)(`span`,{className:`tabular-nums text-muted shrink-0`,children:[`−`,Math.round(e.savings_ms),` ms`]})]},e.id))})]}),ne===`test`&&i&&i.runs.length>1&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,B.jsx)(`div`,{className:`text-[12px] font-medium text-ink`,children:V(`Run history`)}),(0,B.jsx)(sa,{runs:i.runs})]}),S.length===2&&(()=>{let e=i.runs.find(e=>e.ts===S[0]),t=i.runs.find(e=>e.ts===S[1]);if(!e||!t)return null;let[n,r]=e.ts<=t.ts?[e,t]:[t,e],a=[[V(`Performance`),n.score,r.score,`score`],[`LCP`,n.metrics?.lcp??null,r.metrics?.lcp??null,`ms`],[`TBT`,n.metrics?.tbt??null,r.metrics?.tbt??null,`ms`],[`CLS`,n.metrics?.cls??null,r.metrics?.cls??null,`raw`],[`TTFB`,n.metrics?.ttfb??null,r.metrics?.ttfb??null,`ms`]];return(0,B.jsxs)(`div`,{className:`mb-3 rounded border border-line p-3`,children:[(0,B.jsxs)(`div`,{className:`mb-2 flex items-center justify-between text-[11px] text-muted`,children:[(0,B.jsxs)(`span`,{children:[ca(n.ts),` → `,ca(r.ts)]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>C([]),className:`text-accent hover:underline`,children:V(`Clear`)})]}),(0,B.jsxs)(`table`,{className:`w-full border-collapse text-left`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-wider text-faint`,children:[(0,B.jsx)(`th`,{scope:`col`,className:`py-1 font-medium`,children:V(`Metric`)}),(0,B.jsx)(`th`,{scope:`col`,className:`w-20 py-1 text-right font-medium`,children:V(`Before`)}),(0,B.jsx)(`th`,{scope:`col`,className:`w-20 py-1 text-right font-medium`,children:V(`After`)}),(0,B.jsx)(`th`,{scope:`col`,className:`w-24 py-1 text-right font-medium`,children:V(`Change`)})]})}),(0,B.jsx)(`tbody`,{children:a.map(([e,t,n,r])=>{let i=r===`score`,a=t!==null&&n!==null?n-t:null,o=a===null||a===0?null:i?a>0:a<0;return(0,B.jsxs)(`tr`,{className:`border-t border-line`,children:[(0,B.jsx)(`td`,{className:`py-1 text-[12px] text-muted`,children:e}),(0,B.jsx)(`td`,{className:`py-1 text-right text-[12px] tabular-nums text-muted`,children:r===`score`?t??`—`:oa(t,r===`raw`?`raw`:`ms`)}),(0,B.jsx)(`td`,{className:`py-1 text-right text-[12px] tabular-nums text-ink`,children:r===`score`?n??`—`:oa(n,r===`raw`?`raw`:`ms`)}),(0,B.jsxs)(`td`,{className:`py-1 text-right text-[12px] tabular-nums ${o===!0?`text-success`:o===!1?`text-danger`:`text-faint`}`,children:[a===null?`—`:a===0?V(`no change`):`${a>0?`+`:`−`}${r===`score`?Math.abs(a):oa(Math.abs(a),r===`raw`?`raw`:`ms`)}`,o===!0&&` ▲`,o===!1&&` ▼`]})]},e)})})]})]})})(),i.runs.length>1&&S.length<2&&(0,B.jsx)(`p`,{className:`mb-2 text-[11px] text-muted`,children:S.length===1?V(`Pick one more run to compare.`):V(`Pick two runs to compare them.`)}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full min-w-[34rem] border-collapse text-left`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`border-b border-line text-[10px] uppercase tracking-wider text-faint`,children:[(0,B.jsx)(`th`,{scope:`col`,className:`w-8 py-1.5 font-medium`,children:(0,B.jsx)(`span`,{className:`sr-only`,children:V(`Compare`)})}),(0,B.jsx)(`th`,{scope:`col`,className:`w-20 py-1.5 font-medium`,children:V(`When`)}),(0,B.jsx)(`th`,{scope:`col`,className:`py-1.5 font-medium`,children:V(`Provider`)}),(0,B.jsx)(`th`,{scope:`col`,className:`w-12 py-1.5 text-right font-medium`,children:V(`Score`)}),(0,B.jsx)(`th`,{scope:`col`,className:`w-20 py-1.5 text-right font-medium`,title:`Largest Contentful Paint`,children:`LCP`}),(0,B.jsx)(`th`,{scope:`col`,className:`w-16 py-1.5 text-right font-medium`,title:`Total Blocking Time`,children:`TBT`}),(0,B.jsx)(`th`,{scope:`col`,className:`w-14 py-1.5 text-right font-medium`,title:`Cumulative Layout Shift`,children:`CLS`}),(0,B.jsx)(`th`,{scope:`col`,className:`w-20 py-1.5 text-right font-medium`,title:`Time to First Byte`,children:`TTFB`})]})}),(0,B.jsx)(`tbody`,{children:i.runs.slice(0,10).map((e,t)=>(0,B.jsxs)(`tr`,{className:`border-b border-line last:border-b-0 ${S.includes(e.ts)?`bg-panel`:``}`,children:[(0,B.jsx)(`td`,{className:`py-1.5`,children:(0,B.jsx)(`button`,{type:`button`,onClick:()=>C(t=>t.includes(e.ts)?t.filter(t=>t!==e.ts):[...t,e.ts].slice(-2)),"aria-pressed":S.includes(e.ts),title:V(`Compare this run`),className:`rounded p-0.5 ${S.includes(e.ts)?`text-accent`:`text-faint hover:text-accent`}`,children:(0,B.jsx)(ye,{size:12})})}),(0,B.jsx)(`td`,{className:`py-1.5 text-[11px] text-muted`,children:ca(e.ts)}),(0,B.jsx)(`td`,{className:`min-w-0 py-1.5 text-[12px] text-muted`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:e.ok?e.provider===`gtmetrix`?`GTmetrix`:`PageSpeed`:e.error}),e.ok&&e.report_url&&(0,B.jsx)(`a`,{href:e.report_url,target:`_blank`,rel:`noopener noreferrer`,className:`shrink-0 text-faint hover:text-accent`,"aria-label":V(`Open the full report`),children:(0,B.jsx)(L,{size:11})})]})}),(0,B.jsx)(`td`,{className:`py-1.5 text-right text-[13px] font-medium tabular-nums ${Yi(e.score)}`,children:e.ok?e.score??`—`:`—`}),(0,B.jsx)(`td`,{className:`py-1.5 text-right text-[11px] tabular-nums text-muted`,children:oa(e.metrics?.lcp??null,`ms`)}),(0,B.jsx)(`td`,{className:`py-1.5 text-right text-[11px] tabular-nums text-muted`,children:oa(e.metrics?.tbt??null,`ms`)}),(0,B.jsx)(`td`,{className:`py-1.5 text-right text-[11px] tabular-nums text-muted`,children:oa(e.metrics?.cls??null,`raw`)}),(0,B.jsx)(`td`,{className:`py-1.5 text-right text-[11px] tabular-nums text-muted`,children:oa(e.metrics?.ttfb??null,`ms`)})]},`${e.ts}-${t}`))})]})})]}),(0,B.jsx)(qi,{open:b,onClose:()=>x(!1),local:p?.local===!0,onConnected:()=>{k().then(()=>void M())}}),ne===`test`&&(0,B.jsx)(Ma,{module:I,onSaved:t})]})}var ua={HealthPanel:Tr,PreloaderHost:Ur,DatabaseCleanerPanel:Gr,CloudflarePanel:Yr,ObjectCachePanel:$r,MigrationPanel:fi,SupportPanel:pi,McpPanel:vi,CompressionPanel:bi,CssJsPanel:Si,MediaPanel:wi,ResourceHintsPanel:Ei,CacheCoveragePanel:ji,ScorePanel:la};function da({module:e}){let t=Pt.find(t=>t.slug===e.slug),n=t?.teaser?ur[t.teaser]:null,r=tn()===`unlicensed`;if(mr(e.slug))return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(hr,{id:e.slug}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted text-center px-4`,children:V(r?`Activating your license unlocks this module + every other locked row in the sidebar. Your current settings stay unchanged.`:`Pro unlocks this module + every other locked row in the sidebar. Your current Free settings stay unchanged.`)})]});let i={card:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-on-tint bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`,link:`text-primary`};return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`relative overflow-hidden border rounded-card p-6 sm:p-8 ${i.card}`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,B.jsx)(`div`,{className:`shrink-0 w-12 h-12 rounded-full border flex items-center justify-center ${i.iconWrap}`,children:(0,B.jsx)(Ot,{name:e.icon,size:22})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-2 mb-1`,children:(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-2 py-0.5 ${i.badge}`,children:[r?(0,B.jsx)(Oe,{size:10}):(0,B.jsx)(Pe,{size:10}),(0,B.jsx)(`span`,{children:V(r?`Pro — license needed`:`Pro feature`)})]})}),(0,B.jsx)(`h2`,{className:`text-[18px] font-semibold text-ink`,children:e.label}),e.description&&(0,B.jsx)(`p`,{className:`text-[13px] text-ink-soft mt-2 leading-relaxed`,children:e.description}),r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`text-[13px] text-ink-soft mt-3 leading-relaxed`,children:V(`xSpeed Pro is installed — activate your license to unlock this module and every other Pro feature.`)}),(0,B.jsxs)(`a`,{href:lr,className:`inline-flex items-center gap-1.5 mt-4 px-4 py-2 rounded-md text-[13px] font-medium transition-colors ${i.cta}`,children:[V(`Activate your license`),(0,B.jsx)(w,{size:13})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-4 px-4 py-2 rounded-md text-[13px] font-medium transition-colors ${i.cta}`,children:[V(`Upgrade to Pro`),(0,B.jsx)(w,{size:13})]}),(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 ml-3 text-[12px] hover:underline ${i.link}`,children:[V(`Compare plans`),(0,B.jsx)(L,{size:11})]})]})]})]})}),n&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted font-medium mb-2`,children:V(`What this adds`)}),(0,B.jsx)(`p`,{className:`text-[13px] text-ink-soft leading-relaxed`,children:n.body})]}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted text-center px-4`,children:V(r?`Activating your license unlocks this module + every other locked row in the sidebar. Your current settings stay unchanged.`:`Pro unlocks this module + every other locked row in the sidebar. Your current Free settings stay unchanged.`)})]})}var fa=null,pa=new Set;function ma(){for(let e of pa)e(fa)}function ha(e){fa=e,ma()}function ga(){return fa}function _a(e,t){e&&t&&(fa?.module!==e||fa?.field!==t)||(fa=null,ma())}function va(e){return pa.add(e),()=>{pa.delete(e)}}function ya(e,t){switch(t){case`bool`:case`boolean`:return e===`1`||e===`true`?!0:e===`0`||e===`false`?!1:void 0;case`int`:return/^-?\d+$/.test(e.trim())?parseInt(e,10):void 0;case`list`:return e.split(`,`).map(e=>e.trim()).filter(Boolean);default:return e}}function ba(e,t){let n=ya(e,t);return n===void 0?e:typeof n==`boolean`?n?`On`:`Off`:Array.isArray(n)?n.join(`, `):String(n)}function J(e,t,n,r,i){let[a,o]=(0,y.useState)(()=>ga());if((0,y.useEffect)(()=>va(o),[]),!a||a.module!==e||a.field!==t)return null;let s=ya(a.value,n.type);if(s===void 0||!xa(s,n)||JSON.stringify(s)===JSON.stringify(r))return null;let c=ba(a.value,n.type);return c.trim()===``?null:{display:c,value:s,apply:()=>{i(s),_a(e,t)},dismiss:()=>_a(e,t)}}function xa(e,t){if(t.type===`int`)return!(typeof e!=`number`||t.min!==void 0&&e<t.min||t.max!==void 0&&e>t.max);if(t.type===`enum`){let n=Array.isArray(t.options)?t.options:[];return n.length>0&&n.includes(String(e))}if(t.type===`list`)return Array.isArray(e)&&e.length>0;if(t.type===`url`){let t=String(e??``).trim();return t!==``&&/^https?:\/\//i.test(t)}return!0}function Sa({strip:e}){return(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 rounded border border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 px-2.5 py-1.5`,children:[(0,B.jsx)(Me,{size:13,className:`text-amber-600 dark:text-amber-400 shrink-0`}),(0,B.jsxs)(`span`,{className:`text-[12px] text-amber-900 dark:text-amber-200`,children:[V(`Recommended:`),` `,(0,B.jsx)(`span`,{className:`font-medium`,children:e.display})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:e.apply,className:`ml-auto inline-flex items-center gap-1 text-[12px] px-2 py-1 rounded bg-accent text-white hover:bg-primary-hover transition-colors`,children:[(0,B.jsx)(M,{size:12}),V(`Apply`)]}),(0,B.jsx)(`button`,{type:`button`,onClick:e.dismiss,className:`text-[12px] text-amber-800 dark:text-amber-300 hover:underline`,children:V(`Dismiss`)})]})}function Ca(e){return typeof e==`string`&&e.includes(`••••`)}function wa({value:e,onChange:t,label:n,inputClassName:r,readOnly:i=!1}){let a=Ca(e),o=(0,y.useRef)(a?e:``);a&&o.current!==e&&(o.current=e);let s=a?``:String(e??``),c=o.current!==``;return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`input`,{type:`password`,value:s,onChange:e=>{let n=e.target.value;t(n===``?o.current:n)},disabled:i,autoComplete:`off`,spellCheck:!1,placeholder:i?V(`Set in wp-config.php`):a?String(e):n,title:i?V(`This credential is defined in wp-config.php and cannot be changed here.`):c?V(`A key is saved. Type to replace it; use ✕ to remove it.`):void 0,className:`${r??`w-56 rounded-control border border-line bg-paper px-2.5 py-1.5 text-[13px] text-ink focus:outline-none focus:ring-2 focus:ring-primary`}${i?` opacity-60 cursor-not-allowed`:``}`,"aria-label":n}),c&&a&&!i&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{o.current=``,t(``)},className:`shrink-0 p-1.5 rounded border border-line text-ink-soft hover:text-danger hover:border-danger transition-colors`,title:V(`Remove the saved key`),"aria-label":`${V(`Remove`)} ${n}`,children:(0,B.jsx)(xt,{size:13})})]})}var Ta={ms:1/1e3,seconds:1,minutes:60,hours:3600,days:86400},Ea=[{seconds:604800,one:`week`,many:`weeks`},{seconds:86400,one:`day`,many:`days`},{seconds:3600,one:`hour`,many:`hours`},{seconds:60,one:`minute`,many:`minutes`},{seconds:1,one:`second`,many:`seconds`}],Da=3;function Oa(e,t){if(!Number.isFinite(e)||e<=0)return``;let n=Math.floor(e*Ta[t]);if(n<1||t===`seconds`&&n<60)return``;let r=[],i=n;for(let e of Ea){if(r.length>=Da)break;let t=Math.floor(i/e.seconds);t<=0||(r.push(`${t} ${t===1?e.one:e.many}`),i-=t*e.seconds)}return r.join(` `)}function ka(e,t){return Oa(e,t)}function Aa({notices:e}){return!e||e.length===0?null:(0,B.jsx)(B.Fragment,{children:e.map((e,t)=>(0,B.jsx)(Rn,{tone:e.tone,title:e.title,body:e.body,snippet:e.snippet,action:e.action},t))})}function ja({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){if(qt(),e.locked)return(0,B.jsx)(da,{module:e});if(e.custom_panel){let a={onSaved:t,subtab:n,onSubtabChange:r,getModule:i},o=ua[e.custom_panel]??Gt(e.custom_panel);if(o)return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(Aa,{notices:e.notices}),(0,B.jsx)(o,{module:e,...a})]})}return(0,B.jsx)(Ma,{module:e,onSaved:t})}function Ma({module:e,onSaved:t,hoistedNotices:n=!1}){let[r,i]=(0,y.useState)(e.settings),[a,o]=(0,y.useState)(`idle`),[s,c]=(0,y.useState)(null),l=(0,y.useRef)(!0),u=(0,y.useRef)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(JSON.stringify(e.settings)),p=(0,y.useRef)(`idle`);(0,y.useEffect)(()=>{p.current=a},[a]);let m=(0,y.useRef)(r);(0,y.useEffect)(()=>{m.current=r},[r]),(0,y.useEffect)(()=>{i(e.settings),f.current=JSON.stringify(e.settings),l.current=!0,o(`idle`),c(null)},[e.slug]),(0,y.useEffect)(()=>{if(l.current){l.current=!1;return}if(JSON.stringify(r)!==f.current)return u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(async()=>{p.current!==`saved`&&o(`saving`),c(null);let n=r;try{let r=await W.updateModuleSettings(e.slug,n),{next:a,dirty:s}=Ar(n,r,m.current);i(a),f.current=s?``:JSON.stringify(a),o(`saved`),d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>o(`idle`),Dr),t?.(r)}catch(e){c(e instanceof Error?e.message:`Save failed`),o(`failed`),d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>o(`idle`),Or)}},600),()=>{u.current&&window.clearTimeout(u.current)}},[r,e.slug]);let h=Pr(e.schema,r),g=(e,t)=>i(n=>({...n,[e]:t})),[_,v]=(0,y.useState)(e.setting_origins??{}),[b,x]=(0,y.useState)(null);(0,y.useEffect)(()=>{v(e.setting_origins??{})},[e.setting_origins]);let S=async(t,n)=>{x(t);try{let r=await W.request(`/${e.slug}/override`,{method:`POST`,body:JSON.stringify({field:t,override:n})});v(r.origins??{}),r.settings&&i(e=>{let n=r.settings[t];if(n===void 0||Object.is(n,e[t]))return e;let i={...e,[t]:n};return JSON.stringify(e)===f.current&&(f.current=JSON.stringify(i)),i}),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{x(null)}};return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(Er,{state:a}),!n&&(0,B.jsx)(Aa,{notices:e.notices}),(0,B.jsx)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:h.map(([t,n],i)=>(0,B.jsx)(Na,{moduleSlug:e.slug,fieldKey:t,spec:n,value:r[t],onChange:e=>g(t,e),origin:_[t],overrideBusy:b===t,onSetOverride:e=>S(t,e),first:i===0},t))}),s&&(0,B.jsx)(`div`,{className:`text-[12px] text-danger`,children:s})]})}function Na({moduleSlug:e,fieldKey:t,spec:n,value:r,onChange:i,origin:a,overrideBusy:o,onSetOverride:s,first:c}){let l=n.label??La(t),u=a?.source===`constant`?a.constant:null,d=a?.overriding??null,[f,p]=(0,y.useState)(!1),m=`${e}:${t}`,h=J(e,t,n,r,i),g=n.description,_=n.type===`int`&&(n.min!==void 0||n.max!==void 0)?`Range: ${n.min??`-∞`} – ${n.max??`∞`}`:null,v=n.type===`list`,b=c?``:`border-t border-line`;return v?(0,B.jsxs)(`div`,{"data-field-anchor":m,className:`xspeed-field px-4 sm:px-5 py-4 ${b}`,children:[(0,B.jsxs)(`div`,{className:`mb-1.5`,children:[(0,B.jsxs)(`div`,{className:`font-medium text-ink inline-flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{children:l}),n.info&&(0,B.jsx)(vn,{title:n.info_title,body:n.info})]}),(0,B.jsx)(Pa,{spec:n})]}),Ia(n,r,i,l,!!u),(u||d)&&(0,B.jsx)(Vn,{constant:u??d,overridden:!u,busy:o,onOverride:s?()=>p(!0):void 0,onRevert:s?()=>s(!1):void 0}),f&&u&&(0,B.jsx)(`div`,{className:`mt-2`,children:(0,B.jsx)(Wn,{constant:u,busy:o,onConfirm:()=>{p(!1),s?.(!0)},onCancel:()=>p(!1)})}),!u&&h&&(0,B.jsx)(Sa,{strip:h})]}):(0,B.jsxs)(`div`,{"data-field-anchor":m,className:`xspeed-field px-4 sm:px-5 py-4 ${b}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 sm:gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 max-w-[70%] pr-2`,children:[(0,B.jsxs)(`div`,{className:`font-medium text-ink inline-flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{children:l}),n.info&&(0,B.jsx)(vn,{title:n.info_title,body:n.info})]}),(0,B.jsx)(Pa,{spec:n}),!g&&_&&(0,B.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:_}),(u||d)&&(0,B.jsx)(Vn,{constant:u??d,overridden:!u,busy:o,onOverride:s?()=>p(!0):void 0,onRevert:s?()=>s(!1):void 0})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:Ia(n,r,i,l,!!u)})]}),f&&u&&(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Wn,{constant:u,busy:o,onConfirm:()=>{p(!1),s?.(!0)},onCancel:()=>p(!1)})}),!u&&h&&(0,B.jsx)(Sa,{strip:h})]})}function Pa({spec:e}){return!e.description&&!e.doc_url?null:(0,B.jsxs)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:[e.description,e.doc_url&&(0,B.jsxs)(B.Fragment,{children:[e.description?` `:``,(0,B.jsx)(`a`,{href:e.doc_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent hover:underline`,children:`Check the documentation`})]})]})}function Fa({value:e,label:t,onChange:n,defaultValue:r}){let i=Array.isArray(e)?e.map(String):[],[a,o]=(0,y.useState)(null),s=Array.isArray(r)?r.map(String):[],c=s.join(` |
| 12 |
`),l=i.length===s.length&&i.every((e,t)=>e===s[t]),u=a??i.join(` |
| 13 |
`),d=(0,y.useRef)(!1),f=e=>{let t=e.split(` |
| 14 |
`).map(e=>e.trim());(t.length!==i.length||t.some((e,t)=>e!==i[t]))&&n(t)},p=e=>{let t=e.split(` |
| 15 |
`).map(e=>e.trim()).filter(Boolean),r=Array.from(new Set(t));o(null),(r.length!==i.length||r.some((e,t)=>e!==i[t]))&&n(r)},m=(0,B.jsx)(`textarea`,{value:u,rows:8,onCompositionStart:()=>{d.current=!0},onCompositionEnd:e=>{d.current=!1,f(e.currentTarget.value)},onChange:e=>{let t=e.target.value;o(t),d.current||f(t)},onBlur:e=>p(e.target.value),className:`w-full rounded-control border border-line bg-paper px-3 py-2 font-mono text-[12px] text-ink focus:outline-none focus:ring-2 focus:ring-primary`,"aria-label":t});if(r===void 0)return m;let h=`reset-${t.replace(/\W+/g,`-`).toLowerCase()}`;return(0,B.jsx)(`div`,{className:`space-y-1.5`,children:(0,B.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-1 flex min-h-[22px] items-center justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`text-[11.5px] font-medium text-muted`,children:`Current value:`}),(0,B.jsxs)(`button`,{type:`button`,id:h,onClick:()=>{o(null),n([...s])},disabled:l,className:`inline-flex items-center gap-1 rounded-control border border-line px-2 py-0.5 text-[11.5px] text-ink-soft transition-colors hover:bg-panel disabled:cursor-default disabled:opacity-40`,title:l?`This field already matches its default`:`Replace this list with the default`,children:[(0,B.jsx)(Ye,{size:11,"aria-hidden":`true`}),`Reset`]})]}),m]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`mb-1 flex min-h-[22px] items-center gap-2`,children:(0,B.jsx)(`span`,{className:`text-[11.5px] font-medium text-muted`,children:`Default value:`})}),s.length>0?(0,B.jsx)(`textarea`,{value:c,rows:8,readOnly:!0,tabIndex:-1,"aria-label":`${t} — default value`,className:`w-full cursor-default resize-none rounded-control border border-line bg-panel px-3 py-2 font-mono text-[12px] text-muted focus:outline-none`}):(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(`textarea`,{rows:8,readOnly:!0,tabIndex:-1,"aria-hidden":`true`,className:`w-full resize-none rounded-control border border-dashed border-line bg-panel px-3 py-2 font-mono text-[12px] focus:outline-none`}),(0,B.jsx)(`span`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center px-3 text-center text-[11.5px] text-faint`,children:`No defaults — empty by design.`})]})]})]})})}function Ia(e,t,n,r,i=!1){switch(e.type){case`bool`:return(0,B.jsx)(ln,{checked:!!t,onChange:e=>n(e),label:r,disabled:i});case`int`:{let a=e.unit?ka(Number(t),e.unit):``;return(0,B.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,B.jsx)(`input`,{type:`number`,value:t==null?``:Number(t),min:e.min,max:e.max,onChange:e=>n(Number(e.target.value)),disabled:i,className:`w-24 shrink-0 text-right rounded-control border border-line bg-paper px-2.5 py-1.5 text-[13px] text-ink focus:outline-none focus:ring-2 focus:ring-primary ${i?`opacity-60 cursor-not-allowed`:``}`,"aria-label":r}),e.unit&&(0,B.jsx)(`span`,{"aria-live":`polite`,className:`mt-1 block h-4 text-right text-[11.5px] leading-4 text-muted`,children:a})]})}case`enum`:return(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let a=t===r,o=e.option_labels?.[r]??La(r);return(0,B.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:i,className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${a?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`} ${i?`opacity-60 cursor-not-allowed`:``}`,children:o},r)})});case`string`:case`url`:return(0,B.jsx)(`input`,{type:e.type===`url`?`url`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),disabled:i,className:`w-56 rounded-control border border-line bg-paper px-2.5 py-1.5 text-[13px] text-ink focus:outline-none focus:ring-2 focus:ring-primary ${i?`opacity-60 cursor-not-allowed`:``}`,"aria-label":r});case`secret`:return(0,B.jsx)(wa,{value:t,onChange:n,label:r,readOnly:i});case`media`:return(0,B.jsx)(Bn,{value:t==null?``:String(t),onChange:e=>n(e),label:r});case`list`:return(0,B.jsx)(Fa,{value:t,label:r,onChange:n,defaultValue:e.default});default:return null}}function La(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Ra({probe:e,onOpenHealth:t}){let n=!!e&&!e.active&&!e.pending&&!e.inconclusive,r=e?.snippet?`xspeed:rewrite_alert:${za(e.snippet)}`:`xspeed:rewrite_alert:apache`,[i,a]=(0,y.useState)(!1);if((0,y.useEffect)(()=>{if(n)try{a(window.localStorage.getItem(r)===`1`)}catch{a(!1)}},[n,r]),!n||i)return null;let o=()=>{try{window.localStorage.setItem(r,`1`)}catch{}a(!0)},s=e.topology??(e.server_type===`nginx`?`nginx-host`:`htaccess`),c=s===`nginx-container`&&e.behind_proxy===!0,l,u;if(c)l=V(`Static rewrite may not be available on this host`),u=V(`Your cache still works on every request — xSpeed's PHP drop-in is serving cached HTML, so nothing is broken. But this site sits behind a reverse proxy or CDN, which usually means a managed/containerized host where the nginx that serves requests isn't one you can edit. The extra-fast server-level rewrite (5–15ms static hits) needs that nginx, so it likely can't be enabled here — and that's also why the cache HIT log stays empty (nginx never serves the static file, so there's nothing to log). If you DO control the request-terminating nginx, use the snippet in the "Server config" panel below.`);else switch(s){case`nginx-host`:l=V(`nginx detected — configure for max cache speed`),u=V(`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. To shave additional latency, copy the snippet from the "Server config" panel below into your nginx vhost (typically /etc/nginx/sites-enabled/<your-site>) and reload nginx so cached pages skip PHP entirely.`);break;case`nginx-container`:l=V(`Containerized nginx detected — paste into your container config`),u=V(`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. For the full server-level rewrite, copy the snippet from the "Server config" panel below into your container's nginx config (typically docker/nginx.conf next to your docker-compose.yml). The host nginx in front of your container only proxies traffic; pasting there has no effect.`);break;default:l=V(`Server config missing — cache running on PHP fallback`),u=V(`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. To engage the faster server-level rewrite, toggle Cache off and on to reinstall the .htaccess block, and confirm AllowOverride is enabled for your site.`)}return(0,B.jsxs)(`div`,{className:`border border-amber-300 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/30 rounded-lg p-4 sm:p-5 relative`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:o,"aria-label":V(`Dismiss banner`),className:`absolute top-2 right-2 p-1 rounded text-amber-700/70 hover:text-amber-900 dark:text-amber-300/70 dark:hover:text-amber-100 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:(0,B.jsx)(xt,{size:14})}),(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-6`,children:[(0,B.jsx)(St,{size:16,className:`shrink-0 mt-0.5 text-amber-600 dark:text-amber-400`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`font-medium text-amber-900 dark:text-amber-100 text-[13px]`,children:l}),(0,B.jsx)(`p`,{className:`text-[12px] text-amber-800/90 dark:text-amber-200/80 mt-1`,children:u}),(0,B.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,B.jsx)(`button`,{type:`button`,onClick:t,className:`text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300`,children:`View in Health →`})})]})]})]})}function za(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)}function Ba({mobile:e,onOpenCacheSettings:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null);if(!(e&&(e.blocking||e.needs_review))||n)return null;let c=!e.blocking&&e.needs_review;return(0,B.jsxs)(`div`,{className:`border border-amber-300 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/30 rounded-lg p-4 sm:p-5 relative`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:async()=>{r(!0);try{await W.dismissMobileReview()}catch{}},"aria-label":V(`Dismiss banner`),className:`absolute top-2 right-2 p-1 rounded text-amber-700/70 hover:text-amber-900 dark:text-amber-300/70 dark:hover:text-amber-100 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:(0,B.jsx)(xt,{size:14})}),(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-6`,children:[(0,B.jsx)(st,{size:16,className:`shrink-0 mt-0.5 text-amber-600 dark:text-amber-400`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`font-medium text-amber-900 dark:text-amber-100 text-[13px]`,children:c?`Separate Mobile Cache was left off after import`:`Separate Mobile Cache is disabling faster static serving`}),(0,B.jsx)(`p`,{className:`text-[12px] text-amber-800/90 dark:text-amber-200/80 mt-1`,children:c?(0,B.jsxs)(B.Fragment,{children:[`Your previous plugin had Separate Mobile Cache on, but xSpeed kept it `,(0,B.jsx)(`strong`,{children:`off`}),` so it can use the device-blind server-level rewrite (5–15ms static hits) instead of the slower PHP path (~85ms). Most sites serve the same HTML to every device and don’t need it. Only turn it on if your site serves device-specific pages — not sure? Check whether your desktop and mobile pages actually differ.`]}):(0,B.jsx)(B.Fragment,{children:`Separate Mobile Cache is on, so xSpeed can’t use the device-blind server-level rewrite (5–15ms static hits) and falls back to the slower PHP path (~85ms). If your site serves the same HTML to every device, turn it off for much faster cache hits. Not sure? Check whether your desktop and mobile pages actually differ.`})}),o&&o.checked&&(0,B.jsx)(`div`,{className:`mt-2.5 text-[12px] rounded-md px-2.5 py-2 `+(o.identical?`bg-emerald-100/70 dark:bg-emerald-950/40 text-emerald-900 dark:text-emerald-200`:`bg-amber-100/70 dark:bg-amber-900/40 text-amber-900 dark:text-amber-100`),children:o.identical?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(M,{size:13,className:`shrink-0`}),c?`Desktop and mobile HTML are identical — leaving Separate Mobile Cache off is correct; nothing to change.`:`Desktop and mobile HTML are identical — you can safely turn Separate Mobile Cache off to regain the fast static path.`]}):(0,B.jsxs)(B.Fragment,{children:[`Desktop and mobile HTML differ`,o.desktop_bytes&&o.mobile_bytes?` (${o.desktop_bytes.toLocaleString()} vs ${o.mobile_bytes.toLocaleString()} bytes)`:``,` `,`— your site serves device-specific pages, so`,` `,c?`you should turn Separate Mobile Cache on.`:`keeping Separate Mobile Cache on is correct.`]})}),o&&!o.checked&&(0,B.jsxs)(`div`,{className:`mt-2.5 text-[12px] text-amber-800/80 dark:text-amber-200/70`,children:[`Couldn’t complete the check`,o.reason?` (${o.reason})`:``,`. Try again shortly.`]}),(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{a(!0);try{s(await W.mobileEqualityProbe())}catch{s({identical:!1,checked:!1,reason:`probe failed`})}finally{a(!1)}},disabled:i,className:`inline-flex items-center gap-1.5 text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300 disabled:opacity-60 disabled:no-underline`,children:[i&&(0,B.jsx)(Ne,{size:12,className:`animate-spin`}),i?`Checking…`:`Check now`]}),(0,B.jsx)(`button`,{type:`button`,onClick:t,className:`text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300`,children:`Open Cache settings →`})]})]})]})]})}var Va=`xspeed:nginx_server_block:expanded`,Ha=`cache:nginx_snippet`;function Ua({snippet:e,topology:t,focus:n}){let[r,i]=(0,y.useState)(()=>{try{return window.localStorage.getItem(Va)===`1`}catch{return!1}});(0,y.useEffect)(()=>{n===`cache:nginx_snippet`&&i(!0)},[n]);let a=()=>{i(e=>{let t=!e;try{window.localStorage.setItem(Va,t?`1`:`0`)}catch{}return t})};if(!e)return null;let o=t===`nginx-container`?`your container's nginx config (typically docker/nginx.conf next to your docker-compose.yml)`:`your nginx vhost (typically /etc/nginx/sites-enabled/<your-site>)`,s=e.split(` |
| 16 |
`).length;return(0,B.jsxs)(`section`,{"data-field-anchor":Ha,className:`xspeed-field border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 p-4 sm:p-5`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:a,"aria-expanded":r?`true`:`false`,"aria-label":r?`Collapse server config`:`Expand server config`,className:`shrink-0 mt-0.5 rounded text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1`,children:r?(0,B.jsx)(ee,{size:16}):(0,B.jsx)(P,{size:16})}),(0,B.jsx)(tt,{size:16,className:`shrink-0 mt-0.5 text-neutral-500 dark:text-neutral-400`}),(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,B.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5 text-[13px] font-semibold text-neutral-900 dark:text-neutral-50`,children:[(0,B.jsxs)(`span`,{children:[`Server config `,(0,B.jsxs)(`span`,{className:`text-neutral-400 dark:text-neutral-500 font-normal`,children:[`· `,s,` lines`]})]}),(0,B.jsx)(vn,{title:`Good to know`,body:`You added this snippet to your nginx config yourself, so it's yours to manage — xSpeed never touches it. If you ever need to uninstall xSpeed, just remove this snippet from your nginx config first to keep everything tidy and your server running happily.`})]}),(0,B.jsxs)(`p`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:[`Paste this once into `,o,`, above the `,(0,B.jsx)(`code`,{className:`text-[11px]`,children:`location /`}),` block, then reload nginx.`]})]})]}),r&&(0,B.jsx)(`div`,{className:`px-4 pb-4 sm:px-5 sm:pb-5`,children:(0,B.jsx)(qn,{content:e,tone:`neutral`})})]})}function Wa({label:e,value:t,icon:n,onClick:r,expanded:i,hint:a}){let o=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:e}),r?(0,B.jsx)(ee,{size:14,className:`text-neutral-400 dark:text-neutral-500 transition-transform ${i?`rotate-180`:``}`}):n&&(0,B.jsx)(n,{size:14,className:`text-neutral-400 dark:text-neutral-500`})]}),(0,B.jsx)(`div`,{className:`text-[22px] font-semibold text-neutral-900 dark:text-neutral-50 leading-none`,children:t})]}),s=`border bg-white dark:bg-neutral-900 rounded-lg p-5 text-left w-full transition-colors`;return r?(0,B.jsx)(`button`,{type:`button`,onClick:r,"aria-expanded":i??!1,"aria-label":a?`${e} — ${a}`:e,className:`${s} cursor-pointer hover:border-neutral-300 dark:hover:border-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${i?`border-accent dark:border-accent`:`border-neutral-200 dark:border-neutral-800`}`,children:o}):(0,B.jsx)(`div`,{className:`${s} border-neutral-200 dark:border-neutral-800`,children:o})}var Ga={events:[],last_purge:0,last_gc:0,gc_removed:0,gc_removed_total:0,gc_next_run:0};function Ka(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function qa({title:e,busy:t,onRefresh:n,children:r}){return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,B.jsx)(`div`,{className:`text-[12px] font-medium text-neutral-900 dark:text-neutral-50`,children:e}),(0,B.jsx)(`button`,{type:`button`,onClick:n,disabled:t,"aria-label":V(`Refresh`),className:`text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300 disabled:opacity-40`,children:(0,B.jsx)(R,{size:13,className:t?`animate-spin`:``})})]}),r]})}function Ja({text:e}){return(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 py-2`,children:e})}function Ya(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async(e=!1)=>{r(!0);try{t(await W.request(`/cache/inventory?limit=50${e?`&fresh=1`:``}`))}catch{t({entries:[],total:0,capped:!1})}finally{r(!1)}};return(0,y.useEffect)(()=>{i()},[]),(0,B.jsx)(qa,{title:V(`Cached pages`),busy:n,onRefresh:()=>void i(!0),children:e?e.entries.length===0?(0,B.jsx)(Ja,{text:V(`Nothing cached yet. Visit a page as a logged-out visitor to warm the cache.`)}):(0,B.jsxs)(B.Fragment,{children:[e.capped&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2 mb-3 text-[11px] text-amber-700 dark:text-amber-400`,children:[(0,B.jsx)(gt,{size:12,className:`mt-0.5 shrink-0`}),(0,B.jsx)(`span`,{children:V(`This cache is large enough that the scan stopped early — the list below is a recent sample, not every page.`)})]}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400`,children:[(0,B.jsx)(`th`,{className:`text-left font-medium pb-2`,children:V(`Page`)}),(0,B.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:V(`Size`)}),(0,B.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:V(`Age`)}),(0,B.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:V(`Stored`)})]})}),(0,B.jsx)(`tbody`,{children:e.entries.map(e=>(0,B.jsxs)(`tr`,{className:`border-t border-neutral-100 dark:border-neutral-800`,children:[(0,B.jsx)(`td`,{className:`py-1.5 pr-3 max-w-0`,children:e.url?(0,B.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-neutral-800 dark:text-neutral-200 hover:underline inline-flex items-center gap-1 truncate max-w-full`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:e.url}),(0,B.jsx)(L,{size:10,className:`shrink-0 opacity-60`})]}):(0,B.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400 font-mono text-[11px]`,title:e.key,children:V(`Address not recorded`)})}),(0,B.jsx)(`td`,{className:`py-1.5 text-right tabular-nums text-neutral-600 dark:text-neutral-400 whitespace-nowrap`,children:jn(e.bytes)}),(0,B.jsx)(`td`,{className:`py-1.5 pl-3 text-right tabular-nums text-neutral-600 dark:text-neutral-400 whitespace-nowrap`,children:Ka(e.age)}),(0,B.jsx)(`td`,{className:`py-1.5 pl-3 text-right text-[11px] text-neutral-500 dark:text-neutral-400 whitespace-nowrap`,children:e.stored_in.join(` + `)})]},e.url??e.key))})]})}),(0,B.jsxs)(`div`,{className:`mt-2 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[V(`Showing`),` `,e.entries.length,` `,V(`of`),` `,e.total]})]}):(0,B.jsx)(Ja,{text:V(`Loading…`)})})}function Xa(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async()=>{r(!0);try{t(await W.request(`/cache/size`))}catch{t(null)}finally{r(!1)}};(0,y.useEffect)(()=>{i()},[]);let a=e?.buckets.filter(e=>e.files>0)??[],o=a.reduce((e,t)=>Math.max(e,t.bytes),0);return(0,B.jsx)(qa,{title:V(`Where the cache size goes`),busy:n,onRefresh:()=>void i(),children:e?a.length===0?(0,B.jsx)(Ja,{text:V(`Nothing on disk yet.`)}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`space-y-2`,children:a.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-baseline justify-between text-[12px]`,children:[(0,B.jsx)(`span`,{className:`text-neutral-700 dark:text-neutral-300`,children:e.label}),(0,B.jsxs)(`span`,{className:`tabular-nums text-neutral-600 dark:text-neutral-400`,children:[jn(e.bytes),(0,B.jsxs)(`span`,{className:`text-neutral-400 dark:text-neutral-500`,children:[` · `,e.files]})]})]}),(0,B.jsx)(`div`,{className:`mt-1 h-1.5 rounded-full bg-neutral-100 dark:bg-neutral-800 overflow-hidden`,children:(0,B.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:o>0?`${Math.max(2,e.bytes/o*100)}%`:`0%`}})})]},e.key))}),e.compressed_bytes>0&&(0,B.jsxs)(`div`,{className:`mt-3 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[V(`Precompressed copies on disk:`),` `,jn(e.compressed_bytes),`.`,` `,V(`Pages without one are compressed by the server when requested.`)]})]}):(0,B.jsx)(Ja,{text:V(`Loading…`)})})}function Za(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async()=>{r(!0);try{t(await W.request(`/cache/purge-log?limit=25`))}catch{t(Ga)}finally{r(!1)}};(0,y.useEffect)(()=>{i()},[]);let a=Math.floor(Date.now()/1e3),o=e?e.last_gc>0?Nt(V(`Automatic cleanup ran %1$s ago — %2$d file(s) removed, %3$d in total.`),Ka(Math.max(0,a-e.last_gc)),e.gc_removed,e.gc_removed_total):e.gc_next_run>0?Nt(V(`Automatic cleanup has not run yet — first sweep in %s.`),Ka(Math.max(0,e.gc_next_run-a))):null:null;return(0,B.jsxs)(qa,{title:V(`Purge history`),busy:n,onRefresh:()=>void i(),children:[o&&(0,B.jsx)(`p`,{className:`text-[11px] text-neutral-500 dark:text-neutral-400 mb-2`,children:o}),e?e.events.length===0?(0,B.jsx)(Ja,{text:V(`No purges recorded yet.`)}):(0,B.jsx)(`ul`,{className:`space-y-1.5`,children:e.events.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex items-baseline gap-3 text-[12px] border-t border-neutral-100 dark:border-neutral-800 first:border-t-0 pt-1.5 first:pt-0`,children:[(0,B.jsx)(`span`,{className:`tabular-nums text-[11px] text-neutral-500 dark:text-neutral-400 w-12 shrink-0`,children:Ka(Math.max(0,a-e.ts))}),(0,B.jsx)(`span`,{className:`text-neutral-700 dark:text-neutral-300`,children:e.message})]},`${e.ts}-${t}`))}):(0,B.jsx)(Ja,{text:V(`Loading…`)})]})}function Qa({which:e}){return e===`pages`?(0,B.jsx)(Ya,{}):e===`size`?(0,B.jsx)(Xa,{}):e===`purge`?(0,B.jsx)(Za,{}):null}function $a(e){return(e.hits_24h??0)+(e.misses_24h??0)===0?`—`:`${Math.round((e.hit_ratio??0)*100)}%`}function eo(e){if(!e)return`Never`;let t=Math.floor(Date.now()/1e3)-e;return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function to({settings:e,stats:t,onToggle:n,onPurge:r,dropin:i=null}){let[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),l=un(i),u=e=>{if(e&&l){c(!0);return}c(!1),n(e)},d=t.page_cache_serving??e.cache_enabled,f=e.cache_enabled&&!d,p=e=>o(t=>t===e?null:e);return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{"data-field-anchor":`cache:cache_enabled`,className:`xspeed-field border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${f?`bg-amber-500`:e.cache_enabled?`bg-emerald-500`:`bg-neutral-300 dark:bg-neutral-600`}`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Enable Cache`}),(0,B.jsx)(`div`,{className:`text-[12px] ${f?`text-amber-700 dark:text-amber-500`:`text-neutral-500 dark:text-neutral-400`}`,children:f?`On, but not serving — nothing is being cached`:e.cache_enabled?`Active — serving cached HTML`:`Inactive`})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-3 shrink-0`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors`,children:[(0,B.jsx)(mt,{size:13}),`Purge`]}),(0,B.jsx)(ln,{checked:e.cache_enabled,onChange:u,size:`lg`,label:`Enable Cache`})]})]}),s&&l?(0,B.jsx)(`div`,{role:`alertdialog`,"aria-labelledby":`xspeed-dropin-confirm-title`,className:`border border-line bg-info-tint rounded-lg p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(pe,{size:16,className:`text-info shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{id:`xspeed-dropin-confirm-title`,className:`font-medium text-on-tint text-[13px]`,children:l.title}),(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft mt-1`,children:l.body}),(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>{c(!1),n(!0)},style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid !border-primary bg-primary text-on-primary font-medium hover:bg-primary-hover hover:!border-primary-hover transition-colors`,children:l.confirmLabel}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>c(!1),style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid !border-line bg-paper text-ink hover:bg-panel transition-colors`,children:V(`Cancel`)})]})]})]})}):null,f&&t.page_cache_blocked_reason?(0,B.jsx)(`div`,{className:`border border-amber-300 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/40 rounded-lg p-4 text-[13px] text-amber-900 dark:text-amber-200`,children:t.page_cache_blocked_reason}):null,(0,B.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4`,children:[(0,B.jsx)(Wa,{label:`Cached Pages`,value:String(t.cached_pages),onClick:()=>p(`pages`),expanded:a===`pages`,hint:V(`show which pages are cached`)}),(0,B.jsx)(Wa,{label:`Cache Size`,value:jn(t.cache_size),onClick:()=>p(`size`),expanded:a===`size`,hint:V(`show what is taking the space`)}),(0,B.jsx)(Wa,{label:`Last Purge`,value:eo(t.last_purge),onClick:()=>p(`purge`),expanded:a===`purge`,hint:V(`show what cleared the cache and why`)}),(0,B.jsx)(Wa,{label:t.edge_cache?V(`Hit Ratio · 24h · origin`):V(`Hit Ratio · 24h`),value:$a(t),onClick:()=>{document.querySelector(`[data-xspeed-anchor="hit-trend"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})},hint:V(`jump to the hit-ratio trend`)})]}),(t.edge_cache||(t.excluded_24h??0)>0)&&(0,B.jsxs)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 space-y-1 -mt-2`,children:[t.edge_cache&&(0,B.jsx)(`p`,{children:V(`An edge cache (Cloudflare) is in front, so this hit ratio is origin-layer only — hits served at the edge never reach the origin and aren’t counted here.`)}),(t.excluded_24h??0)>0&&(0,B.jsxs)(`p`,{children:[V(`Absorbed`),` `,(0,B.jsx)(`span`,{className:`tabular-nums text-neutral-700 dark:text-neutral-300 font-medium`,children:(t.excluded_24h??0).toLocaleString()}),` `,V(`bot / 404 requests in 24h — excluded from the hit ratio.`)]})]}),a&&(0,B.jsx)(Qa,{which:a})]})}function no(e){let t=e/1e3;return t<60?`${t.toFixed(1)}s`:t<3600?`${(t/60).toFixed(1)} ${V(`min`)}`:`${(t/3600).toFixed(1)} ${V(`hrs`)}`}function ro({stats:e}){let[t,n]=(0,y.useState)(void 0),[r,i]=(0,y.useState)([]);if((0,y.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([W.request(`/cache/benchmark/history`),W.request(`/stats/hit-daily?days=30`)]),r=e.runs.filter(e=>e.cache_enabled&&e.savings_ms!=null&&e.savings_ms>0);n(r.length?r[r.length-1].savings_ms:null),i(t.days)}catch{n(null)}})()},[]),t===void 0)return null;let a=e.hits_24h??0;if(t===null||a===0)return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex items-center gap-3`,children:[(0,B.jsx)(pt,{size:18,className:`text-neutral-400 dark:text-neutral-500 shrink-0`}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:V(t===null?`Run the benchmark once and this card shows how much combined wait time the cache saves your visitors.`:`Serving cached pages… impact numbers appear once today’s hits accumulate.`)})]});let o=e=>r.slice(-e).reduce((e,t)=>e+(t.hits??0),0),s=[{label:V(`last 24h`),hits:a},{label:V(`7 days`),hits:o(7)},{label:V(`30 days`),hits:o(30)}];return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,B.jsx)(St,{size:16,className:`text-accent shrink-0`}),(0,B.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider font-medium text-neutral-500 dark:text-neutral-400`,children:V(`Real visitor impact`)})]}),(0,B.jsxs)(`div`,{className:`text-neutral-900 dark:text-neutral-50`,children:[V(`xSpeed served`),` `,(0,B.jsx)(`span`,{className:`font-semibold tabular-nums`,children:a.toLocaleString()}),` `,V(`cached pages in 24h — saving your visitors`),` `,(0,B.jsx)(`span`,{className:`font-semibold text-emerald-600 dark:text-emerald-400 tabular-nums`,children:no(a*t)}),` `,V(`of combined wait time`),` `,(0,B.jsxs)(`span`,{className:`text-neutral-500 dark:text-neutral-400 text-[13px]`,children:[`(`,Math.round(t),`ms `,V(`faster per page`),`)`]})]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-1 mt-2 text-[12px] text-neutral-500 dark:text-neutral-400`,children:s.slice(1).map(e=>e.hits>0?(0,B.jsxs)(`span`,{children:[e.label,`:`,` `,(0,B.jsx)(`span`,{className:`tabular-nums text-neutral-700 dark:text-neutral-300 font-medium`,children:no(e.hits*t)}),` `,V(`saved across`),` `,e.hits.toLocaleString(),` `,V(`hits`)]},e.label):null)})]})}function io(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=(0,y.useCallback)(async()=>{try{t((await W.request(`/recommendations`)).recommendations)}catch{t([])}},[]);(0,y.useEffect)(()=>{c()},[c]);let l=e?.[0];return e===null?null:l?(0,B.jsx)(`div`,{className:`border border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 rounded-lg p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4`,children:[(0,B.jsx)(Me,{size:18,className:`text-amber-600 dark:text-amber-300 shrink-0 hidden sm:block`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`text-[11px] uppercase tracking-wider font-medium text-amber-700 dark:text-amber-300 mb-0.5`,children:[V(`Next best action`),e.length>1&&(0,B.jsxs)(`span`,{className:`normal-case tracking-normal font-normal`,children:[` `,`· `,e.length-1,` `,V(`more after this`)]})]}),(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:l.title}),(0,B.jsx)(`div`,{className:`text-[12px] text-amber-900/80 dark:text-amber-200/80 mt-0.5`,children:l.detail}),o&&(0,B.jsx)(`div`,{className:`text-[12px] text-red-700 dark:text-red-300 mt-1`,children:o})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:l.action.type===`apply`?(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{if(l){r(!0),s(null);try{let e=await W.request(`/recommendations/apply`,{method:`POST`,body:JSON.stringify({id:l.id})});a(!0),setTimeout(()=>{a(!1),t(e.recommendations)},1600)}catch(e){s(e instanceof Error?e.message:V(`Could not apply the fix.`))}finally{r(!1)}}},disabled:n||i,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-60`,children:[n?(0,B.jsx)(R,{size:13,className:`animate-spin`}):i?(0,B.jsx)(M,{size:13}):null,i?V(`Applied`):l.action.label]}):(0,B.jsxs)(`a`,{href:l.action.module?Pn({module:l.action.module,subtab:l.action.subtab,focus:l.action.focus,suggest:l.action.suggest}):`#`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 text-amber-800 dark:text-amber-200 hover:bg-amber-100 dark:hover:bg-amber-900/40 transition-colors`,children:[l.action.label,` `,(0,B.jsx)(w,{size:13})]})})]})}):(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex items-center gap-3`,children:[(0,B.jsx)(I,{size:18,className:`text-emerald-500 shrink-0`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:V(`No recommendations right now`)}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:V(`Every deterministic check passes — your configuration looks healthy.`)})]})]})}function ao({compact:e=!1}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null);return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 mb-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(St,{size:18,className:`text-accent shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:V(`Cache impact benchmark`)}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:V(`Compare your homepage with and without cache.`)})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{i(!0),o(null);try{n(await W.request(`/cache/benchmark`))}catch(e){o(e instanceof Error?e.message:V(`Benchmark failed`))}finally{i(!1)}},disabled:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(St,{size:13}),V(t?`Re-run`:`Run benchmark`)]})]}),a&&(0,B.jsxs)(`div`,{className:`text-[13px] text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900/60 rounded p-2.5 flex items-start gap-2 mb-3`,children:[(0,B.jsx)(F,{size:14,className:`shrink-0 mt-0.5`}),a]}),t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsx)(oo,{label:V(`Without cache`),tone:`warn`,ms:t.without_cache.time_ms,bytes:t.without_cache.bytes}),(0,B.jsx)(oo,{label:V(`With cache`),tone:`ok`,ms:t.with_cache.time_ms,bytes:t.with_cache.bytes})]}),t.savings_pct!==null&&t.savings_ms!==null&&(0,B.jsx)(`div`,{className:`mt-3 text-center text-[13px]`,children:t.savings_pct>5?(0,B.jsxs)(`span`,{className:`text-emerald-700 dark:text-emerald-300 font-medium`,children:[`⚡ `,V(`Cache is`),` `,(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[t.savings_pct.toFixed(0),`%`]}),` `,V(`faster`),` `,`(`,t.savings_ms.toFixed(0),` ms `,V(`saved per request`),`)`]}):(0,B.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400`,children:V(`Negligible difference — page is cheap to render or cache is cold.`)})}),!t.cache_enabled&&(0,B.jsx)(`div`,{className:`mt-3 text-[12px] text-amber-700 dark:text-amber-300 text-center`,children:V(`Cache is disabled — both runs hit the same uncached path. Enable Cache to see a real difference.`)}),!e&&(0,B.jsx)(`div`,{className:`mt-3 text-[11px] text-neutral-400 text-center font-mono truncate`,children:t.url})]}),!t&&!r&&!a&&(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 text-center py-3`,children:V(`Click "Run benchmark" to compare load times.`)})]})}function oo({label:e,tone:t,ms:n,bytes:r}){return(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full ${t===`ok`?`bg-emerald-500`:`bg-amber-500`}`}),(0,B.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:e})]}),(0,B.jsxs)(`div`,{className:`text-2xl font-semibold tabular-nums ${t===`ok`?`text-emerald-600 dark:text-emerald-400`:`text-amber-600 dark:text-amber-400`}`,children:[Math.round(n),(0,B.jsx)(`span`,{className:`text-[13px] font-normal text-neutral-500 dark:text-neutral-400 ml-1`,children:`ms`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[(0,B.jsx)(ie,{size:11}),(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(n),` ms`]}),(0,B.jsx)(`span`,{className:`text-neutral-300 dark:text-neutral-700`,children:`·`}),(0,B.jsx)(ce,{size:11}),(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[(r/1024).toFixed(1),` KB`]})]})]})}function so(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)([]),[o,s]=(0,y.useState)(30),[c,l]=(0,y.useState)(!1),u=async()=>{l(!0);try{let[e,n]=await Promise.all([W.request(`/stats/hit-daily?days=30`),W.request(`/cache/benchmark/history`)]);t(e.days),r(n.runs),a(e.changes.length?e.changes:n.changes)}catch{t([]),r([])}finally{l(!1)}};(0,y.useEffect)(()=>{u()},[]);let d=(e??[]).slice(-o),f=d.length>=2,p=(n??[]).length>=2;return(0,B.jsxs)(`div`,{"data-xspeed-anchor":`hit-trend`,className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 scroll-mt-6`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 mb-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(ht,{size:18,className:`text-accent shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:V(`Trends`)}),(0,B.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:V(`Hit ratio and benchmark history, with your settings changes marked.`)})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`flex rounded border border-neutral-200 dark:border-neutral-700 overflow-hidden text-[12px]`,children:[7,30].map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(e),className:o===e?`px-2.5 py-1 bg-accent text-white`:`px-2.5 py-1 text-neutral-600 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`,children:[e,`d`]},e))}),(0,B.jsx)(`button`,{type:`button`,onClick:u,disabled:c,"aria-label":V(`Refresh trends`),className:`p-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400 hover:bg-neutral-50 dark:hover:bg-neutral-800 disabled:opacity-40`,children:(0,B.jsx)(R,{size:13,className:c?`animate-spin`:``})})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,B.jsxs)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:[V(`Hit ratio`),` · `,o,`d`]}),f?(0,B.jsx)(po,{rows:d,changes:i}):(0,B.jsx)(X,{text:V(`Trends appear after a couple of days of traffic. The daily series is being collected now.`)})]}),(0,B.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:V(`Benchmark: cached vs uncached (ms)`)}),p?(0,B.jsx)(mo,{rows:n??[],changes:i}):(0,B.jsx)(X,{text:V(`Run the benchmark at least twice to see a trend.`)})]})]}),i.length>0&&(0,B.jsxs)(`div`,{className:`mt-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-1.5`,children:[(0,B.jsx)(Ce,{size:11}),` `,V(`Recent changes`)]}),(0,B.jsx)(`ul`,{className:`space-y-0.5`,children:i.slice(0,5).map(e=>(0,B.jsxs)(`li`,{className:`text-[12px] text-neutral-600 dark:text-neutral-300 truncate`,children:[(0,B.jsx)(`span`,{className:`text-neutral-400 dark:text-neutral-500 tabular-nums mr-2`,children:new Date(e.ts*1e3).toLocaleDateString()}),e.message]},`${e.ts}-${e.message}`))})]})]})}var co=280,lo=80,Y=4;function uo(e,t){return t<=1?Y:Y+e*(co-2*Y)/(t-1)}function fo({changes:e,t0:t,t1:n}){return n<=t?null:(0,B.jsx)(B.Fragment,{children:e.filter(e=>e.ts>=t&&e.ts<=n).map(e=>{let r=Y+(e.ts-t)/(n-t)*(co-2*Y);return(0,B.jsx)(`line`,{x1:r,x2:r,y1:Y,y2:lo-Y,className:`stroke-amber-500/70`,strokeWidth:`1`,strokeDasharray:`2 3`,children:(0,B.jsx)(`title`,{children:e.message})},`${e.ts}-${e.message}`)})})}function po({rows:e,changes:t}){let n=e=>lo-Y-e*(lo-2*Y),r=e.map((t,r)=>`${uo(r,e.length)},${n(t.ratio)}`).join(` `),i=n(1),a=n(.8),o=Date.parse(e[0]?.date??``)/1e3,s=Date.parse(e[e.length-1]?.date??``)/1e3+86399,c=e[e.length-1];return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${co} ${lo}`,className:`w-full h-20`,role:`img`,"aria-label":V(`Hit ratio trend`),children:[(0,B.jsx)(`rect`,{x:Y,y:i,width:co-2*Y,height:a-i,className:`fill-emerald-500/10`}),(0,B.jsx)(`line`,{x1:Y,x2:co-Y,y1:a,y2:a,className:`stroke-emerald-500/40`,strokeWidth:`1`,strokeDasharray:`3 3`}),Number.isFinite(o)&&Number.isFinite(s)&&(0,B.jsx)(fo,{changes:t,t0:o,t1:s}),(0,B.jsx)(`polyline`,{points:r,fill:`none`,className:`stroke-accent`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),e.map((t,r)=>(0,B.jsx)(`circle`,{cx:uo(r,e.length),cy:n(t.ratio),r:`2`,className:`fill-accent`,children:(0,B.jsx)(`title`,{children:`${t.date} — ${(t.ratio*100).toFixed(1)}% (${t.hits} hits / ${t.misses} misses)`})},t.date))]}),c&&(0,B.jsxs)(`div`,{className:`mt-1 text-[12px] text-neutral-500 dark:text-neutral-400`,children:[V(`Latest`),`:`,` `,(0,B.jsxs)(`span`,{className:c.ratio>=.8?`text-emerald-600 dark:text-emerald-400 font-medium`:`text-amber-600 dark:text-amber-400 font-medium`,children:[(c.ratio*100).toFixed(1),`%`]}),` `,`· `,V(`target ≥80%`)]})]})}function mo({rows:e,changes:t}){let n=Math.max(...e.map(e=>e.uncached_ms),1),r=e=>lo-Y-e/n*(lo-2*Y),i=t=>e.map((n,i)=>`${uo(i,e.length)},${r(t(n))}`).join(` `),a=e[0]?.ts??0,o=e[e.length-1]?.ts??0,s=e[e.length-1];return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${co} ${lo}`,className:`w-full h-20`,role:`img`,"aria-label":V(`Benchmark trend`),children:[o>a&&(0,B.jsx)(fo,{changes:t,t0:a,t1:o}),(0,B.jsx)(`polyline`,{points:i(e=>e.uncached_ms),fill:`none`,className:`stroke-amber-500`,strokeWidth:`1.5`,strokeDasharray:`4 3`}),(0,B.jsx)(`polyline`,{points:i(e=>e.cached_ms),fill:`none`,className:`stroke-emerald-500`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),e.map((t,n)=>(0,B.jsx)(`circle`,{cx:uo(n,e.length),cy:r(t.cached_ms),r:`2`,className:`fill-emerald-500`,children:(0,B.jsx)(`title`,{children:`${new Date(t.ts*1e3).toLocaleString()} — ${Math.round(t.cached_ms)}ms cached vs ${Math.round(t.uncached_ms)}ms uncached`})},t.ts))]}),(0,B.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 text-[12px] text-neutral-500 dark:text-neutral-400`,children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,B.jsx)(`span`,{className:`inline-block w-3 h-0.5 bg-emerald-500 rounded`}),` `,V(`cached`)]}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,B.jsx)(`span`,{className:`inline-block w-3 h-0.5 bg-amber-500 rounded`}),` `,V(`uncached`)]}),s?.savings_ms!=null&&(0,B.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[`−`,Math.round(s.savings_ms),`ms`]})]})]})}function X({text:e}){return(0,B.jsx)(`div`,{className:`h-20 flex items-center justify-center text-center text-[12px] text-neutral-400 dark:text-neutral-500 px-4`,children:e})}function ho(){let e=$t(),[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1);return e===`free`?(0,B.jsxs)(`div`,{className:`border border-line bg-primary-tint rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(`span`,{className:`shrink-0 w-9 h-9 rounded-full bg-paper border border-line flex items-center justify-center text-warning`,children:(0,B.jsx)(ct,{size:18})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:V(`What would Pro do for your site?`)}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium text-on-tint`,children:[(0,B.jsx)(Pe,{size:10,"aria-hidden":`true`}),V(`Pro`)]})]}),(0,B.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:V(`Scans your current settings + 24h cache stats and shows exactly which Pro features would help.`)})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[r&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`flex items-center gap-1 text-[12px] text-ink-soft hover:text-ink transition-colors`,children:[(0,B.jsx)(te,{size:13,className:`transition-transform ${s?``:`rotate-180`}`}),V(s?`Hide`:`Show`)]}),(0,B.jsxs)(`button`,{type:`button`,onClick:async()=>{n(!0),o(null);try{i(await W.request(`/audit/pro`)),c(!0)}catch(e){o(e instanceof Error?e.message:V(`Audit failed`))}finally{n(!1)}},disabled:t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded-md bg-primary hover:bg-primary-hover text-on-primary font-medium transition-colors disabled:opacity-50`,children:[t?(0,B.jsx)(R,{size:13,className:`animate-spin`}):(0,B.jsx)(ct,{size:13}),V(r?`Re-run`:`Run Pro audit`)]})]})]}),a&&(0,B.jsx)(`div`,{className:`mt-3 text-[12px] text-danger`,children:a}),r&&s&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[r.suggestions.map(e=>(0,B.jsx)(_o,{suggestion:e},`${e.id}-${e.severity}`)),(0,B.jsx)(`div`,{className:`text-center pt-2`,children:(0,B.jsxs)(`a`,{href:`https://xspeedcache.com/pricing/`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 px-4 py-2 rounded-md bg-primary hover:bg-primary-hover text-on-primary text-[13px] font-medium transition-colors`,children:[V(`Upgrade to Pro`),(0,B.jsx)(w,{size:13})]})})]})]}):null}var go={high:{dot:`bg-danger`,chip:`bg-danger-tint text-danger border-line`,label:`High`},med:{dot:`bg-warning`,chip:`bg-warning-tint text-warning border-line`,label:`Medium`},low:{dot:`bg-info`,chip:`bg-info-tint text-info border-line`,label:`Low`}};function _o({suggestion:e}){let t=ur[e.id],n=go[e.severity];return(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-md p-3 sm:p-4 flex items-start gap-3`,children:[(0,B.jsx)(`span`,{className:`shrink-0 w-2 h-2 rounded-full mt-2.5 ${n.dot}`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`shrink-0 text-warning mt-0.5`,children:t&&(0,B.jsx)(Ot,{name:t.icon,size:16})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:t?.title??e.id}),(0,B.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded border ${n.chip}`,children:n.label}),e.fact&&(0,B.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-panel text-ink-soft`,children:e.fact})]}),(0,B.jsx)(`p`,{className:`text-[12px] text-ink-soft mt-1 leading-relaxed`,children:e.reason})]})]})}function vo(){let e=tn(),t=e===`unlicensed`,n=e===`active`,r=Object.values(ur);return(0,B.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-6`,children:[(0,B.jsxs)(`section`,{className:`relative overflow-hidden rounded-card border border-line bg-primary-tint p-6 sm:p-8`,children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border border-line bg-paper text-on-tint rounded-full px-2 py-0.5`,children:[n?(0,B.jsx)(E,{size:10}):t?(0,B.jsx)(Oe,{size:10}):(0,B.jsx)(Pe,{size:10}),(0,B.jsx)(`span`,{children:V(n?`Pro Licensed`:t?`Pro — license needed`:`xSpeed Pro`)})]}),(0,B.jsx)(`h1`,{className:`mt-3 font-display text-[26px] font-semibold text-ink`,children:V(n?`Pro is licensed on this site.`:`Everything in Free, plus the heavy lifting.`)}),(0,B.jsx)(`p`,{className:`mt-2 max-w-2xl text-[14px] leading-relaxed text-ink-soft`,children:V(n?`Every feature below is unlocked and available from its own page. This screen stays as a reference for what Pro adds — manage your license from the License page.`:t?`xSpeed Pro is installed — activate your license to unlock every feature below. Your current settings stay exactly as they are.`:`Pro layers deeper optimization, real-user insight, and automation on top of the cache you already run. Nothing you have set up changes.`)}),(0,B.jsx)(`div`,{className:`mt-5`,children:n?(0,B.jsxs)(`a`,{href:lr,className:`inline-flex items-center gap-1.5 px-4 py-2 rounded-control text-[13px] font-medium border border-line-strong text-ink no-underline hover:bg-panel transition-colors`,children:[V(`Manage license`),(0,B.jsx)(w,{size:14})]}):t?(0,B.jsxs)(`a`,{href:lr,className:`inline-flex items-center gap-1.5 px-5 py-2.5 rounded-control text-[14px] font-medium bg-primary hover:bg-primary-hover text-on-primary no-underline shadow-primary-glow transition-colors`,children:[V(`Activate License`),(0,B.jsx)(w,{size:15})]}):(0,B.jsxs)(`a`,{href:cr,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 px-5 py-2.5 rounded-control text-[14px] font-medium bg-primary hover:bg-primary-hover text-on-primary no-underline shadow-primary-glow transition-colors`,children:[V(`Upgrade to Pro`),(0,B.jsx)(w,{size:15})]})})]}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:r.map(e=>(0,B.jsx)(`div`,{className:`rounded-card border border-line bg-paper p-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border border-line bg-primary-tint text-primary flex items-center justify-center`,children:(0,B.jsx)(Ot,{name:e.icon,size:17})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:e.title}),(0,B.jsx)(`p`,{className:`mt-1 text-[12px] leading-relaxed text-ink-soft`,children:e.body})]})]})},e.id))}),!n&&(0,B.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 text-[12px] text-muted`,children:[(0,B.jsx)(M,{size:13,className:`text-success`}),(0,B.jsx)(`span`,{children:V(`Your Free tier keeps working exactly as it does today.`)})]})]})}var yo=30;function bo(e,t){let n=e.filter(e=>(e.strategy||`mobile`)===t),r=n[0]??null,i=n.find(e=>e.ok&&typeof e.score==`number`)??null;return{latest:r,lastGood:i,failedSinceGood:r!==null&&!r.ok&&i!==null,stale:i!==null&&Date.now()/1e3-i.ts>yo*86400,hasAny:n.length>0}}function Z({value:e,onChange:t}){let n=[{id:`desktop`,label:V(`Desktop`),Icon:Le},{id:`mobile`,label:V(`Mobile`),Icon:st}];return(0,B.jsx)(`div`,{className:`inline-flex rounded-control border border-line p-0.5`,role:`group`,"aria-label":V(`Score strategy`),children:n.map(({id:n,label:r,Icon:i})=>{let a=e===n;return(0,B.jsx)(`button`,{type:`button`,onClick:()=>t(n),"aria-pressed":a,"aria-label":r,title:r,className:`inline-flex items-center justify-center rounded-[5px] p-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary ${a?`bg-primary-tint text-primary`:`text-faint hover:text-ink-soft`}`,children:(0,B.jsx)(i,{size:13,"aria-hidden":`true`})},n)})})}function xo({onOpenScore:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(`desktop`);(0,y.useEffect)(()=>{let e=!0;return W.request(`/score/history`).then(t=>e&&n(Array.isArray(t.runs)?t.runs:[])).catch(()=>e&&n([])),W.request(`/score/scan-status`).then(t=>e&&i(t.latest??null)).catch(()=>e&&i(null)),()=>{e=!1}},[]);let{lastGood:s,failedSinceGood:c,stale:l,hasAny:u}=bo(t??[],a),d=a===`desktop`?r?.measured?.lighthouse_desktop??null:r?.measured?.lighthouse??null,f=d!==null,p=f?d:s?.score??null,m=f?r?.ts??null:s?.ts??null,h=t===null,g=(()=>{if(h)return V(`Loading…`);if(p===null)return V(u?`No completed scan`:`Never scanned`);let e=m===null?``:` · ${Tn(m)}`;return`${V(a===`desktop`?`desktop`:`mobile`)}${e}`})(),_=p===null?0:Math.min(100,p/90*100),v=V(h?`Checking your score`:p===null?`No score yet`:p>=90?`Your site is fast`:`Room to go faster`),b=V(h?`Reading your latest result.`:f?`Lighthouse performance, from your latest xSpeed Scan.`:p===null&&!u?`See how this site performs for real visitors.`:p===null?`The last scan did not complete.`:c?`Showing your last completed scan.`:l?`Over a month old — may not reflect the site now.`:`Measured on your home page by an external audit.`);return(0,B.jsxs)(`div`,{className:`mt-auto flex items-center gap-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-1 shrink-0`,children:[(0,B.jsx)(Xi,{score:h?null:p,size:72,thickness:3.5,label:p===null?V(`No performance score measured yet`):`${V(`Performance score`)}: ${p} ${V(`out of 100`)}`}),(0,B.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted`,children:V(`Score`)})]}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`font-display text-[15px] font-semibold text-ink leading-snug`,children:v}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[12px] text-ink-soft leading-snug`,children:b})]}),(0,B.jsx)(Z,{value:a,onChange:o})]}),(0,B.jsx)(`div`,{className:`mt-2.5 h-1.5 rounded-pill bg-panel overflow-hidden`,role:`progressbar`,"aria-valuenow":p??void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-label":V(`Performance score`),children:p!==null&&(0,B.jsx)(`div`,{className:`h-full rounded-pill bg-primary`,style:{width:`${_}%`}})}),(0,B.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px]`,children:[(0,B.jsxs)(`span`,{className:`text-muted`,children:[V(`now`),` `,(0,B.jsx)(`span`,{className:`font-semibold text-ink tabular-nums`,children:p===null?`—`:p})]}),(0,B.jsxs)(`span`,{className:`text-muted`,children:[V(`good`),` `,(0,B.jsxs)(`span`,{className:`font-semibold text-success`,children:[90,`+`]})]})]}),(0,B.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 text-[11px] text-muted`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:g}),!h&&(0,B.jsxs)(`button`,{type:`button`,onClick:e,className:`shrink-0 ml-auto inline-flex items-center gap-1 font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded-sm`,children:[V(p===null?`Run a scan`:`View details`),(0,B.jsx)(w,{size:11,"aria-hidden":`true`})]})]})]})]})}function So({settings:e,stats:t,onNavigate:n}){let r=e.cache_enabled,i=t.page_cache_serving??r,a=r&&!i,o=r?t.page_cache_blocked_reason||V(`Another plugin owns the page cache on this site, so xSpeed is serving nothing.`):V(`Turn on the page cache to start serving pages instantly.`);return(0,B.jsxs)(`section`,{className:`rounded-card border border-line bg-paper p-5 flex flex-col`,"aria-label":V(`Cache status`),children:[(!r||a)&&(0,B.jsxs)(`div`,{className:`mb-4 flex items-start gap-2.5 rounded-lg p-3 ${a?`bg-warning-tint`:`bg-panel`}`,children:[(0,B.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 rounded-full shrink-0 ${a?`text-warning`:`text-faint`}`,"aria-hidden":`true`,children:(0,B.jsx)(St,{size:13})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-semibold text-ink leading-snug`,children:V(a?`Cache on, but not serving`:`Cache inactive`)}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[12px] text-ink-soft leading-snug`,children:o})]})]}),(0,B.jsx)(xo,{onOpenScore:()=>n(`score`)}),(0,B.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[V(`Last purged`),` `,t.last_purge?Tn(t.last_purge):V(`never`)]})]})}function Co({onNavigate:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!0),a=(e=!1)=>W.request(`/mcp/hub`,e?{headers:{"X-XSpeed-Reconcile":`1`}}:{}).then(e=>n(e)).catch(()=>void 0);(0,y.useEffect)(()=>{let e=!0;return W.request(`/mcp/hub`).then(t=>{e&&n(t)}).catch(()=>{e&&n(null)}).finally(()=>{e&&i(!1)}),()=>{e=!1}},[]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&a(!0)};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`focus`,e)}},[]);let o=`rounded-card border border-line bg-paper p-5 flex flex-col`,s=`inline-flex items-center gap-2 rounded border border-line-strong px-3 py-1.5 text-[13px] font-medium text-ink-soft hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`;if(r)return(0,B.jsxs)(`section`,{className:o,"aria-busy":`true`,"aria-label":V(`xSpeed Hub`),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(ae,{size:18,className:`text-muted`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`h-4 w-28 rounded bg-panel animate-pulse`})]}),(0,B.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,B.jsx)(`span`,{className:`block h-3 w-full rounded bg-panel animate-pulse`}),(0,B.jsx)(`span`,{className:`block h-3 w-2/3 rounded bg-panel animate-pulse`})]})]});let c=t?.attached===!0;return(0,B.jsxs)(`section`,{className:o,"aria-label":V(`xSpeed Hub`),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(ae,{size:18,className:`text-ink-soft`,"aria-hidden":`true`}),(0,B.jsx)(`h2`,{className:`text-[15px] font-semibold text-ink`,children:V(`xSpeed Hub`)}),c&&(0,B.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1.5 text-[12px] text-success`,children:[(0,B.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-success`,"aria-hidden":`true`}),V(`Connected`)]})]}),c?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-soft`,children:t?.account_email?`${V(`Connected as`)} ${t.account_email}. ${V(`Control caching remotely and from AI agents.`)}`:V(`Control caching remotely, drive it from AI agents, and manage your sites in one place.`)}),(0,B.jsx)(`div`,{className:`mt-auto pt-4`,children:(0,B.jsxs)(`a`,{href:t?.hub_url,target:`_blank`,rel:`noopener noreferrer`,className:s,children:[V(`Open Hub dashboard`),(0,B.jsx)(L,{size:14})]})})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-soft`,children:V(`Connect to control caching remotely, drive it from AI agents, and manage all your sites in one place.`)}),(0,B.jsxs)(`div`,{className:`mt-auto pt-4 flex flex-wrap items-center gap-3`,children:[t?.attach_url?(0,B.jsxs)(`a`,{href:t.attach_url,target:`_blank`,rel:`noopener noreferrer`,className:s,children:[V(`Connect to Hub`),(0,B.jsx)(L,{size:14})]}):(0,B.jsx)(`button`,{type:`button`,onClick:()=>e(`mcp`),className:s,children:V(`Connect to Hub`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>e(`mcp`),className:`text-[13px] text-ink-soft hover:text-ink underline underline-offset-2`,children:V(`More options`)})]})]})]})}var wo=[72,72,72,86,94,98],To=wo.length-1,Eo=wo[To]-wo[0],Do=[{at:600,step:1},{at:1600,step:2},{at:2700,step:3},{at:3600,step:4},{at:4500,step:5},{at:9e3,step:0}],Oo=900,ko=21,Ao=2*Math.PI*ko,jo=`(prefers-reduced-motion: reduce)`,Mo=`(max-width: 639.98px)`;function No(e){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches}function Po(e){let[t,n]=(0,y.useState)(()=>No(e));return(0,y.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener?.(`change`,r),()=>t.removeEventListener?.(`change`,r)},[e]),t}function Fo(){let e=Po(jo),t=Po(Mo),n=e||t,r=()=>No(jo)||No(Mo),[i,a]=(0,y.useState)(()=>r()?To:0),[o,s]=(0,y.useState)(()=>wo[r()?To:0]),c=(0,y.useRef)(o);(0,y.useEffect)(()=>{if(n){a(To),c.current=wo[To],s(wo[To]);return}let e=0,t=0,r=()=>{let n=e===0?0:Do[e-1].at,i=Do[e].at-n;t=window.setTimeout(()=>{a(Do[e].step),e=(e+1)%Do.length,r()},i)};return r(),()=>window.clearTimeout(t)},[n]),(0,y.useEffect)(()=>{let e=wo[i],t=c.current;if(t===e)return;let r=()=>{c.current=e,s(e)};if(e<t||n||typeof requestAnimationFrame!=`function`){r();return}let a=0,o=performance.now(),l=n=>{let r=Math.min(1,(n-o)/Oo),i=1-(1-r)**3,u=Math.round(t+(e-t)*i);c.current=u,s(u),r<1&&(a=requestAnimationFrame(l))};return a=requestAnimationFrame(l),()=>cancelAnimationFrame(a)},[i,n]);let l=e=>e?`opacity-100 translate-y-0`:`opacity-0 translate-y-[3px]`;return(0,B.jsxs)(`div`,{className:`relative hidden min-w-0 sm:block`,"data-testid":`mcp-session`,"data-step":i,children:[(0,B.jsx)(`div`,{className:`xspeed-mcp-glow pointer-events-none absolute -inset-x-3 -inset-y-4`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`xspeed-mcp-well relative flex h-full flex-col gap-2 rounded-control border bg-paper px-[11px] py-[9px]`,"aria-hidden":`true`,children:[(0,B.jsx)(`div`,{className:`flex justify-end transition-all duration-[450ms] ${l(i>=1)}`,children:(0,B.jsx)(`span`,{className:`inline-block max-w-[92%] truncate rounded-[9px_9px_3px_9px] bg-primary-tint px-[9px] py-[5px] text-[11.5px] leading-[1.35] text-on-tint`,children:V(`Optimize my site for better PageSpeed.`)})}),(0,B.jsxs)(`div`,{className:`flex min-h-[17px] items-center gap-1.5 text-[11px] text-muted`,children:[(0,B.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5 transition-all duration-[450ms] ${l(i>=2)}`,children:i>=To?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(I,{size:11,className:`shrink-0 text-success`}),(0,B.jsx)(`span`,{className:`truncate`,children:V(`Applied 3 optimizations`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`xspeed-anim-boltpulse h-1.5 w-1.5 shrink-0 rounded-pill bg-primary`}),(0,B.jsx)(`span`,{className:`truncate`,children:V(`Analyzing site…`)})]})}),(0,B.jsx)(`span`,{className:`ml-auto shrink-0 rounded-pill border border-line-strong bg-paper px-[7px] text-[9.5px] leading-[1.5] text-muted`,children:V(`Example session`)})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_74px] items-center gap-2.5`,children:[(0,B.jsx)(`div`,{className:`flex flex-col gap-[5px]`,children:[V(`Cache optimized`),V(`Compression enabled`),V(`Core Web Vitals checked`)].map((e,t)=>{let n=i>=3+t;return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-ink-soft transition-opacity duration-[450ms] ${n?`opacity-100`:`opacity-30`}`,children:[(0,B.jsx)(`span`,{className:`inline-flex h-[13px] w-[13px] shrink-0 items-center justify-center rounded-pill border transition-colors duration-300 ${n?`border-success-tint bg-success-tint text-success`:`border-line-strong bg-paper text-transparent`}`,children:(0,B.jsx)(M,{size:9,strokeWidth:3.2})}),(0,B.jsx)(`span`,{className:`truncate`,children:e})]},e)})}),(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,B.jsxs)(`div`,{className:`relative h-12 w-12`,children:[(0,B.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,className:`block -rotate-90`,children:[(0,B.jsx)(`circle`,{cx:`24`,cy:`24`,r:ko,fill:`none`,strokeWidth:`4.5`,className:`stroke-line`}),(0,B.jsx)(`circle`,{cx:`24`,cy:`24`,r:ko,fill:`none`,strokeWidth:`4.5`,strokeLinecap:`round`,className:`stroke-primary`,strokeDasharray:Ao,strokeDashoffset:Ao-Ao*o/100})]}),(0,B.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center font-mono text-[14px] font-medium tabular-nums text-ink`,children:o})]}),(0,B.jsxs)(`span`,{className:`flex items-baseline gap-1 leading-none`,children:[(0,B.jsx)(`span`,{className:`text-[9.5px] text-muted`,children:V(`PageSpeed`)}),(0,B.jsxs)(`span`,{className:`font-mono text-[9.5px] text-success transition-opacity duration-[450ms] ${i>=To?`opacity-100`:`opacity-0`}`,children:[`+`,Eo]})]})]})]})]})]})}function Io(e){if(!e||typeof e!=`object`)return null;let t=e.connected;return typeof t==`boolean`?t:null}function Lo(){return[{Icon:_e,title:V(`Improve performance`),body:V(`PageSpeed & Core Web Vitals`)},{Icon:at,title:V(`Optimize automatically`),body:V(`Cache, compression & more`)},{Icon:Ie,title:V(`Just ask`),body:V(`Manage xSpeed through conversation`)}]}var Ro=`xspeed-mcp-card-title`;function zo({tone:e,title:t,body:n,cta:r,onOpen:i}){return(0,B.jsx)(`section`,{id:`xspeed-mcp-card`,"aria-labelledby":Ro,className:`rounded-card border border-line bg-paper p-5`,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,B.jsx)(`span`,{className:`mt-0.5 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-pill ${e===`success`?`bg-success-tint text-success`:`bg-primary-tint text-primary`}`,"aria-hidden":`true`,children:e===`success`?(0,B.jsx)(I,{size:15}):(0,B.jsx)(ct,{size:15})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:Ro,className:`text-[15px] font-semibold text-ink`,children:t}),(0,B.jsx)(`p`,{className:`mt-1 max-w-2xl text-[13px] leading-relaxed text-ink-soft`,children:n})]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:i,className:`inline-flex shrink-0 items-center gap-2 rounded-control border border-line-strong bg-paper px-4 py-2 text-[13px] font-medium leading-[1.2] text-ink transition-colors hover:bg-panel focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:[r,(0,B.jsx)(w,{size:14,"aria-hidden":`true`})]})]})})}function Bo({modules:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!0),[a,o]=(0,y.useState)(!1),s=e.find(e=>e.slug===`mcp`),c=(0,y.useCallback)(async()=>{try{return Io(await W.request(`/mcp/connection`))}catch{return null}},[]);(0,y.useEffect)(()=>{let e=!0;if(!s){i(!1);return}return c().then(t=>{e&&(n(t),i(!1))}),()=>{e=!1}},[s,c]),(0,y.useEffect)(()=>{if(!s)return;let e=()=>{document.visibilityState===`visible`&&c().then(n)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[s,c]);let l=(0,y.useCallback)(()=>{o(!1),c().then(n)},[c]);if(!s)return null;let u=()=>o(!0),d=a&&(0,B.jsxs)(Ii,{open:!0,onClose:l,title:V(`MCP Server`),variant:`drawer`,size:`workspace`,children:[(0,B.jsx)(Aa,{notices:s.notices}),(0,B.jsx)(vi,{module:s})]});if(r||t!==!1){let e=t===!0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(zo,{tone:e?`success`:`primary`,title:V(e?`AI connection active`:`Control xSpeed with AI`),body:V(r?`Checking your AI connection…`:e?`MCP is connected and ready — your AI agent can purge, tune and benchmark this site.`:`We couldn't read this site's AI connection status. Open MCP to check.`),cta:V(e?`Manage MCP`:`Open MCP`),onOpen:u}),d]})}return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{id:`xspeed-mcp-card`,"aria-labelledby":Ro,className:`xspeed-mcp-card relative grid grid-cols-1 gap-5 overflow-hidden rounded-card border bg-paper p-4 lg:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,B.jsx)(`span`,{className:`inline-flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-pill bg-primary-tint text-primary`,"aria-hidden":`true`,children:(0,B.jsx)(ct,{size:14})}),(0,B.jsx)(`h2`,{id:Ro,className:`font-display text-[18px] font-semibold leading-tight text-ink`,children:V(`Control and optimize your site with AI`)})]}),(0,B.jsx)(`p`,{className:`mt-1.5 text-[12.5px] leading-normal text-ink-soft`,children:V(`Connect your AI agent through MCP — then just ask it to analyze and optimize your site.`)}),(0,B.jsx)(`ul`,{className:`m-0 mt-2.5 grid list-none grid-cols-1 gap-3 p-0 lg:grid-cols-[max-content_max-content_minmax(0,1fr)]`,children:Lo().map(({Icon:e,title:t,body:n})=>(0,B.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-[3px] break-words`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(e,{size:13,className:`shrink-0 text-primary`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`text-[12px] font-semibold leading-[1.35] text-ink lg:whitespace-nowrap`,children:t})]}),(0,B.jsx)(`p`,{className:`text-[11.5px] leading-[1.42] text-muted`,children:n})]},t))}),(0,B.jsx)(`div`,{className:`mt-auto pt-2.5`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:u,className:`inline-flex max-w-full items-center gap-2 rounded-control bg-primary px-[14px] py-2 text-[13px] font-medium leading-[1.2] text-on-primary shadow-primary-glow transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:[V(`Connect with MCP`),(0,B.jsx)(w,{size:14,"aria-hidden":`true`})]})})]}),(0,B.jsx)(Fo,{})]}),d]})}function Vo({stats:e}){let[t,n]=(0,y.useState)(void 0);(0,y.useEffect)(()=>{let e=!0;return W.request(`/cache/benchmark/history?limit=1`).then(t=>{e&&n(t.runs&&t.runs.length>0?t.runs[0].savings_ms??null:null)}).catch(()=>{e&&n(null)}),()=>{e=!1}},[]);let r=t==null||t<=0?`—`:t>=950?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)} ms`,i=[{label:V(`Hit ratio`),value:wn(e.hit_ratio),hint:V(`last 24 hours`)},{label:V(`Cached pages`),value:Cn(e.cached_pages),hint:V(`served without PHP`)},{label:V(`Cache size`),value:En(e.cache_size),hint:V(`on disk`)},{label:V(`Avg saved`),value:r,hint:V(`per page load`)}];return(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`,"aria-label":V(`Key metrics`),children:i.map(e=>(0,B.jsxs)(`div`,{className:`rounded-card border border-line bg-paper p-4`,children:[(0,B.jsx)(`p`,{className:`text-[13px] text-ink-soft`,children:e.label}),(0,B.jsx)(`p`,{className:`mt-1 font-display text-[24px] font-semibold text-ink tabular-nums`,children:e.value}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted`,children:e.hint})]},e.label))})}var Ho=`https://calendly.com/xspeed-cache/book-expert-setup`;function Uo({settings:e,stats:t,rewriteProbe:n,showToast:r}){let i=$t(),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(!0),[d,f]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!0,t=[W.getRecommendations().then(t=>{e&&o(t.recommendations??[])}).catch(()=>{e&&o([])})];return i===`free`&&t.push(W.getProAudit().then(t=>{e&&c(t.suggestions??[])}).catch(()=>void 0)),Promise.all(t).finally(()=>{e&&u(!1)}),()=>{e=!1}},[i]);let p=e=>e.action.module?Pn({module:e.action.module,subtab:e.action.subtab,focus:e.action.focus,suggest:e.action.suggest}):`#`,m=async e=>{let{action:t}=e;if(t.type===`apply`){if(d)return;f(e.id);try{o((await W.applyRecommendation(e.id)).recommendations??[]),r(V(`Applied`))}catch{r(V(`Could not apply that fix`))}finally{f(null)}}},h=(t.hits_24h??0)+(t.misses_24h??0)>=50&&(t.hit_ratio??0)<.5,g=n?n.active===!1:!1,_=!e.cache_enabled||g||h,v=a&&a.length>0||s.length>0||_;return(0,B.jsxs)(`section`,{className:`rounded-card border border-line bg-info-tint p-4 sm:p-5`,"aria-label":V(`Recommended for your site`),children:[(0,B.jsxs)(`h2`,{className:`flex items-center gap-1.5 text-[14px] font-semibold text-on-tint mb-3`,children:[(0,B.jsx)(St,{size:15,className:`text-primary`,"aria-hidden":`true`}),V(`Recommended for your site`)]}),l?(0,B.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,B.jsx)(`span`,{className:`block h-10 rounded-lg bg-paper animate-pulse`}),(0,B.jsx)(`span`,{className:`block h-10 w-5/6 rounded-lg bg-paper animate-pulse`})]}):v?(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(a??[]).map(e=>(0,B.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-line bg-paper px-3 py-2.5`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-ink`,children:e.title}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-ink-soft`,children:e.detail})]}),e.action.type===`link`?(0,B.jsxs)(`a`,{href:p(e),className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsx)(w,{size:13}),e.action.label]}):(0,B.jsxs)(`button`,{type:`button`,onClick:()=>m(e),disabled:d===e.id,className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,B.jsx)(vt,{size:13,className:d===e.id?`animate-pulse`:``}),e.action.label]})]},e.id)),s.length>0&&(0,B.jsxs)(`div`,{className:`pt-1`,children:[(0,B.jsx)(`p`,{className:`px-1 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted`,children:V(`Also worth a look`)}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:s.map(e=>(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 px-1`,children:[(0,B.jsx)(`span`,{className:`mt-1.5 w-1.5 h-1.5 rounded-full shrink-0 ${e.severity===`high`||e.severity===`med`?`bg-warning`:`bg-line-strong`}`,"aria-hidden":`true`}),(0,B.jsxs)(`p`,{className:`text-[12px] leading-relaxed text-ink-soft`,children:[e.reason,e.fact&&(0,B.jsxs)(`span`,{className:`ml-1.5 text-muted`,children:[`· `,e.fact]})]})]},e.id))})]}),_&&(0,B.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-line bg-paper px-3 py-2.5`,children:[(0,B.jsx)(k,{size:16,className:`mt-0.5 shrink-0 text-ink-soft`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-ink`,children:V(`Want a hand?`)}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-ink-soft`,children:V(`Book a free setup review with our team.`)})]}),(0,B.jsx)(`a`,{href:Ho,target:`_blank`,rel:`noopener noreferrer`,className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:V(`Book`)})]})]}):(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-[13px] text-ink-soft`,children:[(0,B.jsx)(I,{size:15,className:`text-success`,"aria-hidden":`true`}),V(`You're all set — no recommendations right now.`)]})]})}var Wo=e=>e?.status===`queued`||e?.status===`running`;function Go({onOpenPanel:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(!1),d=(0,y.useRef)(null),f=(0,y.useCallback)(async()=>{try{let e=await W.request(`/score/hub-status`);n(e),i(e.runs?.[0]??null)}catch{n({available:!1})}},[]);(0,y.useEffect)(()=>{f()},[f]),(0,y.useEffect)(()=>()=>{d.current&&window.clearTimeout(d.current)},[]);let p=(0,y.useCallback)(async()=>{try{let e=await W.request(`/score/hub-status`);n(e);let t=e.runs?.[0]??null;i(t),Wo(t)?d.current=window.setTimeout(()=>void p(),5e3):t?.status===`error`&&t.error&&c(t.error)}catch{}},[]),m=(0,y.useCallback)(async()=>{o(!0),c(null);try{let e=await W.request(`/score/hub-test`,{method:`POST`,body:JSON.stringify({})});i(e.run),n(t=>t&&{...t,quota:e.quota??t.quota}),d.current=window.setTimeout(()=>void p(),5e3)}catch(e){c(e instanceof Error?e.message:V(`The test could not be started.`))}finally{o(!1)}},[p]);if(!t)return null;let h=!t.available&&Ki(t.reason);if(!t.available&&!h)return null;let g=t.available&&(t.quota?.remaining??0)===0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-lg p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,B.jsx)(_e,{size:18,className:`text-accent shrink-0`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:V(`GTmetrix test`)}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted`,children:V(g?`No tests left this month.`:`Performance score and Core Web Vitals for your home page.`)})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[t.available&&t.quota&&(0,B.jsx)(`span`,{className:`text-[11px] text-muted`,children:V(`%1$d of %2$d left`).replace(`%1$d`,String(t.quota.remaining)).replace(`%2$d`,String(t.quota.limit))}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t.available?void m():u(!0),disabled:a||Wo(r)||g,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-50`,children:[(a||Wo(r))&&(0,B.jsx)(R,{size:13,className:`animate-spin`}),Wo(r)?V(`Testing…`):V(`Run test`)]})]})]}),s&&(0,B.jsx)(`p`,{className:`mt-3 text-[12px] text-danger`,children:s}),r?.status===`done`&&e&&(0,B.jsxs)(`button`,{type:`button`,onClick:e,className:`mt-3 inline-flex items-center gap-1 text-[12px] text-accent hover:underline`,children:[V(`View the result`),(0,B.jsx)(w,{size:12})]})]}),(0,B.jsx)(qi,{open:l,onClose:()=>u(!1),local:t.local===!0,onConnected:()=>{f().then(()=>void m())}})]})}var Ko=3,qo=[`cache`,`performance`,`network`,`tools`];function Jo(e){return e.locked?`locked`:typeof e.active==`boolean`?e.active?`on`:`off`:null}function Yo({state:e}){return e===`locked`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-ink-soft`,children:[(0,B.jsx)(Pe,{size:11,"aria-hidden":`true`}),V(`Pro`)]}):e===`on`?(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] text-success`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),V(`On`)]}):e===`off`?(0,B.jsx)(`span`,{className:`text-[11px] text-muted`,children:V(`Off`)}):null}function Xo({modules:e,onNavigate:t}){let[n,r]=(0,y.useState)(!1),i=H(e),a=n?i:qo.map(e=>i.find(t=>t.id===e)).filter(e=>!!e),o=i.reduce((e,t)=>e+t.modules.length,0);return(0,B.jsxs)(`section`,{"aria-label":V(`Your setup`),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,B.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:V(`Your setup`)}),o>0&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`inline-flex items-center gap-1 text-[12px] text-ink-soft hover:text-ink underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded`,"aria-expanded":n,children:[n?V(`Show less`):`${V(`Browse all`)} ${o} ${V(`features`)}`,!n&&(0,B.jsx)(w,{size:12,"aria-hidden":`true`})]})]}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-5 gap-y-5`,children:a.map(e=>{let r=n?e.modules:e.modules.slice(0,Ko);return r.length===0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5 px-1`,children:[(0,B.jsx)(Ot,{name:e.icon,size:13,className:`text-muted`}),(0,B.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted`,children:e.label})]}),(0,B.jsx)(`div`,{className:`rounded-card border border-line bg-paper divide-y divide-line overflow-hidden`,children:r.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>t(e.slug),className:`w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,children:[(0,B.jsx)(Ot,{name:e.icon,size:15,className:`shrink-0 text-ink-soft`}),(0,B.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink-soft`,children:e.label}),(0,B.jsx)(Yo,{state:Jo(e)})]},e.slug))})]},e.id)})})]})}var Zo=6;function Qo(e){switch(e){case`success`:return`bg-success`;case`warn`:return`bg-warning`;case`error`:return`bg-red-500`;default:return`bg-line-strong`}}function $o(){let[e,t]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!0;return W.getActivity().then(n=>{e&&t(n.activity??[])}).catch(()=>{e&&t([])}),()=>{e=!1}},[]),!e||e.length===0?null:(0,B.jsxs)(`section`,{"aria-label":V(`Recent activity`),children:[(0,B.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink mb-3`,children:V(`Recent activity`)}),(0,B.jsx)(`ul`,{className:`rounded-card border border-line bg-paper divide-y divide-line`,children:e.slice(0,Zo).map((e,t)=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,B.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Qo(e.severity)}`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink-soft`,children:e.message}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted tabular-nums`,children:Tn(e.ts)})]},`${e.ts}-${t}`))})]})}var es=`https://xspeedcache.com/docs/`,ts=`https://xspeedcache.com/support/`,ns=`https://wordpress.org/support/plugin/xspeed/reviews/#new-post`;function rs(){let e=`inline-flex items-center gap-2 text-ink-soft hover:text-ink transition-colors`;return(0,B.jsxs)(`section`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2 pt-2 text-[13px]`,"aria-label":V(`Help and resources`),children:[(0,B.jsxs)(`a`,{href:es,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,B.jsx)(D,{size:14,"aria-hidden":`true`}),V(`Documentation`)]}),(0,B.jsxs)(`a`,{href:ts,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,B.jsx)(je,{size:14,"aria-hidden":`true`}),V(`Help and support`)]}),(0,B.jsxs)(`a`,{href:ns,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,B.jsx)(ut,{size:14,"aria-hidden":`true`}),V(`Review us on WordPress.org`)]})]})}function is({settings:e,stats:t,rewriteProbe:n,modules:r,onNavigate:i,showToast:a}){return(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,B.jsx)(So,{settings:e,stats:t,onNavigate:i}),(0,B.jsx)(Co,{onNavigate:i})]}),(0,B.jsx)(Bo,{modules:r}),(0,B.jsx)(Vo,{stats:t}),(0,B.jsx)(Go,{onOpenPanel:()=>i(`score`)}),(0,B.jsx)(Uo,{settings:e,stats:t,rewriteProbe:n,showToast:a}),(0,B.jsx)(Xo,{modules:r,onNavigate:i}),(0,B.jsx)($o,{}),(0,B.jsx)(rs,{})]})}var as={"critical-css":{host:`minify`,subtab:`critical`},"unused-css":{host:`minify`,subtab:`unused`},"brotli-compression":{host:`gzip`,subtab:`brotli`},images:{host:`lazy`,subtab:`images`},"smart-image":{host:`lazy`,subtab:`smart`},"smart-predict":{host:`resource-hints`,subtab:`speculation`},"prewarm-schedule":{host:`preloader`,subtab:`scheduled`},"predictive-warm":{host:`preloader`,subtab:`predictive`},"cloudflare-apo":{host:`cloudflare`},analytics:{host:`health`,subtab:`cache`},rum:{host:`health`,subtab:`visitors`},pagespeed:{host:`health`,subtab:`pagespeed`},"performance-health":{host:`health`,subtab:`pagespeed`},recommendations:{host:`health`},"cache-404":{host:`cache-coverage`,subtab:`coverage`},"search-cache":{host:`cache-coverage`,subtab:`coverage`},"feed-cache":{host:`cache-coverage`,subtab:`beyond`},"rest-cache":{host:`cache-coverage`,subtab:`beyond`},"custom-rules":{host:`cache-coverage`,subtab:`rules`},"maintenance-cache":{host:`cache-coverage`,subtab:`rules`}};function os(e){return as[e]??null}var ss=(0,y.createContext)(``);function cs({query:e,children:t}){return(0,B.jsx)(ss.Provider,{value:e,children:t})}function ls(e,t){let n=new Map(e.map(e=>[e.slug,e])),r=(e,t)=>{let r={displayLabel:e.label??e.slug,displayDescription:e.description,...t?.fieldKey?{fieldModuleSlug:e.slug}:{},...t},i=os(e.slug);if(!i)return{module:e,isChild:!1,...r};let a=n.get(i.host);return a?{module:a,subtab:i.subtab,parentLabel:a.label,isChild:!0,...r}:{module:e,isChild:!1,...r}},i=t.trim().toLowerCase();if(!i)return e.filter(e=>!os(e.slug)).map(e=>({module:e,isChild:!1,displayLabel:e.label??e.slug,displayDescription:e.description}));let a=new Set,o=e=>{if(!e)return;let t=`${e.module.slug}::${e.subtab??``}`;a.has(t)||(a.add(t),s.push(e))},s=[];for(let t of e){let e=(t.label??``).toLowerCase().includes(i),n=(t.description??``).toLowerCase().includes(i),a=(t.tab_label??``).toLowerCase().includes(i);if(e||n||a){o(r(t));continue}let s=t.schema??{},c=null;for(let[e,n]of Object.entries(s)){if(n.hidden)continue;let a=(n.label??e).toString();if(`${a} ${(n.description??``).toString()} ${n.option_labels?Object.values(n.option_labels).join(` `):``} ${e}`.toLowerCase().includes(i)){c=r(t,{fieldKey:e,fieldLabel:a});break}}c&&o(c)}return s}function us(e){let[t,n]=(0,y.useState)(``);return{query:t,setQuery:n,results:(0,y.useMemo)(()=>ls(e,t),[e,t])}}var ds=new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`,`PRE`,`CODE`,`KBD`,`SVG`,`STYLE`,`SCRIPT`]),fs=`xspeed-search`;function ps(){return typeof CSS<`u`&&!!CSS.highlights&&typeof globalThis.Highlight==`function`}function ms(e,t){let n=t.trim();if(!n)return[];let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=new RegExp(r,`gi`),a=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(t){if(!t.nodeValue||!t.nodeValue.trim())return NodeFilter.FILTER_REJECT;let n=t.parentNode;for(;n&&n!==e;){if(n instanceof Element&&ds.has(n.tagName))return NodeFilter.FILTER_REJECT;n=n.parentNode}return NodeFilter.FILTER_ACCEPT}}),s=o.nextNode();for(;s;){let e=s.nodeValue??``;i.lastIndex=0;let t;for(;(t=i.exec(e))!==null;){let e=document.createRange();e.setStart(s,t.index),e.setEnd(s,t.index+t[0].length),a.push(e),t[0].length===0&&i.lastIndex++}s=o.nextNode()}return a}function hs({query:e,children:t}){let n=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=n.current;if(!t||!ps())return;let r=CSS.highlights,i=globalThis.Highlight,a=0,o=()=>{let n=ms(t,e);if(n.length===0){r.delete(fs);return}r.set(fs,new i(...n))};o();let s=new MutationObserver(()=>{cancelAnimationFrame(a),a=requestAnimationFrame(o)});return s.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{s.disconnect(),cancelAnimationFrame(a),r.delete(fs)}},[e]),(0,B.jsx)(`div`,{ref:n,className:`contents`,children:t})}function gs(e,t){if(!e)return e;let n=t.trim();if(!n)return e;let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`(${r})`,`gi`),a=e.split(i);return a.length===1?e:(0,B.jsx)(B.Fragment,{children:a.map((e,t)=>t%2==1?(0,B.jsx)(`mark`,{className:`bg-warning-tint text-inherit rounded-sm`,children:e},t):(0,B.jsx)(y.Fragment,{children:e},t))})}function _s({open:e,onClose:t,modules:n,onSelectResult:r,onPurge:i,onPreload:a}){let{query:o,setQuery:s,results:c}=us(n),[l,u]=(0,y.useState)(0),d=(0,y.useRef)(null),f=(0,y.useRef)(null),p=(0,y.useRef)(null),m=(0,y.useRef)(null),h=(0,y.useMemo)(()=>[{id:`purge`,label:V(`Purge all`),icon:R,run:i},{id:`preload`,label:V(`Preload`),icon:Je,run:a}],[i,a]),g=(0,y.useMemo)(()=>{let e=o.trim().toLowerCase();return[...h.filter(t=>!e||t.label.toLowerCase().includes(e)).map(e=>({kind:`command`,command:e})),...c.slice(0,40).map(e=>({kind:`result`,result:e}))]},[h,c,o]);if((0,y.useEffect)(()=>{if(e){m.current=document.activeElement??null,s(``),u(0);let e=window.requestAnimationFrame(()=>d.current?.focus());return()=>window.cancelAnimationFrame(e)}m.current?.focus?.()},[e]),(0,y.useEffect)(()=>{u(e=>Math.min(e,Math.max(0,g.length-1)))},[g.length]),(0,y.useEffect)(()=>{e&&f.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[l,e]),(0,y.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),Fi(e),!e)return null;let _=e=>{e.kind===`command`?e.command.run():r(e.result),t()},v=e=>{if(e.key===`Escape`)e.preventDefault(),t();else if(e.key===`ArrowDown`)e.preventDefault(),u(e=>g.length?(e+1)%g.length:0);else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>g.length?(e-1+g.length)%g.length:0);else if(e.key===`Enter`){e.preventDefault();let t=g[l];t&&_(t)}else e.key===`Tab`&&e.preventDefault()},b=e=>`xspeed-cmdk-opt-${e}`;return(0,B.jsxs)(`div`,{className:`fixed inset-0 z-[100000] flex items-start justify-center px-4 pt-[12vh]`,onMouseDown:e=>{p.current&&!p.current.contains(e.target)&&t()},children:[(0,B.jsx)(`div`,{className:`absolute inset-0 bg-black/40`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{ref:p,role:`dialog`,"aria-modal":`true`,"aria-label":V(`Command palette`),className:`relative w-full max-w-xl rounded-card border border-line bg-paper shadow-xl overflow-hidden`,onKeyDown:v,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-line`,children:[(0,B.jsx)(et,{size:18,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,B.jsx)(`input`,{ref:d,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`xspeed-cmdk-list`,"aria-activedescendant":g.length?b(l):void 0,"aria-label":V(`Search settings, modules, actions`),value:o,onChange:e=>{s(e.target.value),u(0)},placeholder:V(`Search settings, modules, actions…`),className:`w-full bg-transparent py-0.5 text-[15px] text-ink placeholder-muted focus:outline-none`}),(0,B.jsx)(`kbd`,{className:`shrink-0 hidden sm:inline-flex items-center h-[20px] px-1.5 rounded text-[10px] font-medium bg-panel text-muted`,children:`esc`})]}),g.length===0?(0,B.jsx)(`div`,{className:`px-4 py-8 text-center text-[13px] text-muted`,children:V(`No matches`)}):(0,B.jsx)(`ul`,{ref:f,id:`xspeed-cmdk-list`,role:`listbox`,"aria-label":V(`Results`),className:`max-h-[52vh] overflow-y-auto py-1.5`,children:g.map((e,t)=>{let n=t===l,r=`flex items-center gap-3 px-4 py-2 cursor-pointer ${n?`bg-primary-tint`:``}`;if(e.kind===`command`){let i=e.command.icon;return(0,B.jsxs)(`li`,{id:b(t),role:`option`,"aria-selected":n,className:r,onMouseEnter:()=>u(t),onMouseDown:t=>{t.preventDefault(),_(e)},children:[(0,B.jsx)(`span`,{className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-control bg-panel text-ink-soft`,children:(0,B.jsx)(i,{size:14,"aria-hidden":`true`})}),(0,B.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink`,children:gs(e.command.label,o)}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:V(`Action`)}),n&&(0,B.jsx)(se,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]},`cmd-${e.command.id}`)}let i=e.result,a=i.parentLabel??Rt(zt(i.module.slug)??``)?.label??``;return(0,B.jsxs)(`li`,{id:b(t),role:`option`,"aria-selected":n,className:r,onMouseEnter:()=>u(t),onMouseDown:t=>{t.preventDefault(),_(e)},children:[(0,B.jsx)(`span`,{className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-control bg-panel text-ink-soft`,children:(0,B.jsx)(Ot,{name:i.module.icon,size:14})}),(0,B.jsxs)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink`,children:[gs(i.displayLabel,o),i.fieldLabel&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` · `,gs(i.fieldLabel,o)]})]}),a&&(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:a}),n&&(0,B.jsx)(se,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]},`res-${i.module.slug}:${i.subtab??``}:${i.fieldKey??``}`)})})]})]})}var vs=null,ys=0,bs=`xspeed-field-blink`,xs=40;function Ss(e,t){if(vs!==e)return;let n=document.querySelector(`[data-field-anchor="${ws(e)}"]`);if(n&&n.offsetParent!==null){vs=null,n.scrollIntoView({block:`center`,behavior:`smooth`}),n.classList.remove(bs),n.offsetWidth,n.classList.add(bs);let e=()=>n.classList.remove(bs);n.addEventListener(`animationend`,e,{once:!0}),window.setTimeout(e,1500);return}t<xs?ys=window.requestAnimationFrame(()=>Ss(e,t+1)):vs=null}function Cs(e,t){if(typeof window>`u`)return;let n=`${e}:${t}`;vs=n,window.cancelAnimationFrame(ys),ys=window.requestAnimationFrame(()=>Ss(n,0))}function ws(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`)}function Ts(e){if(e.view===`overview`)return`#/overview`;if(e.view===`pro`)return`#/pro`;if(e.view===`group`)return`#/${e.group}`;let t=`#/${e.group}/${e.module}`;return e.subtab&&(t+=`/${e.subtab}`),t}function Es(e){if(!e)return{};let t=new URLSearchParams(e);return{focus:t.get(`focus`)||void 0,suggest:t.get(`suggest`)??void 0}}var Ds={"migration-pro":{module:`migration`}};function Os(e){return e.module===`lazy`&&e.subtab===`fonts`?{...e,group:zt(`fonts`)??e.group,module:`fonts`,subtab:``}:e}function ks(e){let t=(e||``).replace(/^#/,``),n=t.indexOf(`?`),r=n===-1?t:t.slice(0,n),{focus:i,suggest:a}=Es(n===-1?``:t.slice(n+1));if(r.startsWith(`/`)){let e=r.slice(1).split(`/`).filter(Boolean);return e.length===0||e[0]===`overview`?{view:`overview`,focus:i,suggest:a}:e[0]===`pro`?{view:`pro`,focus:i,suggest:a}:Lt.includes(e[0])?e.length===1?{view:`group`,group:e[0],focus:i,suggest:a}:Os({view:`module`,group:e[0],module:e[1],subtab:e[2]||``,focus:i,suggest:a}):{view:`overview`,focus:i,suggest:a}}let o=Fn(e),s=o.module;if(!s||s===`overview`)return{view:`overview`,focus:o.focus,suggest:o.suggest,legacy:!0};let c=Ds[s],l=c?c.module:s;c?.subtab&&!o.subtab&&(o.subtab=c.subtab);let u=zt(l);return u?Os({view:`module`,group:u,module:l,subtab:o.subtab??``,focus:o.focus,suggest:o.suggest,legacy:!0}):{view:`overview`,focus:o.focus,suggest:o.suggest,legacy:!0}}function As(e,t){if(t!==`free`)return e;let n=new Set(e.map(e=>e.slug)),r=Pt.filter(e=>!n.has(e.slug)&&!e.embedded).map(e=>({slug:e.slug,tier:`pro`,version:`0.0.0`,label:e.label,icon:e.icon,description:e.description,settings:{},schema:{},locked:!0}));return[...e,...r]}var js=`xspeed-theme`,Ms=`xspeed_theme`;function Ns(e){document.cookie=`${Ms}=${e}; path=/; max-age=31536000; SameSite=Lax`}function Ps(){let[e,t]=(0,y.useState)(()=>localStorage.getItem(js)===`dark`?`dark`:`light`);return(0,y.useEffect)(()=>{let t=document.getElementById(`xspeed-app`);t&&(t.classList.toggle(`dark`,e===`dark`),document.body.classList.toggle(`xspeed-dark`,e===`dark`),localStorage.setItem(js,e),Ns(e))},[e]),{theme:e,toggle:()=>t(e=>e===`dark`?`light`:`dark`)}}function Fs(){let e=$t(),[t,n]=(0,y.useState)({}),[r,i]=(0,y.useState)(()=>window.XSpeedConfig?.bootstrap?.modules??[]);(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{W.getModules().then(i).catch(()=>void 0)};return window.addEventListener(`xspeed:tier-changed`,e),()=>window.removeEventListener(`xspeed:tier-changed`,e)},[]);let a=(0,y.useMemo)(()=>As(r,e).map(e=>t[e.slug]?{...e,settings:t[e.slug]}:e),[e,t,r]),o=(0,y.useCallback)((e,t)=>{n(n=>({...n,[e]:t})),W.getModules().then(i).catch(()=>void 0),e===`white-label`&&W.getBranding().then(e=>{window.XSpeedPro?.setBranding?.(e)}).catch(()=>void 0)},[]),s=(0,y.useCallback)((e,t)=>{let n=In(e);n&&(Cs(n.module,n.field),ha(t===void 0?null:{module:n.module,field:n.field,value:t}))},[]),[c,l]=(0,y.useState)(()=>ks(window.location.hash));(0,y.useEffect)(()=>{let e=ks(window.location.hash);if(e.legacy){let t=Ts(e);window.location.hash!==t&&history.replaceState(null,``,t)}s(e.focus,e.suggest)},[]),(0,y.useEffect)(()=>{let e=Ts(c);typeof window<`u`&&window.location.hash!==e&&history.replaceState(null,``,e)},[c]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=ks(window.location.hash);l(e),s(e.focus,e.suggest)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[s]);let u=(0,y.useRef)(null),d=(0,y.useCallback)(()=>{u.current?.scrollTo({top:0})},[]),f=(0,y.useCallback)(e=>{d(),l(e===`overview`?{view:`overview`}:{view:`group`,group:e})},[d]),p=(0,y.useCallback)((e,t=``)=>{let n=zt(e);n&&(d(),l({view:`module`,group:n,module:e,subtab:t}))},[d]),m=(0,y.useCallback)(()=>l({view:`pro`}),[]),h=c.view===`overview`?Bt:c.group??`overview`,g=c.view===`module`?c.module??null:null,_=c.view===`module`?c.subtab??``:``,v=(0,y.useMemo)(()=>g?a.find(e=>e.slug===g)??null:null,[a,g]);(0,y.useEffect)(()=>{u.current?.scrollTo({top:0})},[`${c.view}:${c.group??``}:${c.module??``}`]);let b=window.XSpeedConfig?.bootstrap,[x,S]=(0,y.useState)(b?.settings??null),[C,w]=(0,y.useState)(b?.status?.stats??null),[T,E]=(0,y.useState)(b?.status?.rewrite_probe??null),[D,O]=(0,y.useState)(b?.status?.mobile_separate??null),[k,A]=(0,y.useState)(b?.status?.nginx_server_block??null),[j,M]=(0,y.useState)(b?.status?.dropin??null),[ee,N]=(0,y.useState)(null),[P,te]=(0,y.useState)(!1),[ne,F]=(0,y.useState)(null),I=(0,y.useRef)(null),re=(0,y.useRef)(!0),[ie,ae]=(0,y.useState)(!1),[oe,se]=(0,y.useState)(!1),{collapsed:ce,toggle:le}=cn(),[L,ue]=(0,y.useState)(!1),[de,fe]=(0,y.useState)(!1),{theme:pe,toggle:me}=Ps(),[he,ge]=(0,y.useState)(!1),_e=(0,y.useCallback)(e=>{p(e.module.slug,e.subtab??``),e.fieldKey&&Cs(e.fieldModuleSlug??e.module.slug,e.fieldKey)},[p]);(0,y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),e.stopPropagation(),ge(e=>!e))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[]);let ve=(0,y.useRef)(null),[ye,be]=(0,y.useState)(!1),[xe,Se]=(0,y.useState)(!1),[Ce,we]=(0,y.useState)(0),Te=(0,y.useCallback)((e,t=2e3,n=!1,r=!1)=>{ve.current&&window.clearTimeout(ve.current),be(n),Se(r),we(e=>e+1),N(e),ve.current=window.setTimeout(()=>{N(null),ve.current=null},t)},[]);(0,y.useEffect)(()=>(re.current=!0,()=>{re.current=!1,ve.current&&window.clearTimeout(ve.current),I.current&&window.clearTimeout(I.current)}),[]),(0,y.useEffect)(()=>{W.request(`/mcp/hub`).then(e=>fe(e?.attached===!0)).catch(()=>void 0)},[]),(0,y.useEffect)(()=>{x&&C||Promise.all([W.getSettings(),W.getStatus()]).then(([e,t])=>{S(e),w(t.stats),E(t.rewrite_probe??null),O(t.mobile_separate??null),A(t.nginx_server_block??null),M(t.dropin??null)}).catch(()=>Te(V(`Failed to load`)))},[]);let Ee=(0,y.useCallback)(async e=>{if(!x||oe)return;se(!0);let t=x;S({...x,cache_enabled:e}),w(e=>e&&{...e,page_cache_serving:void 0,page_cache_blocked_reason:null});try{let t=await W.toggleCache(e);S(e=>e&&{...e,cache_enabled:t.enabled}),W.getModules().then(i).catch(()=>void 0),w(t.stats),A(t.install_state.nginx_server_block??null),!t.blocked&&t.install_state.dropin_installed&&M(null),t.blocked?Te(t.blocked_reason??V(`Cache could not be enabled.`),1e4,!0):e&&!t.install_state.wp_cache_constant&&t.install_state.manual_snippet?Te(V(`Cache enabled, but nothing will be cached until WP_CACHE is added to wp-config.php — copy the line from Health.`),1e4):e&&t.install_state.nginx_snippet?Te(`Cache enabled. nginx detected — re-run the setup wizard to copy the server-block snippet for max speed.`):Te(V(e?`Cache enabled`:`Cache disabled`))}catch{S(t),Te(V(e?`Failed to enable cache`:`Failed to disable cache`))}finally{se(!1)}},[x,Te,oe]),De=(0,y.useCallback)(async()=>{if(P)return;I.current&&window.clearTimeout(I.current),F(null),te(!0);let e=`failed`;try{let t=await W.purge();w(t.stats);let n=Nn(t.report);e=n.outcome,Te(n.message,n.ms,n.urgent,n.outcome===`cleared`)}catch(e){let t=e instanceof Error?e.message:``;Te(t?Nt(V(`Purge failed: %s`),t):V(`Purge failed`),1e4,!0)}finally{re.current&&(te(!1),F(e),I.current=window.setTimeout(()=>{F(null),I.current=null},2e3))}},[P,Te]),Oe=(0,y.useCallback)(async()=>{if(!ie){ae(!0);try{await W.preload(),Te(V(`Preload started`))}catch{Te(V(`Preload could not start`))}finally{ae(!1)}}},[ie,Te]),ke=(0,y.useCallback)(async()=>{try{let e=await W.getStatus();w(e.stats),E(e.rewrite_probe??null),O(e.mobile_separate??null),A(e.nginx_server_block??null),M(e.dropin??null)}catch{}},[]),Ae=(0,y.useCallback)(()=>p(`mcp`),[p]),je=(0,y.useMemo)(()=>{if(c.view===`overview`)return{current:V(`Overview`)};if(c.view===`group`)return{current:Rt(c.group??``)?.label??``};let e=Rt(c.group??``),t=c.module===`logs`?V(`Logs`):v?.label??c.module??``;return{backLabel:e?.label,onBack:()=>f(c.group??`overview`),current:t}},[c,v,f]),Me=(0,B.jsx)(on,{activeGroup:h,onNavigate:f,onUpgrade:m,onManageLicense:()=>p(`license`),modules:a,collapsed:ce,onToggleCollapse:le,mobileOpen:L,onCloseMobile:()=>ue(!1)}),Ne=(0,B.jsx)(pn,{crumb:je,onOpenSearch:()=>ge(!0),onOpenNav:()=>ue(!0),onPurge:De,onToggleCache:Ee,cacheDropin:j,onConnectHub:Ae,purging:P,purgeOutcome:ne,cacheEnabled:x?.cache_enabled??!1,cacheBusy:oe,cacheReady:!!x,hubConnected:de,theme:pe,onToggleTheme:me});if(!x||!C)return(0,B.jsxs)(cs,{query:``,children:[Me,(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[Ne,(0,B.jsx)(`main`,{className:`flex-1 flex bg-canvas`,children:(0,B.jsx)(kn,{})})]})]});let Pe=c.view===`module`&&c.module!==`logs`&&!v;return(0,B.jsxs)(cs,{query:``,children:[Me,(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[Ne,(0,B.jsx)(`main`,{ref:u,className:`flex-1 overflow-auto bg-canvas`,children:(0,B.jsx)(hs,{query:``,children:(0,B.jsxs)(`div`,{className:`px-4 sm:px-6 lg:px-8 py-5 sm:py-6`,children:[c.view===`overview`&&(0,B.jsx)(is,{settings:x,stats:C,rewriteProbe:T,modules:a,onNavigate:p,showToast:Te}),c.view===`pro`&&(0,B.jsx)(vo,{}),(c.view===`group`||Pe)&&(0,B.jsx)(_n,{groupId:c.group??`cache`,modules:a,onOpen:p}),c.view===`module`&&c.module===`logs`&&(0,B.jsx)(On,{}),c.view===`module`&&v&&(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(xn,{module:v,eyebrow:Rt(c.group??``)?.label}),v.slug===`cache`&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ra,{probe:T,onOpenHealth:()=>p(`health`)}),(0,B.jsx)(Ba,{mobile:D,onOpenCacheSettings:()=>p(`cache`)}),(0,B.jsx)(ro,{stats:C}),(0,B.jsx)(io,{}),(0,B.jsx)(to,{settings:x,stats:C,onToggle:Ee,onPurge:De,dropin:j}),(0,B.jsx)(Ua,{snippet:k,topology:T?.topology,focus:c.focus}),(0,B.jsx)(ho,{}),(0,B.jsx)(ao,{}),(0,B.jsx)(so,{})]}),(0,B.jsx)(ja,{module:v,subtab:_,onSubtabChange:e=>l(t=>t.view===`module`?{...t,subtab:e}:t),getModule:e=>a.find(t=>t.slug===e),onSaved:e=>{o(v.slug,e),ke()}})]})]})})})]}),ee&&(0,B.jsx)(An,{message:ee,urgent:ye,sweep:xe,sweepKey:Ce}),(0,B.jsx)(`div`,{id:`xspeed-toast-host`}),(0,B.jsx)(_s,{open:he,onClose:()=>ge(!1),modules:a,onSelectResult:_e,onPurge:De,onPreload:Oe})]})}var Is=[{id:`review`,label:`Environment`},{id:`configure`,label:`Configure`},{id:`done`,label:`Summary`},{id:`connect`,label:`Connect`}];function Ls(){return typeof window>`u`?!1:!!window.XSpeedConfig?.bootstrap?.hub?.attached}function Rs({current:e,showConnect:t=!Ls()}){let n=t||e===`connect`?Is:Is.filter(e=>e.id!==`connect`).map(e=>e.id===`done`?{...e,label:`Done`}:e),r=n.findIndex(t=>t.id===e);return(0,B.jsx)(`div`,{className:`flex items-center justify-center gap-2 sm:gap-3 py-4 sm:py-5 border-b border-line`,children:n.map((e,t)=>{let i=t<r,a=t===r;return(0,B.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-medium transition-colors ${a?`bg-primary text-on-primary`:i?`bg-success text-white`:`bg-line text-muted`}`,children:i?(0,B.jsx)(M,{size:12}):t+1}),(0,B.jsx)(`span`,{className:`hidden sm:inline text-[13px] font-medium ${a?`text-ink`:i?`text-ink-soft`:`text-faint`}`,children:e.label})]}),t<n.length-1&&(0,B.jsx)(`span`,{className:`w-8 sm:w-12 h-px ${i?`bg-success`:`bg-line`}`})]},e.id)})})}function zs({step:e,hero:t,children:n,footer:r}){return(0,B.jsxs)(`div`,{className:`max-w-3xl mx-auto my-6 sm:my-10 bg-paper border border-line rounded-card overflow-hidden flex flex-col`,children:[(0,B.jsx)(Rs,{current:e}),t,(0,B.jsx)(`div`,{className:`px-4 sm:px-6 py-2 space-y-4`,children:n}),r&&(0,B.jsx)(`div`,{className:`border-t border-line px-4 sm:px-6 py-3 sm:py-4 flex items-center justify-between gap-3 bg-paper mt-6`,children:r})]})}function Bs({icon:e,logo:t,title:n,subtitle:r}){return(0,B.jsxs)(`div`,{className:`text-center max-w-2xl mx-auto px-4 sm:px-6 py-6 sm:py-8`,children:[t?(0,B.jsx)(`div`,{className:`mb-3 flex justify-center`,children:t}):e&&(0,B.jsx)(`div`,{className:`mb-3 flex justify-center`,children:(0,B.jsx)(e,{size:28,className:`text-primary`})}),(0,B.jsx)(`h1`,{className:`text-[22px] sm:text-[24px] font-semibold text-ink leading-tight`,children:n}),r&&(0,B.jsx)(`p`,{className:`text-[13px] text-muted mt-2`,children:r})]})}function Vs({children:e,onClick:t,disabled:n,type:r=`button`}){return(0,B.jsx)(`button`,{type:r,onClick:t,disabled:n,className:`px-4 py-2 rounded text-[13px] font-medium flex items-center gap-1.5 transition-colors ${n?`bg-primary text-on-primary opacity-50 cursor-not-allowed`:`bg-primary text-on-primary hover:bg-primary-hover`}`,children:e})}function Hs({children:e,onClick:t}){return(0,B.jsx)(`button`,{type:`button`,onClick:t,className:`text-[13px] text-muted hover:text-ink transition-colors`,children:e})}function Us({step:e,rows:t=3}){return(0,B.jsxs)(`div`,{className:`max-w-3xl mx-auto my-6 sm:my-10 bg-paper border border-line rounded-card overflow-hidden flex flex-col`,children:[(0,B.jsx)(Rs,{current:e}),(0,B.jsxs)(`div`,{className:`text-center max-w-2xl mx-auto px-4 sm:px-6 py-6 sm:py-8 w-full`,children:[(0,B.jsx)(`div`,{className:`mx-auto mb-4 h-11 w-11 rounded-card bg-line motion-safe:animate-pulse`}),(0,B.jsx)(`div`,{className:`mx-auto h-5 w-1/2 rounded bg-line motion-safe:animate-pulse`}),(0,B.jsx)(`div`,{className:`mx-auto mt-3 h-3 w-3/4 rounded bg-panel motion-safe:animate-pulse`})]}),(0,B.jsx)(`div`,{className:`px-4 sm:px-6 py-2 space-y-3 pb-8`,children:(0,B.jsx)(`div`,{className:`rounded-card border border-line bg-panel px-5 py-5 space-y-3`,children:Array.from({length:t}).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-line motion-safe:animate-pulse shrink-0`}),(0,B.jsx)(`div`,{className:`h-3 rounded bg-line motion-safe:animate-pulse`,style:{width:`${80-t*12}%`}})]},t))})})]})}function Ws({initialHub:e,onNext:t,onSkip:n}){let{status:r,connectUrl:i,error:a,attached:o,hasToken:s,busy:c,loaded:l,generateToken:u}=Wi({active:!0,initial:e}),[d,f]=(0,y.useState)(!1);return!l&&!o?(0,B.jsx)(Us,{step:`connect`,rows:3}):o?(0,B.jsx)(zs,{step:`connect`,hero:(0,B.jsx)(Bs,{icon:M,title:V(`Connected to xSpeed Hub`),subtitle:r?.account_email?Nt(V(`Connected as %s. Your caching is ready to manage from anywhere.`),r.account_email):V(`Your caching is ready to manage from anywhere.`)}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`text-[12px] text-faint`,children:V(`You're all set`)}),(0,B.jsxs)(Vs,{onClick:t,children:[V(`Go to Dashboard`),(0,B.jsx)(w,{size:14})]})]}),children:(0,B.jsxs)(`div`,{className:`rounded-card border border-line bg-success-tint px-4 py-3.5`,children:[(0,B.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-success mb-2.5`,children:V(`Now unlocked`)}),(0,B.jsx)(`ul`,{className:`space-y-2`,children:[V(`One AI connection controls the cache on every site you connect`),V(`Purge, benchmark, preload and tune settings by asking your AI`),V(`Manage this site from the central xSpeed Hub dashboard`)].map(e=>(0,B.jsxs)(`li`,{className:`flex items-start gap-2 text-[12.5px] text-ink-soft`,children:[(0,B.jsx)(M,{size:14,className:`text-success mt-0.5 shrink-0`}),e]},e))})]})}):(0,B.jsxs)(zs,{step:`connect`,hero:(0,B.jsx)(Bs,{logo:(0,B.jsx)(rn,{className:`w-11 h-11 rounded-card`}),title:V(`Run your site just by asking`),subtitle:V(`Connect this site to your free xSpeed Hub — then manage caching here and on every other site straight from ChatGPT, Claude, or any AI assistant. Free, forever.`)}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Hs,{onClick:n,children:V(`I'll connect later`)}),(0,B.jsxs)(Vs,{onClick:t,children:[V(`Go to Dashboard`),(0,B.jsx)(w,{size:14})]})]}),children:[a&&(0,B.jsx)(Rn,{tone:`danger`,title:V(`xSpeed Hub error`),body:a}),(0,B.jsxs)(`div`,{className:`rounded-card bg-panel border border-line px-5 sm:px-8 py-5 sm:py-6`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-ink mb-4`,children:V(`Your Hub is home base for all your sites. Once connected, you can:`)}),(0,B.jsxs)(`ul`,{className:`space-y-3.5`,children:[(0,B.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(St,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,B.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:V(`Just say what you want`)}),` — `,(0,B.jsx)(`em`,{className:`not-italic text-ink`,children:V(`“clear the cache on my store,” “warm up the homepage,” “how fast is my blog?”`)}),` — `,V(`and it happens.`)]})]}),(0,B.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(be,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,B.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:V(`Run every site from one place`)}),` — `,V(`no logging into each dashboard separately.`)]})]}),(0,B.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(ve,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,B.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,B.jsx)(`span`,{className:`font-medium text-ink`,children:V(`Get more over time`)}),` — `,V(`new Hub features arrive automatically, free.`)]})]})]}),(0,B.jsx)(`p`,{className:`text-[13px] mt-4`,children:(0,B.jsx)(`a`,{href:`${r?.hub_url??`https://xspeedcache.com`}`,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:V(`See everything it does.`)})})]}),(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-3 pt-2`,children:[(0,B.jsxs)(`a`,{href:i,className:`inline-flex items-center justify-center gap-2 px-8 py-3 rounded-md text-[14px] font-semibold bg-primary text-on-primary hover:bg-primary-hover transition-colors shadow-sm`,children:[(0,B.jsx)(ct,{size:16}),V(`Connect to xSpeed Hub`)]}),(0,B.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:[V(`Free forever`),V(`Under a minute`),V(`No card, no catch`)].map(e=>(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11.5px] text-muted`,children:[(0,B.jsx)(M,{size:13,className:`text-success`}),e]},e))})]}),(0,B.jsxs)(`div`,{className:`border-t border-line pt-3 text-center`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>{s||u(),f(e=>!e)},className:`inline-flex items-center gap-1.5 text-[11.5px] text-faint hover:text-ink-soft transition-colors`,children:[c===`token`?(0,B.jsx)(R,{size:12,className:`animate-spin`}):(0,B.jsx)(Oe,{size:12}),V(`No redirect? Connect with a token instead.`)]}),d&&(0,B.jsxs)(`div`,{className:`mt-3 space-y-2 text-left`,children:[(0,B.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[V(`Paste this site’s URL + token into the`),` `,(0,B.jsxs)(`a`,{href:r?.add_site_url,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline inline-flex items-center gap-0.5`,children:[V(`Add site form`),` `,(0,B.jsx)(L,{size:11})]}),` `,V(`on your xSpeed Hub account.`)]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:V(`Site URL`)}),(0,B.jsx)(qn,{content:r?.site_url??``})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:V(`Token`)}),(0,B.jsx)(qn,{content:r?.site_token??``,tone:`blue`})]})]})]})]})}var Gs={apache:`Apache`,litespeed:`LiteSpeed`,nginx:`nginx`,iis:`IIS`,unknown:`Unknown`};function Ks({env:e,onNext:t}){let n=Xt(),r=!!n.logo_svg?.trim(),i=e.conflicts.length>0,a=e.wp.ok?`ok`:`fail`,o=e.php.modern?`ok`:e.php.ok?`warn`:`fail`,s=e.cache_dir.writable?`ok`:`fail`,c=e.permalinks_ok?`ok`:`warn`,l=i?`warn`:`ok`,u=e.server.gzip_mode===`auto`?`GZIP can be auto-configured via .htaccess.`:`GZIP requires a manual server-config snippet (we'll show it).`;return(0,B.jsx)(zs,{step:`review`,hero:(0,B.jsx)(Bs,{icon:Je,logo:r?(0,B.jsx)(rn,{className:`w-8 h-8 rounded`}):void 0,title:`Let's review your setup`,subtitle:`A quick 30-second check of your environment before we turn on a sensible caching profile.`}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{}),(0,B.jsxs)(Vs,{onClick:t,children:[`Get Started`,(0,B.jsx)(w,{size:14})]})]}),children:(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:[(0,B.jsx)(Kn,{first:!0,tone:a,label:`WordPress ${e.wp.version}`,detail:e.wp.ok?`Meets the 6.0+ minimum.`:`Upgrade to 6.0 or higher.`}),(0,B.jsx)(Kn,{tone:o,label:`PHP ${e.php.version}`,detail:e.php.modern?`Modern PHP — full speed.`:e.php.ok?`Works, but 8.1+ is recommended for best performance.`:`Upgrade to PHP 7.4 or higher.`}),(0,B.jsx)(Kn,{tone:`info`,label:`Server: ${Gs[e.server.type]}`,detail:u}),(0,B.jsx)(Kn,{tone:s,label:`Cache directory writable`,detail:e.cache_dir.writable?e.cache_dir.path:`Cannot write to ${e.cache_dir.path}. Adjust file permissions before continuing.`}),(0,B.jsx)(Kn,{tone:c,label:`Permalinks`,detail:e.permalinks_ok?`Pretty permalinks active.`:`Set permalinks to anything other than "Plain" — required for page caching.`}),(0,B.jsx)(Kn,{tone:l,label:`Caching plugin conflicts`,detail:i?`Detected: ${e.conflicts.join(`, `)}. Another page cache must be off, and its advanced-cache.php gone, before ${n.name} can enable its own.`:`No other caching plugins detected.`})]})})}var qs=[{value:12,label:`12 hours`},{value:24,label:`24 hours`},{value:168,label:`7 days`},{value:720,label:`30 days`}],Js={cache_enabled:!0,minify_html:!0,minify_css:!0,minify_js:!1,defer_js:!1,gzip_enabled:!0,lazy_images:!0,browser_cache:!0,resource_hints:!0,cache_expiry:168},Ys=[{id:`conservative`,label:`Conservative`,description:`Page cache + GZIP only. No minify, no lazy-load, no browser cache headers. Safest on themes with finicky CSS / JS.`,icon:rt,choices:{cache_enabled:!0,minify_html:!1,minify_css:!1,minify_js:!1,defer_js:!1,gzip_enabled:!0,lazy_images:!1,browser_cache:!1,cache_expiry:12}},{id:`balanced`,label:`Balanced`,description:`Cache + GZIP + safe minify (HTML/CSS only) + lazy images + browser cache headers + LCP image preload & font preconnect, with a 7-day cache lifetime. Recommended for most sites.`,icon:St,choices:Js},{id:`aggressive`,label:`Aggressive`,description:`Everything Balanced does, plus JS minify + defer non-critical JS. Test after enabling — some themes break.`,icon:ge,choices:{...Js,minify_js:!0,defer_js:!0}}],Xs={cache_enabled:`Enable Page Cache`,minify_html:`Minify HTML`,minify_css:`Minify CSS`,minify_js:`Minify JS`,defer_js:`Defer JavaScript`,gzip_enabled:`Enable GZIP Compression`,lazy_images:`Lazy-load Images`,browser_cache:`Browser cache headers`,resource_hints:`LCP image preload + preconnect`};function Zs(e,t){return e?Object.keys(Xs).filter(n=>e[n]===!1&&t[n]===!0).map(e=>Xs[e]):[]}function Qs(e,t){return e?Object.keys(Xs).filter(n=>e[n]===!0&&t[n]!==!0).map(e=>Xs[e]):[]}function $s(e){if(e>=24&&e%24==0){let t=e/24;return`${t} day${t===1?``:`s`}`}return`${e} hour${e===1?``:`s`}`}function ec(e,t){if(!e)return[];let n=e.cache_expiry,r=t.cache_expiry;return typeof n!=`number`||typeof r!=`number`||n===r?[]:[`Cache expiry: ${$s(n)} → ${$s(r)}`]}function tc(e){let t=e;return Ys.find(e=>Object.entries(e.choices).every(([e,n])=>t[e]===n))?.id??`custom`}function nc(){return{...Js}}function rc({env:e,initial:t,current:n,onApply:r,onSkip:i,onBack:a,busy:o}){let[s,c]=(0,y.useState)(t),l=(e,t)=>c(n=>({...n,[e]:t})),u=e=>c(t=>({...t,...e.choices})),d=(0,y.useMemo)(()=>tc(s),[s]),f=(0,y.useMemo)(()=>Qs(n,s),[n,s]),p=(0,y.useMemo)(()=>Zs(n,s),[n,s]),m=(0,y.useMemo)(()=>ec(n,s),[n,s]),h=(0,y.useMemo)(()=>{let e=s.cache_expiry;return typeof e!=`number`||qs.some(t=>t.value===e)?qs:[...qs,{value:e,label:$s(e)}].sort((e,t)=>e.value-t.value)},[s.cache_expiry]);return(0,B.jsxs)(zs,{step:`configure`,hero:(0,B.jsx)(Bs,{icon:nt,title:`Pick a starting point`,subtitle:`Choose a preset to fill the toggles below — or skip and configure each one yourself. You can change everything later.`}),footer:(0,B.jsxs)(B.Fragment,{children:[a&&(0,B.jsxs)(Hs,{onClick:a,children:[(0,B.jsx)(C,{size:14}),` Back`]}),(0,B.jsx)(Hs,{onClick:i,children:`Skip — I'll configure manually`}),(0,B.jsxs)(Vs,{onClick:()=>r(s),disabled:o,children:[o?`Applying…`:`Apply & Continue`,!o&&(0,B.jsx)(w,{size:14})]})]}),children:[(f.length>0||p.length>0||m.length>0)&&(0,B.jsxs)(`div`,{role:`status`,className:`flex gap-2.5 rounded-card border border-warning bg-warning-tint p-3.5 text-[13px] text-ink`,children:[(0,B.jsx)(gt,{size:16,className:`mt-px shrink-0 text-warning`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{className:`m-0`,children:[f.length>0&&(0,B.jsxs)(`p`,{className:`m-0`,children:[`Applying will turn off `,(0,B.jsx)(`strong`,{children:f.join(`, `)}),`, which`,` `,f.length===1?`is`:`are`,` currently on. Switch`,` `,f.length===1?`it`:`them`,` back on below to keep`,` `,f.length===1?`it`:`them`,`.`]}),p.length>0&&(0,B.jsxs)(`p`,{className:f.length>0?`m-0 mt-1.5`:`m-0`,children:[`Applying will turn on `,(0,B.jsx)(`strong`,{children:p.join(`, `)}),`, which`,` `,p.length===1?`is`:`are`,` currently off.`]}),m.length>0&&(0,B.jsxs)(`p`,{className:f.length>0||p.length>0?`m-0 mt-1.5`:`m-0`,children:[`Applying will also change `,(0,B.jsx)(`strong`,{children:m.join(`, `)}),`.`]})]})]}),(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2.5`,children:Ys.map(e=>{let t=e.icon,n=d===e.id;return(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`text-left rounded-card p-3.5 border transition-colors ${n?`border-primary bg-primary-tint`:`border-line bg-paper hover:border-line-strong`}`,"aria-pressed":n,children:[(0,B.jsx)(t,{size:16,className:n?`text-primary`:`text-muted`}),(0,B.jsx)(`div`,{className:`text-[13px] font-medium mt-1.5 ${n?`text-primary`:`text-ink`}`,children:e.label}),(0,B.jsx)(`div`,{className:`text-[11px] text-muted mt-0.5 leading-snug`,children:e.description})]},e.id)})}),d===`custom`&&(0,B.jsx)(`div`,{className:`text-[11px] text-muted -mt-1`,children:`These toggles don't match any preset. Pick one above to replace them, or keep adjusting individually.`}),(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:[(0,B.jsx)(ic,{first:!0,label:`Enable Page Cache`,hint:`Serve static HTML to non-logged-in visitors. The single biggest speed win.`,checked:s.cache_enabled,onChange:e=>l(`cache_enabled`,e)}),(0,B.jsx)(ic,{label:`Minify HTML`,hint:`Strip whitespace and comments from HTML output.`,checked:s.minify_html,onChange:e=>l(`minify_html`,e)}),(0,B.jsx)(ic,{label:`Minify CSS`,hint:`Compress and rewrite enqueued local stylesheets.`,checked:s.minify_css,onChange:e=>l(`minify_css`,e)}),(0,B.jsx)(ic,{label:`Minify JS`,hint:`Compress enqueued local scripts. Higher conflict risk than HTML/CSS — turn off if scripts break.`,checked:s.minify_js,onChange:e=>l(`minify_js`,e)}),(0,B.jsx)(ic,{label:`Defer JavaScript`,hint:`Add defer to enqueued <script> tags so they don't block first paint. Safest paired with Minify JS off; flip on after testing.`,checked:s.defer_js,onChange:e=>l(`defer_js`,e)}),(0,B.jsx)(ic,{label:`Enable GZIP Compression`,hint:e.server.gzip_mode===`auto`?`Reduces transfer size. We will write the .htaccess rules.`:`Reduces transfer size. On ${e.server.type===`nginx`?`nginx`:`this server`} you'll need to paste a snippet into your server config — we'll show it after.`,checked:s.gzip_enabled,onChange:e=>l(`gzip_enabled`,e)}),(0,B.jsx)(ic,{label:`Lazy-load Images`,hint:`Defer off-screen images + iframes until they scroll into view. Keeps the first image eager so your LCP isn't deferred.`,checked:s.lazy_images,onChange:e=>l(`lazy_images`,e)}),(0,B.jsx)(ic,{label:`Browser cache headers`,hint:`Send Cache-Control so returning visitors fetch nothing. 1-year immutable for static assets, 1-hour for HTML.`,checked:s.browser_cache,onChange:e=>l(`browser_cache`,e)}),(0,B.jsx)(ic,{label:`LCP image preload + preconnect`,hint:`Preload the largest above-the-fold image and preconnect to font hosts so the main content paints sooner. Safe on every theme — only adds resource hints, never removes anything.`,checked:s.resource_hints??!0,onChange:e=>l(`resource_hints`,e)})]}),(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsx)(`label`,{htmlFor:`xspeed-onb-expiry`,className:`block text-[13px] font-medium text-ink mb-1.5`,children:`Cache Expiry`}),(0,B.jsx)(`p`,{className:`text-[12px] text-muted mb-2.5`,children:`How long cached pages live before regenerating.`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:h.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>l(`cache_expiry`,e.value),className:`text-[13px] px-3 py-1.5 rounded border transition-colors ${s.cache_expiry===e.value?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:e.label},e.value))})]}),(0,B.jsx)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 sm:gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium text-ink mb-1.5`,children:`Help improve xSpeed`}),(0,B.jsx)(`p`,{className:`text-[12px] text-muted leading-snug`,children:`Share a few anonymous basics — WordPress & PHP version, active theme & plugins, server type, and which features you enable. Never personal data or page content. Change it anytime from the dashboard.`})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:(0,B.jsx)(ln,{checked:s.usage_tracking,onChange:e=>l(`usage_tracking`,e),label:`Share anonymous usage data`})})]})})]})}function ic({label:e,hint:t,checked:n,onChange:r,first:i=!1}){return(0,B.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex items-center justify-between gap-3 sm:gap-4 ${i?``:`border-t border-line`}`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,B.jsx)(`div`,{className:`font-medium text-ink`,children:e}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:t})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:(0,B.jsx)(ln,{checked:n,onChange:r,label:e})})]})}function ac({choices:e,applyResult:t,onDashboard:n,onNext:r}){let i=Xt(),a=!!i.logo_svg?.trim(),o=t?.settings.cache_enabled??e.cache_enabled,s=t?.install_state,c=s?.blocked?s.blocked_reason:null,l=o&&s&&!s.wp_cache_constant&&s.manual_snippet,u=[];o&&u.push(`Page cache`),e.minify_html&&u.push(`HTML minify`),e.minify_css&&u.push(`CSS minify`),e.minify_js&&u.push(`JS minify`),e.defer_js&&u.push(`Defer JS`),e.gzip_enabled&&u.push(`GZIP`),e.lazy_images&&u.push(`Lazy images`),e.browser_cache&&u.push(`Browser cache`);let d=e.cache_expiry>=168?`${Math.round(e.cache_expiry/168)}-week`:e.cache_expiry>=24?`${Math.round(e.cache_expiry/24)}-day`:`${e.cache_expiry}-hour`;return(0,B.jsxs)(zs,{step:`done`,hero:(0,B.jsx)(Bs,{icon:M,logo:a?(0,B.jsx)(rn,{className:`w-8 h-8 rounded`}):void 0,title:c?`${i.name} setup needs attention`:`${i.name} is ready`,subtitle:c?`Your other preferences were saved, but page caching was not enabled.`:o?`Caching is active. Your site is now faster for non-logged-in visitors.`:`Your preferences are saved. Enable cache from the dashboard whenever you are ready.`}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{}),(0,B.jsxs)(Vs,{onClick:r??n,children:[r?`Continue`:`Go to Dashboard`,(0,B.jsx)(w,{size:14})]})]}),children:[c&&(0,B.jsx)(`div`,{role:`alert`,className:`border border-line bg-warning-tint rounded-card p-4 sm:p-5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,B.jsx)(gt,{size:17,className:`mt-0.5 shrink-0 text-warning`,"aria-hidden":`true`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium text-warning mb-1`,children:`Page cache was not enabled`}),(0,B.jsx)(`p`,{className:`text-[12px] text-warning`,children:c})]})]})}),u.length>0&&(0,B.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mb-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted font-medium`,children:`Optimizations active`}),(0,B.jsxs)(`div`,{className:`text-2xl font-semibold text-success tabular-nums mt-1`,children:[u.length,(0,B.jsxs)(`span`,{className:`text-faint text-[14px] font-normal`,children:[` / `,8]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted font-medium`,children:`Cache lifetime`}),(0,B.jsx)(`div`,{className:`text-2xl font-semibold text-ink tabular-nums mt-1`,children:d})]})]}),(0,B.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted font-medium mb-2`,children:`Enabled`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,B.jsx)(`span`,{className:`text-[12px] px-2 py-0.5 rounded bg-success-tint text-success border border-line`,children:e},e))})]}),(0,B.jsx)(ao,{compact:!0}),l&&(0,B.jsxs)(`div`,{className:`border border-line bg-warning-tint rounded-card p-4 sm:p-5`,children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium text-warning mb-1.5`,children:`One manual step`}),(0,B.jsxs)(`p`,{className:`text-[12px] text-warning mb-2`,children:[`Your `,(0,B.jsx)(`code`,{children:`wp-config.php`}),` isn't writable, so we couldn't set `,(0,B.jsx)(`code`,{children:`WP_CACHE`}),`. Add this line above the "That's all, stop editing!" comment:`]}),(0,B.jsx)(qn,{content:s.manual_snippet,tone:`amber`})]}),o&&s?.nginx_server_block&&(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`border border-line bg-info-tint rounded-card p-4 sm:p-5`,children:[(0,B.jsx)(`div`,{className:`text-[13px] font-medium text-info mb-1.5`,children:`nginx detected — one-time server config`}),(0,B.jsxs)(`p`,{className:`text-[12px] text-info`,children:[i.name,` can't write nginx config (it lives outside WordPress). Paste the snippet below into your site's `,(0,B.jsx)(`code`,{children:`server { }`}),` block, then reload nginx — cache hits will be served without booting PHP at all (~5-15ms TTFB). Without this you still get the PHP drop-in path (~85ms).`]})]}),(0,B.jsx)(Ua,{snippet:s.nginx_server_block})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 ${i.hide_help_links?`sm:grid-cols-1`:`sm:grid-cols-2`}`,children:[(0,B.jsx)(oc,{icon:ot,title:`Fine-tune performance`,body:`HTML/CSS/JS minify, lazy-load, browser cache.`,onClick:()=>n(`minify`)}),!i.hide_help_links&&(0,B.jsx)(oc,{icon:D,title:`Read the docs`,body:`Per-module guides, troubleshooting, conflict matrix.`,href:`https://xspeedcache.com/docs`})]})]})}function oc({icon:e,title:t,body:n,onClick:r,href:i}){let a=`text-left border border-line bg-paper rounded-card p-4 sm:p-5 hover:border-primary transition-colors block`,o=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(e,{size:16,className:`text-primary mb-2`}),(0,B.jsx)(`div`,{className:`text-[13px] font-medium text-ink`,children:t}),(0,B.jsx)(`div`,{className:`text-[12px] text-muted mt-1`,children:n})]});return i?(0,B.jsx)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:a,children:o}):(0,B.jsx)(`button`,{type:`button`,onClick:r,className:a,children:o})}function sc(e){let t=e.conflicts.length>0||!!e.page_cache_blocked;return{...nc(),...t?{cache_enabled:!1}:{},usage_tracking:!0}}function cc(){let e=window.XSpeedConfig,t=e.bootstrap?.env,n=e.bootstrap?.settings,r=e.bootstrap?.current??null,i=e.bootstrap?.hub??null,[a,o]=(0,y.useState)(()=>typeof window>`u`?`review`:new URL(window.location.href).searchParams.get(`xspeed_step`)===`connect`?`connect`:`review`),[s,c]=(0,y.useState)(()=>sc(t)),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(null),h=e.dashboardUrl||``,g=async e=>{try{await W.onboardingComplete()}catch{}h&&(window.location.href=e?`${h}#${e}`:h)};return!t||!n?(0,B.jsxs)(`div`,{className:`max-w-md mx-auto my-10 rounded-card border border-line bg-paper p-8 text-center`,children:[(0,B.jsx)(`div`,{className:`mx-auto mb-3 flex h-11 w-11 items-center justify-center rounded-full bg-panel text-muted`,children:(0,B.jsx)(Ue,{size:22})}),(0,B.jsx)(`h1`,{className:`font-display text-[18px] font-semibold text-ink`,children:V(`Onboarding data unavailable`)}),(0,B.jsx)(`p`,{className:`mt-1.5 text-[13px] text-muted`,children:V(`We couldn't load the setup wizard. Your site is unaffected — you can configure everything from the dashboard.`)}),(0,B.jsxs)(`a`,{href:h,className:`mt-5 inline-flex items-center gap-1.5 rounded-control bg-primary px-4 py-2 text-[13px] font-medium text-on-primary hover:bg-primary-hover transition-colors`,children:[V(`Go to the dashboard`),(0,B.jsx)(w,{size:14})]})]}):(0,B.jsxs)(B.Fragment,{children:[a===`review`&&(0,B.jsx)(Ks,{env:t,onNext:()=>o(`configure`)}),a===`configure`&&(0,B.jsx)(rc,{env:t,initial:s,current:r,onApply:async e=>{f(!0),m(null),c(e);try{u(await W.onboardingApply(e)),await W.onboardingComplete(),o(`done`)}catch(e){m(e instanceof Error?e.message:`Failed to apply settings`)}finally{f(!1)}},onSkip:async()=>{try{await W.onboardingComplete()}catch{}h&&(window.location.href=h)},onBack:()=>o(`review`),busy:d}),a===`done`&&(0,B.jsx)(ac,{choices:s,applyResult:l,onDashboard:g,onNext:i?.attached?void 0:()=>o(`connect`)}),a===`connect`&&(0,B.jsx)(Ws,{initialHub:i,onNext:g,onSkip:g}),p&&(0,B.jsx)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 bg-danger-tint border border-line text-danger text-[12px] px-4 py-2 rounded-full shadow-md z-50`,children:p})]})}window.React=y.default,window.ReactDOM=Tt,Kt();var lc=document.getElementById(`xspeed-app`);if(lc){let e=window.XSpeedConfig?.mode===`onboarding`||lc.classList.contains(`xspeed-onboarding-host`);(0,Et.createRoot)(lc).render((0,B.jsx)(y.StrictMode,{children:e?(0,B.jsx)(cc,{}):(0,B.jsx)(Fs,{})}))}})(); |