From eb4e711e58d8a510f2be3062c348c5c64ce5586b Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 22 Aug 2025 15:51:35 +0700 Subject: [PATCH] update UI --- README.md | 73 +- .../assets/_commonjsHelpers-CqkleIqs.js | 1 - .../assets/facebook.service-v39yqJ7I.js | 1 - .../assets/message.service-DcR3euAR.js | 1 - .../assets/popup.js | 182 +---- .../background/background.js | 2 +- .../content/content.js | 12 +- auto-post-facebook-extensions_1.0/index.html | 9 +- .../manifest.json | 7 + package-lock.json | 56 ++ package.json | 2 + public/manifest.json | 7 + .../assets/popup.js | 182 +---- .../background/background.js | 2 +- .../content/content.js | 12 +- .../index.html | 9 +- .../manifest.json | 7 + server/data.json | 16 +- server/server.js | 2 +- src/api/product-api.service.ts | 55 +- src/background/background.ts | 10 +- src/components/btn/confirm-alert.tsx | 5 +- src/components/improved-toggle-filter.tsx | 66 ++ src/components/loader.tsx | 2 +- src/components/post-table.tsx | 93 +-- src/components/product-modal.tsx | 637 ++++++++---------- src/components/ui/badge.tsx | 16 +- src/components/ui/button.tsx | 1 + src/components/ui/calendar.tsx | 40 +- src/components/ui/dialog.tsx | 34 +- src/components/ui/dropdown-menu.tsx | 50 +- src/components/ui/select.tsx | 32 +- src/components/ui/table.tsx | 24 +- src/components/ui/toggle-group.tsx | 71 ++ src/components/ui/toggle.tsx | 47 ++ src/content/content.ts | 129 +++- src/content/inject-ui.tsx | 19 + src/hooks/use-post-hook.ts | 6 +- src/index.css | 4 +- src/lib/contants.ts | 3 + src/lib/utils.ts | 26 +- src/popup/popup.tsx | 413 +++++++++++- src/services/background.service.ts | 49 +- vite.config.popup.ts | 8 + 44 files changed, 1390 insertions(+), 1033 deletions(-) delete mode 100644 auto-post-facebook-extensions_1.0/assets/_commonjsHelpers-CqkleIqs.js delete mode 100644 auto-post-facebook-extensions_1.0/assets/facebook.service-v39yqJ7I.js delete mode 100644 auto-post-facebook-extensions_1.0/assets/message.service-DcR3euAR.js create mode 100644 src/components/improved-toggle-filter.tsx create mode 100644 src/components/ui/toggle-group.tsx create mode 100644 src/components/ui/toggle.tsx create mode 100644 src/content/inject-ui.tsx create mode 100644 src/lib/contants.ts diff --git a/README.md b/README.md index 7959ce4..c903840 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,4 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default tseslint.config([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - ...tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - ...tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - ...tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` - -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: - -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' - -export default tseslint.config([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) -``` +Servers matching 'ai': +Server Name: AI training tool server +Command: ssh root@172.16.7.48 +Password: Work1234 diff --git a/auto-post-facebook-extensions_1.0/assets/_commonjsHelpers-CqkleIqs.js b/auto-post-facebook-extensions_1.0/assets/_commonjsHelpers-CqkleIqs.js deleted file mode 100644 index dbbfc19..0000000 --- a/auto-post-facebook-extensions_1.0/assets/_commonjsHelpers-CqkleIqs.js +++ /dev/null @@ -1 +0,0 @@ -function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{e as g}; diff --git a/auto-post-facebook-extensions_1.0/assets/facebook.service-v39yqJ7I.js b/auto-post-facebook-extensions_1.0/assets/facebook.service-v39yqJ7I.js deleted file mode 100644 index 5b0bddb..0000000 --- a/auto-post-facebook-extensions_1.0/assets/facebook.service-v39yqJ7I.js +++ /dev/null @@ -1 +0,0 @@ -import{a as s,d as v}from"./message.service-DcR3euAR.js";class f{base64ToFile(t,e,i){const n=t.includes(",")?t.split(",")[1]:t,o=atob(n),a=new ArrayBuffer(o.length),d=new Uint8Array(a);for(let l=0;l{let a=0,d=!1;const c=()=>{const l=document.evaluate(d&&n?n:t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(l instanceof HTMLElement){o(l);return}a++,a{const a=new FileReader;a.onloadend=()=>{typeof a.result=="string"?n(a.result.split(",")[1]):o("Không thể đọc dữ liệu ảnh")},a.onerror=o,a.readAsDataURL(i)})}getImageExtension(t){try{const i=new URL(t).pathname.match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}catch{const n=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return n?n[1].toLowerCase():null}}imageLocalToBase64(t){return new Promise((e,i)=>{try{const n=chrome.runtime.getURL(`${t}`);fetch(n).then(o=>o.blob()).then(o=>{const a=new FileReader;a.onloadend=()=>e(a.result),a.onerror=i,a.readAsDataURL(o)}).catch(i)}catch(n){i(n)}})}scrollToElement(t,e="smooth"){t&&t.scrollIntoView({behavior:e,block:"center",inline:"nearest"})}getElementPointCoores(t){if(!t)return null;const e=t.getBoundingClientRect(),i=e.left+e.width/2,n=e.top+e.height/2;return{x:i,y:n}}setInputValue(t,e){t&&(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(t,e)=>{let i;if(typeof e=="string"?i=await this.getElementByXPath(e):i=e,!i)throw new Error("Xpath is not found with value: "+t);this.scrollToElement(i),this.clickByPoint(i),this.setInputValue(i,t)};pressEnter(t){if(!t)throw new Error("Textarea not found:",t);t.focus(),["keydown","keypress","keyup"].forEach(e=>{t.dispatchEvent(new KeyboardEvent(e,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(t,e,i){const n=document.querySelector(t);if(!n)return null;const o=n.querySelectorAll(e);for(const a of o)if(a.innerText.trim().toLowerCase()===i.toLowerCase())return a;return null}findNestedIcElement(t,e,i){let n=null;if(typeof t=="string"){if(document.querySelector(t),!n)return null}else n=t;const o=n.querySelectorAll(e);for(const a of o)if(a.innerText.trim().toLowerCase().includes(i.toLowerCase()))return a;return null}findElInParent(t,e){return t&&t.parentElement?.querySelector(e)||null}waitForElement(t,e=100){return new Promise(i=>{const n=c=>c.offsetParent!==null&&(c.childElementCount>0||c.innerText.trim().length>0),o=()=>{const c=document.querySelector(t);c&&n(c)&&(a.disconnect(),clearInterval(d),i(c))},a=new MutationObserver(o);a.observe(document.body,{childList:!0,subtree:!0});const d=setInterval(o,e);o()})}}const r=new f;class m{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',next_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[5]/div/div/div",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/div/div/div",publish_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/div[2]/div/div",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[2]/div[1]/div[2]/div/div/div[3]/div[2]/div",description_edit_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[2]/div/div/div/label/div/div/textarea",sku_edit_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[5]/div/div/div[1]/label/div/input",new_item_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[7]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(t,e="input"){const i=r.findNestedElement(this.selectors.market_container,"span",t);if(!i)throw new Error("Not found input by title: "+t);return r.findElInParent(i,e)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(t=>t?.click())};uploadImages=async t=>{const e=new DataTransfer;for(const n of t.images){const o=await r.imageUrlToBase64(n);console.log("Base64:",n.slice(0,50)+"...");const a=r.base64ToFile(o,t.sku,r.getImageExtension(n)||"jpg");e.items.add(a)}const i=document.querySelector(this.selectors.file__image_input);i?(i.files=e.files,i.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(t,e,i='[aria-label="Dropdown menu"]')=>{const n=r.findNestedElement(this.selectors.market_container,"span",e);r.scrollToElement(n),await s(500,600),n?.click(),await s(500,600);const o=r.findNestedElement(i,"span",t);if(await s(500,600),!o)throw new Error(`No child found with text "${t}"`);r.scrollToElement(o),await s(500,600),o.click(),await s(500,600)};chooseLocation=async t=>{const e=this.findInputByTitle("location");await r.writeToInput(t,e),await v(600);const i=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],n=Array.from(i).find(o=>o.innerHTML.trim().toLowerCase().includes(t.toLowerCase()));if(console.log(n),!n)throw new Error(`No child found with text "${t}"`);r.scrollToElement(n),await v(400),r.clickByPoint(n)};writeTags=async t=>{const e=this.findInputByTitle("product tags","textarea");if(!e)throw new Error("Input is not found");r.scrollToElement(e),await v(500);for(const i of t)await r.writeToInput(i,e),await v(300),r.pressEnter(e)};clickNext=async()=>{const t=await r.getElementByXPath(this.selectors.next_btn);if(!t)throw new Error("Next button is not found");r.clickByPoint(t)};clickUpdate=async()=>{const t=await r.getElementByXPath(this.selectors.update_btn);if(!t)throw new Error("Next button is not found");r.clickByPoint(t)};clickPublist=async()=>{const t=await r.getElementByXPath(this.selectors.publish_btn);if(!t)throw new Error("Publist button is not found");r.clickByPoint(t)};handlePublist=async t=>{console.log({item:t}),await s(600,1e3),await this.uploadImages(t),await s(600,1e3);const e=this.findInputByTitle("title");r.writeToInput(t.title,e),await s(600,1e3);const i=this.findInputByTitle("price");if(r.writeToInput(String(t.price),i),await s(600,1e3),await this.chooseSelect(t.category,"category"),await s(600,1e3),await this.chooseSelect(t.condition,"condition",'[aria-label="Select an option"]'),t.brand){await s(600,1e3);const a=this.findInputByTitle("brand");await r.writeToInput(t.brand,a)}await s(600,1e3);const n=this.findInputByTitle("description","textarea");await r.writeToInput(t.description,n),await s(600,1e3),await this.writeTags(t.tags),await s(600,1e3);const o=this.findInputByTitle("sku");return await r.writeToInput(t.sku,o),t?.location&&(await s(600,1e3),await this.chooseLocation(t.location)),await s(300,500),await this.clickNext(),!0};handleRePublist=async t=>{console.log({item:t}),await r.waitForElement('[aria-label="Collection of your Marketplace items"]');const e=await this.getOptionEls(t);console.log({items:e}),this.clickItemInList(e,"edit"),await v(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await s(1e3,2e3),await this.clearImages(),await s(600,1e3),await this.uploadImages(t),await s(600,1e3);const i=this.findInputByTitle("title");r.writeToInput(t.title,i),await s(600,1e3);const n=this.findInputByTitle("price");r.writeToInput(String(t.price),n),await s(600,1e3),await this.chooseSelect(t.category,"category"),await s(600,1e3),await this.chooseSelect(t.condition,"condition",'[aria-label="Select an option"]'),await s(600,1e3);const o=this.findInputByTitle("description","textarea");return await r.writeToInput(t.description,o),await s(600,1e3),await this.writeTags(t.tags),await s(600,1e3),t?.location&&(await s(600,1e3),await this.chooseLocation(t.location)),!0};getProducts=async()=>{const t=await r.getElementByXPath(this.selectors.products),e=await r.getElementByXPath(this.selectors.products_fallback);console.log({products1:t,products2:e});const i=[t,e].filter(Boolean);return i.length===0?[]:i.flatMap(n=>this.extractListings(n))};extractListings(t){return Array.from(t.children).map(i=>{const o=i.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",a=document.querySelectorAll(`[aria-label="${o}"]`),d=Array.from(a).filter(p=>!p.querySelector("img"))[0],l=r.findNestedIcElement(d,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),w=l?parseFloat(l[0].replace(/,/g,"")):0;return{title:o,price:w,el:t}})}closeTab=async t=>{chrome.runtime.sendMessage({type:"close-tab",payload:t})};clickOptionOfProduct(t){const e=document.querySelector(`[aria-label="More options for ${t.title}"]`);if(!e)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${t.title}"]`}, ID: ${t.id}`);r.scrollToElement(e),e.click?.()}async getOptionEls(t){return this.clickOptionOfProduct(t),await v(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(t,e){const i=t.find(n=>n.textContent.toLocaleLowerCase().includes(e));if(!i)throw new Error(`Not found item ${e} in options list`);i.click?.()}getItemInList(t,e){const i=t.find(n=>n.textContent.toLocaleLowerCase().includes(e));if(!i)throw new Error(`Not found item ${e} in options list`);return i}handleDelete=async t=>{const e=await this.getOptionEls(t);console.log({items:e}),this.clickItemInList(e,"delete"),await v(1e3);const i=await r.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:i}),i?.click(),(await r.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(t,e=1e4){return new Promise((i,n)=>{const o=Date.now(),a=()=>{window.location.href.includes(t)?i():Date.now()-o>e?n(new Error("Timeout waiting for URL change")):setTimeout(a,500)};a()})}waitForPageReady(t,e,i=15e3){return new Promise((n,o)=>{const a=Date.now(),d=async()=>{window.location.href.includes(t)&&document.querySelector(e)?n():Date.now()-a>i?o(new Error("Timeout waiting for selling page ready")):setTimeout(d,500)};d()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await u.getProducts()};extractMarketplaceItemId(t){const e=t.match(/\/marketplace\/item\/(\d+)/);return e?e[1]:null}handleGetPublistID=async t=>{const e=await u.getProducts(),i=e.find(d=>d.title==t.title&&d.price==t.price);if(console.log({payload:t,product:i,products:e}),!i)return;i.el;const n=await this.getOptionEls(t),o=this.getItemInList(n,"view listing"),a=this.extractMarketplaceItemId(o.href);return this.clickOptionOfProduct(t),a};async gotoPublist(){(await r.getElementByXPath(this.selectors.new_item_btn))?.click(),await s(400,800),(await r.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const u=new m;export{u as f,r as t}; diff --git a/auto-post-facebook-extensions_1.0/assets/message.service-DcR3euAR.js b/auto-post-facebook-extensions_1.0/assets/message.service-DcR3euAR.js deleted file mode 100644 index 05c84e7..0000000 --- a/auto-post-facebook-extensions_1.0/assets/message.service-DcR3euAR.js +++ /dev/null @@ -1 +0,0 @@ -function h(n,e=[]){return Object.entries(n).reduce((r,[s,t])=>((t||e.includes(s))&&(r[s]=t),r),{})}function a(n){return new Promise(e=>setTimeout(e,n))}function l(n,e){const r=Math.floor(Math.random()*(e-n+1))+n;return a(r)}class u{role;listeners;constructor(e){this.role=e,this.listeners=new Map,chrome.runtime.onMessage.addListener((r,s,t)=>{if(r?.type&&this.listeners.has(r.type))return this.listeners.get(r.type)(r.payload,s,t),!0})}on(e,r){this.listeners.set(e,r)}send(e,r,s){const t={from:this.role,to:e,type:r,payload:s};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(t),this.role==="background"&&(e==="content"?chrome.tabs.query({active:!0,currentWindow:!0},o=>{o[0]?.id&&chrome.tabs.sendMessage(o[0].id,t,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):e==="popup"&&chrome.runtime.sendMessage(t,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(e,r,s){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const t={from:this.role,to:"content",type:r,payload:s};chrome.tabs.sendMessage(e,t,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${e}:`,chrome.runtime.lastError.message)})}waitForMessage(e,r=3e4){return new Promise((s,t)=>{let o;const i=c=>{clearTimeout(o),this.off(e,i),s(c)};o=setTimeout(()=>{this.off(e,i),t(new Error(`Timeout khi chờ message: ${e}`))},r),this.on(e,i)})}off(e,r){this.listeners.get(e)===r&&this.listeners.delete(e)}}export{u as M,l as a,a as d,h as r}; diff --git a/auto-post-facebook-extensions_1.0/assets/popup.js b/auto-post-facebook-extensions_1.0/assets/popup.js index f052147..3a6762f 100644 --- a/auto-post-facebook-extensions_1.0/assets/popup.js +++ b/auto-post-facebook-extensions_1.0/assets/popup.js @@ -1,181 +1 @@ -import{g as ch}from"./_commonjsHelpers-CqkleIqs.js";import{p as Sa}from"./product-api.service-Dn0sYl6J.js";import{d as kw,M as zw,r as Uw}from"./message.service-DcR3euAR.js";function Lw(n,a){for(var i=0;is[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();var od={exports:{}},$s={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Pg;function Vw(){if(Pg)return $s;Pg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(s,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:n,type:s,key:d,ref:o!==void 0?o:null,props:c}}return $s.Fragment=a,$s.jsx=i,$s.jsxs=i,$s}var Gg;function Bw(){return Gg||(Gg=1,od.exports=Vw()),od.exports}var y=Bw(),Cl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vr=typeof window>"u"||"Deno"in globalThis;function Wt(){}function Hw(n,a){return typeof n=="function"?n(a):n}function Nd(n){return typeof n=="number"&&n>=0&&n!==1/0}function rb(n,a){return Math.max(n+(a||0)-Date.now(),0)}function rr(n,a){return typeof n=="function"?n(a):n}function wn(n,a){return typeof n=="function"?n(a):n}function Fg(n,a){const{type:i="all",exact:s,fetchStatus:o,predicate:c,queryKey:d,stale:h}=n;if(d){if(s){if(a.queryHash!==fh(d,a.options))return!1}else if(!ol(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||o&&o!==a.state.fetchStatus||c&&!c(a))}function Zg(n,a){const{exact:i,status:s,predicate:o,mutationKey:c}=n;if(c){if(!a.options.mutationKey)return!1;if(i){if(ll(a.options.mutationKey)!==ll(c))return!1}else if(!ol(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||o&&!o(a))}function fh(n,a){return(a?.queryKeyHashFn||ll)(n)}function ll(n){return JSON.stringify(n,(a,i)=>jd(i)?Object.keys(i).sort().reduce((s,o)=>(s[o]=i[o],s),{}):i)}function ol(n,a){return n===a?!0:typeof n!=typeof a?!1:n&&a&&typeof n=="object"&&typeof a=="object"?Object.keys(a).every(i=>ol(n[i],a[i])):!1}function ib(n,a){if(n===a)return n;const i=Yg(n)&&Yg(a);if(i||jd(n)&&jd(a)){const s=i?n:Object.keys(n),o=s.length,c=i?a:Object.keys(a),d=c.length,h=i?[]:{},p=new Set(s);let m=0;for(let g=0;g{setTimeout(a,n)})}function kd(n,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,a):i.structuralSharing!==!1?ib(n,a):a}function Pw(n,a,i=0){const s=[...n,a];return i&&s.length>i?s.slice(1):s}function Gw(n,a,i=0){const s=[a,...n];return i&&s.length>i?s.slice(0,-1):s}var dh=Symbol();function sb(n,a){return!n.queryFn&&a?.initialPromise?()=>a.initialPromise:!n.queryFn||n.queryFn===dh?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Fw(n,a){return typeof n=="function"?n(...a):!!n}var Zw=class extends Cl{#t;#e;#n;constructor(){super(),this.#n=n=>{if(!Vr&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(n){this.#t!==n&&(this.#t=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},hh=new Zw,Yw=class extends Cl{#t=!0;#e;#n;constructor(){super(),this.#n=n=>{if(!Vr&&window.addEventListener){const a=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(this.setOnline.bind(this))}setOnline(n){this.#t!==n&&(this.#t=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#t}},uu=new Yw;function zd(){let n,a;const i=new Promise((o,c)=>{n=o,a=c});i.status="pending",i.catch(()=>{});function s(o){Object.assign(i,o),delete i.resolve,delete i.reject}return i.resolve=o=>{s({status:"fulfilled",value:o}),n(o)},i.reject=o=>{s({status:"rejected",reason:o}),a(o)},i}function Iw(n){return Math.min(1e3*2**n,3e4)}function lb(n){return(n??"online")==="online"?uu.isOnline():!0}var ob=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function ub(n){let a=!1,i=0,s;const o=zd(),c=()=>o.status!=="pending",d=_=>{c()||(w(new ob(_)),n.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>hh.isFocused()&&(n.networkMode==="always"||uu.isOnline())&&n.canRun(),g=()=>lb(n.networkMode)&&n.canRun(),S=_=>{c()||(s?.(),o.resolve(_))},w=_=>{c()||(s?.(),o.reject(_))},A=()=>new Promise(_=>{s=C=>{(c()||m())&&_(C)},n.onPause?.()}).then(()=>{s=void 0,c()||n.onContinue?.()}),O=()=>{if(c())return;let _;const C=i===0?n.initialPromise:void 0;try{_=C??n.fn()}catch(U){_=Promise.reject(U)}Promise.resolve(_).then(S).catch(U=>{if(c())return;const N=n.retry??(Vr?0:3),M=n.retryDelay??Iw,L=typeof M=="function"?M(i,U):M,B=N===!0||typeof N=="number"&&im()?void 0:A()).then(()=>{a?w(U):O()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(s?.(),o),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?O():A().then(O),o)}}var Qw=n=>setTimeout(n,0);function Xw(){let n=[],a=0,i=h=>{h()},s=h=>{h()},o=Qw;const c=h=>{a?n.push(h):o(()=>{i(h)})},d=()=>{const h=n;n=[],h.length&&o(()=>{s(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{o=h}}}var kt=Xw(),cb=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nd(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Vr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},Kw=class extends cb{#t;#e;#n;#a;#r;#l;#s;constructor(n){super(),this.#s=!1,this.#l=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#n=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=$w(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(n){this.options={...this.#l,...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,a){const i=kd(this.state.data,n,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(n,a){this.#i({type:"setState",state:n,setStateOptions:a})}cancel(n){const a=this.#r?.promise;return this.#r?.cancel(n),a?a.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(n=>wn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>rr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!rb(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(n,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(n&&this.setOptions(n),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},o=()=>{const h=sb(this.options,a),m=(()=>{const g={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return s(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#r=ub({initialPromise:a?.initialPromise,fn:d.fetchFn,abort:i.abort.bind(i),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof ob){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#e,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(n){const a=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...fb(i.data,this.options),fetchMeta:n.meta??null};case"success":const s={...i,data:n.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=n.manual?s:void 0,s;case"error":const o=n.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=a(this.state),kt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function fb(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lb(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function $w(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,i=a!==void 0,s=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Jw=class extends Cl{constructor(n={}){super(),this.config=n,this.#t=new Map}#t;build(n,a,i){const s=a.queryKey,o=a.queryHash??fh(s,a);let c=this.get(o);return c||(c=new Kw({client:n,queryKey:s,queryHash:o,options:n.defaultQueryOptions(a),state:i,defaultOptions:n.getQueryDefaults(s)}),this.add(c)),c}add(n){this.#t.has(n.queryHash)||(this.#t.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=this.#t.get(n.queryHash);a&&(n.destroy(),a===n&&this.#t.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){kt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#t.get(n)}getAll(){return[...this.#t.values()]}find(n){const a={exact:!0,...n};return this.getAll().find(i=>Fg(a,i))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(i=>Fg(n,i)):a}notify(n){kt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ww=class extends cb{#t;#e;#n;constructor(n){super(),this.mutationId=n.mutationId,this.#e=n.mutationCache,this.#t=[],this.state=n.state||e1(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(a=>a!==n),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(n){const a=()=>{this.#a({type:"continue"})};this.#n=ub({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#a({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)a();else{this.#a({type:"pending",variables:n,isPaused:s}),await this.#e.config.onMutate?.(n,this);const c=await this.options.onMutate?.(n);c!==this.state.context&&this.#a({type:"pending",context:c,variables:n,isPaused:s})}const o=await this.#n.start();return await this.#e.config.onSuccess?.(o,n,this.state.context,this),await this.options.onSuccess?.(o,n,this.state.context),await this.#e.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,n,this.state.context),this.#a({type:"success",data:o}),o}catch(o){try{throw await this.#e.config.onError?.(o,n,this.state.context,this),await this.options.onError?.(o,n,this.state.context),await this.#e.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,n,this.state.context),o}finally{this.#a({type:"error",error:o})}}finally{this.#e.runNext(this)}}#a(n){const a=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),kt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(n)}),this.#e.notify({mutation:this,type:"updated",action:n})})}};function e1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var t1=class extends Cl{constructor(n={}){super(),this.config=n,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(n,a,i){const s=new Ww({mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(a),state:i});return this.add(s),s}add(n){this.#t.add(n);const a=Io(n);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(n):this.#e.set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#t.delete(n)){const a=Io(n);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}else i[0]===n&&this.#e.delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=Io(n);if(typeof a=="string"){const s=this.#e.get(a)?.find(o=>o.state.status==="pending");return!s||s===n}else return!0}runNext(n){const a=Io(n);return typeof a=="string"?this.#e.get(a)?.find(s=>s!==n&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){kt.batch(()=>{this.#t.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(n){const a={exact:!0,...n};return this.getAll().find(i=>Zg(a,i))}findAll(n={}){return this.getAll().filter(a=>Zg(n,a))}notify(n){kt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return kt.batch(()=>Promise.all(n.map(a=>a.continue().catch(Wt))))}};function Io(n){return n.options.scope?.id}function Qg(n){return{onFetch:(a,i)=>{const s=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const S=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},w=sb(a.options,a.fetchOptions),A=async(O,_,C)=>{if(g)return Promise.reject();if(_==null&&O.pages.length)return Promise.resolve(O);const N=(()=>{const ne={client:a.client,queryKey:a.queryKey,pageParam:_,direction:C?"backward":"forward",meta:a.options.meta};return S(ne),ne})(),M=await w(N),{maxPages:L}=a.options,B=C?Gw:Pw;return{pages:B(O.pages,M,L),pageParams:B(O.pageParams,_,L)}};if(o&&c.length){const O=o==="backward",_=O?n1:Xg,C={pages:c,pageParams:d},U=_(s,C);h=await A(C,U,O)}else{const O=n??c.length;do{const _=p===0?d[0]??s.initialPageParam:Xg(s,h);if(p>0&&_==null)break;h=await A(h,_),p++}while(pa.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function Xg(n,{pages:a,pageParams:i}){const s=a.length-1;return a.length>0?n.getNextPageParam(a[s],a,i[s],i):void 0}function n1(n,{pages:a,pageParams:i}){return a.length>0?n.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var a1=class{#t;#e;#n;#a;#r;#l;#s;#i;constructor(n={}){this.#t=n.queryCache||new Jw,this.#e=n.mutationCache||new t1,this.#n=n.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=hh.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=uu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(n){return this.#t.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#e.findAll({...n,status:"pending"}).length}getQueryData(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),i=this.#t.build(this,a),s=i.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(rr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(n){return this.#t.findAll(n).map(({queryKey:a,state:i})=>{const s=i.data;return[a,s]})}setQueryData(n,a,i){const s=this.defaultQueryOptions({queryKey:n}),c=this.#t.get(s.queryHash)?.state.data,d=Hw(a,c);if(d!==void 0)return this.#t.build(this,s).setData(d,{...i,manual:!0})}setQueriesData(n,a,i){return kt.batch(()=>this.#t.findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,a,i)]))}getQueryState(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state}removeQueries(n){const a=this.#t;kt.batch(()=>{a.findAll(n).forEach(i=>{a.remove(i)})})}resetQueries(n,a){const i=this.#t;return kt.batch(()=>(i.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const i={revert:!0,...a},s=kt.batch(()=>this.#t.findAll(n).map(o=>o.cancel(i)));return Promise.all(s).then(Wt).catch(Wt)}invalidateQueries(n,a={}){return kt.batch(()=>(this.#t.findAll(n).forEach(i=>{i.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},a)))}refetchQueries(n,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},s=kt.batch(()=>this.#t.findAll(n).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,i);return i.throwOnError||(c=c.catch(Wt)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Wt)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(rr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Wt).catch(Wt)}fetchInfiniteQuery(n){return n.behavior=Qg(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Wt).catch(Wt)}ensureInfiniteQueryData(n){return n.behavior=Qg(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return uu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,a){this.#a.set(ll(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...this.#a.values()],i={};return a.forEach(s=>{ol(n,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(n,a){this.#r.set(ll(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...this.#r.values()],i={};return a.forEach(s=>{ol(n,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const a={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=fh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===dh&&(a.enabled=!1),a}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},r1=class extends Cl{constructor(n,a){super(),this.options=a,this.#t=n,this.#i=null,this.#s=zd(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#a=void 0;#r;#l;#s;#i;#p;#d;#h;#u;#c;#o;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Kg(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ud(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ud(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(n){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#e.setOptions(this.options),a._defaulted&&!Dd(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&$g(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||rr(this.options.staleTime,this.#e)!==rr(a.staleTime,this.#e))&&this.#v();const o=this.#g();s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||o!==this.#o)&&this.#y(o)}getOptimisticResult(n){const a=this.#t.getQueryCache().build(this.#t,n),i=this.createResult(a,n);return s1(this,i)&&(this.#a=i,this.#l=this.options,this.#r=this.#e.state),i}getCurrentResult(){return this.#a}trackResult(n,a){return new Proxy(n,{get:(i,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,s))})}trackProp(n){this.#m.add(n)}getCurrentQuery(){return this.#e}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=this.#t.defaultQueryOptions(n),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(n){return this.#f({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(n){this.#_();let a=this.#e.fetch(this.options,n);return n?.throwOnError||(a=a.catch(Wt)),a}#v(){this.#x();const n=rr(this.options.staleTime,this.#e);if(Vr||this.#a.isStale||!Nd(n))return;const i=rb(this.#a.dataUpdatedAt,n)+1;this.#u=setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(n){this.#S(),this.#o=n,!(Vr||wn(this.options.enabled,this.#e)===!1||!Nd(this.#o)||this.#o===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||hh.isFocused())&&this.#f()},this.#o))}#b(){this.#v(),this.#y(this.#g())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(n,a){const i=this.#e,s=this.options,o=this.#a,c=this.#r,d=this.#l,p=n!==i?n.state:this.#n,{state:m}=n;let g={...m},S=!1,w;if(a._optimisticResults){const z=this.hasListeners(),ae=!z&&Kg(n,a),oe=z&&$g(n,i,a,s);(ae||oe)&&(g={...g,...fb(m.data,n.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:A,errorUpdatedAt:O,status:_}=g;w=g.data;let C=!1;if(a.placeholderData!==void 0&&w===void 0&&_==="pending"){let z;o?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(z=o.data,C=!0):z=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,z!==void 0&&(_="success",w=kd(o?.data,z,a),S=!0)}if(a.select&&w!==void 0&&!C)if(o&&w===c?.data&&a.select===this.#p)w=this.#d;else try{this.#p=a.select,w=a.select(w),w=kd(o?.data,w,a),this.#d=w,this.#i=null}catch(z){this.#i=z}this.#i&&(A=this.#i,w=this.#d,O=Date.now(),_="error");const U=g.fetchStatus==="fetching",N=_==="pending",M=_==="error",L=N&&U,B=w!==void 0,Z={status:_,fetchStatus:g.fetchStatus,isPending:N,isSuccess:_==="success",isError:M,isInitialLoading:L,isLoading:L,data:w,dataUpdatedAt:g.dataUpdatedAt,error:A,errorUpdatedAt:O,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:U,isRefetching:U&&!N,isLoadingError:M&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:M&&B,isStale:mh(n,a),refetch:this.refetch,promise:this.#s,isEnabled:wn(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const z=Se=>{Z.status==="error"?Se.reject(Z.error):Z.data!==void 0&&Se.resolve(Z.data)},ae=()=>{const Se=this.#s=Z.promise=zd();z(Se)},oe=this.#s;switch(oe.status){case"pending":n.queryHash===i.queryHash&&z(oe);break;case"fulfilled":(Z.status==="error"||Z.data!==oe.value)&&ae();break;case"rejected":(Z.status!=="error"||Z.error!==oe.reason)&&ae();break}}return Z}updateResult(){const n=this.#a,a=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#l=this.options,this.#r.data!==void 0&&(this.#h=this.#e),Dd(a,n))return;this.#a=a;const i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#m.size)return!0;const c=new Set(o??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(d=>{const h=d;return this.#a[h]!==n[h]&&c.has(h)})};this.#w({listeners:i()})}#_(){const n=this.#t.getQueryCache().build(this.#t,this.options);if(n===this.#e)return;const a=this.#e;this.#e=n,this.#n=n.state,this.hasListeners()&&(a?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(n){kt.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function i1(n,a){return wn(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&a.retryOnMount===!1)}function Kg(n,a){return i1(n,a)||n.state.data!==void 0&&Ud(n,a,a.refetchOnMount)}function Ud(n,a,i){if(wn(a.enabled,n)!==!1&&rr(a.staleTime,n)!=="static"){const s=typeof i=="function"?i(n):i;return s==="always"||s!==!1&&mh(n,a)}return!1}function $g(n,a,i,s){return(n!==a||wn(s.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&mh(n,i)}function mh(n,a){return wn(a.enabled,n)!==!1&&n.isStaleByTime(rr(a.staleTime,n))}function s1(n,a){return!Dd(n.getCurrentResult(),a)}var ud={exports:{}},Ue={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jg;function l1(){if(Jg)return Ue;Jg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),S=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,_={};function C(T,Y,se){this.props=T,this.context=Y,this.refs=_,this.updater=se||A}C.prototype.isReactComponent={},C.prototype.setState=function(T,Y){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,Y,"setState")},C.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function U(){}U.prototype=C.prototype;function N(T,Y,se){this.props=T,this.context=Y,this.refs=_,this.updater=se||A}var M=N.prototype=new U;M.constructor=N,O(M,C.prototype),M.isPureReactComponent=!0;var L=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},ne=Object.prototype.hasOwnProperty;function Z(T,Y,se,W,ce,Re){return se=Re.ref,{$$typeof:n,type:T,key:Y,ref:se!==void 0?se:null,props:Re}}function z(T,Y){return Z(T.type,Y,void 0,void 0,void 0,T.props)}function ae(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function oe(T){var Y={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(se){return Y[se]})}var Se=/\/+/g;function re(T,Y){return typeof T=="object"&&T!==null&&T.key!=null?oe(""+T.key):Y.toString(36)}function ie(){}function ue(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ie,ie):(T.status="pending",T.then(function(Y){T.status==="pending"&&(T.status="fulfilled",T.value=Y)},function(Y){T.status==="pending"&&(T.status="rejected",T.reason=Y)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function me(T,Y,se,W,ce){var Re=typeof T;(Re==="undefined"||Re==="boolean")&&(T=null);var xe=!1;if(T===null)xe=!0;else switch(Re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(T.$$typeof){case n:case a:xe=!0;break;case g:return xe=T._init,me(xe(T._payload),Y,se,W,ce)}}if(xe)return ce=ce(T),xe=W===""?"."+re(T,0):W,L(ce)?(se="",xe!=null&&(se=xe.replace(Se,"$&/")+"/"),me(ce,Y,se,"",function(Xe){return Xe})):ce!=null&&(ae(ce)&&(ce=z(ce,se+(ce.key==null||T&&T.key===ce.key?"":(""+ce.key).replace(Se,"$&/")+"/")+xe)),Y.push(ce)),1;xe=0;var ee=W===""?".":W+":";if(L(T))for(var Te=0;Te{const a=b.useContext(hb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},u1=({client:n,children:a})=>(b.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),y.jsx(hb.Provider,{value:n,children:a})),mb=b.createContext(!1),c1=()=>b.useContext(mb);mb.Provider;function f1(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var d1=b.createContext(f1()),h1=()=>b.useContext(d1),m1=(n,a)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(a.isReset()||(n.retryOnMount=!1))},p1=n=>{b.useEffect(()=>{n.clearReset()},[n])},v1=({result:n,errorResetBoundary:a,throwOnError:i,query:s,suspense:o})=>n.isError&&!a.isReset()&&!n.isFetching&&s&&(o&&n.data===void 0||Fw(i,[n.error,s])),g1=n=>{if(n.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...s)=>a(i(...s)):a(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},y1=(n,a)=>n.isLoading&&n.isFetching&&!a,b1=(n,a)=>n?.suspense&&a.isPending,ey=(n,a,i)=>a.fetchOptimistic(n).catch(()=>{i.clearReset()});function x1(n,a,i){const s=c1(),o=h1(),c=o1(),d=c.defaultQueryOptions(n);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=s?"isRestoring":"optimistic",g1(d),m1(d,o),p1(o);const h=!c.getQueryCache().get(d.queryHash),[p]=b.useState(()=>new a(c,d)),m=p.getOptimisticResult(d),g=!s&&n.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(S=>{const w=g?p.subscribe(kt.batchCalls(S)):Wt;return p.updateResult(),w},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),b.useEffect(()=>{p.setOptions(d)},[d,p]),b1(d,m))throw ey(d,p,o);if(v1({result:m,errorResetBoundary:o,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Vr&&y1(m,s)&&(h?ey(d,p,o):c.getQueryCache().get(d.queryHash)?.promise)?.catch(Wt).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function Ld(n,a){return x1(n,r1)}const S1=new a1({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}});var cd={exports:{}},Js={},fd={exports:{}},dd={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ty;function _1(){return ty||(ty=1,(function(n){function a(j,I){var P=j.length;j.push(I);e:for(;0>>1,T=j[J];if(0>>1;Jo(W,P))ceo(Re,W)?(j[J]=Re,j[ce]=P,J=ce):(j[J]=W,j[se]=P,J=se);else if(ceo(Re,P))j[J]=Re,j[ce]=P,J=ce;else break e}}return I}function o(j,I){var P=j.sortIndex-I.sortIndex;return P!==0?P:j.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,S=null,w=3,A=!1,O=!1,_=!1,C=!1,U=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function L(j){for(var I=i(m);I!==null;){if(I.callback===null)s(m);else if(I.startTime<=j)s(m),I.sortIndex=I.expirationTime,a(p,I);else break;I=i(m)}}function B(j){if(_=!1,L(j),!O)if(i(p)!==null)O=!0,ne||(ne=!0,re());else{var I=i(m);I!==null&&me(B,I.startTime-j)}}var ne=!1,Z=-1,z=5,ae=-1;function oe(){return C?!0:!(n.unstable_now()-aej&&oe());){var J=S.callback;if(typeof J=="function"){S.callback=null,w=S.priorityLevel;var T=J(S.expirationTime<=j);if(j=n.unstable_now(),typeof T=="function"){S.callback=T,L(j),I=!0;break t}S===i(p)&&s(p),L(j)}else s(p);S=i(p)}if(S!==null)I=!0;else{var Y=i(m);Y!==null&&me(B,Y.startTime-j),I=!1}}break e}finally{S=null,w=P,A=!1}I=void 0}}finally{I?re():ne=!1}}}var re;if(typeof M=="function")re=function(){M(Se)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,ue=ie.port2;ie.port1.onmessage=Se,re=function(){ue.postMessage(null)}}else re=function(){U(Se,0)};function me(j,I){Z=U(function(){j(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_forceFrameRate=function(j){0>j||125J?(j.sortIndex=P,a(m,j),i(p)===null&&j===i(m)&&(_?(N(Z),Z=-1):_=!0,me(B,P-J))):(j.sortIndex=T,a(p,j),O||A||(O=!0,ne||(ne=!0,re()))),j},n.unstable_shouldYield=oe,n.unstable_wrapCallback=function(j){var I=w;return function(){var P=w;w=I;try{return j.apply(this,arguments)}finally{w=P}}}})(dd)),dd}var ny;function w1(){return ny||(ny=1,fd.exports=_1()),fd.exports}var hd={exports:{}},Vt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ay;function E1(){if(ay)return Vt;ay=1;var n=ph();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),hd.exports=E1(),hd.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var iy;function T1(){if(iy)return Js;iy=1;var n=w1(),a=ph(),i=pb();function s(e){var t="https://react.dev/errors/"+e;if(1T||(e.current=J[T],J[T]=null,T--)}function W(e,t){T++,J[T]=e.current,e.current=t}var ce=Y(null),Re=Y(null),xe=Y(null),ee=Y(null);function Te(e,t){switch(W(xe,t),W(Re,e),W(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vg(t),e=gg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}se(ce),W(ce,e)}function Xe(){se(ce),se(Re),se(xe)}function He(e){e.memoizedState!==null&&W(ee,e);var t=ce.current,r=gg(t,e.type);t!==r&&(W(Re,e),W(ce,r))}function Fe(e){Re.current===e&&(se(ce),se(Re)),ee.current===e&&(se(ee),Ys._currentValue=P)}var Ke=Object.prototype.hasOwnProperty,At=n.unstable_scheduleCallback,Yt=n.unstable_cancelCallback,Oa=n.unstable_shouldYield,mr=n.unstable_requestPaint,zt=n.unstable_now,Jh=n.unstable_getCurrentPriorityLevel,ts=n.unstable_ImmediatePriority,R=n.unstable_UserBlockingPriority,q=n.unstable_NormalPriority,X=n.unstable_LowPriority,pe=n.unstable_IdlePriority,fe=n.log,le=n.unstable_setDisableYieldValue,_e=null,ke=null;function Ze(e){if(typeof fe=="function"&&le(e),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(_e,e)}catch{}}var ot=Math.clz32?Math.clz32:Xu,Kr=Math.log,Ln=Math.LN2;function Xu(e){return e>>>=0,e===0?32:31-(Kr(e)/Ln|0)|0}var Ma=256,Na=4194304;function ea(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:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;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 pr(e,t,r){var l=e.pendingLanes;if(l===0)return 0;var u=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?u=ea(l):(v&=x,v!==0?u=ea(v):r||(r=x&~e,r!==0&&(u=ea(r))))):(x=l&~f,x!==0?u=ea(x):v!==0?u=ea(v):r||(r=l&~e,r!==0&&(u=ea(r)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,r=t&-t,f>=r||f===32&&(r&4194048)!==0)?t:u}function vr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zl(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 Wh(){var e=Ma;return Ma<<=1,(Ma&4194048)===0&&(Ma=256),e}function em(){var e=Na;return Na<<=1,(Na&62914560)===0&&(Na=4194304),e}function Ku(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ns(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _S(e,t,r,l,u,f){var v=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var x=e.entanglements,E=e.expirationTimes,H=e.hiddenUpdates;for(r=v&~r;0)":-1u||E[l]!==H[u]){var Q=` -`+E[l].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=l&&0<=u);break}}}finally{nc=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?ni(r):""}function RS(e){switch(e.tag){case 26:case 27:case 5:return ni(e.type);case 16:return ni("Lazy");case 13:return ni("Suspense");case 19:return ni("SuspenseList");case 0:case 15:return ac(e.type,!1);case 11:return ac(e.type.render,!1);case 1:return ac(e.type,!0);case 31:return ni("Activity");default:return""}}function cm(e){try{var t="";do t+=RS(e),e=e.return;while(e);return t}catch(r){return` -Error generating stack: `+r.message+` -`+r.stack}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OS(e){var t=fm(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(v){l=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){e._valueTracker||(e._valueTracker=OS(e))}function dm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=fm(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function Bl(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 MS=/[\n"\\]/g;function mn(e){return e.replace(MS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rc(e,t,r,l,u,f,v,x){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?ic(e,v,hn(t)):r!=null?ic(e,v,hn(r)):l!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+hn(x):e.removeAttribute("name")}function hm(e,t,r,l,u,f,v,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;r=r!=null?""+hn(r):"",t=t!=null?""+hn(t):r,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v)}function ic(e,t,r){t==="number"&&Bl(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function ai(e,t,r,l){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cc=!1;if(na)try{var ss={};Object.defineProperty(ss,"passive",{get:function(){cc=!0}}),window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{cc=!1}var ja=null,fc=null,ql=null;function xm(){if(ql)return ql;var e,t=fc,r=t.length,l,u="value"in ja?ja.value:ja.textContent,f=u.length;for(e=0;e=us),Am=" ",Cm=!1;function Rm(e,t){switch(e){case"keyup":return r_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Om(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var li=!1;function s_(e,t){switch(e){case"compositionend":return Om(t);case"keypress":return t.which!==32?null:(Cm=!0,Am);case"textInput":return e=t.data,e===Am&&Cm?null:e;default:return null}}function l_(e,t){if(li)return e==="compositionend"||!vc&&Rm(e,t)?(e=xm(),ql=fc=ja=null,li=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Lm(r)}}function Bm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bl(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Bl(e.document)}return t}function bc(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 p_=na&&"documentMode"in document&&11>=document.documentMode,oi=null,xc=null,hs=null,Sc=!1;function qm(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sc||oi==null||oi!==Bl(l)||(l=oi,"selectionStart"in l&&bc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),hs&&ds(hs,l)||(hs=l,l=Do(xc,"onSelect"),0>=v,u-=v,ra=1<<32-ot(t)+u|r<f?f:8;var v=j.T,x={};j.T=x,lf(e,!1,t,r);try{var E=u(),H=j.S;if(H!==null&&H(x,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var Q=E_(E,l);Rs(e,t,Q,sn(e))}else Rs(e,t,l,sn(e))}catch($){Rs(e,t,{then:function(){},status:"rejected",reason:$},sn())}finally{I.p=f,j.T=v}}function O_(){}function rf(e,t,r,l){if(e.tag!==5)throw Error(s(476));var u=Pp(e).queue;qp(e,u,t,P,r===null?O_:function(){return Gp(e),r(l)})}function Pp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:P},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gp(e){var t=Pp(e).next.queue;Rs(e,t,{},sn())}function sf(){return Lt(Ys)}function Fp(){return xt().memoizedState}function Zp(){return xt().memoizedState}function M_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=sn();e=Ua(r);var l=La(t,e,r);l!==null&&(ln(l,t,r),_s(l,t,r)),t={cache:zc()},e.payload=t;return}t=t.return}}function N_(e,t,r){var l=sn();r={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},fo(e)?Ip(t,r):(r=Tc(e,t,r,l),r!==null&&(ln(r,e,l),Qp(r,t,l)))}function Yp(e,t,r){var l=sn();Rs(e,t,r,l)}function Rs(e,t,r,l){var u={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(fo(e))Ip(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,x=f(v,r);if(u.hasEagerState=!0,u.eagerState=x,en(x,v))return Ql(e,t,u,0),ut===null&&Il(),!1}catch{}finally{}if(r=Tc(e,t,u,l),r!==null)return ln(r,e,l),Qp(r,t,l),!0}return!1}function lf(e,t,r,l){if(l={lane:2,revertLane:Bf(),action:l,hasEagerState:!1,eagerState:null,next:null},fo(e)){if(t)throw Error(s(479))}else t=Tc(e,r,l,2),t!==null&&ln(t,e,2)}function fo(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function Ip(e,t){yi=io=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Qp(e,t,r){if((r&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,nm(e,r)}}var ho={readContext:Lt,use:lo,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},Xp={readContext:Lt,use:lo,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Dp,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,co(4194308,4,Up.bind(null,t,e),r)},useLayoutEffect:function(e,t){return co(4194308,4,e,t)},useInsertionEffect:function(e,t){co(4,2,e,t)},useMemo:function(e,t){var r=Xt();t=t===void 0?null:t;var l=e();if(Or){Ze(!0);try{e()}finally{Ze(!1)}}return r.memoizedState=[l,t],l},useReducer:function(e,t,r){var l=Xt();if(r!==void 0){var u=r(t);if(Or){Ze(!0);try{r(t)}finally{Ze(!1)}}}else u=t;return l.memoizedState=l.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},l.queue=e,e=e.dispatch=N_.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=ef(e);var t=e.queue,r=Yp.bind(null,Ve,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:nf,useDeferredValue:function(e,t){var r=Xt();return af(r,e,t)},useTransition:function(){var e=ef(!1);return e=qp.bind(null,Ve,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var l=Ve,u=Xt();if(Je){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),ut===null)throw Error(s(349));(Ie&124)!==0||vp(l,t,r)}u.memoizedState=r;var f={value:r,getSnapshot:t};return u.queue=f,Dp(yp.bind(null,l,f,e),[e]),l.flags|=2048,xi(9,uo(),gp.bind(null,l,f,r,t),null),r},useId:function(){var e=Xt(),t=ut.identifierPrefix;if(Je){var r=ia,l=ra;r=(l&~(1<<32-ot(l)-1)).toString(32)+r,t="«"+t+"R"+r,r=so++,0Oe?(Mt=Ee,Ee=null):Mt=Ee.sibling;var $e=G(k,Ee,V[Oe],K);if($e===null){Ee===null&&(Ee=Mt);break}e&&Ee&&$e.alternate===null&&t(k,Ee),D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e,Ee=Mt}if(Oe===V.length)return r(k,Ee),Je&&wr(k,Oe),ge;if(Ee===null){for(;OeOe?(Mt=Ee,Ee=null):Mt=Ee.sibling;var er=G(k,Ee,$e.value,K);if(er===null){Ee===null&&(Ee=Mt);break}e&&Ee&&er.alternate===null&&t(k,Ee),D=f(er,D,Oe),qe===null?ge=er:qe.sibling=er,qe=er,Ee=Mt}if($e.done)return r(k,Ee),Je&&wr(k,Oe),ge;if(Ee===null){for(;!$e.done;Oe++,$e=V.next())$e=$(k,$e.value,K),$e!==null&&(D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e);return Je&&wr(k,Oe),ge}for(Ee=l(Ee);!$e.done;Oe++,$e=V.next())$e=F(Ee,k,Oe,$e.value,K),$e!==null&&(e&&$e.alternate!==null&&Ee.delete($e.key===null?Oe:$e.key),D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e);return e&&Ee.forEach(function(jw){return t(k,jw)}),Je&&wr(k,Oe),ge}function it(k,D,V,K){if(typeof V=="object"&&V!==null&&V.type===O&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var ge=V.key;D!==null;){if(D.key===ge){if(ge=V.type,ge===O){if(D.tag===7){r(k,D.sibling),K=u(D,V.props.children),K.return=k,k=K;break e}}else if(D.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===z&&$p(ge)===D.type){r(k,D.sibling),K=u(D,V.props),Ms(K,V),K.return=k,k=K;break e}r(k,D);break}else t(k,D);D=D.sibling}V.type===O?(K=Sr(V.props.children,k.mode,K,V.key),K.return=k,k=K):(K=Kl(V.type,V.key,V.props,null,k.mode,K),Ms(K,V),K.return=k,k=K)}return v(k);case A:e:{for(ge=V.key;D!==null;){if(D.key===ge)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){r(k,D.sibling),K=u(D,V.children||[]),K.return=k,k=K;break e}else{r(k,D);break}else t(k,D);D=D.sibling}K=Rc(V,k.mode,K),K.return=k,k=K}return v(k);case z:return ge=V._init,V=ge(V._payload),it(k,D,V,K)}if(me(V))return De(k,D,V,K);if(re(V)){if(ge=re(V),typeof ge!="function")throw Error(s(150));return V=ge.call(V),Ce(k,D,V,K)}if(typeof V.then=="function")return it(k,D,mo(V),K);if(V.$$typeof===M)return it(k,D,eo(k,V),K);po(k,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(r(k,D.sibling),K=u(D,V),K.return=k,k=K):(r(k,D),K=Cc(V,k.mode,K),K.return=k,k=K),v(k)):r(k,D)}return function(k,D,V,K){try{Os=0;var ge=it(k,D,V,K);return Si=null,ge}catch(Ee){if(Ee===xs||Ee===no)throw Ee;var qe=tn(29,Ee,null,k.mode);return qe.lanes=K,qe.return=k,qe}finally{}}}var _i=Jp(!0),Wp=Jp(!1),bn=Y(null),Bn=null;function Ba(e){var t=e.alternate;W(wt,wt.current&1),W(bn,e),Bn===null&&(t===null||gi.current!==null||t.memoizedState!==null)&&(Bn=e)}function ev(e){if(e.tag===22){if(W(wt,wt.current),W(bn,e),Bn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Bn=e)}}else Ha()}function Ha(){W(wt,wt.current),W(bn,bn.current)}function ua(e){se(bn),Bn===e&&(Bn=null),se(wt)}var wt=Y(0);function vo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||$f(r)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function of(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:g({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var uf={enqueueSetState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Ua(l);u.payload=t,r!=null&&(u.callback=r),t=La(e,u,l),t!==null&&(ln(t,e,l),_s(t,e,l))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Ua(l);u.tag=1,u.payload=t,r!=null&&(u.callback=r),t=La(e,u,l),t!==null&&(ln(t,e,l),_s(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=sn(),l=Ua(r);l.tag=2,t!=null&&(l.callback=t),t=La(e,l,r),t!==null&&(ln(t,e,r),_s(t,e,r))}};function tv(e,t,r,l,u,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!ds(r,l)||!ds(u,f):!0}function nv(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&uf.enqueueReplaceState(t,t.state,null)}function Mr(e,t){var r=t;if("ref"in t){r={};for(var l in t)l!=="ref"&&(r[l]=t[l])}if(e=e.defaultProps){r===t&&(r=g({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}var go=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)};function av(e){go(e)}function rv(e){console.error(e)}function iv(e){go(e)}function yo(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function sv(e,t,r){try{var l=e.onCaughtError;l(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function cf(e,t,r){return r=Ua(r),r.tag=3,r.payload={element:null},r.callback=function(){yo(e,t)},r}function lv(e){return e=Ua(e),e.tag=3,e}function ov(e,t,r,l){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=l.value;e.payload=function(){return u(f)},e.callback=function(){sv(t,r,l)}}var v=r.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){sv(t,r,l),typeof u!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function j_(e,t,r,l,u){if(r.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=r.alternate,t!==null&&gs(t,r,u,!0),r=bn.current,r!==null){switch(r.tag){case 13:return Bn===null?kf():r.alternate===null&&mt===0&&(mt=3),r.flags&=-257,r.flags|=65536,r.lanes=u,l===Vc?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([l]):t.add(l),Uf(e,l,u)),!1;case 22:return r.flags|=65536,l===Vc?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([l]):r.add(l)),Uf(e,l,u)),!1}throw Error(s(435,r.tag))}return Uf(e,l,u),kf(),!1}if(Je)return t=bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,l!==Nc&&(e=Error(s(422),{cause:l}),vs(pn(e,r)))):(l!==Nc&&(t=Error(s(423),{cause:l}),vs(pn(t,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,l=pn(l,r),u=cf(e.stateNode,l,u),qc(e,u),mt!==4&&(mt=2)),!1;var f=Error(s(520),{cause:l});if(f=pn(f,r),Ls===null?Ls=[f]:Ls.push(f),mt!==4&&(mt=2),t===null)return!0;l=pn(l,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=cf(r.stateNode,l,e),qc(r,e),!1;case 1:if(t=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ya===null||!Ya.has(f))))return r.flags|=65536,u&=-u,r.lanes|=u,u=lv(u),ov(u,e,r,l),qc(r,u),!1}r=r.return}while(r!==null);return!1}var uv=Error(s(461)),Rt=!1;function Nt(e,t,r,l){t.child=e===null?Wp(t,null,r,l):_i(t,e.child,r,l)}function cv(e,t,r,l,u){r=r.render;var f=t.ref;if("ref"in l){var v={};for(var x in l)x!=="ref"&&(v[x]=l[x])}else v=l;return Cr(t),l=Yc(e,t,r,v,f,u),x=Ic(),e!==null&&!Rt?(Qc(e,t,u),ca(e,t,u)):(Je&&x&&Oc(t),t.flags|=1,Nt(e,t,l,u),t.child)}function fv(e,t,r,l,u){if(e===null){var f=r.type;return typeof f=="function"&&!Ac(f)&&f.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=f,dv(e,t,f,l,u)):(e=Kl(r.type,null,l,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!yf(e,u)){var v=f.memoizedProps;if(r=r.compare,r=r!==null?r:ds,r(v,l)&&e.ref===t.ref)return ca(e,t,u)}return t.flags|=1,e=aa(f,l),e.ref=t.ref,e.return=t,t.child=e}function dv(e,t,r,l,u){if(e!==null){var f=e.memoizedProps;if(ds(f,l)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=l=f,yf(e,u))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,ca(e,t,u)}return ff(e,t,r,l,u)}function hv(e,t,r){var l=t.pendingProps,u=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=f!==null?f.baseLanes|r:r,e!==null){for(u=t.child=e.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;t.childLanes=f&~l}else t.childLanes=0,t.child=null;return mv(e,t,l,r)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&to(t,f!==null?f.cachePool:null),f!==null?dp(t,f):Gc(),ev(t);else return t.lanes=t.childLanes=536870912,mv(e,t,f!==null?f.baseLanes|r:r,r)}else f!==null?(to(t,f.cachePool),dp(t,f),Ha(),t.memoizedState=null):(e!==null&&to(t,null),Gc(),Ha());return Nt(e,t,u,r),t.child}function mv(e,t,r,l){var u=Lc();return u=u===null?null:{parent:_t._currentValue,pool:u},t.memoizedState={baseLanes:r,cachePool:u},e!==null&&to(t,null),Gc(),ev(t),e!==null&&gs(e,t,l,!0),null}function bo(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function ff(e,t,r,l,u){return Cr(t),r=Yc(e,t,r,l,void 0,u),l=Ic(),e!==null&&!Rt?(Qc(e,t,u),ca(e,t,u)):(Je&&l&&Oc(t),t.flags|=1,Nt(e,t,r,u),t.child)}function pv(e,t,r,l,u,f){return Cr(t),t.updateQueue=null,r=mp(t,l,r,u),hp(e),l=Ic(),e!==null&&!Rt?(Qc(e,t,f),ca(e,t,f)):(Je&&l&&Oc(t),t.flags|=1,Nt(e,t,r,f),t.child)}function vv(e,t,r,l,u){if(Cr(t),t.stateNode===null){var f=di,v=r.contextType;typeof v=="object"&&v!==null&&(f=Lt(v)),f=new r(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=uf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},Bc(t),v=r.contextType,f.context=typeof v=="object"&&v!==null?Lt(v):di,f.state=t.memoizedState,v=r.getDerivedStateFromProps,typeof v=="function"&&(of(t,r,v,l),f.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&uf.enqueueReplaceState(f,f.state,null),Es(t,l,f,u),ws(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var x=t.memoizedProps,E=Mr(r,x);f.props=E;var H=f.context,Q=r.contextType;v=di,typeof Q=="object"&&Q!==null&&(v=Lt(Q));var $=r.getDerivedStateFromProps;Q=typeof $=="function"||typeof f.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,Q||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x||H!==v)&&nv(t,f,l,v),za=!1;var G=t.memoizedState;f.state=G,Es(t,l,f,u),ws(),H=t.memoizedState,x||G!==H||za?(typeof $=="function"&&(of(t,r,$,l),H=t.memoizedState),(E=za||tv(t,r,E,l,G,H,v))?(Q||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=H),f.props=l,f.state=H,f.context=v,l=E):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,Hc(e,t),v=t.memoizedProps,Q=Mr(r,v),f.props=Q,$=t.pendingProps,G=f.context,H=r.contextType,E=di,typeof H=="object"&&H!==null&&(E=Lt(H)),x=r.getDerivedStateFromProps,(H=typeof x=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==$||G!==E)&&nv(t,f,l,E),za=!1,G=t.memoizedState,f.state=G,Es(t,l,f,u),ws();var F=t.memoizedState;v!==$||G!==F||za||e!==null&&e.dependencies!==null&&Wl(e.dependencies)?(typeof x=="function"&&(of(t,r,x,l),F=t.memoizedState),(Q=za||tv(t,r,Q,l,G,F,E)||e!==null&&e.dependencies!==null&&Wl(e.dependencies))?(H||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,F,E),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,F,E)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=F),f.props=l,f.state=F,f.context=E,l=Q):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,bo(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,r=l&&typeof r.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=_i(t,e.child,null,u),t.child=_i(t,null,r,u)):Nt(e,t,r,u),t.memoizedState=f.state,e=t.child):e=ca(e,t,u),e}function gv(e,t,r,l){return ps(),t.flags|=256,Nt(e,t,r,l),t.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hf(e){return{baseLanes:e,cachePool:rp()}}function mf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=xn),e}function yv(e,t,r){var l=t.pendingProps,u=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),v&&(u=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(u?Ba(t):Ha(),Je){var x=ht,E;if(E=x){e:{for(E=x,x=Vn;E.nodeType!==8;){if(!x){x=null;break e}if(E=Cn(E.nextSibling),E===null){x=null;break e}}x=E}x!==null?(t.memoizedState={dehydrated:x,treeContext:_r!==null?{id:ra,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},E=tn(18,null,null,0),E.stateNode=x,E.return=t,t.child=E,qt=t,ht=null,E=!0):E=!1}E||Tr(t)}if(x=t.memoizedState,x!==null&&(x=x.dehydrated,x!==null))return $f(x)?t.lanes=32:t.lanes=536870912,null;ua(t)}return x=l.children,l=l.fallback,u?(Ha(),u=t.mode,x=xo({mode:"hidden",children:x},u),l=Sr(l,u,r,null),x.return=t,l.return=t,x.sibling=l,t.child=x,u=t.child,u.memoizedState=hf(r),u.childLanes=mf(e,v,r),t.memoizedState=df,l):(Ba(t),pf(t,x))}if(E=e.memoizedState,E!==null&&(x=E.dehydrated,x!==null)){if(f)t.flags&256?(Ba(t),t.flags&=-257,t=vf(e,t,r)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),u=l.fallback,x=t.mode,l=xo({mode:"visible",children:l.children},x),u=Sr(u,x,r,null),u.flags|=2,l.return=t,u.return=t,l.sibling=u,t.child=l,_i(t,e.child,null,r),l=t.child,l.memoizedState=hf(r),l.childLanes=mf(e,v,r),t.memoizedState=df,t=u);else if(Ba(t),$f(x)){if(v=x.nextSibling&&x.nextSibling.dataset,v)var H=v.dgst;v=H,l=Error(s(419)),l.stack="",l.digest=v,vs({value:l,source:null,stack:null}),t=vf(e,t,r)}else if(Rt||gs(e,t,r,!1),v=(r&e.childLanes)!==0,Rt||v){if(v=ut,v!==null&&(l=r&-r,l=(l&42)!==0?1:$u(l),l=(l&(v.suspendedLanes|r))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,fi(e,l),ln(v,e,l),uv;x.data==="$?"||kf(),t=vf(e,t,r)}else x.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,ht=Cn(x.nextSibling),qt=t,Je=!0,Er=null,Vn=!1,e!==null&&(gn[yn++]=ra,gn[yn++]=ia,gn[yn++]=_r,ra=e.id,ia=e.overflow,_r=t),t=pf(t,l.children),t.flags|=4096);return t}return u?(Ha(),u=l.fallback,x=t.mode,E=e.child,H=E.sibling,l=aa(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,H!==null?u=aa(H,u):(u=Sr(u,x,r,null),u.flags|=2),u.return=t,l.return=t,l.sibling=u,t.child=l,l=u,u=t.child,x=e.child.memoizedState,x===null?x=hf(r):(E=x.cachePool,E!==null?(H=_t._currentValue,E=E.parent!==H?{parent:H,pool:H}:E):E=rp(),x={baseLanes:x.baseLanes|r,cachePool:E}),u.memoizedState=x,u.childLanes=mf(e,v,r),t.memoizedState=df,l):(Ba(t),r=e.child,e=r.sibling,r=aa(r,{mode:"visible",children:l.children}),r.return=t,r.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=r,t.memoizedState=null,r)}function pf(e,t){return t=xo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xo(e,t){return e=tn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function vf(e,t,r){return _i(t,e.child,null,r),e=pf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bv(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),jc(e.return,t,r)}function gf(e,t,r,l,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=r,f.tailMode=u)}function xv(e,t,r){var l=t.pendingProps,u=l.revealOrder,f=l.tail;if(Nt(e,t,l.children,r),l=wt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bv(e,r,t);else if(e.tag===19)bv(e,r,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}l&=1}switch(W(wt,l),u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&vo(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),gf(t,!1,u,r,f);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vo(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}gf(t,!0,r,null,f);break;case"together":gf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Za|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(gs(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=aa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=aa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function yf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wl(e)))}function k_(e,t,r){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ka(t,_t,e.memoizedState.cache),ps();break;case 27:case 5:He(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ka(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ba(t),t.flags|=128,null):(r&t.child.childLanes)!==0?yv(e,t,r):(Ba(t),e=ca(e,t,r),e!==null?e.sibling:null);Ba(t);break;case 19:var u=(e.flags&128)!==0;if(l=(r&t.childLanes)!==0,l||(gs(e,t,r,!1),l=(r&t.childLanes)!==0),u){if(l)return xv(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),W(wt,wt.current),l)break;return null;case 22:case 23:return t.lanes=0,hv(e,t,r);case 24:ka(t,_t,e.memoizedState.cache)}return ca(e,t,r)}function Sv(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!yf(e,r)&&(t.flags&128)===0)return Rt=!1,k_(e,t,r);Rt=(e.flags&131072)!==0}else Rt=!1,Je&&(t.flags&1048576)!==0&&$m(t,Jl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,u=l._init;if(l=u(l._payload),t.type=l,typeof l=="function")Ac(l)?(e=Mr(l,e),t.tag=1,t=vv(null,t,l,e,r)):(t.tag=0,t=ff(null,t,l,e,r));else{if(l!=null){if(u=l.$$typeof,u===L){t.tag=11,t=cv(null,t,l,e,r);break e}else if(u===Z){t.tag=14,t=fv(null,t,l,e,r);break e}}throw t=ue(l)||l,Error(s(306,t,""))}}return t;case 0:return ff(e,t,t.type,t.pendingProps,r);case 1:return l=t.type,u=Mr(l,t.pendingProps),vv(e,t,l,u,r);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var f=t.memoizedState;u=f.element,Hc(e,t),Es(t,l,null,r);var v=t.memoizedState;if(l=v.cache,ka(t,_t,l),l!==f.cache&&kc(t,[_t],r,!0),ws(),l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=gv(e,t,l,r);break e}else if(l!==u){u=pn(Error(s(424)),t),vs(u),t=gv(e,t,l,r);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(ht=Cn(e.firstChild),qt=t,Je=!0,Er=null,Vn=!0,r=Wp(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ps(),l===u){t=ca(e,t,r);break e}Nt(e,t,l,r)}t=t.child}return t;case 26:return bo(e,t),e===null?(r=Tg(t.type,null,t.pendingProps,null))?t.memoizedState=r:Je||(r=t.type,e=t.pendingProps,l=ko(xe.current).createElement(r),l[Ut]=t,l[It]=e,jt(l,r,e),Ct(l),t.stateNode=l):t.memoizedState=Tg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return He(t),e===null&&Je&&(l=t.stateNode=_g(t.type,t.pendingProps,xe.current),qt=t,Vn=!0,u=ht,Xa(t.type)?(Jf=u,ht=Cn(l.firstChild)):ht=u),Nt(e,t,t.pendingProps.children,r),bo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((u=l=ht)&&(l=ow(l,t.type,t.pendingProps,Vn),l!==null?(t.stateNode=l,qt=t,ht=Cn(l.firstChild),Vn=!1,u=!0):u=!1),u||Tr(t)),He(t),u=t.type,f=t.pendingProps,v=e!==null?e.memoizedProps:null,l=f.children,Qf(u,f)?l=null:v!==null&&Qf(u,v)&&(t.flags|=32),t.memoizedState!==null&&(u=Yc(e,t,A_,null,null,r),Ys._currentValue=u),bo(e,t),Nt(e,t,l,r),t.child;case 6:return e===null&&Je&&((e=r=ht)&&(r=uw(r,t.pendingProps,Vn),r!==null?(t.stateNode=r,qt=t,ht=null,e=!0):e=!1),e||Tr(t)),null;case 13:return yv(e,t,r);case 4:return Te(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=_i(t,null,l,r):Nt(e,t,l,r),t.child;case 11:return cv(e,t,t.type,t.pendingProps,r);case 7:return Nt(e,t,t.pendingProps,r),t.child;case 8:return Nt(e,t,t.pendingProps.children,r),t.child;case 12:return Nt(e,t,t.pendingProps.children,r),t.child;case 10:return l=t.pendingProps,ka(t,t.type,l.value),Nt(e,t,l.children,r),t.child;case 9:return u=t.type._context,l=t.pendingProps.children,Cr(t),u=Lt(u),l=l(u),t.flags|=1,Nt(e,t,l,r),t.child;case 14:return fv(e,t,t.type,t.pendingProps,r);case 15:return dv(e,t,t.type,t.pendingProps,r);case 19:return xv(e,t,r);case 31:return l=t.pendingProps,r=t.mode,l={mode:l.mode,children:l.children},e===null?(r=xo(l,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=aa(e.child,l),r.ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return hv(e,t,r);case 24:return Cr(t),l=Lt(_t),e===null?(u=Lc(),u===null&&(u=ut,f=zc(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=r),u=f),t.memoizedState={parent:l,cache:u},Bc(t),ka(t,_t,u)):((e.lanes&r)!==0&&(Hc(e,t),Es(t,null,null,r),ws()),u=e.memoizedState,f=t.memoizedState,u.parent!==l?(u={parent:l,cache:l},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ka(t,_t,l)):(l=f.cache,ka(t,_t,l),l!==u.cache&&kc(t,[_t],r,!0))),Nt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function fa(e){e.flags|=4}function _v(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Mg(t)){if(t=bn.current,t!==null&&((Ie&4194048)===Ie?Bn!==null:(Ie&62914560)!==Ie&&(Ie&536870912)===0||t!==Bn))throw Ss=Vc,ip;e.flags|=8192}}function So(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?em():536870912,e.lanes|=t,Ai|=t)}function Ns(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags&65011712,l|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function z_(e,t,r){var l=t.pendingProps;switch(Mc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return r=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),la(_t),Xe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ms(t)?fa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ep())),ft(t),null;case 26:return r=t.memoizedState,e===null?(fa(t),r!==null?(ft(t),_v(t,r)):(ft(t),t.flags&=-16777217)):r?r!==e.memoizedState?(fa(t),ft(t),_v(t,r)):(ft(t),t.flags&=-16777217):(e.memoizedProps!==l&&fa(t),ft(t),t.flags&=-16777217),null;case 27:Fe(t),r=xe.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fa(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}e=ce.current,ms(t)?Jm(t):(e=_g(u,l,r),t.stateNode=e,fa(t))}return ft(t),null;case 5:if(Fe(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fa(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}if(e=ce.current,ms(t))Jm(t);else{switch(u=ko(xe.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":e=u.createElement("div"),e.innerHTML=" - - - - + + + + +
diff --git a/auto-post-facebook-extensions_1.0/manifest.json b/auto-post-facebook-extensions_1.0/manifest.json index 307f3a8..9bb331e 100644 --- a/auto-post-facebook-extensions_1.0/manifest.json +++ b/auto-post-facebook-extensions_1.0/manifest.json @@ -9,6 +9,7 @@ "service_worker": "background/background.js", "type": "module" }, + "host_permissions": ["http://172.16.7.48/*"], "content_scripts": [ { "matches": [""], @@ -16,6 +17,12 @@ "type": "module" } ], + "web_accessible_resources": [ + { + "resources": ["content/inject-ui.js", "assets/*"], + "matches": [""] + } + ], "permissions": ["storage", "tabs", "activeTab", "scripting"] } diff --git a/package-lock.json b/package-lock.json index 1df8e81..31d1d2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,8 @@ "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tabs": "^1.1.13", + "@radix-ui/react-toggle": "^1.1.10", + "@radix-ui/react-toggle-group": "^1.1.11", "@tailwindcss/vite": "^4.1.12", "@tanstack/react-query": "^5.85.5", "axios": "^1.11.0", @@ -1538,6 +1540,60 @@ } } }, + "node_modules/@radix-ui/react-toggle": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz", + "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-toggle-group": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.11.tgz", + "integrity": "sha512-5umnS0T8JQzQT6HbPyO7Hh9dgd82NmS36DQr+X/YJ9ctFNCiiQd6IJAYYZ33LUwm8M+taCz5t2ui29fHZc4Y6Q==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.11", + "@radix-ui/react-toggle": "1.1.10", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-use-callback-ref": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz", diff --git a/package.json b/package.json index a8607af..2936ffc 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tabs": "^1.1.13", + "@radix-ui/react-toggle": "^1.1.10", + "@radix-ui/react-toggle-group": "^1.1.11", "@tailwindcss/vite": "^4.1.12", "@tanstack/react-query": "^5.85.5", "axios": "^1.11.0", diff --git a/public/manifest.json b/public/manifest.json index 307f3a8..9bb331e 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -9,6 +9,7 @@ "service_worker": "background/background.js", "type": "module" }, + "host_permissions": ["http://172.16.7.48/*"], "content_scripts": [ { "matches": [""], @@ -16,6 +17,12 @@ "type": "module" } ], + "web_accessible_resources": [ + { + "resources": ["content/inject-ui.js", "assets/*"], + "matches": [""] + } + ], "permissions": ["storage", "tabs", "activeTab", "scripting"] } diff --git a/releases/auto-post-facebook-extensions_1.0/assets/popup.js b/releases/auto-post-facebook-extensions_1.0/assets/popup.js index f052147..3a6762f 100644 --- a/releases/auto-post-facebook-extensions_1.0/assets/popup.js +++ b/releases/auto-post-facebook-extensions_1.0/assets/popup.js @@ -1,181 +1 @@ -import{g as ch}from"./_commonjsHelpers-CqkleIqs.js";import{p as Sa}from"./product-api.service-Dn0sYl6J.js";import{d as kw,M as zw,r as Uw}from"./message.service-DcR3euAR.js";function Lw(n,a){for(var i=0;is[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();var od={exports:{}},$s={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Pg;function Vw(){if(Pg)return $s;Pg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(s,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:n,type:s,key:d,ref:o!==void 0?o:null,props:c}}return $s.Fragment=a,$s.jsx=i,$s.jsxs=i,$s}var Gg;function Bw(){return Gg||(Gg=1,od.exports=Vw()),od.exports}var y=Bw(),Cl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vr=typeof window>"u"||"Deno"in globalThis;function Wt(){}function Hw(n,a){return typeof n=="function"?n(a):n}function Nd(n){return typeof n=="number"&&n>=0&&n!==1/0}function rb(n,a){return Math.max(n+(a||0)-Date.now(),0)}function rr(n,a){return typeof n=="function"?n(a):n}function wn(n,a){return typeof n=="function"?n(a):n}function Fg(n,a){const{type:i="all",exact:s,fetchStatus:o,predicate:c,queryKey:d,stale:h}=n;if(d){if(s){if(a.queryHash!==fh(d,a.options))return!1}else if(!ol(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||o&&o!==a.state.fetchStatus||c&&!c(a))}function Zg(n,a){const{exact:i,status:s,predicate:o,mutationKey:c}=n;if(c){if(!a.options.mutationKey)return!1;if(i){if(ll(a.options.mutationKey)!==ll(c))return!1}else if(!ol(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||o&&!o(a))}function fh(n,a){return(a?.queryKeyHashFn||ll)(n)}function ll(n){return JSON.stringify(n,(a,i)=>jd(i)?Object.keys(i).sort().reduce((s,o)=>(s[o]=i[o],s),{}):i)}function ol(n,a){return n===a?!0:typeof n!=typeof a?!1:n&&a&&typeof n=="object"&&typeof a=="object"?Object.keys(a).every(i=>ol(n[i],a[i])):!1}function ib(n,a){if(n===a)return n;const i=Yg(n)&&Yg(a);if(i||jd(n)&&jd(a)){const s=i?n:Object.keys(n),o=s.length,c=i?a:Object.keys(a),d=c.length,h=i?[]:{},p=new Set(s);let m=0;for(let g=0;g{setTimeout(a,n)})}function kd(n,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,a):i.structuralSharing!==!1?ib(n,a):a}function Pw(n,a,i=0){const s=[...n,a];return i&&s.length>i?s.slice(1):s}function Gw(n,a,i=0){const s=[a,...n];return i&&s.length>i?s.slice(0,-1):s}var dh=Symbol();function sb(n,a){return!n.queryFn&&a?.initialPromise?()=>a.initialPromise:!n.queryFn||n.queryFn===dh?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Fw(n,a){return typeof n=="function"?n(...a):!!n}var Zw=class extends Cl{#t;#e;#n;constructor(){super(),this.#n=n=>{if(!Vr&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(n){this.#t!==n&&(this.#t=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},hh=new Zw,Yw=class extends Cl{#t=!0;#e;#n;constructor(){super(),this.#n=n=>{if(!Vr&&window.addEventListener){const a=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(this.setOnline.bind(this))}setOnline(n){this.#t!==n&&(this.#t=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#t}},uu=new Yw;function zd(){let n,a;const i=new Promise((o,c)=>{n=o,a=c});i.status="pending",i.catch(()=>{});function s(o){Object.assign(i,o),delete i.resolve,delete i.reject}return i.resolve=o=>{s({status:"fulfilled",value:o}),n(o)},i.reject=o=>{s({status:"rejected",reason:o}),a(o)},i}function Iw(n){return Math.min(1e3*2**n,3e4)}function lb(n){return(n??"online")==="online"?uu.isOnline():!0}var ob=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function ub(n){let a=!1,i=0,s;const o=zd(),c=()=>o.status!=="pending",d=_=>{c()||(w(new ob(_)),n.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>hh.isFocused()&&(n.networkMode==="always"||uu.isOnline())&&n.canRun(),g=()=>lb(n.networkMode)&&n.canRun(),S=_=>{c()||(s?.(),o.resolve(_))},w=_=>{c()||(s?.(),o.reject(_))},A=()=>new Promise(_=>{s=C=>{(c()||m())&&_(C)},n.onPause?.()}).then(()=>{s=void 0,c()||n.onContinue?.()}),O=()=>{if(c())return;let _;const C=i===0?n.initialPromise:void 0;try{_=C??n.fn()}catch(U){_=Promise.reject(U)}Promise.resolve(_).then(S).catch(U=>{if(c())return;const N=n.retry??(Vr?0:3),M=n.retryDelay??Iw,L=typeof M=="function"?M(i,U):M,B=N===!0||typeof N=="number"&&im()?void 0:A()).then(()=>{a?w(U):O()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(s?.(),o),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?O():A().then(O),o)}}var Qw=n=>setTimeout(n,0);function Xw(){let n=[],a=0,i=h=>{h()},s=h=>{h()},o=Qw;const c=h=>{a?n.push(h):o(()=>{i(h)})},d=()=>{const h=n;n=[],h.length&&o(()=>{s(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{o=h}}}var kt=Xw(),cb=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nd(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Vr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},Kw=class extends cb{#t;#e;#n;#a;#r;#l;#s;constructor(n){super(),this.#s=!1,this.#l=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#n=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=$w(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(n){this.options={...this.#l,...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,a){const i=kd(this.state.data,n,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(n,a){this.#i({type:"setState",state:n,setStateOptions:a})}cancel(n){const a=this.#r?.promise;return this.#r?.cancel(n),a?a.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(n=>wn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>rr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!rb(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(n,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(n&&this.setOptions(n),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},o=()=>{const h=sb(this.options,a),m=(()=>{const g={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return s(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#r=ub({initialPromise:a?.initialPromise,fn:d.fetchFn,abort:i.abort.bind(i),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof ob){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#e,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(n){const a=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...fb(i.data,this.options),fetchMeta:n.meta??null};case"success":const s={...i,data:n.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=n.manual?s:void 0,s;case"error":const o=n.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=a(this.state),kt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function fb(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lb(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function $w(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,i=a!==void 0,s=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Jw=class extends Cl{constructor(n={}){super(),this.config=n,this.#t=new Map}#t;build(n,a,i){const s=a.queryKey,o=a.queryHash??fh(s,a);let c=this.get(o);return c||(c=new Kw({client:n,queryKey:s,queryHash:o,options:n.defaultQueryOptions(a),state:i,defaultOptions:n.getQueryDefaults(s)}),this.add(c)),c}add(n){this.#t.has(n.queryHash)||(this.#t.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=this.#t.get(n.queryHash);a&&(n.destroy(),a===n&&this.#t.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){kt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#t.get(n)}getAll(){return[...this.#t.values()]}find(n){const a={exact:!0,...n};return this.getAll().find(i=>Fg(a,i))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(i=>Fg(n,i)):a}notify(n){kt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ww=class extends cb{#t;#e;#n;constructor(n){super(),this.mutationId=n.mutationId,this.#e=n.mutationCache,this.#t=[],this.state=n.state||e1(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(a=>a!==n),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(n){const a=()=>{this.#a({type:"continue"})};this.#n=ub({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#a({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)a();else{this.#a({type:"pending",variables:n,isPaused:s}),await this.#e.config.onMutate?.(n,this);const c=await this.options.onMutate?.(n);c!==this.state.context&&this.#a({type:"pending",context:c,variables:n,isPaused:s})}const o=await this.#n.start();return await this.#e.config.onSuccess?.(o,n,this.state.context,this),await this.options.onSuccess?.(o,n,this.state.context),await this.#e.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,n,this.state.context),this.#a({type:"success",data:o}),o}catch(o){try{throw await this.#e.config.onError?.(o,n,this.state.context,this),await this.options.onError?.(o,n,this.state.context),await this.#e.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,n,this.state.context),o}finally{this.#a({type:"error",error:o})}}finally{this.#e.runNext(this)}}#a(n){const a=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),kt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(n)}),this.#e.notify({mutation:this,type:"updated",action:n})})}};function e1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var t1=class extends Cl{constructor(n={}){super(),this.config=n,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(n,a,i){const s=new Ww({mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(a),state:i});return this.add(s),s}add(n){this.#t.add(n);const a=Io(n);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(n):this.#e.set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#t.delete(n)){const a=Io(n);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}else i[0]===n&&this.#e.delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=Io(n);if(typeof a=="string"){const s=this.#e.get(a)?.find(o=>o.state.status==="pending");return!s||s===n}else return!0}runNext(n){const a=Io(n);return typeof a=="string"?this.#e.get(a)?.find(s=>s!==n&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){kt.batch(()=>{this.#t.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(n){const a={exact:!0,...n};return this.getAll().find(i=>Zg(a,i))}findAll(n={}){return this.getAll().filter(a=>Zg(n,a))}notify(n){kt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return kt.batch(()=>Promise.all(n.map(a=>a.continue().catch(Wt))))}};function Io(n){return n.options.scope?.id}function Qg(n){return{onFetch:(a,i)=>{const s=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const S=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},w=sb(a.options,a.fetchOptions),A=async(O,_,C)=>{if(g)return Promise.reject();if(_==null&&O.pages.length)return Promise.resolve(O);const N=(()=>{const ne={client:a.client,queryKey:a.queryKey,pageParam:_,direction:C?"backward":"forward",meta:a.options.meta};return S(ne),ne})(),M=await w(N),{maxPages:L}=a.options,B=C?Gw:Pw;return{pages:B(O.pages,M,L),pageParams:B(O.pageParams,_,L)}};if(o&&c.length){const O=o==="backward",_=O?n1:Xg,C={pages:c,pageParams:d},U=_(s,C);h=await A(C,U,O)}else{const O=n??c.length;do{const _=p===0?d[0]??s.initialPageParam:Xg(s,h);if(p>0&&_==null)break;h=await A(h,_),p++}while(pa.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function Xg(n,{pages:a,pageParams:i}){const s=a.length-1;return a.length>0?n.getNextPageParam(a[s],a,i[s],i):void 0}function n1(n,{pages:a,pageParams:i}){return a.length>0?n.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var a1=class{#t;#e;#n;#a;#r;#l;#s;#i;constructor(n={}){this.#t=n.queryCache||new Jw,this.#e=n.mutationCache||new t1,this.#n=n.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=hh.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=uu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(n){return this.#t.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#e.findAll({...n,status:"pending"}).length}getQueryData(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),i=this.#t.build(this,a),s=i.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(rr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(n){return this.#t.findAll(n).map(({queryKey:a,state:i})=>{const s=i.data;return[a,s]})}setQueryData(n,a,i){const s=this.defaultQueryOptions({queryKey:n}),c=this.#t.get(s.queryHash)?.state.data,d=Hw(a,c);if(d!==void 0)return this.#t.build(this,s).setData(d,{...i,manual:!0})}setQueriesData(n,a,i){return kt.batch(()=>this.#t.findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,a,i)]))}getQueryState(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state}removeQueries(n){const a=this.#t;kt.batch(()=>{a.findAll(n).forEach(i=>{a.remove(i)})})}resetQueries(n,a){const i=this.#t;return kt.batch(()=>(i.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const i={revert:!0,...a},s=kt.batch(()=>this.#t.findAll(n).map(o=>o.cancel(i)));return Promise.all(s).then(Wt).catch(Wt)}invalidateQueries(n,a={}){return kt.batch(()=>(this.#t.findAll(n).forEach(i=>{i.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},a)))}refetchQueries(n,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},s=kt.batch(()=>this.#t.findAll(n).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,i);return i.throwOnError||(c=c.catch(Wt)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Wt)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(rr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Wt).catch(Wt)}fetchInfiniteQuery(n){return n.behavior=Qg(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Wt).catch(Wt)}ensureInfiniteQueryData(n){return n.behavior=Qg(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return uu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,a){this.#a.set(ll(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...this.#a.values()],i={};return a.forEach(s=>{ol(n,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(n,a){this.#r.set(ll(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...this.#r.values()],i={};return a.forEach(s=>{ol(n,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const a={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=fh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===dh&&(a.enabled=!1),a}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},r1=class extends Cl{constructor(n,a){super(),this.options=a,this.#t=n,this.#i=null,this.#s=zd(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#a=void 0;#r;#l;#s;#i;#p;#d;#h;#u;#c;#o;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Kg(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ud(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ud(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(n){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#e.setOptions(this.options),a._defaulted&&!Dd(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&$g(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||rr(this.options.staleTime,this.#e)!==rr(a.staleTime,this.#e))&&this.#v();const o=this.#g();s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||o!==this.#o)&&this.#y(o)}getOptimisticResult(n){const a=this.#t.getQueryCache().build(this.#t,n),i=this.createResult(a,n);return s1(this,i)&&(this.#a=i,this.#l=this.options,this.#r=this.#e.state),i}getCurrentResult(){return this.#a}trackResult(n,a){return new Proxy(n,{get:(i,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,s))})}trackProp(n){this.#m.add(n)}getCurrentQuery(){return this.#e}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=this.#t.defaultQueryOptions(n),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(n){return this.#f({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(n){this.#_();let a=this.#e.fetch(this.options,n);return n?.throwOnError||(a=a.catch(Wt)),a}#v(){this.#x();const n=rr(this.options.staleTime,this.#e);if(Vr||this.#a.isStale||!Nd(n))return;const i=rb(this.#a.dataUpdatedAt,n)+1;this.#u=setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(n){this.#S(),this.#o=n,!(Vr||wn(this.options.enabled,this.#e)===!1||!Nd(this.#o)||this.#o===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||hh.isFocused())&&this.#f()},this.#o))}#b(){this.#v(),this.#y(this.#g())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(n,a){const i=this.#e,s=this.options,o=this.#a,c=this.#r,d=this.#l,p=n!==i?n.state:this.#n,{state:m}=n;let g={...m},S=!1,w;if(a._optimisticResults){const z=this.hasListeners(),ae=!z&&Kg(n,a),oe=z&&$g(n,i,a,s);(ae||oe)&&(g={...g,...fb(m.data,n.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:A,errorUpdatedAt:O,status:_}=g;w=g.data;let C=!1;if(a.placeholderData!==void 0&&w===void 0&&_==="pending"){let z;o?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(z=o.data,C=!0):z=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,z!==void 0&&(_="success",w=kd(o?.data,z,a),S=!0)}if(a.select&&w!==void 0&&!C)if(o&&w===c?.data&&a.select===this.#p)w=this.#d;else try{this.#p=a.select,w=a.select(w),w=kd(o?.data,w,a),this.#d=w,this.#i=null}catch(z){this.#i=z}this.#i&&(A=this.#i,w=this.#d,O=Date.now(),_="error");const U=g.fetchStatus==="fetching",N=_==="pending",M=_==="error",L=N&&U,B=w!==void 0,Z={status:_,fetchStatus:g.fetchStatus,isPending:N,isSuccess:_==="success",isError:M,isInitialLoading:L,isLoading:L,data:w,dataUpdatedAt:g.dataUpdatedAt,error:A,errorUpdatedAt:O,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:U,isRefetching:U&&!N,isLoadingError:M&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:M&&B,isStale:mh(n,a),refetch:this.refetch,promise:this.#s,isEnabled:wn(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const z=Se=>{Z.status==="error"?Se.reject(Z.error):Z.data!==void 0&&Se.resolve(Z.data)},ae=()=>{const Se=this.#s=Z.promise=zd();z(Se)},oe=this.#s;switch(oe.status){case"pending":n.queryHash===i.queryHash&&z(oe);break;case"fulfilled":(Z.status==="error"||Z.data!==oe.value)&&ae();break;case"rejected":(Z.status!=="error"||Z.error!==oe.reason)&&ae();break}}return Z}updateResult(){const n=this.#a,a=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#l=this.options,this.#r.data!==void 0&&(this.#h=this.#e),Dd(a,n))return;this.#a=a;const i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#m.size)return!0;const c=new Set(o??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(d=>{const h=d;return this.#a[h]!==n[h]&&c.has(h)})};this.#w({listeners:i()})}#_(){const n=this.#t.getQueryCache().build(this.#t,this.options);if(n===this.#e)return;const a=this.#e;this.#e=n,this.#n=n.state,this.hasListeners()&&(a?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(n){kt.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function i1(n,a){return wn(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&a.retryOnMount===!1)}function Kg(n,a){return i1(n,a)||n.state.data!==void 0&&Ud(n,a,a.refetchOnMount)}function Ud(n,a,i){if(wn(a.enabled,n)!==!1&&rr(a.staleTime,n)!=="static"){const s=typeof i=="function"?i(n):i;return s==="always"||s!==!1&&mh(n,a)}return!1}function $g(n,a,i,s){return(n!==a||wn(s.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&mh(n,i)}function mh(n,a){return wn(a.enabled,n)!==!1&&n.isStaleByTime(rr(a.staleTime,n))}function s1(n,a){return!Dd(n.getCurrentResult(),a)}var ud={exports:{}},Ue={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jg;function l1(){if(Jg)return Ue;Jg=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),S=Symbol.iterator;function w(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,_={};function C(T,Y,se){this.props=T,this.context=Y,this.refs=_,this.updater=se||A}C.prototype.isReactComponent={},C.prototype.setState=function(T,Y){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,Y,"setState")},C.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function U(){}U.prototype=C.prototype;function N(T,Y,se){this.props=T,this.context=Y,this.refs=_,this.updater=se||A}var M=N.prototype=new U;M.constructor=N,O(M,C.prototype),M.isPureReactComponent=!0;var L=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},ne=Object.prototype.hasOwnProperty;function Z(T,Y,se,W,ce,Re){return se=Re.ref,{$$typeof:n,type:T,key:Y,ref:se!==void 0?se:null,props:Re}}function z(T,Y){return Z(T.type,Y,void 0,void 0,void 0,T.props)}function ae(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function oe(T){var Y={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(se){return Y[se]})}var Se=/\/+/g;function re(T,Y){return typeof T=="object"&&T!==null&&T.key!=null?oe(""+T.key):Y.toString(36)}function ie(){}function ue(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ie,ie):(T.status="pending",T.then(function(Y){T.status==="pending"&&(T.status="fulfilled",T.value=Y)},function(Y){T.status==="pending"&&(T.status="rejected",T.reason=Y)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function me(T,Y,se,W,ce){var Re=typeof T;(Re==="undefined"||Re==="boolean")&&(T=null);var xe=!1;if(T===null)xe=!0;else switch(Re){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(T.$$typeof){case n:case a:xe=!0;break;case g:return xe=T._init,me(xe(T._payload),Y,se,W,ce)}}if(xe)return ce=ce(T),xe=W===""?"."+re(T,0):W,L(ce)?(se="",xe!=null&&(se=xe.replace(Se,"$&/")+"/"),me(ce,Y,se,"",function(Xe){return Xe})):ce!=null&&(ae(ce)&&(ce=z(ce,se+(ce.key==null||T&&T.key===ce.key?"":(""+ce.key).replace(Se,"$&/")+"/")+xe)),Y.push(ce)),1;xe=0;var ee=W===""?".":W+":";if(L(T))for(var Te=0;Te{const a=b.useContext(hb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},u1=({client:n,children:a})=>(b.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),y.jsx(hb.Provider,{value:n,children:a})),mb=b.createContext(!1),c1=()=>b.useContext(mb);mb.Provider;function f1(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var d1=b.createContext(f1()),h1=()=>b.useContext(d1),m1=(n,a)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(a.isReset()||(n.retryOnMount=!1))},p1=n=>{b.useEffect(()=>{n.clearReset()},[n])},v1=({result:n,errorResetBoundary:a,throwOnError:i,query:s,suspense:o})=>n.isError&&!a.isReset()&&!n.isFetching&&s&&(o&&n.data===void 0||Fw(i,[n.error,s])),g1=n=>{if(n.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...s)=>a(i(...s)):a(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},y1=(n,a)=>n.isLoading&&n.isFetching&&!a,b1=(n,a)=>n?.suspense&&a.isPending,ey=(n,a,i)=>a.fetchOptimistic(n).catch(()=>{i.clearReset()});function x1(n,a,i){const s=c1(),o=h1(),c=o1(),d=c.defaultQueryOptions(n);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=s?"isRestoring":"optimistic",g1(d),m1(d,o),p1(o);const h=!c.getQueryCache().get(d.queryHash),[p]=b.useState(()=>new a(c,d)),m=p.getOptimisticResult(d),g=!s&&n.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(S=>{const w=g?p.subscribe(kt.batchCalls(S)):Wt;return p.updateResult(),w},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),b.useEffect(()=>{p.setOptions(d)},[d,p]),b1(d,m))throw ey(d,p,o);if(v1({result:m,errorResetBoundary:o,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Vr&&y1(m,s)&&(h?ey(d,p,o):c.getQueryCache().get(d.queryHash)?.promise)?.catch(Wt).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function Ld(n,a){return x1(n,r1)}const S1=new a1({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}});var cd={exports:{}},Js={},fd={exports:{}},dd={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ty;function _1(){return ty||(ty=1,(function(n){function a(j,I){var P=j.length;j.push(I);e:for(;0>>1,T=j[J];if(0>>1;Jo(W,P))ceo(Re,W)?(j[J]=Re,j[ce]=P,J=ce):(j[J]=W,j[se]=P,J=se);else if(ceo(Re,P))j[J]=Re,j[ce]=P,J=ce;else break e}}return I}function o(j,I){var P=j.sortIndex-I.sortIndex;return P!==0?P:j.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,S=null,w=3,A=!1,O=!1,_=!1,C=!1,U=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function L(j){for(var I=i(m);I!==null;){if(I.callback===null)s(m);else if(I.startTime<=j)s(m),I.sortIndex=I.expirationTime,a(p,I);else break;I=i(m)}}function B(j){if(_=!1,L(j),!O)if(i(p)!==null)O=!0,ne||(ne=!0,re());else{var I=i(m);I!==null&&me(B,I.startTime-j)}}var ne=!1,Z=-1,z=5,ae=-1;function oe(){return C?!0:!(n.unstable_now()-aej&&oe());){var J=S.callback;if(typeof J=="function"){S.callback=null,w=S.priorityLevel;var T=J(S.expirationTime<=j);if(j=n.unstable_now(),typeof T=="function"){S.callback=T,L(j),I=!0;break t}S===i(p)&&s(p),L(j)}else s(p);S=i(p)}if(S!==null)I=!0;else{var Y=i(m);Y!==null&&me(B,Y.startTime-j),I=!1}}break e}finally{S=null,w=P,A=!1}I=void 0}}finally{I?re():ne=!1}}}var re;if(typeof M=="function")re=function(){M(Se)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,ue=ie.port2;ie.port1.onmessage=Se,re=function(){ue.postMessage(null)}}else re=function(){U(Se,0)};function me(j,I){Z=U(function(){j(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_forceFrameRate=function(j){0>j||125J?(j.sortIndex=P,a(m,j),i(p)===null&&j===i(m)&&(_?(N(Z),Z=-1):_=!0,me(B,P-J))):(j.sortIndex=T,a(p,j),O||A||(O=!0,ne||(ne=!0,re()))),j},n.unstable_shouldYield=oe,n.unstable_wrapCallback=function(j){var I=w;return function(){var P=w;w=I;try{return j.apply(this,arguments)}finally{w=P}}}})(dd)),dd}var ny;function w1(){return ny||(ny=1,fd.exports=_1()),fd.exports}var hd={exports:{}},Vt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ay;function E1(){if(ay)return Vt;ay=1;var n=ph();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),hd.exports=E1(),hd.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var iy;function T1(){if(iy)return Js;iy=1;var n=w1(),a=ph(),i=pb();function s(e){var t="https://react.dev/errors/"+e;if(1T||(e.current=J[T],J[T]=null,T--)}function W(e,t){T++,J[T]=e.current,e.current=t}var ce=Y(null),Re=Y(null),xe=Y(null),ee=Y(null);function Te(e,t){switch(W(xe,t),W(Re,e),W(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vg(t),e=gg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}se(ce),W(ce,e)}function Xe(){se(ce),se(Re),se(xe)}function He(e){e.memoizedState!==null&&W(ee,e);var t=ce.current,r=gg(t,e.type);t!==r&&(W(Re,e),W(ce,r))}function Fe(e){Re.current===e&&(se(ce),se(Re)),ee.current===e&&(se(ee),Ys._currentValue=P)}var Ke=Object.prototype.hasOwnProperty,At=n.unstable_scheduleCallback,Yt=n.unstable_cancelCallback,Oa=n.unstable_shouldYield,mr=n.unstable_requestPaint,zt=n.unstable_now,Jh=n.unstable_getCurrentPriorityLevel,ts=n.unstable_ImmediatePriority,R=n.unstable_UserBlockingPriority,q=n.unstable_NormalPriority,X=n.unstable_LowPriority,pe=n.unstable_IdlePriority,fe=n.log,le=n.unstable_setDisableYieldValue,_e=null,ke=null;function Ze(e){if(typeof fe=="function"&&le(e),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(_e,e)}catch{}}var ot=Math.clz32?Math.clz32:Xu,Kr=Math.log,Ln=Math.LN2;function Xu(e){return e>>>=0,e===0?32:31-(Kr(e)/Ln|0)|0}var Ma=256,Na=4194304;function ea(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:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;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 pr(e,t,r){var l=e.pendingLanes;if(l===0)return 0;var u=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?u=ea(l):(v&=x,v!==0?u=ea(v):r||(r=x&~e,r!==0&&(u=ea(r))))):(x=l&~f,x!==0?u=ea(x):v!==0?u=ea(v):r||(r=l&~e,r!==0&&(u=ea(r)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,r=t&-t,f>=r||f===32&&(r&4194048)!==0)?t:u}function vr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zl(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 Wh(){var e=Ma;return Ma<<=1,(Ma&4194048)===0&&(Ma=256),e}function em(){var e=Na;return Na<<=1,(Na&62914560)===0&&(Na=4194304),e}function Ku(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ns(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _S(e,t,r,l,u,f){var v=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var x=e.entanglements,E=e.expirationTimes,H=e.hiddenUpdates;for(r=v&~r;0)":-1u||E[l]!==H[u]){var Q=` -`+E[l].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=l&&0<=u);break}}}finally{nc=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?ni(r):""}function RS(e){switch(e.tag){case 26:case 27:case 5:return ni(e.type);case 16:return ni("Lazy");case 13:return ni("Suspense");case 19:return ni("SuspenseList");case 0:case 15:return ac(e.type,!1);case 11:return ac(e.type.render,!1);case 1:return ac(e.type,!0);case 31:return ni("Activity");default:return""}}function cm(e){try{var t="";do t+=RS(e),e=e.return;while(e);return t}catch(r){return` -Error generating stack: `+r.message+` -`+r.stack}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OS(e){var t=fm(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(v){l=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){e._valueTracker||(e._valueTracker=OS(e))}function dm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=fm(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function Bl(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 MS=/[\n"\\]/g;function mn(e){return e.replace(MS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rc(e,t,r,l,u,f,v,x){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?ic(e,v,hn(t)):r!=null?ic(e,v,hn(r)):l!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+hn(x):e.removeAttribute("name")}function hm(e,t,r,l,u,f,v,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;r=r!=null?""+hn(r):"",t=t!=null?""+hn(t):r,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v)}function ic(e,t,r){t==="number"&&Bl(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function ai(e,t,r,l){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cc=!1;if(na)try{var ss={};Object.defineProperty(ss,"passive",{get:function(){cc=!0}}),window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{cc=!1}var ja=null,fc=null,ql=null;function xm(){if(ql)return ql;var e,t=fc,r=t.length,l,u="value"in ja?ja.value:ja.textContent,f=u.length;for(e=0;e=us),Am=" ",Cm=!1;function Rm(e,t){switch(e){case"keyup":return r_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Om(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var li=!1;function s_(e,t){switch(e){case"compositionend":return Om(t);case"keypress":return t.which!==32?null:(Cm=!0,Am);case"textInput":return e=t.data,e===Am&&Cm?null:e;default:return null}}function l_(e,t){if(li)return e==="compositionend"||!vc&&Rm(e,t)?(e=xm(),ql=fc=ja=null,li=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Lm(r)}}function Bm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bl(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Bl(e.document)}return t}function bc(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 p_=na&&"documentMode"in document&&11>=document.documentMode,oi=null,xc=null,hs=null,Sc=!1;function qm(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sc||oi==null||oi!==Bl(l)||(l=oi,"selectionStart"in l&&bc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),hs&&ds(hs,l)||(hs=l,l=Do(xc,"onSelect"),0>=v,u-=v,ra=1<<32-ot(t)+u|r<f?f:8;var v=j.T,x={};j.T=x,lf(e,!1,t,r);try{var E=u(),H=j.S;if(H!==null&&H(x,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var Q=E_(E,l);Rs(e,t,Q,sn(e))}else Rs(e,t,l,sn(e))}catch($){Rs(e,t,{then:function(){},status:"rejected",reason:$},sn())}finally{I.p=f,j.T=v}}function O_(){}function rf(e,t,r,l){if(e.tag!==5)throw Error(s(476));var u=Pp(e).queue;qp(e,u,t,P,r===null?O_:function(){return Gp(e),r(l)})}function Pp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:P},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gp(e){var t=Pp(e).next.queue;Rs(e,t,{},sn())}function sf(){return Lt(Ys)}function Fp(){return xt().memoizedState}function Zp(){return xt().memoizedState}function M_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=sn();e=Ua(r);var l=La(t,e,r);l!==null&&(ln(l,t,r),_s(l,t,r)),t={cache:zc()},e.payload=t;return}t=t.return}}function N_(e,t,r){var l=sn();r={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},fo(e)?Ip(t,r):(r=Tc(e,t,r,l),r!==null&&(ln(r,e,l),Qp(r,t,l)))}function Yp(e,t,r){var l=sn();Rs(e,t,r,l)}function Rs(e,t,r,l){var u={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(fo(e))Ip(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,x=f(v,r);if(u.hasEagerState=!0,u.eagerState=x,en(x,v))return Ql(e,t,u,0),ut===null&&Il(),!1}catch{}finally{}if(r=Tc(e,t,u,l),r!==null)return ln(r,e,l),Qp(r,t,l),!0}return!1}function lf(e,t,r,l){if(l={lane:2,revertLane:Bf(),action:l,hasEagerState:!1,eagerState:null,next:null},fo(e)){if(t)throw Error(s(479))}else t=Tc(e,r,l,2),t!==null&&ln(t,e,2)}function fo(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function Ip(e,t){yi=io=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Qp(e,t,r){if((r&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,nm(e,r)}}var ho={readContext:Lt,use:lo,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},Xp={readContext:Lt,use:lo,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Dp,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,co(4194308,4,Up.bind(null,t,e),r)},useLayoutEffect:function(e,t){return co(4194308,4,e,t)},useInsertionEffect:function(e,t){co(4,2,e,t)},useMemo:function(e,t){var r=Xt();t=t===void 0?null:t;var l=e();if(Or){Ze(!0);try{e()}finally{Ze(!1)}}return r.memoizedState=[l,t],l},useReducer:function(e,t,r){var l=Xt();if(r!==void 0){var u=r(t);if(Or){Ze(!0);try{r(t)}finally{Ze(!1)}}}else u=t;return l.memoizedState=l.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},l.queue=e,e=e.dispatch=N_.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=ef(e);var t=e.queue,r=Yp.bind(null,Ve,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:nf,useDeferredValue:function(e,t){var r=Xt();return af(r,e,t)},useTransition:function(){var e=ef(!1);return e=qp.bind(null,Ve,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var l=Ve,u=Xt();if(Je){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),ut===null)throw Error(s(349));(Ie&124)!==0||vp(l,t,r)}u.memoizedState=r;var f={value:r,getSnapshot:t};return u.queue=f,Dp(yp.bind(null,l,f,e),[e]),l.flags|=2048,xi(9,uo(),gp.bind(null,l,f,r,t),null),r},useId:function(){var e=Xt(),t=ut.identifierPrefix;if(Je){var r=ia,l=ra;r=(l&~(1<<32-ot(l)-1)).toString(32)+r,t="«"+t+"R"+r,r=so++,0Oe?(Mt=Ee,Ee=null):Mt=Ee.sibling;var $e=G(k,Ee,V[Oe],K);if($e===null){Ee===null&&(Ee=Mt);break}e&&Ee&&$e.alternate===null&&t(k,Ee),D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e,Ee=Mt}if(Oe===V.length)return r(k,Ee),Je&&wr(k,Oe),ge;if(Ee===null){for(;OeOe?(Mt=Ee,Ee=null):Mt=Ee.sibling;var er=G(k,Ee,$e.value,K);if(er===null){Ee===null&&(Ee=Mt);break}e&&Ee&&er.alternate===null&&t(k,Ee),D=f(er,D,Oe),qe===null?ge=er:qe.sibling=er,qe=er,Ee=Mt}if($e.done)return r(k,Ee),Je&&wr(k,Oe),ge;if(Ee===null){for(;!$e.done;Oe++,$e=V.next())$e=$(k,$e.value,K),$e!==null&&(D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e);return Je&&wr(k,Oe),ge}for(Ee=l(Ee);!$e.done;Oe++,$e=V.next())$e=F(Ee,k,Oe,$e.value,K),$e!==null&&(e&&$e.alternate!==null&&Ee.delete($e.key===null?Oe:$e.key),D=f($e,D,Oe),qe===null?ge=$e:qe.sibling=$e,qe=$e);return e&&Ee.forEach(function(jw){return t(k,jw)}),Je&&wr(k,Oe),ge}function it(k,D,V,K){if(typeof V=="object"&&V!==null&&V.type===O&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var ge=V.key;D!==null;){if(D.key===ge){if(ge=V.type,ge===O){if(D.tag===7){r(k,D.sibling),K=u(D,V.props.children),K.return=k,k=K;break e}}else if(D.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===z&&$p(ge)===D.type){r(k,D.sibling),K=u(D,V.props),Ms(K,V),K.return=k,k=K;break e}r(k,D);break}else t(k,D);D=D.sibling}V.type===O?(K=Sr(V.props.children,k.mode,K,V.key),K.return=k,k=K):(K=Kl(V.type,V.key,V.props,null,k.mode,K),Ms(K,V),K.return=k,k=K)}return v(k);case A:e:{for(ge=V.key;D!==null;){if(D.key===ge)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){r(k,D.sibling),K=u(D,V.children||[]),K.return=k,k=K;break e}else{r(k,D);break}else t(k,D);D=D.sibling}K=Rc(V,k.mode,K),K.return=k,k=K}return v(k);case z:return ge=V._init,V=ge(V._payload),it(k,D,V,K)}if(me(V))return De(k,D,V,K);if(re(V)){if(ge=re(V),typeof ge!="function")throw Error(s(150));return V=ge.call(V),Ce(k,D,V,K)}if(typeof V.then=="function")return it(k,D,mo(V),K);if(V.$$typeof===M)return it(k,D,eo(k,V),K);po(k,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(r(k,D.sibling),K=u(D,V),K.return=k,k=K):(r(k,D),K=Cc(V,k.mode,K),K.return=k,k=K),v(k)):r(k,D)}return function(k,D,V,K){try{Os=0;var ge=it(k,D,V,K);return Si=null,ge}catch(Ee){if(Ee===xs||Ee===no)throw Ee;var qe=tn(29,Ee,null,k.mode);return qe.lanes=K,qe.return=k,qe}finally{}}}var _i=Jp(!0),Wp=Jp(!1),bn=Y(null),Bn=null;function Ba(e){var t=e.alternate;W(wt,wt.current&1),W(bn,e),Bn===null&&(t===null||gi.current!==null||t.memoizedState!==null)&&(Bn=e)}function ev(e){if(e.tag===22){if(W(wt,wt.current),W(bn,e),Bn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Bn=e)}}else Ha()}function Ha(){W(wt,wt.current),W(bn,bn.current)}function ua(e){se(bn),Bn===e&&(Bn=null),se(wt)}var wt=Y(0);function vo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||$f(r)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function of(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:g({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var uf={enqueueSetState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Ua(l);u.payload=t,r!=null&&(u.callback=r),t=La(e,u,l),t!==null&&(ln(t,e,l),_s(t,e,l))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Ua(l);u.tag=1,u.payload=t,r!=null&&(u.callback=r),t=La(e,u,l),t!==null&&(ln(t,e,l),_s(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=sn(),l=Ua(r);l.tag=2,t!=null&&(l.callback=t),t=La(e,l,r),t!==null&&(ln(t,e,r),_s(t,e,r))}};function tv(e,t,r,l,u,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!ds(r,l)||!ds(u,f):!0}function nv(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&uf.enqueueReplaceState(t,t.state,null)}function Mr(e,t){var r=t;if("ref"in t){r={};for(var l in t)l!=="ref"&&(r[l]=t[l])}if(e=e.defaultProps){r===t&&(r=g({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}var go=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)};function av(e){go(e)}function rv(e){console.error(e)}function iv(e){go(e)}function yo(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function sv(e,t,r){try{var l=e.onCaughtError;l(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function cf(e,t,r){return r=Ua(r),r.tag=3,r.payload={element:null},r.callback=function(){yo(e,t)},r}function lv(e){return e=Ua(e),e.tag=3,e}function ov(e,t,r,l){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=l.value;e.payload=function(){return u(f)},e.callback=function(){sv(t,r,l)}}var v=r.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){sv(t,r,l),typeof u!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function j_(e,t,r,l,u){if(r.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=r.alternate,t!==null&&gs(t,r,u,!0),r=bn.current,r!==null){switch(r.tag){case 13:return Bn===null?kf():r.alternate===null&&mt===0&&(mt=3),r.flags&=-257,r.flags|=65536,r.lanes=u,l===Vc?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([l]):t.add(l),Uf(e,l,u)),!1;case 22:return r.flags|=65536,l===Vc?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([l]):r.add(l)),Uf(e,l,u)),!1}throw Error(s(435,r.tag))}return Uf(e,l,u),kf(),!1}if(Je)return t=bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,l!==Nc&&(e=Error(s(422),{cause:l}),vs(pn(e,r)))):(l!==Nc&&(t=Error(s(423),{cause:l}),vs(pn(t,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,l=pn(l,r),u=cf(e.stateNode,l,u),qc(e,u),mt!==4&&(mt=2)),!1;var f=Error(s(520),{cause:l});if(f=pn(f,r),Ls===null?Ls=[f]:Ls.push(f),mt!==4&&(mt=2),t===null)return!0;l=pn(l,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=cf(r.stateNode,l,e),qc(r,e),!1;case 1:if(t=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ya===null||!Ya.has(f))))return r.flags|=65536,u&=-u,r.lanes|=u,u=lv(u),ov(u,e,r,l),qc(r,u),!1}r=r.return}while(r!==null);return!1}var uv=Error(s(461)),Rt=!1;function Nt(e,t,r,l){t.child=e===null?Wp(t,null,r,l):_i(t,e.child,r,l)}function cv(e,t,r,l,u){r=r.render;var f=t.ref;if("ref"in l){var v={};for(var x in l)x!=="ref"&&(v[x]=l[x])}else v=l;return Cr(t),l=Yc(e,t,r,v,f,u),x=Ic(),e!==null&&!Rt?(Qc(e,t,u),ca(e,t,u)):(Je&&x&&Oc(t),t.flags|=1,Nt(e,t,l,u),t.child)}function fv(e,t,r,l,u){if(e===null){var f=r.type;return typeof f=="function"&&!Ac(f)&&f.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=f,dv(e,t,f,l,u)):(e=Kl(r.type,null,l,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!yf(e,u)){var v=f.memoizedProps;if(r=r.compare,r=r!==null?r:ds,r(v,l)&&e.ref===t.ref)return ca(e,t,u)}return t.flags|=1,e=aa(f,l),e.ref=t.ref,e.return=t,t.child=e}function dv(e,t,r,l,u){if(e!==null){var f=e.memoizedProps;if(ds(f,l)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=l=f,yf(e,u))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,ca(e,t,u)}return ff(e,t,r,l,u)}function hv(e,t,r){var l=t.pendingProps,u=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=f!==null?f.baseLanes|r:r,e!==null){for(u=t.child=e.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;t.childLanes=f&~l}else t.childLanes=0,t.child=null;return mv(e,t,l,r)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&to(t,f!==null?f.cachePool:null),f!==null?dp(t,f):Gc(),ev(t);else return t.lanes=t.childLanes=536870912,mv(e,t,f!==null?f.baseLanes|r:r,r)}else f!==null?(to(t,f.cachePool),dp(t,f),Ha(),t.memoizedState=null):(e!==null&&to(t,null),Gc(),Ha());return Nt(e,t,u,r),t.child}function mv(e,t,r,l){var u=Lc();return u=u===null?null:{parent:_t._currentValue,pool:u},t.memoizedState={baseLanes:r,cachePool:u},e!==null&&to(t,null),Gc(),ev(t),e!==null&&gs(e,t,l,!0),null}function bo(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function ff(e,t,r,l,u){return Cr(t),r=Yc(e,t,r,l,void 0,u),l=Ic(),e!==null&&!Rt?(Qc(e,t,u),ca(e,t,u)):(Je&&l&&Oc(t),t.flags|=1,Nt(e,t,r,u),t.child)}function pv(e,t,r,l,u,f){return Cr(t),t.updateQueue=null,r=mp(t,l,r,u),hp(e),l=Ic(),e!==null&&!Rt?(Qc(e,t,f),ca(e,t,f)):(Je&&l&&Oc(t),t.flags|=1,Nt(e,t,r,f),t.child)}function vv(e,t,r,l,u){if(Cr(t),t.stateNode===null){var f=di,v=r.contextType;typeof v=="object"&&v!==null&&(f=Lt(v)),f=new r(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=uf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},Bc(t),v=r.contextType,f.context=typeof v=="object"&&v!==null?Lt(v):di,f.state=t.memoizedState,v=r.getDerivedStateFromProps,typeof v=="function"&&(of(t,r,v,l),f.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&uf.enqueueReplaceState(f,f.state,null),Es(t,l,f,u),ws(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var x=t.memoizedProps,E=Mr(r,x);f.props=E;var H=f.context,Q=r.contextType;v=di,typeof Q=="object"&&Q!==null&&(v=Lt(Q));var $=r.getDerivedStateFromProps;Q=typeof $=="function"||typeof f.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,Q||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x||H!==v)&&nv(t,f,l,v),za=!1;var G=t.memoizedState;f.state=G,Es(t,l,f,u),ws(),H=t.memoizedState,x||G!==H||za?(typeof $=="function"&&(of(t,r,$,l),H=t.memoizedState),(E=za||tv(t,r,E,l,G,H,v))?(Q||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=H),f.props=l,f.state=H,f.context=v,l=E):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,Hc(e,t),v=t.memoizedProps,Q=Mr(r,v),f.props=Q,$=t.pendingProps,G=f.context,H=r.contextType,E=di,typeof H=="object"&&H!==null&&(E=Lt(H)),x=r.getDerivedStateFromProps,(H=typeof x=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==$||G!==E)&&nv(t,f,l,E),za=!1,G=t.memoizedState,f.state=G,Es(t,l,f,u),ws();var F=t.memoizedState;v!==$||G!==F||za||e!==null&&e.dependencies!==null&&Wl(e.dependencies)?(typeof x=="function"&&(of(t,r,x,l),F=t.memoizedState),(Q=za||tv(t,r,Q,l,G,F,E)||e!==null&&e.dependencies!==null&&Wl(e.dependencies))?(H||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,F,E),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,F,E)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=F),f.props=l,f.state=F,f.context=E,l=Q):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,bo(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,r=l&&typeof r.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=_i(t,e.child,null,u),t.child=_i(t,null,r,u)):Nt(e,t,r,u),t.memoizedState=f.state,e=t.child):e=ca(e,t,u),e}function gv(e,t,r,l){return ps(),t.flags|=256,Nt(e,t,r,l),t.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hf(e){return{baseLanes:e,cachePool:rp()}}function mf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=xn),e}function yv(e,t,r){var l=t.pendingProps,u=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),v&&(u=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(u?Ba(t):Ha(),Je){var x=ht,E;if(E=x){e:{for(E=x,x=Vn;E.nodeType!==8;){if(!x){x=null;break e}if(E=Cn(E.nextSibling),E===null){x=null;break e}}x=E}x!==null?(t.memoizedState={dehydrated:x,treeContext:_r!==null?{id:ra,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},E=tn(18,null,null,0),E.stateNode=x,E.return=t,t.child=E,qt=t,ht=null,E=!0):E=!1}E||Tr(t)}if(x=t.memoizedState,x!==null&&(x=x.dehydrated,x!==null))return $f(x)?t.lanes=32:t.lanes=536870912,null;ua(t)}return x=l.children,l=l.fallback,u?(Ha(),u=t.mode,x=xo({mode:"hidden",children:x},u),l=Sr(l,u,r,null),x.return=t,l.return=t,x.sibling=l,t.child=x,u=t.child,u.memoizedState=hf(r),u.childLanes=mf(e,v,r),t.memoizedState=df,l):(Ba(t),pf(t,x))}if(E=e.memoizedState,E!==null&&(x=E.dehydrated,x!==null)){if(f)t.flags&256?(Ba(t),t.flags&=-257,t=vf(e,t,r)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),u=l.fallback,x=t.mode,l=xo({mode:"visible",children:l.children},x),u=Sr(u,x,r,null),u.flags|=2,l.return=t,u.return=t,l.sibling=u,t.child=l,_i(t,e.child,null,r),l=t.child,l.memoizedState=hf(r),l.childLanes=mf(e,v,r),t.memoizedState=df,t=u);else if(Ba(t),$f(x)){if(v=x.nextSibling&&x.nextSibling.dataset,v)var H=v.dgst;v=H,l=Error(s(419)),l.stack="",l.digest=v,vs({value:l,source:null,stack:null}),t=vf(e,t,r)}else if(Rt||gs(e,t,r,!1),v=(r&e.childLanes)!==0,Rt||v){if(v=ut,v!==null&&(l=r&-r,l=(l&42)!==0?1:$u(l),l=(l&(v.suspendedLanes|r))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,fi(e,l),ln(v,e,l),uv;x.data==="$?"||kf(),t=vf(e,t,r)}else x.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,ht=Cn(x.nextSibling),qt=t,Je=!0,Er=null,Vn=!1,e!==null&&(gn[yn++]=ra,gn[yn++]=ia,gn[yn++]=_r,ra=e.id,ia=e.overflow,_r=t),t=pf(t,l.children),t.flags|=4096);return t}return u?(Ha(),u=l.fallback,x=t.mode,E=e.child,H=E.sibling,l=aa(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,H!==null?u=aa(H,u):(u=Sr(u,x,r,null),u.flags|=2),u.return=t,l.return=t,l.sibling=u,t.child=l,l=u,u=t.child,x=e.child.memoizedState,x===null?x=hf(r):(E=x.cachePool,E!==null?(H=_t._currentValue,E=E.parent!==H?{parent:H,pool:H}:E):E=rp(),x={baseLanes:x.baseLanes|r,cachePool:E}),u.memoizedState=x,u.childLanes=mf(e,v,r),t.memoizedState=df,l):(Ba(t),r=e.child,e=r.sibling,r=aa(r,{mode:"visible",children:l.children}),r.return=t,r.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=r,t.memoizedState=null,r)}function pf(e,t){return t=xo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xo(e,t){return e=tn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function vf(e,t,r){return _i(t,e.child,null,r),e=pf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bv(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),jc(e.return,t,r)}function gf(e,t,r,l,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=r,f.tailMode=u)}function xv(e,t,r){var l=t.pendingProps,u=l.revealOrder,f=l.tail;if(Nt(e,t,l.children,r),l=wt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bv(e,r,t);else if(e.tag===19)bv(e,r,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}l&=1}switch(W(wt,l),u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&vo(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),gf(t,!1,u,r,f);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&vo(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}gf(t,!0,r,null,f);break;case"together":gf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Za|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(gs(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=aa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=aa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function yf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wl(e)))}function k_(e,t,r){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ka(t,_t,e.memoizedState.cache),ps();break;case 27:case 5:He(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ka(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ba(t),t.flags|=128,null):(r&t.child.childLanes)!==0?yv(e,t,r):(Ba(t),e=ca(e,t,r),e!==null?e.sibling:null);Ba(t);break;case 19:var u=(e.flags&128)!==0;if(l=(r&t.childLanes)!==0,l||(gs(e,t,r,!1),l=(r&t.childLanes)!==0),u){if(l)return xv(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),W(wt,wt.current),l)break;return null;case 22:case 23:return t.lanes=0,hv(e,t,r);case 24:ka(t,_t,e.memoizedState.cache)}return ca(e,t,r)}function Sv(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!yf(e,r)&&(t.flags&128)===0)return Rt=!1,k_(e,t,r);Rt=(e.flags&131072)!==0}else Rt=!1,Je&&(t.flags&1048576)!==0&&$m(t,Jl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,u=l._init;if(l=u(l._payload),t.type=l,typeof l=="function")Ac(l)?(e=Mr(l,e),t.tag=1,t=vv(null,t,l,e,r)):(t.tag=0,t=ff(null,t,l,e,r));else{if(l!=null){if(u=l.$$typeof,u===L){t.tag=11,t=cv(null,t,l,e,r);break e}else if(u===Z){t.tag=14,t=fv(null,t,l,e,r);break e}}throw t=ue(l)||l,Error(s(306,t,""))}}return t;case 0:return ff(e,t,t.type,t.pendingProps,r);case 1:return l=t.type,u=Mr(l,t.pendingProps),vv(e,t,l,u,r);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var f=t.memoizedState;u=f.element,Hc(e,t),Es(t,l,null,r);var v=t.memoizedState;if(l=v.cache,ka(t,_t,l),l!==f.cache&&kc(t,[_t],r,!0),ws(),l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=gv(e,t,l,r);break e}else if(l!==u){u=pn(Error(s(424)),t),vs(u),t=gv(e,t,l,r);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(ht=Cn(e.firstChild),qt=t,Je=!0,Er=null,Vn=!0,r=Wp(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ps(),l===u){t=ca(e,t,r);break e}Nt(e,t,l,r)}t=t.child}return t;case 26:return bo(e,t),e===null?(r=Tg(t.type,null,t.pendingProps,null))?t.memoizedState=r:Je||(r=t.type,e=t.pendingProps,l=ko(xe.current).createElement(r),l[Ut]=t,l[It]=e,jt(l,r,e),Ct(l),t.stateNode=l):t.memoizedState=Tg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return He(t),e===null&&Je&&(l=t.stateNode=_g(t.type,t.pendingProps,xe.current),qt=t,Vn=!0,u=ht,Xa(t.type)?(Jf=u,ht=Cn(l.firstChild)):ht=u),Nt(e,t,t.pendingProps.children,r),bo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((u=l=ht)&&(l=ow(l,t.type,t.pendingProps,Vn),l!==null?(t.stateNode=l,qt=t,ht=Cn(l.firstChild),Vn=!1,u=!0):u=!1),u||Tr(t)),He(t),u=t.type,f=t.pendingProps,v=e!==null?e.memoizedProps:null,l=f.children,Qf(u,f)?l=null:v!==null&&Qf(u,v)&&(t.flags|=32),t.memoizedState!==null&&(u=Yc(e,t,A_,null,null,r),Ys._currentValue=u),bo(e,t),Nt(e,t,l,r),t.child;case 6:return e===null&&Je&&((e=r=ht)&&(r=uw(r,t.pendingProps,Vn),r!==null?(t.stateNode=r,qt=t,ht=null,e=!0):e=!1),e||Tr(t)),null;case 13:return yv(e,t,r);case 4:return Te(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=_i(t,null,l,r):Nt(e,t,l,r),t.child;case 11:return cv(e,t,t.type,t.pendingProps,r);case 7:return Nt(e,t,t.pendingProps,r),t.child;case 8:return Nt(e,t,t.pendingProps.children,r),t.child;case 12:return Nt(e,t,t.pendingProps.children,r),t.child;case 10:return l=t.pendingProps,ka(t,t.type,l.value),Nt(e,t,l.children,r),t.child;case 9:return u=t.type._context,l=t.pendingProps.children,Cr(t),u=Lt(u),l=l(u),t.flags|=1,Nt(e,t,l,r),t.child;case 14:return fv(e,t,t.type,t.pendingProps,r);case 15:return dv(e,t,t.type,t.pendingProps,r);case 19:return xv(e,t,r);case 31:return l=t.pendingProps,r=t.mode,l={mode:l.mode,children:l.children},e===null?(r=xo(l,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=aa(e.child,l),r.ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return hv(e,t,r);case 24:return Cr(t),l=Lt(_t),e===null?(u=Lc(),u===null&&(u=ut,f=zc(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=r),u=f),t.memoizedState={parent:l,cache:u},Bc(t),ka(t,_t,u)):((e.lanes&r)!==0&&(Hc(e,t),Es(t,null,null,r),ws()),u=e.memoizedState,f=t.memoizedState,u.parent!==l?(u={parent:l,cache:l},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ka(t,_t,l)):(l=f.cache,ka(t,_t,l),l!==u.cache&&kc(t,[_t],r,!0))),Nt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function fa(e){e.flags|=4}function _v(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Mg(t)){if(t=bn.current,t!==null&&((Ie&4194048)===Ie?Bn!==null:(Ie&62914560)!==Ie&&(Ie&536870912)===0||t!==Bn))throw Ss=Vc,ip;e.flags|=8192}}function So(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?em():536870912,e.lanes|=t,Ai|=t)}function Ns(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags&65011712,l|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function z_(e,t,r){var l=t.pendingProps;switch(Mc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return r=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),la(_t),Xe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ms(t)?fa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ep())),ft(t),null;case 26:return r=t.memoizedState,e===null?(fa(t),r!==null?(ft(t),_v(t,r)):(ft(t),t.flags&=-16777217)):r?r!==e.memoizedState?(fa(t),ft(t),_v(t,r)):(ft(t),t.flags&=-16777217):(e.memoizedProps!==l&&fa(t),ft(t),t.flags&=-16777217),null;case 27:Fe(t),r=xe.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fa(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}e=ce.current,ms(t)?Jm(t):(e=_g(u,l,r),t.stateNode=e,fa(t))}return ft(t),null;case 5:if(Fe(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&fa(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}if(e=ce.current,ms(t))Jm(t);else{switch(u=ko(xe.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":e=u.createElement("div"),e.innerHTML=" - - - - + + + + +
diff --git a/releases/auto-post-facebook-extensions_1.0/manifest.json b/releases/auto-post-facebook-extensions_1.0/manifest.json index 307f3a8..9bb331e 100644 --- a/releases/auto-post-facebook-extensions_1.0/manifest.json +++ b/releases/auto-post-facebook-extensions_1.0/manifest.json @@ -9,6 +9,7 @@ "service_worker": "background/background.js", "type": "module" }, + "host_permissions": ["http://172.16.7.48/*"], "content_scripts": [ { "matches": [""], @@ -16,6 +17,12 @@ "type": "module" } ], + "web_accessible_resources": [ + { + "resources": ["content/inject-ui.js", "assets/*"], + "matches": [""] + } + ], "permissions": ["storage", "tabs", "activeTab", "scripting"] } diff --git a/server/data.json b/server/data.json index 72dd08c..66ebde9 100644 --- a/server/data.json +++ b/server/data.json @@ -1,20 +1,20 @@ [ + { + "title": "Air-ct7510-k9 - AIR-CT7510-K9", + "price": 8562, + "el": {}, + "date": "2025-08-21T08:56:43.192Z" + }, { "title": "2-Port Analog Telephone Adapter - ATA191-K9", "price": 220, "el": {}, - "date": "2025-08-21T08:34:00.451Z" + "date": "2025-08-21T08:56:43.192Z" }, { "title": "Cisco 2911 Voice Bundle, Pvdm3-16, Uc License Pak, Fl- Cube10 - CISCO2911-V/K9", "price": 125, "el": {}, - "date": "2025-08-21T08:34:00.451Z" - }, - { - "title": "Air-ct7510-k9 - AIR-CT7510-K9", - "price": 8562, - "el": {}, - "date": "2025-08-21T08:34:00.451Z" + "date": "2025-08-21T08:56:43.192Z" } ] \ No newline at end of file diff --git a/server/server.js b/server/server.js index d8ccecc..6bd2dd4 100644 --- a/server/server.js +++ b/server/server.js @@ -142,7 +142,7 @@ app.post("/", async (req, res) => { ); let filteredData = data.data.filter((item) => { - const key = `${item.name} - ${item.code}${item.price}`.toLowerCase(); + const key = `${item.title} - ${item.code}${item.price}`.toLowerCase(); return status === "listed" ? listedCodes.has(key) : !listedCodes.has(key); diff --git a/src/api/product-api.service.ts b/src/api/product-api.service.ts index 58e9a99..5d59157 100644 --- a/src/api/product-api.service.ts +++ b/src/api/product-api.service.ts @@ -40,8 +40,15 @@ class ProductApiService { return axios({ method: "POST", data: { - urlAPI: "/api/product-model/get-info/" + data.id, - pageCurrent: "/productdata/products/edit/" + data.id, + filter: { + where: { + account: "prology_net", + condition: data.raw_condition, + productModelCode: data.sku, + }, + }, + pageCurrent: "/ebaytools/listing-ebay", + urlAPI: "/api/ebay-listing/get-image-listing", }, }); } @@ -59,6 +66,50 @@ class ProductApiService { url: "data", }); } + + async apiRequest( + fn: + | "index" + | "getPublistedProducts" + | "get" + | "createBlobUrl" + | "publist" + | "unlist", + body: Record + ) { + return new Promise((resolve, reject) => { + const requestId = "req_" + Date.now() + "_" + Math.random(); + + // Lắng nghe 1 lần response cho requestId + function handleResponse(event: any) { + if ( + event.data.type === "API_RESPONSE" && + event.data.requestId === requestId + ) { + window.removeEventListener("message", handleResponse); + + if (event.data.error) { + reject(event.data.error); + } else { + resolve(event.data.payload); + } + } + } + + window.addEventListener("message", handleResponse); + + // Gửi yêu cầu + window.postMessage( + { + type: "API_REQUEST", + requestId, + payload: body, + fn, + }, + "*" + ); + }); + } } export const productApi = new ProductApiService(); diff --git a/src/background/background.ts b/src/background/background.ts index e5b2a03..1b974d6 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -8,9 +8,9 @@ const queue = new PQueue({ concurrency: 1 }); const service = new BackgroundService(); // Forward hoặc xử lý logic -service.msgService.on("popup-to-content", (payload) => { +service.msgService.on("content-to-background-actions", (payload) => { console.log("Background nhận từ popup:", payload); - service.msgService.send("content", "popup-to-content", payload); + // service.msgService.send("content", "popup-to-content", payload); switch (payload?.type) { case "publist": { @@ -32,3 +32,9 @@ service.msgService.on("content-to-popup", (payload) => { console.log("Background nhận từ content:", payload); service.msgService.send("popup", "content-to-popup", payload); }); + +// Listent to handle create blob image urls +service.msgService.on( + "content-to-background-create-blod-urls", + (payload) => service.createBlobUrls(payload) +); diff --git a/src/components/btn/confirm-alert.tsx b/src/components/btn/confirm-alert.tsx index d2a51b8..fd35a5d 100644 --- a/src/components/btn/confirm-alert.tsx +++ b/src/components/btn/confirm-alert.tsx @@ -1,7 +1,5 @@ -import { useState, type ReactNode } from "react"; import { AlertDialog, - AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, @@ -10,9 +8,10 @@ import { AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; -import { Button } from "../ui/button"; import { delay } from "@/features/app"; +import { useState, type ReactNode } from "react"; import Loader from "../loader"; +import { Button } from "../ui/button"; export function ConfirmAlert({ children, diff --git a/src/components/improved-toggle-filter.tsx b/src/components/improved-toggle-filter.tsx new file mode 100644 index 0000000..04c8143 --- /dev/null +++ b/src/components/improved-toggle-filter.tsx @@ -0,0 +1,66 @@ +"use client"; + +import { Button } from "@/components/ui/button"; +import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; +import { Eye, EyeOff, X } from "lucide-react"; + +interface FilterToggleProps { + filter: { + statusFilter: string; + }; + setFilter: (filter: { statusFilter: string }) => void; + activeFiltersCount: number; + clearFilters: () => void; +} + +export function ImprovedToggleFilter({ + filter, + setFilter, + activeFiltersCount, + clearFilters, +}: FilterToggleProps) { + return ( +
+ setFilter({ statusFilter: val || "" })} // val null => reset filter + className="flex items-center gap-1 p-1 bg-muted rounded-lg" + > + + + Listed + + + + + Unlisted + + + + {activeFiltersCount > 0 && ( + + )} +
+ ); +} diff --git a/src/components/loader.tsx b/src/components/loader.tsx index 5e48dbd..e074681 100644 --- a/src/components/loader.tsx +++ b/src/components/loader.tsx @@ -22,7 +22,7 @@ export default function Loader({ color = "black", ...props }: ILoaderProps) { >
{ setSearchTerm(""); - setStatusFilter("all"); setFilter({}); setCurrentPage(1); - setIsFilterModalOpen(false); }; - const activeFiltersCount = [statusFilter !== "all", searchTerm !== ""].filter( + const activeFiltersCount = [filter.statusFilter, searchTerm !== ""].filter( Boolean ).length; @@ -197,59 +179,26 @@ export function PostTable() { />
- - - - - - - Product Filters - +
+ + -
- -
- - -
-
- -
+ {activeFiltersCount > 0 && ( + + )} +
diff --git a/src/components/product-modal.tsx b/src/components/product-modal.tsx index afdbc5c..21f7e62 100644 --- a/src/components/product-modal.tsx +++ b/src/components/product-modal.tsx @@ -1,9 +1,10 @@ +/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable no-constant-binary-expression */ "use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { Plus, X } from "lucide-react"; -import { useEffect, useState, type ReactNode } from "react"; +import { useCallback, useEffect, useState, type ReactNode } from "react"; import { useForm } from "react-hook-form"; import { Badge } from "@/components/ui/badge"; @@ -26,9 +27,7 @@ import { } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; -import { productApi } from "@/api/product-api.service"; import Loader from "@/components/loader"; -import { Checkbox } from "@/components/ui/checkbox"; import { Form, FormControl, @@ -37,13 +36,12 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; -import { Label } from "@/components/ui/label"; -import { delay } from "@/features/app"; import { urlToBase64 } from "@/features/base64"; -import { mapToIPost, type IPost } from "@/lib/utils"; -import { useQuery } from "@tanstack/react-query"; -import z from "zod/v3"; import usePost from "@/hooks/use-post-hook"; +import { mapToIPost, type IPost } from "@/lib/utils"; +import z from "zod/v3"; +import { useMutation } from "@tanstack/react-query"; +import { productApi } from "@/api/product-api.service"; // eslint-disable-next-line react-refresh/only-export-components export const productSchema = z.object({ @@ -114,102 +112,6 @@ export default function ProductModal({ const { ...query } = usePost(data); - // const delImageMutation = useMutation({ - // mutationFn: async (imageUrl: string) => { - // await delay(300); - - // return await axios.delete(imageUrl); - // }, - // onSuccess: (data) => { - // refetch(); - // }, - // }); - - // const actionMutation = useMutation({ - // mutationFn: async (formData: ProductFormData & { id?: number }) => { - // const { id, brand, publist, ...rest } = formData; - // let response; - - // if (id) { - // // Update - // response = await productApi.update(id, { ...rest, id }); - - // if (publist && response?.data) { - // const action = data?.status ? "re-publist" : "publist"; - // await productApi.customAction( - // response.data.id, - // action, - // response.data, - // "POST", - // { toast_success: false } - // ); - // } - // } else { - // // Create - // response = await productApi.create({ ...rest, brand }); - - // if (publist && response?.data) { - // await productApi.customAction( - // response.data.id, - // "publist", - // response.data, - // "POST", - // { toast_success: false } - // ); - // } - // } - - // return response; - // }, - // onSuccess: () => { - // refetch(); // làm mới danh sách - // setOpen(false); - // setUrlInput(""); - // setTagInput(""); - // props.onSubmit?.(); - // form.reset(); - // }, - // onError: (error) => { - // console.error("Mutation failed:", error); - // }, - // }); - - const handleImageUpload = (e: React.ChangeEvent) => { - const files = e.target.files; - if (files) { - const newImages: string[] = []; - const currentImages = form.getValues("images"); - - Array.from(files).forEach((file) => { - const url = URL.createObjectURL(file); - newImages.push(url); - }); - - form.setValue("images", [...currentImages, ...newImages]); - } - }; - - const addImageFromUrl = () => { - if (urlInput.trim() && !watchedImages.includes(urlInput.trim())) { - const currentImages = form.getValues("images"); - form.setValue("images", [...currentImages, urlInput.trim()]); - setUrlInput(""); - } - }; - - const removeImage = (index: number, image: string) => { - const currentImages = form.getValues("images"); - - if (data && isHttpUrl(image)) { - // delImageMutation.mutate(image); - } else { - form.setValue( - "images", - currentImages.filter((_, i) => i !== index) - ); - } - }; - const addTag = () => { if (tagInput.trim() && !watchedTags?.includes(tagInput.trim())) { const currentTags = form.getValues("tags") || []; @@ -273,15 +175,6 @@ export default function ProductModal({ } }; - const isHttpUrl = (url: string) => { - try { - const u = new URL(url); - return u.protocol === "http:" || u.protocol === "https:"; - } catch { - return false; - } - }; - const handleClose = () => { setOpen(false); form.reset(); @@ -289,20 +182,26 @@ export default function ProductModal({ setTagInput(""); }; - useEffect(() => { - console.log({ a: { ...data, ...query.data?.data.data } }); - if (query.data?.data?.data && data) { - const values = mapToIPost({ ...data, ...query.data?.data.data }); - form.reset(values); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [query.data, data]); + const mutation = useMutation({ + mutationKey: ["createBlobUrl", data?.sku], + mutationFn: (images: string[]) => { + return productApi.apiRequest("createBlobUrl", images); + }, + }); - // useEffect(() => { - // if (query.isSuccess && query.isFetched && query.data?.data) { - // form.reset(query.data?.data); - // } - // }, [delImageMutation.isSuccess, query.isFetched, query.isSuccess]); + useEffect(() => { + (async () => { + if (!(query.data as any)?.data || !data) return; + const images = mapToIPost({ ...(query.data as any)?.data }).images; + + const urls = await mutation.mutateAsync(images); + const values = { + ...data, + images: urls as string[], + }; + form.reset(values); + })(); + }, [query.data, data]); return ( @@ -319,154 +218,67 @@ export default function ProductModal({ {/* Body */} -
-
- - {/* Images */} - - - ( - - - Images * - - + {!query.isLoading && !mutation.isPending && ( +
+ + + {/* Images */} + + + ( + + + Images * + + - {/* Image preview */} - {watchedImages.length > 0 && ( -
-
- {watchedImages.map((image, index) => ( -
- {`Preview -
- ))} + {/* Image preview */} + {watchedImages.length > 0 && ( +
+
+ {watchedImages.map((image, index) => ( +
+ {`Preview +
+ ))} +
-
- )} - - )} - /> - - - - {/* Product info */} - - -

- Product information -

- - ( - - Title * - - - - - - )} - /> - - ( - - Price ($) * - - - - - - )} - /> - -
- ( - - Category * - - {/* */} - - - - + )} )} /> + + + + {/* Product info */} + + +

+ Product information +

( - Condition * - - - - - - )} - /> - - ( - - Brand + Title * @@ -474,102 +286,197 @@ export default function ProductModal({ )} /> -
- ( - - Description * - -