Changeset 3801546
- Timestamp:
- 11/14/2026 08:38:48 AM (less than one hour ago)
- Location:
- paapi-product-search-for-amazon/trunk
- Files:
-
- 2 added
- 7 edited
-
README.txt (modified) (3 diffs)
-
changelog.txt (modified) (1 diff)
-
paapi-product-search-for-amazon.php (modified) (4 diffs)
-
src/assets/js/admin-app.js (modified) (28 diffs)
-
src/core/admin/go-live-notice.php (added)
-
src/core/admin/notifications.php (modified) (7 diffs)
-
src/core/admin/setup-checklist.php (modified) (4 diffs)
-
src/core/frontend/ssr/skeleton.php (modified) (1 diff)
-
src/core/shared/live-placement-cache.php (added)
Legend:
- Unmodified
- Added
- Removed
-
paapi-product-search-for-amazon/trunk/README.txt
r3801449 r3801546 4 4 Requires at least: 5.8 5 5 Tested up to: 7.1 6 Stable tag: 2.4 4.06 Stable tag: 2.45.0 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 253 253 == Changelog == 254 254 255 = 2.45.0 = 256 * New: On Home, the setup step "Publish a post with your box" is done only when a published post or page holds a PaapiPlugin shortcode. If a draft holding one is waiting, the step links straight to it. 257 * New: While PaapiPlugin is connected and no published post or page holds its shortcode, a notice on the WordPress Dashboard and the Posts and Pages lists shows the next step. Dismiss it once to hide it for two weeks, twice to hide it for good. 258 * Changed: The place step and the box builder's last step say the box shows to visitors once its post is published. 259 * Fixed: Dismissing the last PaapiPlugin notice on a screen moves keyboard focus to the page heading instead of the top of the page. 260 255 261 = 2.44.0 = 256 262 * New: The Product Boxes, Comparison Tables and Credentials pages warn you when a site on the Managed API has more products than its daily or monthly lookups can refresh. … … 285 291 * Changed: The Search page no longer shows the Auto-updating Lists card. Lists has its own page under Create. 286 292 * Fixed: The Help menu and other admin menus, dialogs and panels no longer flicker when they close. 287 288 = 2.40.0 =289 * New: Button text color in Appearance (Premium). Choose Auto, White or Dark for the text on buttons and badges.290 * New: With White, buttons get darker on hover, and with Dark they get lighter, so the text stays easy to read.291 * New: The Appearance preview shows the button text color as you pick it. Without Premium, sites use Auto.292 293 = 2.39.0 =294 * New: Two Premium product box styles, Editorial and Spotlight, next to the original Classic style. Pick one with the Style control in the box builder, or add look="editorial" or look="spotlight" to the shortcode. Both work with the card, horizontal and minimal layouts and follow your Appearance settings.295 * New: look="classic" in the shortcode shows the Classic style in that one post, even when the box has another style saved.296 * New: If your Premium license lapses, a box keeps its saved style and shows Classic until Premium is active again.297 293 298 294 [See the full changelog](https://plugins.trac.wordpress.org/browser/paapi-product-search-for-amazon/trunk/changelog.txt) -
paapi-product-search-for-amazon/trunk/changelog.txt
r3801449 r3801546 1 1 == Changelog == 2 3 = 2.40.0 = 4 * New: Button text color in Appearance (Premium). Choose Auto, White or Dark for the text on buttons and badges. 5 * New: With White, buttons get darker on hover, and with Dark they get lighter, so the text stays easy to read. 6 * New: The Appearance preview shows the button text color as you pick it. Without Premium, sites use Auto. 7 8 = 2.39.0 = 9 * New: Two Premium product box styles, Editorial and Spotlight, next to the original Classic style. Pick one with the Style control in the box builder, or add look="editorial" or look="spotlight" to the shortcode. Both work with the card, horizontal and minimal layouts and follow your Appearance settings. 10 * New: look="classic" in the shortcode shows the Classic style in that one post, even when the box has another style saved. 11 * New: If your Premium license lapses, a box keeps its saved style and shows Classic until Premium is active again. 2 12 3 13 = 2.38.1 = -
paapi-product-search-for-amazon/trunk/paapi-product-search-for-amazon.php
r3801449 r3801546 5 5 * Plugin URI: https://paapiplugin.com/ 6 6 * Description: Amazon affiliate plugin: product boxes, comparison tables and live search, free to start, no Amazon API credentials needed yet. Your Associate tag on every link. 7 * Version: 2.4 4.07 * Version: 2.45.0 8 8 * Author: PaapiPlugin 9 9 * Author URI: https://paapiplugin.com … … 94 94 define('PSFA_PLUGIN_DIR', plugin_dir_path(__FILE__)); 95 95 define('PSFA_PLUGIN_URL', plugin_dir_url(__FILE__)); 96 define('PSFA_VERSION', '2.4 4.0');96 define('PSFA_VERSION', '2.45.0'); 97 97 98 98 /** … … 154 154 require_once PSFA_PLUGIN_DIR . 'src/core/admin/retired-addons.php'; 155 155 156 // Live-placement answers kept for the Home checklist and the go-live notice: 157 // one read per request, and a live answer for the window set in 158 // src/core/shared/live-placement-cache.php. Every post change drops both. 159 // File scope, because posts also change through REST, wp-cron and WP-CLI, 160 // where is_admin() is false. 161 require_once PSFA_PLUGIN_DIR . 'src/core/shared/live-placement-cache.php'; 162 add_action('transition_post_status', 'psfa_live_placement_flush', 10, 0); 163 add_action('save_post', 'psfa_live_placement_flush', 10, 0); 164 add_action('deleted_post', 'psfa_live_placement_flush', 10, 0); 165 add_action('trashed_post', 'psfa_live_placement_flush', 10, 0); 166 156 167 // ── Top-products background pre-generation (stale-while-revalidate, 2026-05-28) ── 157 168 // Keeps the top-products pool build OFF the visitor critical path. Hooks are … … 281 292 psfa_register_admin_notice( 'psfa_render_bfcm_notice', PSFA_ADMIN_NOTICE_COURTESY ); 282 293 add_action( 'wp_ajax_psfa_dismiss_bfcm_notice', 'psfa_ajax_dismiss_bfcm_notice' ); 294 295 // Go-live notice: a path is connected but no published post holds 296 // PaapiPlugin. Dashboard and the Posts and Pages lists only. It reads 297 // the posts through psfa_live_placement_state(): once per request, and 298 // not at all while a live answer is kept. Its X is the feed's courtesy 299 // read action below; the first dismiss snoozes it for 300 // PSFA_GO_LIVE_SNOOZE, the second hides it for good. 301 // COURTESY: nothing on the site is broken while it shows. 302 require_once PSFA_PLUGIN_DIR . 'src/core/admin/go-live-notice.php'; 303 psfa_register_admin_notice( 'psfa_render_go_live_notice', PSFA_ADMIN_NOTICE_COURTESY ); 283 304 284 305 // Notifications feed (psfaAdmin.notifications): every notice above -
paapi-product-search-for-amazon/trunk/src/assets/js/admin-app.js
r3801449 r3801546 1 var EJ=Object.defineProperty;var TJ=(_o,Wn,Ja)=>Wn in _o?EJ(_o,Wn,{enumerable:!0,configurable:!0,writable:!0,value:Ja}):_o[Wn]=Ja;var gw=(_o,Wn,Ja)=>TJ(_o,typeof Wn!="symbol"?Wn+"":Wn,Ja);(function(){"use strict";function _o(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(a,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ja(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _v={exports:{}},Nu={};/**1 var RJ=Object.defineProperty;var kJ=(_o,Wn,Ja)=>Wn in _o?RJ(_o,Wn,{enumerable:!0,configurable:!0,writable:!0,value:Ja}):_o[Wn]=Ja;var gw=(_o,Wn,Ja)=>kJ(_o,typeof Wn!="symbol"?Wn+"":Wn,Ja);(function(){"use strict";function _o(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(a,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ja(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _v={exports:{}},Nu={};/** 2 2 * @license React 3 3 * react-jsx-runtime.production.js … … 7 7 * This source code is licensed under the MIT license found in the 8 8 * LICENSE file in the root directory of this source tree. 9 */var KM=Symbol.for("react.transitional.element"),qM=Symbol.for("react.fragment");function Ev(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:KM,type:e,key:a,ref:t!==void 0?t:null,props:n}}Nu.Fragment=qM,Nu.jsx=Ev,Nu.jsxs=Ev,_v.exports=Nu;var o=_v.exports,Tv={exports:{}},Te={};/**9 */var qM=Symbol.for("react.transitional.element"),XM=Symbol.for("react.fragment");function Ev(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:qM,type:e,key:a,ref:t!==void 0?t:null,props:n}}Nu.Fragment=XM,Nu.jsx=Ev,Nu.jsxs=Ev,_v.exports=Nu;var o=_v.exports,Tv={exports:{}},Te={};/** 10 10 * @license React 11 11 * react.production.js … … 15 15 * This source code is licensed under the MIT license found in the 16 16 * LICENSE file in the root directory of this source tree. 17 */var xw=Symbol.for("react.transitional.element"), XM=Symbol.for("react.portal"),WM=Symbol.for("react.fragment"),ZM=Symbol.for("react.strict_mode"),QM=Symbol.for("react.profiler"),JM=Symbol.for("react.consumer"),e5=Symbol.for("react.context"),t5=Symbol.for("react.forward_ref"),n5=Symbol.for("react.suspense"),a5=Symbol.for("react.memo"),Rv=Symbol.for("react.lazy"),r5=Symbol.for("react.activity"),kv=Symbol.iterator;function o5(e){return e===null||typeof e!="object"?null:(e=kv&&e[kv]||e["@@iterator"],typeof e=="function"?e:null)}var Mv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dv=Object.assign,Ov={};function Ss(e,t,n){this.props=e,this.context=t,this.refs=Ov,this.updater=n||Mv}Ss.prototype.isReactComponent={},Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pv(){}Pv.prototype=Ss.prototype;function bw(e,t,n){this.props=e,this.context=t,this.refs=Ov,this.updater=n||Mv}var vw=bw.prototype=new Pv;vw.constructor=bw,Dv(vw,Ss.prototype),vw.isPureReactComponent=!0;var zv=Array.isArray;function yw(){}var it={H:null,A:null,T:null,S:null},Lv=Object.prototype.hasOwnProperty;function Sw(e,t,n){var a=n.ref;return{$$typeof:xw,type:e,key:t,ref:a!==void 0?a:null,props:n}}function s5(e,t){return Sw(e.type,t,e.props)}function jw(e){return typeof e=="object"&&e!==null&&e.$$typeof===xw}function i5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Iv=/\/+/g;function Nw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?i5(""+e.key):t.toString(36)}function l5(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(yw,yw):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function js(e,t,n,a,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case xw:case XM:i=!0;break;case Rv:return i=e._init,js(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+Nw(e,0):a,zv(r)?(n="",i!=null&&(n=i.replace(Iv,"$&/")+"/"),js(r,t,n,"",function(u){return u})):r!=null&&(jw(r)&&(r=s5(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Iv,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=a===""?".":a+":";if(zv(e))for(var c=0;c<e.length;c++)a=e[c],s=l+Nw(a,c),i+=js(a,t,n,s,r);else if(c=o5(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,s=l+Nw(a,c++),i+=js(a,t,n,s,r);else if(s==="object"){if(typeof e.then=="function")return js(l5(e),t,n,a,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Cu(e,t,n){if(e==null)return e;var a=[],r=0;return js(e,a,"","",function(s){return t.call(n,s,r++)}),a}function c5(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $v=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},u5={map:Cu,forEach:function(e,t,n){Cu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Cu(e,function(){t++}),t},toArray:function(e){return Cu(e,function(t){return t})||[]},only:function(e){if(!jw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Activity=r5,Te.Children=u5,Te.Component=Ss,Te.Fragment=WM,Te.Profiler=QM,Te.PureComponent=bw,Te.StrictMode=ZM,Te.Suspense=n5,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=it,Te.__COMPILER_RUNTIME={__proto__:null,c:function(e){return it.H.useMemoCache(e)}},Te.cache=function(e){return function(){return e.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=Dv({},e.props),r=e.key;if(t!=null)for(s in t.key!==void 0&&(r=""+t.key),t)!Lv.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(a[s]=t[s]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var i=Array(s),l=0;l<s;l++)i[l]=arguments[l+2];a.children=i}return Sw(e.type,r,a)},Te.createContext=function(e){return e={$$typeof:e5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:JM,_context:e},e},Te.createElement=function(e,t,n){var a,r={},s=null;if(t!=null)for(a in t.key!==void 0&&(s=""+t.key),t)Lv.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(r[a]=t[a]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var l=Array(i),c=0;c<i;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)r[a]===void 0&&(r[a]=i[a]);return Sw(e,s,r)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(e){return{$$typeof:t5,render:e}},Te.isValidElement=jw,Te.lazy=function(e){return{$$typeof:Rv,_payload:{_status:-1,_result:e},_init:c5}},Te.memo=function(e,t){return{$$typeof:a5,type:e,compare:t===void 0?null:t}},Te.startTransition=function(e){var t=it.T,n={};it.T=n;try{var a=e(),r=it.S;r!==null&&r(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(yw,$v)}catch(s){$v(s)}finally{t!==null&&n.types!==null&&(t.types=n.types),it.T=t}},Te.unstable_useCacheRefresh=function(){return it.H.useCacheRefresh()},Te.use=function(e){return it.H.use(e)},Te.useActionState=function(e,t,n){return it.H.useActionState(e,t,n)},Te.useCallback=function(e,t){return it.H.useCallback(e,t)},Te.useContext=function(e){return it.H.useContext(e)},Te.useDebugValue=function(){},Te.useDeferredValue=function(e,t){return it.H.useDeferredValue(e,t)},Te.useEffect=function(e,t){return it.H.useEffect(e,t)},Te.useEffectEvent=function(e){return it.H.useEffectEvent(e)},Te.useId=function(){return it.H.useId()},Te.useImperativeHandle=function(e,t,n){return it.H.useImperativeHandle(e,t,n)},Te.useInsertionEffect=function(e,t){return it.H.useInsertionEffect(e,t)},Te.useLayoutEffect=function(e,t){return it.H.useLayoutEffect(e,t)},Te.useMemo=function(e,t){return it.H.useMemo(e,t)},Te.useOptimistic=function(e,t){return it.H.useOptimistic(e,t)},Te.useReducer=function(e,t,n){return it.H.useReducer(e,t,n)},Te.useRef=function(e){return it.H.useRef(e)},Te.useState=function(e){return it.H.useState(e)},Te.useSyncExternalStore=function(e,t,n){return it.H.useSyncExternalStore(e,t,n)},Te.useTransition=function(){return it.H.useTransition()},Te.version="19.2.4",Tv.exports=Te;var d=Tv.exports;const J=Ja(d),Au=_o({__proto__:null,default:J},[d]);var Bv={exports:{}},_u={},Uv={exports:{}},Hv={};/**17 */var xw=Symbol.for("react.transitional.element"),WM=Symbol.for("react.portal"),ZM=Symbol.for("react.fragment"),QM=Symbol.for("react.strict_mode"),JM=Symbol.for("react.profiler"),e5=Symbol.for("react.consumer"),t5=Symbol.for("react.context"),n5=Symbol.for("react.forward_ref"),a5=Symbol.for("react.suspense"),r5=Symbol.for("react.memo"),Rv=Symbol.for("react.lazy"),o5=Symbol.for("react.activity"),kv=Symbol.iterator;function s5(e){return e===null||typeof e!="object"?null:(e=kv&&e[kv]||e["@@iterator"],typeof e=="function"?e:null)}var Mv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dv=Object.assign,Ov={};function Ss(e,t,n){this.props=e,this.context=t,this.refs=Ov,this.updater=n||Mv}Ss.prototype.isReactComponent={},Ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pv(){}Pv.prototype=Ss.prototype;function bw(e,t,n){this.props=e,this.context=t,this.refs=Ov,this.updater=n||Mv}var vw=bw.prototype=new Pv;vw.constructor=bw,Dv(vw,Ss.prototype),vw.isPureReactComponent=!0;var zv=Array.isArray;function yw(){}var it={H:null,A:null,T:null,S:null},Lv=Object.prototype.hasOwnProperty;function Sw(e,t,n){var a=n.ref;return{$$typeof:xw,type:e,key:t,ref:a!==void 0?a:null,props:n}}function i5(e,t){return Sw(e.type,t,e.props)}function jw(e){return typeof e=="object"&&e!==null&&e.$$typeof===xw}function l5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Iv=/\/+/g;function Nw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?l5(""+e.key):t.toString(36)}function c5(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(yw,yw):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function js(e,t,n,a,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case xw:case WM:i=!0;break;case Rv:return i=e._init,js(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+Nw(e,0):a,zv(r)?(n="",i!=null&&(n=i.replace(Iv,"$&/")+"/"),js(r,t,n,"",function(d){return d})):r!=null&&(jw(r)&&(r=i5(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Iv,"$&/")+"/")+i)),t.push(r)),1;i=0;var l=a===""?".":a+":";if(zv(e))for(var c=0;c<e.length;c++)a=e[c],s=l+Nw(a,c),i+=js(a,t,n,s,r);else if(c=s5(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,s=l+Nw(a,c++),i+=js(a,t,n,s,r);else if(s==="object"){if(typeof e.then=="function")return js(c5(e),t,n,a,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Cu(e,t,n){if(e==null)return e;var a=[],r=0;return js(e,a,"","",function(s){return t.call(n,s,r++)}),a}function u5(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $v=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},d5={map:Cu,forEach:function(e,t,n){Cu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Cu(e,function(){t++}),t},toArray:function(e){return Cu(e,function(t){return t})||[]},only:function(e){if(!jw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Activity=o5,Te.Children=d5,Te.Component=Ss,Te.Fragment=ZM,Te.Profiler=JM,Te.PureComponent=bw,Te.StrictMode=QM,Te.Suspense=a5,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=it,Te.__COMPILER_RUNTIME={__proto__:null,c:function(e){return it.H.useMemoCache(e)}},Te.cache=function(e){return function(){return e.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=Dv({},e.props),r=e.key;if(t!=null)for(s in t.key!==void 0&&(r=""+t.key),t)!Lv.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(a[s]=t[s]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var i=Array(s),l=0;l<s;l++)i[l]=arguments[l+2];a.children=i}return Sw(e.type,r,a)},Te.createContext=function(e){return e={$$typeof:t5,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:e5,_context:e},e},Te.createElement=function(e,t,n){var a,r={},s=null;if(t!=null)for(a in t.key!==void 0&&(s=""+t.key),t)Lv.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(r[a]=t[a]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var l=Array(i),c=0;c<i;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)r[a]===void 0&&(r[a]=i[a]);return Sw(e,s,r)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(e){return{$$typeof:n5,render:e}},Te.isValidElement=jw,Te.lazy=function(e){return{$$typeof:Rv,_payload:{_status:-1,_result:e},_init:u5}},Te.memo=function(e,t){return{$$typeof:r5,type:e,compare:t===void 0?null:t}},Te.startTransition=function(e){var t=it.T,n={};it.T=n;try{var a=e(),r=it.S;r!==null&&r(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(yw,$v)}catch(s){$v(s)}finally{t!==null&&n.types!==null&&(t.types=n.types),it.T=t}},Te.unstable_useCacheRefresh=function(){return it.H.useCacheRefresh()},Te.use=function(e){return it.H.use(e)},Te.useActionState=function(e,t,n){return it.H.useActionState(e,t,n)},Te.useCallback=function(e,t){return it.H.useCallback(e,t)},Te.useContext=function(e){return it.H.useContext(e)},Te.useDebugValue=function(){},Te.useDeferredValue=function(e,t){return it.H.useDeferredValue(e,t)},Te.useEffect=function(e,t){return it.H.useEffect(e,t)},Te.useEffectEvent=function(e){return it.H.useEffectEvent(e)},Te.useId=function(){return it.H.useId()},Te.useImperativeHandle=function(e,t,n){return it.H.useImperativeHandle(e,t,n)},Te.useInsertionEffect=function(e,t){return it.H.useInsertionEffect(e,t)},Te.useLayoutEffect=function(e,t){return it.H.useLayoutEffect(e,t)},Te.useMemo=function(e,t){return it.H.useMemo(e,t)},Te.useOptimistic=function(e,t){return it.H.useOptimistic(e,t)},Te.useReducer=function(e,t,n){return it.H.useReducer(e,t,n)},Te.useRef=function(e){return it.H.useRef(e)},Te.useState=function(e){return it.H.useState(e)},Te.useSyncExternalStore=function(e,t,n){return it.H.useSyncExternalStore(e,t,n)},Te.useTransition=function(){return it.H.useTransition()},Te.version="19.2.4",Tv.exports=Te;var u=Tv.exports;const J=Ja(u),Au=_o({__proto__:null,default:J},[u]);var Bv={exports:{}},_u={},Uv={exports:{}},Hv={};/** 18 18 * @license React 19 19 * scheduler.production.js … … 23 23 * This source code is licensed under the MIT license found in the 24 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function t(T,O){var _=T.length;T.push(O);e:for(;0<_;){var $=_-1>>>1,H=T[$];if(0<r(H,O))T[$]=O,T[_]=H,_=$;else break e}}function n(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var O=T[0],_=T.pop();if(_!==O){T[0]=_;e:for(var $=0,H=T.length,F=H>>>1;$<F;){var Q=2*($+1)-1,X=T[Q],P=Q+1,G=T[P];if(0>r(X,_))P<H&&0>r(G,X)?(T[$]=G,T[P]=_,$=P):(T[$]=X,T[Q]=_,$=Q);else if(P<H&&0>r(G,_))T[$]=G,T[P]=_,$=P;else break e}}return O}function r(T,O){var _=T.sortIndex-O.sortIndex;return _!==0?_:T.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[], u=[],m=1,f=null,w=3,p=!1,x=!1,b=!1,y=!1,h=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var O=n(u);O!==null;){if(O.callback===null)a(u);else if(O.startTime<=T)a(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function N(T){if(b=!1,S(T),!x)if(n(c)!==null)x=!0,A||(A=!0,B());else{var O=n(u);O!==null&&D(N,O.startTime-T)}}var A=!1,j=-1,C=5,R=-1;function M(){return y?!0:!(e.unstable_now()-R<C)}function z(){if(y=!1,A){var T=e.unstable_now();R=T;var O=!0;try{e:{x=!1,b&&(b=!1,g(j),j=-1),p=!0;var _=w;try{t:{for(S(T),f=n(c);f!==null&&!(f.expirationTime>T&&M());){var $=f.callback;if(typeof $=="function"){f.callback=null,w=f.priorityLevel;var H=$(f.expirationTime<=T);if(T=e.unstable_now(),typeof H=="function"){f.callback=H,S(T),O=!0;break t}f===n(c)&&a(c),S(T)}else a(c);f=n(c)}if(f!==null)O=!0;else{var F=n(u);F!==null&&D(N,F.startTime-T),O=!1}}break e}finally{f=null,w=_,p=!1}O=void 0}}finally{O?B():A=!1}}}var B;if(typeof v=="function")B=function(){v(z)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,V=I.port2;I.port1.onmessage=z,B=function(){V.postMessage(null)}}else B=function(){h(z,0)};function D(T,O){j=h(function(){T(e.unstable_now())},O)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(T){switch(w){case 1:case 2:case 3:var O=3;break;default:O=w}var _=w;w=O;try{return T()}finally{w=_}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(T,O){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var _=w;w=T;try{return O()}finally{w=_}},e.unstable_scheduleCallback=function(T,O,_){var $=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?$+_:$):_=$,T){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=_+H,T={id:m++,callback:O,priorityLevel:T,startTime:_,expirationTime:H,sortIndex:-1},_>$?(T.sortIndex=_,t(u,T),n(c)===null&&T===n(u)&&(b?(g(j),j=-1):b=!0,D(N,_-$))):(T.sortIndex=H,t(c,T),x||p||(x=!0,A||(A=!0,B()))),T},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(T){var O=w;return function(){var _=w;w=O;try{return T.apply(this,arguments)}finally{w=_}}}})(Hv),Uv.exports=Hv;var d5=Uv.exports,Fv={exports:{}},un={};/**25 */(function(e){function t(T,O){var _=T.length;T.push(O);e:for(;0<_;){var $=_-1>>>1,H=T[$];if(0<r(H,O))T[$]=O,T[_]=H,_=$;else break e}}function n(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var O=T[0],_=T.pop();if(_!==O){T[0]=_;e:for(var $=0,H=T.length,F=H>>>1;$<F;){var Q=2*($+1)-1,X=T[Q],P=Q+1,G=T[P];if(0>r(X,_))P<H&&0>r(G,X)?(T[$]=G,T[P]=_,$=P):(T[$]=X,T[Q]=_,$=Q);else if(P<H&&0>r(G,_))T[$]=G,T[P]=_,$=P;else break e}}return O}function r(T,O){var _=T.sortIndex-O.sortIndex;return _!==0?_:T.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],d=[],m=1,f=null,w=3,p=!1,x=!1,b=!1,y=!1,h=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var O=n(d);O!==null;){if(O.callback===null)a(d);else if(O.startTime<=T)a(d),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(d)}}function N(T){if(b=!1,S(T),!x)if(n(c)!==null)x=!0,A||(A=!0,B());else{var O=n(d);O!==null&&D(N,O.startTime-T)}}var A=!1,j=-1,C=5,R=-1;function M(){return y?!0:!(e.unstable_now()-R<C)}function z(){if(y=!1,A){var T=e.unstable_now();R=T;var O=!0;try{e:{x=!1,b&&(b=!1,g(j),j=-1),p=!0;var _=w;try{t:{for(S(T),f=n(c);f!==null&&!(f.expirationTime>T&&M());){var $=f.callback;if(typeof $=="function"){f.callback=null,w=f.priorityLevel;var H=$(f.expirationTime<=T);if(T=e.unstable_now(),typeof H=="function"){f.callback=H,S(T),O=!0;break t}f===n(c)&&a(c),S(T)}else a(c);f=n(c)}if(f!==null)O=!0;else{var F=n(d);F!==null&&D(N,F.startTime-T),O=!1}}break e}finally{f=null,w=_,p=!1}O=void 0}}finally{O?B():A=!1}}}var B;if(typeof v=="function")B=function(){v(z)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,V=I.port2;I.port1.onmessage=z,B=function(){V.postMessage(null)}}else B=function(){h(z,0)};function D(T,O){j=h(function(){T(e.unstable_now())},O)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(T){switch(w){case 1:case 2:case 3:var O=3;break;default:O=w}var _=w;w=O;try{return T()}finally{w=_}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(T,O){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var _=w;w=T;try{return O()}finally{w=_}},e.unstable_scheduleCallback=function(T,O,_){var $=e.unstable_now();switch(typeof _=="object"&&_!==null?(_=_.delay,_=typeof _=="number"&&0<_?$+_:$):_=$,T){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=_+H,T={id:m++,callback:O,priorityLevel:T,startTime:_,expirationTime:H,sortIndex:-1},_>$?(T.sortIndex=_,t(d,T),n(c)===null&&T===n(d)&&(b?(g(j),j=-1):b=!0,D(N,_-$))):(T.sortIndex=H,t(c,T),x||p||(x=!0,A||(A=!0,B()))),T},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(T){var O=w;return function(){var _=w;w=O;try{return T.apply(this,arguments)}finally{w=_}}}})(Hv),Uv.exports=Hv;var f5=Uv.exports,Fv={exports:{}},un={};/** 26 26 * @license React 27 27 * react-dom.production.js … … 31 31 * This source code is licensed under the MIT license found in the 32 32 * LICENSE file in the root directory of this source tree. 33 */var f5=d;function Vv(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function Dr(){}var dn={d:{f:Dr,r:function(){throw Error(Vv(522))},D:Dr,C:Dr,L:Dr,m:Dr,X:Dr,S:Dr,M:Dr},p:0,findDOMNode:null},m5=Symbol.for("react.portal");function w5(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m5,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var il=f5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Eu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dn,un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Vv(299));return w5(e,t,null,n)},un.flushSync=function(e){var t=il.T,n=dn.p;try{if(il.T=null,dn.p=2,e)return e()}finally{il.T=t,dn.p=n,dn.d.f()}},un.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,dn.d.C(e,t))},un.prefetchDNS=function(e){typeof e=="string"&&dn.d.D(e)},un.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Eu(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?dn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:s}):n==="script"&&dn.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},un.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Eu(t.as,t.crossOrigin);dn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&dn.d.M(e)},un.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Eu(n,t.crossOrigin);dn.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},un.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Eu(t.as,t.crossOrigin);dn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else dn.d.m(e)},un.requestFormReset=function(e){dn.d.r(e)},un.unstable_batchedUpdates=function(e,t){return e(t)},un.useFormState=function(e,t,n){return il.H.useFormState(e,t,n)},un.useFormStatus=function(){return il.H.useHostTransitionStatus()},un.version="19.2.4";function Gv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gv)}catch(e){console.error(e)}}Gv(),Fv.exports=un;var Eo=Fv.exports;const Yv=Ja(Eo);/**33 */var m5=u;function Vv(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function Dr(){}var dn={d:{f:Dr,r:function(){throw Error(Vv(522))},D:Dr,C:Dr,L:Dr,m:Dr,X:Dr,S:Dr,M:Dr},p:0,findDOMNode:null},w5=Symbol.for("react.portal");function p5(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w5,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var il=m5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Eu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=dn,un.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(Vv(299));return p5(e,t,null,n)},un.flushSync=function(e){var t=il.T,n=dn.p;try{if(il.T=null,dn.p=2,e)return e()}finally{il.T=t,dn.p=n,dn.d.f()}},un.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,dn.d.C(e,t))},un.prefetchDNS=function(e){typeof e=="string"&&dn.d.D(e)},un.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Eu(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?dn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:s}):n==="script"&&dn.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},un.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Eu(t.as,t.crossOrigin);dn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&dn.d.M(e)},un.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Eu(n,t.crossOrigin);dn.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},un.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Eu(t.as,t.crossOrigin);dn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else dn.d.m(e)},un.requestFormReset=function(e){dn.d.r(e)},un.unstable_batchedUpdates=function(e,t){return e(t)},un.useFormState=function(e,t,n){return il.H.useFormState(e,t,n)},un.useFormStatus=function(){return il.H.useHostTransitionStatus()},un.version="19.2.4";function Gv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gv)}catch(e){console.error(e)}}Gv(),Fv.exports=un;var Eo=Fv.exports;const Yv=Ja(Eo);/** 34 34 * @license React 35 35 * react-dom-client.production.js … … 39 39 * This source code is licensed under the MIT license found in the 40 40 * LICENSE file in the root directory of this source tree. 41 */var Dt= d5,Kv=d,p5=Eo;function q(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function qv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ll(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 Xv(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 Wv(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zv(e){if(ll(e)!==e)throw Error(q(188))}function h5(e){var t=e.alternate;if(!t){if(t=ll(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Zv(r),e;if(s===a)return Zv(r),t;s=s.sibling}throw Error(q(188))}if(n.return!==a.return)n=r,a=s;else{for(var i=!1,l=r.child;l;){if(l===n){i=!0,n=r,a=s;break}if(l===a){i=!0,a=r,n=s;break}l=l.sibling}if(!i){for(l=s.child;l;){if(l===n){i=!0,n=s,a=r;break}if(l===a){i=!0,a=s,n=r;break}l=l.sibling}if(!i)throw Error(q(189))}}if(n.alternate!==a)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function Qv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Qv(e),t!==null)return t;e=e.sibling}return null}var lt=Object.assign,g5=Symbol.for("react.element"),Tu=Symbol.for("react.transitional.element"),cl=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),Jv=Symbol.for("react.strict_mode"),Cw=Symbol.for("react.profiler"),ey=Symbol.for("react.consumer"),er=Symbol.for("react.context"),Aw=Symbol.for("react.forward_ref"),_w=Symbol.for("react.suspense"),Ew=Symbol.for("react.suspense_list"),Tw=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),Rw=Symbol.for("react.activity"),x5=Symbol.for("react.memo_cache_sentinel"),ty=Symbol.iterator;function ul(e){return e===null||typeof e!="object"?null:(e=ty&&e[ty]||e["@@iterator"],typeof e=="function"?e:null)}var b5=Symbol.for("react.client.reference");function kw(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===b5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ns:return"Fragment";case Cw:return"Profiler";case Jv:return"StrictMode";case _w:return"Suspense";case Ew:return"SuspenseList";case Rw:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case cl:return"Portal";case er:return e.displayName||"Context";case ey:return(e._context.displayName||"Context")+".Consumer";case Aw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tw:return t=e.displayName||null,t!==null?t:kw(e.type)||"Memo";case Or:t=e._payload,e=e._init;try{return kw(e(t))}catch{}}return null}var dl=Array.isArray,Ce=Kv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qe=p5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,To={pending:!1,data:null,method:null,action:null},Mw=[],Cs=-1;function Ra(e){return{current:e}}function $t(e){0>Cs||(e.current=Mw[Cs],Mw[Cs]=null,Cs--)}function st(e,t){Cs++,Mw[Cs]=e.current,e.current=t}var ka=Ra(null),fl=Ra(null),Pr=Ra(null),Ru=Ra(null);function ku(e,t){switch(st(Pr,t),st(fl,e),st(ka,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?AS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=AS(t),e=_S(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$t(ka),st(ka,e)}function As(){$t(ka),$t(fl),$t(Pr)}function Dw(e){e.memoizedState!==null&&st(Ru,e);var t=ka.current,n=_S(t,e.type);t!==n&&(st(fl,e),st(ka,n))}function Mu(e){fl.current===e&&($t(ka),$t(fl)),Ru.current===e&&($t(Ru),tc._currentValue=To)}var Ow,ny;function Ro(e){if(Ow===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ow=t&&t[1]||"",ny=-1<n.stack.indexOf(`41 */var Dt=f5,Kv=u,h5=Eo;function q(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function qv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ll(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 Xv(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 Wv(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zv(e){if(ll(e)!==e)throw Error(q(188))}function g5(e){var t=e.alternate;if(!t){if(t=ll(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Zv(r),e;if(s===a)return Zv(r),t;s=s.sibling}throw Error(q(188))}if(n.return!==a.return)n=r,a=s;else{for(var i=!1,l=r.child;l;){if(l===n){i=!0,n=r,a=s;break}if(l===a){i=!0,a=r,n=s;break}l=l.sibling}if(!i){for(l=s.child;l;){if(l===n){i=!0,n=s,a=r;break}if(l===a){i=!0,a=s,n=r;break}l=l.sibling}if(!i)throw Error(q(189))}}if(n.alternate!==a)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function Qv(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Qv(e),t!==null)return t;e=e.sibling}return null}var lt=Object.assign,x5=Symbol.for("react.element"),Tu=Symbol.for("react.transitional.element"),cl=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),Jv=Symbol.for("react.strict_mode"),Cw=Symbol.for("react.profiler"),ey=Symbol.for("react.consumer"),er=Symbol.for("react.context"),Aw=Symbol.for("react.forward_ref"),_w=Symbol.for("react.suspense"),Ew=Symbol.for("react.suspense_list"),Tw=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),Rw=Symbol.for("react.activity"),b5=Symbol.for("react.memo_cache_sentinel"),ty=Symbol.iterator;function ul(e){return e===null||typeof e!="object"?null:(e=ty&&e[ty]||e["@@iterator"],typeof e=="function"?e:null)}var v5=Symbol.for("react.client.reference");function kw(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===v5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ns:return"Fragment";case Cw:return"Profiler";case Jv:return"StrictMode";case _w:return"Suspense";case Ew:return"SuspenseList";case Rw:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case cl:return"Portal";case er:return e.displayName||"Context";case ey:return(e._context.displayName||"Context")+".Consumer";case Aw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tw:return t=e.displayName||null,t!==null?t:kw(e.type)||"Memo";case Or:t=e._payload,e=e._init;try{return kw(e(t))}catch{}}return null}var dl=Array.isArray,Ae=Kv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qe=h5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,To={pending:!1,data:null,method:null,action:null},Mw=[],Cs=-1;function Ra(e){return{current:e}}function $t(e){0>Cs||(e.current=Mw[Cs],Mw[Cs]=null,Cs--)}function st(e,t){Cs++,Mw[Cs]=e.current,e.current=t}var ka=Ra(null),fl=Ra(null),Pr=Ra(null),Ru=Ra(null);function ku(e,t){switch(st(Pr,t),st(fl,e),st(ka,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?AS(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=AS(t),e=_S(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$t(ka),st(ka,e)}function As(){$t(ka),$t(fl),$t(Pr)}function Dw(e){e.memoizedState!==null&&st(Ru,e);var t=ka.current,n=_S(t,e.type);t!==n&&(st(fl,e),st(ka,n))}function Mu(e){fl.current===e&&($t(ka),$t(fl)),Ru.current===e&&($t(Ru),tc._currentValue=To)}var Ow,ny;function Ro(e){if(Ow===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ow=t&&t[1]||"",ny=-1<n.stack.indexOf(` 42 42 at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return` 43 43 `+Ow+e+ny}var Pw=!1;function zw(e,t){if(!e||Pw)return"";Pw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var w=p}Reflect.construct(e,[],f)}else{try{f.call()}catch(p){w=p}e.call(f.prototype)}}else{try{throw Error()}catch(p){w=p}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(p){if(p&&w&&typeof p.stack=="string")return[p.stack,w.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=a.DetermineComponentFrameRoot(),i=s[0],l=s[1];if(i&&l){var c=i.split(` 44 `), u=l.split(`45 `);for(r=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;r< u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(a===c.length||r===u.length)for(a=c.length-1,r=u.length-1;1<=a&&0<=r&&c[a]!==u[r];)r--;for(;1<=a&&0<=r;a--,r--)if(c[a]!==u[r]){if(a!==1||r!==1)do if(a--,r--,0>r||c[a]!==u[r]){var m=`46 `+c[a].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=a&&0<=r);break}}}finally{Pw=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ro(n):""}function v5(e,t){switch(e.tag){case 26:case 27:case 5:return Ro(e.type);case 16:return Ro("Lazy");case 13:return e.child!==t&&t!==null?Ro("Suspense Fallback"):Ro("Suspense");case 19:return Ro("SuspenseList");case 0:case 15:return zw(e.type,!1);case 11:return zw(e.type.render,!1);case 1:return zw(e.type,!0);case 31:return Ro("Activity");default:return""}}function ay(e){try{var t="",n=null;do t+=v5(e,n),n=e,e=e.return;while(e);return t}catch(a){return`44 `),d=l.split(` 45 `);for(r=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;r<d.length&&!d[r].includes("DetermineComponentFrameRoot");)r++;if(a===c.length||r===d.length)for(a=c.length-1,r=d.length-1;1<=a&&0<=r&&c[a]!==d[r];)r--;for(;1<=a&&0<=r;a--,r--)if(c[a]!==d[r]){if(a!==1||r!==1)do if(a--,r--,0>r||c[a]!==d[r]){var m=` 46 `+c[a].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=a&&0<=r);break}}}finally{Pw=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ro(n):""}function y5(e,t){switch(e.tag){case 26:case 27:case 5:return Ro(e.type);case 16:return Ro("Lazy");case 13:return e.child!==t&&t!==null?Ro("Suspense Fallback"):Ro("Suspense");case 19:return Ro("SuspenseList");case 0:case 15:return zw(e.type,!1);case 11:return zw(e.type.render,!1);case 1:return zw(e.type,!0);case 31:return Ro("Activity");default:return""}}function ay(e){try{var t="",n=null;do t+=y5(e,n),n=e,e=e.return;while(e);return t}catch(a){return` 47 47 Error generating stack: `+a.message+` 48 `+a.stack}}var Lw=Object.prototype.hasOwnProperty,Iw=Dt.unstable_scheduleCallback,$w=Dt.unstable_cancelCallback, y5=Dt.unstable_shouldYield,S5=Dt.unstable_requestPaint,En=Dt.unstable_now,j5=Dt.unstable_getCurrentPriorityLevel,ry=Dt.unstable_ImmediatePriority,oy=Dt.unstable_UserBlockingPriority,Du=Dt.unstable_NormalPriority,N5=Dt.unstable_LowPriority,sy=Dt.unstable_IdlePriority,C5=Dt.log,A5=Dt.unstable_setDisableYieldValue,ml=null,Tn=null;function zr(e){if(typeof C5=="function"&&A5(e),Tn&&typeof Tn.setStrictMode=="function")try{Tn.setStrictMode(ml,e)}catch{}}var Rn=Math.clz32?Math.clz32:T5,_5=Math.log,E5=Math.LN2;function T5(e){return e>>>=0,e===0?32:31-(_5(e)/E5|0)|0}var Ou=256,Pu=262144,zu=4194304;function ko(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Lu(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=a&134217727;return l!==0?(a=l&~s,a!==0?r=ko(a):(i&=l,i!==0?r=ko(i):n||(n=l&~e,n!==0&&(r=ko(n))))):(l=a&~s,l!==0?r=ko(l):i!==0?r=ko(i):n||(n=a&~e,n!==0&&(r=ko(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function wl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function R5(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function iy(){var e=zu;return zu<<=1,!(zu&62914560)&&(zu=4194304),e}function Bw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function k5(e,t,n,a,r,s){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=i&~n;0<n;){var m=31-Rn(n),f=1<<m;l[m]=0,c[m]=-1;var w=u[m];if(w!==null)for(u[m]=null,m=0;m<w.length;m++){var p=w[m];p!==null&&(p.lane&=-536870913)}n&=~f}a!==0&&ly(e,a,0),s!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=s&~(i&~t))}function ly(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Rn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function cy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Rn(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function uy(e,t){var n=t&-t;return n=n&42?1:Uw(n),n&(e.suspendedLanes|t)?0:n}function Uw(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hw(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dy(){var e=qe.p;return e!==0?e:(e=window.event,e===void 0?32:WS(e.type))}function fy(e,t){var n=qe.p;try{return qe.p=e,t()}finally{qe.p=n}}var Lr=Math.random().toString(36).slice(2),Qt="__reactFiber$"+Lr,hn="__reactProps$"+Lr,_s="__reactContainer$"+Lr,Fw="__reactEvents$"+Lr,M5="__reactListeners$"+Lr,D5="__reactHandles$"+Lr,my="__reactResources$"+Lr,hl="__reactMarker$"+Lr;function Vw(e){delete e[Qt],delete e[hn],delete e[Fw],delete e[M5],delete e[D5]}function Es(e){var t=e[Qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_s]||n[Qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=OS(e);e!==null;){if(n=e[Qt])return n;e=OS(e)}return t}e=n,n=e.parentNode}return null}function Ts(e){if(e=e[Qt]||e[_s]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(q(33))}function Rs(e){var t=e[my];return t||(t=e[my]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Bt(e){e[hl]=!0}var wy=new Set,py={};function Mo(e,t){ks(e,t),ks(e+"Capture",t)}function ks(e,t){for(py[e]=t,e=0;e<t.length;e++)wy.add(t[e])}var O5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),hy={},gy={};function P5(e){return Lw.call(gy,e)?!0:Lw.call(hy,e)?!1:O5.test(e)?gy[e]=!0:(hy[e]=!0,!1)}function Iu(e,t,n){if(P5(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function $u(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function tr(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Zn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z5(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,s=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){n=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gw(e){if(!e._valueTracker){var t=xy(e)?"checked":"value";e._valueTracker=z5(e,t,""+e[t])}}function by(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=xy(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Bu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var L5=/[\n"\\]/g;function Qn(e){return e.replace(L5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yw(e,t,n,a,r,s,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zn(t)):e.value!==""+Zn(t)&&(e.value=""+Zn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?Kw(e,i,Zn(t)):n!=null?Kw(e,i,Zn(n)):a!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Zn(l):e.removeAttribute("name")}function vy(e,t,n,a,r,s,i,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Gw(e);return}n=n!=null?""+Zn(n):"",t=t!=null?""+Zn(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=l?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Gw(e)}function Kw(e,t,n){t==="number"&&Bu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ms(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Zn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function yy(e,t,n){if(t!=null&&(t=""+Zn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Zn(n):""}function Sy(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(q(92));if(dl(a)){if(1<a.length)throw Error(q(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Zn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Gw(e)}function Ds(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var I5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function jy(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||I5.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ny(e,t,n){if(t!=null&&typeof t!="object")throw Error(q(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&jy(e,r,a)}else for(var s in t)t.hasOwnProperty(s)&&jy(e,s,t[s])}function qw(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),B5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Uu(e){return B5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nr(){}var Xw=null;function Ww(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Os=null,Ps=null;function Cy(e){var t=Ts(e);if(t&&(e=t.stateNode)){var n=e[hn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yw(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Qn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[hn]||null;if(!r)throw Error(q(90));Yw(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&by(a)}break e;case"textarea":yy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ms(e,!!n.multiple,t,!1)}}}var Zw=!1;function Ay(e,t,n){if(Zw)return e(t,n);Zw=!0;try{var a=e(t);return a}finally{if(Zw=!1,(Os!==null||Ps!==null)&&(Ed(),Os&&(t=Os,e=Ps,Ps=Os=null,Cy(t),e)))for(t=0;t<e.length;t++)Cy(e[t])}}function xl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[hn]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qw=!1;if(ar)try{var bl={};Object.defineProperty(bl,"passive",{get:function(){Qw=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Qw=!1}var Ir=null,Jw=null,Hu=null;function _y(){if(Hu)return Hu;var e,t=Jw,n=t.length,a,r="value"in Ir?Ir.value:Ir.textContent,s=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===r[s-a];a++);return Hu=r.slice(e,1<a?1-a:void 0)}function Fu(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 Vu(){return!0}function Ey(){return!1}function gn(e){function t(n,a,r,s,i){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Vu:Ey,this.isPropagationStopped=Ey,this}return lt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vu)},persist:function(){},isPersistent:Vu}),t}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gu=gn(Do),vl=lt({},Do,{view:0,detail:0}),U5=gn(vl),ep,tp,yl,Yu=lt({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ap,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!==yl&&(yl&&e.type==="mousemove"?(ep=e.screenX-yl.screenX,tp=e.screenY-yl.screenY):tp=ep=0,yl=e),ep)},movementY:function(e){return"movementY"in e?e.movementY:tp}}),Ty=gn(Yu),H5=lt({},Yu,{dataTransfer:0}),F5=gn(H5),V5=lt({},vl,{relatedTarget:0}),np=gn(V5),G5=lt({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),Y5=gn(G5),K5=lt({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),q5=gn(K5),X5=lt({},Do,{data:0}),Ry=gn(X5),W5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Z5={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"},Q5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Q5[e])?!!t[e]:!1}function ap(){return J5}var e4=lt({},vl,{key:function(e){if(e.key){var t=W5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Z5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ap,charCode:function(e){return e.type==="keypress"?Fu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t4=gn(e4),n4=lt({},Yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ky=gn(n4),a4=lt({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ap}),r4=gn(a4),o4=lt({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),s4=gn(o4),i4=lt({},Yu,{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}),l4=gn(i4),c4=lt({},Do,{newState:0,oldState:0}),u4=gn(c4),d4=[9,13,27,32],rp=ar&&"CompositionEvent"in window,Sl=null;ar&&"documentMode"in document&&(Sl=document.documentMode);var f4=ar&&"TextEvent"in window&&!Sl,My=ar&&(!rp||Sl&&8<Sl&&11>=Sl),Dy=" ",Oy=!1;function Py(e,t){switch(e){case"keyup":return d4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zs=!1;function m4(e,t){switch(e){case"compositionend":return zy(t);case"keypress":return t.which!==32?null:(Oy=!0,Dy);case"textInput":return e=t.data,e===Dy&&Oy?null:e;default:return null}}function w4(e,t){if(zs)return e==="compositionend"||!rp&&Py(e,t)?(e=_y(),Hu=Jw=Ir=null,zs=!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 My&&t.locale!=="ko"?null:t.data;default:return null}}var p4={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 Ly(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!p4[e.type]:t==="textarea"}function Iy(e,t,n,a){Os?Ps?Ps.push(a):Ps=[a]:Os=a,t=Pd(t,"onChange"),0<t.length&&(n=new Gu("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var jl=null,Nl=null;function h4(e){vS(e,0)}function Ku(e){var t=gl(e);if(by(t))return e}function $y(e,t){if(e==="change")return t}var By=!1;if(ar){var op;if(ar){var sp="oninput"in document;if(!sp){var Uy=document.createElement("div");Uy.setAttribute("oninput","return;"),sp=typeof Uy.oninput=="function"}op=sp}else op=!1;By=op&&(!document.documentMode||9<document.documentMode)}function Hy(){jl&&(jl.detachEvent("onpropertychange",Fy),Nl=jl=null)}function Fy(e){if(e.propertyName==="value"&&Ku(Nl)){var t=[];Iy(t,Nl,e,Ww(e)),Ay(h4,t)}}function g4(e,t,n){e==="focusin"?(Hy(),jl=t,Nl=n,jl.attachEvent("onpropertychange",Fy)):e==="focusout"&&Hy()}function x4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ku(Nl)}function b4(e,t){if(e==="click")return Ku(t)}function v4(e,t){if(e==="input"||e==="change")return Ku(t)}function y4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kn=typeof Object.is=="function"?Object.is:y4;function Cl(e,t){if(kn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Lw.call(t,r)||!kn(e[r],t[r]))return!1}return!0}function Vy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gy(e,t){var n=Vy(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vy(n)}}function Yy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ky(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bu(e.document)}return t}function ip(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var S4=ar&&"documentMode"in document&&11>=document.documentMode,Ls=null,lp=null,Al=null,cp=!1;function qy(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cp||Ls==null||Ls!==Bu(a)||(a=Ls,"selectionStart"in a&&ip(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Al&&Cl(Al,a)||(Al=a,a=Pd(lp,"onSelect"),0<a.length&&(t=new Gu("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ls)))}function Oo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Is={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},up={},Xy={};ar&&(Xy=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function Po(e){if(up[e])return up[e];if(!Is[e])return e;var t=Is[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xy)return up[e]=t[n];return e}var Wy=Po("animationend"),Zy=Po("animationiteration"),Qy=Po("animationstart"),j4=Po("transitionrun"),N4=Po("transitionstart"),C4=Po("transitioncancel"),Jy=Po("transitionend"),e0=new Map,dp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");dp.push("scrollEnd");function ga(e,t){e0.set(e,t),Mo(t,[e])}var qu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jn=[],$s=0,fp=0;function Xu(){for(var e=$s,t=fp=$s=0;t<e;){var n=Jn[t];Jn[t++]=null;var a=Jn[t];Jn[t++]=null;var r=Jn[t];Jn[t++]=null;var s=Jn[t];if(Jn[t++]=null,a!==null&&r!==null){var i=a.pending;i===null?r.next=r:(r.next=i.next,i.next=r),a.pending=r}s!==0&&t0(n,r,s)}}function Wu(e,t,n,a){Jn[$s++]=e,Jn[$s++]=t,Jn[$s++]=n,Jn[$s++]=a,fp|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function mp(e,t,n,a){return Wu(e,t,n,a),Zu(e)}function zo(e,t){return Wu(e,null,null,t),Zu(e)}function t0(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,s=e.return;s!==null;)s.childLanes|=n,a=s.alternate,a!==null&&(a.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(r=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,r&&t!==null&&(r=31-Rn(n),e=s.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),s):null}function Zu(e){if(50<ql)throw ql=0,Sh=null,Error(q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bs={};function A4(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(e,t,n,a){return new A4(e,t,n,a)}function wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rr(e,t){var n=e.alternate;return n===null?(n=Mn(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&65011712,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.refCleanup=e.refCleanup,n}function n0(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Qu(e,t,n,a,r,s){var i=0;if(a=e,typeof e=="function")wp(e)&&(i=1);else if(typeof e=="string")i=k3(e,n,ka.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Rw:return e=Mn(31,n,t,r),e.elementType=Rw,e.lanes=s,e;case Ns:return Lo(n.children,r,s,t);case Jv:i=8,r|=24;break;case Cw:return e=Mn(12,n,t,r|2),e.elementType=Cw,e.lanes=s,e;case _w:return e=Mn(13,n,t,r),e.elementType=_w,e.lanes=s,e;case Ew:return e=Mn(19,n,t,r),e.elementType=Ew,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case er:i=10;break e;case ey:i=9;break e;case Aw:i=11;break e;case Tw:i=14;break e;case Or:i=16,a=null;break e}i=29,n=Error(q(130,e===null?"null":typeof e,"")),a=null}return t=Mn(i,n,t,r),t.elementType=e,t.type=a,t.lanes=s,t}function Lo(e,t,n,a){return e=Mn(7,e,a,t),e.lanes=n,e}function pp(e,t,n){return e=Mn(6,e,null,t),e.lanes=n,e}function a0(e){var t=Mn(18,null,null,0);return t.stateNode=e,t}function hp(e,t,n){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var r0=new WeakMap;function ea(e,t){if(typeof e=="object"&&e!==null){var n=r0.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ay(t)},r0.set(e,t),t)}return{value:e,source:t,stack:ay(t)}}var Us=[],Hs=0,Ju=null,_l=0,ta=[],na=0,$r=null,Ma=1,Da="";function or(e,t){Us[Hs++]=_l,Us[Hs++]=Ju,Ju=e,_l=t}function o0(e,t,n){ta[na++]=Ma,ta[na++]=Da,ta[na++]=$r,$r=e;var a=Ma;e=Da;var r=32-Rn(a)-1;a&=~(1<<r),n+=1;var s=32-Rn(t)+r;if(30<s){var i=r-r%5;s=(a&(1<<i)-1).toString(32),a>>=i,r-=i,Ma=1<<32-Rn(t)+r|n<<r|a,Da=s+e}else Ma=1<<s|n<<r|a,Da=e}function gp(e){e.return!==null&&(or(e,1),o0(e,1,0))}function xp(e){for(;e===Ju;)Ju=Us[--Hs],Us[Hs]=null,_l=Us[--Hs],Us[Hs]=null;for(;e===$r;)$r=ta[--na],ta[na]=null,Da=ta[--na],ta[na]=null,Ma=ta[--na],ta[na]=null}function s0(e,t){ta[na++]=Ma,ta[na++]=Da,ta[na++]=$r,Ma=t.id,Da=t.overflow,$r=e}var Jt=null,ct=null,Ue=!1,Br=null,aa=!1,bp=Error(q(519));function Ur(e){var t=Error(q(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(ea(t,e)),bp}function i0(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Qt]=e,t[hn]=a,n){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(n=0;n<Wl.length;n++)Ie(Wl[n],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),vy(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),Sy(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||NS(t.textContent,n)?(a.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),a.onScroll!=null&&Ie("scroll",t),a.onScrollEnd!=null&&Ie("scrollend",t),a.onClick!=null&&(t.onclick=nr),t=!0):t=!1,t||Ur(e,!0)}function l0(e){for(Jt=e.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:Jt=Jt.return}}function Fs(e){if(e!==Jt)return!1;if(!Ue)return l0(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Lh(e.type,e.memoizedProps)),n=!n),n&&ct&&Ur(e),l0(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));ct=DS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));ct=DS(e)}else t===27?(t=ct,to(e.type)?(e=Hh,Hh=null,ct=e):ct=t):ct=Jt?oa(e.stateNode.nextSibling):null;return!0}function Io(){ct=Jt=null,Ue=!1}function vp(){var e=Br;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),Br=null),e}function El(e){Br===null?Br=[e]:Br.push(e)}var yp=Ra(null),$o=null,sr=null;function Hr(e,t,n){st(yp,t._currentValue),t._currentValue=n}function ir(e){e._currentValue=yp.current,$t(yp)}function Sp(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function jp(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var s=r.dependencies;if(s!==null){var i=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Sp(s.return,n,e),a||(i=null);break e}s=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(q(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Sp(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function Vs(e,t,n,a){e=null;for(var r=t,s=!1;r!==null;){if(!s){if(r.flags&524288)s=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(q(387));if(i=i.memoizedProps,i!==null){var l=r.type;kn(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===Ru.current){if(i=r.alternate,i===null)throw Error(q(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(tc):e=[tc])}r=r.return}e!==null&&jp(t,e,n,a),t.flags|=262144}function ed(e){for(e=e.firstContext;e!==null;){if(!kn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bo(e){$o=e,sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function en(e){return c0($o,e)}function td(e,t){return $o===null&&Bo(e),c0(e,t)}function c0(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sr===null){if(e===null)throw Error(q(308));sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sr=sr.next=t;return n}var _4=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},E4=Dt.unstable_scheduleCallback,T4=Dt.unstable_NormalPriority,Ct={$$typeof:er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Np(){return{controller:new _4,data:new Map,refCount:0}}function Tl(e){e.refCount--,e.refCount===0&&E4(T4,function(){e.controller.abort()})}var Rl=null,Cp=0,Gs=0,Ys=null;function R4(e,t){if(Rl===null){var n=Rl=[];Cp=0,Gs=Eh(),Ys={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Cp++,t.then(u0,u0),t}function u0(){if(--Cp===0&&Rl!==null){Ys!==null&&(Ys.status="fulfilled");var e=Rl;Rl=null,Gs=0,Ys=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function k4(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var d0=Ce.S;Ce.S=function(e,t){q1=En(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&R4(e,t),d0!==null&&d0(e,t)};var Uo=Ra(null);function Ap(){var e=Uo.current;return e!==null?e:ot.pooledCache}function nd(e,t){t===null?st(Uo,Uo.current):st(Uo,t.pool)}function f0(){var e=Ap();return e===null?null:{parent:Ct._currentValue,pool:e}}var Ks=Error(q(460)),_p=Error(q(474)),ad=Error(q(542)),rd={then:function(){}};function m0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function w0(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nr,nr),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,h0(e),e;default:if(typeof t.status=="string")t.then(nr,nr);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(q(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,h0(e),e}throw Fo=t,Ks}}function Ho(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Fo=n,Ks):n}}var Fo=null;function p0(){if(Fo===null)throw Error(q(459));var e=Fo;return Fo=null,e}function h0(e){if(e===Ks||e===ad)throw Error(q(483))}var qs=null,kl=0;function od(e){var t=kl;return kl+=1,qs===null&&(qs=[]),w0(qs,e,t)}function Ml(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sd(e,t){throw t.$$typeof===g5?Error(q(525)):(e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function g0(e){function t(h,g){if(e){var v=h.deletions;v===null?(h.deletions=[g],h.flags|=16):v.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function a(h){for(var g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function r(h,g){return h=rr(h,g),h.index=0,h.sibling=null,h}function s(h,g,v){return h.index=v,e?(v=h.alternate,v!==null?(v=v.index,v<g?(h.flags|=67108866,g):v):(h.flags|=67108866,g)):(h.flags|=1048576,g)}function i(h){return e&&h.alternate===null&&(h.flags|=67108866),h}function l(h,g,v,S){return g===null||g.tag!==6?(g=pp(v,h.mode,S),g.return=h,g):(g=r(g,v),g.return=h,g)}function c(h,g,v,S){var N=v.type;return N===Ns?m(h,g,v.props.children,S,v.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Or&&Ho(N)===g.type)?(g=r(g,v.props),Ml(g,v),g.return=h,g):(g=Qu(v.type,v.key,v.props,null,h.mode,S),Ml(g,v),g.return=h,g)}function u(h,g,v,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=hp(v,h.mode,S),g.return=h,g):(g=r(g,v.children||[]),g.return=h,g)}function m(h,g,v,S,N){return g===null||g.tag!==7?(g=Lo(v,h.mode,S,N),g.return=h,g):(g=r(g,v),g.return=h,g)}function f(h,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=pp(""+g,h.mode,v),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Tu:return v=Qu(g.type,g.key,g.props,null,h.mode,v),Ml(v,g),v.return=h,v;case cl:return g=hp(g,h.mode,v),g.return=h,g;case Or:return g=Ho(g),f(h,g,v)}if(dl(g)||ul(g))return g=Lo(g,h.mode,v,null),g.return=h,g;if(typeof g.then=="function")return f(h,od(g),v);if(g.$$typeof===er)return f(h,td(h,g),v);sd(h,g)}return null}function w(h,g,v,S){var N=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return N!==null?null:l(h,g,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:return v.key===N?c(h,g,v,S):null;case cl:return v.key===N?u(h,g,v,S):null;case Or:return v=Ho(v),w(h,g,v,S)}if(dl(v)||ul(v))return N!==null?null:m(h,g,v,S,null);if(typeof v.then=="function")return w(h,g,od(v),S);if(v.$$typeof===er)return w(h,g,td(h,v),S);sd(h,v)}return null}function p(h,g,v,S,N){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return h=h.get(v)||null,l(g,h,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Tu:return h=h.get(S.key===null?v:S.key)||null,c(g,h,S,N);case cl:return h=h.get(S.key===null?v:S.key)||null,u(g,h,S,N);case Or:return S=Ho(S),p(h,g,v,S,N)}if(dl(S)||ul(S))return h=h.get(v)||null,m(g,h,S,N,null);if(typeof S.then=="function")return p(h,g,v,od(S),N);if(S.$$typeof===er)return p(h,g,v,td(g,S),N);sd(g,S)}return null}function x(h,g,v,S){for(var N=null,A=null,j=g,C=g=0,R=null;j!==null&&C<v.length;C++){j.index>C?(R=j,j=null):R=j.sibling;var M=w(h,j,v[C],S);if(M===null){j===null&&(j=R);break}e&&j&&M.alternate===null&&t(h,j),g=s(M,g,C),A===null?N=M:A.sibling=M,A=M,j=R}if(C===v.length)return n(h,j),Ue&&or(h,C),N;if(j===null){for(;C<v.length;C++)j=f(h,v[C],S),j!==null&&(g=s(j,g,C),A===null?N=j:A.sibling=j,A=j);return Ue&&or(h,C),N}for(j=a(j);C<v.length;C++)R=p(j,h,C,v[C],S),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?C:R.key),g=s(R,g,C),A===null?N=R:A.sibling=R,A=R);return e&&j.forEach(function(z){return t(h,z)}),Ue&&or(h,C),N}function b(h,g,v,S){if(v==null)throw Error(q(151));for(var N=null,A=null,j=g,C=g=0,R=null,M=v.next();j!==null&&!M.done;C++,M=v.next()){j.index>C?(R=j,j=null):R=j.sibling;var z=w(h,j,M.value,S);if(z===null){j===null&&(j=R);break}e&&j&&z.alternate===null&&t(h,j),g=s(z,g,C),A===null?N=z:A.sibling=z,A=z,j=R}if(M.done)return n(h,j),Ue&&or(h,C),N;if(j===null){for(;!M.done;C++,M=v.next())M=f(h,M.value,S),M!==null&&(g=s(M,g,C),A===null?N=M:A.sibling=M,A=M);return Ue&&or(h,C),N}for(j=a(j);!M.done;C++,M=v.next())M=p(j,h,C,M.value,S),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?C:M.key),g=s(M,g,C),A===null?N=M:A.sibling=M,A=M);return e&&j.forEach(function(B){return t(h,B)}),Ue&&or(h,C),N}function y(h,g,v,S){if(typeof v=="object"&&v!==null&&v.type===Ns&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:e:{for(var N=v.key;g!==null;){if(g.key===N){if(N=v.type,N===Ns){if(g.tag===7){n(h,g.sibling),S=r(g,v.props.children),S.return=h,h=S;break e}}else if(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Or&&Ho(N)===g.type){n(h,g.sibling),S=r(g,v.props),Ml(S,v),S.return=h,h=S;break e}n(h,g);break}else t(h,g);g=g.sibling}v.type===Ns?(S=Lo(v.props.children,h.mode,S,v.key),S.return=h,h=S):(S=Qu(v.type,v.key,v.props,null,h.mode,S),Ml(S,v),S.return=h,h=S)}return i(h);case cl:e:{for(N=v.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(h,g.sibling),S=r(g,v.children||[]),S.return=h,h=S;break e}else{n(h,g);break}else t(h,g);g=g.sibling}S=hp(v,h.mode,S),S.return=h,h=S}return i(h);case Or:return v=Ho(v),y(h,g,v,S)}if(dl(v))return x(h,g,v,S);if(ul(v)){if(N=ul(v),typeof N!="function")throw Error(q(150));return v=N.call(v),b(h,g,v,S)}if(typeof v.then=="function")return y(h,g,od(v),S);if(v.$$typeof===er)return y(h,g,td(h,v),S);sd(h,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(n(h,g.sibling),S=r(g,v),S.return=h,h=S):(n(h,g),S=pp(v,h.mode,S),S.return=h,h=S),i(h)):n(h,g)}return function(h,g,v,S){try{kl=0;var N=y(h,g,v,S);return qs=null,N}catch(j){if(j===Ks||j===ad)throw j;var A=Mn(29,j,null,h.mode);return A.lanes=S,A.return=h,A}finally{}}}var Vo=g0(!0),x0=g0(!1),Fr=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Vr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gr(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Xe&2){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Zu(e),t0(e,null,n),t}return Wu(e,a,t,n),Zu(e)}function Dl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cy(e,n)}}function Rp(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kp=!1;function Ol(){if(kp){var e=Ys;if(e!==null)throw e}}function Pl(e,t,n,a){kp=!1;var r=e.updateQueue;Fr=!1;var s=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?s=u:i.next=u,i=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==i&&(l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;i=0,m=u=c=null,l=s;do{var w=l.lane&-536870913,p=w!==l.lane;if(p?(Be&w)===w:(a&w)===w){w!==0&&w===Gs&&(kp=!0),m!==null&&(m=m.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var x=e,b=l;w=t;var y=n;switch(b.tag){case 1:if(x=b.payload,typeof x=="function"){f=x.call(y,f,w);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,w=typeof x=="function"?x.call(y,f,w):x,w==null)break e;f=lt({},f,w);break e;case 2:Fr=!0}}w=l.callback,w!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[w]:p.push(w))}else p={lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(u=m=p,c=f):m=m.next=p,i|=w;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);m===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=m,s===null&&(r.shared.lanes=0),Wr|=i,e.lanes=i,e.memoizedState=f}}function b0(e,t){if(typeof e!="function")throw Error(q(191,e));e.call(t)}function v0(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)b0(n[e],t)}var Xs=Ra(null),id=Ra(0);function y0(e,t){e=hr,st(id,e),st(Xs,t),hr=e|t.baseLanes}function Mp(){st(id,hr),st(Xs,Xs.current)}function Dp(){hr=id.current,$t(Xs),$t(id)}var Dn=Ra(null),ra=null;function Yr(e){var t=e.alternate;st(yt,yt.current&1),st(Dn,e),ra===null&&(t===null||Xs.current!==null||t.memoizedState!==null)&&(ra=e)}function Op(e){st(yt,yt.current),st(Dn,e),ra===null&&(ra=e)}function S0(e){e.tag===22?(st(yt,yt.current),st(Dn,e),ra===null&&(ra=e)):Kr()}function Kr(){st(yt,yt.current),st(Dn,Dn.current)}function On(e){$t(Dn),ra===e&&(ra=null),$t(yt)}var yt=Ra(0);function ld(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bh(n)||Uh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)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 lr=0,ke=null,et=null,At=null,cd=!1,Ws=!1,Go=!1,ud=0,zl=0,Zs=null,M4=0;function gt(){throw Error(q(321))}function Pp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kn(e[n],t[n]))return!1;return!0}function zp(e,t,n,a,r,s){return lr=s,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ce.H=e===null||e.memoizedState===null?o1:Zp,Go=!1,s=n(a,r),Go=!1,Ws&&(s=N0(t,n,a,r)),j0(e),s}function j0(e){Ce.H=$l;var t=et!==null&&et.next!==null;if(lr=0,At=et=ke=null,cd=!1,zl=0,Zs=null,t)throw Error(q(300));e===null||_t||(e=e.dependencies,e!==null&&ed(e)&&(_t=!0))}function N0(e,t,n,a){ke=e;var r=0;do{if(Ws&&(Zs=null),zl=0,Ws=!1,25<=r)throw Error(q(301));if(r+=1,At=et=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Ce.H=s1,s=t(n,a)}while(Ws);return s}function D4(){var e=Ce.H,t=e.useState()[0];return t=typeof t.then=="function"?Ll(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(ke.flags|=1024),t}function Lp(){var e=ud!==0;return ud=0,e}function Ip(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $p(e){if(cd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cd=!1}lr=0,At=et=ke=null,Ws=!1,zl=ud=0,Zs=null}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?ke.memoizedState=At=e:At=At.next=e,At}function St(){if(et===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=At===null?ke.memoizedState:At.next;if(t!==null)At=t,et=e;else{if(e===null)throw ke.alternate===null?Error(q(467)):Error(q(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},At===null?ke.memoizedState=At=e:At=At.next=e}return At}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ll(e){var t=zl;return zl+=1,Zs===null&&(Zs=[]),e=w0(Zs,e,t),t=ke,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,Ce.H=t===null||t.memoizedState===null?o1:Zp),e}function fd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ll(e);if(e.$$typeof===er)return en(e)}throw Error(q(438,String(e)))}function Bp(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ke.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=dd(),ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=x5;return t.index++,n}function cr(e,t){return typeof t=="function"?t(e):t}function md(e){var t=St();return Up(t,et,e)}function Up(e,t,n){var a=e.queue;if(a===null)throw Error(q(311));a.lastRenderedReducer=n;var r=e.baseQueue,s=a.pending;if(s!==null){if(r!==null){var i=r.next;r.next=s.next,s.next=i}t.baseQueue=r=s,a.pending=null}if(s=e.baseState,r===null)e.memoizedState=s;else{t=r.next;var l=i=null,c=null,u=t,m=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(Be&f)===f:(lr&f)===f){var w=u.revertLane;if(w===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Gs&&(m=!0);else if((lr&w)===w){u=u.next,w===Gs&&(m=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,i=s):c=c.next=f,ke.lanes|=w,Wr|=w;f=u.action,Go&&n(s,f),s=u.hasEagerState?u.eagerState:n(s,f)}else w={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=w,i=s):c=c.next=w,ke.lanes|=f,Wr|=f;u=u.next}while(u!==null&&u!==t);if(c===null?i=s:c.next=l,!kn(s,e.memoizedState)&&(_t=!0,m&&(n=Ys,n!==null)))throw n;e.memoizedState=s,e.baseState=i,e.baseQueue=c,a.lastRenderedState=s}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Hp(e){var t=St(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,s=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do s=e(s,i.action),i=i.next;while(i!==r);kn(s,t.memoizedState)||(_t=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,a]}function C0(e,t,n){var a=ke,r=St(),s=Ue;if(s){if(n===void 0)throw Error(q(407));n=n()}else n=t();var i=!kn((et||r).memoizedState,n);if(i&&(r.memoizedState=n,_t=!0),r=r.queue,Gp(E0.bind(null,a,r,e),[e]),r.getSnapshot!==t||i||At!==null&&At.memoizedState.tag&1){if(a.flags|=2048,Qs(9,{destroy:void 0},_0.bind(null,a,r,n,t),null),ot===null)throw Error(q(349));s||lr&127||A0(a,t,n)}return n}function A0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=dd(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _0(e,t,n,a){t.value=n,t.getSnapshot=a,T0(t)&&R0(e)}function E0(e,t,n){return n(function(){T0(t)&&R0(e)})}function T0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kn(e,n)}catch{return!0}}function R0(e){var t=zo(e,2);t!==null&&Sn(t,e,2)}function Fp(e){var t=fn();if(typeof e=="function"){var n=e;if(e=n(),Go){zr(!0);try{n()}finally{zr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function k0(e,t,n,a){return e.baseState=n,Up(e,et,typeof a=="function"?a:cr)}function O4(e,t,n,a,r){if(hd(e))throw Error(q(485));if(e=t.action,e!==null){var s={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){s.listeners.push(i)}};Ce.T!==null?n(!0):s.isTransition=!1,a(s),n=t.pending,n===null?(s.next=t.pending=s,M0(t,s)):(s.next=n.next,t.pending=n.next=s)}}function M0(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var s=Ce.T,i={};Ce.T=i;try{var l=n(r,a),c=Ce.S;c!==null&&c(i,l),D0(e,t,l)}catch(u){Vp(e,t,u)}finally{s!==null&&i.types!==null&&(s.types=i.types),Ce.T=s}}else try{s=n(r,a),D0(e,t,s)}catch(u){Vp(e,t,u)}}function D0(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){O0(e,t,a)},function(a){return Vp(e,t,a)}):O0(e,t,n)}function O0(e,t,n){t.status="fulfilled",t.value=n,P0(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,M0(e,n)))}function Vp(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,P0(t),t=t.next;while(t!==a)}e.action=null}function P0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function z0(e,t){return t}function L0(e,t){if(Ue){var n=ot.formState;if(n!==null){e:{var a=ke;if(Ue){if(ct){t:{for(var r=ct,s=aa;r.nodeType!==8;){if(!s){r=null;break t}if(r=oa(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){ct=oa(r.nextSibling),a=r.data==="F!";break e}}Ur(a)}a=!1}a&&(t=n[0])}}return n=fn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z0,lastRenderedState:t},n.queue=a,n=n1.bind(null,ke,a),a.dispatch=n,a=Fp(!1),s=Wp.bind(null,ke,!1,a.queue),a=fn(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=O4.bind(null,ke,r,s,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function I0(e){var t=St();return $0(t,et,e)}function $0(e,t,n){if(t=Up(e,t,z0)[0],e=md(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ll(t)}catch(i){throw i===Ks?ad:i}else a=t;t=St();var r=t.queue,s=r.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,Qs(9,{destroy:void 0},P4.bind(null,r,n),null)),[a,s,e]}function P4(e,t){e.action=t}function B0(e){var t=St(),n=et;if(n!==null)return $0(t,n,e);St(),t=t.memoizedState,n=St();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Qs(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=ke.updateQueue,t===null&&(t=dd(),ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function U0(){return St().memoizedState}function wd(e,t,n,a){var r=fn();ke.flags|=e,r.memoizedState=Qs(1|t,{destroy:void 0},n,a===void 0?null:a)}function pd(e,t,n,a){var r=St();a=a===void 0?null:a;var s=r.memoizedState.inst;et!==null&&a!==null&&Pp(a,et.memoizedState.deps)?r.memoizedState=Qs(t,s,n,a):(ke.flags|=e,r.memoizedState=Qs(1|t,s,n,a))}function H0(e,t){wd(8390656,8,e,t)}function Gp(e,t){pd(2048,8,e,t)}function z4(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=dd(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function F0(e){var t=St().memoizedState;return z4({ref:t,nextImpl:e}),function(){if(Xe&2)throw Error(q(440));return t.impl.apply(void 0,arguments)}}function V0(e,t){return pd(4,2,e,t)}function G0(e,t){return pd(4,4,e,t)}function Y0(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function K0(e,t,n){n=n!=null?n.concat([e]):null,pd(4,4,Y0.bind(null,t,e),n)}function Yp(){}function q0(e,t){var n=St();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Pp(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function X0(e,t){var n=St();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Pp(t,a[1]))return a[0];if(a=e(),Go){zr(!0);try{e()}finally{zr(!1)}}return n.memoizedState=[a,t],a}function Kp(e,t,n){return n===void 0||lr&1073741824&&!(Be&261930)?e.memoizedState=t:(e.memoizedState=n,e=W1(),ke.lanes|=e,Wr|=e,n)}function W0(e,t,n,a){return kn(n,t)?n:Xs.current!==null?(e=Kp(e,n,a),kn(e,t)||(_t=!0),e):!(lr&42)||lr&1073741824&&!(Be&261930)?(_t=!0,e.memoizedState=n):(e=W1(),ke.lanes|=e,Wr|=e,t)}function Z0(e,t,n,a,r){var s=qe.p;qe.p=s!==0&&8>s?s:8;var i=Ce.T,l={};Ce.T=l,Wp(e,!1,t,n);try{var c=r(),u=Ce.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var m=k4(c,a);Il(e,t,m,Ln(e))}else Il(e,t,a,Ln(e))}catch(f){Il(e,t,{then:function(){},status:"rejected",reason:f},Ln())}finally{qe.p=s,i!==null&&l.types!==null&&(i.types=l.types),Ce.T=i}}function L4(){}function qp(e,t,n,a){if(e.tag!==5)throw Error(q(476));var r=Q0(e).queue;Z0(e,r,t,To,n===null?L4:function(){return J0(e),n(a)})}function Q0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:To,baseState:To,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:To},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function J0(e){var t=Q0(e);t.next===null&&(t=e.alternate.memoizedState),Il(e,t.next.queue,{},Ln())}function Xp(){return en(tc)}function e1(){return St().memoizedState}function t1(){return St().memoizedState}function I4(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ln();e=Vr(n);var a=Gr(t,e,n);a!==null&&(Sn(a,t,n),Dl(a,t,n)),t={cache:Np()},e.payload=t;return}t=t.return}}function $4(e,t,n){var a=Ln();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hd(e)?a1(t,n):(n=mp(e,t,n,a),n!==null&&(Sn(n,e,a),r1(n,t,a)))}function n1(e,t,n){var a=Ln();Il(e,t,n,a)}function Il(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hd(e))a1(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(r.hasEagerState=!0,r.eagerState=l,kn(l,i))return Wu(e,t,r,0),ot===null&&Xu(),!1}catch{}finally{}if(n=mp(e,t,r,a),n!==null)return Sn(n,e,a),r1(n,t,a),!0}return!1}function Wp(e,t,n,a){if(a={lane:2,revertLane:Eh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hd(e)){if(t)throw Error(q(479))}else t=mp(e,n,a,2),t!==null&&Sn(t,e,2)}function hd(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function a1(e,t){Ws=cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function r1(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cy(e,n)}}var $l={readContext:en,use:fd,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};$l.useEffectEvent=gt;var o1={readContext:en,use:fd,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:H0,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,wd(4194308,4,Y0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wd(4194308,4,e,t)},useInsertionEffect:function(e,t){wd(4,2,e,t)},useMemo:function(e,t){var n=fn();t=t===void 0?null:t;var a=e();if(Go){zr(!0);try{e()}finally{zr(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=fn();if(n!==void 0){var r=n(t);if(Go){zr(!0);try{n(t)}finally{zr(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=$4.bind(null,ke,e),[a.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:function(e){e=Fp(e);var t=e.queue,n=n1.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Yp,useDeferredValue:function(e,t){var n=fn();return Kp(n,e,t)},useTransition:function(){var e=Fp(!1);return e=Z0.bind(null,ke,e.queue,!0,!1),fn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ke,r=fn();if(Ue){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),ot===null)throw Error(q(349));Be&127||A0(a,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,H0(E0.bind(null,a,s,e),[e]),a.flags|=2048,Qs(9,{destroy:void 0},_0.bind(null,a,s,n,t),null),n},useId:function(){var e=fn(),t=ot.identifierPrefix;if(Ue){var n=Da,a=Ma;n=(a&~(1<<32-Rn(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ud++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=M4++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xp,useFormState:L0,useActionState:L0,useOptimistic:function(e){var t=fn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Wp.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bp,useCacheRefresh:function(){return fn().memoizedState=I4.bind(null,ke)},useEffectEvent:function(e){var t=fn(),n={impl:e};return t.memoizedState=n,function(){if(Xe&2)throw Error(q(440));return n.impl.apply(void 0,arguments)}}},Zp={readContext:en,use:fd,useCallback:q0,useContext:en,useEffect:Gp,useImperativeHandle:K0,useInsertionEffect:V0,useLayoutEffect:G0,useMemo:X0,useReducer:md,useRef:U0,useState:function(){return md(cr)},useDebugValue:Yp,useDeferredValue:function(e,t){var n=St();return W0(n,et.memoizedState,e,t)},useTransition:function(){var e=md(cr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ll(e),t]},useSyncExternalStore:C0,useId:e1,useHostTransitionStatus:Xp,useFormState:I0,useActionState:I0,useOptimistic:function(e,t){var n=St();return k0(n,et,e,t)},useMemoCache:Bp,useCacheRefresh:t1};Zp.useEffectEvent=F0;var s1={readContext:en,use:fd,useCallback:q0,useContext:en,useEffect:Gp,useImperativeHandle:K0,useInsertionEffect:V0,useLayoutEffect:G0,useMemo:X0,useReducer:Hp,useRef:U0,useState:function(){return Hp(cr)},useDebugValue:Yp,useDeferredValue:function(e,t){var n=St();return et===null?Kp(n,e,t):W0(n,et.memoizedState,e,t)},useTransition:function(){var e=Hp(cr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ll(e),t]},useSyncExternalStore:C0,useId:e1,useHostTransitionStatus:Xp,useFormState:B0,useActionState:B0,useOptimistic:function(e,t){var n=St();return et!==null?k0(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bp,useCacheRefresh:t1};s1.useEffectEvent=F0;function Qp(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:lt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jp={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Ln(),r=Vr(a);r.payload=t,n!=null&&(r.callback=n),t=Gr(e,r,a),t!==null&&(Sn(t,e,a),Dl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Ln(),r=Vr(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Gr(e,r,a),t!==null&&(Sn(t,e,a),Dl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),a=Vr(n);a.tag=2,t!=null&&(a.callback=t),t=Gr(e,a,n),t!==null&&(Sn(t,e,n),Dl(t,e,n))}};function i1(e,t,n,a,r,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,s,i):t.prototype&&t.prototype.isPureReactComponent?!Cl(n,a)||!Cl(r,s):!0}function l1(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Jp.enqueueReplaceState(t,t.state,null)}function Yo(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=lt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function c1(e){qu(e)}function u1(e){console.error(e)}function d1(e){qu(e)}function gd(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function f1(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function eh(e,t,n){return n=Vr(n),n.tag=3,n.payload={element:null},n.callback=function(){gd(e,t)},n}function m1(e){return e=Vr(e),e.tag=3,e}function w1(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=a.value;e.payload=function(){return r(s)},e.callback=function(){f1(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){f1(t,n,a),typeof r!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var l=a.stack;this.componentDidCatch(a.value,{componentStack:l!==null?l:""})})}function B4(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Vs(t,n,r,!0),n=Dn.current,n!==null){switch(n.tag){case 31:case 13:return ra===null?Td():n.alternate===null&&xt===0&&(xt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===rd?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ch(e,a,r)),!1;case 22:return n.flags|=65536,a===rd?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ch(e,a,r)),!1}throw Error(q(435,n.tag))}return Ch(e,a,r),Td(),!1}if(Ue)return t=Dn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==bp&&(e=Error(q(422),{cause:a}),El(ea(e,n)))):(a!==bp&&(t=Error(q(423),{cause:a}),El(ea(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=ea(a,n),r=eh(e.stateNode,a,r),Rp(e,r),xt!==4&&(xt=2)),!1;var s=Error(q(520),{cause:a});if(s=ea(s,n),Kl===null?Kl=[s]:Kl.push(s),xt!==4&&(xt=2),t===null)return!0;a=ea(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=eh(n.stateNode,a,e),Rp(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Zr===null||!Zr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=m1(r),w1(r,e,n,a),Rp(n,r),!1}n=n.return}while(n!==null);return!1}var th=Error(q(461)),_t=!1;function tn(e,t,n,a){t.child=e===null?x0(t,null,n,a):Vo(t,e.child,n,a)}function p1(e,t,n,a,r){n=n.render;var s=t.ref;if("ref"in a){var i={};for(var l in a)l!=="ref"&&(i[l]=a[l])}else i=a;return Bo(t),a=zp(e,t,n,i,s,r),l=Lp(),e!==null&&!_t?(Ip(e,t,r),ur(e,t,r)):(Ue&&l&&gp(t),t.flags|=1,tn(e,t,a,r),t.child)}function h1(e,t,n,a,r){if(e===null){var s=n.type;return typeof s=="function"&&!wp(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,g1(e,t,s,a,r)):(e=Qu(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!ch(e,r)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:Cl,n(i,a)&&e.ref===t.ref)return ur(e,t,r)}return t.flags|=1,e=rr(s,a),e.ref=t.ref,e.return=t,t.child=e}function g1(e,t,n,a,r){if(e!==null){var s=e.memoizedProps;if(Cl(s,a)&&e.ref===t.ref)if(_t=!1,t.pendingProps=a=s,ch(e,r))e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,ur(e,t,r)}return nh(e,t,n,a,r)}function x1(e,t,n,a){var r=a.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~s}else a=0,t.child=null;return b1(e,t,s,n,a)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nd(t,s!==null?s.cachePool:null),s!==null?y0(t,s):Mp(),S0(t);else return a=t.lanes=536870912,b1(e,t,s!==null?s.baseLanes|n:n,n,a)}else s!==null?(nd(t,s.cachePool),y0(t,s),Kr(),t.memoizedState=null):(e!==null&&nd(t,null),Mp(),Kr());return tn(e,t,r,n),t.child}function Bl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function b1(e,t,n,a,r){var s=Ap();return s=s===null?null:{parent:Ct._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&nd(t,null),Mp(),S0(t),e!==null&&Vs(e,t,a,!0),t.childLanes=r,null}function xd(e,t){return t=vd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function v1(e,t,n){return Vo(t,e.child,null,n),e=xd(t,t.pendingProps),e.flags|=2,On(t),t.memoizedState=null,e}function U4(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(a.mode==="hidden")return e=xd(t,a),t.lanes=536870912,Bl(null,e);if(Op(t),(e=ct)?(e=MS(e,aa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$r!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=a0(e),n.return=t,t.child=n,Jt=t,ct=null)):e=null,e===null)throw Ur(t);return t.lanes=536870912,null}return xd(t,a)}var s=e.memoizedState;if(s!==null){var i=s.dehydrated;if(Op(t),r)if(t.flags&256)t.flags&=-257,t=v1(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(q(558));else if(_t||Vs(e,t,n,!1),r=(n&e.childLanes)!==0,_t||r){if(a=ot,a!==null&&(i=uy(a,n),i!==0&&i!==s.retryLane))throw s.retryLane=i,zo(e,i),Sn(a,e,i),th;Td(),t=v1(e,t,n)}else e=s.treeContext,ct=oa(i.nextSibling),Jt=t,Ue=!0,Br=null,aa=!1,e!==null&&s0(t,e),t=xd(t,a),t.flags|=4096;return t}return e=rr(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bd(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(q(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function nh(e,t,n,a,r){return Bo(t),n=zp(e,t,n,a,void 0,r),a=Lp(),e!==null&&!_t?(Ip(e,t,r),ur(e,t,r)):(Ue&&a&&gp(t),t.flags|=1,tn(e,t,n,r),t.child)}function y1(e,t,n,a,r,s){return Bo(t),t.updateQueue=null,n=N0(t,a,n,r),j0(e),a=Lp(),e!==null&&!_t?(Ip(e,t,s),ur(e,t,s)):(Ue&&a&&gp(t),t.flags|=1,tn(e,t,n,s),t.child)}function S1(e,t,n,a,r){if(Bo(t),t.stateNode===null){var s=Bs,i=n.contextType;typeof i=="object"&&i!==null&&(s=en(i)),s=new n(a,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Jp,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=a,s.state=t.memoizedState,s.refs={},Ep(t),i=n.contextType,s.context=typeof i=="object"&&i!==null?en(i):Bs,s.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Qp(t,n,i,a),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(i=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),i!==s.state&&Jp.enqueueReplaceState(s,s.state,null),Pl(t,a,s,r),Ol(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){s=t.stateNode;var l=t.memoizedProps,c=Yo(n,l);s.props=c;var u=s.context,m=n.contextType;i=Bs,typeof m=="object"&&m!==null&&(i=en(m));var f=n.getDerivedStateFromProps;m=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||u!==i)&&l1(t,s,a,i),Fr=!1;var w=t.memoizedState;s.state=w,Pl(t,a,s,r),Ol(),u=t.memoizedState,l||w!==u||Fr?(typeof f=="function"&&(Qp(t,n,f,a),u=t.memoizedState),(c=Fr||i1(t,n,c,a,w,u,i))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=u),s.props=a,s.state=u,s.context=i,a=c):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,Tp(e,t),i=t.memoizedProps,m=Yo(n,i),s.props=m,f=t.pendingProps,w=s.context,u=n.contextType,c=Bs,typeof u=="object"&&u!==null&&(c=en(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==f||w!==c)&&l1(t,s,a,c),Fr=!1,w=t.memoizedState,s.state=w,Pl(t,a,s,r),Ol();var p=t.memoizedState;i!==f||w!==p||Fr||e!==null&&e.dependencies!==null&&ed(e.dependencies)?(typeof l=="function"&&(Qp(t,n,l,a),p=t.memoizedState),(m=Fr||i1(t,n,m,a,w,p,c)||e!==null&&e.dependencies!==null&&ed(e.dependencies))?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,p,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,p,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=p),s.props=a,s.state=p,s.context=c,a=m):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),a=!1)}return s=a,bd(e,t),a=(t.flags&128)!==0,s||a?(s=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&a?(t.child=Vo(t,e.child,null,r),t.child=Vo(t,null,n,r)):tn(e,t,n,r),t.memoizedState=s.state,e=t.child):e=ur(e,t,r),e}function j1(e,t,n,a){return Io(),t.flags|=256,tn(e,t,n,a),t.child}var ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rh(e){return{baseLanes:e,cachePool:f0()}}function oh(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=zn),e}function N1(e,t,n){var a=t.pendingProps,r=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Yr(t):Kr(),(e=ct)?(e=MS(e,aa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$r!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=a0(e),n.return=t,t.child=n,Jt=t,ct=null)):e=null,e===null)throw Ur(t);return Uh(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,r?(Kr(),r=t.mode,l=vd({mode:"hidden",children:l},r),a=Lo(a,r,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,a=t.child,a.memoizedState=rh(n),a.childLanes=oh(e,i,n),t.memoizedState=ah,Bl(null,a)):(Yr(t),sh(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(s)t.flags&256?(Yr(t),t.flags&=-257,t=ih(e,t,n)):t.memoizedState!==null?(Kr(),t.child=e.child,t.flags|=128,t=null):(Kr(),l=a.fallback,r=t.mode,a=vd({mode:"visible",children:a.children},r),l=Lo(l,r,n,null),l.flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,Vo(t,e.child,null,n),a=t.child,a.memoizedState=rh(n),a.childLanes=oh(e,i,n),t.memoizedState=ah,t=Bl(null,a));else if(Yr(t),Uh(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var u=i.dgst;i=u,a=Error(q(419)),a.stack="",a.digest=i,El({value:a,source:null,stack:null}),t=ih(e,t,n)}else if(_t||Vs(e,t,n,!1),i=(n&e.childLanes)!==0,_t||i){if(i=ot,i!==null&&(a=uy(i,n),a!==0&&a!==c.retryLane))throw c.retryLane=a,zo(e,a),Sn(i,e,a),th;Bh(l)||Td(),t=ih(e,t,n)}else Bh(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ct=oa(l.nextSibling),Jt=t,Ue=!0,Br=null,aa=!1,e!==null&&s0(t,e),t=sh(t,a.children),t.flags|=4096);return t}return r?(Kr(),l=a.fallback,r=t.mode,c=e.child,u=c.sibling,a=rr(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=rr(u,l):(l=Lo(l,r,n,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,Bl(null,a),a=t.child,l=e.child.memoizedState,l===null?l=rh(n):(r=l.cachePool,r!==null?(c=Ct._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=f0(),l={baseLanes:l.baseLanes|n,cachePool:r}),a.memoizedState=l,a.childLanes=oh(e,i,n),t.memoizedState=ah,Bl(e.child,a)):(Yr(t),n=e.child,e=n.sibling,n=rr(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function sh(e,t){return t=vd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vd(e,t){return e=Mn(22,e,null,t),e.lanes=0,e}function ih(e,t,n){return Vo(t,e.child,null,n),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function C1(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Sp(e.return,t,n)}function lh(e,t,n,a,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=a,i.tail=n,i.tailMode=r,i.treeForkCount=s)}function A1(e,t,n){var a=t.pendingProps,r=a.revealOrder,s=a.tail;a=a.children;var i=yt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,st(yt,i),tn(e,t,a,n),a=Ue?_l:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&C1(e,n,t);else if(e.tag===19)C1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ld(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),lh(t,!1,r,n,s,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ld(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}lh(t,!0,n,null,s,a);break;case"together":lh(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ur(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wr|=t.lanes,!(n&t.childLanes))if(e!==null){if(Vs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=rr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ch(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&ed(e)))}function H4(e,t,n){switch(t.tag){case 3:ku(t,t.stateNode.containerInfo),Hr(t,Ct,e.memoizedState.cache),Io();break;case 27:case 5:Dw(t);break;case 4:ku(t,t.stateNode.containerInfo);break;case 10:Hr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Op(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Yr(t),t.flags|=128,null):n&t.child.childLanes?N1(e,t,n):(Yr(t),e=ur(e,t,n),e!==null?e.sibling:null);Yr(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Vs(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return A1(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),st(yt,yt.current),a)break;return null;case 22:return t.lanes=0,x1(e,t,n,t.pendingProps);case 24:Hr(t,Ct,e.memoizedState.cache)}return ur(e,t,n)}function _1(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!ch(e,n)&&!(t.flags&128))return _t=!1,H4(e,t,n);_t=!!(e.flags&131072)}else _t=!1,Ue&&t.flags&1048576&&o0(t,_l,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Ho(t.elementType),t.type=e,typeof e=="function")wp(e)?(a=Yo(e,a),t.tag=1,t=S1(null,t,e,a,n)):(t.tag=0,t=nh(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===Aw){t.tag=11,t=p1(null,t,e,a,n);break e}else if(r===Tw){t.tag=14,t=h1(null,t,e,a,n);break e}}throw t=kw(e)||e,Error(q(306,t,""))}}return t;case 0:return nh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=Yo(a,t.pendingProps),S1(e,t,a,r,n);case 3:e:{if(ku(t,t.stateNode.containerInfo),e===null)throw Error(q(387));a=t.pendingProps;var s=t.memoizedState;r=s.element,Tp(e,t),Pl(t,a,null,n);var i=t.memoizedState;if(a=i.cache,Hr(t,Ct,a),a!==s.cache&&jp(t,[Ct],n,!0),Ol(),a=i.element,s.isDehydrated)if(s={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=j1(e,t,a,n);break e}else if(a!==r){r=ea(Error(q(424)),t),El(r),t=j1(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ct=oa(e.firstChild),Jt=t,Ue=!0,Br=null,aa=!0,n=x0(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Io(),a===r){t=ur(e,t,n);break e}tn(e,t,a,n)}t=t.child}return t;case 26:return bd(e,t),e===null?(n=IS(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(n=t.type,e=t.pendingProps,a=zd(Pr.current).createElement(n),a[Qt]=t,a[hn]=e,nn(a,n,e),Bt(a),t.stateNode=a):t.memoizedState=IS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dw(t),e===null&&Ue&&(a=t.stateNode=PS(t.type,t.pendingProps,Pr.current),Jt=t,aa=!0,r=ct,to(t.type)?(Hh=r,ct=oa(a.firstChild)):ct=r),tn(e,t,t.pendingProps.children,n),bd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=a=ct)&&(a=x3(a,t.type,t.pendingProps,aa),a!==null?(t.stateNode=a,Jt=t,ct=oa(a.firstChild),aa=!1,r=!0):r=!1),r||Ur(t)),Dw(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Lh(r,s)?a=null:i!==null&&Lh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=zp(e,t,D4,null,null,n),tc._currentValue=r),bd(e,t),tn(e,t,a,n),t.child;case 6:return e===null&&Ue&&((e=n=ct)&&(n=b3(n,t.pendingProps,aa),n!==null?(t.stateNode=n,Jt=t,ct=null,e=!0):e=!1),e||Ur(t)),null;case 13:return N1(e,t,n);case 4:return ku(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Vo(t,null,a,n):tn(e,t,a,n),t.child;case 11:return p1(e,t,t.type,t.pendingProps,n);case 7:return tn(e,t,t.pendingProps,n),t.child;case 8:return tn(e,t,t.pendingProps.children,n),t.child;case 12:return tn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Hr(t,t.type,a.value),tn(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,Bo(t),r=en(r),a=a(r),t.flags|=1,tn(e,t,a,n),t.child;case 14:return h1(e,t,t.type,t.pendingProps,n);case 15:return g1(e,t,t.type,t.pendingProps,n);case 19:return A1(e,t,n);case 31:return U4(e,t,n);case 22:return x1(e,t,n,t.pendingProps);case 24:return Bo(t),a=en(Ct),e===null?(r=Ap(),r===null&&(r=ot,s=Np(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),t.memoizedState={parent:a,cache:r},Ep(t),Hr(t,Ct,r)):(e.lanes&n&&(Tp(e,t),Pl(t,null,null,n),Ol()),r=e.memoizedState,s=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Hr(t,Ct,a)):(a=s.cache,Hr(t,Ct,a),a!==r.cache&&jp(t,[Ct],n,!0))),tn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(q(156,t.tag))}function dr(e){e.flags|=4}function uh(e,t,n,a,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(eS())e.flags|=8192;else throw Fo=rd,_p}else e.flags&=-16777217}function E1(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!FS(t))if(eS())e.flags|=8192;else throw Fo=rd,_p}function yd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?iy():536870912,e.lanes|=t,ni|=t)}function Ul(e,t){if(!Ue)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 a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function F4(e,t,n){var a=t.pendingProps;switch(xp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ir(Ct),As(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?dr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vp())),ut(t),null;case 26:var r=t.type,s=t.memoizedState;return e===null?(dr(t),s!==null?(ut(t),E1(t,s)):(ut(t),uh(t,r,null,a,n))):s?s!==e.memoizedState?(dr(t),ut(t),E1(t,s)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&dr(t),ut(t),uh(t,r,e,a,n)),null;case 27:if(Mu(t),n=Pr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return ut(t),null}e=ka.current,Fs(t)?i0(t):(e=PS(r,a,n),t.stateNode=e,dr(t))}return ut(t),null;case 5:if(Mu(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return ut(t),null}if(s=ka.current,Fs(t))i0(t);else{var i=zd(Pr.current);switch(s){case 1:s=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":s=i.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?s.multiple=!0:a.size&&(s.size=a.size);break;default:s=typeof a.is=="string"?i.createElement(r,{is:a.is}):i.createElement(r)}}s[Qt]=t,s[hn]=a;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)s.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=s;e:switch(nn(s,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&dr(t)}}return ut(t),uh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(q(166));if(e=Pr.current,Fs(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Jt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Qt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||NS(e.nodeValue,n)),e||Ur(t,!0)}else e=zd(e).createTextNode(a),e[Qt]=t,t.stateNode=e}return ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Fs(t),n!==null){if(e===null){if(!a)throw Error(q(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(557));e[Qt]=t}else Io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else n=vp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(On(t),t):(On(t),null);if(t.flags&128)throw Error(q(558))}return ut(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fs(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(q(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(q(317));r[Qt]=t}else Io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),r=!1}else r=vp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(On(t),t):(On(t),null)}return On(t),t.flags&128?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yd(t,t.updateQueue),ut(t),null);case 4:return As(),e===null&&Mh(t.stateNode.containerInfo),ut(t),null;case 10:return ir(t.type),ut(t),null;case 19:if($t(yt),a=t.memoizedState,a===null)return ut(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)Ul(a,!1);else{if(xt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ld(e),s!==null){for(t.flags|=128,Ul(a,!1),e=s.updateQueue,t.updateQueue=e,yd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)n0(n,e),n=n.sibling;return st(yt,yt.current&1|2),Ue&&or(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&En()>Ad&&(t.flags|=128,r=!0,Ul(a,!1),t.lanes=4194304)}else{if(!r)if(e=ld(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,yd(t,e),Ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Ue)return ut(t),null}else 2*En()-a.renderingStartTime>Ad&&n!==536870912&&(t.flags|=128,r=!0,Ul(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(e=a.last,e!==null?e.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=En(),e.sibling=null,n=yt.current,st(yt,r?n&1|2:n&1),Ue&&or(t,a.treeForkCount),e):(ut(t),null);case 22:case 23:return On(t),Dp(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),n=t.updateQueue,n!==null&&yd(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&$t(Uo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ir(Ct),ut(t),null;case 25:return null;case 30:return null}throw Error(q(156,t.tag))}function V4(e,t){switch(xp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(Ct),As(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Mu(t),null;case 31:if(t.memoizedState!==null){if(On(t),t.alternate===null)throw Error(q(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(On(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(yt),null;case 4:return As(),null;case 10:return ir(t.type),null;case 22:case 23:return On(t),Dp(),e!==null&&$t(Uo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(Ct),null;case 25:return null;default:return null}}function T1(e,t){switch(xp(t),t.tag){case 3:ir(Ct),As();break;case 26:case 27:case 5:Mu(t);break;case 4:As();break;case 31:t.memoizedState!==null&&On(t);break;case 13:On(t);break;case 19:$t(yt);break;case 10:ir(t.type);break;case 22:case 23:On(t),Dp(),e!==null&&$t(Uo);break;case 24:ir(Ct)}}function Hl(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var s=n.create,i=n.inst;a=s(),i.destroy=a}n=n.next}while(n!==r)}}catch(l){Qe(t,t.return,l)}}function qr(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var s=r.next;a=s;do{if((a.tag&e)===e){var i=a.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(m){Qe(r,c,m)}}}a=a.next}while(a!==s)}}catch(m){Qe(t,t.return,m)}}function R1(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{v0(t,n)}catch(a){Qe(e,e.return,a)}}}function k1(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Qe(e,t,a)}}function Fl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){Qe(e,t,r)}}function Oa(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){Qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function M1(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){Qe(e,e.return,r)}}function dh(e,t,n){try{var a=e.stateNode;f3(a,e.type,n,t),a[hn]=t}catch(r){Qe(e,e.return,r)}}function D1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&to(e.type)||e.tag===4}function fh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&to(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mh(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nr));else if(a!==4&&(a===27&&to(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(mh(e,t,n),e=e.sibling;e!==null;)mh(e,t,n),e=e.sibling}function Sd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&to(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Sd(e,t,n),e=e.sibling;e!==null;)Sd(e,t,n),e=e.sibling}function O1(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);nn(t,a,n),t[Qt]=e,t[hn]=n}catch(s){Qe(e,e.return,s)}}var fr=!1,Et=!1,wh=!1,P1=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function G4(e,t){if(e=e.containerInfo,Ph=Fd,e=Ky(e),ip(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,s=a.focusNode;a=a.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,u=0,m=0,f=e,w=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(l=i+r),f!==s||a!==0&&f.nodeType!==3||(c=i+a),f.nodeType===3&&(i+=f.nodeValue.length),(p=f.firstChild)!==null;)w=f,f=p;for(;;){if(f===e)break t;if(w===n&&++u===r&&(l=i),w===s&&++m===a&&(c=i),(p=f.nextSibling)!==null)break;f=w,w=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(zh={focusedElem:e,selectionRange:n},Fd=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,r=s.memoizedProps,s=s.memoizedState,a=n.stateNode;try{var x=Yo(n.type,r);e=a.getSnapshotBeforeUpdate(x,s),a.__reactInternalSnapshotBeforeUpdate=e}catch(b){Qe(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)$h(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":$h(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(q(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function z1(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:wr(e,n),a&4&&Hl(5,n);break;case 1:if(wr(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Qe(n,n.return,i)}else{var r=Yo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Qe(n,n.return,i)}}a&64&&R1(n),a&512&&Fl(n,n.return);break;case 3:if(wr(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{v0(e,t)}catch(i){Qe(n,n.return,i)}}break;case 27:t===null&&a&4&&O1(n);case 26:case 5:wr(e,n),t===null&&a&4&&M1(n),a&512&&Fl(n,n.return);break;case 12:wr(e,n);break;case 31:wr(e,n),a&4&&$1(e,n);break;case 13:wr(e,n),a&4&&B1(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=e3.bind(null,n),v3(e,n))));break;case 22:if(a=n.memoizedState!==null||fr,!a){t=t!==null&&t.memoizedState!==null||Et,r=fr;var s=Et;fr=a,(Et=t)&&!s?pr(e,n,(n.subtreeFlags&8772)!==0):wr(e,n),fr=r,Et=s}break;case 30:break;default:wr(e,n)}}function L1(e){var t=e.alternate;t!==null&&(e.alternate=null,L1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vw(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,xn=!1;function mr(e,t,n){for(n=n.child;n!==null;)I1(e,t,n),n=n.sibling}function I1(e,t,n){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 26:Et||Oa(n,t),mr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Et||Oa(n,t);var a=ft,r=xn;to(n.type)&&(ft=n.stateNode,xn=!1),mr(e,t,n),Ql(n.stateNode),ft=a,xn=r;break;case 5:Et||Oa(n,t);case 6:if(a=ft,r=xn,ft=null,mr(e,t,n),ft=a,xn=r,ft!==null)if(xn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(s){Qe(n,t,s)}else try{ft.removeChild(n.stateNode)}catch(s){Qe(n,t,s)}break;case 18:ft!==null&&(xn?(e=ft,RS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ui(e)):RS(ft,n.stateNode));break;case 4:a=ft,r=xn,ft=n.stateNode.containerInfo,xn=!0,mr(e,t,n),ft=a,xn=r;break;case 0:case 11:case 14:case 15:qr(2,n,t),Et||qr(4,n,t),mr(e,t,n);break;case 1:Et||(Oa(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&k1(n,t,a)),mr(e,t,n);break;case 21:mr(e,t,n);break;case 22:Et=(a=Et)||n.memoizedState!==null,mr(e,t,n),Et=a;break;default:mr(e,t,n)}}function $1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ui(e)}catch(n){Qe(t,t.return,n)}}}function B1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ui(e)}catch(n){Qe(t,t.return,n)}}function Y4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new P1),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new P1),t;default:throw Error(q(435,e.tag))}}function jd(e,t){var n=Y4(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=t3.bind(null,e,a);a.then(r,r)}})}function bn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],s=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(to(l.type)){ft=l.stateNode,xn=!1;break e}break;case 5:ft=l.stateNode,xn=!1;break e;case 3:case 4:ft=l.stateNode.containerInfo,xn=!0;break e}l=l.return}if(ft===null)throw Error(q(160));I1(s,i,r),ft=null,xn=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)U1(t,e),t=t.sibling}var xa=null;function U1(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bn(t,e),vn(e),a&4&&(qr(3,e,e.return),Hl(3,e),qr(5,e,e.return));break;case 1:bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),a&64&&fr&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=xa;if(bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),a&4){var s=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":s=r.getElementsByTagName("title")[0],(!s||s[hl]||s[Qt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(a),r.head.insertBefore(s,r.querySelector("head > title"))),nn(s,a,n),s[Qt]=e,Bt(s),a=s;break e;case"link":var i=US("link","href",r).get(a+(n.href||""));if(i){for(var l=0;l<i.length;l++)if(s=i[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(l,1);break t}}s=r.createElement(a),nn(s,a,n),r.head.appendChild(s);break;case"meta":if(i=US("meta","content",r).get(a+(n.content||""))){for(l=0;l<i.length;l++)if(s=i[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(l,1);break t}}s=r.createElement(a),nn(s,a,n),r.head.appendChild(s);break;default:throw Error(q(468,a))}s[Qt]=e,Bt(s),a=s}e.stateNode=a}else HS(r,e.type,e.stateNode);else e.stateNode=BS(r,a,e.memoizedProps);else s!==a?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,a===null?HS(r,e.type,e.stateNode):BS(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&dh(e,e.memoizedProps,n.memoizedProps)}break;case 27:bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),n!==null&&a&4&&dh(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),e.flags&32){r=e.stateNode;try{Ds(r,"")}catch(x){Qe(e,e.return,x)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,dh(e,r,n!==null?n.memoizedProps:r)),a&1024&&(wh=!0);break;case 6:if(bn(t,e),vn(e),a&4){if(e.stateNode===null)throw Error(q(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){Qe(e,e.return,x)}}break;case 3:if($d=null,r=xa,xa=Ld(t.containerInfo),bn(t,e),xa=r,vn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(x){Qe(e,e.return,x)}wh&&(wh=!1,H1(e));break;case 4:a=xa,xa=Ld(e.stateNode.containerInfo),bn(t,e),vn(e),xa=a;break;case 12:bn(t,e),vn(e);break;case 31:bn(t,e),vn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 13:bn(t,e),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Cd=En()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=fr,m=Et;if(fr=u||r,Et=m||c,bn(t,e),Et=m,fr=u,vn(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||fr||Et||Ko(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(s=c.stateNode,r)i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,w=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(x){Qe(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){Qe(c,c.return,x)}}}else if(t.tag===18){if(n===null){c=t;try{var p=c.stateNode;r?kS(p,!0):kS(c.stateNode,!1)}catch(x){Qe(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,jd(e,n))));break;case 19:bn(t,e),vn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 30:break;case 21:break;default:bn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(D1(a)){n=a;break}a=a.return}if(n==null)throw Error(q(160));switch(n.tag){case 27:var r=n.stateNode,s=fh(e);Sd(e,s,r);break;case 5:var i=n.stateNode;n.flags&32&&(Ds(i,""),n.flags&=-33);var l=fh(e);Sd(e,l,i);break;case 3:case 4:var c=n.stateNode.containerInfo,u=fh(e);mh(e,u,c);break;default:throw Error(q(161))}}catch(m){Qe(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function H1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;H1(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)z1(e,t.alternate,t),t=t.sibling}function Ko(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qr(4,t,t.return),Ko(t);break;case 1:Oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&k1(t,t.return,n),Ko(t);break;case 27:Ql(t.stateNode);case 26:case 5:Oa(t,t.return),Ko(t);break;case 22:t.memoizedState===null&&Ko(t);break;case 30:Ko(t);break;default:Ko(t)}e=e.sibling}}function pr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,r=e,s=t,i=s.flags;switch(s.tag){case 0:case 11:case 15:pr(r,s,n),Hl(4,s);break;case 1:if(pr(r,s,n),a=s,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Qe(a,a.return,u)}if(a=s,r=a.updateQueue,r!==null){var l=a.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)b0(c[r],l)}catch(u){Qe(a,a.return,u)}}n&&i&64&&R1(s),Fl(s,s.return);break;case 27:O1(s);case 26:case 5:pr(r,s,n),n&&a===null&&i&4&&M1(s),Fl(s,s.return);break;case 12:pr(r,s,n);break;case 31:pr(r,s,n),n&&i&4&&$1(r,s);break;case 13:pr(r,s,n),n&&i&4&&B1(r,s);break;case 22:s.memoizedState===null&&pr(r,s,n),Fl(s,s.return);break;case 30:break;default:pr(r,s,n)}t=t.sibling}}function ph(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Tl(n))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tl(e))}function ba(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)F1(e,t,n,a),t=t.sibling}function F1(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,n,a),r&2048&&Hl(9,t);break;case 1:ba(e,t,n,a);break;case 3:ba(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tl(e)));break;case 12:if(r&2048){ba(e,t,n,a),e=t.stateNode;try{var s=t.memoizedProps,i=s.id,l=s.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Qe(t,t.return,c)}}else ba(e,t,n,a);break;case 31:ba(e,t,n,a);break;case 13:ba(e,t,n,a);break;case 23:break;case 22:s=t.stateNode,i=t.alternate,t.memoizedState!==null?s._visibility&2?ba(e,t,n,a):Vl(e,t):s._visibility&2?ba(e,t,n,a):(s._visibility|=2,Js(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),r&2048&&ph(i,t);break;case 24:ba(e,t,n,a),r&2048&&hh(t.alternate,t);break;default:ba(e,t,n,a)}}function Js(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,i=t,l=n,c=a,u=i.flags;switch(i.tag){case 0:case 11:case 15:Js(s,i,l,c,r),Hl(8,i);break;case 23:break;case 22:var m=i.stateNode;i.memoizedState!==null?m._visibility&2?Js(s,i,l,c,r):Vl(s,i):(m._visibility|=2,Js(s,i,l,c,r)),r&&u&2048&&ph(i.alternate,i);break;case 24:Js(s,i,l,c,r),r&&u&2048&&hh(i.alternate,i);break;default:Js(s,i,l,c,r)}t=t.sibling}}function Vl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Vl(n,a),r&2048&&ph(a.alternate,a);break;case 24:Vl(n,a),r&2048&&hh(a.alternate,a);break;default:Vl(n,a)}t=t.sibling}}var Gl=8192;function ei(e,t,n){if(e.subtreeFlags&Gl)for(e=e.child;e!==null;)V1(e,t,n),e=e.sibling}function V1(e,t,n){switch(e.tag){case 26:ei(e,t,n),e.flags&Gl&&e.memoizedState!==null&&M3(n,xa,e.memoizedState,e.memoizedProps);break;case 5:ei(e,t,n);break;case 3:case 4:var a=xa;xa=Ld(e.stateNode.containerInfo),ei(e,t,n),xa=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Gl,Gl=16777216,ei(e,t,n),Gl=a):ei(e,t,n));break;default:ei(e,t,n)}}function G1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ut=a,K1(a,e)}G1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Y1(e),e=e.sibling}function Y1(e){switch(e.tag){case 0:case 11:case 15:Yl(e),e.flags&2048&&qr(9,e,e.return);break;case 3:Yl(e);break;case 12:Yl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nd(e)):Yl(e);break;default:Yl(e)}}function Nd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ut=a,K1(a,e)}G1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qr(8,t,t.return),Nd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nd(t));break;default:Nd(t)}e=e.sibling}}function K1(e,t){for(;Ut!==null;){var n=Ut;switch(n.tag){case 0:case 11:case 15:qr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Tl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Ut=a;else e:for(n=e;Ut!==null;){a=Ut;var r=a.sibling,s=a.return;if(L1(a),a===n){Ut=null;break e}if(r!==null){r.return=s,Ut=r;break e}Ut=s}}}var K4={getCacheForType:function(e){var t=en(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return en(Ct).controller.signal}},q4=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ot=null,Le=null,Be=0,Ze=0,Pn=null,Xr=!1,ti=!1,gh=!1,hr=0,xt=0,Wr=0,qo=0,xh=0,zn=0,ni=0,Kl=null,yn=null,bh=!1,Cd=0,q1=0,Ad=1/0,_d=null,Zr=null,Ot=0,Qr=null,ai=null,gr=0,vh=0,yh=null,X1=null,ql=0,Sh=null;function Ln(){return Xe&2&&Be!==0?Be&-Be:Ce.T!==null?Eh():dy()}function W1(){if(zn===0)if(!(Be&536870912)||Ue){var e=Pu;Pu<<=1,!(Pu&3932160)&&(Pu=262144),zn=e}else zn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),zn}function Sn(e,t,n){(e===ot&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(ri(e,0),Jr(e,Be,zn,!1)),pl(e,n),(!(Xe&2)||e!==ot)&&(e===ot&&(!(Xe&2)&&(qo|=n),xt===4&&Jr(e,Be,zn,!1)),Pa(e))}function Z1(e,t,n){if(Xe&6)throw Error(q(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||wl(e,t),r=a?Z4(e,t):Nh(e,t,!0),s=a;do{if(r===0){ti&&!a&&Jr(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!X4(n)){r=Nh(e,t,!1),s=!1;continue}if(r===2){if(s=t,e.errorRecoveryDisabledLanes&s)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Kl;var c=l.current.memoizedState.isDehydrated;if(c&&(ri(l,i).flags|=256),i=Nh(l,i,!1),i!==2){if(gh&&!c){l.errorRecoveryDisabledLanes|=s,qo|=s,r=4;break e}s=yn,yn=r,s!==null&&(yn===null?yn=s:yn.push.apply(yn,s))}r=i}if(s=!1,r!==2)continue}}if(r===1){ri(e,0),Jr(e,t,0,!0);break}e:{switch(a=e,s=r,s){case 0:case 1:throw Error(q(345));case 4:if((t&4194048)!==t)break;case 6:Jr(a,t,zn,!Xr);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(q(329))}if((t&62914560)===t&&(r=Cd+300-En(),10<r)){if(Jr(a,t,zn,!Xr),Lu(a,0,!0)!==0)break e;gr=t,a.timeoutHandle=ES(Q1.bind(null,a,n,yn,_d,bh,t,zn,qo,ni,Xr,s,"Throttled",-0,0),r);break e}Q1(a,n,yn,_d,bh,t,zn,qo,ni,Xr,s,null,-0,0)}}break}while(!0);Pa(e)}function Q1(e,t,n,a,r,s,i,l,c,u,m,f,w,p){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nr},V1(t,s,f);var x=(s&62914560)===s?Cd-En():(s&4194048)===s?q1-En():0;if(x=D3(f,x),x!==null){gr=s,e.cancelPendingCommit=x(sS.bind(null,e,t,s,n,a,r,i,l,c,m,f,null,w,p)),Jr(e,s,i,!u);return}}sS(e,t,s,n,a,r,i,l,c)}function X4(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],s=r.getSnapshot;r=r.value;try{if(!kn(s(),r))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 Jr(e,t,n,a){t&=~xh,t&=~qo,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var s=31-Rn(r),i=1<<s;a[s]=-1,r&=~i}n!==0&&ly(e,n,t)}function Ed(){return Xe&6?!0:(Xl(0),!1)}function jh(){if(Le!==null){if(Ze===0)var e=Le.return;else e=Le,sr=$o=null,$p(e),qs=null,kl=0,e=Le;for(;e!==null;)T1(e.alternate,e),e=e.return;Le=null}}function ri(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,p3(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gr=0,jh(),ot=e,Le=n=rr(e.current,null),Be=t,Ze=0,Pn=null,Xr=!1,ti=wl(e,t),gh=!1,ni=zn=xh=qo=Wr=xt=0,yn=Kl=null,bh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Rn(a),s=1<<r;t|=e[r],a&=~s}return hr=t,Xu(),n}function J1(e,t){ke=null,Ce.H=$l,t===Ks||t===ad?(t=p0(),Ze=3):t===_p?(t=p0(),Ze=4):Ze=t===th?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pn=t,Le===null&&(xt=1,gd(e,ea(t,e.current)))}function eS(){var e=Dn.current;return e===null?!0:(Be&4194048)===Be?ra===null:(Be&62914560)===Be||Be&536870912?e===ra:!1}function tS(){var e=Ce.H;return Ce.H=$l,e===null?$l:e}function nS(){var e=Ce.A;return Ce.A=K4,e}function Td(){xt=4,Xr||(Be&4194048)!==Be&&Dn.current!==null||(ti=!0),!(Wr&134217727)&&!(qo&134217727)||ot===null||Jr(ot,Be,zn,!1)}function Nh(e,t,n){var a=Xe;Xe|=2;var r=tS(),s=nS();(ot!==e||Be!==t)&&(_d=null,ri(e,t)),t=!1;var i=xt;e:do try{if(Ze!==0&&Le!==null){var l=Le,c=Pn;switch(Ze){case 8:jh(),i=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(t=!0);var u=Ze;if(Ze=0,Pn=null,oi(e,l,c,u),n&&ti){i=0;break e}break;default:u=Ze,Ze=0,Pn=null,oi(e,l,c,u)}}W4(),i=xt;break}catch(m){J1(e,m)}while(!0);return t&&e.shellSuspendCounter++,sr=$o=null,Xe=a,Ce.H=r,Ce.A=s,Le===null&&(ot=null,Be=0,Xu()),i}function W4(){for(;Le!==null;)aS(Le)}function Z4(e,t){var n=Xe;Xe|=2;var a=tS(),r=nS();ot!==e||Be!==t?(_d=null,Ad=En()+500,ri(e,t)):ti=wl(e,t);e:do try{if(Ze!==0&&Le!==null){t=Le;var s=Pn;t:switch(Ze){case 1:Ze=0,Pn=null,oi(e,t,s,1);break;case 2:case 9:if(m0(s)){Ze=0,Pn=null,rS(t);break}t=function(){Ze!==2&&Ze!==9||ot!==e||(Ze=7),Pa(e)},s.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:m0(s)?(Ze=0,Pn=null,rS(t)):(Ze=0,Pn=null,oi(e,t,s,7));break;case 5:var i=null;switch(Le.tag){case 26:i=Le.memoizedState;case 5:case 27:var l=Le;if(i?FS(i):l.stateNode.complete){Ze=0,Pn=null;var c=l.sibling;if(c!==null)Le=c;else{var u=l.return;u!==null?(Le=u,Rd(u)):Le=null}break t}}Ze=0,Pn=null,oi(e,t,s,5);break;case 6:Ze=0,Pn=null,oi(e,t,s,6);break;case 8:jh(),xt=6;break e;default:throw Error(q(462))}}Q4();break}catch(m){J1(e,m)}while(!0);return sr=$o=null,Ce.H=a,Ce.A=r,Xe=n,Le!==null?0:(ot=null,Be=0,Xu(),xt)}function Q4(){for(;Le!==null&&!y5();)aS(Le)}function aS(e){var t=_1(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?Rd(e):Le=t}function rS(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=y1(n,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=y1(n,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:$p(t);default:T1(n,t),t=Le=n0(t,hr),t=_1(n,t,hr)}e.memoizedProps=e.pendingProps,t===null?Rd(e):Le=t}function oi(e,t,n,a){sr=$o=null,$p(t),qs=null,kl=0;var r=t.return;try{if(B4(e,r,t,n,Be)){xt=1,gd(e,ea(n,e.current)),Le=null;return}}catch(s){if(r!==null)throw Le=r,s;xt=1,gd(e,ea(n,e.current)),Le=null;return}t.flags&32768?(Ue||a===1?e=!0:ti||Be&536870912?e=!1:(Xr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Dn.current,a!==null&&a.tag===13&&(a.flags|=16384))),oS(t,e)):Rd(t)}function Rd(e){var t=e;do{if(t.flags&32768){oS(t,Xr);return}e=t.return;var n=F4(t.alternate,t,hr);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);xt===0&&(xt=5)}function oS(e,t){do{var n=V4(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);xt=6,Le=null}function sS(e,t,n,a,r,s,i,l,c){e.cancelPendingCommit=null;do kd();while(Ot!==0);if(Xe&6)throw Error(q(327));if(t!==null){if(t===e.current)throw Error(q(177));if(s=t.lanes|t.childLanes,s|=fp,k5(e,n,s,i,l,c),e===ot&&(Le=ot=null,Be=0),ai=t,Qr=e,gr=n,vh=s,yh=r,X1=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,n3(Du,function(){return dS(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=Ce.T,Ce.T=null,r=qe.p,qe.p=2,i=Xe,Xe|=4;try{G4(e,t,n)}finally{Xe=i,qe.p=r,Ce.T=a}}Ot=1,iS(),lS(),cS()}}function iS(){if(Ot===1){Ot=0;var e=Qr,t=ai,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ce.T,Ce.T=null;var a=qe.p;qe.p=2;var r=Xe;Xe|=4;try{U1(t,e);var s=zh,i=Ky(e.containerInfo),l=s.focusedElem,c=s.selectionRange;if(i!==l&&l&&l.ownerDocument&&Yy(l.ownerDocument.documentElement,l)){if(c!==null&&ip(l)){var u=c.start,m=c.end;if(m===void 0&&(m=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(m,l.value.length);else{var f=l.ownerDocument||document,w=f&&f.defaultView||window;if(w.getSelection){var p=w.getSelection(),x=l.textContent.length,b=Math.min(c.start,x),y=c.end===void 0?b:Math.min(c.end,x);!p.extend&&b>y&&(i=y,y=b,b=i);var h=Gy(l,b),g=Gy(l,y);if(h&&g&&(p.rangeCount!==1||p.anchorNode!==h.node||p.anchorOffset!==h.offset||p.focusNode!==g.node||p.focusOffset!==g.offset)){var v=f.createRange();v.setStart(h.node,h.offset),p.removeAllRanges(),b>y?(p.addRange(v),p.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),p.addRange(v))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Fd=!!Ph,zh=Ph=null}finally{Xe=r,qe.p=a,Ce.T=n}}e.current=t,Ot=2}}function lS(){if(Ot===2){Ot=0;var e=Qr,t=ai,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ce.T,Ce.T=null;var a=qe.p;qe.p=2;var r=Xe;Xe|=4;try{z1(e,t.alternate,t)}finally{Xe=r,qe.p=a,Ce.T=n}}Ot=3}}function cS(){if(Ot===4||Ot===3){Ot=0,S5();var e=Qr,t=ai,n=gr,a=X1;t.subtreeFlags&10256||t.flags&10256?Ot=5:(Ot=0,ai=Qr=null,uS(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Zr=null),Hw(n),t=t.stateNode,Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(ml,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Ce.T,r=qe.p,qe.p=2,Ce.T=null;try{for(var s=e.onRecoverableError,i=0;i<a.length;i++){var l=a[i];s(l.value,{componentStack:l.stack})}}finally{Ce.T=t,qe.p=r}}gr&3&&kd(),Pa(e),r=e.pendingLanes,n&261930&&r&42?e===Sh?ql++:(ql=0,Sh=e):ql=0,Xl(0)}}function uS(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Tl(t)))}function kd(){return iS(),lS(),cS(),dS()}function dS(){if(Ot!==5)return!1;var e=Qr,t=vh;vh=0;var n=Hw(gr),a=Ce.T,r=qe.p;try{qe.p=32>n?32:n,Ce.T=null,n=yh,yh=null;var s=Qr,i=gr;if(Ot=0,ai=Qr=null,gr=0,Xe&6)throw Error(q(331));var l=Xe;if(Xe|=4,Y1(s.current),F1(s,s.current,i,n),Xe=l,Xl(0,!1),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(ml,s)}catch{}return!0}finally{qe.p=r,Ce.T=a,uS(e,t)}}function fS(e,t,n){t=ea(n,t),t=eh(e.stateNode,t,2),e=Gr(e,t,2),e!==null&&(pl(e,2),Pa(e))}function Qe(e,t,n){if(e.tag===3)fS(e,e,n);else for(;t!==null;){if(t.tag===3){fS(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Zr===null||!Zr.has(a))){e=ea(n,e),n=m1(2),a=Gr(t,n,2),a!==null&&(w1(n,a,t,e),pl(a,2),Pa(a));break}}t=t.return}}function Ch(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new q4;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(gh=!0,r.add(n),e=J4.bind(null,e,t,n),t.then(e,e))}function J4(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&(Be&n)===n&&(xt===4||xt===3&&(Be&62914560)===Be&&300>En()-Cd?!(Xe&2)&&ri(e,0):xh|=n,ni===Be&&(ni=0)),Pa(e)}function mS(e,t){t===0&&(t=iy()),e=zo(e,t),e!==null&&(pl(e,t),Pa(e))}function e3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mS(e,n)}function t3(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(q(314))}a!==null&&a.delete(t),mS(e,n)}function n3(e,t){return Iw(e,t)}var Md=null,si=null,Ah=!1,Dd=!1,_h=!1,eo=0;function Pa(e){e!==si&&e.next===null&&(si===null?Md=si=e:si=si.next=e),Dd=!0,Ah||(Ah=!0,r3())}function Xl(e,t){if(!_h&&Dd){_h=!0;do for(var n=!1,a=Md;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var s=0;else{var i=a.suspendedLanes,l=a.pingedLanes;s=(1<<31-Rn(42|e)+1)-1,s&=r&~(i&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,gS(a,s))}else s=Be,s=Lu(a,a===ot?s:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(s&3)||wl(a,s)||(n=!0,gS(a,s));a=a.next}while(n);_h=!1}}function a3(){wS()}function wS(){Dd=Ah=!1;var e=0;eo!==0&&w3()&&(e=eo);for(var t=En(),n=null,a=Md;a!==null;){var r=a.next,s=pS(a,t);s===0?(a.next=null,n===null?Md=r:n.next=r,r===null&&(si=n)):(n=a,(e!==0||s&3)&&(Dd=!0)),a=r}Ot!==0&&Ot!==5||Xl(e),eo!==0&&(eo=0)}function pS(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var i=31-Rn(s),l=1<<i,c=r[i];c===-1?(!(l&n)||l&a)&&(r[i]=R5(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}if(t=ot,n=Be,n=Lu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&$w(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||wl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&$w(a),Hw(n)){case 2:case 8:n=oy;break;case 32:n=Du;break;case 268435456:n=sy;break;default:n=Du}return a=hS.bind(null,e),n=Iw(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&$w(a),e.callbackPriority=2,e.callbackNode=null,2}function hS(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(kd()&&e.callbackNode!==n)return null;var a=Be;return a=Lu(e,e===ot?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Z1(e,a,t),pS(e,En()),e.callbackNode!=null&&e.callbackNode===n?hS.bind(null,e):null)}function gS(e,t){if(kd())return null;Z1(e,t,!0)}function r3(){h3(function(){Xe&6?Iw(ry,a3):wS()})}function Eh(){if(eo===0){var e=Gs;e===0&&(e=Ou,Ou<<=1,!(Ou&261888)&&(Ou=256)),eo=e}return eo}function xS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uu(""+e)}function bS(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function o3(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var s=xS((r[hn]||null).action),i=a.submitter;i&&(t=(t=i[hn]||null)?xS(t.formAction):i.getAttribute("formAction"),t!==null&&(s=t,i=null));var l=new Gu("action","action",null,a,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(eo!==0){var c=i?bS(r,i):new FormData(r);qp(n,{pending:!0,data:c,method:r.method,action:s},null,c)}}else typeof s=="function"&&(l.preventDefault(),c=i?bS(r,i):new FormData(r),qp(n,{pending:!0,data:c,method:r.method,action:s},s,c))},currentTarget:r}]})}}for(var Th=0;Th<dp.length;Th++){var Rh=dp[Th],s3=Rh.toLowerCase(),i3=Rh[0].toUpperCase()+Rh.slice(1);ga(s3,"on"+i3)}ga(Wy,"onAnimationEnd"),ga(Zy,"onAnimationIteration"),ga(Qy,"onAnimationStart"),ga("dblclick","onDoubleClick"),ga("focusin","onFocus"),ga("focusout","onBlur"),ga(j4,"onTransitionRun"),ga(N4,"onTransitionStart"),ga(C4,"onTransitionCancel"),ga(Jy,"onTransitionEnd"),ks("onMouseEnter",["mouseout","mouseover"]),ks("onMouseLeave",["mouseout","mouseover"]),ks("onPointerEnter",["pointerout","pointerover"]),ks("onPointerLeave",["pointerout","pointerover"]),Mo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),l3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function vS(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var s=void 0;if(t)for(var i=a.length-1;0<=i;i--){var l=a[i],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=u;try{s(r)}catch(m){qu(m)}r.currentTarget=null,s=c}else for(i=0;i<a.length;i++){if(l=a[i],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=u;try{s(r)}catch(m){qu(m)}r.currentTarget=null,s=c}}}}function Ie(e,t){var n=t[Fw];n===void 0&&(n=t[Fw]=new Set);var a=e+"__bubble";n.has(a)||(yS(t,e,2,!1),n.add(a))}function kh(e,t,n){var a=0;t&&(a|=4),yS(n,e,a,t)}var Od="_reactListening"+Math.random().toString(36).slice(2);function Mh(e){if(!e[Od]){e[Od]=!0,wy.forEach(function(n){n!=="selectionchange"&&(l3.has(n)||kh(n,!1,e),kh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,kh("selectionchange",!1,t))}}function yS(e,t,n,a){switch(WS(t)){case 2:var r=z3;break;case 8:r=L3;break;default:r=Kh}n=r.bind(null,t,n,e),r=void 0,!Qw||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Dh(e,t,n,a,r){var s=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var l=a.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=Es(l),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=s=i;continue e}l=l.parentNode}}a=a.return}Ay(function(){var u=s,m=Ww(n),f=[];e:{var w=e0.get(e);if(w!==void 0){var p=Gu,x=e;switch(e){case"keypress":if(Fu(n)===0)break e;case"keydown":case"keyup":p=t4;break;case"focusin":x="focus",p=np;break;case"focusout":x="blur",p=np;break;case"beforeblur":case"afterblur":p=np;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=F5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=r4;break;case Wy:case Zy:case Qy:p=Y5;break;case Jy:p=s4;break;case"scroll":case"scrollend":p=U5;break;case"wheel":p=l4;break;case"copy":case"cut":case"paste":p=q5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ky;break;case"toggle":case"beforetoggle":p=u4}var b=(t&4)!==0,y=!b&&(e==="scroll"||e==="scrollend"),h=b?w!==null?w+"Capture":null:w;b=[];for(var g=u,v;g!==null;){var S=g;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||h===null||(S=xl(g,h),S!=null&&b.push(Zl(g,S,v))),y)break;g=g.return}0<b.length&&(w=new p(w,x,null,n,m),f.push({event:w,listeners:b}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",w&&n!==Xw&&(x=n.relatedTarget||n.fromElement)&&(Es(x)||x[_s]))break e;if((p||w)&&(w=m.window===m?m:(w=m.ownerDocument)?w.defaultView||w.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=u,x=x?Es(x):null,x!==null&&(y=ll(x),b=x.tag,x!==y||b!==5&&b!==27&&b!==6)&&(x=null)):(p=null,x=u),p!==x)){if(b=Ty,S="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=ky,S="onPointerLeave",h="onPointerEnter",g="pointer"),y=p==null?w:gl(p),v=x==null?w:gl(x),w=new b(S,g+"leave",p,n,m),w.target=y,w.relatedTarget=v,S=null,Es(m)===u&&(b=new b(h,g+"enter",x,n,m),b.target=v,b.relatedTarget=y,S=b),y=S,p&&x)t:{for(b=c3,h=p,g=x,v=0,S=h;S;S=b(S))v++;S=0;for(var N=g;N;N=b(N))S++;for(;0<v-S;)h=b(h),v--;for(;0<S-v;)g=b(g),S--;for(;v--;){if(h===g||g!==null&&h===g.alternate){b=h;break t}h=b(h),g=b(g)}b=null}else b=null;p!==null&&SS(f,w,p,b,!1),x!==null&&y!==null&&SS(f,y,x,b,!0)}}e:{if(w=u?gl(u):window,p=w.nodeName&&w.nodeName.toLowerCase(),p==="select"||p==="input"&&w.type==="file")var A=$y;else if(Ly(w))if(By)A=v4;else{A=x4;var j=g4}else p=w.nodeName,!p||p.toLowerCase()!=="input"||w.type!=="checkbox"&&w.type!=="radio"?u&&qw(u.elementType)&&(A=$y):A=b4;if(A&&(A=A(e,u))){Iy(f,A,n,m);break e}j&&j(e,w,u),e==="focusout"&&u&&w.type==="number"&&u.memoizedProps.value!=null&&Kw(w,"number",w.value)}switch(j=u?gl(u):window,e){case"focusin":(Ly(j)||j.contentEditable==="true")&&(Ls=j,lp=u,Al=null);break;case"focusout":Al=lp=Ls=null;break;case"mousedown":cp=!0;break;case"contextmenu":case"mouseup":case"dragend":cp=!1,qy(f,n,m);break;case"selectionchange":if(S4)break;case"keydown":case"keyup":qy(f,n,m)}var C;if(rp)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else zs?Py(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(My&&n.locale!=="ko"&&(zs||R!=="onCompositionStart"?R==="onCompositionEnd"&&zs&&(C=_y()):(Ir=m,Jw="value"in Ir?Ir.value:Ir.textContent,zs=!0)),j=Pd(u,R),0<j.length&&(R=new Ry(R,e,null,n,m),f.push({event:R,listeners:j}),C?R.data=C:(C=zy(n),C!==null&&(R.data=C)))),(C=f4?m4(e,n):w4(e,n))&&(R=Pd(u,"onBeforeInput"),0<R.length&&(j=new Ry("onBeforeInput","beforeinput",null,n,m),f.push({event:j,listeners:R}),j.data=C)),o3(f,e,u,n,m)}vS(f,t)})}function Zl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pd(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=xl(e,n),r!=null&&a.unshift(Zl(e,r,s)),r=xl(e,t),r!=null&&a.push(Zl(e,r,s))),e.tag===3)return a;e=e.return}return[]}function c3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function SS(e,t,n,a,r){for(var s=t._reactName,i=[];n!==null&&n!==a;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===a)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=xl(n,s),u!=null&&i.unshift(Zl(n,u,c))):r||(u=xl(n,s),u!=null&&i.push(Zl(n,u,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var u3=/\r\n?/g,d3=/\u0000|\uFFFD/g;function jS(e){return(typeof e=="string"?e:""+e).replace(u3,`49 `).replace( d3,"")}function NS(e,t){return t=jS(t),jS(e)===t}function tt(e,t,n,a,r,s){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ds(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ds(e,""+a);break;case"className":$u(e,"class",a);break;case"tabIndex":$u(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":$u(e,n,a);break;case"style":Ny(e,a,s);break;case"data":if(t!=="object"){$u(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uu(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(t!=="input"&&tt(e,t,"name",r.name,r,null),tt(e,t,"formEncType",r.formEncType,r,null),tt(e,t,"formMethod",r.formMethod,r,null),tt(e,t,"formTarget",r.formTarget,r,null)):(tt(e,t,"encType",r.encType,r,null),tt(e,t,"method",r.method,r,null),tt(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uu(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=nr);break;case"onScroll":a!=null&&Ie("scroll",e);break;case"onScrollEnd":a!=null&&Ie("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Uu(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Ie("beforetoggle",e),Ie("toggle",e),Iu(e,"popover",a);break;case"xlinkActuate":tr(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":tr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":tr(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":tr(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":tr(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":tr(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":tr(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":tr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":tr(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Iu(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=$5.get(n)||n,Iu(e,n,a))}}function Oh(e,t,n,a,r,s){switch(n){case"style":Ny(e,a,s);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Ds(e,a):(typeof a=="number"||typeof a=="bigint")&&Ds(e,""+a);break;case"onScroll":a!=null&&Ie("scroll",e);break;case"onScrollEnd":a!=null&&Ie("scrollend",e);break;case"onClick":a!=null&&(e.onclick=nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!py.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),s=e[hn]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,r),typeof a=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Iu(e,n,a)}}}function nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("load",e);var a=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var i=n[s];if(i!=null)switch(s){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:tt(e,t,s,i,n,null)}}r&&tt(e,t,"srcSet",n.srcSet,n,null),a&&tt(e,t,"src",n.src,n,null);return;case"input":Ie("invalid",e);var l=s=i=r=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var m=n[a];if(m!=null)switch(a){case"name":r=m;break;case"type":i=m;break;case"checked":c=m;break;case"defaultChecked":u=m;break;case"value":s=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(q(137,t));break;default:tt(e,t,a,m,n,null)}}vy(e,s,l,c,u,i,r,!1);return;case"select":Ie("invalid",e),a=i=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":i=l;break;case"multiple":a=l;default:tt(e,t,r,l,n,null)}t=s,n=i,e.multiple=!!a,t!=null?Ms(e,!!a,t,!1):n!=null&&Ms(e,!!a,n,!0);return;case"textarea":Ie("invalid",e),s=r=a=null;for(i in n)if(n.hasOwnProperty(i)&&(l=n[i],l!=null))switch(i){case"value":a=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(q(91));break;default:tt(e,t,i,l,n,null)}Sy(e,a,r,s);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(a=n[c],a!=null))switch(c){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:tt(e,t,c,a,n,null)}return;case"dialog":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(a=0;a<Wl.length;a++)Ie(Wl[a],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(a=n[u],a!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:tt(e,t,u,a,n,null)}return;default:if(qw(t)){for(m in n)n.hasOwnProperty(m)&&(a=n[m],a!==void 0&&Oh(e,t,m,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(a=n[l],a!=null&&tt(e,t,l,a,n,null))}function f3(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,i=null,l=null,c=null,u=null,m=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=f;default:a.hasOwnProperty(p)||tt(e,t,p,null,a,f)}}for(var w in a){var p=a[w];if(f=n[w],a.hasOwnProperty(w)&&(p!=null||f!=null))switch(w){case"type":s=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":m=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(q(137,t));break;default:p!==f&&tt(e,t,w,p,a,f)}}Yw(e,i,l,c,u,m,s,r);return;case"select":p=i=l=w=null;for(s in n)if(c=n[s],n.hasOwnProperty(s)&&c!=null)switch(s){case"value":break;case"multiple":p=c;default:a.hasOwnProperty(s)||tt(e,t,s,null,a,c)}for(r in a)if(s=a[r],c=n[r],a.hasOwnProperty(r)&&(s!=null||c!=null))switch(r){case"value":w=s;break;case"defaultValue":l=s;break;case"multiple":i=s;default:s!==c&&tt(e,t,r,s,a,c)}t=l,n=i,a=p,w!=null?Ms(e,!!n,w,!1):!!a!=!!n&&(t!=null?Ms(e,!!n,t,!0):Ms(e,!!n,n?[]:"",!1));return;case"textarea":p=w=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!a.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:tt(e,t,l,null,a,r)}for(i in a)if(r=a[i],s=n[i],a.hasOwnProperty(i)&&(r!=null||s!=null))switch(i){case"value":w=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(q(91));break;default:r!==s&&tt(e,t,i,r,a,s)}yy(e,w,p);return;case"option":for(var x in n)if(w=n[x],n.hasOwnProperty(x)&&w!=null&&!a.hasOwnProperty(x))switch(x){case"selected":e.selected=!1;break;default:tt(e,t,x,null,a,w)}for(c in a)if(w=a[c],p=n[c],a.hasOwnProperty(c)&&w!==p&&(w!=null||p!=null))switch(c){case"selected":e.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:tt(e,t,c,w,a,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)w=n[b],n.hasOwnProperty(b)&&w!=null&&!a.hasOwnProperty(b)&&tt(e,t,b,null,a,w);for(u in a)if(w=a[u],p=n[u],a.hasOwnProperty(u)&&w!==p&&(w!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(q(137,t));break;default:tt(e,t,u,w,a,p)}return;default:if(qw(t)){for(var y in n)w=n[y],n.hasOwnProperty(y)&&w!==void 0&&!a.hasOwnProperty(y)&&Oh(e,t,y,void 0,a,w);for(m in a)w=a[m],p=n[m],!a.hasOwnProperty(m)||w===p||w===void 0&&p===void 0||Oh(e,t,m,w,a,p);return}}for(var h in n)w=n[h],n.hasOwnProperty(h)&&w!=null&&!a.hasOwnProperty(h)&&tt(e,t,h,null,a,w);for(f in a)w=a[f],p=n[f],!a.hasOwnProperty(f)||w===p||w==null&&p==null||tt(e,t,f,w,a,p)}function CS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],s=r.transferSize,i=r.initiatorType,l=r.duration;if(s&&l&&CS(i)){for(i=0,l=r.responseEnd,a+=1;a<n.length;a++){var c=n[a],u=c.startTime;if(u>l)break;var m=c.transferSize,f=c.initiatorType;m&&CS(f)&&(c=c.responseEnd,i+=m*(c<l?1:(l-u)/(c-u)))}if(--a,t+=8*(s+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ph=null,zh=null;function zd(e){return e.nodeType===9?e:e.ownerDocument}function AS(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _S(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ih=null;function w3(){var e=window.event;return e&&e.type==="popstate"?e===Ih?!1:(Ih=e,!0):(Ih=null,!1)}var ES=typeof setTimeout=="function"?setTimeout:void 0,p3=typeof clearTimeout=="function"?clearTimeout:void 0,TS=typeof Promise=="function"?Promise:void 0,h3=typeof queueMicrotask=="function"?queueMicrotask:typeof TS<"u"?function(e){return TS.resolve(null).then(e).catch(g3)}:ES;function g3(e){setTimeout(function(){throw e})}function to(e){return e==="head"}function RS(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),ui(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Ql(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ql(n);for(var s=n.firstChild;s;){var i=s.nextSibling,l=s.nodeName;s[hl]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=i}}else n==="body"&&Ql(e.ownerDocument.body);n=r}while(n);ui(t)}function kS(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function $h(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":$h(n),Vw(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function x3(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[hl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=oa(e.nextSibling),e===null)break}return null}function b3(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=oa(e.nextSibling),e===null))return null;return e}function MS(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=oa(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$?"||e.data==="$~"}function Uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function v3(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function oa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hh=null;function DS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return oa(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function OS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function PS(e,t,n){switch(t=zd(n),e){case"html":if(e=t.documentElement,!e)throw Error(q(452));return e;case"head":if(e=t.head,!e)throw Error(q(453));return e;case"body":if(e=t.body,!e)throw Error(q(454));return e;default:throw Error(q(451))}}function Ql(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vw(e)}var sa=new Map,zS=new Set;function Ld(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xr=qe.d;qe.d={f:y3,r:S3,D:j3,C:N3,L:C3,m:A3,X:E3,S:_3,M:T3};function y3(){var e=xr.f(),t=Ed();return e||t}function S3(e){var t=Ts(e);t!==null&&t.tag===5&&t.type==="form"?J0(t):xr.r(e)}var ii=typeof document>"u"?null:document;function LS(e,t,n){var a=ii;if(a&&typeof t=="string"&&t){var r=Qn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),zS.has(r)||(zS.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),nn(t,"link",e),Bt(t),a.head.appendChild(t)))}}function j3(e){xr.D(e),LS("dns-prefetch",e,null)}function N3(e,t){xr.C(e,t),LS("preconnect",e,t)}function C3(e,t,n){xr.L(e,t,n);var a=ii;if(a&&e&&t){var r='link[rel="preload"][as="'+Qn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Qn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Qn(n.imageSizes)+'"]')):r+='[href="'+Qn(e)+'"]';var s=r;switch(t){case"style":s=li(e);break;case"script":s=ci(e)}sa.has(s)||(e=lt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),sa.set(s,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(Jl(s))||t==="script"&&a.querySelector(ec(s))||(t=a.createElement("link"),nn(t,"link",e),Bt(t),a.head.appendChild(t)))}}function A3(e,t){xr.m(e,t);var n=ii;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Qn(a)+'"][href="'+Qn(e)+'"]',s=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ci(e)}if(!sa.has(s)&&(e=lt({rel:"modulepreload",href:e},t),sa.set(s,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ec(s)))return}a=n.createElement("link"),nn(a,"link",e),Bt(a),n.head.appendChild(a)}}}function _3(e,t,n){xr.S(e,t,n);var a=ii;if(a&&e){var r=Rs(a).hoistableStyles,s=li(e);t=t||"default";var i=r.get(s);if(!i){var l={loading:0,preload:null};if(i=a.querySelector(Jl(s)))l.loading=5;else{e=lt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=sa.get(s))&&Fh(e,n);var c=i=a.createElement("link");Bt(c),nn(c,"link",e),c._p=new Promise(function(u,m){c.onload=u,c.onerror=m}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Id(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(s,i)}}}function E3(e,t){xr.X(e,t);var n=ii;if(n&&e){var a=Rs(n).hoistableScripts,r=ci(e),s=a.get(r);s||(s=n.querySelector(ec(r)),s||(e=lt({src:e,async:!0},t),(t=sa.get(r))&&Vh(e,t),s=n.createElement("script"),Bt(s),nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(r,s))}}function T3(e,t){xr.M(e,t);var n=ii;if(n&&e){var a=Rs(n).hoistableScripts,r=ci(e),s=a.get(r);s||(s=n.querySelector(ec(r)),s||(e=lt({src:e,async:!0,type:"module"},t),(t=sa.get(r))&&Vh(e,t),s=n.createElement("script"),Bt(s),nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(r,s))}}function IS(e,t,n,a){var r=(r=Pr.current)?Ld(r):null;if(!r)throw Error(q(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=li(n.href),n=Rs(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=li(n.href);var s=Rs(r).hoistableStyles,i=s.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,i),(s=r.querySelector(Jl(e)))&&!s._p&&(i.instance=s,i.state.loading=5),sa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},sa.set(e,n),s||R3(r,e,n,i.state))),t&&a===null)throw Error(q(528,""));return i}if(t&&a!==null)throw Error(q(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ci(n),n=Rs(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(q(444,e))}}function li(e){return'href="'+Qn(e)+'"'}function Jl(e){return'link[rel="stylesheet"]['+e+"]"}function $S(e){return lt({},e,{"data-precedence":e.precedence,precedence:null})}function R3(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nn(t,"link",n),Bt(t),e.head.appendChild(t))}function ci(e){return'[src="'+Qn(e)+'"]'}function ec(e){return"script[async]"+e}function BS(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Qn(n.href)+'"]');if(a)return t.instance=a,Bt(a),a;var r=lt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Bt(a),nn(a,"style",r),Id(a,n.precedence,e),t.instance=a;case"stylesheet":r=li(n.href);var s=e.querySelector(Jl(r));if(s)return t.state.loading|=4,t.instance=s,Bt(s),s;a=$S(n),(r=sa.get(r))&&Fh(a,r),s=(e.ownerDocument||e).createElement("link"),Bt(s);var i=s;return i._p=new Promise(function(l,c){i.onload=l,i.onerror=c}),nn(s,"link",a),t.state.loading|=4,Id(s,n.precedence,e),t.instance=s;case"script":return s=ci(n.src),(r=e.querySelector(ec(s)))?(t.instance=r,Bt(r),r):(a=n,(r=sa.get(s))&&(a=lt({},n),Vh(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Bt(r),nn(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(q(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,Id(a,n.precedence,e));return t.instance}function Id(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,s=r,i=0;i<a.length;i++){var l=a[i];if(l.dataset.precedence===t)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Fh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $d=null;function US(e,t,n){if($d===null){var a=new Map,r=$d=new Map;r.set(n,a)}else r=$d,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var s=n[r];if(!(s[hl]||s[Qt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var i=s.getAttribute(t)||"";i=e+i;var l=a.get(i);l?l.push(s):a.set(i,[s])}}return a}function HS(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function k3(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function FS(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function M3(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=li(a.href),s=t.querySelector(Jl(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Bd.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Bt(s);return}s=t.ownerDocument||t,a=$S(a),(r=sa.get(r))&&Fh(a,r),s=s.createElement("link"),Bt(s);var i=s;i._p=new Promise(function(l,c){i.onload=l,i.onerror=c}),nn(s,"link",a),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Bd.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Gh=0;function D3(e,t){return e.stylesheets&&e.count===0&&Hd(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Hd(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Gh===0&&(Gh=62500*m3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Hd(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Gh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function Bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ud=null;function Hd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ud=new Map,t.forEach(O3,e),Ud=null,Bd.call(e))}function O3(e,t){if(!(t.state.loading&4)){var n=Ud.get(e);if(n)var a=n.get(null);else{n=new Map,Ud.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var i=r[s];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}r=t.instance,i=r.getAttribute("data-precedence"),s=n.get(i)||a,s===a&&n.set(null,r),n.set(i,r),this.count++,a=Bd.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),s?s.parentNode.insertBefore(r,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var tc={$$typeof:er,Provider:null,Consumer:null,_currentValue:To,_currentValue2:To,_threadCount:0};function P3(e,t,n,a,r,s,i,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bw(0),this.hiddenUpdates=Bw(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function VS(e,t,n,a,r,s,i,l,c,u,m,f){return e=new P3(e,t,n,i,c,u,m,f,l),t=1,s===!0&&(t|=24),s=Mn(3,null,null,t),e.current=s,s.stateNode=e,t=Np(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:a,isDehydrated:n,cache:t},Ep(s),e}function GS(e){return e?(e=Bs,e):Bs}function YS(e,t,n,a,r,s){r=GS(r),a.context===null?a.context=r:a.pendingContext=r,a=Vr(t),a.payload={element:n},s=s===void 0?null:s,s!==null&&(a.callback=s),n=Gr(e,a,t),n!==null&&(Sn(n,e,t),Dl(n,e,t))}function KS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yh(e,t){KS(e,t),(e=e.alternate)&&KS(e,t)}function qS(e){if(e.tag===13||e.tag===31){var t=zo(e,67108864);t!==null&&Sn(t,e,67108864),Yh(e,67108864)}}function XS(e){if(e.tag===13||e.tag===31){var t=Ln();t=Uw(t);var n=zo(e,t);n!==null&&Sn(n,e,t),Yh(e,t)}}var Fd=!0;function z3(e,t,n,a){var r=Ce.T;Ce.T=null;var s=qe.p;try{qe.p=2,Kh(e,t,n,a)}finally{qe.p=s,Ce.T=r}}function L3(e,t,n,a){var r=Ce.T;Ce.T=null;var s=qe.p;try{qe.p=8,Kh(e,t,n,a)}finally{qe.p=s,Ce.T=r}}function Kh(e,t,n,a){if(Fd){var r=qh(a);if(r===null)Dh(e,t,a,Vd,n),ZS(e,a);else if($3(r,e,t,n,a))a.stopPropagation();else if(ZS(e,a),t&4&&-1<I3.indexOf(e)){for(;r!==null;){var s=Ts(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var i=ko(s.pendingLanes);if(i!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var c=1<<31-Rn(i);l.entanglements[1]|=c,i&=~c}Pa(s),!(Xe&6)&&(Ad=En()+500,Xl(0))}}break;case 31:case 13:l=zo(s,2),l!==null&&Sn(l,s,2),Ed(),Yh(s,2)}if(s=qh(a),s===null&&Dh(e,t,a,Vd,n),s===r)break;r=s}r!==null&&a.stopPropagation()}else Dh(e,t,a,null,n)}}function qh(e){return e=Ww(e),Xh(e)}var Vd=null;function Xh(e){if(Vd=null,e=Es(e),e!==null){var t=ll(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Xv(t),e!==null)return e;e=null}else if(n===31){if(e=Wv(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 Vd=e,null}function WS(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(j5()){case ry:return 2;case oy:return 8;case Du:case N5:return 32;case sy:return 268435456;default:return 32}default:return 32}}var Wh=!1,no=null,ao=null,ro=null,nc=new Map,ac=new Map,oo=[],I3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ZS(e,t){switch(e){case"focusin":case"focusout":no=null;break;case"dragenter":case"dragleave":ao=null;break;case"mouseover":case"mouseout":ro=null;break;case"pointerover":case"pointerout":nc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(t.pointerId)}}function rc(e,t,n,a,r,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:s,targetContainers:[r]},t!==null&&(t=Ts(t),t!==null&&qS(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function $3(e,t,n,a,r){switch(t){case"focusin":return no=rc(no,e,t,n,a,r),!0;case"dragenter":return ao=rc(ao,e,t,n,a,r),!0;case"mouseover":return ro=rc(ro,e,t,n,a,r),!0;case"pointerover":var s=r.pointerId;return nc.set(s,rc(nc.get(s)||null,e,t,n,a,r)),!0;case"gotpointercapture":return s=r.pointerId,ac.set(s,rc(ac.get(s)||null,e,t,n,a,r)),!0}return!1}function QS(e){var t=Es(e.target);if(t!==null){var n=ll(t);if(n!==null){if(t=n.tag,t===13){if(t=Xv(n),t!==null){e.blockedOn=t,fy(e.priority,function(){XS(n)});return}}else if(t===31){if(t=Wv(n),t!==null){e.blockedOn=t,fy(e.priority,function(){XS(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 Gd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Xw=a,n.target.dispatchEvent(a),Xw=null}else return t=Ts(n),t!==null&&qS(t),e.blockedOn=n,!1;t.shift()}return!0}function JS(e,t,n){Gd(e)&&n.delete(t)}function B3(){Wh=!1,no!==null&&Gd(no)&&(no=null),ao!==null&&Gd(ao)&&(ao=null),ro!==null&&Gd(ro)&&(ro=null),nc.forEach(JS),ac.forEach(JS)}function Yd(e,t){e.blockedOn===t&&(e.blockedOn=null,Wh||(Wh=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,B3)))}var Kd=null;function ej(e){Kd!==e&&(Kd=e,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,function(){Kd===e&&(Kd=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(Xh(a||n)===null)continue;break}var s=Ts(n);s!==null&&(e.splice(t,3),t-=3,qp(s,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function ui(e){function t(c){return Yd(c,e)}no!==null&&Yd(no,e),ao!==null&&Yd(ao,e),ro!==null&&Yd(ro,e),nc.forEach(t),ac.forEach(t);for(var n=0;n<oo.length;n++){var a=oo[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<oo.length&&(n=oo[0],n.blockedOn===null);)QS(n),n.blockedOn===null&&oo.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],s=n[a+1],i=r[hn]||null;if(typeof s=="function")i||ej(n);else if(i){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,i=s[hn]||null)l=i.formAction;else if(Xh(r)!==null)continue}else l=i.action;typeof l=="function"?n[a+1]=l:(n.splice(a,3),a-=3),ej(n)}}}function tj(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Zh(e){this._internalRoot=e}qd.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));var n=t.current,a=Ln();YS(n,a,e,t,null,null)},qd.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;YS(e.current,2,null,e,null,null),Ed(),t[_s]=null}};function qd(e){this._internalRoot=e}qd.prototype.unstable_scheduleHydration=function(e){if(e){var t=dy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<oo.length&&t!==0&&t<oo[n].priority;n++);oo.splice(n,0,e),n===0&&QS(e)}};var nj=Kv.version;if(nj!=="19.2.4")throw Error(q(527,nj,"19.2.4"));qe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=h5(t),e=e!==null?Qv(e):null,e=e===null?null:e.stateNode,e};var U3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Ce,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xd.isDisabled&&Xd.supportsFiber)try{ml=Xd.inject(U3),Tn=Xd}catch{}}_u.createRoot=function(e,t){if(!qv(e))throw Error(q(299));var n=!1,a="",r=c1,s=u1,i=d1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=VS(e,1,!1,null,null,n,a,null,r,s,i,tj),e[_s]=t.current,Mh(e),new Zh(t)},_u.hydrateRoot=function(e,t,n){if(!qv(e))throw Error(q(299));var a=!1,r="",s=c1,i=u1,l=d1,c=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=VS(e,1,!0,t,n??null,a,r,c,s,i,l,tj),t.context=GS(null),n=t.current,a=Ln(),a=Uw(a),r=Vr(a),r.callback=null,Gr(n,r,a),n=a,t.current.lanes=n,pl(t,n),Pa(t),e[_s]=t.current,Mh(e),new qd(t)},_u.version="19.2.4";function aj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aj)}catch(e){console.error(e)}}aj(),Bv.exports=_u;var H3=Bv.exports;/**48 `+a.stack}}var Lw=Object.prototype.hasOwnProperty,Iw=Dt.unstable_scheduleCallback,$w=Dt.unstable_cancelCallback,S5=Dt.unstable_shouldYield,j5=Dt.unstable_requestPaint,En=Dt.unstable_now,N5=Dt.unstable_getCurrentPriorityLevel,ry=Dt.unstable_ImmediatePriority,oy=Dt.unstable_UserBlockingPriority,Du=Dt.unstable_NormalPriority,C5=Dt.unstable_LowPriority,sy=Dt.unstable_IdlePriority,A5=Dt.log,_5=Dt.unstable_setDisableYieldValue,ml=null,Tn=null;function zr(e){if(typeof A5=="function"&&_5(e),Tn&&typeof Tn.setStrictMode=="function")try{Tn.setStrictMode(ml,e)}catch{}}var Rn=Math.clz32?Math.clz32:R5,E5=Math.log,T5=Math.LN2;function R5(e){return e>>>=0,e===0?32:31-(E5(e)/T5|0)|0}var Ou=256,Pu=262144,zu=4194304;function ko(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Lu(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var l=a&134217727;return l!==0?(a=l&~s,a!==0?r=ko(a):(i&=l,i!==0?r=ko(i):n||(n=l&~e,n!==0&&(r=ko(n))))):(l=a&~s,l!==0?r=ko(l):i!==0?r=ko(i):n||(n=a&~e,n!==0&&(r=ko(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function wl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function k5(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function iy(){var e=zu;return zu<<=1,!(zu&62914560)&&(zu=4194304),e}function Bw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M5(e,t,n,a,r,s){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=i&~n;0<n;){var m=31-Rn(n),f=1<<m;l[m]=0,c[m]=-1;var w=d[m];if(w!==null)for(d[m]=null,m=0;m<w.length;m++){var p=w[m];p!==null&&(p.lane&=-536870913)}n&=~f}a!==0&&ly(e,a,0),s!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=s&~(i&~t))}function ly(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Rn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function cy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Rn(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function uy(e,t){var n=t&-t;return n=n&42?1:Uw(n),n&(e.suspendedLanes|t)?0:n}function Uw(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hw(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dy(){var e=qe.p;return e!==0?e:(e=window.event,e===void 0?32:WS(e.type))}function fy(e,t){var n=qe.p;try{return qe.p=e,t()}finally{qe.p=n}}var Lr=Math.random().toString(36).slice(2),Qt="__reactFiber$"+Lr,hn="__reactProps$"+Lr,_s="__reactContainer$"+Lr,Fw="__reactEvents$"+Lr,D5="__reactListeners$"+Lr,O5="__reactHandles$"+Lr,my="__reactResources$"+Lr,hl="__reactMarker$"+Lr;function Vw(e){delete e[Qt],delete e[hn],delete e[Fw],delete e[D5],delete e[O5]}function Es(e){var t=e[Qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_s]||n[Qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=OS(e);e!==null;){if(n=e[Qt])return n;e=OS(e)}return t}e=n,n=e.parentNode}return null}function Ts(e){if(e=e[Qt]||e[_s]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(q(33))}function Rs(e){var t=e[my];return t||(t=e[my]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Bt(e){e[hl]=!0}var wy=new Set,py={};function Mo(e,t){ks(e,t),ks(e+"Capture",t)}function ks(e,t){for(py[e]=t,e=0;e<t.length;e++)wy.add(t[e])}var P5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),hy={},gy={};function z5(e){return Lw.call(gy,e)?!0:Lw.call(hy,e)?!1:P5.test(e)?gy[e]=!0:(hy[e]=!0,!1)}function Iu(e,t,n){if(z5(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function $u(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function tr(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Zn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L5(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,s=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){n=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gw(e){if(!e._valueTracker){var t=xy(e)?"checked":"value";e._valueTracker=L5(e,t,""+e[t])}}function by(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=xy(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Bu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var I5=/[\n"\\]/g;function Qn(e){return e.replace(I5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yw(e,t,n,a,r,s,i,l){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zn(t)):e.value!==""+Zn(t)&&(e.value=""+Zn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?Kw(e,i,Zn(t)):n!=null?Kw(e,i,Zn(n)):a!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Zn(l):e.removeAttribute("name")}function vy(e,t,n,a,r,s,i,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Gw(e);return}n=n!=null?""+Zn(n):"",t=t!=null?""+Zn(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=l?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),Gw(e)}function Kw(e,t,n){t==="number"&&Bu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ms(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Zn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function yy(e,t,n){if(t!=null&&(t=""+Zn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Zn(n):""}function Sy(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(q(92));if(dl(a)){if(1<a.length)throw Error(q(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Zn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Gw(e)}function Ds(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function jy(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||$5.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ny(e,t,n){if(t!=null&&typeof t!="object")throw Error(q(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&jy(e,r,a)}else for(var s in t)t.hasOwnProperty(s)&&jy(e,s,t[s])}function qw(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var B5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),U5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Uu(e){return U5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nr(){}var Xw=null;function Ww(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Os=null,Ps=null;function Cy(e){var t=Ts(e);if(t&&(e=t.stateNode)){var n=e[hn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yw(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Qn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[hn]||null;if(!r)throw Error(q(90));Yw(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&by(a)}break e;case"textarea":yy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ms(e,!!n.multiple,t,!1)}}}var Zw=!1;function Ay(e,t,n){if(Zw)return e(t,n);Zw=!0;try{var a=e(t);return a}finally{if(Zw=!1,(Os!==null||Ps!==null)&&(Ed(),Os&&(t=Os,e=Ps,Ps=Os=null,Cy(t),e)))for(t=0;t<e.length;t++)Cy(e[t])}}function xl(e,t){var n=e.stateNode;if(n===null)return null;var a=n[hn]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qw=!1;if(ar)try{var bl={};Object.defineProperty(bl,"passive",{get:function(){Qw=!0}}),window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{Qw=!1}var Ir=null,Jw=null,Hu=null;function _y(){if(Hu)return Hu;var e,t=Jw,n=t.length,a,r="value"in Ir?Ir.value:Ir.textContent,s=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===r[s-a];a++);return Hu=r.slice(e,1<a?1-a:void 0)}function Fu(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 Vu(){return!0}function Ey(){return!1}function gn(e){function t(n,a,r,s,i){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Vu:Ey,this.isPropagationStopped=Ey,this}return lt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vu)},persist:function(){},isPersistent:Vu}),t}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gu=gn(Do),vl=lt({},Do,{view:0,detail:0}),H5=gn(vl),ep,tp,yl,Yu=lt({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ap,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!==yl&&(yl&&e.type==="mousemove"?(ep=e.screenX-yl.screenX,tp=e.screenY-yl.screenY):tp=ep=0,yl=e),ep)},movementY:function(e){return"movementY"in e?e.movementY:tp}}),Ty=gn(Yu),F5=lt({},Yu,{dataTransfer:0}),V5=gn(F5),G5=lt({},vl,{relatedTarget:0}),np=gn(G5),Y5=lt({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),K5=gn(Y5),q5=lt({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X5=gn(q5),W5=lt({},Do,{data:0}),Ry=gn(W5),Z5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q5={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"},J5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J5[e])?!!t[e]:!1}function ap(){return e4}var t4=lt({},vl,{key:function(e){if(e.key){var t=Z5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Q5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ap,charCode:function(e){return e.type==="keypress"?Fu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),n4=gn(t4),a4=lt({},Yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ky=gn(a4),r4=lt({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ap}),o4=gn(r4),s4=lt({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),i4=gn(s4),l4=lt({},Yu,{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}),c4=gn(l4),u4=lt({},Do,{newState:0,oldState:0}),d4=gn(u4),f4=[9,13,27,32],rp=ar&&"CompositionEvent"in window,Sl=null;ar&&"documentMode"in document&&(Sl=document.documentMode);var m4=ar&&"TextEvent"in window&&!Sl,My=ar&&(!rp||Sl&&8<Sl&&11>=Sl),Dy=" ",Oy=!1;function Py(e,t){switch(e){case"keyup":return f4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zs=!1;function w4(e,t){switch(e){case"compositionend":return zy(t);case"keypress":return t.which!==32?null:(Oy=!0,Dy);case"textInput":return e=t.data,e===Dy&&Oy?null:e;default:return null}}function p4(e,t){if(zs)return e==="compositionend"||!rp&&Py(e,t)?(e=_y(),Hu=Jw=Ir=null,zs=!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 My&&t.locale!=="ko"?null:t.data;default:return null}}var h4={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 Ly(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h4[e.type]:t==="textarea"}function Iy(e,t,n,a){Os?Ps?Ps.push(a):Ps=[a]:Os=a,t=Pd(t,"onChange"),0<t.length&&(n=new Gu("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var jl=null,Nl=null;function g4(e){vS(e,0)}function Ku(e){var t=gl(e);if(by(t))return e}function $y(e,t){if(e==="change")return t}var By=!1;if(ar){var op;if(ar){var sp="oninput"in document;if(!sp){var Uy=document.createElement("div");Uy.setAttribute("oninput","return;"),sp=typeof Uy.oninput=="function"}op=sp}else op=!1;By=op&&(!document.documentMode||9<document.documentMode)}function Hy(){jl&&(jl.detachEvent("onpropertychange",Fy),Nl=jl=null)}function Fy(e){if(e.propertyName==="value"&&Ku(Nl)){var t=[];Iy(t,Nl,e,Ww(e)),Ay(g4,t)}}function x4(e,t,n){e==="focusin"?(Hy(),jl=t,Nl=n,jl.attachEvent("onpropertychange",Fy)):e==="focusout"&&Hy()}function b4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ku(Nl)}function v4(e,t){if(e==="click")return Ku(t)}function y4(e,t){if(e==="input"||e==="change")return Ku(t)}function S4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kn=typeof Object.is=="function"?Object.is:S4;function Cl(e,t){if(kn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Lw.call(t,r)||!kn(e[r],t[r]))return!1}return!0}function Vy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gy(e,t){var n=Vy(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vy(n)}}function Yy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ky(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bu(e.document)}return t}function ip(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var j4=ar&&"documentMode"in document&&11>=document.documentMode,Ls=null,lp=null,Al=null,cp=!1;function qy(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cp||Ls==null||Ls!==Bu(a)||(a=Ls,"selectionStart"in a&&ip(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Al&&Cl(Al,a)||(Al=a,a=Pd(lp,"onSelect"),0<a.length&&(t=new Gu("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ls)))}function Oo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Is={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},up={},Xy={};ar&&(Xy=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function Po(e){if(up[e])return up[e];if(!Is[e])return e;var t=Is[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xy)return up[e]=t[n];return e}var Wy=Po("animationend"),Zy=Po("animationiteration"),Qy=Po("animationstart"),N4=Po("transitionrun"),C4=Po("transitionstart"),A4=Po("transitioncancel"),Jy=Po("transitionend"),e0=new Map,dp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");dp.push("scrollEnd");function ga(e,t){e0.set(e,t),Mo(t,[e])}var qu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jn=[],$s=0,fp=0;function Xu(){for(var e=$s,t=fp=$s=0;t<e;){var n=Jn[t];Jn[t++]=null;var a=Jn[t];Jn[t++]=null;var r=Jn[t];Jn[t++]=null;var s=Jn[t];if(Jn[t++]=null,a!==null&&r!==null){var i=a.pending;i===null?r.next=r:(r.next=i.next,i.next=r),a.pending=r}s!==0&&t0(n,r,s)}}function Wu(e,t,n,a){Jn[$s++]=e,Jn[$s++]=t,Jn[$s++]=n,Jn[$s++]=a,fp|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function mp(e,t,n,a){return Wu(e,t,n,a),Zu(e)}function zo(e,t){return Wu(e,null,null,t),Zu(e)}function t0(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,s=e.return;s!==null;)s.childLanes|=n,a=s.alternate,a!==null&&(a.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(r=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,r&&t!==null&&(r=31-Rn(n),e=s.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),s):null}function Zu(e){if(50<ql)throw ql=0,Sh=null,Error(q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bs={};function _4(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(e,t,n,a){return new _4(e,t,n,a)}function wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rr(e,t){var n=e.alternate;return n===null?(n=Mn(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&65011712,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.refCleanup=e.refCleanup,n}function n0(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Qu(e,t,n,a,r,s){var i=0;if(a=e,typeof e=="function")wp(e)&&(i=1);else if(typeof e=="string")i=M3(e,n,ka.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Rw:return e=Mn(31,n,t,r),e.elementType=Rw,e.lanes=s,e;case Ns:return Lo(n.children,r,s,t);case Jv:i=8,r|=24;break;case Cw:return e=Mn(12,n,t,r|2),e.elementType=Cw,e.lanes=s,e;case _w:return e=Mn(13,n,t,r),e.elementType=_w,e.lanes=s,e;case Ew:return e=Mn(19,n,t,r),e.elementType=Ew,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case er:i=10;break e;case ey:i=9;break e;case Aw:i=11;break e;case Tw:i=14;break e;case Or:i=16,a=null;break e}i=29,n=Error(q(130,e===null?"null":typeof e,"")),a=null}return t=Mn(i,n,t,r),t.elementType=e,t.type=a,t.lanes=s,t}function Lo(e,t,n,a){return e=Mn(7,e,a,t),e.lanes=n,e}function pp(e,t,n){return e=Mn(6,e,null,t),e.lanes=n,e}function a0(e){var t=Mn(18,null,null,0);return t.stateNode=e,t}function hp(e,t,n){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var r0=new WeakMap;function ea(e,t){if(typeof e=="object"&&e!==null){var n=r0.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ay(t)},r0.set(e,t),t)}return{value:e,source:t,stack:ay(t)}}var Us=[],Hs=0,Ju=null,_l=0,ta=[],na=0,$r=null,Ma=1,Da="";function or(e,t){Us[Hs++]=_l,Us[Hs++]=Ju,Ju=e,_l=t}function o0(e,t,n){ta[na++]=Ma,ta[na++]=Da,ta[na++]=$r,$r=e;var a=Ma;e=Da;var r=32-Rn(a)-1;a&=~(1<<r),n+=1;var s=32-Rn(t)+r;if(30<s){var i=r-r%5;s=(a&(1<<i)-1).toString(32),a>>=i,r-=i,Ma=1<<32-Rn(t)+r|n<<r|a,Da=s+e}else Ma=1<<s|n<<r|a,Da=e}function gp(e){e.return!==null&&(or(e,1),o0(e,1,0))}function xp(e){for(;e===Ju;)Ju=Us[--Hs],Us[Hs]=null,_l=Us[--Hs],Us[Hs]=null;for(;e===$r;)$r=ta[--na],ta[na]=null,Da=ta[--na],ta[na]=null,Ma=ta[--na],ta[na]=null}function s0(e,t){ta[na++]=Ma,ta[na++]=Da,ta[na++]=$r,Ma=t.id,Da=t.overflow,$r=e}var Jt=null,ct=null,Ue=!1,Br=null,aa=!1,bp=Error(q(519));function Ur(e){var t=Error(q(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw El(ea(t,e)),bp}function i0(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Qt]=e,t[hn]=a,n){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(n=0;n<Wl.length;n++)Ie(Wl[n],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),vy(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),Sy(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||NS(t.textContent,n)?(a.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),a.onScroll!=null&&Ie("scroll",t),a.onScrollEnd!=null&&Ie("scrollend",t),a.onClick!=null&&(t.onclick=nr),t=!0):t=!1,t||Ur(e,!0)}function l0(e){for(Jt=e.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:Jt=Jt.return}}function Fs(e){if(e!==Jt)return!1;if(!Ue)return l0(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Lh(e.type,e.memoizedProps)),n=!n),n&&ct&&Ur(e),l0(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));ct=DS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));ct=DS(e)}else t===27?(t=ct,to(e.type)?(e=Hh,Hh=null,ct=e):ct=t):ct=Jt?oa(e.stateNode.nextSibling):null;return!0}function Io(){ct=Jt=null,Ue=!1}function vp(){var e=Br;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),Br=null),e}function El(e){Br===null?Br=[e]:Br.push(e)}var yp=Ra(null),$o=null,sr=null;function Hr(e,t,n){st(yp,t._currentValue),t._currentValue=n}function ir(e){e._currentValue=yp.current,$t(yp)}function Sp(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function jp(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var s=r.dependencies;if(s!==null){var i=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Sp(s.return,n,e),a||(i=null);break e}s=l.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(q(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Sp(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function Vs(e,t,n,a){e=null;for(var r=t,s=!1;r!==null;){if(!s){if(r.flags&524288)s=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(q(387));if(i=i.memoizedProps,i!==null){var l=r.type;kn(r.pendingProps.value,i.value)||(e!==null?e.push(l):e=[l])}}else if(r===Ru.current){if(i=r.alternate,i===null)throw Error(q(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(tc):e=[tc])}r=r.return}e!==null&&jp(t,e,n,a),t.flags|=262144}function ed(e){for(e=e.firstContext;e!==null;){if(!kn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bo(e){$o=e,sr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function en(e){return c0($o,e)}function td(e,t){return $o===null&&Bo(e),c0(e,t)}function c0(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sr===null){if(e===null)throw Error(q(308));sr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sr=sr.next=t;return n}var E4=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},T4=Dt.unstable_scheduleCallback,R4=Dt.unstable_NormalPriority,Ct={$$typeof:er,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Np(){return{controller:new E4,data:new Map,refCount:0}}function Tl(e){e.refCount--,e.refCount===0&&T4(R4,function(){e.controller.abort()})}var Rl=null,Cp=0,Gs=0,Ys=null;function k4(e,t){if(Rl===null){var n=Rl=[];Cp=0,Gs=Eh(),Ys={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Cp++,t.then(u0,u0),t}function u0(){if(--Cp===0&&Rl!==null){Ys!==null&&(Ys.status="fulfilled");var e=Rl;Rl=null,Gs=0,Ys=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function M4(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var d0=Ae.S;Ae.S=function(e,t){q1=En(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&k4(e,t),d0!==null&&d0(e,t)};var Uo=Ra(null);function Ap(){var e=Uo.current;return e!==null?e:ot.pooledCache}function nd(e,t){t===null?st(Uo,Uo.current):st(Uo,t.pool)}function f0(){var e=Ap();return e===null?null:{parent:Ct._currentValue,pool:e}}var Ks=Error(q(460)),_p=Error(q(474)),ad=Error(q(542)),rd={then:function(){}};function m0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function w0(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nr,nr),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,h0(e),e;default:if(typeof t.status=="string")t.then(nr,nr);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(q(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,h0(e),e}throw Fo=t,Ks}}function Ho(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Fo=n,Ks):n}}var Fo=null;function p0(){if(Fo===null)throw Error(q(459));var e=Fo;return Fo=null,e}function h0(e){if(e===Ks||e===ad)throw Error(q(483))}var qs=null,kl=0;function od(e){var t=kl;return kl+=1,qs===null&&(qs=[]),w0(qs,e,t)}function Ml(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sd(e,t){throw t.$$typeof===x5?Error(q(525)):(e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function g0(e){function t(h,g){if(e){var v=h.deletions;v===null?(h.deletions=[g],h.flags|=16):v.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function a(h){for(var g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function r(h,g){return h=rr(h,g),h.index=0,h.sibling=null,h}function s(h,g,v){return h.index=v,e?(v=h.alternate,v!==null?(v=v.index,v<g?(h.flags|=67108866,g):v):(h.flags|=67108866,g)):(h.flags|=1048576,g)}function i(h){return e&&h.alternate===null&&(h.flags|=67108866),h}function l(h,g,v,S){return g===null||g.tag!==6?(g=pp(v,h.mode,S),g.return=h,g):(g=r(g,v),g.return=h,g)}function c(h,g,v,S){var N=v.type;return N===Ns?m(h,g,v.props.children,S,v.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Or&&Ho(N)===g.type)?(g=r(g,v.props),Ml(g,v),g.return=h,g):(g=Qu(v.type,v.key,v.props,null,h.mode,S),Ml(g,v),g.return=h,g)}function d(h,g,v,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=hp(v,h.mode,S),g.return=h,g):(g=r(g,v.children||[]),g.return=h,g)}function m(h,g,v,S,N){return g===null||g.tag!==7?(g=Lo(v,h.mode,S,N),g.return=h,g):(g=r(g,v),g.return=h,g)}function f(h,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=pp(""+g,h.mode,v),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Tu:return v=Qu(g.type,g.key,g.props,null,h.mode,v),Ml(v,g),v.return=h,v;case cl:return g=hp(g,h.mode,v),g.return=h,g;case Or:return g=Ho(g),f(h,g,v)}if(dl(g)||ul(g))return g=Lo(g,h.mode,v,null),g.return=h,g;if(typeof g.then=="function")return f(h,od(g),v);if(g.$$typeof===er)return f(h,td(h,g),v);sd(h,g)}return null}function w(h,g,v,S){var N=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return N!==null?null:l(h,g,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:return v.key===N?c(h,g,v,S):null;case cl:return v.key===N?d(h,g,v,S):null;case Or:return v=Ho(v),w(h,g,v,S)}if(dl(v)||ul(v))return N!==null?null:m(h,g,v,S,null);if(typeof v.then=="function")return w(h,g,od(v),S);if(v.$$typeof===er)return w(h,g,td(h,v),S);sd(h,v)}return null}function p(h,g,v,S,N){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return h=h.get(v)||null,l(g,h,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Tu:return h=h.get(S.key===null?v:S.key)||null,c(g,h,S,N);case cl:return h=h.get(S.key===null?v:S.key)||null,d(g,h,S,N);case Or:return S=Ho(S),p(h,g,v,S,N)}if(dl(S)||ul(S))return h=h.get(v)||null,m(g,h,S,N,null);if(typeof S.then=="function")return p(h,g,v,od(S),N);if(S.$$typeof===er)return p(h,g,v,td(g,S),N);sd(g,S)}return null}function x(h,g,v,S){for(var N=null,A=null,j=g,C=g=0,R=null;j!==null&&C<v.length;C++){j.index>C?(R=j,j=null):R=j.sibling;var M=w(h,j,v[C],S);if(M===null){j===null&&(j=R);break}e&&j&&M.alternate===null&&t(h,j),g=s(M,g,C),A===null?N=M:A.sibling=M,A=M,j=R}if(C===v.length)return n(h,j),Ue&&or(h,C),N;if(j===null){for(;C<v.length;C++)j=f(h,v[C],S),j!==null&&(g=s(j,g,C),A===null?N=j:A.sibling=j,A=j);return Ue&&or(h,C),N}for(j=a(j);C<v.length;C++)R=p(j,h,C,v[C],S),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?C:R.key),g=s(R,g,C),A===null?N=R:A.sibling=R,A=R);return e&&j.forEach(function(z){return t(h,z)}),Ue&&or(h,C),N}function b(h,g,v,S){if(v==null)throw Error(q(151));for(var N=null,A=null,j=g,C=g=0,R=null,M=v.next();j!==null&&!M.done;C++,M=v.next()){j.index>C?(R=j,j=null):R=j.sibling;var z=w(h,j,M.value,S);if(z===null){j===null&&(j=R);break}e&&j&&z.alternate===null&&t(h,j),g=s(z,g,C),A===null?N=z:A.sibling=z,A=z,j=R}if(M.done)return n(h,j),Ue&&or(h,C),N;if(j===null){for(;!M.done;C++,M=v.next())M=f(h,M.value,S),M!==null&&(g=s(M,g,C),A===null?N=M:A.sibling=M,A=M);return Ue&&or(h,C),N}for(j=a(j);!M.done;C++,M=v.next())M=p(j,h,C,M.value,S),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?C:M.key),g=s(M,g,C),A===null?N=M:A.sibling=M,A=M);return e&&j.forEach(function(B){return t(h,B)}),Ue&&or(h,C),N}function y(h,g,v,S){if(typeof v=="object"&&v!==null&&v.type===Ns&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:e:{for(var N=v.key;g!==null;){if(g.key===N){if(N=v.type,N===Ns){if(g.tag===7){n(h,g.sibling),S=r(g,v.props.children),S.return=h,h=S;break e}}else if(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Or&&Ho(N)===g.type){n(h,g.sibling),S=r(g,v.props),Ml(S,v),S.return=h,h=S;break e}n(h,g);break}else t(h,g);g=g.sibling}v.type===Ns?(S=Lo(v.props.children,h.mode,S,v.key),S.return=h,h=S):(S=Qu(v.type,v.key,v.props,null,h.mode,S),Ml(S,v),S.return=h,h=S)}return i(h);case cl:e:{for(N=v.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(h,g.sibling),S=r(g,v.children||[]),S.return=h,h=S;break e}else{n(h,g);break}else t(h,g);g=g.sibling}S=hp(v,h.mode,S),S.return=h,h=S}return i(h);case Or:return v=Ho(v),y(h,g,v,S)}if(dl(v))return x(h,g,v,S);if(ul(v)){if(N=ul(v),typeof N!="function")throw Error(q(150));return v=N.call(v),b(h,g,v,S)}if(typeof v.then=="function")return y(h,g,od(v),S);if(v.$$typeof===er)return y(h,g,td(h,v),S);sd(h,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(n(h,g.sibling),S=r(g,v),S.return=h,h=S):(n(h,g),S=pp(v,h.mode,S),S.return=h,h=S),i(h)):n(h,g)}return function(h,g,v,S){try{kl=0;var N=y(h,g,v,S);return qs=null,N}catch(j){if(j===Ks||j===ad)throw j;var A=Mn(29,j,null,h.mode);return A.lanes=S,A.return=h,A}finally{}}}var Vo=g0(!0),x0=g0(!1),Fr=!1;function Ep(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Vr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gr(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Xe&2){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Zu(e),t0(e,null,n),t}return Wu(e,a,t,n),Zu(e)}function Dl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cy(e,n)}}function Rp(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kp=!1;function Ol(){if(kp){var e=Ys;if(e!==null)throw e}}function Pl(e,t,n,a){kp=!1;var r=e.updateQueue;Fr=!1;var s=r.firstBaseUpdate,i=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,d=c.next;c.next=null,i===null?s=d:i.next=d,i=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==i&&(l===null?m.firstBaseUpdate=d:l.next=d,m.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;i=0,m=d=c=null,l=s;do{var w=l.lane&-536870913,p=w!==l.lane;if(p?(Be&w)===w:(a&w)===w){w!==0&&w===Gs&&(kp=!0),m!==null&&(m=m.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var x=e,b=l;w=t;var y=n;switch(b.tag){case 1:if(x=b.payload,typeof x=="function"){f=x.call(y,f,w);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,w=typeof x=="function"?x.call(y,f,w):x,w==null)break e;f=lt({},f,w);break e;case 2:Fr=!0}}w=l.callback,w!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[w]:p.push(w))}else p={lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(d=m=p,c=f):m=m.next=p,i|=w;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);m===null&&(c=f),r.baseState=c,r.firstBaseUpdate=d,r.lastBaseUpdate=m,s===null&&(r.shared.lanes=0),Wr|=i,e.lanes=i,e.memoizedState=f}}function b0(e,t){if(typeof e!="function")throw Error(q(191,e));e.call(t)}function v0(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)b0(n[e],t)}var Xs=Ra(null),id=Ra(0);function y0(e,t){e=hr,st(id,e),st(Xs,t),hr=e|t.baseLanes}function Mp(){st(id,hr),st(Xs,Xs.current)}function Dp(){hr=id.current,$t(Xs),$t(id)}var Dn=Ra(null),ra=null;function Yr(e){var t=e.alternate;st(yt,yt.current&1),st(Dn,e),ra===null&&(t===null||Xs.current!==null||t.memoizedState!==null)&&(ra=e)}function Op(e){st(yt,yt.current),st(Dn,e),ra===null&&(ra=e)}function S0(e){e.tag===22?(st(yt,yt.current),st(Dn,e),ra===null&&(ra=e)):Kr()}function Kr(){st(yt,yt.current),st(Dn,Dn.current)}function On(e){$t(Dn),ra===e&&(ra=null),$t(yt)}var yt=Ra(0);function ld(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Bh(n)||Uh(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)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 lr=0,ke=null,et=null,At=null,cd=!1,Ws=!1,Go=!1,ud=0,zl=0,Zs=null,D4=0;function gt(){throw Error(q(321))}function Pp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kn(e[n],t[n]))return!1;return!0}function zp(e,t,n,a,r,s){return lr=s,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ae.H=e===null||e.memoizedState===null?o1:Zp,Go=!1,s=n(a,r),Go=!1,Ws&&(s=N0(t,n,a,r)),j0(e),s}function j0(e){Ae.H=$l;var t=et!==null&&et.next!==null;if(lr=0,At=et=ke=null,cd=!1,zl=0,Zs=null,t)throw Error(q(300));e===null||_t||(e=e.dependencies,e!==null&&ed(e)&&(_t=!0))}function N0(e,t,n,a){ke=e;var r=0;do{if(Ws&&(Zs=null),zl=0,Ws=!1,25<=r)throw Error(q(301));if(r+=1,At=et=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Ae.H=s1,s=t(n,a)}while(Ws);return s}function O4(){var e=Ae.H,t=e.useState()[0];return t=typeof t.then=="function"?Ll(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(ke.flags|=1024),t}function Lp(){var e=ud!==0;return ud=0,e}function Ip(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $p(e){if(cd){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}cd=!1}lr=0,At=et=ke=null,Ws=!1,zl=ud=0,Zs=null}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?ke.memoizedState=At=e:At=At.next=e,At}function St(){if(et===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=At===null?ke.memoizedState:At.next;if(t!==null)At=t,et=e;else{if(e===null)throw ke.alternate===null?Error(q(467)):Error(q(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},At===null?ke.memoizedState=At=e:At=At.next=e}return At}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ll(e){var t=zl;return zl+=1,Zs===null&&(Zs=[]),e=w0(Zs,e,t),t=ke,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,Ae.H=t===null||t.memoizedState===null?o1:Zp),e}function fd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ll(e);if(e.$$typeof===er)return en(e)}throw Error(q(438,String(e)))}function Bp(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ke.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=dd(),ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=b5;return t.index++,n}function cr(e,t){return typeof t=="function"?t(e):t}function md(e){var t=St();return Up(t,et,e)}function Up(e,t,n){var a=e.queue;if(a===null)throw Error(q(311));a.lastRenderedReducer=n;var r=e.baseQueue,s=a.pending;if(s!==null){if(r!==null){var i=r.next;r.next=s.next,s.next=i}t.baseQueue=r=s,a.pending=null}if(s=e.baseState,r===null)e.memoizedState=s;else{t=r.next;var l=i=null,c=null,d=t,m=!1;do{var f=d.lane&-536870913;if(f!==d.lane?(Be&f)===f:(lr&f)===f){var w=d.revertLane;if(w===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),f===Gs&&(m=!0);else if((lr&w)===w){d=d.next,w===Gs&&(m=!0);continue}else f={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(l=c=f,i=s):c=c.next=f,ke.lanes|=w,Wr|=w;f=d.action,Go&&n(s,f),s=d.hasEagerState?d.eagerState:n(s,f)}else w={lane:f,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(l=c=w,i=s):c=c.next=w,ke.lanes|=f,Wr|=f;d=d.next}while(d!==null&&d!==t);if(c===null?i=s:c.next=l,!kn(s,e.memoizedState)&&(_t=!0,m&&(n=Ys,n!==null)))throw n;e.memoizedState=s,e.baseState=i,e.baseQueue=c,a.lastRenderedState=s}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Hp(e){var t=St(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,s=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do s=e(s,i.action),i=i.next;while(i!==r);kn(s,t.memoizedState)||(_t=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,a]}function C0(e,t,n){var a=ke,r=St(),s=Ue;if(s){if(n===void 0)throw Error(q(407));n=n()}else n=t();var i=!kn((et||r).memoizedState,n);if(i&&(r.memoizedState=n,_t=!0),r=r.queue,Gp(E0.bind(null,a,r,e),[e]),r.getSnapshot!==t||i||At!==null&&At.memoizedState.tag&1){if(a.flags|=2048,Qs(9,{destroy:void 0},_0.bind(null,a,r,n,t),null),ot===null)throw Error(q(349));s||lr&127||A0(a,t,n)}return n}function A0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=dd(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _0(e,t,n,a){t.value=n,t.getSnapshot=a,T0(t)&&R0(e)}function E0(e,t,n){return n(function(){T0(t)&&R0(e)})}function T0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kn(e,n)}catch{return!0}}function R0(e){var t=zo(e,2);t!==null&&Sn(t,e,2)}function Fp(e){var t=fn();if(typeof e=="function"){var n=e;if(e=n(),Go){zr(!0);try{n()}finally{zr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function k0(e,t,n,a){return e.baseState=n,Up(e,et,typeof a=="function"?a:cr)}function P4(e,t,n,a,r){if(hd(e))throw Error(q(485));if(e=t.action,e!==null){var s={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){s.listeners.push(i)}};Ae.T!==null?n(!0):s.isTransition=!1,a(s),n=t.pending,n===null?(s.next=t.pending=s,M0(t,s)):(s.next=n.next,t.pending=n.next=s)}}function M0(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var s=Ae.T,i={};Ae.T=i;try{var l=n(r,a),c=Ae.S;c!==null&&c(i,l),D0(e,t,l)}catch(d){Vp(e,t,d)}finally{s!==null&&i.types!==null&&(s.types=i.types),Ae.T=s}}else try{s=n(r,a),D0(e,t,s)}catch(d){Vp(e,t,d)}}function D0(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){O0(e,t,a)},function(a){return Vp(e,t,a)}):O0(e,t,n)}function O0(e,t,n){t.status="fulfilled",t.value=n,P0(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,M0(e,n)))}function Vp(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,P0(t),t=t.next;while(t!==a)}e.action=null}function P0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function z0(e,t){return t}function L0(e,t){if(Ue){var n=ot.formState;if(n!==null){e:{var a=ke;if(Ue){if(ct){t:{for(var r=ct,s=aa;r.nodeType!==8;){if(!s){r=null;break t}if(r=oa(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){ct=oa(r.nextSibling),a=r.data==="F!";break e}}Ur(a)}a=!1}a&&(t=n[0])}}return n=fn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z0,lastRenderedState:t},n.queue=a,n=n1.bind(null,ke,a),a.dispatch=n,a=Fp(!1),s=Wp.bind(null,ke,!1,a.queue),a=fn(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=P4.bind(null,ke,r,s,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function I0(e){var t=St();return $0(t,et,e)}function $0(e,t,n){if(t=Up(e,t,z0)[0],e=md(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ll(t)}catch(i){throw i===Ks?ad:i}else a=t;t=St();var r=t.queue,s=r.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,Qs(9,{destroy:void 0},z4.bind(null,r,n),null)),[a,s,e]}function z4(e,t){e.action=t}function B0(e){var t=St(),n=et;if(n!==null)return $0(t,n,e);St(),t=t.memoizedState,n=St();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Qs(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=ke.updateQueue,t===null&&(t=dd(),ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function U0(){return St().memoizedState}function wd(e,t,n,a){var r=fn();ke.flags|=e,r.memoizedState=Qs(1|t,{destroy:void 0},n,a===void 0?null:a)}function pd(e,t,n,a){var r=St();a=a===void 0?null:a;var s=r.memoizedState.inst;et!==null&&a!==null&&Pp(a,et.memoizedState.deps)?r.memoizedState=Qs(t,s,n,a):(ke.flags|=e,r.memoizedState=Qs(1|t,s,n,a))}function H0(e,t){wd(8390656,8,e,t)}function Gp(e,t){pd(2048,8,e,t)}function L4(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=dd(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function F0(e){var t=St().memoizedState;return L4({ref:t,nextImpl:e}),function(){if(Xe&2)throw Error(q(440));return t.impl.apply(void 0,arguments)}}function V0(e,t){return pd(4,2,e,t)}function G0(e,t){return pd(4,4,e,t)}function Y0(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function K0(e,t,n){n=n!=null?n.concat([e]):null,pd(4,4,Y0.bind(null,t,e),n)}function Yp(){}function q0(e,t){var n=St();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Pp(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function X0(e,t){var n=St();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Pp(t,a[1]))return a[0];if(a=e(),Go){zr(!0);try{e()}finally{zr(!1)}}return n.memoizedState=[a,t],a}function Kp(e,t,n){return n===void 0||lr&1073741824&&!(Be&261930)?e.memoizedState=t:(e.memoizedState=n,e=W1(),ke.lanes|=e,Wr|=e,n)}function W0(e,t,n,a){return kn(n,t)?n:Xs.current!==null?(e=Kp(e,n,a),kn(e,t)||(_t=!0),e):!(lr&42)||lr&1073741824&&!(Be&261930)?(_t=!0,e.memoizedState=n):(e=W1(),ke.lanes|=e,Wr|=e,t)}function Z0(e,t,n,a,r){var s=qe.p;qe.p=s!==0&&8>s?s:8;var i=Ae.T,l={};Ae.T=l,Wp(e,!1,t,n);try{var c=r(),d=Ae.S;if(d!==null&&d(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var m=M4(c,a);Il(e,t,m,Ln(e))}else Il(e,t,a,Ln(e))}catch(f){Il(e,t,{then:function(){},status:"rejected",reason:f},Ln())}finally{qe.p=s,i!==null&&l.types!==null&&(i.types=l.types),Ae.T=i}}function I4(){}function qp(e,t,n,a){if(e.tag!==5)throw Error(q(476));var r=Q0(e).queue;Z0(e,r,t,To,n===null?I4:function(){return J0(e),n(a)})}function Q0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:To,baseState:To,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:To},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function J0(e){var t=Q0(e);t.next===null&&(t=e.alternate.memoizedState),Il(e,t.next.queue,{},Ln())}function Xp(){return en(tc)}function e1(){return St().memoizedState}function t1(){return St().memoizedState}function $4(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ln();e=Vr(n);var a=Gr(t,e,n);a!==null&&(Sn(a,t,n),Dl(a,t,n)),t={cache:Np()},e.payload=t;return}t=t.return}}function B4(e,t,n){var a=Ln();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hd(e)?a1(t,n):(n=mp(e,t,n,a),n!==null&&(Sn(n,e,a),r1(n,t,a)))}function n1(e,t,n){var a=Ln();Il(e,t,n,a)}function Il(e,t,n,a){var r={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hd(e))a1(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(r.hasEagerState=!0,r.eagerState=l,kn(l,i))return Wu(e,t,r,0),ot===null&&Xu(),!1}catch{}finally{}if(n=mp(e,t,r,a),n!==null)return Sn(n,e,a),r1(n,t,a),!0}return!1}function Wp(e,t,n,a){if(a={lane:2,revertLane:Eh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hd(e)){if(t)throw Error(q(479))}else t=mp(e,n,a,2),t!==null&&Sn(t,e,2)}function hd(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function a1(e,t){Ws=cd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function r1(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cy(e,n)}}var $l={readContext:en,use:fd,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};$l.useEffectEvent=gt;var o1={readContext:en,use:fd,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:H0,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,wd(4194308,4,Y0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wd(4194308,4,e,t)},useInsertionEffect:function(e,t){wd(4,2,e,t)},useMemo:function(e,t){var n=fn();t=t===void 0?null:t;var a=e();if(Go){zr(!0);try{e()}finally{zr(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=fn();if(n!==void 0){var r=n(t);if(Go){zr(!0);try{n(t)}finally{zr(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=B4.bind(null,ke,e),[a.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:function(e){e=Fp(e);var t=e.queue,n=n1.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Yp,useDeferredValue:function(e,t){var n=fn();return Kp(n,e,t)},useTransition:function(){var e=Fp(!1);return e=Z0.bind(null,ke,e.queue,!0,!1),fn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ke,r=fn();if(Ue){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),ot===null)throw Error(q(349));Be&127||A0(a,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,H0(E0.bind(null,a,s,e),[e]),a.flags|=2048,Qs(9,{destroy:void 0},_0.bind(null,a,s,n,t),null),n},useId:function(){var e=fn(),t=ot.identifierPrefix;if(Ue){var n=Da,a=Ma;n=(a&~(1<<32-Rn(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ud++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=D4++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xp,useFormState:L0,useActionState:L0,useOptimistic:function(e){var t=fn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Wp.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bp,useCacheRefresh:function(){return fn().memoizedState=$4.bind(null,ke)},useEffectEvent:function(e){var t=fn(),n={impl:e};return t.memoizedState=n,function(){if(Xe&2)throw Error(q(440));return n.impl.apply(void 0,arguments)}}},Zp={readContext:en,use:fd,useCallback:q0,useContext:en,useEffect:Gp,useImperativeHandle:K0,useInsertionEffect:V0,useLayoutEffect:G0,useMemo:X0,useReducer:md,useRef:U0,useState:function(){return md(cr)},useDebugValue:Yp,useDeferredValue:function(e,t){var n=St();return W0(n,et.memoizedState,e,t)},useTransition:function(){var e=md(cr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ll(e),t]},useSyncExternalStore:C0,useId:e1,useHostTransitionStatus:Xp,useFormState:I0,useActionState:I0,useOptimistic:function(e,t){var n=St();return k0(n,et,e,t)},useMemoCache:Bp,useCacheRefresh:t1};Zp.useEffectEvent=F0;var s1={readContext:en,use:fd,useCallback:q0,useContext:en,useEffect:Gp,useImperativeHandle:K0,useInsertionEffect:V0,useLayoutEffect:G0,useMemo:X0,useReducer:Hp,useRef:U0,useState:function(){return Hp(cr)},useDebugValue:Yp,useDeferredValue:function(e,t){var n=St();return et===null?Kp(n,e,t):W0(n,et.memoizedState,e,t)},useTransition:function(){var e=Hp(cr)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ll(e),t]},useSyncExternalStore:C0,useId:e1,useHostTransitionStatus:Xp,useFormState:B0,useActionState:B0,useOptimistic:function(e,t){var n=St();return et!==null?k0(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bp,useCacheRefresh:t1};s1.useEffectEvent=F0;function Qp(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:lt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jp={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Ln(),r=Vr(a);r.payload=t,n!=null&&(r.callback=n),t=Gr(e,r,a),t!==null&&(Sn(t,e,a),Dl(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Ln(),r=Vr(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Gr(e,r,a),t!==null&&(Sn(t,e,a),Dl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ln(),a=Vr(n);a.tag=2,t!=null&&(a.callback=t),t=Gr(e,a,n),t!==null&&(Sn(t,e,n),Dl(t,e,n))}};function i1(e,t,n,a,r,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,s,i):t.prototype&&t.prototype.isPureReactComponent?!Cl(n,a)||!Cl(r,s):!0}function l1(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Jp.enqueueReplaceState(t,t.state,null)}function Yo(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=lt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function c1(e){qu(e)}function u1(e){console.error(e)}function d1(e){qu(e)}function gd(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function f1(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function eh(e,t,n){return n=Vr(n),n.tag=3,n.payload={element:null},n.callback=function(){gd(e,t)},n}function m1(e){return e=Vr(e),e.tag=3,e}function w1(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=a.value;e.payload=function(){return r(s)},e.callback=function(){f1(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){f1(t,n,a),typeof r!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var l=a.stack;this.componentDidCatch(a.value,{componentStack:l!==null?l:""})})}function U4(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Vs(t,n,r,!0),n=Dn.current,n!==null){switch(n.tag){case 31:case 13:return ra===null?Td():n.alternate===null&&xt===0&&(xt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===rd?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ch(e,a,r)),!1;case 22:return n.flags|=65536,a===rd?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ch(e,a,r)),!1}throw Error(q(435,n.tag))}return Ch(e,a,r),Td(),!1}if(Ue)return t=Dn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==bp&&(e=Error(q(422),{cause:a}),El(ea(e,n)))):(a!==bp&&(t=Error(q(423),{cause:a}),El(ea(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=ea(a,n),r=eh(e.stateNode,a,r),Rp(e,r),xt!==4&&(xt=2)),!1;var s=Error(q(520),{cause:a});if(s=ea(s,n),Kl===null?Kl=[s]:Kl.push(s),xt!==4&&(xt=2),t===null)return!0;a=ea(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=eh(n.stateNode,a,e),Rp(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Zr===null||!Zr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=m1(r),w1(r,e,n,a),Rp(n,r),!1}n=n.return}while(n!==null);return!1}var th=Error(q(461)),_t=!1;function tn(e,t,n,a){t.child=e===null?x0(t,null,n,a):Vo(t,e.child,n,a)}function p1(e,t,n,a,r){n=n.render;var s=t.ref;if("ref"in a){var i={};for(var l in a)l!=="ref"&&(i[l]=a[l])}else i=a;return Bo(t),a=zp(e,t,n,i,s,r),l=Lp(),e!==null&&!_t?(Ip(e,t,r),ur(e,t,r)):(Ue&&l&&gp(t),t.flags|=1,tn(e,t,a,r),t.child)}function h1(e,t,n,a,r){if(e===null){var s=n.type;return typeof s=="function"&&!wp(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,g1(e,t,s,a,r)):(e=Qu(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!ch(e,r)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:Cl,n(i,a)&&e.ref===t.ref)return ur(e,t,r)}return t.flags|=1,e=rr(s,a),e.ref=t.ref,e.return=t,t.child=e}function g1(e,t,n,a,r){if(e!==null){var s=e.memoizedProps;if(Cl(s,a)&&e.ref===t.ref)if(_t=!1,t.pendingProps=a=s,ch(e,r))e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,ur(e,t,r)}return nh(e,t,n,a,r)}function x1(e,t,n,a){var r=a.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|n:n,e!==null){for(a=t.child=e.child,r=0;a!==null;)r=r|a.lanes|a.childLanes,a=a.sibling;a=r&~s}else a=0,t.child=null;return b1(e,t,s,n,a)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nd(t,s!==null?s.cachePool:null),s!==null?y0(t,s):Mp(),S0(t);else return a=t.lanes=536870912,b1(e,t,s!==null?s.baseLanes|n:n,n,a)}else s!==null?(nd(t,s.cachePool),y0(t,s),Kr(),t.memoizedState=null):(e!==null&&nd(t,null),Mp(),Kr());return tn(e,t,r,n),t.child}function Bl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function b1(e,t,n,a,r){var s=Ap();return s=s===null?null:{parent:Ct._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&nd(t,null),Mp(),S0(t),e!==null&&Vs(e,t,a,!0),t.childLanes=r,null}function xd(e,t){return t=vd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function v1(e,t,n){return Vo(t,e.child,null,n),e=xd(t,t.pendingProps),e.flags|=2,On(t),t.memoizedState=null,e}function H4(e,t,n){var a=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(a.mode==="hidden")return e=xd(t,a),t.lanes=536870912,Bl(null,e);if(Op(t),(e=ct)?(e=MS(e,aa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$r!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=a0(e),n.return=t,t.child=n,Jt=t,ct=null)):e=null,e===null)throw Ur(t);return t.lanes=536870912,null}return xd(t,a)}var s=e.memoizedState;if(s!==null){var i=s.dehydrated;if(Op(t),r)if(t.flags&256)t.flags&=-257,t=v1(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(q(558));else if(_t||Vs(e,t,n,!1),r=(n&e.childLanes)!==0,_t||r){if(a=ot,a!==null&&(i=uy(a,n),i!==0&&i!==s.retryLane))throw s.retryLane=i,zo(e,i),Sn(a,e,i),th;Td(),t=v1(e,t,n)}else e=s.treeContext,ct=oa(i.nextSibling),Jt=t,Ue=!0,Br=null,aa=!1,e!==null&&s0(t,e),t=xd(t,a),t.flags|=4096;return t}return e=rr(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bd(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(q(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function nh(e,t,n,a,r){return Bo(t),n=zp(e,t,n,a,void 0,r),a=Lp(),e!==null&&!_t?(Ip(e,t,r),ur(e,t,r)):(Ue&&a&&gp(t),t.flags|=1,tn(e,t,n,r),t.child)}function y1(e,t,n,a,r,s){return Bo(t),t.updateQueue=null,n=N0(t,a,n,r),j0(e),a=Lp(),e!==null&&!_t?(Ip(e,t,s),ur(e,t,s)):(Ue&&a&&gp(t),t.flags|=1,tn(e,t,n,s),t.child)}function S1(e,t,n,a,r){if(Bo(t),t.stateNode===null){var s=Bs,i=n.contextType;typeof i=="object"&&i!==null&&(s=en(i)),s=new n(a,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Jp,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=a,s.state=t.memoizedState,s.refs={},Ep(t),i=n.contextType,s.context=typeof i=="object"&&i!==null?en(i):Bs,s.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Qp(t,n,i,a),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(i=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),i!==s.state&&Jp.enqueueReplaceState(s,s.state,null),Pl(t,a,s,r),Ol(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){s=t.stateNode;var l=t.memoizedProps,c=Yo(n,l);s.props=c;var d=s.context,m=n.contextType;i=Bs,typeof m=="object"&&m!==null&&(i=en(m));var f=n.getDerivedStateFromProps;m=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,m||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||d!==i)&&l1(t,s,a,i),Fr=!1;var w=t.memoizedState;s.state=w,Pl(t,a,s,r),Ol(),d=t.memoizedState,l||w!==d||Fr?(typeof f=="function"&&(Qp(t,n,f,a),d=t.memoizedState),(c=Fr||i1(t,n,c,a,w,d,i))?(m||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),s.props=a,s.state=d,s.context=i,a=c):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,Tp(e,t),i=t.memoizedProps,m=Yo(n,i),s.props=m,f=t.pendingProps,w=s.context,d=n.contextType,c=Bs,typeof d=="object"&&d!==null&&(c=en(d)),l=n.getDerivedStateFromProps,(d=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==f||w!==c)&&l1(t,s,a,c),Fr=!1,w=t.memoizedState,s.state=w,Pl(t,a,s,r),Ol();var p=t.memoizedState;i!==f||w!==p||Fr||e!==null&&e.dependencies!==null&&ed(e.dependencies)?(typeof l=="function"&&(Qp(t,n,l,a),p=t.memoizedState),(m=Fr||i1(t,n,m,a,w,p,c)||e!==null&&e.dependencies!==null&&ed(e.dependencies))?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,p,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,p,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=p),s.props=a,s.state=p,s.context=c,a=m):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),a=!1)}return s=a,bd(e,t),a=(t.flags&128)!==0,s||a?(s=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&a?(t.child=Vo(t,e.child,null,r),t.child=Vo(t,null,n,r)):tn(e,t,n,r),t.memoizedState=s.state,e=t.child):e=ur(e,t,r),e}function j1(e,t,n,a){return Io(),t.flags|=256,tn(e,t,n,a),t.child}var ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rh(e){return{baseLanes:e,cachePool:f0()}}function oh(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=zn),e}function N1(e,t,n){var a=t.pendingProps,r=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(r?Yr(t):Kr(),(e=ct)?(e=MS(e,aa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$r!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},n=a0(e),n.return=t,t.child=n,Jt=t,ct=null)):e=null,e===null)throw Ur(t);return Uh(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,r?(Kr(),r=t.mode,l=vd({mode:"hidden",children:l},r),a=Lo(a,r,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,a=t.child,a.memoizedState=rh(n),a.childLanes=oh(e,i,n),t.memoizedState=ah,Bl(null,a)):(Yr(t),sh(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(s)t.flags&256?(Yr(t),t.flags&=-257,t=ih(e,t,n)):t.memoizedState!==null?(Kr(),t.child=e.child,t.flags|=128,t=null):(Kr(),l=a.fallback,r=t.mode,a=vd({mode:"visible",children:a.children},r),l=Lo(l,r,n,null),l.flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,Vo(t,e.child,null,n),a=t.child,a.memoizedState=rh(n),a.childLanes=oh(e,i,n),t.memoizedState=ah,t=Bl(null,a));else if(Yr(t),Uh(l)){if(i=l.nextSibling&&l.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(q(419)),a.stack="",a.digest=i,El({value:a,source:null,stack:null}),t=ih(e,t,n)}else if(_t||Vs(e,t,n,!1),i=(n&e.childLanes)!==0,_t||i){if(i=ot,i!==null&&(a=uy(i,n),a!==0&&a!==c.retryLane))throw c.retryLane=a,zo(e,a),Sn(i,e,a),th;Bh(l)||Td(),t=ih(e,t,n)}else Bh(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ct=oa(l.nextSibling),Jt=t,Ue=!0,Br=null,aa=!1,e!==null&&s0(t,e),t=sh(t,a.children),t.flags|=4096);return t}return r?(Kr(),l=a.fallback,r=t.mode,c=e.child,d=c.sibling,a=rr(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?l=rr(d,l):(l=Lo(l,r,n,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,Bl(null,a),a=t.child,l=e.child.memoizedState,l===null?l=rh(n):(r=l.cachePool,r!==null?(c=Ct._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=f0(),l={baseLanes:l.baseLanes|n,cachePool:r}),a.memoizedState=l,a.childLanes=oh(e,i,n),t.memoizedState=ah,Bl(e.child,a)):(Yr(t),n=e.child,e=n.sibling,n=rr(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function sh(e,t){return t=vd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vd(e,t){return e=Mn(22,e,null,t),e.lanes=0,e}function ih(e,t,n){return Vo(t,e.child,null,n),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function C1(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Sp(e.return,t,n)}function lh(e,t,n,a,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r,treeForkCount:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=a,i.tail=n,i.tailMode=r,i.treeForkCount=s)}function A1(e,t,n){var a=t.pendingProps,r=a.revealOrder,s=a.tail;a=a.children;var i=yt.current,l=(i&2)!==0;if(l?(i=i&1|2,t.flags|=128):i&=1,st(yt,i),tn(e,t,a,n),a=Ue?_l:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&C1(e,n,t);else if(e.tag===19)C1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ld(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),lh(t,!1,r,n,s,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ld(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}lh(t,!0,n,null,s,a);break;case"together":lh(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ur(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wr|=t.lanes,!(n&t.childLanes))if(e!==null){if(Vs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=rr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ch(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&ed(e)))}function F4(e,t,n){switch(t.tag){case 3:ku(t,t.stateNode.containerInfo),Hr(t,Ct,e.memoizedState.cache),Io();break;case 27:case 5:Dw(t);break;case 4:ku(t,t.stateNode.containerInfo);break;case 10:Hr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Op(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Yr(t),t.flags|=128,null):n&t.child.childLanes?N1(e,t,n):(Yr(t),e=ur(e,t,n),e!==null?e.sibling:null);Yr(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Vs(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return A1(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),st(yt,yt.current),a)break;return null;case 22:return t.lanes=0,x1(e,t,n,t.pendingProps);case 24:Hr(t,Ct,e.memoizedState.cache)}return ur(e,t,n)}function _1(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)_t=!0;else{if(!ch(e,n)&&!(t.flags&128))return _t=!1,F4(e,t,n);_t=!!(e.flags&131072)}else _t=!1,Ue&&t.flags&1048576&&o0(t,_l,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Ho(t.elementType),t.type=e,typeof e=="function")wp(e)?(a=Yo(e,a),t.tag=1,t=S1(null,t,e,a,n)):(t.tag=0,t=nh(null,t,e,a,n));else{if(e!=null){var r=e.$$typeof;if(r===Aw){t.tag=11,t=p1(null,t,e,a,n);break e}else if(r===Tw){t.tag=14,t=h1(null,t,e,a,n);break e}}throw t=kw(e)||e,Error(q(306,t,""))}}return t;case 0:return nh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=Yo(a,t.pendingProps),S1(e,t,a,r,n);case 3:e:{if(ku(t,t.stateNode.containerInfo),e===null)throw Error(q(387));a=t.pendingProps;var s=t.memoizedState;r=s.element,Tp(e,t),Pl(t,a,null,n);var i=t.memoizedState;if(a=i.cache,Hr(t,Ct,a),a!==s.cache&&jp(t,[Ct],n,!0),Ol(),a=i.element,s.isDehydrated)if(s={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=j1(e,t,a,n);break e}else if(a!==r){r=ea(Error(q(424)),t),El(r),t=j1(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ct=oa(e.firstChild),Jt=t,Ue=!0,Br=null,aa=!0,n=x0(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Io(),a===r){t=ur(e,t,n);break e}tn(e,t,a,n)}t=t.child}return t;case 26:return bd(e,t),e===null?(n=IS(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(n=t.type,e=t.pendingProps,a=zd(Pr.current).createElement(n),a[Qt]=t,a[hn]=e,nn(a,n,e),Bt(a),t.stateNode=a):t.memoizedState=IS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dw(t),e===null&&Ue&&(a=t.stateNode=PS(t.type,t.pendingProps,Pr.current),Jt=t,aa=!0,r=ct,to(t.type)?(Hh=r,ct=oa(a.firstChild)):ct=r),tn(e,t,t.pendingProps.children,n),bd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((r=a=ct)&&(a=b3(a,t.type,t.pendingProps,aa),a!==null?(t.stateNode=a,Jt=t,ct=oa(a.firstChild),aa=!1,r=!0):r=!1),r||Ur(t)),Dw(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Lh(r,s)?a=null:i!==null&&Lh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=zp(e,t,O4,null,null,n),tc._currentValue=r),bd(e,t),tn(e,t,a,n),t.child;case 6:return e===null&&Ue&&((e=n=ct)&&(n=v3(n,t.pendingProps,aa),n!==null?(t.stateNode=n,Jt=t,ct=null,e=!0):e=!1),e||Ur(t)),null;case 13:return N1(e,t,n);case 4:return ku(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Vo(t,null,a,n):tn(e,t,a,n),t.child;case 11:return p1(e,t,t.type,t.pendingProps,n);case 7:return tn(e,t,t.pendingProps,n),t.child;case 8:return tn(e,t,t.pendingProps.children,n),t.child;case 12:return tn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Hr(t,t.type,a.value),tn(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,Bo(t),r=en(r),a=a(r),t.flags|=1,tn(e,t,a,n),t.child;case 14:return h1(e,t,t.type,t.pendingProps,n);case 15:return g1(e,t,t.type,t.pendingProps,n);case 19:return A1(e,t,n);case 31:return H4(e,t,n);case 22:return x1(e,t,n,t.pendingProps);case 24:return Bo(t),a=en(Ct),e===null?(r=Ap(),r===null&&(r=ot,s=Np(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),t.memoizedState={parent:a,cache:r},Ep(t),Hr(t,Ct,r)):(e.lanes&n&&(Tp(e,t),Pl(t,null,null,n),Ol()),r=e.memoizedState,s=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Hr(t,Ct,a)):(a=s.cache,Hr(t,Ct,a),a!==r.cache&&jp(t,[Ct],n,!0))),tn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(q(156,t.tag))}function dr(e){e.flags|=4}function uh(e,t,n,a,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(eS())e.flags|=8192;else throw Fo=rd,_p}else e.flags&=-16777217}function E1(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!FS(t))if(eS())e.flags|=8192;else throw Fo=rd,_p}function yd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?iy():536870912,e.lanes|=t,ni|=t)}function Ul(e,t){if(!Ue)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 a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function V4(e,t,n){var a=t.pendingProps;switch(xp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ir(Ct),As(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?dr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,vp())),ut(t),null;case 26:var r=t.type,s=t.memoizedState;return e===null?(dr(t),s!==null?(ut(t),E1(t,s)):(ut(t),uh(t,r,null,a,n))):s?s!==e.memoizedState?(dr(t),ut(t),E1(t,s)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&dr(t),ut(t),uh(t,r,e,a,n)),null;case 27:if(Mu(t),n=Pr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return ut(t),null}e=ka.current,Fs(t)?i0(t):(e=PS(r,a,n),t.stateNode=e,dr(t))}return ut(t),null;case 5:if(Mu(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return ut(t),null}if(s=ka.current,Fs(t))i0(t);else{var i=zd(Pr.current);switch(s){case 1:s=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":s=i.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?s.multiple=!0:a.size&&(s.size=a.size);break;default:s=typeof a.is=="string"?i.createElement(r,{is:a.is}):i.createElement(r)}}s[Qt]=t,s[hn]=a;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)s.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=s;e:switch(nn(s,r,a),r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&dr(t)}}return ut(t),uh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&dr(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(q(166));if(e=Pr.current,Fs(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Jt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Qt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||NS(e.nodeValue,n)),e||Ur(t,!0)}else e=zd(e).createTextNode(a),e[Qt]=t,t.stateNode=e}return ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Fs(t),n!==null){if(e===null){if(!a)throw Error(q(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(557));e[Qt]=t}else Io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else n=vp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(On(t),t):(On(t),null);if(t.flags&128)throw Error(q(558))}return ut(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fs(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(q(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(q(317));r[Qt]=t}else Io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),r=!1}else r=vp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(On(t),t):(On(t),null)}return On(t),t.flags&128?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==r&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yd(t,t.updateQueue),ut(t),null);case 4:return As(),e===null&&Mh(t.stateNode.containerInfo),ut(t),null;case 10:return ir(t.type),ut(t),null;case 19:if($t(yt),a=t.memoizedState,a===null)return ut(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)Ul(a,!1);else{if(xt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ld(e),s!==null){for(t.flags|=128,Ul(a,!1),e=s.updateQueue,t.updateQueue=e,yd(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)n0(n,e),n=n.sibling;return st(yt,yt.current&1|2),Ue&&or(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&En()>Ad&&(t.flags|=128,r=!0,Ul(a,!1),t.lanes=4194304)}else{if(!r)if(e=ld(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,yd(t,e),Ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Ue)return ut(t),null}else 2*En()-a.renderingStartTime>Ad&&n!==536870912&&(t.flags|=128,r=!0,Ul(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(e=a.last,e!==null?e.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=En(),e.sibling=null,n=yt.current,st(yt,r?n&1|2:n&1),Ue&&or(t,a.treeForkCount),e):(ut(t),null);case 22:case 23:return On(t),Dp(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),n=t.updateQueue,n!==null&&yd(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&$t(Uo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ir(Ct),ut(t),null;case 25:return null;case 30:return null}throw Error(q(156,t.tag))}function G4(e,t){switch(xp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(Ct),As(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Mu(t),null;case 31:if(t.memoizedState!==null){if(On(t),t.alternate===null)throw Error(q(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(On(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(yt),null;case 4:return As(),null;case 10:return ir(t.type),null;case 22:case 23:return On(t),Dp(),e!==null&&$t(Uo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(Ct),null;case 25:return null;default:return null}}function T1(e,t){switch(xp(t),t.tag){case 3:ir(Ct),As();break;case 26:case 27:case 5:Mu(t);break;case 4:As();break;case 31:t.memoizedState!==null&&On(t);break;case 13:On(t);break;case 19:$t(yt);break;case 10:ir(t.type);break;case 22:case 23:On(t),Dp(),e!==null&&$t(Uo);break;case 24:ir(Ct)}}function Hl(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var s=n.create,i=n.inst;a=s(),i.destroy=a}n=n.next}while(n!==r)}}catch(l){Qe(t,t.return,l)}}function qr(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var s=r.next;a=s;do{if((a.tag&e)===e){var i=a.inst,l=i.destroy;if(l!==void 0){i.destroy=void 0,r=t;var c=n,d=l;try{d()}catch(m){Qe(r,c,m)}}}a=a.next}while(a!==s)}}catch(m){Qe(t,t.return,m)}}function R1(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{v0(t,n)}catch(a){Qe(e,e.return,a)}}}function k1(e,t,n){n.props=Yo(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Qe(e,t,a)}}function Fl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){Qe(e,t,r)}}function Oa(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){Qe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function M1(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){Qe(e,e.return,r)}}function dh(e,t,n){try{var a=e.stateNode;m3(a,e.type,n,t),a[hn]=t}catch(r){Qe(e,e.return,r)}}function D1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&to(e.type)||e.tag===4}function fh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&to(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mh(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nr));else if(a!==4&&(a===27&&to(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(mh(e,t,n),e=e.sibling;e!==null;)mh(e,t,n),e=e.sibling}function Sd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&to(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Sd(e,t,n),e=e.sibling;e!==null;)Sd(e,t,n),e=e.sibling}function O1(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);nn(t,a,n),t[Qt]=e,t[hn]=n}catch(s){Qe(e,e.return,s)}}var fr=!1,Et=!1,wh=!1,P1=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function Y4(e,t){if(e=e.containerInfo,Ph=Fd,e=Ky(e),ip(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,s=a.focusNode;a=a.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,d=0,m=0,f=e,w=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(l=i+r),f!==s||a!==0&&f.nodeType!==3||(c=i+a),f.nodeType===3&&(i+=f.nodeValue.length),(p=f.firstChild)!==null;)w=f,f=p;for(;;){if(f===e)break t;if(w===n&&++d===r&&(l=i),w===s&&++m===a&&(c=i),(p=f.nextSibling)!==null)break;f=w,w=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(zh={focusedElem:e,selectionRange:n},Fd=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,r=s.memoizedProps,s=s.memoizedState,a=n.stateNode;try{var x=Yo(n.type,r);e=a.getSnapshotBeforeUpdate(x,s),a.__reactInternalSnapshotBeforeUpdate=e}catch(b){Qe(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)$h(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":$h(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(q(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function z1(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:wr(e,n),a&4&&Hl(5,n);break;case 1:if(wr(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Qe(n,n.return,i)}else{var r=Yo(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Qe(n,n.return,i)}}a&64&&R1(n),a&512&&Fl(n,n.return);break;case 3:if(wr(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{v0(e,t)}catch(i){Qe(n,n.return,i)}}break;case 27:t===null&&a&4&&O1(n);case 26:case 5:wr(e,n),t===null&&a&4&&M1(n),a&512&&Fl(n,n.return);break;case 12:wr(e,n);break;case 31:wr(e,n),a&4&&$1(e,n);break;case 13:wr(e,n),a&4&&B1(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=t3.bind(null,n),y3(e,n))));break;case 22:if(a=n.memoizedState!==null||fr,!a){t=t!==null&&t.memoizedState!==null||Et,r=fr;var s=Et;fr=a,(Et=t)&&!s?pr(e,n,(n.subtreeFlags&8772)!==0):wr(e,n),fr=r,Et=s}break;case 30:break;default:wr(e,n)}}function L1(e){var t=e.alternate;t!==null&&(e.alternate=null,L1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vw(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,xn=!1;function mr(e,t,n){for(n=n.child;n!==null;)I1(e,t,n),n=n.sibling}function I1(e,t,n){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 26:Et||Oa(n,t),mr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Et||Oa(n,t);var a=ft,r=xn;to(n.type)&&(ft=n.stateNode,xn=!1),mr(e,t,n),Ql(n.stateNode),ft=a,xn=r;break;case 5:Et||Oa(n,t);case 6:if(a=ft,r=xn,ft=null,mr(e,t,n),ft=a,xn=r,ft!==null)if(xn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(s){Qe(n,t,s)}else try{ft.removeChild(n.stateNode)}catch(s){Qe(n,t,s)}break;case 18:ft!==null&&(xn?(e=ft,RS(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ui(e)):RS(ft,n.stateNode));break;case 4:a=ft,r=xn,ft=n.stateNode.containerInfo,xn=!0,mr(e,t,n),ft=a,xn=r;break;case 0:case 11:case 14:case 15:qr(2,n,t),Et||qr(4,n,t),mr(e,t,n);break;case 1:Et||(Oa(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&k1(n,t,a)),mr(e,t,n);break;case 21:mr(e,t,n);break;case 22:Et=(a=Et)||n.memoizedState!==null,mr(e,t,n),Et=a;break;default:mr(e,t,n)}}function $1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ui(e)}catch(n){Qe(t,t.return,n)}}}function B1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ui(e)}catch(n){Qe(t,t.return,n)}}function K4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new P1),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new P1),t;default:throw Error(q(435,e.tag))}}function jd(e,t){var n=K4(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var r=n3.bind(null,e,a);a.then(r,r)}})}function bn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],s=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 27:if(to(l.type)){ft=l.stateNode,xn=!1;break e}break;case 5:ft=l.stateNode,xn=!1;break e;case 3:case 4:ft=l.stateNode.containerInfo,xn=!0;break e}l=l.return}if(ft===null)throw Error(q(160));I1(s,i,r),ft=null,xn=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)U1(t,e),t=t.sibling}var xa=null;function U1(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bn(t,e),vn(e),a&4&&(qr(3,e,e.return),Hl(3,e),qr(5,e,e.return));break;case 1:bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),a&64&&fr&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=xa;if(bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),a&4){var s=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":s=r.getElementsByTagName("title")[0],(!s||s[hl]||s[Qt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(a),r.head.insertBefore(s,r.querySelector("head > title"))),nn(s,a,n),s[Qt]=e,Bt(s),a=s;break e;case"link":var i=US("link","href",r).get(a+(n.href||""));if(i){for(var l=0;l<i.length;l++)if(s=i[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(l,1);break t}}s=r.createElement(a),nn(s,a,n),r.head.appendChild(s);break;case"meta":if(i=US("meta","content",r).get(a+(n.content||""))){for(l=0;l<i.length;l++)if(s=i[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(l,1);break t}}s=r.createElement(a),nn(s,a,n),r.head.appendChild(s);break;default:throw Error(q(468,a))}s[Qt]=e,Bt(s),a=s}e.stateNode=a}else HS(r,e.type,e.stateNode);else e.stateNode=BS(r,a,e.memoizedProps);else s!==a?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,a===null?HS(r,e.type,e.stateNode):BS(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&dh(e,e.memoizedProps,n.memoizedProps)}break;case 27:bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),n!==null&&a&4&&dh(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bn(t,e),vn(e),a&512&&(Et||n===null||Oa(n,n.return)),e.flags&32){r=e.stateNode;try{Ds(r,"")}catch(x){Qe(e,e.return,x)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,dh(e,r,n!==null?n.memoizedProps:r)),a&1024&&(wh=!0);break;case 6:if(bn(t,e),vn(e),a&4){if(e.stateNode===null)throw Error(q(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){Qe(e,e.return,x)}}break;case 3:if($d=null,r=xa,xa=Ld(t.containerInfo),bn(t,e),xa=r,vn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(x){Qe(e,e.return,x)}wh&&(wh=!1,H1(e));break;case 4:a=xa,xa=Ld(e.stateNode.containerInfo),bn(t,e),vn(e),xa=a;break;case 12:bn(t,e),vn(e);break;case 31:bn(t,e),vn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 13:bn(t,e),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Cd=En()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=fr,m=Et;if(fr=d||r,Et=m||c,bn(t,e),Et=m,fr=d,vn(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||fr||Et||Ko(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(s=c.stateNode,r)i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,w=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(x){Qe(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){Qe(c,c.return,x)}}}else if(t.tag===18){if(n===null){c=t;try{var p=c.stateNode;r?kS(p,!0):kS(c.stateNode,!1)}catch(x){Qe(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,jd(e,n))));break;case 19:bn(t,e),vn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,jd(e,a)));break;case 30:break;case 21:break;default:bn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(D1(a)){n=a;break}a=a.return}if(n==null)throw Error(q(160));switch(n.tag){case 27:var r=n.stateNode,s=fh(e);Sd(e,s,r);break;case 5:var i=n.stateNode;n.flags&32&&(Ds(i,""),n.flags&=-33);var l=fh(e);Sd(e,l,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=fh(e);mh(e,d,c);break;default:throw Error(q(161))}}catch(m){Qe(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function H1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;H1(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)z1(e,t.alternate,t),t=t.sibling}function Ko(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qr(4,t,t.return),Ko(t);break;case 1:Oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&k1(t,t.return,n),Ko(t);break;case 27:Ql(t.stateNode);case 26:case 5:Oa(t,t.return),Ko(t);break;case 22:t.memoizedState===null&&Ko(t);break;case 30:Ko(t);break;default:Ko(t)}e=e.sibling}}function pr(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,r=e,s=t,i=s.flags;switch(s.tag){case 0:case 11:case 15:pr(r,s,n),Hl(4,s);break;case 1:if(pr(r,s,n),a=s,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){Qe(a,a.return,d)}if(a=s,r=a.updateQueue,r!==null){var l=a.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)b0(c[r],l)}catch(d){Qe(a,a.return,d)}}n&&i&64&&R1(s),Fl(s,s.return);break;case 27:O1(s);case 26:case 5:pr(r,s,n),n&&a===null&&i&4&&M1(s),Fl(s,s.return);break;case 12:pr(r,s,n);break;case 31:pr(r,s,n),n&&i&4&&$1(r,s);break;case 13:pr(r,s,n),n&&i&4&&B1(r,s);break;case 22:s.memoizedState===null&&pr(r,s,n),Fl(s,s.return);break;case 30:break;default:pr(r,s,n)}t=t.sibling}}function ph(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Tl(n))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tl(e))}function ba(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)F1(e,t,n,a),t=t.sibling}function F1(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,n,a),r&2048&&Hl(9,t);break;case 1:ba(e,t,n,a);break;case 3:ba(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tl(e)));break;case 12:if(r&2048){ba(e,t,n,a),e=t.stateNode;try{var s=t.memoizedProps,i=s.id,l=s.onPostCommit;typeof l=="function"&&l(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Qe(t,t.return,c)}}else ba(e,t,n,a);break;case 31:ba(e,t,n,a);break;case 13:ba(e,t,n,a);break;case 23:break;case 22:s=t.stateNode,i=t.alternate,t.memoizedState!==null?s._visibility&2?ba(e,t,n,a):Vl(e,t):s._visibility&2?ba(e,t,n,a):(s._visibility|=2,Js(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),r&2048&&ph(i,t);break;case 24:ba(e,t,n,a),r&2048&&hh(t.alternate,t);break;default:ba(e,t,n,a)}}function Js(e,t,n,a,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,i=t,l=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:Js(s,i,l,c,r),Hl(8,i);break;case 23:break;case 22:var m=i.stateNode;i.memoizedState!==null?m._visibility&2?Js(s,i,l,c,r):Vl(s,i):(m._visibility|=2,Js(s,i,l,c,r)),r&&d&2048&&ph(i.alternate,i);break;case 24:Js(s,i,l,c,r),r&&d&2048&&hh(i.alternate,i);break;default:Js(s,i,l,c,r)}t=t.sibling}}function Vl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Vl(n,a),r&2048&&ph(a.alternate,a);break;case 24:Vl(n,a),r&2048&&hh(a.alternate,a);break;default:Vl(n,a)}t=t.sibling}}var Gl=8192;function ei(e,t,n){if(e.subtreeFlags&Gl)for(e=e.child;e!==null;)V1(e,t,n),e=e.sibling}function V1(e,t,n){switch(e.tag){case 26:ei(e,t,n),e.flags&Gl&&e.memoizedState!==null&&D3(n,xa,e.memoizedState,e.memoizedProps);break;case 5:ei(e,t,n);break;case 3:case 4:var a=xa;xa=Ld(e.stateNode.containerInfo),ei(e,t,n),xa=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Gl,Gl=16777216,ei(e,t,n),Gl=a):ei(e,t,n));break;default:ei(e,t,n)}}function G1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ut=a,K1(a,e)}G1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Y1(e),e=e.sibling}function Y1(e){switch(e.tag){case 0:case 11:case 15:Yl(e),e.flags&2048&&qr(9,e,e.return);break;case 3:Yl(e);break;case 12:Yl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nd(e)):Yl(e);break;default:Yl(e)}}function Nd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ut=a,K1(a,e)}G1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qr(8,t,t.return),Nd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nd(t));break;default:Nd(t)}e=e.sibling}}function K1(e,t){for(;Ut!==null;){var n=Ut;switch(n.tag){case 0:case 11:case 15:qr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Tl(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Ut=a;else e:for(n=e;Ut!==null;){a=Ut;var r=a.sibling,s=a.return;if(L1(a),a===n){Ut=null;break e}if(r!==null){r.return=s,Ut=r;break e}Ut=s}}}var q4={getCacheForType:function(e){var t=en(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return en(Ct).controller.signal}},X4=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ot=null,Le=null,Be=0,Ze=0,Pn=null,Xr=!1,ti=!1,gh=!1,hr=0,xt=0,Wr=0,qo=0,xh=0,zn=0,ni=0,Kl=null,yn=null,bh=!1,Cd=0,q1=0,Ad=1/0,_d=null,Zr=null,Ot=0,Qr=null,ai=null,gr=0,vh=0,yh=null,X1=null,ql=0,Sh=null;function Ln(){return Xe&2&&Be!==0?Be&-Be:Ae.T!==null?Eh():dy()}function W1(){if(zn===0)if(!(Be&536870912)||Ue){var e=Pu;Pu<<=1,!(Pu&3932160)&&(Pu=262144),zn=e}else zn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),zn}function Sn(e,t,n){(e===ot&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(ri(e,0),Jr(e,Be,zn,!1)),pl(e,n),(!(Xe&2)||e!==ot)&&(e===ot&&(!(Xe&2)&&(qo|=n),xt===4&&Jr(e,Be,zn,!1)),Pa(e))}function Z1(e,t,n){if(Xe&6)throw Error(q(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||wl(e,t),r=a?Q4(e,t):Nh(e,t,!0),s=a;do{if(r===0){ti&&!a&&Jr(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!W4(n)){r=Nh(e,t,!1),s=!1;continue}if(r===2){if(s=t,e.errorRecoveryDisabledLanes&s)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var l=e;r=Kl;var c=l.current.memoizedState.isDehydrated;if(c&&(ri(l,i).flags|=256),i=Nh(l,i,!1),i!==2){if(gh&&!c){l.errorRecoveryDisabledLanes|=s,qo|=s,r=4;break e}s=yn,yn=r,s!==null&&(yn===null?yn=s:yn.push.apply(yn,s))}r=i}if(s=!1,r!==2)continue}}if(r===1){ri(e,0),Jr(e,t,0,!0);break}e:{switch(a=e,s=r,s){case 0:case 1:throw Error(q(345));case 4:if((t&4194048)!==t)break;case 6:Jr(a,t,zn,!Xr);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(q(329))}if((t&62914560)===t&&(r=Cd+300-En(),10<r)){if(Jr(a,t,zn,!Xr),Lu(a,0,!0)!==0)break e;gr=t,a.timeoutHandle=ES(Q1.bind(null,a,n,yn,_d,bh,t,zn,qo,ni,Xr,s,"Throttled",-0,0),r);break e}Q1(a,n,yn,_d,bh,t,zn,qo,ni,Xr,s,null,-0,0)}}break}while(!0);Pa(e)}function Q1(e,t,n,a,r,s,i,l,c,d,m,f,w,p){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nr},V1(t,s,f);var x=(s&62914560)===s?Cd-En():(s&4194048)===s?q1-En():0;if(x=O3(f,x),x!==null){gr=s,e.cancelPendingCommit=x(sS.bind(null,e,t,s,n,a,r,i,l,c,m,f,null,w,p)),Jr(e,s,i,!d);return}}sS(e,t,s,n,a,r,i,l,c)}function W4(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],s=r.getSnapshot;r=r.value;try{if(!kn(s(),r))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 Jr(e,t,n,a){t&=~xh,t&=~qo,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var s=31-Rn(r),i=1<<s;a[s]=-1,r&=~i}n!==0&&ly(e,n,t)}function Ed(){return Xe&6?!0:(Xl(0),!1)}function jh(){if(Le!==null){if(Ze===0)var e=Le.return;else e=Le,sr=$o=null,$p(e),qs=null,kl=0,e=Le;for(;e!==null;)T1(e.alternate,e),e=e.return;Le=null}}function ri(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,h3(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gr=0,jh(),ot=e,Le=n=rr(e.current,null),Be=t,Ze=0,Pn=null,Xr=!1,ti=wl(e,t),gh=!1,ni=zn=xh=qo=Wr=xt=0,yn=Kl=null,bh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-Rn(a),s=1<<r;t|=e[r],a&=~s}return hr=t,Xu(),n}function J1(e,t){ke=null,Ae.H=$l,t===Ks||t===ad?(t=p0(),Ze=3):t===_p?(t=p0(),Ze=4):Ze=t===th?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pn=t,Le===null&&(xt=1,gd(e,ea(t,e.current)))}function eS(){var e=Dn.current;return e===null?!0:(Be&4194048)===Be?ra===null:(Be&62914560)===Be||Be&536870912?e===ra:!1}function tS(){var e=Ae.H;return Ae.H=$l,e===null?$l:e}function nS(){var e=Ae.A;return Ae.A=q4,e}function Td(){xt=4,Xr||(Be&4194048)!==Be&&Dn.current!==null||(ti=!0),!(Wr&134217727)&&!(qo&134217727)||ot===null||Jr(ot,Be,zn,!1)}function Nh(e,t,n){var a=Xe;Xe|=2;var r=tS(),s=nS();(ot!==e||Be!==t)&&(_d=null,ri(e,t)),t=!1;var i=xt;e:do try{if(Ze!==0&&Le!==null){var l=Le,c=Pn;switch(Ze){case 8:jh(),i=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(t=!0);var d=Ze;if(Ze=0,Pn=null,oi(e,l,c,d),n&&ti){i=0;break e}break;default:d=Ze,Ze=0,Pn=null,oi(e,l,c,d)}}Z4(),i=xt;break}catch(m){J1(e,m)}while(!0);return t&&e.shellSuspendCounter++,sr=$o=null,Xe=a,Ae.H=r,Ae.A=s,Le===null&&(ot=null,Be=0,Xu()),i}function Z4(){for(;Le!==null;)aS(Le)}function Q4(e,t){var n=Xe;Xe|=2;var a=tS(),r=nS();ot!==e||Be!==t?(_d=null,Ad=En()+500,ri(e,t)):ti=wl(e,t);e:do try{if(Ze!==0&&Le!==null){t=Le;var s=Pn;t:switch(Ze){case 1:Ze=0,Pn=null,oi(e,t,s,1);break;case 2:case 9:if(m0(s)){Ze=0,Pn=null,rS(t);break}t=function(){Ze!==2&&Ze!==9||ot!==e||(Ze=7),Pa(e)},s.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:m0(s)?(Ze=0,Pn=null,rS(t)):(Ze=0,Pn=null,oi(e,t,s,7));break;case 5:var i=null;switch(Le.tag){case 26:i=Le.memoizedState;case 5:case 27:var l=Le;if(i?FS(i):l.stateNode.complete){Ze=0,Pn=null;var c=l.sibling;if(c!==null)Le=c;else{var d=l.return;d!==null?(Le=d,Rd(d)):Le=null}break t}}Ze=0,Pn=null,oi(e,t,s,5);break;case 6:Ze=0,Pn=null,oi(e,t,s,6);break;case 8:jh(),xt=6;break e;default:throw Error(q(462))}}J4();break}catch(m){J1(e,m)}while(!0);return sr=$o=null,Ae.H=a,Ae.A=r,Xe=n,Le!==null?0:(ot=null,Be=0,Xu(),xt)}function J4(){for(;Le!==null&&!S5();)aS(Le)}function aS(e){var t=_1(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?Rd(e):Le=t}function rS(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=y1(n,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=y1(n,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:$p(t);default:T1(n,t),t=Le=n0(t,hr),t=_1(n,t,hr)}e.memoizedProps=e.pendingProps,t===null?Rd(e):Le=t}function oi(e,t,n,a){sr=$o=null,$p(t),qs=null,kl=0;var r=t.return;try{if(U4(e,r,t,n,Be)){xt=1,gd(e,ea(n,e.current)),Le=null;return}}catch(s){if(r!==null)throw Le=r,s;xt=1,gd(e,ea(n,e.current)),Le=null;return}t.flags&32768?(Ue||a===1?e=!0:ti||Be&536870912?e=!1:(Xr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Dn.current,a!==null&&a.tag===13&&(a.flags|=16384))),oS(t,e)):Rd(t)}function Rd(e){var t=e;do{if(t.flags&32768){oS(t,Xr);return}e=t.return;var n=V4(t.alternate,t,hr);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);xt===0&&(xt=5)}function oS(e,t){do{var n=G4(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);xt=6,Le=null}function sS(e,t,n,a,r,s,i,l,c){e.cancelPendingCommit=null;do kd();while(Ot!==0);if(Xe&6)throw Error(q(327));if(t!==null){if(t===e.current)throw Error(q(177));if(s=t.lanes|t.childLanes,s|=fp,M5(e,n,s,i,l,c),e===ot&&(Le=ot=null,Be=0),ai=t,Qr=e,gr=n,vh=s,yh=r,X1=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,a3(Du,function(){return dS(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=Ae.T,Ae.T=null,r=qe.p,qe.p=2,i=Xe,Xe|=4;try{Y4(e,t,n)}finally{Xe=i,qe.p=r,Ae.T=a}}Ot=1,iS(),lS(),cS()}}function iS(){if(Ot===1){Ot=0;var e=Qr,t=ai,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ae.T,Ae.T=null;var a=qe.p;qe.p=2;var r=Xe;Xe|=4;try{U1(t,e);var s=zh,i=Ky(e.containerInfo),l=s.focusedElem,c=s.selectionRange;if(i!==l&&l&&l.ownerDocument&&Yy(l.ownerDocument.documentElement,l)){if(c!==null&&ip(l)){var d=c.start,m=c.end;if(m===void 0&&(m=d),"selectionStart"in l)l.selectionStart=d,l.selectionEnd=Math.min(m,l.value.length);else{var f=l.ownerDocument||document,w=f&&f.defaultView||window;if(w.getSelection){var p=w.getSelection(),x=l.textContent.length,b=Math.min(c.start,x),y=c.end===void 0?b:Math.min(c.end,x);!p.extend&&b>y&&(i=y,y=b,b=i);var h=Gy(l,b),g=Gy(l,y);if(h&&g&&(p.rangeCount!==1||p.anchorNode!==h.node||p.anchorOffset!==h.offset||p.focusNode!==g.node||p.focusOffset!==g.offset)){var v=f.createRange();v.setStart(h.node,h.offset),p.removeAllRanges(),b>y?(p.addRange(v),p.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),p.addRange(v))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Fd=!!Ph,zh=Ph=null}finally{Xe=r,qe.p=a,Ae.T=n}}e.current=t,Ot=2}}function lS(){if(Ot===2){Ot=0;var e=Qr,t=ai,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ae.T,Ae.T=null;var a=qe.p;qe.p=2;var r=Xe;Xe|=4;try{z1(e,t.alternate,t)}finally{Xe=r,qe.p=a,Ae.T=n}}Ot=3}}function cS(){if(Ot===4||Ot===3){Ot=0,j5();var e=Qr,t=ai,n=gr,a=X1;t.subtreeFlags&10256||t.flags&10256?Ot=5:(Ot=0,ai=Qr=null,uS(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Zr=null),Hw(n),t=t.stateNode,Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(ml,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Ae.T,r=qe.p,qe.p=2,Ae.T=null;try{for(var s=e.onRecoverableError,i=0;i<a.length;i++){var l=a[i];s(l.value,{componentStack:l.stack})}}finally{Ae.T=t,qe.p=r}}gr&3&&kd(),Pa(e),r=e.pendingLanes,n&261930&&r&42?e===Sh?ql++:(ql=0,Sh=e):ql=0,Xl(0)}}function uS(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Tl(t)))}function kd(){return iS(),lS(),cS(),dS()}function dS(){if(Ot!==5)return!1;var e=Qr,t=vh;vh=0;var n=Hw(gr),a=Ae.T,r=qe.p;try{qe.p=32>n?32:n,Ae.T=null,n=yh,yh=null;var s=Qr,i=gr;if(Ot=0,ai=Qr=null,gr=0,Xe&6)throw Error(q(331));var l=Xe;if(Xe|=4,Y1(s.current),F1(s,s.current,i,n),Xe=l,Xl(0,!1),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(ml,s)}catch{}return!0}finally{qe.p=r,Ae.T=a,uS(e,t)}}function fS(e,t,n){t=ea(n,t),t=eh(e.stateNode,t,2),e=Gr(e,t,2),e!==null&&(pl(e,2),Pa(e))}function Qe(e,t,n){if(e.tag===3)fS(e,e,n);else for(;t!==null;){if(t.tag===3){fS(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Zr===null||!Zr.has(a))){e=ea(n,e),n=m1(2),a=Gr(t,n,2),a!==null&&(w1(n,a,t,e),pl(a,2),Pa(a));break}}t=t.return}}function Ch(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new X4;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(gh=!0,r.add(n),e=e3.bind(null,e,t,n),t.then(e,e))}function e3(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&(Be&n)===n&&(xt===4||xt===3&&(Be&62914560)===Be&&300>En()-Cd?!(Xe&2)&&ri(e,0):xh|=n,ni===Be&&(ni=0)),Pa(e)}function mS(e,t){t===0&&(t=iy()),e=zo(e,t),e!==null&&(pl(e,t),Pa(e))}function t3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mS(e,n)}function n3(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(q(314))}a!==null&&a.delete(t),mS(e,n)}function a3(e,t){return Iw(e,t)}var Md=null,si=null,Ah=!1,Dd=!1,_h=!1,eo=0;function Pa(e){e!==si&&e.next===null&&(si===null?Md=si=e:si=si.next=e),Dd=!0,Ah||(Ah=!0,o3())}function Xl(e,t){if(!_h&&Dd){_h=!0;do for(var n=!1,a=Md;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var s=0;else{var i=a.suspendedLanes,l=a.pingedLanes;s=(1<<31-Rn(42|e)+1)-1,s&=r&~(i&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,gS(a,s))}else s=Be,s=Lu(a,a===ot?s:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(s&3)||wl(a,s)||(n=!0,gS(a,s));a=a.next}while(n);_h=!1}}function r3(){wS()}function wS(){Dd=Ah=!1;var e=0;eo!==0&&p3()&&(e=eo);for(var t=En(),n=null,a=Md;a!==null;){var r=a.next,s=pS(a,t);s===0?(a.next=null,n===null?Md=r:n.next=r,r===null&&(si=n)):(n=a,(e!==0||s&3)&&(Dd=!0)),a=r}Ot!==0&&Ot!==5||Xl(e),eo!==0&&(eo=0)}function pS(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var i=31-Rn(s),l=1<<i,c=r[i];c===-1?(!(l&n)||l&a)&&(r[i]=k5(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}if(t=ot,n=Be,n=Lu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&$w(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||wl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&$w(a),Hw(n)){case 2:case 8:n=oy;break;case 32:n=Du;break;case 268435456:n=sy;break;default:n=Du}return a=hS.bind(null,e),n=Iw(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&$w(a),e.callbackPriority=2,e.callbackNode=null,2}function hS(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(kd()&&e.callbackNode!==n)return null;var a=Be;return a=Lu(e,e===ot?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Z1(e,a,t),pS(e,En()),e.callbackNode!=null&&e.callbackNode===n?hS.bind(null,e):null)}function gS(e,t){if(kd())return null;Z1(e,t,!0)}function o3(){g3(function(){Xe&6?Iw(ry,r3):wS()})}function Eh(){if(eo===0){var e=Gs;e===0&&(e=Ou,Ou<<=1,!(Ou&261888)&&(Ou=256)),eo=e}return eo}function xS(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uu(""+e)}function bS(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function s3(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var s=xS((r[hn]||null).action),i=a.submitter;i&&(t=(t=i[hn]||null)?xS(t.formAction):i.getAttribute("formAction"),t!==null&&(s=t,i=null));var l=new Gu("action","action",null,a,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(eo!==0){var c=i?bS(r,i):new FormData(r);qp(n,{pending:!0,data:c,method:r.method,action:s},null,c)}}else typeof s=="function"&&(l.preventDefault(),c=i?bS(r,i):new FormData(r),qp(n,{pending:!0,data:c,method:r.method,action:s},s,c))},currentTarget:r}]})}}for(var Th=0;Th<dp.length;Th++){var Rh=dp[Th],i3=Rh.toLowerCase(),l3=Rh[0].toUpperCase()+Rh.slice(1);ga(i3,"on"+l3)}ga(Wy,"onAnimationEnd"),ga(Zy,"onAnimationIteration"),ga(Qy,"onAnimationStart"),ga("dblclick","onDoubleClick"),ga("focusin","onFocus"),ga("focusout","onBlur"),ga(N4,"onTransitionRun"),ga(C4,"onTransitionStart"),ga(A4,"onTransitionCancel"),ga(Jy,"onTransitionEnd"),ks("onMouseEnter",["mouseout","mouseover"]),ks("onMouseLeave",["mouseout","mouseover"]),ks("onPointerEnter",["pointerout","pointerover"]),ks("onPointerLeave",["pointerout","pointerover"]),Mo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),c3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wl));function vS(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var s=void 0;if(t)for(var i=a.length-1;0<=i;i--){var l=a[i],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=d;try{s(r)}catch(m){qu(m)}r.currentTarget=null,s=c}else for(i=0;i<a.length;i++){if(l=a[i],c=l.instance,d=l.currentTarget,l=l.listener,c!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=d;try{s(r)}catch(m){qu(m)}r.currentTarget=null,s=c}}}}function Ie(e,t){var n=t[Fw];n===void 0&&(n=t[Fw]=new Set);var a=e+"__bubble";n.has(a)||(yS(t,e,2,!1),n.add(a))}function kh(e,t,n){var a=0;t&&(a|=4),yS(n,e,a,t)}var Od="_reactListening"+Math.random().toString(36).slice(2);function Mh(e){if(!e[Od]){e[Od]=!0,wy.forEach(function(n){n!=="selectionchange"&&(c3.has(n)||kh(n,!1,e),kh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,kh("selectionchange",!1,t))}}function yS(e,t,n,a){switch(WS(t)){case 2:var r=L3;break;case 8:r=I3;break;default:r=Kh}n=r.bind(null,t,n,e),r=void 0,!Qw||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Dh(e,t,n,a,r){var s=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var l=a.stateNode.containerInfo;if(l===r)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;l!==null;){if(i=Es(l),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=s=i;continue e}l=l.parentNode}}a=a.return}Ay(function(){var d=s,m=Ww(n),f=[];e:{var w=e0.get(e);if(w!==void 0){var p=Gu,x=e;switch(e){case"keypress":if(Fu(n)===0)break e;case"keydown":case"keyup":p=n4;break;case"focusin":x="focus",p=np;break;case"focusout":x="blur",p=np;break;case"beforeblur":case"afterblur":p=np;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=V5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=o4;break;case Wy:case Zy:case Qy:p=K5;break;case Jy:p=i4;break;case"scroll":case"scrollend":p=H5;break;case"wheel":p=c4;break;case"copy":case"cut":case"paste":p=X5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ky;break;case"toggle":case"beforetoggle":p=d4}var b=(t&4)!==0,y=!b&&(e==="scroll"||e==="scrollend"),h=b?w!==null?w+"Capture":null:w;b=[];for(var g=d,v;g!==null;){var S=g;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||h===null||(S=xl(g,h),S!=null&&b.push(Zl(g,S,v))),y)break;g=g.return}0<b.length&&(w=new p(w,x,null,n,m),f.push({event:w,listeners:b}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",w&&n!==Xw&&(x=n.relatedTarget||n.fromElement)&&(Es(x)||x[_s]))break e;if((p||w)&&(w=m.window===m?m:(w=m.ownerDocument)?w.defaultView||w.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=d,x=x?Es(x):null,x!==null&&(y=ll(x),b=x.tag,x!==y||b!==5&&b!==27&&b!==6)&&(x=null)):(p=null,x=d),p!==x)){if(b=Ty,S="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=ky,S="onPointerLeave",h="onPointerEnter",g="pointer"),y=p==null?w:gl(p),v=x==null?w:gl(x),w=new b(S,g+"leave",p,n,m),w.target=y,w.relatedTarget=v,S=null,Es(m)===d&&(b=new b(h,g+"enter",x,n,m),b.target=v,b.relatedTarget=y,S=b),y=S,p&&x)t:{for(b=u3,h=p,g=x,v=0,S=h;S;S=b(S))v++;S=0;for(var N=g;N;N=b(N))S++;for(;0<v-S;)h=b(h),v--;for(;0<S-v;)g=b(g),S--;for(;v--;){if(h===g||g!==null&&h===g.alternate){b=h;break t}h=b(h),g=b(g)}b=null}else b=null;p!==null&&SS(f,w,p,b,!1),x!==null&&y!==null&&SS(f,y,x,b,!0)}}e:{if(w=d?gl(d):window,p=w.nodeName&&w.nodeName.toLowerCase(),p==="select"||p==="input"&&w.type==="file")var A=$y;else if(Ly(w))if(By)A=y4;else{A=b4;var j=x4}else p=w.nodeName,!p||p.toLowerCase()!=="input"||w.type!=="checkbox"&&w.type!=="radio"?d&&qw(d.elementType)&&(A=$y):A=v4;if(A&&(A=A(e,d))){Iy(f,A,n,m);break e}j&&j(e,w,d),e==="focusout"&&d&&w.type==="number"&&d.memoizedProps.value!=null&&Kw(w,"number",w.value)}switch(j=d?gl(d):window,e){case"focusin":(Ly(j)||j.contentEditable==="true")&&(Ls=j,lp=d,Al=null);break;case"focusout":Al=lp=Ls=null;break;case"mousedown":cp=!0;break;case"contextmenu":case"mouseup":case"dragend":cp=!1,qy(f,n,m);break;case"selectionchange":if(j4)break;case"keydown":case"keyup":qy(f,n,m)}var C;if(rp)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else zs?Py(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(My&&n.locale!=="ko"&&(zs||R!=="onCompositionStart"?R==="onCompositionEnd"&&zs&&(C=_y()):(Ir=m,Jw="value"in Ir?Ir.value:Ir.textContent,zs=!0)),j=Pd(d,R),0<j.length&&(R=new Ry(R,e,null,n,m),f.push({event:R,listeners:j}),C?R.data=C:(C=zy(n),C!==null&&(R.data=C)))),(C=m4?w4(e,n):p4(e,n))&&(R=Pd(d,"onBeforeInput"),0<R.length&&(j=new Ry("onBeforeInput","beforeinput",null,n,m),f.push({event:j,listeners:R}),j.data=C)),s3(f,e,d,n,m)}vS(f,t)})}function Zl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pd(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=xl(e,n),r!=null&&a.unshift(Zl(e,r,s)),r=xl(e,t),r!=null&&a.push(Zl(e,r,s))),e.tag===3)return a;e=e.return}return[]}function u3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function SS(e,t,n,a,r){for(var s=t._reactName,i=[];n!==null&&n!==a;){var l=n,c=l.alternate,d=l.stateNode;if(l=l.tag,c!==null&&c===a)break;l!==5&&l!==26&&l!==27||d===null||(c=d,r?(d=xl(n,s),d!=null&&i.unshift(Zl(n,d,c))):r||(d=xl(n,s),d!=null&&i.push(Zl(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var d3=/\r\n?/g,f3=/\u0000|\uFFFD/g;function jS(e){return(typeof e=="string"?e:""+e).replace(d3,` 49 `).replace(f3,"")}function NS(e,t){return t=jS(t),jS(e)===t}function tt(e,t,n,a,r,s){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ds(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ds(e,""+a);break;case"className":$u(e,"class",a);break;case"tabIndex":$u(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":$u(e,n,a);break;case"style":Ny(e,a,s);break;case"data":if(t!=="object"){$u(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uu(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(t!=="input"&&tt(e,t,"name",r.name,r,null),tt(e,t,"formEncType",r.formEncType,r,null),tt(e,t,"formMethod",r.formMethod,r,null),tt(e,t,"formTarget",r.formTarget,r,null)):(tt(e,t,"encType",r.encType,r,null),tt(e,t,"method",r.method,r,null),tt(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uu(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=nr);break;case"onScroll":a!=null&&Ie("scroll",e);break;case"onScrollEnd":a!=null&&Ie("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Uu(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Ie("beforetoggle",e),Ie("toggle",e),Iu(e,"popover",a);break;case"xlinkActuate":tr(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":tr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":tr(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":tr(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":tr(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":tr(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":tr(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":tr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":tr(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Iu(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=B5.get(n)||n,Iu(e,n,a))}}function Oh(e,t,n,a,r,s){switch(n){case"style":Ny(e,a,s);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Ds(e,a):(typeof a=="number"||typeof a=="bigint")&&Ds(e,""+a);break;case"onScroll":a!=null&&Ie("scroll",e);break;case"onScrollEnd":a!=null&&Ie("scrollend",e);break;case"onClick":a!=null&&(e.onclick=nr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!py.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),s=e[hn]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,r),typeof a=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Iu(e,n,a)}}}function nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("load",e);var a=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var i=n[s];if(i!=null)switch(s){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:tt(e,t,s,i,n,null)}}r&&tt(e,t,"srcSet",n.srcSet,n,null),a&&tt(e,t,"src",n.src,n,null);return;case"input":Ie("invalid",e);var l=s=i=r=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var m=n[a];if(m!=null)switch(a){case"name":r=m;break;case"type":i=m;break;case"checked":c=m;break;case"defaultChecked":d=m;break;case"value":s=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(q(137,t));break;default:tt(e,t,a,m,n,null)}}vy(e,s,l,c,d,i,r,!1);return;case"select":Ie("invalid",e),a=i=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":i=l;break;case"multiple":a=l;default:tt(e,t,r,l,n,null)}t=s,n=i,e.multiple=!!a,t!=null?Ms(e,!!a,t,!1):n!=null&&Ms(e,!!a,n,!0);return;case"textarea":Ie("invalid",e),s=r=a=null;for(i in n)if(n.hasOwnProperty(i)&&(l=n[i],l!=null))switch(i){case"value":a=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(q(91));break;default:tt(e,t,i,l,n,null)}Sy(e,a,r,s);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(a=n[c],a!=null))switch(c){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:tt(e,t,c,a,n,null)}return;case"dialog":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(a=0;a<Wl.length;a++)Ie(Wl[a],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in n)if(n.hasOwnProperty(d)&&(a=n[d],a!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:tt(e,t,d,a,n,null)}return;default:if(qw(t)){for(m in n)n.hasOwnProperty(m)&&(a=n[m],a!==void 0&&Oh(e,t,m,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(a=n[l],a!=null&&tt(e,t,l,a,n,null))}function m3(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,i=null,l=null,c=null,d=null,m=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=f;default:a.hasOwnProperty(p)||tt(e,t,p,null,a,f)}}for(var w in a){var p=a[w];if(f=n[w],a.hasOwnProperty(w)&&(p!=null||f!=null))switch(w){case"type":s=p;break;case"name":r=p;break;case"checked":d=p;break;case"defaultChecked":m=p;break;case"value":i=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(q(137,t));break;default:p!==f&&tt(e,t,w,p,a,f)}}Yw(e,i,l,c,d,m,s,r);return;case"select":p=i=l=w=null;for(s in n)if(c=n[s],n.hasOwnProperty(s)&&c!=null)switch(s){case"value":break;case"multiple":p=c;default:a.hasOwnProperty(s)||tt(e,t,s,null,a,c)}for(r in a)if(s=a[r],c=n[r],a.hasOwnProperty(r)&&(s!=null||c!=null))switch(r){case"value":w=s;break;case"defaultValue":l=s;break;case"multiple":i=s;default:s!==c&&tt(e,t,r,s,a,c)}t=l,n=i,a=p,w!=null?Ms(e,!!n,w,!1):!!a!=!!n&&(t!=null?Ms(e,!!n,t,!0):Ms(e,!!n,n?[]:"",!1));return;case"textarea":p=w=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!a.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:tt(e,t,l,null,a,r)}for(i in a)if(r=a[i],s=n[i],a.hasOwnProperty(i)&&(r!=null||s!=null))switch(i){case"value":w=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(q(91));break;default:r!==s&&tt(e,t,i,r,a,s)}yy(e,w,p);return;case"option":for(var x in n)if(w=n[x],n.hasOwnProperty(x)&&w!=null&&!a.hasOwnProperty(x))switch(x){case"selected":e.selected=!1;break;default:tt(e,t,x,null,a,w)}for(c in a)if(w=a[c],p=n[c],a.hasOwnProperty(c)&&w!==p&&(w!=null||p!=null))switch(c){case"selected":e.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:tt(e,t,c,w,a,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)w=n[b],n.hasOwnProperty(b)&&w!=null&&!a.hasOwnProperty(b)&&tt(e,t,b,null,a,w);for(d in a)if(w=a[d],p=n[d],a.hasOwnProperty(d)&&w!==p&&(w!=null||p!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(q(137,t));break;default:tt(e,t,d,w,a,p)}return;default:if(qw(t)){for(var y in n)w=n[y],n.hasOwnProperty(y)&&w!==void 0&&!a.hasOwnProperty(y)&&Oh(e,t,y,void 0,a,w);for(m in a)w=a[m],p=n[m],!a.hasOwnProperty(m)||w===p||w===void 0&&p===void 0||Oh(e,t,m,w,a,p);return}}for(var h in n)w=n[h],n.hasOwnProperty(h)&&w!=null&&!a.hasOwnProperty(h)&&tt(e,t,h,null,a,w);for(f in a)w=a[f],p=n[f],!a.hasOwnProperty(f)||w===p||w==null&&p==null||tt(e,t,f,w,a,p)}function CS(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var r=n[a],s=r.transferSize,i=r.initiatorType,l=r.duration;if(s&&l&&CS(i)){for(i=0,l=r.responseEnd,a+=1;a<n.length;a++){var c=n[a],d=c.startTime;if(d>l)break;var m=c.transferSize,f=c.initiatorType;m&&CS(f)&&(c=c.responseEnd,i+=m*(c<l?1:(l-d)/(c-d)))}if(--a,t+=8*(s+i)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ph=null,zh=null;function zd(e){return e.nodeType===9?e:e.ownerDocument}function AS(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _S(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ih=null;function p3(){var e=window.event;return e&&e.type==="popstate"?e===Ih?!1:(Ih=e,!0):(Ih=null,!1)}var ES=typeof setTimeout=="function"?setTimeout:void 0,h3=typeof clearTimeout=="function"?clearTimeout:void 0,TS=typeof Promise=="function"?Promise:void 0,g3=typeof queueMicrotask=="function"?queueMicrotask:typeof TS<"u"?function(e){return TS.resolve(null).then(e).catch(x3)}:ES;function x3(e){setTimeout(function(){throw e})}function to(e){return e==="head"}function RS(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(r),ui(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Ql(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ql(n);for(var s=n.firstChild;s;){var i=s.nextSibling,l=s.nodeName;s[hl]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=i}}else n==="body"&&Ql(e.ownerDocument.body);n=r}while(n);ui(t)}function kS(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function $h(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":$h(n),Vw(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function b3(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[hl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=oa(e.nextSibling),e===null)break}return null}function v3(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=oa(e.nextSibling),e===null))return null;return e}function MS(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=oa(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$?"||e.data==="$~"}function Uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function y3(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function oa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hh=null;function DS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return oa(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function OS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function PS(e,t,n){switch(t=zd(n),e){case"html":if(e=t.documentElement,!e)throw Error(q(452));return e;case"head":if(e=t.head,!e)throw Error(q(453));return e;case"body":if(e=t.body,!e)throw Error(q(454));return e;default:throw Error(q(451))}}function Ql(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vw(e)}var sa=new Map,zS=new Set;function Ld(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xr=qe.d;qe.d={f:S3,r:j3,D:N3,C:C3,L:A3,m:_3,X:T3,S:E3,M:R3};function S3(){var e=xr.f(),t=Ed();return e||t}function j3(e){var t=Ts(e);t!==null&&t.tag===5&&t.type==="form"?J0(t):xr.r(e)}var ii=typeof document>"u"?null:document;function LS(e,t,n){var a=ii;if(a&&typeof t=="string"&&t){var r=Qn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),zS.has(r)||(zS.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),nn(t,"link",e),Bt(t),a.head.appendChild(t)))}}function N3(e){xr.D(e),LS("dns-prefetch",e,null)}function C3(e,t){xr.C(e,t),LS("preconnect",e,t)}function A3(e,t,n){xr.L(e,t,n);var a=ii;if(a&&e&&t){var r='link[rel="preload"][as="'+Qn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Qn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Qn(n.imageSizes)+'"]')):r+='[href="'+Qn(e)+'"]';var s=r;switch(t){case"style":s=li(e);break;case"script":s=ci(e)}sa.has(s)||(e=lt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),sa.set(s,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(Jl(s))||t==="script"&&a.querySelector(ec(s))||(t=a.createElement("link"),nn(t,"link",e),Bt(t),a.head.appendChild(t)))}}function _3(e,t){xr.m(e,t);var n=ii;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Qn(a)+'"][href="'+Qn(e)+'"]',s=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ci(e)}if(!sa.has(s)&&(e=lt({rel:"modulepreload",href:e},t),sa.set(s,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ec(s)))return}a=n.createElement("link"),nn(a,"link",e),Bt(a),n.head.appendChild(a)}}}function E3(e,t,n){xr.S(e,t,n);var a=ii;if(a&&e){var r=Rs(a).hoistableStyles,s=li(e);t=t||"default";var i=r.get(s);if(!i){var l={loading:0,preload:null};if(i=a.querySelector(Jl(s)))l.loading=5;else{e=lt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=sa.get(s))&&Fh(e,n);var c=i=a.createElement("link");Bt(c),nn(c,"link",e),c._p=new Promise(function(d,m){c.onload=d,c.onerror=m}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Id(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:l},r.set(s,i)}}}function T3(e,t){xr.X(e,t);var n=ii;if(n&&e){var a=Rs(n).hoistableScripts,r=ci(e),s=a.get(r);s||(s=n.querySelector(ec(r)),s||(e=lt({src:e,async:!0},t),(t=sa.get(r))&&Vh(e,t),s=n.createElement("script"),Bt(s),nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(r,s))}}function R3(e,t){xr.M(e,t);var n=ii;if(n&&e){var a=Rs(n).hoistableScripts,r=ci(e),s=a.get(r);s||(s=n.querySelector(ec(r)),s||(e=lt({src:e,async:!0,type:"module"},t),(t=sa.get(r))&&Vh(e,t),s=n.createElement("script"),Bt(s),nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(r,s))}}function IS(e,t,n,a){var r=(r=Pr.current)?Ld(r):null;if(!r)throw Error(q(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=li(n.href),n=Rs(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=li(n.href);var s=Rs(r).hoistableStyles,i=s.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,i),(s=r.querySelector(Jl(e)))&&!s._p&&(i.instance=s,i.state.loading=5),sa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},sa.set(e,n),s||k3(r,e,n,i.state))),t&&a===null)throw Error(q(528,""));return i}if(t&&a!==null)throw Error(q(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ci(n),n=Rs(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(q(444,e))}}function li(e){return'href="'+Qn(e)+'"'}function Jl(e){return'link[rel="stylesheet"]['+e+"]"}function $S(e){return lt({},e,{"data-precedence":e.precedence,precedence:null})}function k3(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nn(t,"link",n),Bt(t),e.head.appendChild(t))}function ci(e){return'[src="'+Qn(e)+'"]'}function ec(e){return"script[async]"+e}function BS(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Qn(n.href)+'"]');if(a)return t.instance=a,Bt(a),a;var r=lt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Bt(a),nn(a,"style",r),Id(a,n.precedence,e),t.instance=a;case"stylesheet":r=li(n.href);var s=e.querySelector(Jl(r));if(s)return t.state.loading|=4,t.instance=s,Bt(s),s;a=$S(n),(r=sa.get(r))&&Fh(a,r),s=(e.ownerDocument||e).createElement("link"),Bt(s);var i=s;return i._p=new Promise(function(l,c){i.onload=l,i.onerror=c}),nn(s,"link",a),t.state.loading|=4,Id(s,n.precedence,e),t.instance=s;case"script":return s=ci(n.src),(r=e.querySelector(ec(s)))?(t.instance=r,Bt(r),r):(a=n,(r=sa.get(s))&&(a=lt({},n),Vh(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Bt(r),nn(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(q(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,Id(a,n.precedence,e));return t.instance}function Id(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,s=r,i=0;i<a.length;i++){var l=a[i];if(l.dataset.precedence===t)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Fh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $d=null;function US(e,t,n){if($d===null){var a=new Map,r=$d=new Map;r.set(n,a)}else r=$d,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var s=n[r];if(!(s[hl]||s[Qt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var i=s.getAttribute(t)||"";i=e+i;var l=a.get(i);l?l.push(s):a.set(i,[s])}}return a}function HS(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function M3(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function FS(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function D3(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=li(a.href),s=t.querySelector(Jl(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Bd.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Bt(s);return}s=t.ownerDocument||t,a=$S(a),(r=sa.get(r))&&Fh(a,r),s=s.createElement("link"),Bt(s);var i=s;i._p=new Promise(function(l,c){i.onload=l,i.onerror=c}),nn(s,"link",a),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Bd.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Gh=0;function O3(e,t){return e.stylesheets&&e.count===0&&Hd(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Hd(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Gh===0&&(Gh=62500*w3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Hd(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Gh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(r)}}:null}function Bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ud=null;function Hd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ud=new Map,t.forEach(P3,e),Ud=null,Bd.call(e))}function P3(e,t){if(!(t.state.loading&4)){var n=Ud.get(e);if(n)var a=n.get(null);else{n=new Map,Ud.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var i=r[s];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}r=t.instance,i=r.getAttribute("data-precedence"),s=n.get(i)||a,s===a&&n.set(null,r),n.set(i,r),this.count++,a=Bd.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),s?s.parentNode.insertBefore(r,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var tc={$$typeof:er,Provider:null,Consumer:null,_currentValue:To,_currentValue2:To,_threadCount:0};function z3(e,t,n,a,r,s,i,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bw(0),this.hiddenUpdates=Bw(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function VS(e,t,n,a,r,s,i,l,c,d,m,f){return e=new z3(e,t,n,i,c,d,m,f,l),t=1,s===!0&&(t|=24),s=Mn(3,null,null,t),e.current=s,s.stateNode=e,t=Np(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:a,isDehydrated:n,cache:t},Ep(s),e}function GS(e){return e?(e=Bs,e):Bs}function YS(e,t,n,a,r,s){r=GS(r),a.context===null?a.context=r:a.pendingContext=r,a=Vr(t),a.payload={element:n},s=s===void 0?null:s,s!==null&&(a.callback=s),n=Gr(e,a,t),n!==null&&(Sn(n,e,t),Dl(n,e,t))}function KS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yh(e,t){KS(e,t),(e=e.alternate)&&KS(e,t)}function qS(e){if(e.tag===13||e.tag===31){var t=zo(e,67108864);t!==null&&Sn(t,e,67108864),Yh(e,67108864)}}function XS(e){if(e.tag===13||e.tag===31){var t=Ln();t=Uw(t);var n=zo(e,t);n!==null&&Sn(n,e,t),Yh(e,t)}}var Fd=!0;function L3(e,t,n,a){var r=Ae.T;Ae.T=null;var s=qe.p;try{qe.p=2,Kh(e,t,n,a)}finally{qe.p=s,Ae.T=r}}function I3(e,t,n,a){var r=Ae.T;Ae.T=null;var s=qe.p;try{qe.p=8,Kh(e,t,n,a)}finally{qe.p=s,Ae.T=r}}function Kh(e,t,n,a){if(Fd){var r=qh(a);if(r===null)Dh(e,t,a,Vd,n),ZS(e,a);else if(B3(r,e,t,n,a))a.stopPropagation();else if(ZS(e,a),t&4&&-1<$3.indexOf(e)){for(;r!==null;){var s=Ts(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var i=ko(s.pendingLanes);if(i!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;i;){var c=1<<31-Rn(i);l.entanglements[1]|=c,i&=~c}Pa(s),!(Xe&6)&&(Ad=En()+500,Xl(0))}}break;case 31:case 13:l=zo(s,2),l!==null&&Sn(l,s,2),Ed(),Yh(s,2)}if(s=qh(a),s===null&&Dh(e,t,a,Vd,n),s===r)break;r=s}r!==null&&a.stopPropagation()}else Dh(e,t,a,null,n)}}function qh(e){return e=Ww(e),Xh(e)}var Vd=null;function Xh(e){if(Vd=null,e=Es(e),e!==null){var t=ll(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Xv(t),e!==null)return e;e=null}else if(n===31){if(e=Wv(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 Vd=e,null}function WS(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(N5()){case ry:return 2;case oy:return 8;case Du:case C5:return 32;case sy:return 268435456;default:return 32}default:return 32}}var Wh=!1,no=null,ao=null,ro=null,nc=new Map,ac=new Map,oo=[],$3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ZS(e,t){switch(e){case"focusin":case"focusout":no=null;break;case"dragenter":case"dragleave":ao=null;break;case"mouseover":case"mouseout":ro=null;break;case"pointerover":case"pointerout":nc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(t.pointerId)}}function rc(e,t,n,a,r,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:s,targetContainers:[r]},t!==null&&(t=Ts(t),t!==null&&qS(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function B3(e,t,n,a,r){switch(t){case"focusin":return no=rc(no,e,t,n,a,r),!0;case"dragenter":return ao=rc(ao,e,t,n,a,r),!0;case"mouseover":return ro=rc(ro,e,t,n,a,r),!0;case"pointerover":var s=r.pointerId;return nc.set(s,rc(nc.get(s)||null,e,t,n,a,r)),!0;case"gotpointercapture":return s=r.pointerId,ac.set(s,rc(ac.get(s)||null,e,t,n,a,r)),!0}return!1}function QS(e){var t=Es(e.target);if(t!==null){var n=ll(t);if(n!==null){if(t=n.tag,t===13){if(t=Xv(n),t!==null){e.blockedOn=t,fy(e.priority,function(){XS(n)});return}}else if(t===31){if(t=Wv(n),t!==null){e.blockedOn=t,fy(e.priority,function(){XS(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 Gd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Xw=a,n.target.dispatchEvent(a),Xw=null}else return t=Ts(n),t!==null&&qS(t),e.blockedOn=n,!1;t.shift()}return!0}function JS(e,t,n){Gd(e)&&n.delete(t)}function U3(){Wh=!1,no!==null&&Gd(no)&&(no=null),ao!==null&&Gd(ao)&&(ao=null),ro!==null&&Gd(ro)&&(ro=null),nc.forEach(JS),ac.forEach(JS)}function Yd(e,t){e.blockedOn===t&&(e.blockedOn=null,Wh||(Wh=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,U3)))}var Kd=null;function ej(e){Kd!==e&&(Kd=e,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,function(){Kd===e&&(Kd=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(Xh(a||n)===null)continue;break}var s=Ts(n);s!==null&&(e.splice(t,3),t-=3,qp(s,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function ui(e){function t(c){return Yd(c,e)}no!==null&&Yd(no,e),ao!==null&&Yd(ao,e),ro!==null&&Yd(ro,e),nc.forEach(t),ac.forEach(t);for(var n=0;n<oo.length;n++){var a=oo[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<oo.length&&(n=oo[0],n.blockedOn===null);)QS(n),n.blockedOn===null&&oo.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],s=n[a+1],i=r[hn]||null;if(typeof s=="function")i||ej(n);else if(i){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,i=s[hn]||null)l=i.formAction;else if(Xh(r)!==null)continue}else l=i.action;typeof l=="function"?n[a+1]=l:(n.splice(a,3),a-=3),ej(n)}}}function tj(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(i){return r=i})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Zh(e){this._internalRoot=e}qd.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));var n=t.current,a=Ln();YS(n,a,e,t,null,null)},qd.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;YS(e.current,2,null,e,null,null),Ed(),t[_s]=null}};function qd(e){this._internalRoot=e}qd.prototype.unstable_scheduleHydration=function(e){if(e){var t=dy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<oo.length&&t!==0&&t<oo[n].priority;n++);oo.splice(n,0,e),n===0&&QS(e)}};var nj=Kv.version;if(nj!=="19.2.4")throw Error(q(527,nj,"19.2.4"));qe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=g5(t),e=e!==null?Qv(e):null,e=e===null?null:e.stateNode,e};var H3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Ae,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xd.isDisabled&&Xd.supportsFiber)try{ml=Xd.inject(H3),Tn=Xd}catch{}}_u.createRoot=function(e,t){if(!qv(e))throw Error(q(299));var n=!1,a="",r=c1,s=u1,i=d1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=VS(e,1,!1,null,null,n,a,null,r,s,i,tj),e[_s]=t.current,Mh(e),new Zh(t)},_u.hydrateRoot=function(e,t,n){if(!qv(e))throw Error(q(299));var a=!1,r="",s=c1,i=u1,l=d1,c=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=VS(e,1,!0,t,n??null,a,r,c,s,i,l,tj),t.context=GS(null),n=t.current,a=Ln(),a=Uw(a),r=Vr(a),r.callback=null,Gr(n,r,a),n=a,t.current.lanes=n,pl(t,n),Pa(t),e[_s]=t.current,Mh(e),new qd(t)},_u.version="19.2.4";function aj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aj)}catch(e){console.error(e)}}aj(),Bv.exports=_u;var F3=Bv.exports;/** 50 50 * react-router v7.13.0 51 51 * … … 56 56 * 57 57 * @license MIT 58 */var rj=e=>{throw TypeError(e)}, F3=(e,t,n)=>t.has(e)||rj("Cannot "+n),Qh=(e,t,n)=>(F3(e,t,"read from private field"),n?n.call(e):t.get(e)),V3=(e,t,n)=>t.has(e)?rj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),oj="popstate";function G3(e={}){function t(r,s){let{pathname:i="/",search:l="",hash:c=""}=br(r.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),oc("",{pathname:i,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){let i=r.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let c=r.location.href,u=c.indexOf("#");l=u===-1?c:c.slice(0,u)}return l+"#"+(typeof s=="string"?s:za(s))}function a(r,s){wt(r.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(s)})`)}return K3(t,n,a,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Y3(){return Math.random().toString(36).substring(2,10)}function sj(e,t){return{usr:e.state,key:e.key,idx:t}}function oc(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?br(t):t,state:n,key:t&&t.key||a||Y3()}}function za({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function br(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function K3(e,t,n,a={}){let{window:r=document.defaultView,v5Compat:s=!1}=a,i=r.history,l="POP",c=null,u=m();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function m(){return(i.state||{idx:null}).idx}function f(){l="POP";let y=m(),h=y==null?null:y-u;u=y,c&&c({action:l,location:b.location,delta:h})}function w(y,h){l="PUSH";let g=oc(b.location,y,h);n&&n(g,y),u=m()+1;let v=sj(g,u),S=b.createHref(g);try{i.pushState(v,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;r.location.assign(S)}s&&c&&c({action:l,location:b.location,delta:1})}function p(y,h){l="REPLACE";let g=oc(b.location,y,h);n&&n(g,y),u=m();let v=sj(g,u),S=b.createHref(g);i.replaceState(v,"",S),s&&c&&c({action:l,location:b.location,delta:0})}function x(y){return ij(y)}let b={get action(){return l},get location(){return e(r,i)},listen(y){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(oj,f),c=y,()=>{r.removeEventListener(oj,f),c=null}},createHref(y){return t(r,y)},createURL:x,encodeLocation(y){let h=x(y);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:w,replace:p,go(y){return i.go(y)}};return b}function ij(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Oe(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:za(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var sc,lj=class{constructor(e){if(V3(this,sc,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Qh(this,sc).has(e))return Qh(this,sc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Qh(this,sc).set(e,t)}};sc=new WeakMap;var q3=new Set(["lazy","caseSensitive","path","id","index","children"]);function X3(e){return q3.has(e)}var W3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Z3(e){return W3.has(e)}function Q3(e){return e.index===!0}function ic(e,t,n=[],a={},r=!1){return e.map((s,i)=>{let l=[...n,String(i)],c=typeof s.id=="string"?s.id:l.join("-");if(Oe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Oe(r||!a[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),Q3(s)){let u={...s,id:c};return a[c]=cj(u,t(u)),u}else{let u={...s,id:c,children:void 0};return a[c]=cj(u,t(u)),s.children&&(u.children=ic(s.children,t,l,a,r)),u}})}function cj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function so(e,t,n="/"){return lc(e,t,n,!1)}function lc(e,t,n,a){let r=typeof t=="string"?br(t):t,s=ia(r.pathname||"/",n);if(s==null)return null;let i=uj(e);eD(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let u=dD(s);l=cD(i[c],u,a)}return l}function J3(e,t){let{route:n,pathname:a,params:r}=e;return{id:n.id,pathname:a,params:r,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function uj(e,t=[],n=[],a="",r=!1){let s=(i,l,c=r,u)=>{let m={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&c)return;Oe(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let f=La([a,m.relativePath]),w=n.concat(m);i.children&&i.children.length>0&&(Oe(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),uj(i.children,t,w,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:iD(f,i.index),routesMeta:w})};return e.forEach((i,l)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))s(i,l);else for(let u of dj(i.path))s(i,l,!0,u)}),t}function dj(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return r?[s,""]:[s];let i=dj(a.join("/")),l=[];return l.push(...i.map(c=>c===""?s:[s,c].join("/"))),r&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function eD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lD(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var tD=/^:[\w-]+$/,nD=3,aD=2,rD=1,oD=10,sD=-2,fj=e=>e==="*";function iD(e,t){let n=e.split("/"),a=n.length;return n.some(fj)&&(a+=sD),t&&(a+=aD),n.filter(r=>!fj(r)).reduce((r,s)=>r+(tD.test(s)?nD:s===""?rD:oD),a)}function lD(e,t){return e.length===t.length&&e.slice(0,-1).every((a,r)=>a===t[r])?e[e.length-1]-t[t.length-1]:0}function cD(e,t,n=!1){let{routesMeta:a}=e,r={},s="/",i=[];for(let l=0;l<a.length;++l){let c=a[l],u=l===a.length-1,m=s==="/"?t:t.slice(s.length)||"/",f=Wd({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},m),w=c.route;if(!f&&u&&n&&!a[a.length-1].route.index&&(f=Wd({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!f)return null;Object.assign(r,f.params),i.push({params:r,pathname:La([s,f.pathname]),pathnameBase:wD(La([s,f.pathnameBase])),route:w}),f.pathnameBase!=="/"&&(s=La([s,f.pathnameBase]))}return i}function Wd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=uD(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let s=r[0],i=s.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:a.reduce((u,{paramName:m,isOptional:f},w)=>{if(m==="*"){let x=l[w]||"";i=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const p=l[w];return f&&!p?u[m]=void 0:u[m]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function uD(e,t=!1,n=!0){wt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(a.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),a]}function dD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ia(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function fD({basename:e,pathname:t}){return t==="/"?e:La([e,t])}var mj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jh=e=>mj.test(e);function mD(e,t="/"){let{pathname:n,search:a="",hash:r=""}=typeof e=="string"?br(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=wj(n.substring(1),"/"):s=wj(n,t)):s=t,{pathname:s,search:pD(a),hash:hD(r)}}function wj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function eg(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zd(e){let t=pj(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Qd(e,t,n,a=!1){let r;typeof e=="string"?r=br(e):(r={...e},Oe(!r.pathname||!r.pathname.includes("?"),eg("?","pathname","search",r)),Oe(!r.pathname||!r.pathname.includes("#"),eg("#","pathname","hash",r)),Oe(!r.search||!r.search.includes("#"),eg("#","search","hash",r)));let s=e===""||r.pathname==="",i=s?"/":r.pathname,l;if(i==null)l=n;else{let f=t.length-1;if(!a&&i.startsWith("..")){let w=i.split("/");for(;w[0]==="..";)w.shift(),f-=1;r.pathname=w.join("/")}l=f>=0?t[f]:"/"}let c=mD(r,l),u=i&&i!=="/"&&i.endsWith("/"),m=(s||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||m)&&(c.pathname+="/"),c}var La=e=>e.join("/").replace(/\/\/+/g,"/"),wD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,cc=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dc(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gj(e,t){let n=e;if(typeof n!="string"||!mj.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,r=!1;if(hj)try{let s=new URL(window.location.href),i=n.startsWith("//")?new URL(s.protocol+n):new URL(n),l=ia(i.pathname,t);i.origin===s.origin&&l!=null?n=l+i.search+i.hash:r=!0}catch{wt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:r,to:n}}var io=Symbol("Uninstrumented");function gD(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(r=>r({id:t.id,index:t.index,path:t.path,instrument(s){let i=Object.keys(n);for(let l of i)s[l]&&n[l].push(s[l])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let r=di(n.lazy,t.lazy,()=>{});r&&(a.lazy=r)}if(typeof t.lazy=="object"){let r=t.lazy;["middleware","loader","action"].forEach(s=>{let i=r[s],l=n[`lazy.${s}`];if(typeof i=="function"&&l.length>0){let c=di(l,i,()=>{});c&&(a.lazy=Object.assign(a.lazy||{},{[s]:c}))}})}return["loader","action"].forEach(r=>{let s=t[r];if(typeof s=="function"&&n[r].length>0){let i=s[io]??s,l=di(n[r],i,(...c)=>bj(c[0]));l&&(r==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[io]=i,a[r]=l)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(r=>{let s=r[io]??r,i=di(n.middleware,s,(...l)=>bj(l[0]));return i?(i[io]=s,i):r})),a}function xD(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(r){let s=Object.keys(r);for(let i of s)r[i]&&n[i].push(r[i])}})),n.navigate.length>0){let a=e.navigate[io]??e.navigate,r=di(n.navigate,a,(...s)=>{let[i,l]=s;return{to:typeof i=="number"||typeof i=="string"?i:i?za(i):".",...vj(e,l??{})}});r&&(r[io]=a,e.navigate=r)}if(n.fetch.length>0){let a=e.fetch[io]??e.fetch,r=di(n.fetch,a,(...s)=>{let[i,,l,c]=s;return{href:l??".",fetcherKey:i,...vj(e,c??{})}});r&&(r[io]=a,e.fetch=r)}return e}function di(e,t,n){return e.length===0?null:async(...a)=>{let r=await xj(e,n(...a),()=>t(...a),e.length-1);if(r.type==="error")throw r.value;return r.value}}async function xj(e,t,n,a){let r=e[a],s;if(r){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=xj(e,t,n,a-1),s=await i,Oe(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await r(l,t)}catch(c){console.error("An instrumentation function threw an error:",c)}i||await l(),await i}else try{s={type:"success",value:await n()}}catch(i){s={type:"error",value:i}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function bj(e){let{request:t,context:n,params:a,unstable_pattern:r}=e;return{request:bD(t),params:{...a},unstable_pattern:r,context:vD(n)}}function vj(e,t){return{currentUrl:za(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function bD(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function vD(e){if(SD(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var yD=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function SD(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===yD}var yj=["POST","PUT","PATCH","DELETE"],jD=new Set(yj),ND=["GET",...yj],CD=new Set(ND),Sj=new Set([301,302,303,307,308]),AD=new Set([307,308]),tg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_D={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ED=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jj="remix-router-transitions",Nj=Symbol("ResetLoaderData");function TD(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],r=e.mapRouteProperties||ED,s=r;if(e.unstable_instrumentations){let k=e.unstable_instrumentations;s=L=>({...r(L),...gD(k.map(U=>U.route).filter(Boolean),L)})}let i={},l=ic(e.routes,s,void 0,i),c,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let m=e.dataStrategy||OD,f={...e.future},w=null,p=new Set,x=null,b=null,y=null,h=e.hydrationData!=null,g=so(l,e.history.location,u),v=!1,S=null,N;if(g==null&&!e.patchRoutesOnNavigation){let k=la(404,{pathname:e.history.location.pathname}),{matches:L,route:U}=Jd(l);N=!0,g=L,S={[U.id]:k}}else if(g&&!e.hydrationData&&kt(g,l,e.history.location.pathname).active&&(g=null),g)if(g.some(k=>k.route.lazy))N=!1;else if(!g.some(k=>ag(k.route)))N=!0;else{let k=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;if(L){let U=g.findIndex(W=>L[W.route.id]!==void 0);N=g.slice(0,U+1).every(W=>!rg(W.route,k,L))}else N=g.every(U=>!rg(U.route,k,L))}else{N=!1,g=[];let k=kt(null,l,e.history.location.pathname);k.active&&k.matches&&(v=!0,g=k.matches)}let A,j={historyAction:e.history.action,location:e.history.location,matches:g,initialized:N,navigation:tg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},C="POP",R=null,M=!1,z,B=!1,I=new Map,V=null,D=!1,T=!1,O=new Set,_=new Map,$=0,H=-1,F=new Map,Q=new Set,X=new Map,P=new Map,G=new Set,ne=new Map,Y,Z=null;function le(){if(w=e.history.listen(({action:k,location:L,delta:U})=>{if(Y){Y(),Y=void 0;return}wt(ne.size===0||U!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let W=ie({currentLocation:j.location,nextLocation:L,historyAction:k});if(W&&U!=null){let te=new Promise(xe=>{Y=xe});e.history.go(U*-1),Za(W,{state:"blocked",location:L,proceed(){Za(W,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),te.then(()=>e.history.go(U))},reset(){let xe=new Map(j.blockers);xe.set(W,fc),K({blockers:xe})}}),R==null||R.resolve(),R=null;return}return Ke(k,L)}),n){QD(t,I);let k=()=>JD(t,I);t.addEventListener("pagehide",k),V=()=>t.removeEventListener("pagehide",k)}return j.initialized||Ke("POP",j.location,{initialHydration:!0}),A}function he(){w&&w(),V&&V(),p.clear(),z&&z.abort(),j.fetchers.forEach((k,L)=>ze(L)),j.blockers.forEach((k,L)=>rn(L))}function ae(k){return p.add(k),()=>p.delete(k)}function K(k,L={}){k.matches&&(k.matches=k.matches.map(te=>{let xe=i[te.route.id],je=te.route;return je.element!==xe.element||je.errorElement!==xe.errorElement||je.hydrateFallbackElement!==xe.hydrateFallbackElement?{...te,route:xe}:te})),j={...j,...k};let U=[],W=[];j.fetchers.forEach((te,xe)=>{te.state==="idle"&&(G.has(xe)?U.push(xe):W.push(xe))}),G.forEach(te=>{!j.fetchers.has(te)&&!_.has(te)&&U.push(te)}),[...p].forEach(te=>te(j,{deletedFetchers:U,newErrors:k.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),U.forEach(te=>ze(te)),W.forEach(te=>j.fetchers.delete(te))}function ge(k,L,{flushSync:U}={}){var Me,be;let W=j.actionData!=null&&j.navigation.formMethod!=null&&sn(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Me=k.state)==null?void 0:Me._isRedirect)!==!0,te;L.actionData?Object.keys(L.actionData).length>0?te=L.actionData:te=null:W?te=j.actionData:te=null;let xe=L.loaderData?$j(j.loaderData,L.loaderData,L.matches||[],L.errors):j.loaderData,je=j.blockers;je.size>0&&(je=new Map(je),je.forEach((De,Fe)=>je.set(Fe,fc)));let ce=D?!1:dt(k,L.matches||j.matches),pe=M===!0||j.navigation.formMethod!=null&&sn(j.navigation.formMethod)&&((be=k.state)==null?void 0:be._isRedirect)!==!0;c&&(l=c,c=void 0),D||C==="POP"||(C==="PUSH"?e.history.push(k,k.state):C==="REPLACE"&&e.history.replace(k,k.state));let ve;if(C==="POP"){let De=I.get(j.location.pathname);De&&De.has(k.pathname)?ve={currentLocation:j.location,nextLocation:k}:I.has(k.pathname)&&(ve={currentLocation:k,nextLocation:j.location})}else if(B){let De=I.get(j.location.pathname);De?De.add(k.pathname):(De=new Set([k.pathname]),I.set(j.location.pathname,De)),ve={currentLocation:j.location,nextLocation:k}}K({...L,actionData:te,loaderData:xe,historyAction:C,location:k,initialized:!0,navigation:tg,revalidation:"idle",restoreScrollPosition:ce,preventScrollReset:pe,blockers:je},{viewTransitionOpts:ve,flushSync:U===!0}),C="POP",M=!1,B=!1,D=!1,T=!1,R==null||R.resolve(),R=null,Z==null||Z.resolve(),Z=null}async function Ne(k,L){if(R==null||R.resolve(),R=null,typeof k=="number"){R||(R=Vj());let Fe=R.promise;return e.history.go(k),Fe}let U=ng(j.location,j.matches,u,k,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:W,submission:te,error:xe}=Cj(!1,U,L),je=j.location,ce=oc(j.location,W,L&&L.state);ce={...ce,...e.history.encodeLocation(ce)};let pe=L&&L.replace!=null?L.replace:void 0,ve="PUSH";pe===!0?ve="REPLACE":pe===!1||te!=null&&sn(te.formMethod)&&te.formAction===j.location.pathname+j.location.search&&(ve="REPLACE");let Me=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,be=(L&&L.flushSync)===!0,De=ie({currentLocation:je,nextLocation:ce,historyAction:ve});if(De){Za(De,{state:"blocked",location:ce,proceed(){Za(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Ne(k,L)},reset(){let Fe=new Map(j.blockers);Fe.set(De,fc),K({blockers:Fe})}});return}await Ke(ve,ce,{submission:te,pendingError:xe,preventScrollReset:Me,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:be,callSiteDefaultShouldRevalidate:L&&L.unstable_defaultShouldRevalidate})}function We(){Z||(Z=Vj()),qn(),K({revalidation:"loading"});let k=Z.promise;return j.navigation.state==="submitting"?k:j.navigation.state==="idle"?(Ke(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),k):(Ke(C||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:B===!0}),k)}async function Ke(k,L,U){z&&z.abort(),z=null,C=k,D=(U&&U.startUninterruptedRevalidation)===!0,Je(j.location,j.matches),M=(U&&U.preventScrollReset)===!0,B=(U&&U.enableViewTransition)===!0;let W=c||l,te=U&&U.overrideNavigation,xe=U!=null&&U.initialHydration&&j.matches&&j.matches.length>0&&!v?j.matches:so(W,L,u),je=(U&&U.flushSync)===!0;if(xe&&j.initialized&&!T&&HD(j.location,L)&&!(U&&U.submission&&sn(U.submission.formMethod))){ge(L,{matches:xe},{flushSync:je});return}let ce=kt(xe,W,L.pathname);if(ce.active&&ce.matches&&(xe=ce.matches),!xe){let{error:Zt,notFoundMatches:pn,route:rt}=Ee(L.pathname);ge(L,{matches:pn,loaderData:{},errors:{[rt.id]:Zt}},{flushSync:je});return}z=new AbortController;let pe=mi(e.history,L,z.signal,U&&U.submission),ve=e.getContext?await e.getContext():new lj,Me;if(U&&U.pendingError)Me=[lo(xe).route.id,{type:"error",error:U.pendingError}];else if(U&&U.submission&&sn(U.submission.formMethod)){let Zt=await at(pe,L,U.submission,xe,ve,ce.active,U&&U.initialHydration===!0,{replace:U.replace,flushSync:je});if(Zt.shortCircuited)return;if(Zt.pendingActionResult){let[pn,rt]=Zt.pendingActionResult;if(In(rt)&&uc(rt.error)&&rt.error.status===404){z=null,ge(L,{matches:Zt.matches,loaderData:{},errors:{[pn]:rt.error}});return}}xe=Zt.matches||xe,Me=Zt.pendingActionResult,te=cg(L,U.submission),je=!1,ce.active=!1,pe=mi(e.history,pe.url,pe.signal)}let{shortCircuited:be,matches:De,loaderData:Fe,errors:on}=await Kt(pe,L,xe,ve,ce.active,te,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,je,Me,U&&U.callSiteDefaultShouldRevalidate);be||(z=null,ge(L,{matches:De||xe,...Bj(Me),loaderData:Fe,errors:on}))}async function at(k,L,U,W,te,xe,je,ce={}){qn();let pe=WD(L,U);if(K({navigation:pe},{flushSync:ce.flushSync===!0}),xe){let be=await Mr(W,L.pathname,k.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:Fe,route:on}=Jd(l);return{matches:Fe,pendingActionResult:[on.id,{type:"error",error:be.error}]}}let De=lo(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[De,{type:"error",error:be.error}]}}else if(be.matches)W=be.matches;else{let{notFoundMatches:De,error:Fe,route:on}=Ee(L.pathname);return{matches:De,pendingActionResult:[on.id,{type:"error",error:Fe}]}}}let ve,Me=tf(W,L);if(!Me.route.action&&!Me.route.lazy)ve={type:"error",error:la(405,{method:k.method,pathname:L.pathname,routeId:Me.route.id})};else{let be=fi(s,i,k,W,Me,je?[]:a,te),De=await wn(k,be,te,null);if(ve=De[Me.route.id],!ve){for(let Fe of W)if(De[Fe.route.id]){ve=De[Fe.route.id];break}}if(k.signal.aborted)return{shortCircuited:!0}}if(Xo(ve)){let be;return ce&&ce.replace!=null?be=ce.replace:be=zj(ve.response.headers.get("Location"),new URL(k.url),u,e.history)===j.location.pathname+j.location.search,await an(k,ve,!0,{submission:U,replace:be}),{shortCircuited:!0}}if(In(ve)){let be=lo(W,Me.route.id);return(ce&&ce.replace)!==!0&&(C="PUSH"),{matches:W,pendingActionResult:[be.route.id,ve,Me.route.id]}}return{matches:W,pendingActionResult:[Me.route.id,ve]}}async function Kt(k,L,U,W,te,xe,je,ce,pe,ve,Me,be,De){let Fe=xe||cg(L,je),on=je||ce||Fj(Fe),Zt=!D&&!ve;if(te){if(Zt){let cn=He(be);K({navigation:Fe,...cn!==void 0?{actionData:cn}:{}},{flushSync:Me})}let Ye=await Mr(U,L.pathname,k.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){if(Ye.partialMatches.length===0){let{matches:sl,route:ys}=Jd(l);return{matches:sl,loaderData:{},errors:{[ys.id]:Ye.error}}}let cn=lo(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,loaderData:{},errors:{[cn]:Ye.error}}}else if(Ye.matches)U=Ye.matches;else{let{error:cn,notFoundMatches:sl,route:ys}=Ee(L.pathname);return{matches:sl,loaderData:{},errors:{[ys.id]:cn}}}}let pn=c||l,{dsMatches:rt,revalidatingFetchers:ha}=Aj(k,W,s,i,e.history,j,U,on,L,ve?[]:a,ve===!0,T,O,G,X,Q,pn,u,e.patchRoutesOnNavigation!=null,be,De);if(H=++$,!e.dataStrategy&&!rt.some(Ye=>Ye.shouldLoad)&&!rt.some(Ye=>Ye.route.middleware&&Ye.route.middleware.length>0)&&ha.length===0){let Ye=pa();return ge(L,{matches:U,loaderData:{},errors:be&&In(be[1])?{[be[0]]:be[1].error}:null,...Bj(be),...Ye?{fetchers:new Map(j.fetchers)}:{}},{flushSync:Me}),{shortCircuited:!0}}if(Zt){let Ye={};if(!te){Ye.navigation=Fe;let cn=He(be);cn!==void 0&&(Ye.actionData=cn)}ha.length>0&&(Ye.fetchers=qt(ha)),K(Ye,{flushSync:Me})}ha.forEach(Ye=>{Ge(Ye.key),Ye.controller&&_.set(Ye.key,Ye.controller)});let bs=()=>ha.forEach(Ye=>Ge(Ye.key));z&&z.signal.addEventListener("abort",bs);let{loaderResults:Su,fetcherResults:Ao}=await An(rt,ha,k,W);if(k.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",bs),ha.forEach(Ye=>_.delete(Ye.key));let Qa=ef(Su);if(Qa)return await an(k,Qa.result,!0,{replace:pe}),{shortCircuited:!0};if(Qa=ef(Ao),Qa)return Q.add(Qa.key),await an(k,Qa.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:Av,errors:ju}=Ij(j,U,Su,be,ha,Ao);ve&&j.errors&&(ju={...j.errors,...ju});let vs=pa(),ww=Xn(H),pw=vs||ww||ha.length>0;return{matches:U,loaderData:Av,errors:ju,...pw?{fetchers:new Map(j.fetchers)}:{}}}function He(k){if(k&&!In(k[1]))return{[k[0]]:k[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function qt(k){return k.forEach(L=>{let U=j.fetchers.get(L.key),W=wc(void 0,U?U.data:void 0);j.fetchers.set(L.key,W)}),new Map(j.fetchers)}async function Cn(k,L,U,W){Ge(k);let te=(W&&W.flushSync)===!0,xe=c||l,je=ng(j.location,j.matches,u,U,L,W==null?void 0:W.relative),ce=so(xe,je,u),pe=kt(ce,xe,je);if(pe.active&&pe.matches&&(ce=pe.matches),!ce){ye(k,L,la(404,{pathname:je}),{flushSync:te});return}let{path:ve,submission:Me,error:be}=Cj(!0,je,W);if(be){ye(k,L,be,{flushSync:te});return}let De=e.getContext?await e.getContext():new lj,Fe=(W&&W.preventScrollReset)===!0;if(Me&&sn(Me.formMethod)){await mt(k,L,ve,ce,De,pe.active,te,Fe,Me,W&&W.unstable_defaultShouldRevalidate);return}X.set(k,{routeId:L,path:ve}),await Xt(k,L,ve,ce,De,pe.active,te,Fe,Me)}async function mt(k,L,U,W,te,xe,je,ce,pe,ve){qn(),X.delete(k);let Me=j.fetchers.get(k);oe(k,ZD(pe,Me),{flushSync:je});let be=new AbortController,De=mi(e.history,U,be.signal,pe);if(xe){let vt=await Mr(W,new URL(De.url).pathname,De.signal,k);if(vt.type==="aborted")return;if(vt.type==="error"){ye(k,L,vt.error,{flushSync:je});return}else if(vt.matches)W=vt.matches;else{ye(k,L,la(404,{pathname:U}),{flushSync:je});return}}let Fe=tf(W,U);if(!Fe.route.action&&!Fe.route.lazy){let vt=la(405,{method:pe.formMethod,pathname:U,routeId:L});ye(k,L,vt,{flushSync:je});return}_.set(k,be);let on=$,Zt=fi(s,i,De,W,Fe,a,te),pn=await wn(De,Zt,te,k),rt=pn[Fe.route.id];if(!rt){for(let vt of Zt)if(pn[vt.route.id]){rt=pn[vt.route.id];break}}if(De.signal.aborted){_.get(k)===be&&_.delete(k);return}if(G.has(k)){if(Xo(rt)||In(rt)){oe(k,vr(void 0));return}}else{if(Xo(rt))if(_.delete(k),H>on){oe(k,vr(void 0));return}else return Q.add(k),oe(k,wc(pe)),an(De,rt,!1,{fetcherSubmission:pe,preventScrollReset:ce});if(In(rt)){ye(k,L,rt.error);return}}let ha=j.navigation.location||j.location,bs=mi(e.history,ha,be.signal),Su=c||l,Ao=j.navigation.state!=="idle"?so(Su,j.navigation.location,u):j.matches;Oe(Ao,"Didn't find any matches after fetcher action");let Qa=++$;F.set(k,Qa);let Av=wc(pe,rt.data);j.fetchers.set(k,Av);let{dsMatches:ju,revalidatingFetchers:vs}=Aj(bs,te,s,i,e.history,j,Ao,pe,ha,a,!1,T,O,G,X,Q,Su,u,e.patchRoutesOnNavigation!=null,[Fe.route.id,rt],ve);vs.filter(vt=>vt.key!==k).forEach(vt=>{let hw=vt.key,YM=j.fetchers.get(hw),_J=wc(void 0,YM?YM.data:void 0);j.fetchers.set(hw,_J),Ge(hw),vt.controller&&_.set(hw,vt.controller)}),K({fetchers:new Map(j.fetchers)});let ww=()=>vs.forEach(vt=>Ge(vt.key));be.signal.addEventListener("abort",ww);let{loaderResults:pw,fetcherResults:Ye}=await An(ju,vs,bs,te);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",ww),F.delete(k),_.delete(k),vs.forEach(vt=>_.delete(vt.key)),j.fetchers.has(k)){let vt=vr(rt.data);j.fetchers.set(k,vt)}let cn=ef(pw);if(cn)return an(bs,cn.result,!1,{preventScrollReset:ce});if(cn=ef(Ye),cn)return Q.add(cn.key),an(bs,cn.result,!1,{preventScrollReset:ce});let{loaderData:sl,errors:ys}=Ij(j,Ao,pw,void 0,vs,Ye);Xn(Qa),j.navigation.state==="loading"&&Qa>H?(Oe(C,"Expected pending action"),z&&z.abort(),ge(j.navigation.location,{matches:Ao,loaderData:sl,errors:ys,fetchers:new Map(j.fetchers)})):(K({errors:ys,loaderData:$j(j.loaderData,sl,Ao,ys),fetchers:new Map(j.fetchers)}),T=!1)}async function Xt(k,L,U,W,te,xe,je,ce,pe){let ve=j.fetchers.get(k);oe(k,wc(pe,ve?ve.data:void 0),{flushSync:je});let Me=new AbortController,be=mi(e.history,U,Me.signal);if(xe){let rt=await Mr(W,new URL(be.url).pathname,be.signal,k);if(rt.type==="aborted")return;if(rt.type==="error"){ye(k,L,rt.error,{flushSync:je});return}else if(rt.matches)W=rt.matches;else{ye(k,L,la(404,{pathname:U}),{flushSync:je});return}}let De=tf(W,U);_.set(k,Me);let Fe=$,on=fi(s,i,be,W,De,a,te),pn=(await wn(be,on,te,k))[De.route.id];if(_.get(k)===Me&&_.delete(k),!be.signal.aborted){if(G.has(k)){oe(k,vr(void 0));return}if(Xo(pn))if(H>Fe){oe(k,vr(void 0));return}else{Q.add(k),await an(be,pn,!1,{preventScrollReset:ce});return}if(In(pn)){ye(k,L,pn.error);return}oe(k,vr(pn.data))}}async function an(k,L,U,{submission:W,fetcherSubmission:te,preventScrollReset:xe,replace:je}={}){U||(R==null||R.resolve(),R=null),L.response.headers.has("X-Remix-Revalidate")&&(T=!0);let ce=L.response.headers.get("Location");Oe(ce,"Expected a Location header on the redirect Response"),ce=zj(ce,new URL(k.url),u,e.history);let pe=oc(j.location,ce,{_isRedirect:!0});if(n){let on=!1;if(L.response.headers.has("X-Remix-Reload-Document"))on=!0;else if(Jh(ce)){const Zt=ij(ce,!0);on=Zt.origin!==t.location.origin||ia(Zt.pathname,u)==null}if(on){je?t.location.replace(ce):t.location.assign(ce);return}}z=null;let ve=je===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Me,formAction:be,formEncType:De}=j.navigation;!W&&!te&&Me&&be&&De&&(W=Fj(j.navigation));let Fe=W||te;if(AD.has(L.response.status)&&Fe&&sn(Fe.formMethod))await Ke(ve,pe,{submission:{...Fe,formAction:ce},preventScrollReset:xe||M,enableViewTransition:U?B:void 0});else{let on=cg(pe,W);await Ke(ve,pe,{overrideNavigation:on,fetcherSubmission:te,preventScrollReset:xe||M,enableViewTransition:U?B:void 0})}}async function wn(k,L,U,W){var je;let te,xe={};try{te=await zD(m,k,L,W,U,!1)}catch(ce){return L.filter(pe=>pe.shouldLoad).forEach(pe=>{xe[pe.route.id]={type:"error",error:ce}}),xe}if(k.signal.aborted)return xe;if(!sn(k.method))for(let ce of L){if(((je=te[ce.route.id])==null?void 0:je.type)==="error")break;!te.hasOwnProperty(ce.route.id)&&!j.loaderData.hasOwnProperty(ce.route.id)&&(!j.errors||!j.errors.hasOwnProperty(ce.route.id))&&ce.shouldCallHandler()&&(te[ce.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ce.route.id}`)})}for(let[ce,pe]of Object.entries(te))if(YD(pe)){let ve=pe.result;xe[ce]={type:"redirect",response:BD(ve,k,ce,L,u)}}else xe[ce]=await $D(pe);return xe}async function An(k,L,U,W){let te=wn(U,k,W,null),xe=Promise.all(L.map(async pe=>{if(pe.matches&&pe.match&&pe.request&&pe.controller){let Me=(await wn(pe.request,pe.matches,W,pe.key))[pe.match.route.id];return{[pe.key]:Me}}else return Promise.resolve({[pe.key]:{type:"error",error:la(404,{pathname:pe.path})}})})),je=await te,ce=(await xe).reduce((pe,ve)=>Object.assign(pe,ve),{});return{loaderResults:je,fetcherResults:ce}}function qn(){T=!0,X.forEach((k,L)=>{_.has(L)&&O.add(L),Ge(L)})}function oe(k,L,U={}){j.fetchers.set(k,L),K({fetchers:new Map(j.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function ye(k,L,U,W={}){let te=lo(j.matches,L);ze(k),K({errors:{[te.route.id]:U},fetchers:new Map(j.fetchers)},{flushSync:(W&&W.flushSync)===!0})}function we(k){return P.set(k,(P.get(k)||0)+1),G.has(k)&&G.delete(k),j.fetchers.get(k)||_D}function Ve(k,L){Ge(k,L==null?void 0:L.reason),oe(k,vr(null))}function ze(k){let L=j.fetchers.get(k);_.has(k)&&!(L&&L.state==="loading"&&F.has(k))&&Ge(k),X.delete(k),F.delete(k),Q.delete(k),G.delete(k),O.delete(k),j.fetchers.delete(k)}function Wt(k){let L=(P.get(k)||0)-1;L<=0?(P.delete(k),G.add(k)):P.set(k,L),K({fetchers:new Map(j.fetchers)})}function Ge(k,L){let U=_.get(k);U&&(U.abort(L),_.delete(k))}function Ea(k){for(let L of k){let U=we(L),W=vr(U.data);j.fetchers.set(L,W)}}function pa(){let k=[],L=!1;for(let U of Q){let W=j.fetchers.get(U);Oe(W,`Expected fetcher: ${U}`),W.state==="loading"&&(Q.delete(U),k.push(U),L=!0)}return Ea(k),L}function Xn(k){let L=[];for(let[U,W]of F)if(W<k){let te=j.fetchers.get(U);Oe(te,`Expected fetcher: ${U}`),te.state==="loading"&&(Ge(U),F.delete(U),L.push(U))}return Ea(L),L.length>0}function Ta(k,L){let U=j.blockers.get(k)||fc;return ne.get(k)!==L&&ne.set(k,L),U}function rn(k){j.blockers.delete(k),ne.delete(k)}function Za(k,L){let U=j.blockers.get(k)||fc;Oe(U.state==="unblocked"&&L.state==="blocked"||U.state==="blocked"&&L.state==="blocked"||U.state==="blocked"&&L.state==="proceeding"||U.state==="blocked"&&L.state==="unblocked"||U.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${U.state} -> ${L.state}`);let W=new Map(j.blockers);W.set(k,L),K({blockers:W})}function ie({currentLocation:k,nextLocation:L,historyAction:U}){if(ne.size===0)return;ne.size>1&&wt(!1,"A router only supports one blocker at a time");let W=Array.from(ne.entries()),[te,xe]=W[W.length-1],je=j.blockers.get(te);if(!(je&&je.state==="proceeding")&&xe({currentLocation:k,nextLocation:L,historyAction:U}))return te}function Ee(k){let L=la(404,{pathname:k}),U=c||l,{matches:W,route:te}=Jd(U);return{notFoundMatches:W,route:te,error:L}}function $e(k,L,U){if(x=k,y=L,b=U||null,!h&&j.navigation===tg){h=!0;let W=dt(j.location,j.matches);W!=null&&K({restoreScrollPosition:W})}return()=>{x=null,y=null,b=null}}function re(k,L){return b&&b(k,L.map(W=>J3(W,j.loaderData)))||k.key}function Je(k,L){if(x&&y){let U=re(k,L);x[U]=y()}}function dt(k,L){if(x){let U=re(k,L),W=x[U];if(typeof W=="number")return W}return null}function kt(k,L,U){if(e.patchRoutesOnNavigation)if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:lc(L,U,u,!0)}}else return{active:!0,matches:lc(L,U,u,!0)||[]};return{active:!1,matches:null}}async function Mr(k,L,U,W){if(!e.patchRoutesOnNavigation)return{type:"success",matches:k};let te=k;for(;;){let xe=c==null,je=c||l,ce=i;try{await e.patchRoutesOnNavigation({signal:U,path:L,matches:te,fetcherKey:W,patch:(Me,be)=>{U.aborted||_j(Me,be,je,ce,s,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:te}}finally{xe&&!U.aborted&&(l=[...l])}if(U.aborted)return{type:"aborted"};let pe=so(je,L,u),ve=null;if(pe){if(Object.keys(pe[0].params).length===0)return{type:"success",matches:pe};if(ve=lc(je,L,u,!0),!(ve&&te.length<ve.length&&Mt(te,ve.slice(0,te.length))))return{type:"success",matches:pe}}if(ve||(ve=lc(je,L,u,!0)),!ve||Mt(te,ve))return{type:"success",matches:null};te=ve}}function Mt(k,L){return k.length===L.length&&k.every((U,W)=>U.route.id===L[W].route.id)}function _n(k){i={},c=ic(k,s,void 0,i)}function ol(k,L,U=!1){let W=c==null;_j(k,L,c||l,i,s,U),W&&(l=[...l],K({}))}return A={get basename(){return u},get future(){return f},get state(){return j},get routes(){return l},get window(){return t},initialize:le,subscribe:ae,enableScrollRestoration:$e,navigate:Ne,fetch:Cn,revalidate:We,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:we,resetFetcher:Ve,deleteFetcher:Wt,dispose:he,getBlocker:Ta,deleteBlocker:rn,patchRoutes:ol,_internalFetchControllers:_,_internalSetRoutes:_n,_internalSetStateDoNotUseOrYouWillBreakYourApp(k){K(k)}},e.unstable_instrumentations&&(A=xD(A,e.unstable_instrumentations.map(k=>k.router).filter(Boolean))),A}function RD(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ng(e,t,n,a,r,s){let i,l;if(r){i=[];for(let u of t)if(i.push(u),u.route.id===r){l=u;break}}else i=t,l=t[t.length-1];let c=Qd(a||".",Zd(i),ia(e.pathname,n)||e.pathname,s==="path");if(a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&l){let u=lg(c.search);if(l.route.index&&!u)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let m=new URLSearchParams(c.search),f=m.getAll("index");m.delete("index"),f.filter(p=>p).forEach(p=>m.append("index",p));let w=m.toString();c.search=w?`?${w}`:""}}return n!=="/"&&(c.pathname=fD({basename:n,pathname:c.pathname})),za(c)}function Cj(e,t,n){if(!n||!RD(n))return{path:t};if(n.formMethod&&!XD(n.formMethod))return{path:t,error:la(405,{method:n.formMethod})};let a=()=>({path:t,error:la(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),i=Uj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sn(s))return a();let f=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,[p,x])=>`${w}${p}=${x}59 `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:i,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if(n.formEncType==="application/json"){if(!sn(s))return a();try{let f=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:i,formEncType:n.formEncType,formData:void 0,json:f,text:void 0}}}catch{return a()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=sg(n.formData),c=n.formData;else if(n.body instanceof FormData)l=sg(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=Lj(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=Lj(l)}catch{return a()}let u={formMethod:s,formAction:i,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(sn(u.formMethod))return{path:t,submission:u};let m=br(t);return e&&m.search&&lg(m.search)&&l.append("index",""),m.search=`?${l}`,{path:za(m),submission:u}}function Aj(e,t,n,a,r,s,i,l,c,u,m,f,w,p,x,b,y,h,g,v,S){var D;let N=v?In(v[1])?v[1].error:v[1].data:void 0,A=r.createURL(s.location),j=r.createURL(c),C;if(m&&s.errors){let T=Object.keys(s.errors)[0];C=i.findIndex(O=>O.route.id===T)}else if(v&&In(v[1])){let T=v[0];C=i.findIndex(O=>O.route.id===T)-1}let R=v?v[1].statusCode:void 0,M=R&&R>=400,z={currentUrl:A,currentParams:((D=s.matches[0])==null?void 0:D.params)||{},nextUrl:j,nextParams:i[0].params,...l,actionResult:N,actionStatus:R},B=dc(i),I=i.map((T,O)=>{let{route:_}=T,$=null;if(C!=null&&O>C?$=!1:_.lazy?$=!0:ag(_)?m?$=rg(_,s.loaderData,s.errors):kD(s.loaderData,s.matches[O],T)&&($=!0):$=!1,$!==null)return og(n,a,e,B,T,u,t,$);let H=!1;typeof S=="boolean"?H=S:M?H=!1:(f||A.pathname+A.search===j.pathname+j.search||A.search!==j.search||MD(s.matches[O],T))&&(H=!0);let F={...z,defaultShouldRevalidate:H},Q=mc(T,F);return og(n,a,e,B,T,u,t,Q,F,S)}),V=[];return x.forEach((T,O)=>{if(m||!i.some(G=>G.route.id===T.routeId)||p.has(O))return;let _=s.fetchers.get(O),$=_&&_.state!=="idle"&&_.data===void 0,H=so(y,T.path,h);if(!H){if(g&&$)return;V.push({key:O,routeId:T.routeId,path:T.path,matches:null,match:null,request:null,controller:null});return}if(b.has(O))return;let F=tf(H,T.path),Q=new AbortController,X=mi(r,T.path,Q.signal),P=null;if(w.has(O))w.delete(O),P=fi(n,a,X,H,F,u,t);else if($)f&&(P=fi(n,a,X,H,F,u,t));else{let G;typeof S=="boolean"?G=S:M?G=!1:G=f;let ne={...z,defaultShouldRevalidate:G};mc(F,ne)&&(P=fi(n,a,X,H,F,u,t,ne))}P&&V.push({key:O,routeId:T.routeId,path:T.path,matches:P,match:F,request:X,controller:Q})}),{dsMatches:I,revalidatingFetchers:V}}function ag(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rg(e,t,n){if(e.lazy)return!0;if(!ag(e))return!1;let a=t!=null&&e.id in t,r=n!=null&&n[e.id]!==void 0;return!a&&r?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!r}function kD(e,t,n){let a=!t||n.route.id!==t.route.id,r=!e.hasOwnProperty(n.route.id);return a||r}function MD(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function mc(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _j(e,t,n,a,r,s){let i;if(e){let u=a[e];Oe(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=n;let l=[],c=[];if(t.forEach(u=>{let m=i.find(f=>Ej(u,f));m?c.push({existingRoute:m,newRoute:u}):l.push(u)}),l.length>0){let u=ic(l,r,[e||"_","patch",String((i==null?void 0:i.length)||"0")],a);i.push(...u)}if(s&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:m,newRoute:f}=c[u],w=m,[p]=ic([f],r,[],{},!0);Object.assign(w,{element:p.element?p.element:w.element,errorElement:p.errorElement?p.errorElement:w.errorElement,hydrateFallbackElement:p.hydrateFallbackElement?p.hydrateFallbackElement:w.hydrateFallbackElement})}}function Ej(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,a)=>{var r;return(r=t.children)==null?void 0:r.some(s=>Ej(n,s))}):!1}var Tj=new WeakMap,Rj=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let r=n[t.id];if(Oe(r,"No route found in manifest"),!r.lazy||typeof r.lazy!="object")return;let s=r.lazy[e];if(!s)return;let i=Tj.get(r);i||(i={},Tj.set(r,i));let l=i[e];if(l)return l;let c=(async()=>{let u=X3(e),f=r[e]!==void 0&&e!=="hasErrorBoundary";if(u)wt(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)wt(!1,`Route "${r.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let w=await s();w!=null&&(Object.assign(r,{[e]:w}),Object.assign(r,a(r)))}typeof r.lazy=="object"&&(r.lazy[e]=void 0,Object.values(r.lazy).every(w=>w===void 0)&&(r.lazy=void 0))})();return i[e]=c,c},kj=new WeakMap;function DD(e,t,n,a,r){let s=n[e.id];if(Oe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=kj.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let f=(async()=>{Oe(typeof e.lazy=="function","No lazy route function found");let w=await e.lazy(),p={};for(let x in w){let b=w[x];if(b===void 0)continue;let y=Z3(x),g=s[x]!==void 0&&x!=="hasErrorBoundary";y?wt(!y,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):g?wt(!g,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):p[x]=b}Object.assign(s,p),Object.assign(s,{...a(s),lazy:void 0})})();return kj.set(s,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),l=[],c;for(let m of i){if(r&&r.includes(m))continue;let f=Rj({key:m,route:e,manifest:n,mapRouteProperties:a});f&&(l.push(f),m===t&&(c=f))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u==null||u.catch(()=>{}),c==null||c.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:c}}async function Mj(e){let t=e.matches.filter(r=>r.shouldLoad),n={};return(await Promise.all(t.map(r=>r.resolve()))).forEach((r,s)=>{n[t[s].route.id]=r}),n}async function OD(e){return e.matches.some(t=>t.route.middleware)?Dj(e,()=>Mj(e)):Mj(e)}function Dj(e,t){return PD(e,t,a=>{if(qD(a))throw a;return a},VD,n);function n(a,r,s){if(s)return Promise.resolve(Object.assign(s.value,{[r]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===r),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),c=lo(i,i[l].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:a}})}}}async function PD(e,t,n,a,r){let{matches:s,request:i,params:l,context:c,unstable_pattern:u}=e,m=s.flatMap(w=>w.route.middleware?w.route.middleware.map(p=>[w.route.id,p]):[]);return await Oj({request:i,params:l,context:c,unstable_pattern:u},m,t,n,a,r)}async function Oj(e,t,n,a,r,s,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let c=t[i];if(!c)return await n();let[u,m]=c,f,w=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Oj(e,t,n,a,r,s,i+1)},f.value}catch(p){return f={value:await s(p,u,f)},f.value}};try{let p=await m(e,w),x=p!=null?a(p):void 0;return r(x)?x:f?x??f.value:(f={value:await w()},f.value)}catch(p){return await s(p,u,f)}}function Pj(e,t,n,a,r){let s=Rj({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=DD(a.route,sn(n.method)?"action":"loader",t,e,r);return{middleware:s,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function og(e,t,n,a,r,s,i,l,c=null,u){let m=!1,f=Pj(e,t,n,r,s);return{...r,_lazyPromises:f,shouldLoad:l,shouldRevalidateArgs:c,shouldCallHandler(w){return m=!0,c?typeof u=="boolean"?mc(r,{...c,defaultShouldRevalidate:u}):typeof w=="boolean"?mc(r,{...c,defaultShouldRevalidate:w}):mc(r,c):l},resolve(w){let{lazy:p,loader:x,middleware:b}=r.route,y=m||l||w&&!sn(n.method)&&(p||x),h=b&&b.length>0&&!x&&!p;return y&&(sn(n.method)||!h)?LD({request:n,unstable_pattern:a,match:r,lazyHandlerPromise:f==null?void 0:f.handler,lazyRoutePromise:f==null?void 0:f.route,handlerOverride:w,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function fi(e,t,n,a,r,s,i,l=null){return a.map(c=>c.route.id!==r.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Pj(e,t,n,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:og(e,t,n,dc(a),c,s,i,!0,l))}async function zD(e,t,n,a,r,s){n.some(u=>{var m;return(m=u._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(u=>{var m;return(m=u._lazyPromises)==null?void 0:m.middleware}));let i={request:t,unstable_pattern:dc(n),params:n[0].params,context:r,matches:n},c=await e({...i,fetcherKey:a,runClientMiddleware:u=>{let m=i;return Dj(m,()=>u({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>{var m,f;return[(m=u._lazyPromises)==null?void 0:m.handler,(f=u._lazyPromises)==null?void 0:f.route]}))}catch{}return c}async function LD({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:r,handlerOverride:s,scopedContext:i}){let l,c,u=sn(e.method),m=u?"action":"loader",f=w=>{let p,x=new Promise((h,g)=>p=g);c=()=>p(),e.signal.addEventListener("abort",c);let b=h=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):w({request:e,unstable_pattern:t,params:n.params,context:i},...h!==void 0?[h]:[]),y=(async()=>{try{return{type:"data",result:await(s?s(g=>b(g)):b())}}catch(h){return{type:"error",result:h}}})();return Promise.race([y,x])};try{let w=u?n.route.action:n.route.loader;if(a||r)if(w){let p,[x]=await Promise.all([f(w).catch(b=>{p=b}),a,r]);if(p!==void 0)throw p;l=x}else{await a;let p=u?n.route.action:n.route.loader;if(p)[l]=await Promise.all([f(p),r]);else if(m==="action"){let x=new URL(e.url),b=x.pathname+x.search;throw la(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(w)l=await f(w);else{let p=new URL(e.url),x=p.pathname+p.search;throw la(404,{pathname:x})}}catch(w){return{type:"error",result:w}}finally{c&&e.signal.removeEventListener("abort",c)}return l}async function ID(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function $D(e){var a,r,s,i,l;let{result:t,type:n}=e;if(ig(t)){let c;try{c=await ID(t)}catch(u){return{type:"error",error:u}}return n==="error"?{type:"error",error:new cc(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:"data",data:c,statusCode:t.status,headers:t.headers}}return n==="error"?Hj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(r=t.init)!=null&&r.headers?new Headers(t.init.headers):void 0}:{type:"error",error:FD(t),statusCode:uc(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:uc(t)?t.status:void 0}:Hj(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function BD(e,t,n,a,r){let s=e.headers.get("Location");if(Oe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jh(s)){let i=a.slice(0,a.findIndex(l=>l.route.id===n)+1);s=ng(new URL(t.url),i,r,s),e.headers.set("Location",s)}return e}function zj(e,t,n,a){let r=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jh(e)){let s=e,i=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(r.includes(i.protocol))throw new Error("Invalid redirect location");let l=ia(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let s=a.createURL(e);if(r.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function mi(e,t,n,a){let r=e.createURL(Uj(t)).toString(),s={signal:n};if(a&&sn(a.formMethod)){let{formMethod:i,formEncType:l}=a;s.method=i.toUpperCase(),l==="application/json"?(s.headers=new Headers({"Content-Type":l}),s.body=JSON.stringify(a.json)):l==="text/plain"?s.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?s.body=sg(a.formData):s.body=a.formData}return new Request(r,s)}function sg(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function Lj(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function UD(e,t,n,a=!1,r=!1){let s={},i=null,l,c=!1,u={},m=n&&In(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let w=f.route.id,p=t[w];if(Oe(!Xo(p),"Cannot handle redirect results in processLoaderData"),In(p)){let x=p.error;if(m!==void 0&&(x=m,m=void 0),i=i||{},r)i[w]=x;else{let b=lo(e,w);i[b.route.id]==null&&(i[b.route.id]=x)}a||(s[w]=Nj),c||(c=!0,l=uc(p.error)?p.error.status:500),p.headers&&(u[w]=p.headers)}else s[w]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(u[w]=p.headers)}),m!==void 0&&n&&(i={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:i,statusCode:l||200,loaderHeaders:u}}function Ij(e,t,n,a,r,s){let{loaderData:i,errors:l}=UD(t,n,a);return r.filter(c=>!c.matches||c.matches.some(u=>u.shouldLoad)).forEach(c=>{let{key:u,match:m,controller:f}=c;if(f&&f.signal.aborted)return;let w=s[u];if(Oe(w,"Did not find corresponding fetcher result"),In(w)){let p=lo(e.matches,m==null?void 0:m.route.id);l&&l[p.route.id]||(l={...l,[p.route.id]:w.error}),e.fetchers.delete(u)}else if(Xo(w))Oe(!1,"Unhandled fetcher revalidation redirect");else{let p=vr(w.data);e.fetchers.set(u,p)}}),{loaderData:i,errors:l}}function $j(e,t,n,a){let r=Object.entries(t).filter(([,s])=>s!==Nj).reduce((s,[i,l])=>(s[i]=l,s),{});for(let s of n){let i=s.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&s.route.loader&&(r[i]=e[i]),a&&a.hasOwnProperty(i))break}return r}function Bj(e){return e?In(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function lo(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Jd(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function la(e,{pathname:t,routeId:n,method:a,type:r,message:s}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&n?l=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:r==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${n}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&n?l=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(l=`Invalid request method "${a.toUpperCase()}"`)),new cc(e||500,i,new Error(l),!0)}function ef(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,r]=t[n];if(Xo(r))return{key:a,result:r}}}function Uj(e){let t=typeof e=="string"?br(e):e;return za({...t,hash:""})}function HD(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function FD(e){var t,n;return new cc(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function VD(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&GD(n))}function GD(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function YD(e){return ig(e.result)&&Sj.has(e.result.status)}function In(e){return e.type==="error"}function Xo(e){return(e&&e.type)==="redirect"}function Hj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ig(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function KD(e){return Sj.has(e)}function qD(e){return ig(e)&&KD(e.status)&&e.headers.has("Location")}function XD(e){return CD.has(e.toUpperCase())}function sn(e){return jD.has(e.toUpperCase())}function lg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function tf(e,t){let n=typeof t=="string"?br(t).search:t.search;if(e[e.length-1].route.index&&lg(n||""))return e[e.length-1];let a=pj(e);return a[a.length-1]}function Fj(e){let{formMethod:t,formAction:n,formEncType:a,text:r,formData:s,json:i}=e;if(!(!t||!n||!a)){if(r!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:r};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:i,text:void 0}}}function cg(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function WD(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function wc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ZD(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function QD(e,t){try{let n=e.sessionStorage.getItem(jj);if(n){let a=JSON.parse(n);for(let[r,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(r,new Set(s||[]))}}catch{}}function JD(e,t){if(t.size>0){let n={};for(let[a,r]of t)n[a]=[...r];try{e.sessionStorage.setItem(jj,JSON.stringify(n))}catch(a){wt(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Vj(){let e,t,n=new Promise((a,r)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{r(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Wo=d.createContext(null);Wo.displayName="DataRouter";var pc=d.createContext(null);pc.displayName="DataRouterState";var Gj=d.createContext(!1);function eO(){return d.useContext(Gj)}var ug=d.createContext({isTransitioning:!1});ug.displayName="ViewTransition";var Yj=d.createContext(new Map);Yj.displayName="Fetchers";var tO=d.createContext(null);tO.displayName="Await";var $n=d.createContext(null);$n.displayName="Navigation";var nf=d.createContext(null);nf.displayName="Location";var ca=d.createContext({outlet:null,matches:[],isDataRoute:!1});ca.displayName="Route";var dg=d.createContext(null);dg.displayName="RouteError";var Kj="REACT_ROUTER_ERROR",nO="REDIRECT",aO="ROUTE_ERROR_RESPONSE";function rO(e){if(e.startsWith(`${Kj}:${nO}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function oO(e){if(e.startsWith(`${Kj}:${aO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new cc(t.status,t.statusText,t.data)}catch{}}function sO(e,{relative:t}={}){Oe(wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=d.useContext($n),{hash:r,pathname:s,search:i}=hc(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:La([n,s])),a.createHref({pathname:l,search:i,hash:r})}function wi(){return d.useContext(nf)!=null}function jn(){return Oe(wi(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(nf).location}var qj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xj(e){d.useContext($n).static||d.useLayoutEffect(e)}function pi(){let{isDataRoute:e}=d.useContext(ca);return e?yO():iO()}function iO(){Oe(wi(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(Wo),{basename:t,navigator:n}=d.useContext($n),{matches:a}=d.useContext(ca),{pathname:r}=jn(),s=JSON.stringify(Zd(a)),i=d.useRef(!1);return Xj(()=>{i.current=!0}),d.useCallback((c,u={})=>{if(wt(i.current,qj),!i.current)return;if(typeof c=="number"){n.go(c);return}let m=Qd(c,JSON.parse(s),r,u.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:La([t,m.pathname])),(u.replace?n.replace:n.push)(m,u.state,u)},[t,n,s,r,e])}var lO=d.createContext(null);function cO(e){let t=d.useContext(ca).outlet;return d.useMemo(()=>t&&d.createElement(lO.Provider,{value:e},t),[t,e])}function Wj(){let{matches:e}=d.useContext(ca),t=e[e.length-1];return t?t.params:{}}function hc(e,{relative:t}={}){let{matches:n}=d.useContext(ca),{pathname:a}=jn(),r=JSON.stringify(Zd(n));return d.useMemo(()=>Qd(e,JSON.parse(r),a,t==="path"),[e,r,a,t])}function uO(e,t,n,a,r){Oe(wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=d.useContext($n),{matches:i}=d.useContext(ca),l=i[i.length-1],c=l?l.params:{},u=l?l.pathname:"/",m=l?l.pathnameBase:"/",f=l&&l.route;{let g=f&&f.path||"";Jj(u,!f||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.60 61 Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let w=jn(),p;p=w;let x=p.pathname||"/",b=x;if(m!=="/"){let g=m.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=so(e,{pathname:b});return wt(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),wt(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`), pO(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},c,g.params),pathname:La([m,s.encodeLocation?s.encodeLocation(g.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?m:La([m,s.encodeLocation?s.encodeLocation(g.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),i,n,a,r)}function dO(){let e=vO(),t=uc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:s},"ErrorBoundary")," or"," ",d.createElement("code",{style:s},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),n?d.createElement("pre",{style:r},n):null,i)}var fO=d.createElement(dO,null),Zj=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=oO(e.digest);n&&(e=n)}let t=e!==void 0?d.createElement(ca.Provider,{value:this.props.routeContext},d.createElement(dg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?d.createElement(mO,{error:e},t):t}};Zj.contextType=Gj;var fg=new WeakMap;function mO({children:e,error:t}){let{basename:n}=d.useContext($n);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=rO(t.digest);if(a){let r=fg.get(t);if(r)throw r;let s=gj(a.location,n);if(hj&&!fg.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw fg.set(t,i),i}return d.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function wO({routeContext:e,match:t,children:n}){let a=d.useContext(Wo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(ca.Provider,{value:e},n)}function pO(e,t=[],n=null,a=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=n==null?void 0:n.errors;if(i!=null){let m=s.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);Oe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let l=!1,c=-1;if(n)for(let m=0;m<s.length;m++){let f=s[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=m),f.route.id){let{loaderData:w,errors:p}=n,x=f.route.loader&&!w.hasOwnProperty(f.route.id)&&(!p||p[f.route.id]===void 0);if(f.route.lazy||x){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}let u=n&&a?(m,f)=>{var w,p;a(m,{location:n.location,params:((p=(w=n.matches)==null?void 0:w[0])==null?void 0:p.params)??{},unstable_pattern:dc(n.matches),errorInfo:f})}:void 0;return s.reduceRight((m,f,w)=>{let p,x=!1,b=null,y=null;n&&(p=i&&f.route.id?i[f.route.id]:void 0,b=f.route.errorElement||fO,l&&(c<0&&w===0?(Jj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,y=null):c===w&&(x=!0,y=f.route.hydrateFallbackElement||null)));let h=t.concat(s.slice(0,w+1)),g=()=>{let v;return p?v=b:x?v=y:f.route.Component?v=d.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=m,d.createElement(wO,{match:f,routeContext:{outlet:m,matches:h,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||w===0)?d.createElement(Zj,{location:n.location,revalidation:n.revalidation,component:b,error:p,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function mg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hO(e){let t=d.useContext(Wo);return Oe(t,mg(e)),t}function gO(e){let t=d.useContext(pc);return Oe(t,mg(e)),t}function xO(e){let t=d.useContext(ca);return Oe(t,mg(e)),t}function wg(e){let t=xO(e),n=t.matches[t.matches.length-1];return Oe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function bO(){return wg("useRouteId")}function vO(){var a;let e=d.useContext(dg),t=gO("useRouteError"),n=wg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function yO(){let{router:e}=hO("useNavigate"),t=wg("useNavigate"),n=d.useRef(!1);return Xj(()=>{n.current=!0}),d.useCallback(async(r,s={})=>{wt(n.current,qj),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))},[e,t])}var Qj={};function Jj(e,t,n){!t&&!Qj[e]&&(Qj[e]=!0,wt(!1,n))}var eN={};function tN(e,t){!e&&!eN[t]&&(eN[t]=!0,console.warn(t))}var SO="useOptimistic",nN=Au[SO],jO=()=>{};function NO(e){return nN?nN(e):[e,jO]}function CO(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&wt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&wt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&wt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var AO=["HydrateFallback","hydrateFallbackElement"],_O=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function EO({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=eO()||a;let[s,i]=d.useState(e.state),[l,c]=NO(s),[u,m]=d.useState(),[f,w]=d.useState({isTransitioning:!1}),[p,x]=d.useState(),[b,y]=d.useState(),[h,g]=d.useState(),v=d.useRef(new Map),S=d.useCallback((C,{deletedFetchers:R,newErrors:M,flushSync:z,viewTransitionOpts:B})=>{M&&n&&Object.values(M).forEach(V=>{var D;return n(V,{location:C.location,params:((D=C.matches[0])==null?void 0:D.params)??{},unstable_pattern:dc(C.matches)})}),C.fetchers.forEach((V,D)=>{V.data!==void 0&&v.current.set(D,V.data)}),R.forEach(V=>v.current.delete(V)),tN(z===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let I=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(tN(B==null||I,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!I){t&&z?t(()=>i(C)):a===!1?i(C):d.startTransition(()=>{a===!0&&c(V=>aN(V,C)),i(C)});return}if(t&&z){t(()=>{b&&(p==null||p.resolve(),b.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>i(C))});V.finished.finally(()=>{t(()=>{x(void 0),y(void 0),m(void 0),w({isTransitioning:!1})})}),t(()=>y(V));return}b?(p==null||p.resolve(),b.skipTransition(),g({state:C,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(m(C),w({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[e.window,t,b,p,a,c,n]);d.useLayoutEffect(()=>e.subscribe(S),[e,S]),d.useEffect(()=>{f.isTransitioning&&!f.flushSync&&x(new _O)},[f]),d.useEffect(()=>{if(p&&u&&e.window){let C=u,R=p.promise,M=e.window.document.startViewTransition(async()=>{a===!1?i(C):d.startTransition(()=>{a===!0&&c(z=>aN(z,C)),i(C)}),await R});M.finished.finally(()=>{x(void 0),y(void 0),m(void 0),w({isTransitioning:!1})}),y(M)}},[u,p,e.window,a,c]),d.useEffect(()=>{p&&u&&l.location.key===u.location.key&&p.resolve()},[p,b,l.location,u]),d.useEffect(()=>{!f.isTransitioning&&h&&(m(h.state),w({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),g(void 0))},[f.isTransitioning,h]);let N=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:C=>e.navigate(C),push:(C,R,M)=>e.navigate(C,{state:R,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(C,R,M)=>e.navigate(C,{replace:!0,state:R,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[e]),A=e.basename||"/",j=d.useMemo(()=>({router:e,navigator:N,static:!1,basename:A,onError:n}),[e,N,A,n]);return d.createElement(d.Fragment,null,d.createElement(Wo.Provider,{value:j},d.createElement(pc.Provider,{value:l},d.createElement(Yj.Provider,{value:v.current},d.createElement(ug.Provider,{value:f},d.createElement(MO,{basename:A,location:l.location,navigationType:l.historyAction,navigator:N,unstable_useTransitions:a},d.createElement(TO,{routes:e.routes,future:e.future,state:l,onError:n})))))),null)}function aN(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var TO=d.memo(RO);function RO({routes:e,future:t,state:n,onError:a}){return uO(e,void 0,n,a,t)}function rN({to:e,replace:t,state:n,relative:a}){Oe(wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=d.useContext($n);wt(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=d.useContext(ca),{pathname:i}=jn(),l=pi(),c=Qd(e,Zd(s),i,a==="path"),u=JSON.stringify(c);return d.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:a})},[l,u,a,t,n]),null}function kO(e){return cO(e.context)}function MO({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:r,static:s=!1,unstable_useTransitions:i}){Oe(!wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=d.useMemo(()=>({basename:l,navigator:r,static:s,unstable_useTransitions:i,future:{}}),[l,r,s,i]);typeof n=="string"&&(n=br(n));let{pathname:u="/",search:m="",hash:f="",state:w=null,key:p="default"}=n,x=d.useMemo(()=>{let b=ia(u,l);return b==null?null:{location:{pathname:b,search:m,hash:f,state:w,key:p},navigationType:a}},[l,u,m,f,w,p,a]);return wt(x!=null,`<Router basename="${l}"> is not able to match the URL "${u}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:d.createElement($n.Provider,{value:c},d.createElement(nf.Provider,{children:t,value:x}))}var af="get",rf="application/x-www-form-urlencoded";function of(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DO(e){return of(e)&&e.tagName.toLowerCase()==="button"}function OO(e){return of(e)&&e.tagName.toLowerCase()==="form"}function PO(e){return of(e)&&e.tagName.toLowerCase()==="input"}function zO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LO(e,t){return e.button===0&&(!t||t==="_self")&&!zO(e)}function pg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(r=>[n,r]):[[n,a]])},[]))}function IO(e,t){let n=pg(e);return t&&t.forEach((a,r)=>{n.has(r)||t.getAll(r).forEach(s=>{n.append(r,s)})}),n}var sf=null;function $O(){if(sf===null)try{new FormData(document.createElement("form"),0),sf=!1}catch{sf=!0}return sf}var BO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hg(e){return e!=null&&!BO.has(e)?(wt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rf}"`),null):e}function UO(e,t){let n,a,r,s,i;if(OO(e)){let l=e.getAttribute("action");a=l?ia(l,t):null,n=e.getAttribute("method")||af,r=hg(e.getAttribute("enctype"))||rf,s=new FormData(e)}else if(DO(e)||PO(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(a=c?ia(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||af,r=hg(e.getAttribute("formenctype"))||hg(l.getAttribute("enctype"))||rf,s=new FormData(l,e),!$O()){let{name:u,type:m,value:f}=e;if(m==="image"){let w=u?`${u}.`:"";s.append(`${w}x`,"0"),s.append(`${w}y`,"0")}else u&&s.append(u,f)}}else{if(of(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=af,a=null,r=rf,i=e}return s&&r==="text/plain"&&(i=s,s=void 0),{action:a,method:n.toLowerCase(),encType:r,formData:s,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function HO(e,t,n,a){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${a}`:r.pathname=`${r.pathname}.${a}`:r.pathname==="/"?r.pathname=`_root.${a}`:t&&ia(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${a}`,r}async function FO(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VO(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function GO(e,t,n){let a=await Promise.all(e.map(async r=>{let s=t.routes[r.route.id];if(s){let i=await FO(s,n);return i.links?i.links():[]}return[]}));return XO(a.flat(1).filter(VO).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function oN(e,t,n,a,r,s){let i=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,l=(c,u)=>{var m;return n[u].pathname!==c.pathname||((m=n[u].route.path)==null?void 0:m.endsWith("*"))&&n[u].params["*"]!==c.params["*"]};return s==="assets"?t.filter((c,u)=>i(c,u)||l(c,u)):s==="data"?t.filter((c,u)=>{var f;let m=a.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(i(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let w=c.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function YO(e,t,{includeHydrateFallback:n}={}){return KO(e.map(a=>{let r=t.routes[a.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function KO(e){return[...new Set(e)]}function qO(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function XO(e,t){let n=new Set;return new Set(t),e.reduce((a,r)=>{let s=JSON.stringify(qO(r));return n.has(s)||(n.add(s),a.push({key:s,link:r})),a},[])}function sN(){let e=d.useContext(Wo);return gg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function WO(){let e=d.useContext(pc);return gg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var xg=d.createContext(void 0);xg.displayName="FrameworkContext";function iN(){let e=d.useContext(xg);return gg(e,"You must render this element inside a <HydratedRouter> element"),e}function ZO(e,t){let n=d.useContext(xg),[a,r]=d.useState(!1),[s,i]=d.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:m,onTouchStart:f}=t,w=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=h=>{h.forEach(g=>{i(g.isIntersecting)})},y=new IntersectionObserver(b,{threshold:.5});return w.current&&y.observe(w.current),()=>{y.disconnect()}}},[e]),d.useEffect(()=>{if(a){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[a]);let p=()=>{r(!0)},x=()=>{r(!1),i(!1)};return n?e!=="intent"?[s,w,{}]:[s,w,{onFocus:gc(l,p),onBlur:gc(c,x),onMouseEnter:gc(u,p),onMouseLeave:gc(m,x),onTouchStart:gc(f,p)}]:[!1,w,{}]}function gc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function QO({page:e,...t}){let{router:n}=sN(),a=d.useMemo(()=>so(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?d.createElement(eP,{page:e,matches:a,...t}):null}function JO(e){let{manifest:t,routeModules:n}=iN(),[a,r]=d.useState([]);return d.useEffect(()=>{let s=!1;return GO(e,t,n).then(i=>{s||r(i)}),()=>{s=!0}},[e,t,n]),a}function eP({page:e,matches:t,...n}){let a=jn(),{future:r,manifest:s,routeModules:i}=iN(),{basename:l}=sN(),{loaderData:c,matches:u}=WO(),m=d.useMemo(()=>oN(e,t,u,s,a,"data"),[e,t,u,s,a]),f=d.useMemo(()=>oN(e,t,u,s,a,"assets"),[e,t,u,s,a]),w=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,y=!1;if(t.forEach(g=>{var S;let v=s.routes[g.route.id];!v||!v.hasLoader||(!m.some(N=>N.route.id===g.route.id)&&g.route.id in c&&((S=i[g.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?y=!0:b.add(g.route.id))}),b.size===0)return[];let h=HO(e,l,r.unstable_trailingSlashAwareDataRequests,"data");return y&&b.size>0&&h.searchParams.set("_routes",t.filter(g=>b.has(g.route.id)).map(g=>g.route.id).join(",")),[h.pathname+h.search]},[l,r.unstable_trailingSlashAwareDataRequests,c,a,s,m,t,e,i]),p=d.useMemo(()=>YO(f,s),[f,s]),x=JO(f);return d.createElement(d.Fragment,null,w.map(b=>d.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),p.map(b=>d.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:y})=>d.createElement("link",{key:b,nonce:n.nonce,...y,crossOrigin:y.crossOrigin??n.crossOrigin})))}function tP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var nP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nP&&(window.__reactRouterVersion="7.13.0")}catch{}function aP(e,t){return TD({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:G3({window:t==null?void 0:t.window}),hydrationData:rP(),routes:e,mapRouteProperties:CO,hydrationRouteProperties:AO,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function rP(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:oP(e.errors)}),e}function oP(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,r]of t)if(r&&r.__type==="RouteErrorResponse")n[a]=new cc(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type==="Error"){if(r.__subType){let s=window[r.__subType];if(typeof s=="function")try{let i=new s(r.message);i.stack="",n[a]=i}catch{}}if(n[a]==null){let s=new Error(r.message);s.stack="",n[a]=s}}else n[a]=r;return n}var lN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bn=d.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:r,reloadDocument:s,replace:i,state:l,target:c,to:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w,...p},x){let{basename:b,unstable_useTransitions:y}=d.useContext($n),h=typeof u=="string"&&lN.test(u),g=gj(u,b);u=g.to;let v=sO(u,{relative:r}),[S,N,A]=ZO(a,p),j=cP(u,{replace:i,state:l,target:c,preventScrollReset:m,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:w,unstable_useTransitions:y});function C(M){t&&t(M),M.defaultPrevented||j(M)}let R=d.createElement("a",{...p,...A,href:g.absoluteURL||v,onClick:g.isExternal||s?t:C,ref:tP(x,N),target:c,"data-discover":!h&&n==="render"?"true":void 0});return S&&!h?d.createElement(d.Fragment,null,R,d.createElement(QO,{page:v})):R});Bn.displayName="Link";var sP=d.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:r=!1,style:s,to:i,viewTransition:l,children:c,...u},m){let f=hc(i,{relative:u.relative}),w=jn(),p=d.useContext(pc),{navigator:x,basename:b}=d.useContext($n),y=p!=null&&pP(f)&&l===!0,h=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,g=w.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(g=g.toLowerCase(),v=v?v.toLowerCase():null,h=h.toLowerCase()),v&&b&&(v=ia(v,b)||v);const S=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let N=g===h||!r&&g.startsWith(h)&&g.charAt(S)==="/",A=v!=null&&(v===h||!r&&v.startsWith(h)&&v.charAt(h.length)==="/"),j={isActive:N,isPending:A,isTransitioning:y},C=N?t:void 0,R;typeof a=="function"?R=a(j):R=[a,N?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(j):s;return d.createElement(Bn,{...u,"aria-current":C,className:R,ref:m,style:M,to:i,viewTransition:l},typeof c=="function"?c(j):c)});sP.displayName="NavLink";var iP=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:r,state:s,method:i=af,action:l,onSubmit:c,relative:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w,...p},x)=>{let{unstable_useTransitions:b}=d.useContext($n),y=mP(),h=wP(l,{relative:u}),g=i.toLowerCase()==="get"?"get":"post",v=typeof l=="string"&&lN.test(l),S=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let A=N.nativeEvent.submitter,j=(A==null?void 0:A.getAttribute("formmethod"))||i,C=()=>y(A||N.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:r,state:s,relative:u,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w});b&&n!==!1?d.startTransition(()=>C()):C()};return d.createElement("form",{ref:x,method:g,action:h,onSubmit:a?c:S,...p,"data-discover":!v&&e==="render"?"true":void 0})});iP.displayName="Form";function lP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cN(e){let t=d.useContext(Wo);return Oe(t,lP(e)),t}function cP(e,{target:t,replace:n,state:a,preventScrollReset:r,relative:s,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let u=pi(),m=jn(),f=hc(e,{relative:s});return d.useCallback(w=>{if(LO(w,t)){w.preventDefault();let p=n!==void 0?n:za(m)===za(f),x=()=>u(e,{replace:p,state:a,preventScrollReset:r,relative:s,viewTransition:i,unstable_defaultShouldRevalidate:l});c?d.startTransition(()=>x()):x()}},[m,u,f,n,a,t,e,r,s,i,l,c])}function uP(e){wt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(pg(e)),n=d.useRef(!1),a=jn(),r=d.useMemo(()=>IO(a.search,n.current?null:t.current),[a.search]),s=pi(),i=d.useCallback((l,c)=>{const u=pg(typeof l=="function"?l(new URLSearchParams(r)):l);n.current=!0,s("?"+u,c)},[s,r]);return[r,i]}var dP=0,fP=()=>`__${String(++dP)}__`;function mP(){let{router:e}=cN("useSubmit"),{basename:t}=d.useContext($n),n=bO(),a=e.fetch,r=e.navigate;return d.useCallback(async(s,i={})=>{let{action:l,method:c,encType:u,formData:m,body:f}=UO(s,t);if(i.navigate===!1){let w=i.fetcherKey||fP();await a(w,n,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||u,flushSync:i.flushSync})}else await r(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,r,t,n])}function wP(e,{relative:t}={}){let{basename:n}=d.useContext($n),a=d.useContext(ca);Oe(a,"useFormAction must be used inside a RouteContext");let[r]=a.matches.slice(-1),s={...hc(e||".",{relative:t})},i=jn();if(e==null){s.search=i.search;let l=new URLSearchParams(s.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(f=>f).forEach(f=>l.append("index",f));let m=l.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:La([n,s.pathname])),za(s)}function pP(e,{relative:t}={}){let n=d.useContext(ug);Oe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cN("useViewTransitionState"),r=hc(e,{relative:t});if(!n.isTransitioning)return!1;let s=ia(n.currentLocation.pathname,a)||n.currentLocation.pathname,i=ia(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Wd(r.pathname,i)!=null||Wd(r.pathname,s)!=null}function hP(e){return d.createElement(EO,{flushSync:Eo.flushSync,...e})}/**58 */var rj=e=>{throw TypeError(e)},V3=(e,t,n)=>t.has(e)||rj("Cannot "+n),Qh=(e,t,n)=>(V3(e,t,"read from private field"),n?n.call(e):t.get(e)),G3=(e,t,n)=>t.has(e)?rj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),oj="popstate";function Y3(e={}){function t(r,s){let{pathname:i="/",search:l="",hash:c=""}=br(r.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),oc("",{pathname:i,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){let i=r.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let c=r.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof s=="string"?s:za(s))}function a(r,s){wt(r.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(s)})`)}return q3(t,n,a,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function K3(){return Math.random().toString(36).substring(2,10)}function sj(e,t){return{usr:e.state,key:e.key,idx:t}}function oc(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?br(t):t,state:n,key:t&&t.key||a||K3()}}function za({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function br(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function q3(e,t,n,a={}){let{window:r=document.defaultView,v5Compat:s=!1}=a,i=r.history,l="POP",c=null,d=m();d==null&&(d=0,i.replaceState({...i.state,idx:d},""));function m(){return(i.state||{idx:null}).idx}function f(){l="POP";let y=m(),h=y==null?null:y-d;d=y,c&&c({action:l,location:b.location,delta:h})}function w(y,h){l="PUSH";let g=oc(b.location,y,h);n&&n(g,y),d=m()+1;let v=sj(g,d),S=b.createHref(g);try{i.pushState(v,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;r.location.assign(S)}s&&c&&c({action:l,location:b.location,delta:1})}function p(y,h){l="REPLACE";let g=oc(b.location,y,h);n&&n(g,y),d=m();let v=sj(g,d),S=b.createHref(g);i.replaceState(v,"",S),s&&c&&c({action:l,location:b.location,delta:0})}function x(y){return ij(y)}let b={get action(){return l},get location(){return e(r,i)},listen(y){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(oj,f),c=y,()=>{r.removeEventListener(oj,f),c=null}},createHref(y){return t(r,y)},createURL:x,encodeLocation(y){let h=x(y);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:w,replace:p,go(y){return i.go(y)}};return b}function ij(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Oe(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:za(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var sc,lj=class{constructor(e){if(G3(this,sc,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Qh(this,sc).has(e))return Qh(this,sc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Qh(this,sc).set(e,t)}};sc=new WeakMap;var X3=new Set(["lazy","caseSensitive","path","id","index","children"]);function W3(e){return X3.has(e)}var Z3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Q3(e){return Z3.has(e)}function J3(e){return e.index===!0}function ic(e,t,n=[],a={},r=!1){return e.map((s,i)=>{let l=[...n,String(i)],c=typeof s.id=="string"?s.id:l.join("-");if(Oe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Oe(r||!a[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),J3(s)){let d={...s,id:c};return a[c]=cj(d,t(d)),d}else{let d={...s,id:c,children:void 0};return a[c]=cj(d,t(d)),s.children&&(d.children=ic(s.children,t,l,a,r)),d}})}function cj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function so(e,t,n="/"){return lc(e,t,n,!1)}function lc(e,t,n,a){let r=typeof t=="string"?br(t):t,s=ia(r.pathname||"/",n);if(s==null)return null;let i=uj(e);tD(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let d=fD(s);l=uD(i[c],d,a)}return l}function eD(e,t){let{route:n,pathname:a,params:r}=e;return{id:n.id,pathname:a,params:r,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function uj(e,t=[],n=[],a="",r=!1){let s=(i,l,c=r,d)=>{let m={relativePath:d===void 0?i.path||"":d,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&c)return;Oe(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let f=La([a,m.relativePath]),w=n.concat(m);i.children&&i.children.length>0&&(Oe(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),uj(i.children,t,w,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:lD(f,i.index),routesMeta:w})};return e.forEach((i,l)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))s(i,l);else for(let d of dj(i.path))s(i,l,!0,d)}),t}function dj(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return r?[s,""]:[s];let i=dj(a.join("/")),l=[];return l.push(...i.map(c=>c===""?s:[s,c].join("/"))),r&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function tD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cD(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var nD=/^:[\w-]+$/,aD=3,rD=2,oD=1,sD=10,iD=-2,fj=e=>e==="*";function lD(e,t){let n=e.split("/"),a=n.length;return n.some(fj)&&(a+=iD),t&&(a+=rD),n.filter(r=>!fj(r)).reduce((r,s)=>r+(nD.test(s)?aD:s===""?oD:sD),a)}function cD(e,t){return e.length===t.length&&e.slice(0,-1).every((a,r)=>a===t[r])?e[e.length-1]-t[t.length-1]:0}function uD(e,t,n=!1){let{routesMeta:a}=e,r={},s="/",i=[];for(let l=0;l<a.length;++l){let c=a[l],d=l===a.length-1,m=s==="/"?t:t.slice(s.length)||"/",f=Wd({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),w=c.route;if(!f&&d&&n&&!a[a.length-1].route.index&&(f=Wd({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!f)return null;Object.assign(r,f.params),i.push({params:r,pathname:La([s,f.pathname]),pathnameBase:pD(La([s,f.pathnameBase])),route:w}),f.pathnameBase!=="/"&&(s=La([s,f.pathnameBase]))}return i}function Wd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=dD(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let s=r[0],i=s.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:a.reduce((d,{paramName:m,isOptional:f},w)=>{if(m==="*"){let x=l[w]||"";i=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const p=l[w];return f&&!p?d[m]=void 0:d[m]=(p||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:i,pattern:e}}function dD(e,t=!1,n=!0){wt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(a.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),a]}function fD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ia(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function mD({basename:e,pathname:t}){return t==="/"?e:La([e,t])}var mj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jh=e=>mj.test(e);function wD(e,t="/"){let{pathname:n,search:a="",hash:r=""}=typeof e=="string"?br(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=wj(n.substring(1),"/"):s=wj(n,t)):s=t,{pathname:s,search:hD(a),hash:gD(r)}}function wj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function eg(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zd(e){let t=pj(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Qd(e,t,n,a=!1){let r;typeof e=="string"?r=br(e):(r={...e},Oe(!r.pathname||!r.pathname.includes("?"),eg("?","pathname","search",r)),Oe(!r.pathname||!r.pathname.includes("#"),eg("#","pathname","hash",r)),Oe(!r.search||!r.search.includes("#"),eg("#","search","hash",r)));let s=e===""||r.pathname==="",i=s?"/":r.pathname,l;if(i==null)l=n;else{let f=t.length-1;if(!a&&i.startsWith("..")){let w=i.split("/");for(;w[0]==="..";)w.shift(),f-=1;r.pathname=w.join("/")}l=f>=0?t[f]:"/"}let c=wD(r,l),d=i&&i!=="/"&&i.endsWith("/"),m=(s||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}var La=e=>e.join("/").replace(/\/\/+/g,"/"),pD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,cc=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dc(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gj(e,t){let n=e;if(typeof n!="string"||!mj.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,r=!1;if(hj)try{let s=new URL(window.location.href),i=n.startsWith("//")?new URL(s.protocol+n):new URL(n),l=ia(i.pathname,t);i.origin===s.origin&&l!=null?n=l+i.search+i.hash:r=!0}catch{wt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:r,to:n}}var io=Symbol("Uninstrumented");function xD(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(r=>r({id:t.id,index:t.index,path:t.path,instrument(s){let i=Object.keys(n);for(let l of i)s[l]&&n[l].push(s[l])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let r=di(n.lazy,t.lazy,()=>{});r&&(a.lazy=r)}if(typeof t.lazy=="object"){let r=t.lazy;["middleware","loader","action"].forEach(s=>{let i=r[s],l=n[`lazy.${s}`];if(typeof i=="function"&&l.length>0){let c=di(l,i,()=>{});c&&(a.lazy=Object.assign(a.lazy||{},{[s]:c}))}})}return["loader","action"].forEach(r=>{let s=t[r];if(typeof s=="function"&&n[r].length>0){let i=s[io]??s,l=di(n[r],i,(...c)=>bj(c[0]));l&&(r==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[io]=i,a[r]=l)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(r=>{let s=r[io]??r,i=di(n.middleware,s,(...l)=>bj(l[0]));return i?(i[io]=s,i):r})),a}function bD(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(r){let s=Object.keys(r);for(let i of s)r[i]&&n[i].push(r[i])}})),n.navigate.length>0){let a=e.navigate[io]??e.navigate,r=di(n.navigate,a,(...s)=>{let[i,l]=s;return{to:typeof i=="number"||typeof i=="string"?i:i?za(i):".",...vj(e,l??{})}});r&&(r[io]=a,e.navigate=r)}if(n.fetch.length>0){let a=e.fetch[io]??e.fetch,r=di(n.fetch,a,(...s)=>{let[i,,l,c]=s;return{href:l??".",fetcherKey:i,...vj(e,c??{})}});r&&(r[io]=a,e.fetch=r)}return e}function di(e,t,n){return e.length===0?null:async(...a)=>{let r=await xj(e,n(...a),()=>t(...a),e.length-1);if(r.type==="error")throw r.value;return r.value}}async function xj(e,t,n,a){let r=e[a],s;if(r){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=xj(e,t,n,a-1),s=await i,Oe(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await r(l,t)}catch(c){console.error("An instrumentation function threw an error:",c)}i||await l(),await i}else try{s={type:"success",value:await n()}}catch(i){s={type:"error",value:i}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function bj(e){let{request:t,context:n,params:a,unstable_pattern:r}=e;return{request:vD(t),params:{...a},unstable_pattern:r,context:yD(n)}}function vj(e,t){return{currentUrl:za(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function vD(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function yD(e){if(jD(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var SD=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jD(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===SD}var yj=["POST","PUT","PATCH","DELETE"],ND=new Set(yj),CD=["GET",...yj],AD=new Set(CD),Sj=new Set([301,302,303,307,308]),_D=new Set([307,308]),tg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ED={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},TD=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),jj="remix-router-transitions",Nj=Symbol("ResetLoaderData");function RD(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],r=e.mapRouteProperties||TD,s=r;if(e.unstable_instrumentations){let k=e.unstable_instrumentations;s=L=>({...r(L),...xD(k.map(U=>U.route).filter(Boolean),L)})}let i={},l=ic(e.routes,s,void 0,i),c,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||PD,f={...e.future},w=null,p=new Set,x=null,b=null,y=null,h=e.hydrationData!=null,g=so(l,e.history.location,d),v=!1,S=null,N;if(g==null&&!e.patchRoutesOnNavigation){let k=la(404,{pathname:e.history.location.pathname}),{matches:L,route:U}=Jd(l);N=!0,g=L,S={[U.id]:k}}else if(g&&!e.hydrationData&&kt(g,l,e.history.location.pathname).active&&(g=null),g)if(g.some(k=>k.route.lazy))N=!1;else if(!g.some(k=>ag(k.route)))N=!0;else{let k=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;if(L){let U=g.findIndex(W=>L[W.route.id]!==void 0);N=g.slice(0,U+1).every(W=>!rg(W.route,k,L))}else N=g.every(U=>!rg(U.route,k,L))}else{N=!1,g=[];let k=kt(null,l,e.history.location.pathname);k.active&&k.matches&&(v=!0,g=k.matches)}let A,j={historyAction:e.history.action,location:e.history.location,matches:g,initialized:N,navigation:tg,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},C="POP",R=null,M=!1,z,B=!1,I=new Map,V=null,D=!1,T=!1,O=new Set,_=new Map,$=0,H=-1,F=new Map,Q=new Set,X=new Map,P=new Map,G=new Set,ne=new Map,Y,Z=null;function le(){if(w=e.history.listen(({action:k,location:L,delta:U})=>{if(Y){Y(),Y=void 0;return}wt(ne.size===0||U!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let W=ie({currentLocation:j.location,nextLocation:L,historyAction:k});if(W&&U!=null){let te=new Promise(xe=>{Y=xe});e.history.go(U*-1),Za(W,{state:"blocked",location:L,proceed(){Za(W,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),te.then(()=>e.history.go(U))},reset(){let xe=new Map(j.blockers);xe.set(W,fc),K({blockers:xe})}}),R==null||R.resolve(),R=null;return}return Ke(k,L)}),n){JD(t,I);let k=()=>eO(t,I);t.addEventListener("pagehide",k),V=()=>t.removeEventListener("pagehide",k)}return j.initialized||Ke("POP",j.location,{initialHydration:!0}),A}function he(){w&&w(),V&&V(),p.clear(),z&&z.abort(),j.fetchers.forEach((k,L)=>ze(L)),j.blockers.forEach((k,L)=>rn(L))}function ae(k){return p.add(k),()=>p.delete(k)}function K(k,L={}){k.matches&&(k.matches=k.matches.map(te=>{let xe=i[te.route.id],je=te.route;return je.element!==xe.element||je.errorElement!==xe.errorElement||je.hydrateFallbackElement!==xe.hydrateFallbackElement?{...te,route:xe}:te})),j={...j,...k};let U=[],W=[];j.fetchers.forEach((te,xe)=>{te.state==="idle"&&(G.has(xe)?U.push(xe):W.push(xe))}),G.forEach(te=>{!j.fetchers.has(te)&&!_.has(te)&&U.push(te)}),[...p].forEach(te=>te(j,{deletedFetchers:U,newErrors:k.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),U.forEach(te=>ze(te)),W.forEach(te=>j.fetchers.delete(te))}function ge(k,L,{flushSync:U}={}){var Me,be;let W=j.actionData!=null&&j.navigation.formMethod!=null&&sn(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Me=k.state)==null?void 0:Me._isRedirect)!==!0,te;L.actionData?Object.keys(L.actionData).length>0?te=L.actionData:te=null:W?te=j.actionData:te=null;let xe=L.loaderData?$j(j.loaderData,L.loaderData,L.matches||[],L.errors):j.loaderData,je=j.blockers;je.size>0&&(je=new Map(je),je.forEach((De,Fe)=>je.set(Fe,fc)));let ce=D?!1:dt(k,L.matches||j.matches),pe=M===!0||j.navigation.formMethod!=null&&sn(j.navigation.formMethod)&&((be=k.state)==null?void 0:be._isRedirect)!==!0;c&&(l=c,c=void 0),D||C==="POP"||(C==="PUSH"?e.history.push(k,k.state):C==="REPLACE"&&e.history.replace(k,k.state));let ve;if(C==="POP"){let De=I.get(j.location.pathname);De&&De.has(k.pathname)?ve={currentLocation:j.location,nextLocation:k}:I.has(k.pathname)&&(ve={currentLocation:k,nextLocation:j.location})}else if(B){let De=I.get(j.location.pathname);De?De.add(k.pathname):(De=new Set([k.pathname]),I.set(j.location.pathname,De)),ve={currentLocation:j.location,nextLocation:k}}K({...L,actionData:te,loaderData:xe,historyAction:C,location:k,initialized:!0,navigation:tg,revalidation:"idle",restoreScrollPosition:ce,preventScrollReset:pe,blockers:je},{viewTransitionOpts:ve,flushSync:U===!0}),C="POP",M=!1,B=!1,D=!1,T=!1,R==null||R.resolve(),R=null,Z==null||Z.resolve(),Z=null}async function Ce(k,L){if(R==null||R.resolve(),R=null,typeof k=="number"){R||(R=Vj());let Fe=R.promise;return e.history.go(k),Fe}let U=ng(j.location,j.matches,d,k,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:W,submission:te,error:xe}=Cj(!1,U,L),je=j.location,ce=oc(j.location,W,L&&L.state);ce={...ce,...e.history.encodeLocation(ce)};let pe=L&&L.replace!=null?L.replace:void 0,ve="PUSH";pe===!0?ve="REPLACE":pe===!1||te!=null&&sn(te.formMethod)&&te.formAction===j.location.pathname+j.location.search&&(ve="REPLACE");let Me=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,be=(L&&L.flushSync)===!0,De=ie({currentLocation:je,nextLocation:ce,historyAction:ve});if(De){Za(De,{state:"blocked",location:ce,proceed(){Za(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Ce(k,L)},reset(){let Fe=new Map(j.blockers);Fe.set(De,fc),K({blockers:Fe})}});return}await Ke(ve,ce,{submission:te,pendingError:xe,preventScrollReset:Me,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:be,callSiteDefaultShouldRevalidate:L&&L.unstable_defaultShouldRevalidate})}function We(){Z||(Z=Vj()),qn(),K({revalidation:"loading"});let k=Z.promise;return j.navigation.state==="submitting"?k:j.navigation.state==="idle"?(Ke(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),k):(Ke(C||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:B===!0}),k)}async function Ke(k,L,U){z&&z.abort(),z=null,C=k,D=(U&&U.startUninterruptedRevalidation)===!0,Je(j.location,j.matches),M=(U&&U.preventScrollReset)===!0,B=(U&&U.enableViewTransition)===!0;let W=c||l,te=U&&U.overrideNavigation,xe=U!=null&&U.initialHydration&&j.matches&&j.matches.length>0&&!v?j.matches:so(W,L,d),je=(U&&U.flushSync)===!0;if(xe&&j.initialized&&!T&&FD(j.location,L)&&!(U&&U.submission&&sn(U.submission.formMethod))){ge(L,{matches:xe},{flushSync:je});return}let ce=kt(xe,W,L.pathname);if(ce.active&&ce.matches&&(xe=ce.matches),!xe){let{error:Zt,notFoundMatches:pn,route:rt}=Ee(L.pathname);ge(L,{matches:pn,loaderData:{},errors:{[rt.id]:Zt}},{flushSync:je});return}z=new AbortController;let pe=mi(e.history,L,z.signal,U&&U.submission),ve=e.getContext?await e.getContext():new lj,Me;if(U&&U.pendingError)Me=[lo(xe).route.id,{type:"error",error:U.pendingError}];else if(U&&U.submission&&sn(U.submission.formMethod)){let Zt=await at(pe,L,U.submission,xe,ve,ce.active,U&&U.initialHydration===!0,{replace:U.replace,flushSync:je});if(Zt.shortCircuited)return;if(Zt.pendingActionResult){let[pn,rt]=Zt.pendingActionResult;if(In(rt)&&uc(rt.error)&&rt.error.status===404){z=null,ge(L,{matches:Zt.matches,loaderData:{},errors:{[pn]:rt.error}});return}}xe=Zt.matches||xe,Me=Zt.pendingActionResult,te=cg(L,U.submission),je=!1,ce.active=!1,pe=mi(e.history,pe.url,pe.signal)}let{shortCircuited:be,matches:De,loaderData:Fe,errors:on}=await Kt(pe,L,xe,ve,ce.active,te,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,je,Me,U&&U.callSiteDefaultShouldRevalidate);be||(z=null,ge(L,{matches:De||xe,...Bj(Me),loaderData:Fe,errors:on}))}async function at(k,L,U,W,te,xe,je,ce={}){qn();let pe=ZD(L,U);if(K({navigation:pe},{flushSync:ce.flushSync===!0}),xe){let be=await Mr(W,L.pathname,k.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:Fe,route:on}=Jd(l);return{matches:Fe,pendingActionResult:[on.id,{type:"error",error:be.error}]}}let De=lo(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[De,{type:"error",error:be.error}]}}else if(be.matches)W=be.matches;else{let{notFoundMatches:De,error:Fe,route:on}=Ee(L.pathname);return{matches:De,pendingActionResult:[on.id,{type:"error",error:Fe}]}}}let ve,Me=tf(W,L);if(!Me.route.action&&!Me.route.lazy)ve={type:"error",error:la(405,{method:k.method,pathname:L.pathname,routeId:Me.route.id})};else{let be=fi(s,i,k,W,Me,je?[]:a,te),De=await wn(k,be,te,null);if(ve=De[Me.route.id],!ve){for(let Fe of W)if(De[Fe.route.id]){ve=De[Fe.route.id];break}}if(k.signal.aborted)return{shortCircuited:!0}}if(Xo(ve)){let be;return ce&&ce.replace!=null?be=ce.replace:be=zj(ve.response.headers.get("Location"),new URL(k.url),d,e.history)===j.location.pathname+j.location.search,await an(k,ve,!0,{submission:U,replace:be}),{shortCircuited:!0}}if(In(ve)){let be=lo(W,Me.route.id);return(ce&&ce.replace)!==!0&&(C="PUSH"),{matches:W,pendingActionResult:[be.route.id,ve,Me.route.id]}}return{matches:W,pendingActionResult:[Me.route.id,ve]}}async function Kt(k,L,U,W,te,xe,je,ce,pe,ve,Me,be,De){let Fe=xe||cg(L,je),on=je||ce||Fj(Fe),Zt=!D&&!ve;if(te){if(Zt){let cn=He(be);K({navigation:Fe,...cn!==void 0?{actionData:cn}:{}},{flushSync:Me})}let Ye=await Mr(U,L.pathname,k.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){if(Ye.partialMatches.length===0){let{matches:sl,route:ys}=Jd(l);return{matches:sl,loaderData:{},errors:{[ys.id]:Ye.error}}}let cn=lo(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,loaderData:{},errors:{[cn]:Ye.error}}}else if(Ye.matches)U=Ye.matches;else{let{error:cn,notFoundMatches:sl,route:ys}=Ee(L.pathname);return{matches:sl,loaderData:{},errors:{[ys.id]:cn}}}}let pn=c||l,{dsMatches:rt,revalidatingFetchers:ha}=Aj(k,W,s,i,e.history,j,U,on,L,ve?[]:a,ve===!0,T,O,G,X,Q,pn,d,e.patchRoutesOnNavigation!=null,be,De);if(H=++$,!e.dataStrategy&&!rt.some(Ye=>Ye.shouldLoad)&&!rt.some(Ye=>Ye.route.middleware&&Ye.route.middleware.length>0)&&ha.length===0){let Ye=pa();return ge(L,{matches:U,loaderData:{},errors:be&&In(be[1])?{[be[0]]:be[1].error}:null,...Bj(be),...Ye?{fetchers:new Map(j.fetchers)}:{}},{flushSync:Me}),{shortCircuited:!0}}if(Zt){let Ye={};if(!te){Ye.navigation=Fe;let cn=He(be);cn!==void 0&&(Ye.actionData=cn)}ha.length>0&&(Ye.fetchers=qt(ha)),K(Ye,{flushSync:Me})}ha.forEach(Ye=>{Ge(Ye.key),Ye.controller&&_.set(Ye.key,Ye.controller)});let bs=()=>ha.forEach(Ye=>Ge(Ye.key));z&&z.signal.addEventListener("abort",bs);let{loaderResults:Su,fetcherResults:Ao}=await An(rt,ha,k,W);if(k.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",bs),ha.forEach(Ye=>_.delete(Ye.key));let Qa=ef(Su);if(Qa)return await an(k,Qa.result,!0,{replace:pe}),{shortCircuited:!0};if(Qa=ef(Ao),Qa)return Q.add(Qa.key),await an(k,Qa.result,!0,{replace:pe}),{shortCircuited:!0};let{loaderData:Av,errors:ju}=Ij(j,U,Su,be,ha,Ao);ve&&j.errors&&(ju={...j.errors,...ju});let vs=pa(),ww=Xn(H),pw=vs||ww||ha.length>0;return{matches:U,loaderData:Av,errors:ju,...pw?{fetchers:new Map(j.fetchers)}:{}}}function He(k){if(k&&!In(k[1]))return{[k[0]]:k[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function qt(k){return k.forEach(L=>{let U=j.fetchers.get(L.key),W=wc(void 0,U?U.data:void 0);j.fetchers.set(L.key,W)}),new Map(j.fetchers)}async function Cn(k,L,U,W){Ge(k);let te=(W&&W.flushSync)===!0,xe=c||l,je=ng(j.location,j.matches,d,U,L,W==null?void 0:W.relative),ce=so(xe,je,d),pe=kt(ce,xe,je);if(pe.active&&pe.matches&&(ce=pe.matches),!ce){ye(k,L,la(404,{pathname:je}),{flushSync:te});return}let{path:ve,submission:Me,error:be}=Cj(!0,je,W);if(be){ye(k,L,be,{flushSync:te});return}let De=e.getContext?await e.getContext():new lj,Fe=(W&&W.preventScrollReset)===!0;if(Me&&sn(Me.formMethod)){await mt(k,L,ve,ce,De,pe.active,te,Fe,Me,W&&W.unstable_defaultShouldRevalidate);return}X.set(k,{routeId:L,path:ve}),await Xt(k,L,ve,ce,De,pe.active,te,Fe,Me)}async function mt(k,L,U,W,te,xe,je,ce,pe,ve){qn(),X.delete(k);let Me=j.fetchers.get(k);oe(k,QD(pe,Me),{flushSync:je});let be=new AbortController,De=mi(e.history,U,be.signal,pe);if(xe){let vt=await Mr(W,new URL(De.url).pathname,De.signal,k);if(vt.type==="aborted")return;if(vt.type==="error"){ye(k,L,vt.error,{flushSync:je});return}else if(vt.matches)W=vt.matches;else{ye(k,L,la(404,{pathname:U}),{flushSync:je});return}}let Fe=tf(W,U);if(!Fe.route.action&&!Fe.route.lazy){let vt=la(405,{method:pe.formMethod,pathname:U,routeId:L});ye(k,L,vt,{flushSync:je});return}_.set(k,be);let on=$,Zt=fi(s,i,De,W,Fe,a,te),pn=await wn(De,Zt,te,k),rt=pn[Fe.route.id];if(!rt){for(let vt of Zt)if(pn[vt.route.id]){rt=pn[vt.route.id];break}}if(De.signal.aborted){_.get(k)===be&&_.delete(k);return}if(G.has(k)){if(Xo(rt)||In(rt)){oe(k,vr(void 0));return}}else{if(Xo(rt))if(_.delete(k),H>on){oe(k,vr(void 0));return}else return Q.add(k),oe(k,wc(pe)),an(De,rt,!1,{fetcherSubmission:pe,preventScrollReset:ce});if(In(rt)){ye(k,L,rt.error);return}}let ha=j.navigation.location||j.location,bs=mi(e.history,ha,be.signal),Su=c||l,Ao=j.navigation.state!=="idle"?so(Su,j.navigation.location,d):j.matches;Oe(Ao,"Didn't find any matches after fetcher action");let Qa=++$;F.set(k,Qa);let Av=wc(pe,rt.data);j.fetchers.set(k,Av);let{dsMatches:ju,revalidatingFetchers:vs}=Aj(bs,te,s,i,e.history,j,Ao,pe,ha,a,!1,T,O,G,X,Q,Su,d,e.patchRoutesOnNavigation!=null,[Fe.route.id,rt],ve);vs.filter(vt=>vt.key!==k).forEach(vt=>{let hw=vt.key,KM=j.fetchers.get(hw),TJ=wc(void 0,KM?KM.data:void 0);j.fetchers.set(hw,TJ),Ge(hw),vt.controller&&_.set(hw,vt.controller)}),K({fetchers:new Map(j.fetchers)});let ww=()=>vs.forEach(vt=>Ge(vt.key));be.signal.addEventListener("abort",ww);let{loaderResults:pw,fetcherResults:Ye}=await An(ju,vs,bs,te);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",ww),F.delete(k),_.delete(k),vs.forEach(vt=>_.delete(vt.key)),j.fetchers.has(k)){let vt=vr(rt.data);j.fetchers.set(k,vt)}let cn=ef(pw);if(cn)return an(bs,cn.result,!1,{preventScrollReset:ce});if(cn=ef(Ye),cn)return Q.add(cn.key),an(bs,cn.result,!1,{preventScrollReset:ce});let{loaderData:sl,errors:ys}=Ij(j,Ao,pw,void 0,vs,Ye);Xn(Qa),j.navigation.state==="loading"&&Qa>H?(Oe(C,"Expected pending action"),z&&z.abort(),ge(j.navigation.location,{matches:Ao,loaderData:sl,errors:ys,fetchers:new Map(j.fetchers)})):(K({errors:ys,loaderData:$j(j.loaderData,sl,Ao,ys),fetchers:new Map(j.fetchers)}),T=!1)}async function Xt(k,L,U,W,te,xe,je,ce,pe){let ve=j.fetchers.get(k);oe(k,wc(pe,ve?ve.data:void 0),{flushSync:je});let Me=new AbortController,be=mi(e.history,U,Me.signal);if(xe){let rt=await Mr(W,new URL(be.url).pathname,be.signal,k);if(rt.type==="aborted")return;if(rt.type==="error"){ye(k,L,rt.error,{flushSync:je});return}else if(rt.matches)W=rt.matches;else{ye(k,L,la(404,{pathname:U}),{flushSync:je});return}}let De=tf(W,U);_.set(k,Me);let Fe=$,on=fi(s,i,be,W,De,a,te),pn=(await wn(be,on,te,k))[De.route.id];if(_.get(k)===Me&&_.delete(k),!be.signal.aborted){if(G.has(k)){oe(k,vr(void 0));return}if(Xo(pn))if(H>Fe){oe(k,vr(void 0));return}else{Q.add(k),await an(be,pn,!1,{preventScrollReset:ce});return}if(In(pn)){ye(k,L,pn.error);return}oe(k,vr(pn.data))}}async function an(k,L,U,{submission:W,fetcherSubmission:te,preventScrollReset:xe,replace:je}={}){U||(R==null||R.resolve(),R=null),L.response.headers.has("X-Remix-Revalidate")&&(T=!0);let ce=L.response.headers.get("Location");Oe(ce,"Expected a Location header on the redirect Response"),ce=zj(ce,new URL(k.url),d,e.history);let pe=oc(j.location,ce,{_isRedirect:!0});if(n){let on=!1;if(L.response.headers.has("X-Remix-Reload-Document"))on=!0;else if(Jh(ce)){const Zt=ij(ce,!0);on=Zt.origin!==t.location.origin||ia(Zt.pathname,d)==null}if(on){je?t.location.replace(ce):t.location.assign(ce);return}}z=null;let ve=je===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Me,formAction:be,formEncType:De}=j.navigation;!W&&!te&&Me&&be&&De&&(W=Fj(j.navigation));let Fe=W||te;if(_D.has(L.response.status)&&Fe&&sn(Fe.formMethod))await Ke(ve,pe,{submission:{...Fe,formAction:ce},preventScrollReset:xe||M,enableViewTransition:U?B:void 0});else{let on=cg(pe,W);await Ke(ve,pe,{overrideNavigation:on,fetcherSubmission:te,preventScrollReset:xe||M,enableViewTransition:U?B:void 0})}}async function wn(k,L,U,W){var je;let te,xe={};try{te=await LD(m,k,L,W,U,!1)}catch(ce){return L.filter(pe=>pe.shouldLoad).forEach(pe=>{xe[pe.route.id]={type:"error",error:ce}}),xe}if(k.signal.aborted)return xe;if(!sn(k.method))for(let ce of L){if(((je=te[ce.route.id])==null?void 0:je.type)==="error")break;!te.hasOwnProperty(ce.route.id)&&!j.loaderData.hasOwnProperty(ce.route.id)&&(!j.errors||!j.errors.hasOwnProperty(ce.route.id))&&ce.shouldCallHandler()&&(te[ce.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ce.route.id}`)})}for(let[ce,pe]of Object.entries(te))if(KD(pe)){let ve=pe.result;xe[ce]={type:"redirect",response:UD(ve,k,ce,L,d)}}else xe[ce]=await BD(pe);return xe}async function An(k,L,U,W){let te=wn(U,k,W,null),xe=Promise.all(L.map(async pe=>{if(pe.matches&&pe.match&&pe.request&&pe.controller){let Me=(await wn(pe.request,pe.matches,W,pe.key))[pe.match.route.id];return{[pe.key]:Me}}else return Promise.resolve({[pe.key]:{type:"error",error:la(404,{pathname:pe.path})}})})),je=await te,ce=(await xe).reduce((pe,ve)=>Object.assign(pe,ve),{});return{loaderResults:je,fetcherResults:ce}}function qn(){T=!0,X.forEach((k,L)=>{_.has(L)&&O.add(L),Ge(L)})}function oe(k,L,U={}){j.fetchers.set(k,L),K({fetchers:new Map(j.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function ye(k,L,U,W={}){let te=lo(j.matches,L);ze(k),K({errors:{[te.route.id]:U},fetchers:new Map(j.fetchers)},{flushSync:(W&&W.flushSync)===!0})}function we(k){return P.set(k,(P.get(k)||0)+1),G.has(k)&&G.delete(k),j.fetchers.get(k)||ED}function Ve(k,L){Ge(k,L==null?void 0:L.reason),oe(k,vr(null))}function ze(k){let L=j.fetchers.get(k);_.has(k)&&!(L&&L.state==="loading"&&F.has(k))&&Ge(k),X.delete(k),F.delete(k),Q.delete(k),G.delete(k),O.delete(k),j.fetchers.delete(k)}function Wt(k){let L=(P.get(k)||0)-1;L<=0?(P.delete(k),G.add(k)):P.set(k,L),K({fetchers:new Map(j.fetchers)})}function Ge(k,L){let U=_.get(k);U&&(U.abort(L),_.delete(k))}function Ea(k){for(let L of k){let U=we(L),W=vr(U.data);j.fetchers.set(L,W)}}function pa(){let k=[],L=!1;for(let U of Q){let W=j.fetchers.get(U);Oe(W,`Expected fetcher: ${U}`),W.state==="loading"&&(Q.delete(U),k.push(U),L=!0)}return Ea(k),L}function Xn(k){let L=[];for(let[U,W]of F)if(W<k){let te=j.fetchers.get(U);Oe(te,`Expected fetcher: ${U}`),te.state==="loading"&&(Ge(U),F.delete(U),L.push(U))}return Ea(L),L.length>0}function Ta(k,L){let U=j.blockers.get(k)||fc;return ne.get(k)!==L&&ne.set(k,L),U}function rn(k){j.blockers.delete(k),ne.delete(k)}function Za(k,L){let U=j.blockers.get(k)||fc;Oe(U.state==="unblocked"&&L.state==="blocked"||U.state==="blocked"&&L.state==="blocked"||U.state==="blocked"&&L.state==="proceeding"||U.state==="blocked"&&L.state==="unblocked"||U.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${U.state} -> ${L.state}`);let W=new Map(j.blockers);W.set(k,L),K({blockers:W})}function ie({currentLocation:k,nextLocation:L,historyAction:U}){if(ne.size===0)return;ne.size>1&&wt(!1,"A router only supports one blocker at a time");let W=Array.from(ne.entries()),[te,xe]=W[W.length-1],je=j.blockers.get(te);if(!(je&&je.state==="proceeding")&&xe({currentLocation:k,nextLocation:L,historyAction:U}))return te}function Ee(k){let L=la(404,{pathname:k}),U=c||l,{matches:W,route:te}=Jd(U);return{notFoundMatches:W,route:te,error:L}}function $e(k,L,U){if(x=k,y=L,b=U||null,!h&&j.navigation===tg){h=!0;let W=dt(j.location,j.matches);W!=null&&K({restoreScrollPosition:W})}return()=>{x=null,y=null,b=null}}function re(k,L){return b&&b(k,L.map(W=>eD(W,j.loaderData)))||k.key}function Je(k,L){if(x&&y){let U=re(k,L);x[U]=y()}}function dt(k,L){if(x){let U=re(k,L),W=x[U];if(typeof W=="number")return W}return null}function kt(k,L,U){if(e.patchRoutesOnNavigation)if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:lc(L,U,d,!0)}}else return{active:!0,matches:lc(L,U,d,!0)||[]};return{active:!1,matches:null}}async function Mr(k,L,U,W){if(!e.patchRoutesOnNavigation)return{type:"success",matches:k};let te=k;for(;;){let xe=c==null,je=c||l,ce=i;try{await e.patchRoutesOnNavigation({signal:U,path:L,matches:te,fetcherKey:W,patch:(Me,be)=>{U.aborted||_j(Me,be,je,ce,s,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:te}}finally{xe&&!U.aborted&&(l=[...l])}if(U.aborted)return{type:"aborted"};let pe=so(je,L,d),ve=null;if(pe){if(Object.keys(pe[0].params).length===0)return{type:"success",matches:pe};if(ve=lc(je,L,d,!0),!(ve&&te.length<ve.length&&Mt(te,ve.slice(0,te.length))))return{type:"success",matches:pe}}if(ve||(ve=lc(je,L,d,!0)),!ve||Mt(te,ve))return{type:"success",matches:null};te=ve}}function Mt(k,L){return k.length===L.length&&k.every((U,W)=>U.route.id===L[W].route.id)}function _n(k){i={},c=ic(k,s,void 0,i)}function ol(k,L,U=!1){let W=c==null;_j(k,L,c||l,i,s,U),W&&(l=[...l],K({}))}return A={get basename(){return d},get future(){return f},get state(){return j},get routes(){return l},get window(){return t},initialize:le,subscribe:ae,enableScrollRestoration:$e,navigate:Ce,fetch:Cn,revalidate:We,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:we,resetFetcher:Ve,deleteFetcher:Wt,dispose:he,getBlocker:Ta,deleteBlocker:rn,patchRoutes:ol,_internalFetchControllers:_,_internalSetRoutes:_n,_internalSetStateDoNotUseOrYouWillBreakYourApp(k){K(k)}},e.unstable_instrumentations&&(A=bD(A,e.unstable_instrumentations.map(k=>k.router).filter(Boolean))),A}function kD(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ng(e,t,n,a,r,s){let i,l;if(r){i=[];for(let d of t)if(i.push(d),d.route.id===r){l=d;break}}else i=t,l=t[t.length-1];let c=Qd(a||".",Zd(i),ia(e.pathname,n)||e.pathname,s==="path");if(a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&l){let d=lg(c.search);if(l.route.index&&!d)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&d){let m=new URLSearchParams(c.search),f=m.getAll("index");m.delete("index"),f.filter(p=>p).forEach(p=>m.append("index",p));let w=m.toString();c.search=w?`?${w}`:""}}return n!=="/"&&(c.pathname=mD({basename:n,pathname:c.pathname})),za(c)}function Cj(e,t,n){if(!n||!kD(n))return{path:t};if(n.formMethod&&!WD(n.formMethod))return{path:t,error:la(405,{method:n.formMethod})};let a=()=>({path:t,error:la(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),i=Uj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sn(s))return a();let f=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,[p,x])=>`${w}${p}=${x} 59 `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:i,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if(n.formEncType==="application/json"){if(!sn(s))return a();try{let f=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:i,formEncType:n.formEncType,formData:void 0,json:f,text:void 0}}}catch{return a()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=sg(n.formData),c=n.formData;else if(n.body instanceof FormData)l=sg(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=Lj(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=Lj(l)}catch{return a()}let d={formMethod:s,formAction:i,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(sn(d.formMethod))return{path:t,submission:d};let m=br(t);return e&&m.search&&lg(m.search)&&l.append("index",""),m.search=`?${l}`,{path:za(m),submission:d}}function Aj(e,t,n,a,r,s,i,l,c,d,m,f,w,p,x,b,y,h,g,v,S){var D;let N=v?In(v[1])?v[1].error:v[1].data:void 0,A=r.createURL(s.location),j=r.createURL(c),C;if(m&&s.errors){let T=Object.keys(s.errors)[0];C=i.findIndex(O=>O.route.id===T)}else if(v&&In(v[1])){let T=v[0];C=i.findIndex(O=>O.route.id===T)-1}let R=v?v[1].statusCode:void 0,M=R&&R>=400,z={currentUrl:A,currentParams:((D=s.matches[0])==null?void 0:D.params)||{},nextUrl:j,nextParams:i[0].params,...l,actionResult:N,actionStatus:R},B=dc(i),I=i.map((T,O)=>{let{route:_}=T,$=null;if(C!=null&&O>C?$=!1:_.lazy?$=!0:ag(_)?m?$=rg(_,s.loaderData,s.errors):MD(s.loaderData,s.matches[O],T)&&($=!0):$=!1,$!==null)return og(n,a,e,B,T,d,t,$);let H=!1;typeof S=="boolean"?H=S:M?H=!1:(f||A.pathname+A.search===j.pathname+j.search||A.search!==j.search||DD(s.matches[O],T))&&(H=!0);let F={...z,defaultShouldRevalidate:H},Q=mc(T,F);return og(n,a,e,B,T,d,t,Q,F,S)}),V=[];return x.forEach((T,O)=>{if(m||!i.some(G=>G.route.id===T.routeId)||p.has(O))return;let _=s.fetchers.get(O),$=_&&_.state!=="idle"&&_.data===void 0,H=so(y,T.path,h);if(!H){if(g&&$)return;V.push({key:O,routeId:T.routeId,path:T.path,matches:null,match:null,request:null,controller:null});return}if(b.has(O))return;let F=tf(H,T.path),Q=new AbortController,X=mi(r,T.path,Q.signal),P=null;if(w.has(O))w.delete(O),P=fi(n,a,X,H,F,d,t);else if($)f&&(P=fi(n,a,X,H,F,d,t));else{let G;typeof S=="boolean"?G=S:M?G=!1:G=f;let ne={...z,defaultShouldRevalidate:G};mc(F,ne)&&(P=fi(n,a,X,H,F,d,t,ne))}P&&V.push({key:O,routeId:T.routeId,path:T.path,matches:P,match:F,request:X,controller:Q})}),{dsMatches:I,revalidatingFetchers:V}}function ag(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rg(e,t,n){if(e.lazy)return!0;if(!ag(e))return!1;let a=t!=null&&e.id in t,r=n!=null&&n[e.id]!==void 0;return!a&&r?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!r}function MD(e,t,n){let a=!t||n.route.id!==t.route.id,r=!e.hasOwnProperty(n.route.id);return a||r}function DD(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function mc(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _j(e,t,n,a,r,s){let i;if(e){let d=a[e];Oe(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),i=d.children}else i=n;let l=[],c=[];if(t.forEach(d=>{let m=i.find(f=>Ej(d,f));m?c.push({existingRoute:m,newRoute:d}):l.push(d)}),l.length>0){let d=ic(l,r,[e||"_","patch",String((i==null?void 0:i.length)||"0")],a);i.push(...d)}if(s&&c.length>0)for(let d=0;d<c.length;d++){let{existingRoute:m,newRoute:f}=c[d],w=m,[p]=ic([f],r,[],{},!0);Object.assign(w,{element:p.element?p.element:w.element,errorElement:p.errorElement?p.errorElement:w.errorElement,hydrateFallbackElement:p.hydrateFallbackElement?p.hydrateFallbackElement:w.hydrateFallbackElement})}}function Ej(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,a)=>{var r;return(r=t.children)==null?void 0:r.some(s=>Ej(n,s))}):!1}var Tj=new WeakMap,Rj=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let r=n[t.id];if(Oe(r,"No route found in manifest"),!r.lazy||typeof r.lazy!="object")return;let s=r.lazy[e];if(!s)return;let i=Tj.get(r);i||(i={},Tj.set(r,i));let l=i[e];if(l)return l;let c=(async()=>{let d=W3(e),f=r[e]!==void 0&&e!=="hasErrorBoundary";if(d)wt(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)wt(!1,`Route "${r.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let w=await s();w!=null&&(Object.assign(r,{[e]:w}),Object.assign(r,a(r)))}typeof r.lazy=="object"&&(r.lazy[e]=void 0,Object.values(r.lazy).every(w=>w===void 0)&&(r.lazy=void 0))})();return i[e]=c,c},kj=new WeakMap;function OD(e,t,n,a,r){let s=n[e.id];if(Oe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=kj.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let f=(async()=>{Oe(typeof e.lazy=="function","No lazy route function found");let w=await e.lazy(),p={};for(let x in w){let b=w[x];if(b===void 0)continue;let y=Q3(x),g=s[x]!==void 0&&x!=="hasErrorBoundary";y?wt(!y,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):g?wt(!g,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):p[x]=b}Object.assign(s,p),Object.assign(s,{...a(s),lazy:void 0})})();return kj.set(s,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),l=[],c;for(let m of i){if(r&&r.includes(m))continue;let f=Rj({key:m,route:e,manifest:n,mapRouteProperties:a});f&&(l.push(f),m===t&&(c=f))}let d=l.length>0?Promise.all(l).then(()=>{}):void 0;return d==null||d.catch(()=>{}),c==null||c.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:c}}async function Mj(e){let t=e.matches.filter(r=>r.shouldLoad),n={};return(await Promise.all(t.map(r=>r.resolve()))).forEach((r,s)=>{n[t[s].route.id]=r}),n}async function PD(e){return e.matches.some(t=>t.route.middleware)?Dj(e,()=>Mj(e)):Mj(e)}function Dj(e,t){return zD(e,t,a=>{if(XD(a))throw a;return a},GD,n);function n(a,r,s){if(s)return Promise.resolve(Object.assign(s.value,{[r]:{type:"error",result:a}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(d=>d.route.id===r),0),Math.max(i.findIndex(d=>d.shouldCallHandler()),0)),c=lo(i,i[l].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:a}})}}}async function zD(e,t,n,a,r){let{matches:s,request:i,params:l,context:c,unstable_pattern:d}=e,m=s.flatMap(w=>w.route.middleware?w.route.middleware.map(p=>[w.route.id,p]):[]);return await Oj({request:i,params:l,context:c,unstable_pattern:d},m,t,n,a,r)}async function Oj(e,t,n,a,r,s,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let c=t[i];if(!c)return await n();let[d,m]=c,f,w=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Oj(e,t,n,a,r,s,i+1)},f.value}catch(p){return f={value:await s(p,d,f)},f.value}};try{let p=await m(e,w),x=p!=null?a(p):void 0;return r(x)?x:f?x??f.value:(f={value:await w()},f.value)}catch(p){return await s(p,d,f)}}function Pj(e,t,n,a,r){let s=Rj({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=OD(a.route,sn(n.method)?"action":"loader",t,e,r);return{middleware:s,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function og(e,t,n,a,r,s,i,l,c=null,d){let m=!1,f=Pj(e,t,n,r,s);return{...r,_lazyPromises:f,shouldLoad:l,shouldRevalidateArgs:c,shouldCallHandler(w){return m=!0,c?typeof d=="boolean"?mc(r,{...c,defaultShouldRevalidate:d}):typeof w=="boolean"?mc(r,{...c,defaultShouldRevalidate:w}):mc(r,c):l},resolve(w){let{lazy:p,loader:x,middleware:b}=r.route,y=m||l||w&&!sn(n.method)&&(p||x),h=b&&b.length>0&&!x&&!p;return y&&(sn(n.method)||!h)?ID({request:n,unstable_pattern:a,match:r,lazyHandlerPromise:f==null?void 0:f.handler,lazyRoutePromise:f==null?void 0:f.route,handlerOverride:w,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function fi(e,t,n,a,r,s,i,l=null){return a.map(c=>c.route.id!==r.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Pj(e,t,n,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:og(e,t,n,dc(a),c,s,i,!0,l))}async function LD(e,t,n,a,r,s){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let i={request:t,unstable_pattern:dc(n),params:n[0].params,context:r,matches:n},c=await e({...i,fetcherKey:a,runClientMiddleware:d=>{let m=i;return Dj(m,()=>d({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,f;return[(m=d._lazyPromises)==null?void 0:m.handler,(f=d._lazyPromises)==null?void 0:f.route]}))}catch{}return c}async function ID({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:r,handlerOverride:s,scopedContext:i}){let l,c,d=sn(e.method),m=d?"action":"loader",f=w=>{let p,x=new Promise((h,g)=>p=g);c=()=>p(),e.signal.addEventListener("abort",c);let b=h=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):w({request:e,unstable_pattern:t,params:n.params,context:i},...h!==void 0?[h]:[]),y=(async()=>{try{return{type:"data",result:await(s?s(g=>b(g)):b())}}catch(h){return{type:"error",result:h}}})();return Promise.race([y,x])};try{let w=d?n.route.action:n.route.loader;if(a||r)if(w){let p,[x]=await Promise.all([f(w).catch(b=>{p=b}),a,r]);if(p!==void 0)throw p;l=x}else{await a;let p=d?n.route.action:n.route.loader;if(p)[l]=await Promise.all([f(p),r]);else if(m==="action"){let x=new URL(e.url),b=x.pathname+x.search;throw la(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(w)l=await f(w);else{let p=new URL(e.url),x=p.pathname+p.search;throw la(404,{pathname:x})}}catch(w){return{type:"error",result:w}}finally{c&&e.signal.removeEventListener("abort",c)}return l}async function $D(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function BD(e){var a,r,s,i,l;let{result:t,type:n}=e;if(ig(t)){let c;try{c=await $D(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new cc(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:"data",data:c,statusCode:t.status,headers:t.headers}}return n==="error"?Hj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(r=t.init)!=null&&r.headers?new Headers(t.init.headers):void 0}:{type:"error",error:VD(t),statusCode:uc(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:uc(t)?t.status:void 0}:Hj(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function UD(e,t,n,a,r){let s=e.headers.get("Location");if(Oe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jh(s)){let i=a.slice(0,a.findIndex(l=>l.route.id===n)+1);s=ng(new URL(t.url),i,r,s),e.headers.set("Location",s)}return e}function zj(e,t,n,a){let r=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jh(e)){let s=e,i=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(r.includes(i.protocol))throw new Error("Invalid redirect location");let l=ia(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let s=a.createURL(e);if(r.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function mi(e,t,n,a){let r=e.createURL(Uj(t)).toString(),s={signal:n};if(a&&sn(a.formMethod)){let{formMethod:i,formEncType:l}=a;s.method=i.toUpperCase(),l==="application/json"?(s.headers=new Headers({"Content-Type":l}),s.body=JSON.stringify(a.json)):l==="text/plain"?s.body=a.text:l==="application/x-www-form-urlencoded"&&a.formData?s.body=sg(a.formData):s.body=a.formData}return new Request(r,s)}function sg(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function Lj(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function HD(e,t,n,a=!1,r=!1){let s={},i=null,l,c=!1,d={},m=n&&In(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let w=f.route.id,p=t[w];if(Oe(!Xo(p),"Cannot handle redirect results in processLoaderData"),In(p)){let x=p.error;if(m!==void 0&&(x=m,m=void 0),i=i||{},r)i[w]=x;else{let b=lo(e,w);i[b.route.id]==null&&(i[b.route.id]=x)}a||(s[w]=Nj),c||(c=!0,l=uc(p.error)?p.error.status:500),p.headers&&(d[w]=p.headers)}else s[w]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(d[w]=p.headers)}),m!==void 0&&n&&(i={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:i,statusCode:l||200,loaderHeaders:d}}function Ij(e,t,n,a,r,s){let{loaderData:i,errors:l}=HD(t,n,a);return r.filter(c=>!c.matches||c.matches.some(d=>d.shouldLoad)).forEach(c=>{let{key:d,match:m,controller:f}=c;if(f&&f.signal.aborted)return;let w=s[d];if(Oe(w,"Did not find corresponding fetcher result"),In(w)){let p=lo(e.matches,m==null?void 0:m.route.id);l&&l[p.route.id]||(l={...l,[p.route.id]:w.error}),e.fetchers.delete(d)}else if(Xo(w))Oe(!1,"Unhandled fetcher revalidation redirect");else{let p=vr(w.data);e.fetchers.set(d,p)}}),{loaderData:i,errors:l}}function $j(e,t,n,a){let r=Object.entries(t).filter(([,s])=>s!==Nj).reduce((s,[i,l])=>(s[i]=l,s),{});for(let s of n){let i=s.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&s.route.loader&&(r[i]=e[i]),a&&a.hasOwnProperty(i))break}return r}function Bj(e){return e?In(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function lo(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Jd(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function la(e,{pathname:t,routeId:n,method:a,type:r,message:s}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&n?l=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:r==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l=`Route "${n}" does not match URL "${t}"`):e===404?(i="Not Found",l=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&n?l=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(l=`Invalid request method "${a.toUpperCase()}"`)),new cc(e||500,i,new Error(l),!0)}function ef(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,r]=t[n];if(Xo(r))return{key:a,result:r}}}function Uj(e){let t=typeof e=="string"?br(e):e;return za({...t,hash:""})}function FD(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function VD(e){var t,n;return new cc(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function GD(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&YD(n))}function YD(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function KD(e){return ig(e.result)&&Sj.has(e.result.status)}function In(e){return e.type==="error"}function Xo(e){return(e&&e.type)==="redirect"}function Hj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ig(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function qD(e){return Sj.has(e)}function XD(e){return ig(e)&&qD(e.status)&&e.headers.has("Location")}function WD(e){return AD.has(e.toUpperCase())}function sn(e){return ND.has(e.toUpperCase())}function lg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function tf(e,t){let n=typeof t=="string"?br(t).search:t.search;if(e[e.length-1].route.index&&lg(n||""))return e[e.length-1];let a=pj(e);return a[a.length-1]}function Fj(e){let{formMethod:t,formAction:n,formEncType:a,text:r,formData:s,json:i}=e;if(!(!t||!n||!a)){if(r!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:r};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:i,text:void 0}}}function cg(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ZD(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function wc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function QD(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function JD(e,t){try{let n=e.sessionStorage.getItem(jj);if(n){let a=JSON.parse(n);for(let[r,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(r,new Set(s||[]))}}catch{}}function eO(e,t){if(t.size>0){let n={};for(let[a,r]of t)n[a]=[...r];try{e.sessionStorage.setItem(jj,JSON.stringify(n))}catch(a){wt(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Vj(){let e,t,n=new Promise((a,r)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{r(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Wo=u.createContext(null);Wo.displayName="DataRouter";var pc=u.createContext(null);pc.displayName="DataRouterState";var Gj=u.createContext(!1);function tO(){return u.useContext(Gj)}var ug=u.createContext({isTransitioning:!1});ug.displayName="ViewTransition";var Yj=u.createContext(new Map);Yj.displayName="Fetchers";var nO=u.createContext(null);nO.displayName="Await";var $n=u.createContext(null);$n.displayName="Navigation";var nf=u.createContext(null);nf.displayName="Location";var ca=u.createContext({outlet:null,matches:[],isDataRoute:!1});ca.displayName="Route";var dg=u.createContext(null);dg.displayName="RouteError";var Kj="REACT_ROUTER_ERROR",aO="REDIRECT",rO="ROUTE_ERROR_RESPONSE";function oO(e){if(e.startsWith(`${Kj}:${aO}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function sO(e){if(e.startsWith(`${Kj}:${rO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new cc(t.status,t.statusText,t.data)}catch{}}function iO(e,{relative:t}={}){Oe(wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=u.useContext($n),{hash:r,pathname:s,search:i}=hc(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:La([n,s])),a.createHref({pathname:l,search:i,hash:r})}function wi(){return u.useContext(nf)!=null}function jn(){return Oe(wi(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(nf).location}var qj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xj(e){u.useContext($n).static||u.useLayoutEffect(e)}function pi(){let{isDataRoute:e}=u.useContext(ca);return e?SO():lO()}function lO(){Oe(wi(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(Wo),{basename:t,navigator:n}=u.useContext($n),{matches:a}=u.useContext(ca),{pathname:r}=jn(),s=JSON.stringify(Zd(a)),i=u.useRef(!1);return Xj(()=>{i.current=!0}),u.useCallback((c,d={})=>{if(wt(i.current,qj),!i.current)return;if(typeof c=="number"){n.go(c);return}let m=Qd(c,JSON.parse(s),r,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:La([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,s,r,e])}var cO=u.createContext(null);function uO(e){let t=u.useContext(ca).outlet;return u.useMemo(()=>t&&u.createElement(cO.Provider,{value:e},t),[t,e])}function Wj(){let{matches:e}=u.useContext(ca),t=e[e.length-1];return t?t.params:{}}function hc(e,{relative:t}={}){let{matches:n}=u.useContext(ca),{pathname:a}=jn(),r=JSON.stringify(Zd(n));return u.useMemo(()=>Qd(e,JSON.parse(r),a,t==="path"),[e,r,a,t])}function dO(e,t,n,a,r){Oe(wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=u.useContext($n),{matches:i}=u.useContext(ca),l=i[i.length-1],c=l?l.params:{},d=l?l.pathname:"/",m=l?l.pathnameBase:"/",f=l&&l.route;{let g=f&&f.path||"";Jj(d,!f||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 60 61 Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let w=jn(),p;p=w;let x=p.pathname||"/",b=x;if(m!=="/"){let g=m.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=so(e,{pathname:b});return wt(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),wt(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),hO(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},c,g.params),pathname:La([m,s.encodeLocation?s.encodeLocation(g.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?m:La([m,s.encodeLocation?s.encodeLocation(g.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),i,n,a,r)}function fO(){let e=yO(),t=uc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=u.createElement(u.Fragment,null,u.createElement("p",null,"💿 Hey developer 👋"),u.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",u.createElement("code",{style:s},"ErrorBoundary")," or"," ",u.createElement("code",{style:s},"errorElement")," prop on your route.")),u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:r},n):null,i)}var mO=u.createElement(fO,null),Zj=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=sO(e.digest);n&&(e=n)}let t=e!==void 0?u.createElement(ca.Provider,{value:this.props.routeContext},u.createElement(dg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?u.createElement(wO,{error:e},t):t}};Zj.contextType=Gj;var fg=new WeakMap;function wO({children:e,error:t}){let{basename:n}=u.useContext($n);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=oO(t.digest);if(a){let r=fg.get(t);if(r)throw r;let s=gj(a.location,n);if(hj&&!fg.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw fg.set(t,i),i}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function pO({routeContext:e,match:t,children:n}){let a=u.useContext(Wo);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(ca.Provider,{value:e},n)}function hO(e,t=[],n=null,a=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,i=n==null?void 0:n.errors;if(i!=null){let m=s.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);Oe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let l=!1,c=-1;if(n)for(let m=0;m<s.length;m++){let f=s[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=m),f.route.id){let{loaderData:w,errors:p}=n,x=f.route.loader&&!w.hasOwnProperty(f.route.id)&&(!p||p[f.route.id]===void 0);if(f.route.lazy||x){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}let d=n&&a?(m,f)=>{var w,p;a(m,{location:n.location,params:((p=(w=n.matches)==null?void 0:w[0])==null?void 0:p.params)??{},unstable_pattern:dc(n.matches),errorInfo:f})}:void 0;return s.reduceRight((m,f,w)=>{let p,x=!1,b=null,y=null;n&&(p=i&&f.route.id?i[f.route.id]:void 0,b=f.route.errorElement||mO,l&&(c<0&&w===0?(Jj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,y=null):c===w&&(x=!0,y=f.route.hydrateFallbackElement||null)));let h=t.concat(s.slice(0,w+1)),g=()=>{let v;return p?v=b:x?v=y:f.route.Component?v=u.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=m,u.createElement(pO,{match:f,routeContext:{outlet:m,matches:h,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||w===0)?u.createElement(Zj,{location:n.location,revalidation:n.revalidation,component:b,error:p,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function mg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gO(e){let t=u.useContext(Wo);return Oe(t,mg(e)),t}function xO(e){let t=u.useContext(pc);return Oe(t,mg(e)),t}function bO(e){let t=u.useContext(ca);return Oe(t,mg(e)),t}function wg(e){let t=bO(e),n=t.matches[t.matches.length-1];return Oe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function vO(){return wg("useRouteId")}function yO(){var a;let e=u.useContext(dg),t=xO("useRouteError"),n=wg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function SO(){let{router:e}=gO("useNavigate"),t=wg("useNavigate"),n=u.useRef(!1);return Xj(()=>{n.current=!0}),u.useCallback(async(r,s={})=>{wt(n.current,qj),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...s}))},[e,t])}var Qj={};function Jj(e,t,n){!t&&!Qj[e]&&(Qj[e]=!0,wt(!1,n))}var eN={};function tN(e,t){!e&&!eN[t]&&(eN[t]=!0,console.warn(t))}var jO="useOptimistic",nN=Au[jO],NO=()=>{};function CO(e){return nN?nN(e):[e,NO]}function AO(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&wt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:u.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&wt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:u.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&wt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:u.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var _O=["HydrateFallback","hydrateFallbackElement"],EO=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function TO({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=tO()||a;let[s,i]=u.useState(e.state),[l,c]=CO(s),[d,m]=u.useState(),[f,w]=u.useState({isTransitioning:!1}),[p,x]=u.useState(),[b,y]=u.useState(),[h,g]=u.useState(),v=u.useRef(new Map),S=u.useCallback((C,{deletedFetchers:R,newErrors:M,flushSync:z,viewTransitionOpts:B})=>{M&&n&&Object.values(M).forEach(V=>{var D;return n(V,{location:C.location,params:((D=C.matches[0])==null?void 0:D.params)??{},unstable_pattern:dc(C.matches)})}),C.fetchers.forEach((V,D)=>{V.data!==void 0&&v.current.set(D,V.data)}),R.forEach(V=>v.current.delete(V)),tN(z===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let I=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(tN(B==null||I,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!I){t&&z?t(()=>i(C)):a===!1?i(C):u.startTransition(()=>{a===!0&&c(V=>aN(V,C)),i(C)});return}if(t&&z){t(()=>{b&&(p==null||p.resolve(),b.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>i(C))});V.finished.finally(()=>{t(()=>{x(void 0),y(void 0),m(void 0),w({isTransitioning:!1})})}),t(()=>y(V));return}b?(p==null||p.resolve(),b.skipTransition(),g({state:C,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(m(C),w({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[e.window,t,b,p,a,c,n]);u.useLayoutEffect(()=>e.subscribe(S),[e,S]),u.useEffect(()=>{f.isTransitioning&&!f.flushSync&&x(new EO)},[f]),u.useEffect(()=>{if(p&&d&&e.window){let C=d,R=p.promise,M=e.window.document.startViewTransition(async()=>{a===!1?i(C):u.startTransition(()=>{a===!0&&c(z=>aN(z,C)),i(C)}),await R});M.finished.finally(()=>{x(void 0),y(void 0),m(void 0),w({isTransitioning:!1})}),y(M)}},[d,p,e.window,a,c]),u.useEffect(()=>{p&&d&&l.location.key===d.location.key&&p.resolve()},[p,b,l.location,d]),u.useEffect(()=>{!f.isTransitioning&&h&&(m(h.state),w({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),g(void 0))},[f.isTransitioning,h]);let N=u.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:C=>e.navigate(C),push:(C,R,M)=>e.navigate(C,{state:R,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(C,R,M)=>e.navigate(C,{replace:!0,state:R,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[e]),A=e.basename||"/",j=u.useMemo(()=>({router:e,navigator:N,static:!1,basename:A,onError:n}),[e,N,A,n]);return u.createElement(u.Fragment,null,u.createElement(Wo.Provider,{value:j},u.createElement(pc.Provider,{value:l},u.createElement(Yj.Provider,{value:v.current},u.createElement(ug.Provider,{value:f},u.createElement(DO,{basename:A,location:l.location,navigationType:l.historyAction,navigator:N,unstable_useTransitions:a},u.createElement(RO,{routes:e.routes,future:e.future,state:l,onError:n})))))),null)}function aN(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var RO=u.memo(kO);function kO({routes:e,future:t,state:n,onError:a}){return dO(e,void 0,n,a,t)}function rN({to:e,replace:t,state:n,relative:a}){Oe(wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=u.useContext($n);wt(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=u.useContext(ca),{pathname:i}=jn(),l=pi(),c=Qd(e,Zd(s),i,a==="path"),d=JSON.stringify(c);return u.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:a})},[l,d,a,t,n]),null}function MO(e){return uO(e.context)}function DO({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:r,static:s=!1,unstable_useTransitions:i}){Oe(!wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=u.useMemo(()=>({basename:l,navigator:r,static:s,unstable_useTransitions:i,future:{}}),[l,r,s,i]);typeof n=="string"&&(n=br(n));let{pathname:d="/",search:m="",hash:f="",state:w=null,key:p="default"}=n,x=u.useMemo(()=>{let b=ia(d,l);return b==null?null:{location:{pathname:b,search:m,hash:f,state:w,key:p},navigationType:a}},[l,d,m,f,w,p,a]);return wt(x!=null,`<Router basename="${l}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:u.createElement($n.Provider,{value:c},u.createElement(nf.Provider,{children:t,value:x}))}var af="get",rf="application/x-www-form-urlencoded";function of(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OO(e){return of(e)&&e.tagName.toLowerCase()==="button"}function PO(e){return of(e)&&e.tagName.toLowerCase()==="form"}function zO(e){return of(e)&&e.tagName.toLowerCase()==="input"}function LO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function IO(e,t){return e.button===0&&(!t||t==="_self")&&!LO(e)}function pg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(r=>[n,r]):[[n,a]])},[]))}function $O(e,t){let n=pg(e);return t&&t.forEach((a,r)=>{n.has(r)||t.getAll(r).forEach(s=>{n.append(r,s)})}),n}var sf=null;function BO(){if(sf===null)try{new FormData(document.createElement("form"),0),sf=!1}catch{sf=!0}return sf}var UO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hg(e){return e!=null&&!UO.has(e)?(wt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rf}"`),null):e}function HO(e,t){let n,a,r,s,i;if(PO(e)){let l=e.getAttribute("action");a=l?ia(l,t):null,n=e.getAttribute("method")||af,r=hg(e.getAttribute("enctype"))||rf,s=new FormData(e)}else if(OO(e)||zO(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(a=c?ia(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||af,r=hg(e.getAttribute("formenctype"))||hg(l.getAttribute("enctype"))||rf,s=new FormData(l,e),!BO()){let{name:d,type:m,value:f}=e;if(m==="image"){let w=d?`${d}.`:"";s.append(`${w}x`,"0"),s.append(`${w}y`,"0")}else d&&s.append(d,f)}}else{if(of(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=af,a=null,r=rf,i=e}return s&&r==="text/plain"&&(i=s,s=void 0),{action:a,method:n.toLowerCase(),encType:r,formData:s,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function FO(e,t,n,a){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${a}`:r.pathname=`${r.pathname}.${a}`:r.pathname==="/"?r.pathname=`_root.${a}`:t&&ia(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${a}`,r}async function VO(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GO(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function YO(e,t,n){let a=await Promise.all(e.map(async r=>{let s=t.routes[r.route.id];if(s){let i=await VO(s,n);return i.links?i.links():[]}return[]}));return WO(a.flat(1).filter(GO).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function oN(e,t,n,a,r,s){let i=(c,d)=>n[d]?c.route.id!==n[d].route.id:!0,l=(c,d)=>{var m;return n[d].pathname!==c.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==c.params["*"]};return s==="assets"?t.filter((c,d)=>i(c,d)||l(c,d)):s==="data"?t.filter((c,d)=>{var f;let m=a.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(i(c,d)||l(c,d))return!0;if(c.route.shouldRevalidate){let w=c.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function KO(e,t,{includeHydrateFallback:n}={}){return qO(e.map(a=>{let r=t.routes[a.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function qO(e){return[...new Set(e)]}function XO(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function WO(e,t){let n=new Set;return new Set(t),e.reduce((a,r)=>{let s=JSON.stringify(XO(r));return n.has(s)||(n.add(s),a.push({key:s,link:r})),a},[])}function sN(){let e=u.useContext(Wo);return gg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ZO(){let e=u.useContext(pc);return gg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var xg=u.createContext(void 0);xg.displayName="FrameworkContext";function iN(){let e=u.useContext(xg);return gg(e,"You must render this element inside a <HydratedRouter> element"),e}function QO(e,t){let n=u.useContext(xg),[a,r]=u.useState(!1),[s,i]=u.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:m,onTouchStart:f}=t,w=u.useRef(null);u.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let b=h=>{h.forEach(g=>{i(g.isIntersecting)})},y=new IntersectionObserver(b,{threshold:.5});return w.current&&y.observe(w.current),()=>{y.disconnect()}}},[e]),u.useEffect(()=>{if(a){let b=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(b)}}},[a]);let p=()=>{r(!0)},x=()=>{r(!1),i(!1)};return n?e!=="intent"?[s,w,{}]:[s,w,{onFocus:gc(l,p),onBlur:gc(c,x),onMouseEnter:gc(d,p),onMouseLeave:gc(m,x),onTouchStart:gc(f,p)}]:[!1,w,{}]}function gc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JO({page:e,...t}){let{router:n}=sN(),a=u.useMemo(()=>so(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?u.createElement(tP,{page:e,matches:a,...t}):null}function eP(e){let{manifest:t,routeModules:n}=iN(),[a,r]=u.useState([]);return u.useEffect(()=>{let s=!1;return YO(e,t,n).then(i=>{s||r(i)}),()=>{s=!0}},[e,t,n]),a}function tP({page:e,matches:t,...n}){let a=jn(),{future:r,manifest:s,routeModules:i}=iN(),{basename:l}=sN(),{loaderData:c,matches:d}=ZO(),m=u.useMemo(()=>oN(e,t,d,s,a,"data"),[e,t,d,s,a]),f=u.useMemo(()=>oN(e,t,d,s,a,"assets"),[e,t,d,s,a]),w=u.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,y=!1;if(t.forEach(g=>{var S;let v=s.routes[g.route.id];!v||!v.hasLoader||(!m.some(N=>N.route.id===g.route.id)&&g.route.id in c&&((S=i[g.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?y=!0:b.add(g.route.id))}),b.size===0)return[];let h=FO(e,l,r.unstable_trailingSlashAwareDataRequests,"data");return y&&b.size>0&&h.searchParams.set("_routes",t.filter(g=>b.has(g.route.id)).map(g=>g.route.id).join(",")),[h.pathname+h.search]},[l,r.unstable_trailingSlashAwareDataRequests,c,a,s,m,t,e,i]),p=u.useMemo(()=>KO(f,s),[f,s]),x=eP(f);return u.createElement(u.Fragment,null,w.map(b=>u.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),p.map(b=>u.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:y})=>u.createElement("link",{key:b,nonce:n.nonce,...y,crossOrigin:y.crossOrigin??n.crossOrigin})))}function nP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var aP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{aP&&(window.__reactRouterVersion="7.13.0")}catch{}function rP(e,t){return RD({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Y3({window:t==null?void 0:t.window}),hydrationData:oP(),routes:e,mapRouteProperties:AO,hydrationRouteProperties:_O,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function oP(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:sP(e.errors)}),e}function sP(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,r]of t)if(r&&r.__type==="RouteErrorResponse")n[a]=new cc(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type==="Error"){if(r.__subType){let s=window[r.__subType];if(typeof s=="function")try{let i=new s(r.message);i.stack="",n[a]=i}catch{}}if(n[a]==null){let s=new Error(r.message);s.stack="",n[a]=s}}else n[a]=r;return n}var lN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bn=u.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:r,reloadDocument:s,replace:i,state:l,target:c,to:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w,...p},x){let{basename:b,unstable_useTransitions:y}=u.useContext($n),h=typeof d=="string"&&lN.test(d),g=gj(d,b);d=g.to;let v=iO(d,{relative:r}),[S,N,A]=QO(a,p),j=uP(d,{replace:i,state:l,target:c,preventScrollReset:m,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:w,unstable_useTransitions:y});function C(M){t&&t(M),M.defaultPrevented||j(M)}let R=u.createElement("a",{...p,...A,href:g.absoluteURL||v,onClick:g.isExternal||s?t:C,ref:nP(x,N),target:c,"data-discover":!h&&n==="render"?"true":void 0});return S&&!h?u.createElement(u.Fragment,null,R,u.createElement(JO,{page:v})):R});Bn.displayName="Link";var iP=u.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:r=!1,style:s,to:i,viewTransition:l,children:c,...d},m){let f=hc(i,{relative:d.relative}),w=jn(),p=u.useContext(pc),{navigator:x,basename:b}=u.useContext($n),y=p!=null&&hP(f)&&l===!0,h=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,g=w.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(g=g.toLowerCase(),v=v?v.toLowerCase():null,h=h.toLowerCase()),v&&b&&(v=ia(v,b)||v);const S=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let N=g===h||!r&&g.startsWith(h)&&g.charAt(S)==="/",A=v!=null&&(v===h||!r&&v.startsWith(h)&&v.charAt(h.length)==="/"),j={isActive:N,isPending:A,isTransitioning:y},C=N?t:void 0,R;typeof a=="function"?R=a(j):R=[a,N?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(j):s;return u.createElement(Bn,{...d,"aria-current":C,className:R,ref:m,style:M,to:i,viewTransition:l},typeof c=="function"?c(j):c)});iP.displayName="NavLink";var lP=u.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:r,state:s,method:i=af,action:l,onSubmit:c,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w,...p},x)=>{let{unstable_useTransitions:b}=u.useContext($n),y=wP(),h=pP(l,{relative:d}),g=i.toLowerCase()==="get"?"get":"post",v=typeof l=="string"&&lN.test(l),S=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let A=N.nativeEvent.submitter,j=(A==null?void 0:A.getAttribute("formmethod"))||i,C=()=>y(A||N.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:r,state:s,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:w});b&&n!==!1?u.startTransition(()=>C()):C()};return u.createElement("form",{ref:x,method:g,action:h,onSubmit:a?c:S,...p,"data-discover":!v&&e==="render"?"true":void 0})});lP.displayName="Form";function cP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cN(e){let t=u.useContext(Wo);return Oe(t,cP(e)),t}function uP(e,{target:t,replace:n,state:a,preventScrollReset:r,relative:s,viewTransition:i,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let d=pi(),m=jn(),f=hc(e,{relative:s});return u.useCallback(w=>{if(IO(w,t)){w.preventDefault();let p=n!==void 0?n:za(m)===za(f),x=()=>d(e,{replace:p,state:a,preventScrollReset:r,relative:s,viewTransition:i,unstable_defaultShouldRevalidate:l});c?u.startTransition(()=>x()):x()}},[m,d,f,n,a,t,e,r,s,i,l,c])}function dP(e){wt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=u.useRef(pg(e)),n=u.useRef(!1),a=jn(),r=u.useMemo(()=>$O(a.search,n.current?null:t.current),[a.search]),s=pi(),i=u.useCallback((l,c)=>{const d=pg(typeof l=="function"?l(new URLSearchParams(r)):l);n.current=!0,s("?"+d,c)},[s,r]);return[r,i]}var fP=0,mP=()=>`__${String(++fP)}__`;function wP(){let{router:e}=cN("useSubmit"),{basename:t}=u.useContext($n),n=vO(),a=e.fetch,r=e.navigate;return u.useCallback(async(s,i={})=>{let{action:l,method:c,encType:d,formData:m,body:f}=HO(s,t);if(i.navigate===!1){let w=i.fetcherKey||mP();await a(w,n,i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||d,flushSync:i.flushSync})}else await r(i.action||l,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||c,formEncType:i.encType||d,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,r,t,n])}function pP(e,{relative:t}={}){let{basename:n}=u.useContext($n),a=u.useContext(ca);Oe(a,"useFormAction must be used inside a RouteContext");let[r]=a.matches.slice(-1),s={...hc(e||".",{relative:t})},i=jn();if(e==null){s.search=i.search;let l=new URLSearchParams(s.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(f=>f).forEach(f=>l.append("index",f));let m=l.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:La([n,s.pathname])),za(s)}function hP(e,{relative:t}={}){let n=u.useContext(ug);Oe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cN("useViewTransitionState"),r=hc(e,{relative:t});if(!n.isTransitioning)return!1;let s=ia(n.currentLocation.pathname,a)||n.currentLocation.pathname,i=ia(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Wd(r.pathname,i)!=null||Wd(r.pathname,s)!=null}function gP(e){return u.createElement(TO,{flushSync:Eo.flushSync,...e})}/** 62 62 * @license lucide-react v0.564.0 - ISC 63 63 * … … 69 69 * This source code is licensed under the ISC license. 70 70 * See the LICENSE file in the root directory of this source tree. 71 */const gP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**72 * @license lucide-react v0.564.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const xP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**77 * @license lucide-react v0.564.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const dN=e=>{const t= xP(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**82 * @license lucide-react v0.564.0 - ISC 83 * 84 * This source code is licensed under the ISC license. 85 * See the LICENSE file in the root directory of this source tree. 86 */var bP={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"};/**87 * @license lucide-react v0.564.0 - ISC 88 * 89 * This source code is licensed under the ISC license. 90 * See the LICENSE file in the root directory of this source tree. 91 */const vP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**92 * @license lucide-react v0.564.0 - ISC 93 * 94 * This source code is licensed under the ISC license. 95 * See the LICENSE file in the root directory of this source tree. 96 */const yP=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:s,iconNode:i,...l},c)=>d.createElement("svg",{ref:c,...bP,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:uN("lucide",r),...!s&&!vP(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,m])=>d.createElement(u,m)),...Array.isArray(s)?s:[s]]));/**97 * @license lucide-react v0.564.0 - ISC 98 * 99 * This source code is licensed under the ISC license. 100 * See the LICENSE file in the root directory of this source tree. 101 */const fe=(e,t)=>{const n= d.forwardRef(({className:a,...r},s)=>d.createElement(yP,{ref:s,iconNode:t,className:uN(`lucide-${gP(dN(e))}`,`lucide-${e}`,a),...r}));return n.displayName=dN(e),n};/**102 * @license lucide-react v0.564.0 - ISC 103 * 104 * This source code is licensed under the ISC license. 105 * See the LICENSE file in the root directory of this source tree. 106 */const SP=fe("arrow-down-up",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**107 * @license lucide-react v0.564.0 - ISC 108 * 109 * This source code is licensed under the ISC license. 110 * See the LICENSE file in the root directory of this source tree. 111 */const jP=fe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**112 * @license lucide-react v0.564.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const NP=fe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**71 */const xP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** 72 * @license lucide-react v0.564.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const bP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/** 77 * @license lucide-react v0.564.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const dN=e=>{const t=bP(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** 82 * @license lucide-react v0.564.0 - ISC 83 * 84 * This source code is licensed under the ISC license. 85 * See the LICENSE file in the root directory of this source tree. 86 */var vP={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"};/** 87 * @license lucide-react v0.564.0 - ISC 88 * 89 * This source code is licensed under the ISC license. 90 * See the LICENSE file in the root directory of this source tree. 91 */const yP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** 92 * @license lucide-react v0.564.0 - ISC 93 * 94 * This source code is licensed under the ISC license. 95 * See the LICENSE file in the root directory of this source tree. 96 */const SP=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:s,iconNode:i,...l},c)=>u.createElement("svg",{ref:c,...vP,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:uN("lucide",r),...!s&&!yP(l)&&{"aria-hidden":"true"},...l},[...i.map(([d,m])=>u.createElement(d,m)),...Array.isArray(s)?s:[s]]));/** 97 * @license lucide-react v0.564.0 - ISC 98 * 99 * This source code is licensed under the ISC license. 100 * See the LICENSE file in the root directory of this source tree. 101 */const fe=(e,t)=>{const n=u.forwardRef(({className:a,...r},s)=>u.createElement(SP,{ref:s,iconNode:t,className:uN(`lucide-${xP(dN(e))}`,`lucide-${e}`,a),...r}));return n.displayName=dN(e),n};/** 102 * @license lucide-react v0.564.0 - ISC 103 * 104 * This source code is licensed under the ISC license. 105 * See the LICENSE file in the root directory of this source tree. 106 */const jP=fe("arrow-down-up",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/** 107 * @license lucide-react v0.564.0 - ISC 108 * 109 * This source code is licensed under the ISC license. 110 * See the LICENSE file in the root directory of this source tree. 111 */const NP=fe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 112 * @license lucide-react v0.564.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const CP=fe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 117 117 * @license lucide-react v0.564.0 - ISC 118 118 * … … 124 124 * This source code is licensed under the ISC license. 125 125 * See the LICENSE file in the root directory of this source tree. 126 */const CP=fe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**127 * @license lucide-react v0.564.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const AP=fe("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**132 * @license lucide-react v0.564.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const _P=fe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**137 * @license lucide-react v0.564.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const EP=fe("badge-percent",[["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:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]);/**126 */const AP=fe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** 127 * @license lucide-react v0.564.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const _P=fe("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 132 * @license lucide-react v0.564.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const EP=fe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 137 * @license lucide-react v0.564.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const TP=fe("badge-percent",[["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:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]);/** 142 142 * @license lucide-react v0.564.0 - ISC 143 143 * … … 149 149 * This source code is licensed under the ISC license. 150 150 * See the LICENSE file in the root directory of this source tree. 151 */const TP=fe("book-open",[["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"}]]);/**151 */const RP=fe("book-open",[["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"}]]);/** 152 152 * @license lucide-react v0.564.0 - ISC 153 153 * … … 174 174 * This source code is licensed under the ISC license. 175 175 * See the LICENSE file in the root directory of this source tree. 176 */const RP=fe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**176 */const kP=fe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 177 177 * @license lucide-react v0.564.0 - ISC 178 178 * … … 194 194 * This source code is licensed under the ISC license. 195 195 * See the LICENSE file in the root directory of this source tree. 196 */const kP=fe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**197 * @license lucide-react v0.564.0 - ISC 198 * 199 * This source code is licensed under the ISC license. 200 * See the LICENSE file in the root directory of this source tree. 201 */const MP=fe("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**196 */const MP=fe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 197 * @license lucide-react v0.564.0 - ISC 198 * 199 * This source code is licensed under the ISC license. 200 * See the LICENSE file in the root directory of this source tree. 201 */const DP=fe("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 202 202 * @license lucide-react v0.564.0 - ISC 203 203 * … … 209 209 * This source code is licensed under the ISC license. 210 210 * See the LICENSE file in the root directory of this source tree. 211 */const DP=fe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**212 * @license lucide-react v0.564.0 - ISC 213 * 214 * This source code is licensed under the ISC license. 215 * See the LICENSE file in the root directory of this source tree. 216 */const OP=fe("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"}]]);/**211 */const OP=fe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 212 * @license lucide-react v0.564.0 - ISC 213 * 214 * This source code is licensed under the ISC license. 215 * See the LICENSE file in the root directory of this source tree. 216 */const PP=fe("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"}]]);/** 217 217 * @license lucide-react v0.564.0 - ISC 218 218 * … … 224 224 * This source code is licensed under the ISC license. 225 225 * See the LICENSE file in the root directory of this source tree. 226 */const PP=fe("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**226 */const zP=fe("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 227 227 * @license lucide-react v0.564.0 - ISC 228 228 * … … 234 234 * This source code is licensed under the ISC license. 235 235 * See the LICENSE file in the root directory of this source tree. 236 */const zP=fe("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"}]]);/**236 */const LP=fe("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"}]]);/** 237 237 * @license lucide-react v0.564.0 - ISC 238 238 * … … 259 259 * This source code is licensed under the ISC license. 260 260 * See the LICENSE file in the root directory of this source tree. 261 */const LP=fe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);/**261 */const IP=fe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);/** 262 262 * @license lucide-react v0.564.0 - ISC 263 263 * … … 269 269 * This source code is licensed under the ISC license. 270 270 * See the LICENSE file in the root directory of this source tree. 271 */const IP=fe("key-round",[["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"}]]);/**272 * @license lucide-react v0.564.0 - ISC 273 * 274 * This source code is licensed under the ISC license. 275 * See the LICENSE file in the root directory of this source tree. 276 */const $P=fe("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);/**277 * @license lucide-react v0.564.0 - ISC 278 * 279 * This source code is licensed under the ISC license. 280 * See the LICENSE file in the root directory of this source tree. 281 */const BP=fe("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**282 * @license lucide-react v0.564.0 - ISC 283 * 284 * This source code is licensed under the ISC license. 285 * See the LICENSE file in the root directory of this source tree. 286 */const UP=fe("life-buoy",[["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"}]]);/**287 * @license lucide-react v0.564.0 - ISC 288 * 289 * This source code is licensed under the ISC license. 290 * See the LICENSE file in the root directory of this source tree. 291 */const HP=fe("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**271 */const $P=fe("key-round",[["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"}]]);/** 272 * @license lucide-react v0.564.0 - ISC 273 * 274 * This source code is licensed under the ISC license. 275 * See the LICENSE file in the root directory of this source tree. 276 */const BP=fe("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);/** 277 * @license lucide-react v0.564.0 - ISC 278 * 279 * This source code is licensed under the ISC license. 280 * See the LICENSE file in the root directory of this source tree. 281 */const UP=fe("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** 282 * @license lucide-react v0.564.0 - ISC 283 * 284 * This source code is licensed under the ISC license. 285 * See the LICENSE file in the root directory of this source tree. 286 */const HP=fe("life-buoy",[["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"}]]);/** 287 * @license lucide-react v0.564.0 - ISC 288 * 289 * This source code is licensed under the ISC license. 290 * See the LICENSE file in the root directory of this source tree. 291 */const FP=fe("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 292 292 * @license lucide-react v0.564.0 - ISC 293 293 * … … 299 299 * This source code is licensed under the ISC license. 300 300 * See the LICENSE file in the root directory of this source tree. 301 */const FP=fe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**302 * @license lucide-react v0.564.0 - ISC 303 * 304 * This source code is licensed under the ISC license. 305 * See the LICENSE file in the root directory of this source tree. 306 */const VP=fe("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"}]]);/**307 * @license lucide-react v0.564.0 - ISC 308 * 309 * This source code is licensed under the ISC license. 310 * See the LICENSE file in the root directory of this source tree. 311 */const GP=fe("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/**301 */const VP=fe("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 302 * @license lucide-react v0.564.0 - ISC 303 * 304 * This source code is licensed under the ISC license. 305 * See the LICENSE file in the root directory of this source tree. 306 */const GP=fe("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"}]]);/** 307 * @license lucide-react v0.564.0 - ISC 308 * 309 * This source code is licensed under the ISC license. 310 * See the LICENSE file in the root directory of this source tree. 311 */const YP=fe("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/** 312 312 * @license lucide-react v0.564.0 - ISC 313 313 * … … 344 344 * This source code is licensed under the ISC license. 345 345 * See the LICENSE file in the root directory of this source tree. 346 */const YP=fe("refresh-cw",[["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"}]]);/**346 */const KP=fe("refresh-cw",[["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"}]]);/** 347 347 * @license lucide-react v0.564.0 - ISC 348 348 * … … 364 364 * This source code is licensed under the ISC license. 365 365 * See the LICENSE file in the root directory of this source tree. 366 */const KP=fe("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**366 */const qP=fe("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 367 367 * @license lucide-react v0.564.0 - ISC 368 368 * … … 379 379 * This source code is licensed under the ISC license. 380 380 * See the LICENSE file in the root directory of this source tree. 381 */const qP=fe("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"}]]);/**381 */const XP=fe("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"}]]);/** 382 382 * @license lucide-react v0.564.0 - ISC 383 383 * … … 389 389 * This source code is licensed under the ISC license. 390 390 * See the LICENSE file in the root directory of this source tree. 391 */const XP=fe("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"}]]);/**391 */const WP=fe("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"}]]);/** 392 392 * @license lucide-react v0.564.0 - ISC 393 393 * … … 404 404 * This source code is licensed under the ISC license. 405 405 * See the LICENSE file in the root directory of this source tree. 406 */const WP=fe("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**407 * @license lucide-react v0.564.0 - ISC 408 * 409 * This source code is licensed under the ISC license. 410 * See the LICENSE file in the root directory of this source tree. 411 */const ZP=fe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);/**412 * @license lucide-react v0.564.0 - ISC 413 * 414 * This source code is licensed under the ISC license. 415 * See the LICENSE file in the root directory of this source tree. 416 */const Eg=fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function CN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ia(...e){return t=>{let n=!1;const a=e.map(r=>{const s=CN(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<a.length;r++){const s=a[r];typeof s=="function"?s():CN(e[r],null)}}}}function Se(...e){return d.useCallback(Ia(...e),e)}var QP=Symbol.for("react.lazy"),uf=Au[" use ".trim().toString()];function JP(e){return typeof e=="object"&&e!==null&&"then"in e}function AN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===QP&&"_payload"in e&&JP(e._payload)}function df(e){const t=ez(e),n=d.forwardRef((a,r)=>{let{children:s,...i}=a;AN(s)&&typeof uf=="function"&&(s=uf(s._payload));const l=d.Children.toArray(s),c=l.find(nz);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Qo=df("Slot");function ez(e){const t=d.forwardRef((n,a)=>{let{children:r,...s}=n;if(AN(r)&&typeof uf=="function"&&(r=uf(r._payload)),d.isValidElement(r)){const i=rz(r),l=az(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tz=Symbol("radix.slottable");function nz(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tz}function az(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function rz(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _N(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=_N(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Tg(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=_N(e))&&(a&&(a+=" "),a+=t);return a}const EN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TN=Tg,hi=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return TN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(u=>{const m=n==null?void 0:n[u],f=s==null?void 0:s[u];if(m===null)return null;const w=EN(m)||EN(f);return r[u][w]}),l=n&&Object.entries(n).reduce((u,m)=>{let[f,w]=m;return w===void 0||(u[f]=w),u},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((u,m)=>{let{class:f,className:w,...p}=m;return Object.entries(p).every(x=>{let[b,y]=x;return Array.isArray(y)?y.includes({...s,...l}[b]):{...s,...l}[b]===y})?[...u,f,w]:u},[]);return TN(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},oz=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},sz=(e,t)=>({classGroupId:e,validator:t}),RN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ff="-",kN=[],iz="arbitrary..",lz=e=>{const t=uz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return cz(i);const l=i.split(ff),c=l[0]===""&&l.length>1?1:0;return MN(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],u=n[i];return c?u?oz(u,c):c:u||kN}return n[i]||kN}}},MN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const u=MN(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const l=t===0?e.join(ff):e.slice(t).join(ff),c=i.length;for(let u=0;u<c;u++){const m=i[u];if(m.validator(l))return m.classGroupId}},cz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?iz+a:void 0})(),uz=e=>{const{theme:t,classGroups:n}=e;return dz(n,t)},dz=(e,t)=>{const n=RN();for(const a in e){const r=e[a];Rg(r,n,a,t)}return n},Rg=(e,t,n,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];fz(i,t,n,a)}},fz=(e,t,n,a)=>{if(typeof e=="string"){mz(e,t,n);return}if(typeof e=="function"){wz(e,t,n,a);return}pz(e,t,n,a)},mz=(e,t,n)=>{const a=e===""?t:DN(t,e);a.classGroupId=n},wz=(e,t,n,a)=>{if(hz(e)){Rg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(sz(n,e))},pz=(e,t,n,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];Rg(c,DN(t,l),n,a)}},DN=(e,t)=>{let n=e;const a=t.split(ff),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=n.nextPart.get(i);l||(l=RN(),n.nextPart.set(i,l)),n=l}return n},hz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const r=(s,i)=>{n[s]=i,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},kg="!",ON=":",xz=[],PN=(e,t,n,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),bz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=r=>{const s=[];let i=0,l=0,c=0,u;const m=r.length;for(let b=0;b<m;b++){const y=r[b];if(i===0&&l===0){if(y===ON){s.push(r.slice(c,b)),c=b+1;continue}if(y==="/"){u=b;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?r:r.slice(c);let w=f,p=!1;f.endsWith(kg)?(w=f.slice(0,-1),p=!0):f.startsWith(kg)&&(w=f.slice(1),p=!0);const x=u&&u>c?u-c:void 0;return PN(s,p,w,x)};if(t){const r=t+ON,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):PN(xz,!1,i,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},vz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},yz=e=>({cache:gz(e.cacheSize),parseClassName:bz(e),sortModifiers:vz(e),...lz(e)}),Sz=/\s+/,jz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(Sz);let c="";for(let u=l.length-1;u>=0;u-=1){const m=l[u],{isExternal:f,modifiers:w,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:b}=n(m);if(f){c=m+(c.length>0?" "+c:c);continue}let y=!!b,h=a(y?x.substring(0,b):x);if(!h){if(!y){c=m+(c.length>0?" "+c:c);continue}if(h=a(x),!h){c=m+(c.length>0?" "+c:c);continue}y=!1}const g=w.length===0?"":w.length===1?w[0]:s(w).join(":"),v=p?g+kg:g,S=v+h;if(i.indexOf(S)>-1)continue;i.push(S);const N=r(h,y);for(let A=0;A<N.length;++A){const j=N[A];i.push(v+j)}c=m+(c.length>0?" "+c:c)}return c},Nz=(...e)=>{let t=0,n,a,r="";for(;t<e.length;)(n=e[t++])&&(a=zN(n))&&(r&&(r+=" "),r+=a);return r},zN=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=zN(e[a]))&&(n&&(n+=" "),n+=t);return n},LN=(e,...t)=>{let n,a,r,s;const i=c=>{const u=t.reduce((m,f)=>f(m),e());return n=yz(u),a=n.cache.get,r=n.cache.set,s=l,l(c)},l=c=>{const u=a(c);if(u)return u;const m=jz(c,n);return r(c,m),m};return s=i,(...c)=>s(Nz(...c))},Cz=[],Pt=e=>{const t=n=>n[e]||Cz;return t.isThemeGetter=!0,t},IN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$N=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Az=/^\d+\/\d+$/,_z=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ez=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=e=>Az.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),uo=e=>!!e&&Number.isInteger(Number(e)),Mg=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Sr=e=>_z.test(e),Mz=()=>!0,Dz=e=>Ez.test(e)&&!Tz.test(e),BN=()=>!1,Oz=e=>Rz.test(e),Pz=e=>kz.test(e),zz=e=>!ue(e)&&!de(e),Lz=e=>xi(e,GN,BN),ue=e=>IN.test(e),Jo=e=>xi(e,YN,Dz),Dg=e=>xi(e,Hz,Pe),UN=e=>xi(e,FN,BN),Iz=e=>xi(e,VN,Pz),mf=e=>xi(e,KN,Oz),de=e=>$N.test(e),jc=e=>bi(e,YN),$z=e=>bi(e,Fz),HN=e=>bi(e,FN),Bz=e=>bi(e,GN),Uz=e=>bi(e,VN),wf=e=>bi(e,KN,!0),xi=(e,t,n)=>{const a=IN.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},bi=(e,t,n=!1)=>{const a=$N.exec(e);return a?a[1]?t(a[1]):n:!1},FN=e=>e==="position"||e==="percentage",VN=e=>e==="image"||e==="url",GN=e=>e==="length"||e==="size"||e==="bg-size",YN=e=>e==="length",Hz=e=>e==="number",Fz=e=>e==="family-name",KN=e=>e==="shadow",qN=()=>{const e=Pt("color"),t=Pt("font"),n=Pt("text"),a=Pt("font-weight"),r=Pt("tracking"),s=Pt("leading"),i=Pt("breakpoint"),l=Pt("container"),c=Pt("spacing"),u=Pt("radius"),m=Pt("shadow"),f=Pt("inset-shadow"),w=Pt("text-shadow"),p=Pt("drop-shadow"),x=Pt("blur"),b=Pt("perspective"),y=Pt("aspect"),h=Pt("ease"),g=Pt("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...S(),de,ue],A=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],C=()=>[de,ue,c],R=()=>[gi,"full","auto",...C()],M=()=>[uo,"none","subgrid",de,ue],z=()=>["auto",{span:["full",uo,de,ue]},uo,de,ue],B=()=>[uo,"auto",de,ue],I=()=>["auto","min","max","fr",de,ue],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...C()],O=()=>[gi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],_=()=>[e,de,ue],$=()=>[...S(),HN,UN,{position:[de,ue]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Bz,Lz,{size:[de,ue]}],Q=()=>[Mg,jc,Jo],X=()=>["","none","full",u,de,ue],P=()=>["",Pe,jc,Jo],G=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Pe,Mg,HN,UN],Z=()=>["","none",x,de,ue],le=()=>["none",Pe,de,ue],he=()=>["none",Pe,de,ue],ae=()=>[Pe,de,ue],K=()=>[gi,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sr],breakpoint:[Sr],color:[Mz],container:[Sr],"drop-shadow":[Sr],ease:["in","out","in-out"],font:[zz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sr],shadow:[Sr],spacing:["px",Pe],text:[Sr],"text-shadow":[Sr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gi,ue,de,y]}],container:["container"],columns:[{columns:[Pe,ue,de,l]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[uo,"auto",de,ue]}],basis:[{basis:[gi,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,gi,"auto","initial","none",ue]}],grow:[{grow:["",Pe,de,ue]}],shrink:[{shrink:["",Pe,de,ue]}],order:[{order:[uo,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[l,"screen",...O()]}],"min-w":[{"min-w":[l,"screen","none",...O()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,jc,Jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,de,Dg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mg,ue]}],"font-family":[{font:[$z,ue,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,de,ue]}],"line-clamp":[{"line-clamp":[Pe,"none",de,Dg]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",de,Jo]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Pe,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uo,de,ue],radial:["",de,ue],conic:[uo,de,ue]},Uz,Iz]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,de,ue]}],"outline-w":[{outline:["",Pe,jc,Jo]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",m,wf,mf]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",f,wf,mf]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Pe,Jo]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",w,wf,mf]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Pe,de,ue]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:Z()}],brightness:[{brightness:[Pe,de,ue]}],contrast:[{contrast:[Pe,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",p,wf,mf]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Pe,de,ue]}],"hue-rotate":[{"hue-rotate":[Pe,de,ue]}],invert:[{invert:["",Pe,de,ue]}],saturate:[{saturate:[Pe,de,ue]}],sepia:[{sepia:["",Pe,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":Z()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",Pe,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",de,ue]}],ease:[{ease:["linear","initial",h,de,ue]}],delay:[{delay:[Pe,de,ue]}],animate:[{animate:["none",g,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,de,ue]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ue]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Pe,jc,Jo,Dg]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Vz=(e,{cacheSize:t,prefix:n,experimentalParseClassName:a,extend:r={},override:s={}})=>(Nc(e,"cacheSize",t),Nc(e,"prefix",n),Nc(e,"experimentalParseClassName",a),pf(e.theme,s.theme),pf(e.classGroups,s.classGroups),pf(e.conflictingClassGroups,s.conflictingClassGroups),pf(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Nc(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),hf(e.theme,r.theme),hf(e.classGroups,r.classGroups),hf(e.conflictingClassGroups,r.conflictingClassGroups),hf(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),XN(e,r,"orderSensitiveModifiers"),e),Nc=(e,t,n)=>{n!==void 0&&(e[t]=n)},pf=(e,t)=>{if(t)for(const n in t)Nc(e,n,t[n])},hf=(e,t)=>{if(t)for(const n in t)XN(e,t,n)},XN=(e,t,n)=>{const a=t[n];a!==void 0&&(e[n]=e[n]?e[n].concat(a):a)},Gz=((e,...t)=>typeof e=="function"?LN(qN,e,...t):LN(()=>Vz(qN(),e),...t))({prefix:"tw"});function E(...e){return Gz(Tg(e))}const gf=hi("tw:inline-flex tw:items-center tw:justify-center tw:gap-0.5 tw:whitespace-nowrap tw:rounded-md tw:text-sm tw:font-medium tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow tw:hover:bg-primary/90",destructive:"tw:bg-destructive tw:text-destructive-foreground tw:shadow-sm tw:hover:bg-destructive/90",outline:"tw:border tw:border-gray-300 tw:bg-white tw:text-gray-700 tw:shadow-sm tw:hover:bg-gray-50 tw:hover:text-gray-900",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-sm tw:hover:bg-secondary/80",ghost:"tw:hover:bg-accent tw:hover:text-accent-foreground",link:"tw:text-primary tw:underline-offset-4 tw:hover:underline"},size:{default:"tw:h-9 tw:px-4 tw:py-2",sm:"tw:h-8 tw:rounded-md tw:px-3 tw:text-xs",lg:"tw:h-10 tw:rounded-md tw:px-8",icon:"tw:h-9 tw:w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ae=d.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...r},s)=>{const i=a?Qo:"button";return o.jsx(i,{className:E(gf({variant:t,size:n,className:e})),ref:s,...r})});Ae.displayName="Button";const pt=d.forwardRef(({className:e,type:t,...n},a)=>o.jsx("input",{type:t,className:E("tw:flex tw:h-9 tw:w-full tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-1 tw:text-base tw:shadow-sm tw:transition-colors tw:file:border-0 tw:file:bg-transparent tw:file:text-sm tw:file:font-medium tw:file:text-foreground tw:placeholder:text-muted-foreground tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:md:text-sm tw:aria-[invalid=true]:border-destructive tw:aria-[invalid=true]:ring-destructive",e),ref:a,...n}));pt.displayName="Input";function Cc(e,[t,n]){return Math.min(n,Math.max(t,e))}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Yz(e,t){const n=d.createContext(t),a=s=>{const{children:i,...l}=s,c=d.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function r(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,r]}function Ht(e,t=[]){let n=[];function a(s,i){const l=d.createContext(i),c=n.length;n=[...n,i];const u=f=>{var h;const{scope:w,children:p,...x}=f,b=((h=w==null?void 0:w[e])==null?void 0:h[c])||l,y=d.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:y,children:p})};u.displayName=s+"Provider";function m(f,w){var b;const p=((b=w==null?void 0:w[e])==null?void 0:b[c])||l,x=d.useContext(p);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,m]}const r=()=>{const s=n.map(i=>d.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[a,Kz(r,...t)]}function Kz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=a.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function WN(e){const t=qz(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(Wz);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function qz(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=Qz(r),l=Zz(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xz=Symbol("radix.slottable");function Wz(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xz}function Zz(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Qz(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xf(e){const t=e+"CollectionProvider",[n,a]=Ht(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:h}=b,g=J.useRef(null),v=J.useRef(new Map).current;return o.jsx(r,{scope:y,itemMap:v,collectionRef:g,children:h})};i.displayName=t;const l=e+"CollectionSlot",c=WN(l),u=J.forwardRef((b,y)=>{const{scope:h,children:g}=b,v=s(l,h),S=Se(y,v.collectionRef);return o.jsx(c,{ref:S,children:g})});u.displayName=l;const m=e+"CollectionItemSlot",f="data-radix-collection-item",w=WN(m),p=J.forwardRef((b,y)=>{const{scope:h,children:g,...v}=b,S=J.useRef(null),N=Se(y,S),A=s(m,h);return J.useEffect(()=>(A.itemMap.set(S,{ref:S,...v}),()=>void A.itemMap.delete(S))),o.jsx(w,{[f]:"",ref:N,children:g})});p.displayName=m;function x(b){const y=s(e+"CollectionConsumer",b);return J.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((A,j)=>v.indexOf(A.ref.current)-v.indexOf(j.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},x,a]}var Jz=d.createContext(void 0);function es(e){const t=d.useContext(Jz);return e||t||"ltr"}function e6(e){const t=t6(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(a6);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function t6(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=o6(r),l=r6(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var n6=Symbol("radix.slottable");function a6(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===n6}function r6(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function o6(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var s6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],me=s6.reduce((e,t)=>{const n=e6(`Primitive.${t}`),a=d.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function ZN(e,t){e&&Eo.flushSync(()=>e.dispatchEvent(t))}function Ft(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function i6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e);d.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var l6="DismissableLayer",Og="dismissableLayer.update",c6="dismissableLayer.pointerDownOutside",u6="dismissableLayer.focusOutside",QN,JN=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vi=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,u=d.useContext(JN),[m,f]=d.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=d.useState({}),x=Se(t,j=>f(j)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=b.indexOf(y),g=m?b.indexOf(m):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,S=g>=h,N=m6(j=>{const C=j.target,R=[...u.branches].some(M=>M.contains(C));!S||R||(r==null||r(j),i==null||i(j),j.defaultPrevented||l==null||l())},w),A=w6(j=>{const C=j.target;[...u.branches].some(M=>M.contains(C))||(s==null||s(j),i==null||i(j),j.defaultPrevented||l==null||l())},w);return i6(j=>{g===u.layers.size-1&&(a==null||a(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},w),d.useEffect(()=>{if(m)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(QN=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(m)),u.layers.add(m),e2(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=QN)}},[m,w,n,u]),d.useEffect(()=>()=>{m&&(u.layers.delete(m),u.layersWithOutsidePointerEventsDisabled.delete(m),e2())},[m,u]),d.useEffect(()=>{const j=()=>p({});return document.addEventListener(Og,j),()=>document.removeEventListener(Og,j)},[]),o.jsx(me.div,{...c,ref:x,style:{pointerEvents:v?S?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,N.onPointerDownCapture)})});vi.displayName=l6;var d6="DismissableLayerBranch",f6=d.forwardRef((e,t)=>{const n=d.useContext(JN),a=d.useRef(null),r=Se(t,a);return d.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),o.jsx(me.div,{...e,ref:r})});f6.displayName=d6;function m6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e),a=d.useRef(!1),r=d.useRef(()=>{});return d.useEffect(()=>{const s=l=>{if(l.target&&!a.current){let c=function(){t2(c6,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function w6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e),a=d.useRef(!1);return d.useEffect(()=>{const r=s=>{s.target&&!a.current&&t2(u6,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function e2(){const e=new CustomEvent(Og);document.dispatchEvent(e)}function t2(e,t,n,{discrete:a}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?ZN(r,s):r.dispatchEvent(s)}var Pg=0;function bf(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n2()),document.body.insertAdjacentElement("beforeend",e[1]??n2()),Pg++,()=>{Pg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pg--}},[])}function n2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zg="focusScope.autoFocusOnMount",Lg="focusScope.autoFocusOnUnmount",a2={bubbles:!1,cancelable:!0},p6="FocusScope",Ac=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[l,c]=d.useState(null),u=Ft(r),m=Ft(s),f=d.useRef(null),w=Se(t,b=>c(b)),p=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(a){let b=function(v){if(p.paused||!l)return;const S=v.target;l.contains(S)?f.current=S:fo(f.current,{select:!0})},y=function(v){if(p.paused||!l)return;const S=v.relatedTarget;S!==null&&(l.contains(S)||fo(f.current,{select:!0}))},h=function(v){if(document.activeElement===document.body)for(const N of v)N.removedNodes.length>0&&fo(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const g=new MutationObserver(h);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),g.disconnect()}}},[a,l,p.paused]),d.useEffect(()=>{if(l){s2.add(p);const b=document.activeElement;if(!l.contains(b)){const h=new CustomEvent(zg,a2);l.addEventListener(zg,u),l.dispatchEvent(h),h.defaultPrevented||(h6(y6(r2(l)),{select:!0}),document.activeElement===b&&fo(l))}return()=>{l.removeEventListener(zg,u),setTimeout(()=>{const h=new CustomEvent(Lg,a2);l.addEventListener(Lg,m),l.dispatchEvent(h),h.defaultPrevented||fo(b??document.body,{select:!0}),l.removeEventListener(Lg,m),s2.remove(p)},0)}}},[l,u,m,p]);const x=d.useCallback(b=>{if(!n&&!a||p.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,h=document.activeElement;if(y&&h){const g=b.currentTarget,[v,S]=g6(g);v&&S?!b.shiftKey&&h===S?(b.preventDefault(),n&&fo(v,{select:!0})):b.shiftKey&&h===v&&(b.preventDefault(),n&&fo(S,{select:!0})):h===g&&b.preventDefault()}},[n,a,p.paused]);return o.jsx(me.div,{tabIndex:-1,...i,ref:w,onKeyDown:x})});Ac.displayName=p6;function h6(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fo(a,{select:t}),document.activeElement!==n)return}function g6(e){const t=r2(e),n=o2(t,e),a=o2(t.reverse(),e);return[n,a]}function r2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o2(e,t){for(const n of e)if(!x6(n,{upTo:t}))return n}function x6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function b6(e){return e instanceof HTMLInputElement&&"select"in e}function fo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&b6(e)&&t&&e.select()}}var s2=v6();function v6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=i2(e,t),e.unshift(t)},remove(t){var n;e=i2(e,t),(n=e[0])==null||n.resume()}}}function i2(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function y6(e){return e.filter(t=>t.tagName!=="A")}var jt=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},S6=Au[" useId ".trim().toString()]||(()=>{}),j6=0;function Un(e){const[t,n]=d.useState(S6());return jt(()=>{n(a=>a??String(j6++))},[e]),t?`radix-${t}`:""}const N6=["top","right","bottom","left"],mo=Math.min,Hn=Math.max,vf=Math.round,yf=Math.floor,$a=e=>({x:e,y:e}),C6={left:"right",right:"left",bottom:"top",top:"bottom"},A6={start:"end",end:"start"};function Ig(e,t,n){return Hn(e,mo(t,n))}function jr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function yi(e){return e.split("-")[1]}function $g(e){return e==="x"?"y":"x"}function Bg(e){return e==="y"?"height":"width"}const _6=new Set(["top","bottom"]);function Ba(e){return _6.has(Nr(e))?"y":"x"}function Ug(e){return $g(Ba(e))}function E6(e,t,n){n===void 0&&(n=!1);const a=yi(e),r=Ug(e),s=Bg(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sf(i)),[i,Sf(i)]}function T6(e){const t=Sf(e);return[Hg(e),t,Hg(t)]}function Hg(e){return e.replace(/start|end/g,t=>A6[t])}const l2=["left","right"],c2=["right","left"],R6=["top","bottom"],k6=["bottom","top"];function M6(e,t,n){switch(e){case"top":case"bottom":return n?t?c2:l2:t?l2:c2;case"left":case"right":return t?R6:k6;default:return[]}}function D6(e,t,n,a){const r=yi(e);let s=M6(Nr(e),n==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Hg)))),s}function Sf(e){return e.replace(/left|right|bottom|top/g,t=>C6[t])}function O6(e){return{top:0,right:0,bottom:0,left:0,...e}}function u2(e){return typeof e!="number"?O6(e):{top:e,right:e,bottom:e,left:e}}function jf(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function d2(e,t,n){let{reference:a,floating:r}=e;const s=Ba(t),i=Ug(t),l=Bg(i),c=Nr(t),u=s==="y",m=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,w=a[l]/2-r[l]/2;let p;switch(c){case"top":p={x:m,y:a.y-r.height};break;case"bottom":p={x:m,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:f};break;case"left":p={x:a.x-r.width,y:f};break;default:p={x:a.x,y:a.y}}switch(yi(t)){case"start":p[i]-=w*(n&&u?-1:1);break;case"end":p[i]+=w*(n&&u?-1:1);break}return p}async function P6(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:w=!1,padding:p=0}=jr(t,e),x=u2(p),y=l[w?f==="floating"?"reference":"floating":f],h=jf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:m,strategy:c})),g=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},N=jf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:v,strategy:c}):g);return{top:(h.top-N.top+x.top)/S.y,bottom:(N.bottom-h.bottom+x.bottom)/S.y,left:(h.left-N.left+x.left)/S.x,right:(N.right-h.right+x.right)/S.x}}const z6=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:f}=d2(u,a,c),w=a,p={},x=0;for(let y=0;y<l.length;y++){var b;const{name:h,fn:g}=l[y],{x:v,y:S,data:N,reset:A}=await g({x:m,y:f,initialPlacement:a,placement:w,strategy:r,middlewareData:p,rects:u,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:P6},elements:{reference:e,floating:t}});m=v??m,f=S??f,p={...p,[h]:{...p[h],...N}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(w=A.placement),A.rects&&(u=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:m,y:f}=d2(u,w,c)),y=-1)}return{x:m,y:f,placement:w,strategy:r,middlewareData:p}},L6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:m=0}=jr(e,t)||{};if(u==null)return{};const f=u2(m),w={x:n,y:a},p=Ug(r),x=Bg(p),b=await i.getDimensions(u),y=p==="y",h=y?"top":"left",g=y?"bottom":"right",v=y?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[p]-w[p]-s.floating[x],N=w[p]-s.reference[p],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let j=A?A[v]:0;(!j||!await(i.isElement==null?void 0:i.isElement(A)))&&(j=l.floating[v]||s.floating[x]);const C=S/2-N/2,R=j/2-b[x]/2-1,M=mo(f[h],R),z=mo(f[g],R),B=M,I=j-b[x]-z,V=j/2-b[x]/2+C,D=Ig(B,V,I),T=!c.arrow&&yi(r)!=null&&V!==D&&s.reference[x]/2-(V<B?M:z)-b[x]/2<0,O=T?V<B?V-B:V-I:0;return{[p]:w[p]+O,data:{[p]:D,centerOffset:V-D-O,...T&&{alignmentOffset:O}},reset:T}}}),I6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:w,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...y}=jr(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const h=Nr(r),g=Ba(l),v=Nr(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=w||(v||!b?[Sf(l)]:T6(l)),A=x!=="none";!w&&A&&N.push(...D6(l,b,x,S));const j=[l,...N],C=await c.detectOverflow(t,y),R=[];let M=((a=s.flip)==null?void 0:a.overflows)||[];if(m&&R.push(C[h]),f){const V=E6(r,i,S);R.push(C[V[0]],C[V[1]])}if(M=[...M,{placement:r,overflows:R}],!R.every(V=>V<=0)){var z,B;const V=(((z=s.flip)==null?void 0:z.index)||0)+1,D=j[V];if(D&&(!(f==="alignment"?g!==Ba(D):!1)||M.every(_=>Ba(_.placement)===g?_.overflows[0]>0:!0)))return{data:{index:V,overflows:M},reset:{placement:D}};let T=(B=M.filter(O=>O.overflows[0]<=0).sort((O,_)=>O.overflows[1]-_.overflows[1])[0])==null?void 0:B.placement;if(!T)switch(p){case"bestFit":{var I;const O=(I=M.filter(_=>{if(A){const $=Ba(_.placement);return $===g||$==="y"}return!0}).map(_=>[_.placement,_.overflows.filter($=>$>0).reduce(($,H)=>$+H,0)]).sort((_,$)=>_[1]-$[1])[0])==null?void 0:I[0];O&&(T=O);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function f2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function m2(e){return N6.some(t=>e[t]>=0)}const $6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:r="referenceHidden",...s}=jr(e,t);switch(r){case"referenceHidden":{const i=await a.detectOverflow(t,{...s,elementContext:"reference"}),l=f2(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:m2(l)}}}case"escaped":{const i=await a.detectOverflow(t,{...s,altBoundary:!0}),l=f2(i,n.floating);return{data:{escapedOffsets:l,escaped:m2(l)}}}default:return{}}}}},w2=new Set(["left","top"]);async function B6(e,t){const{placement:n,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Nr(n),l=yi(n),c=Ba(n)==="y",u=w2.has(i)?-1:1,m=s&&c?-1:1,f=jr(t,e);let{mainAxis:w,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*m,y:w*u}:{x:w*u,y:p*m}}const U6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await B6(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},H6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:h=>{let{x:g,y:v}=h;return{x:g,y:v}}},...u}=jr(e,t),m={x:n,y:a},f=await s.detectOverflow(t,u),w=Ba(Nr(r)),p=$g(w);let x=m[p],b=m[w];if(i){const h=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=x+f[h],S=x-f[g];x=Ig(v,x,S)}if(l){const h=w==="y"?"top":"left",g=w==="y"?"bottom":"right",v=b+f[h],S=b-f[g];b=Ig(v,b,S)}const y=c.fn({...t,[p]:x,[w]:b});return{...y,data:{x:y.x-n,y:y.y-a,enabled:{[p]:i,[w]:l}}}}}},F6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=jr(e,t),m={x:n,y:a},f=Ba(r),w=$g(f);let p=m[w],x=m[f];const b=jr(l,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const v=w==="y"?"height":"width",S=s.reference[w]-s.floating[v]+y.mainAxis,N=s.reference[w]+s.reference[v]-y.mainAxis;p<S?p=S:p>N&&(p=N)}if(u){var h,g;const v=w==="y"?"width":"height",S=w2.has(Nr(r)),N=s.reference[f]-s.floating[v]+(S&&((h=i.offset)==null?void 0:h[f])||0)+(S?0:y.crossAxis),A=s.reference[f]+s.reference[v]+(S?0:((g=i.offset)==null?void 0:g[f])||0)-(S?y.crossAxis:0);x<N?x=N:x>A&&(x=A)}return{[w]:p,[f]:x}}}},V6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...u}=jr(e,t),m=await i.detectOverflow(t,u),f=Nr(r),w=yi(r),p=Ba(r)==="y",{width:x,height:b}=s.floating;let y,h;f==="top"||f==="bottom"?(y=f,h=w===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(h=f,y=w==="end"?"top":"bottom");const g=b-m.top-m.bottom,v=x-m.left-m.right,S=mo(b-m[y],g),N=mo(x-m[h],v),A=!t.middlewareData.shift;let j=S,C=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=v),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(j=g),A&&!w){const M=Hn(m.left,0),z=Hn(m.right,0),B=Hn(m.top,0),I=Hn(m.bottom,0);p?C=x-2*(M!==0||z!==0?M+z:Hn(m.left,m.right)):j=b-2*(B!==0||I!==0?B+I:Hn(m.top,m.bottom))}await c({...t,availableWidth:C,availableHeight:j});const R=await i.getDimensions(l.floating);return x!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function Nf(){return typeof window<"u"}function Si(e){return p2(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ua(e){var t;return(t=(p2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function p2(e){return Nf()?e instanceof Node||e instanceof Fn(e).Node:!1}function va(e){return Nf()?e instanceof Element||e instanceof Fn(e).Element:!1}function Ha(e){return Nf()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function h2(e){return!Nf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}const G6=new Set(["inline","contents"]);function _c(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!G6.has(r)}const Y6=new Set(["table","td","th"]);function K6(e){return Y6.has(Si(e))}const q6=[":popover-open",":modal"];function Cf(e){return q6.some(t=>{try{return e.matches(t)}catch{return!1}})}const X6=["transform","translate","scale","rotate","perspective"],W6=["transform","translate","scale","rotate","perspective","filter"],Z6=["paint","layout","strict","content"];function Fg(e){const t=Vg(),n=va(e)?ya(e):e;return X6.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||W6.some(a=>(n.willChange||"").includes(a))||Z6.some(a=>(n.contain||"").includes(a))}function Q6(e){let t=wo(e);for(;Ha(t)&&!ji(t);){if(Fg(t))return t;if(Cf(t))return null;t=wo(t)}return null}function Vg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const J6=new Set(["html","body","#document"]);function ji(e){return J6.has(Si(e))}function ya(e){return Fn(e).getComputedStyle(e)}function Af(e){return va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wo(e){if(Si(e)==="html")return e;const t=e.assignedSlot||e.parentNode||h2(e)&&e.host||Ua(e);return h2(t)?t.host:t}function g2(e){const t=wo(e);return ji(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ha(t)&&_c(t)?t:g2(t)}function Ec(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=g2(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=Fn(r);if(s){const l=Gg(i);return t.concat(i,i.visualViewport||[],_c(r)?r:[],l&&n?Ec(l):[])}return t.concat(r,Ec(r,[],n))}function Gg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function x2(e){const t=ya(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Ha(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:a,l=vf(n)!==s||vf(a)!==i;return l&&(n=s,a=i),{width:n,height:a,$:l}}function Yg(e){return va(e)?e:e.contextElement}function Ni(e){const t=Yg(e);if(!Ha(t))return $a(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:s}=x2(t);let i=(s?vf(n.width):n.width)/a,l=(s?vf(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const e8=$a(0);function b2(e){const t=Fn(e);return!Vg()||!t.visualViewport?e8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function ts(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Yg(e);let i=$a(1);t&&(a?va(a)&&(i=Ni(a)):i=Ni(e));const l=t8(s,n,a)?b2(s):$a(0);let c=(r.left+l.x)/i.x,u=(r.top+l.y)/i.y,m=r.width/i.x,f=r.height/i.y;if(s){const w=Fn(s),p=a&&va(a)?Fn(a):a;let x=w,b=Gg(x);for(;b&&a&&p!==x;){const y=Ni(b),h=b.getBoundingClientRect(),g=ya(b),v=h.left+(b.clientLeft+parseFloat(g.paddingLeft))*y.x,S=h.top+(b.clientTop+parseFloat(g.paddingTop))*y.y;c*=y.x,u*=y.y,m*=y.x,f*=y.y,c+=v,u+=S,x=Fn(b),b=Gg(x)}}return jf({width:m,height:f,x:c,y:u})}function _f(e,t){const n=Af(e).scrollLeft;return t?t.left+n:ts(Ua(e)).left+n}function v2(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-_f(e,n),r=n.top+t.scrollTop;return{x:a,y:r}}function n8(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=Ua(a),l=t?Cf(t.floating):!1;if(a===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=$a(1);const m=$a(0),f=Ha(a);if((f||!f&&!s)&&((Si(a)!=="body"||_c(i))&&(c=Af(a)),Ha(a))){const p=ts(a);u=Ni(a),m.x=p.x+a.clientLeft,m.y=p.y+a.clientTop}const w=i&&!f&&!s?v2(i,c):$a(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+m.x+w.x,y:n.y*u.y-c.scrollTop*u.y+m.y+w.y}}function a8(e){return Array.from(e.getClientRects())}function r8(e){const t=Ua(e),n=Af(e),a=e.ownerDocument.body,r=Hn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=Hn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+_f(e);const l=-n.scrollTop;return ya(a).direction==="rtl"&&(i+=Hn(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const y2=25;function o8(e,t){const n=Fn(e),a=Ua(e),r=n.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const m=Vg();(!m||m&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=_f(a);if(u<=0){const m=a.ownerDocument,f=m.body,w=getComputedStyle(f),p=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(a.clientWidth-f.clientWidth-p);x<=y2&&(s-=x)}else u<=y2&&(s+=u);return{width:s,height:i,x:l,y:c}}const s8=new Set(["absolute","fixed"]);function i8(e,t){const n=ts(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ha(e)?Ni(e):$a(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=a*s.y;return{width:i,height:l,x:c,y:u}}function S2(e,t,n){let a;if(t==="viewport")a=o8(e,n);else if(t==="document")a=r8(Ua(e));else if(va(t))a=i8(t,n);else{const r=b2(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return jf(a)}function j2(e,t){const n=wo(e);return n===t||!va(n)||ji(n)?!1:ya(n).position==="fixed"||j2(n,t)}function l8(e,t){const n=t.get(e);if(n)return n;let a=Ec(e,[],!1).filter(l=>va(l)&&Si(l)!=="body"),r=null;const s=ya(e).position==="fixed";let i=s?wo(e):e;for(;va(i)&&!ji(i);){const l=ya(i),c=Fg(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&s8.has(r.position)||_c(i)&&!c&&j2(e,i))?a=a.filter(m=>m!==i):r=l,i=wo(i)}return t.set(e,a),a}function c8(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?Cf(t)?[]:l8(t,this._c):[].concat(n),a],l=i[0],c=i.reduce((u,m)=>{const f=S2(t,m,r);return u.top=Hn(f.top,u.top),u.right=mo(f.right,u.right),u.bottom=mo(f.bottom,u.bottom),u.left=Hn(f.left,u.left),u},S2(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function u8(e){const{width:t,height:n}=x2(e);return{width:t,height:n}}function d8(e,t,n){const a=Ha(t),r=Ua(t),s=n==="fixed",i=ts(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=$a(0);function u(){c.x=_f(r)}if(a||!a&&!s)if((Si(t)!=="body"||_c(r))&&(l=Af(t)),a){const p=ts(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else r&&u();s&&!a&&r&&u();const m=r&&!a&&!s?v2(r,l):$a(0),f=i.left+l.scrollLeft-c.x-m.x,w=i.top+l.scrollTop-c.y-m.y;return{x:f,y:w,width:i.width,height:i.height}}function Kg(e){return ya(e).position==="static"}function N2(e,t){if(!Ha(e)||ya(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ua(e)===n&&(n=n.ownerDocument.body),n}function C2(e,t){const n=Fn(e);if(Cf(e))return n;if(!Ha(e)){let r=wo(e);for(;r&&!ji(r);){if(va(r)&&!Kg(r))return r;r=wo(r)}return n}let a=N2(e,t);for(;a&&K6(a)&&Kg(a);)a=N2(a,t);return a&&ji(a)&&Kg(a)&&!Fg(a)?n:a||Q6(e)||n}const f8=async function(e){const t=this.getOffsetParent||C2,n=this.getDimensions,a=await n(e.floating);return{reference:d8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function m8(e){return ya(e).direction==="rtl"}const w8={convertOffsetParentRelativeRectToViewportRelativeRect:n8,getDocumentElement:Ua,getClippingRect:c8,getOffsetParent:C2,getElementRects:f8,getClientRects:a8,getDimensions:u8,getScale:Ni,isElement:va,isRTL:m8};function A2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function p8(e,t){let n=null,a;const r=Ua(e);function s(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:m,top:f,width:w,height:p}=u;if(l||t(),!w||!p)return;const x=yf(f),b=yf(r.clientWidth-(m+w)),y=yf(r.clientHeight-(f+p)),h=yf(m),v={rootMargin:-x+"px "+-b+"px "+-y+"px "+-h+"px",threshold:Hn(0,mo(1,c))||1};let S=!0;function N(A){const j=A[0].intersectionRatio;if(j!==c){if(!S)return i();j?i(!1,j):a=setTimeout(()=>{i(!1,1e-7)},1e3)}j===1&&!A2(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,v)}n.observe(e)}return i(!0),s}function h8(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,u=Yg(e),m=r||s?[...u?Ec(u):[],...Ec(t)]:[];m.forEach(h=>{r&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const f=u&&l?p8(u,n):null;let w=-1,p=null;i&&(p=new ResizeObserver(h=>{let[g]=h;g&&g.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let x,b=c?ts(e):null;c&&y();function y(){const h=ts(e);b&&!A2(b,h)&&n(),b=h,x=requestAnimationFrame(y)}return n(),()=>{var h;m.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),f==null||f(),(h=p)==null||h.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const g8=U6,x8=H6,b8=I6,v8=V6,y8=$6,_2=L6,S8=F6,j8=(e,t,n)=>{const a=new Map,r={platform:w8,...n},s={...r.platform,_c:a};return z6(e,t,{...r,platform:s})};var N8=typeof document<"u",C8=function(){},Ef=N8?d.useLayoutEffect:C8;function Tf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Tf(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;a--!==0;){const s=r[a];if(!(s==="_owner"&&e.$$typeof)&&!Tf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function E2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function T2(e,t){const n=E2(e);return Math.round(t*n)/n}function qg(e){const t=d.useRef(e);return Ef(()=>{t.current=e}),t}function A8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[m,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,p]=d.useState(a);Tf(w,a)||p(a);const[x,b]=d.useState(null),[y,h]=d.useState(null),g=d.useCallback(_=>{_!==A.current&&(A.current=_,b(_))},[]),v=d.useCallback(_=>{_!==j.current&&(j.current=_,h(_))},[]),S=s||x,N=i||y,A=d.useRef(null),j=d.useRef(null),C=d.useRef(m),R=c!=null,M=qg(c),z=qg(r),B=qg(u),I=d.useCallback(()=>{if(!A.current||!j.current)return;const _={placement:t,strategy:n,middleware:w};z.current&&(_.platform=z.current),j8(A.current,j.current,_).then($=>{const H={...$,isPositioned:B.current!==!1};V.current&&!Tf(C.current,H)&&(C.current=H,Eo.flushSync(()=>{f(H)}))})},[w,t,n,z,B]);Ef(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[u]);const V=d.useRef(!1);Ef(()=>(V.current=!0,()=>{V.current=!1}),[]),Ef(()=>{if(S&&(A.current=S),N&&(j.current=N),S&&N){if(M.current)return M.current(S,N,I);I()}},[S,N,I,M,R]);const D=d.useMemo(()=>({reference:A,floating:j,setReference:g,setFloating:v}),[g,v]),T=d.useMemo(()=>({reference:S,floating:N}),[S,N]),O=d.useMemo(()=>{const _={position:n,left:0,top:0};if(!T.floating)return _;const $=T2(T.floating,m.x),H=T2(T.floating,m.y);return l?{..._,transform:"translate("+$+"px, "+H+"px)",...E2(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:H}},[n,l,T.floating,m.x,m.y]);return d.useMemo(()=>({...m,update:I,refs:D,elements:T,floatingStyles:O}),[m,I,D,T,O])}const _8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:r}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?_2({element:a.current,padding:r}).fn(n):{}:a?_2({element:a,padding:r}).fn(n):{}}}},E8=(e,t)=>({...g8(e),options:[e,t]}),T8=(e,t)=>({...x8(e),options:[e,t]}),R8=(e,t)=>({...S8(e),options:[e,t]}),k8=(e,t)=>({...b8(e),options:[e,t]}),M8=(e,t)=>({...v8(e),options:[e,t]}),D8=(e,t)=>({...y8(e),options:[e,t]}),O8=(e,t)=>({..._8(e),options:[e,t]});var P8="Arrow",R2=d.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...s}=e;return o.jsx(me.svg,{...s,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});R2.displayName=P8;var z8=R2;function Tc(e){const[t,n]=d.useState(void 0);return jt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Xg="Popper",[k2,po]=Ht(Xg),[L8,M2]=k2(Xg),D2=e=>{const{__scopePopper:t,children:n}=e,[a,r]=d.useState(null);return o.jsx(L8,{scope:t,anchor:a,onAnchorChange:r,children:n})};D2.displayName=Xg;var O2="PopperAnchor",P2=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,s=M2(O2,n),i=d.useRef(null),l=Se(t,i),c=d.useRef(null);return d.useEffect(()=>{const u=c.current;c.current=(a==null?void 0:a.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),a?null:o.jsx(me.div,{...r,ref:l})});P2.displayName=O2;var Wg="PopperContent",[I8,$8]=k2(Wg),z2=d.forwardRef((e,t)=>{var Y,Z,le,he,ae,K;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:w=!1,updatePositionStrategy:p="optimized",onPlaced:x,...b}=e,y=M2(Wg,n),[h,g]=d.useState(null),v=Se(t,ge=>g(ge)),[S,N]=d.useState(null),A=Tc(S),j=(A==null?void 0:A.width)??0,C=(A==null?void 0:A.height)??0,R=a+(s!=="center"?"-"+s:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},z=Array.isArray(u)?u:[u],B=z.length>0,I={padding:M,boundary:z.filter(U8),altBoundary:B},{refs:V,floatingStyles:D,placement:T,isPositioned:O,middlewareData:_}=A8({strategy:"fixed",placement:R,whileElementsMounted:(...ge)=>h8(...ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[E8({mainAxis:r+C,alignmentAxis:i}),c&&T8({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?R8():void 0,...I}),c&&k8({...I}),M8({...I,apply:({elements:ge,rects:Ne,availableWidth:We,availableHeight:Ke})=>{const{width:at,height:Kt}=Ne.reference,He=ge.floating.style;He.setProperty("--radix-popper-available-width",`${We}px`),He.setProperty("--radix-popper-available-height",`${Ke}px`),He.setProperty("--radix-popper-anchor-width",`${at}px`),He.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),S&&O8({element:S,padding:l}),H8({arrowWidth:j,arrowHeight:C}),w&&D8({strategy:"referenceHidden",...I})]}),[$,H]=$2(T),F=Ft(x);jt(()=>{O&&(F==null||F())},[O,F]);const Q=(Y=_.arrow)==null?void 0:Y.x,X=(Z=_.arrow)==null?void 0:Z.y,P=((le=_.arrow)==null?void 0:le.centerOffset)!==0,[G,ne]=d.useState();return jt(()=>{h&&ne(window.getComputedStyle(h).zIndex)},[h]),o.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:O?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(he=_.transformOrigin)==null?void 0:he.x,(ae=_.transformOrigin)==null?void 0:ae.y].join(" "),...((K=_.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(I8,{scope:n,placedSide:$,onArrowChange:N,arrowX:Q,arrowY:X,shouldHideArrow:P,children:o.jsx(me.div,{"data-side":$,"data-align":H,...b,ref:v,style:{...b.style,animation:O?void 0:"none"}})})})});z2.displayName=Wg;var L2="PopperArrow",B8={top:"bottom",right:"left",bottom:"top",left:"right"},I2=d.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,s=$8(L2,a),i=B8[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(z8,{...r,ref:n,style:{...r.style,display:"block"}})})});I2.displayName=L2;function U8(e){return e!==null}var H8=e=>({name:"transformOrigin",options:e,fn(t){var y,h,g;const{placement:n,rects:a,middlewareData:r}=t,i=((y=r.arrow)==null?void 0:y.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,m]=$2(n),f={start:"0%",center:"50%",end:"100%"}[m],w=(((h=r.arrow)==null?void 0:h.x)??0)+l/2,p=(((g=r.arrow)==null?void 0:g.y)??0)+c/2;let x="",b="";return u==="bottom"?(x=i?f:`${w}px`,b=`${-c}px`):u==="top"?(x=i?f:`${w}px`,b=`${a.floating.height+c}px`):u==="right"?(x=`${-c}px`,b=i?f:`${p}px`):u==="left"&&(x=`${a.floating.width+c}px`,b=i?f:`${p}px`),{data:{x,y:b}}}});function $2(e){const[t,n="center"]=e.split("-");return[t,n]}var Rf=D2,Rc=P2,kf=z2,Mf=I2,F8="Portal",Ci=d.forwardRef((e,t)=>{var l;const{container:n,...a}=e,[r,s]=d.useState(!1);jt(()=>s(!0),[]);const i=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?Yv.createPortal(o.jsx(me.div,{...a,ref:t}),i):null});Ci.displayName=F8;function V8(e){const t=G8(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(K8);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function G8(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=X8(r),l=q8(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Y8=Symbol("radix.slottable");function K8(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Y8}function q8(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function X8(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var W8=Au[" useInsertionEffect ".trim().toString()]||jt;function Vn({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,s,i]=Z8({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const m=d.useRef(e!==void 0);d.useEffect(()=>{const f=m.current;f!==l&&console.warn(`${a} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,a])}const u=d.useCallback(m=>{var f;if(l){const w=Q8(m)?m(e):m;w!==e&&((f=i.current)==null||f.call(i,w))}else s(m)},[l,e,s,i]);return[c,u]}function Z8({defaultProp:e,onChange:t}){const[n,a]=d.useState(e),r=d.useRef(n),s=d.useRef(t);return W8(()=>{s.current=t},[t]),d.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,a,s]}function Q8(e){return typeof e=="function"}function kc(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var B2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),J8="VisuallyHidden",U2=d.forwardRef((e,t)=>o.jsx(me.span,{...e,ref:t,style:{...B2,...e.style}}));U2.displayName=J8;var eL=U2,tL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ai=new WeakMap,Df=new WeakMap,Of={},Zg=0,H2=function(e){return e&&(e.host||H2(e.parentNode))},nL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=H2(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},aL=function(e,t,n,a){var r=nL(t,Array.isArray(e)?e:[e]);Of[n]||(Of[n]=new WeakMap);var s=Of[n],i=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var m=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(w){if(l.has(w))m(w);else try{var p=w.getAttribute(a),x=p!==null&&p!=="false",b=(Ai.get(w)||0)+1,y=(s.get(w)||0)+1;Ai.set(w,b),s.set(w,y),i.push(w),b===1&&x&&Df.set(w,!0),y===1&&w.setAttribute(n,"true"),x||w.setAttribute(a,"true")}catch(h){console.error("aria-hidden: cannot operate on ",w,h)}})};return m(t),l.clear(),Zg++,function(){i.forEach(function(f){var w=Ai.get(f)-1,p=s.get(f)-1;Ai.set(f,w),s.set(f,p),w||(Df.has(f)||f.removeAttribute(a),Df.delete(f)),p||f.removeAttribute(n)}),Zg--,Zg||(Ai=new WeakMap,Ai=new WeakMap,Df=new WeakMap,Of={})}},Pf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=tL(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),aL(a,r,n,"aria-hidden")):function(){return null}},Fa=function(){return Fa=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Fa.apply(this,arguments)};function F2(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function rL(e,t,n){if(n||arguments.length===2)for(var a=0,r=t.length,s;a<r;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var zf="right-scroll-bar-position",Lf="width-before-scroll-bar",oL="with-scroll-bars-hidden",sL="--removed-body-scroll-bar-size";function Qg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iL(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=t,n.facade}var lL=typeof window<"u"?d.useLayoutEffect:d.useEffect,V2=new WeakMap;function cL(e,t){var n=iL(null,function(a){return e.forEach(function(r){return Qg(r,a)})});return lL(function(){var a=V2.get(n);if(a){var r=new Set(a),s=new Set(e),i=n.current;r.forEach(function(l){s.has(l)||Qg(l,null)}),s.forEach(function(l){r.has(l)||Qg(l,i)})}V2.set(n,e)},[e]),n}function uL(e){return e}function dL(e,t){t===void 0&&(t=uL);var n=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,a);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(a=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){a=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var c=function(){var m=i;i=[],m.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(m){i.push(m),u()},filter:function(m){return i=i.filter(m),n}}}};return r}function fL(e){e===void 0&&(e={});var t=dL(null);return t.options=Fa({async:!0,ssr:!1},e),t}var G2=function(e){var t=e.sideCar,n=F2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return d.createElement(a,Fa({},n))};G2.isSideCarExport=!0;function mL(e,t){return e.useMedium(t),G2}var Y2=fL(),Jg=function(){},If=d.forwardRef(function(e,t){var n=d.useRef(null),a=d.useState({onScrollCapture:Jg,onWheelCapture:Jg,onTouchMoveCapture:Jg}),r=a[0],s=a[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,m=e.enabled,f=e.shards,w=e.sideCar,p=e.noRelative,x=e.noIsolation,b=e.inert,y=e.allowPinchZoom,h=e.as,g=h===void 0?"div":h,v=e.gapMode,S=F2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=w,A=cL([n,t]),j=Fa(Fa({},S),r);return d.createElement(d.Fragment,null,m&&d.createElement(N,{sideCar:Y2,removeScrollBar:u,shards:f,noRelative:p,noIsolation:x,inert:b,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:v}),i?d.cloneElement(d.Children.only(l),Fa(Fa({},j),{ref:A})):d.createElement(g,Fa({},j,{className:c,ref:A}),l))});If.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},If.classNames={fullWidth:Lf,zeroRight:zf};var wL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wL();return t&&e.setAttribute("nonce",t),e}function hL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pL())&&(hL(t,n),gL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bL=function(){var e=xL();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},K2=function(){var e=bL(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},vL={left:0,top:0,right:0,gap:0},ex=function(e){return parseInt(e||"",10)||0},yL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[ex(n),ex(a),ex(r)]},SL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vL;var t=yL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},jL=K2(),_i="data-scroll-locked",NL=function(e,t,n,a){var r=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`417 .`.concat( oL,` {406 */const ZP=fe("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 407 * @license lucide-react v0.564.0 - ISC 408 * 409 * This source code is licensed under the ISC license. 410 * See the LICENSE file in the root directory of this source tree. 411 */const QP=fe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);/** 412 * @license lucide-react v0.564.0 - ISC 413 * 414 * This source code is licensed under the ISC license. 415 * See the LICENSE file in the root directory of this source tree. 416 */const Eg=fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function CN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ia(...e){return t=>{let n=!1;const a=e.map(r=>{const s=CN(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<a.length;r++){const s=a[r];typeof s=="function"?s():CN(e[r],null)}}}}function Se(...e){return u.useCallback(Ia(...e),e)}var JP=Symbol.for("react.lazy"),uf=Au[" use ".trim().toString()];function ez(e){return typeof e=="object"&&e!==null&&"then"in e}function AN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===JP&&"_payload"in e&&ez(e._payload)}function df(e){const t=tz(e),n=u.forwardRef((a,r)=>{let{children:s,...i}=a;AN(s)&&typeof uf=="function"&&(s=uf(s._payload));const l=u.Children.toArray(s),c=l.find(az);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Qo=df("Slot");function tz(e){const t=u.forwardRef((n,a)=>{let{children:r,...s}=n;if(AN(r)&&typeof uf=="function"&&(r=uf(r._payload)),u.isValidElement(r)){const i=oz(r),l=rz(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nz=Symbol("radix.slottable");function az(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nz}function rz(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function oz(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _N(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=_N(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Tg(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=_N(e))&&(a&&(a+=" "),a+=t);return a}const EN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TN=Tg,hi=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return TN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const m=n==null?void 0:n[d],f=s==null?void 0:s[d];if(m===null)return null;const w=EN(m)||EN(f);return r[d][w]}),l=n&&Object.entries(n).reduce((d,m)=>{let[f,w]=m;return w===void 0||(d[f]=w),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,m)=>{let{class:f,className:w,...p}=m;return Object.entries(p).every(x=>{let[b,y]=x;return Array.isArray(y)?y.includes({...s,...l}[b]):{...s,...l}[b]===y})?[...d,f,w]:d},[]);return TN(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},sz=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},iz=(e,t)=>({classGroupId:e,validator:t}),RN=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ff="-",kN=[],lz="arbitrary..",cz=e=>{const t=dz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return uz(i);const l=i.split(ff),c=l[0]===""&&l.length>1?1:0;return MN(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=n[i];return c?d?sz(d,c):c:d||kN}return n[i]||kN}}},MN=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const d=MN(e,t+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=t===0?e.join(ff):e.slice(t).join(ff),c=i.length;for(let d=0;d<c;d++){const m=i[d];if(m.validator(l))return m.classGroupId}},uz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?lz+a:void 0})(),dz=e=>{const{theme:t,classGroups:n}=e;return fz(n,t)},fz=(e,t)=>{const n=RN();for(const a in e){const r=e[a];Rg(r,n,a,t)}return n},Rg=(e,t,n,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];mz(i,t,n,a)}},mz=(e,t,n,a)=>{if(typeof e=="string"){wz(e,t,n);return}if(typeof e=="function"){pz(e,t,n,a);return}hz(e,t,n,a)},wz=(e,t,n)=>{const a=e===""?t:DN(t,e);a.classGroupId=n},pz=(e,t,n,a)=>{if(gz(e)){Rg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(iz(n,e))},hz=(e,t,n,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];Rg(c,DN(t,l),n,a)}},DN=(e,t)=>{let n=e;const a=t.split(ff),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=n.nextPart.get(i);l||(l=RN(),n.nextPart.set(i,l)),n=l}return n},gz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,xz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const r=(s,i)=>{n[s]=i,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},kg="!",ON=":",bz=[],PN=(e,t,n,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),vz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const m=r.length;for(let b=0;b<m;b++){const y=r[b];if(i===0&&l===0){if(y===ON){s.push(r.slice(c,b)),c=b+1;continue}if(y==="/"){d=b;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?r:r.slice(c);let w=f,p=!1;f.endsWith(kg)?(w=f.slice(0,-1),p=!0):f.startsWith(kg)&&(w=f.slice(1),p=!0);const x=d&&d>c?d-c:void 0;return PN(s,p,w,x)};if(t){const r=t+ON,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):PN(bz,!1,i,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},yz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},Sz=e=>({cache:xz(e.cacheSize),parseClassName:vz(e),sortModifiers:yz(e),...cz(e)}),jz=/\s+/,Nz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(jz);let c="";for(let d=l.length-1;d>=0;d-=1){const m=l[d],{isExternal:f,modifiers:w,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:b}=n(m);if(f){c=m+(c.length>0?" "+c:c);continue}let y=!!b,h=a(y?x.substring(0,b):x);if(!h){if(!y){c=m+(c.length>0?" "+c:c);continue}if(h=a(x),!h){c=m+(c.length>0?" "+c:c);continue}y=!1}const g=w.length===0?"":w.length===1?w[0]:s(w).join(":"),v=p?g+kg:g,S=v+h;if(i.indexOf(S)>-1)continue;i.push(S);const N=r(h,y);for(let A=0;A<N.length;++A){const j=N[A];i.push(v+j)}c=m+(c.length>0?" "+c:c)}return c},Cz=(...e)=>{let t=0,n,a,r="";for(;t<e.length;)(n=e[t++])&&(a=zN(n))&&(r&&(r+=" "),r+=a);return r},zN=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=zN(e[a]))&&(n&&(n+=" "),n+=t);return n},LN=(e,...t)=>{let n,a,r,s;const i=c=>{const d=t.reduce((m,f)=>f(m),e());return n=Sz(d),a=n.cache.get,r=n.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const m=Nz(c,n);return r(c,m),m};return s=i,(...c)=>s(Cz(...c))},Az=[],Pt=e=>{const t=n=>n[e]||Az;return t.isThemeGetter=!0,t},IN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$N=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_z=/^\d+\/\d+$/,Ez=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=e=>_z.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),uo=e=>!!e&&Number.isInteger(Number(e)),Mg=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Sr=e=>Ez.test(e),Dz=()=>!0,Oz=e=>Tz.test(e)&&!Rz.test(e),BN=()=>!1,Pz=e=>kz.test(e),zz=e=>Mz.test(e),Lz=e=>!ue(e)&&!de(e),Iz=e=>xi(e,GN,BN),ue=e=>IN.test(e),Jo=e=>xi(e,YN,Oz),Dg=e=>xi(e,Fz,Pe),UN=e=>xi(e,FN,BN),$z=e=>xi(e,VN,zz),mf=e=>xi(e,KN,Pz),de=e=>$N.test(e),jc=e=>bi(e,YN),Bz=e=>bi(e,Vz),HN=e=>bi(e,FN),Uz=e=>bi(e,GN),Hz=e=>bi(e,VN),wf=e=>bi(e,KN,!0),xi=(e,t,n)=>{const a=IN.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},bi=(e,t,n=!1)=>{const a=$N.exec(e);return a?a[1]?t(a[1]):n:!1},FN=e=>e==="position"||e==="percentage",VN=e=>e==="image"||e==="url",GN=e=>e==="length"||e==="size"||e==="bg-size",YN=e=>e==="length",Fz=e=>e==="number",Vz=e=>e==="family-name",KN=e=>e==="shadow",qN=()=>{const e=Pt("color"),t=Pt("font"),n=Pt("text"),a=Pt("font-weight"),r=Pt("tracking"),s=Pt("leading"),i=Pt("breakpoint"),l=Pt("container"),c=Pt("spacing"),d=Pt("radius"),m=Pt("shadow"),f=Pt("inset-shadow"),w=Pt("text-shadow"),p=Pt("drop-shadow"),x=Pt("blur"),b=Pt("perspective"),y=Pt("aspect"),h=Pt("ease"),g=Pt("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...S(),de,ue],A=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],C=()=>[de,ue,c],R=()=>[gi,"full","auto",...C()],M=()=>[uo,"none","subgrid",de,ue],z=()=>["auto",{span:["full",uo,de,ue]},uo,de,ue],B=()=>[uo,"auto",de,ue],I=()=>["auto","min","max","fr",de,ue],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...C()],O=()=>[gi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],_=()=>[e,de,ue],$=()=>[...S(),HN,UN,{position:[de,ue]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Uz,Iz,{size:[de,ue]}],Q=()=>[Mg,jc,Jo],X=()=>["","none","full",d,de,ue],P=()=>["",Pe,jc,Jo],G=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Pe,Mg,HN,UN],Z=()=>["","none",x,de,ue],le=()=>["none",Pe,de,ue],he=()=>["none",Pe,de,ue],ae=()=>[Pe,de,ue],K=()=>[gi,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sr],breakpoint:[Sr],color:[Dz],container:[Sr],"drop-shadow":[Sr],ease:["in","out","in-out"],font:[Lz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sr],shadow:[Sr],spacing:["px",Pe],text:[Sr],"text-shadow":[Sr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gi,ue,de,y]}],container:["container"],columns:[{columns:[Pe,ue,de,l]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[uo,"auto",de,ue]}],basis:[{basis:[gi,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,gi,"auto","initial","none",ue]}],grow:[{grow:["",Pe,de,ue]}],shrink:[{shrink:["",Pe,de,ue]}],order:[{order:[uo,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[l,"screen",...O()]}],"min-w":[{"min-w":[l,"screen","none",...O()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,jc,Jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,de,Dg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mg,ue]}],"font-family":[{font:[Bz,ue,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,de,ue]}],"line-clamp":[{"line-clamp":[Pe,"none",de,Dg]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",de,Jo]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Pe,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uo,de,ue],radial:["",de,ue],conic:[uo,de,ue]},Hz,$z]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,de,ue]}],"outline-w":[{outline:["",Pe,jc,Jo]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",m,wf,mf]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",f,wf,mf]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Pe,Jo]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",w,wf,mf]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Pe,de,ue]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:Z()}],brightness:[{brightness:[Pe,de,ue]}],contrast:[{contrast:[Pe,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",p,wf,mf]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Pe,de,ue]}],"hue-rotate":[{"hue-rotate":[Pe,de,ue]}],invert:[{invert:["",Pe,de,ue]}],saturate:[{saturate:[Pe,de,ue]}],sepia:[{sepia:["",Pe,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":Z()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",Pe,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",de,ue]}],ease:[{ease:["linear","initial",h,de,ue]}],delay:[{delay:[Pe,de,ue]}],animate:[{animate:["none",g,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,de,ue]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ue]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Pe,jc,Jo,Dg]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Gz=(e,{cacheSize:t,prefix:n,experimentalParseClassName:a,extend:r={},override:s={}})=>(Nc(e,"cacheSize",t),Nc(e,"prefix",n),Nc(e,"experimentalParseClassName",a),pf(e.theme,s.theme),pf(e.classGroups,s.classGroups),pf(e.conflictingClassGroups,s.conflictingClassGroups),pf(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Nc(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),hf(e.theme,r.theme),hf(e.classGroups,r.classGroups),hf(e.conflictingClassGroups,r.conflictingClassGroups),hf(e.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),XN(e,r,"orderSensitiveModifiers"),e),Nc=(e,t,n)=>{n!==void 0&&(e[t]=n)},pf=(e,t)=>{if(t)for(const n in t)Nc(e,n,t[n])},hf=(e,t)=>{if(t)for(const n in t)XN(e,t,n)},XN=(e,t,n)=>{const a=t[n];a!==void 0&&(e[n]=e[n]?e[n].concat(a):a)},Yz=((e,...t)=>typeof e=="function"?LN(qN,e,...t):LN(()=>Gz(qN(),e),...t))({prefix:"tw"});function E(...e){return Yz(Tg(e))}const gf=hi("tw:inline-flex tw:items-center tw:justify-center tw:gap-0.5 tw:whitespace-nowrap tw:rounded-md tw:text-sm tw:font-medium tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow tw:hover:bg-primary/90",destructive:"tw:bg-destructive tw:text-destructive-foreground tw:shadow-sm tw:hover:bg-destructive/90",outline:"tw:border tw:border-gray-300 tw:bg-white tw:text-gray-700 tw:shadow-sm tw:hover:bg-gray-50 tw:hover:text-gray-900",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-sm tw:hover:bg-secondary/80",ghost:"tw:hover:bg-accent tw:hover:text-accent-foreground",link:"tw:text-primary tw:underline-offset-4 tw:hover:underline"},size:{default:"tw:h-9 tw:px-4 tw:py-2",sm:"tw:h-8 tw:rounded-md tw:px-3 tw:text-xs",lg:"tw:h-10 tw:rounded-md tw:px-8",icon:"tw:h-9 tw:w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ne=u.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...r},s)=>{const i=a?Qo:"button";return o.jsx(i,{className:E(gf({variant:t,size:n,className:e})),ref:s,...r})});Ne.displayName="Button";const pt=u.forwardRef(({className:e,type:t,...n},a)=>o.jsx("input",{type:t,className:E("tw:flex tw:h-9 tw:w-full tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-1 tw:text-base tw:shadow-sm tw:transition-colors tw:file:border-0 tw:file:bg-transparent tw:file:text-sm tw:file:font-medium tw:file:text-foreground tw:placeholder:text-muted-foreground tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:md:text-sm tw:aria-[invalid=true]:border-destructive tw:aria-[invalid=true]:ring-destructive",e),ref:a,...n}));pt.displayName="Input";function Cc(e,[t,n]){return Math.min(n,Math.max(t,e))}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Kz(e,t){const n=u.createContext(t),a=s=>{const{children:i,...l}=s,c=u.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function r(s){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,r]}function Ht(e,t=[]){let n=[];function a(s,i){const l=u.createContext(i),c=n.length;n=[...n,i];const d=f=>{var h;const{scope:w,children:p,...x}=f,b=((h=w==null?void 0:w[e])==null?void 0:h[c])||l,y=u.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:y,children:p})};d.displayName=s+"Provider";function m(f,w){var b;const p=((b=w==null?void 0:w[e])==null?void 0:b[c])||l,x=u.useContext(p);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,m]}const r=()=>{const s=n.map(i=>u.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return u.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[a,qz(r,...t)]}function qz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=a.reduce((l,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...l,...f}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function WN(e){const t=Xz(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(Zz);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Xz(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=Jz(r),l=Qz(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wz=Symbol("radix.slottable");function Zz(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wz}function Qz(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Jz(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xf(e){const t=e+"CollectionProvider",[n,a]=Ht(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:h}=b,g=J.useRef(null),v=J.useRef(new Map).current;return o.jsx(r,{scope:y,itemMap:v,collectionRef:g,children:h})};i.displayName=t;const l=e+"CollectionSlot",c=WN(l),d=J.forwardRef((b,y)=>{const{scope:h,children:g}=b,v=s(l,h),S=Se(y,v.collectionRef);return o.jsx(c,{ref:S,children:g})});d.displayName=l;const m=e+"CollectionItemSlot",f="data-radix-collection-item",w=WN(m),p=J.forwardRef((b,y)=>{const{scope:h,children:g,...v}=b,S=J.useRef(null),N=Se(y,S),A=s(m,h);return J.useEffect(()=>(A.itemMap.set(S,{ref:S,...v}),()=>void A.itemMap.delete(S))),o.jsx(w,{[f]:"",ref:N,children:g})});p.displayName=m;function x(b){const y=s(e+"CollectionConsumer",b);return J.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((A,j)=>v.indexOf(A.ref.current)-v.indexOf(j.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:p},x,a]}var e6=u.createContext(void 0);function es(e){const t=u.useContext(e6);return e||t||"ltr"}function t6(e){const t=n6(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(r6);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function n6(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=s6(r),l=o6(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var a6=Symbol("radix.slottable");function r6(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===a6}function o6(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function s6(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],me=i6.reduce((e,t)=>{const n=t6(`Primitive.${t}`),a=u.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function ZN(e,t){e&&Eo.flushSync(()=>e.dispatchEvent(t))}function Ft(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function l6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e);u.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var c6="DismissableLayer",Og="dismissableLayer.update",u6="dismissableLayer.pointerDownOutside",d6="dismissableLayer.focusOutside",QN,JN=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vi=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,d=u.useContext(JN),[m,f]=u.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=u.useState({}),x=Se(t,j=>f(j)),b=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),h=b.indexOf(y),g=m?b.indexOf(m):-1,v=d.layersWithOutsidePointerEventsDisabled.size>0,S=g>=h,N=w6(j=>{const C=j.target,R=[...d.branches].some(M=>M.contains(C));!S||R||(r==null||r(j),i==null||i(j),j.defaultPrevented||l==null||l())},w),A=p6(j=>{const C=j.target;[...d.branches].some(M=>M.contains(C))||(s==null||s(j),i==null||i(j),j.defaultPrevented||l==null||l())},w);return l6(j=>{g===d.layers.size-1&&(a==null||a(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},w),u.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(QN=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),e2(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=QN)}},[m,w,n,d]),u.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),e2())},[m,d]),u.useEffect(()=>{const j=()=>p({});return document.addEventListener(Og,j),()=>document.removeEventListener(Og,j)},[]),o.jsx(me.div,{...c,ref:x,style:{pointerEvents:v?S?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,N.onPointerDownCapture)})});vi.displayName=c6;var f6="DismissableLayerBranch",m6=u.forwardRef((e,t)=>{const n=u.useContext(JN),a=u.useRef(null),r=Se(t,a);return u.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),o.jsx(me.div,{...e,ref:r})});m6.displayName=f6;function w6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e),a=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const s=l=>{if(l.target&&!a.current){let c=function(){t2(u6,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function p6(e,t=globalThis==null?void 0:globalThis.document){const n=Ft(e),a=u.useRef(!1);return u.useEffect(()=>{const r=s=>{s.target&&!a.current&&t2(d6,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function e2(){const e=new CustomEvent(Og);document.dispatchEvent(e)}function t2(e,t,n,{discrete:a}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?ZN(r,s):r.dispatchEvent(s)}var Pg=0;function bf(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n2()),document.body.insertAdjacentElement("beforeend",e[1]??n2()),Pg++,()=>{Pg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pg--}},[])}function n2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zg="focusScope.autoFocusOnMount",Lg="focusScope.autoFocusOnUnmount",a2={bubbles:!1,cancelable:!0},h6="FocusScope",Ac=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[l,c]=u.useState(null),d=Ft(r),m=Ft(s),f=u.useRef(null),w=Se(t,b=>c(b)),p=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let b=function(v){if(p.paused||!l)return;const S=v.target;l.contains(S)?f.current=S:fo(f.current,{select:!0})},y=function(v){if(p.paused||!l)return;const S=v.relatedTarget;S!==null&&(l.contains(S)||fo(f.current,{select:!0}))},h=function(v){if(document.activeElement===document.body)for(const N of v)N.removedNodes.length>0&&fo(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const g=new MutationObserver(h);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),g.disconnect()}}},[a,l,p.paused]),u.useEffect(()=>{if(l){s2.add(p);const b=document.activeElement;if(!l.contains(b)){const h=new CustomEvent(zg,a2);l.addEventListener(zg,d),l.dispatchEvent(h),h.defaultPrevented||(g6(S6(r2(l)),{select:!0}),document.activeElement===b&&fo(l))}return()=>{l.removeEventListener(zg,d),setTimeout(()=>{const h=new CustomEvent(Lg,a2);l.addEventListener(Lg,m),l.dispatchEvent(h),h.defaultPrevented||fo(b??document.body,{select:!0}),l.removeEventListener(Lg,m),s2.remove(p)},0)}}},[l,d,m,p]);const x=u.useCallback(b=>{if(!n&&!a||p.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,h=document.activeElement;if(y&&h){const g=b.currentTarget,[v,S]=x6(g);v&&S?!b.shiftKey&&h===S?(b.preventDefault(),n&&fo(v,{select:!0})):b.shiftKey&&h===v&&(b.preventDefault(),n&&fo(S,{select:!0})):h===g&&b.preventDefault()}},[n,a,p.paused]);return o.jsx(me.div,{tabIndex:-1,...i,ref:w,onKeyDown:x})});Ac.displayName=h6;function g6(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fo(a,{select:t}),document.activeElement!==n)return}function x6(e){const t=r2(e),n=o2(t,e),a=o2(t.reverse(),e);return[n,a]}function r2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o2(e,t){for(const n of e)if(!b6(n,{upTo:t}))return n}function b6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function v6(e){return e instanceof HTMLInputElement&&"select"in e}function fo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&v6(e)&&t&&e.select()}}var s2=y6();function y6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=i2(e,t),e.unshift(t)},remove(t){var n;e=i2(e,t),(n=e[0])==null||n.resume()}}}function i2(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function S6(e){return e.filter(t=>t.tagName!=="A")}var jt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},j6=Au[" useId ".trim().toString()]||(()=>{}),N6=0;function Un(e){const[t,n]=u.useState(j6());return jt(()=>{n(a=>a??String(N6++))},[e]),t?`radix-${t}`:""}const C6=["top","right","bottom","left"],mo=Math.min,Hn=Math.max,vf=Math.round,yf=Math.floor,$a=e=>({x:e,y:e}),A6={left:"right",right:"left",bottom:"top",top:"bottom"},_6={start:"end",end:"start"};function Ig(e,t,n){return Hn(e,mo(t,n))}function jr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function yi(e){return e.split("-")[1]}function $g(e){return e==="x"?"y":"x"}function Bg(e){return e==="y"?"height":"width"}const E6=new Set(["top","bottom"]);function Ba(e){return E6.has(Nr(e))?"y":"x"}function Ug(e){return $g(Ba(e))}function T6(e,t,n){n===void 0&&(n=!1);const a=yi(e),r=Ug(e),s=Bg(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sf(i)),[i,Sf(i)]}function R6(e){const t=Sf(e);return[Hg(e),t,Hg(t)]}function Hg(e){return e.replace(/start|end/g,t=>_6[t])}const l2=["left","right"],c2=["right","left"],k6=["top","bottom"],M6=["bottom","top"];function D6(e,t,n){switch(e){case"top":case"bottom":return n?t?c2:l2:t?l2:c2;case"left":case"right":return t?k6:M6;default:return[]}}function O6(e,t,n,a){const r=yi(e);let s=D6(Nr(e),n==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Hg)))),s}function Sf(e){return e.replace(/left|right|bottom|top/g,t=>A6[t])}function P6(e){return{top:0,right:0,bottom:0,left:0,...e}}function u2(e){return typeof e!="number"?P6(e):{top:e,right:e,bottom:e,left:e}}function jf(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function d2(e,t,n){let{reference:a,floating:r}=e;const s=Ba(t),i=Ug(t),l=Bg(i),c=Nr(t),d=s==="y",m=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,w=a[l]/2-r[l]/2;let p;switch(c){case"top":p={x:m,y:a.y-r.height};break;case"bottom":p={x:m,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:f};break;case"left":p={x:a.x-r.width,y:f};break;default:p={x:a.x,y:a.y}}switch(yi(t)){case"start":p[i]-=w*(n&&d?-1:1);break;case"end":p[i]+=w*(n&&d?-1:1);break}return p}async function z6(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:w=!1,padding:p=0}=jr(t,e),x=u2(p),y=l[w?f==="floating"?"reference":"floating":f],h=jf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:m,strategy:c})),g=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},N=jf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:v,strategy:c}):g);return{top:(h.top-N.top+x.top)/S.y,bottom:(N.bottom-h.bottom+x.bottom)/S.y,left:(h.left-N.left+x.left)/S.x,right:(N.right-h.right+x.right)/S.x}}const L6=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:f}=d2(d,a,c),w=a,p={},x=0;for(let y=0;y<l.length;y++){var b;const{name:h,fn:g}=l[y],{x:v,y:S,data:N,reset:A}=await g({x:m,y:f,initialPlacement:a,placement:w,strategy:r,middlewareData:p,rects:d,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:z6},elements:{reference:e,floating:t}});m=v??m,f=S??f,p={...p,[h]:{...p[h],...N}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(w=A.placement),A.rects&&(d=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:m,y:f}=d2(d,w,c)),y=-1)}return{x:m,y:f,placement:w,strategy:r,middlewareData:p}},I6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:m=0}=jr(e,t)||{};if(d==null)return{};const f=u2(m),w={x:n,y:a},p=Ug(r),x=Bg(p),b=await i.getDimensions(d),y=p==="y",h=y?"top":"left",g=y?"bottom":"right",v=y?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[p]-w[p]-s.floating[x],N=w[p]-s.reference[p],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let j=A?A[v]:0;(!j||!await(i.isElement==null?void 0:i.isElement(A)))&&(j=l.floating[v]||s.floating[x]);const C=S/2-N/2,R=j/2-b[x]/2-1,M=mo(f[h],R),z=mo(f[g],R),B=M,I=j-b[x]-z,V=j/2-b[x]/2+C,D=Ig(B,V,I),T=!c.arrow&&yi(r)!=null&&V!==D&&s.reference[x]/2-(V<B?M:z)-b[x]/2<0,O=T?V<B?V-B:V-I:0;return{[p]:w[p]+O,data:{[p]:D,centerOffset:V-D-O,...T&&{alignmentOffset:O}},reset:T}}}),$6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:w,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...y}=jr(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const h=Nr(r),g=Ba(l),v=Nr(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=w||(v||!b?[Sf(l)]:R6(l)),A=x!=="none";!w&&A&&N.push(...O6(l,b,x,S));const j=[l,...N],C=await c.detectOverflow(t,y),R=[];let M=((a=s.flip)==null?void 0:a.overflows)||[];if(m&&R.push(C[h]),f){const V=T6(r,i,S);R.push(C[V[0]],C[V[1]])}if(M=[...M,{placement:r,overflows:R}],!R.every(V=>V<=0)){var z,B;const V=(((z=s.flip)==null?void 0:z.index)||0)+1,D=j[V];if(D&&(!(f==="alignment"?g!==Ba(D):!1)||M.every(_=>Ba(_.placement)===g?_.overflows[0]>0:!0)))return{data:{index:V,overflows:M},reset:{placement:D}};let T=(B=M.filter(O=>O.overflows[0]<=0).sort((O,_)=>O.overflows[1]-_.overflows[1])[0])==null?void 0:B.placement;if(!T)switch(p){case"bestFit":{var I;const O=(I=M.filter(_=>{if(A){const $=Ba(_.placement);return $===g||$==="y"}return!0}).map(_=>[_.placement,_.overflows.filter($=>$>0).reduce(($,H)=>$+H,0)]).sort((_,$)=>_[1]-$[1])[0])==null?void 0:I[0];O&&(T=O);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function f2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function m2(e){return C6.some(t=>e[t]>=0)}const B6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:r="referenceHidden",...s}=jr(e,t);switch(r){case"referenceHidden":{const i=await a.detectOverflow(t,{...s,elementContext:"reference"}),l=f2(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:m2(l)}}}case"escaped":{const i=await a.detectOverflow(t,{...s,altBoundary:!0}),l=f2(i,n.floating);return{data:{escapedOffsets:l,escaped:m2(l)}}}default:return{}}}}},w2=new Set(["left","top"]);async function U6(e,t){const{placement:n,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Nr(n),l=yi(n),c=Ba(n)==="y",d=w2.has(i)?-1:1,m=s&&c?-1:1,f=jr(t,e);let{mainAxis:w,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*m,y:w*d}:{x:w*d,y:p*m}}const H6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await U6(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},F6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:h=>{let{x:g,y:v}=h;return{x:g,y:v}}},...d}=jr(e,t),m={x:n,y:a},f=await s.detectOverflow(t,d),w=Ba(Nr(r)),p=$g(w);let x=m[p],b=m[w];if(i){const h=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=x+f[h],S=x-f[g];x=Ig(v,x,S)}if(l){const h=w==="y"?"top":"left",g=w==="y"?"bottom":"right",v=b+f[h],S=b-f[g];b=Ig(v,b,S)}const y=c.fn({...t,[p]:x,[w]:b});return{...y,data:{x:y.x-n,y:y.y-a,enabled:{[p]:i,[w]:l}}}}}},V6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=jr(e,t),m={x:n,y:a},f=Ba(r),w=$g(f);let p=m[w],x=m[f];const b=jr(l,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const v=w==="y"?"height":"width",S=s.reference[w]-s.floating[v]+y.mainAxis,N=s.reference[w]+s.reference[v]-y.mainAxis;p<S?p=S:p>N&&(p=N)}if(d){var h,g;const v=w==="y"?"width":"height",S=w2.has(Nr(r)),N=s.reference[f]-s.floating[v]+(S&&((h=i.offset)==null?void 0:h[f])||0)+(S?0:y.crossAxis),A=s.reference[f]+s.reference[v]+(S?0:((g=i.offset)==null?void 0:g[f])||0)-(S?y.crossAxis:0);x<N?x=N:x>A&&(x=A)}return{[w]:p,[f]:x}}}},G6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=jr(e,t),m=await i.detectOverflow(t,d),f=Nr(r),w=yi(r),p=Ba(r)==="y",{width:x,height:b}=s.floating;let y,h;f==="top"||f==="bottom"?(y=f,h=w===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(h=f,y=w==="end"?"top":"bottom");const g=b-m.top-m.bottom,v=x-m.left-m.right,S=mo(b-m[y],g),N=mo(x-m[h],v),A=!t.middlewareData.shift;let j=S,C=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=v),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(j=g),A&&!w){const M=Hn(m.left,0),z=Hn(m.right,0),B=Hn(m.top,0),I=Hn(m.bottom,0);p?C=x-2*(M!==0||z!==0?M+z:Hn(m.left,m.right)):j=b-2*(B!==0||I!==0?B+I:Hn(m.top,m.bottom))}await c({...t,availableWidth:C,availableHeight:j});const R=await i.getDimensions(l.floating);return x!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function Nf(){return typeof window<"u"}function Si(e){return p2(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ua(e){var t;return(t=(p2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function p2(e){return Nf()?e instanceof Node||e instanceof Fn(e).Node:!1}function va(e){return Nf()?e instanceof Element||e instanceof Fn(e).Element:!1}function Ha(e){return Nf()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function h2(e){return!Nf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}const Y6=new Set(["inline","contents"]);function _c(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!Y6.has(r)}const K6=new Set(["table","td","th"]);function q6(e){return K6.has(Si(e))}const X6=[":popover-open",":modal"];function Cf(e){return X6.some(t=>{try{return e.matches(t)}catch{return!1}})}const W6=["transform","translate","scale","rotate","perspective"],Z6=["transform","translate","scale","rotate","perspective","filter"],Q6=["paint","layout","strict","content"];function Fg(e){const t=Vg(),n=va(e)?ya(e):e;return W6.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Z6.some(a=>(n.willChange||"").includes(a))||Q6.some(a=>(n.contain||"").includes(a))}function J6(e){let t=wo(e);for(;Ha(t)&&!ji(t);){if(Fg(t))return t;if(Cf(t))return null;t=wo(t)}return null}function Vg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const e8=new Set(["html","body","#document"]);function ji(e){return e8.has(Si(e))}function ya(e){return Fn(e).getComputedStyle(e)}function Af(e){return va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wo(e){if(Si(e)==="html")return e;const t=e.assignedSlot||e.parentNode||h2(e)&&e.host||Ua(e);return h2(t)?t.host:t}function g2(e){const t=wo(e);return ji(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ha(t)&&_c(t)?t:g2(t)}function Ec(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=g2(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=Fn(r);if(s){const l=Gg(i);return t.concat(i,i.visualViewport||[],_c(r)?r:[],l&&n?Ec(l):[])}return t.concat(r,Ec(r,[],n))}function Gg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function x2(e){const t=ya(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Ha(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:a,l=vf(n)!==s||vf(a)!==i;return l&&(n=s,a=i),{width:n,height:a,$:l}}function Yg(e){return va(e)?e:e.contextElement}function Ni(e){const t=Yg(e);if(!Ha(t))return $a(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:s}=x2(t);let i=(s?vf(n.width):n.width)/a,l=(s?vf(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const t8=$a(0);function b2(e){const t=Fn(e);return!Vg()||!t.visualViewport?t8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function n8(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function ts(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Yg(e);let i=$a(1);t&&(a?va(a)&&(i=Ni(a)):i=Ni(e));const l=n8(s,n,a)?b2(s):$a(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,m=r.width/i.x,f=r.height/i.y;if(s){const w=Fn(s),p=a&&va(a)?Fn(a):a;let x=w,b=Gg(x);for(;b&&a&&p!==x;){const y=Ni(b),h=b.getBoundingClientRect(),g=ya(b),v=h.left+(b.clientLeft+parseFloat(g.paddingLeft))*y.x,S=h.top+(b.clientTop+parseFloat(g.paddingTop))*y.y;c*=y.x,d*=y.y,m*=y.x,f*=y.y,c+=v,d+=S,x=Fn(b),b=Gg(x)}}return jf({width:m,height:f,x:c,y:d})}function _f(e,t){const n=Af(e).scrollLeft;return t?t.left+n:ts(Ua(e)).left+n}function v2(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-_f(e,n),r=n.top+t.scrollTop;return{x:a,y:r}}function a8(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=Ua(a),l=t?Cf(t.floating):!1;if(a===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=$a(1);const m=$a(0),f=Ha(a);if((f||!f&&!s)&&((Si(a)!=="body"||_c(i))&&(c=Af(a)),Ha(a))){const p=ts(a);d=Ni(a),m.x=p.x+a.clientLeft,m.y=p.y+a.clientTop}const w=i&&!f&&!s?v2(i,c):$a(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+m.x+w.x,y:n.y*d.y-c.scrollTop*d.y+m.y+w.y}}function r8(e){return Array.from(e.getClientRects())}function o8(e){const t=Ua(e),n=Af(e),a=e.ownerDocument.body,r=Hn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=Hn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+_f(e);const l=-n.scrollTop;return ya(a).direction==="rtl"&&(i+=Hn(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const y2=25;function s8(e,t){const n=Fn(e),a=Ua(e),r=n.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const m=Vg();(!m||m&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=_f(a);if(d<=0){const m=a.ownerDocument,f=m.body,w=getComputedStyle(f),p=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(a.clientWidth-f.clientWidth-p);x<=y2&&(s-=x)}else d<=y2&&(s+=d);return{width:s,height:i,x:l,y:c}}const i8=new Set(["absolute","fixed"]);function l8(e,t){const n=ts(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ha(e)?Ni(e):$a(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function S2(e,t,n){let a;if(t==="viewport")a=s8(e,n);else if(t==="document")a=o8(Ua(e));else if(va(t))a=l8(t,n);else{const r=b2(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return jf(a)}function j2(e,t){const n=wo(e);return n===t||!va(n)||ji(n)?!1:ya(n).position==="fixed"||j2(n,t)}function c8(e,t){const n=t.get(e);if(n)return n;let a=Ec(e,[],!1).filter(l=>va(l)&&Si(l)!=="body"),r=null;const s=ya(e).position==="fixed";let i=s?wo(e):e;for(;va(i)&&!ji(i);){const l=ya(i),c=Fg(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&i8.has(r.position)||_c(i)&&!c&&j2(e,i))?a=a.filter(m=>m!==i):r=l,i=wo(i)}return t.set(e,a),a}function u8(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?Cf(t)?[]:c8(t,this._c):[].concat(n),a],l=i[0],c=i.reduce((d,m)=>{const f=S2(t,m,r);return d.top=Hn(f.top,d.top),d.right=mo(f.right,d.right),d.bottom=mo(f.bottom,d.bottom),d.left=Hn(f.left,d.left),d},S2(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function d8(e){const{width:t,height:n}=x2(e);return{width:t,height:n}}function f8(e,t,n){const a=Ha(t),r=Ua(t),s=n==="fixed",i=ts(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=$a(0);function d(){c.x=_f(r)}if(a||!a&&!s)if((Si(t)!=="body"||_c(r))&&(l=Af(t)),a){const p=ts(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else r&&d();s&&!a&&r&&d();const m=r&&!a&&!s?v2(r,l):$a(0),f=i.left+l.scrollLeft-c.x-m.x,w=i.top+l.scrollTop-c.y-m.y;return{x:f,y:w,width:i.width,height:i.height}}function Kg(e){return ya(e).position==="static"}function N2(e,t){if(!Ha(e)||ya(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ua(e)===n&&(n=n.ownerDocument.body),n}function C2(e,t){const n=Fn(e);if(Cf(e))return n;if(!Ha(e)){let r=wo(e);for(;r&&!ji(r);){if(va(r)&&!Kg(r))return r;r=wo(r)}return n}let a=N2(e,t);for(;a&&q6(a)&&Kg(a);)a=N2(a,t);return a&&ji(a)&&Kg(a)&&!Fg(a)?n:a||J6(e)||n}const m8=async function(e){const t=this.getOffsetParent||C2,n=this.getDimensions,a=await n(e.floating);return{reference:f8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function w8(e){return ya(e).direction==="rtl"}const p8={convertOffsetParentRelativeRectToViewportRelativeRect:a8,getDocumentElement:Ua,getClippingRect:u8,getOffsetParent:C2,getElementRects:m8,getClientRects:r8,getDimensions:d8,getScale:Ni,isElement:va,isRTL:w8};function A2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function h8(e,t){let n=null,a;const r=Ua(e);function s(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:m,top:f,width:w,height:p}=d;if(l||t(),!w||!p)return;const x=yf(f),b=yf(r.clientWidth-(m+w)),y=yf(r.clientHeight-(f+p)),h=yf(m),v={rootMargin:-x+"px "+-b+"px "+-y+"px "+-h+"px",threshold:Hn(0,mo(1,c))||1};let S=!0;function N(A){const j=A[0].intersectionRatio;if(j!==c){if(!S)return i();j?i(!1,j):a=setTimeout(()=>{i(!1,1e-7)},1e3)}j===1&&!A2(d,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(N,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,v)}n.observe(e)}return i(!0),s}function g8(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=Yg(e),m=r||s?[...d?Ec(d):[],...Ec(t)]:[];m.forEach(h=>{r&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const f=d&&l?h8(d,n):null;let w=-1,p=null;i&&(p=new ResizeObserver(h=>{let[g]=h;g&&g.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let x,b=c?ts(e):null;c&&y();function y(){const h=ts(e);b&&!A2(b,h)&&n(),b=h,x=requestAnimationFrame(y)}return n(),()=>{var h;m.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),f==null||f(),(h=p)==null||h.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const x8=H6,b8=F6,v8=$6,y8=G6,S8=B6,_2=I6,j8=V6,N8=(e,t,n)=>{const a=new Map,r={platform:p8,...n},s={...r.platform,_c:a};return L6(e,t,{...r,platform:s})};var C8=typeof document<"u",A8=function(){},Ef=C8?u.useLayoutEffect:A8;function Tf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Tf(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;a--!==0;){const s=r[a];if(!(s==="_owner"&&e.$$typeof)&&!Tf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function E2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function T2(e,t){const n=E2(e);return Math.round(t*n)/n}function qg(e){const t=u.useRef(e);return Ef(()=>{t.current=e}),t}function _8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[m,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,p]=u.useState(a);Tf(w,a)||p(a);const[x,b]=u.useState(null),[y,h]=u.useState(null),g=u.useCallback(_=>{_!==A.current&&(A.current=_,b(_))},[]),v=u.useCallback(_=>{_!==j.current&&(j.current=_,h(_))},[]),S=s||x,N=i||y,A=u.useRef(null),j=u.useRef(null),C=u.useRef(m),R=c!=null,M=qg(c),z=qg(r),B=qg(d),I=u.useCallback(()=>{if(!A.current||!j.current)return;const _={placement:t,strategy:n,middleware:w};z.current&&(_.platform=z.current),N8(A.current,j.current,_).then($=>{const H={...$,isPositioned:B.current!==!1};V.current&&!Tf(C.current,H)&&(C.current=H,Eo.flushSync(()=>{f(H)}))})},[w,t,n,z,B]);Ef(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[d]);const V=u.useRef(!1);Ef(()=>(V.current=!0,()=>{V.current=!1}),[]),Ef(()=>{if(S&&(A.current=S),N&&(j.current=N),S&&N){if(M.current)return M.current(S,N,I);I()}},[S,N,I,M,R]);const D=u.useMemo(()=>({reference:A,floating:j,setReference:g,setFloating:v}),[g,v]),T=u.useMemo(()=>({reference:S,floating:N}),[S,N]),O=u.useMemo(()=>{const _={position:n,left:0,top:0};if(!T.floating)return _;const $=T2(T.floating,m.x),H=T2(T.floating,m.y);return l?{..._,transform:"translate("+$+"px, "+H+"px)",...E2(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:H}},[n,l,T.floating,m.x,m.y]);return u.useMemo(()=>({...m,update:I,refs:D,elements:T,floatingStyles:O}),[m,I,D,T,O])}const E8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:r}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?_2({element:a.current,padding:r}).fn(n):{}:a?_2({element:a,padding:r}).fn(n):{}}}},T8=(e,t)=>({...x8(e),options:[e,t]}),R8=(e,t)=>({...b8(e),options:[e,t]}),k8=(e,t)=>({...j8(e),options:[e,t]}),M8=(e,t)=>({...v8(e),options:[e,t]}),D8=(e,t)=>({...y8(e),options:[e,t]}),O8=(e,t)=>({...S8(e),options:[e,t]}),P8=(e,t)=>({...E8(e),options:[e,t]});var z8="Arrow",R2=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...s}=e;return o.jsx(me.svg,{...s,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});R2.displayName=z8;var L8=R2;function Tc(e){const[t,n]=u.useState(void 0);return jt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Xg="Popper",[k2,po]=Ht(Xg),[I8,M2]=k2(Xg),D2=e=>{const{__scopePopper:t,children:n}=e,[a,r]=u.useState(null);return o.jsx(I8,{scope:t,anchor:a,onAnchorChange:r,children:n})};D2.displayName=Xg;var O2="PopperAnchor",P2=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,s=M2(O2,n),i=u.useRef(null),l=Se(t,i),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=(a==null?void 0:a.current)||i.current,d!==c.current&&s.onAnchorChange(c.current)}),a?null:o.jsx(me.div,{...r,ref:l})});P2.displayName=O2;var Wg="PopperContent",[$8,B8]=k2(Wg),z2=u.forwardRef((e,t)=>{var Y,Z,le,he,ae,K;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:w=!1,updatePositionStrategy:p="optimized",onPlaced:x,...b}=e,y=M2(Wg,n),[h,g]=u.useState(null),v=Se(t,ge=>g(ge)),[S,N]=u.useState(null),A=Tc(S),j=(A==null?void 0:A.width)??0,C=(A==null?void 0:A.height)??0,R=a+(s!=="center"?"-"+s:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},z=Array.isArray(d)?d:[d],B=z.length>0,I={padding:M,boundary:z.filter(H8),altBoundary:B},{refs:V,floatingStyles:D,placement:T,isPositioned:O,middlewareData:_}=_8({strategy:"fixed",placement:R,whileElementsMounted:(...ge)=>g8(...ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[T8({mainAxis:r+C,alignmentAxis:i}),c&&R8({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?k8():void 0,...I}),c&&M8({...I}),D8({...I,apply:({elements:ge,rects:Ce,availableWidth:We,availableHeight:Ke})=>{const{width:at,height:Kt}=Ce.reference,He=ge.floating.style;He.setProperty("--radix-popper-available-width",`${We}px`),He.setProperty("--radix-popper-available-height",`${Ke}px`),He.setProperty("--radix-popper-anchor-width",`${at}px`),He.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),S&&P8({element:S,padding:l}),F8({arrowWidth:j,arrowHeight:C}),w&&O8({strategy:"referenceHidden",...I})]}),[$,H]=$2(T),F=Ft(x);jt(()=>{O&&(F==null||F())},[O,F]);const Q=(Y=_.arrow)==null?void 0:Y.x,X=(Z=_.arrow)==null?void 0:Z.y,P=((le=_.arrow)==null?void 0:le.centerOffset)!==0,[G,ne]=u.useState();return jt(()=>{h&&ne(window.getComputedStyle(h).zIndex)},[h]),o.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:O?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(he=_.transformOrigin)==null?void 0:he.x,(ae=_.transformOrigin)==null?void 0:ae.y].join(" "),...((K=_.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx($8,{scope:n,placedSide:$,onArrowChange:N,arrowX:Q,arrowY:X,shouldHideArrow:P,children:o.jsx(me.div,{"data-side":$,"data-align":H,...b,ref:v,style:{...b.style,animation:O?void 0:"none"}})})})});z2.displayName=Wg;var L2="PopperArrow",U8={top:"bottom",right:"left",bottom:"top",left:"right"},I2=u.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,s=B8(L2,a),i=U8[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(L8,{...r,ref:n,style:{...r.style,display:"block"}})})});I2.displayName=L2;function H8(e){return e!==null}var F8=e=>({name:"transformOrigin",options:e,fn(t){var y,h,g;const{placement:n,rects:a,middlewareData:r}=t,i=((y=r.arrow)==null?void 0:y.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,m]=$2(n),f={start:"0%",center:"50%",end:"100%"}[m],w=(((h=r.arrow)==null?void 0:h.x)??0)+l/2,p=(((g=r.arrow)==null?void 0:g.y)??0)+c/2;let x="",b="";return d==="bottom"?(x=i?f:`${w}px`,b=`${-c}px`):d==="top"?(x=i?f:`${w}px`,b=`${a.floating.height+c}px`):d==="right"?(x=`${-c}px`,b=i?f:`${p}px`):d==="left"&&(x=`${a.floating.width+c}px`,b=i?f:`${p}px`),{data:{x,y:b}}}});function $2(e){const[t,n="center"]=e.split("-");return[t,n]}var Rf=D2,Rc=P2,kf=z2,Mf=I2,V8="Portal",Ci=u.forwardRef((e,t)=>{var l;const{container:n,...a}=e,[r,s]=u.useState(!1);jt(()=>s(!0),[]);const i=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?Yv.createPortal(o.jsx(me.div,{...a,ref:t}),i):null});Ci.displayName=V8;function G8(e){const t=Y8(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(q8);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Y8(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=W8(r),l=X8(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K8=Symbol("radix.slottable");function q8(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K8}function X8(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function W8(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Z8=Au[" useInsertionEffect ".trim().toString()]||jt;function Vn({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,s,i]=Q8({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r;{const m=u.useRef(e!==void 0);u.useEffect(()=>{const f=m.current;f!==l&&console.warn(`${a} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,a])}const d=u.useCallback(m=>{var f;if(l){const w=J8(m)?m(e):m;w!==e&&((f=i.current)==null||f.call(i,w))}else s(m)},[l,e,s,i]);return[c,d]}function Q8({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),r=u.useRef(n),s=u.useRef(t);return Z8(()=>{s.current=t},[t]),u.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,a,s]}function J8(e){return typeof e=="function"}function kc(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var B2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eL="VisuallyHidden",U2=u.forwardRef((e,t)=>o.jsx(me.span,{...e,ref:t,style:{...B2,...e.style}}));U2.displayName=eL;var tL=U2,nL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ai=new WeakMap,Df=new WeakMap,Of={},Zg=0,H2=function(e){return e&&(e.host||H2(e.parentNode))},aL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=H2(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},rL=function(e,t,n,a){var r=aL(t,Array.isArray(e)?e:[e]);Of[n]||(Of[n]=new WeakMap);var s=Of[n],i=[],l=new Set,c=new Set(r),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};r.forEach(d);var m=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(w){if(l.has(w))m(w);else try{var p=w.getAttribute(a),x=p!==null&&p!=="false",b=(Ai.get(w)||0)+1,y=(s.get(w)||0)+1;Ai.set(w,b),s.set(w,y),i.push(w),b===1&&x&&Df.set(w,!0),y===1&&w.setAttribute(n,"true"),x||w.setAttribute(a,"true")}catch(h){console.error("aria-hidden: cannot operate on ",w,h)}})};return m(t),l.clear(),Zg++,function(){i.forEach(function(f){var w=Ai.get(f)-1,p=s.get(f)-1;Ai.set(f,w),s.set(f,p),w||(Df.has(f)||f.removeAttribute(a),Df.delete(f)),p||f.removeAttribute(n)}),Zg--,Zg||(Ai=new WeakMap,Ai=new WeakMap,Df=new WeakMap,Of={})}},Pf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=nL(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),rL(a,r,n,"aria-hidden")):function(){return null}},Fa=function(){return Fa=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Fa.apply(this,arguments)};function F2(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function oL(e,t,n){if(n||arguments.length===2)for(var a=0,r=t.length,s;a<r;a++)(s||!(a in t))&&(s||(s=Array.prototype.slice.call(t,0,a)),s[a]=t[a]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var zf="right-scroll-bar-position",Lf="width-before-scroll-bar",sL="with-scroll-bars-hidden",iL="--removed-body-scroll-bar-size";function Qg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lL(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=t,n.facade}var cL=typeof window<"u"?u.useLayoutEffect:u.useEffect,V2=new WeakMap;function uL(e,t){var n=lL(null,function(a){return e.forEach(function(r){return Qg(r,a)})});return cL(function(){var a=V2.get(n);if(a){var r=new Set(a),s=new Set(e),i=n.current;r.forEach(function(l){s.has(l)||Qg(l,null)}),s.forEach(function(l){r.has(l)||Qg(l,i)})}V2.set(n,e)},[e]),n}function dL(e){return e}function fL(e,t){t===void 0&&(t=dL);var n=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,a);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(a=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){a=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var c=function(){var m=i;i=[],m.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(m){i.push(m),d()},filter:function(m){return i=i.filter(m),n}}}};return r}function mL(e){e===void 0&&(e={});var t=fL(null);return t.options=Fa({async:!0,ssr:!1},e),t}var G2=function(e){var t=e.sideCar,n=F2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return u.createElement(a,Fa({},n))};G2.isSideCarExport=!0;function wL(e,t){return e.useMedium(t),G2}var Y2=mL(),Jg=function(){},If=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:Jg,onWheelCapture:Jg,onTouchMoveCapture:Jg}),r=a[0],s=a[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,m=e.enabled,f=e.shards,w=e.sideCar,p=e.noRelative,x=e.noIsolation,b=e.inert,y=e.allowPinchZoom,h=e.as,g=h===void 0?"div":h,v=e.gapMode,S=F2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=w,A=uL([n,t]),j=Fa(Fa({},S),r);return u.createElement(u.Fragment,null,m&&u.createElement(N,{sideCar:Y2,removeScrollBar:d,shards:f,noRelative:p,noIsolation:x,inert:b,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:v}),i?u.cloneElement(u.Children.only(l),Fa(Fa({},j),{ref:A})):u.createElement(g,Fa({},j,{className:c,ref:A}),l))});If.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},If.classNames={fullWidth:Lf,zeroRight:zf};var pL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pL();return t&&e.setAttribute("nonce",t),e}function gL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hL())&&(gL(t,n),xL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vL=function(){var e=bL();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},K2=function(){var e=vL(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},yL={left:0,top:0,right:0,gap:0},ex=function(e){return parseInt(e||"",10)||0},SL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[ex(n),ex(a),ex(r)]},jL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yL;var t=SL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},NL=K2(),_i="data-scroll-locked",CL=function(e,t,n,a){var r=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),` 417 .`.concat(sL,` { 418 418 overflow: hidden `).concat(a,`; 419 419 padding-right: `).concat(l,"px ").concat(a,`; … … 449 449 450 450 body[`).concat(_i,`] { 451 `).concat( sL,": ").concat(l,`px;452 } 453 `)},q2=function(){var e=parseInt(document.body.getAttribute(_i)||"0",10);return isFinite(e)?e:0}, CL=function(){d.useEffect(function(){return document.body.setAttribute(_i,(q2()+1).toString()),function(){var e=q2()-1;e<=0?document.body.removeAttribute(_i):document.body.setAttribute(_i,e.toString())}},[])},AL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;CL();var s=d.useMemo(function(){return SL(r)},[r]);return d.createElement(jL,{styles:NL(s,!t,r,n?"":"!important")})},tx=!1;if(typeof window<"u")try{var $f=Object.defineProperty({},"passive",{get:function(){return tx=!0,!0}});window.addEventListener("test",$f,$f),window.removeEventListener("test",$f,$f)}catch{tx=!1}var Ei=tx?{passive:!1}:!1,_L=function(e){return e.tagName==="TEXTAREA"},X2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_L(e)&&n[t]==="visible")},EL=function(e){return X2(e,"overflowY")},TL=function(e){return X2(e,"overflowX")},W2=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=Z2(e,a);if(r){var s=Q2(e,a),i=s[1],l=s[2];if(i>l)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},RL=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},kL=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Z2=function(e,t){return e==="v"?EL(t):TL(t)},Q2=function(e,t){return e==="v"?RL(t):kL(t)},ML=function(e,t){return e==="h"&&t==="rtl"?-1:1},DL=function(e,t,n,a,r){var s=ML(e,window.getComputedStyle(t).direction),i=s*a,l=n.target,c=t.contains(l),u=!1,m=i>0,f=0,w=0;do{if(!l)break;var p=Q2(e,l),x=p[0],b=p[1],y=p[2],h=b-y-s*x;(x||h)&&Z2(e,l)&&(f+=h,w+=x);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(m&&Math.abs(f)<1||!m&&Math.abs(w)<1)&&(u=!0),u},Bf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J2=function(e){return[e.deltaX,e.deltaY]},eC=function(e){return e&&"current"in e?e.current:e},OL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PL=function(e){return`451 `).concat(iL,": ").concat(l,`px; 452 } 453 `)},q2=function(){var e=parseInt(document.body.getAttribute(_i)||"0",10);return isFinite(e)?e:0},AL=function(){u.useEffect(function(){return document.body.setAttribute(_i,(q2()+1).toString()),function(){var e=q2()-1;e<=0?document.body.removeAttribute(_i):document.body.setAttribute(_i,e.toString())}},[])},_L=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;AL();var s=u.useMemo(function(){return jL(r)},[r]);return u.createElement(NL,{styles:CL(s,!t,r,n?"":"!important")})},tx=!1;if(typeof window<"u")try{var $f=Object.defineProperty({},"passive",{get:function(){return tx=!0,!0}});window.addEventListener("test",$f,$f),window.removeEventListener("test",$f,$f)}catch{tx=!1}var Ei=tx?{passive:!1}:!1,EL=function(e){return e.tagName==="TEXTAREA"},X2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EL(e)&&n[t]==="visible")},TL=function(e){return X2(e,"overflowY")},RL=function(e){return X2(e,"overflowX")},W2=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=Z2(e,a);if(r){var s=Q2(e,a),i=s[1],l=s[2];if(i>l)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},kL=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},ML=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Z2=function(e,t){return e==="v"?TL(t):RL(t)},Q2=function(e,t){return e==="v"?kL(t):ML(t)},DL=function(e,t){return e==="h"&&t==="rtl"?-1:1},OL=function(e,t,n,a,r){var s=DL(e,window.getComputedStyle(t).direction),i=s*a,l=n.target,c=t.contains(l),d=!1,m=i>0,f=0,w=0;do{if(!l)break;var p=Q2(e,l),x=p[0],b=p[1],y=p[2],h=b-y-s*x;(x||h)&&Z2(e,l)&&(f+=h,w+=x);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(m&&Math.abs(f)<1||!m&&Math.abs(w)<1)&&(d=!0),d},Bf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J2=function(e){return[e.deltaX,e.deltaY]},eC=function(e){return e&&"current"in e?e.current:e},PL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zL=function(e){return` 454 454 .block-interactivity-`.concat(e,` {pointer-events: none;} 455 455 .allow-interactivity-`).concat(e,` {pointer-events: all;} 456 `)}, zL=0,Ti=[];function LL(e){var t=d.useRef([]),n=d.useRef([0,0]),a=d.useRef(),r=d.useState(zL++)[0],s=d.useState(K2)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=rL([e.lockRef.current],(e.shards||[]).map(eC),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var h=Bf(b),g=n.current,v="deltaX"in b?b.deltaX:g[0]-h[0],S="deltaY"in b?b.deltaY:g[1]-h[1],N,A=b.target,j=Math.abs(v)>Math.abs(S)?"h":"v";if("touches"in b&&j==="h"&&A.type==="range")return!1;var C=window.getSelection(),R=C&&C.anchorNode,M=R?R===A||R.contains(A):!1;if(M)return!1;var z=W2(j,A);if(!z)return!0;if(z?N=j:(N=j==="v"?"h":"v",z=W2(j,A)),!z)return!1;if(!a.current&&"changedTouches"in b&&(v||S)&&(a.current=N),!N)return!0;var B=a.current||N;return DL(B,y,b,B==="h"?v:S)},[]),c=d.useCallback(function(b){var y=b;if(!(!Ti.length||Ti[Ti.length-1]!==s)){var h="deltaY"in y?J2(y):Bf(y),g=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&OL(N.delta,h)})[0];if(g&&g.should){y.cancelable&&y.preventDefault();return}if(!g){var v=(i.current.shards||[]).map(eC).filter(Boolean).filter(function(N){return N.contains(y.target)}),S=v.length>0?l(y,v[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=d.useCallback(function(b,y,h,g){var v={name:b,delta:y,target:h,should:g,shadowParent:IL(h)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(S){return S!==v})},1)},[]),m=d.useCallback(function(b){n.current=Bf(b),a.current=void 0},[]),f=d.useCallback(function(b){u(b.type,J2(b),b.target,l(b,e.lockRef.current))},[]),w=d.useCallback(function(b){u(b.type,Bf(b),b.target,l(b,e.lockRef.current))},[]);d.useEffect(function(){return Ti.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:w}),document.addEventListener("wheel",c,Ei),document.addEventListener("touchmove",c,Ei),document.addEventListener("touchstart",m,Ei),function(){Ti=Ti.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Ei),document.removeEventListener("touchmove",c,Ei),document.removeEventListener("touchstart",m,Ei)}},[]);var p=e.removeScrollBar,x=e.inert;return d.createElement(d.Fragment,null,x?d.createElement(s,{styles:PL(r)}):null,p?d.createElement(AL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function IL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $L=mL(Y2,LL);var Mc=d.forwardRef(function(e,t){return d.createElement(If,Fa({},e,{ref:t,sideCar:$L}))});Mc.classNames=If.classNames;var BL=[" ","Enter","ArrowUp","ArrowDown"],UL=[" ","Enter"],ns="Select",[Uf,Hf,HL]=xf(ns),[Ri]=Ht(ns,[HL,po]),Ff=po(),[FL,ho]=Ri(ns),[VL,GL]=Ri(ns),tC=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:r,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:f,disabled:w,required:p,form:x}=e,b=Ff(t),[y,h]=d.useState(null),[g,v]=d.useState(null),[S,N]=d.useState(!1),A=es(u),[j,C]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:ns}),[R,M]=Vn({prop:i,defaultProp:l,onChange:c,caller:ns}),z=d.useRef(null),B=y?x||!!y.closest("form"):!0,[I,V]=d.useState(new Set),D=Array.from(I).map(T=>T.props.value).join(";");return o.jsx(Rf,{...b,children:o.jsxs(FL,{required:p,scope:t,trigger:y,onTriggerChange:h,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:Un(),value:R,onValueChange:M,open:j,onOpenChange:C,dir:A,triggerPointerDownPosRef:z,disabled:w,children:[o.jsx(Uf.Provider,{scope:t,children:o.jsx(VL,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(T=>{V(O=>new Set(O).add(T))},[]),onNativeOptionRemove:d.useCallback(T=>{V(O=>{const _=new Set(O);return _.delete(T),_})},[]),children:n})}),B?o.jsxs(AC,{"aria-hidden":!0,required:p,tabIndex:-1,name:m,autoComplete:f,value:R,onChange:T=>M(T.target.value),disabled:w,form:x,children:[R===void 0?o.jsx("option",{value:""}):null,Array.from(I)]},D):null]})})};tC.displayName=ns;var nC="SelectTrigger",aC=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,s=Ff(n),i=ho(nC,n),l=i.disabled||a,c=Se(t,i.onTriggerChange),u=Hf(n),m=d.useRef("touch"),[f,w,p]=EC(b=>{const y=u().filter(v=>!v.disabled),h=y.find(v=>v.value===i.value),g=TC(y,b,h);g!==void 0&&i.onValueChange(g.value)}),x=b=>{l||(i.onOpenChange(!0),p()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return o.jsx(Rc,{asChild:!0,...s,children:o.jsx(me.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":_C(i.value)?"":void 0,...r,ref:c,onClick:ee(r.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&x(b)}),onPointerDown:ee(r.onPointerDown,b=>{m.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(x(b),b.preventDefault())}),onKeyDown:ee(r.onKeyDown,b=>{const y=f.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&w(b.key),!(y&&b.key===" ")&&BL.includes(b.key)&&(x(),b.preventDefault())})})})});aC.displayName=nC;var rC="SelectValue",oC=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:s,placeholder:i="",...l}=e,c=ho(rC,n),{onValueNodeHasChildrenChange:u}=c,m=s!==void 0,f=Se(t,c.onValueNodeChange);return jt(()=>{u(m)},[u,m]),o.jsx(me.span,{...l,ref:f,style:{pointerEvents:"none"},children:_C(c.value)?o.jsx(o.Fragment,{children:i}):s})});oC.displayName=rC;var YL="SelectIcon",sC=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return o.jsx(me.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});sC.displayName=YL;var KL="SelectPortal",iC=e=>o.jsx(Ci,{asChild:!0,...e});iC.displayName=KL;var as="SelectContent",lC=d.forwardRef((e,t)=>{const n=ho(as,e.__scopeSelect),[a,r]=d.useState();if(jt(()=>{r(new DocumentFragment)},[]),!n.open){const s=a;return s?Eo.createPortal(o.jsx(cC,{scope:e.__scopeSelect,children:o.jsx(Uf.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),s):null}return o.jsx(uC,{...e,ref:t})});lC.displayName=as;var Sa=10,[cC,go]=Ri(as),qL="SelectContentImpl",XL=V8("SelectContent.RemoveScroll"),uC=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:f,collisionBoundary:w,collisionPadding:p,sticky:x,hideWhenDetached:b,avoidCollisions:y,...h}=e,g=ho(as,n),[v,S]=d.useState(null),[N,A]=d.useState(null),j=Se(t,Y=>S(Y)),[C,R]=d.useState(null),[M,z]=d.useState(null),B=Hf(n),[I,V]=d.useState(!1),D=d.useRef(!1);d.useEffect(()=>{if(v)return Pf(v)},[v]),bf();const T=d.useCallback(Y=>{const[Z,...le]=B().map(K=>K.ref.current),[he]=le.slice(-1),ae=document.activeElement;for(const K of Y)if(K===ae||(K==null||K.scrollIntoView({block:"nearest"}),K===Z&&N&&(N.scrollTop=0),K===he&&N&&(N.scrollTop=N.scrollHeight),K==null||K.focus(),document.activeElement!==ae))return},[B,N]),O=d.useCallback(()=>T([C,v]),[T,C,v]);d.useEffect(()=>{I&&O()},[I,O]);const{onOpenChange:_,triggerPointerDownPosRef:$}=g;d.useEffect(()=>{if(v){let Y={x:0,y:0};const Z=he=>{var ae,K;Y={x:Math.abs(Math.round(he.pageX)-(((ae=$.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(he.pageY)-(((K=$.current)==null?void 0:K.y)??0))}},le=he=>{Y.x<=10&&Y.y<=10?he.preventDefault():v.contains(he.target)||_(!1),document.removeEventListener("pointermove",Z),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",le,{capture:!0})}}},[v,_,$]),d.useEffect(()=>{const Y=()=>_(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[_]);const[H,F]=EC(Y=>{const Z=B().filter(ae=>!ae.disabled),le=Z.find(ae=>ae.ref.current===document.activeElement),he=TC(Z,Y,le);he&&setTimeout(()=>he.ref.current.focus())}),Q=d.useCallback((Y,Z,le)=>{const he=!D.current&&!le;(g.value!==void 0&&g.value===Z||he)&&(R(Y),he&&(D.current=!0))},[g.value]),X=d.useCallback(()=>v==null?void 0:v.focus(),[v]),P=d.useCallback((Y,Z,le)=>{const he=!D.current&&!le;(g.value!==void 0&&g.value===Z||he)&&z(Y)},[g.value]),G=a==="popper"?nx:dC,ne=G===nx?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:f,collisionBoundary:w,collisionPadding:p,sticky:x,hideWhenDetached:b,avoidCollisions:y}:{};return o.jsx(cC,{scope:n,content:v,viewport:N,onViewportChange:A,itemRefCallback:Q,selectedItem:C,onItemLeave:X,itemTextRefCallback:P,focusSelectedItem:O,selectedItemText:M,position:a,isPositioned:I,searchRef:H,children:o.jsx(Mc,{as:XL,allowPinchZoom:!0,children:o.jsx(Ac,{asChild:!0,trapped:g.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:ee(r,Y=>{var Z;(Z=g.trigger)==null||Z.focus({preventScroll:!0}),Y.preventDefault()}),children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:o.jsx(G,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:Y=>Y.preventDefault(),...h,...ne,onPlaced:()=>V(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:ee(h.onKeyDown,Y=>{const Z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!Z&&Y.key.length===1&&F(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let he=B().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ae=Y.target,K=he.indexOf(ae);he=he.slice(K+1)}setTimeout(()=>T(he)),Y.preventDefault()}})})})})})})});uC.displayName=qL;var WL="SelectItemAlignedPosition",dC=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,s=ho(as,n),i=go(as,n),[l,c]=d.useState(null),[u,m]=d.useState(null),f=Se(t,j=>m(j)),w=Hf(n),p=d.useRef(!1),x=d.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:h,focusSelectedItem:g}=i,v=d.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&b&&y&&h){const j=s.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),M=h.getBoundingClientRect();if(s.dir!=="rtl"){const ae=M.left-C.left,K=R.left-ae,ge=j.left-K,Ne=j.width+ge,We=Math.max(Ne,C.width),Ke=window.innerWidth-Sa,at=Cc(K,[Sa,Math.max(Sa,Ke-We)]);l.style.minWidth=Ne+"px",l.style.left=at+"px"}else{const ae=C.right-M.right,K=window.innerWidth-R.right-ae,ge=window.innerWidth-j.right-K,Ne=j.width+ge,We=Math.max(Ne,C.width),Ke=window.innerWidth-Sa,at=Cc(K,[Sa,Math.max(Sa,Ke-We)]);l.style.minWidth=Ne+"px",l.style.right=at+"px"}const z=w(),B=window.innerHeight-Sa*2,I=b.scrollHeight,V=window.getComputedStyle(u),D=parseInt(V.borderTopWidth,10),T=parseInt(V.paddingTop,10),O=parseInt(V.borderBottomWidth,10),_=parseInt(V.paddingBottom,10),$=D+T+I+_+O,H=Math.min(y.offsetHeight*5,$),F=window.getComputedStyle(b),Q=parseInt(F.paddingTop,10),X=parseInt(F.paddingBottom,10),P=j.top+j.height/2-Sa,G=B-P,ne=y.offsetHeight/2,Y=y.offsetTop+ne,Z=D+T+Y,le=$-Z;if(Z<=P){const ae=z.length>0&&y===z[z.length-1].ref.current;l.style.bottom="0px";const K=u.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(G,ne+(ae?X:0)+K+O),Ne=Z+ge;l.style.height=Ne+"px"}else{const ae=z.length>0&&y===z[0].ref.current;l.style.top="0px";const ge=Math.max(P,D+b.offsetTop+(ae?Q:0)+ne)+le;l.style.height=ge+"px",b.scrollTop=Z-P+b.offsetTop}l.style.margin=`${Sa}px 0`,l.style.minHeight=H+"px",l.style.maxHeight=B+"px",a==null||a(),requestAnimationFrame(()=>p.current=!0)}},[w,s.trigger,s.valueNode,l,u,b,y,h,s.dir,a]);jt(()=>v(),[v]);const[S,N]=d.useState();jt(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const A=d.useCallback(j=>{j&&x.current===!0&&(v(),g==null||g(),x.current=!1)},[v,g]);return o.jsx(QL,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:A,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(me.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});dC.displayName=WL;var ZL="SelectPopperPosition",nx=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=Sa,...s}=e,i=Ff(n);return o.jsx(kf,{...i,...s,ref:t,align:a,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nx.displayName=ZL;var[QL,ax]=Ri(as,{}),rx="SelectViewport",fC=d.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,s=go(rx,n),i=ax(rx,n),l=Se(t,s.onViewportChange),c=d.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Uf.Slot,{scope:n,children:o.jsx(me.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ee(r.onScroll,u=>{const m=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:w}=i;if(w!=null&&w.current&&f){const p=Math.abs(c.current-m.scrollTop);if(p>0){const x=window.innerHeight-Sa*2,b=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),h=Math.max(b,y);if(h<x){const g=h+p,v=Math.min(x,g),S=g-v;f.style.height=v+"px",f.style.bottom==="0px"&&(m.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});fC.displayName=rx;var mC="SelectGroup",[JL,e7]=Ri(mC),wC=d.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Un();return o.jsx(JL,{scope:n,id:r,children:o.jsx(me.div,{role:"group","aria-labelledby":r,...a,ref:t})})});wC.displayName=mC;var pC="SelectLabel",hC=d.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=e7(pC,n);return o.jsx(me.div,{id:r.id,...a,ref:t})});hC.displayName=pC;var Vf="SelectItem",[t7,gC]=Ri(Vf),xC=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:s,...i}=e,l=ho(Vf,n),c=go(Vf,n),u=l.value===a,[m,f]=d.useState(s??""),[w,p]=d.useState(!1),x=Se(t,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,a,r)}),b=Un(),y=d.useRef("touch"),h=()=>{r||(l.onValueChange(a),l.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(t7,{scope:n,value:a,disabled:r,textId:b,isSelected:u,onItemTextChange:d.useCallback(g=>{f(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:o.jsx(Uf.ItemSlot,{scope:n,value:a,disabled:r,textValue:m,children:o.jsx(me.div,{role:"option","aria-labelledby":b,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:x,onFocus:ee(i.onFocus,()=>p(!0)),onBlur:ee(i.onBlur,()=>p(!1)),onClick:ee(i.onClick,()=>{y.current!=="mouse"&&h()}),onPointerUp:ee(i.onPointerUp,()=>{y.current==="mouse"&&h()}),onPointerDown:ee(i.onPointerDown,g=>{y.current=g.pointerType}),onPointerMove:ee(i.onPointerMove,g=>{var v;y.current=g.pointerType,r?(v=c.onItemLeave)==null||v.call(c):y.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ee(i.onKeyDown,g=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&g.key===" "||(UL.includes(g.key)&&h(),g.key===" "&&g.preventDefault())})})})})});xC.displayName=Vf;var Dc="SelectItemText",bC=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...s}=e,i=ho(Dc,n),l=go(Dc,n),c=gC(Dc,n),u=GL(Dc,n),[m,f]=d.useState(null),w=Se(t,h=>f(h),c.onItemTextChange,h=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,h,c.value,c.disabled)}),p=m==null?void 0:m.textContent,x=d.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=u;return jt(()=>(b(x),()=>y(x)),[b,y,x]),o.jsxs(o.Fragment,{children:[o.jsx(me.span,{id:c.textId,...s,ref:w}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Eo.createPortal(s.children,i.valueNode):null]})});bC.displayName=Dc;var vC="SelectItemIndicator",yC=d.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return gC(vC,n).isSelected?o.jsx(me.span,{"aria-hidden":!0,...a,ref:t}):null});yC.displayName=vC;var ox="SelectScrollUpButton",SC=d.forwardRef((e,t)=>{const n=go(ox,e.__scopeSelect),a=ax(ox,e.__scopeSelect),[r,s]=d.useState(!1),i=Se(t,a.onScrollButtonChange);return jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?o.jsx(NC,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});SC.displayName=ox;var sx="SelectScrollDownButton",jC=d.forwardRef((e,t)=>{const n=go(sx,e.__scopeSelect),a=ax(sx,e.__scopeSelect),[r,s]=d.useState(!1),i=Se(t,a.onScrollButtonChange);return jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;s(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?o.jsx(NC,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});jC.displayName=sx;var NC=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,s=go("SelectScrollButton",n),i=d.useRef(null),l=Hf(n),c=d.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),jt(()=>{var m;const u=l().find(f=>f.ref.current===document.activeElement);(m=u==null?void 0:u.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),o.jsx(me.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:ee(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:ee(r.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:ee(r.onPointerLeave,()=>{c()})})}),n7="SelectSeparator",CC=d.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return o.jsx(me.div,{"aria-hidden":!0,...a,ref:t})});CC.displayName=n7;var ix="SelectArrow",a7=d.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Ff(n),s=ho(ix,n),i=go(ix,n);return s.open&&i.position==="popper"?o.jsx(Mf,{...r,...a,ref:t}):null});a7.displayName=ix;var r7="SelectBubbleInput",AC=d.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const r=d.useRef(null),s=Se(a,r),i=kc(t);return d.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&m){const f=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(f)}},[i,t]),o.jsx(me.select,{...n,style:{...B2,...n.style},ref:s,defaultValue:t})});AC.displayName=r7;function _C(e){return e===""||e===void 0}function EC(e){const t=Ft(e),n=d.useRef(""),a=d.useRef(0),r=d.useCallback(i=>{const l=n.current+i;t(l),function c(u){n.current=u,window.clearTimeout(a.current),u!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),s=d.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,s]}function TC(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=o7(e,Math.max(s,0));r.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function o7(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var s7=tC,RC=aC,i7=oC,l7=sC,c7=iC,kC=lC,u7=fC,d7=wC,MC=hC,DC=xC,f7=bC,m7=yC,OC=SC,PC=jC,zC=CC;let Oc=null,Gf=!1;const LC=()=>{Oc="pointer"},IC=e=>{e.metaKey||e.ctrlKey||e.altKey||(Oc="keyboard")};function w7(e=window){return Gf?()=>{}:(Gf=!0,e.addEventListener("pointerdown",LC,!0),e.addEventListener("keydown",IC,!0),()=>{e.removeEventListener("pointerdown",LC,!0),e.removeEventListener("keydown",IC,!0),Gf=!1,Oc=null})}function $C(e){return e instanceof HTMLElement&&(e.hasAttribute("aria-expanded")||e.hasAttribute("aria-haspopup"))}function p7(e){if(e.id){const n=e.id.replace(/["\\]/g,"\\$&"),a=document.querySelector(`[aria-controls="${n}"]`);if($C(a))return a}const t=e.getAttribute("aria-labelledby");if(t){const n=document.getElementById(t);if($C(n))return n}return null}function h7(e){if(!Gf||Oc===null)return;const t=e.currentTarget??e.target;if(!(t instanceof Element))return;const n=p7(t);if(!n)return;const a=Oc==="keyboard",r=HTMLElement.prototype.focus;n.focus=s=>{r.call(n,{...s,focusVisible:a})},queueMicrotask(()=>{delete n.focus})}function lx(e){return t=>{e==null||e(t),!t.defaultPrevented&&h7(t)}}const Vt=s7,Yf=d7,Gt=i7,zt=d.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(RC,{ref:a,className:E("tw:flex tw:h-9 tw:w-full tw:items-center tw:justify-between tw:whitespace-nowrap tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-2 tw:text-sm tw:text-foreground tw:shadow-sm tw:ring-offset-background tw:data-[placeholder]:text-muted-foreground tw:focus:outline-none tw:focus:ring-1 tw:focus:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:[&>span]:line-clamp-1",e),...n,children:[t,o.jsx(l7,{asChild:!0,children:o.jsx(bc,{className:"tw:h-4 tw:w-4 tw:opacity-50"})})]}));zt.displayName=RC.displayName;const BC=d.forwardRef(({className:e,...t},n)=>o.jsx(OC,{ref:n,className:E("tw:flex tw:cursor-default tw:items-center tw:justify-center tw:py-1",e),...t,children:o.jsx(mN,{className:"tw:h-4 tw:w-4"})}));BC.displayName=OC.displayName;const UC=d.forwardRef(({className:e,...t},n)=>o.jsx(PC,{ref:n,className:E("tw:flex tw:cursor-default tw:items-center tw:justify-center tw:py-1",e),...t,children:o.jsx(bc,{className:"tw:h-4 tw:w-4"})}));UC.displayName=PC.displayName;const g7={left:16,right:16},Lt=d.forwardRef(({className:e,children:t,position:n="popper",container:a,disablePortal:r,onCloseAutoFocus:s,...i},l)=>{const c=o.jsxs(kC,{ref:l,onCloseAutoFocus:lx(s),className:E("tw:relative tw:z-50 tw:max-h-[var(--radix-select-content-available-height,100vh)] tw:max-w-[var(--radix-select-content-available-width,calc(100vw_-_2rem))] tw:min-w-[8rem] tw:overflow-y-auto tw:overflow-x-hidden tw:rounded-md tw:border tw:border-gray-200 tw:bg-white tw:text-popover-foreground tw:shadow-md tw:origin-[--radix-select-content-transform-origin]",n==="popper"&&"tw:data-[side=bottom]:translate-y-1 tw:data-[side=left]:-translate-x-1 tw:data-[side=right]:translate-x-1 tw:data-[side=top]:-translate-y-1",e),position:n,collisionPadding:g7,...i,children:[o.jsx(BC,{}),o.jsx(u7,{className:E("tw:p-1",n==="popper"&&"tw:h-[var(--radix-select-trigger-height)] tw:w-full tw:min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(UC,{})]});return r?c:o.jsx(c7,{container:a||void 0,children:c})});Lt.displayName=kC.displayName;const x7=d.forwardRef(({className:e,...t},n)=>o.jsx(MC,{ref:n,className:E("tw:px-2 tw:py-1.5 tw:text-sm tw:font-semibold",e),...t}));x7.displayName=MC.displayName;const Tt=d.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(DC,{ref:a,className:E("tw:relative tw:flex tw:w-full tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-2 tw:pr-8 tw:text-sm tw:outline-none tw:hover:bg-primary/10 tw:focus:bg-primary/15 tw:focus:text-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"tw:absolute tw:right-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(m7,{children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}),o.jsx(f7,{children:t})]}));Tt.displayName=DC.displayName;const b7=d.forwardRef(({className:e,...t},n)=>o.jsx(zC,{ref:n,className:E("tw:-mx-1 tw:my-1 tw:h-px tw:bg-muted",e),...t}));b7.displayName=zC.displayName;const It=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:rounded-xl tw:border tw:border-[var(--color-border,#e5e7eb)] tw:bg-[var(--color-card,white)] tw:text-[var(--color-card-foreground,inherit)] tw:shadow-sm",e),...t}));It.displayName="Card";const Pc=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:flex tw:flex-col tw:space-y-1.5 tw:p-6",e),...t}));Pc.displayName="CardHeader";const zc=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:font-semibold tw:leading-none tw:tracking-tight",e),...t}));zc.displayName="CardTitle";const v7=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));v7.displayName="CardDescription";const Yt=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:p-6",e),...t}));Yt.displayName="CardContent";const y7=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:flex tw:items-center tw:p-6 tw:pt-0",e),...t}));y7.displayName="CardFooter";const S7=hi("tw:relative tw:w-full tw:rounded-lg tw:border tw:px-4 tw:py-3 tw:text-sm tw:[&>svg+div]:translate-y-[-3px] tw:[&>svg]:absolute tw:[&>svg]:left-4 tw:[&>svg]:top-3 tw:[&>svg]:text-foreground tw:[&>svg~*]:pl-7",{variants:{variant:{default:"tw:bg-background tw:text-foreground",destructive:"tw:border-red-200 tw:bg-red-50 tw:text-destructive tw:dark:border-destructive tw:[&>svg]:text-destructive",success:"tw:border-green-300 tw:bg-green-50 tw:text-green-800 tw:[&>svg]:text-green-600",info:"tw:border-blue-300 tw:bg-blue-50 tw:text-blue-800 tw:[&>svg]:text-blue-600",warning:"tw:border-amber-300 tw:bg-amber-50 tw:text-amber-900 tw:[&>svg]:text-amber-600"}},defaultVariants:{variant:"default"}}),ln=d.forwardRef(({className:e,variant:t,...n},a)=>o.jsx("div",{ref:a,role:"alert",className:E(S7({variant:t}),e),...n}));ln.displayName="Alert";const Va=d.forwardRef(({className:e,...t},n)=>o.jsx("h5",{ref:n,className:E("tw:m-0 tw:mb-1 tw:font-medium tw:leading-none tw:tracking-tight",e),...t}));Va.displayName="AlertTitle";const Gn=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:text-sm tw:[&_p]:leading-relaxed",e),...t}));Gn.displayName="AlertDescription";function j7(e,t){return d.useReducer((n,a)=>t[n][a]??n,e)}var Rt=e=>{const{present:t,children:n}=e,a=N7(t),r=typeof n=="function"?n({present:a.isPresent}):d.Children.only(n),s=Se(a.ref,C7(r));return typeof n=="function"||a.isPresent?d.cloneElement(r,{ref:s}):null};Rt.displayName="Presence";function N7(e){const[t,n]=d.useState(),a=d.useRef(null),r=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,c]=j7(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=Kf(a.current);s.current=l==="mounted"?u:"none"},[l]),jt(()=>{const u=a.current,m=r.current;if(m!==e){const w=s.current,p=Kf(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(m&&w!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),jt(()=>{if(t){let u;const m=t.ownerDocument.defaultView??window,f=p=>{const b=Kf(a.current).includes(CSS.escape(p.animationName));if(p.target===t&&b&&(c("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},w=p=>{p.target===t&&(s.current=Kf(a.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{m.clearTimeout(u),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(u=>{a.current=u?getComputedStyle(u):null,n(u)},[])}}function Kf(e){return(e==null?void 0:e.animationName)||"none"}function C7(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function A7(e){const t=_7(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(T7);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function _7(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=k7(r),l=R7(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var E7=Symbol("radix.slottable");function T7(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===E7}function R7(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function k7(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qf="Dialog",[HC,FC]=Ht(qf),[M7,ja]=HC(qf),VC=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=d.useRef(null),c=d.useRef(null),[u,m]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:qf});return o.jsx(M7,{scope:t,triggerRef:l,contentRef:c,contentId:Un(),titleId:Un(),descriptionId:Un(),open:u,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(f=>!f),[m]),modal:i,children:n})};VC.displayName=qf;var GC="DialogTrigger",YC=d.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(GC,n),s=Se(t,r.triggerRef);return o.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":dx(r.open),...a,ref:s,onClick:ee(e.onClick,r.onOpenToggle)})});YC.displayName=GC;var cx="DialogPortal",[D7,KC]=HC(cx,{forceMount:void 0}),qC=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,s=ja(cx,t);return o.jsx(D7,{scope:t,forceMount:n,children:d.Children.map(a,i=>o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:i})}))})};qC.displayName=cx;var Xf="DialogOverlay",XC=d.forwardRef((e,t)=>{const n=KC(Xf,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,s=ja(Xf,e.__scopeDialog);return s.modal?o.jsx(Rt,{present:a||s.open,children:o.jsx(P7,{...r,ref:t})}):null});XC.displayName=Xf;var O7=A7("DialogOverlay.RemoveScroll"),P7=d.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(Xf,n);return o.jsx(Mc,{as:O7,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(me.div,{"data-state":dx(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),rs="DialogContent",WC=d.forwardRef((e,t)=>{const n=KC(rs,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,s=ja(rs,e.__scopeDialog);return o.jsx(Rt,{present:a||s.open,children:s.modal?o.jsx(z7,{...r,ref:t}):o.jsx(L7,{...r,ref:t})})});WC.displayName=rs;var z7=d.forwardRef((e,t)=>{const n=ja(rs,e.__scopeDialog),a=d.useRef(null),r=Se(t,n.contentRef,a);return d.useEffect(()=>{const s=a.current;if(s)return Pf(s)},[]),o.jsx(ZC,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault())})}),L7=d.forwardRef((e,t)=>{const n=ja(rs,e.__scopeDialog),a=d.useRef(!1),r=d.useRef(!1);return o.jsx(ZC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),ZC=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,l=ja(rs,n),c=d.useRef(null),u=Se(t,c);return bf(),o.jsxs(o.Fragment,{children:[o.jsx(Ac,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(vi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":dx(l.open),...i,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx($7,{titleId:l.titleId}),o.jsx(U7,{contentRef:c,descriptionId:l.descriptionId})]})]})}),ux="DialogTitle",QC=d.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(ux,n);return o.jsx(me.h2,{id:r.titleId,...a,ref:t})});QC.displayName=ux;var JC="DialogDescription",eA=d.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(JC,n);return o.jsx(me.p,{id:r.descriptionId,...a,ref:t})});eA.displayName=JC;var tA="DialogClose",nA=d.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(tA,n);return o.jsx(me.button,{type:"button",...a,ref:t,onClick:ee(e.onClick,()=>r.onOpenChange(!1))})});nA.displayName=tA;function dx(e){return e?"open":"closed"}var aA="DialogTitleWarning",[I7,rA]=Yz(aA,{contentName:rs,titleName:ux,docsSlug:"dialog"}),$7=({titleId:e})=>{const t=rA(aA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.456 `)},LL=0,Ti=[];function IL(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),r=u.useState(LL++)[0],s=u.useState(K2)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=oL([e.lockRef.current],(e.shards||[]).map(eC),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=u.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var h=Bf(b),g=n.current,v="deltaX"in b?b.deltaX:g[0]-h[0],S="deltaY"in b?b.deltaY:g[1]-h[1],N,A=b.target,j=Math.abs(v)>Math.abs(S)?"h":"v";if("touches"in b&&j==="h"&&A.type==="range")return!1;var C=window.getSelection(),R=C&&C.anchorNode,M=R?R===A||R.contains(A):!1;if(M)return!1;var z=W2(j,A);if(!z)return!0;if(z?N=j:(N=j==="v"?"h":"v",z=W2(j,A)),!z)return!1;if(!a.current&&"changedTouches"in b&&(v||S)&&(a.current=N),!N)return!0;var B=a.current||N;return OL(B,y,b,B==="h"?v:S)},[]),c=u.useCallback(function(b){var y=b;if(!(!Ti.length||Ti[Ti.length-1]!==s)){var h="deltaY"in y?J2(y):Bf(y),g=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&PL(N.delta,h)})[0];if(g&&g.should){y.cancelable&&y.preventDefault();return}if(!g){var v=(i.current.shards||[]).map(eC).filter(Boolean).filter(function(N){return N.contains(y.target)}),S=v.length>0?l(y,v[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),d=u.useCallback(function(b,y,h,g){var v={name:b,delta:y,target:h,should:g,shadowParent:$L(h)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(S){return S!==v})},1)},[]),m=u.useCallback(function(b){n.current=Bf(b),a.current=void 0},[]),f=u.useCallback(function(b){d(b.type,J2(b),b.target,l(b,e.lockRef.current))},[]),w=u.useCallback(function(b){d(b.type,Bf(b),b.target,l(b,e.lockRef.current))},[]);u.useEffect(function(){return Ti.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:w}),document.addEventListener("wheel",c,Ei),document.addEventListener("touchmove",c,Ei),document.addEventListener("touchstart",m,Ei),function(){Ti=Ti.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Ei),document.removeEventListener("touchmove",c,Ei),document.removeEventListener("touchstart",m,Ei)}},[]);var p=e.removeScrollBar,x=e.inert;return u.createElement(u.Fragment,null,x?u.createElement(s,{styles:zL(r)}):null,p?u.createElement(_L,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $L(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const BL=wL(Y2,IL);var Mc=u.forwardRef(function(e,t){return u.createElement(If,Fa({},e,{ref:t,sideCar:BL}))});Mc.classNames=If.classNames;var UL=[" ","Enter","ArrowUp","ArrowDown"],HL=[" ","Enter"],ns="Select",[Uf,Hf,FL]=xf(ns),[Ri]=Ht(ns,[FL,po]),Ff=po(),[VL,ho]=Ri(ns),[GL,YL]=Ri(ns),tC=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:r,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:d,name:m,autoComplete:f,disabled:w,required:p,form:x}=e,b=Ff(t),[y,h]=u.useState(null),[g,v]=u.useState(null),[S,N]=u.useState(!1),A=es(d),[j,C]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:ns}),[R,M]=Vn({prop:i,defaultProp:l,onChange:c,caller:ns}),z=u.useRef(null),B=y?x||!!y.closest("form"):!0,[I,V]=u.useState(new Set),D=Array.from(I).map(T=>T.props.value).join(";");return o.jsx(Rf,{...b,children:o.jsxs(VL,{required:p,scope:t,trigger:y,onTriggerChange:h,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:Un(),value:R,onValueChange:M,open:j,onOpenChange:C,dir:A,triggerPointerDownPosRef:z,disabled:w,children:[o.jsx(Uf.Provider,{scope:t,children:o.jsx(GL,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(T=>{V(O=>new Set(O).add(T))},[]),onNativeOptionRemove:u.useCallback(T=>{V(O=>{const _=new Set(O);return _.delete(T),_})},[]),children:n})}),B?o.jsxs(AC,{"aria-hidden":!0,required:p,tabIndex:-1,name:m,autoComplete:f,value:R,onChange:T=>M(T.target.value),disabled:w,form:x,children:[R===void 0?o.jsx("option",{value:""}):null,Array.from(I)]},D):null]})})};tC.displayName=ns;var nC="SelectTrigger",aC=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,s=Ff(n),i=ho(nC,n),l=i.disabled||a,c=Se(t,i.onTriggerChange),d=Hf(n),m=u.useRef("touch"),[f,w,p]=EC(b=>{const y=d().filter(v=>!v.disabled),h=y.find(v=>v.value===i.value),g=TC(y,b,h);g!==void 0&&i.onValueChange(g.value)}),x=b=>{l||(i.onOpenChange(!0),p()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return o.jsx(Rc,{asChild:!0,...s,children:o.jsx(me.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":_C(i.value)?"":void 0,...r,ref:c,onClick:ee(r.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&x(b)}),onPointerDown:ee(r.onPointerDown,b=>{m.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(x(b),b.preventDefault())}),onKeyDown:ee(r.onKeyDown,b=>{const y=f.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&w(b.key),!(y&&b.key===" ")&&UL.includes(b.key)&&(x(),b.preventDefault())})})})});aC.displayName=nC;var rC="SelectValue",oC=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:s,placeholder:i="",...l}=e,c=ho(rC,n),{onValueNodeHasChildrenChange:d}=c,m=s!==void 0,f=Se(t,c.onValueNodeChange);return jt(()=>{d(m)},[d,m]),o.jsx(me.span,{...l,ref:f,style:{pointerEvents:"none"},children:_C(c.value)?o.jsx(o.Fragment,{children:i}):s})});oC.displayName=rC;var KL="SelectIcon",sC=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return o.jsx(me.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});sC.displayName=KL;var qL="SelectPortal",iC=e=>o.jsx(Ci,{asChild:!0,...e});iC.displayName=qL;var as="SelectContent",lC=u.forwardRef((e,t)=>{const n=ho(as,e.__scopeSelect),[a,r]=u.useState();if(jt(()=>{r(new DocumentFragment)},[]),!n.open){const s=a;return s?Eo.createPortal(o.jsx(cC,{scope:e.__scopeSelect,children:o.jsx(Uf.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),s):null}return o.jsx(uC,{...e,ref:t})});lC.displayName=as;var Sa=10,[cC,go]=Ri(as),XL="SelectContentImpl",WL=G8("SelectContent.RemoveScroll"),uC=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:w,collisionPadding:p,sticky:x,hideWhenDetached:b,avoidCollisions:y,...h}=e,g=ho(as,n),[v,S]=u.useState(null),[N,A]=u.useState(null),j=Se(t,Y=>S(Y)),[C,R]=u.useState(null),[M,z]=u.useState(null),B=Hf(n),[I,V]=u.useState(!1),D=u.useRef(!1);u.useEffect(()=>{if(v)return Pf(v)},[v]),bf();const T=u.useCallback(Y=>{const[Z,...le]=B().map(K=>K.ref.current),[he]=le.slice(-1),ae=document.activeElement;for(const K of Y)if(K===ae||(K==null||K.scrollIntoView({block:"nearest"}),K===Z&&N&&(N.scrollTop=0),K===he&&N&&(N.scrollTop=N.scrollHeight),K==null||K.focus(),document.activeElement!==ae))return},[B,N]),O=u.useCallback(()=>T([C,v]),[T,C,v]);u.useEffect(()=>{I&&O()},[I,O]);const{onOpenChange:_,triggerPointerDownPosRef:$}=g;u.useEffect(()=>{if(v){let Y={x:0,y:0};const Z=he=>{var ae,K;Y={x:Math.abs(Math.round(he.pageX)-(((ae=$.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(he.pageY)-(((K=$.current)==null?void 0:K.y)??0))}},le=he=>{Y.x<=10&&Y.y<=10?he.preventDefault():v.contains(he.target)||_(!1),document.removeEventListener("pointermove",Z),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",le,{capture:!0})}}},[v,_,$]),u.useEffect(()=>{const Y=()=>_(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[_]);const[H,F]=EC(Y=>{const Z=B().filter(ae=>!ae.disabled),le=Z.find(ae=>ae.ref.current===document.activeElement),he=TC(Z,Y,le);he&&setTimeout(()=>he.ref.current.focus())}),Q=u.useCallback((Y,Z,le)=>{const he=!D.current&&!le;(g.value!==void 0&&g.value===Z||he)&&(R(Y),he&&(D.current=!0))},[g.value]),X=u.useCallback(()=>v==null?void 0:v.focus(),[v]),P=u.useCallback((Y,Z,le)=>{const he=!D.current&&!le;(g.value!==void 0&&g.value===Z||he)&&z(Y)},[g.value]),G=a==="popper"?nx:dC,ne=G===nx?{side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:w,collisionPadding:p,sticky:x,hideWhenDetached:b,avoidCollisions:y}:{};return o.jsx(cC,{scope:n,content:v,viewport:N,onViewportChange:A,itemRefCallback:Q,selectedItem:C,onItemLeave:X,itemTextRefCallback:P,focusSelectedItem:O,selectedItemText:M,position:a,isPositioned:I,searchRef:H,children:o.jsx(Mc,{as:WL,allowPinchZoom:!0,children:o.jsx(Ac,{asChild:!0,trapped:g.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:ee(r,Y=>{var Z;(Z=g.trigger)==null||Z.focus({preventScroll:!0}),Y.preventDefault()}),children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:o.jsx(G,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:Y=>Y.preventDefault(),...h,...ne,onPlaced:()=>V(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:ee(h.onKeyDown,Y=>{const Z=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!Z&&Y.key.length===1&&F(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let he=B().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ae=Y.target,K=he.indexOf(ae);he=he.slice(K+1)}setTimeout(()=>T(he)),Y.preventDefault()}})})})})})})});uC.displayName=XL;var ZL="SelectItemAlignedPosition",dC=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,s=ho(as,n),i=go(as,n),[l,c]=u.useState(null),[d,m]=u.useState(null),f=Se(t,j=>m(j)),w=Hf(n),p=u.useRef(!1),x=u.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:h,focusSelectedItem:g}=i,v=u.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&b&&y&&h){const j=s.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),M=h.getBoundingClientRect();if(s.dir!=="rtl"){const ae=M.left-C.left,K=R.left-ae,ge=j.left-K,Ce=j.width+ge,We=Math.max(Ce,C.width),Ke=window.innerWidth-Sa,at=Cc(K,[Sa,Math.max(Sa,Ke-We)]);l.style.minWidth=Ce+"px",l.style.left=at+"px"}else{const ae=C.right-M.right,K=window.innerWidth-R.right-ae,ge=window.innerWidth-j.right-K,Ce=j.width+ge,We=Math.max(Ce,C.width),Ke=window.innerWidth-Sa,at=Cc(K,[Sa,Math.max(Sa,Ke-We)]);l.style.minWidth=Ce+"px",l.style.right=at+"px"}const z=w(),B=window.innerHeight-Sa*2,I=b.scrollHeight,V=window.getComputedStyle(d),D=parseInt(V.borderTopWidth,10),T=parseInt(V.paddingTop,10),O=parseInt(V.borderBottomWidth,10),_=parseInt(V.paddingBottom,10),$=D+T+I+_+O,H=Math.min(y.offsetHeight*5,$),F=window.getComputedStyle(b),Q=parseInt(F.paddingTop,10),X=parseInt(F.paddingBottom,10),P=j.top+j.height/2-Sa,G=B-P,ne=y.offsetHeight/2,Y=y.offsetTop+ne,Z=D+T+Y,le=$-Z;if(Z<=P){const ae=z.length>0&&y===z[z.length-1].ref.current;l.style.bottom="0px";const K=d.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(G,ne+(ae?X:0)+K+O),Ce=Z+ge;l.style.height=Ce+"px"}else{const ae=z.length>0&&y===z[0].ref.current;l.style.top="0px";const ge=Math.max(P,D+b.offsetTop+(ae?Q:0)+ne)+le;l.style.height=ge+"px",b.scrollTop=Z-P+b.offsetTop}l.style.margin=`${Sa}px 0`,l.style.minHeight=H+"px",l.style.maxHeight=B+"px",a==null||a(),requestAnimationFrame(()=>p.current=!0)}},[w,s.trigger,s.valueNode,l,d,b,y,h,s.dir,a]);jt(()=>v(),[v]);const[S,N]=u.useState();jt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const A=u.useCallback(j=>{j&&x.current===!0&&(v(),g==null||g(),x.current=!1)},[v,g]);return o.jsx(JL,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:A,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(me.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});dC.displayName=ZL;var QL="SelectPopperPosition",nx=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=Sa,...s}=e,i=Ff(n);return o.jsx(kf,{...i,...s,ref:t,align:a,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nx.displayName=QL;var[JL,ax]=Ri(as,{}),rx="SelectViewport",fC=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,s=go(rx,n),i=ax(rx,n),l=Se(t,s.onViewportChange),c=u.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Uf.Slot,{scope:n,children:o.jsx(me.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ee(r.onScroll,d=>{const m=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:w}=i;if(w!=null&&w.current&&f){const p=Math.abs(c.current-m.scrollTop);if(p>0){const x=window.innerHeight-Sa*2,b=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),h=Math.max(b,y);if(h<x){const g=h+p,v=Math.min(x,g),S=g-v;f.style.height=v+"px",f.style.bottom==="0px"&&(m.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});fC.displayName=rx;var mC="SelectGroup",[e7,t7]=Ri(mC),wC=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Un();return o.jsx(e7,{scope:n,id:r,children:o.jsx(me.div,{role:"group","aria-labelledby":r,...a,ref:t})})});wC.displayName=mC;var pC="SelectLabel",hC=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=t7(pC,n);return o.jsx(me.div,{id:r.id,...a,ref:t})});hC.displayName=pC;var Vf="SelectItem",[n7,gC]=Ri(Vf),xC=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:s,...i}=e,l=ho(Vf,n),c=go(Vf,n),d=l.value===a,[m,f]=u.useState(s??""),[w,p]=u.useState(!1),x=Se(t,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,a,r)}),b=Un(),y=u.useRef("touch"),h=()=>{r||(l.onValueChange(a),l.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(n7,{scope:n,value:a,disabled:r,textId:b,isSelected:d,onItemTextChange:u.useCallback(g=>{f(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:o.jsx(Uf.ItemSlot,{scope:n,value:a,disabled:r,textValue:m,children:o.jsx(me.div,{role:"option","aria-labelledby":b,"data-highlighted":w?"":void 0,"aria-selected":d&&w,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:x,onFocus:ee(i.onFocus,()=>p(!0)),onBlur:ee(i.onBlur,()=>p(!1)),onClick:ee(i.onClick,()=>{y.current!=="mouse"&&h()}),onPointerUp:ee(i.onPointerUp,()=>{y.current==="mouse"&&h()}),onPointerDown:ee(i.onPointerDown,g=>{y.current=g.pointerType}),onPointerMove:ee(i.onPointerMove,g=>{var v;y.current=g.pointerType,r?(v=c.onItemLeave)==null||v.call(c):y.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(i.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:ee(i.onKeyDown,g=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&g.key===" "||(HL.includes(g.key)&&h(),g.key===" "&&g.preventDefault())})})})})});xC.displayName=Vf;var Dc="SelectItemText",bC=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...s}=e,i=ho(Dc,n),l=go(Dc,n),c=gC(Dc,n),d=YL(Dc,n),[m,f]=u.useState(null),w=Se(t,h=>f(h),c.onItemTextChange,h=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,h,c.value,c.disabled)}),p=m==null?void 0:m.textContent,x=u.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=d;return jt(()=>(b(x),()=>y(x)),[b,y,x]),o.jsxs(o.Fragment,{children:[o.jsx(me.span,{id:c.textId,...s,ref:w}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Eo.createPortal(s.children,i.valueNode):null]})});bC.displayName=Dc;var vC="SelectItemIndicator",yC=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return gC(vC,n).isSelected?o.jsx(me.span,{"aria-hidden":!0,...a,ref:t}):null});yC.displayName=vC;var ox="SelectScrollUpButton",SC=u.forwardRef((e,t)=>{const n=go(ox,e.__scopeSelect),a=ax(ox,e.__scopeSelect),[r,s]=u.useState(!1),i=Se(t,a.onScrollButtonChange);return jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;s(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?o.jsx(NC,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});SC.displayName=ox;var sx="SelectScrollDownButton",jC=u.forwardRef((e,t)=>{const n=go(sx,e.__scopeSelect),a=ax(sx,e.__scopeSelect),[r,s]=u.useState(!1),i=Se(t,a.onScrollButtonChange);return jt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<d;s(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),r?o.jsx(NC,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});jC.displayName=sx;var NC=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,s=go("SelectScrollButton",n),i=u.useRef(null),l=Hf(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),jt(()=>{var m;const d=l().find(f=>f.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),o.jsx(me.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:ee(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:ee(r.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:ee(r.onPointerLeave,()=>{c()})})}),a7="SelectSeparator",CC=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return o.jsx(me.div,{"aria-hidden":!0,...a,ref:t})});CC.displayName=a7;var ix="SelectArrow",r7=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Ff(n),s=ho(ix,n),i=go(ix,n);return s.open&&i.position==="popper"?o.jsx(Mf,{...r,...a,ref:t}):null});r7.displayName=ix;var o7="SelectBubbleInput",AC=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const r=u.useRef(null),s=Se(a,r),i=kc(t);return u.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&m){const f=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(f)}},[i,t]),o.jsx(me.select,{...n,style:{...B2,...n.style},ref:s,defaultValue:t})});AC.displayName=o7;function _C(e){return e===""||e===void 0}function EC(e){const t=Ft(e),n=u.useRef(""),a=u.useRef(0),r=u.useCallback(i=>{const l=n.current+i;t(l),function c(d){n.current=d,window.clearTimeout(a.current),d!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,s]}function TC(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=s7(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function s7(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var i7=tC,RC=aC,l7=oC,c7=sC,u7=iC,kC=lC,d7=fC,f7=wC,MC=hC,DC=xC,m7=bC,w7=yC,OC=SC,PC=jC,zC=CC;let Oc=null,Gf=!1;const LC=()=>{Oc="pointer"},IC=e=>{e.metaKey||e.ctrlKey||e.altKey||(Oc="keyboard")};function p7(e=window){return Gf?()=>{}:(Gf=!0,e.addEventListener("pointerdown",LC,!0),e.addEventListener("keydown",IC,!0),()=>{e.removeEventListener("pointerdown",LC,!0),e.removeEventListener("keydown",IC,!0),Gf=!1,Oc=null})}function $C(e){return e instanceof HTMLElement&&(e.hasAttribute("aria-expanded")||e.hasAttribute("aria-haspopup"))}function h7(e){if(e.id){const n=e.id.replace(/["\\]/g,"\\$&"),a=document.querySelector(`[aria-controls="${n}"]`);if($C(a))return a}const t=e.getAttribute("aria-labelledby");if(t){const n=document.getElementById(t);if($C(n))return n}return null}function g7(e){if(!Gf||Oc===null)return;const t=e.currentTarget??e.target;if(!(t instanceof Element))return;const n=h7(t);if(!n)return;const a=Oc==="keyboard",r=HTMLElement.prototype.focus;n.focus=s=>{r.call(n,{...s,focusVisible:a})},queueMicrotask(()=>{delete n.focus})}function lx(e){return t=>{e==null||e(t),!t.defaultPrevented&&g7(t)}}const Vt=i7,Yf=f7,Gt=l7,zt=u.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(RC,{ref:a,className:E("tw:flex tw:h-9 tw:w-full tw:items-center tw:justify-between tw:whitespace-nowrap tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-2 tw:text-sm tw:text-foreground tw:shadow-sm tw:ring-offset-background tw:data-[placeholder]:text-muted-foreground tw:focus:outline-none tw:focus:ring-1 tw:focus:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:[&>span]:line-clamp-1",e),...n,children:[t,o.jsx(c7,{asChild:!0,children:o.jsx(bc,{className:"tw:h-4 tw:w-4 tw:opacity-50"})})]}));zt.displayName=RC.displayName;const BC=u.forwardRef(({className:e,...t},n)=>o.jsx(OC,{ref:n,className:E("tw:flex tw:cursor-default tw:items-center tw:justify-center tw:py-1",e),...t,children:o.jsx(mN,{className:"tw:h-4 tw:w-4"})}));BC.displayName=OC.displayName;const UC=u.forwardRef(({className:e,...t},n)=>o.jsx(PC,{ref:n,className:E("tw:flex tw:cursor-default tw:items-center tw:justify-center tw:py-1",e),...t,children:o.jsx(bc,{className:"tw:h-4 tw:w-4"})}));UC.displayName=PC.displayName;const x7={left:16,right:16},Lt=u.forwardRef(({className:e,children:t,position:n="popper",container:a,disablePortal:r,onCloseAutoFocus:s,...i},l)=>{const c=o.jsxs(kC,{ref:l,onCloseAutoFocus:lx(s),className:E("tw:relative tw:z-50 tw:max-h-[var(--radix-select-content-available-height,100vh)] tw:max-w-[var(--radix-select-content-available-width,calc(100vw_-_2rem))] tw:min-w-[8rem] tw:overflow-y-auto tw:overflow-x-hidden tw:rounded-md tw:border tw:border-gray-200 tw:bg-white tw:text-popover-foreground tw:shadow-md tw:origin-[--radix-select-content-transform-origin]",n==="popper"&&"tw:data-[side=bottom]:translate-y-1 tw:data-[side=left]:-translate-x-1 tw:data-[side=right]:translate-x-1 tw:data-[side=top]:-translate-y-1",e),position:n,collisionPadding:x7,...i,children:[o.jsx(BC,{}),o.jsx(d7,{className:E("tw:p-1",n==="popper"&&"tw:h-[var(--radix-select-trigger-height)] tw:w-full tw:min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(UC,{})]});return r?c:o.jsx(u7,{container:a||void 0,children:c})});Lt.displayName=kC.displayName;const b7=u.forwardRef(({className:e,...t},n)=>o.jsx(MC,{ref:n,className:E("tw:px-2 tw:py-1.5 tw:text-sm tw:font-semibold",e),...t}));b7.displayName=MC.displayName;const Tt=u.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(DC,{ref:a,className:E("tw:relative tw:flex tw:w-full tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-2 tw:pr-8 tw:text-sm tw:outline-none tw:hover:bg-primary/10 tw:focus:bg-primary/15 tw:focus:text-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"tw:absolute tw:right-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(w7,{children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}),o.jsx(m7,{children:t})]}));Tt.displayName=DC.displayName;const v7=u.forwardRef(({className:e,...t},n)=>o.jsx(zC,{ref:n,className:E("tw:-mx-1 tw:my-1 tw:h-px tw:bg-muted",e),...t}));v7.displayName=zC.displayName;const It=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:rounded-xl tw:border tw:border-[var(--color-border,#e5e7eb)] tw:bg-[var(--color-card,white)] tw:text-[var(--color-card-foreground,inherit)] tw:shadow-sm",e),...t}));It.displayName="Card";const Pc=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:flex tw:flex-col tw:space-y-1.5 tw:p-6",e),...t}));Pc.displayName="CardHeader";const zc=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:font-semibold tw:leading-none tw:tracking-tight",e),...t}));zc.displayName="CardTitle";const y7=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));y7.displayName="CardDescription";const Yt=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:p-6",e),...t}));Yt.displayName="CardContent";const S7=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:flex tw:items-center tw:p-6 tw:pt-0",e),...t}));S7.displayName="CardFooter";const j7=hi("tw:relative tw:w-full tw:rounded-lg tw:border tw:px-4 tw:py-3 tw:text-sm tw:[&>svg+div]:translate-y-[-3px] tw:[&>svg]:absolute tw:[&>svg]:left-4 tw:[&>svg]:top-3 tw:[&>svg]:text-foreground tw:[&>svg~*]:pl-7",{variants:{variant:{default:"tw:bg-background tw:text-foreground",destructive:"tw:border-red-200 tw:bg-red-50 tw:text-destructive tw:dark:border-destructive tw:[&>svg]:text-destructive",success:"tw:border-green-300 tw:bg-green-50 tw:text-green-800 tw:[&>svg]:text-green-600",info:"tw:border-blue-300 tw:bg-blue-50 tw:text-blue-800 tw:[&>svg]:text-blue-600",warning:"tw:border-amber-300 tw:bg-amber-50 tw:text-amber-900 tw:[&>svg]:text-amber-600"}},defaultVariants:{variant:"default"}}),ln=u.forwardRef(({className:e,variant:t,...n},a)=>o.jsx("div",{ref:a,role:"alert",className:E(j7({variant:t}),e),...n}));ln.displayName="Alert";const Va=u.forwardRef(({className:e,...t},n)=>o.jsx("h5",{ref:n,className:E("tw:m-0 tw:mb-1 tw:font-medium tw:leading-none tw:tracking-tight",e),...t}));Va.displayName="AlertTitle";const Gn=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:E("tw:text-sm tw:[&_p]:leading-relaxed",e),...t}));Gn.displayName="AlertDescription";function N7(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var Rt=e=>{const{present:t,children:n}=e,a=C7(t),r=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),s=Se(a.ref,A7(r));return typeof n=="function"||a.isPresent?u.cloneElement(r,{ref:s}):null};Rt.displayName="Presence";function C7(e){const[t,n]=u.useState(),a=u.useRef(null),r=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[l,c]=N7(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Kf(a.current);s.current=l==="mounted"?d:"none"},[l]),jt(()=>{const d=a.current,m=r.current;if(m!==e){const w=s.current,p=Kf(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(m&&w!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),jt(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,f=p=>{const b=Kf(a.current).includes(CSS.escape(p.animationName));if(p.target===t&&b&&(c("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},w=p=>{p.target===t&&(s.current=Kf(a.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:u.useCallback(d=>{a.current=d?getComputedStyle(d):null,n(d)},[])}}function Kf(e){return(e==null?void 0:e.animationName)||"none"}function A7(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _7(e){const t=E7(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(R7);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function E7(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=M7(r),l=k7(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T7=Symbol("radix.slottable");function R7(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T7}function k7(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function M7(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qf="Dialog",[HC,FC]=Ht(qf),[D7,ja]=HC(qf),VC=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=u.useRef(null),c=u.useRef(null),[d,m]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:qf});return o.jsx(D7,{scope:t,triggerRef:l,contentRef:c,contentId:Un(),titleId:Un(),descriptionId:Un(),open:d,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(f=>!f),[m]),modal:i,children:n})};VC.displayName=qf;var GC="DialogTrigger",YC=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(GC,n),s=Se(t,r.triggerRef);return o.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":dx(r.open),...a,ref:s,onClick:ee(e.onClick,r.onOpenToggle)})});YC.displayName=GC;var cx="DialogPortal",[O7,KC]=HC(cx,{forceMount:void 0}),qC=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,s=ja(cx,t);return o.jsx(O7,{scope:t,forceMount:n,children:u.Children.map(a,i=>o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:i})}))})};qC.displayName=cx;var Xf="DialogOverlay",XC=u.forwardRef((e,t)=>{const n=KC(Xf,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,s=ja(Xf,e.__scopeDialog);return s.modal?o.jsx(Rt,{present:a||s.open,children:o.jsx(z7,{...r,ref:t})}):null});XC.displayName=Xf;var P7=_7("DialogOverlay.RemoveScroll"),z7=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(Xf,n);return o.jsx(Mc,{as:P7,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(me.div,{"data-state":dx(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),rs="DialogContent",WC=u.forwardRef((e,t)=>{const n=KC(rs,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,s=ja(rs,e.__scopeDialog);return o.jsx(Rt,{present:a||s.open,children:s.modal?o.jsx(L7,{...r,ref:t}):o.jsx(I7,{...r,ref:t})})});WC.displayName=rs;var L7=u.forwardRef((e,t)=>{const n=ja(rs,e.__scopeDialog),a=u.useRef(null),r=Se(t,n.contentRef,a);return u.useEffect(()=>{const s=a.current;if(s)return Pf(s)},[]),o.jsx(ZC,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault())})}),I7=u.forwardRef((e,t)=>{const n=ja(rs,e.__scopeDialog),a=u.useRef(!1),r=u.useRef(!1);return o.jsx(ZC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:s=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),ZC=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,l=ja(rs,n),c=u.useRef(null),d=Se(t,c);return bf(),o.jsxs(o.Fragment,{children:[o.jsx(Ac,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(vi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":dx(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(B7,{titleId:l.titleId}),o.jsx(H7,{contentRef:c,descriptionId:l.descriptionId})]})]})}),ux="DialogTitle",QC=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(ux,n);return o.jsx(me.h2,{id:r.titleId,...a,ref:t})});QC.displayName=ux;var JC="DialogDescription",eA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(JC,n);return o.jsx(me.p,{id:r.descriptionId,...a,ref:t})});eA.displayName=JC;var tA="DialogClose",nA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ja(tA,n);return o.jsx(me.button,{type:"button",...a,ref:t,onClick:ee(e.onClick,()=>r.onOpenChange(!1))})});nA.displayName=tA;function dx(e){return e?"open":"closed"}var aA="DialogTitleWarning",[$7,rA]=Kz(aA,{contentName:rs,titleName:ux,docsSlug:"dialog"}),B7=({titleId:e})=>{const t=rA(aA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 457 457 458 458 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 459 459 460 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},B7="DialogDescriptionWarning",U7=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rA(B7).contentName}}.`;return d.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},fx=VC,mx=YC,wx=qC,Lc=XC,ki=WC,Ic=QC,$c=eA,Bc=nA,H7=Symbol("radix.slottable");function F7(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=H7,t}var oA="AlertDialog",[V7]=Ht(oA,[FC]),Cr=FC(),sA=e=>{const{__scopeAlertDialog:t,...n}=e,a=Cr(t);return o.jsx(fx,{...a,...n,modal:!0})};sA.displayName=oA;var G7="AlertDialogTrigger",Y7=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(mx,{...r,...a,ref:t})});Y7.displayName=G7;var K7="AlertDialogPortal",iA=e=>{const{__scopeAlertDialog:t,...n}=e,a=Cr(t);return o.jsx(wx,{...a,...n})};iA.displayName=K7;var q7="AlertDialogOverlay",lA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Lc,{...r,...a,ref:t})});lA.displayName=q7;var Mi="AlertDialogContent",[X7,W7]=V7(Mi),Z7=F7("AlertDialogContent"),cA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...r}=e,s=Cr(n),i=d.useRef(null),l=Se(t,i),c=d.useRef(null);return o.jsx(I7,{contentName:Mi,titleName:uA,docsSlug:"alert-dialog",children:o.jsx(X7,{scope:n,cancelRef:c,children:o.jsxs(ki,{role:"alertdialog",...s,...r,ref:l,onOpenAutoFocus:ee(r.onOpenAutoFocus,u=>{var m;u.preventDefault(),(m=c.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx(Z7,{children:a}),o.jsx(J7,{contentRef:i})]})})})});cA.displayName=Mi;var uA="AlertDialogTitle",dA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Ic,{...r,...a,ref:t})});dA.displayName=uA;var fA="AlertDialogDescription",mA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx($c,{...r,...a,ref:t})});mA.displayName=fA;var Q7="AlertDialogAction",wA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Bc,{...r,...a,ref:t})});wA.displayName=Q7;var pA="AlertDialogCancel",hA=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:r}=W7(pA,n),s=Cr(n),i=Se(t,r);return o.jsx(Bc,{...s,...a,ref:i})});hA.displayName=pA;var J7=({contentRef:e})=>{const t=`\`${Mi}\` requires a description for the component to be accessible for screen reader users.460 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U7="DialogDescriptionWarning",H7=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rA(U7).contentName}}.`;return u.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},fx=VC,mx=YC,wx=qC,Lc=XC,ki=WC,Ic=QC,$c=eA,Bc=nA,F7=Symbol("radix.slottable");function V7(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=F7,t}var oA="AlertDialog",[G7]=Ht(oA,[FC]),Cr=FC(),sA=e=>{const{__scopeAlertDialog:t,...n}=e,a=Cr(t);return o.jsx(fx,{...a,...n,modal:!0})};sA.displayName=oA;var Y7="AlertDialogTrigger",K7=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(mx,{...r,...a,ref:t})});K7.displayName=Y7;var q7="AlertDialogPortal",iA=e=>{const{__scopeAlertDialog:t,...n}=e,a=Cr(t);return o.jsx(wx,{...a,...n})};iA.displayName=q7;var X7="AlertDialogOverlay",lA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Lc,{...r,...a,ref:t})});lA.displayName=X7;var Mi="AlertDialogContent",[W7,Z7]=G7(Mi),Q7=V7("AlertDialogContent"),cA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...r}=e,s=Cr(n),i=u.useRef(null),l=Se(t,i),c=u.useRef(null);return o.jsx($7,{contentName:Mi,titleName:uA,docsSlug:"alert-dialog",children:o.jsx(W7,{scope:n,cancelRef:c,children:o.jsxs(ki,{role:"alertdialog",...s,...r,ref:l,onOpenAutoFocus:ee(r.onOpenAutoFocus,d=>{var m;d.preventDefault(),(m=c.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(Q7,{children:a}),o.jsx(eI,{contentRef:i})]})})})});cA.displayName=Mi;var uA="AlertDialogTitle",dA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Ic,{...r,...a,ref:t})});dA.displayName=uA;var fA="AlertDialogDescription",mA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx($c,{...r,...a,ref:t})});mA.displayName=fA;var J7="AlertDialogAction",wA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,r=Cr(n);return o.jsx(Bc,{...r,...a,ref:t})});wA.displayName=J7;var pA="AlertDialogCancel",hA=u.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:r}=Z7(pA,n),s=Cr(n),i=Se(t,r);return o.jsx(Bc,{...s,...a,ref:i})});hA.displayName=pA;var eI=({contentRef:e})=>{const t=`\`${Mi}\` requires a description for the component to be accessible for screen reader users. 461 461 462 462 You can add a description to the \`${Mi}\` by passing a \`${fA}\` component as a child, which also benefits sighted users by adding visible context to the dialog. … … 464 464 Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Mi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 465 465 466 For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return d.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},eI=sA,tI=iA,gA=lA,xA=cA,bA=wA,vA=hA,yA=dA,SA=mA;const jA=eI,nI=tI,NA=d.forwardRef(({className:e,...t},n)=>o.jsx(gA,{className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/50",e),...t,ref:n}));NA.displayName=gA.displayName;const px=d.forwardRef(({className:e,...t},n)=>o.jsxs(nI,{children:[o.jsx(NA,{}),o.jsx(xA,{ref:n,className:E("tw:fixed tw:left-[50%] tw:top-[50%] tw:z-50 tw:grid tw:w-full tw:max-w-lg tw:translate-x-[-50%] tw:translate-y-[-50%] tw:gap-4 tw:border tw:border-gray-200 tw:bg-background tw:p-6 tw:shadow-xl tw:rounded-lg",e),...t})]}));px.displayName=xA.displayName;const hx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-2 tw:text-center tw:sm:text-left",e),...t});hx.displayName="AlertDialogHeader";const gx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col-reverse tw:sm:flex-row tw:sm:justify-end tw:sm:space-x-2",e),...t});gx.displayName="AlertDialogFooter";const xx=d.forwardRef(({className:e,...t},n)=>o.jsx(yA,{ref:n,className:E("tw:text-lg tw:font-semibold",e),...t}));xx.displayName=yA.displayName;const bx=d.forwardRef(({className:e,...t},n)=>o.jsx(SA,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));bx.displayName=SA.displayName;const CA=d.forwardRef(({className:e,...t},n)=>o.jsx(bA,{ref:n,className:E(gf(),e),...t}));CA.displayName=bA.displayName;const vx=d.forwardRef(({className:e,...t},n)=>o.jsx(vA,{ref:n,className:E(gf({variant:"outline"}),"tw:mt-2 tw:sm:mt-0",e),...t}));vx.displayName=vA.displayName;function aI(e,t=[]){let n=[];function a(s,i){const l=d.createContext(i);l.displayName=s+"Context";const c=n.length;n=[...n,i];const u=f=>{var h;const{scope:w,children:p,...x}=f,b=((h=w==null?void 0:w[e])==null?void 0:h[c])||l,y=d.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:y,children:p})};u.displayName=s+"Provider";function m(f,w){var b;const p=((b=w==null?void 0:w[e])==null?void 0:b[c])||l,x=d.useContext(p);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,m]}const r=()=>{const s=n.map(i=>d.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[a,rI(r,...t)]}function rI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=a.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var oI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yx=oI.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=d.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),AA={exports:{}},_A={};/**466 For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return u.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tI=sA,nI=iA,gA=lA,xA=cA,bA=wA,vA=hA,yA=dA,SA=mA;const jA=tI,aI=nI,NA=u.forwardRef(({className:e,...t},n)=>o.jsx(gA,{className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/50",e),...t,ref:n}));NA.displayName=gA.displayName;const px=u.forwardRef(({className:e,...t},n)=>o.jsxs(aI,{children:[o.jsx(NA,{}),o.jsx(xA,{ref:n,className:E("tw:fixed tw:left-[50%] tw:top-[50%] tw:z-50 tw:grid tw:w-full tw:max-w-lg tw:translate-x-[-50%] tw:translate-y-[-50%] tw:gap-4 tw:border tw:border-gray-200 tw:bg-background tw:p-6 tw:shadow-xl tw:rounded-lg",e),...t})]}));px.displayName=xA.displayName;const hx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-2 tw:text-center tw:sm:text-left",e),...t});hx.displayName="AlertDialogHeader";const gx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col-reverse tw:sm:flex-row tw:sm:justify-end tw:sm:space-x-2",e),...t});gx.displayName="AlertDialogFooter";const xx=u.forwardRef(({className:e,...t},n)=>o.jsx(yA,{ref:n,className:E("tw:text-lg tw:font-semibold",e),...t}));xx.displayName=yA.displayName;const bx=u.forwardRef(({className:e,...t},n)=>o.jsx(SA,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));bx.displayName=SA.displayName;const CA=u.forwardRef(({className:e,...t},n)=>o.jsx(bA,{ref:n,className:E(gf(),e),...t}));CA.displayName=bA.displayName;const vx=u.forwardRef(({className:e,...t},n)=>o.jsx(vA,{ref:n,className:E(gf({variant:"outline"}),"tw:mt-2 tw:sm:mt-0",e),...t}));vx.displayName=vA.displayName;function rI(e,t=[]){let n=[];function a(s,i){const l=u.createContext(i);l.displayName=s+"Context";const c=n.length;n=[...n,i];const d=f=>{var h;const{scope:w,children:p,...x}=f,b=((h=w==null?void 0:w[e])==null?void 0:h[c])||l,y=u.useMemo(()=>x,Object.values(x));return o.jsx(b.Provider,{value:y,children:p})};d.displayName=s+"Provider";function m(f,w){var b;const p=((b=w==null?void 0:w[e])==null?void 0:b[c])||l,x=u.useContext(p);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,m]}const r=()=>{const s=n.map(i=>u.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return u.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[a,oI(r,...t)]}function oI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=a.reduce((l,{useScope:c,scopeName:d})=>{const f=c(s)[`__scope${d}`];return{...l,...f}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var sI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yx=sI.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=u.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),AA={exports:{}},_A={};/** 467 467 * @license React 468 468 * use-sync-external-store-shim.production.js … … 472 472 * This source code is licensed under the MIT license found in the 473 473 * LICENSE file in the root directory of this source tree. 474 */var Di= d;function sI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iI=typeof Object.is=="function"?Object.is:sI,lI=Di.useState,cI=Di.useEffect,uI=Di.useLayoutEffect,dI=Di.useDebugValue;function fI(e,t){var n=t(),a=lI({inst:{value:n,getSnapshot:t}}),r=a[0].inst,s=a[1];return uI(function(){r.value=n,r.getSnapshot=t,Sx(r)&&s({inst:r})},[e,n,t]),cI(function(){return Sx(r)&&s({inst:r}),e(function(){Sx(r)&&s({inst:r})})},[e]),dI(n),n}function Sx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iI(e,n)}catch{return!0}}function mI(e,t){return t()}var wI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mI:fI;_A.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:wI,AA.exports=_A;var pI=AA.exports;function hI(){return pI.useSyncExternalStore(gI,()=>!0,()=>!1)}function gI(){return()=>{}}var jx="Avatar",[xI]=aI(jx),[bI,EA]=xI(jx),TA=d.forwardRef((e,t)=>{const{__scopeAvatar:n,...a}=e,[r,s]=d.useState("idle");return o.jsx(bI,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:o.jsx(yx.span,{...a,ref:t})})});TA.displayName=jx;var RA="AvatarImage",kA=d.forwardRef((e,t)=>{const{__scopeAvatar:n,src:a,onLoadingStatusChange:r=()=>{},...s}=e,i=EA(RA,n),l=vI(a,s),c=Ft(u=>{r(u),i.onImageLoadingStatusChange(u)});return jt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(yx.img,{...s,ref:t,src:a}):null});kA.displayName=RA;var MA="AvatarFallback",DA=d.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:a,...r}=e,s=EA(MA,n),[i,l]=d.useState(a===void 0);return d.useEffect(()=>{if(a!==void 0){const c=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(c)}},[a]),i&&s.imageLoadingStatus!=="loaded"?o.jsx(yx.span,{...r,ref:t}):null});DA.displayName=MA;function OA(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vI(e,{referrerPolicy:t,crossOrigin:n}){const a=hI(),r=d.useRef(null),s=a?(r.current||(r.current=new window.Image),r.current):null,[i,l]=d.useState(()=>OA(s,e));return jt(()=>{l(OA(s,e))},[s,e]),jt(()=>{const c=f=>()=>{l(f)};if(!s)return;const u=c("loaded"),m=c("error");return s.addEventListener("load",u),s.addEventListener("error",m),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",m)}},[s,n,t]),i}var PA=TA,zA=kA,LA=DA;const yI=d.forwardRef(({className:e,...t},n)=>o.jsx(PA,{ref:n,className:E("tw:relative tw:flex tw:h-10 tw:w-10 tw:shrink-0 tw:overflow-hidden tw:rounded-full",e),...t}));yI.displayName=PA.displayName;const SI=d.forwardRef(({className:e,...t},n)=>o.jsx(zA,{ref:n,className:E("tw:aspect-square tw:h-full tw:w-full",e),...t}));SI.displayName=zA.displayName;const jI=d.forwardRef(({className:e,...t},n)=>o.jsx(LA,{ref:n,className:E("tw:flex tw:h-full tw:w-full tw:items-center tw:justify-center tw:rounded-full tw:bg-muted",e),...t}));jI.displayName=LA.displayName;const NI=hi("tw:inline-flex tw:items-center tw:rounded-md tw:border tw:px-2.5 tw:py-0.5 tw:text-xs tw:font-semibold tw:transition-colors tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2",{variants:{variant:{default:"tw:border-transparent tw:bg-primary tw:text-primary-foreground tw:shadow tw:hover:bg-primary/80",secondary:"tw:border-transparent tw:bg-secondary tw:text-secondary-foreground tw:hover:bg-secondary/80",destructive:"tw:border-transparent tw:bg-destructive tw:text-destructive-foreground tw:shadow tw:hover:bg-destructive/80",outline:"tw:text-foreground"}},defaultVariants:{variant:"default"}});function Ar({className:e,variant:t,...n}){return o.jsx("div",{className:E(NI({variant:t}),e),...n})}const IA=d.forwardRef(({...e},t)=>o.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));IA.displayName="Breadcrumb";const $A=d.forwardRef(({className:e,...t},n)=>o.jsx("ol",{ref:n,className:E("tw:flex tw:flex-wrap tw:items-center tw:gap-1.5 tw:break-words tw:text-sm tw:text-muted-foreground tw:sm:gap-2.5",e),...t}));$A.displayName="BreadcrumbList";const BA=d.forwardRef(({className:e,...t},n)=>o.jsx("li",{ref:n,className:E("tw:inline-flex tw:items-center tw:gap-1.5",e),...t}));BA.displayName="BreadcrumbItem";const UA=d.forwardRef(({asChild:e,className:t,...n},a)=>{const r=e?Qo:"a";return o.jsx(r,{ref:a,className:E("tw:transition-colors tw:hover:text-foreground",t),...n})});UA.displayName="BreadcrumbLink";const HA=d.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:E("tw:font-normal tw:text-foreground",e),...t}));HA.displayName="BreadcrumbPage";const FA=({children:e,className:t,...n})=>o.jsx("li",{role:"presentation","aria-hidden":"true",className:E("tw:[&>svg]:w-3.5 tw:[&>svg]:h-3.5",t),...n,children:e??o.jsx(vc,{})});FA.displayName="BreadcrumbSeparator";var Wf="Checkbox",[CI]=Ht(Wf),[AI,Nx]=CI(Wf);function _I(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:r,disabled:s,form:i,name:l,onCheckedChange:c,required:u,value:m="on",internal_do_not_use_render:f}=e,[w,p]=Vn({prop:n,defaultProp:r??!1,onChange:c,caller:Wf}),[x,b]=d.useState(null),[y,h]=d.useState(null),g=d.useRef(!1),v=x?!!i||!!x.closest("form"):!0,S={checked:w,disabled:s,setChecked:p,control:x,setControl:b,name:l,form:i,value:m,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:xo(r)?!1:r,isFormControl:v,bubbleInput:y,setBubbleInput:h};return o.jsx(AI,{scope:t,...S,children:EI(f)?f(S):a})}var VA="CheckboxTrigger",GA=d.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},r)=>{const{control:s,value:i,disabled:l,checked:c,required:u,setControl:m,setChecked:f,hasConsumerStoppedPropagationRef:w,isFormControl:p,bubbleInput:x}=Nx(VA,e),b=Se(r,m),y=d.useRef(c);return d.useEffect(()=>{const h=s==null?void 0:s.form;if(h){const g=()=>f(y.current);return h.addEventListener("reset",g),()=>h.removeEventListener("reset",g)}},[s,f]),o.jsx(me.button,{type:"button",role:"checkbox","aria-checked":xo(c)?"mixed":c,"aria-required":u,"data-state":WA(c),"data-disabled":l?"":void 0,disabled:l,value:i,...a,ref:b,onKeyDown:ee(t,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:ee(n,h=>{f(g=>xo(g)?!0:!g),x&&p&&(w.current=h.isPropagationStopped(),w.current||h.stopPropagation())})})});GA.displayName=VA;var Cx=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:s,required:i,disabled:l,value:c,onCheckedChange:u,form:m,...f}=e;return o.jsx(_I,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:l,required:i,onCheckedChange:u,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(GA,{...f,ref:t,__scopeCheckbox:n}),w&&o.jsx(XA,{__scopeCheckbox:n})]})})});Cx.displayName=Wf;var YA="CheckboxIndicator",KA=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,s=Nx(YA,n);return o.jsx(Rt,{present:a||xo(s.checked)||s.checked===!0,children:o.jsx(me.span,{"data-state":WA(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});KA.displayName=YA;var qA="CheckboxBubbleInput",XA=d.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:i,required:l,disabled:c,name:u,value:m,form:f,bubbleInput:w,setBubbleInput:p}=Nx(qA,e),x=Se(n,p),b=kc(s),y=Tc(a);d.useEffect(()=>{const g=w;if(!g)return;const v=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(v,"checked").set,A=!r.current;if(b!==s&&N){const j=new Event("click",{bubbles:A});g.indeterminate=xo(s),N.call(g,xo(s)?!1:s),g.dispatchEvent(j)}},[w,b,s,r]);const h=d.useRef(xo(s)?!1:s);return o.jsx(me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??h.current,required:l,disabled:c,name:u,value:m,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});XA.displayName=qA;function EI(e){return typeof e=="function"}function xo(e){return e==="indeterminate"}function WA(e){return xo(e)?"indeterminate":e?"checked":"unchecked"}const Uc=d.forwardRef(({className:e,...t},n)=>o.jsx(Cx,{ref:n,className:E("tw:grid tw:place-content-center tw:peer tw:h-4 tw:w-4 tw:shrink-0 tw:rounded-sm tw:border tw:border-primary tw:shadow tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:data-[state=checked]:bg-primary tw:data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(KA,{className:E("tw:grid tw:place-content-center tw:text-current"),children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}));Uc.displayName=Cx.displayName;var Zf="Collapsible",[TI]=Ht(Zf),[RI,Ax]=TI(Zf),ZA=d.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:a,defaultOpen:r,disabled:s,onOpenChange:i,...l}=e,[c,u]=Vn({prop:a,defaultProp:r??!1,onChange:i,caller:Zf});return o.jsx(RI,{scope:n,disabled:s,contentId:Un(),open:c,onOpenToggle:d.useCallback(()=>u(m=>!m),[u]),children:o.jsx(me.div,{"data-state":Ex(c),"data-disabled":s?"":void 0,...l,ref:t})})});ZA.displayName=Zf;var QA="CollapsibleTrigger",JA=d.forwardRef((e,t)=>{const{__scopeCollapsible:n,...a}=e,r=Ax(QA,n);return o.jsx(me.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Ex(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:t,onClick:ee(e.onClick,r.onOpenToggle)})});JA.displayName=QA;var _x="CollapsibleContent",e_=d.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=Ax(_x,e.__scopeCollapsible);return o.jsx(Rt,{present:n||r.open,children:({present:s})=>o.jsx(kI,{...a,ref:t,present:s})})});e_.displayName=_x;var kI=d.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:a,children:r,...s}=e,i=Ax(_x,n),[l,c]=d.useState(a),u=d.useRef(null),m=Se(t,u),f=d.useRef(0),w=f.current,p=d.useRef(0),x=p.current,b=i.open||l,y=d.useRef(b),h=d.useRef(void 0);return d.useEffect(()=>{const g=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(g)},[]),jt(()=>{const g=u.current;if(g){h.current=h.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const v=g.getBoundingClientRect();f.current=v.height,p.current=v.width,y.current||(g.style.transitionDuration=h.current.transitionDuration,g.style.animationName=h.current.animationName),c(a)}},[i.open,a]),o.jsx(me.div,{"data-state":Ex(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...s,ref:m,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:b&&r})});function Ex(e){return e?"open":"closed"}var MI=ZA;const Tx=MI,Rx=JA,kx=e_,Qf=fx,DI=mx,t_=wx,OI=Bc,Mx=d.forwardRef(({className:e,...t},n)=>o.jsx(Lc,{ref:n,className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/50",e),...t}));Mx.displayName=Lc.displayName;const Jf=d.forwardRef(({className:e,children:t,disablePortal:n=!1,overlayClassName:a,closeClassName:r,...s},i)=>{const l=o.jsxs(o.Fragment,{children:[o.jsx(Mx,{className:a}),o.jsxs(ki,{ref:i,className:E("tw:fixed tw:left-[50%] tw:top-[50%] tw:z-50 tw:grid tw:w-full tw:max-w-lg tw:translate-x-[-50%] tw:translate-y-[-50%] tw:gap-4 tw:border tw:border-gray-200 tw:bg-background tw:p-6 tw:shadow-xl tw:rounded-lg",e),...s,children:[t,o.jsxs(Bc,{className:E("tw:absolute tw:right-4 tw:top-4 tw:rounded-sm tw:opacity-70 tw:ring-offset-background tw:transition-opacity tw:hover:opacity-100 tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2 tw:disabled:pointer-events-none tw:data-[state=open]:bg-accent tw:data-[state=open]:text-muted-foreground",r),children:[o.jsx(Eg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Close"})]})]})]});return n?l:o.jsx(t_,{children:l})});Jf.displayName=ki.displayName;const Dx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-1.5 tw:text-center tw:sm:text-left",e),...t});Dx.displayName="DialogHeader";const n_=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col-reverse tw:sm:flex-row tw:sm:justify-end tw:sm:space-x-2",e),...t});n_.displayName="DialogFooter";const Hc=d.forwardRef(({className:e,...t},n)=>o.jsx(Ic,{ref:n,className:E("tw:text-lg tw:font-semibold tw:leading-none tw:tracking-tight",e),...t}));Hc.displayName=Ic.displayName;const a_=d.forwardRef(({className:e,...t},n)=>o.jsx($c,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));a_.displayName=$c.displayName;var Ox="rovingFocusGroup.onEntryFocus",PI={bubbles:!1,cancelable:!0},Fc="RovingFocusGroup",[Px,r_,zI]=xf(Fc),[LI,Oi]=Ht(Fc,[zI]),[II,$I]=LI(Fc),o_=d.forwardRef((e,t)=>o.jsx(Px.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Px.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(BI,{...e,ref:t})})}));o_.displayName=Fc;var BI=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...f}=e,w=d.useRef(null),p=Se(t,w),x=es(s),[b,y]=Vn({prop:i,defaultProp:l??null,onChange:c,caller:Fc}),[h,g]=d.useState(!1),v=Ft(u),S=r_(n),N=d.useRef(!1),[A,j]=d.useState(0);return d.useEffect(()=>{const C=w.current;if(C)return C.addEventListener(Ox,v),()=>C.removeEventListener(Ox,v)},[v]),o.jsx(II,{scope:n,orientation:a,dir:x,loop:r,currentTabStopId:b,onItemFocus:d.useCallback(C=>y(C),[y]),onItemShiftTab:d.useCallback(()=>g(!0),[]),onFocusableItemAdd:d.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:d.useCallback(()=>j(C=>C-1),[]),children:o.jsx(me.div,{tabIndex:h||A===0?-1:0,"data-orientation":a,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{N.current=!0}),onFocus:ee(e.onFocus,C=>{const R=!N.current;if(C.target===C.currentTarget&&R&&!h){const M=new CustomEvent(Ox,PI);if(C.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=S().filter(T=>T.focusable),B=z.find(T=>T.active),I=z.find(T=>T.id===b),D=[B,I,...z].filter(Boolean).map(T=>T.ref.current);l_(D,m)}}N.current=!1}),onBlur:ee(e.onBlur,()=>g(!1))})})}),s_="RovingFocusGroupItem",i_=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:s,children:i,...l}=e,c=Un(),u=s||c,m=$I(s_,n),f=m.currentTabStopId===u,w=r_(n),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:b}=m;return d.useEffect(()=>{if(a)return p(),()=>x()},[a,p,x]),o.jsx(Px.ItemSlot,{scope:n,id:u,focusable:a,active:r,children:o.jsx(me.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:ee(e.onMouseDown,y=>{a?m.onItemFocus(u):y.preventDefault()}),onFocus:ee(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=FI(y,m.orientation,m.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let v=w().filter(S=>S.focusable).map(S=>S.ref.current);if(h==="last")v.reverse();else if(h==="prev"||h==="next"){h==="prev"&&v.reverse();const S=v.indexOf(y.currentTarget);v=m.loop?VI(v,S+1):v.slice(S+1)}setTimeout(()=>l_(v))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:b!=null}):i})})});i_.displayName=s_;var UI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function FI(e,t,n){const a=HI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return UI[a]}function l_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function VI(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var zx=o_,Lx=i_;function GI(e){const t=YI(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(qI);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function YI(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=WI(r),l=XI(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KI=Symbol("radix.slottable");function qI(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KI}function XI(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function WI(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ix=["Enter"," "],ZI=["ArrowDown","PageUp","Home"],c_=["ArrowUp","PageDown","End"],QI=[...ZI,...c_],JI={ltr:[...Ix,"ArrowRight"],rtl:[...Ix,"ArrowLeft"]},e9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vc="Menu",[Gc,t9,n9]=xf(Vc),[os,u_]=Ht(Vc,[n9,po,Oi]),em=po(),d_=Oi(),[a9,ss]=os(Vc),[r9,Yc]=os(Vc),f_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:s,modal:i=!0}=e,l=em(t),[c,u]=d.useState(null),m=d.useRef(!1),f=Ft(s),w=es(r);return d.useEffect(()=>{const p=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),o.jsx(Rf,{...l,children:o.jsx(a9,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(r9,{scope:t,onClose:d.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:w,modal:i,children:a})})})};f_.displayName=Vc;var o9="MenuAnchor",$x=d.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=em(n);return o.jsx(Rc,{...r,...a,ref:t})});$x.displayName=o9;var Bx="MenuPortal",[s9,m_]=os(Bx,{forceMount:void 0}),w_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,s=ss(Bx,t);return o.jsx(s9,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};w_.displayName=Bx;var ua="MenuContent",[i9,Ux]=os(ua),p_=d.forwardRef((e,t)=>{const n=m_(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,s=ss(ua,e.__scopeMenu),i=Yc(ua,e.__scopeMenu);return o.jsx(Gc.Provider,{scope:e.__scopeMenu,children:o.jsx(Rt,{present:a||s.open,children:o.jsx(Gc.Slot,{scope:e.__scopeMenu,children:i.modal?o.jsx(l9,{...r,ref:t}):o.jsx(c9,{...r,ref:t})})})})}),l9=d.forwardRef((e,t)=>{const n=ss(ua,e.__scopeMenu),a=d.useRef(null),r=Se(t,a);return d.useEffect(()=>{const s=a.current;if(s)return Pf(s)},[]),o.jsx(Hx,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),c9=d.forwardRef((e,t)=>{const n=ss(ua,e.__scopeMenu);return o.jsx(Hx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),u9=GI("MenuContent.ScrollLock"),Hx=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:w,onDismiss:p,disableOutsideScroll:x,...b}=e,y=ss(ua,n),h=Yc(ua,n),g=em(n),v=d_(n),S=t9(n),[N,A]=d.useState(null),j=d.useRef(null),C=Se(t,j,y.onContentChange),R=d.useRef(0),M=d.useRef(""),z=d.useRef(0),B=d.useRef(null),I=d.useRef("right"),V=d.useRef(0),D=x?Mc:d.Fragment,T=x?{as:u9,allowPinchZoom:!0}:void 0,O=$=>{var Y,Z;const H=M.current+$,F=S().filter(le=>!le.disabled),Q=document.activeElement,X=(Y=F.find(le=>le.ref.current===Q))==null?void 0:Y.textValue,P=F.map(le=>le.textValue),G=S9(P,H,X),ne=(Z=F.find(le=>le.textValue===G))==null?void 0:Z.ref.current;(function le(he){M.current=he,window.clearTimeout(R.current),he!==""&&(R.current=window.setTimeout(()=>le(""),1e3))})(H),ne&&setTimeout(()=>ne.focus())};d.useEffect(()=>()=>window.clearTimeout(R.current),[]),bf();const _=d.useCallback($=>{var F,Q;return I.current===((F=B.current)==null?void 0:F.side)&&N9($,(Q=B.current)==null?void 0:Q.area)},[]);return o.jsx(i9,{scope:n,searchRef:M,onItemEnter:d.useCallback($=>{_($)&&$.preventDefault()},[_]),onItemLeave:d.useCallback($=>{var H;_($)||((H=j.current)==null||H.focus(),A(null))},[_]),onTriggerLeave:d.useCallback($=>{_($)&&$.preventDefault()},[_]),pointerGraceTimerRef:z,onPointerGraceIntentChange:d.useCallback($=>{B.current=$},[]),children:o.jsx(D,{...T,children:o.jsx(Ac,{asChild:!0,trapped:r,onMountAutoFocus:ee(s,$=>{var H;$.preventDefault(),(H=j.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:w,onDismiss:p,children:o.jsx(zx,{asChild:!0,...v,dir:h.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:A,onEntryFocus:ee(c,$=>{h.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(kf,{role:"menu","aria-orientation":"vertical","data-state":M_(y.open),"data-radix-menu-content":"",dir:h.dir,...g,...b,ref:C,style:{outline:"none",...b.style},onKeyDown:ee(b.onKeyDown,$=>{const F=$.target.closest("[data-radix-menu-content]")===$.currentTarget,Q=$.ctrlKey||$.altKey||$.metaKey,X=$.key.length===1;F&&($.key==="Tab"&&$.preventDefault(),!Q&&X&&O($.key));const P=j.current;if($.target!==P||!QI.includes($.key))return;$.preventDefault();const ne=S().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);c_.includes($.key)&&ne.reverse(),v9(ne)}),onBlur:ee(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:ee(e.onPointerMove,qc($=>{const H=$.target,F=V.current!==$.clientX;if($.currentTarget.contains(H)&&F){const Q=$.clientX>V.current?"right":"left";I.current=Q,V.current=$.clientX}}))})})})})})})});p_.displayName=ua;var d9="MenuGroup",Fx=d.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{role:"group",...a,ref:t})});Fx.displayName=d9;var f9="MenuLabel",h_=d.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{...a,ref:t})});h_.displayName=f9;var tm="MenuItem",g_="menu.itemSelect",nm=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,s=d.useRef(null),i=Yc(tm,e.__scopeMenu),l=Ux(tm,e.__scopeMenu),c=Se(t,s),u=d.useRef(!1),m=()=>{const f=s.current;if(!n&&f){const w=new CustomEvent(g_,{bubbles:!0,cancelable:!0});f.addEventListener(g_,p=>a==null?void 0:a(p),{once:!0}),ZN(f,w),w.defaultPrevented?u.current=!1:i.onClose()}};return o.jsx(x_,{...r,ref:c,disabled:n,onClick:ee(e.onClick,m),onPointerDown:f=>{var w;(w=e.onPointerDown)==null||w.call(e,f),u.current=!0},onPointerUp:ee(e.onPointerUp,f=>{var w;u.current||(w=f.currentTarget)==null||w.click()}),onKeyDown:ee(e.onKeyDown,f=>{const w=l.searchRef.current!=="";n||w&&f.key===" "||Ix.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});nm.displayName=tm;var x_=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...s}=e,i=Ux(tm,n),l=d_(n),c=d.useRef(null),u=Se(t,c),[m,f]=d.useState(!1),[w,p]=d.useState("");return d.useEffect(()=>{const x=c.current;x&&p((x.textContent??"").trim())},[s.children]),o.jsx(Gc.ItemSlot,{scope:n,disabled:a,textValue:r??w,children:o.jsx(Lx,{asChild:!0,...l,focusable:!a,children:o.jsx(me.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:ee(e.onPointerMove,qc(x=>{a?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,qc(x=>i.onItemLeave(x))),onFocus:ee(e.onFocus,()=>f(!0)),onBlur:ee(e.onBlur,()=>f(!1))})})})}),m9="MenuCheckboxItem",b_=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return o.jsx(N_,{scope:e.__scopeMenu,checked:n,children:o.jsx(nm,{role:"menuitemcheckbox","aria-checked":am(n)?"mixed":n,...r,ref:t,"data-state":Gx(n),onSelect:ee(r.onSelect,()=>a==null?void 0:a(am(n)?!0:!n),{checkForDefaultPrevented:!1})})})});b_.displayName=m9;var v_="MenuRadioGroup",[w9,p9]=os(v_,{value:void 0,onValueChange:()=>{}}),y_=d.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,s=Ft(a);return o.jsx(w9,{scope:e.__scopeMenu,value:n,onValueChange:s,children:o.jsx(Fx,{...r,ref:t})})});y_.displayName=v_;var S_="MenuRadioItem",j_=d.forwardRef((e,t)=>{const{value:n,...a}=e,r=p9(S_,e.__scopeMenu),s=n===r.value;return o.jsx(N_,{scope:e.__scopeMenu,checked:s,children:o.jsx(nm,{role:"menuitemradio","aria-checked":s,...a,ref:t,"data-state":Gx(s),onSelect:ee(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});j_.displayName=S_;var Vx="MenuItemIndicator",[N_,h9]=os(Vx,{checked:!1}),C_=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,s=h9(Vx,n);return o.jsx(Rt,{present:a||am(s.checked)||s.checked===!0,children:o.jsx(me.span,{...r,ref:t,"data-state":Gx(s.checked)})})});C_.displayName=Vx;var g9="MenuSeparator",A_=d.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});A_.displayName=g9;var x9="MenuArrow",__=d.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=em(n);return o.jsx(Mf,{...r,...a,ref:t})});__.displayName=x9;var b9="MenuSub",[Bee,E_]=os(b9),Kc="MenuSubTrigger",T_=d.forwardRef((e,t)=>{const n=ss(Kc,e.__scopeMenu),a=Yc(Kc,e.__scopeMenu),r=E_(Kc,e.__scopeMenu),s=Ux(Kc,e.__scopeMenu),i=d.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},m=d.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return d.useEffect(()=>m,[m]),d.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),o.jsx($x,{asChild:!0,...u,children:o.jsx(x_,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":M_(n.open),...e,ref:Ia(t,r.onTriggerChange),onClick:f=>{var w;(w=e.onClick)==null||w.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(e.onPointerMove,qc(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:ee(e.onPointerLeave,qc(f=>{var p,x;m();const w=(p=n.content)==null?void 0:p.getBoundingClientRect();if(w){const b=(x=n.content)==null?void 0:x.dataset.side,y=b==="right",h=y?-5:5,g=w[y?"left":"right"],v=w[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+h,y:f.clientY},{x:g,y:w.top},{x:v,y:w.top},{x:v,y:w.bottom},{x:g,y:w.bottom}],side:b}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,f=>{var p;const w=s.searchRef.current!=="";e.disabled||w&&f.key===" "||JI[a.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});T_.displayName=Kc;var R_="MenuSubContent",k_=d.forwardRef((e,t)=>{const n=m_(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,s=ss(ua,e.__scopeMenu),i=Yc(ua,e.__scopeMenu),l=E_(R_,e.__scopeMenu),c=d.useRef(null),u=Se(t,c);return o.jsx(Gc.Provider,{scope:e.__scopeMenu,children:o.jsx(Rt,{present:a||s.open,children:o.jsx(Gc.Slot,{scope:e.__scopeMenu,children:o.jsx(Hx,{id:l.contentId,"aria-labelledby":l.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ee(e.onFocusOutside,m=>{m.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,m=>{i.onClose(),m.preventDefault()}),onKeyDown:ee(e.onKeyDown,m=>{var p;const f=m.currentTarget.contains(m.target),w=e9[i.dir].includes(m.key);f&&w&&(s.onOpenChange(!1),(p=l.trigger)==null||p.focus(),m.preventDefault())})})})})})});k_.displayName=R_;function M_(e){return e?"open":"closed"}function am(e){return e==="indeterminate"}function Gx(e){return am(e)?"indeterminate":e?"checked":"unchecked"}function v9(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function y9(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function S9(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=y9(e,Math.max(s,0));r.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function j9(e,t){const{x:n,y:a}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],u=l.x,m=l.y,f=c.x,w=c.y;m>a!=w>a&&n<(f-u)*(a-m)/(w-m)+u&&(r=!r)}return r}function N9(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return j9(n,t)}function qc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var C9=f_,A9=$x,_9=w_,E9=p_,T9=Fx,R9=h_,k9=nm,M9=b_,D9=y_,O9=j_,P9=C_,z9=A_,L9=__,I9=T_,$9=k_,rm="DropdownMenu",[B9]=Ht(rm,[u_]),mn=u_(),[U9,D_]=B9(rm),O_=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=mn(t),u=d.useRef(null),[m,f]=Vn({prop:r,defaultProp:s??!1,onChange:i,caller:rm});return o.jsx(U9,{scope:t,triggerId:Un(),triggerRef:u,contentId:Un(),open:m,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(w=>!w),[f]),modal:l,children:o.jsx(C9,{...c,open:m,onOpenChange:f,dir:a,modal:l,children:n})})};O_.displayName=rm;var P_="DropdownMenuTrigger",z_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,s=D_(P_,n),i=mn(n);return o.jsx(A9,{asChild:!0,...i,children:o.jsx(me.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:Ia(t,s.triggerRef),onPointerDown:ee(e.onPointerDown,l=>{!a&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:ee(e.onKeyDown,l=>{a||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});z_.displayName=P_;var H9="DropdownMenuPortal",L_=e=>{const{__scopeDropdownMenu:t,...n}=e,a=mn(t);return o.jsx(_9,{...a,...n})};L_.displayName=H9;var I_="DropdownMenuContent",$_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=D_(I_,n),s=mn(n),i=d.useRef(!1);return o.jsx(E9,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...a,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,l=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,m=c.button===2||u;(!r.modal||m)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$_.displayName=I_;var F9="DropdownMenuGroup",V9=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(T9,{...r,...a,ref:t})});V9.displayName=F9;var G9="DropdownMenuLabel",B_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(R9,{...r,...a,ref:t})});B_.displayName=G9;var Y9="DropdownMenuItem",U_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(k9,{...r,...a,ref:t})});U_.displayName=Y9;var K9="DropdownMenuCheckboxItem",H_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(M9,{...r,...a,ref:t})});H_.displayName=K9;var q9="DropdownMenuRadioGroup",F_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(D9,{...r,...a,ref:t})});F_.displayName=q9;var X9="DropdownMenuRadioItem",V_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(O9,{...r,...a,ref:t})});V_.displayName=X9;var W9="DropdownMenuItemIndicator",G_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(P9,{...r,...a,ref:t})});G_.displayName=W9;var Z9="DropdownMenuSeparator",Y_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(z9,{...r,...a,ref:t})});Y_.displayName=Z9;var Q9="DropdownMenuArrow",J9=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(L9,{...r,...a,ref:t})});J9.displayName=Q9;var e$="DropdownMenuSubTrigger",K_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(I9,{...r,...a,ref:t})});K_.displayName=e$;var t$="DropdownMenuSubContent",q_=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx($9,{...r,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q_.displayName=t$;var n$=O_,a$=z_,r$=L_,X_=$_,W_=B_,Z_=U_,Q_=H_,o$=F_,J_=V_,eE=G_,tE=Y_,nE=K_,aE=q_;const Yx=n$,Kx=a$,s$=o$,i$=d.forwardRef(({className:e,inset:t,children:n,...a},r)=>o.jsxs(nE,{ref:r,className:E("tw:flex tw:cursor-default tw:select-none tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-none tw:focus:bg-accent tw:data-[state=open]:bg-accent tw:[&_svg]:pointer-events-none tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",t&&"tw:pl-8",e),...a,children:[n,o.jsx(vc,{className:"tw:ml-auto"})]}));i$.displayName=nE.displayName;const l$=d.forwardRef(({className:e,...t},n)=>o.jsx(aE,{ref:n,className:E("tw:z-50 tw:min-w-[8rem] tw:overflow-hidden tw:rounded-md tw:border tw:bg-popover tw:p-1 tw:text-popover-foreground tw:shadow-lg tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));l$.displayName=aE.displayName;const om=d.forwardRef(({className:e,sideOffset:t=4,onCloseAutoFocus:n,...a},r)=>o.jsx(r$,{children:o.jsx(X_,{ref:r,sideOffset:t,onCloseAutoFocus:lx(n),className:E("tw:z-50 tw:max-h-[var(--radix-dropdown-menu-content-available-height)] tw:min-w-[8rem] tw:overflow-y-auto tw:overflow-x-hidden tw:rounded-md tw:border tw:bg-popover tw:p-1 tw:text-popover-foreground tw:shadow-md","tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));om.displayName=X_.displayName;const Pi=d.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(Z_,{ref:a,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",t&&"tw:pl-8",e),...n}));Pi.displayName=Z_.displayName;const c$=d.forwardRef(({className:e,children:t,checked:n,...a},r)=>o.jsxs(Q_,{ref:r,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-8 tw:pr-2 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),checked:n,...a,children:[o.jsx("span",{className:"tw:absolute tw:left-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(eE,{children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}),t]}));c$.displayName=Q_.displayName;const rE=d.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(J_,{ref:a,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-8 tw:pr-2 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"tw:absolute tw:left-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(eE,{children:o.jsx(wN,{className:"tw:h-2 tw:w-2 tw:fill-current"})})}),t]}));rE.displayName=J_.displayName;const u$=d.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(W_,{ref:a,className:E("tw:px-2 tw:py-1.5 tw:text-sm tw:font-semibold",t&&"tw:pl-8",e),...n}));u$.displayName=W_.displayName;const qx=d.forwardRef(({className:e,...t},n)=>o.jsx(tE,{ref:n,className:E("tw:-mx-1 tw:my-1 tw:h-px tw:bg-muted",e),...t}));qx.displayName=tE.displayName;var d$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f$=d$.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=d.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),m$="Label",oE=d.forwardRef((e,t)=>o.jsx(f$.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));oE.displayName=m$;var sE=oE;const w$=hi("tw:text-sm tw:font-medium tw:leading-none tw:peer-disabled:cursor-not-allowed tw:peer-disabled:opacity-70"),Re=d.forwardRef(({className:e,...t},n)=>o.jsx(sE,{ref:n,className:E(w$(),e),...t}));Re.displayName=sE.displayName;function p$(e){const t=h$(e),n=d.forwardRef((a,r)=>{const{children:s,...i}=a,l=d.Children.toArray(s),c=l.find(x$);if(c){const u=c.props.children,m=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...i,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function h$(e){const t=d.forwardRef((n,a)=>{const{children:r,...s}=n;if(d.isValidElement(r)){const i=v$(r),l=b$(s,r.props);return r.type!==d.Fragment&&(l.ref=a?Ia(a,i):i),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g$=Symbol("radix.slottable");function x$(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g$}function b$(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function v$(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sm="Popover",[iE]=Ht(sm,[po]),Xc=po(),[y$,bo]=iE(sm),lE=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,l=Xc(t),c=d.useRef(null),[u,m]=d.useState(!1),[f,w]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:sm});return o.jsx(Rf,{...l,children:o.jsx(y$,{scope:t,contentId:Un(),triggerRef:c,open:f,onOpenChange:w,onOpenToggle:d.useCallback(()=>w(p=>!p),[w]),hasCustomAnchor:u,onCustomAnchorAdd:d.useCallback(()=>m(!0),[]),onCustomAnchorRemove:d.useCallback(()=>m(!1),[]),modal:i,children:n})})};lE.displayName=sm;var cE="PopoverAnchor",S$=d.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(cE,n),s=Xc(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=r;return d.useEffect(()=>(i(),()=>l()),[i,l]),o.jsx(Rc,{...s,...a,ref:t})});S$.displayName=cE;var uE="PopoverTrigger",dE=d.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(uE,n),s=Xc(n),i=Se(t,r.triggerRef),l=o.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":hE(r.open),...a,ref:i,onClick:ee(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:o.jsx(Rc,{asChild:!0,...s,children:l})});dE.displayName=uE;var Xx="PopoverPortal",[j$,N$]=iE(Xx,{forceMount:void 0}),fE=e=>{const{__scopePopover:t,forceMount:n,children:a,container:r}=e,s=bo(Xx,t);return o.jsx(j$,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};fE.displayName=Xx;var zi="PopoverContent",mE=d.forwardRef((e,t)=>{const n=N$(zi,e.__scopePopover),{forceMount:a=n.forceMount,...r}=e,s=bo(zi,e.__scopePopover);return o.jsx(Rt,{present:a||s.open,children:s.modal?o.jsx(A$,{...r,ref:t}):o.jsx(_$,{...r,ref:t})})});mE.displayName=zi;var C$=p$("PopoverContent.RemoveScroll"),A$=d.forwardRef((e,t)=>{const n=bo(zi,e.__scopePopover),a=d.useRef(null),r=Se(t,a),s=d.useRef(!1);return d.useEffect(()=>{const i=a.current;if(i)return Pf(i)},[]),o.jsx(Mc,{as:C$,allowPinchZoom:!0,children:o.jsx(wE,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),_$=d.forwardRef((e,t)=>{const n=bo(zi,e.__scopePopover),a=d.useRef(!1),r=d.useRef(!1);return o.jsx(wE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),wE=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,...f}=e,w=bo(zi,n),p=Xc(n);return bf(),o.jsx(Ac,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>w.onOpenChange(!1),children:o.jsx(kf,{"data-state":hE(w.open),role:"dialog",id:w.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),pE="PopoverClose",E$=d.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(pE,n);return o.jsx(me.button,{type:"button",...a,ref:t,onClick:ee(e.onClick,()=>r.onOpenChange(!1))})});E$.displayName=pE;var T$="PopoverArrow",R$=d.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=Xc(n);return o.jsx(Mf,{...r,...a,ref:t})});R$.displayName=T$;function hE(e){return e?"open":"closed"}var k$=lE,M$=dE,D$=fE,gE=mE;const O$=k$,P$=M$,xE=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,disablePortal:a=!1,onCloseAutoFocus:r,...s},i)=>{const l=o.jsx(gE,{ref:i,align:t,sideOffset:n,onCloseAutoFocus:lx(r),className:E("tw:z-50 tw:w-72 tw:rounded-md tw:border tw:bg-popover tw:p-4 tw:text-popover-foreground tw:shadow-md tw:outline-none tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-popover-content-transform-origin]",e),...s});return a?l:o.jsx(D$,{children:l})});xE.displayName=gE.displayName;var Wx="Radio",[z$,bE]=Ht(Wx),[L$,I$]=z$(Wx),vE=d.forwardRef((e,t)=>{const{__scopeRadio:n,name:a,checked:r=!1,required:s,disabled:i,value:l="on",onCheck:c,form:u,...m}=e,[f,w]=d.useState(null),p=Se(t,y=>w(y)),x=d.useRef(!1),b=f?u||!!f.closest("form"):!0;return o.jsxs(L$,{scope:n,checked:r,disabled:i,children:[o.jsx(me.button,{type:"button",role:"radio","aria-checked":r,"data-state":NE(r),"data-disabled":i?"":void 0,disabled:i,value:l,...m,ref:p,onClick:ee(e.onClick,y=>{r||c==null||c(),b&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),b&&o.jsx(jE,{control:f,bubbles:!x.current,name:a,value:l,checked:r,required:s,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});vE.displayName=Wx;var yE="RadioIndicator",SE=d.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:a,...r}=e,s=I$(yE,n);return o.jsx(Rt,{present:a||s.checked,children:o.jsx(me.span,{"data-state":NE(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});SE.displayName=yE;var $$="RadioBubbleInput",jE=d.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:a=!0,...r},s)=>{const i=d.useRef(null),l=Se(i,s),c=kc(n),u=Tc(t);return d.useEffect(()=>{const m=i.current;if(!m)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:a});p.call(m,n),m.dispatchEvent(x)}},[c,n,a]),o.jsx(me.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});jE.displayName=$$;function NE(e){return e?"checked":"unchecked"}var B$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],im="RadioGroup",[U$]=Ht(im,[Oi,bE]),CE=Oi(),AE=bE(),[H$,F$]=U$(im),_E=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:a,defaultValue:r,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:m=!0,onValueChange:f,...w}=e,p=CE(n),x=es(u),[b,y]=Vn({prop:s,defaultProp:r??null,onChange:f,caller:im});return o.jsx(H$,{scope:n,name:a,required:i,disabled:l,value:b,onValueChange:y,children:o.jsx(zx,{asChild:!0,...p,orientation:c,dir:x,loop:m,children:o.jsx(me.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...w,ref:t})})})});_E.displayName=im;var EE="RadioGroupItem",TE=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:a,...r}=e,s=F$(EE,n),i=s.disabled||a,l=CE(n),c=AE(n),u=d.useRef(null),m=Se(t,u),f=s.value===r.value,w=d.useRef(!1);return d.useEffect(()=>{const p=b=>{B$.includes(b.key)&&(w.current=!0)},x=()=>w.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",x)}},[]),o.jsx(Lx,{asChild:!0,...l,focusable:!i,active:f,children:o.jsx(vE,{disabled:i,required:s.required,checked:f,...c,...r,name:s.name,ref:m,onCheck:()=>s.onValueChange(r.value),onKeyDown:ee(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ee(r.onFocus,()=>{var p;w.current&&((p=u.current)==null||p.click())})})})});TE.displayName=EE;var V$="RadioGroupIndicator",RE=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...a}=e,r=AE(n);return o.jsx(SE,{...r,...a,ref:t})});RE.displayName=V$;var kE=_E,lm=TE,G$=RE;const Zx=d.forwardRef(({className:e,...t},n)=>o.jsx(kE,{className:E("tw:grid tw:gap-2",e),...t,ref:n}));Zx.displayName=kE.displayName;const ME=d.forwardRef(({className:e,...t},n)=>o.jsx(lm,{ref:n,className:E("tw:aspect-square tw:h-4 tw:w-4 tw:rounded-full tw:border tw:border-primary tw:text-primary tw:shadow tw:focus:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50",e),...t,children:o.jsx(G$,{className:"tw:flex tw:items-center tw:justify-center",children:o.jsx(wN,{className:"tw:h-3.5 tw:w-3.5 tw:fill-primary"})})}));ME.displayName=lm.displayName;function Y$(e,t){return d.useReducer((n,a)=>t[n][a]??n,e)}var Qx="ScrollArea",[DE]=Ht(Qx),[K$,da]=DE(Qx),OE=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:r,scrollHideDelay:s=600,...i}=e,[l,c]=d.useState(null),[u,m]=d.useState(null),[f,w]=d.useState(null),[p,x]=d.useState(null),[b,y]=d.useState(null),[h,g]=d.useState(0),[v,S]=d.useState(0),[N,A]=d.useState(!1),[j,C]=d.useState(!1),R=Se(t,z=>c(z)),M=es(r);return o.jsx(K$,{scope:n,type:a,dir:M,scrollHideDelay:s,scrollArea:l,viewport:u,onViewportChange:m,content:f,onContentChange:w,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:A,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:j,onScrollbarYEnabledChange:C,onCornerWidthChange:g,onCornerHeightChange:S,children:o.jsx(me.div,{dir:M,...i,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});OE.displayName=Qx;var PE="ScrollAreaViewport",zE=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:r,...s}=e,i=da(PE,n),l=d.useRef(null),c=Se(t,l,i.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(me.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});zE.displayName=PE;var Ga="ScrollAreaScrollbar",Jx=d.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,l=e.orientation==="horizontal";return d.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),r.type==="hover"?o.jsx(q$,{...a,ref:t,forceMount:n}):r.type==="scroll"?o.jsx(X$,{...a,ref:t,forceMount:n}):r.type==="auto"?o.jsx(LE,{...a,ref:t,forceMount:n}):r.type==="always"?o.jsx(eb,{...a,ref:t}):null});Jx.displayName=Ga;var q$=d.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),[s,i]=d.useState(!1);return d.useEffect(()=>{const l=r.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),i(!0)},m=()=>{c=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",m)}}},[r.scrollArea,r.scrollHideDelay]),o.jsx(Rt,{present:n||s,children:o.jsx(LE,{"data-state":s?"visible":"hidden",...a,ref:t})})}),X$=d.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),s=e.orientation==="horizontal",i=fm(()=>c("SCROLL_END"),100),[l,c]=Y$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,r.scrollHideDelay,c]),d.useEffect(()=>{const u=r.viewport,m=s?"scrollLeft":"scrollTop";if(u){let f=u[m];const w=()=>{const p=u[m];f!==p&&(c("SCROLL"),i()),f=p};return u.addEventListener("scroll",w),()=>u.removeEventListener("scroll",w)}},[r.viewport,s,c,i]),o.jsx(Rt,{present:n||l!=="hidden",children:o.jsx(eb,{"data-state":l==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:ee(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ee(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),LE=d.forwardRef((e,t)=>{const n=da(Ga,e.__scopeScrollArea),{forceMount:a,...r}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",c=fm(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?u:m)}},10);return Li(n.viewport,c),Li(n.content,c),o.jsx(Rt,{present:a||s,children:o.jsx(eb,{"data-state":s?"visible":"hidden",...r,ref:t})})}),eb=d.forwardRef((e,t)=>{const{orientation:n="vertical",...a}=e,r=da(Ga,e.__scopeScrollArea),s=d.useRef(null),i=d.useRef(0),[l,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=HE(l.viewport,l.content),m={...a,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:w=>s.current=w,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:w=>i.current=w};function f(w,p){return tB(w,i.current,l,p)}return n==="horizontal"?o.jsx(W$,{...m,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const w=r.viewport.scrollLeft,p=FE(w,l,r.dir);s.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:w=>{r.viewport&&(r.viewport.scrollLeft=w)},onDragScroll:w=>{r.viewport&&(r.viewport.scrollLeft=f(w,r.dir))}}):n==="vertical"?o.jsx(Z$,{...m,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const w=r.viewport.scrollTop,p=FE(w,l);s.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:w=>{r.viewport&&(r.viewport.scrollTop=w)},onDragScroll:w=>{r.viewport&&(r.viewport.scrollTop=f(w))}}):null}),W$=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...r}=e,s=da(Ga,e.__scopeScrollArea),[i,l]=d.useState(),c=d.useRef(null),u=Se(t,c,s.onScrollbarXChange);return d.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx($E,{"data-orientation":"horizontal",...r,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dm(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,f)=>{if(s.viewport){const w=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(w),GE(w,f)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:um(i.paddingLeft),paddingEnd:um(i.paddingRight)}})}})}),Z$=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...r}=e,s=da(Ga,e.__scopeScrollArea),[i,l]=d.useState(),c=d.useRef(null),u=Se(t,c,s.onScrollbarYChange);return d.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx($E,{"data-orientation":"vertical",...r,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dm(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,f)=>{if(s.viewport){const w=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(w),GE(w,f)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:um(i.paddingTop),paddingEnd:um(i.paddingBottom)}})}})}),[Q$,IE]=DE(Ga),$E=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:m,onResize:f,...w}=e,p=da(Ga,n),[x,b]=d.useState(null),y=Se(t,R=>b(R)),h=d.useRef(null),g=d.useRef(""),v=p.viewport,S=a.content-a.viewport,N=Ft(m),A=Ft(c),j=fm(f,10);function C(R){if(h.current){const M=R.clientX-h.current.left,z=R.clientY-h.current.top;u({x:M,y:z})}}return d.useEffect(()=>{const R=M=>{const z=M.target;(x==null?void 0:x.contains(z))&&N(M,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[v,x,S,N]),d.useEffect(A,[a,A]),Li(x,j),Li(p.content,j),o.jsx(Q$,{scope:n,scrollbar:x,hasThumb:r,onThumbChange:Ft(s),onThumbPointerUp:Ft(i),onThumbPositionChange:A,onThumbPointerDown:Ft(l),children:o.jsx(me.div,{...w,ref:y,style:{position:"absolute",...w.style},onPointerDown:ee(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),h.current=x.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(R))}),onPointerMove:ee(e.onPointerMove,C),onPointerUp:ee(e.onPointerUp,R=>{const M=R.target;M.hasPointerCapture(R.pointerId)&&M.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=g.current,p.viewport&&(p.viewport.style.scrollBehavior=""),h.current=null})})})}),cm="ScrollAreaThumb",BE=d.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=IE(cm,e.__scopeScrollArea);return o.jsx(Rt,{present:n||r.hasThumb,children:o.jsx(J$,{ref:t,...a})})}),J$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...r}=e,s=da(cm,n),i=IE(cm,n),{onThumbPositionChange:l}=i,c=Se(t,f=>i.onThumbChange(f)),u=d.useRef(void 0),m=fm(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const f=s.viewport;if(f){const w=()=>{if(m(),!u.current){const p=nB(f,l);u.current=p,l()}};return l(),f.addEventListener("scroll",w),()=>f.removeEventListener("scroll",w)}},[s.viewport,m,l]),o.jsx(me.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:ee(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),x=f.clientX-p.left,b=f.clientY-p.top;i.onThumbPointerDown({x,y:b})}),onPointerUp:ee(e.onPointerUp,i.onThumbPointerUp)})});BE.displayName=cm;var tb="ScrollAreaCorner",UE=d.forwardRef((e,t)=>{const n=da(tb,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?o.jsx(eB,{...e,ref:t}):null});UE.displayName=tb;var eB=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,r=da(tb,n),[s,i]=d.useState(0),[l,c]=d.useState(0),u=!!(s&&l);return Li(r.scrollbarX,()=>{var f;const m=((f=r.scrollbarX)==null?void 0:f.offsetHeight)||0;r.onCornerHeightChange(m),c(m)}),Li(r.scrollbarY,()=>{var f;const m=((f=r.scrollbarY)==null?void 0:f.offsetWidth)||0;r.onCornerWidthChange(m),i(m)}),u?o.jsx(me.div,{...a,ref:t,style:{width:s,height:l,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function um(e){return e?parseInt(e,10):0}function HE(e,t){const n=e/t;return isNaN(n)?0:n}function dm(e){const t=HE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function tB(e,t,n,a="ltr"){const r=dm(n),s=r/2,i=t||s,l=r-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,f=a==="ltr"?[0,m]:[m*-1,0];return VE([c,u],f)(e)}function FE(e,t,n="ltr"){const a=dm(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,i=t.content-t.viewport,l=s-a,c=n==="ltr"?[0,i]:[i*-1,0],u=Cc(e,c);return VE([0,i],[0,l])(u)}function VE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function GE(e,t){return e>0&&e<t}var nB=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function r(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,a=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(a)};function fm(e,t){const n=Ft(e),a=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(a.current),[]),d.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Li(e,t){const n=Ft(t);jt(()=>{let a=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(a),r.unobserve(e)}}},[e,n])}var YE=OE,aB=zE,rB=UE;const oB=d.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(YE,{ref:a,className:E("tw:relative tw:overflow-hidden",e),...n,children:[o.jsx(aB,{className:"tw:h-full tw:w-full tw:rounded-[inherit]",children:t}),o.jsx(KE,{}),o.jsx(rB,{})]}));oB.displayName=YE.displayName;const KE=d.forwardRef(({className:e,orientation:t="vertical",...n},a)=>o.jsx(Jx,{ref:a,orientation:t,className:E("tw:flex tw:touch-none tw:select-none tw:transition-colors",t==="vertical"&&"tw:h-full tw:w-2.5 tw:border-l tw:border-l-transparent tw:p-[1px]",t==="horizontal"&&"tw:h-2.5 tw:flex-col tw:border-t tw:border-t-transparent tw:p-[1px]",e),...n,children:o.jsx(BE,{className:"tw:relative tw:flex-1 tw:rounded-full tw:bg-border"})}));KE.displayName=Jx.displayName;var sB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],iB=sB.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=d.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),lB="Separator",qE="horizontal",cB=["horizontal","vertical"],XE=d.forwardRef((e,t)=>{const{decorative:n,orientation:a=qE,...r}=e,s=uB(a)?a:qE,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(iB.div,{"data-orientation":s,...l,...r,ref:t})});XE.displayName=lB;function uB(e){return cB.includes(e)}var WE=XE;const mm=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},r)=>o.jsx(WE,{ref:r,decorative:n,orientation:t,className:E("tw:shrink-0 tw:bg-border",t==="horizontal"?"tw:h-[1px] tw:w-full":"tw:h-full tw:w-[1px]",e),...a}));mm.displayName=WE.displayName;const Wc=fx,dB=mx,fB=wx,ZE=d.forwardRef(({className:e,...t},n)=>o.jsx(Lc,{className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/80 tw: tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0",e),...t,ref:n}));ZE.displayName=Lc.displayName;const mB=hi("tw:fixed tw:z-50 tw:gap-4 tw:bg-background tw:p-6 tw:shadow-lg tw:transition tw:ease-in-out tw:data-[state=closed]:duration-300 tw:data-[state=open]:duration-500 tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards",{variants:{side:{top:"tw:inset-x-0 tw:top-0 tw:border-b tw:data-[state=closed]:slide-out-to-top tw:data-[state=open]:slide-in-from-top",bottom:"tw:inset-x-0 tw:bottom-0 tw:border-t tw:data-[state=closed]:slide-out-to-bottom tw:data-[state=open]:slide-in-from-bottom",left:"tw:inset-y-0 tw:left-0 tw:h-full tw:w-3/4 tw:border-r tw:data-[state=closed]:slide-out-to-left tw:data-[state=open]:slide-in-from-left tw:sm:max-w-sm",right:"tw:inset-y-0 tw:right-0 tw:h-full tw:w-3/4 tw:border-l tw:data-[state=closed]:slide-out-to-right tw:data-[state=open]:slide-in-from-right tw:sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ii=d.forwardRef(({side:e="right",className:t,children:n,overlayClassName:a,closeClassName:r,...s},i)=>o.jsxs(fB,{children:[o.jsx(ZE,{className:a}),o.jsxs(ki,{ref:i,className:E(mB({side:e}),t),...s,children:[o.jsxs(Bc,{className:E("tw:absolute tw:right-4 tw:top-4 tw:rounded-sm tw:opacity-70 tw:ring-offset-background tw:transition-opacity tw:hover:opacity-100 tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2 tw:disabled:pointer-events-none tw:data-[state=open]:bg-secondary",r),children:[o.jsx(Eg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Close"})]}),n]})]}));Ii.displayName=ki.displayName;const QE=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-2 tw:text-center tw:sm:text-left",e),...t});QE.displayName="SheetHeader";const $i=d.forwardRef(({className:e,...t},n)=>o.jsx(Ic,{ref:n,className:E("tw:text-lg tw:font-semibold tw:text-foreground",e),...t}));$i.displayName=Ic.displayName;const Zc=d.forwardRef(({className:e,...t},n)=>o.jsx($c,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));Zc.displayName=$c.displayName;const nb=768;function wB(){const[e,t]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${nb-1}px)`),a=()=>{t(window.innerWidth<nb)};return n.addEventListener("change",a),t(window.innerWidth<nb),()=>n.removeEventListener("change",a)},[]),!!e}function bt({className:e,...t}){return o.jsx("div",{className:E("psfa-skeleton tw:rounded-md",e),...t})}var pB=Symbol("radix.slottable");function hB(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=pB,t}var[wm]=Ht("Tooltip",[po]),pm=po(),JE="TooltipProvider",gB=700,ab="tooltip.open",[xB,rb]=wm(JE),eT=e=>{const{__scopeTooltip:t,delayDuration:n=gB,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:s}=e,i=d.useRef(!0),l=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(xB,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:l,onPointerInTransitChange:d.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})};eT.displayName=JE;var Qc="Tooltip",[bB,Jc]=wm(Qc),tT=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=e,c=rb(Qc,e.__scopeTooltip),u=pm(t),[m,f]=d.useState(null),w=Un(),p=d.useRef(0),x=i??c.disableHoverableContent,b=l??c.delayDuration,y=d.useRef(!1),[h,g]=Vn({prop:a,defaultProp:r??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(ab))):c.onClose(),s==null||s(j)},caller:Qc}),v=d.useMemo(()=>h?y.current?"delayed-open":"instant-open":"closed",[h]),S=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,g(!0)},[g]),N=d.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),A=d.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,g(!0),p.current=0},b)},[b,g]);return d.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),o.jsx(Rf,{...u,children:o.jsx(bB,{scope:t,contentId:w,open:h,stateAttribute:v,trigger:m,onTriggerChange:f,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?A():S()},[c.isOpenDelayedRef,A,S]),onTriggerLeave:d.useCallback(()=>{x?N():(window.clearTimeout(p.current),p.current=0)},[N,x]),onOpen:S,onClose:N,disableHoverableContent:x,children:n})})};tT.displayName=Qc;var ob="TooltipTrigger",nT=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Jc(ob,n),s=rb(ob,n),i=pm(n),l=d.useRef(null),c=Se(t,l,r.onTriggerChange),u=d.useRef(!1),m=d.useRef(!1),f=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(Rc,{asChild:!0,...i,children:o.jsx(me.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:ee(e.onPointerMove,w=>{w.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),m.current=!0)}),onPointerLeave:ee(e.onPointerLeave,()=>{r.onTriggerLeave(),m.current=!1}),onPointerDown:ee(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ee(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:ee(e.onBlur,r.onClose),onClick:ee(e.onClick,r.onClose)})})});nT.displayName=ob;var sb="TooltipPortal",[vB,yB]=wm(sb,{forceMount:void 0}),aT=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,s=Jc(sb,t);return o.jsx(vB,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};aT.displayName=sb;var Bi="TooltipContent",rT=d.forwardRef((e,t)=>{const n=yB(Bi,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...s}=e,i=Jc(Bi,e.__scopeTooltip);return o.jsx(Rt,{present:a||i.open,children:i.disableHoverableContent?o.jsx(oT,{side:r,...s,ref:t}):o.jsx(SB,{side:r,...s,ref:t})})}),SB=d.forwardRef((e,t)=>{const n=Jc(Bi,e.__scopeTooltip),a=rb(Bi,e.__scopeTooltip),r=d.useRef(null),s=Se(t,r),[i,l]=d.useState(null),{trigger:c,onClose:u}=n,m=r.current,{onPointerInTransitChange:f}=a,w=d.useCallback(()=>{l(null),f(!1)},[f]),p=d.useCallback((x,b)=>{const y=x.currentTarget,h={x:x.clientX,y:x.clientY},g=_B(h,y.getBoundingClientRect()),v=EB(h,g),S=TB(b.getBoundingClientRect()),N=kB([...v,...S]);l(N),f(!0)},[f]);return d.useEffect(()=>()=>w(),[w]),d.useEffect(()=>{if(c&&m){const x=y=>p(y,m),b=y=>p(y,c);return c.addEventListener("pointerleave",x),m.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",b)}}},[c,m,p,w]),d.useEffect(()=>{if(i){const x=b=>{const y=b.target,h={x:b.clientX,y:b.clientY},g=(c==null?void 0:c.contains(y))||(m==null?void 0:m.contains(y)),v=!RB(h,i);g?w():v&&(w(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,m,i,u,w]),o.jsx(oT,{...e,ref:s})}),[jB,NB]=wm(Qc,{isInside:!1}),CB=hB("TooltipContent"),oT=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=Jc(Bi,n),u=pm(n),{onClose:m}=c;return d.useEffect(()=>(document.addEventListener(ab,m),()=>document.removeEventListener(ab,m)),[m]),d.useEffect(()=>{if(c.trigger){const f=w=>{const p=w.target;p!=null&&p.contains(c.trigger)&&m()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,m]),o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:m,children:o.jsxs(kf,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(CB,{children:a}),o.jsx(jB,{scope:n,isInside:!0,children:o.jsx(eL,{id:c.contentId,role:"tooltip",children:r||a})})]})})});rT.displayName=Bi;var sT="TooltipArrow",AB=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=pm(n);return NB(sT,n).isInside?null:o.jsx(Mf,{...r,...a,ref:t})});AB.displayName=sT;function _B(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,r,s)){case s:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function EB(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function TB(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function RB(e,t){const{x:n,y:a}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],u=l.x,m=l.y,f=c.x,w=c.y;m>a!=w>a&&n<(f-u)*(a-m)/(w-m)+u&&(r=!r)}return r}function kB(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),MB(t)}function MB(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var DB=eT,OB=tT,PB=nT,zB=aT,iT=rT;const Ui=DB,eu=OB,tu=PB,Hi=d.forwardRef(({className:e,sideOffset:t=4,...n},a)=>o.jsx(zB,{children:o.jsx(iT,{ref:a,sideOffset:t,className:E("tw:z-50 tw:overflow-hidden tw:rounded-md tw:bg-primary tw:px-3 tw:py-1.5 tw:text-xs tw:text-primary-foreground tw:animate-in tw:fade-in-0 tw:zoom-in-95 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:zoom-out-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-tooltip-content-transform-origin]",e),...n})}));Hi.displayName=iT.displayName;const LB="sidebar_state",IB=60*60*24*7,$B="16rem",BB="18rem",UB="3rem",HB="b",lT=d.createContext(null);function hm(){const e=d.useContext(lT);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const FB=d.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:a,style:r,children:s,...i},l)=>{const c=wB(),[u,m]=d.useState(!1),[f,w]=d.useState(e),p=t??f,x=d.useCallback(g=>{const v=typeof g=="function"?g(p):g;n?n(v):w(v),document.cookie=`${LB}=${v}; path=/; max-age=${IB}`},[n,p]),b=d.useCallback(()=>c?m(g=>!g):x(g=>!g),[c,x,m]);d.useEffect(()=>{const g=v=>{v.key===HB&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),b())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[b]);const y=p?"expanded":"collapsed",h=d.useMemo(()=>({state:y,open:p,setOpen:x,isMobile:c,openMobile:u,setOpenMobile:m,toggleSidebar:b}),[y,p,x,c,u,m,b]);return o.jsx(lT.Provider,{value:h,children:o.jsx(Ui,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":$B,"--sidebar-width-icon":UB,...r},className:E("tw:group/sidebar-wrapper tw:flex tw:min-h-svh tw:h-full tw:w-full tw:has-[[data-variant=inset]]:bg-sidebar",a),ref:l,...i,children:s})})})});FB.displayName="SidebarProvider";const VB=d.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:a,children:r,...s},i)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:m}=hm();return n==="none"?o.jsx("div",{className:E("tw:flex tw:h-full tw:min-h-full tw:w-[var(--sidebar-width)] tw:flex-col tw:bg-sidebar tw:text-sidebar-foreground",a),ref:i,...s,children:r}):l?o.jsx(Wc,{open:u,onOpenChange:m,...s,children:o.jsxs(Ii,{"data-sidebar":"sidebar","data-mobile":"true",className:"tw:w-[var(--sidebar-width)] tw:bg-sidebar tw:p-0 tw:text-sidebar-foreground tw:[&>button]:hidden",style:{"--sidebar-width":BB},side:e,children:[o.jsxs(QE,{className:"tw:sr-only",children:[o.jsx($i,{children:"Sidebar"}),o.jsx(Zc,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"tw:flex tw:h-full tw:w-full tw:flex-col",children:r})]})}):o.jsxs("div",{ref:i,className:"tw:group tw:peer tw:hidden tw:text-sidebar-foreground tw:md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:E("tw:relative tw:w-[var(--sidebar-width)] tw:bg-transparent tw:transition-[width] tw:duration-200 tw:ease-linear","tw:group-data-[collapsible=offcanvas]:w-0","tw:group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"tw:group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),o.jsx("div",{className:E("tw:fixed tw:inset-y-0 tw:z-10 tw:hidden tw:h-svh tw:w-[var(--sidebar-width)] tw:transition-[width] tw:duration-200 tw:ease-linear tw:md:flex",e==="left"?"tw:left-0 tw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"tw:right-0 tw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"tw:p-2 tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"tw:group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] tw:group-data-[side=left]:border-r tw:group-data-[side=right]:border-l",a),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"tw:flex tw:h-full tw:w-full tw:flex-col tw:bg-sidebar tw:group-data-[variant=floating]:rounded-lg tw:group-data-[variant=floating]:border tw:group-data-[variant=floating]:border-sidebar-border tw:group-data-[variant=floating]:shadow",children:r})})]})});VB.displayName="Sidebar";const GB=d.forwardRef(({className:e,onClick:t,...n},a)=>{const{toggleSidebar:r}=hm();return o.jsxs(Ae,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:E("tw:h-7 tw:w-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(bN,{}),o.jsx("span",{className:"tw:sr-only",children:"Toggle Sidebar"})]})});GB.displayName="SidebarTrigger";const YB=d.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:a}=hm();return o.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:E("tw:absolute tw:inset-y-0 tw:z-20 tw:hidden tw:w-4 tw:-translate-x-1/2 tw:transition-all tw:ease-linear tw:after:absolute tw:after:inset-y-0 tw:after:left-1/2 tw:after:w-[2px] tw:hover:after:bg-sidebar-border tw:group-data-[side=left]:-right-4 tw:group-data-[side=right]:left-0 tw:sm:flex","tw:[[data-side=left]_&]:cursor-w-resize tw:[[data-side=right]_&]:cursor-e-resize","tw:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize tw:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize","tw:group-data-[collapsible=offcanvas]:translate-x-0 tw:group-data-[collapsible=offcanvas]:after:left-full tw:group-data-[collapsible=offcanvas]:hover:bg-sidebar","tw:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","tw:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});YB.displayName="SidebarRail";const KB=d.forwardRef(({className:e,...t},n)=>o.jsx("main",{ref:n,className:E("tw:relative tw:flex tw:w-full tw:flex-1 tw:flex-col tw:bg-background","tw:md:peer-data-[variant=inset]:m-2 tw:md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 tw:md:peer-data-[variant=inset]:ml-0 tw:md:peer-data-[variant=inset]:rounded-xl tw:md:peer-data-[variant=inset]:shadow",e),...t}));KB.displayName="SidebarInset";const qB=d.forwardRef(({className:e,...t},n)=>o.jsx(pt,{ref:n,"data-sidebar":"input",className:E("tw:h-8 tw:w-full tw:bg-background tw:shadow-none tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",e),...t}));qB.displayName="SidebarInput";const XB=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"header",className:E("tw:flex tw:flex-col tw:gap-2 tw:p-2",e),...t}));XB.displayName="SidebarHeader";const WB=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"footer",className:E("tw:flex tw:flex-col tw:gap-2 tw:p-2",e),...t}));WB.displayName="SidebarFooter";const ZB=d.forwardRef(({className:e,...t},n)=>o.jsx(mm,{ref:n,"data-sidebar":"separator",className:E("tw:mx-2 tw:w-auto tw:bg-sidebar-border",e),...t}));ZB.displayName="SidebarSeparator";const QB=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"content",className:E("tw:flex tw:min-h-0 tw:flex-1 tw:flex-col tw:gap-2 tw:overflow-auto tw:group-data-[collapsible=icon]:overflow-hidden",e),...t}));QB.displayName="SidebarContent";const JB=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"group",className:E("tw:relative tw:flex tw:w-full tw:min-w-0 tw:flex-col tw:p-2",e),...t}));JB.displayName="SidebarGroup";const eU=d.forwardRef(({className:e,asChild:t=!1,...n},a)=>{const r=t?Qo:"div";return o.jsx(r,{ref:a,"data-sidebar":"group-label",className:E("tw:flex tw:h-8 tw:shrink-0 tw:items-center tw:rounded-md tw:px-2 tw:text-xs tw:font-medium tw:text-sidebar-foreground/70 tw:outline-none tw:ring-sidebar-ring tw:transition-[margin,opacity] tw:duration-200 tw:ease-linear tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:group-data-[collapsible=icon]:-mt-8 tw:group-data-[collapsible=icon]:opacity-0",e),...n})});eU.displayName="SidebarGroupLabel";const tU=d.forwardRef(({className:e,asChild:t=!1,...n},a)=>{const r=t?Qo:"button";return o.jsx(r,{ref:a,"data-sidebar":"group-action",className:E("tw:absolute tw:right-3 tw:top-3.5 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:transition-transform tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:after:absolute tw:after:-inset-2 tw:after:md:hidden","tw:group-data-[collapsible=icon]:hidden",e),...n})});tU.displayName="SidebarGroupAction";const nU=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"group-content",className:E("tw:w-full tw:text-sm",e),...t}));nU.displayName="SidebarGroupContent";const aU=d.forwardRef(({className:e,...t},n)=>o.jsx("ul",{ref:n,"data-sidebar":"menu",className:E("tw:flex tw:w-full tw:min-w-0 tw:flex-col tw:gap-1",e),...t}));aU.displayName="SidebarMenu";const rU=d.forwardRef(({className:e,...t},n)=>o.jsx("li",{ref:n,"data-sidebar":"menu-item",className:E("tw:group/menu-item tw:relative",e),...t}));rU.displayName="SidebarMenuItem";const oU=hi("tw:peer/menu-button tw:flex tw:w-full tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:p-2 tw:text-left tw:text-sm tw:outline-none tw:ring-sidebar-ring tw:transition-[width,height,padding] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:font-medium tw:data-[active=true]:text-sidebar-accent-foreground tw:data-[state=open]:hover:bg-sidebar-accent tw:data-[state=open]:hover:text-sidebar-accent-foreground tw:group-data-[collapsible=icon]:!size-8 tw:group-data-[collapsible=icon]:!p-2 tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",{variants:{variant:{default:"tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground",outline:"tw:bg-background tw:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"tw:h-8 tw:text-sm",sm:"tw:h-7 tw:text-xs",lg:"tw:h-12 tw:text-sm tw:group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),sU=d.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:a="default",tooltip:r,className:s,...i},l)=>{const c=e?Qo:"button",{isMobile:u,state:m}=hm(),f=o.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":a,"data-active":t,className:E(oU({variant:n,size:a}),s),...i});return r?(typeof r=="string"&&(r={children:r}),o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:f}),o.jsx(Hi,{side:"right",align:"center",hidden:m!=="collapsed"||u,...r})]})):f});sU.displayName="SidebarMenuButton";const iU=d.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...a},r)=>{const s=t?Qo:"button";return o.jsx(s,{ref:r,"data-sidebar":"menu-action",className:E("tw:absolute tw:right-1 tw:top-1.5 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:transition-transform tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:after:absolute tw:after:-inset-2 tw:after:md:hidden","tw:peer-data-[size=sm]/menu-button:top-1","tw:peer-data-[size=default]/menu-button:top-1.5","tw:peer-data-[size=lg]/menu-button:top-2.5","tw:group-data-[collapsible=icon]:hidden",n&&"tw:group-focus-within/menu-item:opacity-100 tw:group-hover/menu-item:opacity-100 tw:data-[state=open]:opacity-100 tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground tw:md:opacity-0",e),...a})});iU.displayName="SidebarMenuAction";const lU=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:E("tw:pointer-events-none tw:absolute tw:right-1 tw:flex tw:h-5 tw:min-w-5 tw:select-none tw:items-center tw:justify-center tw:rounded-md tw:px-1 tw:text-xs tw:font-medium tw:tabular-nums tw:text-sidebar-foreground","tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","tw:peer-data-[size=sm]/menu-button:top-1","tw:peer-data-[size=default]/menu-button:top-1.5","tw:peer-data-[size=lg]/menu-button:top-2.5","tw:group-data-[collapsible=icon]:hidden",e),...t}));lU.displayName="SidebarMenuBadge";const cU=d.forwardRef(({className:e,showIcon:t=!1,...n},a)=>{const r=d.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:E("tw:flex tw:h-8 tw:items-center tw:gap-2 tw:rounded-md tw:px-2",e),...n,children:[t&&o.jsx(bt,{className:"tw:size-4 tw:rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(bt,{className:"tw:h-4 tw:max-w-[--skeleton-width] tw:flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});cU.displayName="SidebarMenuSkeleton";const uU=d.forwardRef(({className:e,...t},n)=>o.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:E("tw:mx-3.5 tw:flex tw:min-w-0 tw:translate-x-px tw:flex-col tw:gap-1 tw:border-l tw:border-sidebar-border tw:px-2.5 tw:py-0.5","tw:group-data-[collapsible=icon]:hidden",e),...t}));uU.displayName="SidebarMenuSub";const dU=d.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));dU.displayName="SidebarMenuSubItem";const fU=d.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:a,...r},s)=>{const i=e?Qo:"a";return o.jsx(i,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:E("tw:flex tw:h-7 tw:min-w-0 tw:-translate-x-px tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:px-2 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0 tw:[&>svg]:text-sidebar-accent-foreground","tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"tw:text-xs",t==="md"&&"tw:text-sm","tw:group-data-[collapsible=icon]:hidden",a),...r})});fU.displayName="SidebarMenuSubButton";var cT=["PageUp","PageDown"],uT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Fi="Slider",[ib,mU,wU]=xf(Fi),[fT]=Ht(Fi,[wU]),[pU,gm]=fT(Fi),mT=d.forwardRef((e,t)=>{const{name:n,min:a=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[a],value:m,onValueChange:f=()=>{},onValueCommit:w=()=>{},inverted:p=!1,form:x,...b}=e,y=d.useRef(new Set),h=d.useRef(0),v=i==="horizontal"?hU:gU,[S=[],N]=Vn({prop:m,defaultProp:u,onChange:z=>{var I;(I=[...y.current][h.current])==null||I.focus(),f(z)}}),A=d.useRef(S);function j(z){const B=SU(S,z);M(z,B)}function C(z){M(z,h.current)}function R(){const z=A.current[h.current];S[h.current]!==z&&w(S)}function M(z,B,{commit:I}={commit:!1}){const V=AU(s),D=_U(Math.round((z-a)/s)*s+a,V),T=Cc(D,[a,r]);N((O=[])=>{const _=vU(O,T,B);if(CU(_,c*s)){h.current=_.indexOf(T);const $=String(_)!==String(O);return $&&I&&w(_),$?_:O}else return O})}return o.jsx(pU,{scope:e.__scopeSlider,name:n,disabled:l,min:a,max:r,valueIndexToChangeRef:h,thumbs:y.current,values:S,orientation:i,form:x,children:o.jsx(ib.Provider,{scope:e.__scopeSlider,children:o.jsx(ib.Slot,{scope:e.__scopeSlider,children:o.jsx(v,{"aria-disabled":l,"data-disabled":l?"":void 0,...b,ref:t,onPointerDown:ee(b.onPointerDown,()=>{l||(A.current=S)}),min:a,max:r,inverted:p,onSlideStart:l?void 0:j,onSlideMove:l?void 0:C,onSlideEnd:l?void 0:R,onHomeKeyDown:()=>!l&&M(a,0,{commit:!0}),onEndKeyDown:()=>!l&&M(r,S.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:B})=>{if(!l){const D=cT.includes(z.key)||z.shiftKey&&uT.includes(z.key)?10:1,T=h.current,O=S[T],_=s*D*B;M(O+_,T,{commit:!0})}}})})})})});mT.displayName=Fi;var[wT,pT]=fT(Fi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),hU=d.forwardRef((e,t)=>{const{min:n,max:a,dir:r,inverted:s,onSlideStart:i,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...m}=e,[f,w]=d.useState(null),p=Se(t,v=>w(v)),x=d.useRef(void 0),b=es(r),y=b==="ltr",h=y&&!s||!y&&s;function g(v){const S=x.current||f.getBoundingClientRect(),N=[0,S.width],j=ub(N,h?[n,a]:[a,n]);return x.current=S,j(v-S.left)}return o.jsx(wT,{scope:e.__scopeSlider,startEdge:h?"left":"right",endEdge:h?"right":"left",direction:h?1:-1,size:"width",children:o.jsx(hT,{dir:b,"data-orientation":"horizontal",...m,ref:p,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const S=g(v.clientX);i==null||i(S)},onSlideMove:v=>{const S=g(v.clientX);l==null||l(S)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:v=>{const N=dT[h?"from-left":"from-right"].includes(v.key);u==null||u({event:v,direction:N?-1:1})}})})}),gU=d.forwardRef((e,t)=>{const{min:n,max:a,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:l,onStepKeyDown:c,...u}=e,m=d.useRef(null),f=Se(t,m),w=d.useRef(void 0),p=!r;function x(b){const y=w.current||m.current.getBoundingClientRect(),h=[0,y.height],v=ub(h,p?[a,n]:[n,a]);return w.current=y,v(b-y.top)}return o.jsx(wT,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:o.jsx(hT,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=x(b.clientY);s==null||s(y)},onSlideMove:b=>{const y=x(b.clientY);i==null||i(y)},onSlideEnd:()=>{w.current=void 0,l==null||l()},onStepKeyDown:b=>{const h=dT[p?"from-bottom":"from-top"].includes(b.key);c==null||c({event:b,direction:h?-1:1})}})})}),hT=d.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:c,...u}=e,m=gm(Fi,n);return o.jsx(me.span,{...u,ref:t,onKeyDown:ee(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):cT.concat(uT).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:ee(e.onPointerDown,f=>{const w=f.target;w.setPointerCapture(f.pointerId),f.preventDefault(),m.thumbs.has(w)?w.focus():a(f)}),onPointerMove:ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&r(f)}),onPointerUp:ee(e.onPointerUp,f=>{const w=f.target;w.hasPointerCapture(f.pointerId)&&(w.releasePointerCapture(f.pointerId),s(f))})})}),gT="SliderTrack",xT=d.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,r=gm(gT,n);return o.jsx(me.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...a,ref:t})});xT.displayName=gT;var lb="SliderRange",bT=d.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,r=gm(lb,n),s=pT(lb,n),i=d.useRef(null),l=Se(t,i),c=r.values.length,u=r.values.map(w=>ST(w,r.min,r.max)),m=c>1?Math.min(...u):0,f=100-Math.max(...u);return o.jsx(me.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:l,style:{...e.style,[s.startEdge]:m+"%",[s.endEdge]:f+"%"}})});bT.displayName=lb;var cb="SliderThumb",vT=d.forwardRef((e,t)=>{const n=mU(e.__scopeSlider),[a,r]=d.useState(null),s=Se(t,l=>r(l)),i=d.useMemo(()=>a?n().findIndex(l=>l.ref.current===a):-1,[n,a]);return o.jsx(xU,{...e,ref:s,index:i})}),xU=d.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:r,...s}=e,i=gm(cb,n),l=pT(cb,n),[c,u]=d.useState(null),m=Se(t,g=>u(g)),f=c?i.form||!!c.closest("form"):!0,w=Tc(c),p=i.values[a],x=p===void 0?0:ST(p,i.min,i.max),b=yU(a,i.values.length),y=w==null?void 0:w[l.size],h=y?jU(y,x,l.direction):0;return d.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${h}px)`},children:[o.jsx(ib.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(me.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:p===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{i.valueIndexToChangeRef.current=a})})}),f&&o.jsx(yT,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:p},a)]})});vT.displayName=cb;var bU="RadioBubbleInput",yT=d.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const r=d.useRef(null),s=Se(r,a),i=kc(t);return d.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&m){const f=new Event("input",{bubbles:!0});m.call(l,t),l.dispatchEvent(f)}},[i,t]),o.jsx(me.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});yT.displayName=bU;function vU(e=[],t,n){const a=[...e];return a[n]=t,a.sort((r,s)=>r-s)}function ST(e,t,n){const s=100/(n-t)*(e-t);return Cc(s,[0,100])}function yU(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function SU(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),a=Math.min(...n);return n.indexOf(a)}function jU(e,t,n){const a=e/2,s=ub([0,50],[0,a]);return(a-s(t)*n)*n}function NU(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function CU(e,t){if(t>0){const n=NU(e);return Math.min(...n)>=t}return!0}function ub(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function AU(e){return(String(e).split(".")[1]||"").length}function _U(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var jT=mT,EU=xT,TU=bT,RU=vT;const Vi=d.forwardRef(({className:e,thumbLabels:t,formatValueText:n,...a},r)=>{const s=a.value??a.defaultValue??[0];return o.jsxs(jT,{ref:r,className:E("tw:relative tw:flex tw:w-full tw:touch-none tw:select-none tw:items-center tw:group",e),...a,children:[o.jsx(EU,{className:"tw:relative tw:h-1.5 tw:w-full tw:grow tw:overflow-hidden tw:rounded-full tw:bg-primary/20 tw:dark:bg-primary/30 tw:data-[disabled]:bg-gray-200 tw:dark:data-[disabled]:bg-gray-700",children:o.jsx(TU,{className:"tw:absolute tw:h-full tw:bg-primary tw:data-[disabled]:bg-gray-300 tw:dark:data-[disabled]:bg-gray-600"})}),s.map((i,l)=>o.jsx(RU,{"aria-label":t==null?void 0:t[l],"aria-valuetext":n?n(i):void 0,className:"tw:block tw:h-4 tw:w-4 tw:rounded-full tw:border tw:border-primary/50 tw:bg-background tw:shadow tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[disabled]:border-gray-300 tw:dark:data-[disabled]:border-gray-600"},l))]})});Vi.displayName=jT.displayName;function kU(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const MU=e=>{switch(e){case"success":return PU;case"info":return LU;case"warning":return zU;case"error":return IU;default:return null}},DU=Array(12).fill(0),OU=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},DU.map((n,a)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),PU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),LU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),IU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),$U=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BU=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let db=1;class UU{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:a,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:db++,i=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:a}),{...c,...t,id:s,dismissible:l,title:a}):c):this.addToast({title:a,...r,dismissible:l,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let s=a!==void 0,i;const l=r.then(async u=>{if(i=["resolve",u],J.isValidElement(u))s=!1,this.create({id:a,type:"default",message:u});else if(FU(u)&&!u.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,w=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"error",description:w,...x})}else if(u instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(u):n.error,w=typeof n.description=="function"?await n.description(u):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"error",description:w,...x})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(u):n.success,w=typeof n.description=="function"?await n.description(u):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"success",description:w,...x})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const m=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,p=typeof m=="object"&&!J.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:f,...p})}}).finally(()=>{s&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,m)=>l.then(()=>i[0]==="reject"?m(i[1]):u(i[1])).catch(m));return typeof a!="string"&&typeof a!="number"?{unwrap:c}:Object.assign(a,{unwrap:c})},this.custom=(t,n)=>{const a=(n==null?void 0:n.id)||db++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Nn=new UU,HU=(e,t)=>{const n=(t==null?void 0:t.id)||db++;return Nn.addToast({title:e,...t,id:n}),n},FU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VU=HU,GU=()=>Nn.toasts,YU=()=>Nn.getActiveToasts(),_e=Object.assign(VU,{success:Nn.success,info:Nn.info,warning:Nn.warning,error:Nn.error,custom:Nn.custom,message:Nn.message,promise:Nn.promise,dismiss:Nn.dismiss,loading:Nn.loading},{getHistory:GU,getToasts:YU});kU("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function xm(e){return e.label!==void 0}const KU=3,qU="24px",XU="16px",NT=4e3,WU=356,ZU=14,QU=45,JU=200;function Ya(...e){return e.filter(Boolean).join(" ")}function eH(e){const[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}const tH=e=>{var t,n,a,r,s,i,l,c,u;const{invert:m,toast:f,unstyled:w,interacting:p,setHeights:x,visibleToasts:b,heights:y,index:h,toasts:g,expanded:v,removeToast:S,defaultRichColors:N,closeButton:A,style:j,cancelButtonStyle:C,actionButtonStyle:R,className:M="",descriptionClassName:z="",duration:B,position:I,gap:V,expandByDefault:D,classNames:T,icons:O,closeButtonAriaLabel:_="Close toast"}=e,[$,H]=J.useState(null),[F,Q]=J.useState(null),[X,P]=J.useState(!1),[G,ne]=J.useState(!1),[Y,Z]=J.useState(!1),[le,he]=J.useState(!1),[ae,K]=J.useState(!1),[ge,Ne]=J.useState(0),[We,Ke]=J.useState(0),at=J.useRef(f.duration||B||NT),Kt=J.useRef(null),He=J.useRef(null),qt=h===0,Cn=h+1<=b,mt=f.type,Xt=f.dismissible!==!1,an=f.className||"",wn=f.descriptionClassName||"",An=J.useMemo(()=>y.findIndex(re=>re.toastId===f.id)||0,[y,f.id]),qn=J.useMemo(()=>{var re;return(re=f.closeButton)!=null?re:A},[f.closeButton,A]),oe=J.useMemo(()=>f.duration||B||NT,[f.duration,B]),ye=J.useRef(0),we=J.useRef(0),Ve=J.useRef(0),ze=J.useRef(null),[Wt,Ge]=I.split("-"),Ea=J.useMemo(()=>y.reduce((re,Je,dt)=>dt>=An?re:re+Je.height,0),[y,An]),pa=BU(),Xn=f.invert||m,Ta=mt==="loading";we.current=J.useMemo(()=>An*V+Ea,[An,Ea]),J.useEffect(()=>{at.current=oe},[oe]),J.useEffect(()=>{P(!0)},[]),J.useEffect(()=>{const re=He.current;if(re){const Je=re.getBoundingClientRect().height;return Ke(Je),x(dt=>[{toastId:f.id,height:Je,position:f.position},...dt]),()=>x(dt=>dt.filter(kt=>kt.toastId!==f.id))}},[x,f.id]),J.useLayoutEffect(()=>{if(!X)return;const re=He.current,Je=re.style.height;re.style.height="auto";const dt=re.getBoundingClientRect().height;re.style.height=Je,Ke(dt),x(kt=>kt.find(Mt=>Mt.toastId===f.id)?kt.map(Mt=>Mt.toastId===f.id?{...Mt,height:dt}:Mt):[{toastId:f.id,height:dt,position:f.position},...kt])},[X,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const rn=J.useCallback(()=>{ne(!0),Ne(we.current),x(re=>re.filter(Je=>Je.toastId!==f.id)),setTimeout(()=>{S(f)},JU)},[f,S,x,we]);J.useEffect(()=>{if(f.promise&&mt==="loading"||f.duration===1/0||f.type==="loading")return;let re;return v||p||pa?(()=>{if(Ve.current<ye.current){const kt=new Date().getTime()-ye.current;at.current=at.current-kt}Ve.current=new Date().getTime()})():(()=>{at.current!==1/0&&(ye.current=new Date().getTime(),re=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),rn()},at.current))})(),()=>clearTimeout(re)},[v,p,f,mt,pa,rn]),J.useEffect(()=>{f.delete&&(rn(),f.onDismiss==null||f.onDismiss.call(f,f))},[rn,f.delete]);function Za(){var re;if(O!=null&&O.loading){var Je;return J.createElement("div",{className:Ya(T==null?void 0:T.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":mt==="loading"},O.loading)}return J.createElement(OU,{className:Ya(T==null?void 0:T.loader,f==null||(re=f.classNames)==null?void 0:re.loader),visible:mt==="loading"})}const ie=f.icon||(O==null?void 0:O[mt])||MU(mt);var Ee,$e;return J.createElement("li",{tabIndex:0,ref:He,className:Ya(M,an,T==null?void 0:T.toast,f==null||(t=f.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[mt],f==null||(n=f.classNames)==null?void 0:n[mt]),"data-sonner-toast":"","data-rich-colors":(Ee=f.richColors)!=null?Ee:N,"data-styled":!(f.jsx||f.unstyled||w),"data-mounted":X,"data-promise":!!f.promise,"data-swiped":ae,"data-removed":G,"data-visible":Cn,"data-y-position":Wt,"data-x-position":Ge,"data-index":h,"data-front":qt,"data-swiping":Y,"data-dismissible":Xt,"data-type":mt,"data-invert":Xn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(v||D&&X),"data-testid":f.testId,style:{"--index":h,"--toasts-before":h,"--z-index":g.length-h,"--offset":`${G?ge:we.current}px`,"--initial-height":D?"auto":`${We}px`,...j,...f.style},onDragEnd:()=>{Z(!1),H(null),ze.current=null},onPointerDown:re=>{re.button!==2&&(Ta||!Xt||(Kt.current=new Date,Ne(we.current),re.target.setPointerCapture(re.pointerId),re.target.tagName!=="BUTTON"&&(Z(!0),ze.current={x:re.clientX,y:re.clientY})))},onPointerUp:()=>{var re,Je,dt;if(le||!Xt)return;ze.current=null;const kt=Number(((re=He.current)==null?void 0:re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Mr=Number(((Je=He.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Mt=new Date().getTime()-((dt=Kt.current)==null?void 0:dt.getTime()),_n=$==="x"?kt:Mr,ol=Math.abs(_n)/Mt;if(Math.abs(_n)>=QU||ol>.11){Ne(we.current),f.onDismiss==null||f.onDismiss.call(f,f),Q($==="x"?kt>0?"right":"left":Mr>0?"down":"up"),rn(),he(!0);return}else{var k,L;(k=He.current)==null||k.style.setProperty("--swipe-amount-x","0px"),(L=He.current)==null||L.style.setProperty("--swipe-amount-y","0px")}K(!1),Z(!1),H(null)},onPointerMove:re=>{var Je,dt,kt;if(!ze.current||!Xt||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const Mt=re.clientY-ze.current.y,_n=re.clientX-ze.current.x;var ol;const k=(ol=e.swipeDirections)!=null?ol:eH(I);!$&&(Math.abs(_n)>1||Math.abs(Mt)>1)&&H(Math.abs(_n)>Math.abs(Mt)?"x":"y");let L={x:0,y:0};const U=W=>1/(1.5+Math.abs(W)/20);if($==="y"){if(k.includes("top")||k.includes("bottom"))if(k.includes("top")&&Mt<0||k.includes("bottom")&&Mt>0)L.y=Mt;else{const W=Mt*U(Mt);L.y=Math.abs(W)<Math.abs(Mt)?W:Mt}}else if($==="x"&&(k.includes("left")||k.includes("right")))if(k.includes("left")&&_n<0||k.includes("right")&&_n>0)L.x=_n;else{const W=_n*U(_n);L.x=Math.abs(W)<Math.abs(_n)?W:_n}(Math.abs(L.x)>0||Math.abs(L.y)>0)&&K(!0),(dt=He.current)==null||dt.style.setProperty("--swipe-amount-x",`${L.x}px`),(kt=He.current)==null||kt.style.setProperty("--swipe-amount-y",`${L.y}px`)}},qn&&!f.jsx&&mt!=="loading"?J.createElement("button",{"aria-label":_,"data-disabled":Ta,"data-close-button":!0,onClick:Ta||!Xt?()=>{}:()=>{rn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ya(T==null?void 0:T.closeButton,f==null||(a=f.classNames)==null?void 0:a.closeButton)},($e=O==null?void 0:O.close)!=null?$e:$U):null,(mt||f.icon||f.promise)&&f.icon!==null&&((O==null?void 0:O[mt])!==null||f.icon)?J.createElement("div",{"data-icon":"",className:Ya(T==null?void 0:T.icon,f==null||(r=f.classNames)==null?void 0:r.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Za():null,f.type!=="loading"?ie:null):null,J.createElement("div",{"data-content":"",className:Ya(T==null?void 0:T.content,f==null||(s=f.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:Ya(T==null?void 0:T.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?J.createElement("div",{"data-description":"",className:Ya(z,wn,T==null?void 0:T.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),J.isValidElement(f.cancel)?f.cancel:f.cancel&&xm(f.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||C,onClick:re=>{xm(f.cancel)&&Xt&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,re),rn())},className:Ya(T==null?void 0:T.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,J.isValidElement(f.action)?f.action:f.action&&xm(f.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:re=>{xm(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,re),!re.defaultPrevented&&rn())},className:Ya(T==null?void 0:T.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function CT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function nH(e,t){const n={};return[e,t].forEach((a,r)=>{const s=r===1,i=s?"--mobile-offset":"--offset",l=s?XU:qU;function c(u){["top","right","bottom","left"].forEach(m=>{n[`${i}-${m}`]=typeof u=="number"?`${u}px`:u})}typeof a=="number"||typeof a=="string"?c(a):typeof a=="object"?["top","right","bottom","left"].forEach(u=>{a[u]===void 0?n[`${i}-${u}`]=l:n[`${i}-${u}`]=typeof a[u]=="number"?`${a[u]}px`:a[u]}):c(l)}),n}const aH=J.forwardRef(function(t,n){const{id:a,invert:r,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:m,mobileOffset:f,theme:w="light",richColors:p,duration:x,style:b,visibleToasts:y=KU,toastOptions:h,dir:g=CT(),gap:v=ZU,icons:S,containerAriaLabel:N="Notifications"}=t,[A,j]=J.useState([]),C=J.useMemo(()=>a?A.filter(X=>X.toasterId===a):A.filter(X=>!X.toasterId),[A,a]),R=J.useMemo(()=>Array.from(new Set([s].concat(C.filter(X=>X.position).map(X=>X.position)))),[C,s]),[M,z]=J.useState([]),[B,I]=J.useState(!1),[V,D]=J.useState(!1),[T,O]=J.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=J.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=J.useRef(null),F=J.useRef(!1),Q=J.useCallback(X=>{j(P=>{var G;return(G=P.find(ne=>ne.id===X.id))!=null&&G.delete||Nn.dismiss(X.id),P.filter(({id:ne})=>ne!==X.id)})},[]);return J.useEffect(()=>Nn.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{j(P=>P.map(G=>G.id===X.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Yv.flushSync(()=>{j(P=>{const G=P.findIndex(ne=>ne.id===X.id);return G!==-1?[...P.slice(0,G),{...P[G],...X},...P.slice(G+1)]:[X,...P]})})})}),[A]),J.useEffect(()=>{if(w!=="system"){O(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:P})=>{O(P?"dark":"light")})}catch{X.addListener(({matches:G})=>{try{O(G?"dark":"light")}catch(ne){console.error(ne)}})}},[w]),J.useEffect(()=>{A.length<=1&&I(!1)},[A]),J.useEffect(()=>{const X=P=>{var G;if(i.every(Z=>P[Z]||P.code===Z)){var Y;I(!0),(Y=_.current)==null||Y.focus()}P.code==="Escape"&&(document.activeElement===_.current||(G=_.current)!=null&&G.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[i]),J.useEffect(()=>{if(_.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,F.current=!1)}},[_.current]),J.createElement("section",{ref:n,"aria-label":`${N} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((X,P)=>{var G;const[ne,Y]=X.split("-");return C.length?J.createElement("ol",{key:X,dir:g==="auto"?CT():g,tabIndex:-1,ref:_,className:u,"data-sonner-toaster":!0,"data-sonner-theme":T,"data-y-position":ne,"data-x-position":Y,style:{"--front-toast-height":`${((G=M[0])==null?void 0:G.height)||0}px`,"--width":`${WU}px`,"--gap":`${v}px`,...b,...nH(m,f)},onBlur:Z=>{F.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(F.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||F.current||(F.current=!0,H.current=Z.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{V||I(!1)},onDragEnd:()=>I(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},C.filter(Z=>!Z.position&&P===0||Z.position===X).map((Z,le)=>{var he,ae;return J.createElement(tH,{key:Z.id,icons:S,index:le,toast:Z,defaultRichColors:p,duration:(he=h==null?void 0:h.duration)!=null?he:x,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:r,visibleToasts:y,closeButton:(ae=h==null?void 0:h.closeButton)!=null?ae:c,interacting:V,position:X,style:h==null?void 0:h.style,unstyled:h==null?void 0:h.unstyled,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,closeButtonAriaLabel:h==null?void 0:h.closeButtonAriaLabel,removeToast:Q,toasts:C.filter(K=>K.position==Z.position),heights:M.filter(K=>K.position==Z.position),setHeights:z,expandByDefault:l,gap:v,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),rH=({...e})=>o.jsx(aH,{theme:"light",position:"bottom-right",className:"tw:toaster tw:group",toastOptions:{classNames:{toast:"tw:group tw:toast tw:bg-zinc-900 tw:text-white tw:border-zinc-700 tw:shadow-lg tw:rounded-lg tw:border tw:p-4",description:"tw:text-zinc-300 tw:font-mono tw:text-xs tw:bg-zinc-800 tw:px-2 tw:py-1.5 tw:rounded tw:mt-2 tw:block",actionButton:"tw:bg-primary tw:text-primary-foreground tw:rounded-md tw:px-3 tw:py-1.5 tw:text-sm tw:font-medium hover:tw:bg-primary/90",cancelButton:"tw:bg-zinc-700 tw:text-zinc-200 tw:rounded-md tw:px-3 tw:py-1.5 tw:text-sm",error:"tw:border-red-500 tw:bg-red-900"}},...e});var bm="Switch",[oH]=Ht(bm),[sH,iH]=oH(bm),AT=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:r,defaultChecked:s,required:i,disabled:l,value:c="on",onCheckedChange:u,form:m,...f}=e,[w,p]=d.useState(null),x=Se(t,v=>p(v)),b=d.useRef(!1),y=w?m||!!w.closest("form"):!0,[h,g]=Vn({prop:r,defaultProp:s??!1,onChange:u,caller:bm});return o.jsxs(sH,{scope:n,checked:h,disabled:l,children:[o.jsx(me.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":RT(h),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:ee(e.onClick,v=>{g(S=>!S),y&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),y&&o.jsx(TT,{control:w,bubbles:!b.current,name:a,value:c,checked:h,required:i,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});AT.displayName=bm;var _T="SwitchThumb",ET=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,r=iH(_T,n);return o.jsx(me.span,{"data-state":RT(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:t})});ET.displayName=_T;var lH="SwitchBubbleInput",TT=d.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...r},s)=>{const i=d.useRef(null),l=Se(i,s),c=kc(n),u=Tc(t);return d.useEffect(()=>{const m=i.current;if(!m)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:a});p.call(m,n),m.dispatchEvent(x)}},[c,n,a]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});TT.displayName=lH;function RT(e){return e?"checked":"unchecked"}var kT=AT,cH=ET;const _r=d.forwardRef(({className:e,...t},n)=>o.jsx(kT,{className:E("tw:peer tw:inline-flex tw:h-5 tw:w-9 tw:shrink-0 tw:cursor-pointer tw:items-center tw:rounded-full tw:border-2 tw:border-transparent tw:shadow-sm tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-background tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:data-[state=checked]:bg-primary tw:data-[state=unchecked]:bg-input",e),...t,ref:n,children:o.jsx(cH,{className:E("tw:pointer-events-none tw:block tw:h-4 tw:w-4 tw:rounded-full tw:bg-background tw:shadow-lg tw:ring-0 tw:transition-transform tw:data-[state=checked]:translate-x-4 tw:data-[state=unchecked]:translate-x-0")})}));_r.displayName=kT.displayName;var vm="Tabs",[uH]=Ht(vm,[Oi]),MT=Oi(),[dH,fb]=uH(vm),DT=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,m=es(l),[f,w]=Vn({prop:a,onChange:r,defaultProp:s??"",caller:vm});return o.jsx(dH,{scope:n,baseId:Un(),value:f,onValueChange:w,orientation:i,dir:m,activationMode:c,children:o.jsx(me.div,{dir:m,"data-orientation":i,...u,ref:t})})});DT.displayName=vm;var OT="TabsList",PT=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,s=fb(OT,n),i=MT(n);return o.jsx(zx,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:a,children:o.jsx(me.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});PT.displayName=OT;var zT="TabsTrigger",LT=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...s}=e,i=fb(zT,n),l=MT(n),c=BT(i.baseId,a),u=UT(i.baseId,a),m=a===i.value;return o.jsx(Lx,{asChild:!0,...l,focusable:!r,active:m,children:o.jsx(me.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":u,"data-state":m?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...s,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?i.onValueChange(a):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(a)}),onFocus:ee(e.onFocus,()=>{const f=i.activationMode!=="manual";!m&&!r&&f&&i.onValueChange(a)})})})});LT.displayName=zT;var IT="TabsContent",$T=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:s,...i}=e,l=fb(IT,n),c=BT(l.baseId,a),u=UT(l.baseId,a),m=a===l.value,f=d.useRef(m);return d.useEffect(()=>{const w=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(w)},[]),o.jsx(Rt,{present:r||m,children:({present:w})=>o.jsx(me.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!w,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:w&&s})})});$T.displayName=IT;function BT(e,t){return`${e}-trigger-${t}`}function UT(e,t){return`${e}-content-${t}`}var fH=DT,HT=PT,FT=LT,VT=$T;const mH=fH,GT=d.forwardRef(({className:e,...t},n)=>o.jsx(HT,{ref:n,className:E("tw:inline-flex tw:h-9 tw:items-center tw:justify-center tw:rounded-lg tw:bg-muted tw:p-1 tw:text-muted-foreground",e),...t}));GT.displayName=HT.displayName;const ym=d.forwardRef(({className:e,...t},n)=>o.jsx(FT,{ref:n,className:E("tw:inline-flex tw:items-center tw:justify-center tw:whitespace-nowrap tw:rounded-md tw:px-3 tw:py-1 tw:text-sm tw:font-medium tw:ring-offset-background tw:transition-all tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[state=active]:bg-background tw:data-[state=active]:text-foreground tw:data-[state=active]:shadow",e),...t}));ym.displayName=FT.displayName;const Sm=d.forwardRef(({className:e,...t},n)=>o.jsx(VT,{ref:n,className:E("tw:mt-2 tw:ring-offset-background tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2",e),...t}));Sm.displayName=VT.displayName;const wH=4;function pH(e){const t=window.getComputedStyle(e),n=parseFloat(t.outlineWidth);if(Number.isNaN(n))return wH;const a=parseFloat(t.outlineOffset);return Math.max(0,n+(Number.isNaN(a)?0:a))}function hH(e){try{return e.matches(":focus-visible")}catch{return!1}}function YT(e,t,n,a){return e<n||t-e>a-n?e-n:t>a?t-a:0}function KT(e){const t=e.currentTarget,n=e.target;if(!(n instanceof HTMLElement)||n===t||!hH(n))return;const a=pH(n),r=t.getBoundingClientRect(),s=n.getBoundingClientRect(),i=r.left+t.clientLeft,l=r.top+t.clientTop,c=YT(s.left-a,s.right+a,i,i+t.clientWidth),u=YT(s.top-a,s.bottom+a,l,l+t.clientHeight);c!==0&&t.scrollWidth>t.clientWidth&&(t.scrollLeft+=c),u!==0&&t.scrollHeight>t.clientHeight&&(t.scrollTop+=u)}const qT=d.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"tw:relative tw:w-full tw:overflow-auto",onFocus:KT,children:o.jsx("table",{ref:n,className:E("tw:w-full tw:caption-bottom tw:text-sm",e),...t})}));qT.displayName="Table";const XT=d.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:E("tw:[&_tr]:border-b tw:[&_tr]:border-gray-100",e),...t}));XT.displayName="TableHeader";const WT=d.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:E("tw:[&_tr:last-child]:border-0",e),...t}));WT.displayName="TableBody";const gH=d.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:E("tw:border-t tw:bg-muted/50 tw:font-medium tw:[&>tr]:last:border-b-0",e),...t}));gH.displayName="TableFooter";const nu=d.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:E("tw:border-b tw:border-gray-100 tw:transition-colors tw:hover:bg-muted/50 tw:data-[state=selected]:bg-muted",e),...t}));nu.displayName="TableRow";const is=d.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:E("tw:h-10 tw:px-2 tw:text-left tw:align-middle tw:font-medium tw:text-muted-foreground tw:[&:has([role=checkbox])]:pr-0 tw:[&>[role=checkbox]]:translate-y-[2px]",e),...t}));is.displayName="TableHead";const Er=d.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:E("tw:p-2 tw:align-middle tw:[&:has([role=checkbox])]:pr-0 tw:[&>[role=checkbox]]:translate-y-[2px]",e),...t}));Er.displayName="TableCell";const xH=d.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:E("tw:mt-4 tw:text-sm tw:text-muted-foreground",e),...t}));xH.displayName="TableCaption";const bH=d.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:E("tw:flex tw:min-h-[60px] tw:w-full tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-2 tw:text-base tw:shadow-sm tw:placeholder:text-muted-foreground tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:md:text-sm",e),ref:n,...t}));bH.displayName="Textarea";function vH({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),o.jsx("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"})]})}function ZT({label:e,tooltip:t}){return o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":`About ${e}`,className:"tw:inline-flex tw:items-center tw:justify-center tw:m-0 tw:p-0 tw:border-0 tw:bg-transparent tw:text-gray-400 tw:rounded-full tw:cursor-help tw:transition-colors tw:hover:text-gray-600 tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring",children:o.jsx(vH,{className:"tw:w-4 tw:h-4"})})}),o.jsx(Hi,{side:"top",className:"tw:max-w-xs tw:text-xs",children:t})]})}function mb({label:e,tooltip:t}){return o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1 tw:mb-1",children:[o.jsx("span",{className:"tw:text-xs tw:font-medium tw:text-gray-600",children:e}),o.jsx(ZT,{label:e,tooltip:t})]})}function yH(e){return Object.prototype.toString.call(e)==="[object Object]"}function QT(e){return yH(e)||Array.isArray(e)}function SH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function wb(e,t){const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;const r=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return r!==s?!1:n.every(i=>{const l=e[i],c=t[i];return typeof l=="function"?`${l}`==`${c}`:!QT(l)||!QT(c)?l===c:wb(l,c)})}function JT(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function jH(e,t){if(e.length!==t.length)return!1;const n=JT(e),a=JT(t);return n.every((r,s)=>{const i=a[s];return wb(r,i)})}function pb(e){return typeof e=="number"}function hb(e){return typeof e=="string"}function jm(e){return typeof e=="boolean"}function eR(e){return Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return Math.abs(e)}function gb(e){return Math.sign(e)}function au(e,t){return ht(e-t)}function NH(e,t){if(e===0||t===0||ht(e)<=ht(t))return 0;const n=au(ht(e),ht(t));return ht(n/e)}function CH(e){return Math.round(e*100)/100}function ru(e){return su(e).map(Number)}function Na(e){return e[ou(e)]}function ou(e){return Math.max(0,e.length-1)}function xb(e,t){return t===ou(e)}function tR(e,t=0){return Array.from(Array(e),(n,a)=>t+a)}function su(e){return Object.keys(e)}function nR(e,t){return[e,t].reduce((n,a)=>(su(a).forEach(r=>{const s=n[r],i=a[r],l=eR(s)&&eR(i);n[r]=l?nR(s,i):i}),n),{})}function bb(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function AH(e,t){const n={start:a,center:r,end:s};function a(){return 0}function r(c){return s(c)/2}function s(c){return t-c}function i(c,u){return hb(e)?n[e](c):e(t,c,u)}return{measure:i}}function iu(){let e=[];function t(r,s,i,l={passive:!0}){let c;if("addEventListener"in r)r.addEventListener(s,i,l),c=()=>r.removeEventListener(s,i,l);else{const u=r;u.addListener(i),c=()=>u.removeListener(i)}return e.push(c),a}function n(){e=e.filter(r=>r())}const a={add:t,clear:n};return a}function _H(e,t,n,a){const r=iu(),s=1e3/60;let i=null,l=0,c=0;function u(){r.add(e,"visibilitychange",()=>{e.hidden&&x()})}function m(){p(),r.clear()}function f(y){if(!c)return;i||(i=y,n(),n());const h=y-i;for(i=y,l+=h;l>=s;)n(),l-=s;const g=l/s;a(g),c&&(c=t.requestAnimationFrame(f))}function w(){c||(c=t.requestAnimationFrame(f))}function p(){t.cancelAnimationFrame(c),i=null,l=0,c=0}function x(){i=null,l=0}return{init:u,destroy:m,start:w,stop:p,update:n,render:a}}function EH(e,t){const n=t==="rtl",a=e==="y",r=a?"y":"x",s=a?"x":"y",i=!a&&n?-1:1,l=m(),c=f();function u(x){const{height:b,width:y}=x;return a?b:y}function m(){return a?"top":n?"right":"left"}function f(){return a?"bottom":n?"left":"right"}function w(x){return x*i}return{scroll:r,cross:s,startEdge:l,endEdge:c,measureSize:u,direction:w}}function ls(e=0,t=0){const n=ht(e-t);function a(u){return u<e}function r(u){return u>t}function s(u){return a(u)||r(u)}function i(u){return s(u)?a(u)?e:t:u}function l(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:i,reachedAny:s,reachedMax:r,reachedMin:a,removeOffset:l}}function aR(e,t,n){const{constrain:a}=ls(0,e),r=e+1;let s=i(t);function i(w){return n?ht((r+w)%r):a(w)}function l(){return s}function c(w){return s=i(w),f}function u(w){return m().set(l()+w)}function m(){return aR(e,l(),n)}const f={get:l,set:c,add:u,clone:m};return f}function TH(e,t,n,a,r,s,i,l,c,u,m,f,w,p,x,b,y,h,g){const{cross:v,direction:S}=e,N=["INPUT","SELECT","TEXTAREA"],A={passive:!1},j=iu(),C=iu(),R=ls(50,225).constrain(p.measure(20)),M={mouse:300,touch:400},z={mouse:500,touch:600},B=x?43:25;let I=!1,V=0,D=0,T=!1,O=!1,_=!1,$=!1;function H(K){if(!g)return;function ge(We){(jm(g)||g(K,We))&&ne(We)}const Ne=t;j.add(Ne,"dragstart",We=>We.preventDefault(),A).add(Ne,"touchmove",()=>{},A).add(Ne,"touchend",()=>{}).add(Ne,"touchstart",ge).add(Ne,"mousedown",ge).add(Ne,"touchcancel",Z).add(Ne,"contextmenu",Z).add(Ne,"click",le,!0)}function F(){j.clear(),C.clear()}function Q(){const K=$?n:t;C.add(K,"touchmove",Y,A).add(K,"touchend",Z).add(K,"mousemove",Y,A).add(K,"mouseup",Z)}function X(K){const ge=K.nodeName||"";return N.includes(ge)}function P(){return(x?z:M)[$?"mouse":"touch"]}function G(K,ge){const Ne=f.add(gb(K)*-1),We=m.byDistance(K,!x).distance;return x||ht(K)<R?We:y&&ge?We*.5:m.byIndex(Ne.get(),0).distance}function ne(K){const ge=bb(K,a);$=ge,_=x&&ge&&!K.buttons&&I,I=au(r.get(),i.get())>=2,!(ge&&K.button!==0)&&(X(K.target)||(T=!0,s.pointerDown(K),u.useFriction(0).useDuration(0),r.set(i),Q(),V=s.readPoint(K),D=s.readPoint(K,v),w.emit("pointerDown")))}function Y(K){if(!bb(K,a)&&K.touches.length>=2)return Z(K);const Ne=s.readPoint(K),We=s.readPoint(K,v),Ke=au(Ne,V),at=au(We,D);if(!O&&!$&&(!K.cancelable||(O=Ke>at,!O)))return Z(K);const Kt=s.pointerMove(K);Ke>b&&(_=!0),u.useFriction(.3).useDuration(.75),l.start(),r.add(S(Kt)),K.preventDefault()}function Z(K){const Ne=m.byDistance(0,!1).index!==f.get(),We=s.pointerUp(K)*P(),Ke=G(S(We),Ne),at=NH(We,Ke),Kt=B-10*at,He=h+at/50;O=!1,T=!1,C.clear(),u.useDuration(Kt).useFriction(He),c.distance(Ke,!x),$=!1,w.emit("pointerUp")}function le(K){_&&(K.stopPropagation(),K.preventDefault(),_=!1)}function he(){return T}return{init:H,destroy:F,pointerDown:he}}function RH(e,t){let a,r;function s(f){return f.timeStamp}function i(f,w){const x=`client${(w||e.scroll)==="x"?"X":"Y"}`;return(bb(f,t)?f:f.touches[0])[x]}function l(f){return a=f,r=f,i(f)}function c(f){const w=i(f)-i(r),p=s(f)-s(a)>170;return r=f,p&&(a=f),w}function u(f){if(!a||!r)return 0;const w=i(r)-i(a),p=s(f)-s(a),x=s(f)-s(r)>170,b=w/p;return p&&!x&&ht(b)>.1?b:0}return{pointerDown:l,pointerMove:c,pointerUp:u,readPoint:i}}function kH(){function e(n){const{offsetTop:a,offsetLeft:r,offsetWidth:s,offsetHeight:i}=n;return{top:a,right:r+s,bottom:a+i,left:r,width:s,height:i}}return{measure:e}}function MH(e){function t(a){return e*(a/100)}return{measure:t}}function DH(e,t,n,a,r,s,i){const l=[e].concat(a);let c,u,m=[],f=!1;function w(y){return r.measureSize(i.measure(y))}function p(y){if(!s)return;u=w(e),m=a.map(w);function h(g){for(const v of g){if(f)return;const S=v.target===e,N=a.indexOf(v.target),A=S?u:m[N],j=w(S?e:a[N]);if(ht(j-A)>=.5){y.reInit(),t.emit("resize");break}}}c=new ResizeObserver(g=>{(jm(s)||s(y,g))&&h(g)}),n.requestAnimationFrame(()=>{l.forEach(g=>c.observe(g))})}function x(){f=!0,c&&c.disconnect()}return{init:p,destroy:x}}function OH(e,t,n,a,r,s){let i=0,l=0,c=r,u=s,m=e.get(),f=0;function w(){const A=a.get()-e.get(),j=!c;let C=0;return j?(i=0,n.set(a),e.set(a),C=A):(n.set(e),i+=A/c,i*=u,m+=i,e.add(i),C=m-f),l=gb(C),f=m,N}function p(){const A=a.get()-t.get();return ht(A)<.001}function x(){return c}function b(){return l}function y(){return i}function h(){return v(r)}function g(){return S(s)}function v(A){return c=A,N}function S(A){return u=A,N}const N={direction:b,duration:x,velocity:y,seek:w,settled:p,useBaseFriction:g,useBaseDuration:h,useFriction:S,useDuration:v};return N}function PH(e,t,n,a,r){const s=r.measure(10),i=r.measure(50),l=ls(.1,.99);let c=!1;function u(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function m(p){if(!u())return;const x=e.reachedMin(t.get())?"min":"max",b=ht(e[x]-t.get()),y=n.get()-t.get(),h=l.constrain(b/i);n.subtract(y*h),!p&&ht(y)<s&&(n.set(e.constrain(n.get())),a.useDuration(25).useBaseFriction())}function f(p){c=!p}return{shouldConstrain:u,constrain:m,toggleActive:f}}function zH(e,t,n,a,r){const s=ls(-t+e,0),i=f(),l=m(),c=w();function u(x,b){return au(x,b)<=1}function m(){const x=i[0],b=Na(i),y=i.lastIndexOf(x),h=i.indexOf(b)+1;return ls(y,h)}function f(){return n.map((x,b)=>{const{min:y,max:h}=s,g=s.constrain(x),v=!b,S=xb(n,b);return v?h:S||u(y,g)?y:u(h,g)?h:g}).map(x=>parseFloat(x.toFixed(3)))}function w(){if(t<=e+r)return[s.max];if(a==="keepSnaps")return i;const{min:x,max:b}=l;return i.slice(x,b)}return{snapsContained:c,scrollContainLimit:l}}function LH(e,t,n){const a=t[0],r=n?a-e:Na(t);return{limit:ls(r,a)}}function IH(e,t,n,a){const s=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:c}=ls(s,i);function u(w){return w===1?c(n.get()):w===-1?l(n.get()):!1}function m(w){if(!u(w))return;const p=e*(w*-1);a.forEach(x=>x.add(p))}return{loop:m}}function $H(e){const{max:t,length:n}=e;function a(s){const i=s-t;return n?i/-n:0}return{get:a}}function BH(e,t,n,a,r){const{startEdge:s,endEdge:i}=e,{groupSlides:l}=r,c=f().map(t.measure),u=w(),m=p();function f(){return l(a).map(b=>Na(b)[i]-b[0][s]).map(ht)}function w(){return a.map(b=>n[s]-b[s]).map(b=>-ht(b))}function p(){return l(u).map(b=>b[0]).map((b,y)=>b+c[y])}return{snaps:u,snapsAligned:m}}function UH(e,t,n,a,r,s){const{groupSlides:i}=r,{min:l,max:c}=a,u=m();function m(){const w=i(s),p=!e||t==="keepSnaps";return n.length===1?[s]:p?w:w.slice(l,c).map((x,b,y)=>{const h=!b,g=xb(y,b);if(h){const v=Na(y[0])+1;return tR(v)}if(g){const v=ou(s)-Na(y)[0]+1;return tR(v,Na(y)[0])}return x})}return{slideRegistry:u}}function HH(e,t,n,a,r){const{reachedAny:s,removeOffset:i,constrain:l}=a;function c(x){return x.concat().sort((b,y)=>ht(b)-ht(y))[0]}function u(x){const b=e?i(x):l(x),y=t.map((g,v)=>({diff:m(g-b,0),index:v})).sort((g,v)=>ht(g.diff)-ht(v.diff)),{index:h}=y[0];return{index:h,distance:b}}function m(x,b){const y=[x,x+n,x-n];if(!e)return x;if(!b)return c(y);const h=y.filter(g=>gb(g)===b);return h.length?c(h):Na(y)-n}function f(x,b){const y=t[x]-r.get(),h=m(y,b);return{index:x,distance:h}}function w(x,b){const y=r.get()+x,{index:h,distance:g}=u(y),v=!e&&s(y);if(!b||v)return{index:h,distance:x};const S=t[h]-g,N=x+m(S,0);return{index:h,distance:N}}return{byDistance:w,byIndex:f,shortcut:m}}function FH(e,t,n,a,r,s,i){function l(f){const w=f.distance,p=f.index!==t.get();s.add(w),w&&(a.duration()?e.start():(e.update(),e.render(1),e.update())),p&&(n.set(t.get()),t.set(f.index),i.emit("select"))}function c(f,w){const p=r.byDistance(f,w);l(p)}function u(f,w){const p=t.clone().set(f),x=r.byIndex(p.get(),w);l(x)}return{distance:c,index:u}}function VH(e,t,n,a,r,s,i,l){const c={passive:!0,capture:!0};let u=0;function m(p){if(!l)return;function x(b){if(new Date().getTime()-u>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const g=n.findIndex(v=>v.includes(b));pb(g)&&(r.useDuration(0),a.index(g,0),i.emit("slideFocus"))}s.add(document,"keydown",f,!1),t.forEach((b,y)=>{s.add(b,"focus",h=>{(jm(l)||l(p,h))&&x(y)},c)})}function f(p){p.code==="Tab"&&(u=new Date().getTime())}return{init:m}}function lu(e){let t=e;function n(){return t}function a(c){t=i(c)}function r(c){t+=i(c)}function s(c){t-=i(c)}function i(c){return pb(c)?c:c.get()}return{get:n,set:a,add:r,subtract:s}}function rR(e,t){const n=e.scroll==="x"?i:l,a=t.style;let r=null,s=!1;function i(w){return`translate3d(${w}px,0px,0px)`}function l(w){return`translate3d(0px,${w}px,0px)`}function c(w){if(s)return;const p=CH(e.direction(w));p!==r&&(a.transform=n(p),r=p)}function u(w){s=!w}function m(){s||(a.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:m,to:c,toggleActive:u}}function GH(e,t,n,a,r,s,i,l,c){const m=ru(r),f=ru(r).reverse(),w=h().concat(g());function p(j,C){return j.reduce((R,M)=>R-r[M],C)}function x(j,C){return j.reduce((R,M)=>p(R,C)>0?R.concat([M]):R,[])}function b(j){return s.map((C,R)=>({start:C-a[R]+.5+j,end:C+t-.5+j}))}function y(j,C,R){const M=b(C);return j.map(z=>{const B=R?0:-n,I=R?n:0,V=R?"end":"start",D=M[z][V];return{index:z,loopPoint:D,slideLocation:lu(-1),translate:rR(e,c[z]),target:()=>l.get()>D?B:I}})}function h(){const j=i[0],C=x(f,j);return y(C,n,!1)}function g(){const j=t-i[0]-1,C=x(m,j);return y(C,-n,!0)}function v(){return w.every(({index:j})=>{const C=m.filter(R=>R!==j);return p(C,t)<=.1})}function S(){w.forEach(j=>{const{target:C,translate:R,slideLocation:M}=j,z=C();z!==M.get()&&(R.to(z),M.set(z))})}function N(){w.forEach(j=>j.translate.clear())}return{canLoop:v,clear:N,loop:S,loopPoints:w}}function YH(e,t,n){let a,r=!1;function s(c){if(!n)return;function u(m){for(const f of m)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}a=new MutationObserver(m=>{r||(jm(n)||n(c,m))&&u(m)}),a.observe(e,{childList:!0})}function i(){a&&a.disconnect(),r=!0}return{init:s,destroy:i}}function KH(e,t,n,a){const r={};let s=null,i=null,l,c=!1;function u(){l=new IntersectionObserver(x=>{c||(x.forEach(b=>{const y=t.indexOf(b.target);r[y]=b}),s=null,i=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:a}),t.forEach(x=>l.observe(x))}function m(){l&&l.disconnect(),c=!0}function f(x){return su(r).reduce((b,y)=>{const h=parseInt(y),{isIntersecting:g}=r[h];return(x&&g||!x&&!g)&&b.push(h),b},[])}function w(x=!0){if(x&&s)return s;if(!x&&i)return i;const b=f(x);return x&&(s=b),x||(i=b),b}return{init:u,destroy:m,get:w}}function qH(e,t,n,a,r,s){const{measureSize:i,startEdge:l,endEdge:c}=e,u=n[0]&&r,m=x(),f=b(),w=n.map(i),p=y();function x(){if(!u)return 0;const g=n[0];return ht(t[l]-g[l])}function b(){if(!u)return 0;const g=s.getComputedStyle(Na(a));return parseFloat(g.getPropertyValue(`margin-${c}`))}function y(){return n.map((g,v,S)=>{const N=!v,A=xb(S,v);return N?w[v]+m:A?w[v]+f:S[v+1][l]-g[l]}).map(ht)}return{slideSizes:w,slideSizesWithGaps:p,startGap:m,endGap:f}}function XH(e,t,n,a,r,s,i,l,c){const{startEdge:u,endEdge:m,direction:f}=e,w=pb(n);function p(h,g){return ru(h).filter(v=>v%g===0).map(v=>h.slice(v,v+g))}function x(h){return h.length?ru(h).reduce((g,v,S)=>{const N=Na(g)||0,A=N===0,j=v===ou(h),C=r[u]-s[N][u],R=r[u]-s[v][m],M=!a&&A?f(i):0,z=!a&&j?f(l):0,B=ht(R-z-(C+M));return S&&B>t+c&&g.push(v),j&&g.push(h.length),g},[]).map((g,v,S)=>{const N=Math.max(S[v-1]||0);return h.slice(N,g)}):[]}function b(h){return w?p(h,n):x(h)}return{groupSlides:b}}function WH(e,t,n,a,r,s,i){const{align:l,axis:c,direction:u,startIndex:m,loop:f,duration:w,dragFree:p,dragThreshold:x,inViewThreshold:b,slidesToScroll:y,skipSnaps:h,containScroll:g,watchResize:v,watchSlides:S,watchDrag:N,watchFocus:A}=s,j=2,C=kH(),R=C.measure(t),M=n.map(C.measure),z=EH(c,u),B=z.measureSize(R),I=MH(B),V=AH(l,B),D=!f&&!!g,T=f||!!g,{slideSizes:O,slideSizesWithGaps:_,startGap:$,endGap:H}=qH(z,R,M,n,T,r),F=XH(z,B,y,f,R,M,$,H,j),{snaps:Q,snapsAligned:X}=BH(z,V,R,M,F),P=-Na(Q)+Na(_),{snapsContained:G,scrollContainLimit:ne}=zH(B,P,X,g,j),Y=D?G:X,{limit:Z}=LH(P,Y,f),le=aR(ou(Y),m,f),he=le.clone(),ae=ru(n),K=({dragHandler:we,scrollBody:Ve,scrollBounds:ze,options:{loop:Wt}})=>{Wt||ze.constrain(we.pointerDown()),Ve.seek()},ge=({scrollBody:we,translate:Ve,location:ze,offsetLocation:Wt,previousLocation:Ge,scrollLooper:Ea,slideLooper:pa,dragHandler:Xn,animation:Ta,eventHandler:rn,scrollBounds:Za,options:{loop:ie}},Ee)=>{const $e=we.settled(),re=!Za.shouldConstrain(),Je=ie?$e:$e&&re,dt=Je&&!Xn.pointerDown();dt&&Ta.stop();const kt=ze.get()*Ee+Ge.get()*(1-Ee);Wt.set(kt),ie&&(Ea.loop(we.direction()),pa.loop()),Ve.to(Wt.get()),dt&&rn.emit("settle"),Je||rn.emit("scroll")},Ne=_H(a,r,()=>K(ye),we=>ge(ye,we)),We=.68,Ke=Y[le.get()],at=lu(Ke),Kt=lu(Ke),He=lu(Ke),qt=lu(Ke),Cn=OH(at,He,Kt,qt,w,We),mt=HH(f,Y,P,Z,qt),Xt=FH(Ne,le,he,Cn,mt,qt,i),an=$H(Z),wn=iu(),An=KH(t,n,i,b),{slideRegistry:qn}=UH(D,g,Y,ne,F,ae),oe=VH(e,n,qn,Xt,Cn,wn,i,A),ye={ownerDocument:a,ownerWindow:r,eventHandler:i,containerRect:R,slideRects:M,animation:Ne,axis:z,dragHandler:TH(z,e,a,r,qt,RH(z,r),at,Ne,Xt,Cn,mt,le,i,I,p,x,h,We,N),eventStore:wn,percentOfView:I,index:le,indexPrevious:he,limit:Z,location:at,offsetLocation:He,previousLocation:Kt,options:s,resizeHandler:DH(t,i,r,n,z,v,C),scrollBody:Cn,scrollBounds:PH(Z,He,qt,Cn,I),scrollLooper:IH(P,Z,He,[at,He,Kt,qt]),scrollProgress:an,scrollSnapList:Y.map(an.get),scrollSnaps:Y,scrollTarget:mt,scrollTo:Xt,slideLooper:GH(z,B,P,O,_,Q,Y,He,n),slideFocus:oe,slidesHandler:YH(t,i,S),slidesInView:An,slideIndexes:ae,slideRegistry:qn,slidesToScroll:F,target:qt,translate:rR(z,t)};return ye}function ZH(){let e={},t;function n(u){t=u}function a(u){return e[u]||[]}function r(u){return a(u).forEach(m=>m(t,u)),c}function s(u,m){return e[u]=a(u).concat([m]),c}function i(u,m){return e[u]=a(u).filter(f=>f!==m),c}function l(){e={}}const c={init:n,emit:r,off:i,on:s,clear:l};return c}const QH={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function JH(e){function t(s,i){return nR(s,i||{})}function n(s){const i=s.breakpoints||{},l=su(i).filter(c=>e.matchMedia(c).matches).map(c=>i[c]).reduce((c,u)=>t(c,u),{});return t(s,l)}function a(s){return s.map(i=>su(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:a}}function eF(e){let t=[];function n(s,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(s,e)),i.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function a(){t=t.filter(s=>s.destroy())}return{init:n,destroy:a}}function Nm(e,t,n){const a=e.ownerDocument,r=a.defaultView,s=JH(r),i=eF(s),l=iu(),c=ZH(),{mergeOptions:u,optionsAtMedia:m,optionsMediaQueries:f}=s,{on:w,off:p,emit:x}=c,b=z;let y=!1,h,g=u(QH,Nm.globalOptions),v=u(g),S=[],N,A,j;function C(){const{container:ae,slides:K}=v;A=(hb(ae)?e.querySelector(ae):ae)||e.children[0];const Ne=hb(K)?A.querySelectorAll(K):K;j=[].slice.call(Ne||A.children)}function R(ae){const K=WH(e,A,j,a,r,ae,c);if(ae.loop&&!K.slideLooper.canLoop()){const ge=Object.assign({},ae,{loop:!1});return R(ge)}return K}function M(ae,K){y||(g=u(g,ae),v=m(g),S=K||S,C(),h=R(v),f([g,...S.map(({options:ge})=>ge)]).forEach(ge=>l.add(ge,"change",z)),v.active&&(h.translate.to(h.location.get()),h.animation.init(),h.slidesInView.init(),h.slideFocus.init(he),h.eventHandler.init(he),h.resizeHandler.init(he),h.slidesHandler.init(he),h.options.loop&&h.slideLooper.loop(),A.offsetParent&&j.length&&h.dragHandler.init(he),N=i.init(he,S)))}function z(ae,K){const ge=F();B(),M(u({startIndex:ge},ae),K),c.emit("reInit")}function B(){h.dragHandler.destroy(),h.eventStore.clear(),h.translate.clear(),h.slideLooper.clear(),h.resizeHandler.destroy(),h.slidesHandler.destroy(),h.slidesInView.destroy(),h.animation.destroy(),i.destroy(),l.clear()}function I(){y||(y=!0,l.clear(),B(),c.emit("destroy"),c.clear())}function V(ae,K,ge){!v.active||y||(h.scrollBody.useBaseFriction().useDuration(K===!0?0:v.duration),h.scrollTo.index(ae,ge||0))}function D(ae){const K=h.index.add(1).get();V(K,ae,-1)}function T(ae){const K=h.index.add(-1).get();V(K,ae,1)}function O(){return h.index.add(1).get()!==F()}function _(){return h.index.add(-1).get()!==F()}function $(){return h.scrollSnapList}function H(){return h.scrollProgress.get(h.offsetLocation.get())}function F(){return h.index.get()}function Q(){return h.indexPrevious.get()}function X(){return h.slidesInView.get()}function P(){return h.slidesInView.get(!1)}function G(){return N}function ne(){return h}function Y(){return e}function Z(){return A}function le(){return j}const he={canScrollNext:O,canScrollPrev:_,containerNode:Z,internalEngine:ne,destroy:I,off:p,on:w,emit:x,plugins:G,previousScrollSnap:Q,reInit:b,rootNode:Y,scrollNext:D,scrollPrev:T,scrollProgress:H,scrollSnapList:$,scrollTo:V,selectedScrollSnap:F,slideNodes:le,slidesInView:X,slidesNotInView:P};return M(t,n),setTimeout(()=>c.emit("init"),0),he}Nm.globalOptions=void 0;function vb(e={},t=[]){const n=d.useRef(e),a=d.useRef(t),[r,s]=d.useState(),[i,l]=d.useState(),c=d.useCallback(()=>{r&&r.reInit(n.current,a.current)},[r]);return d.useEffect(()=>{wb(n.current,e)||(n.current=e,c())},[e,c]),d.useEffect(()=>{jH(a.current,t)||(a.current=t,c())},[t,c]),d.useEffect(()=>{if(SH()&&i){Nm.globalOptions=vb.globalOptions;const u=Nm(i,n.current,a.current);return s(u),()=>u.destroy()}else s(void 0)},[i,s]),[l,r]}vb.globalOptions=void 0;const oR=d.createContext(null);function Cm(){const e=d.useContext(oR);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const tF=d.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:a,className:r,children:s,...i},l)=>{const[c,u]=vb({...t,axis:e==="horizontal"?"x":"y"},a),[m,f]=d.useState(!1),[w,p]=d.useState(!1),x=d.useCallback(g=>{g&&(f(g.canScrollPrev()),p(g.canScrollNext()))},[]),b=d.useCallback(()=>{u==null||u.scrollPrev()},[u]),y=d.useCallback(()=>{u==null||u.scrollNext()},[u]),h=d.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),b()):g.key==="ArrowRight"&&(g.preventDefault(),y())},[b,y]);return d.useEffect(()=>{!u||!n||n(u)},[u,n]),d.useEffect(()=>{if(u)return x(u),u.on("reInit",x),u.on("select",x),()=>{u==null||u.off("select",x)}},[u,x]),o.jsx(oR.Provider,{value:{carouselRef:c,api:u,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:y,canScrollPrev:m,canScrollNext:w},children:o.jsx("div",{ref:l,onKeyDownCapture:h,className:E("tw:relative",r),role:"region","aria-roledescription":"carousel",...i,children:s})})});tF.displayName="Carousel";const nF=d.forwardRef(({className:e,...t},n)=>{const{carouselRef:a,orientation:r}=Cm();return o.jsx("div",{ref:a,className:"tw:overflow-hidden",children:o.jsx("div",{ref:n,className:E("tw:flex",r==="horizontal"?"tw:-ml-4":"tw:-mt-4 tw:flex-col",e),...t})})});nF.displayName="CarouselContent";const aF=d.forwardRef(({className:e,...t},n)=>{const{orientation:a}=Cm();return o.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:E("tw:min-w-0 tw:shrink-0 tw:grow-0 tw:basis-full",a==="horizontal"?"tw:pl-4":"tw:pt-4",e),...t})});aF.displayName="CarouselItem";const rF=d.forwardRef(({className:e,variant:t="outline",size:n="icon",...a},r)=>{const{orientation:s,scrollPrev:i,canScrollPrev:l}=Cm();return o.jsxs(Ae,{ref:r,variant:t,size:n,className:E("tw:absolute tw:h-8 tw:w-8 tw:rounded-full",s==="horizontal"?"tw:-left-12 tw:top-1/2 tw:-translate-y-1/2":"tw:-top-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90",e),disabled:!l,onClick:i,...a,children:[o.jsx(NP,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Previous slide"})]})});rF.displayName="CarouselPrevious";const oF=d.forwardRef(({className:e,variant:t="outline",size:n="icon",...a},r)=>{const{orientation:s,scrollNext:i,canScrollNext:l}=Cm();return o.jsxs(Ae,{ref:r,variant:t,size:n,className:E("tw:absolute tw:h-8 tw:w-8 tw:rounded-full",s==="horizontal"?"tw:-right-12 tw:top-1/2 tw:-translate-y-1/2":"tw:-bottom-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90",e),disabled:!l,onClick:i,...a,children:[o.jsx(bg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Next slide"})]})});oF.displayName="CarouselNext";const sR=d.createContext(null);function sF({children:e}){const[t,n]=d.useState({isOpen:!1,options:{message:""},resolve:null}),a=d.useCallback(f=>new Promise(w=>{n({isOpen:!0,options:f,resolve:w})}),[]),r=d.useCallback(()=>{var f;(f=t.resolve)==null||f.call(t,!0),n({isOpen:!1,options:{message:""},resolve:null})},[t.resolve]),s=d.useCallback(()=>{var f;(f=t.resolve)==null||f.call(t,!1),n({isOpen:!1,options:{message:""},resolve:null})},[t.resolve]),{title:i,message:l,confirmText:c,cancelText:u,variant:m}=t.options;return o.jsxs(sR.Provider,{value:{confirm:a},children:[e,o.jsx(jA,{open:t.isOpen,onOpenChange:f=>!f&&s(),children:o.jsxs(px,{children:[o.jsxs(hx,{children:[o.jsx(xx,{children:i||"Confirm"}),o.jsx(bx,{children:l})]}),o.jsxs(gx,{children:[o.jsx(vx,{onClick:s,children:u||"Cancel"}),o.jsx(CA,{onClick:r,className:E((m==="danger"||m==="warning")&&"tw:bg-red-600 tw:hover:bg-red-700"),children:c||"Confirm"})]})]})})]})}function yb(){const e=d.useContext(sR);if(!e)throw new Error("useConfirm must be used within a ConfirmProvider");return e}const iF="M 88.296875 179.015625 C 85.765625 179.015625 84.03125 178.503906 83.066406 177.472656 C 82.078125 176.445312 81.609375 174.664062 81.609375 172.15625 L 81.609375 30.761719 C 81.609375 27.222656 82.144531 24.628906 83.238281 22.957031 C 84.375 21.242188 86.710938 19.65625 90.269531 18.15625 C 94.726562 16.503906 100.386719 15.027344 107.246094 13.695312 C 114.148438 12.324219 122.789062 11.636719 133.140625 11.636719 C 149.304688 11.636719 161.179688 15.582031 168.726562 23.472656 C 176.273438 31.316406 180.046875 42.335938 180.046875 56.570312 L 180.046875 87.011719 C 180.046875 101.824219 175.949219 113.292969 167.785156 121.394531 C 159.660156 129.453125 147.226562 133.484375 130.484375 133.484375 C 125.894531 133.484375 121.652344 132.992188 117.707031 132.027344 C 113.761719 131.042969 110.332031 130.183594 107.417969 129.453125 L 107.417969 172.15625 C 107.417969 174.664062 106.859375 176.445312 105.789062 177.472656 C 104.761719 178.503906 102.980469 179.015625 100.472656 179.015625 Z M 128.683594 109.90625 C 137.429688 109.90625 143.859375 107.976562 147.976562 104.074219 C 152.136719 100.128906 154.234375 94.171875 154.234375 86.152344 L 154.234375 57.253906 C 154.234375 42.570312 146.023438 35.21875 129.625 35.21875 C 125.445312 35.21875 121.738281 35.453125 118.480469 35.90625 C 115.21875 36.375 112.175781 36.976562 109.390625 37.707031 C 108.0625 38.175781 107.417969 39.121094 107.417969 40.535156 L 107.417969 106.558594 C 109.925781 107.203125 113.011719 107.910156 116.679688 108.703125 C 120.386719 109.519531 124.394531 109.90625 128.683594 109.90625 Z M 128.683594 109.90625",lF="M 11.636719 50.707031 C 11.636719 44.0625 14.296875 42.816406 19.613281 46.933594 L 70.117188 88.265625 C 72.175781 89.914062 73.675781 91.308594 74.664062 92.464844 C 75.628906 93.664062 76.121094 95.464844 76.121094 97.867188 L 76.121094 104.984375 C 76.121094 107.492188 75.628906 109.273438 74.664062 110.300781 C 73.675781 111.328125 72.175781 112.660156 70.117188 114.332031 L 19.613281 155.832031 C 14.296875 160.292969 11.636719 159.027344 11.636719 152.058594 L 11.636719 140.742188 C 11.636719 136.5625 12.003906 133.753906 12.753906 132.335938 C 13.480469 130.964844 15.113281 129.25 17.640625 127.191406 L 50.308594 101.640625 L 50.308594 100.269531 L 17.640625 74.714844 C 14.941406 72.484375 13.269531 70.644531 12.582031 69.226562 C 11.9375 67.855469 11.636719 65.070312 11.636719 60.910156 Z M 11.636719 50.707031";function iR({className:e,decorative:t=!1}){return o.jsxs("svg",{viewBox:"0 0 192 192",className:E("tw:block tw:size-[26px] tw:shrink-0",e),role:t?void 0:"img","aria-label":t?void 0:"PaapiPlugin","aria-hidden":t?!0:void 0,focusable:"false",children:[o.jsx("path",{className:"tw:fill-sidebar-foreground",d:iF}),o.jsx("path",{className:"tw:fill-brand-primary",d:lF})]})}const Sb="psfa:connection-change";function cF(e){return e==="managed"||e==="creators"||e==="paapi"?e:null}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function uF(){var t;const e=(t=typeof window>"u"?void 0:window.psfaAdmin)==null?void 0:t.activePath;return e==="managed"||e==="creators"||e==="paapi"?e:"none"}function dF(e){const t=typeof window>"u"?void 0:window.psfaAdmin;if(!t||!Tr(e))return null;Tr(t.settings)||(t.settings={});const n=t.settings,a=cF(e.active_path);a&&(n.useManagedApi=a==="managed",a!=="managed"&&(n.authType=a==="creators"?"oauth":"awssig4")),Array.isArray(e.categories)&&(t.categories=e.categories);const r=e.admin_state;if(Tr(r)){const{settings:s,...i}=r;if(Object.assign(t,i),Tr(s)){const{effectiveAppearance:l,...c}=s;if(Object.assign(n,c),Tr(l)){const u=Tr(n.effectiveAppearance)?n.effectiveAppearance:{};n.effectiveAppearance={...u,...l}}}}return window.dispatchEvent(new CustomEvent(Sb)),a}function jb(e){const t=typeof window>"u"?void 0:window.psfaAdmin;if(!t||!Tr(e))return e;if(Tr(e.setupChecklist)&&(t.setupChecklist=e.setupChecklist),Array.isArray(e.productBoxes)){const n=Tr(t.addonData)?t.addonData:{};t.addonData={...n,productBoxes:e.productBoxes}}return e}async function vo(e,t={}){const n=window.psfaAdmin;if(!n)return{success:!1,message:"PSFA admin config not found"};const a=new FormData;a.append("action",e),a.append("nonce",n.nonce);for(const[s,i]of Object.entries(t))a.append(s,i);let r;try{const s=await fetch(`${n.ajaxUrl}?action=${e}`,{method:"POST",body:a,credentials:"same-origin"});try{r=await s.json()}catch{return{success:!1,message:`HTTP ${s.status}`}}}catch(s){return{success:!1,message:s instanceof Error?s.message:"Network error"}}return!r||typeof r!="object"?{success:!1,message:"Unexpected response"}:(r.success&&dF(r.data),r)}const fF=["red","amber","info"],mF=["primary","secondary","link"];function lR(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Am(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function cR(e){return typeof e=="string"&&e.trim()!==""?e:null}function wF(e){if(!lR(e)||typeof e.label!="string"||e.label==="")return null;const t=mF.includes(e.kind)?e.kind:"secondary";return{label:e.label,kind:t,url:typeof e.url=="string"&&e.url!==""?e.url:null,newTab:e.newTab===!0,marksRead:e.marksRead===!0,note:cR(e.note)}}function Nb(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!lR(n)||typeof n.id!="string"||n.id===""||n.kind!=="fault"&&n.kind!=="courtesy"||typeof n.title!="string"||n.title==="")continue;const a=n.kind==="fault";t.push({id:n.id,kind:n.kind,tone:fF.includes(n.tone)?n.tone:a?"red":"info",priority:Am(n.priority,100),title:n.title,body:typeof n.body=="string"?n.body:"",lines:Array.isArray(n.lines)?n.lines.filter(r=>typeof r=="string"&&r!==""):[],actions:Array.isArray(n.actions)?n.actions.map(wF).filter(r=>r!==null):[],hint:cR(n.hint),createdAt:Am(n.createdAt,0),expiresAt:Am(n.expiresAt,null),read:a?!1:n.read===!0,modal:!a&&n.modal===!0,bannerHiddenUntil:a?Am(n.bannerHiddenUntil,null):null})}return t}function uR(e,t){return e.expiresAt===null||e.expiresAt>t}function dR(e,t){return e.priority-t.priority||t.createdAt-e.createdAt||e.id.localeCompare(t.id)}function cu(e,t){return e.filter(n=>n.kind==="fault"&&uR(n,t)).sort(dR)}function _m(e,t){return e.filter(n=>n.kind==="courtesy"&&uR(n,t)).sort(dR)}function pF(e,t){return cu(e,t).length+_m(e,t).filter(n=>!n.read).length}function hF(e){return e<=0?"":e>9?"9+":String(e)}function gF(e,t){return _m(e,t).some(n=>!n.read)}function xF(e,t){return cu(e,t).find(n=>n.bannerHiddenUntil===null||n.bannerHiddenUntil<=t)??null}function bF(e,t){return _m(e,t).filter(n=>n.modal&&!n.read)}function vF(){return window.psfaAdmin??{}}function yF(e){if(typeof e!="object"||e===null)return null;const t=e;if(t.success!==!0)return null;if(Array.isArray(t.data))return t.data;const n=t.data;return Array.isArray(n==null?void 0:n.items)?n.items:null}async function SF(e,t){var s;const n=vF(),a=String(((s=n.notifications)==null?void 0:s.nonce)??""),r=new URLSearchParams;r.set("action",e),r.set("nonce",a),r.set("_ajax_nonce",a),t!==void 0&&r.set("id",t);try{const i=await fetch(String(n.ajaxUrl??""),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},credentials:"same-origin",body:r}),l=yF(await i.json());return l===null?null:Nb(l)}catch{return null}}const jF=86400,fR=d.createContext(null);function uu(){return Math.floor(Date.now()/1e3)}function mR(){var t;const e=window.psfaAdmin;return Nb((t=e==null?void 0:e.notifications)==null?void 0:t.items)}function Cb(e,t,n){return e.map(a=>a.id===t?{...a,...n}:a)}function NF({children:e,wizardActive:t=!1}){const[n,a]=d.useState(mR),[r]=d.useState(()=>t?[]:bF(n,uu())),[s,i]=d.useState(0),[l,c]=d.useState(!1),u=d.useRef(null),m=d.useRef(0),f=d.useRef(!0);d.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),d.useEffect(()=>{const S=()=>{m.current+=1,a(mR())};return window.addEventListener(Sb,S),()=>window.removeEventListener(Sb,S)},[]);const w=d.useCallback((S,N,A)=>{a(A);const j=++m.current;SF(S,N).then(C=>{C&&f.current&&j===m.current&&a(C)})},[]),p=d.useCallback(S=>w("psfa_notification_read",S,N=>Cb(N,S,{read:!0,modal:!1})),[w]),x=d.useCallback(()=>w("psfa_notification_read_all",void 0,S=>S.map(N=>N.kind==="courtesy"?{...N,read:!0,modal:!1}:N)),[w]),b=d.useCallback(S=>w("psfa_notification_later",S,N=>Cb(N,S,{modal:!1})),[w]),y=d.useCallback(S=>w("psfa_notification_hide_banner",S,N=>Cb(N,S,{bannerHiddenUntil:uu()+jF})),[w]),h=d.useRef(0),g=d.useCallback(S=>{const N=r[h.current];N&&(h.current+=1,i(h.current),S==="read"?p(N.id):b(N.id))},[r,p,b]),v=d.useMemo(()=>({items:n,read:p,readAll:x,later:b,hideBanner:y,panelOpen:l,setPanelOpen:c,bellRef:u,queue:r,queueIndex:s,advanceQueue:g}),[n,p,x,b,y,l,r,s,g]);return o.jsx(fR.Provider,{value:v,children:e})}function du(){const e=d.useContext(fR);if(!e)throw new Error("useNotifications must be used inside NotificationsProvider");return e}const Ab="tw:size-9 tw:shrink-0 tw:rounded-lg tw:text-muted-foreground tw:shadow-none tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,color] tw:duration-150 tw:ease-psfa-out tw:hover:bg-accent tw:hover:text-foreground tw:data-[state=open]:bg-accent tw:data-[state=open]:text-foreground tw:active:scale-95 tw:motion-reduce:active:scale-100 tw:[&_svg]:size-[18px]",wR="tw:flex tw:min-h-[38px] tw:pointer-coarse:min-h-11 tw:w-full tw:items-center tw:gap-2.5 tw:rounded-[10px] tw:border tw:border-solid tw:border-sidebar-button-border tw:bg-sidebar-button tw:px-2.5 tw:text-left tw:text-sm tw:font-medium tw:text-sidebar-foreground tw:no-underline tw:shadow-psfa-xs tw:outline-none tw:touch-manipulation tw:select-none tw:transition-[transform,background-color] tw:duration-120 tw:ease-psfa-out tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring tw:data-[state=open]:bg-sidebar-accent",pR="tw:rounded-md tw:bg-foreground tw:px-2.5 tw:py-1 tw:text-[12.5px] tw:font-medium tw:text-background tw:shadow-psfa-pop";function _b({note:e,noteClassName:t,children:n}){return e?o.jsxs("span",{"data-testid":"action-group",className:"tw:inline-flex tw:min-w-0 tw:max-w-full tw:flex-wrap tw:items-center tw:gap-x-2 tw:gap-y-1 tw:max-[781px]:flex-col tw:max-[781px]:items-stretch tw:max-[781px]:gap-1.5",children:[n,o.jsx("span",{"data-testid":"action-note",className:E("tw:text-[13px] tw:leading-snug tw:[overflow-wrap:anywhere] tw:max-[781px]:text-center",t),children:e})]}):o.jsx(o.Fragment,{children:n})}const hR={"fault-marketplace":Sg,"fault-appearance":Ng,review:cf,"builtin-boxes":Zo,"builtin-tables":_g,"builtin-analytics":xc};function Eb(e){return hR[e.id]?hR[e.id]:e.id.startsWith("bfcm")?EP:e.kind==="fault"?Sc:vg}const CF=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function AF(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}function _F(e,t,n=AF()){const a=new Intl.RelativeTimeFormat(n,{numeric:"auto"}),r=Math.max(0,t-e);for(const[s,i]of CF)if(r>=i)return a.format(-Math.floor(r/i),s);return a.format(0,"second")}const Ka={title:"Notifications",bellLabel:e=>e>0?`Notifications (${e})`:"Notifications",markAllRead:"Mark all as read",empty:"Nothing new",unread:"Unread",later:"Later",close:"Close",dismiss:"Dismiss notice",position:(e,t)=>`${e} of ${t}`,andMore:e=>`and ${e} more`},gR="(max-width: 781px)",EF="(prefers-reduced-motion: reduce)";function xR(e){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(e).matches}function Tb(e){const t=d.useCallback(n=>{var r;if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const a=window.matchMedia(e);return(r=a.addEventListener)==null||r.call(a,"change",n),()=>{var s;return(s=a.removeEventListener)==null?void 0:s.call(a,"change",n)}},[e]);return d.useSyncExternalStore(t,()=>xR(e),()=>!1)}function TF(){return xR(EF)}const RF={red:"tw:bg-destructive-soft tw:text-destructive",amber:"tw:bg-warning-soft tw:text-warning",info:"tw:bg-info-soft tw:text-info"},kF={red:"tw:bg-destructive",amber:"tw:bg-warning",info:"tw:bg-primary"};function MF({item:e,action:t,phone:n,onDone:a}){const r=E("tw:inline-flex tw:items-center tw:gap-1 tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-xs tw:font-medium tw:text-link tw:no-underline tw:cursor-pointer","tw:transition-colors tw:duration-150 tw:hover:text-link/80 tw:hover:underline tw:underline-offset-4","tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2",n&&"tw:min-h-11"),s=o.jsxs(o.Fragment,{children:[t.label,o.jsx(bg,{className:"tw:size-3.5","aria-hidden":"true"})]});return t.url?o.jsx("a",{href:t.url,target:t.newTab?"_blank":void 0,rel:t.newTab?"noopener noreferrer":void 0,className:r,onClick:()=>a(t),"data-item":e.id,children:s}):o.jsx("button",{type:"button",className:r,onClick:()=>a(t),"data-item":e.id,children:s})}function bR({item:e,now:t,phone:n}){const{read:a,setPanelOpen:r}=du(),s=Eb(e),i=!e.read,l=c=>{e.kind==="courtesy"&&c.marksRead&&i&&a(e.id),c.url&&!c.newTab&&r(!1)};return o.jsxs("li",{"data-testid":`notification-row-${e.id}`,"data-unread":String(i),className:E("tw:m-0 tw:grid tw:grid-cols-[2rem_minmax(0,1fr)_0.5rem] tw:items-start tw:gap-3 tw:py-3",n?"tw:px-5":"tw:px-4","tw:[&+&]:border-t tw:[&+&]:border-border"),children:[o.jsx("span",{className:E("tw:grid tw:size-8 tw:place-items-center tw:rounded-md",RF[e.tone]),children:o.jsx(s,{className:"tw:size-4","aria-hidden":"true"})}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsxs("p",{className:E("tw:m-0 tw:text-sm tw:leading-snug tw:[overflow-wrap:anywhere]",i?"tw:font-semibold tw:text-foreground":"tw:font-normal tw:text-foreground"),children:[i?o.jsx("span",{className:"tw:sr-only",children:Ka.unread}):null,e.title]}),e.body?o.jsx("p",{className:E("tw:m-0 tw:mt-0.5 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",e.kind==="fault"?"tw:line-clamp-2":"tw:line-clamp-1"),title:e.body,children:e.body}):null,e.kind==="fault"?e.lines.map(c=>o.jsx("p",{className:"tw:m-0 tw:mt-0.5 tw:line-clamp-2 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",title:c,children:c},c)):null,o.jsxs("div",{className:"tw:mt-1.5 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-1 tw:text-xs",children:[e.createdAt>0?o.jsx("time",{dateTime:new Date(e.createdAt*1e3).toISOString(),className:"tw:whitespace-nowrap tw:text-muted-foreground tw:tabular-nums",children:_F(e.createdAt,t)}):null,e.actions.map(c=>o.jsx(_b,{note:c.note,noteClassName:"tw:text-xs tw:text-muted-foreground tw:max-[781px]:text-left",children:o.jsx(MF,{item:e,action:c,phone:n,onDone:l})},`${c.kind}-${c.label}`))]}),e.hint?o.jsx("p",{className:"tw:m-0 tw:mt-1 tw:text-xs tw:text-muted-foreground",children:e.hint}):null]}),o.jsx("span",{"aria-hidden":"true",className:E("tw:mt-1.5 tw:size-2 tw:rounded-full",i?kF[e.tone]:"tw:bg-transparent")})]})}function vR({phone:e,title:t,focusPanel:n}){const{items:a,readAll:r}=du(),s=uu(),i=cu(a,s),l=_m(a,s),c=i.length+l.length===0,u=gF(a,s);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:E("tw:flex tw:shrink-0 tw:items-center tw:justify-between tw:gap-3 tw:border-b tw:border-border",e?"tw:min-h-14 tw:py-1.5 tw:pl-5 tw:pr-14":"tw:py-2.5 tw:pl-4 tw:pr-3"),children:[t,c?null:o.jsx(Ae,{type:"button",variant:"ghost",size:"sm",disabled:!u,onClick:()=>{r(),n()},className:E("tw:px-2 tw:text-[13px] tw:font-medium tw:text-link tw:hover:bg-accent tw:hover:text-link/80 tw:disabled:text-muted-foreground tw:disabled:opacity-100",e?"tw:h-11":"tw:h-7"),children:Ka.markAllRead})]}),c?o.jsxs("div",{className:"tw:grid tw:justify-items-center tw:gap-3 tw:px-4 tw:pt-10 tw:pb-11 tw:text-center",children:[o.jsx("span",{className:"tw:grid tw:size-10 tw:place-items-center tw:rounded-full tw:bg-secondary tw:text-muted-foreground",children:o.jsx(vg,{className:"tw:size-[18px]","aria-hidden":"true"})}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground",children:Ka.empty})]}):o.jsxs("div",{className:"tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain",children:[i.length?o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:i.map(m=>o.jsx(bR,{item:m,now:s,phone:e},m.id))}):null,i.length&&l.length?o.jsx(mm,{className:"tw:h-1.5 tw:border-y tw:border-border tw:bg-muted"}):null,l.length?o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:l.map(m=>o.jsx(bR,{item:m,now:s,phone:e},m.id))}):null]})]})}function DF(){const{items:e,panelOpen:t,setPanelOpen:n,bellRef:a}=du(),r=Tb(gR),s=d.useId(),i=d.useRef(null),l=pF(e,uu()),c=d.useRef(l),u=c.current!==l;d.useEffect(()=>{c.current=l},[l]);const m=()=>{var w;return(w=i.current)==null?void 0:w.focus({preventScroll:!0})},f=o.jsxs(Ae,{ref:a,type:"button",variant:"ghost",size:"icon","data-testid":"notification-bell","aria-label":Ka.bellLabel(l),className:E(Ab,"tw:relative",r&&"tw:size-11"),children:[o.jsx(vg,{className:"tw:size-[18px]","aria-hidden":"true"}),l>0?o.jsx("span",{"data-testid":"notification-badge","aria-hidden":"true",className:E("tw:absolute tw:top-[3px] tw:right-[3px] tw:grid tw:h-4 tw:min-w-4 tw:place-items-center tw:rounded-full tw:bg-primary tw:px-1 tw:text-[10.5px] tw:font-bold tw:leading-none tw:text-primary-foreground tw:tabular-nums",u&&"psfa-nx-badge-pop"),children:hF(l)},l):null]});return r?o.jsxs(Wc,{open:t,onOpenChange:n,children:[o.jsx(dB,{asChild:!0,children:f}),o.jsx(Ii,{ref:i,side:"bottom",tabIndex:-1,"aria-describedby":void 0,"data-testid":"notification-panel","data-variant":"sheet",onOpenAutoFocus:w=>{w.preventDefault(),m()},overlayClassName:"psfa-nx-overlay psfa-nx-overlay--panel tw:bg-scrim",closeClassName:"tw:top-1.5 tw:right-1.5 tw:grid tw:size-11 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-sheet psfa-nx-sheet--panel tw:flex tw:max-h-[86dvh] tw:flex-col tw:gap-0 tw:rounded-t-2xl tw:border-border tw:p-0 tw:pb-[env(safe-area-inset-bottom,0px)] tw:font-rubik tw:antialiased tw:shadow-[0_-10px_30px_-10px_rgb(0_0_0/0.2)] tw:transition-none tw:outline-none",children:o.jsx(vR,{phone:!0,focusPanel:m,title:o.jsx($i,{className:"tw:m-0 tw:text-sm tw:font-semibold tw:text-foreground",children:Ka.title})})})]}):o.jsxs(O$,{open:t,onOpenChange:n,children:[o.jsx(P$,{asChild:!0,children:f}),o.jsx(xE,{ref:i,align:"end",sideOffset:8,tabIndex:-1,"aria-labelledby":s,"data-testid":"notification-panel","data-variant":"popover",onOpenAutoFocus:w=>{w.preventDefault(),m()},className:"psfa-nx-popover tw:flex tw:w-96 tw:max-w-[calc(100vw-2rem)] tw:max-h-[min(480px,var(--radix-popover-content-available-height))] tw:flex-col tw:rounded-lg tw:border-border tw:bg-card tw:p-0 tw:font-rubik tw:antialiased tw:text-left tw:shadow-lg",children:o.jsx(vR,{phone:!1,focusPanel:m,title:o.jsx("h2",{id:s,className:"tw:m-0 tw:text-sm tw:font-semibold tw:leading-normal tw:text-foreground",children:Ka.title})})})]})}const OF=120,PF="tw:hover:bg-primary/90";function Rb({action:e,phone:t,onActivate:n,variant:a}){const r=E(a==="default"&&PF,a==="link"?"tw:h-auto tw:p-0 tw:font-medium tw:underline tw:underline-offset-4 tw:hover:text-link/80":"tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:[touch-action:manipulation]",a!=="link"&&t&&"tw:h-11 tw:w-full tw:whitespace-normal tw:text-[15px] tw:leading-tight");if(e.url){const s=i=>{i.button>1||n(e,!0)};return o.jsx(Ae,{asChild:!0,variant:a,className:r,children:o.jsx("a",{href:e.url,target:e.newTab?"_blank":void 0,rel:e.newTab?"noopener noreferrer":void 0,onClick:s,onAuxClick:s,className:E("tw:no-underline",a==="default"&&"tw:hover:text-primary-foreground tw:focus:text-primary-foreground"),children:e.label})})}return o.jsx(Ae,{type:"button",variant:a,className:r,onClick:()=>n(e,!1),children:e.label})}function zF({item:e,position:t,total:n,phone:a,phase:r,animateIn:s,onActivate:i,onLater:l,title:c,description:u}){const m=Eb(e),f=e.actions.filter(y=>y.kind!=="link"),w=e.actions.filter(y=>y.kind==="link"),p=e.lines.length>0?w:[],x=e.lines.length>0?[]:w,b=f.some(y=>y.kind==="primary");return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:E("tw:flex tw:min-h-8 tw:items-center tw:gap-2.5 tw:pr-10",a?"tw:mb-3 tw:min-h-11":"tw:mb-4"),children:n>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"tw:flex tw:gap-1","aria-hidden":"true",children:Array.from({length:n},(y,h)=>o.jsx("i",{className:E("tw:block tw:h-1 tw:w-4 tw:rounded-full tw:transition-colors tw:duration-200",h<t?"tw:bg-muted-foreground/50":h===t?"tw:bg-primary":"tw:bg-secondary")},h))}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:tabular-nums",children:Ka.position(t+1,n)})]}):null}),o.jsxs("div",{className:E(r==="leaving"?"psfa-nx-swap-out":s?"psfa-nx-swap-in":void 0),children:[o.jsx("div",{className:"tw:mb-4 tw:grid tw:size-10 tw:place-items-center tw:rounded-lg tw:bg-info-soft tw:text-info",children:o.jsx(m,{className:"tw:size-5","aria-hidden":"true"})}),c,u,o.jsxs("div",{className:E("tw:mt-6 tw:flex tw:flex-wrap tw:items-center tw:gap-2",a&&"tw:flex-col tw:items-stretch tw:gap-1"),children:[f.map(y=>o.jsx(_b,{note:y.note,noteClassName:"tw:text-muted-foreground",children:o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:y.kind==="primary"?"default":"outline"})},`${y.kind}-${y.label}`)),o.jsx(Ae,{type:"button",variant:a&&b?"ghost":"outline",onClick:l,className:E("tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:[touch-action:manipulation]",a&&"tw:h-11 tw:w-full tw:text-[15px]",a&&b&&"tw:text-foreground tw:hover:bg-accent"),children:Ka.later}),x.map(y=>o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:"link"},`${y.kind}-${y.label}`))]}),e.hint?o.jsx("p",{"data-testid":"notification-modal-hint",className:"tw:m-0 tw:mt-3 tw:text-[13px] tw:leading-snug tw:text-muted-foreground",children:e.hint}):null,e.lines.length>0?o.jsxs("div",{"data-testid":"notification-modal-footer",className:"tw:mt-6 tw:flex tw:flex-col tw:gap-4",children:[o.jsx(mm,{}),o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:leading-relaxed tw:text-muted-foreground",children:[e.lines.join(" "),p.map(y=>o.jsxs("span",{children:[" ",o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:"link"})]},`${y.kind}-${y.label}`))]})]}):null]},e.id)]})}function LF(){const{queue:e,queueIndex:t,advanceQueue:n,bellRef:a}=du(),r=Tb(gR),[s,i]=d.useState(t),[l,c]=d.useState("idle"),u=d.useRef(!1),m=d.useRef(null),f=d.useRef([]);d.useEffect(()=>{const S=f.current;return()=>S.forEach(N=>window.clearTimeout(N))},[]),d.useEffect(()=>{var S;s>0&&s<e.length&&((S=m.current)==null||S.focus({preventScroll:!0}))},[s,e.length]);const w=e[s]??null,p=w!==null,x=S=>{if(u.current||!w)return;u.current=!0;const N=s+1;if(n(S),N>=e.length){i(N),u.current=!1;return}c("leaving"),f.current.push(window.setTimeout(()=>{c("idle"),i(N),u.current=!1},OF))},b=(S,N)=>{if(!(S.kind!=="primary"&&!S.marksRead)){if(N){f.current.push(window.setTimeout(()=>x("read"),0));return}x("read")}};if(e.length===0)return null;const y={ref:m,tabIndex:-1,"data-testid":"notification-modal",onOpenAutoFocus:S=>{var N;S.preventDefault(),(N=m.current)==null||N.focus({preventScroll:!0})},onCloseAutoFocus:S=>{var N;S.preventDefault(),(N=a.current)==null||N.focus({preventScroll:!0})},onEscapeKeyDown:S=>{S.preventDefault(),x("later")},onInteractOutside:S=>S.preventDefault()},h=S=>{S||x("read")},g=w??e[e.length-1];if(!g)return null;const v=(S,N)=>o.jsx(zF,{item:g,position:Math.min(s,e.length-1),total:e.length,phone:r,phase:l,animateIn:s>0,onActivate:b,onLater:()=>x("later"),title:o.jsx(S,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:leading-snug tw:tracking-[-0.01em] tw:text-foreground tw:[text-wrap:balance] tw:[overflow-wrap:anywhere]",children:g.title}),description:o.jsx(N,{className:"tw:m-0 tw:mt-2 tw:text-sm tw:leading-relaxed tw:text-muted-foreground tw:[text-wrap:pretty] tw:[overflow-wrap:anywhere]",children:g.body})});return r?o.jsx(Wc,{open:p,onOpenChange:h,children:o.jsx(Ii,{...y,side:"bottom","data-variant":"sheet",overlayClassName:"psfa-nx-overlay psfa-nx-overlay--queue tw:bg-scrim",closeClassName:"tw:top-3.5 tw:right-3 tw:grid tw:size-11 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-sheet psfa-nx-sheet--queue tw:block tw:max-h-[86dvh] tw:overflow-y-auto tw:overscroll-contain tw:rounded-t-2xl tw:border-border tw:p-5 tw:pb-[calc(1.25rem+env(safe-area-inset-bottom,0px))] tw:font-rubik tw:antialiased tw:shadow-xl tw:transition-none tw:outline-none",children:v($i,Zc)})}):o.jsx(Qf,{open:p,onOpenChange:h,children:o.jsx(Jf,{...y,"data-variant":"dialog",overlayClassName:"psfa-nx-overlay psfa-nx-overlay--queue",closeClassName:"tw:top-5 tw:right-4 tw:grid tw:size-8 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-dialog tw:top-[14%] tw:block tw:w-[calc(100%-2rem)] tw:max-w-md tw:translate-y-0 tw:max-h-[calc(86%-1rem)] tw:overflow-y-auto tw:overscroll-contain tw:font-rubik tw:antialiased tw:outline-none",children:v(Hc,a_)})})}const IF=240,$F={red:"destructive",amber:"warning",info:"info"},BF="tw:max-[781px]:h-11 tw:max-[781px]:w-full tw:max-[781px]:whitespace-normal tw:max-[781px]:leading-tight";function UF({action:e}){const t=e.kind==="primary"?"default":e.kind==="secondary"?"outline":"link",n=E(t==="default"&&"tw:hover:bg-primary/90",t==="link"?"tw:h-auto tw:px-0 tw:font-medium tw:text-current tw:underline tw:max-[781px]:min-h-11":E("tw:gap-1.5 tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100",BF)),a=o.jsxs(o.Fragment,{children:[e.label,e.url&&!e.newTab&&t!=="link"?o.jsx(bg,{"aria-hidden":"true"}):null]});return e.url?o.jsx(Ae,{asChild:!0,size:"sm",variant:t,className:n,children:o.jsx("a",{href:e.url,target:e.newTab?"_blank":void 0,rel:e.newTab?"noopener noreferrer":void 0,className:E("tw:no-underline",t==="default"&&"tw:hover:text-primary-foreground tw:focus:text-primary-foreground"),children:a})}):o.jsx(Ae,{type:"button",size:"sm",variant:t,className:n,children:a})}function HF(){const{items:e,hideBanner:t,setPanelOpen:n,bellRef:a}=du(),[r,s]=d.useState(null),[i,l]=d.useState(!1),c=d.useRef(null),u=d.useRef(!1),m=d.useRef(void 0),f=uu(),w=xF(e,f),p=r??w,x=cu(e,f);if(d.useEffect(()=>()=>window.clearTimeout(m.current),[]),d.useEffect(()=>{var g;!u.current||r||(u.current=!1,(g=c.current??a.current)==null||g.focus({preventScroll:!0}))},[r,w,a]),!p)return null;const b=x.filter(g=>g.id!==p.id).length,y=Eb(p),h=()=>{r||(u.current=!0,t(p.id),!TF()&&(s(p),l(!0),m.current=window.setTimeout(()=>s(null),IF)))};return o.jsx("div",{className:E("psfa-nx-banner",r?"psfa-nx-banner--gone":i&&"psfa-nx-banner-in"),"aria-hidden":r?!0:void 0,children:o.jsx("div",{className:"tw:min-h-0 tw:overflow-hidden",children:o.jsxs(ln,{variant:$F[p.tone],"data-testid":"fault-banner","data-tone":p.tone,className:"tw:mb-6 tw:pr-12 tw:leading-normal tw:max-[781px]:pr-14",children:[o.jsx(y,{className:"tw:size-4","aria-hidden":"true"}),o.jsx(Va,{className:"tw:leading-snug tw:[overflow-wrap:anywhere]",children:p.title}),o.jsxs(Gn,{className:"tw:[overflow-wrap:anywhere]",children:[p.body?o.jsx("p",{className:"tw:m-0",children:p.body}):null,p.lines.map(g=>o.jsx("p",{className:"tw:m-0 tw:mt-1",children:g},g)),p.actions.length>0||b>0?o.jsxs("div",{className:"tw:mt-3 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2 tw:max-[781px]:flex-col tw:max-[781px]:items-stretch",children:[p.actions.map(g=>o.jsx(_b,{note:g.note,children:o.jsx(UF,{action:g})},`${g.kind}-${g.label}`)),b>0?o.jsx(Ae,{type:"button",variant:"link",size:"sm",onClick:()=>n(!0),className:"tw:h-auto tw:px-0 tw:font-medium tw:text-current tw:underline tw:underline-offset-4 tw:max-[781px]:min-h-11",children:Ka.andMore(b)}):null]}):null,p.hint?o.jsx("p",{"data-testid":"fault-banner-hint",className:"tw:m-0 tw:mt-2.5 tw:text-[13px]",children:p.hint}):null]}),o.jsx("div",{className:"tw:pointer-events-none tw:absolute tw:top-2.5 tw:right-2.5 tw:flex tw:justify-end tw:max-[781px]:top-1.5 tw:max-[781px]:right-1.5",children:o.jsx("button",{ref:c,type:"button",onClick:h,"aria-label":Ka.dismiss,className:"tw:pointer-events-auto tw:grid tw:size-7 tw:cursor-pointer tw:place-items-center tw:rounded-md tw:border-0 tw:bg-transparent tw:p-0 tw:text-current tw:opacity-75 tw:transition-[opacity,background-color] tw:duration-150 tw:hover:bg-foreground/5 tw:hover:opacity-100 tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:max-[781px]:size-11",children:o.jsx(Eg,{className:"tw:size-4","aria-hidden":"true"})})})]})})},p.id)}async function kb(e,t={},n=!1){const a=window.psfaAdmin,r=window.psfaAjax;if(n&&!a)return{success:!1,message:"PSFA admin config not found"};if(!n&&!r)return{success:!1,message:"PSFA ajax config not found"};const s=n?a.ajaxUrl:r.ajaxurl,i=n?a.nonce:r.nonce,l=new FormData;l.append("action",e),l.append("nonce",i),Object.entries(t).forEach(([c,u])=>{u!=null&&l.append(c,String(u))});try{const c=await fetch(s,{method:"POST",body:l,credentials:"same-origin"});return c.ok?await c.json():{success:!1,message:`HTTP error: ${c.status}`}}catch(c){return{success:!1,message:c instanceof Error?c.message:"Unknown error"}}}const FF=["system","light","dark"],yR="psfa-theme-";function SR(e){return typeof e=="string"&&FF.includes(e)}function jR(e){const t=e&&typeof e=="object"?e:{},n=t.sidebarCollapsed;return{theme:SR(t.theme)?t.theme:"system",sidebarCollapsed:n===!0||n==="1"||n===1}}function VF(e,t=document.body){for(const n of Array.from(t.classList))n.startsWith(yR)&&t.classList.remove(n);t.classList.add(yR+e)}async function GF(e){var n;const t=await kb("psfa_save_admin_prefs",{theme:e.theme,sidebar_collapsed:e.sidebarCollapsed?"1":"0"},!0);if(!t||t.success!==!0)throw new Error((t==null?void 0:t.message)||"psfa_save_admin_prefs failed");return jR(((n=t.data)==null?void 0:n.adminPrefs)??e)}const NR=d.createContext(null);function yo(){return d.useContext(NR)}const YF="(max-width: 781px)",CR="psfa-phone-nav-trigger",Mb=[{value:"system",label:"System",icon:VP},{value:"light",label:"Light",icon:qP},{value:"dark",label:"Dark",icon:GP}];function KF(){const e=yo();if(!e)return null;const t=Mb.find(a=>a.value===e.theme)??Mb[0],n=t.icon;return o.jsxs(Yx,{children:[o.jsx(Kx,{asChild:!0,children:o.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":`Theme: ${t.label}`,title:`Theme: ${t.label}`,className:E(Ab,e.isPhone&&"tw:size-11"),children:o.jsx(n,{"aria-hidden":"true"})})}),o.jsx(om,{align:"end",sideOffset:6,className:"psfa-menu tw:min-w-44",children:o.jsx(s$,{value:e.theme,onValueChange:a=>{SR(a)&&e.setTheme(a)},children:Mb.map(({value:a,label:r,icon:s})=>o.jsxs(rE,{value:a,className:"psfa-menu-item tw:gap-2.5 tw:pl-2.5 tw:[&>span:first-child]:hidden",children:[o.jsx(s,{"aria-hidden":"true",className:"tw:size-4 tw:text-muted-foreground"}),o.jsx("span",{className:E("tw:flex-1",e.theme===a&&"tw:font-semibold"),children:r}),e.theme===a?o.jsx(yr,{"aria-hidden":"true",className:"tw:size-4 tw:text-foreground"}):null]},a))})})]})}function AR(){return o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5","data-testid":"psfa-header-tools",children:[o.jsx(KF,{}),o.jsx(DF,{})]})}const cs={account:"https://paapiplugin.com/account/",upgrade:"https://paapiplugin.com/pricing/",affiliates:"https://paapiplugin.com/affiliates/",support:"https://paapiplugin.com/support/",docs:"https://paapiplugin.com/documentation/",review:"https://wordpress.org/support/plugin/paapi-product-search-for-amazon/reviews/"},_R="psfa-menu-item tw:min-h-9 tw:gap-2.5 tw:px-2.5 tw:text-foreground tw:no-underline tw:cursor-pointer tw:max-[782px]:min-h-11";function Em({href:e,icon:t,label:n}){return o.jsx(Pi,{asChild:!0,className:_R,children:o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer","data-label":n,children:[o.jsx(t,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:flex-1",children:n}),o.jsx(pN,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})})}function qF({collapsed:e,phone:t=!1}){const n=yo(),a=d.useRef(null),r=o.jsx(Kx,{asChild:!0,children:o.jsxs("button",{ref:a,type:"button","aria-label":e?"Help":void 0,className:E(wR,"tw:group/help",e&&"tw:w-11 tw:justify-center tw:px-0",t&&"tw:min-h-11"),children:[o.jsx(MP,{"aria-hidden":"true",className:"tw:size-[18px] tw:shrink-0 tw:text-sidebar-muted"}),e?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"psfa-sb-reveal tw:flex-1",children:"Help"}),o.jsx(mN,{"aria-hidden":"true",className:"tw:size-4 tw:text-sidebar-muted tw:group-data-[state=open]/help:hidden"}),o.jsx(bc,{"aria-hidden":"true",className:"tw:hidden tw:size-4 tw:text-sidebar-muted tw:group-data-[state=open]/help:block"})]})]})});return o.jsxs(Yx,{modal:!1,children:[e?o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:r}),o.jsx(Hi,{side:"right",sideOffset:10,className:pR,children:"Help"})]}):r,o.jsxs(om,{side:e?"right":"top",align:e?"end":"start",sideOffset:8,className:"psfa-menu tw:w-56",children:[o.jsx(Em,{href:cs.support,icon:UP,label:"Support"}),o.jsx(Em,{href:cs.docs,icon:TP,label:"Docs"}),o.jsxs(Pi,{className:_R,"data-label":"What's new",onSelect:()=>n==null?void 0:n.openWhatsNew(a.current),children:[o.jsx(Ag,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:flex-1",children:"What's new"})]}),o.jsx(Em,{href:cs.affiliates,icon:ZP,label:"Affiliates"}),o.jsx(qx,{className:"tw:bg-border"}),o.jsx(Em,{href:cs.review,icon:cf,label:"Leave a review"})]})]})}function XF({to:e}){const t=jn();return o.jsx(rN,{to:{pathname:e,search:t.search},replace:!0})}function Nt(){return typeof window>"u"?{}:window.psfaAdmin??{}}function WF(){const{needsLicense:e,fsAffix:t}=Nt();return!e||!t?null:o.jsxs("div",{role:"status",className:"tw:mb-5 tw:flex tw:flex-wrap tw:items-center tw:gap-3 tw:rounded-[10px] tw:border tw:border-solid tw:border-ring tw:bg-info-soft tw:px-4 tw:py-3.5 tw:text-foreground",children:[o.jsx(IP,{"aria-hidden":"true",className:"tw:size-[18px] tw:shrink-0 tw:text-info"}),o.jsx("div",{className:"tw:min-w-0 tw:flex-1",children:o.jsx("p",{className:"tw:m-0 tw:text-sm tw:font-medium tw:text-foreground",children:"Premium version detected! Please activate your license to unlock all features."})}),o.jsx("a",{href:"#",className:E(`activate-license-trigger ${t}`,gf({variant:"default"}),"tw:shrink-0 tw:rounded-[10px] tw:no-underline tw:hover:bg-primary-hover tw:hover:text-primary-foreground tw:max-[640px]:w-full"),children:"Activate License"})]})}function ZF({title:e}){const t=yo();return t?o.jsxs("div",{"data-testid":"psfa-mobile-bar",className:"tw:sticky tw:top-0 tw:z-20 tw:flex tw:min-h-[52px] tw:items-center tw:gap-2 tw:border-b tw:border-solid tw:border-border tw:bg-card tw:pr-[max(8px,env(safe-area-inset-right,0px))] tw:pl-[max(8px,env(safe-area-inset-left,0px))] tw:min-[601px]:top-[var(--wp-admin--admin-bar--height,46px)]",children:[o.jsxs(Ae,{id:CR,type:"button",variant:"outline","aria-expanded":t.sheetOpen,"aria-controls":"psfa-phone-nav",onClick:()=>t.setSheetOpen(!0),className:"tw:h-11 tw:gap-2 tw:rounded-lg tw:pr-3 tw:pl-2 tw:text-sm tw:font-medium tw:touch-manipulation tw:select-none tw:active:scale-[0.97] tw:motion-reduce:active:scale-100",children:[o.jsx(iR,{decorative:!0,className:"tw:size-[22px]"}),"Menu"]}),o.jsx("span",{"aria-hidden":"true",className:"tw:min-w-0 tw:flex-1 tw:truncate tw:text-sm tw:font-semibold tw:text-foreground",children:e}),o.jsx(AR,{})]}):null}function fu({title:e,description:t,actions:n}){const a=yo(),r=!!a&&!a.isPhone;return o.jsxs("header",{"data-testid":"admin-page-header",className:"tw:mb-7 tw:flex tw:items-end tw:justify-between tw:gap-4 tw:max-[782px]:mb-5 tw:max-[782px]:flex-col tw:max-[782px]:items-stretch tw:max-[782px]:gap-3",children:[o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("h1",{tabIndex:-1,"data-page-title":"true",className:"tw:m-0 tw:p-0 tw:text-[26px] tw:font-semibold tw:leading-[1.2] tw:tracking-[-0.012em] tw:text-balance tw:text-foreground tw:outline-none",children:e}),t?o.jsx("p",{className:"tw:m-0 tw:mt-1.5 tw:max-w-[64ch] tw:text-sm tw:leading-normal tw:text-muted-foreground",children:t}):null]}),r||n?o.jsxs("div",{className:"tw:flex tw:shrink-0 tw:items-center tw:gap-1.5",children:[r?o.jsx(AR,{}):null,n]}):null]})}function QF({label:e,tabs:t}){const{pathname:n}=jn();return o.jsx("nav",{"aria-label":e,className:"tw:mb-6 tw:inline-flex tw:gap-1 tw:rounded-[10px] tw:bg-secondary tw:p-1",children:t.map(a=>{const r=n.replace(/\/+$/,"")===a.to;return o.jsx(Bn,{to:a.to,"aria-current":r?"page":void 0,className:E("tw:inline-flex tw:h-8 tw:items-center tw:rounded-lg tw:px-3.5 tw:text-sm tw:font-medium tw:no-underline tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:max-[782px]:h-10",r?"tw:bg-card tw:text-foreground tw:shadow-psfa-xs":"tw:text-muted-foreground tw:hover:text-foreground"),children:a.label},a.to)})})}const se={home:"/",boxes:"/boxes",boxNew:"/boxes/new",tables:"/tables",lists:"/lists",search:"/search",searchSettings:"/search/settings",appearance:"/appearance",analytics:"/analytics",connection:"/settings/connection",geotargeting:"/settings/geotargeting",cache:"/settings/cache",importExport:"/settings/import-export"},ER={credentials:se.connection,geotargeting:se.geotargeting,lists:se.lists,features:se.home,appearance:se.appearance,themes:se.appearance,layout:se.searchSettings,customization:se.appearance,shortcode:se.search,"api-offers-test":se.home,"api-oauth-test":se.home,cache:se.cache,"comparison-tables":se.tables,"product-boxes":se.boxes,analytics:se.analytics},JF={"/credentials":se.connection,"/geotargeting":se.geotargeting,"/features":se.home,"/layout":se.searchSettings,"/appearance/layout":se.searchSettings,"/shortcode":se.search,"/cache":se.cache,"/addon-comparison-tables":se.tables,"/addon-product-boxes":se.boxes,"/addon-analytics":se.analytics,"/api-offers":se.home,"/api-oauth":se.home,"/settings":se.connection};function eV(e,t){if(t&&t!=="#"&&t!=="#/")return null;const n=new URLSearchParams(e).get("section");return!n||!Object.prototype.hasOwnProperty.call(ER,n)?null:"#"+ER[n]}const TR="whats-new",RR={label:"Search pages",tabs:[{to:se.search,label:"Shortcode"},{to:se.searchSettings,label:"Settings"}]},tV={[se.tables]:{title:"Comparison tables",description:"Create product comparison tables."},[se.lists]:{title:"Lists",description:"Build top seller and new release lists that refresh themselves."},[se.search]:{title:"Search",description:"Generate shortcodes for your pages.",tabs:RR},[se.searchSettings]:{title:"Search",description:"Settings for every search on your site.",tabs:RR},[se.appearance]:{title:"Appearance",description:"Configure colors, style, fonts, dark mode and deal badges."},[se.analytics]:{title:"Analytics",description:"Track visitor interactions and view insights."},[se.connection]:{title:"Amazon connection",description:"How the plugin gets product data from Amazon."},[se.geotargeting]:{title:"Geotargeting",description:"Send each visitor to their own Amazon store, with your tag for it."},[se.cache]:{title:"Cache",description:"View and manage cached API responses."},[se.importExport]:{title:"Import and export",description:"Copy your settings from one site to another."}};function nV(e){const t=e.length>1?e.replace(/\/+$/,""):e;return tV[t]??null}function aV(e){const t=e.length>1?e.replace(/\/+$/,""):e;return t===se.boxes||t.startsWith(se.boxes+"/")?se.boxes:t===se.searchSettings?se.search:t}function rV(e){const t=!e,n={to:se.boxes,label:"Product boxes",icon:Zo,locked:!1},a={to:se.tables,label:"Comparison tables",icon:_g,locked:!1},r={to:se.search,label:"Search",icon:yc,locked:!1},s={to:se.lists,label:"Lists",icon:xN,locked:t},i={to:se.connection,label:"Amazon connection",icon:yN,locked:!1},l={to:se.appearance,label:"Appearance",icon:Ng,locked:!1},c={to:se.cache,label:"Cache",icon:yg,locked:!1},u={to:se.geotargeting,label:"Geotargeting",icon:Sg,locked:t},m={to:se.importExport,label:"Import and export",icon:SP,locked:t},f={to:se.analytics,label:"Analytics",icon:xc,locked:t};return[{id:"home",items:[{to:se.home,label:"Home",icon:LP,locked:!1}]},{id:"create",label:"Create",items:t?[n,a,r,s]:[n,a,s,r]},{id:"settings",label:"Settings",items:t?[i,l,c,u,m]:[i,l,u,c,m]},{id:"insights",label:"Insights",items:[f]}]}function oV(){const e=typeof navigator<"u"?navigator.platform||navigator.userAgent:"";return/Mac|iPhone|iPad/i.test(e)?"⌘ B":"Ctrl B"}function Tm({show:e,label:t,kbd:n,children:a}){return e?o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:a}),o.jsxs(Hi,{side:"right",sideOffset:10,className:pR,children:[t,n?o.jsx("kbd",{className:"tw:ml-1.5 tw:bg-transparent tw:font-mono tw:text-[11px] tw:opacity-75",children:n}):null]})]}):o.jsx(o.Fragment,{children:a})}function sV(){return o.jsx(Ar,{variant:"outline",className:"psfa-sb-reveal tw:h-[18px] tw:shrink-0 tw:rounded-full tw:border-0 tw:bg-pro-soft tw:px-1.5 tw:py-0 tw:text-[10.5px] tw:font-semibold tw:leading-none tw:tracking-[0.04em] tw:text-pro tw:shadow-none",children:"PRO"})}function iV({item:e,active:t,collapsed:n,phone:a,onNavigate:r}){const s=e.icon,i=n?e.label+(e.locked?", Premium":""):void 0;return o.jsx(Tm,{show:n,label:e.locked?`${e.label} (PRO)`:e.label,children:o.jsxs(Bn,{to:e.to,"data-label":e.label,"aria-current":t?"page":void 0,"aria-label":i,onClick:r,className:E("tw:relative tw:flex tw:min-h-[38px] tw:pointer-coarse:min-h-11 tw:items-center tw:gap-2.5 tw:rounded-lg tw:px-2 tw:text-sm tw:font-normal tw:text-sidebar-foreground tw:no-underline tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",t?"tw:bg-sidebar-primary tw:font-semibold tw:text-sidebar-primary-foreground tw:shadow-psfa-card":"tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground",n&&"tw:mx-auto tw:w-11 tw:justify-center tw:px-0",a&&"tw:min-h-11"),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:size-[18px] tw:shrink-0",t?"tw:text-sidebar-icon-active":"tw:text-sidebar-muted")}),n?null:o.jsx("span",{className:"psfa-sb-reveal tw:min-w-0 tw:flex-1 tw:truncate",children:e.label}),e.locked&&!n?o.jsx(sV,{}):null,e.locked&&n?o.jsx("span",{"aria-hidden":"true",className:"tw:absolute tw:top-[7px] tw:right-2 tw:size-1.5 tw:rounded-full tw:bg-sidebar-icon-active"}):null]})})}function lV({collapsed:e,isPremium:t,phone:n}){const a=t?"Account":"Upgrade",r=t?cs.account:Nt().upgradeUrl||cs.upgrade,s=t?WP:Ag;return o.jsx(Tm,{show:e,label:a,children:o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":e?`${a} (opens in a new tab)`:void 0,className:E(wR,e&&"tw:w-11 tw:justify-center tw:px-0",n&&"tw:min-h-11"),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:size-[18px] tw:shrink-0",t?"tw:text-sidebar-muted":"tw:text-sidebar-icon-active")}),e?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"psfa-sb-reveal tw:flex-1",children:a}),o.jsx(AP,{"aria-hidden":"true",className:"tw:size-3.5 tw:text-sidebar-muted"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})]})})}function kR({collapsed:e,phone:t,onNavigate:n}){const a=yo(),r=jn(),s=!!(a!=null&&a.isPremium),i=aV(r.pathname),l=e?"Expand sidebar":"Collapse sidebar";return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:E("tw:flex tw:h-14 tw:shrink-0 tw:items-center tw:justify-between tw:gap-2 tw:pr-2.5 tw:pl-4",e&&"tw:h-auto tw:flex-col tw:justify-center tw:px-0 tw:pt-3 tw:pb-2.5"),children:[o.jsx(Tm,{show:e,label:"Home",children:o.jsx(Bn,{to:"/","aria-label":"PaapiPlugin home",onClick:n,className:E("tw:flex tw:items-center tw:rounded-md tw:outline-none tw:pointer-coarse:min-h-11 tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",t&&"tw:min-h-11"),children:o.jsx(iR,{decorative:!0})})}),t?null:o.jsx(Tm,{show:!0,label:l,kbd:oV(),children:o.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":l,"aria-controls":"psfa-sidebar","aria-expanded":!e,onClick:()=>a==null?void 0:a.toggleCollapsed(!1),className:E(Ab,"tw:text-sidebar-muted tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground"),children:o.jsx(bN,{"aria-hidden":"true"})})})]}),o.jsx("nav",{"aria-label":"PaapiPlugin pages",className:"psfa-scroll tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:px-2 tw:py-2.5",children:rV(s).map(c=>{const u=c.label?`psfa-nav-group-${c.id}${t?"-sheet":""}`:void 0;return o.jsxs("div",{"data-testid":`nav-group-${c.id}`,className:E(c.id!=="home"&&"tw:mt-3.5",c.id!=="home"&&e&&"tw:mt-2 tw:border-t tw:border-solid tw:border-sidebar-border tw:pt-2"),children:[c.label&&!e?o.jsx("span",{id:u,className:"psfa-sb-reveal tw:block tw:px-2.5 tw:pb-1 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-sidebar-muted",children:c.label}):null,o.jsx("ul",{"aria-labelledby":c.label&&!e?u:void 0,className:"tw:m-0 tw:flex tw:list-none tw:flex-col tw:gap-0.5 tw:p-0",children:c.items.map(m=>o.jsx("li",{className:"tw:m-0",children:o.jsx(iV,{item:m,active:i===m.to,collapsed:e,phone:t,onNavigate:n})},m.to))})]},c.id)})}),o.jsxs("div",{className:E("tw:flex tw:shrink-0 tw:flex-col tw:gap-1.5 tw:px-2 tw:pt-2.5 tw:pb-3",e&&"tw:items-center"),children:[o.jsx(lV,{collapsed:e,isPremium:s,phone:t}),o.jsx(qF,{collapsed:e,phone:t})]})]})}function cV(){const e=yo(),t=!!(e!=null&&e.collapsed);return o.jsx(Ui,{delayDuration:380,skipDelayDuration:500,children:o.jsx("aside",{id:"psfa-sidebar","data-testid":"psfa-sidebar","aria-label":"PaapiPlugin","data-collapsed":t?"true":"false","data-expanding":e!=null&&e.expanding?"true":void 0,className:E("tw:sticky tw:top-[var(--wp-admin--admin-bar--height,32px)] tw:flex tw:h-[calc(100dvh-var(--wp-admin--admin-bar--height,32px))] tw:shrink-0 tw:flex-col tw:border-r tw:border-solid tw:border-sidebar-border tw:bg-sidebar tw:text-sidebar-foreground",t?"tw:w-[60px]":"tw:w-[244px]"),children:o.jsx(kR,{collapsed:t,phone:!1})})})}function uV(){const e=yo(),t=d.useRef(!1);if(!e)return null;const n=()=>{t.current=!0,e.setSheetOpen(!1)},a=r=>{var s,i;if(r.preventDefault(),t.current){t.current=!1,(s=document.querySelector("[data-page-title]"))==null||s.focus({preventScroll:!0});return}(i=document.getElementById(CR))==null||i.focus()};return o.jsx(Wc,{open:e.sheetOpen,onOpenChange:e.setSheetOpen,children:o.jsxs(Ii,{id:"psfa-phone-nav",side:"left","data-psfa-sheet":"nav",onCloseAutoFocus:a,overlayClassName:"tw:z-[100000]",closeClassName:"tw:top-1.5 tw:right-1.5 tw:grid tw:size-11 tw:place-items-center tw:rounded-lg tw:text-sidebar-muted tw:opacity-100 tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground tw:focus:ring-sidebar-ring tw:focus:ring-offset-0",className:"tw:z-[100000] tw:flex tw:w-[min(300px,86vw)] tw:flex-col tw:gap-0 tw:border-sidebar-border tw:bg-sidebar tw:p-0 tw:pt-[env(safe-area-inset-top,0px)] tw:pb-[env(safe-area-inset-bottom,0px)] tw:pl-[env(safe-area-inset-left,0px)] tw:font-rubik tw:text-sidebar-foreground tw:antialiased tw:ease-psfa-drawer tw:data-[state=open]:duration-[240ms] tw:data-[state=closed]:duration-200 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:fade-out-0 tw:sm:max-w-none",children:[o.jsx($i,{className:"tw:sr-only",children:"PaapiPlugin menu"}),o.jsx(Zc,{className:"tw:sr-only",children:"Pages, account and help."}),o.jsx(kR,{collapsed:!1,phone:!0,onNavigate:n})]})})}const dV="Couldn't save that setting, so it lasts until you reload the page. Try again in a moment.";function fV(){const[e,t]=d.useState(()=>jR(Nt().adminPrefs)),n=d.useRef(e);d.useLayoutEffect(()=>{VF(e.theme)},[e.theme]);const a=d.useCallback(l=>{n.current=l,t(l);const c=window.psfaAdmin;c&&(c.adminPrefs=l),GF(l).catch(()=>{_e.error(dV)})},[]),r=d.useCallback(l=>{l!==n.current.theme&&a({...n.current,theme:l})},[a]),s=d.useCallback(l=>{l!==n.current.sidebarCollapsed&&a({...n.current,sidebarCollapsed:l})},[a]),i=d.useCallback(()=>{s(!n.current.sidebarCollapsed)},[s]);return{...e,setTheme:r,setSidebarCollapsed:s,toggleSidebar:i,latest:n}}const mV=[{version:"2.43.0",entries:[{title:"Color and size for the buy button",body:"With Premium, Buy Button in Appearance sets a color for the buy button and a size from 80% to 150%. Leave the color empty to keep following your Accent Color. It applies to search results, lists, every product box style and comparison tables."}]},{version:"2.42.0",entries:[{title:"Copy your settings to another site",body:"With Premium, export your Appearance, Search display and Geotargeting settings from one site and import them on the next, from Import and export under Settings."}]},{version:"2.41.0",entries:[{title:"Color and size for product text",body:"With Premium, Product Text in Appearance sets the color and size of titles, brands, prices and deal badges in boxes, tables, lists and search results."},{title:"Prices in your accent color",body:"Prices on every box, card, list and table now use your accent's price color by default. A Product Text color still takes priority."},{title:"Your secret keys are stored encrypted",body:"Your own Amazon API secret keys are now stored encrypted and are no longer sent to the browser."}]},{version:"2.40.0",entries:[{title:"Button text color",body:"With Premium, pick Auto, White or Dark for the text on buttons and badges in Appearance."}]},{version:"2.38.0",entries:[{title:"A new admin, organized by what you do",body:"Home, Create and Settings replace the old menu groups. Old links still land on the right page."},{title:"Build a product box with a live preview",body:"Search Amazon or paste a link, see the box as your site shows it, then copy the shortcode."},{title:"Dark mode for these screens",body:"Pick System, Light or Dark from the header. WordPress keeps its own colors."},{title:"Clicks and views from boxes and tables",body:"With Premium, Analytics now counts clicks and views on your product boxes and comparison tables. Your box list shows each box's clicks for the last 7 days."},{title:"Give a box your own title",body:"Type a title when you build a box and it shows instead of Amazon's."}]}];function wV(){const e=yo();return e?o.jsx(Wc,{open:e.whatsNewOpen,onOpenChange:t=>{t||e.closeWhatsNew()},children:o.jsxs(Ii,{side:"right","data-psfa-sheet":"whats-new",overlayClassName:"tw:z-[100000]",closeClassName:"tw:top-3 tw:right-3 tw:grid tw:size-9 tw:place-items-center tw:rounded-lg tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground tw:focus:ring-offset-0 tw:max-[782px]:size-11",onCloseAutoFocus:t=>{const n=e.whatsNewReturnFocus();n&&n.isConnected&&(t.preventDefault(),n.focus())},className:"tw:z-[100000] tw:flex tw:w-[min(420px,100vw)] tw:flex-col tw:gap-0 tw:border-border tw:bg-card tw:p-0 tw:pr-[env(safe-area-inset-right,0px)] tw:pb-[env(safe-area-inset-bottom,0px)] tw:font-rubik tw:text-foreground tw:antialiased tw:ease-psfa-drawer tw:data-[state=open]:duration-[240ms] tw:data-[state=closed]:duration-200 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:fade-out-0 tw:sm:max-w-none",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:border-b tw:border-solid tw:border-border tw:py-4 tw:pr-16 tw:pl-5",children:[o.jsx($i,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:text-foreground",children:"What's new"}),o.jsx(Zc,{className:"tw:sr-only",children:"Changes in recent versions of PaapiPlugin."})]}),o.jsx("div",{className:"psfa-scroll tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:px-5 tw:pt-1 tw:pb-6",children:mV.map(t=>o.jsxs("section",{"aria-label":`Version ${t.version}`,children:[o.jsxs("p",{className:"tw:m-0 tw:pt-4 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-muted-foreground",children:["New in ",t.version]}),t.entries.map(n=>o.jsxs("article",{className:"tw:border-b tw:border-solid tw:border-border tw:py-4 tw:last:border-b-0",children:[o.jsx("h3",{className:"tw:m-0 tw:mb-1 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",children:n.title}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:leading-normal tw:text-muted-foreground",children:n.body})]},n.title))]},t.version))})]})}):null}const pV={green:"tw:bg-tile-green tw:text-tile-green-foreground",blue:"tw:bg-tile-blue tw:text-tile-blue-foreground",orange:"tw:bg-tile-orange tw:text-tile-orange-foreground",violet:"tw:bg-tile-violet tw:text-tile-violet-foreground"};function Gi({title:e,icon:t,tone:n,meta:a,className:r,headingRef:s,children:i}){const l=d.useId();return o.jsxs(It,{role:"region","aria-labelledby":l,className:E("tw:min-w-0 tw:overflow-hidden tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:shadow-psfa-card",r),children:[o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-2 tw:px-5 tw:pt-[18px] tw:pb-1.5",children:[o.jsxs("h2",{id:l,ref:s,tabIndex:s?-1:void 0,className:"tw:m-0 tw:flex tw:outline-none tw:min-w-0 tw:items-center tw:gap-2.5 tw:p-0 tw:text-base tw:font-semibold tw:leading-[1.3] tw:text-foreground",children:[o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-flex tw:size-[30px] tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg",pV[n]),children:o.jsx(t,{className:"tw:size-4"})}),e]}),a?o.jsx("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-1.5",children:a}):null]}),i]})}const hV={ok:"tw:bg-success-soft tw:text-success",warn:"tw:bg-warning-soft tw:text-warning",bad:"tw:bg-destructive-soft tw:text-destructive",info:"tw:bg-info-soft tw:text-info"};function Db({tone:e,dot:t=!1,children:n}){return o.jsxs(Ar,{variant:"outline",className:E("tw:h-[22px] tw:shrink-0 tw:gap-1.5 tw:rounded-full tw:border-0 tw:px-2 tw:py-0 tw:text-xs tw:font-medium tw:whitespace-nowrap tw:shadow-none",hV[e]),children:[t?o.jsx("span",{"aria-hidden":"true",className:"tw:size-[7px] tw:shrink-0 tw:rounded-full tw:bg-current"}):null,n]})}const gV=600,xV=20,bV=new Intl.NumberFormat("en-US");function Ca(e){return bV.format(e)}function vV(e){const t=(e||"www.amazon.com").replace(/^www\./,"");return t.charAt(0).toUpperCase()+t.slice(1)}function yV(){return!1}function Ob(){return Nt().settings??{}}const MR={none:"Not connected",managed:"Managed API",creators:"Creators API",paapi:"Your own Amazon keys"};function DR(e){return MR[e]??MR.paapi}function OR(){const e=Nt().activePath;return e==="managed"||e==="creators"||e==="paapi"?e:"none"}function SV(){const e=Ob().managedApiKeyMasked;return typeof e=="string"&&e.trim()!==""}function jV(e=Math.floor(Date.now()/1e3)){const t=Nt().notifications;return cu(Nb(t==null?void 0:t.items),e).length}function So(e){return Math.max(0,Math.round(e))}function NV(e,t){if(e.loading)return{kind:"loading"};if(e.error)return{kind:"error"};const n=e.scope==="pool",a=!t&&!n;if(e.pending||typeof e.used!="number"||typeof e.cap!="number")return{kind:"pending",free:a};const r=typeof e.remaining=="number"?So(e.remaining):So(e.cap-e.used),s=Math.min(r,So(e.cap));if(!a)return{kind:"premium",monthLeft:e.quotaExhausted?0:s,monthTotal:So(e.cap),shared:n};const i=typeof e.usedMonth=="number"&&typeof e.capMonth=="number";return{kind:"free",monthLeft:i?Math.min(So(e.capMonth-e.usedMonth),So(e.capMonth)):null,monthTotal:i?So(e.capMonth):null,dayLeft:s,dayTotal:So(e.cap)}}function CV({path:e,faults:t,blockedKey:n,quota:a}){if(t>0||n)return{tone:"bad",label:"Needs attention"};if(e==="none")return{tone:"warn",label:"Not set up"};if(e==="managed"&&a){if(a.kind==="premium"&&a.monthLeft===0||a.kind==="free"&&a.monthLeft===0)return{tone:"warn",label:"Monthly searches used up"};if(a.kind==="free"&&a.dayLeft===0)return{tone:"warn",label:"Paused until tomorrow"}}return{tone:"ok",label:"Working"}}function AV(e,t){return e<=0?"bad":t>0&&e/t<.2?"warn":"ok"}const PR=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),_V=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function EV(e=new Date){const t=[];for(let n=6;n>=0;n--){const a=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()-n));t.push({iso:a.toISOString().slice(0,10),label:PR.format(a)})}return t}const TV=[12,19,9,22,17,25,21];function RV(e,t=new Date){const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");if(!n)return"";const a=new Date(Date.UTC(Number(n[1]),Number(n[2])-1,Number(n[3])));return Number.isNaN(a.getTime())?"":a.getUTCFullYear()===t.getUTCFullYear()?PR.format(a):_V.format(a)}function zR(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const a=n;typeof a.asin!="string"||a.asin===""||t.push({asin:a.asin,title:typeof a.title=="string"?a.title.trim():"",image:typeof a.image=="string"?a.image:"",createdAt:typeof a.createdAt=="string"?a.createdAt:""})}return t}function kV(){var t;const e=(t=Nt().addonData)==null?void 0:t.comparisonTables;return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({id:Number(n.id)||0,name:typeof n.name=="string"?n.name.trim():"",productCount:Number(n.product_count)||0})).sort((n,a)=>a.id-n.id):[]}function MV(){var t;const e=(t=Nt().addonData)==null?void 0:t.productBoxes;return zR(e)}const Rm="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,color] tw:duration-150 tw:ease-psfa-out tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:pointer-coarse:min-h-11",LR="tw:no-underline tw:text-primary-foreground tw:hover:text-primary-foreground tw:focus:text-primary-foreground",DV="tw:no-underline tw:text-secondary-foreground tw:hover:text-secondary-foreground tw:focus:text-secondary-foreground",IR="tw:rounded-sm tw:font-medium tw:text-link tw:underline tw:underline-offset-[3px] tw:hover:text-link tw:focus:text-link tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",jo="tw:m-0 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:leading-normal tw:tracking-[0.07em] tw:text-muted-foreground",Yi="tw:m-0 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",Pb="tw:m-0 tw:px-5 tw:pt-2 tw:pb-5 tw:text-sm tw:leading-normal tw:text-muted-foreground";async function OV(e,t,n={}){const a=Nt();if(!a.ajaxUrl)return{success:!1,data:null};const r=new FormData;r.append("action",e),r.append("nonce",t);for(const[s,i]of Object.entries(n))r.append(s,i);try{const i=await(await fetch(`${a.ajaxUrl}?action=${e}`,{method:"POST",body:r,credentials:"same-origin"})).json();return i&&typeof i=="object"?i:{success:!1,data:null}}catch{return{success:!1,data:null}}}function PV(e){const t=d.useMemo(()=>EV(),[]),[n,a]=d.useState({status:"loading"});return d.useEffect(()=>{},[e,t]),{...n,week:t}}function $R({week:e,values:t,sample:n}){const a=Math.max(1,...t);return o.jsx("ul",{"aria-label":n?"Sample clicks per day":"Clicks per day",className:"tw:m-0 tw:grid tw:list-none tw:gap-[7px] tw:px-5 tw:pt-2.5 tw:pb-[18px]",children:e.map((r,s)=>{const i=t[s]??0,l=i>0?Math.max(2,i/a*100):0;return o.jsxs("li",{className:"tw:m-0 tw:grid tw:grid-cols-[46px_minmax(0,1fr)_auto] tw:items-center tw:gap-2.5 tw:text-[13px]",children:[o.jsx("span",{className:"tw:whitespace-nowrap tw:text-muted-foreground",children:r.label}),o.jsx("span",{"aria-hidden":"true",className:"tw:h-3.5 tw:overflow-hidden tw:rounded-[3px] tw:bg-secondary",children:o.jsx("span",{className:E("tw:block tw:h-full tw:rounded-[3px]",n?"tw:bg-border-strong":"tw:bg-ring"),style:{width:`${l}%`}})}),o.jsx("span",{className:"tw:min-w-[3ch] tw:text-right tw:font-medium tw:tabular-nums tw:text-foreground",children:Ca(i)})]},r.iso)})})}function zV({premium:e}){const t=PV(e);if(!e)return o.jsxs(Gi,{title:"Clicks, last 7 days",icon:xc,tone:"violet",meta:o.jsxs(Db,{tone:"info",children:[o.jsx(zP,{className:"tw:size-3","aria-hidden":"true"}),"Preview"]}),children:[o.jsx($R,{week:t.week,values:TV,sample:!0}),o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:leading-normal tw:text-muted-foreground",children:[o.jsx(lf,{className:"tw:mt-px tw:size-3.5 tw:shrink-0","aria-hidden":"true"}),o.jsxs("span",{children:["Sample numbers. Analytics counts real clicks on your boxes, tables and search results with Premium."," ",o.jsx(Bn,{to:se.analytics,className:IR,children:"See Analytics"})]})]})]});const n=t.status==="ready"?t.values.reduce((a,r)=>a+r,0):0;return o.jsx(Gi,{title:"Clicks, last 7 days",icon:xc,tone:"violet",meta:t.status==="ready"&&n>0?o.jsxs("span",{className:"tw:text-[13px] tw:tabular-nums tw:text-muted-foreground",children:["Total ",Ca(n)]}):null,children:t.status==="loading"?o.jsx("div",{className:"tw:grid tw:gap-[7px] tw:px-5 tw:pt-2.5 tw:pb-[18px]","aria-hidden":"true",children:t.week.map(a=>o.jsx(bt,{className:"tw:h-3.5 tw:bg-secondary tw:bg-none"},a.iso))}):t.status==="error"?o.jsx("p",{className:Pb,children:"Clicks couldn't load."}):n===0?o.jsx("p",{className:Pb,children:"No clicks yet. Clicks show here after visitors click a product on your site."}):o.jsx($R,{week:t.week,values:t.values,sample:!1})})}function fa(e,t,n,a=String){return`${a(e)} ${e===1?t:n}`}const LV=2;function IV({row:e}){const[t,n]=d.useState(!1),a=e.kind==="box"?fN:_g;return o.jsx("span",{"aria-hidden":"true",className:"tw:flex tw:size-9 tw:shrink-0 tw:items-center tw:justify-center tw:overflow-hidden tw:rounded-md tw:border tw:border-solid tw:border-border tw:bg-muted tw:text-muted-foreground",children:e.image&&!t?o.jsx("img",{src:e.image,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0),className:"tw:size-full tw:object-contain"}):o.jsx(a,{className:"tw:size-[18px]"})})}function $V(e){return e.map(t=>{const n=RV(t.createdAt);return{key:`box-${t.asin}`,kind:"box",title:t.title||t.asin,sub:n?`Product box, ${n}`:"Product box",to:`${se.boxes}/${encodeURIComponent(t.asin)}`,image:t.image}})}function BV(){return kV().slice(0,LV).map(e=>({key:`table-${e.id}`,kind:"table",title:e.name||`Table ${e.id}`,sub:`Comparison table, ${fa(e.productCount,"product","products",Ca)}`,to:se.tables,image:""}))}function UV({loading:e,boxes:t}){const n=e?[]:[...$V(t),...BV()],a=!e&&t.length>0;return o.jsx(Gi,{title:"Recently made",icon:fN,tone:"orange",meta:a?o.jsx(Bn,{to:se.boxes,className:E(IR,"tw:inline-flex tw:items-center tw:text-sm tw:pointer-coarse:min-h-11"),children:"All boxes"}):null,children:e?o.jsx("div",{className:"tw:flex tw:flex-col tw:gap-3 tw:px-5 tw:pt-2 tw:pb-5","aria-hidden":"true",children:[0,1,2].map(r=>o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-9 tw:shrink-0 tw:bg-secondary tw:bg-none"}),o.jsx(bt,{className:"tw:h-4 tw:w-2/3 tw:bg-secondary tw:bg-none"})]},r))}):n.length===0?o.jsx("p",{className:Pb,children:"Nothing yet. Boxes and tables you make show up here."}):o.jsx("ul",{className:"tw:m-0 tw:list-none tw:divide-y tw:divide-solid tw:divide-border tw:p-0 tw:pb-1.5",children:n.map(r=>o.jsxs("li",{className:"tw:relative tw:m-0 tw:flex tw:min-w-0 tw:items-center tw:gap-3 tw:px-5 tw:py-3",children:[o.jsx(IV,{row:r}),o.jsxs("span",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col",children:[o.jsx(Bn,{to:r.to,title:r.title,"data-row-title":!0,className:"tw:block tw:truncate tw:rounded-sm tw:font-medium tw:after:absolute tw:after:inset-0 tw:after:content-[''] tw:text-foreground tw:no-underline tw:underline-offset-[3px] tw:hover:text-foreground tw:hover:underline tw:focus:text-foreground tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:r.title}),o.jsx("span",{className:Yi,children:r.sub})]})]},r.key))})})}const BR="tw:grid tw:grid-cols-[28px_minmax(0,1fr)_auto] tw:items-start tw:gap-x-3 tw:gap-y-1 tw:px-5 tw:py-4 tw:max-[640px]:grid-cols-[28px_minmax(0,1fr)]",UR="tw:col-start-3 tw:row-span-2 tw:row-start-1 tw:self-center tw:max-[640px]:col-start-2 tw:max-[640px]:row-span-1 tw:max-[640px]:row-start-auto tw:max-[640px]:mt-2",HR="tw:grid tw:size-6 tw:place-items-center tw:rounded-full";function HV(e){return`${se.boxes}/${encodeURIComponent(e)}?step=place`}function FV(e){const t=d.useRef(null),[n,a]=d.useState({}),r=e.map(s=>s.done?"1":"0").join("");return d.useEffect(()=>{const s={};for(const i of e)s[i.id]=i.done;if(t.current){const i={};for(const l of e)l.done&&!t.current[l.id]&&(i[l.id]=!0);Object.keys(i).length>0&&a(i)}t.current=s},[r]),n}function FR({to:e,children:t}){return o.jsx(Ae,{asChild:!0,size:"sm",className:E("tw:h-9 tw:px-3.5 tw:text-sm",Rm,LR),children:o.jsx(Bn,{to:e,children:t})})}function VV({premium:e}){return o.jsx(Gi,{title:"You're set up",icon:yr,tone:"blue",meta:o.jsx("span",{className:"tw:text-[13px] tw:tabular-nums tw:text-muted-foreground",children:"3 of 3 done"}),children:o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:o.jsxs("li",{className:E(BR,"tw:m-0 tw:bg-muted"),children:[o.jsx("span",{"aria-hidden":"true",className:E(HR,"tw:border tw:border-solid tw:border-border-strong tw:text-muted-foreground"),children:o.jsx(xc,{className:"tw:size-3.5"})}),o.jsx("span",{className:"tw:font-semibold tw:text-foreground",children:"See your clicks"}),o.jsx("p",{className:"tw:col-start-2 tw:m-0 tw:text-[13.5px] tw:leading-normal tw:text-muted-foreground",children:e?"Analytics shows which boxes visitors click, and where.":"Analytics shows which boxes visitors click. It comes with Premium."}),o.jsx("span",{className:UR,children:o.jsx(FR,{to:se.analytics,children:"Open Analytics"})})]})})})}function GV({connected:e,madeBox:t,placed:n,firstBoxAsin:a,premium:r}){const s=[{id:"connect",done:e,title:"Connect to Amazon",desc:"Add your Associate tag. No Amazon credentials needed yet.",action:{label:"Connect to Amazon",to:se.boxNew}},{id:"box",done:t,title:"Make your first product box",desc:"Find a product on Amazon and choose how it looks.",action:{label:"Make a box",to:se.boxNew}},{id:"place",done:n,title:"Place it on a post",desc:"Copy the box's shortcode and paste it into any post or page.",action:a?{label:"Get the shortcode",to:HV(a)}:null}],i=FV(s),l=s.filter(u=>u.done).length,c=s.find(u=>!u.done)??null;return c?o.jsx(Gi,{title:"Get set up",icon:Ag,tone:"blue",meta:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2.5 tw:text-[13px] tw:text-muted-foreground",children:[o.jsxs("span",{className:"tw:tabular-nums",children:[l," of 3 done"]}),o.jsx("span",{"aria-hidden":"true",className:"tw:flex tw:w-24 tw:gap-1",children:s.map(u=>o.jsx("span",{className:E("tw:h-1 tw:flex-1 tw:rounded-full",u.done?"tw:bg-success":"tw:bg-secondary")},u.id))})]}),children:o.jsx("ol",{className:"tw:m-0 tw:list-none tw:divide-y tw:divide-solid tw:divide-border tw:p-0",children:s.map(u=>{const m=u===c;return o.jsxs("li",{"aria-current":m?"step":void 0,className:E(BR,"tw:m-0",m&&"tw:bg-muted"),children:[o.jsx("span",{"aria-hidden":"true",className:E(HR,u.done?"tw:bg-success tw:text-card":"tw:border-[1.5px] tw:border-dashed tw:border-border-strong",i[u.id]&&"tw:animate-in tw:fade-in-0 tw:zoom-in-90 tw:duration-200 tw:ease-psfa-out tw:motion-reduce:zoom-in-100"),children:u.done?o.jsx(yr,{className:"tw:size-[15px]",strokeWidth:2.5}):null}),o.jsxs("span",{className:E("tw:min-w-0",u.done?"tw:font-medium tw:text-muted-foreground":"tw:font-semibold tw:text-foreground"),children:[o.jsx("span",{"data-step-title":!0,children:u.title}),o.jsx("span",{className:"tw:sr-only",children:u.done?" (done)":" (to do)"})]}),u.done?null:o.jsx("p",{className:"tw:col-start-2 tw:m-0 tw:text-[13.5px] tw:leading-normal tw:text-muted-foreground",children:u.desc}),m&&u.action?o.jsx("span",{className:UR,children:o.jsx(FR,{to:u.action.to,children:u.action.label})}):null]},u.id)})})}):o.jsx(VV,{premium:r})}function zb(){const[e,t]=d.useState({loading:!0,error:!1}),[n,a]=d.useState(0),r=d.useCallback(()=>a(s=>s+1),[]);return d.useEffect(()=>{const s=window.psfaAdmin;if(!s){t({loading:!1,error:!0});return}const i=new FormData;i.append("action","psfa_managed_api_get_usage"),i.append("nonce",s.nonce),fetch(s.ajaxUrl+"?action=psfa_managed_api_get_usage",{method:"POST",body:i,credentials:"same-origin"}).then(l=>l.json()).then(l=>{if(!(l!=null&&l.success)){t({loading:!1,error:!0});return}const c=l.data||{};t({loading:!1,error:!1,scope:c.scope==="pool"?"pool":"site",used:typeof c.used=="number"?c.used:void 0,cap:typeof c.cap=="number"?c.cap:void 0,remaining:typeof c.remaining=="number"?c.remaining:void 0,resetsAt:typeof c.resets_at=="string"&&c.resets_at!==""?c.resets_at:void 0,pending:c.usage_pending===!0,successRatePct:typeof c.success_rate_pct=="number"?c.success_rate_pct:void 0,avgLatencyMs:typeof c.avg_latency_ms=="number"?c.avg_latency_ms:void 0,usedMonth:typeof c.used_month=="number"?c.used_month:void 0,capMonth:typeof c.monthly_limit=="number"?c.monthly_limit:void 0,quotaExhausted:!!(c.quota_state==="exhausted"||c.quotaExhausted),tierDrift:c.tier_drift&&typeof c.tier_drift=="object"?{plugin_tier:String(c.tier_drift.plugin_tier??""),proxy_tier:String(c.tier_drift.proxy_tier??""),drift_detected:!!c.tier_drift.drift_detected,recent_sync:!!c.tier_drift.recent_sync}:void 0})}).catch(()=>t({loading:!1,error:!0}))},[n]),{...e,refetch:r}}const YV={ok:"tw:bg-ring",warn:"tw:bg-warning",bad:"tw:bg-destructive"};function Lb({label:e,left:t,total:n}){const a=d.useId(),r=Math.max(0,Math.min(t,n)),s=n>0?r/n*100:0;return o.jsxs(o.Fragment,{children:[o.jsx("p",{id:a,className:jo,children:e}),o.jsxs("p",{className:"tw:m-0 tw:flex tw:flex-wrap tw:items-baseline tw:gap-x-1.5 tw:text-[17px] tw:font-semibold tw:leading-snug tw:tabular-nums tw:text-foreground",children:[Ca(r)," ",o.jsxs("span",{className:E(Yi,"tw:font-normal"),children:["of ",Ca(n)]})]}),o.jsx("div",{role:"meter","aria-labelledby":a,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":r,"aria-valuetext":`${Ca(r)} of ${Ca(n)}`,className:"tw:mt-0.5 tw:h-1.5 tw:overflow-hidden tw:rounded-full tw:bg-secondary",children:o.jsx("span",{className:E("tw:block tw:h-full tw:rounded-full",YV[AV(r,n)]),style:{width:`${s}%`}})})]})}const KV="tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5 tw:px-5 tw:pt-3.5 tw:pb-[18px]",qV="tw:border-0 tw:border-solid tw:border-border tw:border-l tw:max-[760px]:border-l-0 tw:max-[760px]:border-t",XV="tw:col-span-2 tw:max-[760px]:col-span-1";function qa({wide:e=!1,first:t=!1,children:n}){return o.jsx("div",{className:E(KV,!t&&qV,e&&XV),children:n})}function WV({quota:e,onRetry:t}){return e.kind==="loading"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsx(bt,{className:"tw:h-5 tw:w-28 tw:bg-secondary tw:bg-none"}),o.jsx(bt,{className:"tw:h-1.5 tw:w-full tw:max-w-xs tw:bg-secondary tw:bg-none"})]}):e.kind==="error"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:["Usage couldn't load."," ",o.jsx(Ae,{type:"button",variant:"link",onClick:t,className:"tw:h-auto tw:p-0 tw:font-medium tw:text-link tw:underline tw:underline-offset-[3px]",children:"Try again"})]})]}):e.kind==="pending"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Usage appears after this site's next search."}),o.jsx("p",{className:Yi,children:e.free?`Free: ${Ca(xV)} searches and product lookups a day, ${Ca(gV)} a month.`:"No daily limit."})]}):e.kind==="free"?o.jsxs(o.Fragment,{children:[e.monthLeft!==null&&e.monthTotal!==null?o.jsx(qa,{children:o.jsx(Lb,{label:"Searches left this month",left:e.monthLeft,total:e.monthTotal})}):null,o.jsx(qa,{wide:e.monthLeft===null,children:o.jsx(Lb,{label:"Searches left today",left:e.dayLeft,total:e.dayTotal})})]}):o.jsxs(o.Fragment,{children:[o.jsx(qa,{children:o.jsx(Lb,{label:e.shared?"Searches left this month, all sites":"Searches left this month",left:e.monthLeft,total:e.monthTotal})}),o.jsxs(qa,{children:[o.jsx("p",{className:jo,children:"Daily limit"}),o.jsx("p",{className:"tw:m-0 tw:text-[17px] tw:font-semibold tw:leading-snug tw:text-foreground",children:"None"}),o.jsx("p",{className:Yi,children:e.shared?`${Ca(e.monthTotal)} a month, shared by every site on your license.`:`${Ca(e.monthTotal)} a month on this site.`})]})]})}function ZV({switching:e,onSwitch:t}){return o.jsx("div",{className:"tw:px-5 tw:pb-5",children:o.jsxs(ln,{role:"status",variant:"destructive",className:"tw:border-solid tw:border-destructive/40 tw:bg-destructive-soft tw:leading-normal tw:text-foreground tw:[&>svg]:text-destructive",children:[o.jsx(co,{className:"tw:size-4","aria-hidden":"true"}),o.jsx(Va,{className:"tw:leading-snug tw:[overflow-wrap:anywhere]",children:"Your Managed API key isn't in use"}),o.jsxs(Gn,{className:"tw:text-foreground",children:[o.jsx("p",{className:"tw:m-0",children:"You have a key, but the plugin is still set to another connection, so products don't load."}),o.jsx(Ae,{type:"button",size:"sm",onClick:t,disabled:e,className:E("tw:mt-3 tw:max-[640px]:h-11 tw:max-[640px]:w-full",Rm),children:e?"Switching...":"Switch to Managed now"})]})]})})}function QV({quota:e,onRetry:t,...n}){const{path:a,faults:r,isMock:s,managedKey:i,store:l,tag:c,switching:u,onSwitch:m}=n,f=i&&a==="none",w=d.useRef(null),p=d.useRef(f);d.useEffect(()=>{var y;p.current&&!f&&((y=w.current)==null||y.focus({preventScroll:!0})),p.current=f},[f]);const x=CV({path:a,faults:r,blockedKey:f,quota:e});let b;return a==="none"?b=o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Next"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Add your Associate tag to connect. No Amazon credentials needed yet."}),o.jsx("div",{children:o.jsx(Ae,{asChild:!0,variant:"secondary",size:"sm",className:E("tw:mt-1",Rm,DV),children:o.jsx(Bn,{to:se.boxNew,children:"Connect to Amazon"})})})]}):a==="managed"&&e?b=o.jsx(WV,{quota:e,onRetry:t}):b=o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Limits"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Requests go to Amazon on your own account. PaapiPlugin adds no cap."})]}),o.jsxs(Gi,{title:"Is it working?",icon:yN,tone:"green",headingRef:w,meta:o.jsxs(o.Fragment,{children:[s?o.jsxs(Db,{tone:"info",children:[o.jsx(lf,{className:"tw:size-3","aria-hidden":"true"}),"Demo data"]}):null,o.jsx(Db,{tone:x.tone,dot:!0,children:x.label})]}),children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)_minmax(0,1fr)] tw:max-[760px]:grid-cols-1",children:[o.jsxs(qa,{first:!0,children:[o.jsx("p",{className:jo,children:"Products come from"}),o.jsx("p",{className:"tw:m-0 tw:text-[17px] tw:font-semibold tw:leading-snug tw:text-foreground",children:DR(a)}),s?o.jsx("p",{className:Yi,children:"Products are sample data, not live from Amazon."}):null,o.jsx("p",{className:E(Yi,"tw:[overflow-wrap:anywhere]"),children:a==="none"?"Boxes can't load products until you connect.":o.jsxs(o.Fragment,{children:["Store ",vV(l),".",c?o.jsxs(o.Fragment,{children:[" ","Tag"," ",o.jsx("code",{className:"tw:rounded tw:bg-secondary tw:px-1.5 tw:py-px tw:font-mono tw:text-[12.5px] tw:text-foreground",children:c})]}):null]})})]}),b]}),f?o.jsx(ZV,{switching:u,onSwitch:m}):null]})}function JV({onUsage:e}){const t=zb();return d.useEffect(()=>{e(t)},[e,t.loading,t.error,t.pending,t.scope,t.used,t.cap,t.remaining,t.usedMonth,t.capMonth,t.quotaExhausted]),null}function eG(e){const[t,n]=d.useState(null),a=e.path==="managed",r=a?t?NV(t,e.premium):{kind:"loading"}:null;return o.jsxs(o.Fragment,{children:[a?o.jsx(JV,{onUsage:n}):null,o.jsx(QV,{...e,quota:r,onRetry:()=>t==null?void 0:t.refetch()})]})}const VR=3;function tG(){const[e,t]=d.useState({loading:!0,boxes:[]});return d.useEffect(()=>{var r;let n=!1;const a=((r=Nt().addonNonces)==null?void 0:r.productBoxes)??"";return OV("psfa_box_list",a,{page:"1",per_page:String(VR)}).then(s=>{if(n)return;const i=s.success&&s.data?zR(s.data.boxes):MV();t({loading:!1,boxes:i.slice(0,VR)})}),()=>{n=!0}},[]),e}const Ib={managed:"Managed API",creators:"Creators API",paapi:"PA-API v5"};function $b(e,t){return e==="managed"||e==="creators"||e==="paapi"?e:t==="oauth"?"creators":"paapi"}function nG(e){const[t,n]=d.useState(!1),a=d.useCallback(async()=>{var r,s;n(!0);try{const i=await vo("psfa_set_active_api",{path:"managed"});if(i.success){const l=Ob().authType,c=$b((r=i.data)==null?void 0:r.active_path,typeof l=="string"?l:void 0);e(c),_e.success(`Now serving searches via ${DR(c)}`)}else{const l=(s=i.data)==null?void 0:s.message;_e.error(typeof l=="string"&&l!==""?l:"Could not change the active API")}}finally{n(!1)}},[e]);return{switching:t,switchToManaged:a}}function aG(){var x;const e=Nt(),t=yV(),n=Ob(),a=e.setupChecklist,[r,s]=d.useState(OR),[i,l]=d.useState(!!(a!=null&&a.connected)||OR()!=="none"),c=tG(),u=d.useCallback(b=>{s(b),l(!0)},[]),{switching:m,switchToManaged:f}=nG(u),w=!!(a!=null&&a.madeBox)||c.boxes.length>0,p=!(a!=null&&a.madeBox);return o.jsxs("div",{"data-testid":"home-page",children:[o.jsx(fu,{title:"Home",description:p?"Make your first product box. It takes a minute.":"How the plugin is doing on your site, and what to do next.",actions:o.jsx(Ae,{asChild:!0,className:E("tw:h-10 tw:gap-1.5 tw:rounded-[10px] tw:px-4 tw:max-[782px]:flex-1",Rm,LR),children:o.jsxs(Bn,{to:se.boxNew,children:[o.jsx(Cg,{"aria-hidden":"true"}),"New product box"]})})}),o.jsxs("div",{className:"tw:grid tw:grid-cols-[minmax(0,1.25fr)_minmax(0,1fr)] tw:gap-6 tw:max-[1000px]:grid-cols-1 tw:max-[782px]:gap-4",children:[o.jsx("div",{className:"tw:col-span-2 tw:min-w-0 tw:max-[1000px]:col-span-1",children:o.jsx(eG,{path:r,premium:t,faults:jV(),isMock:!!e.isMockMode,managedKey:SV(),store:typeof n.marketplace=="string"?n.marketplace:"",tag:typeof n.associateTag=="string"?n.associateTag.trim():"",switching:m,onSwitch:f})}),o.jsx("div",{className:"tw:col-span-2 tw:min-w-0 tw:max-[1000px]:col-span-1",children:o.jsx(GV,{connected:i,madeBox:w,placed:!!(a!=null&&a.placed),firstBoxAsin:((x=c.boxes[0])==null?void 0:x.asin)??null,premium:t})}),o.jsx(UV,{loading:c.loading,boxes:c.boxes}),o.jsx(zV,{premium:t})]})]})}const GR="With the Managed API, you do not connect your own Amazon API credentials. The Managed API does not use Amazon's official Creators API or PA-API. We fetch Amazon product data for you through a third-party product-data provider during this launch phase, and we attach your own Amazon Associate tag to every product link. The tag on those links is always yours. We never put our own tag on your links.",YR="Before you turn on the Managed API, please read this:",KR=["The Managed API does not use Amazon's official Creators API or PA-API.","Amazon may determine that use of this feature is inconsistent with the Amazon Associates Program, Program Policies, or related Amazon requirements.","Your participation in the Amazon Associates Program is governed solely by Amazon, not by PaapiPlugin.","Amazon may suspend, terminate, or otherwise restrict your participation in the Associates Program at its discretion.","You are solely responsible for evaluating and maintaining your own compliance with Amazon's requirements.","You use this feature at your own risk."],mu="I have read and acknowledge the statements above. I understand that my Amazon Associate tag is used on product links generated through this feature and that I, not PaapiPlugin, am responsible for maintaining compliance with the Amazon Associates Program and related Amazon requirements.",qR="Read how Managed API data is sourced and what you are agreeing to.",XR="Where did you hear about us? (optional)",WR="Choose one",Bb=[{value:"reddit",label:"Reddit"},{value:"google",label:"Google search"},{value:"wporg",label:"WordPress.org plugin directory"},{value:"ai_assistant",label:"ChatGPT or another AI assistant"},{value:"youtube",label:"YouTube"},{value:"social",label:"Facebook or X"},{value:"referral",label:"A friend or colleague"},{value:"other",label:"Somewhere else"}],rG=new Set(Bb.map(e=>e.value));function ZR(e){return rG.has(e)?{heard_from:e}:{}}const us="www.amazon.com",QR=[{value:"www.amazon.com",label:"www.amazon.com (US)",managed:!0},{value:"www.amazon.co.uk",label:"www.amazon.co.uk (UK)",managed:!0},{value:"www.amazon.de",label:"www.amazon.de (Germany)",managed:!0},{value:"www.amazon.fr",label:"www.amazon.fr (France)",managed:!0},{value:"www.amazon.it",label:"www.amazon.it (Italy)",managed:!0},{value:"www.amazon.es",label:"www.amazon.es (Spain)",managed:!0},{value:"www.amazon.ca",label:"www.amazon.ca (Canada)",managed:!0},{value:"www.amazon.com.au",label:"www.amazon.com.au (Australia)",managed:!0},{value:"www.amazon.co.jp",label:"www.amazon.co.jp (Japan)",managed:!0},{value:"www.amazon.in",label:"www.amazon.in (India)",managed:!0},{value:"www.amazon.se",label:"www.amazon.se (Sweden), own Creators API keys only",managed:!1}],oG=new Set(QR.filter(e=>e.managed).map(e=>e.value));function Ub(e){return oG.has(e)}const JR={"www.amazon.com":"https://affiliate-program.amazon.com/","www.amazon.co.uk":"https://affiliate-program.amazon.co.uk/","www.amazon.de":"https://partnernet.amazon.de/","www.amazon.fr":"https://partenaires.amazon.fr/","www.amazon.it":"https://programma-affiliazione.amazon.it/","www.amazon.es":"https://afiliados.amazon.es/","www.amazon.ca":"https://associates.amazon.ca/","www.amazon.com.au":"https://affiliate-program.amazon.com.au/","www.amazon.co.jp":"https://affiliate.amazon.co.jp/","www.amazon.in":"https://affiliate-program.amazon.in/","www.amazon.se":"https://affiliate-program.amazon.se/"};function sG(e){return JR[e]??JR[us]}function iG(e){const t=(e||us).replace(/^www\./,"");return t.charAt(0).toUpperCase()+t.slice(1)}const lG=new Set(["www.amazon.com","www.amazon.ca"]);function cG(e,t){return e.trim().toLowerCase().endsWith("-20")&&!lG.has(t)}const uG={US:"www.amazon.com",GB:"www.amazon.co.uk",DE:"www.amazon.de",AT:"www.amazon.de",CH:"www.amazon.de",FR:"www.amazon.fr",IT:"www.amazon.it",ES:"www.amazon.es",CA:"www.amazon.ca",AU:"www.amazon.com.au",JP:"www.amazon.co.jp",IN:"www.amazon.in",SE:"www.amazon.se"},dG={ja:"www.amazon.co.jp",sv:"www.amazon.se",de:"www.amazon.de",fr:"www.amazon.fr",it:"www.amazon.it",hi:"www.amazon.in"};function fG(e){const t=String(e??"").trim().split(/[-_]/).filter(Boolean);if(t.length===0)return us;const n=t.length>1?t[1].toUpperCase():"";return n?uG[n]??us:dG[t[0].toLowerCase()]??us}function mG(e,t){if(e&&e!==us&&Ub(e))return e;const n=fG(t);return Ub(n)?n:us}function wG(){var t;const e=(t=window.psfaAdmin)==null?void 0:t.userLocale;return typeof e=="string"&&e.trim()!==""?e.trim():typeof document>"u"?"":document.documentElement.getAttribute("lang")||""}const Hb="Read before you connect";function pG({testId:e,children:t}){const[n,a]=d.useState(!1);return o.jsx(ln,{variant:"default",className:"tw:text-sm","data-testid":e,children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-3",children:[o.jsxs(Tx,{open:n,onOpenChange:a,children:[o.jsx(Rx,{asChild:!0,children:o.jsxs(Ae,{type:"button",variant:"ghost",className:"tw:-mx-2 tw:-my-1 tw:h-auto tw:w-[calc(100%+1rem)] tw:justify-between tw:gap-3 tw:px-2 tw:py-1 tw:text-left tw:whitespace-normal tw:[&[data-state=open]>svg]:rotate-180",children:[Hb,o.jsx(bc,{"aria-hidden":"true"})]})}),o.jsx(kx,{forceMount:!0,hidden:!n,className:"tw:pt-3",children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-3",children:[o.jsx("p",{className:"tw:m-0 tw:text-foreground",children:GR}),o.jsx("p",{className:"tw:m-0 tw:font-medium tw:text-foreground",children:YR}),o.jsx("ul",{className:"tw:list-disc tw:pl-5 tw:space-y-1 tw:m-0 tw:text-foreground",children:KR.map(r=>o.jsx("li",{children:r},r))})]})})]}),o.jsx("a",{href:"https://paapiplugin.com/api-terms/",target:"_blank",rel:"noopener",className:"tw:block tw:text-xs tw:underline tw:text-link",children:qR}),t]})})}const ek=mu.indexOf(". ")+1,hG=mu.slice(0,ek),gG=mu.slice(ek+1),xG="Email me product tips & updates, plus 10% off my first Premium purchase (optional)",tk="https://paapiplugin.com/api-terms/",bG="https://paapiplugin.com/privacy-policy/#managed-api",nk="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,border-color,box-shadow] tw:duration-[120ms] tw:ease-psfa-out tw:motion-safe:active:scale-[0.97]",Ki="tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:font-medium tw:text-link tw:underline tw:decoration-1 tw:underline-offset-[3px] tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-card",km="tw:min-h-10 tw:rounded-lg tw:border-solid tw:border-input tw:bg-card tw:px-[11px] tw:text-foreground tw:shadow-none tw:transition-[border-color,box-shadow] tw:duration-[160ms] tw:focus-visible:border-ring tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus:border-ring tw:focus:ring-2 tw:focus:ring-ring tw:aria-[invalid=true]:border-destructive tw:pointer-coarse:min-h-11 tw:pointer-coarse:text-base",vG="tw:z-[100000] tw:bg-scrim tw:duration-200 tw:ease-psfa-out tw:data-[state=open]:animate-in tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:duration-150",yG="tw:fixed tw:top-1/2 tw:left-1/2 tw:z-[100000] tw:flex tw:max-h-[calc(100dvh-48px)] tw:w-[min(560px,calc(100vw-32px))] tw:-translate-x-1/2 tw:-translate-y-1/2 tw:flex-col tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card tw:p-5 tw:font-rubik tw:text-foreground tw:antialiased tw:shadow-psfa-pop tw:outline-none tw:duration-200 tw:ease-psfa-out tw:data-[state=open]:animate-in tw:data-[state=open]:fade-in-0 tw:motion-safe:data-[state=open]:zoom-in-[0.96] tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:motion-safe:data-[state=closed]:zoom-out-[0.96] tw:data-[state=closed]:duration-150";function SG({idPrefix:e,className:t}){const n=`${e}-consent-title`,a=d.useRef(null);return o.jsxs(Qf,{children:[o.jsx(DI,{asChild:!0,children:o.jsx("button",{type:"button",className:E(Ki,"tw:select-none tw:text-[13.5px]",t),children:Hb})}),o.jsxs(t_,{children:[o.jsx(Mx,{className:vG}),o.jsxs(ki,{"aria-labelledby":n,"aria-describedby":void 0,className:yG,onOpenAutoFocus:r=>{var s;r.preventDefault(),(s=a.current)==null||s.focus()},children:[o.jsx(Hc,{id:n,className:"tw:m-0 tw:mb-2 tw:text-[17px] tw:font-semibold tw:leading-snug tw:tracking-normal tw:text-foreground",children:Hb}),o.jsxs("div",{"data-testid":`${e}-consent-body`,role:"region","aria-labelledby":n,tabIndex:0,className:"psfa-scroll tw:-mx-1 tw:mt-1 tw:mb-4 tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:rounded-md tw:px-1 tw:text-[13.5px] tw:leading-relaxed tw:text-foreground tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:[o.jsx("p",{className:"tw:m-0 tw:mb-2.5",children:GR}),o.jsx("p",{className:"tw:m-0 tw:mb-2.5 tw:font-semibold",children:YR}),o.jsx("ul",{className:"tw:m-0 tw:mb-2.5 tw:grid tw:list-disc tw:gap-1 tw:pl-5",children:KR.map(r=>o.jsx("li",{className:"tw:m-0",children:r},r))}),o.jsx("p",{className:"tw:m-0 tw:mb-2.5",children:gG}),o.jsx("a",{href:tk,target:"_blank",rel:"noopener",className:E(Ki,"tw:inline tw:text-[12.5px]"),children:qR})]}),o.jsx("div",{className:"tw:flex tw:justify-end",children:o.jsx(OI,{asChild:!0,children:o.jsx(Ae,{ref:a,type:"button",variant:"outline",className:E("tw:min-h-[38px] tw:rounded-[10px] tw:border-solid tw:border-input tw:bg-card tw:px-4 tw:text-foreground tw:shadow-psfa-xs tw:hover:bg-accent tw:hover:text-foreground tw:pointer-coarse:min-h-11",nk),children:"Close"})})})]})]})]})}function jG(e){return{email:e.email,associate_tag:e.associateTag,marketplace:e.marketplace,marketing_consent:e.marketingConsent?"1":"0",consent_ts:e.marketingConsent?new Date().toISOString():"",clickwrap_accepted:"1",...ZR(e.heardFrom)}}function NG(e){return vo("psfa_managed_api_signup",jG(e))}function CG(e){var t;return((t=e==null?void 0:e.data)==null?void 0:t.message)||(e==null?void 0:e.message)||"Could not get your API key"}const AG=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Mm="tw:m-0 tw:text-sm tw:font-medium tw:leading-snug tw:text-foreground",qi="tw:m-0 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",Fb="tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:text-[13px] tw:leading-normal tw:text-destructive",Dm="tw:mt-[3px] tw:size-3.5 tw:shrink-0",ak="tw:flex tw:items-start tw:gap-2.5",rk='tw:relative tw:mt-px tw:size-[18px] tw:rounded-[5px] tw:border-solid tw:border-border-strong tw:bg-card tw:shadow-none tw:data-[state=checked]:border-primary tw:aria-[invalid=true]:border-destructive tw:focus-visible:ring-2 tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-card tw:pointer-coarse:after:absolute tw:pointer-coarse:after:-inset-[13px] tw:pointer-coarse:after:content-[""] tw:[&_svg]:size-3.5',ok="tw:m-0 tw:cursor-pointer tw:font-normal tw:leading-snug";function _G(){var t,n;const e=(n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.marketplace;return mG(typeof e=="string"?e:"",wG())}function EG(){var t,n;const e=(n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.associateTag;return typeof e=="string"?e:""}function sk({idPrefix:e,showAlternative:t=!1,onConnected:n}){var H;const a=F=>`${e}-${F}`,[r,s]=d.useState(EG),[i,l]=d.useState(_G),[c,u]=d.useState(""),[m,f]=d.useState(""),[w,p]=d.useState(!1),[x,b]=d.useState(!1),[y,h]=d.useState(!1),[g,v]=d.useState(!1),[S,N]=d.useState(""),A=d.useRef(!1),j=d.useRef(null),C=d.useRef(null),R=d.useRef(null),M=r.trim(),z=c.trim(),B=AG.test(z),I=y&&!M?"Add your Associate tag. You'll find it in Amazon Associates, for example yourtag-20.":"",V=y&&!B?"Enter an email address like you@example.com.":"",D=y&&!w?"Tick this box to connect.":"",T=cG(M,i),O=M?B?w?"":"Tick the box above first.":"Add your email first.":"Add your Associate tag first.",_=((H=window.psfaAdmin)==null?void 0:H.isPremium)!==!0,$=async F=>{var Q,X,P;if(F.preventDefault(),!A.current){if(h(!0),!M){(Q=j.current)==null||Q.focus();return}if(!B){(X=C.current)==null||X.focus();return}if(!w){(P=R.current)==null||P.focus();return}if(Ub(i)){A.current=!0,v(!0),N("");try{const G=await NG({email:z,associateTag:M,marketplace:i,marketingConsent:x,heardFrom:m});if(G!=null&&G.success){const ne=G.data??{};n({activePath:uF(),tag:M,marketplace:i,email:ne.email||z,apiKeyMasked:ne.api_key_masked||ne.apiKeyMasked||void 0,tier:ne.tier||void 0})}else N(CG(G))}finally{A.current=!1,v(!1)}}}};return o.jsxs("form",{noValidate:!0,onSubmit:$,"aria-labelledby":a("title"),className:"tw:flex tw:max-w-xl tw:min-w-0 tw:flex-col tw:text-sm tw:text-foreground",children:[o.jsx("h3",{id:a("title"),className:"tw:m-0 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",children:"Connect to Amazon with the Managed API"}),o.jsxs("p",{className:E(qi,"tw:mt-1 tw:mb-4"),children:["Add your Associate tag. No Amazon credentials needed yet.",_?" Free: 20 searches and product lookups a day, 600 a month.":""]}),o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("tag"),className:Mm,children:"Associate tag"}),o.jsx(pt,{ref:j,id:a("tag"),type:"text",value:r,placeholder:"yourtag-20",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,"aria-invalid":I?"true":"false","aria-describedby":a("tag-help"),onChange:F=>s(F.target.value),className:km}),I?o.jsxs("p",{id:a("tag-help"),className:Fb,children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:I})]}):o.jsx("p",{id:a("tag-help"),className:qi,children:"Your links always carry this tag."}),o.jsxs("p",{className:qi,children:["Don't have one yet?"," ",o.jsx("a",{id:a("join"),href:sG(i),target:"_blank",rel:"noopener",className:Ki,children:"Join Amazon Associates"})]})]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("store"),className:Mm,children:"Amazon store"}),o.jsxs(Vt,{value:i,onValueChange:l,children:[o.jsx(zt,{id:a("store"),"aria-describedby":T?a("store-warn"):void 0,className:E(km,"tw:h-auto tw:py-2 tw:text-left"),children:o.jsx(Gt,{})}),o.jsx(Lt,{className:"tw:z-[100000] tw:rounded-lg tw:border-solid tw:border-border tw:bg-card tw:text-foreground tw:shadow-psfa-pop",children:o.jsx(Yf,{children:QR.map(F=>o.jsx(Tt,{value:F.value,disabled:!F.managed,className:"tw:whitespace-normal tw:pointer-coarse:min-h-11",children:F.label},F.value))})})]}),T?o.jsxs("p",{id:a("store-warn"),className:E(qi,"tw:flex tw:items-start tw:gap-1.5 tw:text-warning"),children:[o.jsx(Sc,{"aria-hidden":"true",className:Dm}),o.jsxs("span",{children:["Tags ending in -20 are for Amazon.com and Amazon.ca. Check that this tag belongs to ",iG(i),"."]})]}):null]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("email"),className:Mm,children:"Your email"}),o.jsx(pt,{ref:C,id:a("email"),type:"email",value:c,placeholder:"you@example.com",autoComplete:"email",inputMode:"email",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"go","aria-invalid":V?"true":"false","aria-describedby":V?a("email-error"):void 0,onChange:F=>u(F.target.value),className:km}),V?o.jsxs("p",{id:a("email-error"),className:Fb,children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:V})]}):null]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("heard-from"),className:E(Mm,"tw:text-[13px] tw:font-normal tw:text-muted-foreground"),children:XR}),o.jsxs(Vt,{value:m,onValueChange:f,children:[o.jsx(zt,{id:a("heard-from"),className:E(km,"tw:h-auto tw:py-2 tw:text-left"),children:o.jsx(Gt,{placeholder:WR})}),o.jsx(Lt,{className:"tw:z-[100000] tw:rounded-lg tw:border-solid tw:border-border tw:bg-card tw:text-foreground tw:shadow-psfa-pop",children:o.jsx(Yf,{children:Bb.map(F=>o.jsx(Tt,{value:F.value,className:"tw:pointer-coarse:min-h-11",children:F.label},F.value))})})]})]}),o.jsxs("div",{className:"tw:mt-[18px] tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:bg-muted tw:px-3.5 tw:pt-2.5 tw:pb-3.5 tw:text-[13.5px]",children:[o.jsx(SG,{idPrefix:e,className:"tw:pointer-coarse:inline-flex tw:pointer-coarse:min-h-11 tw:pointer-coarse:items-center"}),o.jsxs("div",{className:E(ak,"tw:mt-2 tw:pointer-coarse:mt-3.5"),children:[o.jsx(Uc,{ref:R,id:a("clickwrap"),checked:w,onCheckedChange:F=>p(F===!0),"aria-invalid":D?"true":"false","aria-describedby":[a("ack-full"),D?a("clickwrap-error"):""].filter(Boolean).join(" "),className:rk}),o.jsx(Re,{htmlFor:a("clickwrap"),className:E(ok,"tw:text-[13.5px] tw:text-foreground"),children:hG})]}),o.jsx("span",{id:a("ack-full"),className:"tw:sr-only",children:mu}),D?o.jsxs("p",{id:a("clickwrap-error"),className:E(Fb,"tw:mt-1.5"),children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:D})]}):null]}),o.jsxs("div",{className:E(ak,"tw:mt-3 tw:pointer-coarse:mt-4"),children:[o.jsx(Uc,{id:a("marketing"),checked:x,onCheckedChange:F=>b(F===!0),className:rk}),o.jsx(Re,{htmlFor:a("marketing"),className:E(ok,"tw:text-[13px] tw:text-muted-foreground"),children:xG})]}),S?o.jsxs(ln,{variant:"destructive",className:"tw:mt-4 tw:border-solid tw:border-destructive/30 tw:bg-destructive-soft tw:text-foreground",children:[o.jsx(co,{"aria-hidden":"true",className:"tw:size-4"}),o.jsx(Gn,{className:"tw:[overflow-wrap:anywhere]",children:S})]}):null,o.jsxs("div",{className:"tw:mt-4 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2",children:[o.jsx(Ae,{type:"submit",disabled:g,"aria-describedby":O?a("missing"):void 0,className:E("tw:min-h-[38px] tw:rounded-[10px] tw:px-4 tw:shadow-psfa-xs tw:pointer-coarse:min-h-11",nk),children:g?"Getting your key...":"Get your free API key"}),O?o.jsx("span",{id:a("missing"),className:qi,children:O}):null]}),o.jsxs("p",{"data-testid":a("terms"),className:E(qi,"tw:mt-2.5 tw:max-w-[60ch] tw:text-[12.5px]"),children:["By getting a key, you agree to the"," ",o.jsx("a",{href:tk,target:"_blank",rel:"noopener",className:Ki,children:"API Terms"}),". The plugin will send your search queries to paapiplugin.com infrastructure."," ",o.jsx("a",{href:bG,target:"_blank",rel:"noopener",className:Ki,children:"Learn what we receive"}),"."]}),t?o.jsx("p",{className:"tw:m-0 tw:mt-3.5 tw:text-sm",children:o.jsx("a",{href:"#/settings/connection",className:E(Ki,"tw:pointer-coarse:inline-flex tw:pointer-coarse:min-h-11 tw:pointer-coarse:items-center"),children:"Use your own Creators API keys instead"})}):null]})}class ds extends Error{constructor(n,a,r,s){super(a);gw(this,"code");gw(this,"field");gw(this,"quota");this.code=n,this.field=r,this.quota=s}}function ik(){var e;return((e=Nt().addonNonces)==null?void 0:e.productBoxes)??""}async function No(e,t,n=ik()){const a=Nt();if(!a.ajaxUrl)throw new ds("invalid","The plugin settings did not load. Reload this page and try again.");const r=new FormData;r.append("action",e),r.append("nonce",n);for(const[i,l]of Object.entries(t))r.append(i,l);let s=null;try{s=await(await fetch(a.ajaxUrl,{method:"POST",body:r,credentials:"same-origin"})).json()}catch{throw new ds("unavailable","Your site did not answer. Check your connection and try again.")}if(!(s!=null&&s.success)){const i=(s==null?void 0:s.data)??{};throw new ds(i.code||"unavailable",i.message||"Something went wrong.",i.field,i.quota)}return s.data}const TG=e=>No("psfa_box_lookup",{query:e}),RG=e=>No("psfa_box_search",{query:e}),lk=e=>No("psfa_box_get",{asin:e}),Om=(e,t)=>No("psfa_box_list",{page:String(e),per_page:String(t)}),kG=e=>No("psfa_box_save",e).then(jb),MG=e=>No("psfa_delete_product_box",{asin:e}).then(jb),DG=()=>No("psfa_mark_box_placed",{},Nt().nonce??"").then(jb);async function OG(){const e=await Om(1,100),t=[...e.boxes];for(let n=2;n<=e.totalPages;n+=1){const a=await Om(n,100);t.push(...a.boxes)}return{...e,boxes:t,perPage:t.length,totalPages:1}}function Vb(){const e=Nt().activePath;return e==="managed"||e==="creators"||e==="paapi"||e==="none"?e:"managed"}function ck(e){const t=!!Nt().isPremium&&!1,n=e==="managed"||e==="none";return{activePath:e==="none"?"managed":e,showsPrice:!n,canCustomButton:t&&!n,canBadge:t,buttonText:n?"Check price on Amazon":""}}const PG=/^(?:https?:\/\/)?(?:www\.)?(?:amzn\.to|a\.co|amzn\.eu|amzn\.asia)(?:\/|$)/i,zG=/^(?:https?:\/\/)?(?:[a-z0-9-]+\.)*amazon\.[a-z.]+\/(?:[^\s?#]*\/)?(?:dp|gp\/product|gp\/aw\/d)\/([A-Z0-9]{10})(?:[/?#]|$)/i,LG=/^(?:https?:\/\/|www\.)\S+$|^[a-z0-9-]+(?:\.[a-z0-9-]+)+\/\S*$/i,IG=/^[A-Z0-9]{10}$/i;function Pm(e){const t=e.trim();if(PG.test(t))return{type:"short"};const n=t.match(zG);return n?{type:"link",asin:n[1].toUpperCase()}:LG.test(t)?{type:"badlink"}:IG.test(t)&&/\d/.test(t)?{type:"asin",asin:t.toUpperCase()}:{type:"keyword",query:t}}function Gb(e){return e.replace(/["[\]\\]/g,"").replace(/\s+/g," ").trim()}function $G({asin:e}){return`[psfa_product_box asin="${e}"]`}function BG(e){return e==="card"||e==="horizontal"||e==="minimal"}function UG(e){return e==="classic"||e==="editorial"||e==="spotlight"}const Yb="Use a number from 0 to 5, like 4.5.",uk="Use a whole number, like 1250.";function dk(e){const t=e.trim();if(t==="")return"";if(!/^\d+(?:\.\d+)?$|^\.\d+$/.test(t))return Yb;const n=Number(t);return n>=0&&n<=5?"":Yb}function Kb(e){return e.trim().replace(/[,\s]/g,"")}function fk(e){const t=Kb(e);return t===""?"":!/^\d{1,10}$/.test(t)||Number(t)>2147483647?uk:""}function HG(e){const t=new URL(e.ajaxUrl,typeof window<"u"?window.location.href:void 0),n=t.searchParams;n.set("action","psfa_box_preview"),n.set("nonce",e.nonce),n.set("asin",e.asin),e.style!=="card"&&n.set("style",e.style),e.look&&e.look!=="classic"&&n.set("look",e.look);const a=e.allowButton?Gb(e.button):"";return a&&n.set("button",a),n.set("title",e.title.trim()),n.set("rating",e.rating.trim()),n.set("reviews",Kb(e.reviews)),e.sendBadge&&n.set("badge",e.badge||"none"),t.toString()}function FG(e){const t=new URL(e.ajaxUrl,typeof window<"u"?window.location.href:void 0);return t.searchParams.set("action","psfa_appearance_preview"),t.searchParams.set("nonce",e.nonce),t.searchParams.set("state",JSON.stringify(e.state)),t.toString()}function VG(e){const t=(e||"www.amazon.com").replace(/^www\./i,"");return t.charAt(0).toUpperCase()+t.slice(1)}const mk=[{id:"none",label:"No badge"},{id:"best_value",label:"Best Value"},{id:"editors_choice",label:"Editor's Choice"},{id:"best_rated",label:"Best Rated"},{id:"budget_pick",label:"Budget Pick"},{id:"premium_pick",label:"Premium Pick"}];function GG(e){var t;return((t=mk.find(n=>n.id===e))==null?void 0:t.label)??""}const YG=/^(?:B0[A-Z0-9]*|\d+X?)$/i,KG=/^(?:https?:|www\.)|amazon\.|amzn\.|\//i;function wu(e){const t=e.trim();return t.length<2||KG.test(t)||YG.test(t)?!1:Pm(t).type==="keyword"}const zm="Boxes on your site keep showing products that are still cached. The rest show as temporarily unavailable until searches start again.",wk="To keep going now, connect your own Creators API credentials, which PaapiPlugin doesn't cap.",pk=e=>new Intl.NumberFormat("en-US").format(e);function qb(e){return e?`This month's ${pk(e)} searches are used up`:"This month's searches are used up"}function qG({path:e,premium:t,quota:n}){return e!=="managed"?{tone:"bad",title:"Amazon is limiting requests right now",text:"Wait a minute, then search again. Nothing is wrong with your connection."}:(n==null?void 0:n.scope)==="pool"?{tone:"bad",title:qb(n.monthlyLimit??n.limit),text:`They're shared by every site on your Agency license, so new products can't load on any of them. ${zm} Searches start again in your next monthly period.`}:t?{tone:"bad",title:qb((n==null?void 0:n.monthlyLimit)??(n==null?void 0:n.limit)),text:`${zm} Searches start again in your next monthly period. ${wk}`}:n!=null&&n.monthlyLimit!=null&&n.usedMonth!=null&&n.usedMonth>=n.monthlyLimit?{tone:"bad",title:qb(n==null?void 0:n.monthlyLimit),text:`${zm} Searches start again in your next monthly period. ${wk}`}:{tone:"bad",title:n!=null&&n.limit?`Today's ${pk(n.limit)} searches are used up`:"Today's searches are used up",text:`${zm} Search again tomorrow. To search more today, connect your own Creators API credentials.`}}function hk(e){switch(e.code){case"short_link":return{tone:"warn",title:"Short links can't be read here",text:"Open the amzn.to link in your browser, then copy the full address or the ASIN from the product page."};case"not_found":return e.kind==="keyword"?{tone:"warn",title:`No products match "${e.query??""}"`,text:"Try fewer or different words, or paste the product's Amazon link."}:{tone:"bad",title:`We couldn't find ASIN ${e.asin??""}`,text:`Check that it has 10 characters and comes from ${e.store||"Amazon.com"}, the store your tag uses. Or search by keyword instead.`};case"quota":return qG(e);default:return{tone:"bad",title:"Amazon couldn't run this search right now",text:"Try again in a minute, or paste the product's Amazon link instead."}}}function Xi({name:e,label:t,value:n,options:a,onChange:r,full:s,className:i}){return o.jsx("div",{role:"radiogroup","aria-label":t,className:E("tw:inline-flex tw:min-w-0 tw:gap-0.5 tw:rounded-[10px] tw:bg-secondary tw:p-[3px]",s&&"tw:flex tw:w-full",i),children:a.map(l=>{const c=`${e}-${l.value}`;return o.jsxs("span",{className:E("tw:relative tw:flex tw:min-w-0",s&&"tw:flex-1"),children:[o.jsx("input",{type:"radio",id:c,name:e,value:l.value,checked:n===l.value,disabled:l.disabled,onChange:()=>r(l.value),className:"tw:peer tw:absolute tw:inset-0 tw:m-0 tw:size-full tw:cursor-pointer tw:touch-manipulation tw:opacity-0 tw:disabled:cursor-not-allowed"}),o.jsxs("label",{htmlFor:c,className:"tw:pointer-events-none tw:flex tw:h-8 tw:w-full tw:min-w-0 tw:items-center tw:justify-center tw:gap-1.5 tw:whitespace-nowrap tw:rounded-lg tw:px-3 tw:text-[13px] tw:font-medium tw:text-muted-foreground tw:select-none tw:transition-colors tw:duration-150 tw:peer-checked:bg-card tw:peer-checked:text-foreground tw:peer-checked:shadow-psfa-xs tw:peer-hover:text-foreground tw:peer-focus-visible:ring-2 tw:peer-focus-visible:ring-ring tw:peer-disabled:opacity-60 tw:max-[782px]:h-11 tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",children:[l.icon,l.label,l.badge]})]},l.value)})})}const gk="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,border-color,color] tw:duration-[120ms] tw:ease-psfa-out tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-background",Lm=`tw:inline-flex tw:h-[38px] tw:shrink-0 tw:items-center tw:justify-center tw:gap-1.5 tw:whitespace-nowrap tw:rounded-[10px] tw:border-0 tw:px-4 tw:text-sm tw:font-medium tw:no-underline tw:cursor-pointer tw:max-[782px]:h-11 tw:[&_svg]:size-4 tw:[&_svg]:shrink-0 tw:aria-disabled:cursor-not-allowed tw:aria-disabled:opacity-60 tw:disabled:opacity-60 ${gk}`,pu=`${Lm} tw:bg-primary tw:text-primary-foreground tw:shadow-psfa-xs tw:hover:bg-primary-hover tw:hover:text-primary-foreground`,Aa=`${Lm} tw:border tw:border-solid tw:border-border-strong tw:bg-card tw:text-foreground tw:shadow-psfa-xs tw:hover:bg-accent tw:hover:text-foreground`,xk=`${Lm} tw:bg-transparent tw:text-foreground tw:shadow-none tw:hover:bg-accent tw:hover:text-foreground`,Xa="tw:h-8 tw:px-3 tw:text-[13px] tw:max-[782px]:h-10",XG=`tw:inline-flex tw:size-9 tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg tw:border-0 tw:bg-transparent tw:p-0 tw:text-muted-foreground tw:cursor-pointer tw:hover:bg-accent tw:hover:text-foreground tw:data-[state=open]:bg-accent tw:data-[state=open]:text-foreground tw:max-[782px]:size-11 tw:[&_svg]:size-[18px] ${gk}`,hu="tw:inline tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:font-medium tw:text-link tw:underline tw:decoration-1 tw:underline-offset-[3px] tw:touch-manipulation tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",Rr="tw:min-w-0 tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:shadow-psfa-card",Im="tw:flex tw:min-h-[56px] tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-2 tw:border-0 tw:border-b tw:border-solid tw:border-border tw:px-5 tw:py-3",$m="tw:m-0 tw:p-0 tw:text-base tw:font-semibold tw:leading-snug tw:text-foreground",Bm="tw:p-5 tw:max-[560px]:p-4",Xb="tw:m-0 tw:p-0 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",fs="tw:mb-1.5 tw:flex tw:items-center tw:gap-2 tw:text-sm tw:font-medium tw:text-foreground",Yn="tw:m-0 tw:mt-1.5 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",gu="tw:m-0 tw:mt-1.5 tw:flex tw:items-start tw:gap-1.5 tw:text-[13px] tw:leading-normal tw:text-destructive",ms="tw:h-10 tw:w-full tw:min-w-0 tw:rounded-[10px] tw:border tw:border-solid tw:border-input tw:bg-card tw:px-3 tw:text-base tw:text-foreground tw:shadow-none tw:outline-none tw:transition-[border-color,box-shadow] tw:duration-150 tw:placeholder:text-muted-foreground tw:focus:border-ring tw:focus:ring-2 tw:focus:ring-ring/40 tw:disabled:cursor-not-allowed tw:disabled:bg-muted tw:disabled:text-muted-foreground tw:aria-[invalid=true]:border-destructive tw:min-[783px]:text-sm tw:max-[782px]:h-11",bk="tw:inline-flex tw:h-[18px] tw:items-center tw:rounded-full tw:bg-pro-soft tw:px-1.5 tw:text-[10.5px] tw:font-semibold tw:tracking-[0.04em] tw:text-pro",Um={style:"card",look:"classic",button:"",title:"",rating:"",reviews:"",badge:"none"};function Wb({className:e}){return o.jsxs("span",{className:E(bk,e),children:["PRO",o.jsx("span",{className:"tw:sr-only",children:" (Premium)"})]})}const WG="tw:mt-[18px] tw:border-0 tw:border-t tw:border-solid tw:border-border tw:pt-[18px]";function ZG({settings:e,onChange:t,caps:n,errors:a}){const r=n.activePath==="managed",s=n.canBadge,i=s?null:o.jsx(Wb,{className:"tw:max-[400px]:hidden"}),l=!s&&e.look!=="classic"?"This box shows as Classic until Pro is active.":s?e.look==="spotlight"?"Works best as one highlighted box per post.":"":"Editorial and Spotlight come with Pro.",c=e.title.length,u=a.rating||a.reviews,m=r?"On the Managed API the button always says this, because prices aren't shown.":n.canCustomButton?"Leave empty to use the text from Appearance.":n.buttonText?`Free boxes use “${n.buttonText}”.`:"Free boxes use the button text from Appearance.";return o.jsxs("section",{"aria-labelledby":"setup-title",className:Rr,children:[o.jsx("div",{className:Im,children:o.jsx("h2",{id:"setup-title",className:$m,children:"Box"})}),o.jsxs("div",{className:Bm,children:[o.jsxs("div",{children:[o.jsx("h3",{className:Xb,children:"Layout and button"}),o.jsx("p",{className:E(Yn,"tw:mb-3 tw:mt-1"),children:"Saved with the box, so every post that shows it changes when you save."}),o.jsxs("div",{children:[o.jsx("span",{className:fs,id:"box-style-label",children:"Layout"}),o.jsx(Xi,{name:"box-style",label:"Layout",full:!0,value:e.style,onChange:f=>t("style",f),options:[{value:"card",label:"Card"},{value:"horizontal",label:"Horizontal"},{value:"minimal",label:"Minimal"}]})]}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsx("span",{className:fs,id:"box-look-label",children:"Style"}),o.jsx(Xi,{name:"box-look",label:"Style",full:!0,value:e.look,onChange:f=>t("look",f),options:[{value:"classic",label:"Classic"},{value:"editorial",label:"Editorial",badge:i,disabled:!s},{value:"spotlight",label:"Spotlight",badge:i,disabled:!s}]}),l?o.jsx("p",{id:"box-look-help",className:Yn,children:l}):null]}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsxs("label",{htmlFor:"box-button",className:fs,children:["Button text ",!r&&!n.canCustomButton?o.jsx(Wb,{}):null]}),o.jsx("input",{id:"box-button",type:"text",maxLength:100,disabled:!n.canCustomButton,value:r?n.buttonText||"Check price on Amazon":n.canCustomButton?e.button:"",placeholder:r?void 0:n.buttonText||void 0,"aria-invalid":a.button?"true":"false","aria-describedby":"box-button-help",onChange:f=>t("button",f.target.value),className:ms}),o.jsx("p",{id:"box-button-help",className:a.button?gu:Yn,children:a.button||m})]})]}),o.jsxs("div",{className:WG,children:[o.jsx("h3",{className:Xb,children:"Product details"}),o.jsx("p",{className:E(Yn,"tw:mb-3 tw:mt-1"),children:"Saved with the product, so they're the same on every post that shows it."}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-baseline tw:gap-2",children:[o.jsx("label",{htmlFor:"box-title",className:fs,children:"Title"}),o.jsx("span",{"aria-live":"polite",className:E("tw:ml-auto tw:text-xs tw:tabular-nums tw:text-muted-foreground",c>80&&"tw:text-warning"),children:c?fa(c,"character","characters"):""})]}),o.jsx("input",{id:"box-title",type:"text",maxLength:255,value:e.title,"aria-invalid":a.title?"true":"false","aria-describedby":"box-title-help",onChange:f=>t("title",f.target.value),className:ms}),o.jsx("p",{id:"box-title-help",className:a.title?gu:Yn,children:a.title||(c>80?"Long titles get cut off on the box. Aim for under 80 characters.":"Leave empty to use Amazon's title.")})]}),o.jsxs("div",{className:"tw:mt-4 tw:grid tw:grid-cols-2 tw:gap-3",children:[o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("label",{htmlFor:"box-rating",className:fs,children:"Rating"}),o.jsx("input",{id:"box-rating",type:"text",inputMode:"decimal",placeholder:"4.5",value:e.rating,"aria-invalid":a.rating?"true":"false","aria-describedby":"box-rating-help",onChange:f=>t("rating",f.target.value),className:ms})]}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("label",{htmlFor:"box-reviews",className:fs,children:"Review count"}),o.jsx("input",{id:"box-reviews",type:"text",inputMode:"numeric",placeholder:"1250",value:e.reviews,"aria-invalid":a.reviews?"true":"false","aria-describedby":"box-rating-help",onChange:f=>t("reviews",f.target.value),className:E(ms,"tw:tabular-nums")})]})]}),u?o.jsxs("p",{id:"box-rating-help",className:gu,children:[o.jsx(co,{"aria-hidden":"true",className:"tw:mt-0.5 tw:size-4 tw:shrink-0"}),u]}):o.jsx("p",{id:"box-rating-help",className:Yn,children:"Amazon doesn't reliably send ratings, so you set them here. Leave empty to hide the stars."}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsxs("label",{htmlFor:"box-badge",className:fs,children:["Badge ",n.canBadge?null:o.jsx(Wb,{})]}),o.jsxs(Vt,{value:n.canBadge&&e.badge||"none",disabled:!n.canBadge,onValueChange:f=>t("badge",f),children:[o.jsx(zt,{id:"box-badge","aria-describedby":"box-badge-help",className:E(ms,"tw:flex tw:items-center tw:justify-between tw:shadow-none"),children:o.jsx(Gt,{})}),o.jsx(Lt,{className:"psfa-menu tw:bg-popover tw:text-popover-foreground",children:o.jsx(Yf,{children:mk.map(f=>o.jsx(Tt,{value:f.id,className:"psfa-menu-item tw:min-h-9 tw:max-[782px]:min-h-11",children:f.label},f.id))})})]}),o.jsx("p",{id:"box-badge-help",className:a.badge?gu:Yn,children:a.badge||(e.style==="minimal"&&n.canBadge&&e.badge!=="none"?"The minimal layout doesn't show badges.":"Shown as a ribbon on the box.")})]}),n.canBadge?null:o.jsxs("p",{className:"tw:m-0 tw:mt-2.5 tw:text-[13px] tw:text-muted-foreground",children:[r?"Badges come with Premium.":"Badges and custom button text come with Premium."," ",o.jsxs("a",{href:cs.upgrade,target:"_blank",rel:"noopener noreferrer",className:"tw:font-medium tw:text-link",children:["See Premium",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]})]})]})]})]})}const vk="cubic-bezier(0.23, 1, 0.32, 1)";function QG(){return typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function JG(){const e=d.useRef(null),t=d.useRef(null);return d.useEffect(()=>{const n=e.current,a=t.current;if(!n||!a||typeof n.animate!="function")return;if(QG()){const i=n.animate([{opacity:0},{opacity:1}],{duration:200,easing:"ease",fill:"backwards"});return()=>i.cancel()}const r=n.animate([{opacity:0,transform:"scale(0.9)"},{opacity:1,transform:"scale(1)"}],{duration:260,easing:vk,fill:"backwards"}),s=a.animate([{strokeDashoffset:32},{strokeDashoffset:0}],{duration:340,delay:140,easing:vk,fill:"backwards"});return()=>{r.cancel(),s.cancel()}},[]),o.jsx("div",{"aria-hidden":"true",className:"tw:mb-[18px] tw:mt-1 tw:size-14",children:o.jsxs("svg",{viewBox:"0 0 56 56",className:"tw:block tw:size-full tw:overflow-visible",children:[o.jsx("circle",{ref:e,cx:"28",cy:"28",r:"26",className:"tw:fill-success tw:[transform-origin:28px_28px]"}),o.jsx("path",{ref:t,d:"M17.5 28.5l7 7 14-15",strokeDasharray:"32",strokeDashoffset:"0",className:"tw:fill-none tw:stroke-primary-foreground tw:stroke-[3.5] tw:[stroke-linecap:round] tw:[stroke-linejoin:round]"})]})})}function eY({onHome:e,onAll:t}){return o.jsx("section",{"aria-labelledby":"done-title",className:Rr,children:o.jsxs("div",{className:Bm,children:[o.jsx(JG,{}),o.jsx("h2",{id:"done-title",tabIndex:-1,"data-step-heading":"true",className:"tw:m-0 tw:mb-1.5 tw:p-0 tw:outline-none tw:text-xl tw:font-semibold tw:text-foreground",children:"Your box is ready"}),o.jsx("p",{className:"tw:m-0 tw:mb-4 tw:text-sm tw:text-muted-foreground",children:"Visitors see it as soon as the post is updated. Home shows your next step."}),o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:gap-2",children:[o.jsx("button",{type:"button",onClick:e,className:Aa,children:"Back to Home"}),o.jsx("button",{type:"button",onClick:t,className:E(xk),children:"See all boxes"})]})]})})}function tY(e){const{ajaxUrl:t,nonce:n,debounceMs:a=300,minLength:r=2}=e,[s,i]=d.useState([]),[l,c]=d.useState(!1),[u,m]=d.useState(-1),f=d.useRef(void 0),w=d.useRef(0),p=d.useCallback(async g=>{var S;if(g.length<r){i([]);return}const v=++w.current;c(!0);try{const N=new URLSearchParams({action:"psfa_autocomplete",nonce:n,q:g}),A=await fetch(`${t}?${N.toString()}`);if(v!==w.current)return;const j=await A.json();if(v!==w.current)return;j.success&&((S=j.data)!=null&&S.suggestions)?(i(j.data.suggestions),m(-1)):i([])}catch{v===w.current&&i([])}finally{v===w.current&&c(!1)}},[t,n,r]),x=d.useCallback(g=>{if(f.current&&clearTimeout(f.current),g.length<r){i([]);return}f.current=setTimeout(()=>{p(g)},a)},[p,a,r]),b=d.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=void 0),w.current++,i([]),m(-1),c(!1)},[]),y=d.useCallback(g=>{if(s.length!==0)switch(g.key){case"ArrowDown":g.preventDefault(),m(v=>Math.min(v+1,s.length-1));break;case"ArrowUp":g.preventDefault(),m(v=>Math.max(v-1,-1));break;case"Escape":g.preventDefault(),b();break}},[s.length,b]),h=d.useCallback(()=>u>=0&&u<s.length?s[u]:null,[u,s]);return d.useEffect(()=>()=>{f.current&&clearTimeout(f.current),w.current++},[]),{suggestions:s,isLoading:l,selectedIndex:u,setSelectedIndex:m,fetchSuggestions:x,clearSuggestions:b,handleKeyDown:y,getSelectedSuggestion:h}}let Hm=null;function nY(){return Hm||(Hm=No("psfa_refresh_nonce",{},"").then(e=>{if(!(e!=null&&e.nonce))throw new Error("no nonce");return e.nonce}).catch(e=>{throw Hm=null,e})),Hm}const aY="Type a keyword, or paste an Amazon link or ASIN.",rY="This link isn't an Amazon product page. Open the product on Amazon and copy its address, or paste its ASIN.";function oY({text:e,typed:t}){const n=t.trim();return n&&e.toLowerCase().startsWith(n.toLowerCase())?o.jsxs("span",{className:"tw:min-w-0 tw:[overflow-wrap:anywhere]",children:[e.slice(0,n.length),o.jsx("span",{className:"tw:font-semibold",children:e.slice(n.length)})]}):o.jsx("span",{className:"tw:min-w-0 tw:[overflow-wrap:anywhere]",children:e})}function yk({idPrefix:e,initial:t="",autoFocus:n,onSubmit:a,footer:r}){const[s,i]=d.useState(t),[l,c]=d.useState(""),[u,m]=d.useState(""),[f,w]=d.useState(!1),p=d.useRef(t),x=`${e}-input`,b=`${d.useId().replace(/:/g,"")}-${e}-suggestions`,y=s.trim()?Pm(s):null,h=tY({ajaxUrl:Nt().ajaxUrl??"",nonce:u}),g=f&&h.suggestions.length>0&&wu(s),v=g&&h.selectedIndex>=0?`${b}-${h.selectedIndex}`:void 0,{fetchSuggestions:S}=h;d.useEffect(()=>{u&&wu(p.current)&&S(p.current.trim())},[u,S]);const N=()=>{h.clearSuggestions(),w(!1)},A=z=>{if(!wu(z)){N();return}if(w(!0),u){S(z.trim());return}nY().then(m).catch(()=>{})},j=z=>{if(N(),!z.trim()){c(aY);return}if(Pm(z).type==="badlink"){c(rY);return}c(""),a(z.trim())},C=z=>{i(z),p.current=z,j(z)},R=z=>{z.preventDefault(),j(s)},M=z=>{if(!g){z.key==="ArrowDown"&&h.suggestions.length>0&&wu(s)&&(z.preventDefault(),w(!0));return}if(z.key==="Enter"&&h.selectedIndex>=0){z.preventDefault(),C(h.suggestions[h.selectedIndex]);return}if(z.key==="Escape"){z.preventDefault(),N();return}h.handleKeyDown(z)};return o.jsxs("form",{onSubmit:R,noValidate:!0,role:"search","aria-label":"Find a product on Amazon",children:[o.jsx("label",{htmlFor:x,className:"tw:mb-1.5 tw:block tw:text-sm tw:font-medium tw:text-foreground",children:"Find a product"}),o.jsxs("div",{className:"tw:relative",children:[o.jsx(yc,{"aria-hidden":"true",className:"tw:pointer-events-none tw:absolute tw:left-3.5 tw:top-1/2 tw:size-[18px] tw:-translate-y-1/2 tw:text-muted-foreground"}),o.jsx("input",{id:x,type:"search",role:"combobox",value:s,autoFocus:n,autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"search",placeholder:"Search Amazon, or paste a product link or ASIN","aria-expanded":g?"true":"false","aria-controls":b,"aria-autocomplete":"list","aria-activedescendant":v,"aria-invalid":l?"true":"false","aria-describedby":`${x}-help${l?` ${x}-error`:""}`,onChange:z=>{i(z.target.value),p.current=z.target.value,l&&c(""),A(z.target.value)},onKeyDown:M,onBlur:()=>w(!1),onFocus:()=>{wu(s)&&h.suggestions.length>0&&w(!0)},className:E(ms,"tw:h-12 tw:pl-[42px] tw:pr-[92px] tw:text-[15px] tw:max-[782px]:h-[52px] tw:max-[782px]:text-base tw:[&::-webkit-search-cancel-button]:hidden")}),o.jsx("button",{type:"submit",className:E(pu,"tw:absolute tw:right-1.5 tw:top-1/2 tw:h-9 tw:min-w-[72px] tw:-translate-y-1/2 tw:max-[782px]:h-10"),children:"Find"}),g?o.jsx("ul",{id:b,role:"listbox","aria-label":"Suggestions",className:"psfa-menu tw:absolute tw:inset-x-0 tw:top-full tw:z-30 tw:m-0 tw:mt-1.5 tw:max-h-[min(320px,50vh)] tw:list-none tw:overflow-y-auto tw:overscroll-contain tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-popover tw:p-1.5 tw:text-popover-foreground tw:shadow-psfa-pop",children:h.suggestions.map((z,B)=>o.jsxs("li",{id:`${b}-${B}`,role:"option","aria-selected":B===h.selectedIndex?"true":"false",onMouseDown:I=>I.preventDefault(),onMouseMove:()=>{B!==h.selectedIndex&&h.setSelectedIndex(B)},onClick:()=>C(z),className:E("psfa-menu-item tw:m-0 tw:flex tw:min-h-9 tw:cursor-pointer tw:select-none tw:items-center tw:gap-2.5 tw:rounded-md tw:px-2.5 tw:py-1.5 tw:text-sm tw:text-foreground tw:touch-manipulation tw:max-[782px]:min-h-11 tw:max-[782px]:text-[15px]",B===h.selectedIndex&&"tw:bg-accent"),children:[o.jsx(yc,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0 tw:text-muted-foreground"}),o.jsx(oY,{text:z,typed:s})]},`${B}-${z}`))}):null]}),o.jsx("span",{role:"status",className:"tw:sr-only",children:g?`${h.suggestions.length} suggestions. Use the up and down arrows to choose one.`:""}),l?o.jsxs("p",{id:`${x}-error`,className:gu,children:[o.jsx(co,{"aria-hidden":"true",className:"tw:mt-0.5 tw:size-4 tw:shrink-0"}),l]}):null,(y==null?void 0:y.type)==="link"?o.jsxs("p",{role:"status",className:"tw:m-0 tw:mt-2 tw:inline-flex tw:items-center tw:gap-1.5 tw:text-[13px] tw:text-success",children:[o.jsx(HP,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0"}),"Link recognized. ASIN ",o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:y.asin})]}):null,o.jsx("p",{id:`${x}-help`,className:Yn,children:"Have a SKU or product code? On Amazon it's the ASIN: 10 letters and numbers, found in the product link after /dp/."}),r]})}function Zb({src:e,className:t}){const[n,a]=d.useState(!1);return o.jsx("span",{className:E("tw:flex tw:size-[76px] tw:shrink-0 tw:items-center tw:justify-center tw:overflow-hidden tw:rounded-lg tw:border tw:border-solid tw:border-border tw:bg-card",t),children:e&&!n?o.jsx("img",{src:e,alt:"",loading:"lazy",onError:()=>a(!0),className:"tw:size-full tw:object-contain tw:p-1"}):o.jsx(Zo,{"aria-hidden":"true",className:"tw:size-1/3 tw:text-muted-foreground"})})}function sY({query:e,results:t,onPick:n}){return o.jsxs(o.Fragment,{children:[o.jsx("p",{role:"status",className:`${Yn} tw:mt-3.5 tw:[overflow-wrap:anywhere]`,children:`Results for "${e}"`}),o.jsx("ul",{className:"tw:m-0 tw:mt-1.5 tw:list-none tw:overflow-hidden tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:p-0",children:t.map(a=>o.jsx("li",{className:"tw:m-0 tw:[&+&]:border-0 tw:[&+&]:border-t tw:[&+&]:border-solid tw:[&+&]:border-border",children:o.jsxs("button",{type:"button",onClick:()=>n(a),className:"tw:grid tw:w-full tw:cursor-pointer tw:grid-cols-[48px_minmax(0,1fr)_auto] tw:items-center tw:gap-3 tw:border-0 tw:bg-card tw:px-3 tw:py-2.5 tw:text-left tw:text-foreground tw:touch-manipulation tw:transition-colors tw:duration-150 tw:hover:bg-accent tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring tw:max-[782px]:min-h-14 tw:[li:first-child>&]:rounded-t-[9px] tw:[li:last-child>&]:rounded-b-[9px]",children:[o.jsx(Zb,{src:a.image,className:"tw:size-12"}),o.jsxs("span",{className:"tw:min-w-0",children:[o.jsx("span",{className:"tw:line-clamp-2 tw:text-[13.5px] tw:font-medium tw:[overflow-wrap:anywhere]",children:a.title||`ASIN ${a.asin}`}),o.jsxs("span",{className:"tw:block tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono",children:a.asin}),a.hasBox?", you have a box for this":""]})]}),o.jsx("span",{className:"tw:whitespace-nowrap tw:text-[13px] tw:font-medium tw:text-link",children:a.hasBox?"Open":"Choose"})]})},a.asin))})]})}const Sk={info:{box:"tw:bg-info-soft",icon:"tw:text-info"},warn:{box:"tw:bg-warning-soft",icon:"tw:text-warning"},bad:{box:"tw:bg-destructive-soft",icon:"tw:text-destructive"}};function ma({tone:e,title:t,children:n,actions:a,className:r}){const s=e==="bad"?co:e==="warn"?Sc:lf;return o.jsxs("div",{role:e==="bad"?"alert":"status",className:E("tw:flex tw:gap-2.5 tw:rounded-[10px] tw:px-3.5 tw:py-3 tw:text-[13.5px] tw:leading-normal tw:text-foreground",Sk[e].box,r),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:mt-px tw:size-[18px] tw:shrink-0",Sk[e].icon)}),o.jsxs("div",{className:"tw:min-w-0 tw:flex-1 tw:[overflow-wrap:anywhere]",children:[t?o.jsx("strong",{className:"tw:block tw:font-semibold",children:t}):null,n?o.jsx("div",{className:t?"tw:mt-0.5":void 0,children:n}):null,a?o.jsx("div",{className:"tw:mt-2 tw:flex tw:flex-wrap tw:gap-3",children:a}):null]})]})}const iY="The plugin settings did not load. Reload this page and try again.";function lY(e){return`<!-- wp:shortcode -->474 */var Di=u;function iI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lI=typeof Object.is=="function"?Object.is:iI,cI=Di.useState,uI=Di.useEffect,dI=Di.useLayoutEffect,fI=Di.useDebugValue;function mI(e,t){var n=t(),a=cI({inst:{value:n,getSnapshot:t}}),r=a[0].inst,s=a[1];return dI(function(){r.value=n,r.getSnapshot=t,Sx(r)&&s({inst:r})},[e,n,t]),uI(function(){return Sx(r)&&s({inst:r}),e(function(){Sx(r)&&s({inst:r})})},[e]),fI(n),n}function Sx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lI(e,n)}catch{return!0}}function wI(e,t){return t()}var pI=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wI:mI;_A.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:pI,AA.exports=_A;var hI=AA.exports;function gI(){return hI.useSyncExternalStore(xI,()=>!0,()=>!1)}function xI(){return()=>{}}var jx="Avatar",[bI]=rI(jx),[vI,EA]=bI(jx),TA=u.forwardRef((e,t)=>{const{__scopeAvatar:n,...a}=e,[r,s]=u.useState("idle");return o.jsx(vI,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:o.jsx(yx.span,{...a,ref:t})})});TA.displayName=jx;var RA="AvatarImage",kA=u.forwardRef((e,t)=>{const{__scopeAvatar:n,src:a,onLoadingStatusChange:r=()=>{},...s}=e,i=EA(RA,n),l=yI(a,s),c=Ft(d=>{r(d),i.onImageLoadingStatusChange(d)});return jt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(yx.img,{...s,ref:t,src:a}):null});kA.displayName=RA;var MA="AvatarFallback",DA=u.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:a,...r}=e,s=EA(MA,n),[i,l]=u.useState(a===void 0);return u.useEffect(()=>{if(a!==void 0){const c=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(c)}},[a]),i&&s.imageLoadingStatus!=="loaded"?o.jsx(yx.span,{...r,ref:t}):null});DA.displayName=MA;function OA(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function yI(e,{referrerPolicy:t,crossOrigin:n}){const a=gI(),r=u.useRef(null),s=a?(r.current||(r.current=new window.Image),r.current):null,[i,l]=u.useState(()=>OA(s,e));return jt(()=>{l(OA(s,e))},[s,e]),jt(()=>{const c=f=>()=>{l(f)};if(!s)return;const d=c("loaded"),m=c("error");return s.addEventListener("load",d),s.addEventListener("error",m),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",d),s.removeEventListener("error",m)}},[s,n,t]),i}var PA=TA,zA=kA,LA=DA;const SI=u.forwardRef(({className:e,...t},n)=>o.jsx(PA,{ref:n,className:E("tw:relative tw:flex tw:h-10 tw:w-10 tw:shrink-0 tw:overflow-hidden tw:rounded-full",e),...t}));SI.displayName=PA.displayName;const jI=u.forwardRef(({className:e,...t},n)=>o.jsx(zA,{ref:n,className:E("tw:aspect-square tw:h-full tw:w-full",e),...t}));jI.displayName=zA.displayName;const NI=u.forwardRef(({className:e,...t},n)=>o.jsx(LA,{ref:n,className:E("tw:flex tw:h-full tw:w-full tw:items-center tw:justify-center tw:rounded-full tw:bg-muted",e),...t}));NI.displayName=LA.displayName;const CI=hi("tw:inline-flex tw:items-center tw:rounded-md tw:border tw:px-2.5 tw:py-0.5 tw:text-xs tw:font-semibold tw:transition-colors tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2",{variants:{variant:{default:"tw:border-transparent tw:bg-primary tw:text-primary-foreground tw:shadow tw:hover:bg-primary/80",secondary:"tw:border-transparent tw:bg-secondary tw:text-secondary-foreground tw:hover:bg-secondary/80",destructive:"tw:border-transparent tw:bg-destructive tw:text-destructive-foreground tw:shadow tw:hover:bg-destructive/80",outline:"tw:text-foreground"}},defaultVariants:{variant:"default"}});function Ar({className:e,variant:t,...n}){return o.jsx("div",{className:E(CI({variant:t}),e),...n})}const IA=u.forwardRef(({...e},t)=>o.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));IA.displayName="Breadcrumb";const $A=u.forwardRef(({className:e,...t},n)=>o.jsx("ol",{ref:n,className:E("tw:flex tw:flex-wrap tw:items-center tw:gap-1.5 tw:break-words tw:text-sm tw:text-muted-foreground tw:sm:gap-2.5",e),...t}));$A.displayName="BreadcrumbList";const BA=u.forwardRef(({className:e,...t},n)=>o.jsx("li",{ref:n,className:E("tw:inline-flex tw:items-center tw:gap-1.5",e),...t}));BA.displayName="BreadcrumbItem";const UA=u.forwardRef(({asChild:e,className:t,...n},a)=>{const r=e?Qo:"a";return o.jsx(r,{ref:a,className:E("tw:transition-colors tw:hover:text-foreground",t),...n})});UA.displayName="BreadcrumbLink";const HA=u.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:E("tw:font-normal tw:text-foreground",e),...t}));HA.displayName="BreadcrumbPage";const FA=({children:e,className:t,...n})=>o.jsx("li",{role:"presentation","aria-hidden":"true",className:E("tw:[&>svg]:w-3.5 tw:[&>svg]:h-3.5",t),...n,children:e??o.jsx(vc,{})});FA.displayName="BreadcrumbSeparator";var Wf="Checkbox",[AI]=Ht(Wf),[_I,Nx]=AI(Wf);function EI(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:r,disabled:s,form:i,name:l,onCheckedChange:c,required:d,value:m="on",internal_do_not_use_render:f}=e,[w,p]=Vn({prop:n,defaultProp:r??!1,onChange:c,caller:Wf}),[x,b]=u.useState(null),[y,h]=u.useState(null),g=u.useRef(!1),v=x?!!i||!!x.closest("form"):!0,S={checked:w,disabled:s,setChecked:p,control:x,setControl:b,name:l,form:i,value:m,hasConsumerStoppedPropagationRef:g,required:d,defaultChecked:xo(r)?!1:r,isFormControl:v,bubbleInput:y,setBubbleInput:h};return o.jsx(_I,{scope:t,...S,children:TI(f)?f(S):a})}var VA="CheckboxTrigger",GA=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},r)=>{const{control:s,value:i,disabled:l,checked:c,required:d,setControl:m,setChecked:f,hasConsumerStoppedPropagationRef:w,isFormControl:p,bubbleInput:x}=Nx(VA,e),b=Se(r,m),y=u.useRef(c);return u.useEffect(()=>{const h=s==null?void 0:s.form;if(h){const g=()=>f(y.current);return h.addEventListener("reset",g),()=>h.removeEventListener("reset",g)}},[s,f]),o.jsx(me.button,{type:"button",role:"checkbox","aria-checked":xo(c)?"mixed":c,"aria-required":d,"data-state":WA(c),"data-disabled":l?"":void 0,disabled:l,value:i,...a,ref:b,onKeyDown:ee(t,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:ee(n,h=>{f(g=>xo(g)?!0:!g),x&&p&&(w.current=h.isPropagationStopped(),w.current||h.stopPropagation())})})});GA.displayName=VA;var Cx=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:s,required:i,disabled:l,value:c,onCheckedChange:d,form:m,...f}=e;return o.jsx(EI,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:l,required:i,onCheckedChange:d,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(GA,{...f,ref:t,__scopeCheckbox:n}),w&&o.jsx(XA,{__scopeCheckbox:n})]})})});Cx.displayName=Wf;var YA="CheckboxIndicator",KA=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,s=Nx(YA,n);return o.jsx(Rt,{present:a||xo(s.checked)||s.checked===!0,children:o.jsx(me.span,{"data-state":WA(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});KA.displayName=YA;var qA="CheckboxBubbleInput",XA=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:i,required:l,disabled:c,name:d,value:m,form:f,bubbleInput:w,setBubbleInput:p}=Nx(qA,e),x=Se(n,p),b=kc(s),y=Tc(a);u.useEffect(()=>{const g=w;if(!g)return;const v=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(v,"checked").set,A=!r.current;if(b!==s&&N){const j=new Event("click",{bubbles:A});g.indeterminate=xo(s),N.call(g,xo(s)?!1:s),g.dispatchEvent(j)}},[w,b,s,r]);const h=u.useRef(xo(s)?!1:s);return o.jsx(me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??h.current,required:l,disabled:c,name:d,value:m,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});XA.displayName=qA;function TI(e){return typeof e=="function"}function xo(e){return e==="indeterminate"}function WA(e){return xo(e)?"indeterminate":e?"checked":"unchecked"}const Uc=u.forwardRef(({className:e,...t},n)=>o.jsx(Cx,{ref:n,className:E("tw:grid tw:place-content-center tw:peer tw:h-4 tw:w-4 tw:shrink-0 tw:rounded-sm tw:border tw:border-primary tw:shadow tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:data-[state=checked]:bg-primary tw:data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(KA,{className:E("tw:grid tw:place-content-center tw:text-current"),children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}));Uc.displayName=Cx.displayName;var Zf="Collapsible",[RI]=Ht(Zf),[kI,Ax]=RI(Zf),ZA=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:a,defaultOpen:r,disabled:s,onOpenChange:i,...l}=e,[c,d]=Vn({prop:a,defaultProp:r??!1,onChange:i,caller:Zf});return o.jsx(kI,{scope:n,disabled:s,contentId:Un(),open:c,onOpenToggle:u.useCallback(()=>d(m=>!m),[d]),children:o.jsx(me.div,{"data-state":Ex(c),"data-disabled":s?"":void 0,...l,ref:t})})});ZA.displayName=Zf;var QA="CollapsibleTrigger",JA=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,...a}=e,r=Ax(QA,n);return o.jsx(me.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Ex(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:t,onClick:ee(e.onClick,r.onOpenToggle)})});JA.displayName=QA;var _x="CollapsibleContent",e_=u.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=Ax(_x,e.__scopeCollapsible);return o.jsx(Rt,{present:n||r.open,children:({present:s})=>o.jsx(MI,{...a,ref:t,present:s})})});e_.displayName=_x;var MI=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:a,children:r,...s}=e,i=Ax(_x,n),[l,c]=u.useState(a),d=u.useRef(null),m=Se(t,d),f=u.useRef(0),w=f.current,p=u.useRef(0),x=p.current,b=i.open||l,y=u.useRef(b),h=u.useRef(void 0);return u.useEffect(()=>{const g=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(g)},[]),jt(()=>{const g=d.current;if(g){h.current=h.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const v=g.getBoundingClientRect();f.current=v.height,p.current=v.width,y.current||(g.style.transitionDuration=h.current.transitionDuration,g.style.animationName=h.current.animationName),c(a)}},[i.open,a]),o.jsx(me.div,{"data-state":Ex(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...s,ref:m,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:b&&r})});function Ex(e){return e?"open":"closed"}var DI=ZA;const Tx=DI,Rx=JA,kx=e_,Qf=fx,OI=mx,t_=wx,PI=Bc,Mx=u.forwardRef(({className:e,...t},n)=>o.jsx(Lc,{ref:n,className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/50",e),...t}));Mx.displayName=Lc.displayName;const Jf=u.forwardRef(({className:e,children:t,disablePortal:n=!1,overlayClassName:a,closeClassName:r,...s},i)=>{const l=o.jsxs(o.Fragment,{children:[o.jsx(Mx,{className:a}),o.jsxs(ki,{ref:i,className:E("tw:fixed tw:left-[50%] tw:top-[50%] tw:z-50 tw:grid tw:w-full tw:max-w-lg tw:translate-x-[-50%] tw:translate-y-[-50%] tw:gap-4 tw:border tw:border-gray-200 tw:bg-background tw:p-6 tw:shadow-xl tw:rounded-lg",e),...s,children:[t,o.jsxs(Bc,{className:E("tw:absolute tw:right-4 tw:top-4 tw:rounded-sm tw:opacity-70 tw:ring-offset-background tw:transition-opacity tw:hover:opacity-100 tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2 tw:disabled:pointer-events-none tw:data-[state=open]:bg-accent tw:data-[state=open]:text-muted-foreground",r),children:[o.jsx(Eg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Close"})]})]})]});return n?l:o.jsx(t_,{children:l})});Jf.displayName=ki.displayName;const Dx=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-1.5 tw:text-center tw:sm:text-left",e),...t});Dx.displayName="DialogHeader";const n_=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col-reverse tw:sm:flex-row tw:sm:justify-end tw:sm:space-x-2",e),...t});n_.displayName="DialogFooter";const Hc=u.forwardRef(({className:e,...t},n)=>o.jsx(Ic,{ref:n,className:E("tw:text-lg tw:font-semibold tw:leading-none tw:tracking-tight",e),...t}));Hc.displayName=Ic.displayName;const a_=u.forwardRef(({className:e,...t},n)=>o.jsx($c,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));a_.displayName=$c.displayName;var Ox="rovingFocusGroup.onEntryFocus",zI={bubbles:!1,cancelable:!0},Fc="RovingFocusGroup",[Px,r_,LI]=xf(Fc),[II,Oi]=Ht(Fc,[LI]),[$I,BI]=II(Fc),o_=u.forwardRef((e,t)=>o.jsx(Px.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Px.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(UI,{...e,ref:t})})}));o_.displayName=Fc;var UI=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...f}=e,w=u.useRef(null),p=Se(t,w),x=es(s),[b,y]=Vn({prop:i,defaultProp:l??null,onChange:c,caller:Fc}),[h,g]=u.useState(!1),v=Ft(d),S=r_(n),N=u.useRef(!1),[A,j]=u.useState(0);return u.useEffect(()=>{const C=w.current;if(C)return C.addEventListener(Ox,v),()=>C.removeEventListener(Ox,v)},[v]),o.jsx($I,{scope:n,orientation:a,dir:x,loop:r,currentTabStopId:b,onItemFocus:u.useCallback(C=>y(C),[y]),onItemShiftTab:u.useCallback(()=>g(!0),[]),onFocusableItemAdd:u.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:u.useCallback(()=>j(C=>C-1),[]),children:o.jsx(me.div,{tabIndex:h||A===0?-1:0,"data-orientation":a,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{N.current=!0}),onFocus:ee(e.onFocus,C=>{const R=!N.current;if(C.target===C.currentTarget&&R&&!h){const M=new CustomEvent(Ox,zI);if(C.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=S().filter(T=>T.focusable),B=z.find(T=>T.active),I=z.find(T=>T.id===b),D=[B,I,...z].filter(Boolean).map(T=>T.ref.current);l_(D,m)}}N.current=!1}),onBlur:ee(e.onBlur,()=>g(!1))})})}),s_="RovingFocusGroupItem",i_=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:s,children:i,...l}=e,c=Un(),d=s||c,m=BI(s_,n),f=m.currentTabStopId===d,w=r_(n),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:b}=m;return u.useEffect(()=>{if(a)return p(),()=>x()},[a,p,x]),o.jsx(Px.ItemSlot,{scope:n,id:d,focusable:a,active:r,children:o.jsx(me.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:ee(e.onMouseDown,y=>{a?m.onItemFocus(d):y.preventDefault()}),onFocus:ee(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=VI(y,m.orientation,m.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let v=w().filter(S=>S.focusable).map(S=>S.ref.current);if(h==="last")v.reverse();else if(h==="prev"||h==="next"){h==="prev"&&v.reverse();const S=v.indexOf(y.currentTarget);v=m.loop?GI(v,S+1):v.slice(S+1)}setTimeout(()=>l_(v))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:b!=null}):i})})});i_.displayName=s_;var HI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VI(e,t,n){const a=FI(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return HI[a]}function l_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function GI(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var zx=o_,Lx=i_;function YI(e){const t=KI(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(XI);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function KI(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=ZI(r),l=WI(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qI=Symbol("radix.slottable");function XI(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qI}function WI(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function ZI(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ix=["Enter"," "],QI=["ArrowDown","PageUp","Home"],c_=["ArrowUp","PageDown","End"],JI=[...QI,...c_],e9={ltr:[...Ix,"ArrowRight"],rtl:[...Ix,"ArrowLeft"]},t9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vc="Menu",[Gc,n9,a9]=xf(Vc),[os,u_]=Ht(Vc,[a9,po,Oi]),em=po(),d_=Oi(),[r9,ss]=os(Vc),[o9,Yc]=os(Vc),f_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:s,modal:i=!0}=e,l=em(t),[c,d]=u.useState(null),m=u.useRef(!1),f=Ft(s),w=es(r);return u.useEffect(()=>{const p=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),o.jsx(Rf,{...l,children:o.jsx(r9,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:d,children:o.jsx(o9,{scope:t,onClose:u.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:w,modal:i,children:a})})})};f_.displayName=Vc;var s9="MenuAnchor",$x=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=em(n);return o.jsx(Rc,{...r,...a,ref:t})});$x.displayName=s9;var Bx="MenuPortal",[i9,m_]=os(Bx,{forceMount:void 0}),w_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,s=ss(Bx,t);return o.jsx(i9,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};w_.displayName=Bx;var ua="MenuContent",[l9,Ux]=os(ua),p_=u.forwardRef((e,t)=>{const n=m_(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,s=ss(ua,e.__scopeMenu),i=Yc(ua,e.__scopeMenu);return o.jsx(Gc.Provider,{scope:e.__scopeMenu,children:o.jsx(Rt,{present:a||s.open,children:o.jsx(Gc.Slot,{scope:e.__scopeMenu,children:i.modal?o.jsx(c9,{...r,ref:t}):o.jsx(u9,{...r,ref:t})})})})}),c9=u.forwardRef((e,t)=>{const n=ss(ua,e.__scopeMenu),a=u.useRef(null),r=Se(t,a);return u.useEffect(()=>{const s=a.current;if(s)return Pf(s)},[]),o.jsx(Hx,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),u9=u.forwardRef((e,t)=>{const n=ss(ua,e.__scopeMenu);return o.jsx(Hx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),d9=YI("MenuContent.ScrollLock"),Hx=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:w,onDismiss:p,disableOutsideScroll:x,...b}=e,y=ss(ua,n),h=Yc(ua,n),g=em(n),v=d_(n),S=n9(n),[N,A]=u.useState(null),j=u.useRef(null),C=Se(t,j,y.onContentChange),R=u.useRef(0),M=u.useRef(""),z=u.useRef(0),B=u.useRef(null),I=u.useRef("right"),V=u.useRef(0),D=x?Mc:u.Fragment,T=x?{as:d9,allowPinchZoom:!0}:void 0,O=$=>{var Y,Z;const H=M.current+$,F=S().filter(le=>!le.disabled),Q=document.activeElement,X=(Y=F.find(le=>le.ref.current===Q))==null?void 0:Y.textValue,P=F.map(le=>le.textValue),G=j9(P,H,X),ne=(Z=F.find(le=>le.textValue===G))==null?void 0:Z.ref.current;(function le(he){M.current=he,window.clearTimeout(R.current),he!==""&&(R.current=window.setTimeout(()=>le(""),1e3))})(H),ne&&setTimeout(()=>ne.focus())};u.useEffect(()=>()=>window.clearTimeout(R.current),[]),bf();const _=u.useCallback($=>{var F,Q;return I.current===((F=B.current)==null?void 0:F.side)&&C9($,(Q=B.current)==null?void 0:Q.area)},[]);return o.jsx(l9,{scope:n,searchRef:M,onItemEnter:u.useCallback($=>{_($)&&$.preventDefault()},[_]),onItemLeave:u.useCallback($=>{var H;_($)||((H=j.current)==null||H.focus(),A(null))},[_]),onTriggerLeave:u.useCallback($=>{_($)&&$.preventDefault()},[_]),pointerGraceTimerRef:z,onPointerGraceIntentChange:u.useCallback($=>{B.current=$},[]),children:o.jsx(D,{...T,children:o.jsx(Ac,{asChild:!0,trapped:r,onMountAutoFocus:ee(s,$=>{var H;$.preventDefault(),(H=j.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:w,onDismiss:p,children:o.jsx(zx,{asChild:!0,...v,dir:h.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:A,onEntryFocus:ee(c,$=>{h.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(kf,{role:"menu","aria-orientation":"vertical","data-state":M_(y.open),"data-radix-menu-content":"",dir:h.dir,...g,...b,ref:C,style:{outline:"none",...b.style},onKeyDown:ee(b.onKeyDown,$=>{const F=$.target.closest("[data-radix-menu-content]")===$.currentTarget,Q=$.ctrlKey||$.altKey||$.metaKey,X=$.key.length===1;F&&($.key==="Tab"&&$.preventDefault(),!Q&&X&&O($.key));const P=j.current;if($.target!==P||!JI.includes($.key))return;$.preventDefault();const ne=S().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);c_.includes($.key)&&ne.reverse(),y9(ne)}),onBlur:ee(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:ee(e.onPointerMove,qc($=>{const H=$.target,F=V.current!==$.clientX;if($.currentTarget.contains(H)&&F){const Q=$.clientX>V.current?"right":"left";I.current=Q,V.current=$.clientX}}))})})})})})})});p_.displayName=ua;var f9="MenuGroup",Fx=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{role:"group",...a,ref:t})});Fx.displayName=f9;var m9="MenuLabel",h_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{...a,ref:t})});h_.displayName=m9;var tm="MenuItem",g_="menu.itemSelect",nm=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,s=u.useRef(null),i=Yc(tm,e.__scopeMenu),l=Ux(tm,e.__scopeMenu),c=Se(t,s),d=u.useRef(!1),m=()=>{const f=s.current;if(!n&&f){const w=new CustomEvent(g_,{bubbles:!0,cancelable:!0});f.addEventListener(g_,p=>a==null?void 0:a(p),{once:!0}),ZN(f,w),w.defaultPrevented?d.current=!1:i.onClose()}};return o.jsx(x_,{...r,ref:c,disabled:n,onClick:ee(e.onClick,m),onPointerDown:f=>{var w;(w=e.onPointerDown)==null||w.call(e,f),d.current=!0},onPointerUp:ee(e.onPointerUp,f=>{var w;d.current||(w=f.currentTarget)==null||w.click()}),onKeyDown:ee(e.onKeyDown,f=>{const w=l.searchRef.current!=="";n||w&&f.key===" "||Ix.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});nm.displayName=tm;var x_=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...s}=e,i=Ux(tm,n),l=d_(n),c=u.useRef(null),d=Se(t,c),[m,f]=u.useState(!1),[w,p]=u.useState("");return u.useEffect(()=>{const x=c.current;x&&p((x.textContent??"").trim())},[s.children]),o.jsx(Gc.ItemSlot,{scope:n,disabled:a,textValue:r??w,children:o.jsx(Lx,{asChild:!0,...l,focusable:!a,children:o.jsx(me.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:d,onPointerMove:ee(e.onPointerMove,qc(x=>{a?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,qc(x=>i.onItemLeave(x))),onFocus:ee(e.onFocus,()=>f(!0)),onBlur:ee(e.onBlur,()=>f(!1))})})})}),w9="MenuCheckboxItem",b_=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return o.jsx(N_,{scope:e.__scopeMenu,checked:n,children:o.jsx(nm,{role:"menuitemcheckbox","aria-checked":am(n)?"mixed":n,...r,ref:t,"data-state":Gx(n),onSelect:ee(r.onSelect,()=>a==null?void 0:a(am(n)?!0:!n),{checkForDefaultPrevented:!1})})})});b_.displayName=w9;var v_="MenuRadioGroup",[p9,h9]=os(v_,{value:void 0,onValueChange:()=>{}}),y_=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,s=Ft(a);return o.jsx(p9,{scope:e.__scopeMenu,value:n,onValueChange:s,children:o.jsx(Fx,{...r,ref:t})})});y_.displayName=v_;var S_="MenuRadioItem",j_=u.forwardRef((e,t)=>{const{value:n,...a}=e,r=h9(S_,e.__scopeMenu),s=n===r.value;return o.jsx(N_,{scope:e.__scopeMenu,checked:s,children:o.jsx(nm,{role:"menuitemradio","aria-checked":s,...a,ref:t,"data-state":Gx(s),onSelect:ee(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});j_.displayName=S_;var Vx="MenuItemIndicator",[N_,g9]=os(Vx,{checked:!1}),C_=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,s=g9(Vx,n);return o.jsx(Rt,{present:a||am(s.checked)||s.checked===!0,children:o.jsx(me.span,{...r,ref:t,"data-state":Gx(s.checked)})})});C_.displayName=Vx;var x9="MenuSeparator",A_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(me.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});A_.displayName=x9;var b9="MenuArrow",__=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=em(n);return o.jsx(Mf,{...r,...a,ref:t})});__.displayName=b9;var v9="MenuSub",[Hee,E_]=os(v9),Kc="MenuSubTrigger",T_=u.forwardRef((e,t)=>{const n=ss(Kc,e.__scopeMenu),a=Yc(Kc,e.__scopeMenu),r=E_(Kc,e.__scopeMenu),s=Ux(Kc,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,d={__scopeMenu:e.__scopeMenu},m=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>m,[m]),u.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),o.jsx($x,{asChild:!0,...d,children:o.jsx(x_,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":M_(n.open),...e,ref:Ia(t,r.onTriggerChange),onClick:f=>{var w;(w=e.onClick)==null||w.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(e.onPointerMove,qc(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:ee(e.onPointerLeave,qc(f=>{var p,x;m();const w=(p=n.content)==null?void 0:p.getBoundingClientRect();if(w){const b=(x=n.content)==null?void 0:x.dataset.side,y=b==="right",h=y?-5:5,g=w[y?"left":"right"],v=w[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+h,y:f.clientY},{x:g,y:w.top},{x:v,y:w.top},{x:v,y:w.bottom},{x:g,y:w.bottom}],side:b}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,f=>{var p;const w=s.searchRef.current!=="";e.disabled||w&&f.key===" "||e9[a.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});T_.displayName=Kc;var R_="MenuSubContent",k_=u.forwardRef((e,t)=>{const n=m_(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,s=ss(ua,e.__scopeMenu),i=Yc(ua,e.__scopeMenu),l=E_(R_,e.__scopeMenu),c=u.useRef(null),d=Se(t,c);return o.jsx(Gc.Provider,{scope:e.__scopeMenu,children:o.jsx(Rt,{present:a||s.open,children:o.jsx(Gc.Slot,{scope:e.__scopeMenu,children:o.jsx(Hx,{id:l.contentId,"aria-labelledby":l.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var f;i.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ee(e.onFocusOutside,m=>{m.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,m=>{i.onClose(),m.preventDefault()}),onKeyDown:ee(e.onKeyDown,m=>{var p;const f=m.currentTarget.contains(m.target),w=t9[i.dir].includes(m.key);f&&w&&(s.onOpenChange(!1),(p=l.trigger)==null||p.focus(),m.preventDefault())})})})})})});k_.displayName=R_;function M_(e){return e?"open":"closed"}function am(e){return e==="indeterminate"}function Gx(e){return am(e)?"indeterminate":e?"checked":"unchecked"}function y9(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function S9(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function j9(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=S9(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function N9(e,t){const{x:n,y:a}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],d=l.x,m=l.y,f=c.x,w=c.y;m>a!=w>a&&n<(f-d)*(a-m)/(w-m)+d&&(r=!r)}return r}function C9(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return N9(n,t)}function qc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var A9=f_,_9=$x,E9=w_,T9=p_,R9=Fx,k9=h_,M9=nm,D9=b_,O9=y_,P9=j_,z9=C_,L9=A_,I9=__,$9=T_,B9=k_,rm="DropdownMenu",[U9]=Ht(rm,[u_]),mn=u_(),[H9,D_]=U9(rm),O_=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=mn(t),d=u.useRef(null),[m,f]=Vn({prop:r,defaultProp:s??!1,onChange:i,caller:rm});return o.jsx(H9,{scope:t,triggerId:Un(),triggerRef:d,contentId:Un(),open:m,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(w=>!w),[f]),modal:l,children:o.jsx(A9,{...c,open:m,onOpenChange:f,dir:a,modal:l,children:n})})};O_.displayName=rm;var P_="DropdownMenuTrigger",z_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,s=D_(P_,n),i=mn(n);return o.jsx(_9,{asChild:!0,...i,children:o.jsx(me.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:Ia(t,s.triggerRef),onPointerDown:ee(e.onPointerDown,l=>{!a&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:ee(e.onKeyDown,l=>{a||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});z_.displayName=P_;var F9="DropdownMenuPortal",L_=e=>{const{__scopeDropdownMenu:t,...n}=e,a=mn(t);return o.jsx(E9,{...a,...n})};L_.displayName=F9;var I_="DropdownMenuContent",$_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=D_(I_,n),s=mn(n),i=u.useRef(!1);return o.jsx(T9,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...a,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,l=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,m=c.button===2||d;(!r.modal||m)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$_.displayName=I_;var V9="DropdownMenuGroup",G9=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(R9,{...r,...a,ref:t})});G9.displayName=V9;var Y9="DropdownMenuLabel",B_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(k9,{...r,...a,ref:t})});B_.displayName=Y9;var K9="DropdownMenuItem",U_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(M9,{...r,...a,ref:t})});U_.displayName=K9;var q9="DropdownMenuCheckboxItem",H_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(D9,{...r,...a,ref:t})});H_.displayName=q9;var X9="DropdownMenuRadioGroup",F_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(O9,{...r,...a,ref:t})});F_.displayName=X9;var W9="DropdownMenuRadioItem",V_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(P9,{...r,...a,ref:t})});V_.displayName=W9;var Z9="DropdownMenuItemIndicator",G_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(z9,{...r,...a,ref:t})});G_.displayName=Z9;var Q9="DropdownMenuSeparator",Y_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(L9,{...r,...a,ref:t})});Y_.displayName=Q9;var J9="DropdownMenuArrow",e$=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(I9,{...r,...a,ref:t})});e$.displayName=J9;var t$="DropdownMenuSubTrigger",K_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx($9,{...r,...a,ref:t})});K_.displayName=t$;var n$="DropdownMenuSubContent",q_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=mn(n);return o.jsx(B9,{...r,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q_.displayName=n$;var a$=O_,r$=z_,o$=L_,X_=$_,W_=B_,Z_=U_,Q_=H_,s$=F_,J_=V_,eE=G_,tE=Y_,nE=K_,aE=q_;const Yx=a$,Kx=r$,i$=s$,l$=u.forwardRef(({className:e,inset:t,children:n,...a},r)=>o.jsxs(nE,{ref:r,className:E("tw:flex tw:cursor-default tw:select-none tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-none tw:focus:bg-accent tw:data-[state=open]:bg-accent tw:[&_svg]:pointer-events-none tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",t&&"tw:pl-8",e),...a,children:[n,o.jsx(vc,{className:"tw:ml-auto"})]}));l$.displayName=nE.displayName;const c$=u.forwardRef(({className:e,...t},n)=>o.jsx(aE,{ref:n,className:E("tw:z-50 tw:min-w-[8rem] tw:overflow-hidden tw:rounded-md tw:border tw:bg-popover tw:p-1 tw:text-popover-foreground tw:shadow-lg tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));c$.displayName=aE.displayName;const om=u.forwardRef(({className:e,sideOffset:t=4,onCloseAutoFocus:n,...a},r)=>o.jsx(o$,{children:o.jsx(X_,{ref:r,sideOffset:t,onCloseAutoFocus:lx(n),className:E("tw:z-50 tw:max-h-[var(--radix-dropdown-menu-content-available-height)] tw:min-w-[8rem] tw:overflow-y-auto tw:overflow-x-hidden tw:rounded-md tw:border tw:bg-popover tw:p-1 tw:text-popover-foreground tw:shadow-md","tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));om.displayName=X_.displayName;const Pi=u.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(Z_,{ref:a,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",t&&"tw:pl-8",e),...n}));Pi.displayName=Z_.displayName;const u$=u.forwardRef(({className:e,children:t,checked:n,...a},r)=>o.jsxs(Q_,{ref:r,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-8 tw:pr-2 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),checked:n,...a,children:[o.jsx("span",{className:"tw:absolute tw:left-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(eE,{children:o.jsx(yr,{className:"tw:h-4 tw:w-4"})})}),t]}));u$.displayName=Q_.displayName;const rE=u.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(J_,{ref:a,className:E("tw:relative tw:flex tw:cursor-default tw:select-none tw:items-center tw:rounded-sm tw:py-1.5 tw:pl-8 tw:pr-2 tw:text-sm tw:outline-none tw:transition-colors tw:focus:bg-accent tw:focus:text-accent-foreground tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"tw:absolute tw:left-2 tw:flex tw:h-3.5 tw:w-3.5 tw:items-center tw:justify-center",children:o.jsx(eE,{children:o.jsx(wN,{className:"tw:h-2 tw:w-2 tw:fill-current"})})}),t]}));rE.displayName=J_.displayName;const d$=u.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(W_,{ref:a,className:E("tw:px-2 tw:py-1.5 tw:text-sm tw:font-semibold",t&&"tw:pl-8",e),...n}));d$.displayName=W_.displayName;const qx=u.forwardRef(({className:e,...t},n)=>o.jsx(tE,{ref:n,className:E("tw:-mx-1 tw:my-1 tw:h-px tw:bg-muted",e),...t}));qx.displayName=tE.displayName;var f$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m$=f$.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=u.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),w$="Label",oE=u.forwardRef((e,t)=>o.jsx(m$.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));oE.displayName=w$;var sE=oE;const p$=hi("tw:text-sm tw:font-medium tw:leading-none tw:peer-disabled:cursor-not-allowed tw:peer-disabled:opacity-70"),Re=u.forwardRef(({className:e,...t},n)=>o.jsx(sE,{ref:n,className:E(p$(),e),...t}));Re.displayName=sE.displayName;function h$(e){const t=g$(e),n=u.forwardRef((a,r)=>{const{children:s,...i}=a,l=u.Children.toArray(s),c=l.find(b$);if(c){const d=c.props.children,m=l.map(f=>f===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,m):null})}return o.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function g$(e){const t=u.forwardRef((n,a)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const i=y$(r),l=v$(s,r.props);return r.type!==u.Fragment&&(l.ref=a?Ia(a,i):i),u.cloneElement(r,l)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var x$=Symbol("radix.slottable");function b$(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===x$}function v$(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...s}:a==="className"&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function y$(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sm="Popover",[iE]=Ht(sm,[po]),Xc=po(),[S$,bo]=iE(sm),lE=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,l=Xc(t),c=u.useRef(null),[d,m]=u.useState(!1),[f,w]=Vn({prop:a,defaultProp:r??!1,onChange:s,caller:sm});return o.jsx(Rf,{...l,children:o.jsx(S$,{scope:t,contentId:Un(),triggerRef:c,open:f,onOpenChange:w,onOpenToggle:u.useCallback(()=>w(p=>!p),[w]),hasCustomAnchor:d,onCustomAnchorAdd:u.useCallback(()=>m(!0),[]),onCustomAnchorRemove:u.useCallback(()=>m(!1),[]),modal:i,children:n})})};lE.displayName=sm;var cE="PopoverAnchor",j$=u.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(cE,n),s=Xc(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=r;return u.useEffect(()=>(i(),()=>l()),[i,l]),o.jsx(Rc,{...s,...a,ref:t})});j$.displayName=cE;var uE="PopoverTrigger",dE=u.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(uE,n),s=Xc(n),i=Se(t,r.triggerRef),l=o.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":hE(r.open),...a,ref:i,onClick:ee(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?l:o.jsx(Rc,{asChild:!0,...s,children:l})});dE.displayName=uE;var Xx="PopoverPortal",[N$,C$]=iE(Xx,{forceMount:void 0}),fE=e=>{const{__scopePopover:t,forceMount:n,children:a,container:r}=e,s=bo(Xx,t);return o.jsx(N$,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};fE.displayName=Xx;var zi="PopoverContent",mE=u.forwardRef((e,t)=>{const n=C$(zi,e.__scopePopover),{forceMount:a=n.forceMount,...r}=e,s=bo(zi,e.__scopePopover);return o.jsx(Rt,{present:a||s.open,children:s.modal?o.jsx(_$,{...r,ref:t}):o.jsx(E$,{...r,ref:t})})});mE.displayName=zi;var A$=h$("PopoverContent.RemoveScroll"),_$=u.forwardRef((e,t)=>{const n=bo(zi,e.__scopePopover),a=u.useRef(null),r=Se(t,a),s=u.useRef(!1);return u.useEffect(()=>{const i=a.current;if(i)return Pf(i)},[]),o.jsx(Mc,{as:A$,allowPinchZoom:!0,children:o.jsx(wE,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),E$=u.forwardRef((e,t)=>{const n=bo(zi,e.__scopePopover),a=u.useRef(!1),r=u.useRef(!1);return o.jsx(wE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:s=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),wE=u.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,...f}=e,w=bo(zi,n),p=Xc(n);return bf(),o.jsx(Ac,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:s,children:o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>w.onOpenChange(!1),children:o.jsx(kf,{"data-state":hE(w.open),role:"dialog",id:w.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),pE="PopoverClose",T$=u.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=bo(pE,n);return o.jsx(me.button,{type:"button",...a,ref:t,onClick:ee(e.onClick,()=>r.onOpenChange(!1))})});T$.displayName=pE;var R$="PopoverArrow",k$=u.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,r=Xc(n);return o.jsx(Mf,{...r,...a,ref:t})});k$.displayName=R$;function hE(e){return e?"open":"closed"}var M$=lE,D$=dE,O$=fE,gE=mE;const P$=M$,z$=D$,xE=u.forwardRef(({className:e,align:t="center",sideOffset:n=4,disablePortal:a=!1,onCloseAutoFocus:r,...s},i)=>{const l=o.jsx(gE,{ref:i,align:t,sideOffset:n,onCloseAutoFocus:lx(r),className:E("tw:z-50 tw:w-72 tw:rounded-md tw:border tw:bg-popover tw:p-4 tw:text-popover-foreground tw:shadow-md tw:outline-none tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-popover-content-transform-origin]",e),...s});return a?l:o.jsx(O$,{children:l})});xE.displayName=gE.displayName;var Wx="Radio",[L$,bE]=Ht(Wx),[I$,$$]=L$(Wx),vE=u.forwardRef((e,t)=>{const{__scopeRadio:n,name:a,checked:r=!1,required:s,disabled:i,value:l="on",onCheck:c,form:d,...m}=e,[f,w]=u.useState(null),p=Se(t,y=>w(y)),x=u.useRef(!1),b=f?d||!!f.closest("form"):!0;return o.jsxs(I$,{scope:n,checked:r,disabled:i,children:[o.jsx(me.button,{type:"button",role:"radio","aria-checked":r,"data-state":NE(r),"data-disabled":i?"":void 0,disabled:i,value:l,...m,ref:p,onClick:ee(e.onClick,y=>{r||c==null||c(),b&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),b&&o.jsx(jE,{control:f,bubbles:!x.current,name:a,value:l,checked:r,required:s,disabled:i,form:d,style:{transform:"translateX(-100%)"}})]})});vE.displayName=Wx;var yE="RadioIndicator",SE=u.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:a,...r}=e,s=$$(yE,n);return o.jsx(Rt,{present:a||s.checked,children:o.jsx(me.span,{"data-state":NE(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});SE.displayName=yE;var B$="RadioBubbleInput",jE=u.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:a=!0,...r},s)=>{const i=u.useRef(null),l=Se(i,s),c=kc(n),d=Tc(t);return u.useEffect(()=>{const m=i.current;if(!m)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:a});p.call(m,n),m.dispatchEvent(x)}},[c,n,a]),o.jsx(me.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});jE.displayName=B$;function NE(e){return e?"checked":"unchecked"}var U$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],im="RadioGroup",[H$]=Ht(im,[Oi,bE]),CE=Oi(),AE=bE(),[F$,V$]=H$(im),_E=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:a,defaultValue:r,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:d,loop:m=!0,onValueChange:f,...w}=e,p=CE(n),x=es(d),[b,y]=Vn({prop:s,defaultProp:r??null,onChange:f,caller:im});return o.jsx(F$,{scope:n,name:a,required:i,disabled:l,value:b,onValueChange:y,children:o.jsx(zx,{asChild:!0,...p,orientation:c,dir:x,loop:m,children:o.jsx(me.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...w,ref:t})})})});_E.displayName=im;var EE="RadioGroupItem",TE=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:a,...r}=e,s=V$(EE,n),i=s.disabled||a,l=CE(n),c=AE(n),d=u.useRef(null),m=Se(t,d),f=s.value===r.value,w=u.useRef(!1);return u.useEffect(()=>{const p=b=>{U$.includes(b.key)&&(w.current=!0)},x=()=>w.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",x)}},[]),o.jsx(Lx,{asChild:!0,...l,focusable:!i,active:f,children:o.jsx(vE,{disabled:i,required:s.required,checked:f,...c,...r,name:s.name,ref:m,onCheck:()=>s.onValueChange(r.value),onKeyDown:ee(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ee(r.onFocus,()=>{var p;w.current&&((p=d.current)==null||p.click())})})})});TE.displayName=EE;var G$="RadioGroupIndicator",RE=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...a}=e,r=AE(n);return o.jsx(SE,{...r,...a,ref:t})});RE.displayName=G$;var kE=_E,lm=TE,Y$=RE;const Zx=u.forwardRef(({className:e,...t},n)=>o.jsx(kE,{className:E("tw:grid tw:gap-2",e),...t,ref:n}));Zx.displayName=kE.displayName;const ME=u.forwardRef(({className:e,...t},n)=>o.jsx(lm,{ref:n,className:E("tw:aspect-square tw:h-4 tw:w-4 tw:rounded-full tw:border tw:border-primary tw:text-primary tw:shadow tw:focus:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50",e),...t,children:o.jsx(Y$,{className:"tw:flex tw:items-center tw:justify-center",children:o.jsx(wN,{className:"tw:h-3.5 tw:w-3.5 tw:fill-primary"})})}));ME.displayName=lm.displayName;function K$(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var Qx="ScrollArea",[DE]=Ht(Qx),[q$,da]=DE(Qx),OE=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:r,scrollHideDelay:s=600,...i}=e,[l,c]=u.useState(null),[d,m]=u.useState(null),[f,w]=u.useState(null),[p,x]=u.useState(null),[b,y]=u.useState(null),[h,g]=u.useState(0),[v,S]=u.useState(0),[N,A]=u.useState(!1),[j,C]=u.useState(!1),R=Se(t,z=>c(z)),M=es(r);return o.jsx(q$,{scope:n,type:a,dir:M,scrollHideDelay:s,scrollArea:l,viewport:d,onViewportChange:m,content:f,onContentChange:w,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:A,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:j,onScrollbarYEnabledChange:C,onCornerWidthChange:g,onCornerHeightChange:S,children:o.jsx(me.div,{dir:M,...i,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});OE.displayName=Qx;var PE="ScrollAreaViewport",zE=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:r,...s}=e,i=da(PE,n),l=u.useRef(null),c=Se(t,l,i.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(me.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});zE.displayName=PE;var Ga="ScrollAreaScrollbar",Jx=u.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,l=e.orientation==="horizontal";return u.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),r.type==="hover"?o.jsx(X$,{...a,ref:t,forceMount:n}):r.type==="scroll"?o.jsx(W$,{...a,ref:t,forceMount:n}):r.type==="auto"?o.jsx(LE,{...a,ref:t,forceMount:n}):r.type==="always"?o.jsx(eb,{...a,ref:t}):null});Jx.displayName=Ga;var X$=u.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),[s,i]=u.useState(!1);return u.useEffect(()=>{const l=r.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),i(!0)},m=()=>{c=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",m)}}},[r.scrollArea,r.scrollHideDelay]),o.jsx(Rt,{present:n||s,children:o.jsx(LE,{"data-state":s?"visible":"hidden",...a,ref:t})})}),W$=u.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=da(Ga,e.__scopeScrollArea),s=e.orientation==="horizontal",i=fm(()=>c("SCROLL_END"),100),[l,c]=K$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return u.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,r.scrollHideDelay,c]),u.useEffect(()=>{const d=r.viewport,m=s?"scrollLeft":"scrollTop";if(d){let f=d[m];const w=()=>{const p=d[m];f!==p&&(c("SCROLL"),i()),f=p};return d.addEventListener("scroll",w),()=>d.removeEventListener("scroll",w)}},[r.viewport,s,c,i]),o.jsx(Rt,{present:n||l!=="hidden",children:o.jsx(eb,{"data-state":l==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:ee(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ee(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),LE=u.forwardRef((e,t)=>{const n=da(Ga,e.__scopeScrollArea),{forceMount:a,...r}=e,[s,i]=u.useState(!1),l=e.orientation==="horizontal",c=fm(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?d:m)}},10);return Li(n.viewport,c),Li(n.content,c),o.jsx(Rt,{present:a||s,children:o.jsx(eb,{"data-state":s?"visible":"hidden",...r,ref:t})})}),eb=u.forwardRef((e,t)=>{const{orientation:n="vertical",...a}=e,r=da(Ga,e.__scopeScrollArea),s=u.useRef(null),i=u.useRef(0),[l,c]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HE(l.viewport,l.content),m={...a,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:w=>s.current=w,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:w=>i.current=w};function f(w,p){return nB(w,i.current,l,p)}return n==="horizontal"?o.jsx(Z$,{...m,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const w=r.viewport.scrollLeft,p=FE(w,l,r.dir);s.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:w=>{r.viewport&&(r.viewport.scrollLeft=w)},onDragScroll:w=>{r.viewport&&(r.viewport.scrollLeft=f(w,r.dir))}}):n==="vertical"?o.jsx(Q$,{...m,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const w=r.viewport.scrollTop,p=FE(w,l);s.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:w=>{r.viewport&&(r.viewport.scrollTop=w)},onDragScroll:w=>{r.viewport&&(r.viewport.scrollTop=f(w))}}):null}),Z$=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...r}=e,s=da(Ga,e.__scopeScrollArea),[i,l]=u.useState(),c=u.useRef(null),d=Se(t,c,s.onScrollbarXChange);return u.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx($E,{"data-orientation":"horizontal",...r,ref:d,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dm(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,f)=>{if(s.viewport){const w=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(w),GE(w,f)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:um(i.paddingLeft),paddingEnd:um(i.paddingRight)}})}})}),Q$=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...r}=e,s=da(Ga,e.__scopeScrollArea),[i,l]=u.useState(),c=u.useRef(null),d=Se(t,c,s.onScrollbarYChange);return u.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx($E,{"data-orientation":"vertical",...r,ref:d,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dm(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,f)=>{if(s.viewport){const w=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(w),GE(w,f)&&m.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:um(i.paddingTop),paddingEnd:um(i.paddingBottom)}})}})}),[J$,IE]=DE(Ga),$E=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:m,onResize:f,...w}=e,p=da(Ga,n),[x,b]=u.useState(null),y=Se(t,R=>b(R)),h=u.useRef(null),g=u.useRef(""),v=p.viewport,S=a.content-a.viewport,N=Ft(m),A=Ft(c),j=fm(f,10);function C(R){if(h.current){const M=R.clientX-h.current.left,z=R.clientY-h.current.top;d({x:M,y:z})}}return u.useEffect(()=>{const R=M=>{const z=M.target;(x==null?void 0:x.contains(z))&&N(M,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[v,x,S,N]),u.useEffect(A,[a,A]),Li(x,j),Li(p.content,j),o.jsx(J$,{scope:n,scrollbar:x,hasThumb:r,onThumbChange:Ft(s),onThumbPointerUp:Ft(i),onThumbPositionChange:A,onThumbPointerDown:Ft(l),children:o.jsx(me.div,{...w,ref:y,style:{position:"absolute",...w.style},onPointerDown:ee(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),h.current=x.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(R))}),onPointerMove:ee(e.onPointerMove,C),onPointerUp:ee(e.onPointerUp,R=>{const M=R.target;M.hasPointerCapture(R.pointerId)&&M.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=g.current,p.viewport&&(p.viewport.style.scrollBehavior=""),h.current=null})})})}),cm="ScrollAreaThumb",BE=u.forwardRef((e,t)=>{const{forceMount:n,...a}=e,r=IE(cm,e.__scopeScrollArea);return o.jsx(Rt,{present:n||r.hasThumb,children:o.jsx(eB,{ref:t,...a})})}),eB=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...r}=e,s=da(cm,n),i=IE(cm,n),{onThumbPositionChange:l}=i,c=Se(t,f=>i.onThumbChange(f)),d=u.useRef(void 0),m=fm(()=>{d.current&&(d.current(),d.current=void 0)},100);return u.useEffect(()=>{const f=s.viewport;if(f){const w=()=>{if(m(),!d.current){const p=aB(f,l);d.current=p,l()}};return l(),f.addEventListener("scroll",w),()=>f.removeEventListener("scroll",w)}},[s.viewport,m,l]),o.jsx(me.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:ee(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),x=f.clientX-p.left,b=f.clientY-p.top;i.onThumbPointerDown({x,y:b})}),onPointerUp:ee(e.onPointerUp,i.onThumbPointerUp)})});BE.displayName=cm;var tb="ScrollAreaCorner",UE=u.forwardRef((e,t)=>{const n=da(tb,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?o.jsx(tB,{...e,ref:t}):null});UE.displayName=tb;var tB=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,r=da(tb,n),[s,i]=u.useState(0),[l,c]=u.useState(0),d=!!(s&&l);return Li(r.scrollbarX,()=>{var f;const m=((f=r.scrollbarX)==null?void 0:f.offsetHeight)||0;r.onCornerHeightChange(m),c(m)}),Li(r.scrollbarY,()=>{var f;const m=((f=r.scrollbarY)==null?void 0:f.offsetWidth)||0;r.onCornerWidthChange(m),i(m)}),d?o.jsx(me.div,{...a,ref:t,style:{width:s,height:l,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function um(e){return e?parseInt(e,10):0}function HE(e,t){const n=e/t;return isNaN(n)?0:n}function dm(e){const t=HE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function nB(e,t,n,a="ltr"){const r=dm(n),s=r/2,i=t||s,l=r-i,c=n.scrollbar.paddingStart+i,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,f=a==="ltr"?[0,m]:[m*-1,0];return VE([c,d],f)(e)}function FE(e,t,n="ltr"){const a=dm(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,i=t.content-t.viewport,l=s-a,c=n==="ltr"?[0,i]:[i*-1,0],d=Cc(e,c);return VE([0,i],[0,l])(d)}function VE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function GE(e,t){return e>0&&e<t}var aB=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function r(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,a=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(a)};function fm(e,t){const n=Ft(e),a=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),u.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Li(e,t){const n=Ft(t);jt(()=>{let a=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(a),r.unobserve(e)}}},[e,n])}var YE=OE,rB=zE,oB=UE;const sB=u.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(YE,{ref:a,className:E("tw:relative tw:overflow-hidden",e),...n,children:[o.jsx(rB,{className:"tw:h-full tw:w-full tw:rounded-[inherit]",children:t}),o.jsx(KE,{}),o.jsx(oB,{})]}));sB.displayName=YE.displayName;const KE=u.forwardRef(({className:e,orientation:t="vertical",...n},a)=>o.jsx(Jx,{ref:a,orientation:t,className:E("tw:flex tw:touch-none tw:select-none tw:transition-colors",t==="vertical"&&"tw:h-full tw:w-2.5 tw:border-l tw:border-l-transparent tw:p-[1px]",t==="horizontal"&&"tw:h-2.5 tw:flex-col tw:border-t tw:border-t-transparent tw:p-[1px]",e),...n,children:o.jsx(BE,{className:"tw:relative tw:flex-1 tw:rounded-full tw:bg-border"})}));KE.displayName=Jx.displayName;var iB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lB=iB.reduce((e,t)=>{const n=df(`Primitive.${t}`),a=u.forwardRef((r,s)=>{const{asChild:i,...l}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),cB="Separator",qE="horizontal",uB=["horizontal","vertical"],XE=u.forwardRef((e,t)=>{const{decorative:n,orientation:a=qE,...r}=e,s=dB(a)?a:qE,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(lB.div,{"data-orientation":s,...l,...r,ref:t})});XE.displayName=cB;function dB(e){return uB.includes(e)}var WE=XE;const mm=u.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},r)=>o.jsx(WE,{ref:r,decorative:n,orientation:t,className:E("tw:shrink-0 tw:bg-border",t==="horizontal"?"tw:h-[1px] tw:w-full":"tw:h-full tw:w-[1px]",e),...a}));mm.displayName=WE.displayName;const Wc=fx,fB=mx,mB=wx,ZE=u.forwardRef(({className:e,...t},n)=>o.jsx(Lc,{className:E("tw:fixed tw:inset-0 tw:z-50 tw:bg-black/80 tw: tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0",e),...t,ref:n}));ZE.displayName=Lc.displayName;const wB=hi("tw:fixed tw:z-50 tw:gap-4 tw:bg-background tw:p-6 tw:shadow-lg tw:transition tw:ease-in-out tw:data-[state=closed]:duration-300 tw:data-[state=open]:duration-500 tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards",{variants:{side:{top:"tw:inset-x-0 tw:top-0 tw:border-b tw:data-[state=closed]:slide-out-to-top tw:data-[state=open]:slide-in-from-top",bottom:"tw:inset-x-0 tw:bottom-0 tw:border-t tw:data-[state=closed]:slide-out-to-bottom tw:data-[state=open]:slide-in-from-bottom",left:"tw:inset-y-0 tw:left-0 tw:h-full tw:w-3/4 tw:border-r tw:data-[state=closed]:slide-out-to-left tw:data-[state=open]:slide-in-from-left tw:sm:max-w-sm",right:"tw:inset-y-0 tw:right-0 tw:h-full tw:w-3/4 tw:border-l tw:data-[state=closed]:slide-out-to-right tw:data-[state=open]:slide-in-from-right tw:sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ii=u.forwardRef(({side:e="right",className:t,children:n,overlayClassName:a,closeClassName:r,...s},i)=>o.jsxs(mB,{children:[o.jsx(ZE,{className:a}),o.jsxs(ki,{ref:i,className:E(wB({side:e}),t),...s,children:[o.jsxs(Bc,{className:E("tw:absolute tw:right-4 tw:top-4 tw:rounded-sm tw:opacity-70 tw:ring-offset-background tw:transition-opacity tw:hover:opacity-100 tw:focus:outline-none tw:focus:ring-2 tw:focus:ring-ring tw:focus:ring-offset-2 tw:disabled:pointer-events-none tw:data-[state=open]:bg-secondary",r),children:[o.jsx(Eg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Close"})]}),n]})]}));Ii.displayName=ki.displayName;const QE=({className:e,...t})=>o.jsx("div",{className:E("tw:flex tw:flex-col tw:space-y-2 tw:text-center tw:sm:text-left",e),...t});QE.displayName="SheetHeader";const $i=u.forwardRef(({className:e,...t},n)=>o.jsx(Ic,{ref:n,className:E("tw:text-lg tw:font-semibold tw:text-foreground",e),...t}));$i.displayName=Ic.displayName;const Zc=u.forwardRef(({className:e,...t},n)=>o.jsx($c,{ref:n,className:E("tw:text-sm tw:text-muted-foreground",e),...t}));Zc.displayName=$c.displayName;const nb=768;function pB(){const[e,t]=u.useState(void 0);return u.useEffect(()=>{const n=window.matchMedia(`(max-width: ${nb-1}px)`),a=()=>{t(window.innerWidth<nb)};return n.addEventListener("change",a),t(window.innerWidth<nb),()=>n.removeEventListener("change",a)},[]),!!e}function bt({className:e,...t}){return o.jsx("div",{className:E("psfa-skeleton tw:rounded-md",e),...t})}var hB=Symbol("radix.slottable");function gB(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=hB,t}var[wm]=Ht("Tooltip",[po]),pm=po(),JE="TooltipProvider",xB=700,ab="tooltip.open",[bB,rb]=wm(JE),eT=e=>{const{__scopeTooltip:t,delayDuration:n=xB,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:s}=e,i=u.useRef(!0),l=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(bB,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:l,onPointerInTransitChange:u.useCallback(d=>{l.current=d},[]),disableHoverableContent:r,children:s})};eT.displayName=JE;var Qc="Tooltip",[vB,Jc]=wm(Qc),tT=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=e,c=rb(Qc,e.__scopeTooltip),d=pm(t),[m,f]=u.useState(null),w=Un(),p=u.useRef(0),x=i??c.disableHoverableContent,b=l??c.delayDuration,y=u.useRef(!1),[h,g]=Vn({prop:a,defaultProp:r??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(ab))):c.onClose(),s==null||s(j)},caller:Qc}),v=u.useMemo(()=>h?y.current?"delayed-open":"instant-open":"closed",[h]),S=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,g(!0)},[g]),N=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),A=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,g(!0),p.current=0},b)},[b,g]);return u.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),o.jsx(Rf,{...d,children:o.jsx(vB,{scope:t,contentId:w,open:h,stateAttribute:v,trigger:m,onTriggerChange:f,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?A():S()},[c.isOpenDelayedRef,A,S]),onTriggerLeave:u.useCallback(()=>{x?N():(window.clearTimeout(p.current),p.current=0)},[N,x]),onOpen:S,onClose:N,disableHoverableContent:x,children:n})})};tT.displayName=Qc;var ob="TooltipTrigger",nT=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Jc(ob,n),s=rb(ob,n),i=pm(n),l=u.useRef(null),c=Se(t,l,r.onTriggerChange),d=u.useRef(!1),m=u.useRef(!1),f=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(Rc,{asChild:!0,...i,children:o.jsx(me.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:ee(e.onPointerMove,w=>{w.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),m.current=!0)}),onPointerLeave:ee(e.onPointerLeave,()=>{r.onTriggerLeave(),m.current=!1}),onPointerDown:ee(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ee(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:ee(e.onBlur,r.onClose),onClick:ee(e.onClick,r.onClose)})})});nT.displayName=ob;var sb="TooltipPortal",[yB,SB]=wm(sb,{forceMount:void 0}),aT=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,s=Jc(sb,t);return o.jsx(yB,{scope:t,forceMount:n,children:o.jsx(Rt,{present:n||s.open,children:o.jsx(Ci,{asChild:!0,container:r,children:a})})})};aT.displayName=sb;var Bi="TooltipContent",rT=u.forwardRef((e,t)=>{const n=SB(Bi,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...s}=e,i=Jc(Bi,e.__scopeTooltip);return o.jsx(Rt,{present:a||i.open,children:i.disableHoverableContent?o.jsx(oT,{side:r,...s,ref:t}):o.jsx(jB,{side:r,...s,ref:t})})}),jB=u.forwardRef((e,t)=>{const n=Jc(Bi,e.__scopeTooltip),a=rb(Bi,e.__scopeTooltip),r=u.useRef(null),s=Se(t,r),[i,l]=u.useState(null),{trigger:c,onClose:d}=n,m=r.current,{onPointerInTransitChange:f}=a,w=u.useCallback(()=>{l(null),f(!1)},[f]),p=u.useCallback((x,b)=>{const y=x.currentTarget,h={x:x.clientX,y:x.clientY},g=EB(h,y.getBoundingClientRect()),v=TB(h,g),S=RB(b.getBoundingClientRect()),N=MB([...v,...S]);l(N),f(!0)},[f]);return u.useEffect(()=>()=>w(),[w]),u.useEffect(()=>{if(c&&m){const x=y=>p(y,m),b=y=>p(y,c);return c.addEventListener("pointerleave",x),m.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",b)}}},[c,m,p,w]),u.useEffect(()=>{if(i){const x=b=>{const y=b.target,h={x:b.clientX,y:b.clientY},g=(c==null?void 0:c.contains(y))||(m==null?void 0:m.contains(y)),v=!kB(h,i);g?w():v&&(w(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,m,i,d,w]),o.jsx(oT,{...e,ref:s})}),[NB,CB]=wm(Qc,{isInside:!1}),AB=gB("TooltipContent"),oT=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=Jc(Bi,n),d=pm(n),{onClose:m}=c;return u.useEffect(()=>(document.addEventListener(ab,m),()=>document.removeEventListener(ab,m)),[m]),u.useEffect(()=>{if(c.trigger){const f=w=>{const p=w.target;p!=null&&p.contains(c.trigger)&&m()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,m]),o.jsx(vi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:m,children:o.jsxs(kf,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(AB,{children:a}),o.jsx(NB,{scope:n,isInside:!0,children:o.jsx(tL,{id:c.contentId,role:"tooltip",children:r||a})})]})})});rT.displayName=Bi;var sT="TooltipArrow",_B=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=pm(n);return CB(sT,n).isInside?null:o.jsx(Mf,{...r,...a,ref:t})});_B.displayName=sT;function EB(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,r,s)){case s:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function TB(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function RB(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function kB(e,t){const{x:n,y:a}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],d=l.x,m=l.y,f=c.x,w=c.y;m>a!=w>a&&n<(f-d)*(a-m)/(w-m)+d&&(r=!r)}return r}function MB(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),DB(t)}function DB(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var OB=eT,PB=tT,zB=nT,LB=aT,iT=rT;const Ui=OB,eu=PB,tu=zB,Hi=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>o.jsx(LB,{children:o.jsx(iT,{ref:a,sideOffset:t,className:E("tw:z-50 tw:overflow-hidden tw:rounded-md tw:bg-primary tw:px-3 tw:py-1.5 tw:text-xs tw:text-primary-foreground tw:animate-in tw:fade-in-0 tw:zoom-in-95 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:zoom-out-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-tooltip-content-transform-origin]",e),...n})}));Hi.displayName=iT.displayName;const IB="sidebar_state",$B=60*60*24*7,BB="16rem",UB="18rem",HB="3rem",FB="b",lT=u.createContext(null);function hm(){const e=u.useContext(lT);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const VB=u.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:a,style:r,children:s,...i},l)=>{const c=pB(),[d,m]=u.useState(!1),[f,w]=u.useState(e),p=t??f,x=u.useCallback(g=>{const v=typeof g=="function"?g(p):g;n?n(v):w(v),document.cookie=`${IB}=${v}; path=/; max-age=${$B}`},[n,p]),b=u.useCallback(()=>c?m(g=>!g):x(g=>!g),[c,x,m]);u.useEffect(()=>{const g=v=>{v.key===FB&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),b())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[b]);const y=p?"expanded":"collapsed",h=u.useMemo(()=>({state:y,open:p,setOpen:x,isMobile:c,openMobile:d,setOpenMobile:m,toggleSidebar:b}),[y,p,x,c,d,m,b]);return o.jsx(lT.Provider,{value:h,children:o.jsx(Ui,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":BB,"--sidebar-width-icon":HB,...r},className:E("tw:group/sidebar-wrapper tw:flex tw:min-h-svh tw:h-full tw:w-full tw:has-[[data-variant=inset]]:bg-sidebar",a),ref:l,...i,children:s})})})});VB.displayName="SidebarProvider";const GB=u.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:a,children:r,...s},i)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:m}=hm();return n==="none"?o.jsx("div",{className:E("tw:flex tw:h-full tw:min-h-full tw:w-[var(--sidebar-width)] tw:flex-col tw:bg-sidebar tw:text-sidebar-foreground",a),ref:i,...s,children:r}):l?o.jsx(Wc,{open:d,onOpenChange:m,...s,children:o.jsxs(Ii,{"data-sidebar":"sidebar","data-mobile":"true",className:"tw:w-[var(--sidebar-width)] tw:bg-sidebar tw:p-0 tw:text-sidebar-foreground tw:[&>button]:hidden",style:{"--sidebar-width":UB},side:e,children:[o.jsxs(QE,{className:"tw:sr-only",children:[o.jsx($i,{children:"Sidebar"}),o.jsx(Zc,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"tw:flex tw:h-full tw:w-full tw:flex-col",children:r})]})}):o.jsxs("div",{ref:i,className:"tw:group tw:peer tw:hidden tw:text-sidebar-foreground tw:md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:E("tw:relative tw:w-[var(--sidebar-width)] tw:bg-transparent tw:transition-[width] tw:duration-200 tw:ease-linear","tw:group-data-[collapsible=offcanvas]:w-0","tw:group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"tw:group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),o.jsx("div",{className:E("tw:fixed tw:inset-y-0 tw:z-10 tw:hidden tw:h-svh tw:w-[var(--sidebar-width)] tw:transition-[width] tw:duration-200 tw:ease-linear tw:md:flex",e==="left"?"tw:left-0 tw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"tw:right-0 tw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"tw:p-2 tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"tw:group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] tw:group-data-[side=left]:border-r tw:group-data-[side=right]:border-l",a),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"tw:flex tw:h-full tw:w-full tw:flex-col tw:bg-sidebar tw:group-data-[variant=floating]:rounded-lg tw:group-data-[variant=floating]:border tw:group-data-[variant=floating]:border-sidebar-border tw:group-data-[variant=floating]:shadow",children:r})})]})});GB.displayName="Sidebar";const YB=u.forwardRef(({className:e,onClick:t,...n},a)=>{const{toggleSidebar:r}=hm();return o.jsxs(Ne,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:E("tw:h-7 tw:w-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(bN,{}),o.jsx("span",{className:"tw:sr-only",children:"Toggle Sidebar"})]})});YB.displayName="SidebarTrigger";const KB=u.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:a}=hm();return o.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:E("tw:absolute tw:inset-y-0 tw:z-20 tw:hidden tw:w-4 tw:-translate-x-1/2 tw:transition-all tw:ease-linear tw:after:absolute tw:after:inset-y-0 tw:after:left-1/2 tw:after:w-[2px] tw:hover:after:bg-sidebar-border tw:group-data-[side=left]:-right-4 tw:group-data-[side=right]:left-0 tw:sm:flex","tw:[[data-side=left]_&]:cursor-w-resize tw:[[data-side=right]_&]:cursor-e-resize","tw:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize tw:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize","tw:group-data-[collapsible=offcanvas]:translate-x-0 tw:group-data-[collapsible=offcanvas]:after:left-full tw:group-data-[collapsible=offcanvas]:hover:bg-sidebar","tw:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","tw:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});KB.displayName="SidebarRail";const qB=u.forwardRef(({className:e,...t},n)=>o.jsx("main",{ref:n,className:E("tw:relative tw:flex tw:w-full tw:flex-1 tw:flex-col tw:bg-background","tw:md:peer-data-[variant=inset]:m-2 tw:md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 tw:md:peer-data-[variant=inset]:ml-0 tw:md:peer-data-[variant=inset]:rounded-xl tw:md:peer-data-[variant=inset]:shadow",e),...t}));qB.displayName="SidebarInset";const XB=u.forwardRef(({className:e,...t},n)=>o.jsx(pt,{ref:n,"data-sidebar":"input",className:E("tw:h-8 tw:w-full tw:bg-background tw:shadow-none tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",e),...t}));XB.displayName="SidebarInput";const WB=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"header",className:E("tw:flex tw:flex-col tw:gap-2 tw:p-2",e),...t}));WB.displayName="SidebarHeader";const ZB=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"footer",className:E("tw:flex tw:flex-col tw:gap-2 tw:p-2",e),...t}));ZB.displayName="SidebarFooter";const QB=u.forwardRef(({className:e,...t},n)=>o.jsx(mm,{ref:n,"data-sidebar":"separator",className:E("tw:mx-2 tw:w-auto tw:bg-sidebar-border",e),...t}));QB.displayName="SidebarSeparator";const JB=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"content",className:E("tw:flex tw:min-h-0 tw:flex-1 tw:flex-col tw:gap-2 tw:overflow-auto tw:group-data-[collapsible=icon]:overflow-hidden",e),...t}));JB.displayName="SidebarContent";const eU=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"group",className:E("tw:relative tw:flex tw:w-full tw:min-w-0 tw:flex-col tw:p-2",e),...t}));eU.displayName="SidebarGroup";const tU=u.forwardRef(({className:e,asChild:t=!1,...n},a)=>{const r=t?Qo:"div";return o.jsx(r,{ref:a,"data-sidebar":"group-label",className:E("tw:flex tw:h-8 tw:shrink-0 tw:items-center tw:rounded-md tw:px-2 tw:text-xs tw:font-medium tw:text-sidebar-foreground/70 tw:outline-none tw:ring-sidebar-ring tw:transition-[margin,opacity] tw:duration-200 tw:ease-linear tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:group-data-[collapsible=icon]:-mt-8 tw:group-data-[collapsible=icon]:opacity-0",e),...n})});tU.displayName="SidebarGroupLabel";const nU=u.forwardRef(({className:e,asChild:t=!1,...n},a)=>{const r=t?Qo:"button";return o.jsx(r,{ref:a,"data-sidebar":"group-action",className:E("tw:absolute tw:right-3 tw:top-3.5 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:transition-transform tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:after:absolute tw:after:-inset-2 tw:after:md:hidden","tw:group-data-[collapsible=icon]:hidden",e),...n})});nU.displayName="SidebarGroupAction";const aU=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"group-content",className:E("tw:w-full tw:text-sm",e),...t}));aU.displayName="SidebarGroupContent";const rU=u.forwardRef(({className:e,...t},n)=>o.jsx("ul",{ref:n,"data-sidebar":"menu",className:E("tw:flex tw:w-full tw:min-w-0 tw:flex-col tw:gap-1",e),...t}));rU.displayName="SidebarMenu";const oU=u.forwardRef(({className:e,...t},n)=>o.jsx("li",{ref:n,"data-sidebar":"menu-item",className:E("tw:group/menu-item tw:relative",e),...t}));oU.displayName="SidebarMenuItem";const sU=hi("tw:peer/menu-button tw:flex tw:w-full tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:p-2 tw:text-left tw:text-sm tw:outline-none tw:ring-sidebar-ring tw:transition-[width,height,padding] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:font-medium tw:data-[active=true]:text-sidebar-accent-foreground tw:data-[state=open]:hover:bg-sidebar-accent tw:data-[state=open]:hover:text-sidebar-accent-foreground tw:group-data-[collapsible=icon]:!size-8 tw:group-data-[collapsible=icon]:!p-2 tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",{variants:{variant:{default:"tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground",outline:"tw:bg-background tw:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"tw:h-8 tw:text-sm",sm:"tw:h-7 tw:text-xs",lg:"tw:h-12 tw:text-sm tw:group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),iU=u.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:a="default",tooltip:r,className:s,...i},l)=>{const c=e?Qo:"button",{isMobile:d,state:m}=hm(),f=o.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":a,"data-active":t,className:E(sU({variant:n,size:a}),s),...i});return r?(typeof r=="string"&&(r={children:r}),o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:f}),o.jsx(Hi,{side:"right",align:"center",hidden:m!=="collapsed"||d,...r})]})):f});iU.displayName="SidebarMenuButton";const lU=u.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...a},r)=>{const s=t?Qo:"button";return o.jsx(s,{ref:r,"data-sidebar":"menu-action",className:E("tw:absolute tw:right-1 tw:top-1.5 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:transition-transform tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:[&>svg]:size-4 tw:[&>svg]:shrink-0","tw:after:absolute tw:after:-inset-2 tw:after:md:hidden","tw:peer-data-[size=sm]/menu-button:top-1","tw:peer-data-[size=default]/menu-button:top-1.5","tw:peer-data-[size=lg]/menu-button:top-2.5","tw:group-data-[collapsible=icon]:hidden",n&&"tw:group-focus-within/menu-item:opacity-100 tw:group-hover/menu-item:opacity-100 tw:data-[state=open]:opacity-100 tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground tw:md:opacity-0",e),...a})});lU.displayName="SidebarMenuAction";const cU=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:E("tw:pointer-events-none tw:absolute tw:right-1 tw:flex tw:h-5 tw:min-w-5 tw:select-none tw:items-center tw:justify-center tw:rounded-md tw:px-1 tw:text-xs tw:font-medium tw:tabular-nums tw:text-sidebar-foreground","tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","tw:peer-data-[size=sm]/menu-button:top-1","tw:peer-data-[size=default]/menu-button:top-1.5","tw:peer-data-[size=lg]/menu-button:top-2.5","tw:group-data-[collapsible=icon]:hidden",e),...t}));cU.displayName="SidebarMenuBadge";const uU=u.forwardRef(({className:e,showIcon:t=!1,...n},a)=>{const r=u.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:E("tw:flex tw:h-8 tw:items-center tw:gap-2 tw:rounded-md tw:px-2",e),...n,children:[t&&o.jsx(bt,{className:"tw:size-4 tw:rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(bt,{className:"tw:h-4 tw:max-w-[--skeleton-width] tw:flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});uU.displayName="SidebarMenuSkeleton";const dU=u.forwardRef(({className:e,...t},n)=>o.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:E("tw:mx-3.5 tw:flex tw:min-w-0 tw:translate-x-px tw:flex-col tw:gap-1 tw:border-l tw:border-sidebar-border tw:px-2.5 tw:py-0.5","tw:group-data-[collapsible=icon]:hidden",e),...t}));dU.displayName="SidebarMenuSub";const fU=u.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));fU.displayName="SidebarMenuSubItem";const mU=u.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:a,...r},s)=>{const i=e?Qo:"a";return o.jsx(i,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:E("tw:flex tw:h-7 tw:min-w-0 tw:-translate-x-px tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:px-2 tw:text-sidebar-foreground tw:outline-none tw:ring-sidebar-ring tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0 tw:[&>svg]:text-sidebar-accent-foreground","tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"tw:text-xs",t==="md"&&"tw:text-sm","tw:group-data-[collapsible=icon]:hidden",a),...r})});mU.displayName="SidebarMenuSubButton";var cT=["PageUp","PageDown"],uT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Fi="Slider",[ib,wU,pU]=xf(Fi),[fT]=Ht(Fi,[pU]),[hU,gm]=fT(Fi),mT=u.forwardRef((e,t)=>{const{name:n,min:a=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[a],value:m,onValueChange:f=()=>{},onValueCommit:w=()=>{},inverted:p=!1,form:x,...b}=e,y=u.useRef(new Set),h=u.useRef(0),v=i==="horizontal"?gU:xU,[S=[],N]=Vn({prop:m,defaultProp:d,onChange:z=>{var I;(I=[...y.current][h.current])==null||I.focus(),f(z)}}),A=u.useRef(S);function j(z){const B=jU(S,z);M(z,B)}function C(z){M(z,h.current)}function R(){const z=A.current[h.current];S[h.current]!==z&&w(S)}function M(z,B,{commit:I}={commit:!1}){const V=_U(s),D=EU(Math.round((z-a)/s)*s+a,V),T=Cc(D,[a,r]);N((O=[])=>{const _=yU(O,T,B);if(AU(_,c*s)){h.current=_.indexOf(T);const $=String(_)!==String(O);return $&&I&&w(_),$?_:O}else return O})}return o.jsx(hU,{scope:e.__scopeSlider,name:n,disabled:l,min:a,max:r,valueIndexToChangeRef:h,thumbs:y.current,values:S,orientation:i,form:x,children:o.jsx(ib.Provider,{scope:e.__scopeSlider,children:o.jsx(ib.Slot,{scope:e.__scopeSlider,children:o.jsx(v,{"aria-disabled":l,"data-disabled":l?"":void 0,...b,ref:t,onPointerDown:ee(b.onPointerDown,()=>{l||(A.current=S)}),min:a,max:r,inverted:p,onSlideStart:l?void 0:j,onSlideMove:l?void 0:C,onSlideEnd:l?void 0:R,onHomeKeyDown:()=>!l&&M(a,0,{commit:!0}),onEndKeyDown:()=>!l&&M(r,S.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:B})=>{if(!l){const D=cT.includes(z.key)||z.shiftKey&&uT.includes(z.key)?10:1,T=h.current,O=S[T],_=s*D*B;M(O+_,T,{commit:!0})}}})})})})});mT.displayName=Fi;var[wT,pT]=fT(Fi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),gU=u.forwardRef((e,t)=>{const{min:n,max:a,dir:r,inverted:s,onSlideStart:i,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...m}=e,[f,w]=u.useState(null),p=Se(t,v=>w(v)),x=u.useRef(void 0),b=es(r),y=b==="ltr",h=y&&!s||!y&&s;function g(v){const S=x.current||f.getBoundingClientRect(),N=[0,S.width],j=ub(N,h?[n,a]:[a,n]);return x.current=S,j(v-S.left)}return o.jsx(wT,{scope:e.__scopeSlider,startEdge:h?"left":"right",endEdge:h?"right":"left",direction:h?1:-1,size:"width",children:o.jsx(hT,{dir:b,"data-orientation":"horizontal",...m,ref:p,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const S=g(v.clientX);i==null||i(S)},onSlideMove:v=>{const S=g(v.clientX);l==null||l(S)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:v=>{const N=dT[h?"from-left":"from-right"].includes(v.key);d==null||d({event:v,direction:N?-1:1})}})})}),xU=u.forwardRef((e,t)=>{const{min:n,max:a,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:l,onStepKeyDown:c,...d}=e,m=u.useRef(null),f=Se(t,m),w=u.useRef(void 0),p=!r;function x(b){const y=w.current||m.current.getBoundingClientRect(),h=[0,y.height],v=ub(h,p?[a,n]:[n,a]);return w.current=y,v(b-y.top)}return o.jsx(wT,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:o.jsx(hT,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=x(b.clientY);s==null||s(y)},onSlideMove:b=>{const y=x(b.clientY);i==null||i(y)},onSlideEnd:()=>{w.current=void 0,l==null||l()},onStepKeyDown:b=>{const h=dT[p?"from-bottom":"from-top"].includes(b.key);c==null||c({event:b,direction:h?-1:1})}})})}),hT=u.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:c,...d}=e,m=gm(Fi,n);return o.jsx(me.span,{...d,ref:t,onKeyDown:ee(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):cT.concat(uT).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:ee(e.onPointerDown,f=>{const w=f.target;w.setPointerCapture(f.pointerId),f.preventDefault(),m.thumbs.has(w)?w.focus():a(f)}),onPointerMove:ee(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&r(f)}),onPointerUp:ee(e.onPointerUp,f=>{const w=f.target;w.hasPointerCapture(f.pointerId)&&(w.releasePointerCapture(f.pointerId),s(f))})})}),gT="SliderTrack",xT=u.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,r=gm(gT,n);return o.jsx(me.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...a,ref:t})});xT.displayName=gT;var lb="SliderRange",bT=u.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,r=gm(lb,n),s=pT(lb,n),i=u.useRef(null),l=Se(t,i),c=r.values.length,d=r.values.map(w=>ST(w,r.min,r.max)),m=c>1?Math.min(...d):0,f=100-Math.max(...d);return o.jsx(me.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...a,ref:l,style:{...e.style,[s.startEdge]:m+"%",[s.endEdge]:f+"%"}})});bT.displayName=lb;var cb="SliderThumb",vT=u.forwardRef((e,t)=>{const n=wU(e.__scopeSlider),[a,r]=u.useState(null),s=Se(t,l=>r(l)),i=u.useMemo(()=>a?n().findIndex(l=>l.ref.current===a):-1,[n,a]);return o.jsx(bU,{...e,ref:s,index:i})}),bU=u.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:r,...s}=e,i=gm(cb,n),l=pT(cb,n),[c,d]=u.useState(null),m=Se(t,g=>d(g)),f=c?i.form||!!c.closest("form"):!0,w=Tc(c),p=i.values[a],x=p===void 0?0:ST(p,i.min,i.max),b=SU(a,i.values.length),y=w==null?void 0:w[l.size],h=y?NU(y,x,l.direction):0;return u.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${h}px)`},children:[o.jsx(ib.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(me.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:p===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{i.valueIndexToChangeRef.current=a})})}),f&&o.jsx(yT,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:p},a)]})});vT.displayName=cb;var vU="RadioBubbleInput",yT=u.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const r=u.useRef(null),s=Se(r,a),i=kc(t);return u.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&m){const f=new Event("input",{bubbles:!0});m.call(l,t),l.dispatchEvent(f)}},[i,t]),o.jsx(me.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});yT.displayName=vU;function yU(e=[],t,n){const a=[...e];return a[n]=t,a.sort((r,s)=>r-s)}function ST(e,t,n){const s=100/(n-t)*(e-t);return Cc(s,[0,100])}function SU(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function jU(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),a=Math.min(...n);return n.indexOf(a)}function NU(e,t,n){const a=e/2,s=ub([0,50],[0,a]);return(a-s(t)*n)*n}function CU(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function AU(e,t){if(t>0){const n=CU(e);return Math.min(...n)>=t}return!0}function ub(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function _U(e){return(String(e).split(".")[1]||"").length}function EU(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var jT=mT,TU=xT,RU=bT,kU=vT;const Vi=u.forwardRef(({className:e,thumbLabels:t,formatValueText:n,...a},r)=>{const s=a.value??a.defaultValue??[0];return o.jsxs(jT,{ref:r,className:E("tw:relative tw:flex tw:w-full tw:touch-none tw:select-none tw:items-center tw:group",e),...a,children:[o.jsx(TU,{className:"tw:relative tw:h-1.5 tw:w-full tw:grow tw:overflow-hidden tw:rounded-full tw:bg-primary/20 tw:dark:bg-primary/30 tw:data-[disabled]:bg-gray-200 tw:dark:data-[disabled]:bg-gray-700",children:o.jsx(RU,{className:"tw:absolute tw:h-full tw:bg-primary tw:data-[disabled]:bg-gray-300 tw:dark:data-[disabled]:bg-gray-600"})}),s.map((i,l)=>o.jsx(kU,{"aria-label":t==null?void 0:t[l],"aria-valuetext":n?n(i):void 0,className:"tw:block tw:h-4 tw:w-4 tw:rounded-full tw:border tw:border-primary/50 tw:bg-background tw:shadow tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[disabled]:border-gray-300 tw:dark:data-[disabled]:border-gray-600"},l))]})});Vi.displayName=jT.displayName;function MU(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const DU=e=>{switch(e){case"success":return zU;case"info":return IU;case"warning":return LU;case"error":return $U;default:return null}},OU=Array(12).fill(0),PU=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},OU.map((n,a)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),zU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),LU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),IU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$U=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),BU=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UU=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let db=1;class HU{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:a,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:db++,i=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:a}),{...c,...t,id:s,dismissible:l,title:a}):c):this.addToast({title:a,...r,dismissible:l,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let s=a!==void 0,i;const l=r.then(async d=>{if(i=["resolve",d],J.isValidElement(d))s=!1,this.create({id:a,type:"default",message:d});else if(VU(d)&&!d.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,w=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"error",description:w,...x})}else if(d instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,w=typeof n.description=="function"?await n.description(d):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"error",description:w,...x})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(d):n.success,w=typeof n.description=="function"?await n.description(d):n.description,x=typeof f=="object"&&!J.isValidElement(f)?f:{message:f};this.create({id:a,type:"success",description:w,...x})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const m=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,p=typeof m=="object"&&!J.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:f,...p})}}).finally(()=>{s&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,m)=>l.then(()=>i[0]==="reject"?m(i[1]):d(i[1])).catch(m));return typeof a!="string"&&typeof a!="number"?{unwrap:c}:Object.assign(a,{unwrap:c})},this.custom=(t,n)=>{const a=(n==null?void 0:n.id)||db++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Nn=new HU,FU=(e,t)=>{const n=(t==null?void 0:t.id)||db++;return Nn.addToast({title:e,...t,id:n}),n},VU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",GU=FU,YU=()=>Nn.toasts,KU=()=>Nn.getActiveToasts(),_e=Object.assign(GU,{success:Nn.success,info:Nn.info,warning:Nn.warning,error:Nn.error,custom:Nn.custom,message:Nn.message,promise:Nn.promise,dismiss:Nn.dismiss,loading:Nn.loading},{getHistory:YU,getToasts:KU});MU("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function xm(e){return e.label!==void 0}const qU=3,XU="24px",WU="16px",NT=4e3,ZU=356,QU=14,JU=45,eH=200;function Ya(...e){return e.filter(Boolean).join(" ")}function tH(e){const[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}const nH=e=>{var t,n,a,r,s,i,l,c,d;const{invert:m,toast:f,unstyled:w,interacting:p,setHeights:x,visibleToasts:b,heights:y,index:h,toasts:g,expanded:v,removeToast:S,defaultRichColors:N,closeButton:A,style:j,cancelButtonStyle:C,actionButtonStyle:R,className:M="",descriptionClassName:z="",duration:B,position:I,gap:V,expandByDefault:D,classNames:T,icons:O,closeButtonAriaLabel:_="Close toast"}=e,[$,H]=J.useState(null),[F,Q]=J.useState(null),[X,P]=J.useState(!1),[G,ne]=J.useState(!1),[Y,Z]=J.useState(!1),[le,he]=J.useState(!1),[ae,K]=J.useState(!1),[ge,Ce]=J.useState(0),[We,Ke]=J.useState(0),at=J.useRef(f.duration||B||NT),Kt=J.useRef(null),He=J.useRef(null),qt=h===0,Cn=h+1<=b,mt=f.type,Xt=f.dismissible!==!1,an=f.className||"",wn=f.descriptionClassName||"",An=J.useMemo(()=>y.findIndex(re=>re.toastId===f.id)||0,[y,f.id]),qn=J.useMemo(()=>{var re;return(re=f.closeButton)!=null?re:A},[f.closeButton,A]),oe=J.useMemo(()=>f.duration||B||NT,[f.duration,B]),ye=J.useRef(0),we=J.useRef(0),Ve=J.useRef(0),ze=J.useRef(null),[Wt,Ge]=I.split("-"),Ea=J.useMemo(()=>y.reduce((re,Je,dt)=>dt>=An?re:re+Je.height,0),[y,An]),pa=UU(),Xn=f.invert||m,Ta=mt==="loading";we.current=J.useMemo(()=>An*V+Ea,[An,Ea]),J.useEffect(()=>{at.current=oe},[oe]),J.useEffect(()=>{P(!0)},[]),J.useEffect(()=>{const re=He.current;if(re){const Je=re.getBoundingClientRect().height;return Ke(Je),x(dt=>[{toastId:f.id,height:Je,position:f.position},...dt]),()=>x(dt=>dt.filter(kt=>kt.toastId!==f.id))}},[x,f.id]),J.useLayoutEffect(()=>{if(!X)return;const re=He.current,Je=re.style.height;re.style.height="auto";const dt=re.getBoundingClientRect().height;re.style.height=Je,Ke(dt),x(kt=>kt.find(Mt=>Mt.toastId===f.id)?kt.map(Mt=>Mt.toastId===f.id?{...Mt,height:dt}:Mt):[{toastId:f.id,height:dt,position:f.position},...kt])},[X,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const rn=J.useCallback(()=>{ne(!0),Ce(we.current),x(re=>re.filter(Je=>Je.toastId!==f.id)),setTimeout(()=>{S(f)},eH)},[f,S,x,we]);J.useEffect(()=>{if(f.promise&&mt==="loading"||f.duration===1/0||f.type==="loading")return;let re;return v||p||pa?(()=>{if(Ve.current<ye.current){const kt=new Date().getTime()-ye.current;at.current=at.current-kt}Ve.current=new Date().getTime()})():(()=>{at.current!==1/0&&(ye.current=new Date().getTime(),re=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),rn()},at.current))})(),()=>clearTimeout(re)},[v,p,f,mt,pa,rn]),J.useEffect(()=>{f.delete&&(rn(),f.onDismiss==null||f.onDismiss.call(f,f))},[rn,f.delete]);function Za(){var re;if(O!=null&&O.loading){var Je;return J.createElement("div",{className:Ya(T==null?void 0:T.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":mt==="loading"},O.loading)}return J.createElement(PU,{className:Ya(T==null?void 0:T.loader,f==null||(re=f.classNames)==null?void 0:re.loader),visible:mt==="loading"})}const ie=f.icon||(O==null?void 0:O[mt])||DU(mt);var Ee,$e;return J.createElement("li",{tabIndex:0,ref:He,className:Ya(M,an,T==null?void 0:T.toast,f==null||(t=f.classNames)==null?void 0:t.toast,T==null?void 0:T.default,T==null?void 0:T[mt],f==null||(n=f.classNames)==null?void 0:n[mt]),"data-sonner-toast":"","data-rich-colors":(Ee=f.richColors)!=null?Ee:N,"data-styled":!(f.jsx||f.unstyled||w),"data-mounted":X,"data-promise":!!f.promise,"data-swiped":ae,"data-removed":G,"data-visible":Cn,"data-y-position":Wt,"data-x-position":Ge,"data-index":h,"data-front":qt,"data-swiping":Y,"data-dismissible":Xt,"data-type":mt,"data-invert":Xn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(v||D&&X),"data-testid":f.testId,style:{"--index":h,"--toasts-before":h,"--z-index":g.length-h,"--offset":`${G?ge:we.current}px`,"--initial-height":D?"auto":`${We}px`,...j,...f.style},onDragEnd:()=>{Z(!1),H(null),ze.current=null},onPointerDown:re=>{re.button!==2&&(Ta||!Xt||(Kt.current=new Date,Ce(we.current),re.target.setPointerCapture(re.pointerId),re.target.tagName!=="BUTTON"&&(Z(!0),ze.current={x:re.clientX,y:re.clientY})))},onPointerUp:()=>{var re,Je,dt;if(le||!Xt)return;ze.current=null;const kt=Number(((re=He.current)==null?void 0:re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Mr=Number(((Je=He.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Mt=new Date().getTime()-((dt=Kt.current)==null?void 0:dt.getTime()),_n=$==="x"?kt:Mr,ol=Math.abs(_n)/Mt;if(Math.abs(_n)>=JU||ol>.11){Ce(we.current),f.onDismiss==null||f.onDismiss.call(f,f),Q($==="x"?kt>0?"right":"left":Mr>0?"down":"up"),rn(),he(!0);return}else{var k,L;(k=He.current)==null||k.style.setProperty("--swipe-amount-x","0px"),(L=He.current)==null||L.style.setProperty("--swipe-amount-y","0px")}K(!1),Z(!1),H(null)},onPointerMove:re=>{var Je,dt,kt;if(!ze.current||!Xt||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const Mt=re.clientY-ze.current.y,_n=re.clientX-ze.current.x;var ol;const k=(ol=e.swipeDirections)!=null?ol:tH(I);!$&&(Math.abs(_n)>1||Math.abs(Mt)>1)&&H(Math.abs(_n)>Math.abs(Mt)?"x":"y");let L={x:0,y:0};const U=W=>1/(1.5+Math.abs(W)/20);if($==="y"){if(k.includes("top")||k.includes("bottom"))if(k.includes("top")&&Mt<0||k.includes("bottom")&&Mt>0)L.y=Mt;else{const W=Mt*U(Mt);L.y=Math.abs(W)<Math.abs(Mt)?W:Mt}}else if($==="x"&&(k.includes("left")||k.includes("right")))if(k.includes("left")&&_n<0||k.includes("right")&&_n>0)L.x=_n;else{const W=_n*U(_n);L.x=Math.abs(W)<Math.abs(_n)?W:_n}(Math.abs(L.x)>0||Math.abs(L.y)>0)&&K(!0),(dt=He.current)==null||dt.style.setProperty("--swipe-amount-x",`${L.x}px`),(kt=He.current)==null||kt.style.setProperty("--swipe-amount-y",`${L.y}px`)}},qn&&!f.jsx&&mt!=="loading"?J.createElement("button",{"aria-label":_,"data-disabled":Ta,"data-close-button":!0,onClick:Ta||!Xt?()=>{}:()=>{rn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ya(T==null?void 0:T.closeButton,f==null||(a=f.classNames)==null?void 0:a.closeButton)},($e=O==null?void 0:O.close)!=null?$e:BU):null,(mt||f.icon||f.promise)&&f.icon!==null&&((O==null?void 0:O[mt])!==null||f.icon)?J.createElement("div",{"data-icon":"",className:Ya(T==null?void 0:T.icon,f==null||(r=f.classNames)==null?void 0:r.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Za():null,f.type!=="loading"?ie:null):null,J.createElement("div",{"data-content":"",className:Ya(T==null?void 0:T.content,f==null||(s=f.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:Ya(T==null?void 0:T.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?J.createElement("div",{"data-description":"",className:Ya(z,wn,T==null?void 0:T.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),J.isValidElement(f.cancel)?f.cancel:f.cancel&&xm(f.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||C,onClick:re=>{xm(f.cancel)&&Xt&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,re),rn())},className:Ya(T==null?void 0:T.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,J.isValidElement(f.action)?f.action:f.action&&xm(f.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:re=>{xm(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,re),!re.defaultPrevented&&rn())},className:Ya(T==null?void 0:T.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function CT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function aH(e,t){const n={};return[e,t].forEach((a,r)=>{const s=r===1,i=s?"--mobile-offset":"--offset",l=s?WU:XU;function c(d){["top","right","bottom","left"].forEach(m=>{n[`${i}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof a=="number"||typeof a=="string"?c(a):typeof a=="object"?["top","right","bottom","left"].forEach(d=>{a[d]===void 0?n[`${i}-${d}`]=l:n[`${i}-${d}`]=typeof a[d]=="number"?`${a[d]}px`:a[d]}):c(l)}),n}const rH=J.forwardRef(function(t,n){const{id:a,invert:r,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:m,mobileOffset:f,theme:w="light",richColors:p,duration:x,style:b,visibleToasts:y=qU,toastOptions:h,dir:g=CT(),gap:v=QU,icons:S,containerAriaLabel:N="Notifications"}=t,[A,j]=J.useState([]),C=J.useMemo(()=>a?A.filter(X=>X.toasterId===a):A.filter(X=>!X.toasterId),[A,a]),R=J.useMemo(()=>Array.from(new Set([s].concat(C.filter(X=>X.position).map(X=>X.position)))),[C,s]),[M,z]=J.useState([]),[B,I]=J.useState(!1),[V,D]=J.useState(!1),[T,O]=J.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=J.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=J.useRef(null),F=J.useRef(!1),Q=J.useCallback(X=>{j(P=>{var G;return(G=P.find(ne=>ne.id===X.id))!=null&&G.delete||Nn.dismiss(X.id),P.filter(({id:ne})=>ne!==X.id)})},[]);return J.useEffect(()=>Nn.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{j(P=>P.map(G=>G.id===X.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Yv.flushSync(()=>{j(P=>{const G=P.findIndex(ne=>ne.id===X.id);return G!==-1?[...P.slice(0,G),{...P[G],...X},...P.slice(G+1)]:[X,...P]})})})}),[A]),J.useEffect(()=>{if(w!=="system"){O(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:P})=>{O(P?"dark":"light")})}catch{X.addListener(({matches:G})=>{try{O(G?"dark":"light")}catch(ne){console.error(ne)}})}},[w]),J.useEffect(()=>{A.length<=1&&I(!1)},[A]),J.useEffect(()=>{const X=P=>{var G;if(i.every(Z=>P[Z]||P.code===Z)){var Y;I(!0),(Y=_.current)==null||Y.focus()}P.code==="Escape"&&(document.activeElement===_.current||(G=_.current)!=null&&G.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[i]),J.useEffect(()=>{if(_.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,F.current=!1)}},[_.current]),J.createElement("section",{ref:n,"aria-label":`${N} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((X,P)=>{var G;const[ne,Y]=X.split("-");return C.length?J.createElement("ol",{key:X,dir:g==="auto"?CT():g,tabIndex:-1,ref:_,className:d,"data-sonner-toaster":!0,"data-sonner-theme":T,"data-y-position":ne,"data-x-position":Y,style:{"--front-toast-height":`${((G=M[0])==null?void 0:G.height)||0}px`,"--width":`${ZU}px`,"--gap":`${v}px`,...b,...aH(m,f)},onBlur:Z=>{F.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(F.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||F.current||(F.current=!0,H.current=Z.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{V||I(!1)},onDragEnd:()=>I(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},C.filter(Z=>!Z.position&&P===0||Z.position===X).map((Z,le)=>{var he,ae;return J.createElement(nH,{key:Z.id,icons:S,index:le,toast:Z,defaultRichColors:p,duration:(he=h==null?void 0:h.duration)!=null?he:x,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:r,visibleToasts:y,closeButton:(ae=h==null?void 0:h.closeButton)!=null?ae:c,interacting:V,position:X,style:h==null?void 0:h.style,unstyled:h==null?void 0:h.unstyled,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,closeButtonAriaLabel:h==null?void 0:h.closeButtonAriaLabel,removeToast:Q,toasts:C.filter(K=>K.position==Z.position),heights:M.filter(K=>K.position==Z.position),setHeights:z,expandByDefault:l,gap:v,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),oH=({...e})=>o.jsx(rH,{theme:"light",position:"bottom-right",className:"tw:toaster tw:group",toastOptions:{classNames:{toast:"tw:group tw:toast tw:bg-zinc-900 tw:text-white tw:border-zinc-700 tw:shadow-lg tw:rounded-lg tw:border tw:p-4",description:"tw:text-zinc-300 tw:font-mono tw:text-xs tw:bg-zinc-800 tw:px-2 tw:py-1.5 tw:rounded tw:mt-2 tw:block",actionButton:"tw:bg-primary tw:text-primary-foreground tw:rounded-md tw:px-3 tw:py-1.5 tw:text-sm tw:font-medium hover:tw:bg-primary/90",cancelButton:"tw:bg-zinc-700 tw:text-zinc-200 tw:rounded-md tw:px-3 tw:py-1.5 tw:text-sm",error:"tw:border-red-500 tw:bg-red-900"}},...e});var bm="Switch",[sH]=Ht(bm),[iH,lH]=sH(bm),AT=u.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:r,defaultChecked:s,required:i,disabled:l,value:c="on",onCheckedChange:d,form:m,...f}=e,[w,p]=u.useState(null),x=Se(t,v=>p(v)),b=u.useRef(!1),y=w?m||!!w.closest("form"):!0,[h,g]=Vn({prop:r,defaultProp:s??!1,onChange:d,caller:bm});return o.jsxs(iH,{scope:n,checked:h,disabled:l,children:[o.jsx(me.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":RT(h),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:ee(e.onClick,v=>{g(S=>!S),y&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),y&&o.jsx(TT,{control:w,bubbles:!b.current,name:a,value:c,checked:h,required:i,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});AT.displayName=bm;var _T="SwitchThumb",ET=u.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,r=lH(_T,n);return o.jsx(me.span,{"data-state":RT(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:t})});ET.displayName=_T;var cH="SwitchBubbleInput",TT=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...r},s)=>{const i=u.useRef(null),l=Se(i,s),c=kc(n),d=Tc(t);return u.useEffect(()=>{const m=i.current;if(!m)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const x=new Event("click",{bubbles:a});p.call(m,n),m.dispatchEvent(x)}},[c,n,a]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:l,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});TT.displayName=cH;function RT(e){return e?"checked":"unchecked"}var kT=AT,uH=ET;const _r=u.forwardRef(({className:e,...t},n)=>o.jsx(kT,{className:E("tw:peer tw:inline-flex tw:h-5 tw:w-9 tw:shrink-0 tw:cursor-pointer tw:items-center tw:rounded-full tw:border-2 tw:border-transparent tw:shadow-sm tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-background tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:data-[state=checked]:bg-primary tw:data-[state=unchecked]:bg-input",e),...t,ref:n,children:o.jsx(uH,{className:E("tw:pointer-events-none tw:block tw:h-4 tw:w-4 tw:rounded-full tw:bg-background tw:shadow-lg tw:ring-0 tw:transition-transform tw:data-[state=checked]:translate-x-4 tw:data-[state=unchecked]:translate-x-0")})}));_r.displayName=kT.displayName;var vm="Tabs",[dH]=Ht(vm,[Oi]),MT=Oi(),[fH,fb]=dH(vm),DT=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:c="automatic",...d}=e,m=es(l),[f,w]=Vn({prop:a,onChange:r,defaultProp:s??"",caller:vm});return o.jsx(fH,{scope:n,baseId:Un(),value:f,onValueChange:w,orientation:i,dir:m,activationMode:c,children:o.jsx(me.div,{dir:m,"data-orientation":i,...d,ref:t})})});DT.displayName=vm;var OT="TabsList",PT=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,s=fb(OT,n),i=MT(n);return o.jsx(zx,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:a,children:o.jsx(me.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});PT.displayName=OT;var zT="TabsTrigger",LT=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...s}=e,i=fb(zT,n),l=MT(n),c=BT(i.baseId,a),d=UT(i.baseId,a),m=a===i.value;return o.jsx(Lx,{asChild:!0,...l,focusable:!r,active:m,children:o.jsx(me.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...s,ref:t,onMouseDown:ee(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?i.onValueChange(a):f.preventDefault()}),onKeyDown:ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(a)}),onFocus:ee(e.onFocus,()=>{const f=i.activationMode!=="manual";!m&&!r&&f&&i.onValueChange(a)})})})});LT.displayName=zT;var IT="TabsContent",$T=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:s,...i}=e,l=fb(IT,n),c=BT(l.baseId,a),d=UT(l.baseId,a),m=a===l.value,f=u.useRef(m);return u.useEffect(()=>{const w=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(w)},[]),o.jsx(Rt,{present:r||m,children:({present:w})=>o.jsx(me.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!w,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:w&&s})})});$T.displayName=IT;function BT(e,t){return`${e}-trigger-${t}`}function UT(e,t){return`${e}-content-${t}`}var mH=DT,HT=PT,FT=LT,VT=$T;const wH=mH,GT=u.forwardRef(({className:e,...t},n)=>o.jsx(HT,{ref:n,className:E("tw:inline-flex tw:h-9 tw:items-center tw:justify-center tw:rounded-lg tw:bg-muted tw:p-1 tw:text-muted-foreground",e),...t}));GT.displayName=HT.displayName;const ym=u.forwardRef(({className:e,...t},n)=>o.jsx(FT,{ref:n,className:E("tw:inline-flex tw:items-center tw:justify-center tw:whitespace-nowrap tw:rounded-md tw:px-3 tw:py-1 tw:text-sm tw:font-medium tw:ring-offset-background tw:transition-all tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[state=active]:bg-background tw:data-[state=active]:text-foreground tw:data-[state=active]:shadow",e),...t}));ym.displayName=FT.displayName;const Sm=u.forwardRef(({className:e,...t},n)=>o.jsx(VT,{ref:n,className:E("tw:mt-2 tw:ring-offset-background tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2",e),...t}));Sm.displayName=VT.displayName;const pH=4;function hH(e){const t=window.getComputedStyle(e),n=parseFloat(t.outlineWidth);if(Number.isNaN(n))return pH;const a=parseFloat(t.outlineOffset);return Math.max(0,n+(Number.isNaN(a)?0:a))}function gH(e){try{return e.matches(":focus-visible")}catch{return!1}}function YT(e,t,n,a){return e<n||t-e>a-n?e-n:t>a?t-a:0}function KT(e){const t=e.currentTarget,n=e.target;if(!(n instanceof HTMLElement)||n===t||!gH(n))return;const a=hH(n),r=t.getBoundingClientRect(),s=n.getBoundingClientRect(),i=r.left+t.clientLeft,l=r.top+t.clientTop,c=YT(s.left-a,s.right+a,i,i+t.clientWidth),d=YT(s.top-a,s.bottom+a,l,l+t.clientHeight);c!==0&&t.scrollWidth>t.clientWidth&&(t.scrollLeft+=c),d!==0&&t.scrollHeight>t.clientHeight&&(t.scrollTop+=d)}const qT=u.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"tw:relative tw:w-full tw:overflow-auto",onFocus:KT,children:o.jsx("table",{ref:n,className:E("tw:w-full tw:caption-bottom tw:text-sm",e),...t})}));qT.displayName="Table";const XT=u.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:E("tw:[&_tr]:border-b tw:[&_tr]:border-gray-100",e),...t}));XT.displayName="TableHeader";const WT=u.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:E("tw:[&_tr:last-child]:border-0",e),...t}));WT.displayName="TableBody";const xH=u.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:E("tw:border-t tw:bg-muted/50 tw:font-medium tw:[&>tr]:last:border-b-0",e),...t}));xH.displayName="TableFooter";const nu=u.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:E("tw:border-b tw:border-gray-100 tw:transition-colors tw:hover:bg-muted/50 tw:data-[state=selected]:bg-muted",e),...t}));nu.displayName="TableRow";const is=u.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:E("tw:h-10 tw:px-2 tw:text-left tw:align-middle tw:font-medium tw:text-muted-foreground tw:[&:has([role=checkbox])]:pr-0 tw:[&>[role=checkbox]]:translate-y-[2px]",e),...t}));is.displayName="TableHead";const Er=u.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:E("tw:p-2 tw:align-middle tw:[&:has([role=checkbox])]:pr-0 tw:[&>[role=checkbox]]:translate-y-[2px]",e),...t}));Er.displayName="TableCell";const bH=u.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:E("tw:mt-4 tw:text-sm tw:text-muted-foreground",e),...t}));bH.displayName="TableCaption";const vH=u.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:E("tw:flex tw:min-h-[60px] tw:w-full tw:rounded-md tw:border tw:border-gray-300 tw:bg-white tw:px-3 tw:py-2 tw:text-base tw:shadow-sm tw:placeholder:text-muted-foreground tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:md:text-sm",e),ref:n,...t}));vH.displayName="Textarea";function yH({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),o.jsx("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"})]})}function ZT({label:e,tooltip:t}){return o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":`About ${e}`,className:"tw:inline-flex tw:items-center tw:justify-center tw:m-0 tw:p-0 tw:border-0 tw:bg-transparent tw:text-gray-400 tw:rounded-full tw:cursor-help tw:transition-colors tw:hover:text-gray-600 tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring",children:o.jsx(yH,{className:"tw:w-4 tw:h-4"})})}),o.jsx(Hi,{side:"top",className:"tw:max-w-xs tw:text-xs",children:t})]})}function mb({label:e,tooltip:t}){return o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1 tw:mb-1",children:[o.jsx("span",{className:"tw:text-xs tw:font-medium tw:text-gray-600",children:e}),o.jsx(ZT,{label:e,tooltip:t})]})}function SH(e){return Object.prototype.toString.call(e)==="[object Object]"}function QT(e){return SH(e)||Array.isArray(e)}function jH(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function wb(e,t){const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;const r=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return r!==s?!1:n.every(i=>{const l=e[i],c=t[i];return typeof l=="function"?`${l}`==`${c}`:!QT(l)||!QT(c)?l===c:wb(l,c)})}function JT(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function NH(e,t){if(e.length!==t.length)return!1;const n=JT(e),a=JT(t);return n.every((r,s)=>{const i=a[s];return wb(r,i)})}function pb(e){return typeof e=="number"}function hb(e){return typeof e=="string"}function jm(e){return typeof e=="boolean"}function eR(e){return Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return Math.abs(e)}function gb(e){return Math.sign(e)}function au(e,t){return ht(e-t)}function CH(e,t){if(e===0||t===0||ht(e)<=ht(t))return 0;const n=au(ht(e),ht(t));return ht(n/e)}function AH(e){return Math.round(e*100)/100}function ru(e){return su(e).map(Number)}function Na(e){return e[ou(e)]}function ou(e){return Math.max(0,e.length-1)}function xb(e,t){return t===ou(e)}function tR(e,t=0){return Array.from(Array(e),(n,a)=>t+a)}function su(e){return Object.keys(e)}function nR(e,t){return[e,t].reduce((n,a)=>(su(a).forEach(r=>{const s=n[r],i=a[r],l=eR(s)&&eR(i);n[r]=l?nR(s,i):i}),n),{})}function bb(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function _H(e,t){const n={start:a,center:r,end:s};function a(){return 0}function r(c){return s(c)/2}function s(c){return t-c}function i(c,d){return hb(e)?n[e](c):e(t,c,d)}return{measure:i}}function iu(){let e=[];function t(r,s,i,l={passive:!0}){let c;if("addEventListener"in r)r.addEventListener(s,i,l),c=()=>r.removeEventListener(s,i,l);else{const d=r;d.addListener(i),c=()=>d.removeListener(i)}return e.push(c),a}function n(){e=e.filter(r=>r())}const a={add:t,clear:n};return a}function EH(e,t,n,a){const r=iu(),s=1e3/60;let i=null,l=0,c=0;function d(){r.add(e,"visibilitychange",()=>{e.hidden&&x()})}function m(){p(),r.clear()}function f(y){if(!c)return;i||(i=y,n(),n());const h=y-i;for(i=y,l+=h;l>=s;)n(),l-=s;const g=l/s;a(g),c&&(c=t.requestAnimationFrame(f))}function w(){c||(c=t.requestAnimationFrame(f))}function p(){t.cancelAnimationFrame(c),i=null,l=0,c=0}function x(){i=null,l=0}return{init:d,destroy:m,start:w,stop:p,update:n,render:a}}function TH(e,t){const n=t==="rtl",a=e==="y",r=a?"y":"x",s=a?"x":"y",i=!a&&n?-1:1,l=m(),c=f();function d(x){const{height:b,width:y}=x;return a?b:y}function m(){return a?"top":n?"right":"left"}function f(){return a?"bottom":n?"left":"right"}function w(x){return x*i}return{scroll:r,cross:s,startEdge:l,endEdge:c,measureSize:d,direction:w}}function ls(e=0,t=0){const n=ht(e-t);function a(d){return d<e}function r(d){return d>t}function s(d){return a(d)||r(d)}function i(d){return s(d)?a(d)?e:t:d}function l(d){return n?d-n*Math.ceil((d-t)/n):d}return{length:n,max:t,min:e,constrain:i,reachedAny:s,reachedMax:r,reachedMin:a,removeOffset:l}}function aR(e,t,n){const{constrain:a}=ls(0,e),r=e+1;let s=i(t);function i(w){return n?ht((r+w)%r):a(w)}function l(){return s}function c(w){return s=i(w),f}function d(w){return m().set(l()+w)}function m(){return aR(e,l(),n)}const f={get:l,set:c,add:d,clone:m};return f}function RH(e,t,n,a,r,s,i,l,c,d,m,f,w,p,x,b,y,h,g){const{cross:v,direction:S}=e,N=["INPUT","SELECT","TEXTAREA"],A={passive:!1},j=iu(),C=iu(),R=ls(50,225).constrain(p.measure(20)),M={mouse:300,touch:400},z={mouse:500,touch:600},B=x?43:25;let I=!1,V=0,D=0,T=!1,O=!1,_=!1,$=!1;function H(K){if(!g)return;function ge(We){(jm(g)||g(K,We))&&ne(We)}const Ce=t;j.add(Ce,"dragstart",We=>We.preventDefault(),A).add(Ce,"touchmove",()=>{},A).add(Ce,"touchend",()=>{}).add(Ce,"touchstart",ge).add(Ce,"mousedown",ge).add(Ce,"touchcancel",Z).add(Ce,"contextmenu",Z).add(Ce,"click",le,!0)}function F(){j.clear(),C.clear()}function Q(){const K=$?n:t;C.add(K,"touchmove",Y,A).add(K,"touchend",Z).add(K,"mousemove",Y,A).add(K,"mouseup",Z)}function X(K){const ge=K.nodeName||"";return N.includes(ge)}function P(){return(x?z:M)[$?"mouse":"touch"]}function G(K,ge){const Ce=f.add(gb(K)*-1),We=m.byDistance(K,!x).distance;return x||ht(K)<R?We:y&&ge?We*.5:m.byIndex(Ce.get(),0).distance}function ne(K){const ge=bb(K,a);$=ge,_=x&&ge&&!K.buttons&&I,I=au(r.get(),i.get())>=2,!(ge&&K.button!==0)&&(X(K.target)||(T=!0,s.pointerDown(K),d.useFriction(0).useDuration(0),r.set(i),Q(),V=s.readPoint(K),D=s.readPoint(K,v),w.emit("pointerDown")))}function Y(K){if(!bb(K,a)&&K.touches.length>=2)return Z(K);const Ce=s.readPoint(K),We=s.readPoint(K,v),Ke=au(Ce,V),at=au(We,D);if(!O&&!$&&(!K.cancelable||(O=Ke>at,!O)))return Z(K);const Kt=s.pointerMove(K);Ke>b&&(_=!0),d.useFriction(.3).useDuration(.75),l.start(),r.add(S(Kt)),K.preventDefault()}function Z(K){const Ce=m.byDistance(0,!1).index!==f.get(),We=s.pointerUp(K)*P(),Ke=G(S(We),Ce),at=CH(We,Ke),Kt=B-10*at,He=h+at/50;O=!1,T=!1,C.clear(),d.useDuration(Kt).useFriction(He),c.distance(Ke,!x),$=!1,w.emit("pointerUp")}function le(K){_&&(K.stopPropagation(),K.preventDefault(),_=!1)}function he(){return T}return{init:H,destroy:F,pointerDown:he}}function kH(e,t){let a,r;function s(f){return f.timeStamp}function i(f,w){const x=`client${(w||e.scroll)==="x"?"X":"Y"}`;return(bb(f,t)?f:f.touches[0])[x]}function l(f){return a=f,r=f,i(f)}function c(f){const w=i(f)-i(r),p=s(f)-s(a)>170;return r=f,p&&(a=f),w}function d(f){if(!a||!r)return 0;const w=i(r)-i(a),p=s(f)-s(a),x=s(f)-s(r)>170,b=w/p;return p&&!x&&ht(b)>.1?b:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:i}}function MH(){function e(n){const{offsetTop:a,offsetLeft:r,offsetWidth:s,offsetHeight:i}=n;return{top:a,right:r+s,bottom:a+i,left:r,width:s,height:i}}return{measure:e}}function DH(e){function t(a){return e*(a/100)}return{measure:t}}function OH(e,t,n,a,r,s,i){const l=[e].concat(a);let c,d,m=[],f=!1;function w(y){return r.measureSize(i.measure(y))}function p(y){if(!s)return;d=w(e),m=a.map(w);function h(g){for(const v of g){if(f)return;const S=v.target===e,N=a.indexOf(v.target),A=S?d:m[N],j=w(S?e:a[N]);if(ht(j-A)>=.5){y.reInit(),t.emit("resize");break}}}c=new ResizeObserver(g=>{(jm(s)||s(y,g))&&h(g)}),n.requestAnimationFrame(()=>{l.forEach(g=>c.observe(g))})}function x(){f=!0,c&&c.disconnect()}return{init:p,destroy:x}}function PH(e,t,n,a,r,s){let i=0,l=0,c=r,d=s,m=e.get(),f=0;function w(){const A=a.get()-e.get(),j=!c;let C=0;return j?(i=0,n.set(a),e.set(a),C=A):(n.set(e),i+=A/c,i*=d,m+=i,e.add(i),C=m-f),l=gb(C),f=m,N}function p(){const A=a.get()-t.get();return ht(A)<.001}function x(){return c}function b(){return l}function y(){return i}function h(){return v(r)}function g(){return S(s)}function v(A){return c=A,N}function S(A){return d=A,N}const N={direction:b,duration:x,velocity:y,seek:w,settled:p,useBaseFriction:g,useBaseDuration:h,useFriction:S,useDuration:v};return N}function zH(e,t,n,a,r){const s=r.measure(10),i=r.measure(50),l=ls(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function m(p){if(!d())return;const x=e.reachedMin(t.get())?"min":"max",b=ht(e[x]-t.get()),y=n.get()-t.get(),h=l.constrain(b/i);n.subtract(y*h),!p&&ht(y)<s&&(n.set(e.constrain(n.get())),a.useDuration(25).useBaseFriction())}function f(p){c=!p}return{shouldConstrain:d,constrain:m,toggleActive:f}}function LH(e,t,n,a,r){const s=ls(-t+e,0),i=f(),l=m(),c=w();function d(x,b){return au(x,b)<=1}function m(){const x=i[0],b=Na(i),y=i.lastIndexOf(x),h=i.indexOf(b)+1;return ls(y,h)}function f(){return n.map((x,b)=>{const{min:y,max:h}=s,g=s.constrain(x),v=!b,S=xb(n,b);return v?h:S||d(y,g)?y:d(h,g)?h:g}).map(x=>parseFloat(x.toFixed(3)))}function w(){if(t<=e+r)return[s.max];if(a==="keepSnaps")return i;const{min:x,max:b}=l;return i.slice(x,b)}return{snapsContained:c,scrollContainLimit:l}}function IH(e,t,n){const a=t[0],r=n?a-e:Na(t);return{limit:ls(r,a)}}function $H(e,t,n,a){const s=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:c}=ls(s,i);function d(w){return w===1?c(n.get()):w===-1?l(n.get()):!1}function m(w){if(!d(w))return;const p=e*(w*-1);a.forEach(x=>x.add(p))}return{loop:m}}function BH(e){const{max:t,length:n}=e;function a(s){const i=s-t;return n?i/-n:0}return{get:a}}function UH(e,t,n,a,r){const{startEdge:s,endEdge:i}=e,{groupSlides:l}=r,c=f().map(t.measure),d=w(),m=p();function f(){return l(a).map(b=>Na(b)[i]-b[0][s]).map(ht)}function w(){return a.map(b=>n[s]-b[s]).map(b=>-ht(b))}function p(){return l(d).map(b=>b[0]).map((b,y)=>b+c[y])}return{snaps:d,snapsAligned:m}}function HH(e,t,n,a,r,s){const{groupSlides:i}=r,{min:l,max:c}=a,d=m();function m(){const w=i(s),p=!e||t==="keepSnaps";return n.length===1?[s]:p?w:w.slice(l,c).map((x,b,y)=>{const h=!b,g=xb(y,b);if(h){const v=Na(y[0])+1;return tR(v)}if(g){const v=ou(s)-Na(y)[0]+1;return tR(v,Na(y)[0])}return x})}return{slideRegistry:d}}function FH(e,t,n,a,r){const{reachedAny:s,removeOffset:i,constrain:l}=a;function c(x){return x.concat().sort((b,y)=>ht(b)-ht(y))[0]}function d(x){const b=e?i(x):l(x),y=t.map((g,v)=>({diff:m(g-b,0),index:v})).sort((g,v)=>ht(g.diff)-ht(v.diff)),{index:h}=y[0];return{index:h,distance:b}}function m(x,b){const y=[x,x+n,x-n];if(!e)return x;if(!b)return c(y);const h=y.filter(g=>gb(g)===b);return h.length?c(h):Na(y)-n}function f(x,b){const y=t[x]-r.get(),h=m(y,b);return{index:x,distance:h}}function w(x,b){const y=r.get()+x,{index:h,distance:g}=d(y),v=!e&&s(y);if(!b||v)return{index:h,distance:x};const S=t[h]-g,N=x+m(S,0);return{index:h,distance:N}}return{byDistance:w,byIndex:f,shortcut:m}}function VH(e,t,n,a,r,s,i){function l(f){const w=f.distance,p=f.index!==t.get();s.add(w),w&&(a.duration()?e.start():(e.update(),e.render(1),e.update())),p&&(n.set(t.get()),t.set(f.index),i.emit("select"))}function c(f,w){const p=r.byDistance(f,w);l(p)}function d(f,w){const p=t.clone().set(f),x=r.byIndex(p.get(),w);l(x)}return{distance:c,index:d}}function GH(e,t,n,a,r,s,i,l){const c={passive:!0,capture:!0};let d=0;function m(p){if(!l)return;function x(b){if(new Date().getTime()-d>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const g=n.findIndex(v=>v.includes(b));pb(g)&&(r.useDuration(0),a.index(g,0),i.emit("slideFocus"))}s.add(document,"keydown",f,!1),t.forEach((b,y)=>{s.add(b,"focus",h=>{(jm(l)||l(p,h))&&x(y)},c)})}function f(p){p.code==="Tab"&&(d=new Date().getTime())}return{init:m}}function lu(e){let t=e;function n(){return t}function a(c){t=i(c)}function r(c){t+=i(c)}function s(c){t-=i(c)}function i(c){return pb(c)?c:c.get()}return{get:n,set:a,add:r,subtract:s}}function rR(e,t){const n=e.scroll==="x"?i:l,a=t.style;let r=null,s=!1;function i(w){return`translate3d(${w}px,0px,0px)`}function l(w){return`translate3d(0px,${w}px,0px)`}function c(w){if(s)return;const p=AH(e.direction(w));p!==r&&(a.transform=n(p),r=p)}function d(w){s=!w}function m(){s||(a.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:m,to:c,toggleActive:d}}function YH(e,t,n,a,r,s,i,l,c){const m=ru(r),f=ru(r).reverse(),w=h().concat(g());function p(j,C){return j.reduce((R,M)=>R-r[M],C)}function x(j,C){return j.reduce((R,M)=>p(R,C)>0?R.concat([M]):R,[])}function b(j){return s.map((C,R)=>({start:C-a[R]+.5+j,end:C+t-.5+j}))}function y(j,C,R){const M=b(C);return j.map(z=>{const B=R?0:-n,I=R?n:0,V=R?"end":"start",D=M[z][V];return{index:z,loopPoint:D,slideLocation:lu(-1),translate:rR(e,c[z]),target:()=>l.get()>D?B:I}})}function h(){const j=i[0],C=x(f,j);return y(C,n,!1)}function g(){const j=t-i[0]-1,C=x(m,j);return y(C,-n,!0)}function v(){return w.every(({index:j})=>{const C=m.filter(R=>R!==j);return p(C,t)<=.1})}function S(){w.forEach(j=>{const{target:C,translate:R,slideLocation:M}=j,z=C();z!==M.get()&&(R.to(z),M.set(z))})}function N(){w.forEach(j=>j.translate.clear())}return{canLoop:v,clear:N,loop:S,loopPoints:w}}function KH(e,t,n){let a,r=!1;function s(c){if(!n)return;function d(m){for(const f of m)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}a=new MutationObserver(m=>{r||(jm(n)||n(c,m))&&d(m)}),a.observe(e,{childList:!0})}function i(){a&&a.disconnect(),r=!0}return{init:s,destroy:i}}function qH(e,t,n,a){const r={};let s=null,i=null,l,c=!1;function d(){l=new IntersectionObserver(x=>{c||(x.forEach(b=>{const y=t.indexOf(b.target);r[y]=b}),s=null,i=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:a}),t.forEach(x=>l.observe(x))}function m(){l&&l.disconnect(),c=!0}function f(x){return su(r).reduce((b,y)=>{const h=parseInt(y),{isIntersecting:g}=r[h];return(x&&g||!x&&!g)&&b.push(h),b},[])}function w(x=!0){if(x&&s)return s;if(!x&&i)return i;const b=f(x);return x&&(s=b),x||(i=b),b}return{init:d,destroy:m,get:w}}function XH(e,t,n,a,r,s){const{measureSize:i,startEdge:l,endEdge:c}=e,d=n[0]&&r,m=x(),f=b(),w=n.map(i),p=y();function x(){if(!d)return 0;const g=n[0];return ht(t[l]-g[l])}function b(){if(!d)return 0;const g=s.getComputedStyle(Na(a));return parseFloat(g.getPropertyValue(`margin-${c}`))}function y(){return n.map((g,v,S)=>{const N=!v,A=xb(S,v);return N?w[v]+m:A?w[v]+f:S[v+1][l]-g[l]}).map(ht)}return{slideSizes:w,slideSizesWithGaps:p,startGap:m,endGap:f}}function WH(e,t,n,a,r,s,i,l,c){const{startEdge:d,endEdge:m,direction:f}=e,w=pb(n);function p(h,g){return ru(h).filter(v=>v%g===0).map(v=>h.slice(v,v+g))}function x(h){return h.length?ru(h).reduce((g,v,S)=>{const N=Na(g)||0,A=N===0,j=v===ou(h),C=r[d]-s[N][d],R=r[d]-s[v][m],M=!a&&A?f(i):0,z=!a&&j?f(l):0,B=ht(R-z-(C+M));return S&&B>t+c&&g.push(v),j&&g.push(h.length),g},[]).map((g,v,S)=>{const N=Math.max(S[v-1]||0);return h.slice(N,g)}):[]}function b(h){return w?p(h,n):x(h)}return{groupSlides:b}}function ZH(e,t,n,a,r,s,i){const{align:l,axis:c,direction:d,startIndex:m,loop:f,duration:w,dragFree:p,dragThreshold:x,inViewThreshold:b,slidesToScroll:y,skipSnaps:h,containScroll:g,watchResize:v,watchSlides:S,watchDrag:N,watchFocus:A}=s,j=2,C=MH(),R=C.measure(t),M=n.map(C.measure),z=TH(c,d),B=z.measureSize(R),I=DH(B),V=_H(l,B),D=!f&&!!g,T=f||!!g,{slideSizes:O,slideSizesWithGaps:_,startGap:$,endGap:H}=XH(z,R,M,n,T,r),F=WH(z,B,y,f,R,M,$,H,j),{snaps:Q,snapsAligned:X}=UH(z,V,R,M,F),P=-Na(Q)+Na(_),{snapsContained:G,scrollContainLimit:ne}=LH(B,P,X,g,j),Y=D?G:X,{limit:Z}=IH(P,Y,f),le=aR(ou(Y),m,f),he=le.clone(),ae=ru(n),K=({dragHandler:we,scrollBody:Ve,scrollBounds:ze,options:{loop:Wt}})=>{Wt||ze.constrain(we.pointerDown()),Ve.seek()},ge=({scrollBody:we,translate:Ve,location:ze,offsetLocation:Wt,previousLocation:Ge,scrollLooper:Ea,slideLooper:pa,dragHandler:Xn,animation:Ta,eventHandler:rn,scrollBounds:Za,options:{loop:ie}},Ee)=>{const $e=we.settled(),re=!Za.shouldConstrain(),Je=ie?$e:$e&&re,dt=Je&&!Xn.pointerDown();dt&&Ta.stop();const kt=ze.get()*Ee+Ge.get()*(1-Ee);Wt.set(kt),ie&&(Ea.loop(we.direction()),pa.loop()),Ve.to(Wt.get()),dt&&rn.emit("settle"),Je||rn.emit("scroll")},Ce=EH(a,r,()=>K(ye),we=>ge(ye,we)),We=.68,Ke=Y[le.get()],at=lu(Ke),Kt=lu(Ke),He=lu(Ke),qt=lu(Ke),Cn=PH(at,He,Kt,qt,w,We),mt=FH(f,Y,P,Z,qt),Xt=VH(Ce,le,he,Cn,mt,qt,i),an=BH(Z),wn=iu(),An=qH(t,n,i,b),{slideRegistry:qn}=HH(D,g,Y,ne,F,ae),oe=GH(e,n,qn,Xt,Cn,wn,i,A),ye={ownerDocument:a,ownerWindow:r,eventHandler:i,containerRect:R,slideRects:M,animation:Ce,axis:z,dragHandler:RH(z,e,a,r,qt,kH(z,r),at,Ce,Xt,Cn,mt,le,i,I,p,x,h,We,N),eventStore:wn,percentOfView:I,index:le,indexPrevious:he,limit:Z,location:at,offsetLocation:He,previousLocation:Kt,options:s,resizeHandler:OH(t,i,r,n,z,v,C),scrollBody:Cn,scrollBounds:zH(Z,He,qt,Cn,I),scrollLooper:$H(P,Z,He,[at,He,Kt,qt]),scrollProgress:an,scrollSnapList:Y.map(an.get),scrollSnaps:Y,scrollTarget:mt,scrollTo:Xt,slideLooper:YH(z,B,P,O,_,Q,Y,He,n),slideFocus:oe,slidesHandler:KH(t,i,S),slidesInView:An,slideIndexes:ae,slideRegistry:qn,slidesToScroll:F,target:qt,translate:rR(z,t)};return ye}function QH(){let e={},t;function n(d){t=d}function a(d){return e[d]||[]}function r(d){return a(d).forEach(m=>m(t,d)),c}function s(d,m){return e[d]=a(d).concat([m]),c}function i(d,m){return e[d]=a(d).filter(f=>f!==m),c}function l(){e={}}const c={init:n,emit:r,off:i,on:s,clear:l};return c}const JH={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function eF(e){function t(s,i){return nR(s,i||{})}function n(s){const i=s.breakpoints||{},l=su(i).filter(c=>e.matchMedia(c).matches).map(c=>i[c]).reduce((c,d)=>t(c,d),{});return t(s,l)}function a(s){return s.map(i=>su(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:a}}function tF(e){let t=[];function n(s,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(s,e)),i.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function a(){t=t.filter(s=>s.destroy())}return{init:n,destroy:a}}function Nm(e,t,n){const a=e.ownerDocument,r=a.defaultView,s=eF(r),i=tF(s),l=iu(),c=QH(),{mergeOptions:d,optionsAtMedia:m,optionsMediaQueries:f}=s,{on:w,off:p,emit:x}=c,b=z;let y=!1,h,g=d(JH,Nm.globalOptions),v=d(g),S=[],N,A,j;function C(){const{container:ae,slides:K}=v;A=(hb(ae)?e.querySelector(ae):ae)||e.children[0];const Ce=hb(K)?A.querySelectorAll(K):K;j=[].slice.call(Ce||A.children)}function R(ae){const K=ZH(e,A,j,a,r,ae,c);if(ae.loop&&!K.slideLooper.canLoop()){const ge=Object.assign({},ae,{loop:!1});return R(ge)}return K}function M(ae,K){y||(g=d(g,ae),v=m(g),S=K||S,C(),h=R(v),f([g,...S.map(({options:ge})=>ge)]).forEach(ge=>l.add(ge,"change",z)),v.active&&(h.translate.to(h.location.get()),h.animation.init(),h.slidesInView.init(),h.slideFocus.init(he),h.eventHandler.init(he),h.resizeHandler.init(he),h.slidesHandler.init(he),h.options.loop&&h.slideLooper.loop(),A.offsetParent&&j.length&&h.dragHandler.init(he),N=i.init(he,S)))}function z(ae,K){const ge=F();B(),M(d({startIndex:ge},ae),K),c.emit("reInit")}function B(){h.dragHandler.destroy(),h.eventStore.clear(),h.translate.clear(),h.slideLooper.clear(),h.resizeHandler.destroy(),h.slidesHandler.destroy(),h.slidesInView.destroy(),h.animation.destroy(),i.destroy(),l.clear()}function I(){y||(y=!0,l.clear(),B(),c.emit("destroy"),c.clear())}function V(ae,K,ge){!v.active||y||(h.scrollBody.useBaseFriction().useDuration(K===!0?0:v.duration),h.scrollTo.index(ae,ge||0))}function D(ae){const K=h.index.add(1).get();V(K,ae,-1)}function T(ae){const K=h.index.add(-1).get();V(K,ae,1)}function O(){return h.index.add(1).get()!==F()}function _(){return h.index.add(-1).get()!==F()}function $(){return h.scrollSnapList}function H(){return h.scrollProgress.get(h.offsetLocation.get())}function F(){return h.index.get()}function Q(){return h.indexPrevious.get()}function X(){return h.slidesInView.get()}function P(){return h.slidesInView.get(!1)}function G(){return N}function ne(){return h}function Y(){return e}function Z(){return A}function le(){return j}const he={canScrollNext:O,canScrollPrev:_,containerNode:Z,internalEngine:ne,destroy:I,off:p,on:w,emit:x,plugins:G,previousScrollSnap:Q,reInit:b,rootNode:Y,scrollNext:D,scrollPrev:T,scrollProgress:H,scrollSnapList:$,scrollTo:V,selectedScrollSnap:F,slideNodes:le,slidesInView:X,slidesNotInView:P};return M(t,n),setTimeout(()=>c.emit("init"),0),he}Nm.globalOptions=void 0;function vb(e={},t=[]){const n=u.useRef(e),a=u.useRef(t),[r,s]=u.useState(),[i,l]=u.useState(),c=u.useCallback(()=>{r&&r.reInit(n.current,a.current)},[r]);return u.useEffect(()=>{wb(n.current,e)||(n.current=e,c())},[e,c]),u.useEffect(()=>{NH(a.current,t)||(a.current=t,c())},[t,c]),u.useEffect(()=>{if(jH()&&i){Nm.globalOptions=vb.globalOptions;const d=Nm(i,n.current,a.current);return s(d),()=>d.destroy()}else s(void 0)},[i,s]),[l,r]}vb.globalOptions=void 0;const oR=u.createContext(null);function Cm(){const e=u.useContext(oR);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const nF=u.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:a,className:r,children:s,...i},l)=>{const[c,d]=vb({...t,axis:e==="horizontal"?"x":"y"},a),[m,f]=u.useState(!1),[w,p]=u.useState(!1),x=u.useCallback(g=>{g&&(f(g.canScrollPrev()),p(g.canScrollNext()))},[]),b=u.useCallback(()=>{d==null||d.scrollPrev()},[d]),y=u.useCallback(()=>{d==null||d.scrollNext()},[d]),h=u.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),b()):g.key==="ArrowRight"&&(g.preventDefault(),y())},[b,y]);return u.useEffect(()=>{!d||!n||n(d)},[d,n]),u.useEffect(()=>{if(d)return x(d),d.on("reInit",x),d.on("select",x),()=>{d==null||d.off("select",x)}},[d,x]),o.jsx(oR.Provider,{value:{carouselRef:c,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:y,canScrollPrev:m,canScrollNext:w},children:o.jsx("div",{ref:l,onKeyDownCapture:h,className:E("tw:relative",r),role:"region","aria-roledescription":"carousel",...i,children:s})})});nF.displayName="Carousel";const aF=u.forwardRef(({className:e,...t},n)=>{const{carouselRef:a,orientation:r}=Cm();return o.jsx("div",{ref:a,className:"tw:overflow-hidden",children:o.jsx("div",{ref:n,className:E("tw:flex",r==="horizontal"?"tw:-ml-4":"tw:-mt-4 tw:flex-col",e),...t})})});aF.displayName="CarouselContent";const rF=u.forwardRef(({className:e,...t},n)=>{const{orientation:a}=Cm();return o.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:E("tw:min-w-0 tw:shrink-0 tw:grow-0 tw:basis-full",a==="horizontal"?"tw:pl-4":"tw:pt-4",e),...t})});rF.displayName="CarouselItem";const oF=u.forwardRef(({className:e,variant:t="outline",size:n="icon",...a},r)=>{const{orientation:s,scrollPrev:i,canScrollPrev:l}=Cm();return o.jsxs(Ne,{ref:r,variant:t,size:n,className:E("tw:absolute tw:h-8 tw:w-8 tw:rounded-full",s==="horizontal"?"tw:-left-12 tw:top-1/2 tw:-translate-y-1/2":"tw:-top-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90",e),disabled:!l,onClick:i,...a,children:[o.jsx(CP,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Previous slide"})]})});oF.displayName="CarouselPrevious";const sF=u.forwardRef(({className:e,variant:t="outline",size:n="icon",...a},r)=>{const{orientation:s,scrollNext:i,canScrollNext:l}=Cm();return o.jsxs(Ne,{ref:r,variant:t,size:n,className:E("tw:absolute tw:h-8 tw:w-8 tw:rounded-full",s==="horizontal"?"tw:-right-12 tw:top-1/2 tw:-translate-y-1/2":"tw:-bottom-12 tw:left-1/2 tw:-translate-x-1/2 tw:rotate-90",e),disabled:!l,onClick:i,...a,children:[o.jsx(bg,{className:"tw:h-4 tw:w-4"}),o.jsx("span",{className:"tw:sr-only",children:"Next slide"})]})});sF.displayName="CarouselNext";const sR=u.createContext(null);function iF({children:e}){const[t,n]=u.useState({isOpen:!1,options:{message:""},resolve:null}),a=u.useCallback(f=>new Promise(w=>{n({isOpen:!0,options:f,resolve:w})}),[]),r=u.useCallback(()=>{var f;(f=t.resolve)==null||f.call(t,!0),n({isOpen:!1,options:{message:""},resolve:null})},[t.resolve]),s=u.useCallback(()=>{var f;(f=t.resolve)==null||f.call(t,!1),n({isOpen:!1,options:{message:""},resolve:null})},[t.resolve]),{title:i,message:l,confirmText:c,cancelText:d,variant:m}=t.options;return o.jsxs(sR.Provider,{value:{confirm:a},children:[e,o.jsx(jA,{open:t.isOpen,onOpenChange:f=>!f&&s(),children:o.jsxs(px,{children:[o.jsxs(hx,{children:[o.jsx(xx,{children:i||"Confirm"}),o.jsx(bx,{children:l})]}),o.jsxs(gx,{children:[o.jsx(vx,{onClick:s,children:d||"Cancel"}),o.jsx(CA,{onClick:r,className:E((m==="danger"||m==="warning")&&"tw:bg-red-600 tw:hover:bg-red-700"),children:c||"Confirm"})]})]})})]})}function yb(){const e=u.useContext(sR);if(!e)throw new Error("useConfirm must be used within a ConfirmProvider");return e}const lF="M 88.296875 179.015625 C 85.765625 179.015625 84.03125 178.503906 83.066406 177.472656 C 82.078125 176.445312 81.609375 174.664062 81.609375 172.15625 L 81.609375 30.761719 C 81.609375 27.222656 82.144531 24.628906 83.238281 22.957031 C 84.375 21.242188 86.710938 19.65625 90.269531 18.15625 C 94.726562 16.503906 100.386719 15.027344 107.246094 13.695312 C 114.148438 12.324219 122.789062 11.636719 133.140625 11.636719 C 149.304688 11.636719 161.179688 15.582031 168.726562 23.472656 C 176.273438 31.316406 180.046875 42.335938 180.046875 56.570312 L 180.046875 87.011719 C 180.046875 101.824219 175.949219 113.292969 167.785156 121.394531 C 159.660156 129.453125 147.226562 133.484375 130.484375 133.484375 C 125.894531 133.484375 121.652344 132.992188 117.707031 132.027344 C 113.761719 131.042969 110.332031 130.183594 107.417969 129.453125 L 107.417969 172.15625 C 107.417969 174.664062 106.859375 176.445312 105.789062 177.472656 C 104.761719 178.503906 102.980469 179.015625 100.472656 179.015625 Z M 128.683594 109.90625 C 137.429688 109.90625 143.859375 107.976562 147.976562 104.074219 C 152.136719 100.128906 154.234375 94.171875 154.234375 86.152344 L 154.234375 57.253906 C 154.234375 42.570312 146.023438 35.21875 129.625 35.21875 C 125.445312 35.21875 121.738281 35.453125 118.480469 35.90625 C 115.21875 36.375 112.175781 36.976562 109.390625 37.707031 C 108.0625 38.175781 107.417969 39.121094 107.417969 40.535156 L 107.417969 106.558594 C 109.925781 107.203125 113.011719 107.910156 116.679688 108.703125 C 120.386719 109.519531 124.394531 109.90625 128.683594 109.90625 Z M 128.683594 109.90625",cF="M 11.636719 50.707031 C 11.636719 44.0625 14.296875 42.816406 19.613281 46.933594 L 70.117188 88.265625 C 72.175781 89.914062 73.675781 91.308594 74.664062 92.464844 C 75.628906 93.664062 76.121094 95.464844 76.121094 97.867188 L 76.121094 104.984375 C 76.121094 107.492188 75.628906 109.273438 74.664062 110.300781 C 73.675781 111.328125 72.175781 112.660156 70.117188 114.332031 L 19.613281 155.832031 C 14.296875 160.292969 11.636719 159.027344 11.636719 152.058594 L 11.636719 140.742188 C 11.636719 136.5625 12.003906 133.753906 12.753906 132.335938 C 13.480469 130.964844 15.113281 129.25 17.640625 127.191406 L 50.308594 101.640625 L 50.308594 100.269531 L 17.640625 74.714844 C 14.941406 72.484375 13.269531 70.644531 12.582031 69.226562 C 11.9375 67.855469 11.636719 65.070312 11.636719 60.910156 Z M 11.636719 50.707031";function iR({className:e,decorative:t=!1}){return o.jsxs("svg",{viewBox:"0 0 192 192",className:E("tw:block tw:size-[26px] tw:shrink-0",e),role:t?void 0:"img","aria-label":t?void 0:"PaapiPlugin","aria-hidden":t?!0:void 0,focusable:"false",children:[o.jsx("path",{className:"tw:fill-sidebar-foreground",d:lF}),o.jsx("path",{className:"tw:fill-brand-primary",d:cF})]})}const Sb="psfa:connection-change";function uF(e){return e==="managed"||e==="creators"||e==="paapi"?e:null}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dF(){var t;const e=(t=typeof window>"u"?void 0:window.psfaAdmin)==null?void 0:t.activePath;return e==="managed"||e==="creators"||e==="paapi"?e:"none"}function fF(e){const t=typeof window>"u"?void 0:window.psfaAdmin;if(!t||!Tr(e))return null;Tr(t.settings)||(t.settings={});const n=t.settings,a=uF(e.active_path);a&&(n.useManagedApi=a==="managed",a!=="managed"&&(n.authType=a==="creators"?"oauth":"awssig4")),Array.isArray(e.categories)&&(t.categories=e.categories);const r=e.admin_state;if(Tr(r)){const{settings:s,...i}=r;if(Object.assign(t,i),Tr(s)){const{effectiveAppearance:l,...c}=s;if(Object.assign(n,c),Tr(l)){const d=Tr(n.effectiveAppearance)?n.effectiveAppearance:{};n.effectiveAppearance={...d,...l}}}}return window.dispatchEvent(new CustomEvent(Sb)),a}function jb(e){const t=typeof window>"u"?void 0:window.psfaAdmin;if(!t||!Tr(e))return e;if(Tr(e.setupChecklist)&&(t.setupChecklist=e.setupChecklist),Array.isArray(e.productBoxes)){const n=Tr(t.addonData)?t.addonData:{};t.addonData={...n,productBoxes:e.productBoxes}}return e}async function vo(e,t={}){const n=window.psfaAdmin;if(!n)return{success:!1,message:"PSFA admin config not found"};const a=new FormData;a.append("action",e),a.append("nonce",n.nonce);for(const[s,i]of Object.entries(t))a.append(s,i);let r;try{const s=await fetch(`${n.ajaxUrl}?action=${e}`,{method:"POST",body:a,credentials:"same-origin"});try{r=await s.json()}catch{return{success:!1,message:`HTTP ${s.status}`}}}catch(s){return{success:!1,message:s instanceof Error?s.message:"Network error"}}return!r||typeof r!="object"?{success:!1,message:"Unexpected response"}:(r.success&&fF(r.data),r)}const mF=["red","amber","info"],wF=["primary","secondary","link"];function lR(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Am(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function cR(e){return typeof e=="string"&&e.trim()!==""?e:null}function pF(e){if(!lR(e)||typeof e.label!="string"||e.label==="")return null;const t=wF.includes(e.kind)?e.kind:"secondary";return{label:e.label,kind:t,url:typeof e.url=="string"&&e.url!==""?e.url:null,newTab:e.newTab===!0,marksRead:e.marksRead===!0,note:cR(e.note)}}function Nb(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!lR(n)||typeof n.id!="string"||n.id===""||n.kind!=="fault"&&n.kind!=="courtesy"||typeof n.title!="string"||n.title==="")continue;const a=n.kind==="fault";t.push({id:n.id,kind:n.kind,tone:mF.includes(n.tone)?n.tone:a?"red":"info",priority:Am(n.priority,100),title:n.title,body:typeof n.body=="string"?n.body:"",lines:Array.isArray(n.lines)?n.lines.filter(r=>typeof r=="string"&&r!==""):[],actions:Array.isArray(n.actions)?n.actions.map(pF).filter(r=>r!==null):[],hint:cR(n.hint),createdAt:Am(n.createdAt,0),expiresAt:Am(n.expiresAt,null),read:a?!1:n.read===!0,modal:!a&&n.modal===!0,bannerHiddenUntil:a?Am(n.bannerHiddenUntil,null):null})}return t}function uR(e,t){return e.expiresAt===null||e.expiresAt>t}function dR(e,t){return e.priority-t.priority||t.createdAt-e.createdAt||e.id.localeCompare(t.id)}function cu(e,t){return e.filter(n=>n.kind==="fault"&&uR(n,t)).sort(dR)}function _m(e,t){return e.filter(n=>n.kind==="courtesy"&&uR(n,t)).sort(dR)}function hF(e,t){return cu(e,t).length+_m(e,t).filter(n=>!n.read).length}function gF(e){return e<=0?"":e>9?"9+":String(e)}function xF(e,t){return _m(e,t).some(n=>!n.read)}function bF(e,t){return cu(e,t).find(n=>n.bannerHiddenUntil===null||n.bannerHiddenUntil<=t)??null}function vF(e,t){return _m(e,t).filter(n=>n.modal&&!n.read)}function yF(){return window.psfaAdmin??{}}function SF(e){if(typeof e!="object"||e===null)return null;const t=e;if(t.success!==!0)return null;if(Array.isArray(t.data))return t.data;const n=t.data;return Array.isArray(n==null?void 0:n.items)?n.items:null}async function jF(e,t){var s;const n=yF(),a=String(((s=n.notifications)==null?void 0:s.nonce)??""),r=new URLSearchParams;r.set("action",e),r.set("nonce",a),r.set("_ajax_nonce",a),t!==void 0&&r.set("id",t);try{const i=await fetch(String(n.ajaxUrl??""),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},credentials:"same-origin",body:r}),l=SF(await i.json());return l===null?null:Nb(l)}catch{return null}}const NF=86400,fR=u.createContext(null);function uu(){return Math.floor(Date.now()/1e3)}function mR(){var t;const e=window.psfaAdmin;return Nb((t=e==null?void 0:e.notifications)==null?void 0:t.items)}function Cb(e,t,n){return e.map(a=>a.id===t?{...a,...n}:a)}function CF({children:e,wizardActive:t=!1}){const[n,a]=u.useState(mR),[r]=u.useState(()=>t?[]:vF(n,uu())),[s,i]=u.useState(0),[l,c]=u.useState(!1),d=u.useRef(null),m=u.useRef(0),f=u.useRef(!0);u.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),u.useEffect(()=>{const S=()=>{m.current+=1,a(mR())};return window.addEventListener(Sb,S),()=>window.removeEventListener(Sb,S)},[]);const w=u.useCallback((S,N,A)=>{a(A);const j=++m.current;jF(S,N).then(C=>{C&&f.current&&j===m.current&&a(C)})},[]),p=u.useCallback(S=>w("psfa_notification_read",S,N=>Cb(N,S,{read:!0,modal:!1})),[w]),x=u.useCallback(()=>w("psfa_notification_read_all",void 0,S=>S.map(N=>N.kind==="courtesy"?{...N,read:!0,modal:!1}:N)),[w]),b=u.useCallback(S=>w("psfa_notification_later",S,N=>Cb(N,S,{modal:!1})),[w]),y=u.useCallback(S=>w("psfa_notification_hide_banner",S,N=>Cb(N,S,{bannerHiddenUntil:uu()+NF})),[w]),h=u.useRef(0),g=u.useCallback(S=>{const N=r[h.current];N&&(h.current+=1,i(h.current),S==="read"?p(N.id):b(N.id))},[r,p,b]),v=u.useMemo(()=>({items:n,read:p,readAll:x,later:b,hideBanner:y,panelOpen:l,setPanelOpen:c,bellRef:d,queue:r,queueIndex:s,advanceQueue:g}),[n,p,x,b,y,l,r,s,g]);return o.jsx(fR.Provider,{value:v,children:e})}function du(){const e=u.useContext(fR);if(!e)throw new Error("useNotifications must be used inside NotificationsProvider");return e}const Ab="tw:size-9 tw:shrink-0 tw:rounded-lg tw:text-muted-foreground tw:shadow-none tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,color] tw:duration-150 tw:ease-psfa-out tw:hover:bg-accent tw:hover:text-foreground tw:data-[state=open]:bg-accent tw:data-[state=open]:text-foreground tw:active:scale-95 tw:motion-reduce:active:scale-100 tw:[&_svg]:size-[18px]",wR="tw:flex tw:min-h-[38px] tw:pointer-coarse:min-h-11 tw:w-full tw:items-center tw:gap-2.5 tw:rounded-[10px] tw:border tw:border-solid tw:border-sidebar-button-border tw:bg-sidebar-button tw:px-2.5 tw:text-left tw:text-sm tw:font-medium tw:text-sidebar-foreground tw:no-underline tw:shadow-psfa-xs tw:outline-none tw:touch-manipulation tw:select-none tw:transition-[transform,background-color] tw:duration-120 tw:ease-psfa-out tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring tw:data-[state=open]:bg-sidebar-accent",pR="tw:rounded-md tw:bg-foreground tw:px-2.5 tw:py-1 tw:text-[12.5px] tw:font-medium tw:text-background tw:shadow-psfa-pop";function _b({note:e,noteClassName:t,children:n}){return e?o.jsxs("span",{"data-testid":"action-group",className:"tw:inline-flex tw:min-w-0 tw:max-w-full tw:flex-wrap tw:items-center tw:gap-x-2 tw:gap-y-1 tw:max-[781px]:flex-col tw:max-[781px]:items-stretch tw:max-[781px]:gap-1.5",children:[n,o.jsx("span",{"data-testid":"action-note",className:E("tw:text-[13px] tw:leading-snug tw:[overflow-wrap:anywhere] tw:max-[781px]:text-center",t),children:e})]}):o.jsx(o.Fragment,{children:n})}const hR={"fault-marketplace":Sg,"fault-appearance":Ng,review:cf,"builtin-boxes":Zo,"builtin-tables":_g,"builtin-analytics":xc};function Eb(e){return hR[e.id]?hR[e.id]:e.id.startsWith("bfcm")?TP:e.kind==="fault"?Sc:vg}const AF=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function _F(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}function EF(e,t,n=_F()){const a=new Intl.RelativeTimeFormat(n,{numeric:"auto"}),r=Math.max(0,t-e);for(const[s,i]of AF)if(r>=i)return a.format(-Math.floor(r/i),s);return a.format(0,"second")}const Ka={title:"Notifications",bellLabel:e=>e>0?`Notifications (${e})`:"Notifications",markAllRead:"Mark all as read",empty:"Nothing new",unread:"Unread",later:"Later",close:"Close",dismiss:"Dismiss notice",position:(e,t)=>`${e} of ${t}`,andMore:e=>`and ${e} more`},gR="(max-width: 781px)",TF="(prefers-reduced-motion: reduce)";function xR(e){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(e).matches}function Tb(e){const t=u.useCallback(n=>{var r;if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const a=window.matchMedia(e);return(r=a.addEventListener)==null||r.call(a,"change",n),()=>{var s;return(s=a.removeEventListener)==null?void 0:s.call(a,"change",n)}},[e]);return u.useSyncExternalStore(t,()=>xR(e),()=>!1)}function RF(){return xR(TF)}const kF={red:"tw:bg-destructive-soft tw:text-destructive",amber:"tw:bg-warning-soft tw:text-warning",info:"tw:bg-info-soft tw:text-info"},MF={red:"tw:bg-destructive",amber:"tw:bg-warning",info:"tw:bg-primary"};function DF({item:e,action:t,phone:n,onDone:a}){const r=E("tw:inline-flex tw:items-center tw:gap-1 tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-xs tw:font-medium tw:text-link tw:no-underline tw:cursor-pointer","tw:transition-colors tw:duration-150 tw:hover:text-link/80 tw:hover:underline tw:underline-offset-4","tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2",n&&"tw:min-h-11"),s=o.jsxs(o.Fragment,{children:[t.label,o.jsx(bg,{className:"tw:size-3.5","aria-hidden":"true"})]});return t.url?o.jsx("a",{href:t.url,target:t.newTab?"_blank":void 0,rel:t.newTab?"noopener noreferrer":void 0,className:r,onClick:()=>a(t),"data-item":e.id,children:s}):o.jsx("button",{type:"button",className:r,onClick:()=>a(t),"data-item":e.id,children:s})}function bR({item:e,now:t,phone:n}){const{read:a,setPanelOpen:r}=du(),s=Eb(e),i=!e.read,l=c=>{e.kind==="courtesy"&&c.marksRead&&i&&a(e.id),c.url&&!c.newTab&&r(!1)};return o.jsxs("li",{"data-testid":`notification-row-${e.id}`,"data-unread":String(i),className:E("tw:m-0 tw:grid tw:grid-cols-[2rem_minmax(0,1fr)_0.5rem] tw:items-start tw:gap-3 tw:py-3",n?"tw:px-5":"tw:px-4","tw:[&+&]:border-t tw:[&+&]:border-border"),children:[o.jsx("span",{className:E("tw:grid tw:size-8 tw:place-items-center tw:rounded-md",kF[e.tone]),children:o.jsx(s,{className:"tw:size-4","aria-hidden":"true"})}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsxs("p",{className:E("tw:m-0 tw:text-sm tw:leading-snug tw:[overflow-wrap:anywhere]",i?"tw:font-semibold tw:text-foreground":"tw:font-normal tw:text-foreground"),children:[i?o.jsx("span",{className:"tw:sr-only",children:Ka.unread}):null,e.title]}),e.body?o.jsx("p",{className:E("tw:m-0 tw:mt-0.5 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",e.kind==="fault"?"tw:line-clamp-2":"tw:line-clamp-1"),title:e.body,children:e.body}):null,e.kind==="fault"?e.lines.map(c=>o.jsx("p",{className:"tw:m-0 tw:mt-0.5 tw:line-clamp-2 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",title:c,children:c},c)):null,o.jsxs("div",{className:"tw:mt-1.5 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-1 tw:text-xs",children:[e.createdAt>0?o.jsx("time",{dateTime:new Date(e.createdAt*1e3).toISOString(),className:"tw:whitespace-nowrap tw:text-muted-foreground tw:tabular-nums",children:EF(e.createdAt,t)}):null,e.actions.map(c=>o.jsx(_b,{note:c.note,noteClassName:"tw:text-xs tw:text-muted-foreground tw:max-[781px]:text-left",children:o.jsx(DF,{item:e,action:c,phone:n,onDone:l})},`${c.kind}-${c.label}`))]}),e.hint?o.jsx("p",{className:"tw:m-0 tw:mt-1 tw:text-xs tw:text-muted-foreground",children:e.hint}):null]}),o.jsx("span",{"aria-hidden":"true",className:E("tw:mt-1.5 tw:size-2 tw:rounded-full",i?MF[e.tone]:"tw:bg-transparent")})]})}function vR({phone:e,title:t,focusPanel:n}){const{items:a,readAll:r}=du(),s=uu(),i=cu(a,s),l=_m(a,s),c=i.length+l.length===0,d=xF(a,s);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:E("tw:flex tw:shrink-0 tw:items-center tw:justify-between tw:gap-3 tw:border-b tw:border-border",e?"tw:min-h-14 tw:py-1.5 tw:pl-5 tw:pr-14":"tw:py-2.5 tw:pl-4 tw:pr-3"),children:[t,c?null:o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:!d,onClick:()=>{r(),n()},className:E("tw:px-2 tw:text-[13px] tw:font-medium tw:text-link tw:hover:bg-accent tw:hover:text-link/80 tw:disabled:text-muted-foreground tw:disabled:opacity-100",e?"tw:h-11":"tw:h-7"),children:Ka.markAllRead})]}),c?o.jsxs("div",{className:"tw:grid tw:justify-items-center tw:gap-3 tw:px-4 tw:pt-10 tw:pb-11 tw:text-center",children:[o.jsx("span",{className:"tw:grid tw:size-10 tw:place-items-center tw:rounded-full tw:bg-secondary tw:text-muted-foreground",children:o.jsx(vg,{className:"tw:size-[18px]","aria-hidden":"true"})}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground",children:Ka.empty})]}):o.jsxs("div",{className:"tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain",children:[i.length?o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:i.map(m=>o.jsx(bR,{item:m,now:s,phone:e},m.id))}):null,i.length&&l.length?o.jsx(mm,{className:"tw:h-1.5 tw:border-y tw:border-border tw:bg-muted"}):null,l.length?o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:l.map(m=>o.jsx(bR,{item:m,now:s,phone:e},m.id))}):null]})]})}function OF(){const{items:e,panelOpen:t,setPanelOpen:n,bellRef:a}=du(),r=Tb(gR),s=u.useId(),i=u.useRef(null),l=hF(e,uu()),c=u.useRef(l),d=c.current!==l;u.useEffect(()=>{c.current=l},[l]);const m=()=>{var w;return(w=i.current)==null?void 0:w.focus({preventScroll:!0})},f=o.jsxs(Ne,{ref:a,type:"button",variant:"ghost",size:"icon","data-testid":"notification-bell","aria-label":Ka.bellLabel(l),className:E(Ab,"tw:relative",r&&"tw:size-11"),children:[o.jsx(vg,{className:"tw:size-[18px]","aria-hidden":"true"}),l>0?o.jsx("span",{"data-testid":"notification-badge","aria-hidden":"true",className:E("tw:absolute tw:top-[3px] tw:right-[3px] tw:grid tw:h-4 tw:min-w-4 tw:place-items-center tw:rounded-full tw:bg-primary tw:px-1 tw:text-[10.5px] tw:font-bold tw:leading-none tw:text-primary-foreground tw:tabular-nums",d&&"psfa-nx-badge-pop"),children:gF(l)},l):null]});return r?o.jsxs(Wc,{open:t,onOpenChange:n,children:[o.jsx(fB,{asChild:!0,children:f}),o.jsx(Ii,{ref:i,side:"bottom",tabIndex:-1,"aria-describedby":void 0,"data-testid":"notification-panel","data-variant":"sheet",onOpenAutoFocus:w=>{w.preventDefault(),m()},overlayClassName:"psfa-nx-overlay psfa-nx-overlay--panel tw:bg-scrim",closeClassName:"tw:top-1.5 tw:right-1.5 tw:grid tw:size-11 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-sheet psfa-nx-sheet--panel tw:flex tw:max-h-[86dvh] tw:flex-col tw:gap-0 tw:rounded-t-2xl tw:border-border tw:p-0 tw:pb-[env(safe-area-inset-bottom,0px)] tw:font-rubik tw:antialiased tw:shadow-[0_-10px_30px_-10px_rgb(0_0_0/0.2)] tw:transition-none tw:outline-none",children:o.jsx(vR,{phone:!0,focusPanel:m,title:o.jsx($i,{className:"tw:m-0 tw:text-sm tw:font-semibold tw:text-foreground",children:Ka.title})})})]}):o.jsxs(P$,{open:t,onOpenChange:n,children:[o.jsx(z$,{asChild:!0,children:f}),o.jsx(xE,{ref:i,align:"end",sideOffset:8,tabIndex:-1,"aria-labelledby":s,"data-testid":"notification-panel","data-variant":"popover",onOpenAutoFocus:w=>{w.preventDefault(),m()},className:"psfa-nx-popover tw:flex tw:w-96 tw:max-w-[calc(100vw-2rem)] tw:max-h-[min(480px,var(--radix-popover-content-available-height))] tw:flex-col tw:rounded-lg tw:border-border tw:bg-card tw:p-0 tw:font-rubik tw:antialiased tw:text-left tw:shadow-lg",children:o.jsx(vR,{phone:!1,focusPanel:m,title:o.jsx("h2",{id:s,className:"tw:m-0 tw:text-sm tw:font-semibold tw:leading-normal tw:text-foreground",children:Ka.title})})})]})}const PF=120,zF="tw:hover:bg-primary/90";function Rb({action:e,phone:t,onActivate:n,variant:a}){const r=E(a==="default"&&zF,a==="link"?"tw:h-auto tw:p-0 tw:font-medium tw:underline tw:underline-offset-4 tw:hover:text-link/80":"tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:[touch-action:manipulation]",a!=="link"&&t&&"tw:h-11 tw:w-full tw:whitespace-normal tw:text-[15px] tw:leading-tight");if(e.url){const s=i=>{i.button>1||n(e,!0)};return o.jsx(Ne,{asChild:!0,variant:a,className:r,children:o.jsx("a",{href:e.url,target:e.newTab?"_blank":void 0,rel:e.newTab?"noopener noreferrer":void 0,onClick:s,onAuxClick:s,className:E("tw:no-underline",a==="default"&&"tw:hover:text-primary-foreground tw:focus:text-primary-foreground"),children:e.label})})}return o.jsx(Ne,{type:"button",variant:a,className:r,onClick:()=>n(e,!1),children:e.label})}function LF({item:e,position:t,total:n,phone:a,phase:r,animateIn:s,onActivate:i,onLater:l,title:c,description:d}){const m=Eb(e),f=e.actions.filter(y=>y.kind!=="link"),w=e.actions.filter(y=>y.kind==="link"),p=e.lines.length>0?w:[],x=e.lines.length>0?[]:w,b=f.some(y=>y.kind==="primary");return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:E("tw:flex tw:min-h-8 tw:items-center tw:gap-2.5 tw:pr-10",a?"tw:mb-3 tw:min-h-11":"tw:mb-4"),children:n>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"tw:flex tw:gap-1","aria-hidden":"true",children:Array.from({length:n},(y,h)=>o.jsx("i",{className:E("tw:block tw:h-1 tw:w-4 tw:rounded-full tw:transition-colors tw:duration-200",h<t?"tw:bg-muted-foreground/50":h===t?"tw:bg-primary":"tw:bg-secondary")},h))}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:tabular-nums",children:Ka.position(t+1,n)})]}):null}),o.jsxs("div",{className:E(r==="leaving"?"psfa-nx-swap-out":s?"psfa-nx-swap-in":void 0),children:[o.jsx("div",{className:"tw:mb-4 tw:grid tw:size-10 tw:place-items-center tw:rounded-lg tw:bg-info-soft tw:text-info",children:o.jsx(m,{className:"tw:size-5","aria-hidden":"true"})}),c,d,o.jsxs("div",{className:E("tw:mt-6 tw:flex tw:flex-wrap tw:items-center tw:gap-2",a&&"tw:flex-col tw:items-stretch tw:gap-1"),children:[f.map(y=>o.jsx(_b,{note:y.note,noteClassName:"tw:text-muted-foreground",children:o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:y.kind==="primary"?"default":"outline"})},`${y.kind}-${y.label}`)),o.jsx(Ne,{type:"button",variant:a&&b?"ghost":"outline",onClick:l,className:E("tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:[touch-action:manipulation]",a&&"tw:h-11 tw:w-full tw:text-[15px]",a&&b&&"tw:text-foreground tw:hover:bg-accent"),children:Ka.later}),x.map(y=>o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:"link"},`${y.kind}-${y.label}`))]}),e.hint?o.jsx("p",{"data-testid":"notification-modal-hint",className:"tw:m-0 tw:mt-3 tw:text-[13px] tw:leading-snug tw:text-muted-foreground",children:e.hint}):null,e.lines.length>0?o.jsxs("div",{"data-testid":"notification-modal-footer",className:"tw:mt-6 tw:flex tw:flex-col tw:gap-4",children:[o.jsx(mm,{}),o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:leading-relaxed tw:text-muted-foreground",children:[e.lines.join(" "),p.map(y=>o.jsxs("span",{children:[" ",o.jsx(Rb,{action:y,phone:a,onActivate:i,variant:"link"})]},`${y.kind}-${y.label}`))]})]}):null]},e.id)]})}function IF(){const{queue:e,queueIndex:t,advanceQueue:n,bellRef:a}=du(),r=Tb(gR),[s,i]=u.useState(t),[l,c]=u.useState("idle"),d=u.useRef(!1),m=u.useRef(null),f=u.useRef([]);u.useEffect(()=>{const S=f.current;return()=>S.forEach(N=>window.clearTimeout(N))},[]),u.useEffect(()=>{var S;s>0&&s<e.length&&((S=m.current)==null||S.focus({preventScroll:!0}))},[s,e.length]);const w=e[s]??null,p=w!==null,x=S=>{if(d.current||!w)return;d.current=!0;const N=s+1;if(n(S),N>=e.length){i(N),d.current=!1;return}c("leaving"),f.current.push(window.setTimeout(()=>{c("idle"),i(N),d.current=!1},PF))},b=(S,N)=>{if(!(S.kind!=="primary"&&!S.marksRead)){if(N){f.current.push(window.setTimeout(()=>x("read"),0));return}x("read")}};if(e.length===0)return null;const y={ref:m,tabIndex:-1,"data-testid":"notification-modal",onOpenAutoFocus:S=>{var N;S.preventDefault(),(N=m.current)==null||N.focus({preventScroll:!0})},onCloseAutoFocus:S=>{var N;S.preventDefault(),(N=a.current)==null||N.focus({preventScroll:!0})},onEscapeKeyDown:S=>{S.preventDefault(),x("later")},onInteractOutside:S=>S.preventDefault()},h=S=>{S||x("read")},g=w??e[e.length-1];if(!g)return null;const v=(S,N)=>o.jsx(LF,{item:g,position:Math.min(s,e.length-1),total:e.length,phone:r,phase:l,animateIn:s>0,onActivate:b,onLater:()=>x("later"),title:o.jsx(S,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:leading-snug tw:tracking-[-0.01em] tw:text-foreground tw:[text-wrap:balance] tw:[overflow-wrap:anywhere]",children:g.title}),description:o.jsx(N,{className:"tw:m-0 tw:mt-2 tw:text-sm tw:leading-relaxed tw:text-muted-foreground tw:[text-wrap:pretty] tw:[overflow-wrap:anywhere]",children:g.body})});return r?o.jsx(Wc,{open:p,onOpenChange:h,children:o.jsx(Ii,{...y,side:"bottom","data-variant":"sheet",overlayClassName:"psfa-nx-overlay psfa-nx-overlay--queue tw:bg-scrim",closeClassName:"tw:top-3.5 tw:right-3 tw:grid tw:size-11 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-sheet psfa-nx-sheet--queue tw:block tw:max-h-[86dvh] tw:overflow-y-auto tw:overscroll-contain tw:rounded-t-2xl tw:border-border tw:p-5 tw:pb-[calc(1.25rem+env(safe-area-inset-bottom,0px))] tw:font-rubik tw:antialiased tw:shadow-xl tw:transition-none tw:outline-none",children:v($i,Zc)})}):o.jsx(Qf,{open:p,onOpenChange:h,children:o.jsx(Jf,{...y,"data-variant":"dialog",overlayClassName:"psfa-nx-overlay psfa-nx-overlay--queue",closeClassName:"tw:top-5 tw:right-4 tw:grid tw:size-8 tw:place-items-center tw:rounded-md tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground",className:"psfa-nx-dialog tw:top-[14%] tw:block tw:w-[calc(100%-2rem)] tw:max-w-md tw:translate-y-0 tw:max-h-[calc(86%-1rem)] tw:overflow-y-auto tw:overscroll-contain tw:font-rubik tw:antialiased tw:outline-none",children:v(Hc,a_)})})}const $F=240,BF={red:"destructive",amber:"warning",info:"info"},UF="tw:max-[781px]:h-11 tw:max-[781px]:w-full tw:max-[781px]:whitespace-normal tw:max-[781px]:leading-tight";function HF({action:e}){const t=e.kind==="primary"?"default":e.kind==="secondary"?"outline":"link",n=E(t==="default"&&"tw:hover:bg-primary/90",t==="link"?"tw:h-auto tw:px-0 tw:font-medium tw:text-current tw:underline tw:max-[781px]:min-h-11":E("tw:gap-1.5 tw:transition-[color,background-color,border-color,transform] tw:duration-150 tw:active:scale-[0.97] tw:motion-reduce:active:scale-100",UF)),a=o.jsxs(o.Fragment,{children:[e.label,e.url&&!e.newTab&&t!=="link"?o.jsx(bg,{"aria-hidden":"true"}):null]});return e.url?o.jsx(Ne,{asChild:!0,size:"sm",variant:t,className:n,children:o.jsx("a",{href:e.url,target:e.newTab?"_blank":void 0,rel:e.newTab?"noopener noreferrer":void 0,className:E("tw:no-underline",t==="default"&&"tw:hover:text-primary-foreground tw:focus:text-primary-foreground"),children:a})}):o.jsx(Ne,{type:"button",size:"sm",variant:t,className:n,children:a})}function FF(){const{items:e,hideBanner:t,setPanelOpen:n,bellRef:a}=du(),[r,s]=u.useState(null),[i,l]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),m=u.useRef(void 0),f=uu(),w=bF(e,f),p=r??w,x=cu(e,f);if(u.useEffect(()=>()=>window.clearTimeout(m.current),[]),u.useEffect(()=>{var g;!d.current||r||(d.current=!1,(g=c.current??a.current)==null||g.focus({preventScroll:!0}))},[r,w,a]),!p)return null;const b=x.filter(g=>g.id!==p.id).length,y=Eb(p),h=()=>{r||(d.current=!0,t(p.id),!RF()&&(s(p),l(!0),m.current=window.setTimeout(()=>s(null),$F)))};return o.jsx("div",{className:E("psfa-nx-banner",r?"psfa-nx-banner--gone":i&&"psfa-nx-banner-in"),"aria-hidden":r?!0:void 0,children:o.jsx("div",{className:"tw:min-h-0 tw:overflow-hidden",children:o.jsxs(ln,{variant:BF[p.tone],"data-testid":"fault-banner","data-tone":p.tone,className:"tw:mb-6 tw:pr-12 tw:leading-normal tw:max-[781px]:pr-14",children:[o.jsx(y,{className:"tw:size-4","aria-hidden":"true"}),o.jsx(Va,{className:"tw:leading-snug tw:[overflow-wrap:anywhere]",children:p.title}),o.jsxs(Gn,{className:"tw:[overflow-wrap:anywhere]",children:[p.body?o.jsx("p",{className:"tw:m-0",children:p.body}):null,p.lines.map(g=>o.jsx("p",{className:"tw:m-0 tw:mt-1",children:g},g)),p.actions.length>0||b>0?o.jsxs("div",{className:"tw:mt-3 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2 tw:max-[781px]:flex-col tw:max-[781px]:items-stretch",children:[p.actions.map(g=>o.jsx(_b,{note:g.note,children:o.jsx(HF,{action:g})},`${g.kind}-${g.label}`)),b>0?o.jsx(Ne,{type:"button",variant:"link",size:"sm",onClick:()=>n(!0),className:"tw:h-auto tw:px-0 tw:font-medium tw:text-current tw:underline tw:underline-offset-4 tw:max-[781px]:min-h-11",children:Ka.andMore(b)}):null]}):null,p.hint?o.jsx("p",{"data-testid":"fault-banner-hint",className:"tw:m-0 tw:mt-2.5 tw:text-[13px]",children:p.hint}):null]}),o.jsx("div",{className:"tw:pointer-events-none tw:absolute tw:top-2.5 tw:right-2.5 tw:flex tw:justify-end tw:max-[781px]:top-1.5 tw:max-[781px]:right-1.5",children:o.jsx("button",{ref:c,type:"button",onClick:h,"aria-label":Ka.dismiss,className:"tw:pointer-events-auto tw:grid tw:size-7 tw:cursor-pointer tw:place-items-center tw:rounded-md tw:border-0 tw:bg-transparent tw:p-0 tw:text-current tw:opacity-75 tw:transition-[opacity,background-color] tw:duration-150 tw:hover:bg-foreground/5 tw:hover:opacity-100 tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:max-[781px]:size-11",children:o.jsx(Eg,{className:"tw:size-4","aria-hidden":"true"})})})]})})},p.id)}async function kb(e,t={},n=!1){const a=window.psfaAdmin,r=window.psfaAjax;if(n&&!a)return{success:!1,message:"PSFA admin config not found"};if(!n&&!r)return{success:!1,message:"PSFA ajax config not found"};const s=n?a.ajaxUrl:r.ajaxurl,i=n?a.nonce:r.nonce,l=new FormData;l.append("action",e),l.append("nonce",i),Object.entries(t).forEach(([c,d])=>{d!=null&&l.append(c,String(d))});try{const c=await fetch(s,{method:"POST",body:l,credentials:"same-origin"});return c.ok?await c.json():{success:!1,message:`HTTP error: ${c.status}`}}catch(c){return{success:!1,message:c instanceof Error?c.message:"Unknown error"}}}const VF=["system","light","dark"],yR="psfa-theme-";function SR(e){return typeof e=="string"&&VF.includes(e)}function jR(e){const t=e&&typeof e=="object"?e:{},n=t.sidebarCollapsed;return{theme:SR(t.theme)?t.theme:"system",sidebarCollapsed:n===!0||n==="1"||n===1}}function GF(e,t=document.body){for(const n of Array.from(t.classList))n.startsWith(yR)&&t.classList.remove(n);t.classList.add(yR+e)}async function YF(e){var n;const t=await kb("psfa_save_admin_prefs",{theme:e.theme,sidebar_collapsed:e.sidebarCollapsed?"1":"0"},!0);if(!t||t.success!==!0)throw new Error((t==null?void 0:t.message)||"psfa_save_admin_prefs failed");return jR(((n=t.data)==null?void 0:n.adminPrefs)??e)}const NR=u.createContext(null);function yo(){return u.useContext(NR)}const KF="(max-width: 781px)",CR="psfa-phone-nav-trigger",Mb=[{value:"system",label:"System",icon:GP},{value:"light",label:"Light",icon:XP},{value:"dark",label:"Dark",icon:YP}];function qF(){const e=yo();if(!e)return null;const t=Mb.find(a=>a.value===e.theme)??Mb[0],n=t.icon;return o.jsxs(Yx,{children:[o.jsx(Kx,{asChild:!0,children:o.jsx(Ne,{type:"button",variant:"ghost",size:"icon","aria-label":`Theme: ${t.label}`,title:`Theme: ${t.label}`,className:E(Ab,e.isPhone&&"tw:size-11"),children:o.jsx(n,{"aria-hidden":"true"})})}),o.jsx(om,{align:"end",sideOffset:6,className:"psfa-menu tw:min-w-44",children:o.jsx(i$,{value:e.theme,onValueChange:a=>{SR(a)&&e.setTheme(a)},children:Mb.map(({value:a,label:r,icon:s})=>o.jsxs(rE,{value:a,className:"psfa-menu-item tw:gap-2.5 tw:pl-2.5 tw:[&>span:first-child]:hidden",children:[o.jsx(s,{"aria-hidden":"true",className:"tw:size-4 tw:text-muted-foreground"}),o.jsx("span",{className:E("tw:flex-1",e.theme===a&&"tw:font-semibold"),children:r}),e.theme===a?o.jsx(yr,{"aria-hidden":"true",className:"tw:size-4 tw:text-foreground"}):null]},a))})})]})}function AR(){return o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5","data-testid":"psfa-header-tools",children:[o.jsx(qF,{}),o.jsx(OF,{})]})}const cs={account:"https://paapiplugin.com/account/",upgrade:"https://paapiplugin.com/pricing/",affiliates:"https://paapiplugin.com/affiliates/",support:"https://paapiplugin.com/support/",docs:"https://paapiplugin.com/documentation/",review:"https://wordpress.org/support/plugin/paapi-product-search-for-amazon/reviews/"},_R="psfa-menu-item tw:min-h-9 tw:gap-2.5 tw:px-2.5 tw:text-foreground tw:no-underline tw:cursor-pointer tw:max-[782px]:min-h-11";function Em({href:e,icon:t,label:n}){return o.jsx(Pi,{asChild:!0,className:_R,children:o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer","data-label":n,children:[o.jsx(t,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:flex-1",children:n}),o.jsx(pN,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})})}function XF({collapsed:e,phone:t=!1}){const n=yo(),a=u.useRef(null),r=o.jsx(Kx,{asChild:!0,children:o.jsxs("button",{ref:a,type:"button","aria-label":e?"Help":void 0,className:E(wR,"tw:group/help",e&&"tw:w-11 tw:justify-center tw:px-0",t&&"tw:min-h-11"),children:[o.jsx(DP,{"aria-hidden":"true",className:"tw:size-[18px] tw:shrink-0 tw:text-sidebar-muted"}),e?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"psfa-sb-reveal tw:flex-1",children:"Help"}),o.jsx(mN,{"aria-hidden":"true",className:"tw:size-4 tw:text-sidebar-muted tw:group-data-[state=open]/help:hidden"}),o.jsx(bc,{"aria-hidden":"true",className:"tw:hidden tw:size-4 tw:text-sidebar-muted tw:group-data-[state=open]/help:block"})]})]})});return o.jsxs(Yx,{modal:!1,children:[e?o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:r}),o.jsx(Hi,{side:"right",sideOffset:10,className:pR,children:"Help"})]}):r,o.jsxs(om,{side:e?"right":"top",align:e?"end":"start",sideOffset:8,className:"psfa-menu tw:w-56",children:[o.jsx(Em,{href:cs.support,icon:HP,label:"Support"}),o.jsx(Em,{href:cs.docs,icon:RP,label:"Docs"}),o.jsxs(Pi,{className:_R,"data-label":"What's new",onSelect:()=>n==null?void 0:n.openWhatsNew(a.current),children:[o.jsx(Ag,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),o.jsx("span",{className:"tw:flex-1",children:"What's new"})]}),o.jsx(Em,{href:cs.affiliates,icon:QP,label:"Affiliates"}),o.jsx(qx,{className:"tw:bg-border"}),o.jsx(Em,{href:cs.review,icon:cf,label:"Leave a review"})]})]})}function WF({to:e}){const t=jn();return o.jsx(rN,{to:{pathname:e,search:t.search},replace:!0})}function Nt(){return typeof window>"u"?{}:window.psfaAdmin??{}}function ZF(){const{needsLicense:e,fsAffix:t}=Nt();return!e||!t?null:o.jsxs("div",{role:"status",className:"tw:mb-5 tw:flex tw:flex-wrap tw:items-center tw:gap-3 tw:rounded-[10px] tw:border tw:border-solid tw:border-ring tw:bg-info-soft tw:px-4 tw:py-3.5 tw:text-foreground",children:[o.jsx($P,{"aria-hidden":"true",className:"tw:size-[18px] tw:shrink-0 tw:text-info"}),o.jsx("div",{className:"tw:min-w-0 tw:flex-1",children:o.jsx("p",{className:"tw:m-0 tw:text-sm tw:font-medium tw:text-foreground",children:"Premium version detected! Please activate your license to unlock all features."})}),o.jsx("a",{href:"#",className:E(`activate-license-trigger ${t}`,gf({variant:"default"}),"tw:shrink-0 tw:rounded-[10px] tw:no-underline tw:hover:bg-primary-hover tw:hover:text-primary-foreground tw:max-[640px]:w-full"),children:"Activate License"})]})}function QF({title:e}){const t=yo();return t?o.jsxs("div",{"data-testid":"psfa-mobile-bar",className:"tw:sticky tw:top-0 tw:z-20 tw:flex tw:min-h-[52px] tw:items-center tw:gap-2 tw:border-b tw:border-solid tw:border-border tw:bg-card tw:pr-[max(8px,env(safe-area-inset-right,0px))] tw:pl-[max(8px,env(safe-area-inset-left,0px))] tw:min-[601px]:top-[var(--wp-admin--admin-bar--height,46px)]",children:[o.jsxs(Ne,{id:CR,type:"button",variant:"outline","aria-expanded":t.sheetOpen,"aria-controls":"psfa-phone-nav",onClick:()=>t.setSheetOpen(!0),className:"tw:h-11 tw:gap-2 tw:rounded-lg tw:pr-3 tw:pl-2 tw:text-sm tw:font-medium tw:touch-manipulation tw:select-none tw:active:scale-[0.97] tw:motion-reduce:active:scale-100",children:[o.jsx(iR,{decorative:!0,className:"tw:size-[22px]"}),"Menu"]}),o.jsx("span",{"aria-hidden":"true",className:"tw:min-w-0 tw:flex-1 tw:truncate tw:text-sm tw:font-semibold tw:text-foreground",children:e}),o.jsx(AR,{})]}):null}function fu({title:e,description:t,actions:n}){const a=yo(),r=!!a&&!a.isPhone;return o.jsxs("header",{"data-testid":"admin-page-header",className:"tw:mb-7 tw:flex tw:items-end tw:justify-between tw:gap-4 tw:max-[782px]:mb-5 tw:max-[782px]:flex-col tw:max-[782px]:items-stretch tw:max-[782px]:gap-3",children:[o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("h1",{tabIndex:-1,"data-page-title":"true",className:"tw:m-0 tw:p-0 tw:text-[26px] tw:font-semibold tw:leading-[1.2] tw:tracking-[-0.012em] tw:text-balance tw:text-foreground tw:outline-none",children:e}),t?o.jsx("p",{className:"tw:m-0 tw:mt-1.5 tw:max-w-[64ch] tw:text-sm tw:leading-normal tw:text-muted-foreground",children:t}):null]}),r||n?o.jsxs("div",{className:"tw:flex tw:shrink-0 tw:items-center tw:gap-1.5",children:[r?o.jsx(AR,{}):null,n]}):null]})}function JF({label:e,tabs:t}){const{pathname:n}=jn();return o.jsx("nav",{"aria-label":e,className:"tw:mb-6 tw:inline-flex tw:gap-1 tw:rounded-[10px] tw:bg-secondary tw:p-1",children:t.map(a=>{const r=n.replace(/\/+$/,"")===a.to;return o.jsx(Bn,{to:a.to,"aria-current":r?"page":void 0,className:E("tw:inline-flex tw:h-8 tw:items-center tw:rounded-lg tw:px-3.5 tw:text-sm tw:font-medium tw:no-underline tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:max-[782px]:h-10",r?"tw:bg-card tw:text-foreground tw:shadow-psfa-xs":"tw:text-muted-foreground tw:hover:text-foreground"),children:a.label},a.to)})})}const se={home:"/",boxes:"/boxes",boxNew:"/boxes/new",tables:"/tables",lists:"/lists",search:"/search",searchSettings:"/search/settings",appearance:"/appearance",analytics:"/analytics",connection:"/settings/connection",geotargeting:"/settings/geotargeting",cache:"/settings/cache",importExport:"/settings/import-export"},ER={credentials:se.connection,geotargeting:se.geotargeting,lists:se.lists,features:se.home,appearance:se.appearance,themes:se.appearance,layout:se.searchSettings,customization:se.appearance,shortcode:se.search,"api-offers-test":se.home,"api-oauth-test":se.home,cache:se.cache,"comparison-tables":se.tables,"product-boxes":se.boxes,analytics:se.analytics},eV={"/credentials":se.connection,"/geotargeting":se.geotargeting,"/features":se.home,"/layout":se.searchSettings,"/appearance/layout":se.searchSettings,"/shortcode":se.search,"/cache":se.cache,"/addon-comparison-tables":se.tables,"/addon-product-boxes":se.boxes,"/addon-analytics":se.analytics,"/api-offers":se.home,"/api-oauth":se.home,"/settings":se.connection};function tV(e,t){if(t&&t!=="#"&&t!=="#/")return null;const n=new URLSearchParams(e).get("section");return!n||!Object.prototype.hasOwnProperty.call(ER,n)?null:"#"+ER[n]}const TR="whats-new",RR={label:"Search pages",tabs:[{to:se.search,label:"Shortcode"},{to:se.searchSettings,label:"Settings"}]},nV={[se.tables]:{title:"Comparison tables",description:"Create product comparison tables."},[se.lists]:{title:"Lists",description:"Build top seller and new release lists that refresh themselves."},[se.search]:{title:"Search",description:"Generate shortcodes for your pages.",tabs:RR},[se.searchSettings]:{title:"Search",description:"Settings for every search on your site.",tabs:RR},[se.appearance]:{title:"Appearance",description:"Configure colors, style, fonts, dark mode and deal badges."},[se.analytics]:{title:"Analytics",description:"Track visitor interactions and view insights."},[se.connection]:{title:"Amazon connection",description:"How the plugin gets product data from Amazon."},[se.geotargeting]:{title:"Geotargeting",description:"Send each visitor to their own Amazon store, with your tag for it."},[se.cache]:{title:"Cache",description:"View and manage cached API responses."},[se.importExport]:{title:"Import and export",description:"Copy your settings from one site to another."}};function aV(e){const t=e.length>1?e.replace(/\/+$/,""):e;return nV[t]??null}function rV(e){const t=e.length>1?e.replace(/\/+$/,""):e;return t===se.boxes||t.startsWith(se.boxes+"/")?se.boxes:t===se.searchSettings?se.search:t}function oV(e){const t=!e,n={to:se.boxes,label:"Product boxes",icon:Zo,locked:!1},a={to:se.tables,label:"Comparison tables",icon:_g,locked:!1},r={to:se.search,label:"Search",icon:yc,locked:!1},s={to:se.lists,label:"Lists",icon:xN,locked:t},i={to:se.connection,label:"Amazon connection",icon:yN,locked:!1},l={to:se.appearance,label:"Appearance",icon:Ng,locked:!1},c={to:se.cache,label:"Cache",icon:yg,locked:!1},d={to:se.geotargeting,label:"Geotargeting",icon:Sg,locked:t},m={to:se.importExport,label:"Import and export",icon:jP,locked:t},f={to:se.analytics,label:"Analytics",icon:xc,locked:t};return[{id:"home",items:[{to:se.home,label:"Home",icon:IP,locked:!1}]},{id:"create",label:"Create",items:t?[n,a,r,s]:[n,a,s,r]},{id:"settings",label:"Settings",items:t?[i,l,c,d,m]:[i,l,d,c,m]},{id:"insights",label:"Insights",items:[f]}]}function sV(){const e=typeof navigator<"u"?navigator.platform||navigator.userAgent:"";return/Mac|iPhone|iPad/i.test(e)?"⌘ B":"Ctrl B"}function Tm({show:e,label:t,kbd:n,children:a}){return e?o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:a}),o.jsxs(Hi,{side:"right",sideOffset:10,className:pR,children:[t,n?o.jsx("kbd",{className:"tw:ml-1.5 tw:bg-transparent tw:font-mono tw:text-[11px] tw:opacity-75",children:n}):null]})]}):o.jsx(o.Fragment,{children:a})}function iV(){return o.jsx(Ar,{variant:"outline",className:"psfa-sb-reveal tw:h-[18px] tw:shrink-0 tw:rounded-full tw:border-0 tw:bg-pro-soft tw:px-1.5 tw:py-0 tw:text-[10.5px] tw:font-semibold tw:leading-none tw:tracking-[0.04em] tw:text-pro tw:shadow-none",children:"PRO"})}function lV({item:e,active:t,collapsed:n,phone:a,onNavigate:r}){const s=e.icon,i=n?e.label+(e.locked?", Premium":""):void 0;return o.jsx(Tm,{show:n,label:e.locked?`${e.label} (PRO)`:e.label,children:o.jsxs(Bn,{to:e.to,"data-label":e.label,"aria-current":t?"page":void 0,"aria-label":i,onClick:r,className:E("tw:relative tw:flex tw:min-h-[38px] tw:pointer-coarse:min-h-11 tw:items-center tw:gap-2.5 tw:rounded-lg tw:px-2 tw:text-sm tw:font-normal tw:text-sidebar-foreground tw:no-underline tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",t?"tw:bg-sidebar-primary tw:font-semibold tw:text-sidebar-primary-foreground tw:shadow-psfa-card":"tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground",n&&"tw:mx-auto tw:w-11 tw:justify-center tw:px-0",a&&"tw:min-h-11"),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:size-[18px] tw:shrink-0",t?"tw:text-sidebar-icon-active":"tw:text-sidebar-muted")}),n?null:o.jsx("span",{className:"psfa-sb-reveal tw:min-w-0 tw:flex-1 tw:truncate",children:e.label}),e.locked&&!n?o.jsx(iV,{}):null,e.locked&&n?o.jsx("span",{"aria-hidden":"true",className:"tw:absolute tw:top-[7px] tw:right-2 tw:size-1.5 tw:rounded-full tw:bg-sidebar-icon-active"}):null]})})}function cV({collapsed:e,isPremium:t,phone:n}){const a=t?"Account":"Upgrade",r=t?cs.account:Nt().upgradeUrl||cs.upgrade,s=t?ZP:Ag;return o.jsx(Tm,{show:e,label:a,children:o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":e?`${a} (opens in a new tab)`:void 0,className:E(wR,e&&"tw:w-11 tw:justify-center tw:px-0",n&&"tw:min-h-11"),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:size-[18px] tw:shrink-0",t?"tw:text-sidebar-muted":"tw:text-sidebar-icon-active")}),e?null:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"psfa-sb-reveal tw:flex-1",children:a}),o.jsx(_P,{"aria-hidden":"true",className:"tw:size-3.5 tw:text-sidebar-muted"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})]})})}function kR({collapsed:e,phone:t,onNavigate:n}){const a=yo(),r=jn(),s=!!(a!=null&&a.isPremium),i=rV(r.pathname),l=e?"Expand sidebar":"Collapse sidebar";return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:E("tw:flex tw:h-14 tw:shrink-0 tw:items-center tw:justify-between tw:gap-2 tw:pr-2.5 tw:pl-4",e&&"tw:h-auto tw:flex-col tw:justify-center tw:px-0 tw:pt-3 tw:pb-2.5"),children:[o.jsx(Tm,{show:e,label:"Home",children:o.jsx(Bn,{to:"/","aria-label":"PaapiPlugin home",onClick:n,className:E("tw:flex tw:items-center tw:rounded-md tw:outline-none tw:pointer-coarse:min-h-11 tw:focus-visible:ring-2 tw:focus-visible:ring-sidebar-ring",t&&"tw:min-h-11"),children:o.jsx(iR,{decorative:!0})})}),t?null:o.jsx(Tm,{show:!0,label:l,kbd:sV(),children:o.jsx(Ne,{type:"button",variant:"ghost",size:"icon","aria-label":l,"aria-controls":"psfa-sidebar","aria-expanded":!e,onClick:()=>a==null?void 0:a.toggleCollapsed(!1),className:E(Ab,"tw:text-sidebar-muted tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground"),children:o.jsx(bN,{"aria-hidden":"true"})})})]}),o.jsx("nav",{"aria-label":"PaapiPlugin pages",className:"psfa-scroll tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:px-2 tw:py-2.5",children:oV(s).map(c=>{const d=c.label?`psfa-nav-group-${c.id}${t?"-sheet":""}`:void 0;return o.jsxs("div",{"data-testid":`nav-group-${c.id}`,className:E(c.id!=="home"&&"tw:mt-3.5",c.id!=="home"&&e&&"tw:mt-2 tw:border-t tw:border-solid tw:border-sidebar-border tw:pt-2"),children:[c.label&&!e?o.jsx("span",{id:d,className:"psfa-sb-reveal tw:block tw:px-2.5 tw:pb-1 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-sidebar-muted",children:c.label}):null,o.jsx("ul",{"aria-labelledby":c.label&&!e?d:void 0,className:"tw:m-0 tw:flex tw:list-none tw:flex-col tw:gap-0.5 tw:p-0",children:c.items.map(m=>o.jsx("li",{className:"tw:m-0",children:o.jsx(lV,{item:m,active:i===m.to,collapsed:e,phone:t,onNavigate:n})},m.to))})]},c.id)})}),o.jsxs("div",{className:E("tw:flex tw:shrink-0 tw:flex-col tw:gap-1.5 tw:px-2 tw:pt-2.5 tw:pb-3",e&&"tw:items-center"),children:[o.jsx(cV,{collapsed:e,isPremium:s,phone:t}),o.jsx(XF,{collapsed:e,phone:t})]})]})}function uV(){const e=yo(),t=!!(e!=null&&e.collapsed);return o.jsx(Ui,{delayDuration:380,skipDelayDuration:500,children:o.jsx("aside",{id:"psfa-sidebar","data-testid":"psfa-sidebar","aria-label":"PaapiPlugin","data-collapsed":t?"true":"false","data-expanding":e!=null&&e.expanding?"true":void 0,className:E("tw:sticky tw:top-[var(--wp-admin--admin-bar--height,32px)] tw:flex tw:h-[calc(100dvh-var(--wp-admin--admin-bar--height,32px))] tw:shrink-0 tw:flex-col tw:border-r tw:border-solid tw:border-sidebar-border tw:bg-sidebar tw:text-sidebar-foreground",t?"tw:w-[60px]":"tw:w-[244px]"),children:o.jsx(kR,{collapsed:t,phone:!1})})})}function dV(){const e=yo(),t=u.useRef(!1);if(!e)return null;const n=()=>{t.current=!0,e.setSheetOpen(!1)},a=r=>{var s,i;if(r.preventDefault(),t.current){t.current=!1,(s=document.querySelector("[data-page-title]"))==null||s.focus({preventScroll:!0});return}(i=document.getElementById(CR))==null||i.focus()};return o.jsx(Wc,{open:e.sheetOpen,onOpenChange:e.setSheetOpen,children:o.jsxs(Ii,{id:"psfa-phone-nav",side:"left","data-psfa-sheet":"nav",onCloseAutoFocus:a,overlayClassName:"tw:z-[100000]",closeClassName:"tw:top-1.5 tw:right-1.5 tw:grid tw:size-11 tw:place-items-center tw:rounded-lg tw:text-sidebar-muted tw:opacity-100 tw:hover:bg-sidebar-accent tw:hover:text-sidebar-foreground tw:focus:ring-sidebar-ring tw:focus:ring-offset-0",className:"tw:z-[100000] tw:flex tw:w-[min(300px,86vw)] tw:flex-col tw:gap-0 tw:border-sidebar-border tw:bg-sidebar tw:p-0 tw:pt-[env(safe-area-inset-top,0px)] tw:pb-[env(safe-area-inset-bottom,0px)] tw:pl-[env(safe-area-inset-left,0px)] tw:font-rubik tw:text-sidebar-foreground tw:antialiased tw:ease-psfa-drawer tw:data-[state=open]:duration-[240ms] tw:data-[state=closed]:duration-200 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:fade-out-0 tw:sm:max-w-none",children:[o.jsx($i,{className:"tw:sr-only",children:"PaapiPlugin menu"}),o.jsx(Zc,{className:"tw:sr-only",children:"Pages, account and help."}),o.jsx(kR,{collapsed:!1,phone:!0,onNavigate:n})]})})}const fV="Couldn't save that setting, so it lasts until you reload the page. Try again in a moment.";function mV(){const[e,t]=u.useState(()=>jR(Nt().adminPrefs)),n=u.useRef(e);u.useLayoutEffect(()=>{GF(e.theme)},[e.theme]);const a=u.useCallback(l=>{n.current=l,t(l);const c=window.psfaAdmin;c&&(c.adminPrefs=l),YF(l).catch(()=>{_e.error(fV)})},[]),r=u.useCallback(l=>{l!==n.current.theme&&a({...n.current,theme:l})},[a]),s=u.useCallback(l=>{l!==n.current.sidebarCollapsed&&a({...n.current,sidebarCollapsed:l})},[a]),i=u.useCallback(()=>{s(!n.current.sidebarCollapsed)},[s]);return{...e,setTheme:r,setSidebarCollapsed:s,toggleSidebar:i,latest:n}}const wV=[{version:"2.43.0",entries:[{title:"Color and size for the buy button",body:"With Premium, Buy Button in Appearance sets a color for the buy button and a size from 80% to 150%. Leave the color empty to keep following your Accent Color. It applies to search results, lists, every product box style and comparison tables."}]},{version:"2.42.0",entries:[{title:"Copy your settings to another site",body:"With Premium, export your Appearance, Search display and Geotargeting settings from one site and import them on the next, from Import and export under Settings."}]},{version:"2.41.0",entries:[{title:"Color and size for product text",body:"With Premium, Product Text in Appearance sets the color and size of titles, brands, prices and deal badges in boxes, tables, lists and search results."},{title:"Prices in your accent color",body:"Prices on every box, card, list and table now use your accent's price color by default. A Product Text color still takes priority."},{title:"Your secret keys are stored encrypted",body:"Your own Amazon API secret keys are now stored encrypted and are no longer sent to the browser."}]},{version:"2.40.0",entries:[{title:"Button text color",body:"With Premium, pick Auto, White or Dark for the text on buttons and badges in Appearance."}]},{version:"2.38.0",entries:[{title:"A new admin, organized by what you do",body:"Home, Create and Settings replace the old menu groups. Old links still land on the right page."},{title:"Build a product box with a live preview",body:"Search Amazon or paste a link, see the box as your site shows it, then copy the shortcode."},{title:"Dark mode for these screens",body:"Pick System, Light or Dark from the header. WordPress keeps its own colors."},{title:"Clicks and views from boxes and tables",body:"With Premium, Analytics now counts clicks and views on your product boxes and comparison tables. Your box list shows each box's clicks for the last 7 days."},{title:"Give a box your own title",body:"Type a title when you build a box and it shows instead of Amazon's."}]}];function pV(){const e=yo();return e?o.jsx(Wc,{open:e.whatsNewOpen,onOpenChange:t=>{t||e.closeWhatsNew()},children:o.jsxs(Ii,{side:"right","data-psfa-sheet":"whats-new",overlayClassName:"tw:z-[100000]",closeClassName:"tw:top-3 tw:right-3 tw:grid tw:size-9 tw:place-items-center tw:rounded-lg tw:text-muted-foreground tw:opacity-100 tw:hover:bg-accent tw:hover:text-foreground tw:focus:ring-offset-0 tw:max-[782px]:size-11",onCloseAutoFocus:t=>{const n=e.whatsNewReturnFocus();n&&n.isConnected&&(t.preventDefault(),n.focus())},className:"tw:z-[100000] tw:flex tw:w-[min(420px,100vw)] tw:flex-col tw:gap-0 tw:border-border tw:bg-card tw:p-0 tw:pr-[env(safe-area-inset-right,0px)] tw:pb-[env(safe-area-inset-bottom,0px)] tw:font-rubik tw:text-foreground tw:antialiased tw:ease-psfa-drawer tw:data-[state=open]:duration-[240ms] tw:data-[state=closed]:duration-200 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:fade-out-0 tw:sm:max-w-none",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:border-b tw:border-solid tw:border-border tw:py-4 tw:pr-16 tw:pl-5",children:[o.jsx($i,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:text-foreground",children:"What's new"}),o.jsx(Zc,{className:"tw:sr-only",children:"Changes in recent versions of PaapiPlugin."})]}),o.jsx("div",{className:"psfa-scroll tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:px-5 tw:pt-1 tw:pb-6",children:wV.map(t=>o.jsxs("section",{"aria-label":`Version ${t.version}`,children:[o.jsxs("p",{className:"tw:m-0 tw:pt-4 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-muted-foreground",children:["New in ",t.version]}),t.entries.map(n=>o.jsxs("article",{className:"tw:border-b tw:border-solid tw:border-border tw:py-4 tw:last:border-b-0",children:[o.jsx("h3",{className:"tw:m-0 tw:mb-1 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",children:n.title}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:leading-normal tw:text-muted-foreground",children:n.body})]},n.title))]},t.version))})]})}):null}const hV={green:"tw:bg-tile-green tw:text-tile-green-foreground",blue:"tw:bg-tile-blue tw:text-tile-blue-foreground",orange:"tw:bg-tile-orange tw:text-tile-orange-foreground",violet:"tw:bg-tile-violet tw:text-tile-violet-foreground"};function Gi({title:e,icon:t,tone:n,meta:a,className:r,headingRef:s,children:i}){const l=u.useId();return o.jsxs(It,{role:"region","aria-labelledby":l,className:E("tw:min-w-0 tw:overflow-hidden tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:shadow-psfa-card",r),children:[o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-2 tw:px-5 tw:pt-[18px] tw:pb-1.5",children:[o.jsxs("h2",{id:l,ref:s,tabIndex:s?-1:void 0,className:"tw:m-0 tw:flex tw:outline-none tw:min-w-0 tw:items-center tw:gap-2.5 tw:p-0 tw:text-base tw:font-semibold tw:leading-[1.3] tw:text-foreground",children:[o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-flex tw:size-[30px] tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg",hV[n]),children:o.jsx(t,{className:"tw:size-4"})}),e]}),a?o.jsx("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-1.5",children:a}):null]}),i]})}const gV={ok:"tw:bg-success-soft tw:text-success",warn:"tw:bg-warning-soft tw:text-warning",bad:"tw:bg-destructive-soft tw:text-destructive",info:"tw:bg-info-soft tw:text-info"};function Db({tone:e,dot:t=!1,children:n}){return o.jsxs(Ar,{variant:"outline",className:E("tw:h-[22px] tw:shrink-0 tw:gap-1.5 tw:rounded-full tw:border-0 tw:px-2 tw:py-0 tw:text-xs tw:font-medium tw:whitespace-nowrap tw:shadow-none",gV[e]),children:[t?o.jsx("span",{"aria-hidden":"true",className:"tw:size-[7px] tw:shrink-0 tw:rounded-full tw:bg-current"}):null,n]})}const xV=600,bV=20,vV=new Intl.NumberFormat("en-US");function Ca(e){return vV.format(e)}function yV(e){const t=(e||"www.amazon.com").replace(/^www\./,"");return t.charAt(0).toUpperCase()+t.slice(1)}function SV(){return!1}function Ob(){return Nt().settings??{}}const MR={none:"Not connected",managed:"Managed API",creators:"Creators API",paapi:"Your own Amazon keys"};function DR(e){return MR[e]??MR.paapi}function OR(){const e=Nt().activePath;return e==="managed"||e==="creators"||e==="paapi"?e:"none"}function jV(){const e=Ob().managedApiKeyMasked;return typeof e=="string"&&e.trim()!==""}function NV(e=Math.floor(Date.now()/1e3)){const t=Nt().notifications;return cu(Nb(t==null?void 0:t.items),e).length}function So(e){return Math.max(0,Math.round(e))}function CV(e,t){if(e.loading)return{kind:"loading"};if(e.error)return{kind:"error"};const n=e.scope==="pool",a=!t&&!n;if(e.pending||typeof e.used!="number"||typeof e.cap!="number")return{kind:"pending",free:a};const r=typeof e.remaining=="number"?So(e.remaining):So(e.cap-e.used),s=Math.min(r,So(e.cap));if(!a)return{kind:"premium",monthLeft:e.quotaExhausted?0:s,monthTotal:So(e.cap),shared:n};const i=typeof e.usedMonth=="number"&&typeof e.capMonth=="number";return{kind:"free",monthLeft:i?Math.min(So(e.capMonth-e.usedMonth),So(e.capMonth)):null,monthTotal:i?So(e.capMonth):null,dayLeft:s,dayTotal:So(e.cap)}}function AV({path:e,faults:t,blockedKey:n,quota:a}){if(t>0||n)return{tone:"bad",label:"Needs attention"};if(e==="none")return{tone:"warn",label:"Not set up"};if(e==="managed"&&a){if(a.kind==="premium"&&a.monthLeft===0||a.kind==="free"&&a.monthLeft===0)return{tone:"warn",label:"Monthly searches used up"};if(a.kind==="free"&&a.dayLeft===0)return{tone:"warn",label:"Paused until tomorrow"}}return{tone:"ok",label:"Working"}}function _V(e,t){return e<=0?"bad":t>0&&e/t<.2?"warn":"ok"}const PR=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),EV=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function TV(e=new Date){const t=[];for(let n=6;n>=0;n--){const a=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()-n));t.push({iso:a.toISOString().slice(0,10),label:PR.format(a)})}return t}const RV=[12,19,9,22,17,25,21];function kV(e,t=new Date){const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");if(!n)return"";const a=new Date(Date.UTC(Number(n[1]),Number(n[2])-1,Number(n[3])));return Number.isNaN(a.getTime())?"":a.getUTCFullYear()===t.getUTCFullYear()?PR.format(a):EV.format(a)}function zR(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const a=n;typeof a.asin!="string"||a.asin===""||t.push({asin:a.asin,title:typeof a.title=="string"?a.title.trim():"",image:typeof a.image=="string"?a.image:"",createdAt:typeof a.createdAt=="string"?a.createdAt:""})}return t}function MV(){var t;const e=(t=Nt().addonData)==null?void 0:t.comparisonTables;return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({id:Number(n.id)||0,name:typeof n.name=="string"?n.name.trim():"",productCount:Number(n.product_count)||0})).sort((n,a)=>a.id-n.id):[]}function DV(){var t;const e=(t=Nt().addonData)==null?void 0:t.productBoxes;return zR(e)}const Rm="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,color] tw:duration-150 tw:ease-psfa-out tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:pointer-coarse:min-h-11",LR="tw:no-underline tw:text-primary-foreground tw:hover:text-primary-foreground tw:focus:text-primary-foreground",OV="tw:no-underline tw:text-secondary-foreground tw:hover:text-secondary-foreground tw:focus:text-secondary-foreground",IR="tw:rounded-sm tw:font-medium tw:text-link tw:underline tw:underline-offset-[3px] tw:hover:text-link tw:focus:text-link tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",jo="tw:m-0 tw:text-[11.5px] tw:font-semibold tw:uppercase tw:leading-normal tw:tracking-[0.07em] tw:text-muted-foreground",Yi="tw:m-0 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",Pb="tw:m-0 tw:px-5 tw:pt-2 tw:pb-5 tw:text-sm tw:leading-normal tw:text-muted-foreground";async function PV(e,t,n={}){const a=Nt();if(!a.ajaxUrl)return{success:!1,data:null};const r=new FormData;r.append("action",e),r.append("nonce",t);for(const[s,i]of Object.entries(n))r.append(s,i);try{const i=await(await fetch(`${a.ajaxUrl}?action=${e}`,{method:"POST",body:r,credentials:"same-origin"})).json();return i&&typeof i=="object"?i:{success:!1,data:null}}catch{return{success:!1,data:null}}}function zV(e){const t=u.useMemo(()=>TV(),[]),[n,a]=u.useState({status:"loading"});return u.useEffect(()=>{},[e,t]),{...n,week:t}}function $R({week:e,values:t,sample:n}){const a=Math.max(1,...t);return o.jsx("ul",{"aria-label":n?"Sample clicks per day":"Clicks per day",className:"tw:m-0 tw:grid tw:list-none tw:gap-[7px] tw:px-5 tw:pt-2.5 tw:pb-[18px]",children:e.map((r,s)=>{const i=t[s]??0,l=i>0?Math.max(2,i/a*100):0;return o.jsxs("li",{className:"tw:m-0 tw:grid tw:grid-cols-[46px_minmax(0,1fr)_auto] tw:items-center tw:gap-2.5 tw:text-[13px]",children:[o.jsx("span",{className:"tw:whitespace-nowrap tw:text-muted-foreground",children:r.label}),o.jsx("span",{"aria-hidden":"true",className:"tw:h-3.5 tw:overflow-hidden tw:rounded-[3px] tw:bg-secondary",children:o.jsx("span",{className:E("tw:block tw:h-full tw:rounded-[3px]",n?"tw:bg-border-strong":"tw:bg-ring"),style:{width:`${l}%`}})}),o.jsx("span",{className:"tw:min-w-[3ch] tw:text-right tw:font-medium tw:tabular-nums tw:text-foreground",children:Ca(i)})]},r.iso)})})}function LV({premium:e}){const t=zV(e);if(!e)return o.jsxs(Gi,{title:"Clicks, last 7 days",icon:xc,tone:"violet",meta:o.jsxs(Db,{tone:"info",children:[o.jsx(LP,{className:"tw:size-3","aria-hidden":"true"}),"Preview"]}),children:[o.jsx($R,{week:t.week,values:RV,sample:!0}),o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:leading-normal tw:text-muted-foreground",children:[o.jsx(lf,{className:"tw:mt-px tw:size-3.5 tw:shrink-0","aria-hidden":"true"}),o.jsxs("span",{children:["Sample numbers. Analytics counts real clicks on your boxes, tables and search results with Premium."," ",o.jsx(Bn,{to:se.analytics,className:IR,children:"See Analytics"})]})]})]});const n=t.status==="ready"?t.values.reduce((a,r)=>a+r,0):0;return o.jsx(Gi,{title:"Clicks, last 7 days",icon:xc,tone:"violet",meta:t.status==="ready"&&n>0?o.jsxs("span",{className:"tw:text-[13px] tw:tabular-nums tw:text-muted-foreground",children:["Total ",Ca(n)]}):null,children:t.status==="loading"?o.jsx("div",{className:"tw:grid tw:gap-[7px] tw:px-5 tw:pt-2.5 tw:pb-[18px]","aria-hidden":"true",children:t.week.map(a=>o.jsx(bt,{className:"tw:h-3.5 tw:bg-secondary tw:bg-none"},a.iso))}):t.status==="error"?o.jsx("p",{className:Pb,children:"Clicks couldn't load."}):n===0?o.jsx("p",{className:Pb,children:"No clicks yet. Clicks show here after visitors click a product on your site."}):o.jsx($R,{week:t.week,values:t.values,sample:!1})})}function fa(e,t,n,a=String){return`${a(e)} ${e===1?t:n}`}const IV=2;function $V({row:e}){const[t,n]=u.useState(!1),a=e.kind==="box"?fN:_g;return o.jsx("span",{"aria-hidden":"true",className:"tw:flex tw:size-9 tw:shrink-0 tw:items-center tw:justify-center tw:overflow-hidden tw:rounded-md tw:border tw:border-solid tw:border-border tw:bg-muted tw:text-muted-foreground",children:e.image&&!t?o.jsx("img",{src:e.image,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0),className:"tw:size-full tw:object-contain"}):o.jsx(a,{className:"tw:size-[18px]"})})}function BV(e){return e.map(t=>{const n=kV(t.createdAt);return{key:`box-${t.asin}`,kind:"box",title:t.title||t.asin,sub:n?`Product box, ${n}`:"Product box",to:`${se.boxes}/${encodeURIComponent(t.asin)}`,image:t.image}})}function UV(){return MV().slice(0,IV).map(e=>({key:`table-${e.id}`,kind:"table",title:e.name||`Table ${e.id}`,sub:`Comparison table, ${fa(e.productCount,"product","products",Ca)}`,to:se.tables,image:""}))}function HV({loading:e,boxes:t}){const n=e?[]:[...BV(t),...UV()],a=!e&&t.length>0;return o.jsx(Gi,{title:"Recently made",icon:fN,tone:"orange",meta:a?o.jsx(Bn,{to:se.boxes,className:E(IR,"tw:inline-flex tw:items-center tw:text-sm tw:pointer-coarse:min-h-11"),children:"All boxes"}):null,children:e?o.jsx("div",{className:"tw:flex tw:flex-col tw:gap-3 tw:px-5 tw:pt-2 tw:pb-5","aria-hidden":"true",children:[0,1,2].map(r=>o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-9 tw:shrink-0 tw:bg-secondary tw:bg-none"}),o.jsx(bt,{className:"tw:h-4 tw:w-2/3 tw:bg-secondary tw:bg-none"})]},r))}):n.length===0?o.jsx("p",{className:Pb,children:"Nothing yet. Boxes and tables you make show up here."}):o.jsx("ul",{className:"tw:m-0 tw:list-none tw:divide-y tw:divide-solid tw:divide-border tw:p-0 tw:pb-1.5",children:n.map(r=>o.jsxs("li",{className:"tw:relative tw:m-0 tw:flex tw:min-w-0 tw:items-center tw:gap-3 tw:px-5 tw:py-3",children:[o.jsx($V,{row:r}),o.jsxs("span",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col",children:[o.jsx(Bn,{to:r.to,title:r.title,"data-row-title":!0,className:"tw:block tw:truncate tw:rounded-sm tw:font-medium tw:after:absolute tw:after:inset-0 tw:after:content-[''] tw:text-foreground tw:no-underline tw:underline-offset-[3px] tw:hover:text-foreground tw:hover:underline tw:focus:text-foreground tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:r.title}),o.jsx("span",{className:Yi,children:r.sub})]})]},r.key))})})}const BR="tw:grid tw:grid-cols-[28px_minmax(0,1fr)_auto] tw:items-start tw:gap-x-3 tw:gap-y-1 tw:px-5 tw:py-4 tw:max-[640px]:grid-cols-[28px_minmax(0,1fr)]",UR="tw:col-start-3 tw:row-span-2 tw:row-start-1 tw:self-center tw:max-[640px]:col-start-2 tw:max-[640px]:row-span-1 tw:max-[640px]:row-start-auto tw:max-[640px]:mt-2",HR="tw:grid tw:size-6 tw:place-items-center tw:rounded-full";function FV(e){return`${se.boxes}/${encodeURIComponent(e)}?step=place`}function VV(e){const t=u.useRef(null),[n,a]=u.useState({}),r=e.map(s=>s.done?"1":"0").join("");return u.useEffect(()=>{const s={};for(const i of e)s[i.id]=i.done;if(t.current){const i={};for(const l of e)l.done&&!t.current[l.id]&&(i[l.id]=!0);Object.keys(i).length>0&&a(i)}t.current=s},[r]),n}const FR=E("tw:h-9 tw:px-3.5 tw:text-sm",Rm,LR);function VR({to:e,children:t}){return o.jsx(Ne,{asChild:!0,size:"sm",className:FR,children:o.jsx(Bn,{to:e,children:t})})}function GV({action:e}){return"href"in e?o.jsx(Ne,{asChild:!0,size:"sm",className:FR,children:o.jsx("a",{href:e.href,children:e.label})}):o.jsx(VR,{to:e.to,children:e.label})}function YV({premium:e}){return o.jsx(Gi,{title:"You're set up",icon:yr,tone:"blue",meta:o.jsx("span",{className:"tw:text-[13px] tw:tabular-nums tw:text-muted-foreground",children:"3 of 3 done"}),children:o.jsx("ul",{className:"tw:m-0 tw:list-none tw:p-0",children:o.jsxs("li",{className:E(BR,"tw:m-0 tw:bg-muted"),children:[o.jsx("span",{"aria-hidden":"true",className:E(HR,"tw:border tw:border-solid tw:border-border-strong tw:text-muted-foreground"),children:o.jsx(xc,{className:"tw:size-3.5"})}),o.jsx("span",{className:"tw:font-semibold tw:text-foreground",children:"See your clicks"}),o.jsx("p",{className:"tw:col-start-2 tw:m-0 tw:text-[13.5px] tw:leading-normal tw:text-muted-foreground",children:e?"Analytics shows which boxes visitors click, and where.":"Analytics shows which boxes visitors click. It comes with Premium."}),o.jsx("span",{className:UR,children:o.jsx(VR,{to:se.analytics,children:"Open Analytics"})})]})})})}function KV({connected:e,madeBox:t,live:n,draftEditUrl:a,firstBoxAsin:r,premium:s}){const i=[{id:"connect",done:e,title:"Connect to Amazon",desc:"Add your Associate tag. No Amazon credentials needed yet.",action:{label:"Connect to Amazon",to:se.boxNew}},{id:"box",done:t,title:"Make your first product box",desc:"Find a product on Amazon and choose how it looks.",action:{label:"Make a box",to:se.boxNew}},a?{id:"place",done:n,title:"Publish a post with your box",desc:"A draft with PaapiPlugin in it is waiting. Visitors see it once you publish the post.",action:{label:"Open the draft",href:a}}:{id:"place",done:n,title:"Publish a post with your box",desc:"Paste the box's shortcode into any post or page and publish it. That's when visitors see it.",action:r?{label:"Get the shortcode",to:FV(r)}:null}],l=VV(i),c=i.filter(m=>m.done).length,d=i.find(m=>!m.done)??null;return d?o.jsx(Gi,{title:"Get set up",icon:Ag,tone:"blue",meta:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2.5 tw:text-[13px] tw:text-muted-foreground",children:[o.jsxs("span",{className:"tw:tabular-nums",children:[c," of 3 done"]}),o.jsx("span",{"aria-hidden":"true",className:"tw:flex tw:w-24 tw:gap-1",children:i.map(m=>o.jsx("span",{className:E("tw:h-1 tw:flex-1 tw:rounded-full",m.done?"tw:bg-success":"tw:bg-secondary")},m.id))})]}),children:o.jsx("ol",{className:"tw:m-0 tw:list-none tw:divide-y tw:divide-solid tw:divide-border tw:p-0",children:i.map(m=>{const f=m===d;return o.jsxs("li",{"aria-current":f?"step":void 0,className:E(BR,"tw:m-0",f&&"tw:bg-muted"),children:[o.jsx("span",{"aria-hidden":"true",className:E(HR,m.done?"tw:bg-success tw:text-card":"tw:border-[1.5px] tw:border-dashed tw:border-border-strong",l[m.id]&&"tw:animate-in tw:fade-in-0 tw:zoom-in-90 tw:duration-200 tw:ease-psfa-out tw:motion-reduce:zoom-in-100"),children:m.done?o.jsx(yr,{className:"tw:size-[15px]",strokeWidth:2.5}):null}),o.jsxs("span",{className:E("tw:min-w-0",m.done?"tw:font-medium tw:text-muted-foreground":"tw:font-semibold tw:text-foreground"),children:[o.jsx("span",{"data-step-title":!0,children:m.title}),o.jsx("span",{className:"tw:sr-only",children:m.done?" (done)":" (to do)"})]}),m.done?null:o.jsx("p",{className:"tw:col-start-2 tw:m-0 tw:text-[13.5px] tw:leading-normal tw:text-muted-foreground",children:m.desc}),f&&m.action?o.jsx("span",{className:UR,children:o.jsx(GV,{action:m.action})}):null]},m.id)})})}):o.jsx(YV,{premium:s})}function zb(){const[e,t]=u.useState({loading:!0,error:!1}),[n,a]=u.useState(0),r=u.useCallback(()=>a(s=>s+1),[]);return u.useEffect(()=>{const s=window.psfaAdmin;if(!s){t({loading:!1,error:!0});return}const i=new FormData;i.append("action","psfa_managed_api_get_usage"),i.append("nonce",s.nonce),fetch(s.ajaxUrl+"?action=psfa_managed_api_get_usage",{method:"POST",body:i,credentials:"same-origin"}).then(l=>l.json()).then(l=>{if(!(l!=null&&l.success)){t({loading:!1,error:!0});return}const c=l.data||{};t({loading:!1,error:!1,scope:c.scope==="pool"?"pool":"site",used:typeof c.used=="number"?c.used:void 0,cap:typeof c.cap=="number"?c.cap:void 0,remaining:typeof c.remaining=="number"?c.remaining:void 0,resetsAt:typeof c.resets_at=="string"&&c.resets_at!==""?c.resets_at:void 0,pending:c.usage_pending===!0,successRatePct:typeof c.success_rate_pct=="number"?c.success_rate_pct:void 0,avgLatencyMs:typeof c.avg_latency_ms=="number"?c.avg_latency_ms:void 0,usedMonth:typeof c.used_month=="number"?c.used_month:void 0,capMonth:typeof c.monthly_limit=="number"?c.monthly_limit:void 0,quotaExhausted:!!(c.quota_state==="exhausted"||c.quotaExhausted),tierDrift:c.tier_drift&&typeof c.tier_drift=="object"?{plugin_tier:String(c.tier_drift.plugin_tier??""),proxy_tier:String(c.tier_drift.proxy_tier??""),drift_detected:!!c.tier_drift.drift_detected,recent_sync:!!c.tier_drift.recent_sync}:void 0})}).catch(()=>t({loading:!1,error:!0}))},[n]),{...e,refetch:r}}const qV={ok:"tw:bg-ring",warn:"tw:bg-warning",bad:"tw:bg-destructive"};function Lb({label:e,left:t,total:n}){const a=u.useId(),r=Math.max(0,Math.min(t,n)),s=n>0?r/n*100:0;return o.jsxs(o.Fragment,{children:[o.jsx("p",{id:a,className:jo,children:e}),o.jsxs("p",{className:"tw:m-0 tw:flex tw:flex-wrap tw:items-baseline tw:gap-x-1.5 tw:text-[17px] tw:font-semibold tw:leading-snug tw:tabular-nums tw:text-foreground",children:[Ca(r)," ",o.jsxs("span",{className:E(Yi,"tw:font-normal"),children:["of ",Ca(n)]})]}),o.jsx("div",{role:"meter","aria-labelledby":a,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":r,"aria-valuetext":`${Ca(r)} of ${Ca(n)}`,className:"tw:mt-0.5 tw:h-1.5 tw:overflow-hidden tw:rounded-full tw:bg-secondary",children:o.jsx("span",{className:E("tw:block tw:h-full tw:rounded-full",qV[_V(r,n)]),style:{width:`${s}%`}})})]})}const XV="tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5 tw:px-5 tw:pt-3.5 tw:pb-[18px]",WV="tw:border-0 tw:border-solid tw:border-border tw:border-l tw:max-[760px]:border-l-0 tw:max-[760px]:border-t",ZV="tw:col-span-2 tw:max-[760px]:col-span-1";function qa({wide:e=!1,first:t=!1,children:n}){return o.jsx("div",{className:E(XV,!t&&WV,e&&ZV),children:n})}function QV({quota:e,onRetry:t}){return e.kind==="loading"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsx(bt,{className:"tw:h-5 tw:w-28 tw:bg-secondary tw:bg-none"}),o.jsx(bt,{className:"tw:h-1.5 tw:w-full tw:max-w-xs tw:bg-secondary tw:bg-none"})]}):e.kind==="error"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:["Usage couldn't load."," ",o.jsx(Ne,{type:"button",variant:"link",onClick:t,className:"tw:h-auto tw:p-0 tw:font-medium tw:text-link tw:underline tw:underline-offset-[3px]",children:"Try again"})]})]}):e.kind==="pending"?o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Searches left"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Usage appears after this site's next search."}),o.jsx("p",{className:Yi,children:e.free?`Free: ${Ca(bV)} searches and product lookups a day, ${Ca(xV)} a month.`:"No daily limit."})]}):e.kind==="free"?o.jsxs(o.Fragment,{children:[e.monthLeft!==null&&e.monthTotal!==null?o.jsx(qa,{children:o.jsx(Lb,{label:"Searches left this month",left:e.monthLeft,total:e.monthTotal})}):null,o.jsx(qa,{wide:e.monthLeft===null,children:o.jsx(Lb,{label:"Searches left today",left:e.dayLeft,total:e.dayTotal})})]}):o.jsxs(o.Fragment,{children:[o.jsx(qa,{children:o.jsx(Lb,{label:e.shared?"Searches left this month, all sites":"Searches left this month",left:e.monthLeft,total:e.monthTotal})}),o.jsxs(qa,{children:[o.jsx("p",{className:jo,children:"Daily limit"}),o.jsx("p",{className:"tw:m-0 tw:text-[17px] tw:font-semibold tw:leading-snug tw:text-foreground",children:"None"}),o.jsx("p",{className:Yi,children:e.shared?`${Ca(e.monthTotal)} a month, shared by every site on your license.`:`${Ca(e.monthTotal)} a month on this site.`})]})]})}function JV({switching:e,onSwitch:t}){return o.jsx("div",{className:"tw:px-5 tw:pb-5",children:o.jsxs(ln,{role:"status",variant:"destructive",className:"tw:border-solid tw:border-destructive/40 tw:bg-destructive-soft tw:leading-normal tw:text-foreground tw:[&>svg]:text-destructive",children:[o.jsx(co,{className:"tw:size-4","aria-hidden":"true"}),o.jsx(Va,{className:"tw:leading-snug tw:[overflow-wrap:anywhere]",children:"Your Managed API key isn't in use"}),o.jsxs(Gn,{className:"tw:text-foreground",children:[o.jsx("p",{className:"tw:m-0",children:"You have a key, but the plugin is still set to another connection, so products don't load."}),o.jsx(Ne,{type:"button",size:"sm",onClick:t,disabled:e,className:E("tw:mt-3 tw:max-[640px]:h-11 tw:max-[640px]:w-full",Rm),children:e?"Switching...":"Switch to Managed now"})]})]})})}function eG({quota:e,onRetry:t,...n}){const{path:a,faults:r,isMock:s,managedKey:i,store:l,tag:c,switching:d,onSwitch:m}=n,f=i&&a==="none",w=u.useRef(null),p=u.useRef(f);u.useEffect(()=>{var y;p.current&&!f&&((y=w.current)==null||y.focus({preventScroll:!0})),p.current=f},[f]);const x=AV({path:a,faults:r,blockedKey:f,quota:e});let b;return a==="none"?b=o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Next"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Add your Associate tag to connect. No Amazon credentials needed yet."}),o.jsx("div",{children:o.jsx(Ne,{asChild:!0,variant:"secondary",size:"sm",className:E("tw:mt-1",Rm,OV),children:o.jsx(Bn,{to:se.boxNew,children:"Connect to Amazon"})})})]}):a==="managed"&&e?b=o.jsx(QV,{quota:e,onRetry:t}):b=o.jsxs(qa,{wide:!0,children:[o.jsx("p",{className:jo,children:"Limits"}),o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Requests go to Amazon on your own account. PaapiPlugin adds no cap."})]}),o.jsxs(Gi,{title:"Is it working?",icon:yN,tone:"green",headingRef:w,meta:o.jsxs(o.Fragment,{children:[s?o.jsxs(Db,{tone:"info",children:[o.jsx(lf,{className:"tw:size-3","aria-hidden":"true"}),"Demo data"]}):null,o.jsx(Db,{tone:x.tone,dot:!0,children:x.label})]}),children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)_minmax(0,1fr)] tw:max-[760px]:grid-cols-1",children:[o.jsxs(qa,{first:!0,children:[o.jsx("p",{className:jo,children:"Products come from"}),o.jsx("p",{className:"tw:m-0 tw:text-[17px] tw:font-semibold tw:leading-snug tw:text-foreground",children:DR(a)}),s?o.jsx("p",{className:Yi,children:"Products are sample data, not live from Amazon."}):null,o.jsx("p",{className:E(Yi,"tw:[overflow-wrap:anywhere]"),children:a==="none"?"Boxes can't load products until you connect.":o.jsxs(o.Fragment,{children:["Store ",yV(l),".",c?o.jsxs(o.Fragment,{children:[" ","Tag"," ",o.jsx("code",{className:"tw:rounded tw:bg-secondary tw:px-1.5 tw:py-px tw:font-mono tw:text-[12.5px] tw:text-foreground",children:c})]}):null]})})]}),b]}),f?o.jsx(JV,{switching:d,onSwitch:m}):null]})}function tG({onUsage:e}){const t=zb();return u.useEffect(()=>{e(t)},[e,t.loading,t.error,t.pending,t.scope,t.used,t.cap,t.remaining,t.usedMonth,t.capMonth,t.quotaExhausted]),null}function nG(e){const[t,n]=u.useState(null),a=e.path==="managed",r=a?t?CV(t,e.premium):{kind:"loading"}:null;return o.jsxs(o.Fragment,{children:[a?o.jsx(tG,{onUsage:n}):null,o.jsx(eG,{...e,quota:r,onRetry:()=>t==null?void 0:t.refetch()})]})}const GR=3;function aG(){const[e,t]=u.useState({loading:!0,boxes:[]});return u.useEffect(()=>{var r;let n=!1;const a=((r=Nt().addonNonces)==null?void 0:r.productBoxes)??"";return PV("psfa_box_list",a,{page:"1",per_page:String(GR)}).then(s=>{if(n)return;const i=s.success&&s.data?zR(s.data.boxes):DV();t({loading:!1,boxes:i.slice(0,GR)})}),()=>{n=!0}},[]),e}const Ib={managed:"Managed API",creators:"Creators API",paapi:"PA-API v5"};function $b(e,t){return e==="managed"||e==="creators"||e==="paapi"?e:t==="oauth"?"creators":"paapi"}function rG(e){const[t,n]=u.useState(!1),a=u.useCallback(async()=>{var r,s;n(!0);try{const i=await vo("psfa_set_active_api",{path:"managed"});if(i.success){const l=Ob().authType,c=$b((r=i.data)==null?void 0:r.active_path,typeof l=="string"?l:void 0);e(c),_e.success(`Now serving searches via ${DR(c)}`)}else{const l=(s=i.data)==null?void 0:s.message;_e.error(typeof l=="string"&&l!==""?l:"Could not change the active API")}}finally{n(!1)}},[e]);return{switching:t,switchToManaged:a}}function oG(){var x;const e=Nt(),t=SV(),n=Ob(),a=e.setupChecklist,[r,s]=u.useState(OR),[i,l]=u.useState(!!(a!=null&&a.connected)||OR()!=="none"),c=aG(),d=u.useCallback(b=>{s(b),l(!0)},[]),{switching:m,switchToManaged:f}=rG(d),w=!!(a!=null&&a.madeBox)||c.boxes.length>0,p=!(a!=null&&a.madeBox);return o.jsxs("div",{"data-testid":"home-page",children:[o.jsx(fu,{title:"Home",description:p?"Make your first product box. It takes a minute.":"How the plugin is doing on your site, and what to do next.",actions:o.jsx(Ne,{asChild:!0,className:E("tw:h-10 tw:gap-1.5 tw:rounded-[10px] tw:px-4 tw:max-[782px]:flex-1",Rm,LR),children:o.jsxs(Bn,{to:se.boxNew,children:[o.jsx(Cg,{"aria-hidden":"true"}),"New product box"]})})}),o.jsxs("div",{className:"tw:grid tw:grid-cols-[minmax(0,1.25fr)_minmax(0,1fr)] tw:gap-6 tw:max-[1000px]:grid-cols-1 tw:max-[782px]:gap-4",children:[o.jsx("div",{className:"tw:col-span-2 tw:min-w-0 tw:max-[1000px]:col-span-1",children:o.jsx(nG,{path:r,premium:t,faults:NV(),isMock:!!e.isMockMode,managedKey:jV(),store:typeof n.marketplace=="string"?n.marketplace:"",tag:typeof n.associateTag=="string"?n.associateTag.trim():"",switching:m,onSwitch:f})}),o.jsx("div",{className:"tw:col-span-2 tw:min-w-0 tw:max-[1000px]:col-span-1",children:o.jsx(KV,{connected:i,madeBox:w,live:(a==null?void 0:a.live)===!0,draftEditUrl:typeof(a==null?void 0:a.draftEditUrl)=="string"&&a.draftEditUrl!==""?a.draftEditUrl:null,firstBoxAsin:((x=c.boxes[0])==null?void 0:x.asin)??null,premium:t})}),o.jsx(HV,{loading:c.loading,boxes:c.boxes}),o.jsx(LV,{premium:t})]})]})}const YR="With the Managed API, you do not connect your own Amazon API credentials. The Managed API does not use Amazon's official Creators API or PA-API. We fetch Amazon product data for you through a third-party product-data provider during this launch phase, and we attach your own Amazon Associate tag to every product link. The tag on those links is always yours. We never put our own tag on your links.",KR="Before you turn on the Managed API, please read this:",qR=["The Managed API does not use Amazon's official Creators API or PA-API.","Amazon may determine that use of this feature is inconsistent with the Amazon Associates Program, Program Policies, or related Amazon requirements.","Your participation in the Amazon Associates Program is governed solely by Amazon, not by PaapiPlugin.","Amazon may suspend, terminate, or otherwise restrict your participation in the Associates Program at its discretion.","You are solely responsible for evaluating and maintaining your own compliance with Amazon's requirements.","You use this feature at your own risk."],mu="I have read and acknowledge the statements above. I understand that my Amazon Associate tag is used on product links generated through this feature and that I, not PaapiPlugin, am responsible for maintaining compliance with the Amazon Associates Program and related Amazon requirements.",XR="Read how Managed API data is sourced and what you are agreeing to.",WR="Where did you hear about us? (optional)",ZR="Choose one",Bb=[{value:"reddit",label:"Reddit"},{value:"google",label:"Google search"},{value:"wporg",label:"WordPress.org plugin directory"},{value:"ai_assistant",label:"ChatGPT or another AI assistant"},{value:"youtube",label:"YouTube"},{value:"social",label:"Facebook or X"},{value:"referral",label:"A friend or colleague"},{value:"other",label:"Somewhere else"}],sG=new Set(Bb.map(e=>e.value));function QR(e){return sG.has(e)?{heard_from:e}:{}}const us="www.amazon.com",JR=[{value:"www.amazon.com",label:"www.amazon.com (US)",managed:!0},{value:"www.amazon.co.uk",label:"www.amazon.co.uk (UK)",managed:!0},{value:"www.amazon.de",label:"www.amazon.de (Germany)",managed:!0},{value:"www.amazon.fr",label:"www.amazon.fr (France)",managed:!0},{value:"www.amazon.it",label:"www.amazon.it (Italy)",managed:!0},{value:"www.amazon.es",label:"www.amazon.es (Spain)",managed:!0},{value:"www.amazon.ca",label:"www.amazon.ca (Canada)",managed:!0},{value:"www.amazon.com.au",label:"www.amazon.com.au (Australia)",managed:!0},{value:"www.amazon.co.jp",label:"www.amazon.co.jp (Japan)",managed:!0},{value:"www.amazon.in",label:"www.amazon.in (India)",managed:!0},{value:"www.amazon.se",label:"www.amazon.se (Sweden), own Creators API keys only",managed:!1}],iG=new Set(JR.filter(e=>e.managed).map(e=>e.value));function Ub(e){return iG.has(e)}const ek={"www.amazon.com":"https://affiliate-program.amazon.com/","www.amazon.co.uk":"https://affiliate-program.amazon.co.uk/","www.amazon.de":"https://partnernet.amazon.de/","www.amazon.fr":"https://partenaires.amazon.fr/","www.amazon.it":"https://programma-affiliazione.amazon.it/","www.amazon.es":"https://afiliados.amazon.es/","www.amazon.ca":"https://associates.amazon.ca/","www.amazon.com.au":"https://affiliate-program.amazon.com.au/","www.amazon.co.jp":"https://affiliate.amazon.co.jp/","www.amazon.in":"https://affiliate-program.amazon.in/","www.amazon.se":"https://affiliate-program.amazon.se/"};function lG(e){return ek[e]??ek[us]}function cG(e){const t=(e||us).replace(/^www\./,"");return t.charAt(0).toUpperCase()+t.slice(1)}const uG=new Set(["www.amazon.com","www.amazon.ca"]);function dG(e,t){return e.trim().toLowerCase().endsWith("-20")&&!uG.has(t)}const fG={US:"www.amazon.com",GB:"www.amazon.co.uk",DE:"www.amazon.de",AT:"www.amazon.de",CH:"www.amazon.de",FR:"www.amazon.fr",IT:"www.amazon.it",ES:"www.amazon.es",CA:"www.amazon.ca",AU:"www.amazon.com.au",JP:"www.amazon.co.jp",IN:"www.amazon.in",SE:"www.amazon.se"},mG={ja:"www.amazon.co.jp",sv:"www.amazon.se",de:"www.amazon.de",fr:"www.amazon.fr",it:"www.amazon.it",hi:"www.amazon.in"};function wG(e){const t=String(e??"").trim().split(/[-_]/).filter(Boolean);if(t.length===0)return us;const n=t.length>1?t[1].toUpperCase():"";return n?fG[n]??us:mG[t[0].toLowerCase()]??us}function pG(e,t){if(e&&e!==us&&Ub(e))return e;const n=wG(t);return Ub(n)?n:us}function hG(){var t;const e=(t=window.psfaAdmin)==null?void 0:t.userLocale;return typeof e=="string"&&e.trim()!==""?e.trim():typeof document>"u"?"":document.documentElement.getAttribute("lang")||""}const Hb="Read before you connect";function gG({testId:e,children:t}){const[n,a]=u.useState(!1);return o.jsx(ln,{variant:"default",className:"tw:text-sm","data-testid":e,children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-3",children:[o.jsxs(Tx,{open:n,onOpenChange:a,children:[o.jsx(Rx,{asChild:!0,children:o.jsxs(Ne,{type:"button",variant:"ghost",className:"tw:-mx-2 tw:-my-1 tw:h-auto tw:w-[calc(100%+1rem)] tw:justify-between tw:gap-3 tw:px-2 tw:py-1 tw:text-left tw:whitespace-normal tw:[&[data-state=open]>svg]:rotate-180",children:[Hb,o.jsx(bc,{"aria-hidden":"true"})]})}),o.jsx(kx,{forceMount:!0,hidden:!n,className:"tw:pt-3",children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-3",children:[o.jsx("p",{className:"tw:m-0 tw:text-foreground",children:YR}),o.jsx("p",{className:"tw:m-0 tw:font-medium tw:text-foreground",children:KR}),o.jsx("ul",{className:"tw:list-disc tw:pl-5 tw:space-y-1 tw:m-0 tw:text-foreground",children:qR.map(r=>o.jsx("li",{children:r},r))})]})})]}),o.jsx("a",{href:"https://paapiplugin.com/api-terms/",target:"_blank",rel:"noopener",className:"tw:block tw:text-xs tw:underline tw:text-link",children:XR}),t]})})}const tk=mu.indexOf(". ")+1,xG=mu.slice(0,tk),bG=mu.slice(tk+1),vG="Email me product tips & updates, plus 10% off my first Premium purchase (optional)",nk="https://paapiplugin.com/api-terms/",yG="https://paapiplugin.com/privacy-policy/#managed-api",ak="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,border-color,box-shadow] tw:duration-[120ms] tw:ease-psfa-out tw:motion-safe:active:scale-[0.97]",Ki="tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:font-medium tw:text-link tw:underline tw:decoration-1 tw:underline-offset-[3px] tw:outline-none tw:touch-manipulation tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-card",km="tw:min-h-10 tw:rounded-lg tw:border-solid tw:border-input tw:bg-card tw:px-[11px] tw:text-foreground tw:shadow-none tw:transition-[border-color,box-shadow] tw:duration-[160ms] tw:focus-visible:border-ring tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus:border-ring tw:focus:ring-2 tw:focus:ring-ring tw:aria-[invalid=true]:border-destructive tw:pointer-coarse:min-h-11 tw:pointer-coarse:text-base",SG="tw:z-[100000] tw:bg-scrim tw:duration-200 tw:ease-psfa-out tw:data-[state=open]:animate-in tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:duration-150",jG="tw:fixed tw:top-1/2 tw:left-1/2 tw:z-[100000] tw:flex tw:max-h-[calc(100dvh-48px)] tw:w-[min(560px,calc(100vw-32px))] tw:-translate-x-1/2 tw:-translate-y-1/2 tw:flex-col tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card tw:p-5 tw:font-rubik tw:text-foreground tw:antialiased tw:shadow-psfa-pop tw:outline-none tw:duration-200 tw:ease-psfa-out tw:data-[state=open]:animate-in tw:data-[state=open]:fade-in-0 tw:motion-safe:data-[state=open]:zoom-in-[0.96] tw:data-[state=closed]:animate-out tw:data-[state=closed]:fill-mode-forwards tw:data-[state=closed]:fade-out-0 tw:motion-safe:data-[state=closed]:zoom-out-[0.96] tw:data-[state=closed]:duration-150";function NG({idPrefix:e,className:t}){const n=`${e}-consent-title`,a=u.useRef(null);return o.jsxs(Qf,{children:[o.jsx(OI,{asChild:!0,children:o.jsx("button",{type:"button",className:E(Ki,"tw:select-none tw:text-[13.5px]",t),children:Hb})}),o.jsxs(t_,{children:[o.jsx(Mx,{className:SG}),o.jsxs(ki,{"aria-labelledby":n,"aria-describedby":void 0,className:jG,onOpenAutoFocus:r=>{var s;r.preventDefault(),(s=a.current)==null||s.focus()},children:[o.jsx(Hc,{id:n,className:"tw:m-0 tw:mb-2 tw:text-[17px] tw:font-semibold tw:leading-snug tw:tracking-normal tw:text-foreground",children:Hb}),o.jsxs("div",{"data-testid":`${e}-consent-body`,role:"region","aria-labelledby":n,tabIndex:0,className:"psfa-scroll tw:-mx-1 tw:mt-1 tw:mb-4 tw:min-h-0 tw:flex-1 tw:overflow-y-auto tw:overscroll-contain tw:rounded-md tw:px-1 tw:text-[13.5px] tw:leading-relaxed tw:text-foreground tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:[o.jsx("p",{className:"tw:m-0 tw:mb-2.5",children:YR}),o.jsx("p",{className:"tw:m-0 tw:mb-2.5 tw:font-semibold",children:KR}),o.jsx("ul",{className:"tw:m-0 tw:mb-2.5 tw:grid tw:list-disc tw:gap-1 tw:pl-5",children:qR.map(r=>o.jsx("li",{className:"tw:m-0",children:r},r))}),o.jsx("p",{className:"tw:m-0 tw:mb-2.5",children:bG}),o.jsx("a",{href:nk,target:"_blank",rel:"noopener",className:E(Ki,"tw:inline tw:text-[12.5px]"),children:XR})]}),o.jsx("div",{className:"tw:flex tw:justify-end",children:o.jsx(PI,{asChild:!0,children:o.jsx(Ne,{ref:a,type:"button",variant:"outline",className:E("tw:min-h-[38px] tw:rounded-[10px] tw:border-solid tw:border-input tw:bg-card tw:px-4 tw:text-foreground tw:shadow-psfa-xs tw:hover:bg-accent tw:hover:text-foreground tw:pointer-coarse:min-h-11",ak),children:"Close"})})})]})]})]})}function CG(e){return{email:e.email,associate_tag:e.associateTag,marketplace:e.marketplace,marketing_consent:e.marketingConsent?"1":"0",consent_ts:e.marketingConsent?new Date().toISOString():"",clickwrap_accepted:"1",...QR(e.heardFrom)}}function AG(e){return vo("psfa_managed_api_signup",CG(e))}function _G(e){var t;return((t=e==null?void 0:e.data)==null?void 0:t.message)||(e==null?void 0:e.message)||"Could not get your API key"}const EG=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Mm="tw:m-0 tw:text-sm tw:font-medium tw:leading-snug tw:text-foreground",qi="tw:m-0 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",Fb="tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:text-[13px] tw:leading-normal tw:text-destructive",Dm="tw:mt-[3px] tw:size-3.5 tw:shrink-0",rk="tw:flex tw:items-start tw:gap-2.5",ok='tw:relative tw:mt-px tw:size-[18px] tw:rounded-[5px] tw:border-solid tw:border-border-strong tw:bg-card tw:shadow-none tw:data-[state=checked]:border-primary tw:aria-[invalid=true]:border-destructive tw:focus-visible:ring-2 tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-card tw:pointer-coarse:after:absolute tw:pointer-coarse:after:-inset-[13px] tw:pointer-coarse:after:content-[""] tw:[&_svg]:size-3.5',sk="tw:m-0 tw:cursor-pointer tw:font-normal tw:leading-snug";function TG(){var t,n;const e=(n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.marketplace;return pG(typeof e=="string"?e:"",hG())}function RG(){var t,n;const e=(n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.associateTag;return typeof e=="string"?e:""}function ik({idPrefix:e,showAlternative:t=!1,onConnected:n}){var H;const a=F=>`${e}-${F}`,[r,s]=u.useState(RG),[i,l]=u.useState(TG),[c,d]=u.useState(""),[m,f]=u.useState(""),[w,p]=u.useState(!1),[x,b]=u.useState(!1),[y,h]=u.useState(!1),[g,v]=u.useState(!1),[S,N]=u.useState(""),A=u.useRef(!1),j=u.useRef(null),C=u.useRef(null),R=u.useRef(null),M=r.trim(),z=c.trim(),B=EG.test(z),I=y&&!M?"Add your Associate tag. You'll find it in Amazon Associates, for example yourtag-20.":"",V=y&&!B?"Enter an email address like you@example.com.":"",D=y&&!w?"Tick this box to connect.":"",T=dG(M,i),O=M?B?w?"":"Tick the box above first.":"Add your email first.":"Add your Associate tag first.",_=((H=window.psfaAdmin)==null?void 0:H.isPremium)!==!0,$=async F=>{var Q,X,P;if(F.preventDefault(),!A.current){if(h(!0),!M){(Q=j.current)==null||Q.focus();return}if(!B){(X=C.current)==null||X.focus();return}if(!w){(P=R.current)==null||P.focus();return}if(Ub(i)){A.current=!0,v(!0),N("");try{const G=await AG({email:z,associateTag:M,marketplace:i,marketingConsent:x,heardFrom:m});if(G!=null&&G.success){const ne=G.data??{};n({activePath:dF(),tag:M,marketplace:i,email:ne.email||z,apiKeyMasked:ne.api_key_masked||ne.apiKeyMasked||void 0,tier:ne.tier||void 0})}else N(_G(G))}finally{A.current=!1,v(!1)}}}};return o.jsxs("form",{noValidate:!0,onSubmit:$,"aria-labelledby":a("title"),className:"tw:flex tw:max-w-xl tw:min-w-0 tw:flex-col tw:text-sm tw:text-foreground",children:[o.jsx("h3",{id:a("title"),className:"tw:m-0 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",children:"Connect to Amazon with the Managed API"}),o.jsxs("p",{className:E(qi,"tw:mt-1 tw:mb-4"),children:["Add your Associate tag. No Amazon credentials needed yet.",_?" Free: 20 searches and product lookups a day, 600 a month.":""]}),o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("tag"),className:Mm,children:"Associate tag"}),o.jsx(pt,{ref:j,id:a("tag"),type:"text",value:r,placeholder:"yourtag-20",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,"aria-invalid":I?"true":"false","aria-describedby":a("tag-help"),onChange:F=>s(F.target.value),className:km}),I?o.jsxs("p",{id:a("tag-help"),className:Fb,children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:I})]}):o.jsx("p",{id:a("tag-help"),className:qi,children:"Your links always carry this tag."}),o.jsxs("p",{className:qi,children:["Don't have one yet?"," ",o.jsx("a",{id:a("join"),href:lG(i),target:"_blank",rel:"noopener",className:Ki,children:"Join Amazon Associates"})]})]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("store"),className:Mm,children:"Amazon store"}),o.jsxs(Vt,{value:i,onValueChange:l,children:[o.jsx(zt,{id:a("store"),"aria-describedby":T?a("store-warn"):void 0,className:E(km,"tw:h-auto tw:py-2 tw:text-left"),children:o.jsx(Gt,{})}),o.jsx(Lt,{className:"tw:z-[100000] tw:rounded-lg tw:border-solid tw:border-border tw:bg-card tw:text-foreground tw:shadow-psfa-pop",children:o.jsx(Yf,{children:JR.map(F=>o.jsx(Tt,{value:F.value,disabled:!F.managed,className:"tw:whitespace-normal tw:pointer-coarse:min-h-11",children:F.label},F.value))})})]}),T?o.jsxs("p",{id:a("store-warn"),className:E(qi,"tw:flex tw:items-start tw:gap-1.5 tw:text-warning"),children:[o.jsx(Sc,{"aria-hidden":"true",className:Dm}),o.jsxs("span",{children:["Tags ending in -20 are for Amazon.com and Amazon.ca. Check that this tag belongs to ",cG(i),"."]})]}):null]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("email"),className:Mm,children:"Your email"}),o.jsx(pt,{ref:C,id:a("email"),type:"email",value:c,placeholder:"you@example.com",autoComplete:"email",inputMode:"email",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"go","aria-invalid":V?"true":"false","aria-describedby":V?a("email-error"):void 0,onChange:F=>d(F.target.value),className:km}),V?o.jsxs("p",{id:a("email-error"),className:Fb,children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:V})]}):null]}),o.jsxs("div",{className:"tw:mt-3.5 tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(Re,{htmlFor:a("heard-from"),className:E(Mm,"tw:text-[13px] tw:font-normal tw:text-muted-foreground"),children:WR}),o.jsxs(Vt,{value:m,onValueChange:f,children:[o.jsx(zt,{id:a("heard-from"),className:E(km,"tw:h-auto tw:py-2 tw:text-left"),children:o.jsx(Gt,{placeholder:ZR})}),o.jsx(Lt,{className:"tw:z-[100000] tw:rounded-lg tw:border-solid tw:border-border tw:bg-card tw:text-foreground tw:shadow-psfa-pop",children:o.jsx(Yf,{children:Bb.map(F=>o.jsx(Tt,{value:F.value,className:"tw:pointer-coarse:min-h-11",children:F.label},F.value))})})]})]}),o.jsxs("div",{className:"tw:mt-[18px] tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:bg-muted tw:px-3.5 tw:pt-2.5 tw:pb-3.5 tw:text-[13.5px]",children:[o.jsx(NG,{idPrefix:e,className:"tw:pointer-coarse:inline-flex tw:pointer-coarse:min-h-11 tw:pointer-coarse:items-center"}),o.jsxs("div",{className:E(rk,"tw:mt-2 tw:pointer-coarse:mt-3.5"),children:[o.jsx(Uc,{ref:R,id:a("clickwrap"),checked:w,onCheckedChange:F=>p(F===!0),"aria-invalid":D?"true":"false","aria-describedby":[a("ack-full"),D?a("clickwrap-error"):""].filter(Boolean).join(" "),className:ok}),o.jsx(Re,{htmlFor:a("clickwrap"),className:E(sk,"tw:text-[13.5px] tw:text-foreground"),children:xG})]}),o.jsx("span",{id:a("ack-full"),className:"tw:sr-only",children:mu}),D?o.jsxs("p",{id:a("clickwrap-error"),className:E(Fb,"tw:mt-1.5"),children:[o.jsx(co,{"aria-hidden":"true",className:Dm}),o.jsx("span",{children:D})]}):null]}),o.jsxs("div",{className:E(rk,"tw:mt-3 tw:pointer-coarse:mt-4"),children:[o.jsx(Uc,{id:a("marketing"),checked:x,onCheckedChange:F=>b(F===!0),className:ok}),o.jsx(Re,{htmlFor:a("marketing"),className:E(sk,"tw:text-[13px] tw:text-muted-foreground"),children:vG})]}),S?o.jsxs(ln,{variant:"destructive",className:"tw:mt-4 tw:border-solid tw:border-destructive/30 tw:bg-destructive-soft tw:text-foreground",children:[o.jsx(co,{"aria-hidden":"true",className:"tw:size-4"}),o.jsx(Gn,{className:"tw:[overflow-wrap:anywhere]",children:S})]}):null,o.jsxs("div",{className:"tw:mt-4 tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2",children:[o.jsx(Ne,{type:"submit",disabled:g,"aria-describedby":O?a("missing"):void 0,className:E("tw:min-h-[38px] tw:rounded-[10px] tw:px-4 tw:shadow-psfa-xs tw:pointer-coarse:min-h-11",ak),children:g?"Getting your key...":"Get your free API key"}),O?o.jsx("span",{id:a("missing"),className:qi,children:O}):null]}),o.jsxs("p",{"data-testid":a("terms"),className:E(qi,"tw:mt-2.5 tw:max-w-[60ch] tw:text-[12.5px]"),children:["By getting a key, you agree to the"," ",o.jsx("a",{href:nk,target:"_blank",rel:"noopener",className:Ki,children:"API Terms"}),". The plugin will send your search queries to paapiplugin.com infrastructure."," ",o.jsx("a",{href:yG,target:"_blank",rel:"noopener",className:Ki,children:"Learn what we receive"}),"."]}),t?o.jsx("p",{className:"tw:m-0 tw:mt-3.5 tw:text-sm",children:o.jsx("a",{href:"#/settings/connection",className:E(Ki,"tw:pointer-coarse:inline-flex tw:pointer-coarse:min-h-11 tw:pointer-coarse:items-center"),children:"Use your own Creators API keys instead"})}):null]})}class ds extends Error{constructor(n,a,r,s){super(a);gw(this,"code");gw(this,"field");gw(this,"quota");this.code=n,this.field=r,this.quota=s}}function lk(){var e;return((e=Nt().addonNonces)==null?void 0:e.productBoxes)??""}async function No(e,t,n=lk()){const a=Nt();if(!a.ajaxUrl)throw new ds("invalid","The plugin settings did not load. Reload this page and try again.");const r=new FormData;r.append("action",e),r.append("nonce",n);for(const[i,l]of Object.entries(t))r.append(i,l);let s=null;try{s=await(await fetch(a.ajaxUrl,{method:"POST",body:r,credentials:"same-origin"})).json()}catch{throw new ds("unavailable","Your site did not answer. Check your connection and try again.")}if(!(s!=null&&s.success)){const i=(s==null?void 0:s.data)??{};throw new ds(i.code||"unavailable",i.message||"Something went wrong.",i.field,i.quota)}return s.data}const kG=e=>No("psfa_box_lookup",{query:e}),MG=e=>No("psfa_box_search",{query:e}),ck=e=>No("psfa_box_get",{asin:e}),Om=(e,t)=>No("psfa_box_list",{page:String(e),per_page:String(t)}),DG=e=>No("psfa_box_save",e).then(jb),OG=e=>No("psfa_delete_product_box",{asin:e}).then(jb),PG=()=>No("psfa_mark_box_placed",{},Nt().nonce??"").then(jb);async function zG(){const e=await Om(1,100),t=[...e.boxes];for(let n=2;n<=e.totalPages;n+=1){const a=await Om(n,100);t.push(...a.boxes)}return{...e,boxes:t,perPage:t.length,totalPages:1}}function Vb(){const e=Nt().activePath;return e==="managed"||e==="creators"||e==="paapi"||e==="none"?e:"managed"}function uk(e){const t=!!Nt().isPremium&&!1,n=e==="managed"||e==="none";return{activePath:e==="none"?"managed":e,showsPrice:!n,canCustomButton:t&&!n,canBadge:t,buttonText:n?"Check price on Amazon":""}}const LG=/^(?:https?:\/\/)?(?:www\.)?(?:amzn\.to|a\.co|amzn\.eu|amzn\.asia)(?:\/|$)/i,IG=/^(?:https?:\/\/)?(?:[a-z0-9-]+\.)*amazon\.[a-z.]+\/(?:[^\s?#]*\/)?(?:dp|gp\/product|gp\/aw\/d)\/([A-Z0-9]{10})(?:[/?#]|$)/i,$G=/^(?:https?:\/\/|www\.)\S+$|^[a-z0-9-]+(?:\.[a-z0-9-]+)+\/\S*$/i,BG=/^[A-Z0-9]{10}$/i;function Pm(e){const t=e.trim();if(LG.test(t))return{type:"short"};const n=t.match(IG);return n?{type:"link",asin:n[1].toUpperCase()}:$G.test(t)?{type:"badlink"}:BG.test(t)&&/\d/.test(t)?{type:"asin",asin:t.toUpperCase()}:{type:"keyword",query:t}}function Gb(e){return e.replace(/["[\]\\]/g,"").replace(/\s+/g," ").trim()}function UG({asin:e}){return`[psfa_product_box asin="${e}"]`}function HG(e){return e==="card"||e==="horizontal"||e==="minimal"}function FG(e){return e==="classic"||e==="editorial"||e==="spotlight"}const Yb="Use a number from 0 to 5, like 4.5.",dk="Use a whole number, like 1250.";function fk(e){const t=e.trim();if(t==="")return"";if(!/^\d+(?:\.\d+)?$|^\.\d+$/.test(t))return Yb;const n=Number(t);return n>=0&&n<=5?"":Yb}function Kb(e){return e.trim().replace(/[,\s]/g,"")}function mk(e){const t=Kb(e);return t===""?"":!/^\d{1,10}$/.test(t)||Number(t)>2147483647?dk:""}function VG(e){const t=new URL(e.ajaxUrl,typeof window<"u"?window.location.href:void 0),n=t.searchParams;n.set("action","psfa_box_preview"),n.set("nonce",e.nonce),n.set("asin",e.asin),e.style!=="card"&&n.set("style",e.style),e.look&&e.look!=="classic"&&n.set("look",e.look);const a=e.allowButton?Gb(e.button):"";return a&&n.set("button",a),n.set("title",e.title.trim()),n.set("rating",e.rating.trim()),n.set("reviews",Kb(e.reviews)),e.sendBadge&&n.set("badge",e.badge||"none"),t.toString()}function GG(e){const t=new URL(e.ajaxUrl,typeof window<"u"?window.location.href:void 0);return t.searchParams.set("action","psfa_appearance_preview"),t.searchParams.set("nonce",e.nonce),t.searchParams.set("state",JSON.stringify(e.state)),t.toString()}function YG(e){const t=(e||"www.amazon.com").replace(/^www\./i,"");return t.charAt(0).toUpperCase()+t.slice(1)}const wk=[{id:"none",label:"No badge"},{id:"best_value",label:"Best Value"},{id:"editors_choice",label:"Editor's Choice"},{id:"best_rated",label:"Best Rated"},{id:"budget_pick",label:"Budget Pick"},{id:"premium_pick",label:"Premium Pick"}];function KG(e){var t;return((t=wk.find(n=>n.id===e))==null?void 0:t.label)??""}const qG=/^(?:B0[A-Z0-9]*|\d+X?)$/i,XG=/^(?:https?:|www\.)|amazon\.|amzn\.|\//i;function wu(e){const t=e.trim();return t.length<2||XG.test(t)||qG.test(t)?!1:Pm(t).type==="keyword"}const zm="Boxes on your site keep showing products that are still cached. The rest show as temporarily unavailable until searches start again.",pk="To keep going now, connect your own Creators API credentials, which PaapiPlugin doesn't cap.",hk=e=>new Intl.NumberFormat("en-US").format(e);function qb(e){return e?`This month's ${hk(e)} searches are used up`:"This month's searches are used up"}function WG({path:e,premium:t,quota:n}){return e!=="managed"?{tone:"bad",title:"Amazon is limiting requests right now",text:"Wait a minute, then search again. Nothing is wrong with your connection."}:(n==null?void 0:n.scope)==="pool"?{tone:"bad",title:qb(n.monthlyLimit??n.limit),text:`They're shared by every site on your Agency license, so new products can't load on any of them. ${zm} Searches start again in your next monthly period.`}:t?{tone:"bad",title:qb((n==null?void 0:n.monthlyLimit)??(n==null?void 0:n.limit)),text:`${zm} Searches start again in your next monthly period. ${pk}`}:n!=null&&n.monthlyLimit!=null&&n.usedMonth!=null&&n.usedMonth>=n.monthlyLimit?{tone:"bad",title:qb(n==null?void 0:n.monthlyLimit),text:`${zm} Searches start again in your next monthly period. ${pk}`}:{tone:"bad",title:n!=null&&n.limit?`Today's ${hk(n.limit)} searches are used up`:"Today's searches are used up",text:`${zm} Search again tomorrow. To search more today, connect your own Creators API credentials.`}}function gk(e){switch(e.code){case"short_link":return{tone:"warn",title:"Short links can't be read here",text:"Open the amzn.to link in your browser, then copy the full address or the ASIN from the product page."};case"not_found":return e.kind==="keyword"?{tone:"warn",title:`No products match "${e.query??""}"`,text:"Try fewer or different words, or paste the product's Amazon link."}:{tone:"bad",title:`We couldn't find ASIN ${e.asin??""}`,text:`Check that it has 10 characters and comes from ${e.store||"Amazon.com"}, the store your tag uses. Or search by keyword instead.`};case"quota":return WG(e);default:return{tone:"bad",title:"Amazon couldn't run this search right now",text:"Try again in a minute, or paste the product's Amazon link instead."}}}function Xi({name:e,label:t,value:n,options:a,onChange:r,full:s,className:i}){return o.jsx("div",{role:"radiogroup","aria-label":t,className:E("tw:inline-flex tw:min-w-0 tw:gap-0.5 tw:rounded-[10px] tw:bg-secondary tw:p-[3px]",s&&"tw:flex tw:w-full",i),children:a.map(l=>{const c=`${e}-${l.value}`;return o.jsxs("span",{className:E("tw:relative tw:flex tw:min-w-0",s&&"tw:flex-1"),children:[o.jsx("input",{type:"radio",id:c,name:e,value:l.value,checked:n===l.value,disabled:l.disabled,onChange:()=>r(l.value),className:"tw:peer tw:absolute tw:inset-0 tw:m-0 tw:size-full tw:cursor-pointer tw:touch-manipulation tw:opacity-0 tw:disabled:cursor-not-allowed"}),o.jsxs("label",{htmlFor:c,className:"tw:pointer-events-none tw:flex tw:h-8 tw:w-full tw:min-w-0 tw:items-center tw:justify-center tw:gap-1.5 tw:whitespace-nowrap tw:rounded-lg tw:px-3 tw:text-[13px] tw:font-medium tw:text-muted-foreground tw:select-none tw:transition-colors tw:duration-150 tw:peer-checked:bg-card tw:peer-checked:text-foreground tw:peer-checked:shadow-psfa-xs tw:peer-hover:text-foreground tw:peer-focus-visible:ring-2 tw:peer-focus-visible:ring-ring tw:peer-disabled:opacity-60 tw:max-[782px]:h-11 tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",children:[l.icon,l.label,l.badge]})]},l.value)})})}const xk="tw:touch-manipulation tw:select-none tw:transition-[transform,background-color,border-color,color] tw:duration-[120ms] tw:ease-psfa-out tw:active:scale-[0.97] tw:motion-reduce:active:scale-100 tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2 tw:focus-visible:ring-offset-background",Lm=`tw:inline-flex tw:h-[38px] tw:shrink-0 tw:items-center tw:justify-center tw:gap-1.5 tw:whitespace-nowrap tw:rounded-[10px] tw:border-0 tw:px-4 tw:text-sm tw:font-medium tw:no-underline tw:cursor-pointer tw:max-[782px]:h-11 tw:[&_svg]:size-4 tw:[&_svg]:shrink-0 tw:aria-disabled:cursor-not-allowed tw:aria-disabled:opacity-60 tw:disabled:opacity-60 ${xk}`,pu=`${Lm} tw:bg-primary tw:text-primary-foreground tw:shadow-psfa-xs tw:hover:bg-primary-hover tw:hover:text-primary-foreground`,Aa=`${Lm} tw:border tw:border-solid tw:border-border-strong tw:bg-card tw:text-foreground tw:shadow-psfa-xs tw:hover:bg-accent tw:hover:text-foreground`,bk=`${Lm} tw:bg-transparent tw:text-foreground tw:shadow-none tw:hover:bg-accent tw:hover:text-foreground`,Xa="tw:h-8 tw:px-3 tw:text-[13px] tw:max-[782px]:h-10",ZG=`tw:inline-flex tw:size-9 tw:shrink-0 tw:items-center tw:justify-center tw:rounded-lg tw:border-0 tw:bg-transparent tw:p-0 tw:text-muted-foreground tw:cursor-pointer tw:hover:bg-accent tw:hover:text-foreground tw:data-[state=open]:bg-accent tw:data-[state=open]:text-foreground tw:max-[782px]:size-11 tw:[&_svg]:size-[18px] ${xk}`,hu="tw:inline tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:font-medium tw:text-link tw:underline tw:decoration-1 tw:underline-offset-[3px] tw:touch-manipulation tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",Rr="tw:min-w-0 tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:shadow-psfa-card",Im="tw:flex tw:min-h-[56px] tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-2 tw:border-0 tw:border-b tw:border-solid tw:border-border tw:px-5 tw:py-3",$m="tw:m-0 tw:p-0 tw:text-base tw:font-semibold tw:leading-snug tw:text-foreground",Bm="tw:p-5 tw:max-[560px]:p-4",Xb="tw:m-0 tw:p-0 tw:text-[15px] tw:font-semibold tw:leading-snug tw:text-foreground",fs="tw:mb-1.5 tw:flex tw:items-center tw:gap-2 tw:text-sm tw:font-medium tw:text-foreground",Yn="tw:m-0 tw:mt-1.5 tw:text-[13px] tw:leading-normal tw:text-muted-foreground",gu="tw:m-0 tw:mt-1.5 tw:flex tw:items-start tw:gap-1.5 tw:text-[13px] tw:leading-normal tw:text-destructive",ms="tw:h-10 tw:w-full tw:min-w-0 tw:rounded-[10px] tw:border tw:border-solid tw:border-input tw:bg-card tw:px-3 tw:text-base tw:text-foreground tw:shadow-none tw:outline-none tw:transition-[border-color,box-shadow] tw:duration-150 tw:placeholder:text-muted-foreground tw:focus:border-ring tw:focus:ring-2 tw:focus:ring-ring/40 tw:disabled:cursor-not-allowed tw:disabled:bg-muted tw:disabled:text-muted-foreground tw:aria-[invalid=true]:border-destructive tw:min-[783px]:text-sm tw:max-[782px]:h-11",vk="tw:inline-flex tw:h-[18px] tw:items-center tw:rounded-full tw:bg-pro-soft tw:px-1.5 tw:text-[10.5px] tw:font-semibold tw:tracking-[0.04em] tw:text-pro",Um={style:"card",look:"classic",button:"",title:"",rating:"",reviews:"",badge:"none"};function Wb({className:e}){return o.jsxs("span",{className:E(vk,e),children:["PRO",o.jsx("span",{className:"tw:sr-only",children:" (Premium)"})]})}const QG="tw:mt-[18px] tw:border-0 tw:border-t tw:border-solid tw:border-border tw:pt-[18px]";function JG({settings:e,onChange:t,caps:n,errors:a}){const r=n.activePath==="managed",s=n.canBadge,i=s?null:o.jsx(Wb,{className:"tw:max-[400px]:hidden"}),l=!s&&e.look!=="classic"?"This box shows as Classic until Pro is active.":s?e.look==="spotlight"?"Works best as one highlighted box per post.":"":"Editorial and Spotlight come with Pro.",c=e.title.length,d=a.rating||a.reviews,m=r?"On the Managed API the button always says this, because prices aren't shown.":n.canCustomButton?"Leave empty to use the text from Appearance.":n.buttonText?`Free boxes use “${n.buttonText}”.`:"Free boxes use the button text from Appearance.";return o.jsxs("section",{"aria-labelledby":"setup-title",className:Rr,children:[o.jsx("div",{className:Im,children:o.jsx("h2",{id:"setup-title",className:$m,children:"Box"})}),o.jsxs("div",{className:Bm,children:[o.jsxs("div",{children:[o.jsx("h3",{className:Xb,children:"Layout and button"}),o.jsx("p",{className:E(Yn,"tw:mb-3 tw:mt-1"),children:"Saved with the box, so every post that shows it changes when you save."}),o.jsxs("div",{children:[o.jsx("span",{className:fs,id:"box-style-label",children:"Layout"}),o.jsx(Xi,{name:"box-style",label:"Layout",full:!0,value:e.style,onChange:f=>t("style",f),options:[{value:"card",label:"Card"},{value:"horizontal",label:"Horizontal"},{value:"minimal",label:"Minimal"}]})]}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsx("span",{className:fs,id:"box-look-label",children:"Style"}),o.jsx(Xi,{name:"box-look",label:"Style",full:!0,value:e.look,onChange:f=>t("look",f),options:[{value:"classic",label:"Classic"},{value:"editorial",label:"Editorial",badge:i,disabled:!s},{value:"spotlight",label:"Spotlight",badge:i,disabled:!s}]}),l?o.jsx("p",{id:"box-look-help",className:Yn,children:l}):null]}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsxs("label",{htmlFor:"box-button",className:fs,children:["Button text ",!r&&!n.canCustomButton?o.jsx(Wb,{}):null]}),o.jsx("input",{id:"box-button",type:"text",maxLength:100,disabled:!n.canCustomButton,value:r?n.buttonText||"Check price on Amazon":n.canCustomButton?e.button:"",placeholder:r?void 0:n.buttonText||void 0,"aria-invalid":a.button?"true":"false","aria-describedby":"box-button-help",onChange:f=>t("button",f.target.value),className:ms}),o.jsx("p",{id:"box-button-help",className:a.button?gu:Yn,children:a.button||m})]})]}),o.jsxs("div",{className:QG,children:[o.jsx("h3",{className:Xb,children:"Product details"}),o.jsx("p",{className:E(Yn,"tw:mb-3 tw:mt-1"),children:"Saved with the product, so they're the same on every post that shows it."}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-baseline tw:gap-2",children:[o.jsx("label",{htmlFor:"box-title",className:fs,children:"Title"}),o.jsx("span",{"aria-live":"polite",className:E("tw:ml-auto tw:text-xs tw:tabular-nums tw:text-muted-foreground",c>80&&"tw:text-warning"),children:c?fa(c,"character","characters"):""})]}),o.jsx("input",{id:"box-title",type:"text",maxLength:255,value:e.title,"aria-invalid":a.title?"true":"false","aria-describedby":"box-title-help",onChange:f=>t("title",f.target.value),className:ms}),o.jsx("p",{id:"box-title-help",className:a.title?gu:Yn,children:a.title||(c>80?"Long titles get cut off on the box. Aim for under 80 characters.":"Leave empty to use Amazon's title.")})]}),o.jsxs("div",{className:"tw:mt-4 tw:grid tw:grid-cols-2 tw:gap-3",children:[o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("label",{htmlFor:"box-rating",className:fs,children:"Rating"}),o.jsx("input",{id:"box-rating",type:"text",inputMode:"decimal",placeholder:"4.5",value:e.rating,"aria-invalid":a.rating?"true":"false","aria-describedby":"box-rating-help",onChange:f=>t("rating",f.target.value),className:ms})]}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("label",{htmlFor:"box-reviews",className:fs,children:"Review count"}),o.jsx("input",{id:"box-reviews",type:"text",inputMode:"numeric",placeholder:"1250",value:e.reviews,"aria-invalid":a.reviews?"true":"false","aria-describedby":"box-rating-help",onChange:f=>t("reviews",f.target.value),className:E(ms,"tw:tabular-nums")})]})]}),d?o.jsxs("p",{id:"box-rating-help",className:gu,children:[o.jsx(co,{"aria-hidden":"true",className:"tw:mt-0.5 tw:size-4 tw:shrink-0"}),d]}):o.jsx("p",{id:"box-rating-help",className:Yn,children:"Amazon doesn't reliably send ratings, so you set them here. Leave empty to hide the stars."}),o.jsxs("div",{className:"tw:mt-4",children:[o.jsxs("label",{htmlFor:"box-badge",className:fs,children:["Badge ",n.canBadge?null:o.jsx(Wb,{})]}),o.jsxs(Vt,{value:n.canBadge&&e.badge||"none",disabled:!n.canBadge,onValueChange:f=>t("badge",f),children:[o.jsx(zt,{id:"box-badge","aria-describedby":"box-badge-help",className:E(ms,"tw:flex tw:items-center tw:justify-between tw:shadow-none"),children:o.jsx(Gt,{})}),o.jsx(Lt,{className:"psfa-menu tw:bg-popover tw:text-popover-foreground",children:o.jsx(Yf,{children:wk.map(f=>o.jsx(Tt,{value:f.id,className:"psfa-menu-item tw:min-h-9 tw:max-[782px]:min-h-11",children:f.label},f.id))})})]}),o.jsx("p",{id:"box-badge-help",className:a.badge?gu:Yn,children:a.badge||(e.style==="minimal"&&n.canBadge&&e.badge!=="none"?"The minimal layout doesn't show badges.":"Shown as a ribbon on the box.")})]}),n.canBadge?null:o.jsxs("p",{className:"tw:m-0 tw:mt-2.5 tw:text-[13px] tw:text-muted-foreground",children:[r?"Badges come with Premium.":"Badges and custom button text come with Premium."," ",o.jsxs("a",{href:cs.upgrade,target:"_blank",rel:"noopener noreferrer",className:"tw:font-medium tw:text-link",children:["See Premium",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]})]})]})]})]})}const yk="cubic-bezier(0.23, 1, 0.32, 1)";function eY(){return typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function tY(){const e=u.useRef(null),t=u.useRef(null);return u.useEffect(()=>{const n=e.current,a=t.current;if(!n||!a||typeof n.animate!="function")return;if(eY()){const i=n.animate([{opacity:0},{opacity:1}],{duration:200,easing:"ease",fill:"backwards"});return()=>i.cancel()}const r=n.animate([{opacity:0,transform:"scale(0.9)"},{opacity:1,transform:"scale(1)"}],{duration:260,easing:yk,fill:"backwards"}),s=a.animate([{strokeDashoffset:32},{strokeDashoffset:0}],{duration:340,delay:140,easing:yk,fill:"backwards"});return()=>{r.cancel(),s.cancel()}},[]),o.jsx("div",{"aria-hidden":"true",className:"tw:mb-[18px] tw:mt-1 tw:size-14",children:o.jsxs("svg",{viewBox:"0 0 56 56",className:"tw:block tw:size-full tw:overflow-visible",children:[o.jsx("circle",{ref:e,cx:"28",cy:"28",r:"26",className:"tw:fill-success tw:[transform-origin:28px_28px]"}),o.jsx("path",{ref:t,d:"M17.5 28.5l7 7 14-15",strokeDasharray:"32",strokeDashoffset:"0",className:"tw:fill-none tw:stroke-primary-foreground tw:stroke-[3.5] tw:[stroke-linecap:round] tw:[stroke-linejoin:round]"})]})})}function nY({onHome:e,onAll:t}){return o.jsx("section",{"aria-labelledby":"done-title",className:Rr,children:o.jsxs("div",{className:Bm,children:[o.jsx(tY,{}),o.jsx("h2",{id:"done-title",tabIndex:-1,"data-step-heading":"true",className:"tw:m-0 tw:mb-1.5 tw:p-0 tw:outline-none tw:text-xl tw:font-semibold tw:text-foreground",children:"Your box is ready"}),o.jsx("p",{className:"tw:m-0 tw:mb-4 tw:text-sm tw:text-muted-foreground",children:"Visitors see the box once the post it's in is published. Home shows your next step."}),o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:gap-2",children:[o.jsx("button",{type:"button",onClick:e,className:Aa,children:"Back to Home"}),o.jsx("button",{type:"button",onClick:t,className:E(bk),children:"See all boxes"})]})]})})}function aY(e){const{ajaxUrl:t,nonce:n,debounceMs:a=300,minLength:r=2}=e,[s,i]=u.useState([]),[l,c]=u.useState(!1),[d,m]=u.useState(-1),f=u.useRef(void 0),w=u.useRef(0),p=u.useCallback(async g=>{var S;if(g.length<r){i([]);return}const v=++w.current;c(!0);try{const N=new URLSearchParams({action:"psfa_autocomplete",nonce:n,q:g}),A=await fetch(`${t}?${N.toString()}`);if(v!==w.current)return;const j=await A.json();if(v!==w.current)return;j.success&&((S=j.data)!=null&&S.suggestions)?(i(j.data.suggestions),m(-1)):i([])}catch{v===w.current&&i([])}finally{v===w.current&&c(!1)}},[t,n,r]),x=u.useCallback(g=>{if(f.current&&clearTimeout(f.current),g.length<r){i([]);return}f.current=setTimeout(()=>{p(g)},a)},[p,a,r]),b=u.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=void 0),w.current++,i([]),m(-1),c(!1)},[]),y=u.useCallback(g=>{if(s.length!==0)switch(g.key){case"ArrowDown":g.preventDefault(),m(v=>Math.min(v+1,s.length-1));break;case"ArrowUp":g.preventDefault(),m(v=>Math.max(v-1,-1));break;case"Escape":g.preventDefault(),b();break}},[s.length,b]),h=u.useCallback(()=>d>=0&&d<s.length?s[d]:null,[d,s]);return u.useEffect(()=>()=>{f.current&&clearTimeout(f.current),w.current++},[]),{suggestions:s,isLoading:l,selectedIndex:d,setSelectedIndex:m,fetchSuggestions:x,clearSuggestions:b,handleKeyDown:y,getSelectedSuggestion:h}}let Hm=null;function rY(){return Hm||(Hm=No("psfa_refresh_nonce",{},"").then(e=>{if(!(e!=null&&e.nonce))throw new Error("no nonce");return e.nonce}).catch(e=>{throw Hm=null,e})),Hm}const oY="Type a keyword, or paste an Amazon link or ASIN.",sY="This link isn't an Amazon product page. Open the product on Amazon and copy its address, or paste its ASIN.";function iY({text:e,typed:t}){const n=t.trim();return n&&e.toLowerCase().startsWith(n.toLowerCase())?o.jsxs("span",{className:"tw:min-w-0 tw:[overflow-wrap:anywhere]",children:[e.slice(0,n.length),o.jsx("span",{className:"tw:font-semibold",children:e.slice(n.length)})]}):o.jsx("span",{className:"tw:min-w-0 tw:[overflow-wrap:anywhere]",children:e})}function Sk({idPrefix:e,initial:t="",autoFocus:n,onSubmit:a,footer:r}){const[s,i]=u.useState(t),[l,c]=u.useState(""),[d,m]=u.useState(""),[f,w]=u.useState(!1),p=u.useRef(t),x=`${e}-input`,b=`${u.useId().replace(/:/g,"")}-${e}-suggestions`,y=s.trim()?Pm(s):null,h=aY({ajaxUrl:Nt().ajaxUrl??"",nonce:d}),g=f&&h.suggestions.length>0&&wu(s),v=g&&h.selectedIndex>=0?`${b}-${h.selectedIndex}`:void 0,{fetchSuggestions:S}=h;u.useEffect(()=>{d&&wu(p.current)&&S(p.current.trim())},[d,S]);const N=()=>{h.clearSuggestions(),w(!1)},A=z=>{if(!wu(z)){N();return}if(w(!0),d){S(z.trim());return}rY().then(m).catch(()=>{})},j=z=>{if(N(),!z.trim()){c(oY);return}if(Pm(z).type==="badlink"){c(sY);return}c(""),a(z.trim())},C=z=>{i(z),p.current=z,j(z)},R=z=>{z.preventDefault(),j(s)},M=z=>{if(!g){z.key==="ArrowDown"&&h.suggestions.length>0&&wu(s)&&(z.preventDefault(),w(!0));return}if(z.key==="Enter"&&h.selectedIndex>=0){z.preventDefault(),C(h.suggestions[h.selectedIndex]);return}if(z.key==="Escape"){z.preventDefault(),N();return}h.handleKeyDown(z)};return o.jsxs("form",{onSubmit:R,noValidate:!0,role:"search","aria-label":"Find a product on Amazon",children:[o.jsx("label",{htmlFor:x,className:"tw:mb-1.5 tw:block tw:text-sm tw:font-medium tw:text-foreground",children:"Find a product"}),o.jsxs("div",{className:"tw:relative",children:[o.jsx(yc,{"aria-hidden":"true",className:"tw:pointer-events-none tw:absolute tw:left-3.5 tw:top-1/2 tw:size-[18px] tw:-translate-y-1/2 tw:text-muted-foreground"}),o.jsx("input",{id:x,type:"search",role:"combobox",value:s,autoFocus:n,autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"search",placeholder:"Search Amazon, or paste a product link or ASIN","aria-expanded":g?"true":"false","aria-controls":b,"aria-autocomplete":"list","aria-activedescendant":v,"aria-invalid":l?"true":"false","aria-describedby":`${x}-help${l?` ${x}-error`:""}`,onChange:z=>{i(z.target.value),p.current=z.target.value,l&&c(""),A(z.target.value)},onKeyDown:M,onBlur:()=>w(!1),onFocus:()=>{wu(s)&&h.suggestions.length>0&&w(!0)},className:E(ms,"tw:h-12 tw:pl-[42px] tw:pr-[92px] tw:text-[15px] tw:max-[782px]:h-[52px] tw:max-[782px]:text-base tw:[&::-webkit-search-cancel-button]:hidden")}),o.jsx("button",{type:"submit",className:E(pu,"tw:absolute tw:right-1.5 tw:top-1/2 tw:h-9 tw:min-w-[72px] tw:-translate-y-1/2 tw:max-[782px]:h-10"),children:"Find"}),g?o.jsx("ul",{id:b,role:"listbox","aria-label":"Suggestions",className:"psfa-menu tw:absolute tw:inset-x-0 tw:top-full tw:z-30 tw:m-0 tw:mt-1.5 tw:max-h-[min(320px,50vh)] tw:list-none tw:overflow-y-auto tw:overscroll-contain tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-popover tw:p-1.5 tw:text-popover-foreground tw:shadow-psfa-pop",children:h.suggestions.map((z,B)=>o.jsxs("li",{id:`${b}-${B}`,role:"option","aria-selected":B===h.selectedIndex?"true":"false",onMouseDown:I=>I.preventDefault(),onMouseMove:()=>{B!==h.selectedIndex&&h.setSelectedIndex(B)},onClick:()=>C(z),className:E("psfa-menu-item tw:m-0 tw:flex tw:min-h-9 tw:cursor-pointer tw:select-none tw:items-center tw:gap-2.5 tw:rounded-md tw:px-2.5 tw:py-1.5 tw:text-sm tw:text-foreground tw:touch-manipulation tw:max-[782px]:min-h-11 tw:max-[782px]:text-[15px]",B===h.selectedIndex&&"tw:bg-accent"),children:[o.jsx(yc,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0 tw:text-muted-foreground"}),o.jsx(iY,{text:z,typed:s})]},`${B}-${z}`))}):null]}),o.jsx("span",{role:"status",className:"tw:sr-only",children:g?`${h.suggestions.length} suggestions. Use the up and down arrows to choose one.`:""}),l?o.jsxs("p",{id:`${x}-error`,className:gu,children:[o.jsx(co,{"aria-hidden":"true",className:"tw:mt-0.5 tw:size-4 tw:shrink-0"}),l]}):null,(y==null?void 0:y.type)==="link"?o.jsxs("p",{role:"status",className:"tw:m-0 tw:mt-2 tw:inline-flex tw:items-center tw:gap-1.5 tw:text-[13px] tw:text-success",children:[o.jsx(FP,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0"}),"Link recognized. ASIN ",o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:y.asin})]}):null,o.jsx("p",{id:`${x}-help`,className:Yn,children:"Have a SKU or product code? On Amazon it's the ASIN: 10 letters and numbers, found in the product link after /dp/."}),r]})}function Zb({src:e,className:t}){const[n,a]=u.useState(!1);return o.jsx("span",{className:E("tw:flex tw:size-[76px] tw:shrink-0 tw:items-center tw:justify-center tw:overflow-hidden tw:rounded-lg tw:border tw:border-solid tw:border-border tw:bg-card",t),children:e&&!n?o.jsx("img",{src:e,alt:"",loading:"lazy",onError:()=>a(!0),className:"tw:size-full tw:object-contain tw:p-1"}):o.jsx(Zo,{"aria-hidden":"true",className:"tw:size-1/3 tw:text-muted-foreground"})})}function lY({query:e,results:t,onPick:n}){return o.jsxs(o.Fragment,{children:[o.jsx("p",{role:"status",className:`${Yn} tw:mt-3.5 tw:[overflow-wrap:anywhere]`,children:`Results for "${e}"`}),o.jsx("ul",{className:"tw:m-0 tw:mt-1.5 tw:list-none tw:overflow-hidden tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:p-0",children:t.map(a=>o.jsx("li",{className:"tw:m-0 tw:[&+&]:border-0 tw:[&+&]:border-t tw:[&+&]:border-solid tw:[&+&]:border-border",children:o.jsxs("button",{type:"button",onClick:()=>n(a),className:"tw:grid tw:w-full tw:cursor-pointer tw:grid-cols-[48px_minmax(0,1fr)_auto] tw:items-center tw:gap-3 tw:border-0 tw:bg-card tw:px-3 tw:py-2.5 tw:text-left tw:text-foreground tw:touch-manipulation tw:transition-colors tw:duration-150 tw:hover:bg-accent tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring tw:max-[782px]:min-h-14 tw:[li:first-child>&]:rounded-t-[9px] tw:[li:last-child>&]:rounded-b-[9px]",children:[o.jsx(Zb,{src:a.image,className:"tw:size-12"}),o.jsxs("span",{className:"tw:min-w-0",children:[o.jsx("span",{className:"tw:line-clamp-2 tw:text-[13.5px] tw:font-medium tw:[overflow-wrap:anywhere]",children:a.title||`ASIN ${a.asin}`}),o.jsxs("span",{className:"tw:block tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono",children:a.asin}),a.hasBox?", you have a box for this":""]})]}),o.jsx("span",{className:"tw:whitespace-nowrap tw:text-[13px] tw:font-medium tw:text-link",children:a.hasBox?"Open":"Choose"})]})},a.asin))})]})}const jk={info:{box:"tw:bg-info-soft",icon:"tw:text-info"},warn:{box:"tw:bg-warning-soft",icon:"tw:text-warning"},bad:{box:"tw:bg-destructive-soft",icon:"tw:text-destructive"}};function ma({tone:e,title:t,children:n,actions:a,className:r}){const s=e==="bad"?co:e==="warn"?Sc:lf;return o.jsxs("div",{role:e==="bad"?"alert":"status",className:E("tw:flex tw:gap-2.5 tw:rounded-[10px] tw:px-3.5 tw:py-3 tw:text-[13.5px] tw:leading-normal tw:text-foreground",jk[e].box,r),children:[o.jsx(s,{"aria-hidden":"true",className:E("tw:mt-px tw:size-[18px] tw:shrink-0",jk[e].icon)}),o.jsxs("div",{className:"tw:min-w-0 tw:flex-1 tw:[overflow-wrap:anywhere]",children:[t?o.jsx("strong",{className:"tw:block tw:font-semibold",children:t}):null,n?o.jsx("div",{className:t?"tw:mt-0.5":void 0,children:n}):null,a?o.jsx("div",{className:"tw:mt-2 tw:flex tw:flex-wrap tw:gap-3",children:a}):null]})]})}const cY="The plugin settings did not load. Reload this page and try again.";function uY(e){return`<!-- wp:shortcode --> 475 475 ${e} 476 <!-- /wp:shortcode -->`}function cY(){const e=Nt().ajaxUrl;if(!e)return null;try{return new URL("./",new URL(e,window.location.href))}catch{return null}}async function uY({title:e,content:t}){const n=cY();if(!n)throw new Error(iY);const a=await fetch(new URL("admin-ajax.php?action=rest-nonce",n).toString(),{credentials:"same-origin"}),r=(await a.text()).trim();if(!a.ok||!/^[a-f0-9]{10}$/i.test(r))throw new Error("Your login could not be confirmed. Reload this page and try again.");const s=await fetch(new URL("../index.php?rest_route=/wp/v2/posts",n).toString(),{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":r},body:JSON.stringify({title:e,status:"draft",content:t})});let i=null;try{i=await s.json()}catch{i=null}if(!s.ok||!(i!=null&&i.id))throw new Error((i==null?void 0:i.message)||`Your site answered with HTTP ${s.status}.`);return new URL(`post.php?post=${i.id}&action=edit`,n).toString()}function dY(e){if(!e)return;const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function fY(e){if(typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}async function mY(e,t){var a;return((a=navigator.clipboard)!=null&&a.writeText?await navigator.clipboard.writeText(e).then(()=>!0,()=>!1):!1)||fY(e)?!0:(dY(t),!1)}const jk="tw:col-start-1 tw:row-start-1 tw:transition-[opacity,transform] tw:duration-[160ms] tw:ease-psfa-out tw:motion-reduce:transition-none";function Nk({text:e,fallbackRef:t,label:n="Copy shortcode",ariaLabel:a,small:r,className:s}){const[i,l]=d.useState(!1),c=d.useRef(0);d.useEffect(()=>()=>window.clearTimeout(c.current),[]);const u=async()=>{await mY(e,t==null?void 0:t.current)?(l(!0),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!1),1800)):_e("Copy didn't work here. The shortcode is selected: press Ctrl+C or Cmd+C.")};return o.jsxs("button",{type:"button","aria-label":a,onClick:u,className:E(Aa,r&&Xa,s),children:[o.jsxs("span",{"aria-hidden":"true",className:"tw:inline-grid",children:[o.jsx(OP,{className:E(jk,i&&"tw:scale-75 tw:opacity-0")}),o.jsx(yr,{className:E(jk,"tw:text-success",!i&&"tw:scale-75 tw:opacity-0")})]}),o.jsx("span",{"aria-live":"polite",children:i?"Copied":n})]})}const wY={block:["Open the post and click + where the box should go.","Add a Shortcode block and paste into it.","Update the post."],classic:["Open the post and put the cursor where the box should go.","Paste the shortcode on its own line.","Update the post."],elementor:["Edit the page with Elementor.","Drag a Shortcode widget to where the box should go, then paste into it.","Click Update."]};function pY({shortcode:e,postTitle:t,onChangeBox:n,onLater:a}){const r=d.useRef(null),[s,i]=d.useState("block"),[l,c]=d.useState({status:"idle"}),u=async()=>{if(l.status!=="creating"){c({status:"creating"});try{const m=await uY({title:t,content:lY(e)});c({status:"done",editUrl:m})}catch(m){c({status:"error",message:m instanceof Error?m.message:"Something went wrong."})}}};return o.jsxs("section",{"aria-labelledby":"place-title",className:Rr,children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"place-title",tabIndex:-1,"data-step-heading":"true",className:E($m,"tw:outline-none"),children:"Place it"}),o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5 tw:rounded-full tw:bg-success-soft tw:px-2.5 tw:py-0.5 tw:text-xs tw:font-medium tw:text-success",children:[o.jsx("span",{"aria-hidden":"true",className:"tw:size-1.5 tw:rounded-full tw:bg-success"}),"Saved"]})]}),o.jsxs("div",{className:Bm,children:[o.jsxs("div",{className:"tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:bg-muted tw:px-3.5 tw:pb-3.5 tw:pt-3",children:[o.jsxs("div",{className:"tw:mb-2.5 tw:flex tw:items-center tw:justify-between tw:gap-3",children:[o.jsx("span",{id:"shortcode-label",className:"tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-muted-foreground",children:"Shortcode"}),o.jsx(Nk,{text:e,fallbackRef:r,small:!0})]}),o.jsx("code",{ref:r,"aria-labelledby":"shortcode-label",className:"tw:block tw:select-all tw:rounded-md tw:border tw:border-solid tw:border-border tw:bg-card tw:px-3 tw:py-2.5 tw:font-mono tw:text-sm tw:leading-normal tw:text-foreground tw:[overflow-wrap:anywhere]",children:e})]}),o.jsx("h3",{className:E(Xb,"tw:mb-2.5 tw:mt-[22px]"),children:"Where to paste"}),o.jsx(Xi,{name:"paste-guide",label:"Editor",full:!0,value:s,onChange:i,options:[{value:"block",label:"Block editor"},{value:"classic",label:"Classic editor"},{value:"elementor",label:"Elementor"}]}),o.jsx("ol",{className:"tw:m-0 tw:mt-3 tw:grid tw:list-decimal tw:gap-2 tw:pl-[22px] tw:text-sm tw:text-foreground tw:marker:tabular-nums tw:marker:text-muted-foreground",children:wY[s].map(m=>o.jsx("li",{className:"tw:m-0",children:m},m))}),o.jsxs("div",{className:"tw:mt-[18px] tw:grid tw:justify-items-start tw:gap-2.5",children:[l.status==="done"?o.jsxs("div",{role:"status",className:"tw:text-sm",children:[o.jsxs("p",{className:"tw:m-0 tw:flex tw:flex-wrap tw:items-center tw:gap-1.5 tw:text-foreground",children:[o.jsx(kP,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0 tw:text-success"}),o.jsx("span",{children:"Draft post created."}),o.jsxs("a",{href:l.editUrl,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:gap-1 tw:font-medium tw:text-link",children:["Open it in the editor",o.jsx(pN,{"aria-hidden":"true",className:"tw:size-3.5"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})]}),o.jsx("p",{className:Yn,children:"Publish it when it looks right."})]}):o.jsx("button",{type:"button","aria-disabled":l.status==="creating"?"true":void 0,onClick:u,className:E(Aa,Xa),children:l.status==="creating"?"Creating your post...":"Create a post with this box"}),l.status==="error"?o.jsxs(ma,{tone:"bad",title:"The post wasn't created",className:"tw:w-full",children:[l.message," You can still paste the shortcode into any post."]}):null]}),o.jsx("p",{className:E(Yn,"tw:mt-[18px]"),children:"Not ready to paste? The box is saved. Copy the shortcode from Product boxes any time."}),o.jsxs("div",{className:"tw:mt-3 tw:flex tw:flex-wrap tw:gap-2",children:[o.jsxs("button",{type:"button",onClick:n,className:E(Aa,Xa),children:[o.jsx(vN,{"aria-hidden":"true"}),"Change the box"]}),o.jsx("button",{type:"button",onClick:a,className:E(xk,Xa),children:"Place it later"})]})]})]})}const Ck={classic:"tw:w-full tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card",editorial:"tw:w-full tw:border-0 tw:border-y tw:border-solid tw:border-border tw:py-5",spotlight:"tw:w-full tw:overflow-hidden tw:rounded-xl tw:border-2 tw:border-solid tw:border-primary tw:bg-card"},hY={classic:"",editorial:"tw:rounded-lg tw:bg-muted tw:p-5",spotlight:"tw:bg-primary/10 tw:px-6 tw:pt-7 tw:pb-5"};function Qb({className:e}){return o.jsx(bt,{className:E("tw:h-3 tw:rounded-full",e)})}function Jb({title:e}){return o.jsxs(o.Fragment,{children:[Array.from({length:e},(t,n)=>o.jsx(Qb,{className:E("tw:h-3.5",n===e-1?"tw:w-3/4":"tw:w-full")},n)),o.jsx(Qb,{className:"tw:w-1/3"}),o.jsx(Qb,{className:"tw:w-2/5"})]})}function ev({centered:e,look:t="classic",short:n=!1}){return o.jsxs(o.Fragment,{children:[o.jsx(bt,{className:E(t==="classic"?"tw:h-5 tw:w-20":"tw:h-7 tw:w-24","tw:rounded-full",e&&"tw:mx-auto")}),o.jsx(bt,{className:E(n?"tw:ml-auto tw:w-52 tw:max-w-full":"tw:w-full","tw:rounded-lg",t==="classic"?"tw:h-10":t==="spotlight"?"tw:h-12":"tw:h-11")})]})}function gY({layout:e,look:t,row:n}){const a=e==="minimal";return o.jsxs("div",{className:E(Ck[t],e!=="horizontal"&&"tw:mx-auto tw:max-w-[280px]"),children:[t==="spotlight"&&e!=="minimal"?o.jsx("div",{className:"tw:h-9 tw:bg-primary/20"}):null,o.jsxs("div",{className:E("tw:grid",n&&(t==="editorial"?"tw:grid-cols-[3fr_5fr] tw:items-start tw:gap-6":"tw:grid-cols-[9fr_11fr]"),!n&&t==="editorial"&&"tw:gap-5"),children:[o.jsx("div",{className:E(hY[t],a&&"tw:p-3"),children:o.jsx(bt,{className:E("tw:w-full tw:rounded-lg",a?"tw:mx-auto tw:h-[120px] tw:w-[120px]":e==="horizontal"?"tw:h-[220px]":"tw:h-[200px]")})}),o.jsxs("div",{className:E("tw:flex tw:min-w-0 tw:flex-col tw:gap-2.5",t==="spotlight"&&"tw:p-5"),children:[o.jsx(Jb,{title:a?2:3}),o.jsx("div",{className:"tw:mt-1 tw:flex tw:flex-col tw:gap-2.5",children:o.jsx(ev,{centered:!1,look:t,short:n&&t==="editorial"})})]})]})]})}function xY({layout:e,look:t="classic",device:n,style:a}){const r=Ck.classic,s=n==="desktop",i=e==="horizontal"&&s,l=e==="horizontal"||!s;return o.jsx("div",{"data-testid":"preview-skeleton","data-layout":e,"data-look":t,"data-device":n,"aria-hidden":"true",style:a,className:E("psfa-preview-skeleton tw:w-full tw:transition-opacity tw:duration-[180ms] tw:ease-psfa-out",s?"tw:p-6":"tw:p-4",l?s?"tw:max-w-[760px]":"tw:max-w-[375px]":"tw:max-w-[328px]"),children:t!=="classic"?o.jsx(gY,{layout:e,look:t,row:i}):e==="horizontal"?o.jsxs("div",{className:E(r,"tw:flex",i?"tw:flex-row tw:items-stretch":"tw:flex-col"),children:[o.jsx("div",{className:E("tw:p-4",i&&"tw:w-[220px] tw:shrink-0"),children:o.jsx(bt,{className:"tw:h-[160px] tw:w-full tw:rounded-lg"})}),o.jsx("div",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-2.5 tw:p-4",children:o.jsx(Jb,{title:2})}),i?o.jsx("div",{className:"tw:w-px tw:shrink-0 tw:bg-border"}):null,o.jsx("div",{className:E("tw:flex tw:flex-col tw:justify-center tw:gap-2.5 tw:p-4",i&&"tw:w-[220px] tw:shrink-0"),children:o.jsx(ev,{centered:!0})})]}):o.jsxs("div",{className:E(r,"tw:mx-auto tw:max-w-[280px]"),children:[o.jsx("div",{className:E(e==="minimal"?"tw:p-3 tw:pb-0":"tw:p-4 tw:pb-0"),children:o.jsx(bt,{className:E("tw:rounded-lg",e==="minimal"?"tw:mx-auto tw:h-[120px] tw:w-[120px]":"tw:h-[200px] tw:w-full")})}),o.jsxs("div",{className:E("tw:flex tw:flex-col tw:gap-2.5",e==="minimal"?"tw:p-3":"tw:p-4"),children:[o.jsx(Jb,{title:e==="minimal"?2:3}),o.jsx("div",{className:"tw:mt-1 tw:flex tw:flex-col tw:gap-2.5",children:o.jsx(ev,{centered:!0})})]})]})})}const bY={desktop:1280,phone:375},vY={desktop:24,phone:16};function yY({device:e,viewport:t,docHeight:n,box:a,available:r}){const s=vY[e];let i=0,l=0,c=t,u=n;a&&a.width>0&&a.height>0&&(e==="desktop"&&(i=a.left-s,c=a.width+2*s),l=a.top-s,u=a.height+2*s);const m=r>0?Math.min(1,r/c):1;return{x:i,y:l,width:c,height:u,scale:m}}const SY={left:0,right:0,top:0,bottom:0};function jY(e){const t=[];let n=0,a=0;for(let r=0;r<e.length;r+=1){const s=e[r];s==="("?n+=1:s===")"?n-=1:s===","&&n===0&&(t.push(e.slice(a,r)),a=r+1)}return t.push(e.slice(a)),t}function NY(e){const t={...SY};if(!e||e.trim()==="none")return t;for(const n of jY(e)){const a=n.replace(/[a-z-]+\([^)]*\)/gi," ").replace(/#[0-9a-f]+/gi," ");if(/\binset\b/i.test(a))continue;const r=(a.match(/-?\d*\.?\d+(?:px)?/g)??[]).map(parseFloat);if(r.length<2)continue;const[s,i,l=0,c=0]=r,u=Math.max(0,l)+c;t.left=Math.max(t.left,u-s),t.right=Math.max(t.right,u+s),t.top=Math.max(t.top,u-i),t.bottom=Math.max(t.bottom,u+i)}return t}function CY(e,t,{rootPaints:n=!0}={}){const a=t.filter(u=>u.width>0||u.height>0),r=n||a.length===0?e:null;let s=r?r.left:1/0,i=r?r.top:1/0,l=r?r.left+r.width:-1/0,c=r?r.top+r.height:-1/0;for(const u of a)s=Math.min(s,u.left-u.shadow.left),i=Math.min(i,u.top-u.shadow.top),l=Math.max(l,u.left+u.width+u.shadow.right),c=Math.max(c,u.top+u.height+u.shadow.bottom);return{left:s,top:i,width:l-s,height:c-i}}const AY=300,_Y=180,EY=new Set(["hidden","clip","auto","scroll"]);function TY(e,t){const n=[],a=r=>{const s=t.getComputedStyle(r);if(s.display==="none"||s.visibility==="hidden")return;const i=r.getBoundingClientRect();if(n.push({left:i.left,top:i.top,width:i.width,height:i.height,shadow:NY(s.boxShadow)}),![s.overflow,s.overflowX,s.overflowY].some(l=>EY.has(l)))for(const l of Array.from(r.children))a(l)};for(const r of Array.from(e.children))a(r);return n}const RY={box:null,docHeight:0,available:0,background:""},Ak=/^(?:transparent|rgba\(0, 0, 0, 0\))$/;function kY(e){const t=!e.backgroundColor||Ak.test(e.backgroundColor),n=e.boxShadow&&e.boxShadow!=="none",a=["top","right","bottom","left"].some(s=>parseFloat(e.getPropertyValue(`border-${s}-width`))>0),r=parseFloat(e.outlineWidth)>0&&e.outlineStyle!=="none";return!t||!!n||a||r}function MY(e,t){for(const n of[e==null?void 0:e.documentElement,e==null?void 0:e.body]){if(!n)continue;const a=t.getComputedStyle(n).backgroundColor;if(a&&!Ak.test(a))return a}return""}function DY(e,t){var n,a,r,s,i,l,c,u;return e.docHeight===t.docHeight&&e.background===t.background&&e.available===t.available&&((n=e.box)==null?void 0:n.left)===((a=t.box)==null?void 0:a.left)&&((r=e.box)==null?void 0:r.top)===((s=t.box)==null?void 0:s.top)&&((i=e.box)==null?void 0:i.width)===((l=t.box)==null?void 0:l.width)&&((c=e.box)==null?void 0:c.height)===((u=t.box)==null?void 0:u.height)}function _k({previewKey:e,target:t,layout:n,look:a,empty:r,footer:s}){const[i,l]=d.useState("desktop"),[c,u]=d.useState(null),[m,f]=d.useState(!1),[w,p]=d.useState(RY),[x,b]=d.useState(null),[y,h]=d.useState(null),g=d.useRef(null),v=d.useRef(null),S=d.useRef(null),N=bY[i];d.useEffect(()=>{if(!e){u(null);return}if(!t||t===c)return;const D=window.setTimeout(()=>{u(t),f(!0)},c?AY:0);return()=>window.clearTimeout(D)},[e,t,c]);const A=d.useCallback(()=>{var P,G,ne,Y,Z;const D=(P=g.current)==null?void 0:P.contentDocument,T=((G=v.current)==null?void 0:G.clientWidth)??0,O=D==null?void 0:D.querySelector(".psfa-product-box-root"),_=O==null?void 0:O.getBoundingClientRect(),$=(D==null?void 0:D.defaultView)??window,H=((ne=D==null?void 0:D.defaultView)==null?void 0:ne.scrollX)??0,F=((Y=D==null?void 0:D.defaultView)==null?void 0:Y.scrollY)??0;let Q=null;if(O&&_&&_.width>0&&_.height>0){const le=CY({left:_.left,top:_.top,width:_.width,height:_.height},TY(O,$),{rootPaints:kY($.getComputedStyle(O))});Q={...le,left:le.left+H,top:le.top+F}}const X={available:T,docHeight:((Z=D==null?void 0:D.documentElement)==null?void 0:Z.scrollHeight)??0,box:Q,background:MY(D,$)};p(le=>DY(le,X)?le:X)},[]);d.useEffect(()=>{const D=v.current;if(!D||typeof ResizeObserver>"u")return;const T=new ResizeObserver(A);return T.observe(D),()=>T.disconnect()},[A,e]),d.useEffect(()=>{A()},[i,A]),d.useEffect(()=>()=>{var D;return(D=S.current)==null?void 0:D.disconnect()},[]);const j=()=>{var _,$,H;f(!1);const D=g.current,T=D==null?void 0:D.contentDocument;if(!D||!T)return;A(),(((_=T.documentElement)==null?void 0:_.scrollHeight)??0)>0&&b(e),($=S.current)==null||$.disconnect();const O=(H=D.contentWindow)==null?void 0:H.ResizeObserver;if(O&&T.documentElement){S.current=new O(A),S.current.observe(T.documentElement);const F=T.querySelector(".psfa-product-box-root");F&&S.current.observe(F)}},C=w.docHeight>0,R=e!==null&&x===e&&C,M=e!==null&&y!==e;d.useEffect(()=>{if(!R||y===e)return;const D=window.setTimeout(()=>h(e),_Y+20);return()=>window.clearTimeout(D)},[R,e,y]);const z=yY({device:i,viewport:N,docHeight:w.docHeight,box:w.box,available:w.available}),B=z.scale<1?w.available:z.width,I=z.height*z.scale,V=Math.max(w.docHeight,z.y+z.height);return o.jsxs("section",{"aria-labelledby":"pv-title",className:E(Rr,"tw:@container"),children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"pv-title",className:$m,children:"Preview"}),o.jsx("div",{className:"tw:flex tw:min-w-0 tw:max-w-full tw:flex-wrap tw:gap-2",children:o.jsx(Xi,{name:"pv-device",label:"Screen size",value:i,onChange:l,options:[{value:"desktop",label:"Desktop",icon:o.jsx($P,{"aria-hidden":"true"})},{value:"phone",label:"Phone",icon:o.jsx(KP,{"aria-hidden":"true"})}]})})]}),o.jsx("div",{"data-testid":"preview-canvas","aria-busy":e&&!R?"true":void 0,className:"psfa-preview-stage tw:flex tw:min-h-[360px] tw:bg-secondary tw:p-5 tw:@max-[480px]:p-3",children:o.jsxs("div",{ref:v,"data-testid":"preview-stage",className:"tw:grid tw:w-full tw:min-w-0 tw:items-start tw:justify-items-center",children:[e&&M?o.jsx(xY,{layout:n,look:a,device:i,style:{gridArea:"1 / 1",opacity:R?0:1}}):null,e?o.jsx("div",{"data-testid":"preview-page","data-psfa-visitor-preview":"","data-device":i,"data-viewport":N,"data-scale":z.scale.toFixed(3),"aria-hidden":R?void 0:"true",style:{gridArea:"1 / 1",colorScheme:"light",backgroundColor:R?w.background||"Canvas":"transparent",opacity:R?1:0,pointerEvents:R?void 0:"none",width:C?`${B}px`:void 0,height:C?`${I}px`:void 0},className:E("tw:relative tw:shrink-0 tw:overflow-hidden tw:rounded tw:shadow-psfa-xs tw:transition-[opacity,background-color] tw:duration-[180ms] tw:ease-psfa-out",!C&&"tw:h-[160px] tw:w-full tw:max-w-[760px]",!C&&i==="phone"&&"tw:max-w-[375px]"),children:c?o.jsx("div",{"aria-busy":m?"true":void 0,className:E("tw:absolute tw:inset-0 tw:transition-[opacity,filter,scale] tw:duration-[180ms] tw:ease-psfa-out",m&&"tw:scale-[0.995] tw:opacity-[0.35] tw:blur-[2px] tw:motion-reduce:scale-100 tw:motion-reduce:blur-none"),children:o.jsx("iframe",{ref:g,title:"Product box preview",src:c,sandbox:"allow-same-origin allow-scripts",scrolling:"no",tabIndex:-1,onLoad:j,style:{colorScheme:"light",width:`${N}px`,height:C?`${V}px`:"160px",transform:`scale(${z.scale}) translate(${-z.x}px, ${-z.y}px)`,transformOrigin:"0 0"},className:"tw:absolute tw:left-0 tw:top-0 tw:block tw:max-w-none tw:border-0 tw:bg-transparent"},"box-preview")}):null}):r]})}),o.jsx("p",{"data-testid":"preview-status",role:"status",className:"tw:sr-only",children:e&&!R?"Loading preview":""}),s]})}function OY({asin:e,settings:t,caps:n,valid:a}){const r=n.activePath==="managed",s=n.canBadge?t.look:"classic",i=e&&a?HG({ajaxUrl:Nt().ajaxUrl??"",nonce:ik(),asin:e,style:t.style,look:s,button:t.button,allowButton:n.canCustomButton,title:t.title,rating:t.rating,reviews:t.reviews,badge:t.badge,sendBadge:n.canBadge}):null,c=(n.canCustomButton?Gb(t.button):"")||n.buttonText;return o.jsx(_k,{previewKey:e,target:i,layout:t.style,look:s,empty:o.jsxs("div",{className:"tw:col-start-1 tw:row-start-1 tw:m-auto tw:flex tw:max-w-[300px] tw:flex-col tw:items-center tw:gap-2 tw:text-center tw:text-sm tw:text-muted-foreground",children:[o.jsx(Zo,{"aria-hidden":"true",className:"tw:size-6"}),o.jsx("p",{className:"tw:m-0",children:"Pick a product to see the box here, as it will look in a post."})]}),footer:o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx(Ng,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsxs("span",{className:"tw:[overflow-wrap:anywhere]",children:["Uses your"," ",o.jsx(Bn,{to:se.appearance,className:hu,children:"Appearance settings"}),".",c?` The button says “${c}”${r?" on the Managed API":""}.`:""]})]})})}const Ek=e=>new Intl.NumberFormat("en-US").format(e);function Tk(e,t,n){if(typeof e=="number")return typeof t=="number"&&typeof n=="number"&&n>0?Math.max(0,Math.min(e,n-t)):Math.max(0,e)}function PY({quota:e}){const t=zb(),n=e?Tk(e.remaining,e.usedMonth,e.monthlyLimit):Tk(t.remaining,t.usedMonth,t.capMonth);if(typeof n!="number")return null;const a=e?e.limit:t.cap,r=typeof a=="number"&&a>0?`Each search or product lookup uses 1 of your ${Ek(a)} a day.`:"Each search or product lookup counts toward your daily allowance.";return o.jsx("p",{className:`${Yn} tw:tabular-nums`,role:"status",children:`${r} ${Ek(n)} left today.`})}const zY=["Find product","Set up","Place it"],LY=["find","setup","place"];function IY({step:e}){const t=e==="done"?3:LY.indexOf(e);return o.jsx("ol",{"aria-label":"Steps",className:"tw:m-0 tw:mb-5 tw:flex tw:list-none tw:flex-wrap tw:items-center tw:p-0",children:zY.map((n,a)=>{const r=a<t,s=a===t;return o.jsxs("li",{"aria-current":s?"step":void 0,className:E("tw:m-0 tw:flex tw:items-center tw:gap-2 tw:text-sm tw:font-medium tw:text-muted-foreground",s&&"tw:font-semibold tw:text-foreground"),children:[a>0?o.jsx("span",{"aria-hidden":"true",className:"tw:mx-2.5 tw:h-px tw:w-8 tw:bg-border tw:max-[560px]:mx-1.5 tw:max-[560px]:w-3.5"}):null,o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-flex tw:size-[22px] tw:items-center tw:justify-center tw:rounded-full tw:border-[1.5px] tw:border-solid tw:border-input tw:text-xs tw:font-semibold tw:tabular-nums",s&&"tw:border-foreground tw:bg-foreground tw:text-background",r&&"tw:border-success tw:bg-success tw:text-primary-foreground"),children:r?o.jsx(yr,{className:"tw:size-[13px]",strokeWidth:2.6}):a+1}),o.jsx("span",{className:E(!s&&"tw:max-[560px]:sr-only"),children:n}),o.jsx("span",{className:"tw:sr-only",children:r?" (done)":s?" (current step)":""})]},n)})})}const Rk={title:"Use a title of 255 characters or fewer.",rating:Yb,reviews:uk,badge:"Choose one of the listed badges.",button:"Use button text of 100 characters or fewer.",button_text:"Use button text of 100 characters or fewer."},$Y={button_text:"button"},BY=e=>new Intl.NumberFormat("en-US").format(e);function tv(e){return{asin:e.asin,title:e.title,brand:e.brand,image:e.image,price:e.price}}function kk(e,t){return{asin:e.asin,title:(t==null?void 0:t.title)||e.amazonTitle||e.title,brand:(t==null?void 0:t.brand)??"",image:(t==null?void 0:t.image)||e.image,price:t==null?void 0:t.price}}function Mk(e){return{...Um,style:BG(e.style)?e.style:"card",look:UG(e.look)?e.look:"classic",button:e.buttonText??"",title:e.titleOverride||"",rating:e.rating==null?"":String(e.rating),reviews:e.reviewCount==null?"":BY(e.reviewCount),badge:e.badge||"none"}}function Dk(e){return e==="place"||e==="done"?e:void 0}function Ok(e,t,n){return e?`box:${e.toUpperCase()}:${n??"setup"}`:`new:${t}`}const UY={find:"find-title",setup:"find-title",place:"place-title",done:"done-title"},HY={find:"Step 1 of 3: Find product",setup:"Step 2 of 3: Set up",place:"Step 3 of 3: Place it",done:"Box placed"};function Pk(){const{asin:e}=Wj(),{search:t}=jn(),n=new URLSearchParams(t),a=Ok(e,n.get("q")??"",Dk(n.get("step"))),r=d.useRef(null),[s,i]=d.useState({routeKey:a,key:0});if(s.routeKey!==a){const l=r.current===a;r.current=null,i({routeKey:a,key:l?s.key:s.key+1})}return o.jsx(FY,{onAdopt:l=>{r.current=Ok(l.asin,"",l.step)}},s.key)}function FY({onAdopt:e}){const{asin:t}=Wj(),[n]=uP(),a=pi(),r=t?"":n.get("q")??"",s=!1,[i,l]=d.useState(Vb),[c,u]=d.useState(()=>ck(Vb())),[m,f]=d.useState(t?Dk(n.get("step"))??"setup":"find"),[w,p]=d.useState(""),x=d.useRef(m),[b,y]=d.useState(null),[h,g]=d.useState(Um),[v,S]=d.useState(null),[N,A]=d.useState(!!t),[j,C]=d.useState(null),[R,M]=d.useState({status:"idle"}),[z,B]=d.useState(!1),[I,V]=d.useState(!1),[D,T]=d.useState(!1),[O,_]=d.useState("settings"),[$,H]=d.useState({}),[F,Q]=d.useState(!1),[X,P]=d.useState(!1),[G,ne]=d.useState(!1),[Y,Z]=d.useState(null),[le,he]=d.useState(0),ae=d.useRef(!0),K=d.useRef(null);K.current=v;const ge=d.useRef(0),Ne=d.useRef(0),We=d.useRef(!1);d.useEffect(()=>(ae.current=!0,()=>{ae.current=!1}),[]);const Ke=()=>{ge.current+=1;const ie=ge.current;return()=>ae.current&&ge.current===ie},at=()=>{ge.current+=1,Ne.current+=1};d.useEffect(()=>{if(t||i==="none")return;let ie=!0;return Om(1,1).then(Ee=>{ie&&ae.current&&u(Ee.capabilities)}).catch(()=>{}),()=>{ie=!1}},[t,i]),d.useEffect(()=>{if(!t||t.toUpperCase()===K.current)return;let ie=!0;return A(!0),C(null),lk(t.toUpperCase()).then(({box:Ee,capabilities:$e})=>{ie&&(u($e),y(kk(Ee)),g(Mk(Ee)),S(Ee.asin),A(!1))}).catch(()=>{ie&&(C(t.toUpperCase()),A(!1))}),()=>{ie=!1,ae.current&&A(!1)}},[t]),d.useEffect(()=>{r&&i!=="none"&&Xt(r)},[]),d.useEffect(()=>{var Ee;if(x.current===m)return;x.current=m,p(HY[m]);const ie=document.activeElement;m==="find"&&ie&&ie!==document.body||(Ee=document.getElementById(UY[m]))==null||Ee.focus()},[m]);const Kt=i==="managed"&&c.activePath==="managed"&&!s;function He(ie){const Ee=t==null?void 0:t.toUpperCase();(ie.asin??void 0)!==Ee&&(e(ie),a(ie.asin?`/boxes/${ie.asin}`:"/boxes/new",{replace:!0}))}function qt(ie){Ne.current+=1,He({}),y(ie),g(Um),S(null),B(!1),H({}),P(!1),M({status:"idle"}),f("setup"),_("settings")}function Cn(ie,Ee,$e){Ne.current+=1,He({asin:ie.asin}),$e&&u($e),y(kk(ie,Ee)),g(Mk(ie)),S(ie.asin),B(!0),H({}),P(!1),M({status:"idle"}),f("setup"),_("settings")}function mt(ie,Ee){var re;const $e=ie instanceof ds?ie:new ds("unavailable","Something went wrong.");if($e.quota&&Z($e.quota),$e.code==="not_configured"){l("none"),V(!0),M({status:"idle"});return}if($e.code==="invalid"){M({status:"error",note:{tone:"warn",title:"We couldn't read that",text:"Type a keyword, or paste an Amazon product link or a 10-character ASIN."}});return}M({status:"error",note:hk({code:$e.code,...Ee,store:VG(((re=Nt().settings)==null?void 0:re.marketplace)??""),path:c.activePath,premium:s,quota:$e.quota??null})})}function Xt(ie){const Ee=Pm(ie);B(!1);const $e=Ke();if(Ee.type==="short"){M({status:"error",note:hk({code:"short_link"})});return}if(Ee.type!=="badlink"){if(M({status:"loading",query:Ee.type==="keyword"?Ee.query:Ee.asin}),Ee.type==="keyword"){RG(Ee.query).then(re=>{$e()&&(re.quota&&Z(re.quota),M({status:"results",query:re.query||Ee.query,results:re.results}))}).catch(re=>{$e()&&mt(re,{kind:"keyword",query:Ee.query})});return}TG(ie).then(({product:re,box:Je,quota:dt})=>{$e()&&(dt&&Z(dt),Je?Cn(Je,re):qt(tv(re)))}).catch(re=>{if($e()){if(re instanceof ds&&re.code==="unavailable"){qt({asin:Ee.asin,title:"",brand:"",image:"",unavailable:!0});return}mt(re,{kind:"asin",asin:Ee.asin})}})}}function an(ie){if(!ie.hasBox){qt(tv(ie));return}const Ee=Ke();M({status:"loading",query:ie.asin}),lk(ie.asin).then(({box:$e,capabilities:re})=>{Ee()&&Cn($e,ie,re)}).catch(()=>{Ee()&&qt(tv(ie))})}function wn(){at(),f("find"),B(!1),M({status:"idle"}),he(ie=>ie+1)}function An(){at(),y(null),g(Um),S(null),B(!1),C(null),M({status:"idle"}),H({}),f("find"),he(ie=>ie+1)}const qn=(ie,Ee)=>{g($e=>({...$e,[ie]:Ee})),H($e=>$e[ie]?{...$e,[ie]:void 0}:$e)},oe={...$,rating:dk(h.rating)||$.rating,reviews:fk(h.reviews)||$.reviews},ye=!!(dk(h.rating)||fk(h.reviews)),we=Object.values(oe).some(Boolean);async function Ve(){if(!b||We.current)return;We.current=!0,Ne.current+=1;const ie=Ne.current,Ee=()=>ae.current&&Ne.current===ie;Q(!0),P(!1);const $e={asin:b.asin,title:h.title.trim(),rating:h.rating.trim(),reviews:Kb(h.reviews),style:h.style};c.canBadge&&($e.badge=h.badge||"none"),c.canBadge&&($e.look=h.look),c.canCustomButton&&($e.button_text=Gb(h.button));try{const{box:re,quota:Je}=await kG($e);if(!Ee())return;Je&&Z(Je),e({asin:re.asin,step:"place"}),S(re.asin),B(!1),H({}),f("place"),_("settings"),a(`/boxes/${re.asin}?step=place`,{replace:!0})}catch(re){if(!Ee())return;re instanceof ds&&re.code==="invalid"&&re.field&&Rk[re.field]?H({[$Y[re.field]??re.field]:Rk[re.field]}):P(!0)}finally{We.current=!1,ae.current&&Q(!1)}}async function ze(){if(!G){ne(!0);try{if(await DG(),!ae.current)return;f("done"),_("settings"),b&&(e({asin:b.asin,step:"done"}),a(`/boxes/${b.asin}?step=done`,{replace:!0}))}catch{ae.current&&_e.error("That step didn't save. Try again.")}finally{ae.current&&ne(!1)}}}const Wt=ie=>{l(ie.activePath),u(ck(ie.activePath)),V(!1),T(!0),M({status:"idle"})},Ge=c.activePath==="managed",Ea=b?$G({asin:b.asin}):"";let pa=v?"Edit product box":"New product box",Xn=null;if(m==="find"||m==="setup"){const ie=i==="none"&&!b?"Connect to Amazon first.":N?"Loading the box.":b?we?"Fix the highlighted field first.":"":"Pick a product first.";Xn=o.jsxs("span",{className:"tw:inline-flex tw:flex-col tw:items-end tw:gap-1 tw:max-[782px]:items-stretch",children:[o.jsx("button",{type:"button","aria-disabled":ie||F?"true":"false","aria-describedby":ie?"save-blocked":void 0,onClick:()=>{ie||Ve()},className:pu,children:F?"Saving":v?"Save changes":"Save and get shortcode"}),ie?o.jsx("span",{id:"save-blocked",className:"tw:text-[12.5px] tw:text-muted-foreground",children:ie}):null]})}else m==="place"?Xn=o.jsxs("button",{type:"button","aria-disabled":G?"true":void 0,onClick:ze,className:pu,children:[o.jsx(yr,{"aria-hidden":"true"}),"I've placed it"]}):(pa="Box placed",Xn=o.jsxs("button",{type:"button",className:pu,onClick:()=>{An(),a("/boxes/new")},children:[o.jsx(Cg,{"aria-hidden":"true"}),"New box"]}));const Ta=!!(b&&b.title.length>120&&!h.title.trim()),rn=o.jsxs("section",{"aria-labelledby":"find-title",className:Rr,children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"find-title",tabIndex:-1,"data-step-heading":"true",className:E($m,"tw:outline-none"),children:i==="none"&&!b?"Connect to Amazon":"Product"}),b&&m!=="find"?o.jsx("span",{className:"tw:font-mono tw:text-[13px] tw:text-muted-foreground",children:b.asin}):null]}),o.jsxs("div",{className:E(Bm,"tw:flex tw:flex-col tw:gap-3.5"),children:[z&&m==="setup"?o.jsx(ma,{tone:"info",title:"You already have a box for this product, so we opened it",actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{An(),a("/boxes/new",{replace:!0})},children:"Find a different product"}),children:"Changes here update that box everywhere it's placed."}):null,j?o.jsx(ma,{tone:"bad",title:`There's no box for ASIN ${j}`,actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{An(),a("/boxes/new",{replace:!0})},children:"Find a product"}),children:"It may have been deleted. Find the product to make a new box."}):N?o.jsxs("div",{"aria-label":"Loading the box",className:"tw:grid tw:grid-cols-[56px_1fr] tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-14 tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx(bt,{className:"tw:h-3.5 tw:w-4/5"}),o.jsx(bt,{className:"tw:h-3 tw:w-2/5"})]})]}):b&&m!=="find"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[56px_minmax(0,1fr)_auto] tw:items-center tw:gap-3",children:[o.jsx(Zb,{src:b.image,className:"tw:size-14"}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("div",{title:b.title||void 0,className:"tw:line-clamp-2 tw:text-sm tw:font-semibold tw:text-foreground tw:[overflow-wrap:anywhere]",children:b.title||`ASIN ${b.asin}`}),o.jsx("div",{className:"tw:mt-0.5 tw:truncate tw:text-[12.5px] tw:text-muted-foreground",title:b.brand||void 0,children:b.brand||"Brand not listed"})]}),o.jsx("button",{type:"button",onClick:wn,className:E(Aa,Xa),children:"Change"})]}),b.unavailable?o.jsx(ma,{tone:"warn",title:"This product is unavailable on Amazon right now",actions:o.jsx("button",{type:"button",className:hu,onClick:wn,children:"Pick another product"}),children:`Until it's back, visitors see "Product details are unavailable." in its place. You can still save the box.`}):Ge?o.jsx(ma,{tone:"info",children:`The Managed API doesn't show prices. The button says "Check price on Amazon" and Amazon shows the live price.`}):b.price===""?o.jsx(ma,{tone:"warn",title:"Amazon isn't sending a price for this product",children:"The box shows no price. The button still takes visitors to Amazon."}):null,Ta&&!b.unavailable?o.jsxs(ma,{tone:"info",title:"This title is long",actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{var ie;_("settings"),(ie=document.getElementById("box-title"))==null||ie.focus()},children:"Write a shorter title"}),children:[h.style==="card"?"The card shows the first 3 lines.":"The box shows the first 2 lines."," A short title reads better."]}):null]}):i==="none"?o.jsxs(o.Fragment,{children:[I?o.jsx(ma,{tone:"info",children:"Connect to Amazon first, then start with the product."}):null,o.jsx(sk,{idPrefix:"builder-connect",showAlternative:!0,onConnected:Wt})]}):o.jsxs("div",{children:[o.jsx(yk,{idPrefix:"builder-finder",initial:r,autoFocus:!r||D||le>0,onSubmit:Xt,footer:Kt?o.jsx(PY,{quota:Y}):null},le),R.status==="loading"?o.jsxs("p",{role:"status",className:E(Yn,"tw:mt-3 tw:[overflow-wrap:anywhere]"),children:['Looking up "',R.query,'"']}):null,R.status==="loading"?o.jsx("ul",{"aria-label":"Looking up products",className:"tw:m-0 tw:mt-2 tw:grid tw:list-none tw:gap-2.5 tw:p-0",children:[0,1,2].map(ie=>o.jsxs("li",{className:"tw:m-0 tw:grid tw:grid-cols-[48px_1fr] tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-12 tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(bt,{className:"tw:h-3",style:{width:`${90-ie*15}%`}}),o.jsx(bt,{className:"tw:h-2.5 tw:w-2/5"})]})]},ie))}):null,R.status==="error"?o.jsx(ma,{tone:R.note.tone,title:R.note.title,className:"tw:mt-3.5",children:R.note.text}):null,R.status==="results"?o.jsx(sY,{results:R.results,query:R.query,onPick:an}):null]}),X?o.jsx(ma,{tone:"bad",title:"The box wasn't saved",children:"Your site couldn't store it just now. Try again in a moment."}):null]})]}),Za=m==="place"&&b?o.jsx(pY,{shortcode:Ea,postTitle:h.title.trim()||b.title||`Product ${b.asin}`,onChangeBox:()=>{f("setup"),_("settings"),e({asin:b.asin}),a(`/boxes/${b.asin}`,{replace:!0})},onLater:()=>a("/boxes")}):m==="done"&&!j?o.jsx(eY,{onHome:()=>a("/"),onAll:()=>a("/boxes")}):m==="place"||m==="done"?rn:o.jsxs(o.Fragment,{children:[rn,b&&m==="setup"&&!N?o.jsx(ZG,{settings:h,onChange:qn,caps:c,errors:oe}):null]});return o.jsxs("div",{className:"tw:@container",children:[o.jsx(fu,{title:pa,actions:Xn}),o.jsx("p",{"data-testid":"step-announcer",role:"status",className:"tw:sr-only",children:w}),o.jsx(IY,{step:m}),o.jsx("div",{className:E("tw:sticky tw:z-10 tw:-mx-1 tw:mb-1 tw:hidden tw:bg-background tw:px-1 tw:py-2 tw:@max-[802px]:flex","tw:top-[var(--wp-admin--admin-bar--height,32px)] tw:max-[781px]:top-[calc(var(--wp-admin--admin-bar--height,46px)+52px)] tw:max-[600px]:top-[52px]"),children:o.jsx(Xi,{name:"builder-pane",label:"Show",full:!0,value:O,onChange:_,options:[{value:"settings",label:m==="place"?"Place it":m==="done"?"Done":"Settings"},{value:"preview",label:"Preview"}]})}),o.jsxs("div",{"data-testid":"builder","data-pane":O,className:"tw:grid tw:grid-cols-[minmax(320px,420px)_minmax(458px,1fr)] tw:items-start tw:gap-6 tw:@max-[802px]:grid-cols-[minmax(0,1fr)]",children:[o.jsx("div",{className:E("tw:flex tw:min-w-0 tw:flex-col tw:gap-4",O==="preview"&&"tw:@max-[802px]:hidden"),children:Za}),o.jsx("div",{className:E("tw:sticky tw:top-[calc(var(--wp-admin--admin-bar--height,32px)+16px)] tw:min-w-0 tw:@max-[802px]:static",O==="settings"&&"tw:@max-[802px]:hidden"),children:o.jsx(OY,{asin:(b==null?void 0:b.asin)??null,settings:h,caps:c,valid:!ye})})]})]})}const nv="psfa-menu-item tw:min-h-9 tw:cursor-pointer tw:gap-2.5 tw:px-2.5 tw:text-foreground tw:max-[782px]:min-h-11",VY=e=>new Intl.NumberFormat("en-US").format(e);function GY({box:e,showBadge:t,clicks:n,onEdit:a,onPlace:r,onDelete:s}){const i=d.useRef(null),l=e.title||e.amazonTitle||e.asin,c=t&&e.badge&&e.badge!=="none"?GG(e.badge):"";return o.jsxs("li",{className:E(Rr,"tw:m-0 tw:flex tw:flex-col tw:transition-[border-color] tw:duration-150 tw:hover:border-border-strong"),children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[76px_minmax(0,1fr)] tw:items-start tw:gap-3.5 tw:p-3.5",children:[o.jsx(Zb,{src:e.image}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("button",{type:"button",title:l,onClick:a,className:"tw:line-clamp-2 tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-left tw:text-[14.5px] tw:font-semibold tw:leading-[1.35] tw:text-foreground tw:[overflow-wrap:anywhere] tw:hover:underline tw:hover:underline-offset-[3px] tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:l}),o.jsxs("div",{className:"tw:mt-1.5 tw:flex tw:min-w-0 tw:flex-wrap tw:items-center tw:gap-x-2.5 tw:gap-y-1 tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:e.asin}),c?o.jsx("span",{children:c}):null,typeof n=="number"?o.jsx("span",{className:"tw:tabular-nums",children:`${fa(n,"click","clicks",VY)}, 7 days`}):null]})]})]}),o.jsxs("div",{className:"tw:mt-auto tw:flex tw:min-w-0 tw:items-center tw:gap-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-3.5 tw:py-2.5",children:[o.jsx("span",{ref:i,title:e.shortcode,className:"tw:min-w-0 tw:flex-1 tw:truncate tw:font-mono tw:text-[12.5px] tw:text-muted-foreground",children:e.shortcode}),o.jsx(Nk,{text:e.shortcode,fallbackRef:i,small:!0,label:"Copy",ariaLabel:`Copy shortcode for ${l}`}),o.jsxs(Yx,{modal:!1,children:[o.jsx(Kx,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":`More actions for ${l}`,"data-more-for":e.asin,className:XG,children:o.jsx(PP,{"aria-hidden":"true"})})}),o.jsxs(om,{align:"end",sideOffset:6,className:"psfa-menu tw:min-w-[200px]",children:[o.jsxs(Pi,{className:nv,onSelect:a,children:[o.jsx(vN,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),"Edit box"]}),o.jsxs(Pi,{className:nv,onSelect:r,children:[o.jsx(FP,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),"Where to paste"]}),o.jsx(qx,{className:"tw:bg-border"}),o.jsxs(Pi,{className:E(nv,"tw:text-destructive tw:focus:text-destructive"),onSelect:s,children:[o.jsx(NN,{"aria-hidden":"true"}),"Delete box"]})]})]})]})]})}function YY({target:e,onClose:t,onConfirm:n,focusAfterDelete:a}){const[r,s]=d.useState(!1),i=d.useRef(!1),l=d.useRef(null);e&&(l.current=e);const c=l.current;return o.jsx(jA,{open:!!e,onOpenChange:u=>{!u&&!r&&t()},children:o.jsxs(px,{className:"tw:w-[min(440px,calc(100vw-32px))] tw:gap-5 tw:rounded-xl tw:border-border tw:bg-card tw:p-6 tw:text-foreground tw:shadow-psfa-pop",onCloseAutoFocus:u=>{if(!i.current){const f=c?document.querySelector(`[data-more-for="${c.asin}"]`):null;f&&(u.preventDefault(),f.focus());return}i.current=!1;const m=a();m&&(u.preventDefault(),m.focus())},children:[o.jsxs(hx,{className:"tw:gap-2 tw:space-y-0 tw:text-left tw:sm:text-left",children:[o.jsx(xx,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:text-foreground",children:"Delete this box?"}),o.jsx(bx,{className:"tw:m-0 tw:text-sm tw:leading-normal tw:text-muted-foreground tw:[overflow-wrap:anywhere]",children:c?`The box for "${c.title}" and the settings you chose for it will be removed.`:""})]}),o.jsxs(gx,{className:"tw:flex-row tw:flex-wrap tw:justify-end tw:gap-2 tw:space-x-0 tw:sm:space-x-0",children:[o.jsx(vx,{className:E(Aa,"tw:mt-0"),children:"Keep it"}),o.jsx("button",{type:"button","aria-disabled":r?"true":void 0,className:E(Lm,"tw:bg-destructive tw:text-destructive-foreground tw:shadow-psfa-xs tw:hover:bg-destructive/90"),onClick:async()=>{if(!c||r)return;s(!0);const u=await n(c);s(!1),u&&(i.current=!0,t())},children:r?"Deleting":"Delete box"})]})]})})}const Wi=e=>new Intl.NumberFormat("en-US").format(e),zk=E(Aa,Xa,"tw:h-auto tw:min-h-8 tw:max-w-full tw:whitespace-normal tw:py-1.5 tw:text-center tw:max-[782px]:h-auto tw:max-[782px]:min-h-10"),KY=`${se.connection}?tab=creators`;function qY(){var t;if(typeof window>"u")return null;const e=(t=window.psfaAdmin)==null?void 0:t.productLoad;return e&&typeof e=="object"?e:null}function Fm(e){return typeof e=="number"&&Number.isFinite(e)}function XY(e){const{warn:t,productCount:n,dailyLimit:a,monthlyLimit:r,monthlyNeed:s,pooled:i}=e;return Fm(n)?t==="daily"&&Fm(a)?`You have ${fa(n,"product","products",Wi)} in boxes and tables. On the free Managed API each one uses a lookup when its details refresh, once a day, and the daily limit is ${Wi(a)}. On days when more than ${Wi(a)} need refreshing, the extra products show as unavailable to visitors until the limit resets at midnight UTC.`:t==="monthly"&&Fm(r)&&Fm(s)?`You have ${fa(n,"product","products",Wi)} in boxes and tables. Each one uses a lookup when its details refresh, once a day, so they need about ${Wi(s)} lookups a month. Your plan includes ${Wi(r)} a month${i?", shared across all your sites":""}. When the month's lookups run out, products show as unavailable to visitors until the allowance resets.`:null:null}function av({onCredentialsPage:e=!1,className:t}){var l;const n=qY(),a=n?XY(n):null;if(!n||!a)return null;const r=((l=window.psfaAdmin)==null?void 0:l.upgradeUrl)||"https://paapiplugin.com/pricing/#plans",s=e?null:o.jsx(Bn,{to:KY,className:zk,children:"Use your own Amazon credentials"}),i=n.warn==="daily"?o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:zk,children:"See Premium"}):null;return o.jsx(ma,{tone:"warn",className:t,actions:s||i?o.jsxs(o.Fragment,{children:[s,i]}):void 0,children:o.jsx("p",{className:"tw:m-0 tw:max-w-[72ch]",children:a})})}const Vm=24;function WY(e,t){return[e.asin,e.title,e.amazonTitle,e.titleOverride].join(" ").toLowerCase().includes(t)}function ZY({withClicks:e}){const[t,n]=d.useState("loading"),[a,r]=d.useState(null),[s,i]=d.useState(1),[l,c]=d.useState(0),[u,m]=d.useState(""),[f,w]=d.useState(null),[p,x]=d.useState(1),[b,y]=d.useState({});d.useEffect(()=>{let C=!0;return n(R=>R==="ready"?R:"loading"),Om(s,Vm).then(R=>{if(C){if(R.totalPages>0&&s>R.totalPages){i(R.totalPages);return}r(R),n("ready")}}).catch(()=>{C&&n("error")}),()=>{C=!1}},[s,l]);const h=u.trim().toLowerCase();d.useEffect(()=>{if(!h||f)return;let C=!0;return OG().then(R=>{C&&w(R.boxes)}).catch(()=>{C&&w([])}),()=>{C=!1}},[h,f]);const g=d.useMemo(()=>h&&f?f.filter(C=>WY(C,h)):null,[h,f]),v=g?Math.max(1,Math.ceil(g.length/Vm)):1,S=g?g.slice((p-1)*Vm,p*Vm):(a==null?void 0:a.boxes)??[],N=S.map(C=>C.asin).join(",");d.useEffect(()=>{},[e,N,b]);const A=d.useCallback(C=>{m(C),x(1)},[]),j=d.useCallback(async C=>{try{await MG(C)}catch{return!1}return w(R=>R&&R.filter(M=>M.asin!==C)),r(R=>R&&{...R,boxes:R.boxes.filter(M=>M.asin!==C),total:Math.max(0,R.total-1)}),c(R=>R+1),!0},[]);return{status:t,total:(a==null?void 0:a.total)??0,capabilities:(a==null?void 0:a.capabilities)??null,page:g?p:s,totalPages:g?v:Math.max(1,(a==null?void 0:a.totalPages)??1),setPage:g?x:i,filter:u,setFilter:A,filtering:!!h,filterLoading:!!h&&!f,matchCount:(g==null?void 0:g.length)??0,boxes:S,clicks:b,remove:j,retry:()=>{n("loading"),c(C=>C+1)}}}const Lk=e=>new Intl.NumberFormat("en-US").format(e),Ik=e=>fa(e,"box","boxes",Lk);function QY(){const e=pi(),t=!1,n=ZY({withClicks:t}),[a,r]=d.useState(Vb),[s,i]=d.useState(!1),[l,c]=d.useState(null),u=d.useRef(null),m=d.useRef(null),f=o.jsxs("button",{ref:m,type:"button",className:pu,onClick:()=>e("/boxes/new"),children:[o.jsx(Cg,{"aria-hidden":"true"}),"New box"]});if(n.status==="ready"&&n.total===0&&!n.filtering)return o.jsxs("div",{children:[o.jsx(fu,{title:"Product boxes",actions:f}),o.jsxs("section",{"aria-labelledby":"boxes-empty-title",className:"tw:mx-auto tw:mt-8 tw:max-w-[640px] tw:max-[782px]:mt-2",children:[o.jsx("h2",{id:"boxes-empty-title",className:"tw:m-0 tw:mb-1.5 tw:p-0 tw:text-xl tw:font-semibold tw:text-foreground",children:"No product boxes yet"}),o.jsxs("p",{className:"tw:m-0 tw:mb-5 tw:text-sm tw:leading-normal tw:text-muted-foreground",children:["A box shows one Amazon product inside a post."," ",a==="none"?"Connect to Amazon first, then start with the product.":"Start with the product."]}),a==="none"?o.jsx("div",{className:E(Rr,"tw:p-5 tw:max-[560px]:p-4"),children:o.jsx(sk,{idPrefix:"empty-connect",showAlternative:!0,onConnected:x=>{r(x.activePath),i(!0)}})}):o.jsx(yk,{idPrefix:"empty-finder",autoFocus:s,onSubmit:x=>e(`/boxes/new?${new URLSearchParams({q:x}).toString()}`)})]})]});const p=n.filtering?n.filterLoading?"Searching every box":`${Lk(n.matchCount)} of ${Ik(n.total)}`:Ik(n.total);return o.jsxs("div",{children:[o.jsx(fu,{title:"Product boxes",description:"Each box shows one Amazon product. Copy its shortcode into any post.",actions:f}),o.jsx(av,{className:"tw:mb-5"}),n.status==="error"?o.jsx(ma,{tone:"bad",title:"Your boxes didn't load",actions:o.jsx("button",{type:"button",className:E(Aa,Xa),onClick:n.retry,children:"Try again"}),children:"Reload the page if this keeps happening."}):n.status==="loading"?o.jsx("ul",{"aria-label":"Loading product boxes",className:"tw:m-0 tw:grid tw:list-none tw:grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] tw:gap-5 tw:p-0",children:[0,1,2].map(x=>o.jsxs("li",{className:E(Rr,"tw:m-0 tw:grid tw:grid-cols-[76px_1fr] tw:gap-3.5 tw:p-3.5"),children:[o.jsx(bt,{className:"tw:size-[76px] tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-2 tw:pt-1",children:[o.jsx(bt,{className:"tw:h-3.5 tw:w-4/5"}),o.jsx(bt,{className:"tw:h-3 tw:w-2/5"})]})]},x))}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:mb-4 tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-3",children:[o.jsx("span",{role:"status",className:"tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:p}),o.jsxs("div",{className:"tw:w-[min(320px,100%)]",children:[o.jsx("label",{htmlFor:"lib-filter",className:"tw:sr-only",children:"Filter boxes"}),o.jsx("input",{ref:u,id:"lib-filter",type:"search",placeholder:"Filter by title or ASIN",autoComplete:"off",spellCheck:!1,value:n.filter,onChange:x=>n.setFilter(x.target.value),className:ms})]})]}),n.boxes.length?o.jsx("ul",{"aria-label":"Product boxes",className:"tw:m-0 tw:grid tw:list-none tw:grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] tw:gap-5 tw:p-0",children:n.boxes.map(x=>o.jsx(GY,{box:x,showBadge:t,clicks:void 0,onEdit:()=>e(`/boxes/${x.asin}`),onPlace:()=>e(`/boxes/${x.asin}?step=place`),onDelete:()=>c({asin:x.asin,title:x.title||x.amazonTitle||x.asin})},x.asin))}):n.filtering&&!n.filterLoading?o.jsxs("div",{className:E(Rr,"tw:px-4 tw:py-10 tw:text-center tw:text-sm tw:text-muted-foreground"),children:[o.jsx("p",{className:"tw:m-0 tw:[overflow-wrap:anywhere]",children:`No boxes match "${n.filter.trim()}".`}),o.jsx("p",{className:"tw:m-0 tw:mt-2.5",children:o.jsx("button",{type:"button",className:E(Aa,Xa),onClick:()=>{var x;n.setFilter(""),(x=u.current)==null||x.focus()},children:"Clear the filter"})})]}):null,n.totalPages>1?o.jsxs("nav",{"aria-label":"Pages",className:"tw:mt-6 tw:flex tw:items-center tw:justify-center tw:gap-3",children:[o.jsxs("button",{type:"button","aria-label":"Previous page",disabled:n.page<=1,onClick:()=>n.setPage(n.page-1),className:E(Aa,Xa,"tw:disabled:cursor-not-allowed"),children:[o.jsx(RP,{"aria-hidden":"true"}),"Previous"]}),o.jsx("span",{className:"tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:`Page ${n.page} of ${n.totalPages}`}),o.jsxs("button",{type:"button","aria-label":"Next page",disabled:n.page>=n.totalPages,onClick:()=>n.setPage(n.page+1),className:E(Aa,Xa,"tw:disabled:cursor-not-allowed"),children:["Next",o.jsx(vc,{"aria-hidden":"true"})]})]}):null]}),o.jsx(YY,{target:l,onClose:()=>c(null),onConfirm:x=>n.remove(x.asin),focusAfterDelete:()=>u.current??m.current})]})}function JY({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M200,48v63.1c0,39.7-31.75,72.6-71.45,72.9A72,72,0,0,1,56,112V48Z",opacity:"0.2"}),o.jsx("path",{d:"M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})]})}function eK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M216.71,99.73l-15.6,93.59a8,8,0,0,1-7.89,6.68H62.78a8,8,0,0,1-7.89-6.68L39.29,99.73l.08,0a19.82,19.82,0,0,0,9.22-4.16h0L88,144l32-73.65h0a20,20,0,0,0,15.92,0h0L168,144l39.39-48.48h0a19.82,19.82,0,0,0,9.22,4.16Z",opacity:"0.2"}),o.jsx("path",{d:"M248,80a28,28,0,1,0-51.12,15.77l-26.79,33L146,73.4a28,28,0,1,0-36.06,0L85.91,128.74l-26.79-33a28,28,0,1,0-26.6,12L47,194.63A16,16,0,0,0,62.78,208H193.22A16,16,0,0,0,209,194.63l14.47-86.85A28,28,0,0,0,248,80ZM128,40a12,12,0,1,1-12,12A12,12,0,0,1,128,40ZM24,80A12,12,0,1,1,36,92,12,12,0,0,1,24,80ZM193.22,192H62.78L48.86,108.52,81.79,149A8,8,0,0,0,88,152a7.83,7.83,0,0,0,1.08-.07,8,8,0,0,0,6.26-4.74l29.3-67.4a27,27,0,0,0,6.72,0l29.3,67.4a8,8,0,0,0,6.26,4.74A7.83,7.83,0,0,0,168,152a8,8,0,0,0,6.21-3l32.93-40.52ZM220,92a12,12,0,1,1,12-12A12,12,0,0,1,220,92Z"})]})}function tK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),o.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})]})}function nK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M192,168a40,40,0,0,1-40,40H128V128h24A40,40,0,0,1,192,168ZM112,48a40,40,0,0,0,0,80h16V48Z",opacity:"0.2"}),o.jsx("path",{d:"M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"})]})}function aK({className:e}){return o.jsx("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:o.jsx("path",{d:"M197.09,100.48l-56.49-19.08L121.52,24.9a8,8,0,0,0-15,0L87.4,81.4,30.91,100.48a8,8,0,0,0,0,15l56.49,19.09L106.48,191.1a8,8,0,0,0,15,0l19.08-56.52,56.53-19.09a8,8,0,0,0,0-15ZM136.21,120.2a8,8,0,0,0-5,5L114,168.35,96.82,125.22a8,8,0,0,0-5-5L48.65,103l43.13-14.57a8,8,0,0,0,5-5L114,40.31,131.16,83.44a8,8,0,0,0,5,5l43.17,14.58ZM229.24,159.53l-20.41-6.89-6.89-20.42a8,8,0,0,0-15.18,0l-6.89,20.42L159.46,159.53a8,8,0,0,0,0,15.18l20.41,6.89,6.89,20.41a8,8,0,0,0,15.18,0l6.89-20.41,20.41-6.89a8,8,0,0,0,0-15.18Z"})})}const rK={best_value:JY,editors_choice:eK,best_rated:tK,budget_pick:nK,premium_pick:aK};function Zi({step:e,title:t,description:n,icon:a}){return o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-info-soft tw:text-info tw:rounded-full",children:[a==="search"&&o.jsx(oK,{}),a==="plus"&&o.jsx(sK,{}),a==="copy"&&o.jsx(iK,{}),a==="list"&&o.jsx(xN,{"aria-hidden":"true",className:"tw:w-4 tw:h-4"}),a==="category"&&o.jsx(BP,{"aria-hidden":"true",className:"tw:w-4 tw:h-4"})]})}),o.jsxs("div",{className:"tw:flex-1",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:t}),o.jsxs("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-foreground tw:rounded",children:["Step ",e]})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:n})]})]})})})}function oK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}function sK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}function iK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}const lK=[{value:"none",label:"No Badge"},{value:"best_value",label:"Best Value"},{value:"editors_choice",label:"Editor's Choice"},{value:"best_rated",label:"Best Rated"},{value:"budget_pick",label:"Budget Pick"},{value:"premium_pick",label:"Premium Pick"}];function cK(){return o.jsx(dK,{})}function uK(){const e=typeof psfaAdmin<"u"?psfaAdmin:null;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/"}}function $k({id:e,upgradeUrl:t}){return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",title:"Available in Premium","data-testid":`premium-hint-${e}`,className:"tw:inline-flex tw:shrink-0 tw:items-center tw:px-1.5 tw:py-0.5 tw:text-xs tw:font-medium tw:leading-none tw:border tw:border-solid tw:border-pro/30 tw:bg-pro-soft tw:text-pro tw:rounded tw:no-underline tw:hover:underline tw:underline-offset-2",children:"Premium"})}function dK(){var V;const{confirm:e}=yb(),{isPremium:t,upgradeUrl:n}=uK(),a=((V=psfaAdmin.addonData)==null?void 0:V.comparisonTables)||[],[r,s]=d.useState(a),[i,l]=d.useState(""),[c,u]=d.useState(!1),[m,f]=d.useState(null),[w,p]=d.useState({isOpen:!1,tableId:null,tableName:"",products:[],loading:!1,saving:!1}),[x,b]=d.useState(""),y=d.useRef(null),h=d.useRef(null),g=async D=>{var T,O;if(D.preventDefault(),!(!i.trim()||c)){u(!0);try{const _=new FormData;_.append("action","psfa_create_comparison_table"),_.append("nonce",((T=psfaAdmin.addonNonces)==null?void 0:T.comparisonTables)||""),_.append("name",i.trim());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();if(H.success){l("");const F={id:H.data.table_id,name:i.trim(),product_count:0},Q=[...r,F];s(Q),psfaAdmin.addonData&&(psfaAdmin.addonData.comparisonTables=Q),_e.success("Table created successfully")}else _e.error(((O=H.data)==null?void 0:O.message)||"Failed to create table")}catch(_){console.error("Failed to create table:",_)}finally{u(!1)}}},v=async D=>{var O,_;if(await e({message:"Are you sure you want to delete this comparison table?",title:"Delete Table",confirmText:"Delete",variant:"danger"}))try{const $=new FormData;$.append("action","psfa_delete_comparison_table"),$.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),$.append("table_id",D.toString());const F=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:$})).json();if(F.success){const Q=r.filter(X=>X.id!==D);s(Q),psfaAdmin.addonData&&(psfaAdmin.addonData.comparisonTables=Q),_e.success("Table deleted")}else _e.error(((_=F.data)==null?void 0:_.message)||"Failed to delete table")}catch($){console.error("Failed to delete table:",$)}},S=D=>{const T=`[psfa_comparison id="${D}"]`;navigator.clipboard.writeText(T),f(D),setTimeout(()=>f(null),2e3)},N=async D=>{var O;const T=r.find(_=>_.id===D);p(_=>({..._,isOpen:!0,tableId:D,tableName:(T==null?void 0:T.name)||"",loading:!0}));try{const _=new FormData;_.append("action","psfa_get_table_data"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",D.toString());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();H.success?p(F=>({...F,tableName:H.data.name,products:H.data.products||[],loading:!1})):p(F=>({...F,loading:!1}))}catch(_){console.error("Failed to load table data:",_),p($=>({...$,loading:!1}))}},A=()=>{p({isOpen:!1,tableId:null,tableName:"",products:[],loading:!1,saving:!1}),b("")},j=async()=>{var D,T;if(w.tableId){p(O=>({...O,saving:!0}));try{const O=new FormData;O.append("action","psfa_update_comparison_table"),O.append("nonce",((D=psfaAdmin.addonNonces)==null?void 0:D.comparisonTables)||""),O.append("table_id",w.tableId.toString()),O.append("name",w.tableName);const $=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:O})).json();if(!$.success){_e.error(((T=$.data)==null?void 0:T.message)||"Failed to save table name"),p(F=>({...F,saving:!1}));return}const H=w.products.map(F=>{var X;const Q=new FormData;return Q.append("action","psfa_update_product_rating"),Q.append("nonce",((X=psfaAdmin.addonNonces)==null?void 0:X.comparisonTables)||""),Q.append("table_id",w.tableId.toString()),Q.append("asin",F.asin),Q.append("rating",F.rating!==null?String(F.rating):""),Q.append("review_count",F.review_count!==null?String(F.review_count):""),Q.append("badge_type",F.badge_type||""),fetch(psfaAdmin.ajaxUrl,{method:"POST",body:Q})});await Promise.all(H),s(F=>F.map(Q=>Q.id===w.tableId?{...Q,name:w.tableName,product_count:w.products.length}:Q)),_e.success("Changes saved successfully"),A()}catch(O){console.error("Failed to save table:",O),_e.error("Failed to save changes")}finally{p(O=>({...O,saving:!1}))}}},C=(D,T,O)=>{const _=T==="badge_type"&&O==="none"?"":O;p($=>({...$,products:$.products.map(H=>H.asin===D?{...H,[T]:T==="badge_type"?_:_===""?null:Number(_)}:H)}))},R=async D=>{var T,O;if(D.preventDefault(),!(!x.trim()||!w.tableId))try{const _=new FormData;_.append("action","psfa_add_comparison_product_by_asin"),_.append("nonce",((T=psfaAdmin.addonNonces)==null?void 0:T.comparisonTables)||""),_.append("table_id",w.tableId.toString()),_.append("asin",x.trim().toUpperCase());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();H.success?(p(F=>({...F,products:[...F.products,{asin:H.data.asin,title:H.data.title,image_url:H.data.image_url,badge_type:"",rating:null,review_count:null}]})),b(""),_e.success("Product added")):_e.error(((O=H.data)==null?void 0:O.message)||"Failed to add product")}catch(_){console.error("Failed to add product:",_)}},M=async D=>{var O;if(!(!w.tableId||!await e({message:"Remove this product from the table?",confirmText:"Remove",variant:"danger"})))try{const _=new FormData;_.append("action","psfa_remove_comparison_product"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",w.tableId.toString()),_.append("asin",D),(await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json()).success&&(p(F=>({...F,products:F.products.filter(Q=>Q.asin!==D)})),_e.success("Product removed"))}catch(_){console.error("Failed to remove product:",_)}},z=D=>{y.current=D},B=D=>{h.current=D},I=async()=>{var O;if(y.current===null||h.current===null||y.current===h.current)return;const D=[...w.products],T=D[y.current];if(D.splice(y.current,1),D.splice(h.current,0,T),p(_=>({..._,products:D})),w.tableId){const _=new FormData;_.append("action","psfa_reorder_comparison_products"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",w.tableId.toString()),D.forEach($=>_.append("order[]",$.asin));try{(await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json()).success&&_e.success("Order saved")}catch($){console.error("Failed to save order:",$)}}y.current=null,h.current=null};return o.jsxs("div",{className:"tw:space-y-8",children:[o.jsx(av,{}),o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"How It Works"}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-4",children:[o.jsx(Zi,{step:"1",title:"Search Products",description:"Visit your search page while logged in as admin.",icon:"search"}),o.jsx(Zi,{step:"2",title:'Click "+ Compare"',description:'Click "+ Compare" on products to add them to a comparison table.',icon:"plus"}),o.jsx(Zi,{step:"3",title:"Use Shortcode",description:"Copy the shortcode and paste it anywhere on your site.",icon:"copy"})]})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"Create New Table"}),o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-info-soft tw:text-info tw:rounded-full",children:o.jsx(mK,{})})}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"New Comparison Table"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Create a table to start adding products for comparison."}),o.jsxs("form",{onSubmit:g,className:"tw:flex tw:flex-wrap tw:gap-2 tw:items-center",children:[o.jsx(pt,{type:"text",value:i,onChange:D=>l(D.target.value),placeholder:"Best Headphones 2026",required:!0,className:"tw:w-64 tw:max-w-full"}),o.jsx("button",{type:"submit",disabled:c,className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0 tw:disabled:opacity-50",children:c?"Creating...":"Create Table"})]})]})]})})})]}),o.jsxs("div",{children:[o.jsxs("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:["Saved Comparison Tables",r.length>0&&o.jsxs("em",{className:"tw:text-sm tw:font-light tw:text-foreground tw:ml-2",children:[r.length," table(s)"]})]}),r.length===0?o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-secondary tw:text-muted-foreground tw:rounded-full",children:o.jsx(Bk,{})})}),o.jsxs("div",{className:"tw:flex-1",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"No Comparison Tables Yet"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:'Create a table above or add products from search results using the "+ Compare" button.'})]})]})})}):o.jsx("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:r.map(D=>o.jsx(It,{children:o.jsx(Yt,{className:"tw:p-4",children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-10 tw:h-10 tw:bg-info-soft tw:text-info tw:rounded-lg",children:o.jsx(Bk,{})})}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:truncate",children:D.name}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:bg-secondary tw:text-muted-foreground tw:rounded",children:fa(D.product_count,"product","products")})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mt-2",children:[o.jsxs("code",{className:"tw:bg-muted tw:border tw:border-border tw:px-2 tw:py-1 tw:rounded tw:text-xs tw:text-foreground tw:flex-1 tw:overflow-hidden tw:text-ellipsis",children:['[psfa_comparison id="',D.id,'"]']}),o.jsx("button",{type:"button",onClick:()=>N(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:border tw:border-info/40 tw:rounded-lg tw:hover:bg-info/15 tw:cursor-pointer tw:transition-colors",children:"Edit"}),o.jsx("button",{type:"button",onClick:()=>S(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:bg-primary tw:text-primary-foreground tw:border-0 tw:rounded-lg tw:hover:bg-primary/90 tw:cursor-pointer tw:transition-colors",children:m===D.id?"Copied!":"Copy"}),o.jsx("button",{type:"button",onClick:()=>v(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-destructive tw:bg-destructive-soft tw:border tw:border-destructive/40 tw:rounded-lg tw:hover:bg-destructive/15 tw:cursor-pointer tw:transition-colors",children:"Delete"})]})]})]})})},D.id))})]}),o.jsx(fK,{isPremium:t,upgradeUrl:n}),o.jsx(Qf,{open:w.isOpen,onOpenChange:D=>!D&&A(),children:o.jsxs(Jf,{className:"tw:grid-cols-1 tw:max-w-2xl tw:max-h-[85vh] tw:overflow-y-auto",onFocus:KT,children:[o.jsx(Dx,{children:o.jsx(Hc,{children:"Edit Table"})}),w.loading?o.jsx("div",{className:"tw:text-center tw:py-8 tw:text-muted-foreground",children:"Loading..."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-1",children:"Table Name"}),o.jsx(pt,{type:"text",className:"tw:mt-3",value:w.tableName,onChange:D=>p(T=>({...T,tableName:D.target.value}))})]}),o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-2",children:"Products (drag to reorder)"}),o.jsx("div",{className:"tw:border tw:mt-3 tw:border-border tw:rounded-lg tw:min-h-[100px] tw:bg-muted tw:overflow-hidden",children:w.products.length===0?o.jsx("div",{className:"tw:p-4 tw:text-center tw:text-muted-foreground tw:text-sm",children:"No products yet. Add by ASIN below."}):o.jsx("div",{className:"tw:divide-y tw:divide-border",children:w.products.map((D,T)=>o.jsx("div",{className:"tw:p-3 tw:bg-card",draggable:!0,onDragStart:()=>z(T),onDragEnter:()=>B(T),onDragEnd:I,onDragOver:O=>O.preventDefault(),children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:text-muted-foreground tw:cursor-move tw:select-none tw:text-lg tw:leading-none tw:pt-2",children:"≡"}),D.image_url?o.jsx("img",{src:D.image_url,alt:"",className:"tw:w-12 tw:h-12 tw:object-contain tw:rounded tw:bg-muted"}):o.jsx("div",{className:"tw:w-12 tw:h-12 tw:bg-secondary tw:rounded"}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsx("div",{className:"tw:max-w-102 tw:text-sm tw:font-medium tw:text-foreground tw:truncate",children:D.title||"Untitled"}),o.jsx("div",{className:"tw:text-xs tw:text-muted-foreground tw:mb-2",children:D.asin}),o.jsx(Ui,{delayDuration:200,children:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-end tw:gap-3 tw:text-xs",children:[o.jsxs("div",{children:[o.jsx(mb,{label:"Rating",tooltip:"Star rating (0 - 5). Amazon's API does not reliably return review data, so ratings are set manually here."}),o.jsx(pt,{type:"number",step:"0.1",min:"0",max:"5",value:D.rating??"",onChange:O=>C(D.asin,"rating",O.target.value),className:"tw:w-16 tw:h-7 tw:px-1.5 tw:text-xs tw:shadow-none",placeholder:"-"})]}),o.jsxs("div",{children:[o.jsx(mb,{label:"Reviews",tooltip:"Review count shown next to the stars. Set manually - Amazon's API does not reliably provide this data."}),o.jsx(pt,{type:"number",min:"0",value:D.review_count??"",onChange:O=>C(D.asin,"review_count",O.target.value),className:"tw:w-20 tw:h-7 tw:px-1.5 tw:text-xs tw:shadow-none",placeholder:"-"})]}),o.jsxs("div",{"data-testid":"table-badge-field",children:[o.jsx(mb,{label:"Badge",tooltip:"Winner badge displayed on the table"}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5",children:[o.jsxs(Vt,{value:D.badge_type||"none",disabled:!t,onValueChange:O=>C(D.asin,"badge_type",O),children:[o.jsx(zt,{className:"tw:w-auto tw:h-7 tw:px-2 tw:text-xs tw:shadow-none tw:gap-1 tw:whitespace-nowrap",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:lK.map(O=>{const _=O.value!=="none"?rK[O.value]:null;return o.jsx(Tt,{value:O.value,className:"tw:text-xs",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-1.5",children:[_&&o.jsx(_,{className:"tw:h-3.5 tw:w-3.5 tw:text-muted-foreground"}),O.label]})},O.value)})})]}),!t&&o.jsx($k,{id:"table-badge",upgradeUrl:n})]})]})]})})]}),o.jsx("button",{onClick:()=>M(D.asin),className:"tw:px-2 tw:py-1 tw:text-xs tw:text-destructive tw:bg-destructive-soft tw:border tw:border-destructive/40 tw:rounded tw:hover:bg-destructive/15 tw:cursor-pointer",children:"Remove"})]})},D.asin))})})]}),o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-1",children:"Add Product by ASIN"}),o.jsxs("form",{onSubmit:R,className:"tw:flex tw:gap-2 tw:mt-3",children:[o.jsx(pt,{type:"text",value:x,onChange:D=>b(D.target.value.toUpperCase()),placeholder:"B09XS7JWHH",pattern:"[A-Za-z0-9]{10}",className:"tw:flex-1 tw:uppercase"}),o.jsx("button",{type:"submit",className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0",children:"Add"})]})]}),o.jsxs("div",{className:"tw:p-3 tw:bg-muted tw:rounded-lg tw:border tw:border-border",children:[o.jsx(Re,{className:"tw:text-xs tw:text-muted-foreground tw:mb-1",children:"Shortcode"}),o.jsxs("code",{className:"tw:text-sm tw:text-foreground",children:['[psfa_comparison id="',w.tableId,'"]']})]})]}),o.jsx(n_,{children:o.jsx("button",{onClick:j,disabled:w.saving,className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0 tw:disabled:opacity-50",children:w.saving?"Saving...":"Save Changes"})})]})})]})}function fK({isPremium:e,upgradeUrl:t}){const n=a=>e?null:o.jsx($k,{id:a,upgradeUrl:t});return o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"Shortcode Options"}),o.jsx(It,{children:o.jsxs(Yt,{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Basic Usage"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5"]'})]}),o.jsxs("div",{className:"tw:border-t tw:border-border tw:pt-4 tw:mb-4",children:[o.jsx("h4",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Available Options"}),o.jsx("div",{className:"tw:overflow-x-auto tw:border tw:border-border tw:rounded-lg",children:o.jsxs("table",{className:"tw:w-full tw:text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"tw:bg-muted",children:[o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Attribute"}),o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Values"}),o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Description"})]})}),o.jsxs("tbody",{className:"tw:text-muted-foreground",children:[o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"id"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Table ID"}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Required. The comparison table ID."})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"columns"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:text-xs",children:"image,title,price,rating,features,button"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Comma-separated list of columns. Options: image, title, price, rating, prime, discount, features, button"})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"size"}),n("size")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"small"}),", ",o.jsx("code",{className:"tw:text-xs",children:"medium"}),", ",o.jsx("code",{className:"tw:text-xs",children:"large"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Table size. Default: medium.",!e&&" Small and large need Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"layout"}),n("layout")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"horizontal"}),", ",o.jsx("code",{className:"tw:text-xs",children:"vertical"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Table layout. Default: horizontal.",!e&&" Vertical needs Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"responsive"}),n("responsive")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"scroll"}),", ",o.jsx("code",{className:"tw:text-xs",children:"stack"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Mobile behavior. scroll = horizontal scroll (default), stack = card view.",!e&&" Stack needs Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"winner"})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"true"}),", ",o.jsx("code",{className:"tw:text-xs",children:"false"})]}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Highlight best value. Default: true"})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"button_text"}),n("button_text")]})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Custom text"}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:'Buy button text. The Managed API always shows "Check price on Amazon".'})]})]})]})})]}),o.jsxs("div",{className:"tw:border-t tw:border-border tw:pt-4",children:[o.jsx("h4",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Examples"}),o.jsxs("div",{className:"tw:space-y-2",children:[o.jsxs("div",{children:[o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:block tw:mb-1",children:"Custom columns:"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5" columns="image,title,price,button"]'})]}),o.jsxs("div",{children:[o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:block tw:mb-1",children:"Vertical layout:"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5" layout="vertical"]'})]})]})]})]})})]})}function mK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}function Bk(){return o.jsx("svg",{className:"tw:w-5 tw:h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})}const Uk="tw:max-h-[min(24rem,var(--radix-select-content-available-height,100vh))]";function wK(){var t,n;return(((n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.marketplace)??"").trim().replace(/^www\./i,"")}function pK(e,t){if(!e||t.some(a=>a.value===e))return null;const n=wK();return{value:e,label:e,tier:"free",supported:!1,reason:n?`Not available on ${n}`:"Not available in this Amazon store"}}function Hk({categories:e,isPremium:t,premiumNote:n,selectedValue:a}){const r=pK(a,e),s=r?[r,...e]:e;return o.jsx(o.Fragment,{children:s.map(i=>{const l=i.tier==="premium"&&!t,c=!i.supported,u=l||c;return o.jsx(Tt,{value:i.value,"data-value":i.value,disabled:u,className:u?"tw:data-[disabled]:opacity-100 tw:text-muted-foreground":void 0,children:o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-0.5",children:[o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:i.label}),l&&n?n:null]}),!l&&c&&i.reason?o.jsx("span",{className:"tw:text-xs",children:i.reason}):null,i.note?o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:i.note}):null]})},i.value)})})}async function Fk(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}const ws="_default_",hK="Browse sub-categories",gK="Loading sub-categories...",xK="Amazon lists no sub-categories here.",bK={keyword_required:"Add a keyword first to see matching sub-categories.",quota:"Your Managed API allowance is used up, so sub-categories can't load right now. You can still enter a number below.",lookup_failed:"Sub-categories couldn't load. You can still enter a number below."},vK=["keyword_required","quota","lookup_failed"];function yK(e){return Array.isArray(e)?e.flatMap(t=>{const n=t&&typeof t=="object"?String(t.id??""):"",a=t&&typeof t=="object"?t.name:void 0;return/^\d+$/.test(n)&&typeof a=="string"&&a.trim()?[{id:n,name:a.trim()}]:[]}):null}async function SK(e,t,n){var r,s;const a={category:e};t&&(a.node=t),n&&(a.keyword=n);try{const i=await kb("psfa_list_subcategories",a,!0);if((i==null?void 0:i.success)===!0){const c=yK((r=i.data)==null?void 0:r.nodes);return c?{nodes:c}:{code:"lookup_failed"}}const l=(s=i==null?void 0:i.data)==null?void 0:s.code;return{code:vK.includes(l)?l:"lookup_failed"}}catch{return{code:"lookup_failed"}}}function jK({category:e,categoryLabel:t,keyword:n,node:a,picked:r,cache:s,onPick:i,onClear:l}){const[c,u]=d.useState({category:e,trail:[]}),[m,f]=d.useState(null),w=d.useRef(null),p=d.useRef(!1),x=c.category===e?c.trail:[],b=x.length?x[x.length-1]:null,y=(n==null?void 0:n.trim())||void 0,h=JSON.stringify([e,(b==null?void 0:b.id)??"",y??""]),g=s.get(h),v=!g&&(m==null?void 0:m.key)===h&&m.status==="loading",S=!g&&(m==null?void 0:m.key)===h&&m.status==="error"?m.code:null,N=!!g||v||S!==null||x.length>0,A=!g&&!v,j=r&&r.id===a?r:null,C=x.map(B=>B.id).join("/");d.useEffect(()=>{var B;p.current&&(p.current=!1,(B=w.current)==null||B.focus())},[C]);const R=d.useCallback(async(B,I)=>{if(s.has(I))return;f({key:I,status:"loading"});const V=await SK(e,B,y);"nodes"in V&&s.set(I,V.nodes),f(D=>(D==null?void 0:D.key)!==I?D:"nodes"in V?null:{key:I,status:"error",code:V.code})},[s,e,y]),M=d.useCallback(B=>{p.current=!0,u({category:e,trail:B});const I=B.length?B[B.length-1].id:"",V=JSON.stringify([e,I,y??""]);B.length>x.length&&R(I,V)},[e,R,y,x.length]),z=v?gK:S?bK[S]:g&&g.length===0?xK:"";return o.jsxs("div",{role:"group","aria-labelledby":"psfa-list-subcategory-label",className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx("p",{id:"psfa-list-subcategory-label",className:"tw:text-sm tw:font-medium tw:leading-none tw:text-foreground tw:m-0",children:"Sub-category"}),j&&o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-baseline tw:gap-x-3 tw:gap-y-1",children:[o.jsx("p",{"data-testid":"psfa-list-subcategory-selected",className:"tw:m-0 tw:min-w-0 tw:text-sm tw:text-foreground tw:[overflow-wrap:anywhere]",children:`Selected: ${j.name} (${j.id})`}),o.jsx(Ae,{type:"button",variant:"link",size:"sm",onClick:l,className:"tw:h-auto tw:p-0",children:"Clear"})]}),N&&o.jsxs("div",{className:"tw:rounded-lg tw:border tw:border-solid tw:border-border tw:bg-card",children:[o.jsx(IA,{"aria-label":"Sub-category path",className:"tw:border-0 tw:border-b tw:border-solid tw:border-border tw:px-3 tw:py-2",children:o.jsxs($A,{className:"tw:m-0 tw:text-xs",children:[o.jsx(Vk,{label:t,current:x.length===0,onSelect:()=>M([])}),x.map((B,I)=>o.jsx(NK,{label:B.name,current:I===x.length-1,onSelect:()=>M(x.slice(0,I+1))},B.id))]})}),o.jsxs("div",{ref:w,tabIndex:-1,"aria-busy":v,className:"tw:outline-none",children:[z&&o.jsx("p",{role:"status",className:"tw:m-0 tw:px-3 tw:py-3 tw:text-sm tw:text-muted-foreground",children:z}),g&&g.length>0&&o.jsx("ul",{"aria-label":`Sub-categories of ${(b==null?void 0:b.name)??t}`,className:"tw:m-0 tw:flex tw:max-h-60 tw:list-none tw:flex-col tw:overflow-y-auto tw:overscroll-contain tw:p-1",children:g.map(B=>{const I=B.id===a;return o.jsxs("li",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1",children:[o.jsx(Ae,{type:"button",variant:"ghost","aria-pressed":I,onClick:()=>i(B),className:E("tw:h-auto tw:min-h-9 tw:min-w-0 tw:flex-1 tw:whitespace-normal tw:px-2 tw:py-2 tw:text-left tw:font-normal tw:text-foreground tw:[overflow-wrap:anywhere]",I&&"tw:bg-info-soft tw:font-medium tw:text-info"),children:o.jsx("span",{className:"tw:w-full tw:text-left",children:B.name})}),o.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":`Show sub-categories of ${B.name}`,onClick:()=>M([...x,B]),className:"tw:shrink-0 tw:text-muted-foreground",children:o.jsx(vc,{"aria-hidden":"true"})})]},B.id)})})]})]}),A&&o.jsx("div",{children:o.jsx(Ae,{type:"button",variant:"outline",size:"sm",onClick:()=>void R((b==null?void 0:b.id)??"",h),children:hK})})]})}function Vk({label:e,current:t,onSelect:n}){return o.jsx(BA,{className:"tw:m-0 tw:min-w-0 tw:max-w-full",children:t?o.jsx(HA,{className:"tw:font-medium tw:text-foreground tw:[overflow-wrap:anywhere]",children:e}):o.jsx(UA,{asChild:!0,children:o.jsx("button",{type:"button",onClick:n,className:"tw:m-0 tw:min-w-0 tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-left tw:text-xs tw:text-muted-foreground tw:underline tw:underline-offset-2 tw:[overflow-wrap:anywhere] tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring",children:e})})})}function NK(e){return o.jsxs(o.Fragment,{children:[o.jsx(FA,{className:"tw:m-0 tw:text-muted-foreground",children:"›"}),o.jsx(Vk,{...e})]})}const Gk=1,Yk=20,CK="Optional. The number at the end of an Amazon Best Sellers page address, for example the Headphones page.",AK="Top sellers aren't available for your Amazon store on the Managed API. New releases still work.",_K="Amazon ignores newest-first sorting in a few departments, which then show Amazon's usual order.";function Gm(e){return e.replace(/\D/g,"").slice(0,Yk)}function Kk(e){return e.replace(/["[\]]/g,"").replace(/\s+/g," ").trim()}const qk=20,rv=10,EK=[{value:"bestsellers",label:"Top sellers"},{value:"new",label:"New releases"}],TK=[{value:"list",label:"List"},{value:"grid",label:"Grid"}];function RK(e,t=!1){const n=e.type==="new"?"new":"bestsellers",a=e.category&&e.category!==ws?e.category:"",r=[`type="${n}"`];if(t&&n==="bestsellers"){if(!a)return"";r.push(`category="${a}"`);const i=Gm(e.node??"");i&&r.push(`node="${i}"`)}else{const i=Kk(e.keyword);if(!i)return"";if(r.push(`keyword="${i}"`),a&&r.push(`category="${a}"`),n==="bestsellers"){const l=Gm(e.node??"");l&&r.push(`node="${l}"`)}}const s=Number.isFinite(e.count)?Math.min(qk,Math.max(Gk,Math.round(e.count))):rv;return s!==rv&&r.push(`count="${s}"`),e.layout==="grid"&&r.push('layout="grid"'),`[psfa_list ${r.join(" ")}]`}function kK({withTitle:e=!0}){var S,N,A,j,C,R;const t=((S=window.psfaAdmin)==null?void 0:S.isPremium)??!1,n=(A=(N=window.psfaAdmin)==null?void 0:N.settings)==null?void 0:A.useManagedApi,a=n===!0||n==="1",r=((j=window.psfaAdmin)==null?void 0:j.upgradeUrl)??"https://paapiplugin.com/pricing/#plans",s=((C=window.psfaAdmin)==null?void 0:C.categories)??[],i=d.useMemo(()=>{var z;const M=(z=window.psfaAdmin)==null?void 0:z.managedBestsellerCategories;return a&&Array.isArray(M)?M.filter(B=>typeof B=="string"):null},[a]),l=d.useMemo(()=>i?s.filter(M=>i.includes(M.value)):s,[s,i]),[c,u]=d.useState({type:"bestsellers",keyword:"",category:"",count:rv,layout:"list",node:""}),[m,f]=d.useState(!1),[w,p]=d.useState(null),x=d.useRef(new Map),b=d.useCallback(M=>{u(z=>({...z,...M}))},[]),y=d.useMemo(()=>RK(c,a),[c,a]),h=a&&c.type==="bestsellers",g=h&&i!==null&&l.length===0,v=d.useCallback(async()=>{y&&(await Fk(y),f(!0),setTimeout(()=>f(!1),2e3))},[y]);return o.jsx(It,{"data-testid":"psfa-list-card",children:o.jsxs(Yt,{className:"tw:p-5",children:[(e||!t)&&o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:e?"Auto-updating Lists":"Auto-updating lists come with Premium"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"A numbered list of top sellers or new releases for a category that keeps itself current."}),t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-type",className:"tw:mb-1.5 tw:block",children:"List Type"}),o.jsxs(Vt,{value:c.type,onValueChange:M=>{const z=M==="new"?"new":"bestsellers",B=z==="bestsellers"&&i!==null&&c.category!==""&&!i.includes(c.category);B&&p(null),b(B?{type:z,category:"",node:""}:{type:z})},children:[o.jsx(zt,{id:"psfa-list-type",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:EK.map(M=>o.jsx(Tt,{value:M.value,children:M.label},M.value))})]}),a&&c.type==="new"&&o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:_K})]}),!h&&o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-keyword",className:"tw:mb-1.5 tw:block",children:"Keyword"}),o.jsx(pt,{id:"psfa-list-keyword",value:c.keyword,onChange:M=>b({keyword:M.target.value}),placeholder:"e.g., air fryer","aria-describedby":"psfa-list-keyword-help","aria-required":"true"}),o.jsx("p",{id:"psfa-list-keyword-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Required. The list is drawn from Amazon's results for this keyword."})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:g?void 0:"psfa-list-category",className:"tw:mb-1.5 tw:block",children:h?"Category (required)":"Category (optional)"}),g?o.jsx("p",{"data-testid":"psfa-list-top-sellers-unavailable",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:AK}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:c.category,onValueChange:M=>{const z=M===ws?"":M;z!==c.category&&(p(null),b({category:z,node:""}))},children:[o.jsx(zt,{id:"psfa-list-category","aria-required":h?"true":void 0,"aria-describedby":h?"psfa-list-category-help":void 0,children:o.jsx(Gt,{placeholder:h?"Choose a category":"-- Default (All) --"})}),o.jsxs(Lt,{className:Uk,children:[!h&&o.jsx(Tt,{value:ws,"data-value":ws,children:"-- Default (All) --"}),o.jsx(Hk,{categories:h?l:s,isPremium:t,premiumNote:null})]})]}),h?o.jsx("p",{id:"psfa-list-category-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Required. On the Managed API, top sellers are Amazon's Best Sellers list for this category, so no keyword is needed."}):c.type==="bestsellers"&&o.jsx("p",{"data-testid":"psfa-list-category-hint",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Pick a category to keep the ranking meaningful. Amazon ranks sales within a category, not across them."})]})]}),c.type==="bestsellers"&&!g&&c.category!==""&&o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-4",children:[o.jsx(jK,{category:c.category,categoryLabel:((R=s.find(M=>M.value===c.category))==null?void 0:R.label)??c.category,keyword:a?void 0:Kk(c.keyword),node:c.node??"",picked:w,cache:x.current,onPick:M=>{p(M),b({node:Gm(M.id)})},onClear:()=>{p(null),b({node:""})}}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-node",className:"tw:mb-1.5 tw:block",children:"Or enter a sub-category number"}),o.jsx(pt,{id:"psfa-list-node",value:c.node??"",onChange:M=>{p(null),b({node:Gm(M.target.value)})},inputMode:"numeric",pattern:"[0-9]*",maxLength:Yk,autoComplete:"off",spellCheck:!1,placeholder:"Digits only","aria-describedby":"psfa-list-node-help",className:"tw:font-mono tw:tabular-nums"}),o.jsx("p",{id:"psfa-list-node-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:CK})]})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-layout",className:"tw:mb-1.5 tw:block",children:"Layout"}),o.jsxs(Vt,{value:c.layout,onValueChange:M=>b({layout:M==="grid"?"grid":"list"}),children:[o.jsx(zt,{id:"psfa-list-layout",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:TK.map(M=>o.jsx(Tt,{value:M.value,children:M.label},M.value))})]})]}),o.jsxs("div",{className:"tw:md:col-span-2",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{htmlFor:"psfa-list-count",children:"Product Count"}),o.jsx("span",{"data-testid":"psfa-list-count-value",className:"tw:text-sm tw:font-medium tw:text-foreground tw:tabular-nums",children:c.count})]}),o.jsx(Vi,{id:"psfa-list-count",min:Gk,max:qk,step:1,value:[c.count],onValueChange:([M])=>b({count:M}),className:"tw:w-full"})]})]}),o.jsxs("div",{className:"tw:flex tw:gap-3 tw:items-center tw:mt-5",children:[y?o.jsx("code",{"data-testid":"psfa-list-shortcode",className:"tw:flex-1 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-border tw:rounded-lg tw:text-sm tw:font-mono tw:text-foreground tw:break-all",children:y}):o.jsx("p",{"data-testid":"psfa-list-shortcode",className:"tw:flex-1 tw:m-0 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-dashed tw:border-border-strong tw:rounded-lg tw:text-sm tw:text-muted-foreground",children:g?"Choose New releases to get a shortcode.":h?"Choose a category to get the shortcode.":"Add a keyword to get the shortcode."}),o.jsxs(Ae,{onClick:v,disabled:!y,className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(MK,{}),m?"Copied!":"Copy"]})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Top sellers or new releases for a category"}),o.jsx("li",{children:"Numbered list or grid, 1 to 20 products"}),o.jsx("li",{children:"Refreshes itself, no manual updates"})]}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})})}function MK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function DK(){return o.jsxs("div",{className:"tw:space-y-8",children:[o.jsxs("div",{"data-testid":"lists-how-it-works",children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"How It Works"}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-4",children:[o.jsx(Zi,{step:"1",title:"Pick a list",description:"Top sellers or new releases.",icon:"list"}),o.jsx(Zi,{step:"2",title:"Choose a category",description:"Add a keyword too where the builder offers one.",icon:"category"}),o.jsx(Zi,{step:"3",title:"Use Shortcode",description:"Copy the shortcode and paste it anywhere on your site. The list refreshes itself at least once a day.",icon:"copy"})]})]}),o.jsx(kK,{withTitle:!1})]})}const OK="https://paapiplugin.com/psfa-documentation/#shortcode",PK="The categories Amazon offers differ by store. This list follows the marketplace you selected on the Amazon connection page.",zK=[{value:"",label:"-- Default --"},{value:"Relevance",label:"Relevance"},{value:"Price:LowToHigh",label:"Price: Low to High"},{value:"Price:HighToLow",label:"Price: High to Low"},{value:"NewestArrivals",label:"Newest Arrivals"},{value:"AvgCustomerReviews",label:"Customer Reviews"},{value:"Featured",label:"Featured"}],Xk=[{value:"",label:"-- Default --"},{value:"Relevance",label:"Relevance"},{value:"AvgCustomerReviews",label:"Customer Reviews"}],LK=Xk.map(e=>e.value),IK=[{value:"",label:"-- Default (infinite) --"},{value:"infinite",label:"Infinite Scroll"},{value:"button",label:"Load More Button"},{value:"none",label:"No Pagination"}],$K=[{value:"",label:"Use site setting"},{value:"grid",label:"Grid"},{value:"list",label:"List",premium:!0}];function BK(e,t,n=!1){const a=[];return e.query.trim()&&a.push(`query="${e.query.trim()}"`),e.category&&a.push(`category="${e.category}"`),e.brand.trim()&&a.push(`brand="${e.brand.trim()}"`),e.sort&&(!n||LK.includes(e.sort))&&a.push(`sort="${e.sort}"`),e.pagination&&a.push(`pagination="${e.pagination}"`),e.pagination==="none"&&e.count!==20&&a.push(`count="${e.count}"`),(e.layout==="grid"||e.layout==="list"&&t)&&a.push(`layout="${e.layout}"`),t&&!n&&e.minSavingPercent>0&&a.push(`min_saving_percent="${e.minSavingPercent}"`),t&&!n&&e.hasDeal&&a.push('has_deal="true"'),e.hideSearch&&a.push('hide_search="true"'),e.hideFilters&&a.push('hide_filters="true"'),e.hideCategoryBanner&&a.push('hide_category_banner="true"'),e.autoDetect||a.push('auto_detect="no"'),a.length>0?`[psfa_search ${a.join(" ")}]`:"[psfa_search]"}function UK(){var x,b,y,h,g;const e=((x=window.psfaAdmin)==null?void 0:x.isPremium)??!1,t=(y=(b=window.psfaAdmin)==null?void 0:b.settings)==null?void 0:y.useManagedApi,n=t===!0||t==="1",a=((h=window.psfaAdmin)==null?void 0:h.upgradeUrl)??"https://paapiplugin.com/pricing/#plans",[r,s]=d.useState({query:"",category:"",brand:"",sort:"",pagination:"",layout:"",count:20,hideSearch:!1,hideFilters:!1,hideCategoryBanner:!1,autoDetect:!0,hasDeal:!1,minSavingPercent:0}),[i,l]=d.useState(!1),c=((g=window.psfaAdmin)==null?void 0:g.categories)??[],u=c.filter(v=>v.supported).length,m=d.useCallback(v=>{s(S=>({...S,...v}))},[]),f=n?Xk:zK,w=d.useMemo(()=>BK(r,e,n),[r,e,n]),p=d.useCallback(async()=>{await Fk(w),l(!0),setTimeout(()=>l(!1),2e3)},[w]);return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-4",children:[o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Search & Content"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Configure default search query and category."}),o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Default Query"}),o.jsx(pt,{value:r.query,onChange:v=>m({query:v.target.value}),placeholder:"e.g., laptop, headphones"})]}),o.jsxs("div",{children:[o.jsx(Ui,{delayDuration:200,children:o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:mb-1.5",children:[o.jsx(Re,{htmlFor:"psfa-shortcode-category",children:"Category"}),o.jsx(ZT,{label:"Category",tooltip:PK})]})}),o.jsxs(Vt,{value:r.category,onValueChange:v=>m({category:v===ws?"":v}),children:[o.jsx(zt,{id:"psfa-shortcode-category",children:o.jsx(Gt,{placeholder:"-- Default (All) --"})}),o.jsxs(Lt,{className:Uk,children:[o.jsx(Tt,{value:ws,"data-value":ws,children:"-- Default (All) --"}),o.jsx(Hk,{categories:c,isPremium:e,premiumNote:o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})})]})]}),!e&&u>0&&o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:[o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," to access every category your Amazon store offers."]})]}),o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Brand"}),o.jsx(pt,{value:r.brand,onChange:v=>m({brand:v.target.value}),placeholder:"e.g., Apple, Samsung"})]}),o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Sort By"}),o.jsxs(Vt,{value:r.sort,onValueChange:v=>m({sort:v==="_default_"?"":v}),children:[o.jsx(zt,{children:o.jsx(Gt,{placeholder:"-- Default --"})}),o.jsx(Lt,{children:f.map(v=>o.jsx(Tt,{value:v.value||"_default_",children:v.label},v.value))})]}),n&&o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Price sorting is not available on the Managed API. Add your own Amazon credentials to sort by price."})]})]})]})}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Display Options"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Control visibility and pagination behavior."}),o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Pagination"}),o.jsxs(Vt,{value:r.pagination,onValueChange:v=>m({pagination:v==="_default_"?"":v}),children:[o.jsx(zt,{children:o.jsx(Gt,{placeholder:"-- Default (infinite) --"})}),o.jsx(Lt,{children:IK.map(v=>o.jsx(Tt,{value:v.value||"_default_",children:v.label},v.value))})]})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-shortcode-layout",className:"tw:mb-1.5 tw:block",children:"Layout"}),o.jsxs(Vt,{value:r.layout,onValueChange:v=>m({layout:v==="_default_"?"":v}),children:[o.jsx(zt,{id:"psfa-shortcode-layout",children:o.jsx(Gt,{placeholder:"Use site setting"})}),o.jsx(Lt,{children:$K.map(v=>{const S=!!v.premium&&!e;return o.jsx(Tt,{value:v.value||"_default_",disabled:S,className:S?"tw:data-[disabled]:opacity-100 tw:text-muted-foreground":void 0,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:v.label}),S?o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"}):null]})},v.value)})})]}),o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:["Overrides the layout on the Settings tab for this shortcode only.",e?null:o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," to use the List layout."]})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{children:"Product Count"}),o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:r.count})]}),o.jsx(Vi,{min:2,max:20,step:1,value:[r.count],onValueChange:([v])=>m({count:v}),disabled:r.pagination!=="none",className:"tw:w-full"}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:mt-1 tw:m-0",children:r.pagination==="none"?"Set the exact number of products to display":"Enable 'No Pagination' to use this setting"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"tw:block tw:text-sm tw:font-medium tw:text-foreground tw:mb-3",children:"Visibility"}),o.jsxs("div",{className:"tw:space-y-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-search",className:"tw:text-sm tw:text-foreground",children:"Hide Search Box"}),o.jsx(_r,{id:"hide-search",checked:r.hideSearch,onCheckedChange:v=>m({hideSearch:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-filters",className:"tw:text-sm tw:text-foreground",children:"Hide Filters"}),o.jsx(_r,{id:"hide-filters",checked:r.hideFilters,onCheckedChange:v=>m({hideFilters:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-category-banner",className:"tw:text-sm tw:text-foreground",children:"Hide Category Banner"}),o.jsx(_r,{id:"hide-category-banner",checked:r.hideCategoryBanner,onCheckedChange:v=>m({hideCategoryBanner:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"auto-detect",className:"tw:text-sm tw:text-foreground",children:"Auto-detect Category"}),o.jsx(_r,{id:"auto-detect",checked:r.autoDetect,onCheckedChange:v=>m({autoDetect:v})})]})]})]})]})]})}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Discount Filters"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Restrict search results to deals and minimum saving thresholds."}),n?o.jsx(ln,{variant:"info","data-testid":"managed-discount-notice",children:o.jsx(Gn,{children:"Deal and discount filters are not available on the Managed API path, because price and discount data are not shown there. Add your own Amazon credentials (Creators API or PA-API) to use these filters."})}):e?o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"has-deal",className:"tw:text-sm tw:text-foreground",children:"Only show products with deals"}),o.jsx(_r,{id:"has-deal",checked:r.hasDeal,onCheckedChange:v=>m({hasDeal:v})})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{htmlFor:"min-saving-percent",children:"Minimum Discount %"}),o.jsxs("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:[r.minSavingPercent,"%"]})]}),o.jsx(Vi,{id:"min-saving-percent",min:0,max:99,step:1,value:[r.minSavingPercent],onValueChange:([v])=>m({minSavingPercent:v}),className:"tw:w-full"}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:mt-1 tw:m-0",children:r.minSavingPercent===0?"Set above 0 to require a minimum discount.":`Show products with at least ${r.minSavingPercent}% off.`})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Filter results to only show products with active deals"}),o.jsx("li",{children:"Set minimum savings percentage thresholds (any value, e.g. 27% off)"}),o.jsx("li",{children:"Combine with category and brand filters"})]}),o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})})]}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Generated Shortcode"})}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Copy this shortcode and paste it into any page or post."}),o.jsxs("div",{className:"tw:flex tw:gap-3 tw:items-center",children:[o.jsx("code",{className:"tw:flex-1 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-border tw:rounded-lg tw:text-sm tw:font-mono tw:text-foreground tw:break-all",children:w}),o.jsxs(Ae,{onClick:p,className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(HK,{}),i?"Copied!":"Copy"]})]}),i&&o.jsx("p",{className:"tw:text-sm tw:text-success tw:m-0 tw:mt-2",children:"Copied to clipboard!"})]})}),o.jsx(It,{"data-testid":"psfa-usage-examples",className:"tw:bg-warning-soft tw:border-warning/40",children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx(FK,{className:"tw:text-warning"}),o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Usage Examples"})]}),o.jsxs("p",{className:"tw:m-0 tw:mb-4 tw:text-sm tw:text-muted-foreground",children:["More examples and a video walkthrough: see the"," ",o.jsxs("a",{href:OK,target:"_blank",rel:"noopener noreferrer",className:"tw:underline tw:text-link",children:["shortcode guide",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]}),"."]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsx(ps,{title:"Basic:",code:"[psfa_search]"}),o.jsx(ps,{title:"Pre-filled search:",code:'[psfa_search query="wireless headphones"]'}),o.jsx(ps,{title:"Category page:",code:'[psfa_search category="Electronics" hide_search="true"]'}),o.jsx(ps,{title:"Product listing:",code:'[psfa_search query="iphone" hide_search="true" hide_filters="true"]'}),o.jsx(ps,{title:"Premium - list layout:",code:'[psfa_search query="iphone" layout="list" hide_search="true" hide_filters="true"]'}),!n&&o.jsx(ps,{title:"Premium - deals only:",code:'[psfa_search min_saving_percent="20" has_deal="true"]'}),o.jsx(ps,{title:"Premium - top sellers list:",code:n?'[psfa_list type="bestsellers" category="Electronics"]':'[psfa_list type="bestsellers" keyword="air fryer" category="HomeAndKitchen"]'})]})]})})]})}function ps({title:e,code:t}){return o.jsxs("div",{children:[o.jsx("p",{className:"tw:text-sm tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:e}),o.jsx("code",{className:"tw:text-xs tw:text-warning tw:bg-warning/10 tw:px-2 tw:py-1 tw:rounded",children:t})]})}function HK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function FK({className:e}){return o.jsx("svg",{className:E("tw:w-5 tw:h-5",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}function Co({label:e,checked:t,onChange:n,premium:a,info:r}){return o.jsxs("label",{className:"tw:group/row tw:relative tw:flex tw:items-center tw:justify-between tw:p-3 tw:bg-muted tw:rounded-lg tw:cursor-pointer tw:hover:bg-accent tw:transition-colors",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:e}),r&&o.jsxs("span",{className:"tw:group",children:[o.jsx("svg",{className:"tw:w-4 tw:h-4 tw:text-muted-foreground tw:hover:text-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),o.jsxs("span",{className:"tw:hidden tw:group-hover:block tw:group-focus-within/row:block tw:absolute tw:z-50 tw:left-2 tw:bottom-full tw:mb-2 tw:w-max tw:max-w-[calc(100%-1rem)] tw:px-3 tw:py-2 tw:text-xs tw:leading-snug tw:text-background tw:bg-foreground tw:rounded-lg tw:whitespace-normal tw:shadow-lg",children:[r,o.jsx("span",{className:"tw:hidden"})]})]}),a&&o.jsx("span",{className:"tw:px-1.5 tw:py-0.5 tw:text-[10px] tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx(_r,{checked:t,onCheckedChange:n})]})}const VK=[{key:"brand",label:"Brand"},{key:"price",label:"Price Range"},{key:"sort",label:"Sort By"},{key:"condition",label:"Condition"},{key:"merchant",label:"Merchant"},{key:"availability",label:"Availability"}],Wk="tw:absolute tw:inset-0 tw:m-0 tw:p-0 tw:border-0 tw:bg-transparent tw:rounded-xl",GK=[{key:"has_deal",label:"Has Deal"},{key:"deals",label:"Discounts"}];function YK(){const e=typeof psfaAdmin<"u"?psfaAdmin.isPremium:!1,t=typeof psfaAdmin<"u"?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/#plans",n=typeof psfaAdmin<"u"?psfaAdmin.settings:null,a=x=>x===!0||x==="1"||x===1,[r,s]=d.useState(()=>{const x={brand:!0,price:!0,sort:!0,condition:!0,merchant:!0,availability:!0,has_deal:!0,deals:!0};return{displayMode:(n==null?void 0:n.displayMode)==="list"?"list":"grid",hideSearch:a(n==null?void 0:n.hideSearch),hideFilters:a(n==null?void 0:n.hideFilters),hideCategoryBanner:a(n==null?void 0:n.hideCategoryBanner),topProductsEnabled:(n==null?void 0:n.topProductsEnabled)===void 0?!0:a(n.topProductsEnabled),whiteLabel:a(n==null?void 0:n.whiteLabel),filterVisibility:typeof(n==null?void 0:n.filterVisibility)=="object"?n.filterVisibility:x}}),[i,l]=d.useState(!1),{confirm:c}=yb(),u=x=>{s(b=>({...b,...x}))},m=x=>{(x==="grid"||x==="list"&&e)&&u({displayMode:x})},f=x=>{s(b=>({...b,filterVisibility:{...b.filterVisibility,[x]:!b.filterVisibility[x]}}))},w=async()=>{var x;l(!0);try{const b=new FormData;b.append("action","psfa_save_settings"),b.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),b.append("psfa_display_mode",r.displayMode),b.append("psfa_hide_search",r.hideSearch?"1":"0"),b.append("psfa_hide_filters",r.hideFilters?"1":"0"),b.append("psfa_hide_category_banner",r.hideCategoryBanner?"1":"0"),b.append("psfa_top_products_enabled",r.topProductsEnabled?"1":"0"),b.append("psfa_white_label",r.whiteLabel?"1":"0"),b.append("psfa_filter_visibility",JSON.stringify(r.filterVisibility));const h=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:b})).json();h.success?(typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,displayMode:r.displayMode,hideSearch:r.hideSearch,hideFilters:r.hideFilters,hideCategoryBanner:r.hideCategoryBanner,topProductsEnabled:r.topProductsEnabled,whiteLabel:r.whiteLabel,filterVisibility:r.filterVisibility}),_e.success("Search settings saved.")):_e.error(((x=h.data)==null?void 0:x.message)||"Search settings could not be saved.")}catch(b){console.error("Failed to save:",b)}finally{l(!1)}},p=async()=>{if(await c({message:"Every search setting goes back to its default.",title:"Reset search settings?",confirmText:"Reset",variant:"danger"}))try{const b=new FormData;if(b.append("action","psfa_reset_settings"),b.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),b.append("section","layout"),(await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:b})).json()).success){const g={displayMode:"grid",hideSearch:!1,hideFilters:!1,hideCategoryBanner:!1,topProductsEnabled:!0,whiteLabel:!1,filterVisibility:{brand:!0,price:!0,sort:!0,condition:!0,merchant:!0,availability:!0,has_deal:!0,deals:!0}};s(g),typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...g}),_e.success("Search settings reset to defaults.")}}catch(b){console.error("Failed to reset:",b)}};return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("section",{className:"tw:mb-6",children:[o.jsx("h2",{id:"psfa-display-layout-heading",className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Display Layout"}),o.jsx("p",{id:"psfa-display-layout-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose how search results are displayed."}),o.jsxs(Zx,{value:e||r.displayMode==="grid"?r.displayMode:"",onValueChange:m,"aria-labelledby":"psfa-display-layout-heading","aria-describedby":"psfa-display-layout-hint",className:"tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{className:E("tw:relative tw:bg-card tw:rounded-xl tw:border tw:transition-[border-color,box-shadow] tw:p-5",r.displayMode==="grid"?"tw:border-ring tw:ring-1 tw:ring-ring":"tw:border-border tw:shadow-xs tw:hover:border-border-strong"),children:[o.jsx(lm,{value:"grid","aria-labelledby":"psfa-layout-grid-title","aria-describedby":"psfa-layout-grid-hint",className:E(Wk,"tw:cursor-pointer")}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx("div",{className:"tw:w-10 tw:h-10 tw:bg-secondary tw:rounded-lg tw:flex tw:items-center tw:justify-center",children:o.jsx(KK,{})}),o.jsx("h3",{id:"psfa-layout-grid-title",className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Grid Layout"})]}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{id:"psfa-layout-grid-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Products displayed in a responsive grid format, perfect for browsing multiple items at once."})]}),o.jsxs("div",{className:E("tw:relative tw:bg-card tw:rounded-xl tw:border tw:transition-[border-color,box-shadow] tw:p-5",r.displayMode==="list"&&e?"tw:border-ring tw:ring-1 tw:ring-ring":"tw:border-border tw:shadow-xs tw:hover:border-border-strong"),children:[o.jsx(lm,{value:"list",disabled:!e,"aria-labelledby":"psfa-layout-list-title","aria-describedby":"psfa-layout-list-tier psfa-layout-list-hint",className:E(Wk,e&&"tw:cursor-pointer")}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx("div",{className:"tw:w-10 tw:h-10 tw:bg-secondary tw:rounded-lg tw:flex tw:items-center tw:justify-center",children:o.jsx(qK,{})}),o.jsx("h3",{id:"psfa-layout-list-title",className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"List Layout"})]}),o.jsx("span",{id:"psfa-layout-list-tier",className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{id:"psfa-layout-list-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Products displayed in a vertical list format, ideal for detailed product information and comparisons."}),!e&&o.jsx("div",{className:"tw:mt-3 tw:flex tw:justify-end",children:o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:relative tw:z-10 tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})})]})]})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-4 tw:mb-6",children:[o.jsxs("section",{className:"tw:bg-card tw:rounded-xl tw:border tw:border-border tw:shadow-xs tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Display Options"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose what each search shows. A shortcode can override the search bar, filters and category banner."}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:[o.jsx(Co,{label:"Hide Search Bar",checked:r.hideSearch,onChange:()=>u({hideSearch:!r.hideSearch}),info:"Hide the search input field. Useful for category-only or curated product pages."}),o.jsx(Co,{label:"Hide Filters",checked:r.hideFilters,onChange:()=>u({hideFilters:!r.hideFilters}),info:"Hide the filter bar entirely. Useful for simple product listings."}),o.jsx(Co,{label:"Hide Category Banner",checked:r.hideCategoryBanner,onChange:()=>u({hideCategoryBanner:!r.hideCategoryBanner}),info:"Hide the 'Top Products in [Category]' banner header on category pages."}),o.jsx(Co,{label:"Top Products on Empty State",checked:r.topProductsEnabled,onChange:()=>u({topProductsEnabled:!r.topProductsEnabled}),info:"When [psfa_search] is rendered with no query and no category, show a rotating mixed-category grid of top products instead of an empty state."}),e&&o.jsx(Co,{label:"White Label",checked:r.whiteLabel,onChange:()=>u({whiteLabel:!r.whiteLabel}),premium:!0,info:"Enable to hide the 'Powered by PaapiPlugin' link below search results."})]}),!e&&o.jsxs("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-4",children:[o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," for white-label mode."]})]}),o.jsxs("section",{className:"tw:bg-card tw:rounded-xl tw:border tw:border-border tw:shadow-xs tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Filter Visibility"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose which filters to display in the search interface."}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:[VK.map(x=>o.jsx(Co,{label:x.label,checked:r.filterVisibility[x.key],onChange:()=>f(x.key)},x.key)),e&&GK.map(x=>o.jsx(Co,{label:x.label,checked:r.filterVisibility[x.key],onChange:()=>f(x.key),premium:!0},x.key))]}),!e&&o.jsxs("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-4",children:[o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," for Has Deal and Discounts filters."]})]})]}),o.jsxs("div",{className:"tw:flex tw:gap-3",children:[o.jsx(Ae,{onClick:w,disabled:i,children:i?"Saving...":"Save settings"}),o.jsx(Ae,{variant:"outline",onClick:p,children:"Reset to Defaults"})]})]})}function KK(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function qK(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}const Zk={amber:{fill:"#f59e0b",ink:"#0a0a0a",border:"#c47e09"},blue:{fill:"#3b82f6",ink:"#0a0a0a",border:"#2f68c5"},cyan:{fill:"#06b6d4",ink:"#0a0a0a",border:"#0592aa"},emerald:{fill:"#10b981",ink:"#0a0a0a",border:"#0d9467"},fuchsia:{fill:"#d946ef",ink:"#0a0a0a",border:"#ae38bf"},green:{fill:"#22c55e",ink:"#0a0a0a",border:"#1b9e4b"},indigo:{fill:"#4f46e5",ink:"#ffffff",border:"#3f38b7"},lime:{fill:"#84cc16",ink:"#0a0a0a",border:"#6aa312"},orange:{fill:"#f97316",ink:"#0a0a0a",border:"#c75c12"},pink:{fill:"#ec4899",ink:"#0a0a0a",border:"#bd3a7a"},purple:{fill:"#9333ea",ink:"#ffffff",border:"#7629bb"},red:{fill:"#ef4444",ink:"#0a0a0a",border:"#bf3636"},rose:{fill:"#f43f5e",ink:"#0a0a0a",border:"#c3324b"},sky:{fill:"#0ea5e9",ink:"#0a0a0a",border:"#0b84ba"},teal:{fill:"#14b8a6",ink:"#0a0a0a",border:"#109385"},violet:{fill:"#7c3aed",ink:"#ffffff",border:"#632ebe"},yellow:{fill:"#eab308",ink:"#0a0a0a",border:"#bb8f06"}},Qk={white:"#ffffff",dark:"#0a0a0a"};function Jk(e,t="auto"){const n=Zk[e]??Zk.orange;return t==="auto"||!Qk[t]?n:{...n,ink:Qk[t]}}const eM=["title","brand","price","deal"],XK=[...eM,"button"],ov=80,sv=150,Ym=5,Wa=100,hs={title:{color:"",scale:Wa},brand:{color:"",scale:Wa},price:{color:"",scale:Wa},deal:{color:"",scale:Wa},button:{color:"",scale:Wa}},tM="#ffffff",nM="#111827",iv="#ffffff",lv="#0a0a0a",WK=/^#[0-9a-f]{6}$/;function ZK(e){if(typeof e!="string")return"";const t=e.trim().toLowerCase();return WK.test(t)?t:""}function aM(e){const t=e.trim().toLowerCase();if(t==="")return"";const n=t.replace(/^#/,"");return/^[0-9a-f]{6}$/.test(n)?`#${n}`:/^[0-9a-f]{3}$/.test(n)?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:null}function QK(e){const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN;if(!Number.isFinite(t))return Wa;const n=Math.round(t/Ym)*Ym;return Math.min(sv,Math.max(ov,n))}function JK(e){const t=e&&typeof e=="object"?e:{},n={};for(const a of XK){const r=t[a]&&typeof t[a]=="object"?t[a]:{};n[a]={color:ZK(r.color),scale:QK(r.scale)}}return n}function eq(e){return e.color===""&&e.scale===Wa}function cv(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function rM(e){const t=parseInt(e.replace("#",""),16);return .2126*cv(t>>16&255)+.7152*cv(t>>8&255)+.0722*cv(t&255)}function gs(e,t){const n=rM(e),a=rM(t);return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function tq(e){return gs(e,tM)>=gs(e,nM)?tM:nM}function nq(e,t="auto"){return t==="white"?iv:t==="dark"?lv:gs(e,iv)>=gs(e,lv)?iv:lv}const aq="Check price on Amazon",Qi=[{id:"neutral",name:"Neutral",swatch:"#a3a3a3",premium:!1},{id:"stone",name:"Stone",swatch:"#a8a29e",premium:!0},{id:"slate",name:"Slate",swatch:"#94a3b8",premium:!0},{id:"zinc",name:"Zinc",swatch:"#a1a1aa",premium:!0},{id:"gray",name:"Gray",swatch:"#9ca3af",premium:!0}],Ji=[{id:"orange",name:"Orange",hex:"#f97316",premium:!1},{id:"red",name:"Red",hex:"#ef4444",premium:!0},{id:"amber",name:"Amber",hex:"#f59e0b",premium:!0},{id:"yellow",name:"Yellow",hex:"#eab308",premium:!0},{id:"lime",name:"Lime",hex:"#84cc16",premium:!0},{id:"green",name:"Green",hex:"#22c55e",premium:!0},{id:"emerald",name:"Emerald",hex:"#10b981",premium:!0},{id:"teal",name:"Teal",hex:"#14b8a6",premium:!0},{id:"cyan",name:"Cyan",hex:"#06b6d4",premium:!0},{id:"sky",name:"Sky",hex:"#0ea5e9",premium:!0},{id:"blue",name:"Blue",hex:"#3b82f6",premium:!0},{id:"indigo",name:"Indigo",hex:"#6366f1",premium:!0},{id:"violet",name:"Violet",hex:"#8b5cf6",premium:!0},{id:"purple",name:"Purple",hex:"#a855f7",premium:!0},{id:"fuchsia",name:"Fuchsia",hex:"#d946ef",premium:!0},{id:"pink",name:"Pink",hex:"#ec4899",premium:!0},{id:"rose",name:"Rose",hex:"#f43f5e",premium:!0}],rq=["0","0.3","0.5","0.75","1.0"],oq=[{key:"deal_badge",label:"Deal Badges",info:"Show Lightning Deal, Best Deal, and other Amazon deal badges"},{key:"prime_exclusive",label:"Prime Exclusive Deals",info:"Show Prime Exclusive Deal indicator badge"},{key:"low_stock",label:"Low Stock Warning",info:"Show animated 'Low Stock' warning when inventory is scarce"},{key:"deal_countdown",label:"Deal Countdown",info:"Show countdown timer for time-limited deals"}],oM={deal_badge:!0,prime_exclusive:!0,low_stock:!0,deal_countdown:!0},Km=[{id:"vega",name:"Vega",description:"Classic shadcn, clean",premium:!1},{id:"nova",name:"Nova",description:"Compact layouts",premium:!0},{id:"maia",name:"Maia",description:"Soft & rounded",premium:!0},{id:"lyra",name:"Lyra",description:"Boxy & sharp",premium:!0},{id:"mira",name:"Mira",description:"Dense interfaces",premium:!0}],el=[{value:"",label:"System Default",family:"",premium:!1},{value:"inter",label:"Inter",family:"'Inter', sans-serif",premium:!0},{value:"roboto",label:"Roboto",family:"'Roboto', sans-serif",premium:!0},{value:"open-sans",label:"Open Sans",family:"'Open Sans', sans-serif",premium:!0},{value:"lato",label:"Lato",family:"'Lato', sans-serif",premium:!0},{value:"montserrat",label:"Montserrat",family:"'Montserrat', sans-serif",premium:!0},{value:"poppins",label:"Poppins",family:"'Poppins', sans-serif",premium:!0},{value:"dm-sans",label:"DM Sans",family:"'DM Sans', sans-serif",premium:!0},{value:"plus-jakarta",label:"Plus Jakarta Sans",family:"'Plus Jakarta Sans', sans-serif",premium:!0},{value:"outfit",label:"Outfit",family:"'Outfit', sans-serif",premium:!0},{value:"space-grotesk",label:"Space Grotesk",family:"'Space Grotesk', sans-serif",premium:!0},{value:"rubik",label:"Rubik",family:"'Rubik', sans-serif",premium:!0},{value:"source-serif",label:"Source Serif 4",family:"'Source Serif 4', serif",premium:!0},{value:"merriweather",label:"Merriweather",family:"'Merriweather', serif",premium:!0},{value:"playfair",label:"Playfair Display",family:"'Playfair Display', serif",premium:!0},{value:"lora",label:"Lora",family:"'Lora', serif",premium:!0}];function sM(e,t){if(!t.length||document.getElementById(e))return;const n=t.map(r=>`family=${encodeURIComponent(r)}:wght@400;600;700`).join("&"),a=document.createElement("link");a.id=e,a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?${n}&display=swap`,document.head.appendChild(a)}const sq=el.filter(e=>e.value).map(e=>e.label),iq={neutral:{light:"#ffffff",dark:"#0a0a0a"},stone:{light:"#ffffff",dark:"#0c0a09"},slate:{light:"#ffffff",dark:"#020817"},zinc:{light:"#ffffff",dark:"#09090b"},gray:{light:"#ffffff",dark:"#030712"}},lq=["deal_badge","deal_countdown","prime_exclusive","low_stock","buybox_winner","used_price"],uv=[{id:"auto",name:"Auto"},{id:"white",name:"White"},{id:"dark",name:"Dark"}],iM=e=>{var t;return((t=uv.find(n=>n.id===e))==null?void 0:t.id)??"auto"},cq=["baseColor","radius","accentColor","accentInk","darkMode","style","font","buttonText","hideAmazonIcon","elementStyles"],uq={title:{label:"Title",name:"Title",picker:"#0a0a0a"},brand:{label:"Brand",name:"Brand",picker:"#737373"},price:{label:"Price",name:"Price",picker:"#c45500"},deal:{label:"Deal badges",name:"Deal badge",picker:"#c2410c"}},dv=4.5;function dq(){var I,V,D,T,O,_,$,H,F,Q,X;const e=typeof psfaAdmin<"u"?psfaAdmin.isPremium:!1,t=typeof psfaAdmin<"u"?((I=psfaAdmin.settings)==null?void 0:I.useManagedApi)===!0:!1,n=typeof psfaAdmin<"u"?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/#plans",a=typeof psfaAdmin<"u"?psfaAdmin.settings:{},[r,s]=d.useState({baseColor:(a==null?void 0:a.baseColor)||"neutral",accentColor:(a==null?void 0:a.accentColor)||"orange",accentInk:iM(a==null?void 0:a.accentInk),style:(a==null?void 0:a.style)||"vega",radius:(a==null?void 0:a.radius)||"0.5",darkMode:(a==null?void 0:a.darkMode)===!0||(a==null?void 0:a.darkMode)==="1",font:(a==null?void 0:a.font)||"",buttonText:(a==null?void 0:a.buttonText)||"Buy on Amazon",hideAmazonIcon:(a==null?void 0:a.hideAmazonIcon)===!0,elementStyles:JK(a==null?void 0:a.elementStyles)}),[i,l]=d.useState(()=>{const P=a!=null&&a.features&&typeof a.features=="object"?a.features:{},G=Object.fromEntries(Object.entries(P).map(([ne,Y])=>[ne,Y===!0||Y==="1"||Y===1]));return{...oM,...G}}),[c,u]=d.useState(!1),{confirm:m}=yb(),f=P=>{l(G=>({...G,[P]:!G[P]}))},[w,p]=d.useState(null);d.useEffect(()=>{if(typeof psfaAdmin>"u")return;let P=!1;const G=new FormData;return G.append("action","psfa_appearance_path_state"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G}).then(ne=>ne.json()).then(ne=>{const Y=ne!=null&&ne.success?ne.data:null;if(P||!Y||typeof Y.buttonText!="string"||!Array.isArray(Y.inactiveAppearanceAxes))return;const Z={buttonText:Y.buttonText,inactiveAppearanceAxes:Y.inactiveAppearanceAxes};psfaAdmin.settings&&(psfaAdmin.settings.effectiveAppearance={...psfaAdmin.settings.effectiveAppearance,buttonText:Z.buttonText},psfaAdmin.settings.inactiveAppearanceAxes=Z.inactiveAppearanceAxes),p(Z)}).catch(()=>{}),()=>{P=!0}},[]);const x=(P,G)=>{s(ne=>({...ne,[P]:G}))},b=(P,G)=>{s(ne=>{const Y=ne.elementStyles??hs;return{...ne,elementStyles:{...Y,[P]:{...Y[P],...G}}}})};d.useEffect(()=>{var G;const P=(G=el.find(ne=>ne.value===r.font))==null?void 0:G.label;P&&r.font&&sM("psfa-preview-font",[P])},[r.font]);const y=d.useCallback(P=>{P&&sM("psfa-all-fonts",sq)},[]),h=async()=>{var P;u(!0);try{const G=new FormData;G.append("action","psfa_save_settings"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),G.append("psfa_base_color",r.baseColor),G.append("psfa_accent_color",r.accentColor),G.append("psfa_accent_ink",r.accentInk??"auto"),G.append("psfa_style",r.style),G.append("psfa_radius",r.radius),G.append("psfa_dark_mode",r.darkMode?"1":"0"),G.append("psfa_font",r.font),G.append("psfa_button_text",r.buttonText),G.append("psfa_hide_amazon_icon",r.hideAmazonIcon?"1":"0"),G.append("psfa_features",JSON.stringify(i)),G.append("psfa_element_styles",JSON.stringify(r.elementStyles??hs));const Y=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G})).json();Y.success?(typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...r,features:i}),_e.success("Appearance saved successfully!")):_e.error(((P=Y.data)==null?void 0:P.message)||"Failed to save appearance")}catch(G){console.error("Failed to save:",G),_e.error("Failed to save appearance. Please try again.")}finally{u(!1)}},g=async()=>{if(await m({message:"Are you sure you want to reset appearance settings to defaults?",title:"Reset Appearance",confirmText:"Reset",variant:"danger"}))try{const G=new FormData;if(G.append("action","psfa_reset_settings"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),G.append("section","appearance"),(await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G})).json()).success){const Z={baseColor:"neutral",accentColor:"orange",accentInk:"auto",style:"vega",radius:"0.5",darkMode:!1,font:"",buttonText:"Buy on Amazon",hideAmazonIcon:!1,elementStyles:hs},le={...i,...oM};s(Z),l(le),typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...Z,features:le}),_e.success("Appearance reset to defaults!")}}catch(G){console.error("Failed to reset:",G),_e.error("Failed to reset. Please try again.")}},v=((V=Ji.find(P=>P.id===r.accentColor))==null?void 0:V.hex)||"#f97316",S=el.find(P=>P.value===r.font),N=a==null?void 0:a.effectiveAppearance,A=e?r:{...r,baseColor:(N==null?void 0:N.baseColor)||"neutral",accentColor:(N==null?void 0:N.accentColor)||"orange",accentInk:iM(N==null?void 0:N.accentInk),style:(N==null?void 0:N.style)||"vega",radius:(N==null?void 0:N.radius)||"0.5",darkMode:(N==null?void 0:N.darkMode)===!0||(N==null?void 0:N.darkMode)==="1",font:(N==null?void 0:N.font)||"",buttonText:(w==null?void 0:w.buttonText)||(N==null?void 0:N.buttonText)||"Buy on Amazon",hideAmazonIcon:(N==null?void 0:N.hideAmazonIcon)===!0||(N==null?void 0:N.hideAmazonIcon)==="1",elementStyles:hs},j=FG({ajaxUrl:typeof psfaAdmin<"u"&&psfaAdmin.ajaxUrl||"",nonce:typeof psfaAdmin<"u"&&psfaAdmin.nonce||"",state:{baseColor:A.baseColor,accentColor:A.accentColor,accentInk:A.accentInk??"auto",style:A.style,radius:A.radius,darkMode:A.darkMode,font:A.font,buttonText:A.buttonText,hideAmazonIcon:A.hideAmazonIcon,features:Object.fromEntries(lq.map(P=>[P,i[P]===!0])),elementStyles:A.elementStyles??hs}}),C=w?w.inactiveAppearanceAxes:a==null?void 0:a.inactiveAppearanceAxes,R=Array.isArray(C)?C:[],M={baseColor:{label:"Base Color",showing:((D=Qi.find(P=>P.id===A.baseColor))==null?void 0:D.name)||""},radius:{label:"Radius",showing:A.radius},accentColor:{label:"Accent Color",showing:((T=Ji.find(P=>P.id===A.accentColor))==null?void 0:T.name)||""},accentInk:{label:"Button Text Color",showing:((O=uv.find(P=>P.id===A.accentInk))==null?void 0:O.name)||""},darkMode:{label:"Dark Mode",showing:A.darkMode?"Dark":"Light"},style:{label:"Style",showing:((_=Km.find(P=>P.id===A.style))==null?void 0:_.name)||""},font:{label:"Font",showing:(($=el.find(P=>P.value===A.font))==null?void 0:$.label)||""},buttonText:{label:"Button Text",showing:`"${A.buttonText}"`},hideAmazonIcon:{label:"Amazon Icon",showing:A.hideAmazonIcon?"Hidden":"Visible"},elementStyles:{label:"Product Text and Buy Button",showing:"Default"}},z=cq.filter(P=>R.includes(P)).map(P=>({key:P,...M[P]})),B=!e&&z.length>0;return o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-[minmax(0,1fr)_320px] tw:gap-8",children:[o.jsxs("div",{className:"tw:@container tw:min-w-0",children:[B&&o.jsxs("div",{"data-testid":"inactive-appearance-panel",className:"tw:mb-8 tw:rounded-lg tw:border tw:border-border tw:bg-muted tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Some of your saved settings are not being applied"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Your site is showing the free defaults for these:"}),o.jsx("ul",{className:"tw:text-sm tw:text-foreground tw:m-0 tw:mb-3 tw:pl-5 tw:list-disc tw:space-y-1",children:z.map(P=>o.jsxs("li",{"data-testid":`inactive-axis-${P.key}`,children:[o.jsx("span",{className:"tw:font-medium",children:P.label}),P.showing?` (showing ${P.showing})`:""]},P.key))}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Your saved values are still stored. They apply automatically once Premium is active."})]}),!e&&o.jsxs("div",{className:"tw:mb-8 tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Unlock Full Appearance Customization"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Upgrade to Premium to access all customization options:"}),o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:list-disc tw:space-y-1",children:[o.jsx("li",{children:"5 base color palettes (Stone, Slate, Zinc, Gray)"}),o.jsx("li",{children:"17 accent colors for buttons, badges & highlights"}),o.jsx("li",{children:"Button text color"}),o.jsx("li",{children:"5 layout styles (Nova, Maia, Lyra, Mira)"}),o.jsx("li",{children:"Adjustable corner radius"}),o.jsx("li",{children:"Dark mode"}),o.jsx("li",{children:"15 Google Fonts"}),o.jsx("li",{children:"Title, brand, price and deal colors and sizes"}),o.jsx("li",{children:"Buy button color and size"}),o.jsx("li",{children:"Custom button text"}),o.jsx("li",{children:"Hide Amazon icon"}),o.jsx("li",{children:"Editorial and Spotlight product box styles"})]}),B&&o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"If you saved these settings on Premium before, they are still stored and apply again as soon as you reactivate."}),o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Upgrade to Premium"})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:@min-[17rem]:grid-cols-2 tw:gap-x-8 tw:gap-y-8 tw:items-start",children:[o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-y-8",children:[o.jsx(_a,{title:"Base Color",description:"Gray scale palette for backgrounds, borders, and text. (Base colors are easier to see in dark mode)",children:e?o.jsxs(Vt,{value:r.baseColor,onValueChange:P=>x("baseColor",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:(H=Qi.find(P=>P.id===r.baseColor))==null?void 0:H.swatch}}),o.jsx("span",{children:(F=Qi.find(P=>P.id===r.baseColor))==null?void 0:F.name})]})})}),o.jsx(Lt,{children:Qi.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:P.swatch}}),o.jsx("span",{children:P.name})]})},P.id))})]}):o.jsxs(Kn,{children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:Qi[0].swatch}}),o.jsx("span",{children:Qi[0].name})]})}),o.jsx(_a,{title:"Accent Color",description:"Primary color for buttons, badges, and highlights.",children:e?o.jsxs(Vt,{value:r.accentColor,onValueChange:P=>x("accentColor",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:v}}),o.jsx("span",{children:(Q=Ji.find(P=>P.id===r.accentColor))==null?void 0:Q.name})]})})}),o.jsx(Lt,{className:"tw:max-h-60",children:Ji.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:P.hex}}),o.jsx("span",{children:P.name})]})},P.id))})]}):o.jsxs(Kn,{children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:Ji[0].hex}}),o.jsx("span",{children:Ji[0].name})]})}),o.jsx(_a,{title:"Button Text Color",description:"Text on buttons, badges and ribbons. Auto picks the more readable one for your accent.",badge:e?void 0:o.jsx(fv,{}),children:o.jsx(fq,{value:e?r.accentInk??"auto":A.accentInk??"auto",accentColor:A.accentColor,isPremium:e,storedLocked:!e&&r.accentInk!=="auto",onChange:P=>x("accentInk",P)})}),o.jsx(_a,{title:"Button Text",description:"Text displayed on the buy button.",children:t?o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx(Kn,{children:aq}),o.jsx(ln,{variant:"info","data-testid":"managed-cta-lock-notice",children:o.jsx(Gn,{children:`Managed API installs use a fixed "Check price on Amazon" button to stay compliant with Amazon's Associates program. This text cannot be changed while the Managed API is active.`})})]}):e?o.jsx(pt,{value:r.buttonText,onChange:P=>x("buttonText",P.target.value),placeholder:"Buy on Amazon"}):o.jsx(Kn,{children:"Buy on Amazon"})})]}),o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-y-8",children:[o.jsx(_a,{title:"Buy Button",description:"Color and size of the buy button.",badge:e?void 0:o.jsx(fv,{}),className:"psfa-buy-button-style",children:o.jsx(hq,{value:(r.elementStyles??hs).button,isPremium:e,accentHex:Jk(A.accentColor).fill,accentInk:r.accentInk??"auto",onChange:P=>b("button",P)})}),o.jsx(_a,{title:"Radius",description:"Corner roundness for cards and buttons.",children:e?o.jsx("div",{className:"tw:@container",children:o.jsx("div",{className:"tw:grid tw:grid-cols-[repeat(2,minmax(0,3.5rem))] tw:gap-2 tw:@min-[8.5rem]:grid-cols-[repeat(3,minmax(0,3.5rem))] tw:@min-[15.75rem]:grid-cols-[repeat(5,minmax(0,3.5rem))]",children:rq.map(P=>o.jsxs("button",{onClick:()=>x("radius",P),className:E("tw:flex tw:min-w-0 tw:flex-col tw:items-center tw:gap-1.5 tw:px-1 tw:py-2.5 tw:rounded-lg tw:border tw:transition-all tw:bg-card tw:cursor-pointer",r.radius===P?"tw:border-ring tw:ring-2 tw:ring-ring/20":"tw:border-border tw:hover:border-border-strong"),children:[o.jsx("span",{className:"tw:w-8 tw:h-8 tw:border-2 tw:border-border-strong tw:bg-muted",style:{borderRadius:`${P}rem`}}),o.jsx("span",{className:"tw:text-xs tw:font-medium tw:text-muted-foreground",children:P})]},P))})}):o.jsx(Kn,{children:"0.5"})}),o.jsx(_a,{title:"Style",description:"Card padding, borders, shadows, and spacing.",children:e?o.jsxs(Vt,{value:r.style,onValueChange:P=>x("style",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsx("span",{children:(X=Km.find(P=>P.id===r.style))==null?void 0:X.name})})}),o.jsx(Lt,{children:Km.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:P.name}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:P.description})]})},P.id))})]}):o.jsx(Kn,{children:Km[0].name})}),o.jsx(_a,{title:"Font",description:"Google Font or system default.",children:e?o.jsxs(Vt,{value:r.font||"_system_",onValueChange:P=>{x("font",P==="_system_"?"":P)},onOpenChange:y,children:[o.jsx(zt,{style:S!=null&&S.family?{fontFamily:S.family}:void 0,children:o.jsx(Gt,{placeholder:"Select font..."})}),o.jsx(Lt,{className:"tw:max-h-60",children:el.map(P=>o.jsx(Tt,{value:P.value||"_system_",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-between tw:w-full tw:gap-2",style:P.family?{fontFamily:P.family}:void 0,children:o.jsx("span",{children:P.label})})},P.value||"_system_"))})]}):o.jsx(Kn,{children:el[0].label})})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:gap-8 tw:md:@min-[17rem]:col-span-2 tw:md:@min-[17rem]:grid-cols-subgrid tw:md:@min-[17rem]:gap-y-0 tw:md:@min-[17rem]:*:row-span-3 tw:md:@min-[17rem]:*:grid tw:md:@min-[17rem]:*:grid-rows-subgrid",children:[o.jsx(_a,{title:"Dark Mode",description:"Light or dark appearance.",children:e?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(_r,{checked:r.darkMode,onCheckedChange:P=>x("darkMode",P)}),o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:r.darkMode?"Dark":"Light"})]}):o.jsx(Kn,{children:"Light"})}),o.jsx(_a,{title:"Amazon Icon",description:"Show or hide the Amazon logo on buy buttons.",children:e?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(_r,{checked:r.hideAmazonIcon,onCheckedChange:P=>x("hideAmazonIcon",P)}),o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:r.hideAmazonIcon?"Hidden":"Visible"})]}):o.jsx(Kn,{children:"Visible"})})]}),o.jsx(_a,{title:"Product Text",description:"Color and size for the title, brand, price and deal badges on every box, table, list and search result.",badge:e?void 0:o.jsx(fv,{}),className:"psfa-element-styles tw:md:@min-[17rem]:col-span-2",children:o.jsx("div",{className:"tw:@container tw:flex tw:flex-col",children:eM.map(P=>o.jsx(pq,{el:P,value:(r.elementStyles??hs)[P],isPremium:e,cardHex:iq[A.baseColor][A.darkMode?"dark":"light"],darkMode:A.darkMode,onChange:G=>b(P,G)},P))})}),o.jsxs("section",{className:"tw:md:@min-[17rem]:col-span-2",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Badge & Deal Settings"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Choose which deal badges show on search results, product boxes and lists."}),e?o.jsx("div",{className:"tw:grid tw:grid-cols-1 tw:md:@min-[20rem]:grid-cols-2 tw:gap-3",children:oq.map(P=>o.jsx(Co,{label:P.label,checked:i[P.key],onChange:()=>f(P.key),info:P.info},P.key))}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Deal Badges - Lightning Deal, Best Deal badges"}),o.jsx("li",{children:"Prime Exclusive Deals indicator"}),o.jsx("li",{children:"Low Stock warning animation"}),o.jsx("li",{children:"Deal Countdown timer"})]}),o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})]}),o.jsxs("div",{className:"tw:pt-6 tw:mt-8 tw:border-t tw:border-border tw:flex tw:flex-wrap tw:gap-3",children:[o.jsx(Ae,{onClick:h,disabled:c,children:c?"Saving...":"Save Appearance"}),o.jsx(Ae,{variant:"outline",onClick:g,children:"Reset to Defaults"})]})]}),o.jsx("div",{className:"tw:hidden tw:lg:block",children:o.jsx("div",{className:"tw:sticky tw:top-[calc(var(--wp-admin--admin-bar--height,32px)+16px)]",children:o.jsx(_k,{previewKey:"appearance",target:j,layout:"card",look:"classic",footer:o.jsx(gq,{managed:t})})})})]})}function _a({title:e,description:t,badge:n,className:a,children:r}){return o.jsxs("div",{className:a,children:[n?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:e}),n]}):o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-1",children:e}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:t}),r]})}function fv(){return o.jsxs("span",{className:bk,children:["PRO",o.jsx("span",{className:"tw:sr-only",children:" (Premium)"})]})}function fq({value:e,accentColor:t,isPremium:n,storedLocked:a,onChange:r}){const s=a?"Your site shows Auto until Premium is active.":n?"":"White and Dark come with Premium.";return o.jsxs("div",{className:"tw:@container",children:[o.jsx(Xi,{name:"accent-ink",label:"Button text color",full:!0,value:e,onChange:r,options:uv.map(i=>{const l=!n&&i.id!=="auto",c=Jk(t,i.id);return{value:i.id,label:i.name,disabled:l,icon:o.jsx("span",{"data-ink-swatch":"","aria-hidden":"true",className:"tw:hidden tw:@[300px]:inline-flex tw:h-5 tw:min-w-[26px] tw:shrink-0 tw:items-center tw:justify-center tw:rounded-[5px] tw:px-1 tw:text-[11px] tw:font-semibold tw:leading-none tw:shadow-[inset_0_0_0_1px_rgb(0_0_0/0.08)]",style:{background:c.fill,color:c.ink},children:"Aa"})}})}),s?o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-2",children:s}):null]})}function mq(e,t,n,a){if(!t)return"";if(e==="deal"){const s=gs(t,tq(t));return s<dv?`Badge text is hard to read on this color (${s.toFixed(1)}:1).`:""}const r=gs(t,n);return r<dv?`Hard to read on ${a?"dark":"light"} cards (${r.toFixed(1)}:1).`:""}const qm="tw:col-span-2 tw:@xs:col-span-1",lM="tw:col-span-full tw:@lg:col-start-2 tw:@lg:col-span-3",wq="linear-gradient(to top right, transparent calc(50% - 0.75px), hsl(var(--border-strong)) calc(50% - 0.75px), hsl(var(--border-strong)) calc(50% + 0.75px), transparent calc(50% + 0.75px))";function pq({el:e,value:t,isPremium:n,cardHex:a,darkMode:r,onChange:s}){const i=uq[e],l=i.name.toLowerCase(),c=n?mq(e,t.color,a,r):"";return o.jsxs("div",{role:"group","aria-label":i.label,className:"tw:grid tw:grid-cols-[minmax(0,1fr)_2.25rem] tw:items-center tw:gap-x-5 tw:gap-y-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:py-3 tw:first:border-t-0 tw:first:pt-0 tw:@xs:grid-cols-[minmax(9rem,15rem)_minmax(9.5rem,1fr)] tw:@lg:grid-cols-[7rem_minmax(9rem,15rem)_minmax(9.5rem,1fr)_2.25rem]",children:[o.jsx("span",{className:"tw:col-start-1 tw:row-start-1 tw:text-sm tw:font-medium tw:text-foreground",children:i.label}),n?o.jsxs(o.Fragment,{children:[o.jsx(cM,{name:i.name,picker:i.picker,value:t.color,onChange:u=>s({color:u}),className:qm}),o.jsxs("div",{className:E(qm,"tw:flex tw:min-w-0 tw:items-center tw:gap-3"),children:[o.jsx(Vi,{min:ov,max:sv,step:Ym,value:[t.scale],onValueChange:([u])=>s({scale:u}),thumbLabels:[`${i.name} size`],formatValueText:u=>`${u}%`,className:"tw:min-w-24"}),o.jsxs("span",{className:"tw:w-11 tw:shrink-0 tw:text-right tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:[t.scale,"%"]})]}),o.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":`Reset ${l} to default`,title:"Reset to default",onClick:()=>s({color:"",scale:Wa}),className:E("tw:col-start-2 tw:row-start-1 tw:justify-self-end tw:@lg:col-start-4",eq(t)&&"tw:invisible"),children:o.jsx(SN,{"aria-hidden":"true"})})]}):o.jsxs(o.Fragment,{children:[o.jsx(Kn,{className:qm,children:"Default"}),o.jsx(Kn,{className:qm,children:"100%"})]}),e==="deal"&&o.jsx("p",{className:E(lM,"tw:m-0 tw:text-xs tw:text-muted-foreground"),children:"Fills the deal and discount badges. Their text turns white or dark, whichever reads better."}),c&&o.jsxs("p",{role:"status",className:E(lM,"tw:m-0 tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:text-muted-foreground"),children:[o.jsx(Sc,{"aria-hidden":"true",className:"tw:size-3.5 tw:shrink-0 tw:text-warning"}),c]})]})}function hq({value:e,isPremium:t,accentHex:n,accentInk:a,onChange:r}){const s=e.color?nq(e.color,a):"",i=s?gs(e.color,s):1/0,l=t&&i<dv?`Button text is hard to read on this color (${i.toFixed(1)}:1).`:"",c=(u,m,f,w)=>o.jsx(Ae,{type:"button",variant:"ghost",size:"icon","aria-label":u,title:m,onClick:()=>r(w),className:E("tw:size-7 tw:shrink-0",f&&"tw:invisible"),children:o.jsx(SN,{"aria-hidden":"true"})});return o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-4",children:[o.jsxs("div",{role:"group","aria-label":"Buy button color",className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5",children:[o.jsxs("div",{className:"tw:flex tw:min-h-7 tw:items-center tw:justify-between tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:"Color"}),t&&c("Reset buy button color to Accent Color","Follow Accent Color",!e.color,{color:""})]}),t?o.jsx(cM,{name:"Buy button",picker:n,value:e.color,placeholder:"Accent",emptySwatch:n,onChange:u=>r({color:u})}):o.jsx(Kn,{children:"Accent color"}),t&&o.jsx("p",{className:"tw:m-0 tw:text-xs tw:text-muted-foreground",children:"Leave it empty to follow Accent Color."}),l&&o.jsxs("p",{role:"status",className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:text-xs tw:text-muted-foreground",children:[o.jsx(Sc,{"aria-hidden":"true",className:"tw:mt-px tw:size-3.5 tw:shrink-0 tw:text-warning"}),l]})]}),o.jsxs("div",{role:"group","aria-label":"Buy button size",className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5",children:[o.jsxs("div",{className:"tw:flex tw:min-h-7 tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:"Size"}),o.jsx("span",{className:"tw:ml-auto tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:t?`${e.scale}%`:""}),t&&c("Reset buy button size to 100%","Reset to 100%",e.scale===Wa,{scale:Wa})]}),t?o.jsx(Vi,{min:ov,max:sv,step:Ym,value:[e.scale],onValueChange:([u])=>r({scale:u}),thumbLabels:["Buy button size"],formatValueText:u=>`${u}%`,className:"tw:min-w-0 tw:h-9"}):o.jsx(Kn,{children:"100%"})]})]})}function cM({name:e,picker:t,value:n,onChange:a,className:r,placeholder:s="Default",emptySwatch:i}){const[l,c]=d.useState(null),u=l??n,m=l!==null&&aM(l)===null;return o.jsxs("div",{className:E(r,"tw:flex tw:min-w-0 tw:items-center tw:gap-2"),children:[o.jsx("span",{className:E("tw:relative tw:size-9 tw:shrink-0 tw:overflow-hidden tw:rounded-md tw:border tw:border-solid tw:border-border-strong tw:has-focus-visible:ring-2 tw:has-focus-visible:ring-ring",!n&&!i&&"tw:bg-card"),style:n?{backgroundColor:n}:i?{backgroundColor:i}:{backgroundImage:wq},children:o.jsx("input",{type:"color","aria-label":`Pick ${e.toLowerCase()} color`,value:n||t,onChange:f=>{c(null),a(f.target.value.toLowerCase())},className:"tw:absolute tw:inset-0 tw:m-0 tw:size-full tw:cursor-pointer tw:border-0 tw:p-0 tw:opacity-0"})}),o.jsx(pt,{"aria-label":`${e} color`,"aria-invalid":m||void 0,placeholder:s,spellCheck:!1,autoComplete:"off",autoCapitalize:"none",maxLength:7,value:u,onChange:f=>{c(f.target.value);const w=aM(f.target.value);w!==null&&a(w)},onBlur:()=>c(null),className:"tw:min-w-0 tw:font-mono"})]})}function Kn({children:e,className:t}){return o.jsx("div",{className:E(t,"tw:flex tw:items-center tw:gap-2 tw:h-9 tw:px-3 tw:rounded-md tw:border tw:border-border tw:bg-muted tw:text-sm tw:text-foreground"),children:e})}function gq({managed:e}){return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:leading-normal tw:text-muted-foreground",children:[o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5",children:[o.jsx(Zo,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsx("span",{children:"A sample product with your unsaved changes."})]}),e&&o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5",children:[o.jsx(lf,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsx("span",{children:"Managed API boxes show no price or deal badges, so their colors do not show here."})]})]})}var xq=Array.isArray,bq=xq,vq=typeof Wn=="object"&&Wn&&Wn.Object===Object&&Wn,yq=vq,Sq=yq,jq=typeof self=="object"&&self&&self.Object===Object&&self,Nq=Sq||jq||Function("return this")(),Xm=Nq,Cq=Xm,Aq=Cq.Symbol,mv=Aq,uM=mv,dM=Object.prototype,_q=dM.hasOwnProperty,Eq=dM.toString,xu=uM?uM.toStringTag:void 0;function Tq(e){var t=_q.call(e,xu),n=e[xu];try{e[xu]=void 0;var a=!0}catch{}var r=Eq.call(e);return a&&(t?e[xu]=n:delete e[xu]),r}var Rq=Tq,kq=Object.prototype,Mq=kq.toString;function Dq(e){return Mq.call(e)}var Oq=Dq,fM=mv,Pq=Rq,zq=Oq,Lq="[object Null]",Iq="[object Undefined]",mM=fM?fM.toStringTag:void 0;function $q(e){return e==null?e===void 0?Iq:Lq:mM&&mM in Object(e)?Pq(e):zq(e)}var wv=$q;function Bq(e){return e!=null&&typeof e=="object"}var wM=Bq,Uq=wv,Hq=wM,Fq="[object Symbol]";function Vq(e){return typeof e=="symbol"||Hq(e)&&Uq(e)==Fq}var Gq=Vq;function Yq(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bu=Yq,Kq=wv,qq=bu,Xq="[object AsyncFunction]",Wq="[object Function]",Zq="[object GeneratorFunction]",Qq="[object Proxy]";function Jq(e){if(!qq(e))return!1;var t=Kq(e);return t==Wq||t==Zq||t==Xq||t==Qq}var eX=Jq,tX=Xm,nX=tX["__core-js_shared__"],aX=nX,pv=aX,pM=function(){var e=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function rX(e){return!!pM&&pM in e}var oX=rX,sX=Function.prototype,iX=sX.toString;function lX(e){if(e!=null){try{return iX.call(e)}catch{}try{return e+""}catch{}}return""}var cX=lX,uX=eX,dX=oX,fX=bu,mX=cX,wX=/[\\^$.*+?()[\]{}|]/g,pX=/^\[object .+?Constructor\]$/,hX=Function.prototype,gX=Object.prototype,xX=hX.toString,bX=gX.hasOwnProperty,vX=RegExp("^"+xX.call(bX).replace(wX,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yX(e){if(!fX(e)||dX(e))return!1;var t=uX(e)?vX:pX;return t.test(mX(e))}var SX=yX;function jX(e,t){return e==null?void 0:e[t]}var NX=jX,CX=SX,AX=NX;function _X(e,t){var n=AX(e,t);return CX(n)?n:void 0}var hM=_X,EX=hM,TX=EX(Object,"create"),Wm=TX,gM=Wm;function RX(){this.__data__=gM?gM(null):{},this.size=0}var kX=RX;function MX(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DX=MX,OX=Wm,PX="__lodash_hash_undefined__",zX=Object.prototype,LX=zX.hasOwnProperty;function IX(e){var t=this.__data__;if(OX){var n=t[e];return n===PX?void 0:n}return LX.call(t,e)?t[e]:void 0}var $X=IX,BX=Wm,UX=Object.prototype,HX=UX.hasOwnProperty;function FX(e){var t=this.__data__;return BX?t[e]!==void 0:HX.call(t,e)}var VX=FX,GX=Wm,YX="__lodash_hash_undefined__";function KX(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=GX&&t===void 0?YX:t,this}var qX=KX,XX=kX,WX=DX,ZX=$X,QX=VX,JX=qX;function tl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}tl.prototype.clear=XX,tl.prototype.delete=WX,tl.prototype.get=ZX,tl.prototype.has=QX,tl.prototype.set=JX;var eW=tl;function tW(){this.__data__=[],this.size=0}var nW=tW;function aW(e,t){return e===t||e!==e&&t!==t}var rW=aW,oW=rW;function sW(e,t){for(var n=e.length;n--;)if(oW(e[n][0],t))return n;return-1}var Zm=sW,iW=Zm,lW=Array.prototype,cW=lW.splice;function uW(e){var t=this.__data__,n=iW(t,e);if(n<0)return!1;var a=t.length-1;return n==a?t.pop():cW.call(t,n,1),--this.size,!0}var dW=uW,fW=Zm;function mW(e){var t=this.__data__,n=fW(t,e);return n<0?void 0:t[n][1]}var wW=mW,pW=Zm;function hW(e){return pW(this.__data__,e)>-1}var gW=hW,xW=Zm;function bW(e,t){var n=this.__data__,a=xW(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}var vW=bW,yW=nW,SW=dW,jW=wW,NW=gW,CW=vW;function nl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}nl.prototype.clear=yW,nl.prototype.delete=SW,nl.prototype.get=jW,nl.prototype.has=NW,nl.prototype.set=CW;var AW=nl,_W=hM,EW=Xm,TW=_W(EW,"Map"),RW=TW,xM=eW,kW=AW,MW=RW;function DW(){this.size=0,this.__data__={hash:new xM,map:new(MW||kW),string:new xM}}var OW=DW;function PW(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var zW=PW,LW=zW;function IW(e,t){var n=e.__data__;return LW(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Qm=IW,$W=Qm;function BW(e){var t=$W(this,e).delete(e);return this.size-=t?1:0,t}var UW=BW,HW=Qm;function FW(e){return HW(this,e).get(e)}var VW=FW,GW=Qm;function YW(e){return GW(this,e).has(e)}var KW=YW,qW=Qm;function XW(e,t){var n=qW(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}var WW=XW,ZW=OW,QW=UW,JW=VW,eZ=KW,tZ=WW;function al(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}al.prototype.clear=ZW,al.prototype.delete=QW,al.prototype.get=JW,al.prototype.has=eZ,al.prototype.set=tZ;var nZ=al,bM=nZ,aZ="Expected a function";function hv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(aZ);var n=function(){var a=arguments,r=t?t.apply(this,a):a[0],s=n.cache;if(s.has(r))return s.get(r);var i=e.apply(this,a);return n.cache=s.set(r,i)||s,i};return n.cache=new(hv.Cache||bM),n}hv.Cache=bM;var rZ=hv,oZ=rZ,sZ=500;function iZ(e){var t=oZ(e,function(a){return n.size===sZ&&n.clear(),a}),n=t.cache;return t}var lZ=iZ,cZ=lZ,uZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dZ=/\\(\\)?/g;cZ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(uZ,function(n,a,r,s){t.push(r?s.replace(dZ,"$1"):a||n)}),t});var vM=mv,yM=vM?vM.prototype:void 0;yM&&yM.toString;var fZ=wv,mZ=bq,wZ=wM,pZ="[object String]";function hZ(e){return typeof e=="string"||!mZ(e)&&wZ(e)&&fZ(e)==pZ}var gZ=hZ;const xZ=Ja(gZ);var nt={};/**476 <!-- /wp:shortcode -->`}function dY(){const e=Nt().ajaxUrl;if(!e)return null;try{return new URL("./",new URL(e,window.location.href))}catch{return null}}async function fY({title:e,content:t}){const n=dY();if(!n)throw new Error(cY);const a=await fetch(new URL("admin-ajax.php?action=rest-nonce",n).toString(),{credentials:"same-origin"}),r=(await a.text()).trim();if(!a.ok||!/^[a-f0-9]{10}$/i.test(r))throw new Error("Your login could not be confirmed. Reload this page and try again.");const s=await fetch(new URL("../index.php?rest_route=/wp/v2/posts",n).toString(),{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":r},body:JSON.stringify({title:e,status:"draft",content:t})});let i=null;try{i=await s.json()}catch{i=null}if(!s.ok||!(i!=null&&i.id))throw new Error((i==null?void 0:i.message)||`Your site answered with HTTP ${s.status}.`);return new URL(`post.php?post=${i.id}&action=edit`,n).toString()}function mY(e){if(!e)return;const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function wY(e){if(typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}async function pY(e,t){var a;return((a=navigator.clipboard)!=null&&a.writeText?await navigator.clipboard.writeText(e).then(()=>!0,()=>!1):!1)||wY(e)?!0:(mY(t),!1)}const Nk="tw:col-start-1 tw:row-start-1 tw:transition-[opacity,transform] tw:duration-[160ms] tw:ease-psfa-out tw:motion-reduce:transition-none";function Ck({text:e,fallbackRef:t,label:n="Copy shortcode",ariaLabel:a,small:r,className:s}){const[i,l]=u.useState(!1),c=u.useRef(0);u.useEffect(()=>()=>window.clearTimeout(c.current),[]);const d=async()=>{await pY(e,t==null?void 0:t.current)?(l(!0),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!1),1800)):_e("Copy didn't work here. The shortcode is selected: press Ctrl+C or Cmd+C.")};return o.jsxs("button",{type:"button","aria-label":a,onClick:d,className:E(Aa,r&&Xa,s),children:[o.jsxs("span",{"aria-hidden":"true",className:"tw:inline-grid",children:[o.jsx(PP,{className:E(Nk,i&&"tw:scale-75 tw:opacity-0")}),o.jsx(yr,{className:E(Nk,"tw:text-success",!i&&"tw:scale-75 tw:opacity-0")})]}),o.jsx("span",{"aria-live":"polite",children:i?"Copied":n})]})}const hY={block:["Open the post and click + where the box should go.","Add a Shortcode block and paste into it.","Update the post."],classic:["Open the post and put the cursor where the box should go.","Paste the shortcode on its own line.","Update the post."],elementor:["Edit the page with Elementor.","Drag a Shortcode widget to where the box should go, then paste into it.","Click Update."]};function gY({shortcode:e,postTitle:t,onChangeBox:n,onLater:a}){const r=u.useRef(null),[s,i]=u.useState("block"),[l,c]=u.useState({status:"idle"}),d=async()=>{if(l.status!=="creating"){c({status:"creating"});try{const m=await fY({title:t,content:uY(e)});c({status:"done",editUrl:m})}catch(m){c({status:"error",message:m instanceof Error?m.message:"Something went wrong."})}}};return o.jsxs("section",{"aria-labelledby":"place-title",className:Rr,children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"place-title",tabIndex:-1,"data-step-heading":"true",className:E($m,"tw:outline-none"),children:"Place it"}),o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5 tw:rounded-full tw:bg-success-soft tw:px-2.5 tw:py-0.5 tw:text-xs tw:font-medium tw:text-success",children:[o.jsx("span",{"aria-hidden":"true",className:"tw:size-1.5 tw:rounded-full tw:bg-success"}),"Saved"]})]}),o.jsxs("div",{className:Bm,children:[o.jsxs("div",{className:"tw:rounded-[10px] tw:border tw:border-solid tw:border-border tw:bg-muted tw:px-3.5 tw:pb-3.5 tw:pt-3",children:[o.jsxs("div",{className:"tw:mb-2.5 tw:flex tw:items-center tw:justify-between tw:gap-3",children:[o.jsx("span",{id:"shortcode-label",className:"tw:text-[11.5px] tw:font-semibold tw:uppercase tw:tracking-[0.07em] tw:text-muted-foreground",children:"Shortcode"}),o.jsx(Ck,{text:e,fallbackRef:r,small:!0})]}),o.jsx("code",{ref:r,"aria-labelledby":"shortcode-label",className:"tw:block tw:select-all tw:rounded-md tw:border tw:border-solid tw:border-border tw:bg-card tw:px-3 tw:py-2.5 tw:font-mono tw:text-sm tw:leading-normal tw:text-foreground tw:[overflow-wrap:anywhere]",children:e})]}),o.jsx("h3",{className:E(Xb,"tw:mb-2.5 tw:mt-[22px]"),children:"Where to paste"}),o.jsx(Xi,{name:"paste-guide",label:"Editor",full:!0,value:s,onChange:i,options:[{value:"block",label:"Block editor"},{value:"classic",label:"Classic editor"},{value:"elementor",label:"Elementor"}]}),o.jsx("ol",{className:"tw:m-0 tw:mt-3 tw:grid tw:list-decimal tw:gap-2 tw:pl-[22px] tw:text-sm tw:text-foreground tw:marker:tabular-nums tw:marker:text-muted-foreground",children:hY[s].map(m=>o.jsx("li",{className:"tw:m-0",children:m},m))}),o.jsxs("div",{className:"tw:mt-[18px] tw:grid tw:justify-items-start tw:gap-2.5",children:[l.status==="done"?o.jsxs("div",{role:"status",className:"tw:text-sm",children:[o.jsxs("p",{className:"tw:m-0 tw:flex tw:flex-wrap tw:items-center tw:gap-1.5 tw:text-foreground",children:[o.jsx(MP,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0 tw:text-success"}),o.jsx("span",{children:"Draft post created."}),o.jsxs("a",{href:l.editUrl,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:gap-1 tw:font-medium tw:text-link",children:["Open it in the editor",o.jsx(pN,{"aria-hidden":"true",className:"tw:size-3.5"}),o.jsx("span",{className:"tw:sr-only",children:"(opens in a new tab)"})]})]}),o.jsx("p",{className:Yn,children:"The box shows to visitors once you publish this post."})]}):o.jsx("button",{type:"button","aria-disabled":l.status==="creating"?"true":void 0,onClick:d,className:E(Aa,Xa),children:l.status==="creating"?"Creating your post...":"Create a post with this box"}),l.status==="error"?o.jsxs(ma,{tone:"bad",title:"The post wasn't created",className:"tw:w-full",children:[l.message," You can still paste the shortcode into any post."]}):null]}),o.jsx("p",{className:E(Yn,"tw:mt-[18px]"),children:"Not ready to paste? The box is saved. Copy the shortcode from Product boxes any time."}),o.jsxs("div",{className:"tw:mt-3 tw:flex tw:flex-wrap tw:gap-2",children:[o.jsxs("button",{type:"button",onClick:n,className:E(Aa,Xa),children:[o.jsx(vN,{"aria-hidden":"true"}),"Change the box"]}),o.jsx("button",{type:"button",onClick:a,className:E(bk,Xa),children:"Place it later"})]})]})]})}const Ak={classic:"tw:w-full tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-card",editorial:"tw:w-full tw:border-0 tw:border-y tw:border-solid tw:border-border tw:py-5",spotlight:"tw:w-full tw:overflow-hidden tw:rounded-xl tw:border-2 tw:border-solid tw:border-primary tw:bg-card"},xY={classic:"",editorial:"tw:rounded-lg tw:bg-muted tw:p-5",spotlight:"tw:bg-primary/10 tw:px-6 tw:pt-7 tw:pb-5"};function Qb({className:e}){return o.jsx(bt,{className:E("tw:h-3 tw:rounded-full",e)})}function Jb({title:e}){return o.jsxs(o.Fragment,{children:[Array.from({length:e},(t,n)=>o.jsx(Qb,{className:E("tw:h-3.5",n===e-1?"tw:w-3/4":"tw:w-full")},n)),o.jsx(Qb,{className:"tw:w-1/3"}),o.jsx(Qb,{className:"tw:w-2/5"})]})}function ev({centered:e,look:t="classic",short:n=!1}){return o.jsxs(o.Fragment,{children:[o.jsx(bt,{className:E(t==="classic"?"tw:h-5 tw:w-20":"tw:h-7 tw:w-24","tw:rounded-full",e&&"tw:mx-auto")}),o.jsx(bt,{className:E(n?"tw:ml-auto tw:w-52 tw:max-w-full":"tw:w-full","tw:rounded-lg",t==="classic"?"tw:h-10":t==="spotlight"?"tw:h-12":"tw:h-11")})]})}function bY({layout:e,look:t,row:n}){const a=e==="minimal";return o.jsxs("div",{className:E(Ak[t],e!=="horizontal"&&"tw:mx-auto tw:max-w-[280px]"),children:[t==="spotlight"&&e!=="minimal"?o.jsx("div",{className:"tw:h-9 tw:bg-primary/20"}):null,o.jsxs("div",{className:E("tw:grid",n&&(t==="editorial"?"tw:grid-cols-[3fr_5fr] tw:items-start tw:gap-6":"tw:grid-cols-[9fr_11fr]"),!n&&t==="editorial"&&"tw:gap-5"),children:[o.jsx("div",{className:E(xY[t],a&&"tw:p-3"),children:o.jsx(bt,{className:E("tw:w-full tw:rounded-lg",a?"tw:mx-auto tw:h-[120px] tw:w-[120px]":e==="horizontal"?"tw:h-[220px]":"tw:h-[200px]")})}),o.jsxs("div",{className:E("tw:flex tw:min-w-0 tw:flex-col tw:gap-2.5",t==="spotlight"&&"tw:p-5"),children:[o.jsx(Jb,{title:a?2:3}),o.jsx("div",{className:"tw:mt-1 tw:flex tw:flex-col tw:gap-2.5",children:o.jsx(ev,{centered:!1,look:t,short:n&&t==="editorial"})})]})]})]})}function vY({layout:e,look:t="classic",device:n,style:a}){const r=Ak.classic,s=n==="desktop",i=e==="horizontal"&&s,l=e==="horizontal"||!s;return o.jsx("div",{"data-testid":"preview-skeleton","data-layout":e,"data-look":t,"data-device":n,"aria-hidden":"true",style:a,className:E("psfa-preview-skeleton tw:w-full tw:transition-opacity tw:duration-[180ms] tw:ease-psfa-out",s?"tw:p-6":"tw:p-4",l?s?"tw:max-w-[760px]":"tw:max-w-[375px]":"tw:max-w-[328px]"),children:t!=="classic"?o.jsx(bY,{layout:e,look:t,row:i}):e==="horizontal"?o.jsxs("div",{className:E(r,"tw:flex",i?"tw:flex-row tw:items-stretch":"tw:flex-col"),children:[o.jsx("div",{className:E("tw:p-4",i&&"tw:w-[220px] tw:shrink-0"),children:o.jsx(bt,{className:"tw:h-[160px] tw:w-full tw:rounded-lg"})}),o.jsx("div",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-2.5 tw:p-4",children:o.jsx(Jb,{title:2})}),i?o.jsx("div",{className:"tw:w-px tw:shrink-0 tw:bg-border"}):null,o.jsx("div",{className:E("tw:flex tw:flex-col tw:justify-center tw:gap-2.5 tw:p-4",i&&"tw:w-[220px] tw:shrink-0"),children:o.jsx(ev,{centered:!0})})]}):o.jsxs("div",{className:E(r,"tw:mx-auto tw:max-w-[280px]"),children:[o.jsx("div",{className:E(e==="minimal"?"tw:p-3 tw:pb-0":"tw:p-4 tw:pb-0"),children:o.jsx(bt,{className:E("tw:rounded-lg",e==="minimal"?"tw:mx-auto tw:h-[120px] tw:w-[120px]":"tw:h-[200px] tw:w-full")})}),o.jsxs("div",{className:E("tw:flex tw:flex-col tw:gap-2.5",e==="minimal"?"tw:p-3":"tw:p-4"),children:[o.jsx(Jb,{title:e==="minimal"?2:3}),o.jsx("div",{className:"tw:mt-1 tw:flex tw:flex-col tw:gap-2.5",children:o.jsx(ev,{centered:!0})})]})]})})}const yY={desktop:1280,phone:375},SY={desktop:24,phone:16};function jY({device:e,viewport:t,docHeight:n,box:a,available:r}){const s=SY[e];let i=0,l=0,c=t,d=n;a&&a.width>0&&a.height>0&&(e==="desktop"&&(i=a.left-s,c=a.width+2*s),l=a.top-s,d=a.height+2*s);const m=r>0?Math.min(1,r/c):1;return{x:i,y:l,width:c,height:d,scale:m}}const NY={left:0,right:0,top:0,bottom:0};function CY(e){const t=[];let n=0,a=0;for(let r=0;r<e.length;r+=1){const s=e[r];s==="("?n+=1:s===")"?n-=1:s===","&&n===0&&(t.push(e.slice(a,r)),a=r+1)}return t.push(e.slice(a)),t}function AY(e){const t={...NY};if(!e||e.trim()==="none")return t;for(const n of CY(e)){const a=n.replace(/[a-z-]+\([^)]*\)/gi," ").replace(/#[0-9a-f]+/gi," ");if(/\binset\b/i.test(a))continue;const r=(a.match(/-?\d*\.?\d+(?:px)?/g)??[]).map(parseFloat);if(r.length<2)continue;const[s,i,l=0,c=0]=r,d=Math.max(0,l)+c;t.left=Math.max(t.left,d-s),t.right=Math.max(t.right,d+s),t.top=Math.max(t.top,d-i),t.bottom=Math.max(t.bottom,d+i)}return t}function _Y(e,t,{rootPaints:n=!0}={}){const a=t.filter(d=>d.width>0||d.height>0),r=n||a.length===0?e:null;let s=r?r.left:1/0,i=r?r.top:1/0,l=r?r.left+r.width:-1/0,c=r?r.top+r.height:-1/0;for(const d of a)s=Math.min(s,d.left-d.shadow.left),i=Math.min(i,d.top-d.shadow.top),l=Math.max(l,d.left+d.width+d.shadow.right),c=Math.max(c,d.top+d.height+d.shadow.bottom);return{left:s,top:i,width:l-s,height:c-i}}const EY=300,TY=180,RY=new Set(["hidden","clip","auto","scroll"]);function kY(e,t){const n=[],a=r=>{const s=t.getComputedStyle(r);if(s.display==="none"||s.visibility==="hidden")return;const i=r.getBoundingClientRect();if(n.push({left:i.left,top:i.top,width:i.width,height:i.height,shadow:AY(s.boxShadow)}),![s.overflow,s.overflowX,s.overflowY].some(l=>RY.has(l)))for(const l of Array.from(r.children))a(l)};for(const r of Array.from(e.children))a(r);return n}const MY={box:null,docHeight:0,available:0,background:""},_k=/^(?:transparent|rgba\(0, 0, 0, 0\))$/;function DY(e){const t=!e.backgroundColor||_k.test(e.backgroundColor),n=e.boxShadow&&e.boxShadow!=="none",a=["top","right","bottom","left"].some(s=>parseFloat(e.getPropertyValue(`border-${s}-width`))>0),r=parseFloat(e.outlineWidth)>0&&e.outlineStyle!=="none";return!t||!!n||a||r}function OY(e,t){for(const n of[e==null?void 0:e.documentElement,e==null?void 0:e.body]){if(!n)continue;const a=t.getComputedStyle(n).backgroundColor;if(a&&!_k.test(a))return a}return""}function PY(e,t){var n,a,r,s,i,l,c,d;return e.docHeight===t.docHeight&&e.background===t.background&&e.available===t.available&&((n=e.box)==null?void 0:n.left)===((a=t.box)==null?void 0:a.left)&&((r=e.box)==null?void 0:r.top)===((s=t.box)==null?void 0:s.top)&&((i=e.box)==null?void 0:i.width)===((l=t.box)==null?void 0:l.width)&&((c=e.box)==null?void 0:c.height)===((d=t.box)==null?void 0:d.height)}function Ek({previewKey:e,target:t,layout:n,look:a,empty:r,footer:s}){const[i,l]=u.useState("desktop"),[c,d]=u.useState(null),[m,f]=u.useState(!1),[w,p]=u.useState(MY),[x,b]=u.useState(null),[y,h]=u.useState(null),g=u.useRef(null),v=u.useRef(null),S=u.useRef(null),N=yY[i];u.useEffect(()=>{if(!e){d(null);return}if(!t||t===c)return;const D=window.setTimeout(()=>{d(t),f(!0)},c?EY:0);return()=>window.clearTimeout(D)},[e,t,c]);const A=u.useCallback(()=>{var P,G,ne,Y,Z;const D=(P=g.current)==null?void 0:P.contentDocument,T=((G=v.current)==null?void 0:G.clientWidth)??0,O=D==null?void 0:D.querySelector(".psfa-product-box-root"),_=O==null?void 0:O.getBoundingClientRect(),$=(D==null?void 0:D.defaultView)??window,H=((ne=D==null?void 0:D.defaultView)==null?void 0:ne.scrollX)??0,F=((Y=D==null?void 0:D.defaultView)==null?void 0:Y.scrollY)??0;let Q=null;if(O&&_&&_.width>0&&_.height>0){const le=_Y({left:_.left,top:_.top,width:_.width,height:_.height},kY(O,$),{rootPaints:DY($.getComputedStyle(O))});Q={...le,left:le.left+H,top:le.top+F}}const X={available:T,docHeight:((Z=D==null?void 0:D.documentElement)==null?void 0:Z.scrollHeight)??0,box:Q,background:OY(D,$)};p(le=>PY(le,X)?le:X)},[]);u.useEffect(()=>{const D=v.current;if(!D||typeof ResizeObserver>"u")return;const T=new ResizeObserver(A);return T.observe(D),()=>T.disconnect()},[A,e]),u.useEffect(()=>{A()},[i,A]),u.useEffect(()=>()=>{var D;return(D=S.current)==null?void 0:D.disconnect()},[]);const j=()=>{var _,$,H;f(!1);const D=g.current,T=D==null?void 0:D.contentDocument;if(!D||!T)return;A(),(((_=T.documentElement)==null?void 0:_.scrollHeight)??0)>0&&b(e),($=S.current)==null||$.disconnect();const O=(H=D.contentWindow)==null?void 0:H.ResizeObserver;if(O&&T.documentElement){S.current=new O(A),S.current.observe(T.documentElement);const F=T.querySelector(".psfa-product-box-root");F&&S.current.observe(F)}},C=w.docHeight>0,R=e!==null&&x===e&&C,M=e!==null&&y!==e;u.useEffect(()=>{if(!R||y===e)return;const D=window.setTimeout(()=>h(e),TY+20);return()=>window.clearTimeout(D)},[R,e,y]);const z=jY({device:i,viewport:N,docHeight:w.docHeight,box:w.box,available:w.available}),B=z.scale<1?w.available:z.width,I=z.height*z.scale,V=Math.max(w.docHeight,z.y+z.height);return o.jsxs("section",{"aria-labelledby":"pv-title",className:E(Rr,"tw:@container"),children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"pv-title",className:$m,children:"Preview"}),o.jsx("div",{className:"tw:flex tw:min-w-0 tw:max-w-full tw:flex-wrap tw:gap-2",children:o.jsx(Xi,{name:"pv-device",label:"Screen size",value:i,onChange:l,options:[{value:"desktop",label:"Desktop",icon:o.jsx(BP,{"aria-hidden":"true"})},{value:"phone",label:"Phone",icon:o.jsx(qP,{"aria-hidden":"true"})}]})})]}),o.jsx("div",{"data-testid":"preview-canvas","aria-busy":e&&!R?"true":void 0,className:"psfa-preview-stage tw:flex tw:min-h-[360px] tw:bg-secondary tw:p-5 tw:@max-[480px]:p-3",children:o.jsxs("div",{ref:v,"data-testid":"preview-stage",className:"tw:grid tw:w-full tw:min-w-0 tw:items-start tw:justify-items-center",children:[e&&M?o.jsx(vY,{layout:n,look:a,device:i,style:{gridArea:"1 / 1",opacity:R?0:1}}):null,e?o.jsx("div",{"data-testid":"preview-page","data-psfa-visitor-preview":"","data-device":i,"data-viewport":N,"data-scale":z.scale.toFixed(3),"aria-hidden":R?void 0:"true",style:{gridArea:"1 / 1",colorScheme:"light",backgroundColor:R?w.background||"Canvas":"transparent",opacity:R?1:0,pointerEvents:R?void 0:"none",width:C?`${B}px`:void 0,height:C?`${I}px`:void 0},className:E("tw:relative tw:shrink-0 tw:overflow-hidden tw:rounded tw:shadow-psfa-xs tw:transition-[opacity,background-color] tw:duration-[180ms] tw:ease-psfa-out",!C&&"tw:h-[160px] tw:w-full tw:max-w-[760px]",!C&&i==="phone"&&"tw:max-w-[375px]"),children:c?o.jsx("div",{"aria-busy":m?"true":void 0,className:E("tw:absolute tw:inset-0 tw:transition-[opacity,filter,scale] tw:duration-[180ms] tw:ease-psfa-out",m&&"tw:scale-[0.995] tw:opacity-[0.35] tw:blur-[2px] tw:motion-reduce:scale-100 tw:motion-reduce:blur-none"),children:o.jsx("iframe",{ref:g,title:"Product box preview",src:c,sandbox:"allow-same-origin allow-scripts",scrolling:"no",tabIndex:-1,onLoad:j,style:{colorScheme:"light",width:`${N}px`,height:C?`${V}px`:"160px",transform:`scale(${z.scale}) translate(${-z.x}px, ${-z.y}px)`,transformOrigin:"0 0"},className:"tw:absolute tw:left-0 tw:top-0 tw:block tw:max-w-none tw:border-0 tw:bg-transparent"},"box-preview")}):null}):r]})}),o.jsx("p",{"data-testid":"preview-status",role:"status",className:"tw:sr-only",children:e&&!R?"Loading preview":""}),s]})}function zY({asin:e,settings:t,caps:n,valid:a}){const r=n.activePath==="managed",s=n.canBadge?t.look:"classic",i=e&&a?VG({ajaxUrl:Nt().ajaxUrl??"",nonce:lk(),asin:e,style:t.style,look:s,button:t.button,allowButton:n.canCustomButton,title:t.title,rating:t.rating,reviews:t.reviews,badge:t.badge,sendBadge:n.canBadge}):null,c=(n.canCustomButton?Gb(t.button):"")||n.buttonText;return o.jsx(Ek,{previewKey:e,target:i,layout:t.style,look:s,empty:o.jsxs("div",{className:"tw:col-start-1 tw:row-start-1 tw:m-auto tw:flex tw:max-w-[300px] tw:flex-col tw:items-center tw:gap-2 tw:text-center tw:text-sm tw:text-muted-foreground",children:[o.jsx(Zo,{"aria-hidden":"true",className:"tw:size-6"}),o.jsx("p",{className:"tw:m-0",children:"Pick a product to see the box here, as it will look in a post."})]}),footer:o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx(Ng,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsxs("span",{className:"tw:[overflow-wrap:anywhere]",children:["Uses your"," ",o.jsx(Bn,{to:se.appearance,className:hu,children:"Appearance settings"}),".",c?` The button says “${c}”${r?" on the Managed API":""}.`:""]})]})})}const Tk=e=>new Intl.NumberFormat("en-US").format(e);function Rk(e,t,n){if(typeof e=="number")return typeof t=="number"&&typeof n=="number"&&n>0?Math.max(0,Math.min(e,n-t)):Math.max(0,e)}function LY({quota:e}){const t=zb(),n=e?Rk(e.remaining,e.usedMonth,e.monthlyLimit):Rk(t.remaining,t.usedMonth,t.capMonth);if(typeof n!="number")return null;const a=e?e.limit:t.cap,r=typeof a=="number"&&a>0?`Each search or product lookup uses 1 of your ${Tk(a)} a day.`:"Each search or product lookup counts toward your daily allowance.";return o.jsx("p",{className:`${Yn} tw:tabular-nums`,role:"status",children:`${r} ${Tk(n)} left today.`})}const IY=["Find product","Set up","Place it"],$Y=["find","setup","place"];function BY({step:e}){const t=e==="done"?3:$Y.indexOf(e);return o.jsx("ol",{"aria-label":"Steps",className:"tw:m-0 tw:mb-5 tw:flex tw:list-none tw:flex-wrap tw:items-center tw:p-0",children:IY.map((n,a)=>{const r=a<t,s=a===t;return o.jsxs("li",{"aria-current":s?"step":void 0,className:E("tw:m-0 tw:flex tw:items-center tw:gap-2 tw:text-sm tw:font-medium tw:text-muted-foreground",s&&"tw:font-semibold tw:text-foreground"),children:[a>0?o.jsx("span",{"aria-hidden":"true",className:"tw:mx-2.5 tw:h-px tw:w-8 tw:bg-border tw:max-[560px]:mx-1.5 tw:max-[560px]:w-3.5"}):null,o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-flex tw:size-[22px] tw:items-center tw:justify-center tw:rounded-full tw:border-[1.5px] tw:border-solid tw:border-input tw:text-xs tw:font-semibold tw:tabular-nums",s&&"tw:border-foreground tw:bg-foreground tw:text-background",r&&"tw:border-success tw:bg-success tw:text-primary-foreground"),children:r?o.jsx(yr,{className:"tw:size-[13px]",strokeWidth:2.6}):a+1}),o.jsx("span",{className:E(!s&&"tw:max-[560px]:sr-only"),children:n}),o.jsx("span",{className:"tw:sr-only",children:r?" (done)":s?" (current step)":""})]},n)})})}const kk={title:"Use a title of 255 characters or fewer.",rating:Yb,reviews:dk,badge:"Choose one of the listed badges.",button:"Use button text of 100 characters or fewer.",button_text:"Use button text of 100 characters or fewer."},UY={button_text:"button"},HY=e=>new Intl.NumberFormat("en-US").format(e);function tv(e){return{asin:e.asin,title:e.title,brand:e.brand,image:e.image,price:e.price}}function Mk(e,t){return{asin:e.asin,title:(t==null?void 0:t.title)||e.amazonTitle||e.title,brand:(t==null?void 0:t.brand)??"",image:(t==null?void 0:t.image)||e.image,price:t==null?void 0:t.price}}function Dk(e){return{...Um,style:HG(e.style)?e.style:"card",look:FG(e.look)?e.look:"classic",button:e.buttonText??"",title:e.titleOverride||"",rating:e.rating==null?"":String(e.rating),reviews:e.reviewCount==null?"":HY(e.reviewCount),badge:e.badge||"none"}}function Ok(e){return e==="place"||e==="done"?e:void 0}function Pk(e,t,n){return e?`box:${e.toUpperCase()}:${n??"setup"}`:`new:${t}`}const FY={find:"find-title",setup:"find-title",place:"place-title",done:"done-title"},VY={find:"Step 1 of 3: Find product",setup:"Step 2 of 3: Set up",place:"Step 3 of 3: Place it",done:"Box placed"};function zk(){const{asin:e}=Wj(),{search:t}=jn(),n=new URLSearchParams(t),a=Pk(e,n.get("q")??"",Ok(n.get("step"))),r=u.useRef(null),[s,i]=u.useState({routeKey:a,key:0});if(s.routeKey!==a){const l=r.current===a;r.current=null,i({routeKey:a,key:l?s.key:s.key+1})}return o.jsx(GY,{onAdopt:l=>{r.current=Pk(l.asin,"",l.step)}},s.key)}function GY({onAdopt:e}){const{asin:t}=Wj(),[n]=dP(),a=pi(),r=t?"":n.get("q")??"",s=!1,[i,l]=u.useState(Vb),[c,d]=u.useState(()=>uk(Vb())),[m,f]=u.useState(t?Ok(n.get("step"))??"setup":"find"),[w,p]=u.useState(""),x=u.useRef(m),[b,y]=u.useState(null),[h,g]=u.useState(Um),[v,S]=u.useState(null),[N,A]=u.useState(!!t),[j,C]=u.useState(null),[R,M]=u.useState({status:"idle"}),[z,B]=u.useState(!1),[I,V]=u.useState(!1),[D,T]=u.useState(!1),[O,_]=u.useState("settings"),[$,H]=u.useState({}),[F,Q]=u.useState(!1),[X,P]=u.useState(!1),[G,ne]=u.useState(!1),[Y,Z]=u.useState(null),[le,he]=u.useState(0),ae=u.useRef(!0),K=u.useRef(null);K.current=v;const ge=u.useRef(0),Ce=u.useRef(0),We=u.useRef(!1);u.useEffect(()=>(ae.current=!0,()=>{ae.current=!1}),[]);const Ke=()=>{ge.current+=1;const ie=ge.current;return()=>ae.current&&ge.current===ie},at=()=>{ge.current+=1,Ce.current+=1};u.useEffect(()=>{if(t||i==="none")return;let ie=!0;return Om(1,1).then(Ee=>{ie&&ae.current&&d(Ee.capabilities)}).catch(()=>{}),()=>{ie=!1}},[t,i]),u.useEffect(()=>{if(!t||t.toUpperCase()===K.current)return;let ie=!0;return A(!0),C(null),ck(t.toUpperCase()).then(({box:Ee,capabilities:$e})=>{ie&&(d($e),y(Mk(Ee)),g(Dk(Ee)),S(Ee.asin),A(!1))}).catch(()=>{ie&&(C(t.toUpperCase()),A(!1))}),()=>{ie=!1,ae.current&&A(!1)}},[t]),u.useEffect(()=>{r&&i!=="none"&&Xt(r)},[]),u.useEffect(()=>{var Ee;if(x.current===m)return;x.current=m,p(VY[m]);const ie=document.activeElement;m==="find"&&ie&&ie!==document.body||(Ee=document.getElementById(FY[m]))==null||Ee.focus()},[m]);const Kt=i==="managed"&&c.activePath==="managed"&&!s;function He(ie){const Ee=t==null?void 0:t.toUpperCase();(ie.asin??void 0)!==Ee&&(e(ie),a(ie.asin?`/boxes/${ie.asin}`:"/boxes/new",{replace:!0}))}function qt(ie){Ce.current+=1,He({}),y(ie),g(Um),S(null),B(!1),H({}),P(!1),M({status:"idle"}),f("setup"),_("settings")}function Cn(ie,Ee,$e){Ce.current+=1,He({asin:ie.asin}),$e&&d($e),y(Mk(ie,Ee)),g(Dk(ie)),S(ie.asin),B(!0),H({}),P(!1),M({status:"idle"}),f("setup"),_("settings")}function mt(ie,Ee){var re;const $e=ie instanceof ds?ie:new ds("unavailable","Something went wrong.");if($e.quota&&Z($e.quota),$e.code==="not_configured"){l("none"),V(!0),M({status:"idle"});return}if($e.code==="invalid"){M({status:"error",note:{tone:"warn",title:"We couldn't read that",text:"Type a keyword, or paste an Amazon product link or a 10-character ASIN."}});return}M({status:"error",note:gk({code:$e.code,...Ee,store:YG(((re=Nt().settings)==null?void 0:re.marketplace)??""),path:c.activePath,premium:s,quota:$e.quota??null})})}function Xt(ie){const Ee=Pm(ie);B(!1);const $e=Ke();if(Ee.type==="short"){M({status:"error",note:gk({code:"short_link"})});return}if(Ee.type!=="badlink"){if(M({status:"loading",query:Ee.type==="keyword"?Ee.query:Ee.asin}),Ee.type==="keyword"){MG(Ee.query).then(re=>{$e()&&(re.quota&&Z(re.quota),M({status:"results",query:re.query||Ee.query,results:re.results}))}).catch(re=>{$e()&&mt(re,{kind:"keyword",query:Ee.query})});return}kG(ie).then(({product:re,box:Je,quota:dt})=>{$e()&&(dt&&Z(dt),Je?Cn(Je,re):qt(tv(re)))}).catch(re=>{if($e()){if(re instanceof ds&&re.code==="unavailable"){qt({asin:Ee.asin,title:"",brand:"",image:"",unavailable:!0});return}mt(re,{kind:"asin",asin:Ee.asin})}})}}function an(ie){if(!ie.hasBox){qt(tv(ie));return}const Ee=Ke();M({status:"loading",query:ie.asin}),ck(ie.asin).then(({box:$e,capabilities:re})=>{Ee()&&Cn($e,ie,re)}).catch(()=>{Ee()&&qt(tv(ie))})}function wn(){at(),f("find"),B(!1),M({status:"idle"}),he(ie=>ie+1)}function An(){at(),y(null),g(Um),S(null),B(!1),C(null),M({status:"idle"}),H({}),f("find"),he(ie=>ie+1)}const qn=(ie,Ee)=>{g($e=>({...$e,[ie]:Ee})),H($e=>$e[ie]?{...$e,[ie]:void 0}:$e)},oe={...$,rating:fk(h.rating)||$.rating,reviews:mk(h.reviews)||$.reviews},ye=!!(fk(h.rating)||mk(h.reviews)),we=Object.values(oe).some(Boolean);async function Ve(){if(!b||We.current)return;We.current=!0,Ce.current+=1;const ie=Ce.current,Ee=()=>ae.current&&Ce.current===ie;Q(!0),P(!1);const $e={asin:b.asin,title:h.title.trim(),rating:h.rating.trim(),reviews:Kb(h.reviews),style:h.style};c.canBadge&&($e.badge=h.badge||"none"),c.canBadge&&($e.look=h.look),c.canCustomButton&&($e.button_text=Gb(h.button));try{const{box:re,quota:Je}=await DG($e);if(!Ee())return;Je&&Z(Je),e({asin:re.asin,step:"place"}),S(re.asin),B(!1),H({}),f("place"),_("settings"),a(`/boxes/${re.asin}?step=place`,{replace:!0})}catch(re){if(!Ee())return;re instanceof ds&&re.code==="invalid"&&re.field&&kk[re.field]?H({[UY[re.field]??re.field]:kk[re.field]}):P(!0)}finally{We.current=!1,ae.current&&Q(!1)}}async function ze(){if(!G){ne(!0);try{if(await PG(),!ae.current)return;f("done"),_("settings"),b&&(e({asin:b.asin,step:"done"}),a(`/boxes/${b.asin}?step=done`,{replace:!0}))}catch{ae.current&&_e.error("That step didn't save. Try again.")}finally{ae.current&&ne(!1)}}}const Wt=ie=>{l(ie.activePath),d(uk(ie.activePath)),V(!1),T(!0),M({status:"idle"})},Ge=c.activePath==="managed",Ea=b?UG({asin:b.asin}):"";let pa=v?"Edit product box":"New product box",Xn=null;if(m==="find"||m==="setup"){const ie=i==="none"&&!b?"Connect to Amazon first.":N?"Loading the box.":b?we?"Fix the highlighted field first.":"":"Pick a product first.";Xn=o.jsxs("span",{className:"tw:inline-flex tw:flex-col tw:items-end tw:gap-1 tw:max-[782px]:items-stretch",children:[o.jsx("button",{type:"button","aria-disabled":ie||F?"true":"false","aria-describedby":ie?"save-blocked":void 0,onClick:()=>{ie||Ve()},className:pu,children:F?"Saving":v?"Save changes":"Save and get shortcode"}),ie?o.jsx("span",{id:"save-blocked",className:"tw:text-[12.5px] tw:text-muted-foreground",children:ie}):null]})}else m==="place"?Xn=o.jsxs("button",{type:"button","aria-disabled":G?"true":void 0,onClick:ze,className:pu,children:[o.jsx(yr,{"aria-hidden":"true"}),"I've placed it"]}):(pa="Box placed",Xn=o.jsxs("button",{type:"button",className:pu,onClick:()=>{An(),a("/boxes/new")},children:[o.jsx(Cg,{"aria-hidden":"true"}),"New box"]}));const Ta=!!(b&&b.title.length>120&&!h.title.trim()),rn=o.jsxs("section",{"aria-labelledby":"find-title",className:Rr,children:[o.jsxs("div",{className:Im,children:[o.jsx("h2",{id:"find-title",tabIndex:-1,"data-step-heading":"true",className:E($m,"tw:outline-none"),children:i==="none"&&!b?"Connect to Amazon":"Product"}),b&&m!=="find"?o.jsx("span",{className:"tw:font-mono tw:text-[13px] tw:text-muted-foreground",children:b.asin}):null]}),o.jsxs("div",{className:E(Bm,"tw:flex tw:flex-col tw:gap-3.5"),children:[z&&m==="setup"?o.jsx(ma,{tone:"info",title:"You already have a box for this product, so we opened it",actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{An(),a("/boxes/new",{replace:!0})},children:"Find a different product"}),children:"Changes here update that box everywhere it's placed."}):null,j?o.jsx(ma,{tone:"bad",title:`There's no box for ASIN ${j}`,actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{An(),a("/boxes/new",{replace:!0})},children:"Find a product"}),children:"It may have been deleted. Find the product to make a new box."}):N?o.jsxs("div",{"aria-label":"Loading the box",className:"tw:grid tw:grid-cols-[56px_1fr] tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-14 tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx(bt,{className:"tw:h-3.5 tw:w-4/5"}),o.jsx(bt,{className:"tw:h-3 tw:w-2/5"})]})]}):b&&m!=="find"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[56px_minmax(0,1fr)_auto] tw:items-center tw:gap-3",children:[o.jsx(Zb,{src:b.image,className:"tw:size-14"}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("div",{title:b.title||void 0,className:"tw:line-clamp-2 tw:text-sm tw:font-semibold tw:text-foreground tw:[overflow-wrap:anywhere]",children:b.title||`ASIN ${b.asin}`}),o.jsx("div",{className:"tw:mt-0.5 tw:truncate tw:text-[12.5px] tw:text-muted-foreground",title:b.brand||void 0,children:b.brand||"Brand not listed"})]}),o.jsx("button",{type:"button",onClick:wn,className:E(Aa,Xa),children:"Change"})]}),b.unavailable?o.jsx(ma,{tone:"warn",title:"This product is unavailable on Amazon right now",actions:o.jsx("button",{type:"button",className:hu,onClick:wn,children:"Pick another product"}),children:`Until it's back, visitors see "Product details are unavailable." in its place. You can still save the box.`}):Ge?o.jsx(ma,{tone:"info",children:`The Managed API doesn't show prices. The button says "Check price on Amazon" and Amazon shows the live price.`}):b.price===""?o.jsx(ma,{tone:"warn",title:"Amazon isn't sending a price for this product",children:"The box shows no price. The button still takes visitors to Amazon."}):null,Ta&&!b.unavailable?o.jsxs(ma,{tone:"info",title:"This title is long",actions:o.jsx("button",{type:"button",className:hu,onClick:()=>{var ie;_("settings"),(ie=document.getElementById("box-title"))==null||ie.focus()},children:"Write a shorter title"}),children:[h.style==="card"?"The card shows the first 3 lines.":"The box shows the first 2 lines."," A short title reads better."]}):null]}):i==="none"?o.jsxs(o.Fragment,{children:[I?o.jsx(ma,{tone:"info",children:"Connect to Amazon first, then start with the product."}):null,o.jsx(ik,{idPrefix:"builder-connect",showAlternative:!0,onConnected:Wt})]}):o.jsxs("div",{children:[o.jsx(Sk,{idPrefix:"builder-finder",initial:r,autoFocus:!r||D||le>0,onSubmit:Xt,footer:Kt?o.jsx(LY,{quota:Y}):null},le),R.status==="loading"?o.jsxs("p",{role:"status",className:E(Yn,"tw:mt-3 tw:[overflow-wrap:anywhere]"),children:['Looking up "',R.query,'"']}):null,R.status==="loading"?o.jsx("ul",{"aria-label":"Looking up products",className:"tw:m-0 tw:mt-2 tw:grid tw:list-none tw:gap-2.5 tw:p-0",children:[0,1,2].map(ie=>o.jsxs("li",{className:"tw:m-0 tw:grid tw:grid-cols-[48px_1fr] tw:items-center tw:gap-3",children:[o.jsx(bt,{className:"tw:size-12 tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-1.5",children:[o.jsx(bt,{className:"tw:h-3",style:{width:`${90-ie*15}%`}}),o.jsx(bt,{className:"tw:h-2.5 tw:w-2/5"})]})]},ie))}):null,R.status==="error"?o.jsx(ma,{tone:R.note.tone,title:R.note.title,className:"tw:mt-3.5",children:R.note.text}):null,R.status==="results"?o.jsx(lY,{results:R.results,query:R.query,onPick:an}):null]}),X?o.jsx(ma,{tone:"bad",title:"The box wasn't saved",children:"Your site couldn't store it just now. Try again in a moment."}):null]})]}),Za=m==="place"&&b?o.jsx(gY,{shortcode:Ea,postTitle:h.title.trim()||b.title||`Product ${b.asin}`,onChangeBox:()=>{f("setup"),_("settings"),e({asin:b.asin}),a(`/boxes/${b.asin}`,{replace:!0})},onLater:()=>a("/boxes")}):m==="done"&&!j?o.jsx(nY,{onHome:()=>a("/"),onAll:()=>a("/boxes")}):m==="place"||m==="done"?rn:o.jsxs(o.Fragment,{children:[rn,b&&m==="setup"&&!N?o.jsx(JG,{settings:h,onChange:qn,caps:c,errors:oe}):null]});return o.jsxs("div",{className:"tw:@container",children:[o.jsx(fu,{title:pa,actions:Xn}),o.jsx("p",{"data-testid":"step-announcer",role:"status",className:"tw:sr-only",children:w}),o.jsx(BY,{step:m}),o.jsx("div",{className:E("tw:sticky tw:z-10 tw:-mx-1 tw:mb-1 tw:hidden tw:bg-background tw:px-1 tw:py-2 tw:@max-[802px]:flex","tw:top-[var(--wp-admin--admin-bar--height,32px)] tw:max-[781px]:top-[calc(var(--wp-admin--admin-bar--height,46px)+52px)] tw:max-[600px]:top-[52px]"),children:o.jsx(Xi,{name:"builder-pane",label:"Show",full:!0,value:O,onChange:_,options:[{value:"settings",label:m==="place"?"Place it":m==="done"?"Done":"Settings"},{value:"preview",label:"Preview"}]})}),o.jsxs("div",{"data-testid":"builder","data-pane":O,className:"tw:grid tw:grid-cols-[minmax(320px,420px)_minmax(458px,1fr)] tw:items-start tw:gap-6 tw:@max-[802px]:grid-cols-[minmax(0,1fr)]",children:[o.jsx("div",{className:E("tw:flex tw:min-w-0 tw:flex-col tw:gap-4",O==="preview"&&"tw:@max-[802px]:hidden"),children:Za}),o.jsx("div",{className:E("tw:sticky tw:top-[calc(var(--wp-admin--admin-bar--height,32px)+16px)] tw:min-w-0 tw:@max-[802px]:static",O==="settings"&&"tw:@max-[802px]:hidden"),children:o.jsx(zY,{asin:(b==null?void 0:b.asin)??null,settings:h,caps:c,valid:!ye})})]})]})}const nv="psfa-menu-item tw:min-h-9 tw:cursor-pointer tw:gap-2.5 tw:px-2.5 tw:text-foreground tw:max-[782px]:min-h-11",YY=e=>new Intl.NumberFormat("en-US").format(e);function KY({box:e,showBadge:t,clicks:n,onEdit:a,onPlace:r,onDelete:s}){const i=u.useRef(null),l=e.title||e.amazonTitle||e.asin,c=t&&e.badge&&e.badge!=="none"?KG(e.badge):"";return o.jsxs("li",{className:E(Rr,"tw:m-0 tw:flex tw:flex-col tw:transition-[border-color] tw:duration-150 tw:hover:border-border-strong"),children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-[76px_minmax(0,1fr)] tw:items-start tw:gap-3.5 tw:p-3.5",children:[o.jsx(Zb,{src:e.image}),o.jsxs("div",{className:"tw:min-w-0",children:[o.jsx("button",{type:"button",title:l,onClick:a,className:"tw:line-clamp-2 tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-left tw:text-[14.5px] tw:font-semibold tw:leading-[1.35] tw:text-foreground tw:[overflow-wrap:anywhere] tw:hover:underline tw:hover:underline-offset-[3px] tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring",children:l}),o.jsxs("div",{className:"tw:mt-1.5 tw:flex tw:min-w-0 tw:flex-wrap tw:items-center tw:gap-x-2.5 tw:gap-y-1 tw:text-[12.5px] tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:e.asin}),c?o.jsx("span",{children:c}):null,typeof n=="number"?o.jsx("span",{className:"tw:tabular-nums",children:`${fa(n,"click","clicks",YY)}, 7 days`}):null]})]})]}),o.jsxs("div",{className:"tw:mt-auto tw:flex tw:min-w-0 tw:items-center tw:gap-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-3.5 tw:py-2.5",children:[o.jsx("span",{ref:i,title:e.shortcode,className:"tw:min-w-0 tw:flex-1 tw:truncate tw:font-mono tw:text-[12.5px] tw:text-muted-foreground",children:e.shortcode}),o.jsx(Ck,{text:e.shortcode,fallbackRef:i,small:!0,label:"Copy",ariaLabel:`Copy shortcode for ${l}`}),o.jsxs(Yx,{modal:!1,children:[o.jsx(Kx,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":`More actions for ${l}`,"data-more-for":e.asin,className:ZG,children:o.jsx(zP,{"aria-hidden":"true"})})}),o.jsxs(om,{align:"end",sideOffset:6,className:"psfa-menu tw:min-w-[200px]",children:[o.jsxs(Pi,{className:nv,onSelect:a,children:[o.jsx(vN,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),"Edit box"]}),o.jsxs(Pi,{className:nv,onSelect:r,children:[o.jsx(VP,{"aria-hidden":"true",className:"tw:text-muted-foreground"}),"Where to paste"]}),o.jsx(qx,{className:"tw:bg-border"}),o.jsxs(Pi,{className:E(nv,"tw:text-destructive tw:focus:text-destructive"),onSelect:s,children:[o.jsx(NN,{"aria-hidden":"true"}),"Delete box"]})]})]})]})]})}function qY({target:e,onClose:t,onConfirm:n,focusAfterDelete:a}){const[r,s]=u.useState(!1),i=u.useRef(!1),l=u.useRef(null);e&&(l.current=e);const c=l.current;return o.jsx(jA,{open:!!e,onOpenChange:d=>{!d&&!r&&t()},children:o.jsxs(px,{className:"tw:w-[min(440px,calc(100vw-32px))] tw:gap-5 tw:rounded-xl tw:border-border tw:bg-card tw:p-6 tw:text-foreground tw:shadow-psfa-pop",onCloseAutoFocus:d=>{if(!i.current){const f=c?document.querySelector(`[data-more-for="${c.asin}"]`):null;f&&(d.preventDefault(),f.focus());return}i.current=!1;const m=a();m&&(d.preventDefault(),m.focus())},children:[o.jsxs(hx,{className:"tw:gap-2 tw:space-y-0 tw:text-left tw:sm:text-left",children:[o.jsx(xx,{className:"tw:m-0 tw:text-lg tw:font-semibold tw:text-foreground",children:"Delete this box?"}),o.jsx(bx,{className:"tw:m-0 tw:text-sm tw:leading-normal tw:text-muted-foreground tw:[overflow-wrap:anywhere]",children:c?`The box for "${c.title}" and the settings you chose for it will be removed.`:""})]}),o.jsxs(gx,{className:"tw:flex-row tw:flex-wrap tw:justify-end tw:gap-2 tw:space-x-0 tw:sm:space-x-0",children:[o.jsx(vx,{className:E(Aa,"tw:mt-0"),children:"Keep it"}),o.jsx("button",{type:"button","aria-disabled":r?"true":void 0,className:E(Lm,"tw:bg-destructive tw:text-destructive-foreground tw:shadow-psfa-xs tw:hover:bg-destructive/90"),onClick:async()=>{if(!c||r)return;s(!0);const d=await n(c);s(!1),d&&(i.current=!0,t())},children:r?"Deleting":"Delete box"})]})]})})}const Wi=e=>new Intl.NumberFormat("en-US").format(e),Lk=E(Aa,Xa,"tw:h-auto tw:min-h-8 tw:max-w-full tw:whitespace-normal tw:py-1.5 tw:text-center tw:max-[782px]:h-auto tw:max-[782px]:min-h-10"),XY=`${se.connection}?tab=creators`;function WY(){var t;if(typeof window>"u")return null;const e=(t=window.psfaAdmin)==null?void 0:t.productLoad;return e&&typeof e=="object"?e:null}function Fm(e){return typeof e=="number"&&Number.isFinite(e)}function ZY(e){const{warn:t,productCount:n,dailyLimit:a,monthlyLimit:r,monthlyNeed:s,pooled:i}=e;return Fm(n)?t==="daily"&&Fm(a)?`You have ${fa(n,"product","products",Wi)} in boxes and tables. On the free Managed API each one uses a lookup when its details refresh, once a day, and the daily limit is ${Wi(a)}. On days when more than ${Wi(a)} need refreshing, the extra products show as unavailable to visitors until the limit resets at midnight UTC.`:t==="monthly"&&Fm(r)&&Fm(s)?`You have ${fa(n,"product","products",Wi)} in boxes and tables. Each one uses a lookup when its details refresh, once a day, so they need about ${Wi(s)} lookups a month. Your plan includes ${Wi(r)} a month${i?", shared across all your sites":""}. When the month's lookups run out, products show as unavailable to visitors until the allowance resets.`:null:null}function av({onCredentialsPage:e=!1,className:t}){var l;const n=WY(),a=n?ZY(n):null;if(!n||!a)return null;const r=((l=window.psfaAdmin)==null?void 0:l.upgradeUrl)||"https://paapiplugin.com/pricing/#plans",s=e?null:o.jsx(Bn,{to:XY,className:Lk,children:"Use your own Amazon credentials"}),i=n.warn==="daily"?o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:Lk,children:"See Premium"}):null;return o.jsx(ma,{tone:"warn",className:t,actions:s||i?o.jsxs(o.Fragment,{children:[s,i]}):void 0,children:o.jsx("p",{className:"tw:m-0 tw:max-w-[72ch]",children:a})})}const Vm=24;function QY(e,t){return[e.asin,e.title,e.amazonTitle,e.titleOverride].join(" ").toLowerCase().includes(t)}function JY({withClicks:e}){const[t,n]=u.useState("loading"),[a,r]=u.useState(null),[s,i]=u.useState(1),[l,c]=u.useState(0),[d,m]=u.useState(""),[f,w]=u.useState(null),[p,x]=u.useState(1),[b,y]=u.useState({});u.useEffect(()=>{let C=!0;return n(R=>R==="ready"?R:"loading"),Om(s,Vm).then(R=>{if(C){if(R.totalPages>0&&s>R.totalPages){i(R.totalPages);return}r(R),n("ready")}}).catch(()=>{C&&n("error")}),()=>{C=!1}},[s,l]);const h=d.trim().toLowerCase();u.useEffect(()=>{if(!h||f)return;let C=!0;return zG().then(R=>{C&&w(R.boxes)}).catch(()=>{C&&w([])}),()=>{C=!1}},[h,f]);const g=u.useMemo(()=>h&&f?f.filter(C=>QY(C,h)):null,[h,f]),v=g?Math.max(1,Math.ceil(g.length/Vm)):1,S=g?g.slice((p-1)*Vm,p*Vm):(a==null?void 0:a.boxes)??[],N=S.map(C=>C.asin).join(",");u.useEffect(()=>{},[e,N,b]);const A=u.useCallback(C=>{m(C),x(1)},[]),j=u.useCallback(async C=>{try{await OG(C)}catch{return!1}return w(R=>R&&R.filter(M=>M.asin!==C)),r(R=>R&&{...R,boxes:R.boxes.filter(M=>M.asin!==C),total:Math.max(0,R.total-1)}),c(R=>R+1),!0},[]);return{status:t,total:(a==null?void 0:a.total)??0,capabilities:(a==null?void 0:a.capabilities)??null,page:g?p:s,totalPages:g?v:Math.max(1,(a==null?void 0:a.totalPages)??1),setPage:g?x:i,filter:d,setFilter:A,filtering:!!h,filterLoading:!!h&&!f,matchCount:(g==null?void 0:g.length)??0,boxes:S,clicks:b,remove:j,retry:()=>{n("loading"),c(C=>C+1)}}}const Ik=e=>new Intl.NumberFormat("en-US").format(e),$k=e=>fa(e,"box","boxes",Ik);function eK(){const e=pi(),t=!1,n=JY({withClicks:t}),[a,r]=u.useState(Vb),[s,i]=u.useState(!1),[l,c]=u.useState(null),d=u.useRef(null),m=u.useRef(null),f=o.jsxs("button",{ref:m,type:"button",className:pu,onClick:()=>e("/boxes/new"),children:[o.jsx(Cg,{"aria-hidden":"true"}),"New box"]});if(n.status==="ready"&&n.total===0&&!n.filtering)return o.jsxs("div",{children:[o.jsx(fu,{title:"Product boxes",actions:f}),o.jsxs("section",{"aria-labelledby":"boxes-empty-title",className:"tw:mx-auto tw:mt-8 tw:max-w-[640px] tw:max-[782px]:mt-2",children:[o.jsx("h2",{id:"boxes-empty-title",className:"tw:m-0 tw:mb-1.5 tw:p-0 tw:text-xl tw:font-semibold tw:text-foreground",children:"No product boxes yet"}),o.jsxs("p",{className:"tw:m-0 tw:mb-5 tw:text-sm tw:leading-normal tw:text-muted-foreground",children:["A box shows one Amazon product inside a post."," ",a==="none"?"Connect to Amazon first, then start with the product.":"Start with the product."]}),a==="none"?o.jsx("div",{className:E(Rr,"tw:p-5 tw:max-[560px]:p-4"),children:o.jsx(ik,{idPrefix:"empty-connect",showAlternative:!0,onConnected:x=>{r(x.activePath),i(!0)}})}):o.jsx(Sk,{idPrefix:"empty-finder",autoFocus:s,onSubmit:x=>e(`/boxes/new?${new URLSearchParams({q:x}).toString()}`)})]})]});const p=n.filtering?n.filterLoading?"Searching every box":`${Ik(n.matchCount)} of ${$k(n.total)}`:$k(n.total);return o.jsxs("div",{children:[o.jsx(fu,{title:"Product boxes",description:"Each box shows one Amazon product. Copy its shortcode into any post.",actions:f}),o.jsx(av,{className:"tw:mb-5"}),n.status==="error"?o.jsx(ma,{tone:"bad",title:"Your boxes didn't load",actions:o.jsx("button",{type:"button",className:E(Aa,Xa),onClick:n.retry,children:"Try again"}),children:"Reload the page if this keeps happening."}):n.status==="loading"?o.jsx("ul",{"aria-label":"Loading product boxes",className:"tw:m-0 tw:grid tw:list-none tw:grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] tw:gap-5 tw:p-0",children:[0,1,2].map(x=>o.jsxs("li",{className:E(Rr,"tw:m-0 tw:grid tw:grid-cols-[76px_1fr] tw:gap-3.5 tw:p-3.5"),children:[o.jsx(bt,{className:"tw:size-[76px] tw:rounded-lg"}),o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-2 tw:pt-1",children:[o.jsx(bt,{className:"tw:h-3.5 tw:w-4/5"}),o.jsx(bt,{className:"tw:h-3 tw:w-2/5"})]})]},x))}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:mb-4 tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-3",children:[o.jsx("span",{role:"status",className:"tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:p}),o.jsxs("div",{className:"tw:w-[min(320px,100%)]",children:[o.jsx("label",{htmlFor:"lib-filter",className:"tw:sr-only",children:"Filter boxes"}),o.jsx("input",{ref:d,id:"lib-filter",type:"search",placeholder:"Filter by title or ASIN",autoComplete:"off",spellCheck:!1,value:n.filter,onChange:x=>n.setFilter(x.target.value),className:ms})]})]}),n.boxes.length?o.jsx("ul",{"aria-label":"Product boxes",className:"tw:m-0 tw:grid tw:list-none tw:grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] tw:gap-5 tw:p-0",children:n.boxes.map(x=>o.jsx(KY,{box:x,showBadge:t,clicks:void 0,onEdit:()=>e(`/boxes/${x.asin}`),onPlace:()=>e(`/boxes/${x.asin}?step=place`),onDelete:()=>c({asin:x.asin,title:x.title||x.amazonTitle||x.asin})},x.asin))}):n.filtering&&!n.filterLoading?o.jsxs("div",{className:E(Rr,"tw:px-4 tw:py-10 tw:text-center tw:text-sm tw:text-muted-foreground"),children:[o.jsx("p",{className:"tw:m-0 tw:[overflow-wrap:anywhere]",children:`No boxes match "${n.filter.trim()}".`}),o.jsx("p",{className:"tw:m-0 tw:mt-2.5",children:o.jsx("button",{type:"button",className:E(Aa,Xa),onClick:()=>{var x;n.setFilter(""),(x=d.current)==null||x.focus()},children:"Clear the filter"})})]}):null,n.totalPages>1?o.jsxs("nav",{"aria-label":"Pages",className:"tw:mt-6 tw:flex tw:items-center tw:justify-center tw:gap-3",children:[o.jsxs("button",{type:"button","aria-label":"Previous page",disabled:n.page<=1,onClick:()=>n.setPage(n.page-1),className:E(Aa,Xa,"tw:disabled:cursor-not-allowed"),children:[o.jsx(kP,{"aria-hidden":"true"}),"Previous"]}),o.jsx("span",{className:"tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:`Page ${n.page} of ${n.totalPages}`}),o.jsxs("button",{type:"button","aria-label":"Next page",disabled:n.page>=n.totalPages,onClick:()=>n.setPage(n.page+1),className:E(Aa,Xa,"tw:disabled:cursor-not-allowed"),children:["Next",o.jsx(vc,{"aria-hidden":"true"})]})]}):null]}),o.jsx(qY,{target:l,onClose:()=>c(null),onConfirm:x=>n.remove(x.asin),focusAfterDelete:()=>d.current??m.current})]})}function tK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M200,48v63.1c0,39.7-31.75,72.6-71.45,72.9A72,72,0,0,1,56,112V48Z",opacity:"0.2"}),o.jsx("path",{d:"M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})]})}function nK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M216.71,99.73l-15.6,93.59a8,8,0,0,1-7.89,6.68H62.78a8,8,0,0,1-7.89-6.68L39.29,99.73l.08,0a19.82,19.82,0,0,0,9.22-4.16h0L88,144l32-73.65h0a20,20,0,0,0,15.92,0h0L168,144l39.39-48.48h0a19.82,19.82,0,0,0,9.22,4.16Z",opacity:"0.2"}),o.jsx("path",{d:"M248,80a28,28,0,1,0-51.12,15.77l-26.79,33L146,73.4a28,28,0,1,0-36.06,0L85.91,128.74l-26.79-33a28,28,0,1,0-26.6,12L47,194.63A16,16,0,0,0,62.78,208H193.22A16,16,0,0,0,209,194.63l14.47-86.85A28,28,0,0,0,248,80ZM128,40a12,12,0,1,1-12,12A12,12,0,0,1,128,40ZM24,80A12,12,0,1,1,36,92,12,12,0,0,1,24,80ZM193.22,192H62.78L48.86,108.52,81.79,149A8,8,0,0,0,88,152a7.83,7.83,0,0,0,1.08-.07,8,8,0,0,0,6.26-4.74l29.3-67.4a27,27,0,0,0,6.72,0l29.3,67.4a8,8,0,0,0,6.26,4.74A7.83,7.83,0,0,0,168,152a8,8,0,0,0,6.21-3l32.93-40.52ZM220,92a12,12,0,1,1,12-12A12,12,0,0,1,220,92Z"})]})}function aK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z",opacity:"0.2"}),o.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})]})}function rK({className:e}){return o.jsxs("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:[o.jsx("path",{d:"M192,168a40,40,0,0,1-40,40H128V128h24A40,40,0,0,1,192,168ZM112,48a40,40,0,0,0,0,80h16V48Z",opacity:"0.2"}),o.jsx("path",{d:"M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"})]})}function oK({className:e}){return o.jsx("svg",{viewBox:"0 0 256 256",fill:"currentColor",className:e,children:o.jsx("path",{d:"M197.09,100.48l-56.49-19.08L121.52,24.9a8,8,0,0,0-15,0L87.4,81.4,30.91,100.48a8,8,0,0,0,0,15l56.49,19.09L106.48,191.1a8,8,0,0,0,15,0l19.08-56.52,56.53-19.09a8,8,0,0,0,0-15ZM136.21,120.2a8,8,0,0,0-5,5L114,168.35,96.82,125.22a8,8,0,0,0-5-5L48.65,103l43.13-14.57a8,8,0,0,0,5-5L114,40.31,131.16,83.44a8,8,0,0,0,5,5l43.17,14.58ZM229.24,159.53l-20.41-6.89-6.89-20.42a8,8,0,0,0-15.18,0l-6.89,20.42L159.46,159.53a8,8,0,0,0,0,15.18l20.41,6.89,6.89,20.41a8,8,0,0,0,15.18,0l6.89-20.41,20.41-6.89a8,8,0,0,0,0-15.18Z"})})}const sK={best_value:tK,editors_choice:nK,best_rated:aK,budget_pick:rK,premium_pick:oK};function Zi({step:e,title:t,description:n,icon:a}){return o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-info-soft tw:text-info tw:rounded-full",children:[a==="search"&&o.jsx(iK,{}),a==="plus"&&o.jsx(lK,{}),a==="copy"&&o.jsx(cK,{}),a==="list"&&o.jsx(xN,{"aria-hidden":"true",className:"tw:w-4 tw:h-4"}),a==="category"&&o.jsx(UP,{"aria-hidden":"true",className:"tw:w-4 tw:h-4"})]})}),o.jsxs("div",{className:"tw:flex-1",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:t}),o.jsxs("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-foreground tw:rounded",children:["Step ",e]})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:n})]})]})})})}function iK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}function lK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}function cK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}const uK=[{value:"none",label:"No Badge"},{value:"best_value",label:"Best Value"},{value:"editors_choice",label:"Editor's Choice"},{value:"best_rated",label:"Best Rated"},{value:"budget_pick",label:"Budget Pick"},{value:"premium_pick",label:"Premium Pick"}];function dK(){return o.jsx(mK,{})}function fK(){const e=typeof psfaAdmin<"u"?psfaAdmin:null;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/"}}function Bk({id:e,upgradeUrl:t}){return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",title:"Available in Premium","data-testid":`premium-hint-${e}`,className:"tw:inline-flex tw:shrink-0 tw:items-center tw:px-1.5 tw:py-0.5 tw:text-xs tw:font-medium tw:leading-none tw:border tw:border-solid tw:border-pro/30 tw:bg-pro-soft tw:text-pro tw:rounded tw:no-underline tw:hover:underline tw:underline-offset-2",children:"Premium"})}function mK(){var V;const{confirm:e}=yb(),{isPremium:t,upgradeUrl:n}=fK(),a=((V=psfaAdmin.addonData)==null?void 0:V.comparisonTables)||[],[r,s]=u.useState(a),[i,l]=u.useState(""),[c,d]=u.useState(!1),[m,f]=u.useState(null),[w,p]=u.useState({isOpen:!1,tableId:null,tableName:"",products:[],loading:!1,saving:!1}),[x,b]=u.useState(""),y=u.useRef(null),h=u.useRef(null),g=async D=>{var T,O;if(D.preventDefault(),!(!i.trim()||c)){d(!0);try{const _=new FormData;_.append("action","psfa_create_comparison_table"),_.append("nonce",((T=psfaAdmin.addonNonces)==null?void 0:T.comparisonTables)||""),_.append("name",i.trim());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();if(H.success){l("");const F={id:H.data.table_id,name:i.trim(),product_count:0},Q=[...r,F];s(Q),psfaAdmin.addonData&&(psfaAdmin.addonData.comparisonTables=Q),_e.success("Table created successfully")}else _e.error(((O=H.data)==null?void 0:O.message)||"Failed to create table")}catch(_){console.error("Failed to create table:",_)}finally{d(!1)}}},v=async D=>{var O,_;if(await e({message:"Are you sure you want to delete this comparison table?",title:"Delete Table",confirmText:"Delete",variant:"danger"}))try{const $=new FormData;$.append("action","psfa_delete_comparison_table"),$.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),$.append("table_id",D.toString());const F=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:$})).json();if(F.success){const Q=r.filter(X=>X.id!==D);s(Q),psfaAdmin.addonData&&(psfaAdmin.addonData.comparisonTables=Q),_e.success("Table deleted")}else _e.error(((_=F.data)==null?void 0:_.message)||"Failed to delete table")}catch($){console.error("Failed to delete table:",$)}},S=D=>{const T=`[psfa_comparison id="${D}"]`;navigator.clipboard.writeText(T),f(D),setTimeout(()=>f(null),2e3)},N=async D=>{var O;const T=r.find(_=>_.id===D);p(_=>({..._,isOpen:!0,tableId:D,tableName:(T==null?void 0:T.name)||"",loading:!0}));try{const _=new FormData;_.append("action","psfa_get_table_data"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",D.toString());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();H.success?p(F=>({...F,tableName:H.data.name,products:H.data.products||[],loading:!1})):p(F=>({...F,loading:!1}))}catch(_){console.error("Failed to load table data:",_),p($=>({...$,loading:!1}))}},A=()=>{p({isOpen:!1,tableId:null,tableName:"",products:[],loading:!1,saving:!1}),b("")},j=async()=>{var D,T;if(w.tableId){p(O=>({...O,saving:!0}));try{const O=new FormData;O.append("action","psfa_update_comparison_table"),O.append("nonce",((D=psfaAdmin.addonNonces)==null?void 0:D.comparisonTables)||""),O.append("table_id",w.tableId.toString()),O.append("name",w.tableName);const $=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:O})).json();if(!$.success){_e.error(((T=$.data)==null?void 0:T.message)||"Failed to save table name"),p(F=>({...F,saving:!1}));return}const H=w.products.map(F=>{var X;const Q=new FormData;return Q.append("action","psfa_update_product_rating"),Q.append("nonce",((X=psfaAdmin.addonNonces)==null?void 0:X.comparisonTables)||""),Q.append("table_id",w.tableId.toString()),Q.append("asin",F.asin),Q.append("rating",F.rating!==null?String(F.rating):""),Q.append("review_count",F.review_count!==null?String(F.review_count):""),Q.append("badge_type",F.badge_type||""),fetch(psfaAdmin.ajaxUrl,{method:"POST",body:Q})});await Promise.all(H),s(F=>F.map(Q=>Q.id===w.tableId?{...Q,name:w.tableName,product_count:w.products.length}:Q)),_e.success("Changes saved successfully"),A()}catch(O){console.error("Failed to save table:",O),_e.error("Failed to save changes")}finally{p(O=>({...O,saving:!1}))}}},C=(D,T,O)=>{const _=T==="badge_type"&&O==="none"?"":O;p($=>({...$,products:$.products.map(H=>H.asin===D?{...H,[T]:T==="badge_type"?_:_===""?null:Number(_)}:H)}))},R=async D=>{var T,O;if(D.preventDefault(),!(!x.trim()||!w.tableId))try{const _=new FormData;_.append("action","psfa_add_comparison_product_by_asin"),_.append("nonce",((T=psfaAdmin.addonNonces)==null?void 0:T.comparisonTables)||""),_.append("table_id",w.tableId.toString()),_.append("asin",x.trim().toUpperCase());const H=await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json();H.success?(p(F=>({...F,products:[...F.products,{asin:H.data.asin,title:H.data.title,image_url:H.data.image_url,badge_type:"",rating:null,review_count:null}]})),b(""),_e.success("Product added")):_e.error(((O=H.data)==null?void 0:O.message)||"Failed to add product")}catch(_){console.error("Failed to add product:",_)}},M=async D=>{var O;if(!(!w.tableId||!await e({message:"Remove this product from the table?",confirmText:"Remove",variant:"danger"})))try{const _=new FormData;_.append("action","psfa_remove_comparison_product"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",w.tableId.toString()),_.append("asin",D),(await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json()).success&&(p(F=>({...F,products:F.products.filter(Q=>Q.asin!==D)})),_e.success("Product removed"))}catch(_){console.error("Failed to remove product:",_)}},z=D=>{y.current=D},B=D=>{h.current=D},I=async()=>{var O;if(y.current===null||h.current===null||y.current===h.current)return;const D=[...w.products],T=D[y.current];if(D.splice(y.current,1),D.splice(h.current,0,T),p(_=>({..._,products:D})),w.tableId){const _=new FormData;_.append("action","psfa_reorder_comparison_products"),_.append("nonce",((O=psfaAdmin.addonNonces)==null?void 0:O.comparisonTables)||""),_.append("table_id",w.tableId.toString()),D.forEach($=>_.append("order[]",$.asin));try{(await(await fetch(psfaAdmin.ajaxUrl,{method:"POST",body:_})).json()).success&&_e.success("Order saved")}catch($){console.error("Failed to save order:",$)}}y.current=null,h.current=null};return o.jsxs("div",{className:"tw:space-y-8",children:[o.jsx(av,{}),o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"How It Works"}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-4",children:[o.jsx(Zi,{step:"1",title:"Search Products",description:"Visit your search page while logged in as admin.",icon:"search"}),o.jsx(Zi,{step:"2",title:'Click "+ Compare"',description:'Click "+ Compare" on products to add them to a comparison table.',icon:"plus"}),o.jsx(Zi,{step:"3",title:"Use Shortcode",description:"Copy the shortcode and paste it anywhere on your site.",icon:"copy"})]})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"Create New Table"}),o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-info-soft tw:text-info tw:rounded-full",children:o.jsx(pK,{})})}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"New Comparison Table"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Create a table to start adding products for comparison."}),o.jsxs("form",{onSubmit:g,className:"tw:flex tw:flex-wrap tw:gap-2 tw:items-center",children:[o.jsx(pt,{type:"text",value:i,onChange:D=>l(D.target.value),placeholder:"Best Headphones 2026",required:!0,className:"tw:w-64 tw:max-w-full"}),o.jsx("button",{type:"submit",disabled:c,className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0 tw:disabled:opacity-50",children:c?"Creating...":"Create Table"})]})]})]})})})]}),o.jsxs("div",{children:[o.jsxs("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:["Saved Comparison Tables",r.length>0&&o.jsxs("em",{className:"tw:text-sm tw:font-light tw:text-foreground tw:ml-2",children:[r.length," table(s)"]})]}),r.length===0?o.jsx(It,{children:o.jsx(Yt,{children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:bg-secondary tw:text-muted-foreground tw:rounded-full",children:o.jsx(Uk,{})})}),o.jsxs("div",{className:"tw:flex-1",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"No Comparison Tables Yet"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:'Create a table above or add products from search results using the "+ Compare" button.'})]})]})})}):o.jsx("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:r.map(D=>o.jsx(It,{children:o.jsx(Yt,{className:"tw:p-4",children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:shrink-0",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-center tw:w-10 tw:h-10 tw:bg-info-soft tw:text-info tw:rounded-lg",children:o.jsx(Uk,{})})}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:truncate",children:D.name}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:bg-secondary tw:text-muted-foreground tw:rounded",children:fa(D.product_count,"product","products")})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mt-2",children:[o.jsxs("code",{className:"tw:bg-muted tw:border tw:border-border tw:px-2 tw:py-1 tw:rounded tw:text-xs tw:text-foreground tw:flex-1 tw:overflow-hidden tw:text-ellipsis",children:['[psfa_comparison id="',D.id,'"]']}),o.jsx("button",{type:"button",onClick:()=>N(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:border tw:border-info/40 tw:rounded-lg tw:hover:bg-info/15 tw:cursor-pointer tw:transition-colors",children:"Edit"}),o.jsx("button",{type:"button",onClick:()=>S(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:bg-primary tw:text-primary-foreground tw:border-0 tw:rounded-lg tw:hover:bg-primary/90 tw:cursor-pointer tw:transition-colors",children:m===D.id?"Copied!":"Copy"}),o.jsx("button",{type:"button",onClick:()=>v(D.id),className:"tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-destructive tw:bg-destructive-soft tw:border tw:border-destructive/40 tw:rounded-lg tw:hover:bg-destructive/15 tw:cursor-pointer tw:transition-colors",children:"Delete"})]})]})]})})},D.id))})]}),o.jsx(wK,{isPremium:t,upgradeUrl:n}),o.jsx(Qf,{open:w.isOpen,onOpenChange:D=>!D&&A(),children:o.jsxs(Jf,{className:"tw:grid-cols-1 tw:max-w-2xl tw:max-h-[85vh] tw:overflow-y-auto",onFocus:KT,children:[o.jsx(Dx,{children:o.jsx(Hc,{children:"Edit Table"})}),w.loading?o.jsx("div",{className:"tw:text-center tw:py-8 tw:text-muted-foreground",children:"Loading..."}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-1",children:"Table Name"}),o.jsx(pt,{type:"text",className:"tw:mt-3",value:w.tableName,onChange:D=>p(T=>({...T,tableName:D.target.value}))})]}),o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-2",children:"Products (drag to reorder)"}),o.jsx("div",{className:"tw:border tw:mt-3 tw:border-border tw:rounded-lg tw:min-h-[100px] tw:bg-muted tw:overflow-hidden",children:w.products.length===0?o.jsx("div",{className:"tw:p-4 tw:text-center tw:text-muted-foreground tw:text-sm",children:"No products yet. Add by ASIN below."}):o.jsx("div",{className:"tw:divide-y tw:divide-border",children:w.products.map((D,T)=>o.jsx("div",{className:"tw:p-3 tw:bg-card",draggable:!0,onDragStart:()=>z(T),onDragEnter:()=>B(T),onDragEnd:I,onDragOver:O=>O.preventDefault(),children:o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-3",children:[o.jsx("div",{className:"tw:text-muted-foreground tw:cursor-move tw:select-none tw:text-lg tw:leading-none tw:pt-2",children:"≡"}),D.image_url?o.jsx("img",{src:D.image_url,alt:"",className:"tw:w-12 tw:h-12 tw:object-contain tw:rounded tw:bg-muted"}):o.jsx("div",{className:"tw:w-12 tw:h-12 tw:bg-secondary tw:rounded"}),o.jsxs("div",{className:"tw:flex-1 tw:min-w-0",children:[o.jsx("div",{className:"tw:max-w-102 tw:text-sm tw:font-medium tw:text-foreground tw:truncate",children:D.title||"Untitled"}),o.jsx("div",{className:"tw:text-xs tw:text-muted-foreground tw:mb-2",children:D.asin}),o.jsx(Ui,{delayDuration:200,children:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-end tw:gap-3 tw:text-xs",children:[o.jsxs("div",{children:[o.jsx(mb,{label:"Rating",tooltip:"Star rating (0 - 5). Amazon's API does not reliably return review data, so ratings are set manually here."}),o.jsx(pt,{type:"number",step:"0.1",min:"0",max:"5",value:D.rating??"",onChange:O=>C(D.asin,"rating",O.target.value),className:"tw:w-16 tw:h-7 tw:px-1.5 tw:text-xs tw:shadow-none",placeholder:"-"})]}),o.jsxs("div",{children:[o.jsx(mb,{label:"Reviews",tooltip:"Review count shown next to the stars. Set manually - Amazon's API does not reliably provide this data."}),o.jsx(pt,{type:"number",min:"0",value:D.review_count??"",onChange:O=>C(D.asin,"review_count",O.target.value),className:"tw:w-20 tw:h-7 tw:px-1.5 tw:text-xs tw:shadow-none",placeholder:"-"})]}),o.jsxs("div",{"data-testid":"table-badge-field",children:[o.jsx(mb,{label:"Badge",tooltip:"Winner badge displayed on the table"}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5",children:[o.jsxs(Vt,{value:D.badge_type||"none",disabled:!t,onValueChange:O=>C(D.asin,"badge_type",O),children:[o.jsx(zt,{className:"tw:w-auto tw:h-7 tw:px-2 tw:text-xs tw:shadow-none tw:gap-1 tw:whitespace-nowrap",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:uK.map(O=>{const _=O.value!=="none"?sK[O.value]:null;return o.jsx(Tt,{value:O.value,className:"tw:text-xs",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-1.5",children:[_&&o.jsx(_,{className:"tw:h-3.5 tw:w-3.5 tw:text-muted-foreground"}),O.label]})},O.value)})})]}),!t&&o.jsx(Bk,{id:"table-badge",upgradeUrl:n})]})]})]})})]}),o.jsx("button",{onClick:()=>M(D.asin),className:"tw:px-2 tw:py-1 tw:text-xs tw:text-destructive tw:bg-destructive-soft tw:border tw:border-destructive/40 tw:rounded tw:hover:bg-destructive/15 tw:cursor-pointer",children:"Remove"})]})},D.asin))})})]}),o.jsxs("div",{className:"tw:mb-4",children:[o.jsx(Re,{className:"tw:mb-1",children:"Add Product by ASIN"}),o.jsxs("form",{onSubmit:R,className:"tw:flex tw:gap-2 tw:mt-3",children:[o.jsx(pt,{type:"text",value:x,onChange:D=>b(D.target.value.toUpperCase()),placeholder:"B09XS7JWHH",pattern:"[A-Za-z0-9]{10}",className:"tw:flex-1 tw:uppercase"}),o.jsx("button",{type:"submit",className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0",children:"Add"})]})]}),o.jsxs("div",{className:"tw:p-3 tw:bg-muted tw:rounded-lg tw:border tw:border-border",children:[o.jsx(Re,{className:"tw:text-xs tw:text-muted-foreground tw:mb-1",children:"Shortcode"}),o.jsxs("code",{className:"tw:text-sm tw:text-foreground",children:['[psfa_comparison id="',w.tableId,'"]']})]})]}),o.jsx(n_,{children:o.jsx("button",{onClick:j,disabled:w.saving,className:"tw:px-4 tw:py-2 tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:rounded-lg tw:hover:bg-primary/90 tw:transition-colors tw:cursor-pointer tw:border-0 tw:disabled:opacity-50",children:w.saving?"Saving...":"Save Changes"})})]})})]})}function wK({isPremium:e,upgradeUrl:t}){const n=a=>e?null:o.jsx(Bk,{id:a,upgradeUrl:t});return o.jsxs("div",{children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"Shortcode Options"}),o.jsx(It,{children:o.jsxs(Yt,{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Basic Usage"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5"]'})]}),o.jsxs("div",{className:"tw:border-t tw:border-border tw:pt-4 tw:mb-4",children:[o.jsx("h4",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Available Options"}),o.jsx("div",{className:"tw:overflow-x-auto tw:border tw:border-border tw:rounded-lg",children:o.jsxs("table",{className:"tw:w-full tw:text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"tw:bg-muted",children:[o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Attribute"}),o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Values"}),o.jsx("th",{className:"tw:text-left tw:py-2 tw:px-3 tw:font-semibold tw:text-foreground tw:border-b tw:border-border",children:"Description"})]})}),o.jsxs("tbody",{className:"tw:text-muted-foreground",children:[o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"id"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Table ID"}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Required. The comparison table ID."})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"columns"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:text-xs",children:"image,title,price,rating,features,button"})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Comma-separated list of columns. Options: image, title, price, rating, prime, discount, features, button"})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"size"}),n("size")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"small"}),", ",o.jsx("code",{className:"tw:text-xs",children:"medium"}),", ",o.jsx("code",{className:"tw:text-xs",children:"large"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Table size. Default: medium.",!e&&" Small and large need Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"layout"}),n("layout")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"horizontal"}),", ",o.jsx("code",{className:"tw:text-xs",children:"vertical"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Table layout. Default: horizontal.",!e&&" Vertical needs Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"responsive"}),n("responsive")]})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"scroll"}),", ",o.jsx("code",{className:"tw:text-xs",children:"stack"})]}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:["Mobile behavior. scroll = horizontal scroll (default), stack = card view.",!e&&" Stack needs Premium."]})]}),o.jsxs("tr",{className:"tw:border-b tw:border-border",children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"winner"})}),o.jsxs("td",{className:"tw:py-2 tw:px-3",children:[o.jsx("code",{className:"tw:text-xs",children:"true"}),", ",o.jsx("code",{className:"tw:text-xs",children:"false"})]}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Highlight best value. Default: true"})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"tw:py-2 tw:px-3",children:o.jsxs("span",{className:"tw:inline-flex tw:items-center tw:gap-1.5",children:[o.jsx("code",{className:"tw:bg-secondary tw:px-1.5 tw:py-0.5 tw:rounded tw:text-xs",children:"button_text"}),n("button_text")]})}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:"Custom text"}),o.jsx("td",{className:"tw:py-2 tw:px-3",children:'Buy button text. The Managed API always shows "Check price on Amazon".'})]})]})]})})]}),o.jsxs("div",{className:"tw:border-t tw:border-border tw:pt-4",children:[o.jsx("h4",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Examples"}),o.jsxs("div",{className:"tw:space-y-2",children:[o.jsxs("div",{children:[o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:block tw:mb-1",children:"Custom columns:"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5" columns="image,title,price,button"]'})]}),o.jsxs("div",{children:[o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground tw:block tw:mb-1",children:"Vertical layout:"}),o.jsx("code",{className:"tw:block tw:bg-muted tw:border tw:border-border tw:px-3 tw:py-2 tw:rounded tw:text-sm tw:text-foreground",children:'[psfa_comparison id="5" layout="vertical"]'})]})]})]})]})})]})}function pK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}function Uk(){return o.jsx("svg",{className:"tw:w-5 tw:h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})}const Hk="tw:max-h-[min(24rem,var(--radix-select-content-available-height,100vh))]";function hK(){var t,n;return(((n=(t=window.psfaAdmin)==null?void 0:t.settings)==null?void 0:n.marketplace)??"").trim().replace(/^www\./i,"")}function gK(e,t){if(!e||t.some(a=>a.value===e))return null;const n=hK();return{value:e,label:e,tier:"free",supported:!1,reason:n?`Not available on ${n}`:"Not available in this Amazon store"}}function Fk({categories:e,isPremium:t,premiumNote:n,selectedValue:a}){const r=gK(a,e),s=r?[r,...e]:e;return o.jsx(o.Fragment,{children:s.map(i=>{const l=i.tier==="premium"&&!t,c=!i.supported,d=l||c;return o.jsx(Tt,{value:i.value,"data-value":i.value,disabled:d,className:d?"tw:data-[disabled]:opacity-100 tw:text-muted-foreground":void 0,children:o.jsxs("span",{className:"tw:flex tw:flex-col tw:gap-0.5",children:[o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:i.label}),l&&n?n:null]}),!l&&c&&i.reason?o.jsx("span",{className:"tw:text-xs",children:i.reason}):null,i.note?o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:i.note}):null]})},i.value)})})}async function Vk(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}const ws="_default_",xK="Browse sub-categories",bK="Loading sub-categories...",vK="Amazon lists no sub-categories here.",yK={keyword_required:"Add a keyword first to see matching sub-categories.",quota:"Your Managed API allowance is used up, so sub-categories can't load right now. You can still enter a number below.",lookup_failed:"Sub-categories couldn't load. You can still enter a number below."},SK=["keyword_required","quota","lookup_failed"];function jK(e){return Array.isArray(e)?e.flatMap(t=>{const n=t&&typeof t=="object"?String(t.id??""):"",a=t&&typeof t=="object"?t.name:void 0;return/^\d+$/.test(n)&&typeof a=="string"&&a.trim()?[{id:n,name:a.trim()}]:[]}):null}async function NK(e,t,n){var r,s;const a={category:e};t&&(a.node=t),n&&(a.keyword=n);try{const i=await kb("psfa_list_subcategories",a,!0);if((i==null?void 0:i.success)===!0){const c=jK((r=i.data)==null?void 0:r.nodes);return c?{nodes:c}:{code:"lookup_failed"}}const l=(s=i==null?void 0:i.data)==null?void 0:s.code;return{code:SK.includes(l)?l:"lookup_failed"}}catch{return{code:"lookup_failed"}}}function CK({category:e,categoryLabel:t,keyword:n,node:a,picked:r,cache:s,onPick:i,onClear:l}){const[c,d]=u.useState({category:e,trail:[]}),[m,f]=u.useState(null),w=u.useRef(null),p=u.useRef(!1),x=c.category===e?c.trail:[],b=x.length?x[x.length-1]:null,y=(n==null?void 0:n.trim())||void 0,h=JSON.stringify([e,(b==null?void 0:b.id)??"",y??""]),g=s.get(h),v=!g&&(m==null?void 0:m.key)===h&&m.status==="loading",S=!g&&(m==null?void 0:m.key)===h&&m.status==="error"?m.code:null,N=!!g||v||S!==null||x.length>0,A=!g&&!v,j=r&&r.id===a?r:null,C=x.map(B=>B.id).join("/");u.useEffect(()=>{var B;p.current&&(p.current=!1,(B=w.current)==null||B.focus())},[C]);const R=u.useCallback(async(B,I)=>{if(s.has(I))return;f({key:I,status:"loading"});const V=await NK(e,B,y);"nodes"in V&&s.set(I,V.nodes),f(D=>(D==null?void 0:D.key)!==I?D:"nodes"in V?null:{key:I,status:"error",code:V.code})},[s,e,y]),M=u.useCallback(B=>{p.current=!0,d({category:e,trail:B});const I=B.length?B[B.length-1].id:"",V=JSON.stringify([e,I,y??""]);B.length>x.length&&R(I,V)},[e,R,y,x.length]),z=v?bK:S?yK[S]:g&&g.length===0?vK:"";return o.jsxs("div",{role:"group","aria-labelledby":"psfa-list-subcategory-label",className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx("p",{id:"psfa-list-subcategory-label",className:"tw:text-sm tw:font-medium tw:leading-none tw:text-foreground tw:m-0",children:"Sub-category"}),j&&o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-baseline tw:gap-x-3 tw:gap-y-1",children:[o.jsx("p",{"data-testid":"psfa-list-subcategory-selected",className:"tw:m-0 tw:min-w-0 tw:text-sm tw:text-foreground tw:[overflow-wrap:anywhere]",children:`Selected: ${j.name} (${j.id})`}),o.jsx(Ne,{type:"button",variant:"link",size:"sm",onClick:l,className:"tw:h-auto tw:p-0",children:"Clear"})]}),N&&o.jsxs("div",{className:"tw:rounded-lg tw:border tw:border-solid tw:border-border tw:bg-card",children:[o.jsx(IA,{"aria-label":"Sub-category path",className:"tw:border-0 tw:border-b tw:border-solid tw:border-border tw:px-3 tw:py-2",children:o.jsxs($A,{className:"tw:m-0 tw:text-xs",children:[o.jsx(Gk,{label:t,current:x.length===0,onSelect:()=>M([])}),x.map((B,I)=>o.jsx(AK,{label:B.name,current:I===x.length-1,onSelect:()=>M(x.slice(0,I+1))},B.id))]})}),o.jsxs("div",{ref:w,tabIndex:-1,"aria-busy":v,className:"tw:outline-none",children:[z&&o.jsx("p",{role:"status",className:"tw:m-0 tw:px-3 tw:py-3 tw:text-sm tw:text-muted-foreground",children:z}),g&&g.length>0&&o.jsx("ul",{"aria-label":`Sub-categories of ${(b==null?void 0:b.name)??t}`,className:"tw:m-0 tw:flex tw:max-h-60 tw:list-none tw:flex-col tw:overflow-y-auto tw:overscroll-contain tw:p-1",children:g.map(B=>{const I=B.id===a;return o.jsxs("li",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1",children:[o.jsx(Ne,{type:"button",variant:"ghost","aria-pressed":I,onClick:()=>i(B),className:E("tw:h-auto tw:min-h-9 tw:min-w-0 tw:flex-1 tw:whitespace-normal tw:px-2 tw:py-2 tw:text-left tw:font-normal tw:text-foreground tw:[overflow-wrap:anywhere]",I&&"tw:bg-info-soft tw:font-medium tw:text-info"),children:o.jsx("span",{className:"tw:w-full tw:text-left",children:B.name})}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon","aria-label":`Show sub-categories of ${B.name}`,onClick:()=>M([...x,B]),className:"tw:shrink-0 tw:text-muted-foreground",children:o.jsx(vc,{"aria-hidden":"true"})})]},B.id)})})]})]}),A&&o.jsx("div",{children:o.jsx(Ne,{type:"button",variant:"outline",size:"sm",onClick:()=>void R((b==null?void 0:b.id)??"",h),children:xK})})]})}function Gk({label:e,current:t,onSelect:n}){return o.jsx(BA,{className:"tw:m-0 tw:min-w-0 tw:max-w-full",children:t?o.jsx(HA,{className:"tw:font-medium tw:text-foreground tw:[overflow-wrap:anywhere]",children:e}):o.jsx(UA,{asChild:!0,children:o.jsx("button",{type:"button",onClick:n,className:"tw:m-0 tw:min-w-0 tw:cursor-pointer tw:rounded-sm tw:border-0 tw:bg-transparent tw:p-0 tw:text-left tw:text-xs tw:text-muted-foreground tw:underline tw:underline-offset-2 tw:[overflow-wrap:anywhere] tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring",children:e})})})}function AK(e){return o.jsxs(o.Fragment,{children:[o.jsx(FA,{className:"tw:m-0 tw:text-muted-foreground",children:"›"}),o.jsx(Gk,{...e})]})}const Yk=1,Kk=20,_K="Optional. The number at the end of an Amazon Best Sellers page address, for example the Headphones page.",EK="Top sellers aren't available for your Amazon store on the Managed API. New releases still work.",TK="Amazon ignores newest-first sorting in a few departments, which then show Amazon's usual order.";function Gm(e){return e.replace(/\D/g,"").slice(0,Kk)}function qk(e){return e.replace(/["[\]]/g,"").replace(/\s+/g," ").trim()}const Xk=20,rv=10,RK=[{value:"bestsellers",label:"Top sellers"},{value:"new",label:"New releases"}],kK=[{value:"list",label:"List"},{value:"grid",label:"Grid"}];function MK(e,t=!1){const n=e.type==="new"?"new":"bestsellers",a=e.category&&e.category!==ws?e.category:"",r=[`type="${n}"`];if(t&&n==="bestsellers"){if(!a)return"";r.push(`category="${a}"`);const i=Gm(e.node??"");i&&r.push(`node="${i}"`)}else{const i=qk(e.keyword);if(!i)return"";if(r.push(`keyword="${i}"`),a&&r.push(`category="${a}"`),n==="bestsellers"){const l=Gm(e.node??"");l&&r.push(`node="${l}"`)}}const s=Number.isFinite(e.count)?Math.min(Xk,Math.max(Yk,Math.round(e.count))):rv;return s!==rv&&r.push(`count="${s}"`),e.layout==="grid"&&r.push('layout="grid"'),`[psfa_list ${r.join(" ")}]`}function DK({withTitle:e=!0}){var S,N,A,j,C,R;const t=((S=window.psfaAdmin)==null?void 0:S.isPremium)??!1,n=(A=(N=window.psfaAdmin)==null?void 0:N.settings)==null?void 0:A.useManagedApi,a=n===!0||n==="1",r=((j=window.psfaAdmin)==null?void 0:j.upgradeUrl)??"https://paapiplugin.com/pricing/#plans",s=((C=window.psfaAdmin)==null?void 0:C.categories)??[],i=u.useMemo(()=>{var z;const M=(z=window.psfaAdmin)==null?void 0:z.managedBestsellerCategories;return a&&Array.isArray(M)?M.filter(B=>typeof B=="string"):null},[a]),l=u.useMemo(()=>i?s.filter(M=>i.includes(M.value)):s,[s,i]),[c,d]=u.useState({type:"bestsellers",keyword:"",category:"",count:rv,layout:"list",node:""}),[m,f]=u.useState(!1),[w,p]=u.useState(null),x=u.useRef(new Map),b=u.useCallback(M=>{d(z=>({...z,...M}))},[]),y=u.useMemo(()=>MK(c,a),[c,a]),h=a&&c.type==="bestsellers",g=h&&i!==null&&l.length===0,v=u.useCallback(async()=>{y&&(await Vk(y),f(!0),setTimeout(()=>f(!1),2e3))},[y]);return o.jsx(It,{"data-testid":"psfa-list-card",children:o.jsxs(Yt,{className:"tw:p-5",children:[(e||!t)&&o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:e?"Auto-updating Lists":"Auto-updating lists come with Premium"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"A numbered list of top sellers or new releases for a category that keeps itself current."}),t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-type",className:"tw:mb-1.5 tw:block",children:"List Type"}),o.jsxs(Vt,{value:c.type,onValueChange:M=>{const z=M==="new"?"new":"bestsellers",B=z==="bestsellers"&&i!==null&&c.category!==""&&!i.includes(c.category);B&&p(null),b(B?{type:z,category:"",node:""}:{type:z})},children:[o.jsx(zt,{id:"psfa-list-type",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:RK.map(M=>o.jsx(Tt,{value:M.value,children:M.label},M.value))})]}),a&&c.type==="new"&&o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:TK})]}),!h&&o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-keyword",className:"tw:mb-1.5 tw:block",children:"Keyword"}),o.jsx(pt,{id:"psfa-list-keyword",value:c.keyword,onChange:M=>b({keyword:M.target.value}),placeholder:"e.g., air fryer","aria-describedby":"psfa-list-keyword-help","aria-required":"true"}),o.jsx("p",{id:"psfa-list-keyword-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Required. The list is drawn from Amazon's results for this keyword."})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:g?void 0:"psfa-list-category",className:"tw:mb-1.5 tw:block",children:h?"Category (required)":"Category (optional)"}),g?o.jsx("p",{"data-testid":"psfa-list-top-sellers-unavailable",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:EK}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:c.category,onValueChange:M=>{const z=M===ws?"":M;z!==c.category&&(p(null),b({category:z,node:""}))},children:[o.jsx(zt,{id:"psfa-list-category","aria-required":h?"true":void 0,"aria-describedby":h?"psfa-list-category-help":void 0,children:o.jsx(Gt,{placeholder:h?"Choose a category":"-- Default (All) --"})}),o.jsxs(Lt,{className:Hk,children:[!h&&o.jsx(Tt,{value:ws,"data-value":ws,children:"-- Default (All) --"}),o.jsx(Fk,{categories:h?l:s,isPremium:t,premiumNote:null})]})]}),h?o.jsx("p",{id:"psfa-list-category-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Required. On the Managed API, top sellers are Amazon's Best Sellers list for this category, so no keyword is needed."}):c.type==="bestsellers"&&o.jsx("p",{"data-testid":"psfa-list-category-hint",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Pick a category to keep the ranking meaningful. Amazon ranks sales within a category, not across them."})]})]}),c.type==="bestsellers"&&!g&&c.category!==""&&o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-4",children:[o.jsx(CK,{category:c.category,categoryLabel:((R=s.find(M=>M.value===c.category))==null?void 0:R.label)??c.category,keyword:a?void 0:qk(c.keyword),node:c.node??"",picked:w,cache:x.current,onPick:M=>{p(M),b({node:Gm(M.id)})},onClear:()=>{p(null),b({node:""})}}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-node",className:"tw:mb-1.5 tw:block",children:"Or enter a sub-category number"}),o.jsx(pt,{id:"psfa-list-node",value:c.node??"",onChange:M=>{p(null),b({node:Gm(M.target.value)})},inputMode:"numeric",pattern:"[0-9]*",maxLength:Kk,autoComplete:"off",spellCheck:!1,placeholder:"Digits only","aria-describedby":"psfa-list-node-help",className:"tw:font-mono tw:tabular-nums"}),o.jsx("p",{id:"psfa-list-node-help",className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:_K})]})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-list-layout",className:"tw:mb-1.5 tw:block",children:"Layout"}),o.jsxs(Vt,{value:c.layout,onValueChange:M=>b({layout:M==="grid"?"grid":"list"}),children:[o.jsx(zt,{id:"psfa-list-layout",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:kK.map(M=>o.jsx(Tt,{value:M.value,children:M.label},M.value))})]})]}),o.jsxs("div",{className:"tw:md:col-span-2",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{htmlFor:"psfa-list-count",children:"Product Count"}),o.jsx("span",{"data-testid":"psfa-list-count-value",className:"tw:text-sm tw:font-medium tw:text-foreground tw:tabular-nums",children:c.count})]}),o.jsx(Vi,{id:"psfa-list-count",min:Yk,max:Xk,step:1,value:[c.count],onValueChange:([M])=>b({count:M}),className:"tw:w-full"})]})]}),o.jsxs("div",{className:"tw:flex tw:gap-3 tw:items-center tw:mt-5",children:[y?o.jsx("code",{"data-testid":"psfa-list-shortcode",className:"tw:flex-1 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-border tw:rounded-lg tw:text-sm tw:font-mono tw:text-foreground tw:break-all",children:y}):o.jsx("p",{"data-testid":"psfa-list-shortcode",className:"tw:flex-1 tw:m-0 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-dashed tw:border-border-strong tw:rounded-lg tw:text-sm tw:text-muted-foreground",children:g?"Choose New releases to get a shortcode.":h?"Choose a category to get the shortcode.":"Add a keyword to get the shortcode."}),o.jsxs(Ne,{onClick:v,disabled:!y,className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(OK,{}),m?"Copied!":"Copy"]})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Top sellers or new releases for a category"}),o.jsx("li",{children:"Numbered list or grid, 1 to 20 products"}),o.jsx("li",{children:"Refreshes itself, no manual updates"})]}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})})}function OK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function PK(){return o.jsxs("div",{className:"tw:space-y-8",children:[o.jsxs("div",{"data-testid":"lists-how-it-works",children:[o.jsx("h2",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0 tw:mb-4",children:"How It Works"}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-4",children:[o.jsx(Zi,{step:"1",title:"Pick a list",description:"Top sellers or new releases.",icon:"list"}),o.jsx(Zi,{step:"2",title:"Choose a category",description:"Add a keyword too where the builder offers one.",icon:"category"}),o.jsx(Zi,{step:"3",title:"Use Shortcode",description:"Copy the shortcode and paste it anywhere on your site. The list refreshes itself at least once a day.",icon:"copy"})]})]}),o.jsx(DK,{withTitle:!1})]})}const zK="https://paapiplugin.com/psfa-documentation/#shortcode",LK="The categories Amazon offers differ by store. This list follows the marketplace you selected on the Amazon connection page.",IK=[{value:"",label:"-- Default --"},{value:"Relevance",label:"Relevance"},{value:"Price:LowToHigh",label:"Price: Low to High"},{value:"Price:HighToLow",label:"Price: High to Low"},{value:"NewestArrivals",label:"Newest Arrivals"},{value:"AvgCustomerReviews",label:"Customer Reviews"},{value:"Featured",label:"Featured"}],Wk=[{value:"",label:"-- Default --"},{value:"Relevance",label:"Relevance"},{value:"AvgCustomerReviews",label:"Customer Reviews"}],$K=Wk.map(e=>e.value),BK=[{value:"",label:"-- Default (infinite) --"},{value:"infinite",label:"Infinite Scroll"},{value:"button",label:"Load More Button"},{value:"none",label:"No Pagination"}],UK=[{value:"",label:"Use site setting"},{value:"grid",label:"Grid"},{value:"list",label:"List",premium:!0}];function HK(e,t,n=!1){const a=[];return e.query.trim()&&a.push(`query="${e.query.trim()}"`),e.category&&a.push(`category="${e.category}"`),e.brand.trim()&&a.push(`brand="${e.brand.trim()}"`),e.sort&&(!n||$K.includes(e.sort))&&a.push(`sort="${e.sort}"`),e.pagination&&a.push(`pagination="${e.pagination}"`),e.pagination==="none"&&e.count!==20&&a.push(`count="${e.count}"`),(e.layout==="grid"||e.layout==="list"&&t)&&a.push(`layout="${e.layout}"`),t&&!n&&e.minSavingPercent>0&&a.push(`min_saving_percent="${e.minSavingPercent}"`),t&&!n&&e.hasDeal&&a.push('has_deal="true"'),e.hideSearch&&a.push('hide_search="true"'),e.hideFilters&&a.push('hide_filters="true"'),e.hideCategoryBanner&&a.push('hide_category_banner="true"'),e.autoDetect||a.push('auto_detect="no"'),a.length>0?`[psfa_search ${a.join(" ")}]`:"[psfa_search]"}function FK(){var x,b,y,h,g;const e=((x=window.psfaAdmin)==null?void 0:x.isPremium)??!1,t=(y=(b=window.psfaAdmin)==null?void 0:b.settings)==null?void 0:y.useManagedApi,n=t===!0||t==="1",a=((h=window.psfaAdmin)==null?void 0:h.upgradeUrl)??"https://paapiplugin.com/pricing/#plans",[r,s]=u.useState({query:"",category:"",brand:"",sort:"",pagination:"",layout:"",count:20,hideSearch:!1,hideFilters:!1,hideCategoryBanner:!1,autoDetect:!0,hasDeal:!1,minSavingPercent:0}),[i,l]=u.useState(!1),c=((g=window.psfaAdmin)==null?void 0:g.categories)??[],d=c.filter(v=>v.supported).length,m=u.useCallback(v=>{s(S=>({...S,...v}))},[]),f=n?Wk:IK,w=u.useMemo(()=>HK(r,e,n),[r,e,n]),p=u.useCallback(async()=>{await Vk(w),l(!0),setTimeout(()=>l(!1),2e3)},[w]);return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-4",children:[o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Search & Content"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Configure default search query and category."}),o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Default Query"}),o.jsx(pt,{value:r.query,onChange:v=>m({query:v.target.value}),placeholder:"e.g., laptop, headphones"})]}),o.jsxs("div",{children:[o.jsx(Ui,{delayDuration:200,children:o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:mb-1.5",children:[o.jsx(Re,{htmlFor:"psfa-shortcode-category",children:"Category"}),o.jsx(ZT,{label:"Category",tooltip:LK})]})}),o.jsxs(Vt,{value:r.category,onValueChange:v=>m({category:v===ws?"":v}),children:[o.jsx(zt,{id:"psfa-shortcode-category",children:o.jsx(Gt,{placeholder:"-- Default (All) --"})}),o.jsxs(Lt,{className:Hk,children:[o.jsx(Tt,{value:ws,"data-value":ws,children:"-- Default (All) --"}),o.jsx(Fk,{categories:c,isPremium:e,premiumNote:o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})})]})]}),!e&&d>0&&o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:[o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," to access every category your Amazon store offers."]})]}),o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Brand"}),o.jsx(pt,{value:r.brand,onChange:v=>m({brand:v.target.value}),placeholder:"e.g., Apple, Samsung"})]}),o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Sort By"}),o.jsxs(Vt,{value:r.sort,onValueChange:v=>m({sort:v==="_default_"?"":v}),children:[o.jsx(zt,{children:o.jsx(Gt,{placeholder:"-- Default --"})}),o.jsx(Lt,{children:f.map(v=>o.jsx(Tt,{value:v.value||"_default_",children:v.label},v.value))})]}),n&&o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:"Price sorting is not available on the Managed API. Add your own Amazon credentials to sort by price."})]})]})]})}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Display Options"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Control visibility and pagination behavior."}),o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{children:[o.jsx(Re,{className:"tw:mb-1.5 tw:block",children:"Pagination"}),o.jsxs(Vt,{value:r.pagination,onValueChange:v=>m({pagination:v==="_default_"?"":v}),children:[o.jsx(zt,{children:o.jsx(Gt,{placeholder:"-- Default (infinite) --"})}),o.jsx(Lt,{children:BK.map(v=>o.jsx(Tt,{value:v.value||"_default_",children:v.label},v.value))})]})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-shortcode-layout",className:"tw:mb-1.5 tw:block",children:"Layout"}),o.jsxs(Vt,{value:r.layout,onValueChange:v=>m({layout:v==="_default_"?"":v}),children:[o.jsx(zt,{id:"psfa-shortcode-layout",children:o.jsx(Gt,{placeholder:"Use site setting"})}),o.jsx(Lt,{children:UK.map(v=>{const S=!!v.premium&&!e;return o.jsx(Tt,{value:v.value||"_default_",disabled:S,className:S?"tw:data-[disabled]:opacity-100 tw:text-muted-foreground":void 0,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:v.label}),S?o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"}):null]})},v.value)})})]}),o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-2",children:["Overrides the layout on the Settings tab for this shortcode only.",e?null:o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," to use the List layout."]})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{children:"Product Count"}),o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:r.count})]}),o.jsx(Vi,{min:2,max:20,step:1,value:[r.count],onValueChange:([v])=>m({count:v}),disabled:r.pagination!=="none",className:"tw:w-full"}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:mt-1 tw:m-0",children:r.pagination==="none"?"Set the exact number of products to display":"Enable 'No Pagination' to use this setting"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"tw:block tw:text-sm tw:font-medium tw:text-foreground tw:mb-3",children:"Visibility"}),o.jsxs("div",{className:"tw:space-y-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-search",className:"tw:text-sm tw:text-foreground",children:"Hide Search Box"}),o.jsx(_r,{id:"hide-search",checked:r.hideSearch,onCheckedChange:v=>m({hideSearch:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-filters",className:"tw:text-sm tw:text-foreground",children:"Hide Filters"}),o.jsx(_r,{id:"hide-filters",checked:r.hideFilters,onCheckedChange:v=>m({hideFilters:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"hide-category-banner",className:"tw:text-sm tw:text-foreground",children:"Hide Category Banner"}),o.jsx(_r,{id:"hide-category-banner",checked:r.hideCategoryBanner,onCheckedChange:v=>m({hideCategoryBanner:v})})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"auto-detect",className:"tw:text-sm tw:text-foreground",children:"Auto-detect Category"}),o.jsx(_r,{id:"auto-detect",checked:r.autoDetect,onCheckedChange:v=>m({autoDetect:v})})]})]})]})]})]})}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Discount Filters"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Restrict search results to deals and minimum saving thresholds."}),n?o.jsx(ln,{variant:"info","data-testid":"managed-discount-notice",children:o.jsx(Gn,{children:"Deal and discount filters are not available on the Managed API path, because price and discount data are not shown there. Add your own Amazon credentials (Creators API or PA-API) to use these filters."})}):e?o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between",children:[o.jsx(Re,{htmlFor:"has-deal",className:"tw:text-sm tw:text-foreground",children:"Only show products with deals"}),o.jsx(_r,{id:"has-deal",checked:r.hasDeal,onCheckedChange:v=>m({hasDeal:v})})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-2",children:[o.jsx(Re,{htmlFor:"min-saving-percent",children:"Minimum Discount %"}),o.jsxs("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:[r.minSavingPercent,"%"]})]}),o.jsx(Vi,{id:"min-saving-percent",min:0,max:99,step:1,value:[r.minSavingPercent],onValueChange:([v])=>m({minSavingPercent:v}),className:"tw:w-full"}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:mt-1 tw:m-0",children:r.minSavingPercent===0?"Set above 0 to require a minimum discount.":`Show products with at least ${r.minSavingPercent}% off.`})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Filter results to only show products with active deals"}),o.jsx("li",{children:"Set minimum savings percentage thresholds (any value, e.g. 27% off)"}),o.jsx("li",{children:"Combine with category and brand filters"})]}),o.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})})]}),o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Generated Shortcode"})}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Copy this shortcode and paste it into any page or post."}),o.jsxs("div",{className:"tw:flex tw:gap-3 tw:items-center",children:[o.jsx("code",{className:"tw:flex-1 tw:px-4 tw:py-3 tw:bg-muted tw:border tw:border-border tw:rounded-lg tw:text-sm tw:font-mono tw:text-foreground tw:break-all",children:w}),o.jsxs(Ne,{onClick:p,className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(VK,{}),i?"Copied!":"Copy"]})]}),i&&o.jsx("p",{className:"tw:text-sm tw:text-success tw:m-0 tw:mt-2",children:"Copied to clipboard!"})]})}),o.jsx(It,{"data-testid":"psfa-usage-examples",className:"tw:bg-warning-soft tw:border-warning/40",children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx(GK,{className:"tw:text-warning"}),o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Usage Examples"})]}),o.jsxs("p",{className:"tw:m-0 tw:mb-4 tw:text-sm tw:text-muted-foreground",children:["More examples and a video walkthrough: see the"," ",o.jsxs("a",{href:zK,target:"_blank",rel:"noopener noreferrer",className:"tw:underline tw:text-link",children:["shortcode guide",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]}),"."]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsx(ps,{title:"Basic:",code:"[psfa_search]"}),o.jsx(ps,{title:"Pre-filled search:",code:'[psfa_search query="wireless headphones"]'}),o.jsx(ps,{title:"Category page:",code:'[psfa_search category="Electronics" hide_search="true"]'}),o.jsx(ps,{title:"Product listing:",code:'[psfa_search query="iphone" hide_search="true" hide_filters="true"]'}),o.jsx(ps,{title:"Premium - list layout:",code:'[psfa_search query="iphone" layout="list" hide_search="true" hide_filters="true"]'}),!n&&o.jsx(ps,{title:"Premium - deals only:",code:'[psfa_search min_saving_percent="20" has_deal="true"]'}),o.jsx(ps,{title:"Premium - top sellers list:",code:n?'[psfa_list type="bestsellers" category="Electronics"]':'[psfa_list type="bestsellers" keyword="air fryer" category="HomeAndKitchen"]'})]})]})})]})}function ps({title:e,code:t}){return o.jsxs("div",{children:[o.jsx("p",{className:"tw:text-sm tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:e}),o.jsx("code",{className:"tw:text-xs tw:text-warning tw:bg-warning/10 tw:px-2 tw:py-1 tw:rounded",children:t})]})}function VK(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function GK({className:e}){return o.jsx("svg",{className:E("tw:w-5 tw:h-5",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}function Co({label:e,checked:t,onChange:n,premium:a,info:r}){return o.jsxs("label",{className:"tw:group/row tw:relative tw:flex tw:items-center tw:justify-between tw:p-3 tw:bg-muted tw:rounded-lg tw:cursor-pointer tw:hover:bg-accent tw:transition-colors",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:e}),r&&o.jsxs("span",{className:"tw:group",children:[o.jsx("svg",{className:"tw:w-4 tw:h-4 tw:text-muted-foreground tw:hover:text-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),o.jsxs("span",{className:"tw:hidden tw:group-hover:block tw:group-focus-within/row:block tw:absolute tw:z-50 tw:left-2 tw:bottom-full tw:mb-2 tw:w-max tw:max-w-[calc(100%-1rem)] tw:px-3 tw:py-2 tw:text-xs tw:leading-snug tw:text-background tw:bg-foreground tw:rounded-lg tw:whitespace-normal tw:shadow-lg",children:[r,o.jsx("span",{className:"tw:hidden"})]})]}),a&&o.jsx("span",{className:"tw:px-1.5 tw:py-0.5 tw:text-[10px] tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx(_r,{checked:t,onCheckedChange:n})]})}const YK=[{key:"brand",label:"Brand"},{key:"price",label:"Price Range"},{key:"sort",label:"Sort By"},{key:"condition",label:"Condition"},{key:"merchant",label:"Merchant"},{key:"availability",label:"Availability"}],Zk="tw:absolute tw:inset-0 tw:m-0 tw:p-0 tw:border-0 tw:bg-transparent tw:rounded-xl",KK=[{key:"has_deal",label:"Has Deal"},{key:"deals",label:"Discounts"}];function qK(){const e=typeof psfaAdmin<"u"?psfaAdmin.isPremium:!1,t=typeof psfaAdmin<"u"?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/#plans",n=typeof psfaAdmin<"u"?psfaAdmin.settings:null,a=x=>x===!0||x==="1"||x===1,[r,s]=u.useState(()=>{const x={brand:!0,price:!0,sort:!0,condition:!0,merchant:!0,availability:!0,has_deal:!0,deals:!0};return{displayMode:(n==null?void 0:n.displayMode)==="list"?"list":"grid",hideSearch:a(n==null?void 0:n.hideSearch),hideFilters:a(n==null?void 0:n.hideFilters),hideCategoryBanner:a(n==null?void 0:n.hideCategoryBanner),topProductsEnabled:(n==null?void 0:n.topProductsEnabled)===void 0?!0:a(n.topProductsEnabled),whiteLabel:a(n==null?void 0:n.whiteLabel),filterVisibility:typeof(n==null?void 0:n.filterVisibility)=="object"?n.filterVisibility:x}}),[i,l]=u.useState(!1),{confirm:c}=yb(),d=x=>{s(b=>({...b,...x}))},m=x=>{(x==="grid"||x==="list"&&e)&&d({displayMode:x})},f=x=>{s(b=>({...b,filterVisibility:{...b.filterVisibility,[x]:!b.filterVisibility[x]}}))},w=async()=>{var x;l(!0);try{const b=new FormData;b.append("action","psfa_save_settings"),b.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),b.append("psfa_display_mode",r.displayMode),b.append("psfa_hide_search",r.hideSearch?"1":"0"),b.append("psfa_hide_filters",r.hideFilters?"1":"0"),b.append("psfa_hide_category_banner",r.hideCategoryBanner?"1":"0"),b.append("psfa_top_products_enabled",r.topProductsEnabled?"1":"0"),b.append("psfa_white_label",r.whiteLabel?"1":"0"),b.append("psfa_filter_visibility",JSON.stringify(r.filterVisibility));const h=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:b})).json();h.success?(typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,displayMode:r.displayMode,hideSearch:r.hideSearch,hideFilters:r.hideFilters,hideCategoryBanner:r.hideCategoryBanner,topProductsEnabled:r.topProductsEnabled,whiteLabel:r.whiteLabel,filterVisibility:r.filterVisibility}),_e.success("Search settings saved.")):_e.error(((x=h.data)==null?void 0:x.message)||"Search settings could not be saved.")}catch(b){console.error("Failed to save:",b)}finally{l(!1)}},p=async()=>{if(await c({message:"Every search setting goes back to its default.",title:"Reset search settings?",confirmText:"Reset",variant:"danger"}))try{const b=new FormData;if(b.append("action","psfa_reset_settings"),b.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),b.append("section","layout"),(await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:b})).json()).success){const g={displayMode:"grid",hideSearch:!1,hideFilters:!1,hideCategoryBanner:!1,topProductsEnabled:!0,whiteLabel:!1,filterVisibility:{brand:!0,price:!0,sort:!0,condition:!0,merchant:!0,availability:!0,has_deal:!0,deals:!0}};s(g),typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...g}),_e.success("Search settings reset to defaults.")}}catch(b){console.error("Failed to reset:",b)}};return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("section",{className:"tw:mb-6",children:[o.jsx("h2",{id:"psfa-display-layout-heading",className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-3",children:"Display Layout"}),o.jsx("p",{id:"psfa-display-layout-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose how search results are displayed."}),o.jsxs(Zx,{value:e||r.displayMode==="grid"?r.displayMode:"",onValueChange:m,"aria-labelledby":"psfa-display-layout-heading","aria-describedby":"psfa-display-layout-hint",className:"tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{className:E("tw:relative tw:bg-card tw:rounded-xl tw:border tw:transition-[border-color,box-shadow] tw:p-5",r.displayMode==="grid"?"tw:border-ring tw:ring-1 tw:ring-ring":"tw:border-border tw:shadow-xs tw:hover:border-border-strong"),children:[o.jsx(lm,{value:"grid","aria-labelledby":"psfa-layout-grid-title","aria-describedby":"psfa-layout-grid-hint",className:E(Zk,"tw:cursor-pointer")}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx("div",{className:"tw:w-10 tw:h-10 tw:bg-secondary tw:rounded-lg tw:flex tw:items-center tw:justify-center",children:o.jsx(XK,{})}),o.jsx("h3",{id:"psfa-layout-grid-title",className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Grid Layout"})]}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{id:"psfa-layout-grid-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Products displayed in a responsive grid format, perfect for browsing multiple items at once."})]}),o.jsxs("div",{className:E("tw:relative tw:bg-card tw:rounded-xl tw:border tw:transition-[border-color,box-shadow] tw:p-5",r.displayMode==="list"&&e?"tw:border-ring tw:ring-1 tw:ring-ring":"tw:border-border tw:shadow-xs tw:hover:border-border-strong"),children:[o.jsx(lm,{value:"list",disabled:!e,"aria-labelledby":"psfa-layout-list-title","aria-describedby":"psfa-layout-list-tier psfa-layout-list-hint",className:E(Zk,e&&"tw:cursor-pointer")}),o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:mb-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx("div",{className:"tw:w-10 tw:h-10 tw:bg-secondary tw:rounded-lg tw:flex tw:items-center tw:justify-center",children:o.jsx(WK,{})}),o.jsx("h3",{id:"psfa-layout-list-title",className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"List Layout"})]}),o.jsx("span",{id:"psfa-layout-list-tier",className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{id:"psfa-layout-list-hint",className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Products displayed in a vertical list format, ideal for detailed product information and comparisons."}),!e&&o.jsx("div",{className:"tw:mt-3 tw:flex tw:justify-end",children:o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:relative tw:z-10 tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})})]})]})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-4 tw:mb-6",children:[o.jsxs("section",{className:"tw:bg-card tw:rounded-xl tw:border tw:border-border tw:shadow-xs tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-4",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Display Options"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose what each search shows. A shortcode can override the search bar, filters and category banner."}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:[o.jsx(Co,{label:"Hide Search Bar",checked:r.hideSearch,onChange:()=>d({hideSearch:!r.hideSearch}),info:"Hide the search input field. Useful for category-only or curated product pages."}),o.jsx(Co,{label:"Hide Filters",checked:r.hideFilters,onChange:()=>d({hideFilters:!r.hideFilters}),info:"Hide the filter bar entirely. Useful for simple product listings."}),o.jsx(Co,{label:"Hide Category Banner",checked:r.hideCategoryBanner,onChange:()=>d({hideCategoryBanner:!r.hideCategoryBanner}),info:"Hide the 'Top Products in [Category]' banner header on category pages."}),o.jsx(Co,{label:"Top Products on Empty State",checked:r.topProductsEnabled,onChange:()=>d({topProductsEnabled:!r.topProductsEnabled}),info:"When [psfa_search] is rendered with no query and no category, show a rotating mixed-category grid of top products instead of an empty state."}),e&&o.jsx(Co,{label:"White Label",checked:r.whiteLabel,onChange:()=>d({whiteLabel:!r.whiteLabel}),premium:!0,info:"Enable to hide the 'Powered by PaapiPlugin' link below search results."})]}),!e&&o.jsxs("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-4",children:[o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," for white-label mode."]})]}),o.jsxs("section",{className:"tw:bg-card tw:rounded-xl tw:border tw:border-border tw:shadow-xs tw:p-5",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:[o.jsx("h3",{className:"tw:text-sm tw:font-semibold tw:text-foreground tw:m-0",children:"Filter Visibility"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Free"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Choose which filters to display in the search interface."}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-3",children:[YK.map(x=>o.jsx(Co,{label:x.label,checked:r.filterVisibility[x.key],onChange:()=>f(x.key)},x.key)),e&&KK.map(x=>o.jsx(Co,{label:x.label,checked:r.filterVisibility[x.key],onChange:()=>f(x.key),premium:!0},x.key))]}),!e&&o.jsxs("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-4",children:[o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"tw:text-link tw:no-underline tw:hover:opacity-80",children:"Upgrade to Premium"})," for Has Deal and Discounts filters."]})]})]}),o.jsxs("div",{className:"tw:flex tw:gap-3",children:[o.jsx(Ne,{onClick:w,disabled:i,children:i?"Saving...":"Save settings"}),o.jsx(Ne,{variant:"outline",onClick:p,children:"Reset to Defaults"})]})]})}function XK(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})}function WK(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}const Qk={amber:{fill:"#f59e0b",ink:"#0a0a0a",border:"#c47e09"},blue:{fill:"#3b82f6",ink:"#0a0a0a",border:"#2f68c5"},cyan:{fill:"#06b6d4",ink:"#0a0a0a",border:"#0592aa"},emerald:{fill:"#10b981",ink:"#0a0a0a",border:"#0d9467"},fuchsia:{fill:"#d946ef",ink:"#0a0a0a",border:"#ae38bf"},green:{fill:"#22c55e",ink:"#0a0a0a",border:"#1b9e4b"},indigo:{fill:"#4f46e5",ink:"#ffffff",border:"#3f38b7"},lime:{fill:"#84cc16",ink:"#0a0a0a",border:"#6aa312"},orange:{fill:"#f97316",ink:"#0a0a0a",border:"#c75c12"},pink:{fill:"#ec4899",ink:"#0a0a0a",border:"#bd3a7a"},purple:{fill:"#9333ea",ink:"#ffffff",border:"#7629bb"},red:{fill:"#ef4444",ink:"#0a0a0a",border:"#bf3636"},rose:{fill:"#f43f5e",ink:"#0a0a0a",border:"#c3324b"},sky:{fill:"#0ea5e9",ink:"#0a0a0a",border:"#0b84ba"},teal:{fill:"#14b8a6",ink:"#0a0a0a",border:"#109385"},violet:{fill:"#7c3aed",ink:"#ffffff",border:"#632ebe"},yellow:{fill:"#eab308",ink:"#0a0a0a",border:"#bb8f06"}},Jk={white:"#ffffff",dark:"#0a0a0a"};function eM(e,t="auto"){const n=Qk[e]??Qk.orange;return t==="auto"||!Jk[t]?n:{...n,ink:Jk[t]}}const tM=["title","brand","price","deal"],ZK=[...tM,"button"],ov=80,sv=150,Ym=5,Wa=100,hs={title:{color:"",scale:Wa},brand:{color:"",scale:Wa},price:{color:"",scale:Wa},deal:{color:"",scale:Wa},button:{color:"",scale:Wa}},nM="#ffffff",aM="#111827",iv="#ffffff",lv="#0a0a0a",QK=/^#[0-9a-f]{6}$/;function JK(e){if(typeof e!="string")return"";const t=e.trim().toLowerCase();return QK.test(t)?t:""}function rM(e){const t=e.trim().toLowerCase();if(t==="")return"";const n=t.replace(/^#/,"");return/^[0-9a-f]{6}$/.test(n)?`#${n}`:/^[0-9a-f]{3}$/.test(n)?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:null}function eq(e){const t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN;if(!Number.isFinite(t))return Wa;const n=Math.round(t/Ym)*Ym;return Math.min(sv,Math.max(ov,n))}function tq(e){const t=e&&typeof e=="object"?e:{},n={};for(const a of ZK){const r=t[a]&&typeof t[a]=="object"?t[a]:{};n[a]={color:JK(r.color),scale:eq(r.scale)}}return n}function nq(e){return e.color===""&&e.scale===Wa}function cv(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function oM(e){const t=parseInt(e.replace("#",""),16);return .2126*cv(t>>16&255)+.7152*cv(t>>8&255)+.0722*cv(t&255)}function gs(e,t){const n=oM(e),a=oM(t);return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function aq(e){return gs(e,nM)>=gs(e,aM)?nM:aM}function rq(e,t="auto"){return t==="white"?iv:t==="dark"?lv:gs(e,iv)>=gs(e,lv)?iv:lv}const oq="Check price on Amazon",Qi=[{id:"neutral",name:"Neutral",swatch:"#a3a3a3",premium:!1},{id:"stone",name:"Stone",swatch:"#a8a29e",premium:!0},{id:"slate",name:"Slate",swatch:"#94a3b8",premium:!0},{id:"zinc",name:"Zinc",swatch:"#a1a1aa",premium:!0},{id:"gray",name:"Gray",swatch:"#9ca3af",premium:!0}],Ji=[{id:"orange",name:"Orange",hex:"#f97316",premium:!1},{id:"red",name:"Red",hex:"#ef4444",premium:!0},{id:"amber",name:"Amber",hex:"#f59e0b",premium:!0},{id:"yellow",name:"Yellow",hex:"#eab308",premium:!0},{id:"lime",name:"Lime",hex:"#84cc16",premium:!0},{id:"green",name:"Green",hex:"#22c55e",premium:!0},{id:"emerald",name:"Emerald",hex:"#10b981",premium:!0},{id:"teal",name:"Teal",hex:"#14b8a6",premium:!0},{id:"cyan",name:"Cyan",hex:"#06b6d4",premium:!0},{id:"sky",name:"Sky",hex:"#0ea5e9",premium:!0},{id:"blue",name:"Blue",hex:"#3b82f6",premium:!0},{id:"indigo",name:"Indigo",hex:"#6366f1",premium:!0},{id:"violet",name:"Violet",hex:"#8b5cf6",premium:!0},{id:"purple",name:"Purple",hex:"#a855f7",premium:!0},{id:"fuchsia",name:"Fuchsia",hex:"#d946ef",premium:!0},{id:"pink",name:"Pink",hex:"#ec4899",premium:!0},{id:"rose",name:"Rose",hex:"#f43f5e",premium:!0}],sq=["0","0.3","0.5","0.75","1.0"],iq=[{key:"deal_badge",label:"Deal Badges",info:"Show Lightning Deal, Best Deal, and other Amazon deal badges"},{key:"prime_exclusive",label:"Prime Exclusive Deals",info:"Show Prime Exclusive Deal indicator badge"},{key:"low_stock",label:"Low Stock Warning",info:"Show animated 'Low Stock' warning when inventory is scarce"},{key:"deal_countdown",label:"Deal Countdown",info:"Show countdown timer for time-limited deals"}],sM={deal_badge:!0,prime_exclusive:!0,low_stock:!0,deal_countdown:!0},Km=[{id:"vega",name:"Vega",description:"Classic shadcn, clean",premium:!1},{id:"nova",name:"Nova",description:"Compact layouts",premium:!0},{id:"maia",name:"Maia",description:"Soft & rounded",premium:!0},{id:"lyra",name:"Lyra",description:"Boxy & sharp",premium:!0},{id:"mira",name:"Mira",description:"Dense interfaces",premium:!0}],el=[{value:"",label:"System Default",family:"",premium:!1},{value:"inter",label:"Inter",family:"'Inter', sans-serif",premium:!0},{value:"roboto",label:"Roboto",family:"'Roboto', sans-serif",premium:!0},{value:"open-sans",label:"Open Sans",family:"'Open Sans', sans-serif",premium:!0},{value:"lato",label:"Lato",family:"'Lato', sans-serif",premium:!0},{value:"montserrat",label:"Montserrat",family:"'Montserrat', sans-serif",premium:!0},{value:"poppins",label:"Poppins",family:"'Poppins', sans-serif",premium:!0},{value:"dm-sans",label:"DM Sans",family:"'DM Sans', sans-serif",premium:!0},{value:"plus-jakarta",label:"Plus Jakarta Sans",family:"'Plus Jakarta Sans', sans-serif",premium:!0},{value:"outfit",label:"Outfit",family:"'Outfit', sans-serif",premium:!0},{value:"space-grotesk",label:"Space Grotesk",family:"'Space Grotesk', sans-serif",premium:!0},{value:"rubik",label:"Rubik",family:"'Rubik', sans-serif",premium:!0},{value:"source-serif",label:"Source Serif 4",family:"'Source Serif 4', serif",premium:!0},{value:"merriweather",label:"Merriweather",family:"'Merriweather', serif",premium:!0},{value:"playfair",label:"Playfair Display",family:"'Playfair Display', serif",premium:!0},{value:"lora",label:"Lora",family:"'Lora', serif",premium:!0}];function iM(e,t){if(!t.length||document.getElementById(e))return;const n=t.map(r=>`family=${encodeURIComponent(r)}:wght@400;600;700`).join("&"),a=document.createElement("link");a.id=e,a.rel="stylesheet",a.href=`https://fonts.googleapis.com/css2?${n}&display=swap`,document.head.appendChild(a)}const lq=el.filter(e=>e.value).map(e=>e.label),cq={neutral:{light:"#ffffff",dark:"#0a0a0a"},stone:{light:"#ffffff",dark:"#0c0a09"},slate:{light:"#ffffff",dark:"#020817"},zinc:{light:"#ffffff",dark:"#09090b"},gray:{light:"#ffffff",dark:"#030712"}},uq=["deal_badge","deal_countdown","prime_exclusive","low_stock","buybox_winner","used_price"],uv=[{id:"auto",name:"Auto"},{id:"white",name:"White"},{id:"dark",name:"Dark"}],lM=e=>{var t;return((t=uv.find(n=>n.id===e))==null?void 0:t.id)??"auto"},dq=["baseColor","radius","accentColor","accentInk","darkMode","style","font","buttonText","hideAmazonIcon","elementStyles"],fq={title:{label:"Title",name:"Title",picker:"#0a0a0a"},brand:{label:"Brand",name:"Brand",picker:"#737373"},price:{label:"Price",name:"Price",picker:"#c45500"},deal:{label:"Deal badges",name:"Deal badge",picker:"#c2410c"}},dv=4.5;function mq(){var I,V,D,T,O,_,$,H,F,Q,X;const e=typeof psfaAdmin<"u"?psfaAdmin.isPremium:!1,t=typeof psfaAdmin<"u"?((I=psfaAdmin.settings)==null?void 0:I.useManagedApi)===!0:!1,n=typeof psfaAdmin<"u"?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/#plans",a=typeof psfaAdmin<"u"?psfaAdmin.settings:{},[r,s]=u.useState({baseColor:(a==null?void 0:a.baseColor)||"neutral",accentColor:(a==null?void 0:a.accentColor)||"orange",accentInk:lM(a==null?void 0:a.accentInk),style:(a==null?void 0:a.style)||"vega",radius:(a==null?void 0:a.radius)||"0.5",darkMode:(a==null?void 0:a.darkMode)===!0||(a==null?void 0:a.darkMode)==="1",font:(a==null?void 0:a.font)||"",buttonText:(a==null?void 0:a.buttonText)||"Buy on Amazon",hideAmazonIcon:(a==null?void 0:a.hideAmazonIcon)===!0,elementStyles:tq(a==null?void 0:a.elementStyles)}),[i,l]=u.useState(()=>{const P=a!=null&&a.features&&typeof a.features=="object"?a.features:{},G=Object.fromEntries(Object.entries(P).map(([ne,Y])=>[ne,Y===!0||Y==="1"||Y===1]));return{...sM,...G}}),[c,d]=u.useState(!1),{confirm:m}=yb(),f=P=>{l(G=>({...G,[P]:!G[P]}))},[w,p]=u.useState(null);u.useEffect(()=>{if(typeof psfaAdmin>"u")return;let P=!1;const G=new FormData;return G.append("action","psfa_appearance_path_state"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G}).then(ne=>ne.json()).then(ne=>{const Y=ne!=null&&ne.success?ne.data:null;if(P||!Y||typeof Y.buttonText!="string"||!Array.isArray(Y.inactiveAppearanceAxes))return;const Z={buttonText:Y.buttonText,inactiveAppearanceAxes:Y.inactiveAppearanceAxes};psfaAdmin.settings&&(psfaAdmin.settings.effectiveAppearance={...psfaAdmin.settings.effectiveAppearance,buttonText:Z.buttonText},psfaAdmin.settings.inactiveAppearanceAxes=Z.inactiveAppearanceAxes),p(Z)}).catch(()=>{}),()=>{P=!0}},[]);const x=(P,G)=>{s(ne=>({...ne,[P]:G}))},b=(P,G)=>{s(ne=>{const Y=ne.elementStyles??hs;return{...ne,elementStyles:{...Y,[P]:{...Y[P],...G}}}})};u.useEffect(()=>{var G;const P=(G=el.find(ne=>ne.value===r.font))==null?void 0:G.label;P&&r.font&&iM("psfa-preview-font",[P])},[r.font]);const y=u.useCallback(P=>{P&&iM("psfa-all-fonts",lq)},[]),h=async()=>{var P;d(!0);try{const G=new FormData;G.append("action","psfa_save_settings"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),G.append("psfa_base_color",r.baseColor),G.append("psfa_accent_color",r.accentColor),G.append("psfa_accent_ink",r.accentInk??"auto"),G.append("psfa_style",r.style),G.append("psfa_radius",r.radius),G.append("psfa_dark_mode",r.darkMode?"1":"0"),G.append("psfa_font",r.font),G.append("psfa_button_text",r.buttonText),G.append("psfa_hide_amazon_icon",r.hideAmazonIcon?"1":"0"),G.append("psfa_features",JSON.stringify(i)),G.append("psfa_element_styles",JSON.stringify(r.elementStyles??hs));const Y=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G})).json();Y.success?(typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...r,features:i}),_e.success("Appearance saved successfully!")):_e.error(((P=Y.data)==null?void 0:P.message)||"Failed to save appearance")}catch(G){console.error("Failed to save:",G),_e.error("Failed to save appearance. Please try again.")}finally{d(!1)}},g=async()=>{if(await m({message:"Are you sure you want to reset appearance settings to defaults?",title:"Reset Appearance",confirmText:"Reset",variant:"danger"}))try{const G=new FormData;if(G.append("action","psfa_reset_settings"),G.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||""),G.append("section","appearance"),(await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:G})).json()).success){const Z={baseColor:"neutral",accentColor:"orange",accentInk:"auto",style:"vega",radius:"0.5",darkMode:!1,font:"",buttonText:"Buy on Amazon",hideAmazonIcon:!1,elementStyles:hs},le={...i,...sM};s(Z),l(le),typeof psfaAdmin<"u"&&(psfaAdmin.settings={...psfaAdmin.settings,...Z,features:le}),_e.success("Appearance reset to defaults!")}}catch(G){console.error("Failed to reset:",G),_e.error("Failed to reset. Please try again.")}},v=((V=Ji.find(P=>P.id===r.accentColor))==null?void 0:V.hex)||"#f97316",S=el.find(P=>P.value===r.font),N=a==null?void 0:a.effectiveAppearance,A=e?r:{...r,baseColor:(N==null?void 0:N.baseColor)||"neutral",accentColor:(N==null?void 0:N.accentColor)||"orange",accentInk:lM(N==null?void 0:N.accentInk),style:(N==null?void 0:N.style)||"vega",radius:(N==null?void 0:N.radius)||"0.5",darkMode:(N==null?void 0:N.darkMode)===!0||(N==null?void 0:N.darkMode)==="1",font:(N==null?void 0:N.font)||"",buttonText:(w==null?void 0:w.buttonText)||(N==null?void 0:N.buttonText)||"Buy on Amazon",hideAmazonIcon:(N==null?void 0:N.hideAmazonIcon)===!0||(N==null?void 0:N.hideAmazonIcon)==="1",elementStyles:hs},j=GG({ajaxUrl:typeof psfaAdmin<"u"&&psfaAdmin.ajaxUrl||"",nonce:typeof psfaAdmin<"u"&&psfaAdmin.nonce||"",state:{baseColor:A.baseColor,accentColor:A.accentColor,accentInk:A.accentInk??"auto",style:A.style,radius:A.radius,darkMode:A.darkMode,font:A.font,buttonText:A.buttonText,hideAmazonIcon:A.hideAmazonIcon,features:Object.fromEntries(uq.map(P=>[P,i[P]===!0])),elementStyles:A.elementStyles??hs}}),C=w?w.inactiveAppearanceAxes:a==null?void 0:a.inactiveAppearanceAxes,R=Array.isArray(C)?C:[],M={baseColor:{label:"Base Color",showing:((D=Qi.find(P=>P.id===A.baseColor))==null?void 0:D.name)||""},radius:{label:"Radius",showing:A.radius},accentColor:{label:"Accent Color",showing:((T=Ji.find(P=>P.id===A.accentColor))==null?void 0:T.name)||""},accentInk:{label:"Button Text Color",showing:((O=uv.find(P=>P.id===A.accentInk))==null?void 0:O.name)||""},darkMode:{label:"Dark Mode",showing:A.darkMode?"Dark":"Light"},style:{label:"Style",showing:((_=Km.find(P=>P.id===A.style))==null?void 0:_.name)||""},font:{label:"Font",showing:(($=el.find(P=>P.value===A.font))==null?void 0:$.label)||""},buttonText:{label:"Button Text",showing:`"${A.buttonText}"`},hideAmazonIcon:{label:"Amazon Icon",showing:A.hideAmazonIcon?"Hidden":"Visible"},elementStyles:{label:"Product Text and Buy Button",showing:"Default"}},z=dq.filter(P=>R.includes(P)).map(P=>({key:P,...M[P]})),B=!e&&z.length>0;return o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:lg:grid-cols-[minmax(0,1fr)_320px] tw:gap-8",children:[o.jsxs("div",{className:"tw:@container tw:min-w-0",children:[B&&o.jsxs("div",{"data-testid":"inactive-appearance-panel",className:"tw:mb-8 tw:rounded-lg tw:border tw:border-border tw:bg-muted tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Some of your saved settings are not being applied"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Your site is showing the free defaults for these:"}),o.jsx("ul",{className:"tw:text-sm tw:text-foreground tw:m-0 tw:mb-3 tw:pl-5 tw:list-disc tw:space-y-1",children:z.map(P=>o.jsxs("li",{"data-testid":`inactive-axis-${P.key}`,children:[o.jsx("span",{className:"tw:font-medium",children:P.label}),P.showing?` (showing ${P.showing})`:""]},P.key))}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Your saved values are still stored. They apply automatically once Premium is active."})]}),!e&&o.jsxs("div",{className:"tw:mb-8 tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Unlock Full Appearance Customization"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Upgrade to Premium to access all customization options:"}),o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:list-disc tw:space-y-1",children:[o.jsx("li",{children:"5 base color palettes (Stone, Slate, Zinc, Gray)"}),o.jsx("li",{children:"17 accent colors for buttons, badges & highlights"}),o.jsx("li",{children:"Button text color"}),o.jsx("li",{children:"5 layout styles (Nova, Maia, Lyra, Mira)"}),o.jsx("li",{children:"Adjustable corner radius"}),o.jsx("li",{children:"Dark mode"}),o.jsx("li",{children:"15 Google Fonts"}),o.jsx("li",{children:"Title, brand, price and deal colors and sizes"}),o.jsx("li",{children:"Buy button color and size"}),o.jsx("li",{children:"Custom button text"}),o.jsx("li",{children:"Hide Amazon icon"}),o.jsx("li",{children:"Editorial and Spotlight product box styles"})]}),B&&o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"If you saved these settings on Premium before, they are still stored and apply again as soon as you reactivate."}),o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Upgrade to Premium"})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:@min-[17rem]:grid-cols-2 tw:gap-x-8 tw:gap-y-8 tw:items-start",children:[o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-y-8",children:[o.jsx(_a,{title:"Base Color",description:"Gray scale palette for backgrounds, borders, and text. (Base colors are easier to see in dark mode)",children:e?o.jsxs(Vt,{value:r.baseColor,onValueChange:P=>x("baseColor",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:(H=Qi.find(P=>P.id===r.baseColor))==null?void 0:H.swatch}}),o.jsx("span",{children:(F=Qi.find(P=>P.id===r.baseColor))==null?void 0:F.name})]})})}),o.jsx(Lt,{children:Qi.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:P.swatch}}),o.jsx("span",{children:P.name})]})},P.id))})]}):o.jsxs(Kn,{children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:border tw:border-border-strong tw:inline-block tw:shrink-0",style:{background:Qi[0].swatch}}),o.jsx("span",{children:Qi[0].name})]})}),o.jsx(_a,{title:"Accent Color",description:"Primary color for buttons, badges, and highlights.",children:e?o.jsxs(Vt,{value:r.accentColor,onValueChange:P=>x("accentColor",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:v}}),o.jsx("span",{children:(Q=Ji.find(P=>P.id===r.accentColor))==null?void 0:Q.name})]})})}),o.jsx(Lt,{className:"tw:max-h-60",children:Ji.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:P.hex}}),o.jsx("span",{children:P.name})]})},P.id))})]}):o.jsxs(Kn,{children:[o.jsx("span",{className:"tw:w-4 tw:h-4 tw:rounded-full tw:inline-block tw:shrink-0",style:{background:Ji[0].hex}}),o.jsx("span",{children:Ji[0].name})]})}),o.jsx(_a,{title:"Button Text Color",description:"Text on buttons, badges and ribbons. Auto picks the more readable one for your accent.",badge:e?void 0:o.jsx(fv,{}),children:o.jsx(wq,{value:e?r.accentInk??"auto":A.accentInk??"auto",accentColor:A.accentColor,isPremium:e,storedLocked:!e&&r.accentInk!=="auto",onChange:P=>x("accentInk",P)})}),o.jsx(_a,{title:"Button Text",description:"Text displayed on the buy button.",children:t?o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2",children:[o.jsx(Kn,{children:oq}),o.jsx(ln,{variant:"info","data-testid":"managed-cta-lock-notice",children:o.jsx(Gn,{children:`Managed API installs use a fixed "Check price on Amazon" button to stay compliant with Amazon's Associates program. This text cannot be changed while the Managed API is active.`})})]}):e?o.jsx(pt,{value:r.buttonText,onChange:P=>x("buttonText",P.target.value),placeholder:"Buy on Amazon"}):o.jsx(Kn,{children:"Buy on Amazon"})})]}),o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-y-8",children:[o.jsx(_a,{title:"Buy Button",description:"Color and size of the buy button.",badge:e?void 0:o.jsx(fv,{}),className:"psfa-buy-button-style",children:o.jsx(xq,{value:(r.elementStyles??hs).button,isPremium:e,accentHex:eM(A.accentColor).fill,accentInk:r.accentInk??"auto",onChange:P=>b("button",P)})}),o.jsx(_a,{title:"Radius",description:"Corner roundness for cards and buttons.",children:e?o.jsx("div",{className:"tw:@container",children:o.jsx("div",{className:"tw:grid tw:grid-cols-[repeat(2,minmax(0,3.5rem))] tw:gap-2 tw:@min-[8.5rem]:grid-cols-[repeat(3,minmax(0,3.5rem))] tw:@min-[15.75rem]:grid-cols-[repeat(5,minmax(0,3.5rem))]",children:sq.map(P=>o.jsxs("button",{onClick:()=>x("radius",P),className:E("tw:flex tw:min-w-0 tw:flex-col tw:items-center tw:gap-1.5 tw:px-1 tw:py-2.5 tw:rounded-lg tw:border tw:transition-all tw:bg-card tw:cursor-pointer",r.radius===P?"tw:border-ring tw:ring-2 tw:ring-ring/20":"tw:border-border tw:hover:border-border-strong"),children:[o.jsx("span",{className:"tw:w-8 tw:h-8 tw:border-2 tw:border-border-strong tw:bg-muted",style:{borderRadius:`${P}rem`}}),o.jsx("span",{className:"tw:text-xs tw:font-medium tw:text-muted-foreground",children:P})]},P))})}):o.jsx(Kn,{children:"0.5"})}),o.jsx(_a,{title:"Style",description:"Card padding, borders, shadows, and spacing.",children:e?o.jsxs(Vt,{value:r.style,onValueChange:P=>x("style",P),children:[o.jsx(zt,{children:o.jsx(Gt,{children:o.jsx("span",{children:(X=Km.find(P=>P.id===r.style))==null?void 0:X.name})})}),o.jsx(Lt,{children:Km.map(P=>o.jsx(Tt,{value:P.id,children:o.jsxs("span",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx("span",{children:P.name}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:P.description})]})},P.id))})]}):o.jsx(Kn,{children:Km[0].name})}),o.jsx(_a,{title:"Font",description:"Google Font or system default.",children:e?o.jsxs(Vt,{value:r.font||"_system_",onValueChange:P=>{x("font",P==="_system_"?"":P)},onOpenChange:y,children:[o.jsx(zt,{style:S!=null&&S.family?{fontFamily:S.family}:void 0,children:o.jsx(Gt,{placeholder:"Select font..."})}),o.jsx(Lt,{className:"tw:max-h-60",children:el.map(P=>o.jsx(Tt,{value:P.value||"_system_",children:o.jsx("span",{className:"tw:flex tw:items-center tw:justify-between tw:w-full tw:gap-2",style:P.family?{fontFamily:P.family}:void 0,children:o.jsx("span",{children:P.label})})},P.value||"_system_"))})]}):o.jsx(Kn,{children:el[0].label})})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:gap-8 tw:md:@min-[17rem]:col-span-2 tw:md:@min-[17rem]:grid-cols-subgrid tw:md:@min-[17rem]:gap-y-0 tw:md:@min-[17rem]:*:row-span-3 tw:md:@min-[17rem]:*:grid tw:md:@min-[17rem]:*:grid-rows-subgrid",children:[o.jsx(_a,{title:"Dark Mode",description:"Light or dark appearance.",children:e?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(_r,{checked:r.darkMode,onCheckedChange:P=>x("darkMode",P)}),o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:r.darkMode?"Dark":"Light"})]}):o.jsx(Kn,{children:"Light"})}),o.jsx(_a,{title:"Amazon Icon",description:"Show or hide the Amazon logo on buy buttons.",children:e?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsx(_r,{checked:r.hideAmazonIcon,onCheckedChange:P=>x("hideAmazonIcon",P)}),o.jsx("span",{className:"tw:text-sm tw:text-foreground",children:r.hideAmazonIcon?"Hidden":"Visible"})]}):o.jsx(Kn,{children:"Visible"})})]}),o.jsx(_a,{title:"Product Text",description:"Color and size for the title, brand, price and deal badges on every box, table, list and search result.",badge:e?void 0:o.jsx(fv,{}),className:"psfa-element-styles tw:md:@min-[17rem]:col-span-2",children:o.jsx("div",{className:"tw:@container tw:flex tw:flex-col",children:tM.map(P=>o.jsx(gq,{el:P,value:(r.elementStyles??hs)[P],isPremium:e,cardHex:cq[A.baseColor][A.darkMode?"dark":"light"],darkMode:A.darkMode,onChange:G=>b(P,G)},P))})}),o.jsxs("section",{className:"tw:md:@min-[17rem]:col-span-2",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Badge & Deal Settings"}),o.jsx("span",{className:"tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium tw:border tw:border-solid tw:border-border-strong tw:bg-secondary tw:text-muted-foreground tw:rounded",children:"Premium"})]}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"Choose which deal badges show on search results, product boxes and lists."}),e?o.jsx("div",{className:"tw:grid tw:grid-cols-1 tw:md:@min-[20rem]:grid-cols-2 tw:gap-3",children:iq.map(P=>o.jsx(Co,{label:P.label,checked:i[P.key],onChange:()=>f(P.key),info:P.info},P.key))}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:space-y-1 tw:list-disc",children:[o.jsx("li",{children:"Deal Badges - Lightning Deal, Best Deal badges"}),o.jsx("li",{children:"Prime Exclusive Deals indicator"}),o.jsx("li",{children:"Low Stock warning animation"}),o.jsx("li",{children:"Deal Countdown timer"})]}),o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-3 tw:py-1.5 tw:text-xs tw:font-medium tw:text-info tw:bg-info-soft tw:rounded-lg tw:hover:bg-info/15 tw:transition-colors tw:no-underline tw:focus:outline-none",children:"Upgrade"})]})]})]}),o.jsxs("div",{className:"tw:pt-6 tw:mt-8 tw:border-t tw:border-border tw:flex tw:flex-wrap tw:gap-3",children:[o.jsx(Ne,{onClick:h,disabled:c,children:c?"Saving...":"Save Appearance"}),o.jsx(Ne,{variant:"outline",onClick:g,children:"Reset to Defaults"})]})]}),o.jsx("div",{className:"tw:hidden tw:lg:block",children:o.jsx("div",{className:"tw:sticky tw:top-[calc(var(--wp-admin--admin-bar--height,32px)+16px)]",children:o.jsx(Ek,{previewKey:"appearance",target:j,layout:"card",look:"classic",footer:o.jsx(bq,{managed:t})})})})]})}function _a({title:e,description:t,badge:n,className:a,children:r}){return o.jsxs("div",{className:a,children:[n?o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-1",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:e}),n]}):o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-1",children:e}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:t}),r]})}function fv(){return o.jsxs("span",{className:vk,children:["PRO",o.jsx("span",{className:"tw:sr-only",children:" (Premium)"})]})}function wq({value:e,accentColor:t,isPremium:n,storedLocked:a,onChange:r}){const s=a?"Your site shows Auto until Premium is active.":n?"":"White and Dark come with Premium.";return o.jsxs("div",{className:"tw:@container",children:[o.jsx(Xi,{name:"accent-ink",label:"Button text color",full:!0,value:e,onChange:r,options:uv.map(i=>{const l=!n&&i.id!=="auto",c=eM(t,i.id);return{value:i.id,label:i.name,disabled:l,icon:o.jsx("span",{"data-ink-swatch":"","aria-hidden":"true",className:"tw:hidden tw:@[300px]:inline-flex tw:h-5 tw:min-w-[26px] tw:shrink-0 tw:items-center tw:justify-center tw:rounded-[5px] tw:px-1 tw:text-[11px] tw:font-semibold tw:leading-none tw:shadow-[inset_0_0_0_1px_rgb(0_0_0/0.08)]",style:{background:c.fill,color:c.ink},children:"Aa"})}})}),s?o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-2",children:s}):null]})}function pq(e,t,n,a){if(!t)return"";if(e==="deal"){const s=gs(t,aq(t));return s<dv?`Badge text is hard to read on this color (${s.toFixed(1)}:1).`:""}const r=gs(t,n);return r<dv?`Hard to read on ${a?"dark":"light"} cards (${r.toFixed(1)}:1).`:""}const qm="tw:col-span-2 tw:@xs:col-span-1",cM="tw:col-span-full tw:@lg:col-start-2 tw:@lg:col-span-3",hq="linear-gradient(to top right, transparent calc(50% - 0.75px), hsl(var(--border-strong)) calc(50% - 0.75px), hsl(var(--border-strong)) calc(50% + 0.75px), transparent calc(50% + 0.75px))";function gq({el:e,value:t,isPremium:n,cardHex:a,darkMode:r,onChange:s}){const i=fq[e],l=i.name.toLowerCase(),c=n?pq(e,t.color,a,r):"";return o.jsxs("div",{role:"group","aria-label":i.label,className:"tw:grid tw:grid-cols-[minmax(0,1fr)_2.25rem] tw:items-center tw:gap-x-5 tw:gap-y-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:py-3 tw:first:border-t-0 tw:first:pt-0 tw:@xs:grid-cols-[minmax(9rem,15rem)_minmax(9.5rem,1fr)] tw:@lg:grid-cols-[7rem_minmax(9rem,15rem)_minmax(9.5rem,1fr)_2.25rem]",children:[o.jsx("span",{className:"tw:col-start-1 tw:row-start-1 tw:text-sm tw:font-medium tw:text-foreground",children:i.label}),n?o.jsxs(o.Fragment,{children:[o.jsx(uM,{name:i.name,picker:i.picker,value:t.color,onChange:d=>s({color:d}),className:qm}),o.jsxs("div",{className:E(qm,"tw:flex tw:min-w-0 tw:items-center tw:gap-3"),children:[o.jsx(Vi,{min:ov,max:sv,step:Ym,value:[t.scale],onValueChange:([d])=>s({scale:d}),thumbLabels:[`${i.name} size`],formatValueText:d=>`${d}%`,className:"tw:min-w-24"}),o.jsxs("span",{className:"tw:w-11 tw:shrink-0 tw:text-right tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:[t.scale,"%"]})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon","aria-label":`Reset ${l} to default`,title:"Reset to default",onClick:()=>s({color:"",scale:Wa}),className:E("tw:col-start-2 tw:row-start-1 tw:justify-self-end tw:@lg:col-start-4",nq(t)&&"tw:invisible"),children:o.jsx(SN,{"aria-hidden":"true"})})]}):o.jsxs(o.Fragment,{children:[o.jsx(Kn,{className:qm,children:"Default"}),o.jsx(Kn,{className:qm,children:"100%"})]}),e==="deal"&&o.jsx("p",{className:E(cM,"tw:m-0 tw:text-xs tw:text-muted-foreground"),children:"Fills the deal and discount badges. Their text turns white or dark, whichever reads better."}),c&&o.jsxs("p",{role:"status",className:E(cM,"tw:m-0 tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:text-muted-foreground"),children:[o.jsx(Sc,{"aria-hidden":"true",className:"tw:size-3.5 tw:shrink-0 tw:text-warning"}),c]})]})}function xq({value:e,isPremium:t,accentHex:n,accentInk:a,onChange:r}){const s=e.color?rq(e.color,a):"",i=s?gs(e.color,s):1/0,l=t&&i<dv?`Button text is hard to read on this color (${i.toFixed(1)}:1).`:"",c=(d,m,f,w)=>o.jsx(Ne,{type:"button",variant:"ghost",size:"icon","aria-label":d,title:m,onClick:()=>r(w),className:E("tw:size-7 tw:shrink-0",f&&"tw:invisible"),children:o.jsx(SN,{"aria-hidden":"true"})});return o.jsxs("div",{className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-4",children:[o.jsxs("div",{role:"group","aria-label":"Buy button color",className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5",children:[o.jsxs("div",{className:"tw:flex tw:min-h-7 tw:items-center tw:justify-between tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:"Color"}),t&&c("Reset buy button color to Accent Color","Follow Accent Color",!e.color,{color:""})]}),t?o.jsx(uM,{name:"Buy button",picker:n,value:e.color,placeholder:"Accent",emptySwatch:n,onChange:d=>r({color:d})}):o.jsx(Kn,{children:"Accent color"}),t&&o.jsx("p",{className:"tw:m-0 tw:text-xs tw:text-muted-foreground",children:"Leave it empty to follow Accent Color."}),l&&o.jsxs("p",{role:"status",className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5 tw:text-xs tw:text-muted-foreground",children:[o.jsx(Sc,{"aria-hidden":"true",className:"tw:mt-px tw:size-3.5 tw:shrink-0 tw:text-warning"}),l]})]}),o.jsxs("div",{role:"group","aria-label":"Buy button size",className:"tw:flex tw:min-w-0 tw:flex-col tw:gap-1.5",children:[o.jsxs("div",{className:"tw:flex tw:min-h-7 tw:items-center tw:gap-2",children:[o.jsx("span",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:"Size"}),o.jsx("span",{className:"tw:ml-auto tw:text-sm tw:tabular-nums tw:text-muted-foreground",children:t?`${e.scale}%`:""}),t&&c("Reset buy button size to 100%","Reset to 100%",e.scale===Wa,{scale:Wa})]}),t?o.jsx(Vi,{min:ov,max:sv,step:Ym,value:[e.scale],onValueChange:([d])=>r({scale:d}),thumbLabels:["Buy button size"],formatValueText:d=>`${d}%`,className:"tw:min-w-0 tw:h-9"}):o.jsx(Kn,{children:"100%"})]})]})}function uM({name:e,picker:t,value:n,onChange:a,className:r,placeholder:s="Default",emptySwatch:i}){const[l,c]=u.useState(null),d=l??n,m=l!==null&&rM(l)===null;return o.jsxs("div",{className:E(r,"tw:flex tw:min-w-0 tw:items-center tw:gap-2"),children:[o.jsx("span",{className:E("tw:relative tw:size-9 tw:shrink-0 tw:overflow-hidden tw:rounded-md tw:border tw:border-solid tw:border-border-strong tw:has-focus-visible:ring-2 tw:has-focus-visible:ring-ring",!n&&!i&&"tw:bg-card"),style:n?{backgroundColor:n}:i?{backgroundColor:i}:{backgroundImage:hq},children:o.jsx("input",{type:"color","aria-label":`Pick ${e.toLowerCase()} color`,value:n||t,onChange:f=>{c(null),a(f.target.value.toLowerCase())},className:"tw:absolute tw:inset-0 tw:m-0 tw:size-full tw:cursor-pointer tw:border-0 tw:p-0 tw:opacity-0"})}),o.jsx(pt,{"aria-label":`${e} color`,"aria-invalid":m||void 0,placeholder:s,spellCheck:!1,autoComplete:"off",autoCapitalize:"none",maxLength:7,value:d,onChange:f=>{c(f.target.value);const w=rM(f.target.value);w!==null&&a(w)},onBlur:()=>c(null),className:"tw:min-w-0 tw:font-mono"})]})}function Kn({children:e,className:t}){return o.jsx("div",{className:E(t,"tw:flex tw:items-center tw:gap-2 tw:h-9 tw:px-3 tw:rounded-md tw:border tw:border-border tw:bg-muted tw:text-sm tw:text-foreground"),children:e})}function bq({managed:e}){return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-5 tw:py-3 tw:text-[12.5px] tw:leading-normal tw:text-muted-foreground",children:[o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5",children:[o.jsx(Zo,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsx("span",{children:"A sample product with your unsaved changes."})]}),e&&o.jsxs("p",{className:"tw:m-0 tw:flex tw:items-start tw:gap-1.5",children:[o.jsx(lf,{"aria-hidden":"true",className:"tw:mt-px tw:size-4 tw:shrink-0"}),o.jsx("span",{children:"Managed API boxes show no price or deal badges, so their colors do not show here."})]})]})}var vq=Array.isArray,yq=vq,Sq=typeof Wn=="object"&&Wn&&Wn.Object===Object&&Wn,jq=Sq,Nq=jq,Cq=typeof self=="object"&&self&&self.Object===Object&&self,Aq=Nq||Cq||Function("return this")(),Xm=Aq,_q=Xm,Eq=_q.Symbol,mv=Eq,dM=mv,fM=Object.prototype,Tq=fM.hasOwnProperty,Rq=fM.toString,xu=dM?dM.toStringTag:void 0;function kq(e){var t=Tq.call(e,xu),n=e[xu];try{e[xu]=void 0;var a=!0}catch{}var r=Rq.call(e);return a&&(t?e[xu]=n:delete e[xu]),r}var Mq=kq,Dq=Object.prototype,Oq=Dq.toString;function Pq(e){return Oq.call(e)}var zq=Pq,mM=mv,Lq=Mq,Iq=zq,$q="[object Null]",Bq="[object Undefined]",wM=mM?mM.toStringTag:void 0;function Uq(e){return e==null?e===void 0?Bq:$q:wM&&wM in Object(e)?Lq(e):Iq(e)}var wv=Uq;function Hq(e){return e!=null&&typeof e=="object"}var pM=Hq,Fq=wv,Vq=pM,Gq="[object Symbol]";function Yq(e){return typeof e=="symbol"||Vq(e)&&Fq(e)==Gq}var Kq=Yq;function qq(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bu=qq,Xq=wv,Wq=bu,Zq="[object AsyncFunction]",Qq="[object Function]",Jq="[object GeneratorFunction]",eX="[object Proxy]";function tX(e){if(!Wq(e))return!1;var t=Xq(e);return t==Qq||t==Jq||t==Zq||t==eX}var nX=tX,aX=Xm,rX=aX["__core-js_shared__"],oX=rX,pv=oX,hM=function(){var e=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sX(e){return!!hM&&hM in e}var iX=sX,lX=Function.prototype,cX=lX.toString;function uX(e){if(e!=null){try{return cX.call(e)}catch{}try{return e+""}catch{}}return""}var dX=uX,fX=nX,mX=iX,wX=bu,pX=dX,hX=/[\\^$.*+?()[\]{}|]/g,gX=/^\[object .+?Constructor\]$/,xX=Function.prototype,bX=Object.prototype,vX=xX.toString,yX=bX.hasOwnProperty,SX=RegExp("^"+vX.call(yX).replace(hX,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jX(e){if(!wX(e)||mX(e))return!1;var t=fX(e)?SX:gX;return t.test(pX(e))}var NX=jX;function CX(e,t){return e==null?void 0:e[t]}var AX=CX,_X=NX,EX=AX;function TX(e,t){var n=EX(e,t);return _X(n)?n:void 0}var gM=TX,RX=gM,kX=RX(Object,"create"),Wm=kX,xM=Wm;function MX(){this.__data__=xM?xM(null):{},this.size=0}var DX=MX;function OX(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var PX=OX,zX=Wm,LX="__lodash_hash_undefined__",IX=Object.prototype,$X=IX.hasOwnProperty;function BX(e){var t=this.__data__;if(zX){var n=t[e];return n===LX?void 0:n}return $X.call(t,e)?t[e]:void 0}var UX=BX,HX=Wm,FX=Object.prototype,VX=FX.hasOwnProperty;function GX(e){var t=this.__data__;return HX?t[e]!==void 0:VX.call(t,e)}var YX=GX,KX=Wm,qX="__lodash_hash_undefined__";function XX(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=KX&&t===void 0?qX:t,this}var WX=XX,ZX=DX,QX=PX,JX=UX,eW=YX,tW=WX;function tl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}tl.prototype.clear=ZX,tl.prototype.delete=QX,tl.prototype.get=JX,tl.prototype.has=eW,tl.prototype.set=tW;var nW=tl;function aW(){this.__data__=[],this.size=0}var rW=aW;function oW(e,t){return e===t||e!==e&&t!==t}var sW=oW,iW=sW;function lW(e,t){for(var n=e.length;n--;)if(iW(e[n][0],t))return n;return-1}var Zm=lW,cW=Zm,uW=Array.prototype,dW=uW.splice;function fW(e){var t=this.__data__,n=cW(t,e);if(n<0)return!1;var a=t.length-1;return n==a?t.pop():dW.call(t,n,1),--this.size,!0}var mW=fW,wW=Zm;function pW(e){var t=this.__data__,n=wW(t,e);return n<0?void 0:t[n][1]}var hW=pW,gW=Zm;function xW(e){return gW(this.__data__,e)>-1}var bW=xW,vW=Zm;function yW(e,t){var n=this.__data__,a=vW(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}var SW=yW,jW=rW,NW=mW,CW=hW,AW=bW,_W=SW;function nl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}nl.prototype.clear=jW,nl.prototype.delete=NW,nl.prototype.get=CW,nl.prototype.has=AW,nl.prototype.set=_W;var EW=nl,TW=gM,RW=Xm,kW=TW(RW,"Map"),MW=kW,bM=nW,DW=EW,OW=MW;function PW(){this.size=0,this.__data__={hash:new bM,map:new(OW||DW),string:new bM}}var zW=PW;function LW(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var IW=LW,$W=IW;function BW(e,t){var n=e.__data__;return $W(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Qm=BW,UW=Qm;function HW(e){var t=UW(this,e).delete(e);return this.size-=t?1:0,t}var FW=HW,VW=Qm;function GW(e){return VW(this,e).get(e)}var YW=GW,KW=Qm;function qW(e){return KW(this,e).has(e)}var XW=qW,WW=Qm;function ZW(e,t){var n=WW(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}var QW=ZW,JW=zW,eZ=FW,tZ=YW,nZ=XW,aZ=QW;function al(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}al.prototype.clear=JW,al.prototype.delete=eZ,al.prototype.get=tZ,al.prototype.has=nZ,al.prototype.set=aZ;var rZ=al,vM=rZ,oZ="Expected a function";function hv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oZ);var n=function(){var a=arguments,r=t?t.apply(this,a):a[0],s=n.cache;if(s.has(r))return s.get(r);var i=e.apply(this,a);return n.cache=s.set(r,i)||s,i};return n.cache=new(hv.Cache||vM),n}hv.Cache=vM;var sZ=hv,iZ=sZ,lZ=500;function cZ(e){var t=iZ(e,function(a){return n.size===lZ&&n.clear(),a}),n=t.cache;return t}var uZ=cZ,dZ=uZ,fZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mZ=/\\(\\)?/g;dZ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(fZ,function(n,a,r,s){t.push(r?s.replace(mZ,"$1"):a||n)}),t});var yM=mv,SM=yM?yM.prototype:void 0;SM&&SM.toString;var wZ=wv,pZ=yq,hZ=pM,gZ="[object String]";function xZ(e){return typeof e=="string"||!pZ(e)&&hZ(e)&&wZ(e)==gZ}var bZ=xZ;const vZ=Ja(bZ);var nt={};/** 477 477 * @license React 478 478 * react-is.production.min.js … … 482 482 * This source code is licensed under the MIT license found in the 483 483 * LICENSE file in the root directory of this source tree. 484 */var gv=Symbol.for("react.element"),xv=Symbol.for("react.portal"),Jm=Symbol.for("react.fragment"),ew=Symbol.for("react.strict_mode"),tw=Symbol.for("react.profiler"),nw=Symbol.for("react.provider"),aw=Symbol.for("react.context"), bZ=Symbol.for("react.server_context"),rw=Symbol.for("react.forward_ref"),ow=Symbol.for("react.suspense"),sw=Symbol.for("react.suspense_list"),iw=Symbol.for("react.memo"),lw=Symbol.for("react.lazy"),vZ=Symbol.for("react.offscreen"),SM;SM=Symbol.for("react.module.reference");function wa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case gv:switch(e=e.type,e){case Jm:case tw:case ew:case ow:case sw:return e;default:switch(e=e&&e.$$typeof,e){case bZ:case aw:case rw:case lw:case iw:case nw:return e;default:return t}}case xv:return t}}}nt.ContextConsumer=aw,nt.ContextProvider=nw,nt.Element=gv,nt.ForwardRef=rw,nt.Fragment=Jm,nt.Lazy=lw,nt.Memo=iw,nt.Portal=xv,nt.Profiler=tw,nt.StrictMode=ew,nt.Suspense=ow,nt.SuspenseList=sw,nt.isAsyncMode=function(){return!1},nt.isConcurrentMode=function(){return!1},nt.isContextConsumer=function(e){return wa(e)===aw},nt.isContextProvider=function(e){return wa(e)===nw},nt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===gv},nt.isForwardRef=function(e){return wa(e)===rw},nt.isFragment=function(e){return wa(e)===Jm},nt.isLazy=function(e){return wa(e)===lw},nt.isMemo=function(e){return wa(e)===iw},nt.isPortal=function(e){return wa(e)===xv},nt.isProfiler=function(e){return wa(e)===tw},nt.isStrictMode=function(e){return wa(e)===ew},nt.isSuspense=function(e){return wa(e)===ow},nt.isSuspenseList=function(e){return wa(e)===sw},nt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Jm||e===tw||e===ew||e===ow||e===sw||e===vZ||typeof e=="object"&&e!==null&&(e.$$typeof===lw||e.$$typeof===iw||e.$$typeof===nw||e.$$typeof===aw||e.$$typeof===rw||e.$$typeof===SM||e.getModuleId!==void 0)},nt.typeOf=wa;var cw=function(t){return xZ(t)&&t.indexOf("%")===t.length-1},yZ=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},bv=function(t,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),s=2;s<a;s++)r[s-2]=arguments[s]},SZ=Xm,jZ=function(){return SZ.Date.now()},NZ=jZ,CZ=/\s/;function AZ(e){for(var t=e.length;t--&&CZ.test(e.charAt(t)););return t}var _Z=AZ,EZ=_Z,TZ=/^\s+/;function RZ(e){return e&&e.slice(0,EZ(e)+1).replace(TZ,"")}var kZ=RZ,MZ=kZ,jM=bu,DZ=Gq,NM=NaN,OZ=/^[-+]0x[0-9a-f]+$/i,PZ=/^0b[01]+$/i,zZ=/^0o[0-7]+$/i,LZ=parseInt;function IZ(e){if(typeof e=="number")return e;if(DZ(e))return NM;if(jM(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=jM(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MZ(e);var n=PZ.test(e);return n||zZ.test(e)?LZ(e.slice(2),n?2:8):OZ.test(e)?NM:+e}var $Z=IZ,BZ=bu,vv=NZ,CM=$Z,UZ="Expected a function",HZ=Math.max,FZ=Math.min;function VZ(e,t,n){var a,r,s,i,l,c,u=0,m=!1,f=!1,w=!0;if(typeof e!="function")throw new TypeError(UZ);t=CM(t)||0,BZ(n)&&(m=!!n.leading,f="maxWait"in n,s=f?HZ(CM(n.maxWait)||0,t):s,w="trailing"in n?!!n.trailing:w);function p(A){var j=a,C=r;return a=r=void 0,u=A,i=e.apply(C,j),i}function x(A){return u=A,l=setTimeout(h,t),m?p(A):i}function b(A){var j=A-c,C=A-u,R=t-j;return f?FZ(R,s-C):R}function y(A){var j=A-c,C=A-u;return c===void 0||j>=t||j<0||f&&C>=s}function h(){var A=vv();if(y(A))return g(A);l=setTimeout(h,b(A))}function g(A){return l=void 0,w&&a?p(A):(a=r=void 0,i)}function v(){l!==void 0&&clearTimeout(l),u=0,a=c=r=l=void 0}function S(){return l===void 0?i:g(vv())}function N(){var A=vv(),j=y(A);if(a=arguments,r=this,c=A,j){if(l===void 0)return x(c);if(f)return clearTimeout(l),l=setTimeout(h,t),p(c)}return l===void 0&&(l=setTimeout(h,t)),i}return N.cancel=v,N.flush=S,N}var GZ=VZ,YZ=GZ,KZ=bu,qZ="Expected a function";function XZ(e,t,n){var a=!0,r=!0;if(typeof e!="function")throw new TypeError(qZ);return KZ(n)&&(a="leading"in n?!!n.leading:a,r="trailing"in n?!!n.trailing:r),YZ(e,t,{leading:a,maxWait:t,trailing:r})}var WZ=XZ;const ZZ=Ja(WZ);function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function uw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(a){QZ(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function QZ(e,t,n){return t=JZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JZ(e){var t=eQ(e,"string");return vu(t)=="symbol"?t:t+""}function eQ(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(vu(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tQ(e,t){return oQ(e)||rQ(e,t)||aQ(e,t)||nQ()}function nQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.485 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aQ(e,t){if(e){if(typeof e=="string")return _M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _M(e,t)}}function _M(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function rQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,r,s,i,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(a=s.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(m){u=!0,r=m}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return l}}function oQ(e){if(Array.isArray(e))return e}var sQ=d.forwardRef(function(e,t){var n=e.aspect,a=e.initialDimension,r=a===void 0?{width:-1,height:-1}:a,s=e.width,i=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,m=u===void 0?0:u,f=e.minHeight,w=e.maxHeight,p=e.children,x=e.debounce,b=x===void 0?0:x,y=e.id,h=e.className,g=e.onResize,v=e.style,S=v===void 0?{}:v,N=d.useRef(null),A=d.useRef();A.current=g,d.useImperativeHandle(t,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var j=d.useState({containerWidth:r.width,containerHeight:r.height}),C=tQ(j,2),R=C[0],M=C[1],z=d.useCallback(function(I,V){M(function(D){var T=Math.round(I),O=Math.round(V);return D.containerWidth===T&&D.containerHeight===O?D:{containerWidth:T,containerHeight:O}})},[]);d.useEffect(function(){var I=function($){var H,F=$[0].contentRect,Q=F.width,X=F.height;z(Q,X),(H=A.current)===null||H===void 0||H.call(A,Q,X)};b>0&&(I=ZZ(I,b,{trailing:!0,leading:!1}));var V=new ResizeObserver(I),D=N.current.getBoundingClientRect(),T=D.width,O=D.height;return z(T,O),V.observe(N.current),function(){V.disconnect()}},[z,b]);var B=d.useMemo(function(){var I=R.containerWidth,V=R.containerHeight;if(I<0||V<0)return null;bv(cw(i)||cw(c),`The width(%s) and height(%s) are both fixed numbers,484 */var gv=Symbol.for("react.element"),xv=Symbol.for("react.portal"),Jm=Symbol.for("react.fragment"),ew=Symbol.for("react.strict_mode"),tw=Symbol.for("react.profiler"),nw=Symbol.for("react.provider"),aw=Symbol.for("react.context"),yZ=Symbol.for("react.server_context"),rw=Symbol.for("react.forward_ref"),ow=Symbol.for("react.suspense"),sw=Symbol.for("react.suspense_list"),iw=Symbol.for("react.memo"),lw=Symbol.for("react.lazy"),SZ=Symbol.for("react.offscreen"),jM;jM=Symbol.for("react.module.reference");function wa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case gv:switch(e=e.type,e){case Jm:case tw:case ew:case ow:case sw:return e;default:switch(e=e&&e.$$typeof,e){case yZ:case aw:case rw:case lw:case iw:case nw:return e;default:return t}}case xv:return t}}}nt.ContextConsumer=aw,nt.ContextProvider=nw,nt.Element=gv,nt.ForwardRef=rw,nt.Fragment=Jm,nt.Lazy=lw,nt.Memo=iw,nt.Portal=xv,nt.Profiler=tw,nt.StrictMode=ew,nt.Suspense=ow,nt.SuspenseList=sw,nt.isAsyncMode=function(){return!1},nt.isConcurrentMode=function(){return!1},nt.isContextConsumer=function(e){return wa(e)===aw},nt.isContextProvider=function(e){return wa(e)===nw},nt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===gv},nt.isForwardRef=function(e){return wa(e)===rw},nt.isFragment=function(e){return wa(e)===Jm},nt.isLazy=function(e){return wa(e)===lw},nt.isMemo=function(e){return wa(e)===iw},nt.isPortal=function(e){return wa(e)===xv},nt.isProfiler=function(e){return wa(e)===tw},nt.isStrictMode=function(e){return wa(e)===ew},nt.isSuspense=function(e){return wa(e)===ow},nt.isSuspenseList=function(e){return wa(e)===sw},nt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Jm||e===tw||e===ew||e===ow||e===sw||e===SZ||typeof e=="object"&&e!==null&&(e.$$typeof===lw||e.$$typeof===iw||e.$$typeof===nw||e.$$typeof===aw||e.$$typeof===rw||e.$$typeof===jM||e.getModuleId!==void 0)},nt.typeOf=wa;var cw=function(t){return vZ(t)&&t.indexOf("%")===t.length-1},jZ=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},bv=function(t,n){for(var a=arguments.length,r=new Array(a>2?a-2:0),s=2;s<a;s++)r[s-2]=arguments[s]},NZ=Xm,CZ=function(){return NZ.Date.now()},AZ=CZ,_Z=/\s/;function EZ(e){for(var t=e.length;t--&&_Z.test(e.charAt(t)););return t}var TZ=EZ,RZ=TZ,kZ=/^\s+/;function MZ(e){return e&&e.slice(0,RZ(e)+1).replace(kZ,"")}var DZ=MZ,OZ=DZ,NM=bu,PZ=Kq,CM=NaN,zZ=/^[-+]0x[0-9a-f]+$/i,LZ=/^0b[01]+$/i,IZ=/^0o[0-7]+$/i,$Z=parseInt;function BZ(e){if(typeof e=="number")return e;if(PZ(e))return CM;if(NM(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=NM(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=OZ(e);var n=LZ.test(e);return n||IZ.test(e)?$Z(e.slice(2),n?2:8):zZ.test(e)?CM:+e}var UZ=BZ,HZ=bu,vv=AZ,AM=UZ,FZ="Expected a function",VZ=Math.max,GZ=Math.min;function YZ(e,t,n){var a,r,s,i,l,c,d=0,m=!1,f=!1,w=!0;if(typeof e!="function")throw new TypeError(FZ);t=AM(t)||0,HZ(n)&&(m=!!n.leading,f="maxWait"in n,s=f?VZ(AM(n.maxWait)||0,t):s,w="trailing"in n?!!n.trailing:w);function p(A){var j=a,C=r;return a=r=void 0,d=A,i=e.apply(C,j),i}function x(A){return d=A,l=setTimeout(h,t),m?p(A):i}function b(A){var j=A-c,C=A-d,R=t-j;return f?GZ(R,s-C):R}function y(A){var j=A-c,C=A-d;return c===void 0||j>=t||j<0||f&&C>=s}function h(){var A=vv();if(y(A))return g(A);l=setTimeout(h,b(A))}function g(A){return l=void 0,w&&a?p(A):(a=r=void 0,i)}function v(){l!==void 0&&clearTimeout(l),d=0,a=c=r=l=void 0}function S(){return l===void 0?i:g(vv())}function N(){var A=vv(),j=y(A);if(a=arguments,r=this,c=A,j){if(l===void 0)return x(c);if(f)return clearTimeout(l),l=setTimeout(h,t),p(c)}return l===void 0&&(l=setTimeout(h,t)),i}return N.cancel=v,N.flush=S,N}var KZ=YZ,qZ=KZ,XZ=bu,WZ="Expected a function";function ZZ(e,t,n){var a=!0,r=!0;if(typeof e!="function")throw new TypeError(WZ);return XZ(n)&&(a="leading"in n?!!n.leading:a,r="trailing"in n?!!n.trailing:r),qZ(e,t,{leading:a,maxWait:t,trailing:r})}var QZ=ZZ;const JZ=Ja(QZ);function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function uw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_M(Object(n),!0).forEach(function(a){eQ(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_M(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function eQ(e,t,n){return t=tQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tQ(e){var t=nQ(e,"string");return vu(t)=="symbol"?t:t+""}function nQ(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(vu(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aQ(e,t){return iQ(e)||sQ(e,t)||oQ(e,t)||rQ()}function rQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 485 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oQ(e,t){if(e){if(typeof e=="string")return EM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EM(e,t)}}function EM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function sQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,r,s,i,l=[],c=!0,d=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(a=s.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(m){d=!0,r=m}finally{try{if(!c&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(d)throw r}}return l}}function iQ(e){if(Array.isArray(e))return e}var lQ=u.forwardRef(function(e,t){var n=e.aspect,a=e.initialDimension,r=a===void 0?{width:-1,height:-1}:a,s=e.width,i=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,d=e.minWidth,m=d===void 0?0:d,f=e.minHeight,w=e.maxHeight,p=e.children,x=e.debounce,b=x===void 0?0:x,y=e.id,h=e.className,g=e.onResize,v=e.style,S=v===void 0?{}:v,N=u.useRef(null),A=u.useRef();A.current=g,u.useImperativeHandle(t,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var j=u.useState({containerWidth:r.width,containerHeight:r.height}),C=aQ(j,2),R=C[0],M=C[1],z=u.useCallback(function(I,V){M(function(D){var T=Math.round(I),O=Math.round(V);return D.containerWidth===T&&D.containerHeight===O?D:{containerWidth:T,containerHeight:O}})},[]);u.useEffect(function(){var I=function($){var H,F=$[0].contentRect,Q=F.width,X=F.height;z(Q,X),(H=A.current)===null||H===void 0||H.call(A,Q,X)};b>0&&(I=JZ(I,b,{trailing:!0,leading:!1}));var V=new ResizeObserver(I),D=N.current.getBoundingClientRect(),T=D.width,O=D.height;return z(T,O),V.observe(N.current),function(){V.disconnect()}},[z,b]);var B=u.useMemo(function(){var I=R.containerWidth,V=R.containerHeight;if(I<0||V<0)return null;bv(cw(i)||cw(c),`The width(%s) and height(%s) are both fixed numbers, 486 486 maybe you don't need to use a ResponsiveContainer.`,i,c),bv(!n||n>0,"The aspect(%s) must be greater than zero.",n);var D=cw(i)?I:i,T=cw(c)?V:c;n&&n>0&&(D?T=D/n:T&&(D=T*n),w&&T>w&&(T=w)),bv(D>0||T>0,`The width(%s) and height(%s) of chart should be greater than 0, 487 487 please check the style of container, or the props width(%s) and height(%s), 488 488 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 489 height and width.`,D,T,i,c,m,f,n);var O=!Array.isArray(p)&& yZ(p.type).endsWith("Chart");return J.Children.map(p,function(_){return J.isValidElement(_)?d.cloneElement(_,uw({width:D,height:T},O?{style:uw({height:"100%",width:"100%",maxHeight:T,maxWidth:D},_.props.style)}:{})):_})},[n,p,c,w,f,m,R,i]);return J.createElement("div",{id:y?"".concat(y):void 0,className:Tg("recharts-responsive-container",h),style:uw(uw({},S),{},{width:i,height:c,minWidth:m,minHeight:f,maxHeight:w}),ref:N},B)});const iQ={light:"",dark:".dark"},EM=d.createContext(null);function TM(){const e=d.useContext(EM);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const lQ=d.forwardRef(({id:e,className:t,children:n,config:a,...r},s)=>{const i=d.useId(),l=`chart-${e||i.replace(/:/g,"")}`;return o.jsx(EM.Provider,{value:{config:a},children:o.jsxs("div",{"data-chart":l,ref:s,className:E("tw:flex tw:aspect-video tw:justify-center tw:text-xs tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground tw:[&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border tw:[&_.recharts-dot[stroke=#fff]]:stroke-transparent tw:[&_.recharts-layer]:outline-none tw:[&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border tw:[&_.recharts-radial-bar-background-sector]:fill-muted tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted tw:[&_.recharts-reference-line_[stroke=#ccc]]:stroke-border tw:[&_.recharts-sector[stroke=#fff]]:stroke-transparent tw:[&_.recharts-sector]:outline-none tw:[&_.recharts-surface]:outline-none",t),...r,children:[o.jsx(cQ,{id:l,config:a}),o.jsx(sQ,{children:n})]})})});lQ.displayName="Chart";const cQ=({id:e,config:t})=>{const n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(iQ).map(([a,r])=>`489 height and width.`,D,T,i,c,m,f,n);var O=!Array.isArray(p)&&jZ(p.type).endsWith("Chart");return J.Children.map(p,function(_){return J.isValidElement(_)?u.cloneElement(_,uw({width:D,height:T},O?{style:uw({height:"100%",width:"100%",maxHeight:T,maxWidth:D},_.props.style)}:{})):_})},[n,p,c,w,f,m,R,i]);return J.createElement("div",{id:y?"".concat(y):void 0,className:Tg("recharts-responsive-container",h),style:uw(uw({},S),{},{width:i,height:c,minWidth:m,minHeight:f,maxHeight:w}),ref:N},B)});const cQ={light:"",dark:".dark"},TM=u.createContext(null);function RM(){const e=u.useContext(TM);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const uQ=u.forwardRef(({id:e,className:t,children:n,config:a,...r},s)=>{const i=u.useId(),l=`chart-${e||i.replace(/:/g,"")}`;return o.jsx(TM.Provider,{value:{config:a},children:o.jsxs("div",{"data-chart":l,ref:s,className:E("tw:flex tw:aspect-video tw:justify-center tw:text-xs tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground tw:[&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border tw:[&_.recharts-dot[stroke=#fff]]:stroke-transparent tw:[&_.recharts-layer]:outline-none tw:[&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border tw:[&_.recharts-radial-bar-background-sector]:fill-muted tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted tw:[&_.recharts-reference-line_[stroke=#ccc]]:stroke-border tw:[&_.recharts-sector[stroke=#fff]]:stroke-transparent tw:[&_.recharts-sector]:outline-none tw:[&_.recharts-surface]:outline-none",t),...r,children:[o.jsx(dQ,{id:l,config:a}),o.jsx(lQ,{children:n})]})})});uQ.displayName="Chart";const dQ=({id:e,config:t})=>{const n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(cQ).map(([a,r])=>` 490 490 ${r} [data-chart=${e}] { 491 491 ${n.map(([s,i])=>{var c;const l=((c=i.theme)==null?void 0:c[a])||i.color;return l?` --color-${s}: ${l};`:null}).join(` … … 493 493 } 494 494 `).join(` 495 `)}}):null}, uQ=d.forwardRef(({active:e,payload:t,className:n,indicator:a="dot",hideLabel:r=!1,hideIndicator:s=!1,label:i,labelFormatter:l,labelClassName:c,formatter:u,color:m,nameKey:f,labelKey:w},p)=>{const{config:x}=TM(),b=d.useMemo(()=>{var N;if(r||!(t!=null&&t.length))return null;const[h]=t,g=`${w||(h==null?void 0:h.dataKey)||(h==null?void 0:h.name)||"value"}`,v=yv(x,h,g),S=!w&&typeof i=="string"?((N=x[i])==null?void 0:N.label)||i:v==null?void 0:v.label;return l?o.jsx("div",{className:E("tw:font-medium",c),children:l(S,t)}):S?o.jsx("div",{className:E("tw:font-medium",c),children:S}):null},[i,l,t,r,c,x,w]);if(!e||!(t!=null&&t.length))return null;const y=t.length===1&&a!=="dot";return o.jsxs("div",{ref:p,className:E("tw:grid tw:min-w-[8rem] tw:items-start tw:gap-1.5 tw:rounded-lg tw:border tw:border-border/50 tw:bg-background tw:px-2.5 tw:py-1.5 tw:text-xs tw:shadow-xl",n),children:[y?null:b,o.jsx("div",{className:"tw:grid tw:gap-1.5",children:t.filter(h=>h.type!=="none").map((h,g)=>{const v=`${f||h.name||h.dataKey||"value"}`,S=yv(x,h,v),N=m||h.payload.fill||h.color;return o.jsx("div",{className:E("tw:flex tw:w-full tw:flex-wrap tw:items-stretch tw:gap-2 tw:[&>svg]:h-2.5 tw:[&>svg]:w-2.5 tw:[&>svg]:text-muted-foreground",a==="dot"&&"tw:items-center"),children:u&&(h==null?void 0:h.value)!==void 0&&h.name?u(h.value,h.name,h,g,h.payload):o.jsxs(o.Fragment,{children:[S!=null&&S.icon?o.jsx(S.icon,{}):!s&&o.jsx("div",{className:E("tw:shrink-0 tw:rounded-[2px] tw:border-[--color-border] tw:bg-[--color-bg]",{"tw:h-2.5 tw:w-2.5":a==="dot","tw:w-1":a==="line","tw:w-0 tw:border-[1.5px] tw:border-dashed tw:bg-transparent":a==="dashed","tw:my-0.5":y&&a==="dashed"}),style:{"--color-bg":N,"--color-border":N}}),o.jsxs("div",{className:E("tw:flex tw:flex-1 tw:justify-between tw:leading-none",y?"tw:items-end":"tw:items-center"),children:[o.jsxs("div",{className:"tw:grid tw:gap-1.5",children:[y?b:null,o.jsx("span",{className:"tw:text-muted-foreground",children:(S==null?void 0:S.label)||h.name})]}),h.value&&o.jsx("span",{className:"tw:font-mono tw:font-medium tw:tabular-nums tw:text-foreground",children:h.value.toLocaleString()})]})]})},h.dataKey)})})]})});uQ.displayName="ChartTooltip";const dQ=d.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:a="bottom",nameKey:r},s)=>{const{config:i}=TM();return n!=null&&n.length?o.jsx("div",{ref:s,className:E("tw:flex tw:items-center tw:justify-center tw:gap-4",a==="top"?"tw:pb-3":"tw:pt-3",e),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${r||l.dataKey||"value"}`,u=yv(i,l,c);return o.jsxs("div",{className:E("tw:flex tw:items-center tw:gap-1.5 tw:[&>svg]:h-3 tw:[&>svg]:w-3 tw:[&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!t?o.jsx(u.icon,{}):o.jsx("div",{className:"tw:h-2 tw:w-2 tw:shrink-0 tw:rounded-[2px]",style:{backgroundColor:l.color}}),u==null?void 0:u.label]},l.value)})}):null});dQ.displayName="ChartLegend";function yv(e,t,n){if(typeof t!="object"||t===null)return;const a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let r=n;return n in t&&typeof t[n]=="string"?r=t[n]:a&&n in a&&typeof a[n]=="string"&&(r=a[n]),r in e?e[r]:e[n]}function fQ(){return typeof psfaAdmin<"u"&&psfaAdmin.isPremium,o.jsx(mQ,{})}function mQ(){const e=typeof psfaAdmin<"u"&&psfaAdmin.upgradeUrl?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/";return o.jsxs("div",{"data-testid":"analytics-premium-prompt",className:"tw:max-w-2xl tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Analytics comes with Premium"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"See what your visitors search for, which products they click and which filters they use."}),o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:list-disc tw:space-y-1",children:[o.jsx("li",{children:"Searches, clicks and product impressions"}),o.jsx("li",{children:"Clicks and views on your product boxes and comparison tables"}),o.jsx("li",{children:"Each box's clicks for the last 7 days, right in your box list"}),o.jsx("li",{children:"Charts for any date range"}),o.jsx("li",{children:"Top products and top search terms"}),o.jsx("li",{children:"Export to CSV or JSON"})]}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Upgrade to Premium"})]})}function RM(e){return e?"•".repeat(24)+(e.length>=16?e.slice(-4):""):""}function kM(e,t,n){return e.trim()!==""||t&&!n}function yu(e){return e.trim()===""?void 0:e}function MM(e,t){const n=yu(t);return n===void 0?{}:{[e]:n}}function wQ(e,t){const n={secretKeySaved:e.secretKeySaved,secretKeyMasked:e.secretKeyMasked,secretKeyUnreadable:e.secretKeyUnreadable,oauthClientSecretSaved:e.oauthClientSecretSaved,oauthClientSecretMasked:e.oauthClientSecretMasked,oauthClientSecretUnreadable:e.oauthClientSecretUnreadable};if(yu(e.secretKey)!==void 0&&(n.secretKeySaved=!0,n.secretKeyMasked=RM(e.secretKey.trim()),n.secretKeyUnreadable=!1),yu(e.oauthClientSecret)!==void 0&&(n.oauthClientSecretSaved=!0,n.oauthClientSecretMasked=RM(e.oauthClientSecret.trim()),n.oauthClientSecretUnreadable=!1),t&&typeof t=="object"){const a=t;for(const r of Object.keys(n)){const s=a[r];typeof s==typeof n[r]&&(n[r]=s)}}return n}function pQ(e){const[t,n]=d.useState(e),[a,r]=d.useState(!1),[s,i]=d.useState(!1),l=d.useCallback(m=>{n(f=>({...f,...m}))},[]),c=d.useCallback(async()=>{var m;r(!0);try{const f=await vo("psfa_save_credentials",{access_key:t.accessKey,...MM("secret_key",t.secretKey),associate_tag:t.associateTag,oauth_client_id:t.oauthClientId,...MM("oauth_client_secret",t.oauthClientSecret),oauth_credential_version:t.oauthCredentialVersion,oauth_auth_region:t.oauthAuthRegion,marketplace:t.marketplace});if(f.success){const w=(m=f.data)==null?void 0:m.admin_state,p=wQ(t,w==null?void 0:w.settings);n(x=>({...x,...p,secretKey:"",oauthClientSecret:""})),typeof window.psfaAdmin<"u"&&(window.psfaAdmin.settings={...window.psfaAdmin.settings,accessKey:t.accessKey,secretKey:"",associateTag:t.associateTag,oauthClientId:t.oauthClientId,oauthClientSecret:"",oauthCredentialVersion:t.oauthCredentialVersion,oauthAuthRegion:t.oauthAuthRegion,marketplace:t.marketplace,...p})}return{success:f.success,message:f.message||(f.success?"Settings saved successfully":"Failed to save settings")}}catch(f){return{success:!1,message:f instanceof Error?f.message:"Unknown error"}}finally{r(!1)}},[t]),u=d.useCallback(async()=>{var m,f;i(!0);try{const w=t.authType==="oauth"?{auth_type:"oauth",client_id:t.oauthClientId,client_secret:yu(t.oauthClientSecret),credential_version:t.oauthCredentialVersion,auth_region:t.oauthAuthRegion,marketplace:t.marketplace,associate_tag:t.associateTag}:{auth_type:"awssig4",access_key:t.accessKey,secret_key:yu(t.secretKey),associate_tag:t.associateTag},p=await kb("psfa_test_connection",w,!0),x=((m=p.data)==null?void 0:m.message)||p.message||"Connection test completed",b=(f=p.data)==null?void 0:f.diagnostic;return{success:p.success,message:x,...b?{diagnostic:b}:{}}}catch(w){return{success:!1,message:w instanceof Error?w.message:"Connection error"}}finally{i(!1)}},[t]);return{settings:t,updateSettings:l,saveSettings:c,testConnection:u,isSaving:a,isTesting:s}}const hQ=new Intl.NumberFormat("en-US"),gQ=new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"});function xQ(e){if(!e)return null;const t=Date.parse(e);return Number.isFinite(t)?gQ.format(new Date(t)):null}const bQ=24*60*60*1e3;function vQ(){var n;const e=(n=window.psfaAdmin)==null?void 0:n.settings,t=e==null?void 0:e.managedApiLastKnownTier;return typeof t=="string"?t:void 0}function yQ(e){if(!e)return!0;const t=Date.parse(e);return!Number.isFinite(t)||t-Date.now()<=bQ}function xs({value:e}){return o.jsx("span",{className:"tw:font-medium tw:tabular-nums",children:hQ.format(e)})}function SQ({resetDate:e}){return o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground","data-testid":"managed-pool-warning",children:["When the pool is used up, product search, product boxes and comparison tables stop showing new results on every site on this license until the pool resets",e?` on ${e}`:"",". Results a site already loaded can keep showing until they expire: up to 24 hours in product boxes and comparison tables, and up to 30 minutes in search results."]})}function jQ({used:e,cap:t,exhausted:n,label:a}){const r=Math.max(0,Math.min(e,t)),s=t>0?r/t*100:0;return o.jsx("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":r,className:"tw:h-2 tw:overflow-hidden tw:rounded tw:bg-secondary",children:o.jsx("div",{className:E("tw:h-full tw:rounded",n?"tw:bg-destructive":"tw:bg-ring"),style:{width:`${s}%`}})})}function NQ({usage:e,tier:t}){if(e.loading)return o.jsx("div",{className:"tw:text-sm tw:text-muted-foreground",children:"Loading usage..."});const n=e.scope==="pool",a=!n&&(t??vQ())==="free",r=a&&yQ(e.resetsAt),s=n?"Shared Agency pool":r?"Today":a?"This month":"Usage this month",i=a&&r&&typeof e.usedMonth=="number"&&typeof e.capMonth=="number",l=xQ(e.resetsAt),c=typeof e.used=="number"&&typeof e.cap=="number",u=o.jsxs("div",{className:"tw:grid tw:grid-cols-2 tw:gap-2 tw:text-xs tw:text-muted-foreground",children:[o.jsxs("div",{children:["Success rate:"," ",typeof e.successRatePct=="number"?`${e.successRatePct.toFixed(0)}%`:"-"]}),o.jsxs("div",{children:["Avg latency: ",typeof e.avgLatencyMs=="number"?`${e.avgLatencyMs}ms`:"-"]})]});if(!c)return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2","data-testid":"managed-usage-panel",children:[o.jsx("div",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:s}),e.pending?o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Usage appears after this site's next search."}):o.jsx("div",{className:"tw:text-sm tw:text-foreground",children:"-"})]});const m=e.used,f=e.cap,w=typeof e.remaining=="number"?Math.max(0,e.remaining):Math.max(0,f-m),p=!!e.quotaExhausted||w<=0,x=n?" across all sites on your license":"";return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2","data-testid":"managed-usage-panel",children:[o.jsx("div",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:s}),o.jsx(jQ,{used:m,cap:f,exhausted:p,label:s}),p?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-destructive",children:[o.jsx(xs,{value:m})," of ",o.jsx(xs,{value:f})," searches and product lookups used",x,".",n?" None left.":` None left until ${l?`the reset on ${l}`:"the monthly reset"}.`]}),n&&o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-destructive",children:["Product search, product boxes and comparison tables are not showing new results on any site on this license until the pool resets",l?` on ${l}`:"","."]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:[o.jsx(xs,{value:m})," of ",o.jsx(xs,{value:f})," searches and product lookups used",x,"."," ",o.jsx(xs,{value:w})," left.",l&&!r?` Resets ${l}.`:""]}),n&&o.jsx(SQ,{resetDate:l})]}),i&&o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground","data-testid":"managed-usage-month",children:["This month: ",o.jsx(xs,{value:e.usedMonth})," of ",o.jsx(xs,{value:e.capMonth}),"."]}),u]})}const CQ=[{value:"us-east-1",label:"us-east-1 (US)"},{value:"us-west-2",label:"us-west-2"},{value:"eu-west-1",label:"eu-west-1 (Europe)"},{value:"ap-northeast-1",label:"ap-northeast-1 (Japan)"}],DM=[{value:"www.amazon.com",label:"www.amazon.com (US)"},{value:"www.amazon.co.uk",label:"www.amazon.co.uk (UK)"},{value:"www.amazon.de",label:"www.amazon.de (Germany)"},{value:"www.amazon.fr",label:"www.amazon.fr (France)"},{value:"www.amazon.it",label:"www.amazon.it (Italy)"},{value:"www.amazon.es",label:"www.amazon.es (Spain)"},{value:"www.amazon.ca",label:"www.amazon.ca (Canada)"},{value:"www.amazon.com.au",label:"www.amazon.com.au (Australia)"},{value:"www.amazon.co.jp",label:"www.amazon.co.jp (Japan)"},{value:"www.amazon.in",label:"www.amazon.in (India)"},{value:"www.amazon.se",label:"www.amazon.se (Sweden)"}],AQ=["www.amazon.com","www.amazon.co.uk","www.amazon.de","www.amazon.fr","www.amazon.it","www.amazon.es","www.amazon.ca","www.amazon.co.jp","www.amazon.com.au","www.amazon.in"],_Q=new Set(AQ);function OM(e){return _Q.has(e)}const EQ="-20",TQ=new Set(["www.amazon.com","www.amazon.ca"]);function RQ(e,t){return e.trim().toLowerCase().endsWith(EQ)?!TQ.has(t):!1}const kQ={auth:{title:"PaapiPlugin Managed API authorization expired.",body:"The key below is being rejected (invalid, revoked, or a deactivated account), so visitor searches, product boxes and comparison tables return no results. Remove these credentials and connect again, or switch the Active API to your own Amazon credentials.",variant:"destructive"},quota:{title:"PaapiPlugin Managed API quota exhausted.",body:"Visitor searches, product boxes and comparison tables return no results until the quota resets. Switch the Active API to your own Amazon credentials (Creators API or PA-API v5) to keep them working in the meantime.",variant:"destructive"},outage:{title:"Managed API temporarily unavailable.",body:"Visitor searches, product boxes and comparison tables return no results. Saved Creators API / PA-API v5 credentials are used as a fallback for the affected requests.",variant:"warning"}};function MQ(e){return{title:"PaapiPlugin Managed API shared pool used up.",body:"Product search, product boxes and comparison tables return no new results on every site on this license until the pool resets. Switch this site to your own Amazon credentials (Creators API) to keep its searches, boxes and tables working in the meantime.",variant:"destructive"}}function DQ(){var t;const e=(t=window.psfaAdmin)==null?void 0:t.managedApiNotice;return(e==null?void 0:e.scope)==="pool"?"pool":"site"}function OQ(){var n;const e=(n=window.psfaAdmin)==null?void 0:n.managedApiNotice,t=e==null?void 0:e.type;return t==="quota"||t==="auth"||t==="outage"?t:null}const PQ=["managed","creators","paapi"];function zQ(e){const t=e.includes("?")?e.slice(e.indexOf("?")+1):"",n=new URLSearchParams(t),a=n.get("tab"),r=n.get("store");return{tab:a&&PQ.includes(a)?a:null,store:r&&DM.some(s=>s.value===r)?r:null}}function LQ(){return typeof window>"u"?{tab:null,store:null}:zQ(window.location.hash||"")}function Sv(){const e=window.psfaAdmin,t=e==null?void 0:e.settings,n=(e==null?void 0:e.settings)??{};return{authType:(t==null?void 0:t.authType)||"oauth",accessKey:(t==null?void 0:t.accessKey)||"",secretKey:"",associateTag:(t==null?void 0:t.associateTag)||"",oauthClientId:(t==null?void 0:t.oauthClientId)||"",oauthClientSecret:"",oauthCredentialVersion:(t==null?void 0:t.oauthCredentialVersion)||"",oauthAuthRegion:(t==null?void 0:t.oauthAuthRegion)||"us-east-1",marketplace:(t==null?void 0:t.marketplace)||"www.amazon.com",secretKeySaved:!!n.secretKeySaved||!!n.secretKey,secretKeyMasked:typeof n.secretKeyMasked=="string"?n.secretKeyMasked:"",secretKeyUnreadable:!!n.secretKeyUnreadable,oauthClientSecretSaved:!!n.oauthClientSecretSaved||!!n.oauthClientSecret,oauthClientSecretMasked:typeof n.oauthClientSecretMasked=="string"?n.oauthClientSecretMasked:"",oauthClientSecretUnreadable:!!n.oauthClientSecretUnreadable}}const PM="https://paapiplugin.com/account/";function zM(){var t;const e=((t=window.psfaAdmin)==null?void 0:t.settings)||{};return{useManagedApi:!!e.useManagedApi,managedApiKeyMasked:e.managedApiKeyMasked||"",managedApiSignupEmail:e.managedApiSignupEmail||"",managedApiLastKnownTier:e.managedApiLastKnownTier||"unknown",managePlanUrl:e.managePlanUrl||PM}}function IQ(){var l;const e=((l=window.psfaAdmin)==null?void 0:l.settings)||{},t=e.oauthClientId||"",n=e.accessKey||"",a=e.authType||"",r=e.defaultTab||"managed",s=!!e.useManagedApi,i=e.managedApiKeyMasked||"";return s&&i||r==="managed"&&!t&&!n?"managed":t||a==="oauth"?"creators":n||a==="awssig4"?"paapi":"managed"}function rl(){typeof window<"u"&&typeof window.scrollTo=="function"&&window.scrollTo({top:0,left:0,behavior:"auto"})}function $Q(){const[e]=d.useState(LQ),{settings:t,updateSettings:n,saveSettings:a,testConnection:r,isSaving:s,isTesting:i}=pQ(e.store?{...Sv(),marketplace:e.store}:Sv()),[l,c]=d.useState(()=>zM()),[u,m]=d.useState(()=>e.tab??IQ()),[f,w]=d.useState(null),[p,x]=d.useState(new Set),[b,y]=d.useState(()=>l.managedApiSignupEmail),[h,g]=d.useState(!1),[v,S]=d.useState(!1),[N,A]=d.useState(""),[j,C]=d.useState(!1),[R,M]=d.useState(!1),[z,B]=d.useState(!1),[I,V]=d.useState(null),[D,T]=d.useState(!1),[O,_]=d.useState(()=>{const oe=Sv();return{associateTag:oe.associateTag,marketplace:oe.marketplace}}),[$,H]=d.useState(!1),F=t.associateTag!==O.associateTag||t.marketplace!==O.marketplace,Q=kM(t.oauthClientSecret,t.oauthClientSecretSaved,t.oauthClientSecretUnreadable),X=kM(t.secretKey,t.secretKeySaved,t.secretKeyUnreadable),P=!!t.oauthClientId&&Q,G=!!t.accessKey&&X,ne=!!l.managedApiKeyMasked,Y=l.useManagedApi&&ne,Z=Y?"managed":t.authType==="oauth"&&P?"creators":G?"paapi":null,le=l.useManagedApi?"managed":t.authType==="oauth"?"creators":"paapi",he=Y||u==="managed",ae=he&&!OM(t.marketplace),K=RQ(t.associateTag,t.marketplace),ge=()=>{const oe=new Map;return u==="creators"?(t.oauthClientId.trim()||oe.set("oauthClientId","Credential ID"),Q||oe.set("oauthClientSecret","Credential Secret"),t.oauthCredentialVersion.trim()||oe.set("oauthCredentialVersion","Credential Version")):u==="paapi"&&(t.accessKey.trim()||oe.set("accessKey","Access Key ID"),X||oe.set("secretKey","Secret Access Key")),t.associateTag.trim()||oe.set("associateTag","Associate Tag"),x(new Set(oe.keys())),oe},Ne=(oe,ye)=>{n({[oe]:ye}),p.has(oe)&&x(we=>{const Ve=new Set(we);return Ve.delete(oe),Ve})},We=oe=>{m(oe),w(null)},Ke=async()=>{const oe=ge();if(oe.size>0){_e.error(`Please fill in: ${[...oe.values()].join(", ")}`);return}const ye=await a();ye.success?(He(),_({associateTag:t.associateTag,marketplace:t.marketplace}),_e.success("Credentials saved successfully"),rl()):_e.error(ye.message||"Failed to save credentials")},at=async()=>{var oe;if(!t.associateTag.trim()){x(new Set(["associateTag"])),_e.error("Please fill in: Associate Tag");return}H(!0);try{const ye={associateTag:t.associateTag,marketplace:t.marketplace},we=await vo("psfa_save_credentials",{associate_tag:ye.associateTag,marketplace:ye.marketplace});if(we!=null&&we.success){if(window.psfaAdmin&&window.psfaAdmin.settings){const Ve=window.psfaAdmin.settings;Ve.associateTag=ye.associateTag,Ve.marketplace=ye.marketplace}He(),_(ye),_e.success("Associate Tag and Marketplace saved"),rl()}else _e.error(((oe=we==null?void 0:we.data)==null?void 0:oe.message)||(we==null?void 0:we.message)||"Failed to save settings")}finally{H(!1)}},Kt=async()=>{var we,Ve;if(u==="managed"){B(!0),w(null);try{const ze=await qt("psfa_managed_api_test");ze.success?w({success:!0,message:((we=ze.data)==null?void 0:we.message)||"Managed API connection OK"}):w({success:!1,message:((Ve=ze.data)==null?void 0:Ve.message)||ze.message||"Managed API test failed"})}finally{B(!1)}return}const oe=ge();if(oe.size>0){_e.error(`Please fill in: ${[...oe.values()].join(", ")}`);return}w(null);const ye=await r();w(ye)},He=()=>{var ye;const oe=(ye=window.psfaAdmin)==null?void 0:ye.settings;oe&&(c(we=>({...we,useManagedApi:!!oe.useManagedApi})),(oe.authType==="oauth"||oe.authType==="awssig4")&&n({authType:oe.authType}))},qt=async(oe,ye={})=>{const we=window.psfaAdmin;if(!we)return{success:!1,message:"PSFA admin config not found"};const Ve=new FormData;Ve.append("action",oe),Ve.append("nonce",we.nonce);for(const[ze,Wt]of Object.entries(ye))Ve.append(ze,Wt);try{const ze=await fetch(we.ajaxUrl+"?action="+oe,{method:"POST",body:Ve,credentials:"same-origin"});try{return await ze.json()}catch{return{success:!1,message:`HTTP ${ze.status}`}}}catch(ze){return{success:!1,message:ze instanceof Error?ze.message:"Network error"}}},Cn=async()=>{var oe,ye,we,Ve,ze,Wt;if(!b.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)){_e.error("Please enter a valid email");return}if(!t.associateTag.trim()){_e.error("Associate Tag is required");return}if(v&&!ae){C(!0);try{const Ge=await vo("psfa_managed_api_signup",{email:b.trim(),associate_tag:t.associateTag.trim(),marketplace:t.marketplace,marketing_consent:h?"1":"0",consent_ts:h?new Date().toISOString():"",clickwrap_accepted:"1",...ZR(N)});if(Ge!=null&&Ge.success){const Ea=((oe=Ge.data)==null?void 0:oe.api_key_masked)||((ye=Ge.data)==null?void 0:ye.apiKeyMasked)||"••••••••••••••••••••••••0000",pa=((we=Ge.data)==null?void 0:we.tier)||"free",Xn=((Ve=Ge.data)==null?void 0:Ve.active_path)==="managed";V($b((ze=Ge.data)==null?void 0:ze.active_path,t.authType)),c(Ta=>({...Ta,useManagedApi:Xn,managedApiKeyMasked:Ea,managedApiSignupEmail:b.trim(),managedApiLastKnownTier:pa})),_e.success("Your free API key is ready. Welcome to PaapiPlugin Managed API."),rl()}else _e.error(((Wt=Ge==null?void 0:Ge.data)==null?void 0:Wt.message)||(Ge==null?void 0:Ge.message)||"Could not get your API key")}finally{C(!1)}}},mt=async()=>{M(!0);try{if((await vo("psfa_managed_api_disconnect")).success){const ye=zM();c(ye),y(ye.managedApiSignupEmail),He(),_e.success("Managed API credentials removed"),rl()}else c(ye=>({...ye,useManagedApi:!1,managedApiKeyMasked:"",managedApiSignupEmail:"",managedApiLastKnownTier:"unknown"})),_e.message("Managed API credentials removed locally")}finally{M(!1)}},Xt=async oe=>{var Ve;const ye=oe==="oauth"?"Creators API":"PA-API v5";if(!window.confirm(`Remove your stored ${ye} credentials? This cannot be undone.`))return;const we=await vo("psfa_byoc_disconnect",{auth_type:oe,...oe==="oauth"?{clear_oauth_client_secret:"1"}:{clear_secret_key:"1"}});if(we!=null&&we.success){const ze=oe==="oauth"?{oauthClientId:"",oauthClientSecret:"",oauthCredentialVersion:"",oauthClientSecretSaved:!1,oauthClientSecretMasked:"",oauthClientSecretUnreadable:!1}:{accessKey:"",secretKey:"",secretKeySaved:!1,secretKeyMasked:"",secretKeyUnreadable:!1};n(ze),window.psfaAdmin&&window.psfaAdmin.settings&&Object.assign(window.psfaAdmin.settings,ze),He(),_e.success(`${ye} credentials removed`),rl()}else _e.error(((Ve=we==null?void 0:we.data)==null?void 0:Ve.message)||(we==null?void 0:we.message)||"Could not remove credentials")},an=async oe=>{var Ve,ze;const ye=oe;if(ye===le)return;const we=await vo("psfa_set_active_api",{path:ye});if(we!=null&&we.success){const Wt=$b((Ve=we.data)==null?void 0:Ve.active_path,t.authType);He(),V(Ge=>Ge===null?Ge:Wt),_e.success(`Now serving searches via ${Ib[Wt]}`),rl()}else _e.error(((ze=we==null?void 0:we.data)==null?void 0:ze.message)||(we==null?void 0:we.message)||"Could not change the active API")},wn=async()=>{T(!0);try{await an("managed")}finally{T(!1)}},qn=Z==="managed"?{connected:!0,label:"Connected · Managed API"}:Z==="creators"?{connected:!0,label:"Connected · Creators API"}:Z==="paapi"?{connected:!0,label:"Connected · PA-API v5"}:{connected:!1,label:"Not connected"};return o.jsx("div",{className:"tw:space-y-6",children:o.jsxs(It,{children:[o.jsxs(Pc,{className:"tw:border-b tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:flex-col tw:sm:flex-row tw:sm:items-center tw:sm:justify-between tw:gap-3",children:[o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(tJ,{}),"Amazon API Credentials"]}),o.jsx(qQ,{connected:qn.connected,label:qn.label})]}),o.jsx("p",{className:"tw:mt-1 tw:text-sm tw:text-muted-foreground tw:m-0",children:"Your Associate Tag is shared across all paths."})]}),o.jsxs(Yt,{className:"tw:pt-5",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-x-8 tw:gap-y-6",children:[o.jsx("div",{className:"tw:md:col-span-1 tw:md:border-r tw:md:border-border tw:md:pr-6",children:o.jsx(BQ,{value:le,onChange:an,managedConfigured:ne,creatorsConfigured:P,paapiConfigured:G})}),o.jsxs("div",{className:"tw:md:col-span-2",children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Manage credentials"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-1",children:"Add or update keys for each path. Use the selector on the left to choose which one serves searches."})]}),o.jsxs(mH,{value:u,onValueChange:We,children:[o.jsxs(GT,{className:"tw:grid tw:w-full tw:grid-cols-3 tw:h-auto",children:[o.jsx(ym,{value:"managed",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="managed"?"active":ne?"saved":"none"}),o.jsx("span",{className:"tw:truncate",children:"Managed API"})]})}),o.jsx(ym,{value:"creators",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="creators"?"active":P?"saved":"none"}),o.jsxs("span",{className:"tw:truncate",children:["Creators API",o.jsx("span",{className:"tw:sr-only",children:" (OAuth) · Recommended"})]})]})}),o.jsx(ym,{value:"paapi",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="paapi"?"active":G?"saved":"none"}),o.jsxs("span",{className:"tw:truncate",children:["PA-API v5",o.jsx("span",{className:"tw:sr-only",children:" · Advanced"})]})]})})]}),o.jsxs(Sm,{value:"managed",className:"tw:pt-5",children:[I!==null&&o.jsxs(ln,{variant:I==="managed"?"success":"warning",className:"tw:mb-5","data-testid":"managed-signup-confirmation",children:[I==="managed"?o.jsx(aJ,{}):o.jsx(dw,{}),I==="managed"?o.jsxs(o.Fragment,{children:[o.jsx(Va,{children:"Managed API is provisioned and serving your searches"}),o.jsx(Gn,{children:"Your Managed API key is ready, and every search on your site now runs on the Managed API."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Va,{children:"Managed API is provisioned, but it is not serving your searches"}),o.jsxs(Gn,{children:[o.jsxs("p",{className:"tw:m-0",children:["Your Managed API key is ready. Searches on your site still run on the"," ",Ib[I],", which was already set up, so signup left it in place. Switch when you want the Managed API to serve searches instead."]}),o.jsx(Ae,{className:"tw:mt-3",onClick:wn,disabled:D,children:D?"Switching...":"Switch to Managed now"})]})]})]}),o.jsx(UQ,{children:"The Condition, Merchant, and In Stock filters are hidden on the storefront when using the Managed API. Amazon's managed search data does not include per-item condition, seller, or stock information, so these filters cannot be applied. The Newest Arrivals and Featured sort options are also hidden on the Managed API: managed search data has no per-item date, and Featured matches the default Relevance order. All of these remain available when you connect your own Amazon credentials (Creators API or PA-API)."}),ne?o.jsx(FQ,{managed:l,onDisconnect:mt,isDisconnecting:R,hasOauthCreds:P,hasAwsCreds:G}):o.jsx(HQ,{email:b,onEmailChange:y,onConnect:Cn,isConnecting:j,marketingConsent:h,onMarketingConsentChange:g,clickwrapAccepted:v,onClickwrapAcceptedChange:S,heardFrom:N,onHeardFromChange:A,unsupportedStore:ae?t.marketplace:null})]}),o.jsx(Sm,{value:"creators",className:"tw:pt-5",children:o.jsx(YQ,{settings:t,invalidFields:p,onChange:Ne,hasOauthCreds:P,onRemoveCredentials:()=>Xt("oauth")})}),o.jsx(Sm,{value:"paapi",className:"tw:pt-5",children:o.jsx(KQ,{settings:t,invalidFields:p,onChange:Ne,hasAwsCreds:G,onRemoveCredentials:()=>Xt("awssig4")})})]})]})]}),o.jsxs("div",{className:"tw:mt-6 tw:pt-5 tw:border-t tw:border-border",children:[F&&o.jsxs("div",{role:"status",className:"tw:mb-3 tw:flex tw:items-center tw:gap-2 tw:flex-wrap",children:[o.jsx(Ar,{"data-testid":"shared-unsaved-badge",children:"Unsaved changes"}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:"Your Associate Tag / Marketplace edits are not saved yet."})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-associate-tag",className:"tw:mb-1.5 tw:block",children:"Associate Tag"}),o.jsx(pt,{id:"psfa-associate-tag",value:t.associateTag,onChange:oe=>Ne("associateTag",oe.target.value),placeholder:"your-associate-tag",autoComplete:"off","aria-invalid":p.has("associateTag")})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-marketplace",className:"tw:mb-1.5 tw:block",children:"Marketplace"}),o.jsxs(Vt,{value:t.marketplace,onValueChange:oe=>n({marketplace:oe}),children:[o.jsx(zt,{id:"psfa-marketplace",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:DM.map(oe=>{const ye=he&&!OM(oe.value);return o.jsx(Tt,{value:oe.value,disabled:ye,children:ye?`${oe.label} · not on the Managed API`:oe.label},oe.value)})})]})]})]}),ae&&o.jsxs(ln,{variant:Y?"destructive":"warning",className:"tw:mt-4","data-testid":"managed-marketplace-unsupported",children:[o.jsx(dw,{}),o.jsxs(Va,{children:[t.marketplace," is not available on the Managed API"]}),o.jsx(Gn,{children:Y?`The Managed API cannot serve ${t.marketplace}, so your searches are falling back to US products right now. To keep this marketplace, switch the Active API to the Creators API or PA-API v5 and save your own Amazon credentials. Otherwise choose one of the marketplaces the Managed API supports.`:Z?`Your searches run on the ${Ib[Z]}, which serves ${t.marketplace} correctly. The Managed API cannot: switching to it would return US products instead. Keep your own credentials for this marketplace.`:`The Managed API cannot serve ${t.marketplace}: a Managed key would return US products instead. Connect the Creators API or PA-API v5 to use this marketplace.`})]}),K&&o.jsxs(ln,{variant:"warning",className:"tw:mt-4","data-testid":"associate-tag-marketplace-mismatch",children:[o.jsx(dw,{}),o.jsx(Va,{children:"Your Associate Tag ends in -20, which is an Amazon.com / Amazon.ca tag"}),o.jsx(Gn,{children:`${t.marketplace} needs a tracking ID created in that marketplace's own Amazon Associates account. With a -20 tag, Amazon rejects the request with "Your credential is not linked to the partner tag in the request for the given Marketplace." Copy the tracking ID from your ${t.marketplace} Associates account and paste it above. If this tag really is the right one for your account, ignore this and save as usual.`})]}),u==="managed"&&o.jsxs("div",{className:"tw:mt-4 tw:flex tw:flex-col tw:gap-2",children:[o.jsx("div",{children:o.jsx(Ae,{onClick:at,disabled:$||!F,"data-testid":"save-shared-settings",children:$?"Saving...":"Save Associate Tag & Marketplace"})}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0",children:"The Managed API uses these two settings for every search. Your Managed API key is provisioned separately above."})]})]}),f&&o.jsx("div",{className:"tw:mt-5",children:o.jsx(WQ,{result:f})}),o.jsxs("div",{className:"tw:mt-5 tw:flex tw:gap-3 tw:flex-wrap",children:[u!=="managed"&&o.jsx(Ae,{onClick:Ke,disabled:s,children:s?"Saving...":"Save Credentials"}),(u!=="managed"||ne)&&o.jsx(Ae,{variant:"outline",onClick:Kt,disabled:i||z,children:i||z?"Testing...":"Test Connection"})]})]})]})})}function BQ({value:e,onChange:t,managedConfigured:n,creatorsConfigured:a,paapiConfigured:r}){const s=[{path:"managed",label:"Managed API",configured:n},{path:"creators",label:"Creators API",configured:a},{path:"paapi",label:"PA-API v5",configured:r}];return o.jsxs("div",{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Active API"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-1",children:"The API that serves your searches."})]}),o.jsx(Zx,{value:e,onValueChange:t,className:"tw:grid tw:grid-cols-1 tw:gap-3",children:s.map(i=>{const l=`psfa-active-api-${i.path}`;return o.jsxs(Re,{htmlFor:l,className:E("tw:m-0 tw:block tw:rounded-md tw:border tw:p-3 tw:font-medium",e===i.path?"tw:border-ring tw:bg-info-soft":"tw:border-border",i.configured?"tw:cursor-pointer":"tw:cursor-not-allowed tw:opacity-70 tw:text-muted-foreground"),children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(ME,{id:l,value:i.path,disabled:!i.configured,className:"tw:sr-only"}),o.jsx("span",{children:i.label})]}),!i.configured&&o.jsx("span",{className:"tw:block tw:mt-1 tw:text-xs tw:text-muted-foreground",children:"Save credentials below first."})]},i.path)})})]})}function UQ({children:e}){const[t,n]=d.useState(!1);return o.jsx(Tx,{open:t,onOpenChange:n,className:"tw:mb-5",children:o.jsxs(ln,{variant:"info","data-testid":"managed-filters-note",children:[o.jsx(nJ,{}),o.jsxs(Va,{className:"tw:mb-0 tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-1 tw:leading-snug",children:[o.jsx("span",{children:"Some storefront filters are unavailable on the Managed API"}),o.jsx(Rx,{asChild:!0,children:o.jsxs(Ae,{type:"button",variant:"ghost",size:"sm",className:"tw:-my-1 tw:-mr-2 tw:h-auto tw:gap-1 tw:px-2 tw:py-1 tw:[&[data-state=open]>svg]:rotate-180",children:["Details",o.jsx(bc,{"aria-hidden":"true"})]})})]}),o.jsx(kx,{forceMount:!0,hidden:!t,className:"tw:pt-2",children:o.jsx(Gn,{children:e})})]})})}const LM="psfa-managed-signup-blocked";function HQ({email:e,onEmailChange:t,onConnect:n,isConnecting:a,marketingConsent:r,onMarketingConsentChange:s,clickwrapAccepted:i,onClickwrapAcceptedChange:l,heardFrom:c,onHeardFromChange:u,unsupportedStore:m=null}){const f=m?`The Managed API does not cover ${m.replace(/^www\./,"")}. Choose another marketplace below, or connect your own credentials on the Creators API tab.`:"";return o.jsxs("div",{className:"tw:space-y-5",children:[o.jsxs("div",{children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Managed API"})}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Live Amazon product data for your boxes, tables and search. Free to start."})]}),o.jsxs("ul",{className:"tw:list-disc tw:pl-5 tw:space-y-1 tw:text-sm tw:text-foreground tw:m-0",children:[o.jsx("li",{children:"Get started in 30 seconds"}),o.jsx("li",{children:"20 searches and product lookups a day free"}),o.jsx("li",{children:"Products in boxes and tables refresh once a day, and each refresh is one lookup"}),o.jsx("li",{children:"No credit card"}),o.jsx("li",{children:"Your Amazon Associate tag, always"})]}),o.jsx(pG,{testId:"managed-clickwrap-card",children:o.jsxs("p",{className:"tw:m-0 tw:text-foreground",children:["By getting a key, you agree to the"," ",o.jsx("a",{href:"https://paapiplugin.com/api-terms/",target:"_blank",rel:"noopener",className:"tw:underline tw:text-link",children:"API Terms"}),". The plugin will send your search queries to paapiplugin.com infrastructure."," ",o.jsx("a",{href:"https://paapiplugin.com/privacy-policy/#managed-api",target:"_blank",rel:"noopener",className:"tw:underline tw:text-link",children:"Learn what we receive"}),"."]})}),o.jsxs("div",{className:"tw:max-w-md tw:space-y-2",children:[o.jsx(Re,{htmlFor:"psfa-managed-email",className:"tw:mb-1.5 tw:block",children:"Your email"}),o.jsx(pt,{id:"psfa-managed-email",type:"email",value:e,onChange:w=>t(w.target.value),placeholder:"you@example.com",autoComplete:"email"})]}),o.jsxs("div",{className:"tw:max-w-md tw:space-y-2",children:[o.jsx(Re,{htmlFor:"psfa-managed-heard-from",className:"tw:mb-1.5 tw:block",children:XR}),o.jsxs(Vt,{value:c,onValueChange:u,children:[o.jsx(zt,{id:"psfa-managed-heard-from",children:o.jsx(Gt,{placeholder:WR})}),o.jsx(Lt,{children:o.jsx(Yf,{children:Bb.map(w=>o.jsx(Tt,{value:w.value,children:w.label},w.value))})})]})]}),o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2",children:[o.jsx(Uc,{id:"psfa-managed-clickwrap",checked:i,onCheckedChange:w=>l(w===!0),className:"tw:mt-0.5"}),o.jsx(Re,{htmlFor:"psfa-managed-clickwrap",className:"tw:m-0 tw:text-sm tw:font-normal tw:text-foreground tw:cursor-pointer",children:mu})]}),o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2 tw:max-w-md",children:[o.jsx(Uc,{id:"psfa-managed-marketing-consent",checked:r,onCheckedChange:w=>s(w===!0),className:"tw:mt-0.5"}),o.jsx(Re,{htmlFor:"psfa-managed-marketing-consent",className:"tw:m-0 tw:text-sm tw:font-normal tw:text-foreground tw:cursor-pointer",children:"Email me product tips & updates, plus 10% off my first Premium purchase (optional)"})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-x-3 tw:gap-y-2 tw:flex-wrap",children:[o.jsx(Ae,{onClick:n,disabled:a||!i||!!m,"aria-describedby":f?LM:void 0,children:a?"Getting your key...":"Get your free API key"}),f&&o.jsx("p",{id:LM,className:"tw:m-0 tw:text-sm tw:text-muted-foreground","data-testid":"managed-signup-blocked","aria-live":"polite",children:f})]})]})}function FQ({managed:e,onDisconnect:t,isDisconnecting:n,hasOauthCreds:a,hasAwsCreds:r}){var u;const s=zb(),i=OQ(),l=i?i==="quota"&&DQ()==="pool"?MQ():kQ[i]:null,c=s.scope==="pool";return o.jsxs("div",{className:"tw:space-y-5",children:[l&&o.jsxs(ln,{variant:l.variant,"data-testid":"managed-panel-state-alert",children:[o.jsx(dw,{}),o.jsx(Va,{children:l.title}),o.jsx(Gn,{children:l.body})]}),((u=s.tierDrift)==null?void 0:u.drift_detected)&&o.jsx(VQ,{tierDrift:s.tierDrift}),o.jsxs("div",{children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Managed API"})}),o.jsxs("dl",{className:"tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:gap-y-2 tw:text-sm tw:m-0",children:[o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"Account"}),o.jsx("dd",{className:"tw:text-foreground tw:m-0",children:e.managedApiSignupEmail||"-"}),o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"API Key"}),o.jsx("dd",{className:"tw:font-mono tw:text-xs tw:text-foreground tw:m-0",children:e.managedApiKeyMasked}),o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"Tier"}),c?o.jsx("dd",{className:"tw:text-foreground tw:m-0",children:"Agency (shared pool)"}):o.jsx("dd",{className:"tw:text-foreground tw:m-0 tw:capitalize",children:e.managedApiLastKnownTier})]})]}),(a||r)&&o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0",children:["If the Managed API is briefly unavailable, the plugin falls back to your saved"," ",a&&r?"Creators API / PA-API v5 credentials":a?"Creators API credentials":"PA-API v5 credentials"," ","for that request."]}),o.jsx(av,{onCredentialsPage:!0}),o.jsx(NQ,{usage:s}),!1,o.jsxs("div",{className:"tw:flex tw:gap-3 tw:flex-wrap",children:[e.managedApiLastKnownTier==="premium"?o.jsx("a",{href:e.managePlanUrl,...e.managePlanUrl===PM?{target:"_blank",rel:"noopener"}:{},className:"tw:inline-flex tw:items-center tw:justify-center tw:whitespace-nowrap tw:rounded-md tw:border tw:border-border-strong tw:bg-card tw:text-foreground tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:no-underline tw:hover:bg-accent",children:"Manage plan"}):o.jsxs("a",{href:"https://paapiplugin.com/pricing/#plans",target:"_blank",rel:"noopener",className:"tw:inline-flex tw:items-center tw:gap-1.5 tw:text-left tw:leading-snug tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90",children:["Upgrade to Premium: 1,200 searches and product lookups a month, every category, auto-updating lists, geotargeting, styling and badges",o.jsx(vc,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0"})]}),o.jsx(Ae,{variant:"outline",onClick:t,disabled:n,children:n?"Removing...":"Remove credentials"})]})]})}function VQ({tierDrift:e}){const{plugin_tier:t,proxy_tier:n,recent_sync:a}=e,r=t==="premium"&&n==="free",s=t==="free"&&n==="premium";let i="info",l="",c=null;return a?(i="info",l="Tier sync in progress",c="Tier sync in progress - should complete shortly."):r?(i="warning",l="Tier sync needed",c=o.jsx("span",{children:"Your Freemius tier is premium but the managed-API proxy still shows free. Reload an admin page to trigger a sync, or wait up to one hour."})):s?(i="info",l="Downgrade pending",c=o.jsx("span",{children:"Your Freemius license is no longer paid; managed-API quota will downgrade at next sync."})):(i="info",l="Tier sync pending",c=o.jsxs("span",{children:["Plugin reports your Freemius tier as ",o.jsx("strong",{children:t})," but the managed-API proxy shows ",o.jsx("strong",{children:n}),". Reload an admin page to trigger a sync, or wait up to one hour."]})),o.jsxs(ln,{variant:i,"data-testid":"tier-drift-banner",children:[o.jsx(Va,{children:l}),o.jsx(Gn,{children:c})]})}const GQ="https://paapiplugin.com/psfa-documentation/#api-credentials";function IM(){return o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground",children:["Need credentials? Follow the"," ",o.jsxs("a",{href:GQ,target:"_blank",rel:"noopener noreferrer",className:"tw:underline tw:text-link",children:["setup guide",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]}),"."]})}const $M="psfa-oauth-secret-status",BM="psfa-secret-key-status";function UM({id:e,typed:t,saved:n,masked:a,unreadable:r}){if(!n&&!r)return null;const s=t.trim()!=="",i=a.replace(/^\u2022+/,"").slice(-4);let l;return s?l="Saving replaces the saved secret.":r?l="The saved secret could not be read. This happens when a site move changes the WordPress security keys. Enter it again and save.":i?l=o.jsxs(o.Fragment,{children:["Saved, ending in ",o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:i}),". Leave this blank to keep it."]}):l="Saved. Leave this blank to keep it.",o.jsx("p",{id:e,"data-testid":e,className:E("tw:m-0 tw:mt-1.5 tw:text-sm",r&&!s?"tw:text-destructive":"tw:text-muted-foreground"),children:l})}function YQ({settings:e,invalidFields:t,onChange:n,hasOauthCreds:a,onRemoveCredentials:r}){return o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:flex-wrap",children:[o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Creators API (OAuth 2.0)"}),(a||e.oauthClientSecretUnreadable)&&o.jsx(Ae,{variant:"outline",size:"sm",onClick:r,children:"Remove credentials"})]}),o.jsx(IM,{}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-oauth-id",className:"tw:mb-1.5 tw:block",children:"Credential ID"}),o.jsx(pt,{id:"psfa-oauth-id",value:e.oauthClientId,onChange:s=>n("oauthClientId",s.target.value),placeholder:"Your credential_id from Creators API",autoComplete:"off","aria-invalid":t.has("oauthClientId")})]}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-oauth-secret",className:"tw:mb-1.5 tw:block",children:"Credential Secret"}),o.jsx(pt,{id:"psfa-oauth-secret",type:"password",value:e.oauthClientSecret,onChange:s=>n("oauthClientSecret",s.target.value),placeholder:e.oauthClientSecretSaved&&!e.oauthClientSecretUnreadable?"Enter a new secret to replace the saved one":"Your credential_secret",autoComplete:"new-password","aria-invalid":t.has("oauthClientSecret"),"aria-describedby":e.oauthClientSecretSaved||e.oauthClientSecretUnreadable?$M:void 0}),o.jsx(UM,{id:$M,typed:e.oauthClientSecret,saved:e.oauthClientSecretSaved,masked:e.oauthClientSecretMasked,unreadable:e.oauthClientSecretUnreadable})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-oauth-version",className:"tw:mb-1.5 tw:block",children:"Credential Version"}),o.jsx(pt,{id:"psfa-oauth-version",value:e.oauthCredentialVersion,onChange:s=>n("oauthCredentialVersion",s.target.value),placeholder:"e.g., 3.1 or 2.1",autoComplete:"off","aria-invalid":t.has("oauthCredentialVersion")})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-oauth-region",className:"tw:mb-1.5 tw:block",children:"Auth Region"}),o.jsxs(Vt,{value:e.oauthAuthRegion,onValueChange:s=>n("oauthAuthRegion",s),children:[o.jsx(zt,{id:"psfa-oauth-region",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:CQ.map(s=>o.jsx(Tt,{value:s.value,children:s.label},s.value))})]})]})]})]})}function KQ({settings:e,invalidFields:t,onChange:n,hasAwsCreds:a,onRemoveCredentials:r}){return o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:flex-wrap",children:[o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"PA-API v5 (AWS Signature V4)"}),(a||e.secretKeyUnreadable)&&o.jsx(Ae,{variant:"outline",size:"sm",onClick:r,children:"Remove credentials"})]}),o.jsx(IM,{}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-access-key",className:"tw:mb-1.5 tw:block",children:"Access Key ID"}),o.jsx(pt,{id:"psfa-access-key",value:e.accessKey,onChange:s=>n("accessKey",s.target.value),placeholder:"Enter your Access Key ID",autoComplete:"off","aria-invalid":t.has("accessKey")})]}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-secret-key",className:"tw:mb-1.5 tw:block",children:"Secret Access Key"}),o.jsx(pt,{id:"psfa-secret-key",type:"password",value:e.secretKey,onChange:s=>n("secretKey",s.target.value),placeholder:e.secretKeySaved&&!e.secretKeyUnreadable?"Enter a new key to replace the saved one":"Enter your Secret Access Key",autoComplete:"new-password","aria-invalid":t.has("secretKey"),"aria-describedby":e.secretKeySaved||e.secretKeyUnreadable?BM:void 0}),o.jsx(UM,{id:BM,typed:e.secretKey,saved:e.secretKeySaved,masked:e.secretKeyMasked,unreadable:e.secretKeyUnreadable})]})]})}function qQ({connected:e,label:t}){return o.jsxs("div",{className:E("tw:inline-flex tw:items-center tw:gap-2 tw:rounded-full tw:px-3 tw:py-1 tw:text-xs tw:font-medium",e?"tw:bg-success-soft tw:text-success tw:border tw:border-success/40":"tw:bg-muted tw:text-foreground tw:border tw:border-border"),children:[o.jsx(XQ,{color:e?"green":"red"}),t]})}function XQ({color:e}){return o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-block tw:w-2 tw:h-2 tw:rounded-full",e==="green"?"tw:bg-success":"tw:bg-destructive")})}function jv({state:e}){return e==="none"?null:e==="active"?o.jsx("span",{"data-testid":"tab-indicator-active",title:"Active - this path serves your searches",className:"tw:inline-block tw:w-2 tw:h-2 tw:rounded-full tw:bg-success"}):o.jsxs("span",{"data-testid":"tab-indicator-saved",title:"Saved - credentials stored but not active","aria-label":"Saved",className:"tw:inline-flex tw:items-center tw:text-[10px] tw:font-medium tw:text-muted-foreground",children:[o.jsx("span",{"aria-hidden":"true",className:"tw:inline-block tw:w-2 tw:h-2 tw:rounded-full tw:border tw:border-border-strong"}),o.jsx("span",{className:"tw:sr-only",children:"Saved"})]})}function WQ({result:e}){return e.success?o.jsx(ln,{variant:"success",children:e.message}):e.diagnostic?o.jsx(eJ,{result:e,diagnostic:e.diagnostic}):o.jsx(ln,{variant:"destructive",children:e.message})}const ZQ=[{key:"http_status",label:"HTTP status"},{key:"amazon_error_code",label:"Amazon error code"},{key:"amazon_error_description",label:"Amazon error description"},{key:"amazon_request_id",label:"Amazon request ID (x-amzn-RequestId)"},{key:"request_url",label:"Request URL"},{key:"credential_version",label:"Credential version"},{key:"auth_region",label:"Auth region"},{key:"marketplace",label:"Marketplace"},{key:"associate_tag_last4",label:"Associate tag (last 4)"},{key:"client_id",label:"Client ID"},{key:"client_secret_length",label:"Client secret length"},{key:"plugin_version",label:"Plugin version"},{key:"php_version",label:"PHP version"},{key:"wp_version",label:"WordPress version"},{key:"timestamp_utc",label:"Timestamp (UTC)"}];function QQ(e){return e==null?"(none)":typeof e=="boolean"?e?"true":"false":typeof e=="string"?e===""?"(empty)":e:typeof e=="number"?String(e):JSON.stringify(e)}function JQ(e){const t=[];t.push("### PaapiPlugin Test Connection diagnostic"),t.push(""),t.push("```");for(const[n,a]of Object.entries(e)){let r;a==null?r="(none)":typeof a=="boolean"?r=a?"true":"false":typeof a=="string"||typeof a=="number"?r=String(a):r=JSON.stringify(a),t.push(`${n}: ${r}`)}return t.push("```"),t.join(`496 `)}function eJ({result:e,diagnostic:t}){const[n,a]=d.useState(!1),[r,s]=d.useState(!1),i=t.human_hint||e.message,l=async()=>{var u;const c=JQ(t);try{typeof navigator<"u"&&((u=navigator.clipboard)!=null&&u.writeText)?(await navigator.clipboard.writeText(c),s(!0),setTimeout(()=>s(!1),2e3),_e.success("Diagnostic copied to clipboard")):_e.error("Clipboard API not available")}catch{_e.error("Failed to copy diagnostic")}};return o.jsxs("div",{className:"tw:space-y-3","data-testid":"diagnostic-surface",children:[o.jsx(ln,{variant:"destructive",children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-1",children:[o.jsx("span",{className:"tw:font-medium",children:i}),t.hint_url&&o.jsx("a",{href:t.hint_url,target:"_blank",rel:"noopener noreferrer",className:"tw:text-xs tw:underline tw:text-destructive",children:"See Amazon documentation"})]})}),o.jsxs(Tx,{open:n,onOpenChange:a,children:[o.jsx(Rx,{asChild:!0,children:o.jsx(Ae,{variant:"outline",size:"sm","data-testid":"diagnostic-toggle",children:n?"Hide diagnostic details":"Show diagnostic details"})}),o.jsx(kx,{className:"tw:mt-3",children:o.jsx(It,{"data-testid":"diagnostic-card",children:o.jsxs(Yt,{className:"tw:p-4",children:[o.jsx("dl",{className:"tw:grid tw:grid-cols-1 tw:gap-2 tw:text-sm",children:ZQ.map(({key:c,label:u})=>o.jsxs("div",{className:"tw:flex tw:flex-col tw:sm:flex-row tw:gap-1 tw:sm:gap-3",children:[o.jsx("dt",{className:"tw:font-medium tw:text-foreground tw:sm:w-56 tw:shrink-0",children:u}),o.jsx("dd",{className:"tw:font-mono tw:text-xs tw:text-foreground tw:break-all",children:QQ(t[c])})]},c))}),o.jsx("div",{className:"tw:mt-4",children:o.jsx(Ae,{variant:"outline",size:"sm",onClick:l,"data-testid":"diagnostic-copy",children:r?"Copied!":"Copy diagnostic for support"})})]})})})]})]})}function tJ(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-info",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}function nJ(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function dw(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}function aJ(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}function rJ(){const e=typeof window<"u"?window.psfaAdmin:void 0;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/#plans"}}function oJ({withTitle:e=!0}){return o.jsxs(Pc,{className:"tw:border-b tw:border-border",children:[e&&o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(Sg,{"aria-hidden":"true",className:"tw:size-4 tw:text-muted-foreground"}),"Geotargeting"]}),o.jsxs("p",{className:E("tw:text-sm tw:text-muted-foreground tw:m-0",e&&"tw:mt-1"),children:[e&&o.jsx(o.Fragment,{children:"Sends each visitor to their own country's Amazon store with your tracking ID for that store. "}),"Product details do not change, only the link does."]}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-1",children:"Uses the visitor's time zone. No IP lookup, no cookies."})]})}function sJ({upgradeUrl:e}){return o.jsxs("div",{className:"tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Geotargeting comes with Premium"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Send visitors from other countries to their own Amazon store, with your tracking ID for that store."}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Get geotargeting with Premium"})]})}function iJ({withTitle:e=!0}){const{upgradeUrl:t}=rJ();return o.jsxs(It,{"data-testid":"geotargeting-card",children:[o.jsx(oJ,{withTitle:e}),o.jsx(Yt,{className:"tw:pt-5",children:o.jsx(sJ,{upgradeUrl:t})})]})}function lJ(){return o.jsx(iJ,{withTitle:!1})}const fw=30;function HM(e){if(e<=0)return"Expired";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m`;const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n>0?`${t}h ${n}m`:`${t}h`}function cJ(e){if(!e)return"-";const n=Math.floor(Date.now()/1e3)-e;if(n<60)return"Just now";if(n<3600)return`${Math.floor(n/60)}m ago`;if(n<86400){const r=Math.floor(n/3600),s=Math.floor(n%3600/60);return s>0?`${r}h ${s}m ago`:`${r}h ago`}if(n<604800){const r=Math.floor(n/86400);return r===1?"1 day ago":`${r} days ago`}if(n<2592e3){const r=Math.floor(n/604800);return r===1?"1 week ago":`${r} weeks ago`}const a=Math.floor(n/2592e3);return a===1?"1 month ago":`${a} months ago`}function mw(e){return`$${(e/100).toFixed(2)}`}const uJ={managed:"Managed API",oauth:"Creators API",awssig4:"PA-API"};function FM(e){return e?uJ[e]||e:"Unknown"}function VM(e){switch(e){case"managed":return"tw:bg-success-soft tw:text-success tw:border-success/40";case"oauth":return"tw:bg-pro-soft tw:text-pro tw:border-pro/40";case"awssig4":return"tw:bg-info-soft tw:text-info tw:border-info/40";default:return"tw:bg-muted tw:text-muted-foreground tw:border-border"}}function dJ(e){if(!e)return[];const t=[];return e.category&&e.category!=="All"&&t.push(e.category),e.brand&&t.push(e.brand),e.condition&&t.push(e.condition),e.merchant&&t.push(e.merchant),e.sort&&t.push(e.sort),e.availability==="IncludeOutOfStock"&&t.push("All items"),e.min_price&&t.push(`≥${mw(e.min_price)}`),e.max_price&&t.push(`≤${mw(e.max_price)}`),e.has_deal==="1"&&t.push("Deals"),e.min_saving_percent&&t.push(`${e.min_saving_percent}%+ off`),e.min_reviews_rating&&t.push(`${e.min_reviews_rating}★+`),e.page&&e.page>1&&t.push(`Page ${e.page}`),e.results&&e.results>0&&t.push(fa(e.results,"result","results")),t}function Nv(){return o.jsxs(Ar,{variant:"outline",className:"tw:bg-primary tw:text-primary-foreground tw:border-primary tw:gap-1",children:[o.jsx(cf,{className:"tw:size-3 tw:fill-current"}),o.jsx("span",{className:"tw:whitespace-nowrap",children:"Top Products"})]})}function fJ(){var z,B;const[e,t]=d.useState(null),[n,a]=d.useState(!0),[r,s]=d.useState(!1),[i,l]=d.useState(""),[c,u]=d.useState("all"),[m,f]=d.useState(null),[w,p]=d.useState(fw),[x,b]=d.useState("created"),[y,h]=d.useState("desc"),g=d.useRef(null),v=I=>{x===I?h(V=>V==="asc"?"desc":"asc"):(b(I),h("asc"))},S=d.useCallback(async()=>{try{const I=new FormData;I.append("action","psfa_cache_stats"),I.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||"");const D=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:I})).json();D.success&&t(D.data)}catch{}finally{a(!1)}},[]);d.useEffect(()=>{S()},[S]);const N=async()=>{var I,V;s(!0);try{const D=new FormData;D.append("action","psfa_clear_cache"),D.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||"");const O=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:D})).json();O.success?(_e.success(((I=O.data)==null?void 0:I.message)||"Cache cleared"),l(""),u("all"),await S()):_e.error(((V=O.data)==null?void 0:V.message)||"Failed to clear cache")}catch{_e.error("Failed to clear cache")}finally{s(!1)}},A=e?e.products+e.searches:0,j=d.useMemo(()=>{if(!(e!=null&&e.entries))return[];const I=e.entries.filter(D=>{var T,O,_,$,H,F;if(c!=="all"&&D.type!==c)return!1;if(i){const Q=i.toLowerCase();return D.label.toLowerCase().includes(Q)||D.key.toLowerCase().includes(Q)||((O=(T=D.meta)==null?void 0:T.keywords)==null?void 0:O.toLowerCase().includes(Q))||(($=(_=D.meta)==null?void 0:_.category)==null?void 0:$.toLowerCase().includes(Q))||((F=(H=D.meta)==null?void 0:H.brand)==null?void 0:F.toLowerCase().includes(Q))}return!0}),V=y==="asc"?1:-1;return I.sort((D,T)=>{switch(x){case"type":{const O=_=>{var $;return _.type==="top_pool"?"a":_.type==="product"?"b":(($=_.meta)==null?void 0:$.purpose)==="filter_options"?"c":"d"};return V*O(D).localeCompare(O(T))}case"entry":return V*D.label.localeCompare(T.label);case"created":return V*((D.created_at||0)-(T.created_at||0));case"expires":return V*(D.expires-T.expires);default:return 0}}),I},[e==null?void 0:e.entries,c,i,x,y]);d.useEffect(()=>{p(fw)},[c,i,x,y]);const C=d.useMemo(()=>j.slice(0,w),[j,w]),R=w<j.length;d.useEffect(()=>{const I=g.current;if(!I||!R)return;const V=new IntersectionObserver(D=>{D[0].isIntersecting&&p(T=>Math.min(T+fw,j.length))},{rootMargin:"200px"});return V.observe(I),()=>V.disconnect()},[R,j.length]);const M=({col:I})=>x!==I?o.jsx(CP,{className:"tw:size-3 tw:text-muted-foreground/50"}):y==="asc"?o.jsx(_P,{className:"tw:size-3 tw:text-muted-foreground"}):o.jsx(jP,{className:"tw:size-3 tw:text-muted-foreground"});return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-3 tw:gap-4",children:[o.jsx(Cv,{label:"Product Entries",value:(e==null?void 0:e.products)??0,sublabel:"24 hr TTL on the Managed API, 1 hr on own credentials",isLoading:n}),o.jsx(Cv,{label:"Search Entries",value:(e==null?void 0:e.searches)??0,sublabel:"30 min TTL",isLoading:n}),o.jsx(Cv,{label:"Total Cached",value:A,sublabel:A>0?"API calls saved":"No cached data",isLoading:n})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsxs(Ae,{onClick:N,disabled:r||A===0,children:[o.jsx(NN,{className:"tw:size-4"}),r?"Clearing...":"Clear All Cache"]}),o.jsxs(Ae,{variant:"outline",onClick:()=>{a(!0),S()},children:[o.jsx(YP,{className:"tw:size-4"}),"Refresh"]}),!n&&A===0&&o.jsx("span",{className:"tw:text-sm tw:text-muted-foreground",children:"Cache is empty. Entries will appear after visitors search on your site."})]}),!n&&A>0&&o.jsxs(It,{children:[o.jsx(Pc,{className:"tw:border-b tw:border-border",children:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-4",children:[o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2 tw:text-base tw:shrink-0",children:[o.jsx(yg,{className:"tw:size-5 tw:text-info"}),"Cached Entries",o.jsxs(Ar,{variant:"secondary",className:"tw:ml-1 tw:font-normal",children:[j.length,j.length!==A?` / ${A}`:""]})]}),o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-2",children:[o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-1 tw:bg-secondary tw:rounded-lg tw:p-0.5",children:[o.jsx(gN,{className:"tw:size-3.5 tw:text-muted-foreground tw:ml-2"}),["all","product","search","top_pool"].map(I=>o.jsx("button",{onClick:()=>u(I),className:`tw:px-2.5 tw:py-1 tw:text-xs tw:font-medium tw:rounded-md tw:transition-colors tw:border-none tw:cursor-pointer ${c===I?"tw:bg-card tw:text-foreground tw:shadow-sm":"tw:bg-transparent tw:text-muted-foreground tw:hover:text-foreground"}`,children:I==="all"?"All":I==="product"?"Products":I==="search"?"Searches":"Top Products"},I))]}),o.jsxs("div",{className:"tw:relative",children:[o.jsx(yc,{className:"tw:absolute tw:left-2.5 tw:top-1/2 tw:-translate-y-1/2 tw:size-3.5 tw:text-muted-foreground"}),o.jsx(pt,{placeholder:"Filter entries...",value:i,onChange:I=>l(I.target.value),className:"tw:pl-8 tw:h-8 tw:w-48 tw:text-sm"})]})]})]})}),o.jsxs(Yt,{className:"tw:p-0 tw:[&>div]:max-h-[480px] tw:[&>div]:overflow-y-auto tw:[&>div]:overflow-x-auto",children:[o.jsxs(qT,{className:"tw:table-fixed",children:[o.jsxs("colgroup",{children:[o.jsx("col",{className:"tw:w-40"}),o.jsx("col",{className:"tw:w-56"}),o.jsx("col",{}),o.jsx("col",{className:"tw:w-32"}),o.jsx("col",{className:"tw:w-30"}),o.jsx("col",{className:"tw:w-24"})]}),o.jsx(XT,{className:"tw:bg-muted tw:sticky tw:top-0 tw:z-10",children:o.jsxs(nu,{children:[o.jsx(is,{className:"tw:px-4",children:o.jsxs("button",{onClick:()=>v("type"),className:"tw:flex tw:items-center tw:gap-1 tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Type ",o.jsx(M,{col:"type"})]})}),o.jsx(is,{className:"tw:px-4",children:o.jsxs("button",{onClick:()=>v("entry"),className:"tw:flex tw:items-center tw:gap-1 tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Entry ",o.jsx(M,{col:"entry"})]})}),o.jsx(is,{className:"tw:px-4",children:"Info"}),o.jsx(is,{className:"tw:px-4",children:"Credentials"}),o.jsx(is,{className:"tw:px-4 tw:text-right",children:o.jsxs("button",{onClick:()=>v("created"),className:"tw:flex tw:items-center tw:gap-1 tw:ml-auto tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Created ",o.jsx(M,{col:"created"})]})}),o.jsx(is,{className:"tw:px-4 tw:text-right",children:o.jsxs("button",{onClick:()=>v("expires"),className:"tw:flex tw:items-center tw:gap-1 tw:ml-auto tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["TTL ",o.jsx(M,{col:"expires"})]})})]})}),o.jsx(WT,{children:j.length===0?o.jsx(nu,{children:o.jsx(Er,{colSpan:6,className:"tw:text-center tw:py-8 tw:text-muted-foreground",children:"No entries match your filter."})}):o.jsxs(o.Fragment,{children:[C.map((I,V)=>{var _,$,H,F,Q,X;const D=I.type==="top_pool",T=((_=I.meta)==null?void 0:_.purpose)==="filter_options",O=I.type==="search"&&(($=I.meta)==null?void 0:$.purpose)==="top_products";return o.jsxs(nu,{className:`tw:cursor-pointer ${T?"tw:opacity-60":""}`,onClick:()=>f(I),children:[o.jsx(Er,{className:"tw:px-4",children:D?o.jsx(Nv,{}):o.jsx(Ar,{variant:"outline",className:I.type==="product"?"tw:bg-info-soft tw:text-info tw:border-info/40":T?"tw:bg-muted tw:text-muted-foreground tw:border-border":"tw:bg-warning-soft tw:text-warning tw:border-warning/40",children:o.jsx("span",{className:"tw:whitespace-nowrap",children:I.type==="product"?"Product":T?"Filter data":"Search"})})}),o.jsx(Er,{className:"tw:px-4 tw:overflow-hidden tw:text-ellipsis tw:whitespace-nowrap tw:text-foreground",children:I.label}),o.jsx(Er,{className:"tw:px-4",children:I.type==="product"?o.jsxs("span",{className:"tw:text-xs tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono",children:I.key}),((H=I.meta)==null?void 0:H.price)&&o.jsx("span",{className:"tw:ml-1.5 tw:text-muted-foreground tw:font-sans",children:I.meta.price})]}):D?(F=I.meta)!=null&&F.results&&I.meta.results>0?o.jsx("span",{className:"tw:inline-flex tw:items-center tw:px-1.5 tw:py-0 tw:text-[10px] tw:font-medium tw:text-muted-foreground tw:bg-secondary tw:rounded",children:fa(I.meta.results,"product","products")}):null:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-1",children:[O&&o.jsx(Nv,{}),dJ(I.meta).map(P=>o.jsx("span",{className:"tw:inline-flex tw:items-center tw:px-1.5 tw:py-0 tw:text-[10px] tw:font-medium tw:text-muted-foreground tw:bg-secondary tw:rounded",children:P},P))]})}),o.jsx(Er,{className:"tw:px-4",children:o.jsx(Ar,{variant:"outline",className:VM((Q=I.meta)==null?void 0:Q.auth_type),children:o.jsx("span",{className:"tw:whitespace-nowrap",children:FM((X=I.meta)==null?void 0:X.auth_type)})})}),o.jsx(Er,{className:"tw:px-4 tw:text-right tw:text-xs tw:text-muted-foreground",children:I.created_at?o.jsx(Ui,{delayDuration:200,children:o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:o.jsx("span",{className:"tw:cursor-default",children:cJ(I.created_at)})}),o.jsx(Hi,{children:new Date(I.created_at*1e3).toLocaleString()})]})}):"-"}),o.jsx(Er,{className:"tw:px-4 tw:text-right",children:o.jsx("span",{className:`tw:whitespace-nowrap ${I.expires<=0?"tw:text-destructive":I.expires<300?"tw:text-warning":"tw:text-success"}`,children:HM(I.expires)})})]},`${I.type}-${I.key}-${V}`)}),R&&o.jsx(nu,{ref:g,children:o.jsx(Er,{colSpan:6,className:"tw:text-center tw:py-3 tw:text-xs tw:text-muted-foreground",children:"Loading more..."})})]})})]}),j.length>fw&&o.jsxs("div",{className:"tw:px-4 tw:py-2 tw:border-t tw:border-border tw:text-xs tw:text-muted-foreground",children:["Showing ",Math.min(w,j.length)," of ",fa(j.length,"entry","entries")]})]})]}),o.jsx(Qf,{open:!!m,onOpenChange:I=>!I&&f(null),children:o.jsxs(Jf,{className:"tw:sm:max-w-md",children:[o.jsx(Dx,{children:o.jsxs(Hc,{className:"tw:flex tw:items-center tw:gap-2",children:[(m==null?void 0:m.type)==="top_pool"?o.jsx(Nv,{}):o.jsx(Ar,{variant:"outline",className:(m==null?void 0:m.type)==="product"?"tw:bg-info-soft tw:text-info tw:border-info/40":"tw:bg-warning-soft tw:text-warning tw:border-warning/40",children:(m==null?void 0:m.type)==="product"?"Product":"Search"}),"Cache Entry Details"]})}),m&&o.jsxs("div",{className:"tw:space-y-4",children:[m.type==="product"?o.jsx(mJ,{entry:m}):m.type==="top_pool"?o.jsx(pJ,{entry:m}):o.jsx(wJ,{entry:m}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:text-sm tw:pt-3 tw:border-t tw:border-border",children:[o.jsx(yg,{className:"tw:size-3.5 tw:text-muted-foreground"}),o.jsx("span",{className:"tw:text-muted-foreground",children:"Fetched via:"}),o.jsx(Ar,{variant:"outline",className:VM((z=m.meta)==null?void 0:z.auth_type),children:FM((B=m.meta)==null?void 0:B.auth_type)})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:text-sm",children:[o.jsx(DP,{className:"tw:size-3.5 tw:text-muted-foreground"}),o.jsx("span",{className:"tw:text-muted-foreground",children:"Expires in:"}),o.jsx("span",{className:m.expires<=0?"tw:font-medium tw:text-destructive":m.expires<300?"tw:font-medium tw:text-warning":"tw:font-medium tw:text-success",children:HM(m.expires)})]})]})]})}),o.jsxs(It,{children:[o.jsx(Pc,{className:"tw:border-b tw:border-border",children:o.jsx(zc,{className:"tw:text-base",children:"How Caching Works"})}),o.jsx(Yt,{className:"tw:pt-4",children:o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-6 tw:text-sm tw:text-muted-foreground",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Search Cache (30 min)"}),o.jsx("p",{className:"tw:m-0",children:"When a visitor searches, the full API response is cached. Identical searches within 30 minutes are served instantly without hitting Amazon's API."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Product Cache (24 hours or 1 hour)"}),o.jsx("p",{className:"tw:m-0",children:"Product data is cached per ASIN and shared by product boxes and comparison tables, so the same product is only fetched once. Products fetched through the Managed API stay cached for 24 hours, because every uncached lookup counts toward your Managed API quota. With your own Amazon credentials they stay cached for 1 hour."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Auto-Invalidation"}),o.jsx("p",{className:"tw:m-0",children:"Search cache is automatically cleared when you change your Marketplace or Associate Tag, ensuring results match your current settings."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Manual Clear"}),o.jsx("p",{className:"tw:m-0",children:'Use the "Clear All Cache" button above to force fresh data from Amazon. Useful after updating product listings or troubleshooting.'})]})]})})]})]})}function mJ({entry:e}){const{meta:t}=e;return o.jsxs("div",{className:"tw:space-y-3",children:[(t==null?void 0:t.image)&&o.jsx("div",{className:"tw:flex tw:justify-center tw:py-2",children:o.jsx("img",{src:t.image,alt:t.title||"",className:"tw:h-24 tw:w-auto tw:object-contain tw:rounded"})}),o.jsx(kr,{icon:o.jsx(hN,{className:"tw:size-3.5"}),label:"Title",value:(t==null?void 0:t.title)||e.label}),o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"ASIN",value:(t==null?void 0:t.asin)||e.key,mono:!0}),(t==null?void 0:t.price)&&o.jsx(kr,{icon:o.jsx(XP,{className:"tw:size-3.5"}),label:"Price",value:t.price})]})}function wJ({entry:e}){const{meta:t}=e,n=[];return t!=null&&t.category&&t.category!=="All"&&n.push({label:"Category",value:t.category}),t!=null&&t.brand&&n.push({label:"Brand",value:t.brand}),t!=null&&t.sort&&n.push({label:"Sort",value:t.sort}),t!=null&&t.condition&&n.push({label:"Condition",value:t.condition}),t!=null&&t.merchant&&n.push({label:"Merchant",value:t.merchant}),t!=null&&t.availability&&n.push({label:"Availability",value:t.availability==="IncludeOutOfStock"?"All items":t.availability}),t!=null&&t.min_price&&n.push({label:"Min Price",value:mw(t.min_price)}),t!=null&&t.max_price&&n.push({label:"Max Price",value:mw(t.max_price)}),(t==null?void 0:t.has_deal)==="1"&&n.push({label:"Has Deal",value:"Yes"}),t!=null&&t.min_saving_percent&&n.push({label:"Min Discount",value:`${t.min_saving_percent}%+`}),t!=null&&t.min_reviews_rating&&n.push({label:"Min Rating",value:`${t.min_reviews_rating}+ stars`}),t!=null&&t.page&&t.page>1&&n.push({label:"Page",value:String(t.page)}),o.jsxs("div",{className:"tw:space-y-3",children:[(t==null?void 0:t.purpose)==="filter_options"&&o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:px-3 tw:py-2 tw:bg-muted tw:rounded-md tw:text-xs tw:text-muted-foreground",children:[o.jsx(gN,{className:"tw:size-3"}),"Unfiltered pass - used to populate the brands dropdown and filter options."]}),o.jsx(kr,{icon:o.jsx(yc,{className:"tw:size-3.5"}),label:"Keywords",value:(t==null?void 0:t.keywords)||"Unknown"}),(t==null?void 0:t.results)!==void 0&&t.results>0&&o.jsx(kr,{icon:o.jsx(Zo,{className:"tw:size-3.5"}),label:"Results",value:fa(t.results,"product","products")}),n.length>0&&o.jsxs("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:font-medium tw:text-muted-foreground tw:mb-2",children:[o.jsx(jN,{className:"tw:size-3"}),"Search Parameters"]}),o.jsx("div",{className:"tw:grid tw:grid-cols-2 tw:gap-x-4 tw:gap-y-1.5",children:n.map(a=>o.jsxs("div",{className:"tw:text-xs",children:[o.jsxs("span",{className:"tw:text-muted-foreground",children:[a.label,": "]}),o.jsx("span",{className:"tw:text-foreground",children:a.value})]},a.label))})]}),o.jsx("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"Cache Key",value:e.key,mono:!0})})]})}function pJ({entry:e}){var a,r,s;const{meta:t}=e,n=[];return(a=t==null?void 0:t.filters)!=null&&a.brand&&n.push({label:"Brand",value:t.filters.brand}),((r=t==null?void 0:t.filters)==null?void 0:r.has_deal)==="1"&&n.push({label:"Has Deal",value:"Yes"}),(s=t==null?void 0:t.filters)!=null&&s.min_saving_percent&&n.push({label:"Min Discount",value:`${t.filters.min_saving_percent}%+`}),o.jsxs("div",{className:"tw:space-y-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:px-3 tw:py-2 tw:bg-info-soft tw:rounded-md tw:text-xs tw:text-muted-foreground",children:[o.jsx(cf,{className:"tw:size-3 tw:text-info"}),"Top-products pool - the pre-built set of products surfaced by the top-products mechanism."]}),o.jsx(kr,{icon:o.jsx(hN,{className:"tw:size-3.5"}),label:"Pool",value:e.label}),(t==null?void 0:t.results)!==void 0&&t.results>0&&o.jsx(kr,{icon:o.jsx(Zo,{className:"tw:size-3.5"}),label:"Results",value:fa(t.results,"product","products")}),n.length>0&&o.jsxs("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:font-medium tw:text-muted-foreground tw:mb-2",children:[o.jsx(jN,{className:"tw:size-3"}),"Pool Filters"]}),o.jsx("div",{className:"tw:grid tw:grid-cols-2 tw:gap-x-4 tw:gap-y-1.5",children:n.map(i=>o.jsxs("div",{className:"tw:text-xs",children:[o.jsxs("span",{className:"tw:text-muted-foreground",children:[i.label,": "]}),o.jsx("span",{className:"tw:text-foreground",children:i.value})]},i.label))})]}),o.jsx("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"Cache Key",value:e.key,mono:!0})})]})}function kr({icon:e,label:t,value:n,mono:a}){return o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2 tw:text-sm",children:[o.jsx("span",{className:"tw:text-muted-foreground tw:mt-0.5 tw:shrink-0",children:e}),o.jsx("span",{className:"tw:text-muted-foreground tw:shrink-0 tw:w-20",children:t}),o.jsx("span",{className:`tw:text-foreground tw:break-all ${a?"tw:font-mono tw:text-xs tw:mt-0.5":""}`,children:n})]})}function Cv({label:e,value:t,sublabel:n,isLoading:a}){return o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsx("p",{className:"tw:text-sm tw:font-medium tw:text-muted-foreground tw:m-0",children:e}),o.jsx("p",{className:"tw:text-3xl tw:font-semibold tw:text-foreground tw:m-0 tw:mt-1",children:a?"-":t}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-1",children:n})]})})}[{key:"appearance",label:"Appearance",hint:"Colors, style, font, button text, badges and product text.",route:se.appearance},{key:"search_display",label:"Search display",hint:"Grid or list, filters, banner and top products.",route:se.searchSettings},{key:"geo",label:"Geotargeting",hint:"On or off, where visitors land and your tracking ID for each store.",route:se.geotargeting}].map(e=>e.key);function hJ(){const e=typeof window<"u"?window.psfaAdmin:void 0;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/#plans"}}function gJ(){const{upgradeUrl:e}=hJ();return o.jsx(xJ,{upgradeUrl:e})}function xJ({upgradeUrl:e}){return o.jsxs("div",{"data-testid":"settings-transfer-premium-prompt",className:"tw:max-w-2xl tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h2",{className:"tw:m-0 tw:mb-2 tw:text-base tw:font-semibold tw:text-foreground",children:"Import and export comes with Premium"}),o.jsx("p",{className:"tw:m-0 tw:mb-3 tw:text-sm tw:text-muted-foreground",children:"Set up one site, then copy its settings to the next one in a few clicks."}),o.jsxs("ul",{className:"tw:m-0 tw:mb-4 tw:list-disc tw:space-y-1 tw:pl-5 tw:text-sm tw:text-muted-foreground",children:[o.jsx("li",{children:"Export Appearance, Search display and Geotargeting to one file"}),o.jsx("li",{children:"See every change before you import"}),o.jsx("li",{children:"Amazon credentials never leave the site"})]}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:rounded-md tw:bg-primary tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:text-primary-foreground tw:no-underline tw:transition-opacity tw:hover:opacity-90",children:"Get import and export with Premium"})]})}const bJ=220;function vJ(e){return e instanceof HTMLElement?e.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(e.tagName):!1}function yJ(){return o.jsx(NF,{children:o.jsx(SJ,{})})}function SJ(){const e=jn(),t=pi(),n=Tb(YF),a=fV(),[r,s]=d.useState(!1),[i,l]=d.useState(!1),[c,u]=d.useState(!1),m=d.useRef(null),f=d.useRef(void 0),w=d.useRef(!0),p=!!Nt().isPremium,x=nV(e.pathname),{toggleSidebar:b,latest:y}=a,h=d.useCallback((A=!1)=>{const j=y.current.sidebarCollapsed;b(),window.clearTimeout(f.current),j&&!A?(l(!0),f.current=window.setTimeout(()=>l(!1),bJ)):l(!1)},[b,y]);d.useEffect(()=>()=>window.clearTimeout(f.current),[]),d.useEffect(()=>{const A=j=>{!(j.ctrlKey||j.metaKey)||j.shiftKey||j.altKey||j.key!=="b"&&j.key!=="B"||n||vJ(j.target)||(j.preventDefault(),h(!0))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[n,h]),d.useEffect(()=>{n||s(!1)},[n]),d.useLayoutEffect(()=>{if(w.current){w.current=!1;return}if(s(!1),document.documentElement.scrollTop=0,document.body.scrollTop=0,document.activeElement instanceof HTMLElement&&document.activeElement.dataset.stepHeading==="true")return;const A=document.querySelector("[data-page-title]");A==null||A.focus({preventScroll:!0})},[e.pathname]);const g=d.useCallback(A=>{m.current=A??null,u(!0)},[]),v=d.useCallback(()=>u(!1),[]),S=d.useCallback(()=>m.current,[]);d.useEffect(()=>{const A=new URLSearchParams(e.search);if(A.get(TR)!=="1")return;A.delete(TR);const j=A.toString();g(null),t({pathname:e.pathname,search:j?`?${j}`:""},{replace:!0})},[e.pathname,e.search,t,g]);const N=d.useMemo(()=>({isPhone:n,isPremium:p,theme:a.theme,setTheme:a.setTheme,collapsed:a.sidebarCollapsed,toggleCollapsed:h,expanding:i,sheetOpen:r,setSheetOpen:s,whatsNewOpen:c,openWhatsNew:g,closeWhatsNew:v,whatsNewReturnFocus:S}),[n,p,a.theme,a.setTheme,a.sidebarCollapsed,h,i,r,c,g,v,S]);return o.jsx(NR.Provider,{value:N,children:o.jsxs("div",{"data-testid":"psfa-shell",className:"psfa-shell tw:flex tw:min-h-full tw:w-full tw:min-w-0 tw:flex-1 tw:bg-background tw:font-rubik tw:text-foreground tw:antialiased",children:[n?null:o.jsx(cV,{}),o.jsxs("main",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col",children:[n?o.jsx(ZF,{title:x==null?void 0:x.title}):null,o.jsxs("div",{className:"tw:mx-auto tw:w-full tw:max-w-[1200px] tw:px-4 tw:pt-6 tw:pb-24 tw:min-[1100px]:px-8 tw:min-[1100px]:pt-7",children:[o.jsx(WF,{}),o.jsx(HF,{}),x?o.jsx(fu,{title:x.title,description:x.description}):null,x!=null&&x.tabs?o.jsx(QF,{...x.tabs}):null,o.jsx(kO,{})]})]}),n?o.jsx(uV,{}):null,o.jsx(LF,{}),o.jsx(wV,{})]})})}function jJ(){const e=eV(window.location.search,window.location.hash);e&&(window.location.hash=e)}jJ();const NJ=[{path:"/",element:o.jsx(yJ,{}),children:[{index:!0,element:o.jsx(aG,{})},{path:"boxes",element:o.jsx(QY,{})},{path:"boxes/new",element:o.jsx(Pk,{})},{path:"boxes/:asin",element:o.jsx(Pk,{})},{path:"tables",element:o.jsx(cK,{})},{path:"lists",element:o.jsx(DK,{})},{path:"search",element:o.jsx(UK,{})},{path:"search/settings",element:o.jsx(YK,{})},{path:"appearance",element:o.jsx(dq,{})},{path:"analytics",element:o.jsx(fQ,{})},{path:"settings/connection",element:o.jsx($Q,{})},{path:"settings/geotargeting",element:o.jsx(lJ,{})},{path:"settings/cache",element:o.jsx(fJ,{})},{path:"settings/import-export",element:o.jsx(gJ,{})},...Object.entries(JF).map(([e,t])=>({path:e.slice(1),element:o.jsx(XF,{to:t})})),{path:"*",element:o.jsx(rN,{to:"/",replace:!0})}]}],CJ=aP(NJ);function AJ(){return o.jsx(Ui,{children:o.jsxs(sF,{children:[o.jsx(hP,{router:CJ}),o.jsx(rH,{})]})})}const GM=document.getElementById("psfa-admin-root");GM&&(w7(),H3.createRoot(GM).render(o.jsx(d.StrictMode,{children:o.jsx(AJ,{})})))})();495 `)}}):null},fQ=u.forwardRef(({active:e,payload:t,className:n,indicator:a="dot",hideLabel:r=!1,hideIndicator:s=!1,label:i,labelFormatter:l,labelClassName:c,formatter:d,color:m,nameKey:f,labelKey:w},p)=>{const{config:x}=RM(),b=u.useMemo(()=>{var N;if(r||!(t!=null&&t.length))return null;const[h]=t,g=`${w||(h==null?void 0:h.dataKey)||(h==null?void 0:h.name)||"value"}`,v=yv(x,h,g),S=!w&&typeof i=="string"?((N=x[i])==null?void 0:N.label)||i:v==null?void 0:v.label;return l?o.jsx("div",{className:E("tw:font-medium",c),children:l(S,t)}):S?o.jsx("div",{className:E("tw:font-medium",c),children:S}):null},[i,l,t,r,c,x,w]);if(!e||!(t!=null&&t.length))return null;const y=t.length===1&&a!=="dot";return o.jsxs("div",{ref:p,className:E("tw:grid tw:min-w-[8rem] tw:items-start tw:gap-1.5 tw:rounded-lg tw:border tw:border-border/50 tw:bg-background tw:px-2.5 tw:py-1.5 tw:text-xs tw:shadow-xl",n),children:[y?null:b,o.jsx("div",{className:"tw:grid tw:gap-1.5",children:t.filter(h=>h.type!=="none").map((h,g)=>{const v=`${f||h.name||h.dataKey||"value"}`,S=yv(x,h,v),N=m||h.payload.fill||h.color;return o.jsx("div",{className:E("tw:flex tw:w-full tw:flex-wrap tw:items-stretch tw:gap-2 tw:[&>svg]:h-2.5 tw:[&>svg]:w-2.5 tw:[&>svg]:text-muted-foreground",a==="dot"&&"tw:items-center"),children:d&&(h==null?void 0:h.value)!==void 0&&h.name?d(h.value,h.name,h,g,h.payload):o.jsxs(o.Fragment,{children:[S!=null&&S.icon?o.jsx(S.icon,{}):!s&&o.jsx("div",{className:E("tw:shrink-0 tw:rounded-[2px] tw:border-[--color-border] tw:bg-[--color-bg]",{"tw:h-2.5 tw:w-2.5":a==="dot","tw:w-1":a==="line","tw:w-0 tw:border-[1.5px] tw:border-dashed tw:bg-transparent":a==="dashed","tw:my-0.5":y&&a==="dashed"}),style:{"--color-bg":N,"--color-border":N}}),o.jsxs("div",{className:E("tw:flex tw:flex-1 tw:justify-between tw:leading-none",y?"tw:items-end":"tw:items-center"),children:[o.jsxs("div",{className:"tw:grid tw:gap-1.5",children:[y?b:null,o.jsx("span",{className:"tw:text-muted-foreground",children:(S==null?void 0:S.label)||h.name})]}),h.value&&o.jsx("span",{className:"tw:font-mono tw:font-medium tw:tabular-nums tw:text-foreground",children:h.value.toLocaleString()})]})]})},h.dataKey)})})]})});fQ.displayName="ChartTooltip";const mQ=u.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:a="bottom",nameKey:r},s)=>{const{config:i}=RM();return n!=null&&n.length?o.jsx("div",{ref:s,className:E("tw:flex tw:items-center tw:justify-center tw:gap-4",a==="top"?"tw:pb-3":"tw:pt-3",e),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${r||l.dataKey||"value"}`,d=yv(i,l,c);return o.jsxs("div",{className:E("tw:flex tw:items-center tw:gap-1.5 tw:[&>svg]:h-3 tw:[&>svg]:w-3 tw:[&>svg]:text-muted-foreground"),children:[d!=null&&d.icon&&!t?o.jsx(d.icon,{}):o.jsx("div",{className:"tw:h-2 tw:w-2 tw:shrink-0 tw:rounded-[2px]",style:{backgroundColor:l.color}}),d==null?void 0:d.label]},l.value)})}):null});mQ.displayName="ChartLegend";function yv(e,t,n){if(typeof t!="object"||t===null)return;const a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let r=n;return n in t&&typeof t[n]=="string"?r=t[n]:a&&n in a&&typeof a[n]=="string"&&(r=a[n]),r in e?e[r]:e[n]}function wQ(){return typeof psfaAdmin<"u"&&psfaAdmin.isPremium,o.jsx(pQ,{})}function pQ(){const e=typeof psfaAdmin<"u"&&psfaAdmin.upgradeUrl?psfaAdmin.upgradeUrl:"https://paapiplugin.com/pricing/";return o.jsxs("div",{"data-testid":"analytics-premium-prompt",className:"tw:max-w-2xl tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h2",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Analytics comes with Premium"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-3",children:"See what your visitors search for, which products they click and which filters they use."}),o.jsxs("ul",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4 tw:pl-5 tw:list-disc tw:space-y-1",children:[o.jsx("li",{children:"Searches, clicks and product impressions"}),o.jsx("li",{children:"Clicks and views on your product boxes and comparison tables"}),o.jsx("li",{children:"Each box's clicks for the last 7 days, right in your box list"}),o.jsx("li",{children:"Charts for any date range"}),o.jsx("li",{children:"Top products and top search terms"}),o.jsx("li",{children:"Export to CSV or JSON"})]}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Upgrade to Premium"})]})}function kM(e){return e?"•".repeat(24)+(e.length>=16?e.slice(-4):""):""}function MM(e,t,n){return e.trim()!==""||t&&!n}function yu(e){return e.trim()===""?void 0:e}function DM(e,t){const n=yu(t);return n===void 0?{}:{[e]:n}}function hQ(e,t){const n={secretKeySaved:e.secretKeySaved,secretKeyMasked:e.secretKeyMasked,secretKeyUnreadable:e.secretKeyUnreadable,oauthClientSecretSaved:e.oauthClientSecretSaved,oauthClientSecretMasked:e.oauthClientSecretMasked,oauthClientSecretUnreadable:e.oauthClientSecretUnreadable};if(yu(e.secretKey)!==void 0&&(n.secretKeySaved=!0,n.secretKeyMasked=kM(e.secretKey.trim()),n.secretKeyUnreadable=!1),yu(e.oauthClientSecret)!==void 0&&(n.oauthClientSecretSaved=!0,n.oauthClientSecretMasked=kM(e.oauthClientSecret.trim()),n.oauthClientSecretUnreadable=!1),t&&typeof t=="object"){const a=t;for(const r of Object.keys(n)){const s=a[r];typeof s==typeof n[r]&&(n[r]=s)}}return n}function gQ(e){const[t,n]=u.useState(e),[a,r]=u.useState(!1),[s,i]=u.useState(!1),l=u.useCallback(m=>{n(f=>({...f,...m}))},[]),c=u.useCallback(async()=>{var m;r(!0);try{const f=await vo("psfa_save_credentials",{access_key:t.accessKey,...DM("secret_key",t.secretKey),associate_tag:t.associateTag,oauth_client_id:t.oauthClientId,...DM("oauth_client_secret",t.oauthClientSecret),oauth_credential_version:t.oauthCredentialVersion,oauth_auth_region:t.oauthAuthRegion,marketplace:t.marketplace});if(f.success){const w=(m=f.data)==null?void 0:m.admin_state,p=hQ(t,w==null?void 0:w.settings);n(x=>({...x,...p,secretKey:"",oauthClientSecret:""})),typeof window.psfaAdmin<"u"&&(window.psfaAdmin.settings={...window.psfaAdmin.settings,accessKey:t.accessKey,secretKey:"",associateTag:t.associateTag,oauthClientId:t.oauthClientId,oauthClientSecret:"",oauthCredentialVersion:t.oauthCredentialVersion,oauthAuthRegion:t.oauthAuthRegion,marketplace:t.marketplace,...p})}return{success:f.success,message:f.message||(f.success?"Settings saved successfully":"Failed to save settings")}}catch(f){return{success:!1,message:f instanceof Error?f.message:"Unknown error"}}finally{r(!1)}},[t]),d=u.useCallback(async()=>{var m,f;i(!0);try{const w=t.authType==="oauth"?{auth_type:"oauth",client_id:t.oauthClientId,client_secret:yu(t.oauthClientSecret),credential_version:t.oauthCredentialVersion,auth_region:t.oauthAuthRegion,marketplace:t.marketplace,associate_tag:t.associateTag}:{auth_type:"awssig4",access_key:t.accessKey,secret_key:yu(t.secretKey),associate_tag:t.associateTag},p=await kb("psfa_test_connection",w,!0),x=((m=p.data)==null?void 0:m.message)||p.message||"Connection test completed",b=(f=p.data)==null?void 0:f.diagnostic;return{success:p.success,message:x,...b?{diagnostic:b}:{}}}catch(w){return{success:!1,message:w instanceof Error?w.message:"Connection error"}}finally{i(!1)}},[t]);return{settings:t,updateSettings:l,saveSettings:c,testConnection:d,isSaving:a,isTesting:s}}const xQ=new Intl.NumberFormat("en-US"),bQ=new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:"UTC"});function vQ(e){if(!e)return null;const t=Date.parse(e);return Number.isFinite(t)?bQ.format(new Date(t)):null}const yQ=24*60*60*1e3;function SQ(){var n;const e=(n=window.psfaAdmin)==null?void 0:n.settings,t=e==null?void 0:e.managedApiLastKnownTier;return typeof t=="string"?t:void 0}function jQ(e){if(!e)return!0;const t=Date.parse(e);return!Number.isFinite(t)||t-Date.now()<=yQ}function xs({value:e}){return o.jsx("span",{className:"tw:font-medium tw:tabular-nums",children:xQ.format(e)})}function NQ({resetDate:e}){return o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground","data-testid":"managed-pool-warning",children:["When the pool is used up, product search, product boxes and comparison tables stop showing new results on every site on this license until the pool resets",e?` on ${e}`:"",". Results a site already loaded can keep showing until they expire: up to 24 hours in product boxes and comparison tables, and up to 30 minutes in search results."]})}function CQ({used:e,cap:t,exhausted:n,label:a}){const r=Math.max(0,Math.min(e,t)),s=t>0?r/t*100:0;return o.jsx("div",{role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":r,className:"tw:h-2 tw:overflow-hidden tw:rounded tw:bg-secondary",children:o.jsx("div",{className:E("tw:h-full tw:rounded",n?"tw:bg-destructive":"tw:bg-ring"),style:{width:`${s}%`}})})}function AQ({usage:e,tier:t}){if(e.loading)return o.jsx("div",{className:"tw:text-sm tw:text-muted-foreground",children:"Loading usage..."});const n=e.scope==="pool",a=!n&&(t??SQ())==="free",r=a&&jQ(e.resetsAt),s=n?"Shared Agency pool":r?"Today":a?"This month":"Usage this month",i=a&&r&&typeof e.usedMonth=="number"&&typeof e.capMonth=="number",l=vQ(e.resetsAt),c=typeof e.used=="number"&&typeof e.cap=="number",d=o.jsxs("div",{className:"tw:grid tw:grid-cols-2 tw:gap-2 tw:text-xs tw:text-muted-foreground",children:[o.jsxs("div",{children:["Success rate:"," ",typeof e.successRatePct=="number"?`${e.successRatePct.toFixed(0)}%`:"-"]}),o.jsxs("div",{children:["Avg latency: ",typeof e.avgLatencyMs=="number"?`${e.avgLatencyMs}ms`:"-"]})]});if(!c)return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2","data-testid":"managed-usage-panel",children:[o.jsx("div",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:s}),e.pending?o.jsx("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:"Usage appears after this site's next search."}):o.jsx("div",{className:"tw:text-sm tw:text-foreground",children:"-"})]});const m=e.used,f=e.cap,w=typeof e.remaining=="number"?Math.max(0,e.remaining):Math.max(0,f-m),p=!!e.quotaExhausted||w<=0,x=n?" across all sites on your license":"";return o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-2","data-testid":"managed-usage-panel",children:[o.jsx("div",{className:"tw:text-sm tw:font-medium tw:text-foreground",children:s}),o.jsx(CQ,{used:m,cap:f,exhausted:p,label:s}),p?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-destructive",children:[o.jsx(xs,{value:m})," of ",o.jsx(xs,{value:f})," searches and product lookups used",x,".",n?" None left.":` None left until ${l?`the reset on ${l}`:"the monthly reset"}.`]}),n&&o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-destructive",children:["Product search, product boxes and comparison tables are not showing new results on any site on this license until the pool resets",l?` on ${l}`:"","."]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground",children:[o.jsx(xs,{value:m})," of ",o.jsx(xs,{value:f})," searches and product lookups used",x,"."," ",o.jsx(xs,{value:w})," left.",l&&!r?` Resets ${l}.`:""]}),n&&o.jsx(NQ,{resetDate:l})]}),i&&o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-foreground","data-testid":"managed-usage-month",children:["This month: ",o.jsx(xs,{value:e.usedMonth})," of ",o.jsx(xs,{value:e.capMonth}),"."]}),d]})}const _Q=[{value:"us-east-1",label:"us-east-1 (US)"},{value:"us-west-2",label:"us-west-2"},{value:"eu-west-1",label:"eu-west-1 (Europe)"},{value:"ap-northeast-1",label:"ap-northeast-1 (Japan)"}],OM=[{value:"www.amazon.com",label:"www.amazon.com (US)"},{value:"www.amazon.co.uk",label:"www.amazon.co.uk (UK)"},{value:"www.amazon.de",label:"www.amazon.de (Germany)"},{value:"www.amazon.fr",label:"www.amazon.fr (France)"},{value:"www.amazon.it",label:"www.amazon.it (Italy)"},{value:"www.amazon.es",label:"www.amazon.es (Spain)"},{value:"www.amazon.ca",label:"www.amazon.ca (Canada)"},{value:"www.amazon.com.au",label:"www.amazon.com.au (Australia)"},{value:"www.amazon.co.jp",label:"www.amazon.co.jp (Japan)"},{value:"www.amazon.in",label:"www.amazon.in (India)"},{value:"www.amazon.se",label:"www.amazon.se (Sweden)"}],EQ=["www.amazon.com","www.amazon.co.uk","www.amazon.de","www.amazon.fr","www.amazon.it","www.amazon.es","www.amazon.ca","www.amazon.co.jp","www.amazon.com.au","www.amazon.in"],TQ=new Set(EQ);function PM(e){return TQ.has(e)}const RQ="-20",kQ=new Set(["www.amazon.com","www.amazon.ca"]);function MQ(e,t){return e.trim().toLowerCase().endsWith(RQ)?!kQ.has(t):!1}const DQ={auth:{title:"PaapiPlugin Managed API authorization expired.",body:"The key below is being rejected (invalid, revoked, or a deactivated account), so visitor searches, product boxes and comparison tables return no results. Remove these credentials and connect again, or switch the Active API to your own Amazon credentials.",variant:"destructive"},quota:{title:"PaapiPlugin Managed API quota exhausted.",body:"Visitor searches, product boxes and comparison tables return no results until the quota resets. Switch the Active API to your own Amazon credentials (Creators API or PA-API v5) to keep them working in the meantime.",variant:"destructive"},outage:{title:"Managed API temporarily unavailable.",body:"Visitor searches, product boxes and comparison tables return no results. Saved Creators API / PA-API v5 credentials are used as a fallback for the affected requests.",variant:"warning"}};function OQ(e){return{title:"PaapiPlugin Managed API shared pool used up.",body:"Product search, product boxes and comparison tables return no new results on every site on this license until the pool resets. Switch this site to your own Amazon credentials (Creators API) to keep its searches, boxes and tables working in the meantime.",variant:"destructive"}}function PQ(){var t;const e=(t=window.psfaAdmin)==null?void 0:t.managedApiNotice;return(e==null?void 0:e.scope)==="pool"?"pool":"site"}function zQ(){var n;const e=(n=window.psfaAdmin)==null?void 0:n.managedApiNotice,t=e==null?void 0:e.type;return t==="quota"||t==="auth"||t==="outage"?t:null}const LQ=["managed","creators","paapi"];function IQ(e){const t=e.includes("?")?e.slice(e.indexOf("?")+1):"",n=new URLSearchParams(t),a=n.get("tab"),r=n.get("store");return{tab:a&&LQ.includes(a)?a:null,store:r&&OM.some(s=>s.value===r)?r:null}}function $Q(){return typeof window>"u"?{tab:null,store:null}:IQ(window.location.hash||"")}function Sv(){const e=window.psfaAdmin,t=e==null?void 0:e.settings,n=(e==null?void 0:e.settings)??{};return{authType:(t==null?void 0:t.authType)||"oauth",accessKey:(t==null?void 0:t.accessKey)||"",secretKey:"",associateTag:(t==null?void 0:t.associateTag)||"",oauthClientId:(t==null?void 0:t.oauthClientId)||"",oauthClientSecret:"",oauthCredentialVersion:(t==null?void 0:t.oauthCredentialVersion)||"",oauthAuthRegion:(t==null?void 0:t.oauthAuthRegion)||"us-east-1",marketplace:(t==null?void 0:t.marketplace)||"www.amazon.com",secretKeySaved:!!n.secretKeySaved||!!n.secretKey,secretKeyMasked:typeof n.secretKeyMasked=="string"?n.secretKeyMasked:"",secretKeyUnreadable:!!n.secretKeyUnreadable,oauthClientSecretSaved:!!n.oauthClientSecretSaved||!!n.oauthClientSecret,oauthClientSecretMasked:typeof n.oauthClientSecretMasked=="string"?n.oauthClientSecretMasked:"",oauthClientSecretUnreadable:!!n.oauthClientSecretUnreadable}}const zM="https://paapiplugin.com/account/";function LM(){var t;const e=((t=window.psfaAdmin)==null?void 0:t.settings)||{};return{useManagedApi:!!e.useManagedApi,managedApiKeyMasked:e.managedApiKeyMasked||"",managedApiSignupEmail:e.managedApiSignupEmail||"",managedApiLastKnownTier:e.managedApiLastKnownTier||"unknown",managePlanUrl:e.managePlanUrl||zM}}function BQ(){var l;const e=((l=window.psfaAdmin)==null?void 0:l.settings)||{},t=e.oauthClientId||"",n=e.accessKey||"",a=e.authType||"",r=e.defaultTab||"managed",s=!!e.useManagedApi,i=e.managedApiKeyMasked||"";return s&&i||r==="managed"&&!t&&!n?"managed":t||a==="oauth"?"creators":n||a==="awssig4"?"paapi":"managed"}function rl(){typeof window<"u"&&typeof window.scrollTo=="function"&&window.scrollTo({top:0,left:0,behavior:"auto"})}function UQ(){const[e]=u.useState($Q),{settings:t,updateSettings:n,saveSettings:a,testConnection:r,isSaving:s,isTesting:i}=gQ(e.store?{...Sv(),marketplace:e.store}:Sv()),[l,c]=u.useState(()=>LM()),[d,m]=u.useState(()=>e.tab??BQ()),[f,w]=u.useState(null),[p,x]=u.useState(new Set),[b,y]=u.useState(()=>l.managedApiSignupEmail),[h,g]=u.useState(!1),[v,S]=u.useState(!1),[N,A]=u.useState(""),[j,C]=u.useState(!1),[R,M]=u.useState(!1),[z,B]=u.useState(!1),[I,V]=u.useState(null),[D,T]=u.useState(!1),[O,_]=u.useState(()=>{const oe=Sv();return{associateTag:oe.associateTag,marketplace:oe.marketplace}}),[$,H]=u.useState(!1),F=t.associateTag!==O.associateTag||t.marketplace!==O.marketplace,Q=MM(t.oauthClientSecret,t.oauthClientSecretSaved,t.oauthClientSecretUnreadable),X=MM(t.secretKey,t.secretKeySaved,t.secretKeyUnreadable),P=!!t.oauthClientId&&Q,G=!!t.accessKey&&X,ne=!!l.managedApiKeyMasked,Y=l.useManagedApi&&ne,Z=Y?"managed":t.authType==="oauth"&&P?"creators":G?"paapi":null,le=l.useManagedApi?"managed":t.authType==="oauth"?"creators":"paapi",he=Y||d==="managed",ae=he&&!PM(t.marketplace),K=MQ(t.associateTag,t.marketplace),ge=()=>{const oe=new Map;return d==="creators"?(t.oauthClientId.trim()||oe.set("oauthClientId","Credential ID"),Q||oe.set("oauthClientSecret","Credential Secret"),t.oauthCredentialVersion.trim()||oe.set("oauthCredentialVersion","Credential Version")):d==="paapi"&&(t.accessKey.trim()||oe.set("accessKey","Access Key ID"),X||oe.set("secretKey","Secret Access Key")),t.associateTag.trim()||oe.set("associateTag","Associate Tag"),x(new Set(oe.keys())),oe},Ce=(oe,ye)=>{n({[oe]:ye}),p.has(oe)&&x(we=>{const Ve=new Set(we);return Ve.delete(oe),Ve})},We=oe=>{m(oe),w(null)},Ke=async()=>{const oe=ge();if(oe.size>0){_e.error(`Please fill in: ${[...oe.values()].join(", ")}`);return}const ye=await a();ye.success?(He(),_({associateTag:t.associateTag,marketplace:t.marketplace}),_e.success("Credentials saved successfully"),rl()):_e.error(ye.message||"Failed to save credentials")},at=async()=>{var oe;if(!t.associateTag.trim()){x(new Set(["associateTag"])),_e.error("Please fill in: Associate Tag");return}H(!0);try{const ye={associateTag:t.associateTag,marketplace:t.marketplace},we=await vo("psfa_save_credentials",{associate_tag:ye.associateTag,marketplace:ye.marketplace});if(we!=null&&we.success){if(window.psfaAdmin&&window.psfaAdmin.settings){const Ve=window.psfaAdmin.settings;Ve.associateTag=ye.associateTag,Ve.marketplace=ye.marketplace}He(),_(ye),_e.success("Associate Tag and Marketplace saved"),rl()}else _e.error(((oe=we==null?void 0:we.data)==null?void 0:oe.message)||(we==null?void 0:we.message)||"Failed to save settings")}finally{H(!1)}},Kt=async()=>{var we,Ve;if(d==="managed"){B(!0),w(null);try{const ze=await qt("psfa_managed_api_test");ze.success?w({success:!0,message:((we=ze.data)==null?void 0:we.message)||"Managed API connection OK"}):w({success:!1,message:((Ve=ze.data)==null?void 0:Ve.message)||ze.message||"Managed API test failed"})}finally{B(!1)}return}const oe=ge();if(oe.size>0){_e.error(`Please fill in: ${[...oe.values()].join(", ")}`);return}w(null);const ye=await r();w(ye)},He=()=>{var ye;const oe=(ye=window.psfaAdmin)==null?void 0:ye.settings;oe&&(c(we=>({...we,useManagedApi:!!oe.useManagedApi})),(oe.authType==="oauth"||oe.authType==="awssig4")&&n({authType:oe.authType}))},qt=async(oe,ye={})=>{const we=window.psfaAdmin;if(!we)return{success:!1,message:"PSFA admin config not found"};const Ve=new FormData;Ve.append("action",oe),Ve.append("nonce",we.nonce);for(const[ze,Wt]of Object.entries(ye))Ve.append(ze,Wt);try{const ze=await fetch(we.ajaxUrl+"?action="+oe,{method:"POST",body:Ve,credentials:"same-origin"});try{return await ze.json()}catch{return{success:!1,message:`HTTP ${ze.status}`}}}catch(ze){return{success:!1,message:ze instanceof Error?ze.message:"Network error"}}},Cn=async()=>{var oe,ye,we,Ve,ze,Wt;if(!b.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)){_e.error("Please enter a valid email");return}if(!t.associateTag.trim()){_e.error("Associate Tag is required");return}if(v&&!ae){C(!0);try{const Ge=await vo("psfa_managed_api_signup",{email:b.trim(),associate_tag:t.associateTag.trim(),marketplace:t.marketplace,marketing_consent:h?"1":"0",consent_ts:h?new Date().toISOString():"",clickwrap_accepted:"1",...QR(N)});if(Ge!=null&&Ge.success){const Ea=((oe=Ge.data)==null?void 0:oe.api_key_masked)||((ye=Ge.data)==null?void 0:ye.apiKeyMasked)||"••••••••••••••••••••••••0000",pa=((we=Ge.data)==null?void 0:we.tier)||"free",Xn=((Ve=Ge.data)==null?void 0:Ve.active_path)==="managed";V($b((ze=Ge.data)==null?void 0:ze.active_path,t.authType)),c(Ta=>({...Ta,useManagedApi:Xn,managedApiKeyMasked:Ea,managedApiSignupEmail:b.trim(),managedApiLastKnownTier:pa})),_e.success("Your free API key is ready. Welcome to PaapiPlugin Managed API."),rl()}else _e.error(((Wt=Ge==null?void 0:Ge.data)==null?void 0:Wt.message)||(Ge==null?void 0:Ge.message)||"Could not get your API key")}finally{C(!1)}}},mt=async()=>{M(!0);try{if((await vo("psfa_managed_api_disconnect")).success){const ye=LM();c(ye),y(ye.managedApiSignupEmail),He(),_e.success("Managed API credentials removed"),rl()}else c(ye=>({...ye,useManagedApi:!1,managedApiKeyMasked:"",managedApiSignupEmail:"",managedApiLastKnownTier:"unknown"})),_e.message("Managed API credentials removed locally")}finally{M(!1)}},Xt=async oe=>{var Ve;const ye=oe==="oauth"?"Creators API":"PA-API v5";if(!window.confirm(`Remove your stored ${ye} credentials? This cannot be undone.`))return;const we=await vo("psfa_byoc_disconnect",{auth_type:oe,...oe==="oauth"?{clear_oauth_client_secret:"1"}:{clear_secret_key:"1"}});if(we!=null&&we.success){const ze=oe==="oauth"?{oauthClientId:"",oauthClientSecret:"",oauthCredentialVersion:"",oauthClientSecretSaved:!1,oauthClientSecretMasked:"",oauthClientSecretUnreadable:!1}:{accessKey:"",secretKey:"",secretKeySaved:!1,secretKeyMasked:"",secretKeyUnreadable:!1};n(ze),window.psfaAdmin&&window.psfaAdmin.settings&&Object.assign(window.psfaAdmin.settings,ze),He(),_e.success(`${ye} credentials removed`),rl()}else _e.error(((Ve=we==null?void 0:we.data)==null?void 0:Ve.message)||(we==null?void 0:we.message)||"Could not remove credentials")},an=async oe=>{var Ve,ze;const ye=oe;if(ye===le)return;const we=await vo("psfa_set_active_api",{path:ye});if(we!=null&&we.success){const Wt=$b((Ve=we.data)==null?void 0:Ve.active_path,t.authType);He(),V(Ge=>Ge===null?Ge:Wt),_e.success(`Now serving searches via ${Ib[Wt]}`),rl()}else _e.error(((ze=we==null?void 0:we.data)==null?void 0:ze.message)||(we==null?void 0:we.message)||"Could not change the active API")},wn=async()=>{T(!0);try{await an("managed")}finally{T(!1)}},qn=Z==="managed"?{connected:!0,label:"Connected · Managed API"}:Z==="creators"?{connected:!0,label:"Connected · Creators API"}:Z==="paapi"?{connected:!0,label:"Connected · PA-API v5"}:{connected:!1,label:"Not connected"};return o.jsx("div",{className:"tw:space-y-6",children:o.jsxs(It,{children:[o.jsxs(Pc,{className:"tw:border-b tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:flex-col tw:sm:flex-row tw:sm:items-center tw:sm:justify-between tw:gap-3",children:[o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(aJ,{}),"Amazon API Credentials"]}),o.jsx(WQ,{connected:qn.connected,label:qn.label})]}),o.jsx("p",{className:"tw:mt-1 tw:text-sm tw:text-muted-foreground tw:m-0",children:"Your Associate Tag is shared across all paths."})]}),o.jsxs(Yt,{className:"tw:pt-5",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-3 tw:gap-x-8 tw:gap-y-6",children:[o.jsx("div",{className:"tw:md:col-span-1 tw:md:border-r tw:md:border-border tw:md:pr-6",children:o.jsx(HQ,{value:le,onChange:an,managedConfigured:ne,creatorsConfigured:P,paapiConfigured:G})}),o.jsxs("div",{className:"tw:md:col-span-2",children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Manage credentials"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-1",children:"Add or update keys for each path. Use the selector on the left to choose which one serves searches."})]}),o.jsxs(wH,{value:d,onValueChange:We,children:[o.jsxs(GT,{className:"tw:grid tw:w-full tw:grid-cols-3 tw:h-auto",children:[o.jsx(ym,{value:"managed",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="managed"?"active":ne?"saved":"none"}),o.jsx("span",{className:"tw:truncate",children:"Managed API"})]})}),o.jsx(ym,{value:"creators",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="creators"?"active":P?"saved":"none"}),o.jsxs("span",{className:"tw:truncate",children:["Creators API",o.jsx("span",{className:"tw:sr-only",children:" (OAuth) · Recommended"})]})]})}),o.jsx(ym,{value:"paapi",className:"tw:py-2 tw:min-w-0",children:o.jsxs("span",{className:"tw:flex tw:items-center tw:justify-center tw:gap-1.5 tw:min-w-0",children:[o.jsx(jv,{state:Z==="paapi"?"active":G?"saved":"none"}),o.jsxs("span",{className:"tw:truncate",children:["PA-API v5",o.jsx("span",{className:"tw:sr-only",children:" · Advanced"})]})]})})]}),o.jsxs(Sm,{value:"managed",className:"tw:pt-5",children:[I!==null&&o.jsxs(ln,{variant:I==="managed"?"success":"warning",className:"tw:mb-5","data-testid":"managed-signup-confirmation",children:[I==="managed"?o.jsx(oJ,{}):o.jsx(dw,{}),I==="managed"?o.jsxs(o.Fragment,{children:[o.jsx(Va,{children:"Managed API is provisioned and serving your searches"}),o.jsx(Gn,{children:"Your Managed API key is ready, and every search on your site now runs on the Managed API."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Va,{children:"Managed API is provisioned, but it is not serving your searches"}),o.jsxs(Gn,{children:[o.jsxs("p",{className:"tw:m-0",children:["Your Managed API key is ready. Searches on your site still run on the"," ",Ib[I],", which was already set up, so signup left it in place. Switch when you want the Managed API to serve searches instead."]}),o.jsx(Ne,{className:"tw:mt-3",onClick:wn,disabled:D,children:D?"Switching...":"Switch to Managed now"})]})]})]}),o.jsx(FQ,{children:"The Condition, Merchant, and In Stock filters are hidden on the storefront when using the Managed API. Amazon's managed search data does not include per-item condition, seller, or stock information, so these filters cannot be applied. The Newest Arrivals and Featured sort options are also hidden on the Managed API: managed search data has no per-item date, and Featured matches the default Relevance order. All of these remain available when you connect your own Amazon credentials (Creators API or PA-API)."}),ne?o.jsx(GQ,{managed:l,onDisconnect:mt,isDisconnecting:R,hasOauthCreds:P,hasAwsCreds:G}):o.jsx(VQ,{email:b,onEmailChange:y,onConnect:Cn,isConnecting:j,marketingConsent:h,onMarketingConsentChange:g,clickwrapAccepted:v,onClickwrapAcceptedChange:S,heardFrom:N,onHeardFromChange:A,unsupportedStore:ae?t.marketplace:null})]}),o.jsx(Sm,{value:"creators",className:"tw:pt-5",children:o.jsx(qQ,{settings:t,invalidFields:p,onChange:Ce,hasOauthCreds:P,onRemoveCredentials:()=>Xt("oauth")})}),o.jsx(Sm,{value:"paapi",className:"tw:pt-5",children:o.jsx(XQ,{settings:t,invalidFields:p,onChange:Ce,hasAwsCreds:G,onRemoveCredentials:()=>Xt("awssig4")})})]})]})]}),o.jsxs("div",{className:"tw:mt-6 tw:pt-5 tw:border-t tw:border-border",children:[F&&o.jsxs("div",{role:"status",className:"tw:mb-3 tw:flex tw:items-center tw:gap-2 tw:flex-wrap",children:[o.jsx(Ar,{"data-testid":"shared-unsaved-badge",children:"Unsaved changes"}),o.jsx("span",{className:"tw:text-xs tw:text-muted-foreground",children:"Your Associate Tag / Marketplace edits are not saved yet."})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-associate-tag",className:"tw:mb-1.5 tw:block",children:"Associate Tag"}),o.jsx(pt,{id:"psfa-associate-tag",value:t.associateTag,onChange:oe=>Ce("associateTag",oe.target.value),placeholder:"your-associate-tag",autoComplete:"off","aria-invalid":p.has("associateTag")})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-marketplace",className:"tw:mb-1.5 tw:block",children:"Marketplace"}),o.jsxs(Vt,{value:t.marketplace,onValueChange:oe=>n({marketplace:oe}),children:[o.jsx(zt,{id:"psfa-marketplace",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:OM.map(oe=>{const ye=he&&!PM(oe.value);return o.jsx(Tt,{value:oe.value,disabled:ye,children:ye?`${oe.label} · not on the Managed API`:oe.label},oe.value)})})]})]})]}),ae&&o.jsxs(ln,{variant:Y?"destructive":"warning",className:"tw:mt-4","data-testid":"managed-marketplace-unsupported",children:[o.jsx(dw,{}),o.jsxs(Va,{children:[t.marketplace," is not available on the Managed API"]}),o.jsx(Gn,{children:Y?`The Managed API cannot serve ${t.marketplace}, so your searches are falling back to US products right now. To keep this marketplace, switch the Active API to the Creators API or PA-API v5 and save your own Amazon credentials. Otherwise choose one of the marketplaces the Managed API supports.`:Z?`Your searches run on the ${Ib[Z]}, which serves ${t.marketplace} correctly. The Managed API cannot: switching to it would return US products instead. Keep your own credentials for this marketplace.`:`The Managed API cannot serve ${t.marketplace}: a Managed key would return US products instead. Connect the Creators API or PA-API v5 to use this marketplace.`})]}),K&&o.jsxs(ln,{variant:"warning",className:"tw:mt-4","data-testid":"associate-tag-marketplace-mismatch",children:[o.jsx(dw,{}),o.jsx(Va,{children:"Your Associate Tag ends in -20, which is an Amazon.com / Amazon.ca tag"}),o.jsx(Gn,{children:`${t.marketplace} needs a tracking ID created in that marketplace's own Amazon Associates account. With a -20 tag, Amazon rejects the request with "Your credential is not linked to the partner tag in the request for the given Marketplace." Copy the tracking ID from your ${t.marketplace} Associates account and paste it above. If this tag really is the right one for your account, ignore this and save as usual.`})]}),d==="managed"&&o.jsxs("div",{className:"tw:mt-4 tw:flex tw:flex-col tw:gap-2",children:[o.jsx("div",{children:o.jsx(Ne,{onClick:at,disabled:$||!F,"data-testid":"save-shared-settings",children:$?"Saving...":"Save Associate Tag & Marketplace"})}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0",children:"The Managed API uses these two settings for every search. Your Managed API key is provisioned separately above."})]})]}),f&&o.jsx("div",{className:"tw:mt-5",children:o.jsx(QQ,{result:f})}),o.jsxs("div",{className:"tw:mt-5 tw:flex tw:gap-3 tw:flex-wrap",children:[d!=="managed"&&o.jsx(Ne,{onClick:Ke,disabled:s,children:s?"Saving...":"Save Credentials"}),(d!=="managed"||ne)&&o.jsx(Ne,{variant:"outline",onClick:Kt,disabled:i||z,children:i||z?"Testing...":"Test Connection"})]})]})]})})}function HQ({value:e,onChange:t,managedConfigured:n,creatorsConfigured:a,paapiConfigured:r}){const s=[{path:"managed",label:"Managed API",configured:n},{path:"creators",label:"Creators API",configured:a},{path:"paapi",label:"PA-API v5",configured:r}];return o.jsxs("div",{children:[o.jsxs("div",{className:"tw:mb-4",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0",children:"Active API"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mt-1",children:"The API that serves your searches."})]}),o.jsx(Zx,{value:e,onValueChange:t,className:"tw:grid tw:grid-cols-1 tw:gap-3",children:s.map(i=>{const l=`psfa-active-api-${i.path}`;return o.jsxs(Re,{htmlFor:l,className:E("tw:m-0 tw:block tw:rounded-md tw:border tw:p-3 tw:font-medium",e===i.path?"tw:border-ring tw:bg-info-soft":"tw:border-border",i.configured?"tw:cursor-pointer":"tw:cursor-not-allowed tw:opacity-70 tw:text-muted-foreground"),children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(ME,{id:l,value:i.path,disabled:!i.configured,className:"tw:sr-only"}),o.jsx("span",{children:i.label})]}),!i.configured&&o.jsx("span",{className:"tw:block tw:mt-1 tw:text-xs tw:text-muted-foreground",children:"Save credentials below first."})]},i.path)})})]})}function FQ({children:e}){const[t,n]=u.useState(!1);return o.jsx(Tx,{open:t,onOpenChange:n,className:"tw:mb-5",children:o.jsxs(ln,{variant:"info","data-testid":"managed-filters-note",children:[o.jsx(rJ,{}),o.jsxs(Va,{className:"tw:mb-0 tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-x-3 tw:gap-y-1 tw:leading-snug",children:[o.jsx("span",{children:"Some storefront filters are unavailable on the Managed API"}),o.jsx(Rx,{asChild:!0,children:o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",className:"tw:-my-1 tw:-mr-2 tw:h-auto tw:gap-1 tw:px-2 tw:py-1 tw:[&[data-state=open]>svg]:rotate-180",children:["Details",o.jsx(bc,{"aria-hidden":"true"})]})})]}),o.jsx(kx,{forceMount:!0,hidden:!t,className:"tw:pt-2",children:o.jsx(Gn,{children:e})})]})})}const IM="psfa-managed-signup-blocked";function VQ({email:e,onEmailChange:t,onConnect:n,isConnecting:a,marketingConsent:r,onMarketingConsentChange:s,clickwrapAccepted:i,onClickwrapAcceptedChange:l,heardFrom:c,onHeardFromChange:d,unsupportedStore:m=null}){const f=m?`The Managed API does not cover ${m.replace(/^www\./,"")}. Choose another marketplace below, or connect your own credentials on the Creators API tab.`:"";return o.jsxs("div",{className:"tw:space-y-5",children:[o.jsxs("div",{children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Managed API"})}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0",children:"Live Amazon product data for your boxes, tables and search. Free to start."})]}),o.jsxs("ul",{className:"tw:list-disc tw:pl-5 tw:space-y-1 tw:text-sm tw:text-foreground tw:m-0",children:[o.jsx("li",{children:"Get started in 30 seconds"}),o.jsx("li",{children:"20 searches and product lookups a day free"}),o.jsx("li",{children:"Products in boxes and tables refresh once a day, and each refresh is one lookup"}),o.jsx("li",{children:"No credit card"}),o.jsx("li",{children:"Your Amazon Associate tag, always"})]}),o.jsx(gG,{testId:"managed-clickwrap-card",children:o.jsxs("p",{className:"tw:m-0 tw:text-foreground",children:["By getting a key, you agree to the"," ",o.jsx("a",{href:"https://paapiplugin.com/api-terms/",target:"_blank",rel:"noopener",className:"tw:underline tw:text-link",children:"API Terms"}),". The plugin will send your search queries to paapiplugin.com infrastructure."," ",o.jsx("a",{href:"https://paapiplugin.com/privacy-policy/#managed-api",target:"_blank",rel:"noopener",className:"tw:underline tw:text-link",children:"Learn what we receive"}),"."]})}),o.jsxs("div",{className:"tw:max-w-md tw:space-y-2",children:[o.jsx(Re,{htmlFor:"psfa-managed-email",className:"tw:mb-1.5 tw:block",children:"Your email"}),o.jsx(pt,{id:"psfa-managed-email",type:"email",value:e,onChange:w=>t(w.target.value),placeholder:"you@example.com",autoComplete:"email"})]}),o.jsxs("div",{className:"tw:max-w-md tw:space-y-2",children:[o.jsx(Re,{htmlFor:"psfa-managed-heard-from",className:"tw:mb-1.5 tw:block",children:WR}),o.jsxs(Vt,{value:c,onValueChange:d,children:[o.jsx(zt,{id:"psfa-managed-heard-from",children:o.jsx(Gt,{placeholder:ZR})}),o.jsx(Lt,{children:o.jsx(Yf,{children:Bb.map(w=>o.jsx(Tt,{value:w.value,children:w.label},w.value))})})]})]}),o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2",children:[o.jsx(Uc,{id:"psfa-managed-clickwrap",checked:i,onCheckedChange:w=>l(w===!0),className:"tw:mt-0.5"}),o.jsx(Re,{htmlFor:"psfa-managed-clickwrap",className:"tw:m-0 tw:text-sm tw:font-normal tw:text-foreground tw:cursor-pointer",children:mu})]}),o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2 tw:max-w-md",children:[o.jsx(Uc,{id:"psfa-managed-marketing-consent",checked:r,onCheckedChange:w=>s(w===!0),className:"tw:mt-0.5"}),o.jsx(Re,{htmlFor:"psfa-managed-marketing-consent",className:"tw:m-0 tw:text-sm tw:font-normal tw:text-foreground tw:cursor-pointer",children:"Email me product tips & updates, plus 10% off my first Premium purchase (optional)"})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-x-3 tw:gap-y-2 tw:flex-wrap",children:[o.jsx(Ne,{onClick:n,disabled:a||!i||!!m,"aria-describedby":f?IM:void 0,children:a?"Getting your key...":"Get your free API key"}),f&&o.jsx("p",{id:IM,className:"tw:m-0 tw:text-sm tw:text-muted-foreground","data-testid":"managed-signup-blocked","aria-live":"polite",children:f})]})]})}function GQ({managed:e,onDisconnect:t,isDisconnecting:n,hasOauthCreds:a,hasAwsCreds:r}){var d;const s=zb(),i=zQ(),l=i?i==="quota"&&PQ()==="pool"?OQ():DQ[i]:null,c=s.scope==="pool";return o.jsxs("div",{className:"tw:space-y-5",children:[l&&o.jsxs(ln,{variant:l.variant,"data-testid":"managed-panel-state-alert",children:[o.jsx(dw,{}),o.jsx(Va,{children:l.title}),o.jsx(Gn,{children:l.body})]}),((d=s.tierDrift)==null?void 0:d.drift_detected)&&o.jsx(YQ,{tierDrift:s.tierDrift}),o.jsxs("div",{children:[o.jsx("div",{className:"tw:flex tw:items-center tw:gap-2 tw:mb-2",children:o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Managed API"})}),o.jsxs("dl",{className:"tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:gap-y-2 tw:text-sm tw:m-0",children:[o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"Account"}),o.jsx("dd",{className:"tw:text-foreground tw:m-0",children:e.managedApiSignupEmail||"-"}),o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"API Key"}),o.jsx("dd",{className:"tw:font-mono tw:text-xs tw:text-foreground tw:m-0",children:e.managedApiKeyMasked}),o.jsx("dt",{className:"tw:font-medium tw:text-foreground",children:"Tier"}),c?o.jsx("dd",{className:"tw:text-foreground tw:m-0",children:"Agency (shared pool)"}):o.jsx("dd",{className:"tw:text-foreground tw:m-0 tw:capitalize",children:e.managedApiLastKnownTier})]})]}),(a||r)&&o.jsxs("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0",children:["If the Managed API is briefly unavailable, the plugin falls back to your saved"," ",a&&r?"Creators API / PA-API v5 credentials":a?"Creators API credentials":"PA-API v5 credentials"," ","for that request."]}),o.jsx(av,{onCredentialsPage:!0}),o.jsx(AQ,{usage:s}),!1,o.jsxs("div",{className:"tw:flex tw:gap-3 tw:flex-wrap",children:[e.managedApiLastKnownTier==="premium"?o.jsx("a",{href:e.managePlanUrl,...e.managePlanUrl===zM?{target:"_blank",rel:"noopener"}:{},className:"tw:inline-flex tw:items-center tw:justify-center tw:whitespace-nowrap tw:rounded-md tw:border tw:border-border-strong tw:bg-card tw:text-foreground tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:no-underline tw:hover:bg-accent",children:"Manage plan"}):o.jsxs("a",{href:"https://paapiplugin.com/pricing/#plans",target:"_blank",rel:"noopener",className:"tw:inline-flex tw:items-center tw:gap-1.5 tw:text-left tw:leading-snug tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90",children:["Upgrade to Premium: 1,200 searches and product lookups a month, every category, auto-updating lists, geotargeting, styling and badges",o.jsx(vc,{"aria-hidden":"true",className:"tw:size-4 tw:shrink-0"})]}),o.jsx(Ne,{variant:"outline",onClick:t,disabled:n,children:n?"Removing...":"Remove credentials"})]})]})}function YQ({tierDrift:e}){const{plugin_tier:t,proxy_tier:n,recent_sync:a}=e,r=t==="premium"&&n==="free",s=t==="free"&&n==="premium";let i="info",l="",c=null;return a?(i="info",l="Tier sync in progress",c="Tier sync in progress - should complete shortly."):r?(i="warning",l="Tier sync needed",c=o.jsx("span",{children:"Your Freemius tier is premium but the managed-API proxy still shows free. Reload an admin page to trigger a sync, or wait up to one hour."})):s?(i="info",l="Downgrade pending",c=o.jsx("span",{children:"Your Freemius license is no longer paid; managed-API quota will downgrade at next sync."})):(i="info",l="Tier sync pending",c=o.jsxs("span",{children:["Plugin reports your Freemius tier as ",o.jsx("strong",{children:t})," but the managed-API proxy shows ",o.jsx("strong",{children:n}),". Reload an admin page to trigger a sync, or wait up to one hour."]})),o.jsxs(ln,{variant:i,"data-testid":"tier-drift-banner",children:[o.jsx(Va,{children:l}),o.jsx(Gn,{children:c})]})}const KQ="https://paapiplugin.com/psfa-documentation/#api-credentials";function $M(){return o.jsxs("p",{className:"tw:m-0 tw:text-sm tw:text-muted-foreground",children:["Need credentials? Follow the"," ",o.jsxs("a",{href:KQ,target:"_blank",rel:"noopener noreferrer",className:"tw:underline tw:text-link",children:["setup guide",o.jsx("span",{className:"tw:sr-only",children:" (opens in a new tab)"})]}),"."]})}const BM="psfa-oauth-secret-status",UM="psfa-secret-key-status";function HM({id:e,typed:t,saved:n,masked:a,unreadable:r}){if(!n&&!r)return null;const s=t.trim()!=="",i=a.replace(/^\u2022+/,"").slice(-4);let l;return s?l="Saving replaces the saved secret.":r?l="The saved secret could not be read. This happens when a site move changes the WordPress security keys. Enter it again and save.":i?l=o.jsxs(o.Fragment,{children:["Saved, ending in ",o.jsx("span",{className:"tw:font-mono tw:text-foreground",children:i}),". Leave this blank to keep it."]}):l="Saved. Leave this blank to keep it.",o.jsx("p",{id:e,"data-testid":e,className:E("tw:m-0 tw:mt-1.5 tw:text-sm",r&&!s?"tw:text-destructive":"tw:text-muted-foreground"),children:l})}function qQ({settings:e,invalidFields:t,onChange:n,hasOauthCreds:a,onRemoveCredentials:r}){return o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:flex-wrap",children:[o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"Creators API (OAuth 2.0)"}),(a||e.oauthClientSecretUnreadable)&&o.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:"Remove credentials"})]}),o.jsx($M,{}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-oauth-id",className:"tw:mb-1.5 tw:block",children:"Credential ID"}),o.jsx(pt,{id:"psfa-oauth-id",value:e.oauthClientId,onChange:s=>n("oauthClientId",s.target.value),placeholder:"Your credential_id from Creators API",autoComplete:"off","aria-invalid":t.has("oauthClientId")})]}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-oauth-secret",className:"tw:mb-1.5 tw:block",children:"Credential Secret"}),o.jsx(pt,{id:"psfa-oauth-secret",type:"password",value:e.oauthClientSecret,onChange:s=>n("oauthClientSecret",s.target.value),placeholder:e.oauthClientSecretSaved&&!e.oauthClientSecretUnreadable?"Enter a new secret to replace the saved one":"Your credential_secret",autoComplete:"new-password","aria-invalid":t.has("oauthClientSecret"),"aria-describedby":e.oauthClientSecretSaved||e.oauthClientSecretUnreadable?BM:void 0}),o.jsx(HM,{id:BM,typed:e.oauthClientSecret,saved:e.oauthClientSecretSaved,masked:e.oauthClientSecretMasked,unreadable:e.oauthClientSecretUnreadable})]}),o.jsxs("div",{className:"tw:grid tw:grid-cols-2 tw:gap-4",children:[o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-oauth-version",className:"tw:mb-1.5 tw:block",children:"Credential Version"}),o.jsx(pt,{id:"psfa-oauth-version",value:e.oauthCredentialVersion,onChange:s=>n("oauthCredentialVersion",s.target.value),placeholder:"e.g., 3.1 or 2.1",autoComplete:"off","aria-invalid":t.has("oauthCredentialVersion")})]}),o.jsxs("div",{children:[o.jsx(Re,{htmlFor:"psfa-oauth-region",className:"tw:mb-1.5 tw:block",children:"Auth Region"}),o.jsxs(Vt,{value:e.oauthAuthRegion,onValueChange:s=>n("oauthAuthRegion",s),children:[o.jsx(zt,{id:"psfa-oauth-region",children:o.jsx(Gt,{})}),o.jsx(Lt,{children:_Q.map(s=>o.jsx(Tt,{value:s.value,children:s.label},s.value))})]})]})]})]})}function XQ({settings:e,invalidFields:t,onChange:n,hasAwsCreds:a,onRemoveCredentials:r}){return o.jsxs("div",{className:"tw:space-y-4",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:flex-wrap",children:[o.jsx("h3",{className:"tw:text-lg tw:font-semibold tw:text-foreground tw:m-0",children:"PA-API v5 (AWS Signature V4)"}),(a||e.secretKeyUnreadable)&&o.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:"Remove credentials"})]}),o.jsx($M,{}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-access-key",className:"tw:mb-1.5 tw:block",children:"Access Key ID"}),o.jsx(pt,{id:"psfa-access-key",value:e.accessKey,onChange:s=>n("accessKey",s.target.value),placeholder:"Enter your Access Key ID",autoComplete:"off","aria-invalid":t.has("accessKey")})]}),o.jsxs("div",{className:"tw:max-w-md",children:[o.jsx(Re,{htmlFor:"psfa-secret-key",className:"tw:mb-1.5 tw:block",children:"Secret Access Key"}),o.jsx(pt,{id:"psfa-secret-key",type:"password",value:e.secretKey,onChange:s=>n("secretKey",s.target.value),placeholder:e.secretKeySaved&&!e.secretKeyUnreadable?"Enter a new key to replace the saved one":"Enter your Secret Access Key",autoComplete:"new-password","aria-invalid":t.has("secretKey"),"aria-describedby":e.secretKeySaved||e.secretKeyUnreadable?UM:void 0}),o.jsx(HM,{id:UM,typed:e.secretKey,saved:e.secretKeySaved,masked:e.secretKeyMasked,unreadable:e.secretKeyUnreadable})]})]})}function WQ({connected:e,label:t}){return o.jsxs("div",{className:E("tw:inline-flex tw:items-center tw:gap-2 tw:rounded-full tw:px-3 tw:py-1 tw:text-xs tw:font-medium",e?"tw:bg-success-soft tw:text-success tw:border tw:border-success/40":"tw:bg-muted tw:text-foreground tw:border tw:border-border"),children:[o.jsx(ZQ,{color:e?"green":"red"}),t]})}function ZQ({color:e}){return o.jsx("span",{"aria-hidden":"true",className:E("tw:inline-block tw:w-2 tw:h-2 tw:rounded-full",e==="green"?"tw:bg-success":"tw:bg-destructive")})}function jv({state:e}){return e==="none"?null:e==="active"?o.jsx("span",{"data-testid":"tab-indicator-active",title:"Active - this path serves your searches",className:"tw:inline-block tw:w-2 tw:h-2 tw:rounded-full tw:bg-success"}):o.jsxs("span",{"data-testid":"tab-indicator-saved",title:"Saved - credentials stored but not active","aria-label":"Saved",className:"tw:inline-flex tw:items-center tw:text-[10px] tw:font-medium tw:text-muted-foreground",children:[o.jsx("span",{"aria-hidden":"true",className:"tw:inline-block tw:w-2 tw:h-2 tw:rounded-full tw:border tw:border-border-strong"}),o.jsx("span",{className:"tw:sr-only",children:"Saved"})]})}function QQ({result:e}){return e.success?o.jsx(ln,{variant:"success",children:e.message}):e.diagnostic?o.jsx(nJ,{result:e,diagnostic:e.diagnostic}):o.jsx(ln,{variant:"destructive",children:e.message})}const JQ=[{key:"http_status",label:"HTTP status"},{key:"amazon_error_code",label:"Amazon error code"},{key:"amazon_error_description",label:"Amazon error description"},{key:"amazon_request_id",label:"Amazon request ID (x-amzn-RequestId)"},{key:"request_url",label:"Request URL"},{key:"credential_version",label:"Credential version"},{key:"auth_region",label:"Auth region"},{key:"marketplace",label:"Marketplace"},{key:"associate_tag_last4",label:"Associate tag (last 4)"},{key:"client_id",label:"Client ID"},{key:"client_secret_length",label:"Client secret length"},{key:"plugin_version",label:"Plugin version"},{key:"php_version",label:"PHP version"},{key:"wp_version",label:"WordPress version"},{key:"timestamp_utc",label:"Timestamp (UTC)"}];function eJ(e){return e==null?"(none)":typeof e=="boolean"?e?"true":"false":typeof e=="string"?e===""?"(empty)":e:typeof e=="number"?String(e):JSON.stringify(e)}function tJ(e){const t=[];t.push("### PaapiPlugin Test Connection diagnostic"),t.push(""),t.push("```");for(const[n,a]of Object.entries(e)){let r;a==null?r="(none)":typeof a=="boolean"?r=a?"true":"false":typeof a=="string"||typeof a=="number"?r=String(a):r=JSON.stringify(a),t.push(`${n}: ${r}`)}return t.push("```"),t.join(` 496 `)}function nJ({result:e,diagnostic:t}){const[n,a]=u.useState(!1),[r,s]=u.useState(!1),i=t.human_hint||e.message,l=async()=>{var d;const c=tJ(t);try{typeof navigator<"u"&&((d=navigator.clipboard)!=null&&d.writeText)?(await navigator.clipboard.writeText(c),s(!0),setTimeout(()=>s(!1),2e3),_e.success("Diagnostic copied to clipboard")):_e.error("Clipboard API not available")}catch{_e.error("Failed to copy diagnostic")}};return o.jsxs("div",{className:"tw:space-y-3","data-testid":"diagnostic-surface",children:[o.jsx(ln,{variant:"destructive",children:o.jsxs("div",{className:"tw:flex tw:flex-col tw:gap-1",children:[o.jsx("span",{className:"tw:font-medium",children:i}),t.hint_url&&o.jsx("a",{href:t.hint_url,target:"_blank",rel:"noopener noreferrer",className:"tw:text-xs tw:underline tw:text-destructive",children:"See Amazon documentation"})]})}),o.jsxs(Tx,{open:n,onOpenChange:a,children:[o.jsx(Rx,{asChild:!0,children:o.jsx(Ne,{variant:"outline",size:"sm","data-testid":"diagnostic-toggle",children:n?"Hide diagnostic details":"Show diagnostic details"})}),o.jsx(kx,{className:"tw:mt-3",children:o.jsx(It,{"data-testid":"diagnostic-card",children:o.jsxs(Yt,{className:"tw:p-4",children:[o.jsx("dl",{className:"tw:grid tw:grid-cols-1 tw:gap-2 tw:text-sm",children:JQ.map(({key:c,label:d})=>o.jsxs("div",{className:"tw:flex tw:flex-col tw:sm:flex-row tw:gap-1 tw:sm:gap-3",children:[o.jsx("dt",{className:"tw:font-medium tw:text-foreground tw:sm:w-56 tw:shrink-0",children:d}),o.jsx("dd",{className:"tw:font-mono tw:text-xs tw:text-foreground tw:break-all",children:eJ(t[c])})]},c))}),o.jsx("div",{className:"tw:mt-4",children:o.jsx(Ne,{variant:"outline",size:"sm",onClick:l,"data-testid":"diagnostic-copy",children:r?"Copied!":"Copy diagnostic for support"})})]})})})]})]})}function aJ(){return o.jsx("svg",{className:"tw:w-5 tw:h-5 tw:text-info",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}function rJ(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function dw(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}function oJ(){return o.jsx("svg",{className:"tw:w-4 tw:h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}function sJ(){const e=typeof window<"u"?window.psfaAdmin:void 0;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/#plans"}}function iJ({withTitle:e=!0}){return o.jsxs(Pc,{className:"tw:border-b tw:border-border",children:[e&&o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2",children:[o.jsx(Sg,{"aria-hidden":"true",className:"tw:size-4 tw:text-muted-foreground"}),"Geotargeting"]}),o.jsxs("p",{className:E("tw:text-sm tw:text-muted-foreground tw:m-0",e&&"tw:mt-1"),children:[e&&o.jsx(o.Fragment,{children:"Sends each visitor to their own country's Amazon store with your tracking ID for that store. "}),"Product details do not change, only the link does."]}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-1",children:"Uses the visitor's time zone. No IP lookup, no cookies."})]})}function lJ({upgradeUrl:e}){return o.jsxs("div",{className:"tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h3",{className:"tw:text-base tw:font-semibold tw:text-foreground tw:m-0 tw:mb-2",children:"Geotargeting comes with Premium"}),o.jsx("p",{className:"tw:text-sm tw:text-muted-foreground tw:m-0 tw:mb-4",children:"Send visitors from other countries to their own Amazon store, with your tracking ID for that store."}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:px-4 tw:py-2 tw:rounded-md tw:bg-primary tw:text-primary-foreground tw:text-sm tw:font-medium tw:no-underline tw:hover:opacity-90 tw:transition-opacity",children:"Get geotargeting with Premium"})]})}function cJ({withTitle:e=!0}){const{upgradeUrl:t}=sJ();return o.jsxs(It,{"data-testid":"geotargeting-card",children:[o.jsx(iJ,{withTitle:e}),o.jsx(Yt,{className:"tw:pt-5",children:o.jsx(lJ,{upgradeUrl:t})})]})}function uJ(){return o.jsx(cJ,{withTitle:!1})}const fw=30;function FM(e){if(e<=0)return"Expired";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m`;const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n>0?`${t}h ${n}m`:`${t}h`}function dJ(e){if(!e)return"-";const n=Math.floor(Date.now()/1e3)-e;if(n<60)return"Just now";if(n<3600)return`${Math.floor(n/60)}m ago`;if(n<86400){const r=Math.floor(n/3600),s=Math.floor(n%3600/60);return s>0?`${r}h ${s}m ago`:`${r}h ago`}if(n<604800){const r=Math.floor(n/86400);return r===1?"1 day ago":`${r} days ago`}if(n<2592e3){const r=Math.floor(n/604800);return r===1?"1 week ago":`${r} weeks ago`}const a=Math.floor(n/2592e3);return a===1?"1 month ago":`${a} months ago`}function mw(e){return`$${(e/100).toFixed(2)}`}const fJ={managed:"Managed API",oauth:"Creators API",awssig4:"PA-API"};function VM(e){return e?fJ[e]||e:"Unknown"}function GM(e){switch(e){case"managed":return"tw:bg-success-soft tw:text-success tw:border-success/40";case"oauth":return"tw:bg-pro-soft tw:text-pro tw:border-pro/40";case"awssig4":return"tw:bg-info-soft tw:text-info tw:border-info/40";default:return"tw:bg-muted tw:text-muted-foreground tw:border-border"}}function mJ(e){if(!e)return[];const t=[];return e.category&&e.category!=="All"&&t.push(e.category),e.brand&&t.push(e.brand),e.condition&&t.push(e.condition),e.merchant&&t.push(e.merchant),e.sort&&t.push(e.sort),e.availability==="IncludeOutOfStock"&&t.push("All items"),e.min_price&&t.push(`≥${mw(e.min_price)}`),e.max_price&&t.push(`≤${mw(e.max_price)}`),e.has_deal==="1"&&t.push("Deals"),e.min_saving_percent&&t.push(`${e.min_saving_percent}%+ off`),e.min_reviews_rating&&t.push(`${e.min_reviews_rating}★+`),e.page&&e.page>1&&t.push(`Page ${e.page}`),e.results&&e.results>0&&t.push(fa(e.results,"result","results")),t}function Nv(){return o.jsxs(Ar,{variant:"outline",className:"tw:bg-primary tw:text-primary-foreground tw:border-primary tw:gap-1",children:[o.jsx(cf,{className:"tw:size-3 tw:fill-current"}),o.jsx("span",{className:"tw:whitespace-nowrap",children:"Top Products"})]})}function wJ(){var z,B;const[e,t]=u.useState(null),[n,a]=u.useState(!0),[r,s]=u.useState(!1),[i,l]=u.useState(""),[c,d]=u.useState("all"),[m,f]=u.useState(null),[w,p]=u.useState(fw),[x,b]=u.useState("created"),[y,h]=u.useState("desc"),g=u.useRef(null),v=I=>{x===I?h(V=>V==="asc"?"desc":"asc"):(b(I),h("asc"))},S=u.useCallback(async()=>{try{const I=new FormData;I.append("action","psfa_cache_stats"),I.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||"");const D=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:I})).json();D.success&&t(D.data)}catch{}finally{a(!1)}},[]);u.useEffect(()=>{S()},[S]);const N=async()=>{var I,V;s(!0);try{const D=new FormData;D.append("action","psfa_clear_cache"),D.append("nonce",(psfaAdmin==null?void 0:psfaAdmin.nonce)||"");const O=await(await fetch((psfaAdmin==null?void 0:psfaAdmin.ajaxUrl)||"",{method:"POST",body:D})).json();O.success?(_e.success(((I=O.data)==null?void 0:I.message)||"Cache cleared"),l(""),d("all"),await S()):_e.error(((V=O.data)==null?void 0:V.message)||"Failed to clear cache")}catch{_e.error("Failed to clear cache")}finally{s(!1)}},A=e?e.products+e.searches:0,j=u.useMemo(()=>{if(!(e!=null&&e.entries))return[];const I=e.entries.filter(D=>{var T,O,_,$,H,F;if(c!=="all"&&D.type!==c)return!1;if(i){const Q=i.toLowerCase();return D.label.toLowerCase().includes(Q)||D.key.toLowerCase().includes(Q)||((O=(T=D.meta)==null?void 0:T.keywords)==null?void 0:O.toLowerCase().includes(Q))||(($=(_=D.meta)==null?void 0:_.category)==null?void 0:$.toLowerCase().includes(Q))||((F=(H=D.meta)==null?void 0:H.brand)==null?void 0:F.toLowerCase().includes(Q))}return!0}),V=y==="asc"?1:-1;return I.sort((D,T)=>{switch(x){case"type":{const O=_=>{var $;return _.type==="top_pool"?"a":_.type==="product"?"b":(($=_.meta)==null?void 0:$.purpose)==="filter_options"?"c":"d"};return V*O(D).localeCompare(O(T))}case"entry":return V*D.label.localeCompare(T.label);case"created":return V*((D.created_at||0)-(T.created_at||0));case"expires":return V*(D.expires-T.expires);default:return 0}}),I},[e==null?void 0:e.entries,c,i,x,y]);u.useEffect(()=>{p(fw)},[c,i,x,y]);const C=u.useMemo(()=>j.slice(0,w),[j,w]),R=w<j.length;u.useEffect(()=>{const I=g.current;if(!I||!R)return;const V=new IntersectionObserver(D=>{D[0].isIntersecting&&p(T=>Math.min(T+fw,j.length))},{rootMargin:"200px"});return V.observe(I),()=>V.disconnect()},[R,j.length]);const M=({col:I})=>x!==I?o.jsx(AP,{className:"tw:size-3 tw:text-muted-foreground/50"}):y==="asc"?o.jsx(EP,{className:"tw:size-3 tw:text-muted-foreground"}):o.jsx(NP,{className:"tw:size-3 tw:text-muted-foreground"});return o.jsxs("div",{className:"tw:space-y-6",children:[o.jsxs("div",{className:"tw:grid tw:grid-cols-3 tw:gap-4",children:[o.jsx(Cv,{label:"Product Entries",value:(e==null?void 0:e.products)??0,sublabel:"24 hr TTL on the Managed API, 1 hr on own credentials",isLoading:n}),o.jsx(Cv,{label:"Search Entries",value:(e==null?void 0:e.searches)??0,sublabel:"30 min TTL",isLoading:n}),o.jsx(Cv,{label:"Total Cached",value:A,sublabel:A>0?"API calls saved":"No cached data",isLoading:n})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-3",children:[o.jsxs(Ne,{onClick:N,disabled:r||A===0,children:[o.jsx(NN,{className:"tw:size-4"}),r?"Clearing...":"Clear All Cache"]}),o.jsxs(Ne,{variant:"outline",onClick:()=>{a(!0),S()},children:[o.jsx(KP,{className:"tw:size-4"}),"Refresh"]}),!n&&A===0&&o.jsx("span",{className:"tw:text-sm tw:text-muted-foreground",children:"Cache is empty. Entries will appear after visitors search on your site."})]}),!n&&A>0&&o.jsxs(It,{children:[o.jsx(Pc,{className:"tw:border-b tw:border-border",children:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-4",children:[o.jsxs(zc,{className:"tw:flex tw:items-center tw:gap-2 tw:text-base tw:shrink-0",children:[o.jsx(yg,{className:"tw:size-5 tw:text-info"}),"Cached Entries",o.jsxs(Ar,{variant:"secondary",className:"tw:ml-1 tw:font-normal",children:[j.length,j.length!==A?` / ${A}`:""]})]}),o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-2",children:[o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-1 tw:bg-secondary tw:rounded-lg tw:p-0.5",children:[o.jsx(gN,{className:"tw:size-3.5 tw:text-muted-foreground tw:ml-2"}),["all","product","search","top_pool"].map(I=>o.jsx("button",{onClick:()=>d(I),className:`tw:px-2.5 tw:py-1 tw:text-xs tw:font-medium tw:rounded-md tw:transition-colors tw:border-none tw:cursor-pointer ${c===I?"tw:bg-card tw:text-foreground tw:shadow-sm":"tw:bg-transparent tw:text-muted-foreground tw:hover:text-foreground"}`,children:I==="all"?"All":I==="product"?"Products":I==="search"?"Searches":"Top Products"},I))]}),o.jsxs("div",{className:"tw:relative",children:[o.jsx(yc,{className:"tw:absolute tw:left-2.5 tw:top-1/2 tw:-translate-y-1/2 tw:size-3.5 tw:text-muted-foreground"}),o.jsx(pt,{placeholder:"Filter entries...",value:i,onChange:I=>l(I.target.value),className:"tw:pl-8 tw:h-8 tw:w-48 tw:text-sm"})]})]})]})}),o.jsxs(Yt,{className:"tw:p-0 tw:[&>div]:max-h-[480px] tw:[&>div]:overflow-y-auto tw:[&>div]:overflow-x-auto",children:[o.jsxs(qT,{className:"tw:table-fixed",children:[o.jsxs("colgroup",{children:[o.jsx("col",{className:"tw:w-40"}),o.jsx("col",{className:"tw:w-56"}),o.jsx("col",{}),o.jsx("col",{className:"tw:w-32"}),o.jsx("col",{className:"tw:w-30"}),o.jsx("col",{className:"tw:w-24"})]}),o.jsx(XT,{className:"tw:bg-muted tw:sticky tw:top-0 tw:z-10",children:o.jsxs(nu,{children:[o.jsx(is,{className:"tw:px-4",children:o.jsxs("button",{onClick:()=>v("type"),className:"tw:flex tw:items-center tw:gap-1 tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Type ",o.jsx(M,{col:"type"})]})}),o.jsx(is,{className:"tw:px-4",children:o.jsxs("button",{onClick:()=>v("entry"),className:"tw:flex tw:items-center tw:gap-1 tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Entry ",o.jsx(M,{col:"entry"})]})}),o.jsx(is,{className:"tw:px-4",children:"Info"}),o.jsx(is,{className:"tw:px-4",children:"Credentials"}),o.jsx(is,{className:"tw:px-4 tw:text-right",children:o.jsxs("button",{onClick:()=>v("created"),className:"tw:flex tw:items-center tw:gap-1 tw:ml-auto tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["Created ",o.jsx(M,{col:"created"})]})}),o.jsx(is,{className:"tw:px-4 tw:text-right",children:o.jsxs("button",{onClick:()=>v("expires"),className:"tw:flex tw:items-center tw:gap-1 tw:ml-auto tw:border-none tw:bg-transparent tw:cursor-pointer tw:font-medium tw:text-inherit tw:p-0",children:["TTL ",o.jsx(M,{col:"expires"})]})})]})}),o.jsx(WT,{children:j.length===0?o.jsx(nu,{children:o.jsx(Er,{colSpan:6,className:"tw:text-center tw:py-8 tw:text-muted-foreground",children:"No entries match your filter."})}):o.jsxs(o.Fragment,{children:[C.map((I,V)=>{var _,$,H,F,Q,X;const D=I.type==="top_pool",T=((_=I.meta)==null?void 0:_.purpose)==="filter_options",O=I.type==="search"&&(($=I.meta)==null?void 0:$.purpose)==="top_products";return o.jsxs(nu,{className:`tw:cursor-pointer ${T?"tw:opacity-60":""}`,onClick:()=>f(I),children:[o.jsx(Er,{className:"tw:px-4",children:D?o.jsx(Nv,{}):o.jsx(Ar,{variant:"outline",className:I.type==="product"?"tw:bg-info-soft tw:text-info tw:border-info/40":T?"tw:bg-muted tw:text-muted-foreground tw:border-border":"tw:bg-warning-soft tw:text-warning tw:border-warning/40",children:o.jsx("span",{className:"tw:whitespace-nowrap",children:I.type==="product"?"Product":T?"Filter data":"Search"})})}),o.jsx(Er,{className:"tw:px-4 tw:overflow-hidden tw:text-ellipsis tw:whitespace-nowrap tw:text-foreground",children:I.label}),o.jsx(Er,{className:"tw:px-4",children:I.type==="product"?o.jsxs("span",{className:"tw:text-xs tw:text-muted-foreground",children:[o.jsx("span",{className:"tw:font-mono",children:I.key}),((H=I.meta)==null?void 0:H.price)&&o.jsx("span",{className:"tw:ml-1.5 tw:text-muted-foreground tw:font-sans",children:I.meta.price})]}):D?(F=I.meta)!=null&&F.results&&I.meta.results>0?o.jsx("span",{className:"tw:inline-flex tw:items-center tw:px-1.5 tw:py-0 tw:text-[10px] tw:font-medium tw:text-muted-foreground tw:bg-secondary tw:rounded",children:fa(I.meta.results,"product","products")}):null:o.jsxs("div",{className:"tw:flex tw:flex-wrap tw:items-center tw:gap-1",children:[O&&o.jsx(Nv,{}),mJ(I.meta).map(P=>o.jsx("span",{className:"tw:inline-flex tw:items-center tw:px-1.5 tw:py-0 tw:text-[10px] tw:font-medium tw:text-muted-foreground tw:bg-secondary tw:rounded",children:P},P))]})}),o.jsx(Er,{className:"tw:px-4",children:o.jsx(Ar,{variant:"outline",className:GM((Q=I.meta)==null?void 0:Q.auth_type),children:o.jsx("span",{className:"tw:whitespace-nowrap",children:VM((X=I.meta)==null?void 0:X.auth_type)})})}),o.jsx(Er,{className:"tw:px-4 tw:text-right tw:text-xs tw:text-muted-foreground",children:I.created_at?o.jsx(Ui,{delayDuration:200,children:o.jsxs(eu,{children:[o.jsx(tu,{asChild:!0,children:o.jsx("span",{className:"tw:cursor-default",children:dJ(I.created_at)})}),o.jsx(Hi,{children:new Date(I.created_at*1e3).toLocaleString()})]})}):"-"}),o.jsx(Er,{className:"tw:px-4 tw:text-right",children:o.jsx("span",{className:`tw:whitespace-nowrap ${I.expires<=0?"tw:text-destructive":I.expires<300?"tw:text-warning":"tw:text-success"}`,children:FM(I.expires)})})]},`${I.type}-${I.key}-${V}`)}),R&&o.jsx(nu,{ref:g,children:o.jsx(Er,{colSpan:6,className:"tw:text-center tw:py-3 tw:text-xs tw:text-muted-foreground",children:"Loading more..."})})]})})]}),j.length>fw&&o.jsxs("div",{className:"tw:px-4 tw:py-2 tw:border-t tw:border-border tw:text-xs tw:text-muted-foreground",children:["Showing ",Math.min(w,j.length)," of ",fa(j.length,"entry","entries")]})]})]}),o.jsx(Qf,{open:!!m,onOpenChange:I=>!I&&f(null),children:o.jsxs(Jf,{className:"tw:sm:max-w-md",children:[o.jsx(Dx,{children:o.jsxs(Hc,{className:"tw:flex tw:items-center tw:gap-2",children:[(m==null?void 0:m.type)==="top_pool"?o.jsx(Nv,{}):o.jsx(Ar,{variant:"outline",className:(m==null?void 0:m.type)==="product"?"tw:bg-info-soft tw:text-info tw:border-info/40":"tw:bg-warning-soft tw:text-warning tw:border-warning/40",children:(m==null?void 0:m.type)==="product"?"Product":"Search"}),"Cache Entry Details"]})}),m&&o.jsxs("div",{className:"tw:space-y-4",children:[m.type==="product"?o.jsx(pJ,{entry:m}):m.type==="top_pool"?o.jsx(gJ,{entry:m}):o.jsx(hJ,{entry:m}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:text-sm tw:pt-3 tw:border-t tw:border-border",children:[o.jsx(yg,{className:"tw:size-3.5 tw:text-muted-foreground"}),o.jsx("span",{className:"tw:text-muted-foreground",children:"Fetched via:"}),o.jsx(Ar,{variant:"outline",className:GM((z=m.meta)==null?void 0:z.auth_type),children:VM((B=m.meta)==null?void 0:B.auth_type)})]}),o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:text-sm",children:[o.jsx(OP,{className:"tw:size-3.5 tw:text-muted-foreground"}),o.jsx("span",{className:"tw:text-muted-foreground",children:"Expires in:"}),o.jsx("span",{className:m.expires<=0?"tw:font-medium tw:text-destructive":m.expires<300?"tw:font-medium tw:text-warning":"tw:font-medium tw:text-success",children:FM(m.expires)})]})]})]})}),o.jsxs(It,{children:[o.jsx(Pc,{className:"tw:border-b tw:border-border",children:o.jsx(zc,{className:"tw:text-base",children:"How Caching Works"})}),o.jsx(Yt,{className:"tw:pt-4",children:o.jsxs("div",{className:"tw:grid tw:grid-cols-1 tw:md:grid-cols-2 tw:gap-6 tw:text-sm tw:text-muted-foreground",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Search Cache (30 min)"}),o.jsx("p",{className:"tw:m-0",children:"When a visitor searches, the full API response is cached. Identical searches within 30 minutes are served instantly without hitting Amazon's API."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Product Cache (24 hours or 1 hour)"}),o.jsx("p",{className:"tw:m-0",children:"Product data is cached per ASIN and shared by product boxes and comparison tables, so the same product is only fetched once. Products fetched through the Managed API stay cached for 24 hours, because every uncached lookup counts toward your Managed API quota. With your own Amazon credentials they stay cached for 1 hour."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Auto-Invalidation"}),o.jsx("p",{className:"tw:m-0",children:"Search cache is automatically cleared when you change your Marketplace or Associate Tag, ensuring results match your current settings."})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"tw:font-medium tw:text-foreground tw:m-0 tw:mb-1",children:"Manual Clear"}),o.jsx("p",{className:"tw:m-0",children:'Use the "Clear All Cache" button above to force fresh data from Amazon. Useful after updating product listings or troubleshooting.'})]})]})})]})]})}function pJ({entry:e}){const{meta:t}=e;return o.jsxs("div",{className:"tw:space-y-3",children:[(t==null?void 0:t.image)&&o.jsx("div",{className:"tw:flex tw:justify-center tw:py-2",children:o.jsx("img",{src:t.image,alt:t.title||"",className:"tw:h-24 tw:w-auto tw:object-contain tw:rounded"})}),o.jsx(kr,{icon:o.jsx(hN,{className:"tw:size-3.5"}),label:"Title",value:(t==null?void 0:t.title)||e.label}),o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"ASIN",value:(t==null?void 0:t.asin)||e.key,mono:!0}),(t==null?void 0:t.price)&&o.jsx(kr,{icon:o.jsx(WP,{className:"tw:size-3.5"}),label:"Price",value:t.price})]})}function hJ({entry:e}){const{meta:t}=e,n=[];return t!=null&&t.category&&t.category!=="All"&&n.push({label:"Category",value:t.category}),t!=null&&t.brand&&n.push({label:"Brand",value:t.brand}),t!=null&&t.sort&&n.push({label:"Sort",value:t.sort}),t!=null&&t.condition&&n.push({label:"Condition",value:t.condition}),t!=null&&t.merchant&&n.push({label:"Merchant",value:t.merchant}),t!=null&&t.availability&&n.push({label:"Availability",value:t.availability==="IncludeOutOfStock"?"All items":t.availability}),t!=null&&t.min_price&&n.push({label:"Min Price",value:mw(t.min_price)}),t!=null&&t.max_price&&n.push({label:"Max Price",value:mw(t.max_price)}),(t==null?void 0:t.has_deal)==="1"&&n.push({label:"Has Deal",value:"Yes"}),t!=null&&t.min_saving_percent&&n.push({label:"Min Discount",value:`${t.min_saving_percent}%+`}),t!=null&&t.min_reviews_rating&&n.push({label:"Min Rating",value:`${t.min_reviews_rating}+ stars`}),t!=null&&t.page&&t.page>1&&n.push({label:"Page",value:String(t.page)}),o.jsxs("div",{className:"tw:space-y-3",children:[(t==null?void 0:t.purpose)==="filter_options"&&o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:px-3 tw:py-2 tw:bg-muted tw:rounded-md tw:text-xs tw:text-muted-foreground",children:[o.jsx(gN,{className:"tw:size-3"}),"Unfiltered pass - used to populate the brands dropdown and filter options."]}),o.jsx(kr,{icon:o.jsx(yc,{className:"tw:size-3.5"}),label:"Keywords",value:(t==null?void 0:t.keywords)||"Unknown"}),(t==null?void 0:t.results)!==void 0&&t.results>0&&o.jsx(kr,{icon:o.jsx(Zo,{className:"tw:size-3.5"}),label:"Results",value:fa(t.results,"product","products")}),n.length>0&&o.jsxs("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:font-medium tw:text-muted-foreground tw:mb-2",children:[o.jsx(jN,{className:"tw:size-3"}),"Search Parameters"]}),o.jsx("div",{className:"tw:grid tw:grid-cols-2 tw:gap-x-4 tw:gap-y-1.5",children:n.map(a=>o.jsxs("div",{className:"tw:text-xs",children:[o.jsxs("span",{className:"tw:text-muted-foreground",children:[a.label,": "]}),o.jsx("span",{className:"tw:text-foreground",children:a.value})]},a.label))})]}),o.jsx("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"Cache Key",value:e.key,mono:!0})})]})}function gJ({entry:e}){var a,r,s;const{meta:t}=e,n=[];return(a=t==null?void 0:t.filters)!=null&&a.brand&&n.push({label:"Brand",value:t.filters.brand}),((r=t==null?void 0:t.filters)==null?void 0:r.has_deal)==="1"&&n.push({label:"Has Deal",value:"Yes"}),(s=t==null?void 0:t.filters)!=null&&s.min_saving_percent&&n.push({label:"Min Discount",value:`${t.filters.min_saving_percent}%+`}),o.jsxs("div",{className:"tw:space-y-3",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-2 tw:px-3 tw:py-2 tw:bg-info-soft tw:rounded-md tw:text-xs tw:text-muted-foreground",children:[o.jsx(cf,{className:"tw:size-3 tw:text-info"}),"Top-products pool - the pre-built set of products surfaced by the top-products mechanism."]}),o.jsx(kr,{icon:o.jsx(hN,{className:"tw:size-3.5"}),label:"Pool",value:e.label}),(t==null?void 0:t.results)!==void 0&&t.results>0&&o.jsx(kr,{icon:o.jsx(Zo,{className:"tw:size-3.5"}),label:"Results",value:fa(t.results,"product","products")}),n.length>0&&o.jsxs("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:[o.jsxs("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:text-xs tw:font-medium tw:text-muted-foreground tw:mb-2",children:[o.jsx(jN,{className:"tw:size-3"}),"Pool Filters"]}),o.jsx("div",{className:"tw:grid tw:grid-cols-2 tw:gap-x-4 tw:gap-y-1.5",children:n.map(i=>o.jsxs("div",{className:"tw:text-xs",children:[o.jsxs("span",{className:"tw:text-muted-foreground",children:[i.label,": "]}),o.jsx("span",{className:"tw:text-foreground",children:i.value})]},i.label))})]}),o.jsx("div",{className:"tw:pt-2 tw:border-t tw:border-border",children:o.jsx(kr,{icon:o.jsx(jg,{className:"tw:size-3.5"}),label:"Cache Key",value:e.key,mono:!0})})]})}function kr({icon:e,label:t,value:n,mono:a}){return o.jsxs("div",{className:"tw:flex tw:items-start tw:gap-2 tw:text-sm",children:[o.jsx("span",{className:"tw:text-muted-foreground tw:mt-0.5 tw:shrink-0",children:e}),o.jsx("span",{className:"tw:text-muted-foreground tw:shrink-0 tw:w-20",children:t}),o.jsx("span",{className:`tw:text-foreground tw:break-all ${a?"tw:font-mono tw:text-xs tw:mt-0.5":""}`,children:n})]})}function Cv({label:e,value:t,sublabel:n,isLoading:a}){return o.jsx(It,{children:o.jsxs(Yt,{className:"tw:p-5",children:[o.jsx("p",{className:"tw:text-sm tw:font-medium tw:text-muted-foreground tw:m-0",children:e}),o.jsx("p",{className:"tw:text-3xl tw:font-semibold tw:text-foreground tw:m-0 tw:mt-1",children:a?"-":t}),o.jsx("p",{className:"tw:text-xs tw:text-muted-foreground tw:m-0 tw:mt-1",children:n})]})})}[{key:"appearance",label:"Appearance",hint:"Colors, style, font, button text, badges and product text.",route:se.appearance},{key:"search_display",label:"Search display",hint:"Grid or list, filters, banner and top products.",route:se.searchSettings},{key:"geo",label:"Geotargeting",hint:"On or off, where visitors land and your tracking ID for each store.",route:se.geotargeting}].map(e=>e.key);function xJ(){const e=typeof window<"u"?window.psfaAdmin:void 0;return{isPremium:!!(e!=null&&e.isPremium),upgradeUrl:(e==null?void 0:e.upgradeUrl)||"https://paapiplugin.com/pricing/#plans"}}function bJ(){const{upgradeUrl:e}=xJ();return o.jsx(vJ,{upgradeUrl:e})}function vJ({upgradeUrl:e}){return o.jsxs("div",{"data-testid":"settings-transfer-premium-prompt",className:"tw:max-w-2xl tw:rounded-lg tw:border tw:border-warning/40 tw:bg-warning-soft tw:p-5",children:[o.jsx("h2",{className:"tw:m-0 tw:mb-2 tw:text-base tw:font-semibold tw:text-foreground",children:"Import and export comes with Premium"}),o.jsx("p",{className:"tw:m-0 tw:mb-3 tw:text-sm tw:text-muted-foreground",children:"Set up one site, then copy its settings to the next one in a few clicks."}),o.jsxs("ul",{className:"tw:m-0 tw:mb-4 tw:list-disc tw:space-y-1 tw:pl-5 tw:text-sm tw:text-muted-foreground",children:[o.jsx("li",{children:"Export Appearance, Search display and Geotargeting to one file"}),o.jsx("li",{children:"See every change before you import"}),o.jsx("li",{children:"Amazon credentials never leave the site"})]}),o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tw:inline-flex tw:items-center tw:rounded-md tw:bg-primary tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:text-primary-foreground tw:no-underline tw:transition-opacity tw:hover:opacity-90",children:"Get import and export with Premium"})]})}const yJ=220;function SJ(e){return e instanceof HTMLElement?e.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(e.tagName):!1}function jJ(){return o.jsx(CF,{children:o.jsx(NJ,{})})}function NJ(){const e=jn(),t=pi(),n=Tb(KF),a=mV(),[r,s]=u.useState(!1),[i,l]=u.useState(!1),[c,d]=u.useState(!1),m=u.useRef(null),f=u.useRef(void 0),w=u.useRef(!0),p=!!Nt().isPremium,x=aV(e.pathname),{toggleSidebar:b,latest:y}=a,h=u.useCallback((A=!1)=>{const j=y.current.sidebarCollapsed;b(),window.clearTimeout(f.current),j&&!A?(l(!0),f.current=window.setTimeout(()=>l(!1),yJ)):l(!1)},[b,y]);u.useEffect(()=>()=>window.clearTimeout(f.current),[]),u.useEffect(()=>{const A=j=>{!(j.ctrlKey||j.metaKey)||j.shiftKey||j.altKey||j.key!=="b"&&j.key!=="B"||n||SJ(j.target)||(j.preventDefault(),h(!0))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[n,h]),u.useEffect(()=>{n||s(!1)},[n]),u.useLayoutEffect(()=>{if(w.current){w.current=!1;return}if(s(!1),document.documentElement.scrollTop=0,document.body.scrollTop=0,document.activeElement instanceof HTMLElement&&document.activeElement.dataset.stepHeading==="true")return;const A=document.querySelector("[data-page-title]");A==null||A.focus({preventScroll:!0})},[e.pathname]);const g=u.useCallback(A=>{m.current=A??null,d(!0)},[]),v=u.useCallback(()=>d(!1),[]),S=u.useCallback(()=>m.current,[]);u.useEffect(()=>{const A=new URLSearchParams(e.search);if(A.get(TR)!=="1")return;A.delete(TR);const j=A.toString();g(null),t({pathname:e.pathname,search:j?`?${j}`:""},{replace:!0})},[e.pathname,e.search,t,g]);const N=u.useMemo(()=>({isPhone:n,isPremium:p,theme:a.theme,setTheme:a.setTheme,collapsed:a.sidebarCollapsed,toggleCollapsed:h,expanding:i,sheetOpen:r,setSheetOpen:s,whatsNewOpen:c,openWhatsNew:g,closeWhatsNew:v,whatsNewReturnFocus:S}),[n,p,a.theme,a.setTheme,a.sidebarCollapsed,h,i,r,c,g,v,S]);return o.jsx(NR.Provider,{value:N,children:o.jsxs("div",{"data-testid":"psfa-shell",className:"psfa-shell tw:flex tw:min-h-full tw:w-full tw:min-w-0 tw:flex-1 tw:bg-background tw:font-rubik tw:text-foreground tw:antialiased",children:[n?null:o.jsx(uV,{}),o.jsxs("main",{className:"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col",children:[n?o.jsx(QF,{title:x==null?void 0:x.title}):null,o.jsxs("div",{className:"tw:mx-auto tw:w-full tw:max-w-[1200px] tw:px-4 tw:pt-6 tw:pb-24 tw:min-[1100px]:px-8 tw:min-[1100px]:pt-7",children:[o.jsx(ZF,{}),o.jsx(FF,{}),x?o.jsx(fu,{title:x.title,description:x.description}):null,x!=null&&x.tabs?o.jsx(JF,{...x.tabs}):null,o.jsx(MO,{})]})]}),n?o.jsx(dV,{}):null,o.jsx(IF,{}),o.jsx(pV,{})]})})}function CJ(){const e=tV(window.location.search,window.location.hash);e&&(window.location.hash=e)}CJ();const AJ=[{path:"/",element:o.jsx(jJ,{}),children:[{index:!0,element:o.jsx(oG,{})},{path:"boxes",element:o.jsx(eK,{})},{path:"boxes/new",element:o.jsx(zk,{})},{path:"boxes/:asin",element:o.jsx(zk,{})},{path:"tables",element:o.jsx(dK,{})},{path:"lists",element:o.jsx(PK,{})},{path:"search",element:o.jsx(FK,{})},{path:"search/settings",element:o.jsx(qK,{})},{path:"appearance",element:o.jsx(mq,{})},{path:"analytics",element:o.jsx(wQ,{})},{path:"settings/connection",element:o.jsx(UQ,{})},{path:"settings/geotargeting",element:o.jsx(uJ,{})},{path:"settings/cache",element:o.jsx(wJ,{})},{path:"settings/import-export",element:o.jsx(bJ,{})},...Object.entries(eV).map(([e,t])=>({path:e.slice(1),element:o.jsx(WF,{to:t})})),{path:"*",element:o.jsx(rN,{to:"/",replace:!0})}]}],_J=rP(AJ);function EJ(){return o.jsx(Ui,{children:o.jsxs(iF,{children:[o.jsx(gP,{router:_J}),o.jsx(oH,{})]})})}const YM=document.getElementById("psfa-admin-root");YM&&(p7(),F3.createRoot(YM).render(o.jsx(u.StrictMode,{children:o.jsx(EJ,{})})))})(); -
paapi-product-search-for-amazon/trunk/src/core/admin/notifications.php
r3796429 r3801546 12 12 * appearance (copy in notices.php) 13 13 * courtesy the admin's new layout (admin-moved-notice.php), Black Friday 14 * (bfcm-notice.php), review request (review-notice.php), the 15 * built-in notes (the loaders), 14 * (bfcm-notice.php), review request (review-notice.php), go-live 15 * (go-live-notice.php; never a modal), the built-in notes (the 16 * loaders), 16 17 * remote messages from the proxy feed (remote-messages.php; 17 18 * a remote message is a modal only when it says so) … … 19 20 * Inside the plugin's own pages React renders the feed (bell, modal queue, 20 21 * fault banner). On WordPress core screens only slim cards print, and only on 21 * the Dashboard and the Plugins list. No modal or bell there. 22 * the Dashboard and the Plugins list, plus the Posts and Pages lists for the 23 * go-live card. No modal or bell there. 22 24 * 23 25 * Per-user state, all in user meta: … … 209 211 } 210 212 213 $card_screen = psfa_notification_card_screen(); 214 if ( '' === $card_screen || in_array( $card_screen, psfa_go_live_notice_screens(), true ) ) { 215 $go_live = psfa_go_live_notification_item( $now ); 216 if ( null !== $go_live ) { 217 $items[] = $go_live; 218 } 219 } 220 211 221 if ( current_user_can( 'activate_plugins' ) ) { 212 222 foreach ( psfa_builtin_addon_notes() as $note ) { … … 258 268 } else { 259 269 $item['read'] = isset( $read[ $id ] ); 260 $item['modal'] = ( 0 !== strpos( $id, 'remote-' ) || true === $item['modal'] ) && ! $item['read'] && ! isset( $shown[ $id ] );270 $item['modal'] = ( 0 !== strpos( $id, 'remote-' ) || true === $item['modal'] ) && 0 !== strpos( $id, 'go-live' ) && ! $item['read'] && ! isset( $shown[ $id ] ); 261 271 $item['bannerHiddenUntil'] = null; 262 272 } … … 466 476 467 477 /** 468 * The core screen a slim card may print on: 'dashboard', 'plugins' or ''. 478 * The core screen a slim card may print on: 'dashboard', 'plugins', 479 * 'edit-post' (the Posts list), 'edit-page' (the Pages list) or ''. Only the 480 * go-live card prints on the two lists. 469 481 * 470 482 * @return string 471 483 */ 472 484 function psfa_notification_card_screen(): string { 473 if ( ! psfa_managed_api_notice_allowed_on_screen() ) { 485 if ( psfa_managed_api_notice_allowed_on_screen() ) { 486 return (string) get_current_screen()->base; 487 } 488 489 if ( ! function_exists( 'get_current_screen' ) ) { 474 490 return ''; 475 491 } 476 492 477 return (string) get_current_screen()->base; 493 $screen = get_current_screen(); 494 $id = is_object( $screen ) && isset( $screen->id ) ? (string) $screen->id : ''; 495 496 return in_array( $id, array( 'edit-post', 'edit-page' ), true ) ? $id : ''; 478 497 } 479 498 … … 481 500 * Whether an item prints as a slim card on the given screen. 482 501 * 483 * Faults print until the user hides them. The deal prints until read. A 484 * built-in note prints on the Plugins screen only, until read. The review 485 * request never prints outside the plugin's own pages. 502 * The go-live card prints on the Dashboard and the Posts and Pages lists, 503 * until read. Everything else prints on the Dashboard and the Plugins screen 504 * only: faults until the user hides them, the deal until read, a built-in 505 * note on the Plugins screen only, until read. The review request never 506 * prints outside the plugin's own pages. 486 507 * 487 508 * @param array<string,mixed> $item Feed item. 488 * @param string $screen 'dashboard' or 'plugins'.509 * @param string $screen A screen from psfa_notification_card_screen(). 489 510 * @return bool 490 511 */ 491 512 function psfa_notification_card_visible( array $item, string $screen ): bool { 513 if ( 0 === strpos( (string) $item['id'], 'go-live' ) ) { 514 return ! $item['read'] && in_array( $screen, psfa_go_live_notice_screens(), true ); 515 } 516 517 if ( 'dashboard' !== $screen && 'plugins' !== $screen ) { 518 return false; 519 } 520 492 521 if ( 'fault' === $item['kind'] ) { 493 522 return null === $item['bannerHiddenUntil']; … … 561 590 . 'send(c.getAttribute("data-psfa-dismiss"),id);' 562 591 . 'var x=c.nextElementSibling;x=x&&x.classList.contains("psfa-slim")?x.querySelector(".psfa-slim-x"):null;' 563 . 'c.parentNode.removeChild(c);if(x){x.focus();} });})();</script>' . "\n";592 . 'c.parentNode.removeChild(c);if(x){x.focus();}else{var h=document.querySelector(".wrap h1");if(h){h.setAttribute("tabindex","-1");h.focus();}}});})();</script>' . "\n"; 564 593 } 565 594 -
paapi-product-search-for-amazon/trunk/src/core/admin/setup-checklist.php
r3794149 r3801546 13 13 } 14 14 15 require_once PSFA_PLUGIN_DIR . 'src/core/shared/live-placement-cache.php'; 16 15 17 /** 16 18 * The path serving products: 'managed', 'creators' or 'paapi', or 'none' … … 41 43 42 44 /** 45 * A post of a public type with one of the given statuses that holds a 46 * PaapiPlugin shortcode in its content or its Elementor data: the most 47 * recently modified one when $newest is true, else any one, so the database 48 * can stop at the first match. 49 * 50 * A missing database object, or one that lacks the wpdb query methods used 51 * here, finds nothing, as in psfa_admin_product_asin_count(). 52 * 53 * @since 2.45.0 54 * @param string[] $statuses Post statuses to look in. 55 * @param bool $newest Whether the most recently modified match is wanted. 56 * @return int Post ID, or 0 when none matches. 57 */ 58 function psfa_live_placement_find_post( array $statuses, bool $newest ): int { 59 global $wpdb; 60 61 if ( ! is_object( $wpdb ) ) { 62 return 0; 63 } 64 foreach ( array( 'get_var', 'prepare', 'esc_like' ) as $method ) { 65 if ( ! method_exists( $wpdb, $method ) ) { 66 return 0; 67 } 68 } 69 70 $types = array_values( array_diff( get_post_types( array( 'public' => true ) ), array( 'attachment' ) ) ); 71 if ( array() === $types || array() === $statuses ) { 72 return 0; 73 } 74 75 $like = '%' . $wpdb->esc_like( '[psfa_' ) . '%'; 76 $type_list = implode( ', ', array_fill( 0, count( $types ), '%s' ) ); 77 $status_list = implode( ', ', array_fill( 0, count( $statuses ), '%s' ) ); 78 $posts_table = $wpdb->posts; 79 $postmeta_table = $wpdb->postmeta; 80 $prepare_args = array_merge( $types, $statuses, array( $like, '_elementor_data', $like ) ); 81 $order = $newest ? ' ORDER BY p.post_modified DESC' : ''; 82 83 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- psfa_live_placement_state() keeps the answer for the request, and a live answer for 12 hours; see src/core/shared/live-placement-cache.php. 84 $id = $wpdb->get_var( 85 // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber -- $type_list and $status_list are array_fill('%s') lists; $prepare_args binds one value per placeholder. 86 $wpdb->prepare( 87 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table names come from $wpdb; the lists hold %s placeholders only; $order is one of two literals. 88 "SELECT p.ID FROM {$posts_table} p WHERE p.post_type IN ({$type_list}) AND p.post_status IN ({$status_list}) AND ( p.post_content LIKE %s OR EXISTS ( SELECT 1 FROM {$postmeta_table} m WHERE m.post_id = p.ID AND m.meta_key = %s AND m.meta_value LIKE %s ) ){$order} LIMIT 1", 89 $prepare_args 90 ) 91 ); 92 93 return (int) $id; 94 } 95 96 /** 97 * Whether PaapiPlugin is on the public site, read from the posts themselves. 98 * 99 * live is true when a published post of a public post type other than 100 * attachment holds the literal [psfa_ (the opening of every shortcode the 101 * plugin registers) in post_content or in the _elementor_data meta, where 102 * Elementor keeps its widgets. Drafts, pending, scheduled, private and 103 * trashed posts, auto-drafts and revisions are not live. 104 * 105 * draftEditUrl is the raw edit link of the most recently modified draft or 106 * pending post holding [psfa_ by the same rule, when the current user can 107 * edit it. A scheduled post is not linked: it publishes on its own, so 108 * telling the user to publish it would be false. It is null when live is 109 * true, when no such post exists or when the user cannot edit the newest 110 * one. 111 * 112 * Read once per request, then kept for the rest of it. A live answer is also 113 * kept for 12 hours in the PSFA_LIVE_PLACEMENT_CACHE transient, cleared by 114 * every post change; a not-live answer and the draft link are never stored. 115 * A stale "live" can only hide a courtesy card or tick a Home step early, 116 * never show a banner that should be gone, which is the failure the 117 * notices.php docblock records. See src/core/shared/live-placement-cache.php. 118 * At most two prepared LIMIT 1 queries per request, none while the live 119 * answer is kept. Nothing leaves the site. 120 * 121 * @since 2.45.0 122 * @return array{live:bool,draftEditUrl:?string} 123 */ 124 function psfa_live_placement_state(): array { 125 $kept = psfa_live_placement_memo(); 126 if ( null !== $kept ) { 127 return $kept; 128 } 129 130 $state = psfa_live_placement_read(); 131 psfa_live_placement_memo( $state ); 132 133 return $state; 134 } 135 136 /** 137 * The placement as the kept live answer or the posts show it. 138 * 139 * @since 2.45.0 140 * @return array{live:bool,draftEditUrl:?string} 141 */ 142 function psfa_live_placement_read(): array { 143 $live = array( 144 'live' => true, 145 'draftEditUrl' => null, 146 ); 147 148 if ( '1' === get_transient( PSFA_LIVE_PLACEMENT_CACHE ) ) { 149 return $live; 150 } 151 152 if ( psfa_live_placement_find_post( array( 'publish' ), false ) > 0 ) { 153 set_transient( PSFA_LIVE_PLACEMENT_CACHE, '1', 12 * HOUR_IN_SECONDS ); 154 return $live; 155 } 156 157 $draft_id = psfa_live_placement_find_post( array( 'draft', 'pending' ), true ); 158 $url = null; 159 if ( $draft_id > 0 && current_user_can( 'edit_post', $draft_id ) ) { 160 $link = get_edit_post_link( $draft_id, 'raw' ); 161 $url = is_string( $link ) && '' !== $link ? $link : null; 162 } 163 164 return array( 165 'live' => false, 166 'draftEditUrl' => $url, 167 ); 168 } 169 170 /** 43 171 * The checklist state for Home. 44 172 * 45 173 * placed is the flag psfa_mark_box_placed sets, or true on an install that 46 * predates the 2.38.0 redesign and already has a box. 47 * 48 * @return array{connected:bool,madeBox:bool,placed:bool} 174 * predates the 2.38.0 redesign and already has a box. live and draftEditUrl 175 * come from psfa_live_placement_state(). 176 * 177 * @return array{connected:bool,madeBox:bool,placed:bool,live:bool,draftEditUrl:?string} 49 178 */ 50 179 function psfa_setup_checklist_state(): array { … … 54 183 || ( $made_box && function_exists( 'psfa_install_predates_admin_redesign' ) && psfa_install_predates_admin_redesign() ); 55 184 185 $placement = psfa_live_placement_state(); 186 56 187 return array( 57 'connected' => 'none' !== psfa_admin_active_path(), 58 'madeBox' => $made_box, 59 'placed' => $placed, 188 'connected' => 'none' !== psfa_admin_active_path(), 189 'madeBox' => $made_box, 190 'placed' => $placed, 191 'live' => $placement['live'], 192 'draftEditUrl' => $placement['draftEditUrl'], 60 193 ); 61 194 } … … 93 226 * these, so the admin app can store what a reload would localize. 94 227 * 95 * @return array{setupChecklist:array{connected:bool,madeBox:bool,placed:bool },productBoxes:array<int,array<string,mixed>>}228 * @return array{setupChecklist:array{connected:bool,madeBox:bool,placed:bool,live:bool,draftEditUrl:?string},productBoxes:array<int,array<string,mixed>>} 96 229 */ 97 230 function psfa_admin_box_state(): array { -
paapi-product-search-for-amazon/trunk/src/core/frontend/ssr/skeleton.php
r3801449 r3801546 8 8 * initial content while React hydrates on the client. 9 9 * 10 * Generated: 2026-11-1 3T15:42:22.195Z10 * Generated: 2026-11-14T08:32:36.528Z 11 11 */ 12 12
Note:
See TracChangeset
for help on using the changeset viewer.