@danhachuel/prodmaker 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/app/api/builder.py +127 -0
- package/app/main.py +4 -2
- package/app/services/builder.py +333 -0
- package/frontend/dist/assets/index-tkOFAfR-.js +77 -0
- package/frontend/dist/index.html +1 -1
- package/package.json +1 -1
- package/scripts/cli.mjs +1 -1
- package/seed/prompts/builder-anuncios.md +25 -0
- package/seed/prompts/builder-assets.md +23 -0
- package/seed/prompts/builder-estrutura.md +33 -0
- package/seed/prompts/builder-ofertas.md +27 -0
- package/seed/prompts/builder-produto.md +19 -0
- package/frontend/dist/assets/index-C8sX5Mkf.js +0 -74
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
function ud(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(r,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zo={exports:{}},Ca={},Oo={exports:{}},B={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var hr=Symbol.for("react.element"),dd=Symbol.for("react.portal"),pd=Symbol.for("react.fragment"),fd=Symbol.for("react.strict_mode"),hd=Symbol.for("react.profiler"),md=Symbol.for("react.provider"),vd=Symbol.for("react.context"),gd=Symbol.for("react.forward_ref"),xd=Symbol.for("react.suspense"),yd=Symbol.for("react.memo"),jd=Symbol.for("react.lazy"),si=Symbol.iterator;function Sd(e){return e===null||typeof e!="object"?null:(e=si&&e[si]||e["@@iterator"],typeof e=="function"?e:null)}var Ro={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Do=Object.assign,bo={};function Cn(e,t,n){this.props=e,this.context=t,this.refs=bo,this.updater=n||Ro}Cn.prototype.isReactComponent={};Cn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $o(){}$o.prototype=Cn.prototype;function cs(e,t,n){this.props=e,this.context=t,this.refs=bo,this.updater=n||Ro}var ds=cs.prototype=new $o;ds.constructor=cs;Do(ds,Cn.prototype);ds.isPureReactComponent=!0;var ii=Array.isArray,Fo=Object.prototype.hasOwnProperty,ps={current:null},Mo={key:!0,ref:!0,__self:!0,__source:!0};function Bo(e,t,n){var r,l={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Fo.call(t,r)&&!Mo.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1<u){for(var o=Array(u),c=0;c<u;c++)o[c]=arguments[c+2];l.children=o}if(e&&e.defaultProps)for(r in u=e.defaultProps,u)l[r]===void 0&&(l[r]=u[r]);return{$$typeof:hr,type:e,key:s,ref:i,props:l,_owner:ps.current}}function wd(e,t){return{$$typeof:hr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function fs(e){return typeof e=="object"&&e!==null&&e.$$typeof===hr}function kd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var oi=/\/+/g;function Ba(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kd(""+e.key):t.toString(36)}function Ur(e,t,n,r,l){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case hr:case dd:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+Ba(i,0):r,ii(l)?(n="",e!=null&&(n=e.replace(oi,"$&/")+"/"),Ur(l,t,n,"",function(c){return c})):l!=null&&(fs(l)&&(l=wd(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(oi,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",ii(e))for(var u=0;u<e.length;u++){s=e[u];var o=r+Ba(s,u);i+=Ur(s,t,n,o,l)}else if(o=Sd(e),typeof o=="function")for(e=o.call(e),u=0;!(s=e.next()).done;)s=s.value,o=r+Ba(s,u++),i+=Ur(s,t,n,o,l);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function kr(e,t,n){if(e==null)return e;var r=[],l=0;return Ur(e,r,"","",function(s){return t.call(n,s,l++)}),r}function Cd(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Se={current:null},Vr={transition:null},Nd={ReactCurrentDispatcher:Se,ReactCurrentBatchConfig:Vr,ReactCurrentOwner:ps};function Uo(){throw Error("act(...) is not supported in production builds of React.")}B.Children={map:kr,forEach:function(e,t,n){kr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kr(e,function(){t++}),t},toArray:function(e){return kr(e,function(t){return t})||[]},only:function(e){if(!fs(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};B.Component=Cn;B.Fragment=pd;B.Profiler=hd;B.PureComponent=cs;B.StrictMode=fd;B.Suspense=xd;B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nd;B.act=Uo;B.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Do({},e.props),l=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=ps.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(o in t)Fo.call(t,o)&&!Mo.hasOwnProperty(o)&&(r[o]=t[o]===void 0&&u!==void 0?u[o]:t[o])}var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){u=Array(o);for(var c=0;c<o;c++)u[c]=arguments[c+2];r.children=u}return{$$typeof:hr,type:e.type,key:l,ref:s,props:r,_owner:i}};B.createContext=function(e){return e={$$typeof:vd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:md,_context:e},e.Consumer=e};B.createElement=Bo;B.createFactory=function(e){var t=Bo.bind(null,e);return t.type=e,t};B.createRef=function(){return{current:null}};B.forwardRef=function(e){return{$$typeof:gd,render:e}};B.isValidElement=fs;B.lazy=function(e){return{$$typeof:jd,_payload:{_status:-1,_result:e},_init:Cd}};B.memo=function(e,t){return{$$typeof:yd,type:e,compare:t===void 0?null:t}};B.startTransition=function(e){var t=Vr.transition;Vr.transition={};try{e()}finally{Vr.transition=t}};B.unstable_act=Uo;B.useCallback=function(e,t){return Se.current.useCallback(e,t)};B.useContext=function(e){return Se.current.useContext(e)};B.useDebugValue=function(){};B.useDeferredValue=function(e){return Se.current.useDeferredValue(e)};B.useEffect=function(e,t){return Se.current.useEffect(e,t)};B.useId=function(){return Se.current.useId()};B.useImperativeHandle=function(e,t,n){return Se.current.useImperativeHandle(e,t,n)};B.useInsertionEffect=function(e,t){return Se.current.useInsertionEffect(e,t)};B.useLayoutEffect=function(e,t){return Se.current.useLayoutEffect(e,t)};B.useMemo=function(e,t){return Se.current.useMemo(e,t)};B.useReducer=function(e,t,n){return Se.current.useReducer(e,t,n)};B.useRef=function(e){return Se.current.useRef(e)};B.useState=function(e){return Se.current.useState(e)};B.useSyncExternalStore=function(e,t,n){return Se.current.useSyncExternalStore(e,t,n)};B.useTransition=function(){return Se.current.useTransition()};B.version="18.3.1";Oo.exports=B;var f=Oo.exports;const Vo=cd(f),Ed=ud({__proto__:null,default:Vo},[f]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Pd=f,_d=Symbol.for("react.element"),Td=Symbol.for("react.fragment"),Ld=Object.prototype.hasOwnProperty,Ad=Pd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Id={key:!0,ref:!0,__self:!0,__source:!0};function Wo(e,t,n){var r,l={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Ld.call(t,r)&&!Id.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:_d,type:e,key:s,ref:i,props:l,_owner:Ad.current}}Ca.Fragment=Td;Ca.jsx=Wo;Ca.jsxs=Wo;zo.exports=Ca;var a=zo.exports,Ho={exports:{}},ze={},Go={exports:{}},Qo={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(O,F){var L=O.length;O.push(F);e:for(;0<L;){var $=L-1>>>1,_=O[$];if(0<l(_,F))O[$]=F,O[L]=_,L=$;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var F=O[0],L=O.pop();if(L!==F){O[0]=L;e:for(var $=0,_=O.length,H=_>>>1;$<H;){var De=2*($+1)-1,Ve=O[De],zt=De+1,wr=O[zt];if(0>l(Ve,L))zt<_&&0>l(wr,Ve)?(O[$]=wr,O[zt]=L,$=zt):(O[$]=Ve,O[De]=L,$=De);else if(zt<_&&0>l(wr,L))O[$]=wr,O[zt]=L,$=zt;else break e}}return F}function l(O,F){var L=O.sortIndex-F.sortIndex;return L!==0?L:O.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var o=[],c=[],v=1,g=null,h=3,S=!1,y=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(O){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=O)r(c),F.sortIndex=F.expirationTime,t(o,F);else break;F=n(c)}}function j(O){if(k=!1,p(O),!y)if(n(o)!==null)y=!0,T(C);else{var F=n(c);F!==null&&M(j,F.startTime-O)}}function C(O,F){y=!1,k&&(k=!1,x(P),P=-1),S=!0;var L=h;try{for(p(F),g=n(o);g!==null&&(!(g.expirationTime>F)||O&&!D());){var $=g.callback;if(typeof $=="function"){g.callback=null,h=g.priorityLevel;var _=$(g.expirationTime<=F);F=e.unstable_now(),typeof _=="function"?g.callback=_:g===n(o)&&r(o),p(F)}else r(o);g=n(o)}if(g!==null)var H=!0;else{var De=n(c);De!==null&&M(j,De.startTime-F),H=!1}return H}finally{g=null,h=L,S=!1}}var A=!1,E=null,P=-1,m=5,w=-1;function D(){return!(e.unstable_now()-w<m)}function U(){if(E!==null){var O=e.unstable_now();w=O;var F=!0;try{F=E(!0,O)}finally{F?W():(A=!1,E=null)}}else A=!1}var W;if(typeof d=="function")W=function(){d(U)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,_e=xe.port2;xe.port1.onmessage=U,W=function(){_e.postMessage(null)}}else W=function(){N(U,0)};function T(O){E=O,A||(A=!0,W())}function M(O,F){P=N(function(){O(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){y||S||(y=!0,T(C))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(o)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var F=3;break;default:F=h}var L=h;h=F;try{return O()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,F){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var L=h;h=O;try{return F()}finally{h=L}},e.unstable_scheduleCallback=function(O,F,L){var $=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?$+L:$):L=$,O){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=L+_,O={id:v++,callback:F,priorityLevel:O,startTime:L,expirationTime:_,sortIndex:-1},L>$?(O.sortIndex=L,t(c,O),n(o)===null&&O===n(c)&&(k?(x(P),P=-1):k=!0,M(j,L-$))):(O.sortIndex=_,t(o,O),y||S||(y=!0,T(C))),O},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(O){var F=h;return function(){var L=h;h=F;try{return O.apply(this,arguments)}finally{h=L}}}})(Qo);Go.exports=Qo;var zd=Go.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Od=f,Ie=zd;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var qo=new Set,Kn={};function qt(e,t){gn(e,t),gn(e+"Capture",t)}function gn(e,t){for(Kn[e]=t,e=0;e<t.length;e++)qo.add(t[e])}var it=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ml=Object.prototype.hasOwnProperty,Rd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ui={},ci={};function Dd(e){return ml.call(ci,e)?!0:ml.call(ui,e)?!1:Rd.test(e)?ci[e]=!0:(ui[e]=!0,!1)}function bd(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $d(e,t,n,r){if(t===null||typeof t>"u"||bd(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function we(e,t,n,r,l,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pe[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pe[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pe[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pe[e]=new we(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){pe[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pe[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pe[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pe[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pe[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var hs=/[\-:]([a-z])/g;function ms(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hs,ms);pe[t]=new we(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hs,ms);pe[t]=new we(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hs,ms);pe[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pe[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});pe.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pe[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function vs(e,t,n,r){var l=pe.hasOwnProperty(t)?pe[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($d(t,n,l,r)&&(n=null),r||l===null?Dd(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var dt=Od.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Cr=Symbol.for("react.element"),Yt=Symbol.for("react.portal"),Zt=Symbol.for("react.fragment"),gs=Symbol.for("react.strict_mode"),vl=Symbol.for("react.profiler"),Ko=Symbol.for("react.provider"),Jo=Symbol.for("react.context"),xs=Symbol.for("react.forward_ref"),gl=Symbol.for("react.suspense"),xl=Symbol.for("react.suspense_list"),ys=Symbol.for("react.memo"),ft=Symbol.for("react.lazy"),Xo=Symbol.for("react.offscreen"),di=Symbol.iterator;function _n(e){return e===null||typeof e!="object"?null:(e=di&&e[di]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Object.assign,Ua;function Dn(e){if(Ua===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ua=t&&t[1]||""}return`
|
|
34
|
-
`+Ua+e}var Va=!1;function Wa(e,t){if(!e||Va)return"";Va=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
|
|
35
|
-
`),s=r.stack.split(`
|
|
36
|
-
`),i=l.length-1,u=s.length-1;1<=i&&0<=u&&l[i]!==s[u];)u--;for(;1<=i&&0<=u;i--,u--)if(l[i]!==s[u]){if(i!==1||u!==1)do if(i--,u--,0>u||l[i]!==s[u]){var o=`
|
|
37
|
-
`+l[i].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=i&&0<=u);break}}}finally{Va=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Dn(e):""}function Fd(e){switch(e.tag){case 5:return Dn(e.type);case 16:return Dn("Lazy");case 13:return Dn("Suspense");case 19:return Dn("SuspenseList");case 0:case 2:case 15:return e=Wa(e.type,!1),e;case 11:return e=Wa(e.type.render,!1),e;case 1:return e=Wa(e.type,!0),e;default:return""}}function yl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zt:return"Fragment";case Yt:return"Portal";case vl:return"Profiler";case gs:return"StrictMode";case gl:return"Suspense";case xl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jo:return(e.displayName||"Context")+".Consumer";case Ko:return(e._context.displayName||"Context")+".Provider";case xs:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ys:return t=e.displayName||null,t!==null?t:yl(e.type)||"Memo";case ft:t=e._payload,e=e._init;try{return yl(e(t))}catch{}}return null}function Md(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return yl(t);case 8:return t===gs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _t(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bd(e){var t=Yo(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nr(e){e._valueTracker||(e._valueTracker=Bd(e))}function Zo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yo(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ea(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function jl(e,t){var n=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_t(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function eu(e,t){t=t.checked,t!=null&&vs(e,"checked",t,!1)}function Sl(e,t){eu(e,t);var n=_t(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wl(e,t.type,n):t.hasOwnProperty("defaultValue")&&wl(e,t.type,_t(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wl(e,t,n){(t!=="number"||ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bn=Array.isArray;function dn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+_t(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function kl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return Z({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hi(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(bn(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:_t(n)}}function tu(e,t){var n=_t(t.value),r=_t(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mi(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Cl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Er,ru=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Er=Er||document.createElement("div"),Er.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ud=["Webkit","ms","Moz","O"];Object.keys(Mn).forEach(function(e){Ud.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mn[t]=Mn[e]})});function au(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mn.hasOwnProperty(e)&&Mn[e]?(""+t).trim():t+"px"}function lu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=au(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Vd=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Nl(e,t){if(t){if(Vd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function El(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pl=null;function js(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _l=null,pn=null,fn=null;function vi(e){if(e=gr(e)){if(typeof _l!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Ta(t),_l(e.stateNode,e.type,t))}}function su(e){pn?fn?fn.push(e):fn=[e]:pn=e}function iu(){if(pn){var e=pn,t=fn;if(fn=pn=null,vi(e),t)for(e=0;e<t.length;e++)vi(t[e])}}function ou(e,t){return e(t)}function uu(){}var Ha=!1;function cu(e,t,n){if(Ha)return e(t,n);Ha=!0;try{return ou(e,t,n)}finally{Ha=!1,(pn!==null||fn!==null)&&(uu(),iu())}}function Xn(e,t){var n=e.stateNode;if(n===null)return null;var r=Ta(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var Tl=!1;if(it)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){Tl=!0}}),window.addEventListener("test",Tn,Tn),window.removeEventListener("test",Tn,Tn)}catch{Tl=!1}function Wd(e,t,n,r,l,s,i,u,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(v){this.onError(v)}}var Bn=!1,ta=null,na=!1,Ll=null,Hd={onError:function(e){Bn=!0,ta=e}};function Gd(e,t,n,r,l,s,i,u,o){Bn=!1,ta=null,Wd.apply(Hd,arguments)}function Qd(e,t,n,r,l,s,i,u,o){if(Gd.apply(this,arguments),Bn){if(Bn){var c=ta;Bn=!1,ta=null}else throw Error(I(198));na||(na=!0,Ll=c)}}function Kt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function du(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function gi(e){if(Kt(e)!==e)throw Error(I(188))}function qd(e){var t=e.alternate;if(!t){if(t=Kt(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var s=l.alternate;if(s===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===n)return gi(l),e;if(s===r)return gi(l),t;s=s.sibling}throw Error(I(188))}if(n.return!==r.return)n=l,r=s;else{for(var i=!1,u=l.child;u;){if(u===n){i=!0,n=l,r=s;break}if(u===r){i=!0,r=l,n=s;break}u=u.sibling}if(!i){for(u=s.child;u;){if(u===n){i=!0,n=s,r=l;break}if(u===r){i=!0,r=s,n=l;break}u=u.sibling}if(!i)throw Error(I(189))}}if(n.alternate!==r)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function pu(e){return e=qd(e),e!==null?fu(e):null}function fu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fu(e);if(t!==null)return t;e=e.sibling}return null}var hu=Ie.unstable_scheduleCallback,xi=Ie.unstable_cancelCallback,Kd=Ie.unstable_shouldYield,Jd=Ie.unstable_requestPaint,ne=Ie.unstable_now,Xd=Ie.unstable_getCurrentPriorityLevel,Ss=Ie.unstable_ImmediatePriority,mu=Ie.unstable_UserBlockingPriority,ra=Ie.unstable_NormalPriority,Yd=Ie.unstable_LowPriority,vu=Ie.unstable_IdlePriority,Na=null,et=null;function Zd(e){if(et&&typeof et.onCommitFiberRoot=="function")try{et.onCommitFiberRoot(Na,e,void 0,(e.current.flags&128)===128)}catch{}}var qe=Math.clz32?Math.clz32:np,ep=Math.log,tp=Math.LN2;function np(e){return e>>>=0,e===0?32:31-(ep(e)/tp|0)|0}var Pr=64,_r=4194304;function $n(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function aa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=$n(u):(s&=i,s!==0&&(r=$n(s)))}else i=n&~l,i!==0?r=$n(i):s!==0&&(r=$n(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-qe(t),l=1<<n,r|=e[n],t&=~l;return r}function rp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ap(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-qe(s),u=1<<i,o=l[i];o===-1?(!(u&n)||u&r)&&(l[i]=rp(u,t)):o<=t&&(e.expiredLanes|=u),s&=~u}}function Al(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gu(){var e=Pr;return Pr<<=1,!(Pr&4194240)&&(Pr=64),e}function Ga(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qe(t),e[t]=n}function lp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-qe(n),s=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~s}}function ws(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qe(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var G=0;function xu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yu,ks,ju,Su,wu,Il=!1,Tr=[],jt=null,St=null,wt=null,Yn=new Map,Zn=new Map,mt=[],sp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yi(e,t){switch(e){case"focusin":case"focusout":jt=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":wt=null;break;case"pointerover":case"pointerout":Yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zn.delete(t.pointerId)}}function Ln(e,t,n,r,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[l]},t!==null&&(t=gr(t),t!==null&&ks(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function ip(e,t,n,r,l){switch(t){case"focusin":return jt=Ln(jt,e,t,n,r,l),!0;case"dragenter":return St=Ln(St,e,t,n,r,l),!0;case"mouseover":return wt=Ln(wt,e,t,n,r,l),!0;case"pointerover":var s=l.pointerId;return Yn.set(s,Ln(Yn.get(s)||null,e,t,n,r,l)),!0;case"gotpointercapture":return s=l.pointerId,Zn.set(s,Ln(Zn.get(s)||null,e,t,n,r,l)),!0}return!1}function ku(e){var t=bt(e.target);if(t!==null){var n=Kt(t);if(n!==null){if(t=n.tag,t===13){if(t=du(n),t!==null){e.blockedOn=t,wu(e.priority,function(){ju(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=zl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pl=r,n.target.dispatchEvent(r),Pl=null}else return t=gr(n),t!==null&&ks(t),e.blockedOn=n,!1;t.shift()}return!0}function ji(e,t,n){Wr(e)&&n.delete(t)}function op(){Il=!1,jt!==null&&Wr(jt)&&(jt=null),St!==null&&Wr(St)&&(St=null),wt!==null&&Wr(wt)&&(wt=null),Yn.forEach(ji),Zn.forEach(ji)}function An(e,t){e.blockedOn===t&&(e.blockedOn=null,Il||(Il=!0,Ie.unstable_scheduleCallback(Ie.unstable_NormalPriority,op)))}function er(e){function t(l){return An(l,e)}if(0<Tr.length){An(Tr[0],e);for(var n=1;n<Tr.length;n++){var r=Tr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(jt!==null&&An(jt,e),St!==null&&An(St,e),wt!==null&&An(wt,e),Yn.forEach(t),Zn.forEach(t),n=0;n<mt.length;n++)r=mt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<mt.length&&(n=mt[0],n.blockedOn===null);)ku(n),n.blockedOn===null&&mt.shift()}var hn=dt.ReactCurrentBatchConfig,la=!0;function up(e,t,n,r){var l=G,s=hn.transition;hn.transition=null;try{G=1,Cs(e,t,n,r)}finally{G=l,hn.transition=s}}function cp(e,t,n,r){var l=G,s=hn.transition;hn.transition=null;try{G=4,Cs(e,t,n,r)}finally{G=l,hn.transition=s}}function Cs(e,t,n,r){if(la){var l=zl(e,t,n,r);if(l===null)nl(e,t,r,sa,n),yi(e,r);else if(ip(l,e,t,n,r))r.stopPropagation();else if(yi(e,r),t&4&&-1<sp.indexOf(e)){for(;l!==null;){var s=gr(l);if(s!==null&&yu(s),s=zl(e,t,n,r),s===null&&nl(e,t,r,sa,n),s===l)break;l=s}l!==null&&r.stopPropagation()}else nl(e,t,r,null,n)}}var sa=null;function zl(e,t,n,r){if(sa=null,e=js(r),e=bt(e),e!==null)if(t=Kt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=du(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return sa=e,null}function Cu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xd()){case Ss:return 1;case mu:return 4;case ra:case Yd:return 16;case vu:return 536870912;default:return 16}default:return 16}}var gt=null,Ns=null,Hr=null;function Nu(){if(Hr)return Hr;var e,t=Ns,n=t.length,r,l="value"in gt?gt.value:gt.textContent,s=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[s-r];r++);return Hr=l.slice(e,1<r?1-r:void 0)}function Gr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Lr(){return!0}function Si(){return!1}function Oe(e){function t(n,r,l,s,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(s):s[u]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Lr:Si,this.isPropagationStopped=Si,this}return Z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Lr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Lr)},persist:function(){},isPersistent:Lr}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Es=Oe(Nn),vr=Z({},Nn,{view:0,detail:0}),dp=Oe(vr),Qa,qa,In,Ea=Z({},vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ps,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==In&&(In&&e.type==="mousemove"?(Qa=e.screenX-In.screenX,qa=e.screenY-In.screenY):qa=Qa=0,In=e),Qa)},movementY:function(e){return"movementY"in e?e.movementY:qa}}),wi=Oe(Ea),pp=Z({},Ea,{dataTransfer:0}),fp=Oe(pp),hp=Z({},vr,{relatedTarget:0}),Ka=Oe(hp),mp=Z({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0}),vp=Oe(mp),gp=Z({},Nn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xp=Oe(gp),yp=Z({},Nn,{data:0}),ki=Oe(yp),jp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},wp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wp[e])?!!t[e]:!1}function Ps(){return kp}var Cp=Z({},vr,{key:function(e){if(e.key){var t=jp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ps,charCode:function(e){return e.type==="keypress"?Gr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Np=Oe(Cp),Ep=Z({},Ea,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ci=Oe(Ep),Pp=Z({},vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ps}),_p=Oe(Pp),Tp=Z({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lp=Oe(Tp),Ap=Z({},Ea,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ip=Oe(Ap),zp=[9,13,27,32],_s=it&&"CompositionEvent"in window,Un=null;it&&"documentMode"in document&&(Un=document.documentMode);var Op=it&&"TextEvent"in window&&!Un,Eu=it&&(!_s||Un&&8<Un&&11>=Un),Ni=" ",Ei=!1;function Pu(e,t){switch(e){case"keyup":return zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _u(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var en=!1;function Rp(e,t){switch(e){case"compositionend":return _u(t);case"keypress":return t.which!==32?null:(Ei=!0,Ni);case"textInput":return e=t.data,e===Ni&&Ei?null:e;default:return null}}function Dp(e,t){if(en)return e==="compositionend"||!_s&&Pu(e,t)?(e=Nu(),Hr=Ns=gt=null,en=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Eu&&t.locale!=="ko"?null:t.data;default:return null}}var bp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!bp[e.type]:t==="textarea"}function Tu(e,t,n,r){su(r),t=ia(t,"onChange"),0<t.length&&(n=new Es("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,tr=null;function $p(e){Mu(e,0)}function Pa(e){var t=rn(e);if(Zo(t))return e}function Fp(e,t){if(e==="change")return t}var Lu=!1;if(it){var Ja;if(it){var Xa="oninput"in document;if(!Xa){var _i=document.createElement("div");_i.setAttribute("oninput","return;"),Xa=typeof _i.oninput=="function"}Ja=Xa}else Ja=!1;Lu=Ja&&(!document.documentMode||9<document.documentMode)}function Ti(){Vn&&(Vn.detachEvent("onpropertychange",Au),tr=Vn=null)}function Au(e){if(e.propertyName==="value"&&Pa(tr)){var t=[];Tu(t,tr,e,js(e)),cu($p,t)}}function Mp(e,t,n){e==="focusin"?(Ti(),Vn=t,tr=n,Vn.attachEvent("onpropertychange",Au)):e==="focusout"&&Ti()}function Bp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pa(tr)}function Up(e,t){if(e==="click")return Pa(t)}function Vp(e,t){if(e==="input"||e==="change")return Pa(t)}function Wp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Je=typeof Object.is=="function"?Object.is:Wp;function nr(e,t){if(Je(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!ml.call(t,l)||!Je(e[l],t[l]))return!1}return!0}function Li(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ai(e,t){var n=Li(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Li(n)}}function Iu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zu(){for(var e=window,t=ea();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ea(e.document)}return t}function Ts(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hp(e){var t=zu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Iu(n.ownerDocument.documentElement,n)){if(r!==null&&Ts(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Ai(n,s);var i=Ai(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gp=it&&"documentMode"in document&&11>=document.documentMode,tn=null,Ol=null,Wn=null,Rl=!1;function Ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rl||tn==null||tn!==ea(r)||(r=tn,"selectionStart"in r&&Ts(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Wn&&nr(Wn,r)||(Wn=r,r=ia(Ol,"onSelect"),0<r.length&&(t=new Es("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=tn)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var nn={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionend:Ar("Transition","TransitionEnd")},Ya={},Ou={};it&&(Ou=document.createElement("div").style,"AnimationEvent"in window||(delete nn.animationend.animation,delete nn.animationiteration.animation,delete nn.animationstart.animation),"TransitionEvent"in window||delete nn.transitionend.transition);function _a(e){if(Ya[e])return Ya[e];if(!nn[e])return e;var t=nn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ou)return Ya[e]=t[n];return e}var Ru=_a("animationend"),Du=_a("animationiteration"),bu=_a("animationstart"),$u=_a("transitionend"),Fu=new Map,zi="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Lt(e,t){Fu.set(e,t),qt(t,[e])}for(var Za=0;Za<zi.length;Za++){var el=zi[Za],Qp=el.toLowerCase(),qp=el[0].toUpperCase()+el.slice(1);Lt(Qp,"on"+qp)}Lt(Ru,"onAnimationEnd");Lt(Du,"onAnimationIteration");Lt(bu,"onAnimationStart");Lt("dblclick","onDoubleClick");Lt("focusin","onFocus");Lt("focusout","onBlur");Lt($u,"onTransitionEnd");gn("onMouseEnter",["mouseout","mouseover"]);gn("onMouseLeave",["mouseout","mouseover"]);gn("onPointerEnter",["pointerout","pointerover"]);gn("onPointerLeave",["pointerout","pointerover"]);qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qt("onBeforeInput",["compositionend","keypress","textInput","paste"]);qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Kp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fn));function Oi(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Qd(r,t,void 0,e),e.currentTarget=null}function Mu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var u=r[i],o=u.instance,c=u.currentTarget;if(u=u.listener,o!==s&&l.isPropagationStopped())break e;Oi(l,u,c),s=o}else for(i=0;i<r.length;i++){if(u=r[i],o=u.instance,c=u.currentTarget,u=u.listener,o!==s&&l.isPropagationStopped())break e;Oi(l,u,c),s=o}}}if(na)throw e=Ll,na=!1,Ll=null,e}function q(e,t){var n=t[Ml];n===void 0&&(n=t[Ml]=new Set);var r=e+"__bubble";n.has(r)||(Bu(t,e,2,!1),n.add(r))}function tl(e,t,n){var r=0;t&&(r|=4),Bu(n,e,r,t)}var Ir="_reactListening"+Math.random().toString(36).slice(2);function rr(e){if(!e[Ir]){e[Ir]=!0,qo.forEach(function(n){n!=="selectionchange"&&(Kp.has(n)||tl(n,!1,e),tl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ir]||(t[Ir]=!0,tl("selectionchange",!1,t))}}function Bu(e,t,n,r){switch(Cu(t)){case 1:var l=up;break;case 4:l=cp;break;default:l=Cs}n=l.bind(null,t,n,e),l=void 0,!Tl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function nl(e,t,n,r,l){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var u=r.stateNode.containerInfo;if(u===l||u.nodeType===8&&u.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var o=i.tag;if((o===3||o===4)&&(o=i.stateNode.containerInfo,o===l||o.nodeType===8&&o.parentNode===l))return;i=i.return}for(;u!==null;){if(i=bt(u),i===null)return;if(o=i.tag,o===5||o===6){r=s=i;continue e}u=u.parentNode}}r=r.return}cu(function(){var c=s,v=js(n),g=[];e:{var h=Fu.get(e);if(h!==void 0){var S=Es,y=e;switch(e){case"keypress":if(Gr(n)===0)break e;case"keydown":case"keyup":S=Np;break;case"focusin":y="focus",S=Ka;break;case"focusout":y="blur",S=Ka;break;case"beforeblur":case"afterblur":S=Ka;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=wi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=fp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=_p;break;case Ru:case Du:case bu:S=vp;break;case $u:S=Lp;break;case"scroll":S=dp;break;case"wheel":S=Ip;break;case"copy":case"cut":case"paste":S=xp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=Ci}var k=(t&4)!==0,N=!k&&e==="scroll",x=k?h!==null?h+"Capture":null:h;k=[];for(var d=c,p;d!==null;){p=d;var j=p.stateNode;if(p.tag===5&&j!==null&&(p=j,x!==null&&(j=Xn(d,x),j!=null&&k.push(ar(d,j,p)))),N)break;d=d.return}0<k.length&&(h=new S(h,y,null,n,v),g.push({event:h,listeners:k}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",h&&n!==Pl&&(y=n.relatedTarget||n.fromElement)&&(bt(y)||y[ot]))break e;if((S||h)&&(h=v.window===v?v:(h=v.ownerDocument)?h.defaultView||h.parentWindow:window,S?(y=n.relatedTarget||n.toElement,S=c,y=y?bt(y):null,y!==null&&(N=Kt(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(S=null,y=c),S!==y)){if(k=wi,j="onMouseLeave",x="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(k=Ci,j="onPointerLeave",x="onPointerEnter",d="pointer"),N=S==null?h:rn(S),p=y==null?h:rn(y),h=new k(j,d+"leave",S,n,v),h.target=N,h.relatedTarget=p,j=null,bt(v)===c&&(k=new k(x,d+"enter",y,n,v),k.target=p,k.relatedTarget=N,j=k),N=j,S&&y)t:{for(k=S,x=y,d=0,p=k;p;p=Xt(p))d++;for(p=0,j=x;j;j=Xt(j))p++;for(;0<d-p;)k=Xt(k),d--;for(;0<p-d;)x=Xt(x),p--;for(;d--;){if(k===x||x!==null&&k===x.alternate)break t;k=Xt(k),x=Xt(x)}k=null}else k=null;S!==null&&Ri(g,h,S,k,!1),y!==null&&N!==null&&Ri(g,N,y,k,!0)}}e:{if(h=c?rn(c):window,S=h.nodeName&&h.nodeName.toLowerCase(),S==="select"||S==="input"&&h.type==="file")var C=Fp;else if(Pi(h))if(Lu)C=Vp;else{C=Bp;var A=Mp}else(S=h.nodeName)&&S.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=Up);if(C&&(C=C(e,c))){Tu(g,C,n,v);break e}A&&A(e,h,c),e==="focusout"&&(A=h._wrapperState)&&A.controlled&&h.type==="number"&&wl(h,"number",h.value)}switch(A=c?rn(c):window,e){case"focusin":(Pi(A)||A.contentEditable==="true")&&(tn=A,Ol=c,Wn=null);break;case"focusout":Wn=Ol=tn=null;break;case"mousedown":Rl=!0;break;case"contextmenu":case"mouseup":case"dragend":Rl=!1,Ii(g,n,v);break;case"selectionchange":if(Gp)break;case"keydown":case"keyup":Ii(g,n,v)}var E;if(_s)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else en?Pu(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Eu&&n.locale!=="ko"&&(en||P!=="onCompositionStart"?P==="onCompositionEnd"&&en&&(E=Nu()):(gt=v,Ns="value"in gt?gt.value:gt.textContent,en=!0)),A=ia(c,P),0<A.length&&(P=new ki(P,e,null,n,v),g.push({event:P,listeners:A}),E?P.data=E:(E=_u(n),E!==null&&(P.data=E)))),(E=Op?Rp(e,n):Dp(e,n))&&(c=ia(c,"onBeforeInput"),0<c.length&&(v=new ki("onBeforeInput","beforeinput",null,n,v),g.push({event:v,listeners:c}),v.data=E))}Mu(g,t)})}function ar(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ia(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,s=l.stateNode;l.tag===5&&s!==null&&(l=s,s=Xn(e,n),s!=null&&r.unshift(ar(e,s,l)),s=Xn(e,t),s!=null&&r.push(ar(e,s,l))),e=e.return}return r}function Xt(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ri(e,t,n,r,l){for(var s=t._reactName,i=[];n!==null&&n!==r;){var u=n,o=u.alternate,c=u.stateNode;if(o!==null&&o===r)break;u.tag===5&&c!==null&&(u=c,l?(o=Xn(n,s),o!=null&&i.unshift(ar(n,o,u))):l||(o=Xn(n,s),o!=null&&i.push(ar(n,o,u)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Jp=/\r\n?/g,Xp=/\u0000|\uFFFD/g;function Di(e){return(typeof e=="string"?e:""+e).replace(Jp,`
|
|
38
|
-
`).replace(Xp,"")}function zr(e,t,n){if(t=Di(t),Di(e)!==t&&n)throw Error(I(425))}function oa(){}var Dl=null,bl=null;function $l(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fl=typeof setTimeout=="function"?setTimeout:void 0,Yp=typeof clearTimeout=="function"?clearTimeout:void 0,bi=typeof Promise=="function"?Promise:void 0,Zp=typeof queueMicrotask=="function"?queueMicrotask:typeof bi<"u"?function(e){return bi.resolve(null).then(e).catch(ef)}:Fl;function ef(e){setTimeout(function(){throw e})}function rl(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),er(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);er(t)}function kt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $i(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var En=Math.random().toString(36).slice(2),Ze="__reactFiber$"+En,lr="__reactProps$"+En,ot="__reactContainer$"+En,Ml="__reactEvents$"+En,tf="__reactListeners$"+En,nf="__reactHandles$"+En;function bt(e){var t=e[Ze];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[Ze]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$i(e);e!==null;){if(n=e[Ze])return n;e=$i(e)}return t}e=n,n=e.parentNode}return null}function gr(e){return e=e[Ze]||e[ot],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function rn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Ta(e){return e[lr]||null}var Bl=[],an=-1;function At(e){return{current:e}}function K(e){0>an||(e.current=Bl[an],Bl[an]=null,an--)}function Q(e,t){an++,Bl[an]=e.current,e.current=t}var Tt={},ge=At(Tt),Ne=At(!1),Vt=Tt;function xn(e,t){var n=e.type.contextTypes;if(!n)return Tt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ee(e){return e=e.childContextTypes,e!=null}function ua(){K(Ne),K(ge)}function Fi(e,t,n){if(ge.current!==Tt)throw Error(I(168));Q(ge,t),Q(Ne,n)}function Uu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(I(108,Md(e)||"Unknown",l));return Z({},n,r)}function ca(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tt,Vt=ge.current,Q(ge,e),Q(Ne,Ne.current),!0}function Mi(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=Uu(e,t,Vt),r.__reactInternalMemoizedMergedChildContext=e,K(Ne),K(ge),Q(ge,e)):K(Ne),Q(Ne,n)}var rt=null,La=!1,al=!1;function Vu(e){rt===null?rt=[e]:rt.push(e)}function rf(e){La=!0,Vu(e)}function It(){if(!al&&rt!==null){al=!0;var e=0,t=G;try{var n=rt;for(G=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}rt=null,La=!1}catch(l){throw rt!==null&&(rt=rt.slice(e+1)),hu(Ss,It),l}finally{G=t,al=!1}}return null}var ln=[],sn=0,da=null,pa=0,be=[],$e=0,Wt=null,at=1,lt="";function Rt(e,t){ln[sn++]=pa,ln[sn++]=da,da=e,pa=t}function Wu(e,t,n){be[$e++]=at,be[$e++]=lt,be[$e++]=Wt,Wt=e;var r=at;e=lt;var l=32-qe(r)-1;r&=~(1<<l),n+=1;var s=32-qe(t)+l;if(30<s){var i=l-l%5;s=(r&(1<<i)-1).toString(32),r>>=i,l-=i,at=1<<32-qe(t)+l|n<<l|r,lt=s+e}else at=1<<s|n<<l|r,lt=e}function Ls(e){e.return!==null&&(Rt(e,1),Wu(e,1,0))}function As(e){for(;e===da;)da=ln[--sn],ln[sn]=null,pa=ln[--sn],ln[sn]=null;for(;e===Wt;)Wt=be[--$e],be[$e]=null,lt=be[--$e],be[$e]=null,at=be[--$e],be[$e]=null}var Ae=null,Le=null,J=!1,Qe=null;function Hu(e,t){var n=Fe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Bi(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ae=e,Le=kt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ae=e,Le=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wt!==null?{id:at,overflow:lt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ae=e,Le=null,!0):!1;default:return!1}}function Ul(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vl(e){if(J){var t=Le;if(t){var n=t;if(!Bi(e,t)){if(Ul(e))throw Error(I(418));t=kt(n.nextSibling);var r=Ae;t&&Bi(e,t)?Hu(r,n):(e.flags=e.flags&-4097|2,J=!1,Ae=e)}}else{if(Ul(e))throw Error(I(418));e.flags=e.flags&-4097|2,J=!1,Ae=e}}}function Ui(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ae=e}function Or(e){if(e!==Ae)return!1;if(!J)return Ui(e),J=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$l(e.type,e.memoizedProps)),t&&(t=Le)){if(Ul(e))throw Gu(),Error(I(418));for(;t;)Hu(e,t),t=kt(t.nextSibling)}if(Ui(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Le=kt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Le=null}}else Le=Ae?kt(e.stateNode.nextSibling):null;return!0}function Gu(){for(var e=Le;e;)e=kt(e.nextSibling)}function yn(){Le=Ae=null,J=!1}function Is(e){Qe===null?Qe=[e]:Qe.push(e)}var af=dt.ReactCurrentBatchConfig;function zn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var r=n.stateNode}if(!r)throw Error(I(147,e));var l=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var u=l.refs;i===null?delete u[s]:u[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Rr(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vi(e){var t=e._init;return t(e._payload)}function Qu(e){function t(x,d){if(e){var p=x.deletions;p===null?(x.deletions=[d],x.flags|=16):p.push(d)}}function n(x,d){if(!e)return null;for(;d!==null;)t(x,d),d=d.sibling;return null}function r(x,d){for(x=new Map;d!==null;)d.key!==null?x.set(d.key,d):x.set(d.index,d),d=d.sibling;return x}function l(x,d){return x=Pt(x,d),x.index=0,x.sibling=null,x}function s(x,d,p){return x.index=p,e?(p=x.alternate,p!==null?(p=p.index,p<d?(x.flags|=2,d):p):(x.flags|=2,d)):(x.flags|=1048576,d)}function i(x){return e&&x.alternate===null&&(x.flags|=2),x}function u(x,d,p,j){return d===null||d.tag!==6?(d=dl(p,x.mode,j),d.return=x,d):(d=l(d,p),d.return=x,d)}function o(x,d,p,j){var C=p.type;return C===Zt?v(x,d,p.props.children,j,p.key):d!==null&&(d.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ft&&Vi(C)===d.type)?(j=l(d,p.props),j.ref=zn(x,d,p),j.return=x,j):(j=Zr(p.type,p.key,p.props,null,x.mode,j),j.ref=zn(x,d,p),j.return=x,j)}function c(x,d,p,j){return d===null||d.tag!==4||d.stateNode.containerInfo!==p.containerInfo||d.stateNode.implementation!==p.implementation?(d=pl(p,x.mode,j),d.return=x,d):(d=l(d,p.children||[]),d.return=x,d)}function v(x,d,p,j,C){return d===null||d.tag!==7?(d=Bt(p,x.mode,j,C),d.return=x,d):(d=l(d,p),d.return=x,d)}function g(x,d,p){if(typeof d=="string"&&d!==""||typeof d=="number")return d=dl(""+d,x.mode,p),d.return=x,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Cr:return p=Zr(d.type,d.key,d.props,null,x.mode,p),p.ref=zn(x,null,d),p.return=x,p;case Yt:return d=pl(d,x.mode,p),d.return=x,d;case ft:var j=d._init;return g(x,j(d._payload),p)}if(bn(d)||_n(d))return d=Bt(d,x.mode,p,null),d.return=x,d;Rr(x,d)}return null}function h(x,d,p,j){var C=d!==null?d.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return C!==null?null:u(x,d,""+p,j);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Cr:return p.key===C?o(x,d,p,j):null;case Yt:return p.key===C?c(x,d,p,j):null;case ft:return C=p._init,h(x,d,C(p._payload),j)}if(bn(p)||_n(p))return C!==null?null:v(x,d,p,j,null);Rr(x,p)}return null}function S(x,d,p,j,C){if(typeof j=="string"&&j!==""||typeof j=="number")return x=x.get(p)||null,u(d,x,""+j,C);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Cr:return x=x.get(j.key===null?p:j.key)||null,o(d,x,j,C);case Yt:return x=x.get(j.key===null?p:j.key)||null,c(d,x,j,C);case ft:var A=j._init;return S(x,d,p,A(j._payload),C)}if(bn(j)||_n(j))return x=x.get(p)||null,v(d,x,j,C,null);Rr(d,j)}return null}function y(x,d,p,j){for(var C=null,A=null,E=d,P=d=0,m=null;E!==null&&P<p.length;P++){E.index>P?(m=E,E=null):m=E.sibling;var w=h(x,E,p[P],j);if(w===null){E===null&&(E=m);break}e&&E&&w.alternate===null&&t(x,E),d=s(w,d,P),A===null?C=w:A.sibling=w,A=w,E=m}if(P===p.length)return n(x,E),J&&Rt(x,P),C;if(E===null){for(;P<p.length;P++)E=g(x,p[P],j),E!==null&&(d=s(E,d,P),A===null?C=E:A.sibling=E,A=E);return J&&Rt(x,P),C}for(E=r(x,E);P<p.length;P++)m=S(E,x,P,p[P],j),m!==null&&(e&&m.alternate!==null&&E.delete(m.key===null?P:m.key),d=s(m,d,P),A===null?C=m:A.sibling=m,A=m);return e&&E.forEach(function(D){return t(x,D)}),J&&Rt(x,P),C}function k(x,d,p,j){var C=_n(p);if(typeof C!="function")throw Error(I(150));if(p=C.call(p),p==null)throw Error(I(151));for(var A=C=null,E=d,P=d=0,m=null,w=p.next();E!==null&&!w.done;P++,w=p.next()){E.index>P?(m=E,E=null):m=E.sibling;var D=h(x,E,w.value,j);if(D===null){E===null&&(E=m);break}e&&E&&D.alternate===null&&t(x,E),d=s(D,d,P),A===null?C=D:A.sibling=D,A=D,E=m}if(w.done)return n(x,E),J&&Rt(x,P),C;if(E===null){for(;!w.done;P++,w=p.next())w=g(x,w.value,j),w!==null&&(d=s(w,d,P),A===null?C=w:A.sibling=w,A=w);return J&&Rt(x,P),C}for(E=r(x,E);!w.done;P++,w=p.next())w=S(E,x,P,w.value,j),w!==null&&(e&&w.alternate!==null&&E.delete(w.key===null?P:w.key),d=s(w,d,P),A===null?C=w:A.sibling=w,A=w);return e&&E.forEach(function(U){return t(x,U)}),J&&Rt(x,P),C}function N(x,d,p,j){if(typeof p=="object"&&p!==null&&p.type===Zt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Cr:e:{for(var C=p.key,A=d;A!==null;){if(A.key===C){if(C=p.type,C===Zt){if(A.tag===7){n(x,A.sibling),d=l(A,p.props.children),d.return=x,x=d;break e}}else if(A.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ft&&Vi(C)===A.type){n(x,A.sibling),d=l(A,p.props),d.ref=zn(x,A,p),d.return=x,x=d;break e}n(x,A);break}else t(x,A);A=A.sibling}p.type===Zt?(d=Bt(p.props.children,x.mode,j,p.key),d.return=x,x=d):(j=Zr(p.type,p.key,p.props,null,x.mode,j),j.ref=zn(x,d,p),j.return=x,x=j)}return i(x);case Yt:e:{for(A=p.key;d!==null;){if(d.key===A)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(x,d.sibling),d=l(d,p.children||[]),d.return=x,x=d;break e}else{n(x,d);break}else t(x,d);d=d.sibling}d=pl(p,x.mode,j),d.return=x,x=d}return i(x);case ft:return A=p._init,N(x,d,A(p._payload),j)}if(bn(p))return y(x,d,p,j);if(_n(p))return k(x,d,p,j);Rr(x,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(x,d.sibling),d=l(d,p),d.return=x,x=d):(n(x,d),d=dl(p,x.mode,j),d.return=x,x=d),i(x)):n(x,d)}return N}var jn=Qu(!0),qu=Qu(!1),fa=At(null),ha=null,on=null,zs=null;function Os(){zs=on=ha=null}function Rs(e){var t=fa.current;K(fa),e._currentValue=t}function Wl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function mn(e,t){ha=e,zs=on=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ce=!0),e.firstContext=null)}function Be(e){var t=e._currentValue;if(zs!==e)if(e={context:e,memoizedValue:t,next:null},on===null){if(ha===null)throw Error(I(308));on=e,ha.dependencies={lanes:0,firstContext:e}}else on=on.next=e;return t}var $t=null;function Ds(e){$t===null?$t=[e]:$t.push(e)}function Ku(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ds(t)):(n.next=l.next,l.next=n),t.interleaved=n,ut(e,r)}function ut(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ht=!1;function bs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ju(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function st(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ut(e,n)}return l=r.interleaved,l===null?(t.next=t,Ds(r)):(t.next=l.next,l.next=t),r.interleaved=t,ut(e,n)}function Qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ws(e,n)}}function Wi(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ma(e,t,n,r){var l=e.updateQueue;ht=!1;var s=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var o=u,c=o.next;o.next=null,i===null?s=c:i.next=c,i=o;var v=e.alternate;v!==null&&(v=v.updateQueue,u=v.lastBaseUpdate,u!==i&&(u===null?v.firstBaseUpdate=c:u.next=c,v.lastBaseUpdate=o))}if(s!==null){var g=l.baseState;i=0,v=c=o=null,u=s;do{var h=u.lane,S=u.eventTime;if((r&h)===h){v!==null&&(v=v.next={eventTime:S,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var y=e,k=u;switch(h=t,S=n,k.tag){case 1:if(y=k.payload,typeof y=="function"){g=y.call(S,g,h);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=k.payload,h=typeof y=="function"?y.call(S,g,h):y,h==null)break e;g=Z({},g,h);break e;case 2:ht=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[u]:h.push(u))}else S={eventTime:S,lane:h,tag:u.tag,payload:u.payload,callback:u.callback,next:null},v===null?(c=v=S,o=g):v=v.next=S,i|=h;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;h=u,u=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(v===null&&(o=g),l.baseState=o,l.firstBaseUpdate=c,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Gt|=i,e.lanes=i,e.memoizedState=g}}function Hi(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(I(191,l));l.call(r)}}}var xr={},tt=At(xr),sr=At(xr),ir=At(xr);function Ft(e){if(e===xr)throw Error(I(174));return e}function $s(e,t){switch(Q(ir,t),Q(sr,e),Q(tt,xr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Cl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Cl(t,e)}K(tt),Q(tt,t)}function Sn(){K(tt),K(sr),K(ir)}function Xu(e){Ft(ir.current);var t=Ft(tt.current),n=Cl(t,e.type);t!==n&&(Q(sr,e),Q(tt,n))}function Fs(e){sr.current===e&&(K(tt),K(sr))}var X=At(0);function va(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ll=[];function Ms(){for(var e=0;e<ll.length;e++)ll[e]._workInProgressVersionPrimary=null;ll.length=0}var qr=dt.ReactCurrentDispatcher,sl=dt.ReactCurrentBatchConfig,Ht=0,Y=null,le=null,oe=null,ga=!1,Hn=!1,or=0,lf=0;function fe(){throw Error(I(321))}function Bs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Je(e[n],t[n]))return!1;return!0}function Us(e,t,n,r,l,s){if(Ht=s,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qr.current=e===null||e.memoizedState===null?cf:df,e=n(r,l),Hn){s=0;do{if(Hn=!1,or=0,25<=s)throw Error(I(301));s+=1,oe=le=null,t.updateQueue=null,qr.current=pf,e=n(r,l)}while(Hn)}if(qr.current=xa,t=le!==null&&le.next!==null,Ht=0,oe=le=Y=null,ga=!1,t)throw Error(I(300));return e}function Vs(){var e=or!==0;return or=0,e}function Ye(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oe===null?Y.memoizedState=oe=e:oe=oe.next=e,oe}function Ue(){if(le===null){var e=Y.alternate;e=e!==null?e.memoizedState:null}else e=le.next;var t=oe===null?Y.memoizedState:oe.next;if(t!==null)oe=t,le=e;else{if(e===null)throw Error(I(310));le=e,e={memoizedState:le.memoizedState,baseState:le.baseState,baseQueue:le.baseQueue,queue:le.queue,next:null},oe===null?Y.memoizedState=oe=e:oe=oe.next=e}return oe}function ur(e,t){return typeof t=="function"?t(e):t}function il(e){var t=Ue(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=le,l=r.baseQueue,s=n.pending;if(s!==null){if(l!==null){var i=l.next;l.next=s.next,s.next=i}r.baseQueue=l=s,n.pending=null}if(l!==null){s=l.next,r=r.baseState;var u=i=null,o=null,c=s;do{var v=c.lane;if((Ht&v)===v)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var g={lane:v,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(u=o=g,i=r):o=o.next=g,Y.lanes|=v,Gt|=v}c=c.next}while(c!==null&&c!==s);o===null?i=r:o.next=u,Je(r,t.memoizedState)||(Ce=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=o,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do s=l.lane,Y.lanes|=s,Gt|=s,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ol(e){var t=Ue(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,s=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do s=e(s,i.action),i=i.next;while(i!==l);Je(s,t.memoizedState)||(Ce=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Yu(){}function Zu(e,t){var n=Y,r=Ue(),l=t(),s=!Je(r.memoizedState,l);if(s&&(r.memoizedState=l,Ce=!0),r=r.queue,Ws(nc.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||oe!==null&&oe.memoizedState.tag&1){if(n.flags|=2048,cr(9,tc.bind(null,n,r,l,t),void 0,null),ue===null)throw Error(I(349));Ht&30||ec(n,t,l)}return l}function ec(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t={lastEffect:null,stores:null},Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tc(e,t,n,r){t.value=n,t.getSnapshot=r,rc(t)&&ac(e)}function nc(e,t,n){return n(function(){rc(t)&&ac(e)})}function rc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Je(e,n)}catch{return!0}}function ac(e){var t=ut(e,1);t!==null&&Ke(t,e,1,-1)}function Gi(e){var t=Ye();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t.queue=e,e=e.dispatch=uf.bind(null,Y,e),[t.memoizedState,e]}function cr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Y.updateQueue,t===null?(t={lastEffect:null,stores:null},Y.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function lc(){return Ue().memoizedState}function Kr(e,t,n,r){var l=Ye();Y.flags|=e,l.memoizedState=cr(1|t,n,void 0,r===void 0?null:r)}function Aa(e,t,n,r){var l=Ue();r=r===void 0?null:r;var s=void 0;if(le!==null){var i=le.memoizedState;if(s=i.destroy,r!==null&&Bs(r,i.deps)){l.memoizedState=cr(t,n,s,r);return}}Y.flags|=e,l.memoizedState=cr(1|t,n,s,r)}function Qi(e,t){return Kr(8390656,8,e,t)}function Ws(e,t){return Aa(2048,8,e,t)}function sc(e,t){return Aa(4,2,e,t)}function ic(e,t){return Aa(4,4,e,t)}function oc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uc(e,t,n){return n=n!=null?n.concat([e]):null,Aa(4,4,oc.bind(null,t,e),n)}function Hs(){}function cc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bs(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function pc(e,t,n){return Ht&21?(Je(n,t)||(n=gu(),Y.lanes|=n,Gt|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ce=!0),e.memoizedState=n)}function sf(e,t){var n=G;G=n!==0&&4>n?n:4,e(!0);var r=sl.transition;sl.transition={};try{e(!1),t()}finally{G=n,sl.transition=r}}function fc(){return Ue().memoizedState}function of(e,t,n){var r=Et(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hc(e))mc(t,n);else if(n=Ku(e,t,n,r),n!==null){var l=je();Ke(n,e,r,l),vc(n,t,r)}}function uf(e,t,n){var r=Et(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hc(e))mc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,u=s(i,n);if(l.hasEagerState=!0,l.eagerState=u,Je(u,i)){var o=t.interleaved;o===null?(l.next=l,Ds(t)):(l.next=o.next,o.next=l),t.interleaved=l;return}}catch{}finally{}n=Ku(e,t,l,r),n!==null&&(l=je(),Ke(n,e,r,l),vc(n,t,r))}}function hc(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function mc(e,t){Hn=ga=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ws(e,n)}}var xa={readContext:Be,useCallback:fe,useContext:fe,useEffect:fe,useImperativeHandle:fe,useInsertionEffect:fe,useLayoutEffect:fe,useMemo:fe,useReducer:fe,useRef:fe,useState:fe,useDebugValue:fe,useDeferredValue:fe,useTransition:fe,useMutableSource:fe,useSyncExternalStore:fe,useId:fe,unstable_isNewReconciler:!1},cf={readContext:Be,useCallback:function(e,t){return Ye().memoizedState=[e,t===void 0?null:t],e},useContext:Be,useEffect:Qi,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kr(4194308,4,oc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kr(4,2,e,t)},useMemo:function(e,t){var n=Ye();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ye();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=of.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Ye();return e={current:e},t.memoizedState=e},useState:Gi,useDebugValue:Hs,useDeferredValue:function(e){return Ye().memoizedState=e},useTransition:function(){var e=Gi(!1),t=e[0];return e=sf.bind(null,e[1]),Ye().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Y,l=Ye();if(J){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),ue===null)throw Error(I(349));Ht&30||ec(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,Qi(nc.bind(null,r,s,e),[e]),r.flags|=2048,cr(9,tc.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ye(),t=ue.identifierPrefix;if(J){var n=lt,r=at;n=(r&~(1<<32-qe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=or++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=lf++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},df={readContext:Be,useCallback:cc,useContext:Be,useEffect:Ws,useImperativeHandle:uc,useInsertionEffect:sc,useLayoutEffect:ic,useMemo:dc,useReducer:il,useRef:lc,useState:function(){return il(ur)},useDebugValue:Hs,useDeferredValue:function(e){var t=Ue();return pc(t,le.memoizedState,e)},useTransition:function(){var e=il(ur)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:Yu,useSyncExternalStore:Zu,useId:fc,unstable_isNewReconciler:!1},pf={readContext:Be,useCallback:cc,useContext:Be,useEffect:Ws,useImperativeHandle:uc,useInsertionEffect:sc,useLayoutEffect:ic,useMemo:dc,useReducer:ol,useRef:lc,useState:function(){return ol(ur)},useDebugValue:Hs,useDeferredValue:function(e){var t=Ue();return le===null?t.memoizedState=e:pc(t,le.memoizedState,e)},useTransition:function(){var e=ol(ur)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:Yu,useSyncExternalStore:Zu,useId:fc,unstable_isNewReconciler:!1};function He(e,t){if(e&&e.defaultProps){t=Z({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Hl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ia={isMounted:function(e){return(e=e._reactInternals)?Kt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=je(),l=Et(e),s=st(r,l);s.payload=t,n!=null&&(s.callback=n),t=Ct(e,s,l),t!==null&&(Ke(t,e,l,r),Qr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=je(),l=Et(e),s=st(r,l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ct(e,s,l),t!==null&&(Ke(t,e,l,r),Qr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=je(),r=Et(e),l=st(n,r);l.tag=2,t!=null&&(l.callback=t),t=Ct(e,l,r),t!==null&&(Ke(t,e,r,n),Qr(t,e,r))}};function qi(e,t,n,r,l,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!nr(n,r)||!nr(l,s):!0}function gc(e,t,n){var r=!1,l=Tt,s=t.contextType;return typeof s=="object"&&s!==null?s=Be(s):(l=Ee(t)?Vt:ge.current,r=t.contextTypes,s=(r=r!=null)?xn(e,l):Tt),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ia,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=s),t}function Ki(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ia.enqueueReplaceState(t,t.state,null)}function Gl(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},bs(e);var s=t.contextType;typeof s=="object"&&s!==null?l.context=Be(s):(s=Ee(t)?Vt:ge.current,l.context=xn(e,s)),l.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Hl(e,t,s,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Ia.enqueueReplaceState(l,l.state,null),ma(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function wn(e,t){try{var n="",r=t;do n+=Fd(r),r=r.return;while(r);var l=n}catch(s){l=`
|
|
39
|
-
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:l,digest:null}}function ul(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ql(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ff=typeof WeakMap=="function"?WeakMap:Map;function xc(e,t,n){n=st(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ja||(ja=!0,rs=r),Ql(e,t)},n}function yc(e,t,n){n=st(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Ql(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ql(e,t),typeof r!="function"&&(Nt===null?Nt=new Set([this]):Nt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Ji(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ff;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Pf.bind(null,e,t,n),t.then(e,e))}function Xi(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yi(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=st(-1,1),t.tag=2,Ct(n,t,1))),n.lanes|=1),e)}var hf=dt.ReactCurrentOwner,Ce=!1;function ye(e,t,n,r){t.child=e===null?qu(t,null,n,r):jn(t,e.child,n,r)}function Zi(e,t,n,r,l){n=n.render;var s=t.ref;return mn(t,l),r=Us(e,t,n,r,s,l),n=Vs(),e!==null&&!Ce?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ct(e,t,l)):(J&&n&&Ls(t),t.flags|=1,ye(e,t,r,l),t.child)}function eo(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!Zs(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,jc(e,t,s,r,l)):(e=Zr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&l)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:nr,n(i,r)&&e.ref===t.ref)return ct(e,t,l)}return t.flags|=1,e=Pt(s,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(nr(s,r)&&e.ref===t.ref)if(Ce=!1,t.pendingProps=r=s,(e.lanes&l)!==0)e.flags&131072&&(Ce=!0);else return t.lanes=e.lanes,ct(e,t,l)}return ql(e,t,n,r,l)}function Sc(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Q(cn,Te),Te|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Q(cn,Te),Te|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Q(cn,Te),Te|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Q(cn,Te),Te|=r;return ye(e,t,l,n),t.child}function wc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ql(e,t,n,r,l){var s=Ee(n)?Vt:ge.current;return s=xn(t,s),mn(t,l),n=Us(e,t,n,r,s,l),r=Vs(),e!==null&&!Ce?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ct(e,t,l)):(J&&r&&Ls(t),t.flags|=1,ye(e,t,n,l),t.child)}function to(e,t,n,r,l){if(Ee(n)){var s=!0;ca(t)}else s=!1;if(mn(t,l),t.stateNode===null)Jr(e,t),gc(t,n,r),Gl(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,u=t.memoizedProps;i.props=u;var o=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Be(c):(c=Ee(n)?Vt:ge.current,c=xn(t,c));var v=n.getDerivedStateFromProps,g=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function";g||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==r||o!==c)&&Ki(t,i,r,c),ht=!1;var h=t.memoizedState;i.state=h,ma(t,r,i,l),o=t.memoizedState,u!==r||h!==o||Ne.current||ht?(typeof v=="function"&&(Hl(t,n,v,r),o=t.memoizedState),(u=ht||qi(t,n,u,r,h,o,c))?(g||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=o),i.props=r,i.state=o,i.context=c,r=u):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Ju(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:He(t.type,u),i.props=c,g=t.pendingProps,h=i.context,o=n.contextType,typeof o=="object"&&o!==null?o=Be(o):(o=Ee(n)?Vt:ge.current,o=xn(t,o));var S=n.getDerivedStateFromProps;(v=typeof S=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==g||h!==o)&&Ki(t,i,r,o),ht=!1,h=t.memoizedState,i.state=h,ma(t,r,i,l);var y=t.memoizedState;u!==g||h!==y||Ne.current||ht?(typeof S=="function"&&(Hl(t,n,S,r),y=t.memoizedState),(c=ht||qi(t,n,c,r,h,y,o)||!1)?(v||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,o),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,o)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=o,r=c):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Kl(e,t,n,r,s,l)}function Kl(e,t,n,r,l,s){wc(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&Mi(t,n,!1),ct(e,t,s);r=t.stateNode,hf.current=t;var u=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=jn(t,e.child,null,s),t.child=jn(t,null,u,s)):ye(e,t,u,s),t.memoizedState=r.state,l&&Mi(t,n,!0),t.child}function kc(e){var t=e.stateNode;t.pendingContext?Fi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fi(e,t.context,!1),$s(e,t.containerInfo)}function no(e,t,n,r,l){return yn(),Is(l),t.flags|=256,ye(e,t,n,r),t.child}var Jl={dehydrated:null,treeContext:null,retryLane:0};function Xl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cc(e,t,n){var r=t.pendingProps,l=X.current,s=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(l&2)!==0),u?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Q(X,l&1),e===null)return Vl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Ra(i,r,0,null),e=Bt(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Xl(n),t.memoizedState=Jl,e):Gs(t,i));if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null))return mf(e,t,i,r,u,l,n);if(s){s=r.fallback,i=t.mode,l=e.child,u=l.sibling;var o={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=o,t.deletions=null):(r=Pt(l,o),r.subtreeFlags=l.subtreeFlags&14680064),u!==null?s=Pt(u,s):(s=Bt(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?Xl(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Jl,r}return s=e.child,e=s.sibling,r=Pt(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Gs(e,t){return t=Ra({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Dr(e,t,n,r){return r!==null&&Is(r),jn(t,e.child,null,n),e=Gs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mf(e,t,n,r,l,s,i){if(n)return t.flags&256?(t.flags&=-257,r=ul(Error(I(422))),Dr(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=Ra({mode:"visible",children:r.children},l,0,null),s=Bt(s,l,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&jn(t,e.child,null,i),t.child.memoizedState=Xl(i),t.memoizedState=Jl,s);if(!(t.mode&1))return Dr(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var u=r.dgst;return r=u,s=Error(I(419)),r=ul(s,r,void 0),Dr(e,t,i,r)}if(u=(i&e.childLanes)!==0,Ce||u){if(r=ue,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,ut(e,l),Ke(r,e,l,-1))}return Ys(),r=ul(Error(I(421))),Dr(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=_f.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,Le=kt(l.nextSibling),Ae=t,J=!0,Qe=null,e!==null&&(be[$e++]=at,be[$e++]=lt,be[$e++]=Wt,at=e.id,lt=e.overflow,Wt=t),t=Gs(t,r.children),t.flags|=4096,t)}function ro(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wl(e.return,t,n)}function cl(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function Nc(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(ye(e,t,r.children,n),r=X.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ro(e,n,t);else if(e.tag===19)ro(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Q(X,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&va(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),cl(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&va(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}cl(t,!0,n,null,s);break;case"together":cl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Jr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Pt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vf(e,t,n){switch(t.tag){case 3:kc(t),yn();break;case 5:Xu(t);break;case 1:Ee(t.type)&&ca(t);break;case 4:$s(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Q(fa,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Q(X,X.current&1),t.flags|=128,null):n&t.child.childLanes?Cc(e,t,n):(Q(X,X.current&1),e=ct(e,t,n),e!==null?e.sibling:null);Q(X,X.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Nc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(X,X.current),r)break;return null;case 22:case 23:return t.lanes=0,Sc(e,t,n)}return ct(e,t,n)}var Ec,Yl,Pc,_c;Ec=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yl=function(){};Pc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Ft(tt.current);var s=null;switch(n){case"input":l=jl(e,l),r=jl(e,r),s=[];break;case"select":l=Z({},l,{value:void 0}),r=Z({},r,{value:void 0}),s=[];break;case"textarea":l=kl(e,l),r=kl(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=oa)}Nl(n,r);var i;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var u=l[c];for(i in u)u.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Kn.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var o=r[c];if(u=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&o!==u&&(o!=null||u!=null))if(c==="style")if(u){for(i in u)!u.hasOwnProperty(i)||o&&o.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in o)o.hasOwnProperty(i)&&u[i]!==o[i]&&(n||(n={}),n[i]=o[i])}else n||(s||(s=[]),s.push(c,n)),n=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,u=u?u.__html:void 0,o!=null&&u!==o&&(s=s||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(s=s||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Kn.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&q("scroll",e),s||u===o||(s=[])):(s=s||[]).push(c,o))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};_c=function(e,t,n,r){n!==r&&(t.flags|=4)};function On(e,t){if(!J)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function he(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gf(e,t,n){var r=t.pendingProps;switch(As(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return he(t),null;case 1:return Ee(t.type)&&ua(),he(t),null;case 3:return r=t.stateNode,Sn(),K(Ne),K(ge),Ms(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Or(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qe!==null&&(ss(Qe),Qe=null))),Yl(e,t),he(t),null;case 5:Fs(t);var l=Ft(ir.current);if(n=t.type,e!==null&&t.stateNode!=null)Pc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(I(166));return he(t),null}if(e=Ft(tt.current),Or(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ze]=t,r[lr]=s,e=(t.mode&1)!==0,n){case"dialog":q("cancel",r),q("close",r);break;case"iframe":case"object":case"embed":q("load",r);break;case"video":case"audio":for(l=0;l<Fn.length;l++)q(Fn[l],r);break;case"source":q("error",r);break;case"img":case"image":case"link":q("error",r),q("load",r);break;case"details":q("toggle",r);break;case"input":pi(r,s),q("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},q("invalid",r);break;case"textarea":hi(r,s),q("invalid",r)}Nl(n,s),l=null;for(var i in s)if(s.hasOwnProperty(i)){var u=s[i];i==="children"?typeof u=="string"?r.textContent!==u&&(s.suppressHydrationWarning!==!0&&zr(r.textContent,u,e),l=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(s.suppressHydrationWarning!==!0&&zr(r.textContent,u,e),l=["children",""+u]):Kn.hasOwnProperty(i)&&u!=null&&i==="onScroll"&&q("scroll",r)}switch(n){case"input":Nr(r),fi(r,s,!0);break;case"textarea":Nr(r),mi(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=oa)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ze]=t,e[lr]=r,Ec(e,t,!1,!1),t.stateNode=e;e:{switch(i=El(n,r),n){case"dialog":q("cancel",e),q("close",e),l=r;break;case"iframe":case"object":case"embed":q("load",e),l=r;break;case"video":case"audio":for(l=0;l<Fn.length;l++)q(Fn[l],e);l=r;break;case"source":q("error",e),l=r;break;case"img":case"image":case"link":q("error",e),q("load",e),l=r;break;case"details":q("toggle",e),l=r;break;case"input":pi(e,r),l=jl(e,r),q("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=Z({},r,{value:void 0}),q("invalid",e);break;case"textarea":hi(e,r),l=kl(e,r),q("invalid",e);break;default:l=r}Nl(n,l),u=l;for(s in u)if(u.hasOwnProperty(s)){var o=u[s];s==="style"?lu(e,o):s==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&ru(e,o)):s==="children"?typeof o=="string"?(n!=="textarea"||o!=="")&&Jn(e,o):typeof o=="number"&&Jn(e,""+o):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Kn.hasOwnProperty(s)?o!=null&&s==="onScroll"&&q("scroll",e):o!=null&&vs(e,s,o,i))}switch(n){case"input":Nr(e),fi(e,r,!1);break;case"textarea":Nr(e),mi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+_t(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?dn(e,!!r.multiple,s,!1):r.defaultValue!=null&&dn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=oa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return he(t),null;case 6:if(e&&t.stateNode!=null)_c(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(I(166));if(n=Ft(ir.current),Ft(tt.current),Or(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ze]=t,(s=r.nodeValue!==n)&&(e=Ae,e!==null))switch(e.tag){case 3:zr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&zr(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ze]=t,t.stateNode=r}return he(t),null;case 13:if(K(X),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(J&&Le!==null&&t.mode&1&&!(t.flags&128))Gu(),yn(),t.flags|=98560,s=!1;else if(s=Or(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(I(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(I(317));s[Ze]=t}else yn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;he(t),s=!1}else Qe!==null&&(ss(Qe),Qe=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||X.current&1?se===0&&(se=3):Ys())),t.updateQueue!==null&&(t.flags|=4),he(t),null);case 4:return Sn(),Yl(e,t),e===null&&rr(t.stateNode.containerInfo),he(t),null;case 10:return Rs(t.type._context),he(t),null;case 17:return Ee(t.type)&&ua(),he(t),null;case 19:if(K(X),s=t.memoizedState,s===null)return he(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)On(s,!1);else{if(se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=va(e),i!==null){for(t.flags|=128,On(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Q(X,X.current&1|2),t.child}e=e.sibling}s.tail!==null&&ne()>kn&&(t.flags|=128,r=!0,On(s,!1),t.lanes=4194304)}else{if(!r)if(e=va(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),On(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!J)return he(t),null}else 2*ne()-s.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,On(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ne(),t.sibling=null,n=X.current,Q(X,r?n&1|2:n&1),t):(he(t),null);case 22:case 23:return Xs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Te&1073741824&&(he(t),t.subtreeFlags&6&&(t.flags|=8192)):he(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function xf(e,t){switch(As(t),t.tag){case 1:return Ee(t.type)&&ua(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sn(),K(Ne),K(ge),Ms(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fs(t),null;case 13:if(K(X),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));yn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(X),null;case 4:return Sn(),null;case 10:return Rs(t.type._context),null;case 22:case 23:return Xs(),null;case 24:return null;default:return null}}var br=!1,me=!1,yf=typeof WeakSet=="function"?WeakSet:Set,b=null;function un(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ee(e,t,r)}else n.current=null}function Zl(e,t,n){try{n()}catch(r){ee(e,t,r)}}var ao=!1;function jf(e,t){if(Dl=la,e=zu(),Ts(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,u=-1,o=-1,c=0,v=0,g=e,h=null;t:for(;;){for(var S;g!==n||l!==0&&g.nodeType!==3||(u=i+l),g!==s||r!==0&&g.nodeType!==3||(o=i+r),g.nodeType===3&&(i+=g.nodeValue.length),(S=g.firstChild)!==null;)h=g,g=S;for(;;){if(g===e)break t;if(h===n&&++c===l&&(u=i),h===s&&++v===r&&(o=i),(S=g.nextSibling)!==null)break;g=h,h=g.parentNode}g=S}n=u===-1||o===-1?null:{start:u,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(bl={focusedElem:e,selectionRange:n},la=!1,b=t;b!==null;)if(t=b,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,b=e;else for(;b!==null;){t=b;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var k=y.memoizedProps,N=y.memoizedState,x=t.stateNode,d=x.getSnapshotBeforeUpdate(t.elementType===t.type?k:He(t.type,k),N);x.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(j){ee(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,b=e;break}b=t.return}return y=ao,ao=!1,y}function Gn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&Zl(t,n,s)}l=l.next}while(l!==r)}}function za(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function es(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ze],delete t[lr],delete t[Ml],delete t[tf],delete t[nf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lc(e){return e.tag===5||e.tag===3||e.tag===4}function lo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ts(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=oa));else if(r!==4&&(e=e.child,e!==null))for(ts(e,t,n),e=e.sibling;e!==null;)ts(e,t,n),e=e.sibling}function ns(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ns(e,t,n),e=e.sibling;e!==null;)ns(e,t,n),e=e.sibling}var ce=null,Ge=!1;function pt(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(et&&typeof et.onCommitFiberUnmount=="function")try{et.onCommitFiberUnmount(Na,n)}catch{}switch(n.tag){case 5:me||un(n,t);case 6:var r=ce,l=Ge;ce=null,pt(e,t,n),ce=r,Ge=l,ce!==null&&(Ge?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(Ge?(e=ce,n=n.stateNode,e.nodeType===8?rl(e.parentNode,n):e.nodeType===1&&rl(e,n),er(e)):rl(ce,n.stateNode));break;case 4:r=ce,l=Ge,ce=n.stateNode.containerInfo,Ge=!0,pt(e,t,n),ce=r,Ge=l;break;case 0:case 11:case 14:case 15:if(!me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Zl(n,t,i),l=l.next}while(l!==r)}pt(e,t,n);break;case 1:if(!me&&(un(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){ee(n,t,u)}pt(e,t,n);break;case 21:pt(e,t,n);break;case 22:n.mode&1?(me=(r=me)||n.memoizedState!==null,pt(e,t,n),me=r):pt(e,t,n);break;default:pt(e,t,n)}}function so(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yf),t.forEach(function(r){var l=Tf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var s=e,i=t,u=i;e:for(;u!==null;){switch(u.tag){case 5:ce=u.stateNode,Ge=!1;break e;case 3:ce=u.stateNode.containerInfo,Ge=!0;break e;case 4:ce=u.stateNode.containerInfo,Ge=!0;break e}u=u.return}if(ce===null)throw Error(I(160));Ac(s,i,l),ce=null,Ge=!1;var o=l.alternate;o!==null&&(o.return=null),l.return=null}catch(c){ee(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ic(t,e),t=t.sibling}function Ic(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(We(t,e),Xe(e),r&4){try{Gn(3,e,e.return),za(3,e)}catch(k){ee(e,e.return,k)}try{Gn(5,e,e.return)}catch(k){ee(e,e.return,k)}}break;case 1:We(t,e),Xe(e),r&512&&n!==null&&un(n,n.return);break;case 5:if(We(t,e),Xe(e),r&512&&n!==null&&un(n,n.return),e.flags&32){var l=e.stateNode;try{Jn(l,"")}catch(k){ee(e,e.return,k)}}if(r&4&&(l=e.stateNode,l!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,u=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{u==="input"&&s.type==="radio"&&s.name!=null&&eu(l,s),El(u,i);var c=El(u,s);for(i=0;i<o.length;i+=2){var v=o[i],g=o[i+1];v==="style"?lu(l,g):v==="dangerouslySetInnerHTML"?ru(l,g):v==="children"?Jn(l,g):vs(l,v,g,c)}switch(u){case"input":Sl(l,s);break;case"textarea":tu(l,s);break;case"select":var h=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!s.multiple;var S=s.value;S!=null?dn(l,!!s.multiple,S,!1):h!==!!s.multiple&&(s.defaultValue!=null?dn(l,!!s.multiple,s.defaultValue,!0):dn(l,!!s.multiple,s.multiple?[]:"",!1))}l[lr]=s}catch(k){ee(e,e.return,k)}}break;case 6:if(We(t,e),Xe(e),r&4){if(e.stateNode===null)throw Error(I(162));l=e.stateNode,s=e.memoizedProps;try{l.nodeValue=s}catch(k){ee(e,e.return,k)}}break;case 3:if(We(t,e),Xe(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{er(t.containerInfo)}catch(k){ee(e,e.return,k)}break;case 4:We(t,e),Xe(e);break;case 13:We(t,e),Xe(e),l=e.child,l.flags&8192&&(s=l.memoizedState!==null,l.stateNode.isHidden=s,!s||l.alternate!==null&&l.alternate.memoizedState!==null||(Ks=ne())),r&4&&so(e);break;case 22:if(v=n!==null&&n.memoizedState!==null,e.mode&1?(me=(c=me)||v,We(t,e),me=c):We(t,e),Xe(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!v&&e.mode&1)for(b=e,v=e.child;v!==null;){for(g=b=v;b!==null;){switch(h=b,S=h.child,h.tag){case 0:case 11:case 14:case 15:Gn(4,h,h.return);break;case 1:un(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(k){ee(r,n,k)}}break;case 5:un(h,h.return);break;case 22:if(h.memoizedState!==null){oo(g);continue}}S!==null?(S.return=h,b=S):oo(g)}v=v.sibling}e:for(v=null,g=e;;){if(g.tag===5){if(v===null){v=g;try{l=g.stateNode,c?(s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(u=g.stateNode,o=g.memoizedProps.style,i=o!=null&&o.hasOwnProperty("display")?o.display:null,u.style.display=au("display",i))}catch(k){ee(e,e.return,k)}}}else if(g.tag===6){if(v===null)try{g.stateNode.nodeValue=c?"":g.memoizedProps}catch(k){ee(e,e.return,k)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;v===g&&(v=null),g=g.return}v===g&&(v=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:We(t,e),Xe(e),r&4&&so(e);break;case 21:break;default:We(t,e),Xe(e)}}function Xe(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Lc(n)){var r=n;break e}n=n.return}throw Error(I(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Jn(l,""),r.flags&=-33);var s=lo(e);ns(e,s,l);break;case 3:case 4:var i=r.stateNode.containerInfo,u=lo(e);ts(e,u,i);break;default:throw Error(I(161))}}catch(o){ee(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sf(e,t,n){b=e,zc(e)}function zc(e,t,n){for(var r=(e.mode&1)!==0;b!==null;){var l=b,s=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||br;if(!i){var u=l.alternate,o=u!==null&&u.memoizedState!==null||me;u=br;var c=me;if(br=i,(me=o)&&!c)for(b=l;b!==null;)i=b,o=i.child,i.tag===22&&i.memoizedState!==null?uo(l):o!==null?(o.return=i,b=o):uo(l);for(;s!==null;)b=s,zc(s),s=s.sibling;b=l,br=u,me=c}io(e)}else l.subtreeFlags&8772&&s!==null?(s.return=l,b=s):io(e)}}function io(e){for(;b!==null;){var t=b;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:me||za(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!me)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:He(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Hi(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Hi(t,i,n)}break;case 5:var u=t.stateNode;if(n===null&&t.flags&4){n=u;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src&&(n.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var v=c.memoizedState;if(v!==null){var g=v.dehydrated;g!==null&&er(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}me||t.flags&512&&es(t)}catch(h){ee(t,t.return,h)}}if(t===e){b=null;break}if(n=t.sibling,n!==null){n.return=t.return,b=n;break}b=t.return}}function oo(e){for(;b!==null;){var t=b;if(t===e){b=null;break}var n=t.sibling;if(n!==null){n.return=t.return,b=n;break}b=t.return}}function uo(e){for(;b!==null;){var t=b;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{za(4,t)}catch(o){ee(t,n,o)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(o){ee(t,l,o)}}var s=t.return;try{es(t)}catch(o){ee(t,s,o)}break;case 5:var i=t.return;try{es(t)}catch(o){ee(t,i,o)}}}catch(o){ee(t,t.return,o)}if(t===e){b=null;break}var u=t.sibling;if(u!==null){u.return=t.return,b=u;break}b=t.return}}var wf=Math.ceil,ya=dt.ReactCurrentDispatcher,Qs=dt.ReactCurrentOwner,Me=dt.ReactCurrentBatchConfig,V=0,ue=null,re=null,de=0,Te=0,cn=At(0),se=0,dr=null,Gt=0,Oa=0,qs=0,Qn=null,ke=null,Ks=0,kn=1/0,nt=null,ja=!1,rs=null,Nt=null,$r=!1,xt=null,Sa=0,qn=0,as=null,Xr=-1,Yr=0;function je(){return V&6?ne():Xr!==-1?Xr:Xr=ne()}function Et(e){return e.mode&1?V&2&&de!==0?de&-de:af.transition!==null?(Yr===0&&(Yr=gu()),Yr):(e=G,e!==0||(e=window.event,e=e===void 0?16:Cu(e.type)),e):1}function Ke(e,t,n,r){if(50<qn)throw qn=0,as=null,Error(I(185));mr(e,n,r),(!(V&2)||e!==ue)&&(e===ue&&(!(V&2)&&(Oa|=n),se===4&&vt(e,de)),Pe(e,r),n===1&&V===0&&!(t.mode&1)&&(kn=ne()+500,La&&It()))}function Pe(e,t){var n=e.callbackNode;ap(e,t);var r=aa(e,e===ue?de:0);if(r===0)n!==null&&xi(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xi(n),t===1)e.tag===0?rf(co.bind(null,e)):Vu(co.bind(null,e)),Zp(function(){!(V&6)&&It()}),n=null;else{switch(xu(r)){case 1:n=Ss;break;case 4:n=mu;break;case 16:n=ra;break;case 536870912:n=vu;break;default:n=ra}n=Bc(n,Oc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Oc(e,t){if(Xr=-1,Yr=0,V&6)throw Error(I(327));var n=e.callbackNode;if(vn()&&e.callbackNode!==n)return null;var r=aa(e,e===ue?de:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=wa(e,r);else{t=r;var l=V;V|=2;var s=Dc();(ue!==e||de!==t)&&(nt=null,kn=ne()+500,Mt(e,t));do try{Nf();break}catch(u){Rc(e,u)}while(!0);Os(),ya.current=s,V=l,re!==null?t=0:(ue=null,de=0,t=se)}if(t!==0){if(t===2&&(l=Al(e),l!==0&&(r=l,t=ls(e,l))),t===1)throw n=dr,Mt(e,0),vt(e,r),Pe(e,ne()),n;if(t===6)vt(e,r);else{if(l=e.current.alternate,!(r&30)&&!kf(l)&&(t=wa(e,r),t===2&&(s=Al(e),s!==0&&(r=s,t=ls(e,s))),t===1))throw n=dr,Mt(e,0),vt(e,r),Pe(e,ne()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(I(345));case 2:Dt(e,ke,nt);break;case 3:if(vt(e,r),(r&130023424)===r&&(t=Ks+500-ne(),10<t)){if(aa(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){je(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Fl(Dt.bind(null,e,ke,nt),t);break}Dt(e,ke,nt);break;case 4:if(vt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-qe(r);s=1<<i,i=t[i],i>l&&(l=i),r&=~s}if(r=l,r=ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wf(r/1960))-r,10<r){e.timeoutHandle=Fl(Dt.bind(null,e,ke,nt),r);break}Dt(e,ke,nt);break;case 5:Dt(e,ke,nt);break;default:throw Error(I(329))}}}return Pe(e,ne()),e.callbackNode===n?Oc.bind(null,e):null}function ls(e,t){var n=Qn;return e.current.memoizedState.isDehydrated&&(Mt(e,t).flags|=256),e=wa(e,t),e!==2&&(t=ke,ke=n,t!==null&&ss(t)),e}function ss(e){ke===null?ke=e:ke.push.apply(ke,e)}function kf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],s=l.getSnapshot;l=l.value;try{if(!Je(s(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vt(e,t){for(t&=~qs,t&=~Oa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qe(t),r=1<<n;e[n]=-1,t&=~r}}function co(e){if(V&6)throw Error(I(327));vn();var t=aa(e,0);if(!(t&1))return Pe(e,ne()),null;var n=wa(e,t);if(e.tag!==0&&n===2){var r=Al(e);r!==0&&(t=r,n=ls(e,r))}if(n===1)throw n=dr,Mt(e,0),vt(e,t),Pe(e,ne()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dt(e,ke,nt),Pe(e,ne()),null}function Js(e,t){var n=V;V|=1;try{return e(t)}finally{V=n,V===0&&(kn=ne()+500,La&&It())}}function Qt(e){xt!==null&&xt.tag===0&&!(V&6)&&vn();var t=V;V|=1;var n=Me.transition,r=G;try{if(Me.transition=null,G=1,e)return e()}finally{G=r,Me.transition=n,V=t,!(V&6)&&It()}}function Xs(){Te=cn.current,K(cn)}function Mt(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Yp(n)),re!==null)for(n=re.return;n!==null;){var r=n;switch(As(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ua();break;case 3:Sn(),K(Ne),K(ge),Ms();break;case 5:Fs(r);break;case 4:Sn();break;case 13:K(X);break;case 19:K(X);break;case 10:Rs(r.type._context);break;case 22:case 23:Xs()}n=n.return}if(ue=e,re=e=Pt(e.current,null),de=Te=t,se=0,dr=null,qs=Oa=Gt=0,ke=Qn=null,$t!==null){for(t=0;t<$t.length;t++)if(n=$t[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=l,r.next=i}n.pending=r}$t=null}return e}function Rc(e,t){do{var n=re;try{if(Os(),qr.current=xa,ga){for(var r=Y.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}ga=!1}if(Ht=0,oe=le=Y=null,Hn=!1,or=0,Qs.current=null,n===null||n.return===null){se=1,dr=t,re=null;break}e:{var s=e,i=n.return,u=n,o=t;if(t=de,u.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,v=u,g=v.tag;if(!(v.mode&1)&&(g===0||g===11||g===15)){var h=v.alternate;h?(v.updateQueue=h.updateQueue,v.memoizedState=h.memoizedState,v.lanes=h.lanes):(v.updateQueue=null,v.memoizedState=null)}var S=Xi(i);if(S!==null){S.flags&=-257,Yi(S,i,u,s,t),S.mode&1&&Ji(s,c,t),t=S,o=c;var y=t.updateQueue;if(y===null){var k=new Set;k.add(o),t.updateQueue=k}else y.add(o);break e}else{if(!(t&1)){Ji(s,c,t),Ys();break e}o=Error(I(426))}}else if(J&&u.mode&1){var N=Xi(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Yi(N,i,u,s,t),Is(wn(o,u));break e}}s=o=wn(o,u),se!==4&&(se=2),Qn===null?Qn=[s]:Qn.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=xc(s,o,t);Wi(s,x);break e;case 1:u=o;var d=s.type,p=s.stateNode;if(!(s.flags&128)&&(typeof d.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Nt===null||!Nt.has(p)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=yc(s,u,t);Wi(s,j);break e}}s=s.return}while(s!==null)}$c(n)}catch(C){t=C,re===n&&n!==null&&(re=n=n.return);continue}break}while(!0)}function Dc(){var e=ya.current;return ya.current=xa,e===null?xa:e}function Ys(){(se===0||se===3||se===2)&&(se=4),ue===null||!(Gt&268435455)&&!(Oa&268435455)||vt(ue,de)}function wa(e,t){var n=V;V|=2;var r=Dc();(ue!==e||de!==t)&&(nt=null,Mt(e,t));do try{Cf();break}catch(l){Rc(e,l)}while(!0);if(Os(),V=n,ya.current=r,re!==null)throw Error(I(261));return ue=null,de=0,se}function Cf(){for(;re!==null;)bc(re)}function Nf(){for(;re!==null&&!Kd();)bc(re)}function bc(e){var t=Mc(e.alternate,e,Te);e.memoizedProps=e.pendingProps,t===null?$c(e):re=t,Qs.current=null}function $c(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xf(n,t),n!==null){n.flags&=32767,re=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{se=6,re=null;return}}else if(n=gf(n,t,Te),n!==null){re=n;return}if(t=t.sibling,t!==null){re=t;return}re=t=e}while(t!==null);se===0&&(se=5)}function Dt(e,t,n){var r=G,l=Me.transition;try{Me.transition=null,G=1,Ef(e,t,n,r)}finally{Me.transition=l,G=r}return null}function Ef(e,t,n,r){do vn();while(xt!==null);if(V&6)throw Error(I(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(lp(e,s),e===ue&&(re=ue=null,de=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||$r||($r=!0,Bc(ra,function(){return vn(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Me.transition,Me.transition=null;var i=G;G=1;var u=V;V|=4,Qs.current=null,jf(e,n),Ic(n,e),Hp(bl),la=!!Dl,bl=Dl=null,e.current=n,Sf(n),Jd(),V=u,G=i,Me.transition=s}else e.current=n;if($r&&($r=!1,xt=e,Sa=l),s=e.pendingLanes,s===0&&(Nt=null),Zd(n.stateNode),Pe(e,ne()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(ja)throw ja=!1,e=rs,rs=null,e;return Sa&1&&e.tag!==0&&vn(),s=e.pendingLanes,s&1?e===as?qn++:(qn=0,as=e):qn=0,It(),null}function vn(){if(xt!==null){var e=xu(Sa),t=Me.transition,n=G;try{if(Me.transition=null,G=16>e?16:e,xt===null)var r=!1;else{if(e=xt,xt=null,Sa=0,V&6)throw Error(I(331));var l=V;for(V|=4,b=e.current;b!==null;){var s=b,i=s.child;if(b.flags&16){var u=s.deletions;if(u!==null){for(var o=0;o<u.length;o++){var c=u[o];for(b=c;b!==null;){var v=b;switch(v.tag){case 0:case 11:case 15:Gn(8,v,s)}var g=v.child;if(g!==null)g.return=v,b=g;else for(;b!==null;){v=b;var h=v.sibling,S=v.return;if(Tc(v),v===c){b=null;break}if(h!==null){h.return=S,b=h;break}b=S}}}var y=s.alternate;if(y!==null){var k=y.child;if(k!==null){y.child=null;do{var N=k.sibling;k.sibling=null,k=N}while(k!==null)}}b=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,b=i;else e:for(;b!==null;){if(s=b,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Gn(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,b=x;break e}b=s.return}}var d=e.current;for(b=d;b!==null;){i=b;var p=i.child;if(i.subtreeFlags&2064&&p!==null)p.return=i,b=p;else e:for(i=d;b!==null;){if(u=b,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:za(9,u)}}catch(C){ee(u,u.return,C)}if(u===i){b=null;break e}var j=u.sibling;if(j!==null){j.return=u.return,b=j;break e}b=u.return}}if(V=l,It(),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(Na,e)}catch{}r=!0}return r}finally{G=n,Me.transition=t}}return!1}function po(e,t,n){t=wn(n,t),t=xc(e,t,1),e=Ct(e,t,1),t=je(),e!==null&&(mr(e,1,t),Pe(e,t))}function ee(e,t,n){if(e.tag===3)po(e,e,n);else for(;t!==null;){if(t.tag===3){po(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nt===null||!Nt.has(r))){e=wn(n,e),e=yc(t,e,1),t=Ct(t,e,1),e=je(),t!==null&&(mr(t,1,e),Pe(t,e));break}}t=t.return}}function Pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=je(),e.pingedLanes|=e.suspendedLanes&n,ue===e&&(de&n)===n&&(se===4||se===3&&(de&130023424)===de&&500>ne()-Ks?Mt(e,0):qs|=n),Pe(e,t)}function Fc(e,t){t===0&&(e.mode&1?(t=_r,_r<<=1,!(_r&130023424)&&(_r=4194304)):t=1);var n=je();e=ut(e,t),e!==null&&(mr(e,t,n),Pe(e,n))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fc(e,n)}function Tf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(I(314))}r!==null&&r.delete(t),Fc(e,n)}var Mc;Mc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ne.current)Ce=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ce=!1,vf(e,t,n);Ce=!!(e.flags&131072)}else Ce=!1,J&&t.flags&1048576&&Wu(t,pa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Jr(e,t),e=t.pendingProps;var l=xn(t,ge.current);mn(t,n),l=Us(null,t,r,e,l,n);var s=Vs();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ee(r)?(s=!0,ca(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,bs(t),l.updater=Ia,t.stateNode=l,l._reactInternals=t,Gl(t,r,e,n),t=Kl(null,t,r,!0,s,n)):(t.tag=0,J&&s&&Ls(t),ye(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Jr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Af(r),e=He(r,e),l){case 0:t=ql(null,t,r,e,n);break e;case 1:t=to(null,t,r,e,n);break e;case 11:t=Zi(null,t,r,e,n);break e;case 14:t=eo(null,t,r,He(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),ql(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),to(e,t,r,l,n);case 3:e:{if(kc(t),e===null)throw Error(I(387));r=t.pendingProps,s=t.memoizedState,l=s.element,Ju(e,t),ma(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=wn(Error(I(423)),t),t=no(e,t,r,n,l);break e}else if(r!==l){l=wn(Error(I(424)),t),t=no(e,t,r,n,l);break e}else for(Le=kt(t.stateNode.containerInfo.firstChild),Ae=t,J=!0,Qe=null,n=qu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yn(),r===l){t=ct(e,t,n);break e}ye(e,t,r,n)}t=t.child}return t;case 5:return Xu(t),e===null&&Vl(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,i=l.children,$l(r,l)?i=null:s!==null&&$l(r,s)&&(t.flags|=32),wc(e,t),ye(e,t,i,n),t.child;case 6:return e===null&&Vl(t),null;case 13:return Cc(e,t,n);case 4:return $s(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=jn(t,null,r,n):ye(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),Zi(e,t,r,l,n);case 7:return ye(e,t,t.pendingProps,n),t.child;case 8:return ye(e,t,t.pendingProps.children,n),t.child;case 12:return ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,i=l.value,Q(fa,r._currentValue),r._currentValue=i,s!==null)if(Je(s.value,i)){if(s.children===l.children&&!Ne.current){t=ct(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var u=s.dependencies;if(u!==null){i=s.child;for(var o=u.firstContext;o!==null;){if(o.context===r){if(s.tag===1){o=st(-1,n&-n),o.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?o.next=o:(o.next=v.next,v.next=o),c.pending=o}}s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wl(s.return,n,t),u.lanes|=n;break}o=o.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(I(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Wl(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}ye(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,mn(t,n),l=Be(l),r=r(l),t.flags|=1,ye(e,t,r,n),t.child;case 14:return r=t.type,l=He(r,t.pendingProps),l=He(r.type,l),eo(e,t,r,l,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:He(r,l),Jr(e,t),t.tag=1,Ee(r)?(e=!0,ca(t)):e=!1,mn(t,n),gc(t,r,l),Gl(t,r,l,n),Kl(null,t,r,!0,e,n);case 19:return Nc(e,t,n);case 22:return Sc(e,t,n)}throw Error(I(156,t.tag))};function Bc(e,t){return hu(e,t)}function Lf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fe(e,t,n,r){return new Lf(e,t,n,r)}function Zs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Af(e){if(typeof e=="function")return Zs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xs)return 11;if(e===ys)return 14}return 2}function Pt(e,t){var n=e.alternate;return n===null?(n=Fe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Zr(e,t,n,r,l,s){var i=2;if(r=e,typeof e=="function")Zs(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Zt:return Bt(n.children,l,s,t);case gs:i=8,l|=8;break;case vl:return e=Fe(12,n,t,l|2),e.elementType=vl,e.lanes=s,e;case gl:return e=Fe(13,n,t,l),e.elementType=gl,e.lanes=s,e;case xl:return e=Fe(19,n,t,l),e.elementType=xl,e.lanes=s,e;case Xo:return Ra(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ko:i=10;break e;case Jo:i=9;break e;case xs:i=11;break e;case ys:i=14;break e;case ft:i=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Fe(i,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Bt(e,t,n,r){return e=Fe(7,e,r,t),e.lanes=n,e}function Ra(e,t,n,r){return e=Fe(22,e,r,t),e.elementType=Xo,e.lanes=n,e.stateNode={isHidden:!1},e}function dl(e,t,n){return e=Fe(6,e,null,t),e.lanes=n,e}function pl(e,t,n){return t=Fe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function If(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ga(0),this.expirationTimes=Ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ga(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ei(e,t,n,r,l,s,i,u,o){return e=new If(e,t,n,u,o),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Fe(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bs(s),e}function zf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yt,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Uc(e){if(!e)return Tt;e=e._reactInternals;e:{if(Kt(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ee(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(Ee(n))return Uu(e,n,t)}return t}function Vc(e,t,n,r,l,s,i,u,o){return e=ei(n,r,!0,e,l,s,i,u,o),e.context=Uc(null),n=e.current,r=je(),l=Et(n),s=st(r,l),s.callback=t??null,Ct(n,s,l),e.current.lanes=l,mr(e,l,r),Pe(e,r),e}function Da(e,t,n,r){var l=t.current,s=je(),i=Et(l);return n=Uc(n),t.context===null?t.context=n:t.pendingContext=n,t=st(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ct(l,t,i),e!==null&&(Ke(e,l,i,s),Qr(e,l,i)),i}function ka(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fo(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ti(e,t){fo(e,t),(e=e.alternate)&&fo(e,t)}function Of(){return null}var Wc=typeof reportError=="function"?reportError:function(e){console.error(e)};function ni(e){this._internalRoot=e}ba.prototype.render=ni.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));Da(e,t,null,null)};ba.prototype.unmount=ni.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qt(function(){Da(null,e,null,null)}),t[ot]=null}};function ba(e){this._internalRoot=e}ba.prototype.unstable_scheduleHydration=function(e){if(e){var t=Su();e={blockedOn:null,target:e,priority:t};for(var n=0;n<mt.length&&t!==0&&t<mt[n].priority;n++);mt.splice(n,0,e),n===0&&ku(e)}};function ri(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ho(){}function Rf(e,t,n,r,l){if(l){if(typeof r=="function"){var s=r;r=function(){var c=ka(i);s.call(c)}}var i=Vc(t,r,e,0,null,!1,!1,"",ho);return e._reactRootContainer=i,e[ot]=i.current,rr(e.nodeType===8?e.parentNode:e),Qt(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var u=r;r=function(){var c=ka(o);u.call(c)}}var o=ei(e,0,!1,null,null,!1,!1,"",ho);return e._reactRootContainer=o,e[ot]=o.current,rr(e.nodeType===8?e.parentNode:e),Qt(function(){Da(t,o,n,r)}),o}function Fa(e,t,n,r,l){var s=n._reactRootContainer;if(s){var i=s;if(typeof l=="function"){var u=l;l=function(){var o=ka(i);u.call(o)}}Da(t,i,e,l)}else i=Rf(n,t,e,l,r);return ka(i)}yu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$n(t.pendingLanes);n!==0&&(ws(t,n|1),Pe(t,ne()),!(V&6)&&(kn=ne()+500,It()))}break;case 13:Qt(function(){var r=ut(e,1);if(r!==null){var l=je();Ke(r,e,1,l)}}),ti(e,1)}};ks=function(e){if(e.tag===13){var t=ut(e,134217728);if(t!==null){var n=je();Ke(t,e,134217728,n)}ti(e,134217728)}};ju=function(e){if(e.tag===13){var t=Et(e),n=ut(e,t);if(n!==null){var r=je();Ke(n,e,t,r)}ti(e,t)}};Su=function(){return G};wu=function(e,t){var n=G;try{return G=e,t()}finally{G=n}};_l=function(e,t,n){switch(t){case"input":if(Sl(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Ta(r);if(!l)throw Error(I(90));Zo(r),Sl(r,l)}}}break;case"textarea":tu(e,n);break;case"select":t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}};ou=Js;uu=Qt;var Df={usingClientEntryPoint:!1,Events:[gr,rn,Ta,su,iu,Js]},Rn={findFiberByHostInstance:bt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bf={bundleType:Rn.bundleType,version:Rn.version,rendererPackageName:Rn.rendererPackageName,rendererConfig:Rn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:dt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pu(e),e===null?null:e.stateNode},findFiberByHostInstance:Rn.findFiberByHostInstance||Of,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fr.isDisabled&&Fr.supportsFiber)try{Na=Fr.inject(bf),et=Fr}catch{}}ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Df;ze.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ri(t))throw Error(I(200));return zf(e,t,null,n)};ze.createRoot=function(e,t){if(!ri(e))throw Error(I(299));var n=!1,r="",l=Wc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=ei(e,1,!1,null,null,n,!1,r,l),e[ot]=t.current,rr(e.nodeType===8?e.parentNode:e),new ni(t)};ze.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=pu(t),e=e===null?null:e.stateNode,e};ze.flushSync=function(e){return Qt(e)};ze.hydrate=function(e,t,n){if(!$a(t))throw Error(I(200));return Fa(null,e,t,!0,n)};ze.hydrateRoot=function(e,t,n){if(!ri(e))throw Error(I(405));var r=n!=null&&n.hydratedSources||null,l=!1,s="",i=Wc;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Vc(t,null,e,1,n??null,l,!1,s,i),e[ot]=t.current,rr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new ba(t)};ze.render=function(e,t,n){if(!$a(t))throw Error(I(200));return Fa(null,e,t,!1,n)};ze.unmountComponentAtNode=function(e){if(!$a(e))throw Error(I(40));return e._reactRootContainer?(Qt(function(){Fa(null,null,e,!1,function(){e._reactRootContainer=null,e[ot]=null})}),!0):!1};ze.unstable_batchedUpdates=Js;ze.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$a(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return Fa(e,t,n,!1,r)};ze.version="18.3.1-next-f1338f8080-20240426";function Hc(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hc)}catch(e){console.error(e)}}Hc(),Ho.exports=ze;var $f=Ho.exports,Gc,mo=$f;Gc=mo.createRoot,mo.hydrateRoot;/**
|
|
41
|
-
* @remix-run/router v1.23.4
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pr.apply(null,arguments)}var yt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(yt||(yt={}));const vo="popstate";function Ff(e){e===void 0&&(e={});function t(r,l){let{pathname:s,search:i,hash:u}=r.location;return is("",{pathname:s,search:i,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:qc(l)}return Bf(t,n,null,e)}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Mf(){return Math.random().toString(36).substr(2,8)}function go(e,t){return{usr:e.state,key:e.key,idx:t}}function is(e,t,n,r){return n===void 0&&(n=null),pr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pn(t):t,{state:n,key:t&&t.key||r||Mf()})}function qc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Pn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Bf(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:s=!1}=r,i=l.history,u=yt.Pop,o=null,c=v();c==null&&(c=0,i.replaceState(pr({},i.state,{idx:c}),""));function v(){return(i.state||{idx:null}).idx}function g(){u=yt.Pop;let N=v(),x=N==null?null:N-c;c=N,o&&o({action:u,location:k.location,delta:x})}function h(N,x){u=yt.Push;let d=is(k.location,N,x);c=v()+1;let p=go(d,c),j=k.createHref(d);try{i.pushState(p,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;l.location.assign(j)}s&&o&&o({action:u,location:k.location,delta:1})}function S(N,x){u=yt.Replace;let d=is(k.location,N,x);c=v();let p=go(d,c),j=k.createHref(d);i.replaceState(p,"",j),s&&o&&o({action:u,location:k.location,delta:0})}function y(N){let x=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof N=="string"?N:qc(N);return d=d.replace(/ $/,"%20"),ae(x,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,x)}let k={get action(){return u},get location(){return e(l,i)},listen(N){if(o)throw new Error("A history only accepts one active listener");return l.addEventListener(vo,g),o=N,()=>{l.removeEventListener(vo,g),o=null}},createHref(N){return t(l,N)},createURL:y,encodeLocation(N){let x=y(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:S,go(N){return i.go(N)}};return k}var xo;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xo||(xo={}));function Uf(e,t,n){return n===void 0&&(n="/"),Vf(e,t,n)}function Vf(e,t,n,r){let l=typeof t=="string"?Pn(t):t,s=Xc(l.pathname||"/",n);if(s==null)return null;let i=Kc(e);Wf(i);let u=null,o=nh(s);for(let c=0;u==null&&c<i.length;++c)u=Zf(i[c],o);return u}function Kc(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(s,i,u)=>{let o={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};o.relativePath.startsWith("/")&&(ae(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(r.length));let c=Ut([r,o.relativePath]),v=n.concat(o);s.children&&s.children.length>0&&(ae(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Kc(s.children,t,v,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:Xf(c,s.index),routesMeta:v})};return e.forEach((s,i)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))l(s,i);else for(let o of Jc(s.path))l(s,i,o)}),t}function Jc(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let i=Jc(r.join("/")),u=[];return u.push(...i.map(o=>o===""?s:[s,o].join("/"))),l&&u.push(...i),u.map(o=>e.startsWith("/")&&o===""?"/":o)}function Wf(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Yf(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Hf=/^:[\w-]+$/,Gf=3,Qf=2,qf=1,Kf=10,Jf=-2,yo=e=>e==="*";function Xf(e,t){let n=e.split("/"),r=n.length;return n.some(yo)&&(r+=Jf),t&&(r+=Qf),n.filter(l=>!yo(l)).reduce((l,s)=>l+(Hf.test(s)?Gf:s===""?qf:Kf),r)}function Yf(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Zf(e,t,n){let{routesMeta:r}=e,l={},s="/",i=[];for(let u=0;u<r.length;++u){let o=r[u],c=u===r.length-1,v=s==="/"?t:t.slice(s.length)||"/",g=eh({path:o.relativePath,caseSensitive:o.caseSensitive,end:c},v),h=o.route;if(!g)return null;Object.assign(l,g.params),i.push({params:l,pathname:Ut([s,g.pathname]),pathnameBase:lh(Ut([s,g.pathnameBase])),route:h}),g.pathnameBase!=="/"&&(s=Ut([s,g.pathnameBase]))}return i}function eh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=th(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let s=l[0],i=s.replace(/(.)\/+$/,"$1"),u=l.slice(1);return{params:r.reduce((c,v,g)=>{let{paramName:h,isOptional:S}=v;if(h==="*"){let k=u[g]||"";i=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const y=u[g];return S&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}function th(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,o)=>(r.push({paramName:u,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function nh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function rh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Pn(e):e,s;return n?(n=ed(n),n.startsWith("/")?s=jo(n.substring(1),"/"):s=jo(n,t)):s=t,{pathname:s,search:sh(r),hash:ih(l)}}function jo(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function fl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ah(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yc(e,t){let n=ah(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Zc(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Pn(e):(l=pr({},e),ae(!l.pathname||!l.pathname.includes("?"),fl("?","pathname","search",l)),ae(!l.pathname||!l.pathname.includes("#"),fl("#","pathname","hash",l)),ae(!l.search||!l.search.includes("#"),fl("#","search","hash",l)));let s=e===""||l.pathname==="",i=s?"/":l.pathname,u;if(i==null)u=n;else{let g=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),g-=1;l.pathname=h.join("/")}u=g>=0?t[g]:"/"}let o=rh(l,u),c=i&&i!=="/"&&i.endsWith("/"),v=(s||i===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(c||v)&&(o.pathname+="/"),o}const ed=e=>e.replace(/\/\/+/g,"/"),Ut=e=>ed(e.join("/")),lh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ih=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function oh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const td=["post","put","patch","delete"];new Set(td);const uh=["get",...td];new Set(uh);/**
|
|
50
|
-
* React Router v6.30.6
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fr.apply(null,arguments)}const ai=f.createContext(null),ch=f.createContext(null),yr=f.createContext(null),Ma=f.createContext(null),Jt=f.createContext({outlet:null,matches:[],isDataRoute:!1}),nd=f.createContext(null);function jr(){return f.useContext(Ma)!=null}function Sr(){return jr()||ae(!1),f.useContext(Ma).location}function rd(e){f.useContext(yr).static||f.useLayoutEffect(e)}function Re(){let{isDataRoute:e}=f.useContext(Jt);return e?kh():dh()}function dh(){jr()||ae(!1);let e=f.useContext(ai),{basename:t,future:n,navigator:r}=f.useContext(yr),{matches:l}=f.useContext(Jt),{pathname:s}=Sr(),i=JSON.stringify(Yc(l,n.v7_relativeSplatPath)),u=f.useRef(!1);return rd(()=>{u.current=!0}),f.useCallback(function(c,v){if(v===void 0&&(v={}),!u.current)return;if(typeof c=="number"){r.go(c);return}let g=Zc(c,JSON.parse(i),s,v.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ut([t,g.pathname])),(v.replace?r.replace:r.push)(g,v.state,v)},[t,r,i,s,e])}function ph(e,t){return fh(e,t)}function fh(e,t,n,r){jr()||ae(!1);let{navigator:l}=f.useContext(yr),{matches:s}=f.useContext(Jt),i=s[s.length-1],u=i?i.params:{};i&&i.pathname;let o=i?i.pathnameBase:"/";i&&i.route;let c=Sr(),v;if(t){var g;let N=typeof t=="string"?Pn(t):t;o==="/"||(g=N.pathname)!=null&&g.startsWith(o)||ae(!1),v=N}else v=c;let h=v.pathname||"/",S=h;if(o!=="/"){let N=o.replace(/^\//,"").split("/");S="/"+h.replace(/^\//,"").split("/").slice(N.length).join("/")}let y=Uf(e,{pathname:S}),k=xh(y&&y.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:Ut([o,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?o:Ut([o,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),s,n,r);return t&&k?f.createElement(Ma.Provider,{value:{location:fr({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:yt.Pop}},k):k}function hh(){let e=wh(),t=oh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:l},n):null,null)}const mh=f.createElement(hh,null);class vh extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(Jt.Provider,{value:this.props.routeContext},f.createElement(nd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gh(e){let{routeContext:t,match:n,children:r}=e,l=f.useContext(ai);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Jt.Provider,{value:t},r)}function xh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,u=(l=n)==null?void 0:l.errors;if(u!=null){let v=i.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);v>=0||ae(!1),i=i.slice(0,Math.min(i.length,v+1))}let o=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let v=0;v<i.length;v++){let g=i[v];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=v),g.route.id){let{loaderData:h,errors:S}=n,y=g.route.loader&&h[g.route.id]===void 0&&(!S||S[g.route.id]===void 0);if(g.route.lazy||y){o=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((v,g,h)=>{let S,y=!1,k=null,N=null;n&&(S=u&&g.route.id?u[g.route.id]:void 0,k=g.route.errorElement||mh,o&&(c<0&&h===0?(Ch("route-fallback"),y=!0,N=null):c===h&&(y=!0,N=g.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,h+1)),d=()=>{let p;return S?p=k:y?p=N:g.route.Component?p=f.createElement(g.route.Component,null):g.route.element?p=g.route.element:p=v,f.createElement(gh,{match:g,routeContext:{outlet:v,matches:x,isDataRoute:n!=null},children:p})};return n&&(g.route.ErrorBoundary||g.route.errorElement||h===0)?f.createElement(vh,{location:n.location,revalidation:n.revalidation,component:k,error:S,children:d(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):d()},null)}var ad=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ad||{}),ld=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ld||{});function yh(e){let t=f.useContext(ai);return t||ae(!1),t}function jh(e){let t=f.useContext(ch);return t||ae(!1),t}function Sh(e){let t=f.useContext(Jt);return t||ae(!1),t}function sd(e){let t=Sh(),n=t.matches[t.matches.length-1];return n.route.id||ae(!1),n.route.id}function wh(){var e;let t=f.useContext(nd),n=jh(),r=sd();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function kh(){let{router:e}=yh(ad.UseNavigateStable),t=sd(ld.UseNavigateStable),n=f.useRef(!1);return rd(()=>{n.current=!0}),f.useCallback(function(l,s){s===void 0&&(s={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,fr({fromRouteId:t},s)))},[e,t])}const So={};function Ch(e,t,n){So[e]||(So[e]=!0)}function Nh(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wo(e){let{to:t,replace:n,state:r,relative:l}=e;jr()||ae(!1);let{future:s,static:i}=f.useContext(yr),{matches:u}=f.useContext(Jt),{pathname:o}=Sr(),c=Re(),v=Zc(t,Yc(u,s.v7_relativeSplatPath),o,l==="path"),g=JSON.stringify(v);return f.useEffect(()=>c(JSON.parse(g),{replace:n,state:r,relative:l}),[c,g,l,n,r]),null}function te(e){ae(!1)}function Eh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=yt.Pop,navigator:s,static:i=!1,future:u}=e;jr()&&ae(!1);let o=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:o,navigator:s,static:i,future:fr({v7_relativeSplatPath:!1},u)}),[o,u,s,i]);typeof r=="string"&&(r=Pn(r));let{pathname:v="/",search:g="",hash:h="",state:S=null,key:y="default"}=r,k=f.useMemo(()=>{let N=Xc(v,o);return N==null?null:{location:{pathname:N,search:g,hash:h,state:S,key:y},navigationType:l}},[o,v,g,h,S,y,l]);return k==null?null:f.createElement(yr.Provider,{value:c},f.createElement(Ma.Provider,{children:n,value:k}))}function Ph(e){let{children:t,location:n}=e;return ph(os(t),n)}new Promise(()=>{});function os(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,l)=>{if(!f.isValidElement(r))return;let s=[...t,l];if(r.type===f.Fragment){n.push.apply(n,os(r.props.children,s));return}r.type!==te&&ae(!1),!r.props.index||!r.props.children||ae(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=os(r.props.children,s)),n.push(i)}),n}/**
|
|
59
|
-
* React Router DOM v6.30.6
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/const _h="6";try{window.__reactRouterVersion=_h}catch{}const Th="startTransition",ko=Ed[Th];function Lh(e){let{basename:t,children:n,future:r,window:l}=e,s=f.useRef();s.current==null&&(s.current=Ff({window:l,v5Compat:!0}));let i=s.current,[u,o]=f.useState({action:i.action,location:i.location}),{v7_startTransition:c}=r||{},v=f.useCallback(g=>{c&&ko?ko(()=>o(g)):o(g)},[o,c]);return f.useLayoutEffect(()=>i.listen(v),[i,v]),f.useEffect(()=>Nh(r),[r]),f.createElement(Eh,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i,future:r})}var Co;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Co||(Co={}));var No;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(No||(No={}));async function R(e,t={}){const n=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json",...t.headers||{}},...t});if(!n.ok){let r=`${n.status} ${n.statusText}`;try{r=(await n.json()).detail||r}catch{}throw new Error(typeof r=="string"?r:JSON.stringify(r))}return n.json()}const z={health:()=>R("/api/health"),version:()=>R("/api/version"),session:()=>R("/api/auth/session"),login:(e,t)=>R("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,activation_code:t})}),logout:()=>R("/api/auth/logout",{method:"POST"}),settings:()=>R("/api/settings"),saveSettings:e=>R("/api/settings",{method:"PUT",body:JSON.stringify(e)}),produtos:()=>R("/api/produtos"),createProduto:e=>R("/api/produtos",{method:"POST",body:JSON.stringify(e)}),updateProduto:(e,t)=>R(`/api/produtos/${e}`,{method:"PUT",body:JSON.stringify(t)}),deleteProduto:e=>R(`/api/produtos/${e}`,{method:"DELETE"}),aprovarProduto:e=>R(`/api/produtos/${e}/aprovar`,{method:"POST"}),analisarProduto:e=>R(`/api/produtos/${e}/analisar`,{method:"POST"}),llmProviders:()=>R("/api/llm/providers"),llmTest:e=>R("/api/llm/test",{method:"POST",body:JSON.stringify({id:e})}),trackingDashboard:()=>R("/api/tracking/dashboard"),visitante:e=>R(`/api/tracking/visitante/${e}`),infoprodutos:()=>R("/api/infoprodutos"),createInfoproduto:e=>R("/api/infoprodutos",{method:"POST",body:JSON.stringify(e)}),deleteInfoproduto:e=>R(`/api/infoprodutos/${e}`,{method:"DELETE"}),infoprodutoMarkdown:e=>R(`/api/infoprodutos/${e}/markdown`),paginas:()=>R("/api/paginas"),createPagina:e=>R("/api/paginas",{method:"POST",body:JSON.stringify(e)}),paginaHtml:e=>R(`/api/paginas/${e}/html`),updatePaginaHtml:(e,t)=>R(`/api/paginas/${e}/html`,{method:"PUT",body:JSON.stringify({html:t})}),publicarPagina:e=>R(`/api/paginas/${e}/publicar`,{method:"POST"}),deletePagina:e=>R(`/api/paginas/${e}`,{method:"DELETE"}),dominios:()=>R("/api/dominios"),createDominio:e=>R("/api/dominios",{method:"POST",body:JSON.stringify(e)}),verificarDominio:e=>R(`/api/dominios/${e}/verificar`,{method:"POST"}),updateDominioTags:(e,t)=>R(`/api/dominios/${e}/tags`,{method:"PUT",body:JSON.stringify({tags:t})}),deleteDominio:e=>R(`/api/dominios/${e}`,{method:"DELETE"}),vendas:()=>R("/api/vendas"),vendasResumo:()=>R("/api/vendas/resumo"),createVenda:e=>R("/api/vendas",{method:"POST",body:JSON.stringify(e)}),deleteVenda:e=>R(`/api/vendas/${e}`,{method:"DELETE"}),importVendasCsv:e=>R("/api/vendas/csv",{method:"POST",body:JSON.stringify({csv:e})}),uploadConversao:e=>R(`/api/vendas/${e}/conversao`,{method:"POST"}),uploadConversoesLote:()=>R("/api/vendas/conversoes/upload",{method:"POST"}),adswords:e=>R(e?`/api/adswords?produto_id=${e}`:"/api/adswords"),adswordsGerar:e=>R("/api/adswords/gerar",{method:"POST",body:JSON.stringify({produto_id:e})}),adswordsAdicionar:e=>R("/api/adswords",{method:"POST",body:JSON.stringify(e)}),adswordsRemover:e=>R(`/api/adswords/${e}`,{method:"DELETE"}),gerarCriativos:e=>R("/api/criativos/gerar",{method:"POST",body:JSON.stringify(e)}),campanhas:()=>R("/api/campanhas"),createCampanha:e=>R("/api/campanhas",{method:"POST",body:JSON.stringify(e)}),getCampanha:e=>R(`/api/campanhas/${e}`),deleteCampanha:e=>R(`/api/campanhas/${e}`,{method:"DELETE"}),publicarCampanha:e=>R(`/api/campanhas/${e}/publicar`,{method:"POST"}),dashboard:()=>R("/api/dashboard"),lancamentoAtual:()=>R("/api/lancamentos/atual"),lancamentoEtapas:()=>R("/api/lancamentos/etapas"),iniciarLancamento:e=>R("/api/lancamentos",{method:"POST",body:JSON.stringify({produto_id:e})}),salvarEtapaLancamento:(e,t,n)=>R(`/api/lancamentos/${e}/etapa`,{method:"POST",body:JSON.stringify({etapa:t,dados:n})}),relatorioLancamento:e=>R(`/api/lancamentos/${e}/relatorio`),concluirLancamento:e=>R(`/api/lancamentos/${e}/concluir`,{method:"POST"}),notificacoesConfig:()=>R("/api/notificacoes"),salvarNotificacoes:(e,t)=>R("/api/notificacoes",{method:"PUT",body:JSON.stringify({eventos:e,targets:t})}),notificacoesHistorico:()=>R("/api/notificacoes/historico"),testarNotificacao:e=>R("/api/notificacoes/teste",{method:"POST",body:JSON.stringify(e)}),pins:e=>R(e?`/api/pins?produto_id=${e}`:"/api/pins"),pinsGerar:e=>R("/api/pins/gerar",{method:"POST",body:JSON.stringify(e)}),pinStatus:(e,t)=>R(`/api/pins/${e}/status`,{method:"PUT",body:JSON.stringify({status:t})}),pinRemover:e=>R(`/api/pins/${e}`,{method:"DELETE"}),pinsExport:e=>R("/api/pins/export",{method:"POST",body:JSON.stringify({pin_ids:e})}),logs:()=>R("/api/logs"),guias:()=>R("/api/guias"),guia:e=>R(`/api/guias/${e}`),googleOAuthUrl:()=>R("/api/google/oauth/url"),investimentos:()=>R("/api/investimentos"),registrarInvestimento:e=>R("/api/investimentos",{method:"POST",body:JSON.stringify(e)}),removerInvestimento:e=>R(`/api/investimentos/${e}`,{method:"DELETE"})},Eo=[{to:"/",emoji:"📦",label:"Seus Produtos"},{to:"/dashboard",emoji:"📊",label:"AdsDashboard"},{emoji:"🌐",label:"AdsHosting",children:[{to:"/hosting/dominios",label:"Domínios"},{to:"/hosting/paginas",label:"Páginas Criadas"}]},{emoji:"📖",label:"Infoprodutos",children:[{to:"/studio",label:"Criar Infoproduto"},{to:"/studio/biblioteca",label:"Biblioteca"}]},{to:"/adspages",emoji:"🛡️",label:"AdsPages"},{to:"/adswords",emoji:"✈️",label:"AdsWords"},{to:"/adscreator",emoji:"🎯",label:"AdsCreator"},{emoji:"🔄",label:"AdsTracking",children:[{to:"/tracking/visitas",label:"Minhas Visitas"},{to:"/tracking/vendas",label:"Minhas Vendas"},{to:"/tracking/gclid",label:"Conversões GCLID"}]},{to:"/adsbot",emoji:"🤖",label:"AdsBot"},{to:"/pinterest",emoji:"📌",label:"Pinterest"},"divider",{to:"/contas-google",emoji:"🔑",label:"Contas do Google"},{to:"/api-keys",emoji:"🔌",label:"Chaves de API"},{to:"/notificacoes",emoji:"🔔",label:"Notificações"},{to:"/logs",emoji:"📋",label:"Logs"},{to:"/faq",emoji:"❓",label:"FAQ & Documentação"}];function Ah(){const e=Sr(),t=Re(),{version:n,logout:r}=li(),[l,s]=f.useState(()=>{const o=new Set;for(const c of Eo)c.children&&c.children.some(v=>v.to===e.pathname)&&o.add(c.label);return o}),i=o=>s(c=>{const v=new Set(c);return v.has(o)?v.delete(o):v.add(o),v}),u=async()=>{await r(),t("/login")};return a.jsxs("aside",{className:"sidebar",children:[a.jsxs("div",{className:"logo-area",children:["🚀 ProdMaker ",n&&a.jsxs("span",{className:"badge",children:["v",n]})]}),a.jsx("nav",{children:a.jsx("ul",{children:Eo.map((o,c)=>{if(o==="divider"||o.divider)return a.jsx("div",{className:"divider"},`d${c}`);if(o.children){const v=o.children.some(h=>h.to===e.pathname),g=l.has(o.label)||v;return a.jsxs("li",{className:`has-submenu ${g?"expanded":""}`,children:[a.jsxs("div",{onClick:()=>i(o.label),children:[a.jsx("span",{style:{fontSize:"16px"},children:o.emoji})," ",o.label,a.jsx("span",{className:"submenu-arrow",children:"▼"})]}),a.jsx("ul",{children:o.children.map(h=>a.jsx("li",{className:e.pathname===h.to?"active":"",onClick:()=>t(h.to),children:h.label},h.to))})]},o.label)}return a.jsxs("li",{className:`nav-item ${e.pathname===o.to?"active":""}`,onClick:()=>t(o.to),children:[a.jsx("span",{style:{fontSize:"16px"},children:o.emoji})," ",o.label]},o.to)})})}),a.jsx("div",{className:"sidebar-bottom",children:a.jsx("button",{className:"btn-logout",onClick:u,children:"🚪 Sair"})})]})}function Ih(){const{session:e,theme:t,toggleTheme:n}=li(),r=Re(),s=((e==null?void 0:e.email)||"").split("@")[0]||"usuário";return a.jsxs("header",{className:"top-bar",children:[a.jsx("div",{className:"promo-banner",onClick:()=>r("/adsbot"),title:"Abrir o AdsBot",children:"🚀 Novo Lançamento — conduza seu lançamento passo a passo no AdsBot →"}),a.jsxs("div",{className:"user-profile",children:["Olá, ",s,a.jsx("span",{className:"avatar",children:s.charAt(0)}),a.jsx("button",{className:"theme-toggle",onClick:n,title:"Alternar Tema",children:t==="light"?"🌙":"☀️"})]})]})}const id=f.createContext(null),ie=()=>f.useContext(id);function zh({children:e}){const[t,n]=f.useState([]),r=f.useCallback(l=>{const s=Date.now()+Math.random();n(i=>[...i,{id:s,message:l}]),setTimeout(()=>n(i=>i.filter(u=>u.id!==s)),3e3)},[]);return a.jsxs(id.Provider,{value:{toast:r},children:[e,t.map((l,s)=>a.jsxs("div",{className:"toast",style:{top:70+s*70},children:[a.jsx("span",{children:"✓"}),a.jsx("div",{children:l.message})]},l.id))]})}const Oh=[{number:"1",icon:"inventory_2",title:"Adicione o produto",last:!1},{number:"2",icon:"web",title:"Crie a Presell",last:!1},{number:"3",icon:"campaign",title:"Crie a Campanha",last:!1},{number:"4",icon:"trending_up",title:"Receba Vendas",last:!0}],Rh=[{code:"pt",label:"Português"},{code:"en",label:"English"},{code:"es",label:"Español"}];function Dh(){const{login:e}=li(),t=Re(),[n,r]=f.useState(""),[l,s]=f.useState(""),[i,u]=f.useState(!1),[o,c]=f.useState("pt"),[v,g]=f.useState(""),[h,S]=f.useState(!1),y=async k=>{k.preventDefault(),g(""),S(!0);try{await e(n,l),t("/",{replace:!0})}catch(N){g(N.message||"Não foi possível entrar. Verifique o e-mail e o código de ativação.")}finally{S(!1)}};return a.jsxs("div",{className:"login-page",children:[a.jsxs("div",{className:"login-left",children:[a.jsxs("div",{className:"login-left-content",children:[a.jsxs("h1",{className:"login-left-title",children:[a.jsx("span",{children:"Tudo o que o afiliado precisa"})," ",a.jsx("br",{}),a.jsx("span",{className:"highlight-text",children:"para vender"})," ",a.jsx("br",{}),a.jsx("span",{children:"em um só lugar"})]}),a.jsx("p",{className:"login-left-description",children:"Menos configuração, mais vendas!"}),a.jsx("div",{className:"features-grid",children:Oh.map(k=>a.jsxs("div",{className:"feature-step-item",children:[a.jsxs("div",{className:`feature-card feature-step ${k.last?"feature-step-last":""}`,children:[a.jsx("span",{className:"feature-step-number","aria-hidden":"true",children:k.number}),a.jsx("div",{className:"feature-step-icon",children:a.jsx("i",{className:"material-symbols-outlined",children:k.icon})}),!k.last&&a.jsx("div",{className:"feature-step-arrow"})]}),a.jsx("h3",{className:"feature-title",children:k.title})]},k.number))})]}),a.jsx("div",{className:"login-blur-effect blur-effect-center"}),a.jsx("div",{className:"login-blur-effect blur-effect-1"}),a.jsx("div",{className:"login-blur-effect blur-effect-2"}),a.jsx("div",{className:"login-particle",style:{left:"8%",width:"4px",height:"4px",background:"#8b3fbf",opacity:.5,animationDuration:"10s",animationDelay:"0s"}}),a.jsx("div",{className:"login-particle",style:{left:"22%",width:"3px",height:"3px",background:"#8b3fbf",opacity:.4,animationDuration:"11s",animationDelay:"1s"}}),a.jsx("div",{className:"login-particle",style:{left:"38%",width:"5px",height:"5px",background:"#8b3fbf",opacity:.4,animationDuration:"11s",animationDelay:"1s"}}),a.jsx("div",{className:"login-particle",style:{left:"55%",width:"3px",height:"3px",background:"#8b3fbf",opacity:.4,animationDuration:"11s",animationDelay:"1s"}}),a.jsx("div",{className:"login-particle",style:{left:"70%",width:"4px",height:"4px",background:"#ee476f",opacity:.35,animationDuration:"14s",animationDelay:"0.5s"}}),a.jsx("div",{className:"login-particle",style:{left:"82%",width:"3px",height:"3px",background:"#8b3fbf",opacity:.45,animationDuration:"12s",animationDelay:"1.8s"}}),a.jsx("div",{className:"login-particle",style:{left:"93%",width:"4px",height:"4px",background:"#a653d4",opacity:.3,animationDuration:"10s",animationDelay:"3.8s"}})]}),a.jsxs("div",{className:"login-right",children:[a.jsx("div",{className:"login-language-toggle",children:a.jsxs("div",{className:"language-toggle-wrapper",children:[a.jsx("button",{className:"language-toggle-btn",title:"Alterar idioma",type:"button",children:a.jsx("span",{className:"material-symbols-outlined",children:"translate"})}),a.jsx("div",{className:"language-toggle-dropdown",children:Rh.map(k=>a.jsx("div",{className:`language-toggle-item ${o===k.code?"active":""}`,onClick:()=>c(k.code),children:k.label},k.code))})]})}),a.jsxs("div",{className:"login-form",children:[a.jsx("h2",{children:"Bem-vindo de volta!"}),a.jsx("p",{className:"login-subtitle",children:"Insira seu e-mail e código de ativação"}),a.jsxs("form",{onSubmit:y,children:[v&&a.jsx("div",{className:"login-error",children:v}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"email",children:"E-mail:"}),a.jsxs("div",{className:"email-input-wrapper",children:[a.jsx("span",{className:"material-symbols-outlined email-icon",children:"mail"}),a.jsx("input",{id:"email",type:"email",required:!0,placeholder:"seu@email.com",value:n,onChange:k=>r(k.target.value),autoComplete:"email"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"activationCode",children:"Código de Ativação"}),a.jsxs("div",{className:"password-input-wrapper",children:[a.jsx("span",{className:"material-symbols-outlined lock-icon",children:"lock"}),a.jsx("input",{id:"activationCode",type:i?"text":"password",required:!0,placeholder:"********",value:l,onChange:k=>s(k.target.value),autoComplete:"current-password"}),a.jsx("button",{type:"button",className:"password-toggle-btn","aria-label":i?"Ocultar código":"Mostrar código",onClick:()=>u(k=>!k),children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20px",viewBox:"0 -960 960 960",width:"20px",fill:"currentColor",children:a.jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-42 0-71-29t-29-71q0-42 29-71t71-29q42 0 71 29t29 71q0 42-29 71t-71 29Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Z"})})})]})]}),a.jsx("button",{type:"submit",className:"login-button",disabled:h,children:a.jsx("span",{children:h?"Entrando…":"Entrar"})})]}),a.jsxs("div",{className:"support-link",children:[a.jsxs("p",{children:[a.jsx("span",{children:"Esqueceu o código de ativação?"}),a.jsx("a",{href:"/faq",children:"Clique aqui"})]}),a.jsx("p",{children:a.jsx("span",{children:"Problemas com a ativação? Use o chat de suporte abaixo"})})]})]}),a.jsxs("div",{className:"login-footer-bottom",children:[a.jsxs("div",{style:{marginBottom:"10px"},children:[a.jsx("a",{href:"/legal/terms.html",target:"_blank",rel:"noreferrer",children:"Termos de Serviço"}),a.jsx("span",{style:{opacity:.5},children:"|"}),a.jsx("a",{href:"/legal/privacy.html",target:"_blank",rel:"noreferrer",children:"Política de Privacidade"})]}),a.jsx("div",{children:"© 2026. Todos os direitos reservados."})]})]})]})}function ve({open:e,title:t,onClose:n,children:r}){return e?a.jsx("div",{className:"modal-overlay",onClick:l=>{l.target===l.currentTarget&&n()},children:a.jsxs("div",{className:"modal-content",children:[a.jsx("button",{className:"modal-close",onClick:n,children:"✕"}),t&&a.jsx("h2",{children:t}),r]})}):null}const bh=["Clickbank","Hotmart","Digistore24","Kiify","Cakto","Outro"],Po={nome:"",plataforma:"Clickbank",link_afiliado:"",comissao:"",preco:"",nicho:""};function $h(e){if(!e)return"—";const[t]=e.split(" "),[n,r,l]=t.split("-");return n?`${l}/${r}/${n.slice(2)}`:e}function od(e){if(!(e!=null&&e.analysis))return null;if(typeof e.analysis=="string")try{return JSON.parse(e.analysis)}catch{return null}return e.analysis}function Fh({produto:e,onClose:t}){const n=od(e);if(!n)return null;const r=n.analise||n;return a.jsxs(ve,{open:!0,title:`🧠 Análise — ${e.nome}`,onClose:t,children:[r.resumo&&a.jsxs("p",{style:{fontSize:"14px",marginBottom:"14px"},children:[a.jsx("strong",{children:"Resumo:"})," ",r.resumo]}),Array.isArray(r.angulos_copy)&&a.jsxs("div",{style:{marginBottom:"12px"},children:[a.jsx("strong",{style:{fontSize:"13px"},children:"Ângulos de copy"}),a.jsx("ul",{className:"placeholder-list",children:r.angulos_copy.map((l,s)=>a.jsx("li",{children:l},s))})]}),Array.isArray(r.palavras_chave)&&a.jsxs("div",{style:{marginBottom:"12px"},children:[a.jsx("strong",{style:{fontSize:"13px"},children:"Palavras-chave sugeridas"}),a.jsx("ul",{className:"placeholder-list",children:r.palavras_chave.map((l,s)=>a.jsx("li",{children:l},s))})]}),Array.isArray(r.negativas_sugeridas)&&a.jsxs("div",{style:{marginBottom:"12px"},children:[a.jsx("strong",{style:{fontSize:"13px"},children:"Negativas sugeridas"}),a.jsx("ul",{className:"placeholder-list",children:r.negativas_sugeridas.map((l,s)=>a.jsx("li",{children:l},s))})]}),r.brief_presell&&a.jsxs("div",{style:{marginBottom:"12px"},children:[a.jsx("strong",{style:{fontSize:"13px"},children:"Brief da presell"}),a.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginTop:"6px"},children:r.brief_presell})]}),r.publico&&a.jsxs("div",{children:[a.jsx("strong",{style:{fontSize:"13px"},children:"Público"}),a.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginTop:"6px"},children:r.publico})]}),a.jsxs("p",{className:"placeholder-note",children:["Análise gerada por: ",n.provider||"IA"]})]})}function Mh(){const e=Re(),{toast:t}=ie(),[n,r]=f.useState([]),[l,s]=f.useState(!0),[i,u]=f.useState(""),[o,c]=f.useState("em_analise"),[v,g]=f.useState(""),[h,S]=f.useState(!1),[y,k]=f.useState(null),[N,x]=f.useState(Po),[d,p]=f.useState(!1),[j,C]=f.useState(null),[A,E]=f.useState(null),P=f.useCallback(async()=>{s(!0),u("");try{r(await z.produtos())}catch(T){u(T.message||"Falha ao carregar produtos.")}finally{s(!1)}},[]);f.useEffect(()=>{P()},[P]);const m=f.useMemo(()=>{const T=v.trim().toLowerCase();return n.filter(M=>M.status===o&&(!T||M.nome.toLowerCase().includes(T)||(M.nicho||"").toLowerCase().includes(T)))},[n,o,v]),w=()=>{k(null),x(Po),S(!0)},D=T=>{k(T),x({nome:T.nome||"",plataforma:T.plataforma||"Outro",link_afiliado:T.link_afiliado||"",comissao:T.comissao??"",preco:T.preco??"",nicho:T.nicho||""}),S(!0)},U=async T=>{T.preventDefault(),p(!0);try{const M={nome:N.nome,plataforma:N.plataforma,link_afiliado:N.link_afiliado,comissao:Number(N.comissao)||0,preco:Number(N.preco)||0,nicho:N.nicho};y?(await z.updateProduto(y.id,M),t("Produto atualizado!")):(await z.createProduto(M),t("Produto adicionado — em análise!")),S(!1),await P()}catch(M){t(M.message||"Falha ao salvar o produto.")}finally{p(!1)}},W=async T=>{E(T.id);try{const M=await z.aprovarProduto(T.id);t(`"${T.nome}" aprovado!`),await P(),M.analysis?C(M):M.analysis_error&&t(`Análise IA indisponível: ${M.analysis_error}`)}catch(M){t(M.message||"Falha ao aprovar.")}finally{E(null)}},xe=async T=>{E(T.id);try{const M=await z.analisarProduto(T.id);t("Análise gerada!"),await P(),C(M)}catch(M){t(M.message||"Falha na análise.")}finally{E(null)}},_e=async T=>{if(window.confirm(`Excluir o produto "${T.nome}"?`))try{await z.deleteProduto(T.id),t("Produto excluído."),await P()}catch(M){t(M.message||"Falha ao excluir.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"Seus Produtos"}),a.jsx("p",{className:"subtitle",children:"Analise, aprove e anuncie seus produtos."}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[a.jsx("input",{type:"text",placeholder:"Produto...",value:v,onChange:T=>g(T.target.value),style:{padding:"10px",width:"300px",border:"1px solid var(--border)",borderRadius:"6px",background:"var(--input-bg)",color:"var(--text-main)",outline:"none"}}),a.jsx("button",{className:"btn-primary",onClick:w,children:"+ Adicionar produto"})]}),a.jsxs("div",{className:"tabs",children:[a.jsx("div",{className:`tab ${o==="em_analise"?"active":""}`,onClick:()=>c("em_analise"),children:"🔍 Em Análise"}),a.jsx("div",{className:`tab ${o==="aprovado"?"active":""}`,onClick:()=>c("aprovado"),children:"✓ Aprovados"})]}),i&&a.jsx("div",{className:"login-error",children:i}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Atualizado"}),a.jsx("th",{children:"Produto"}),a.jsx("th",{children:"Plataforma"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:l?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:4,children:"Carregando…"})}):m.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:4,children:o==="em_analise"?"Nenhum produto em análise. Clique em “+ Adicionar produto” para começar.":"Nenhum produto aprovado ainda. Aprove um produto na aba “Em Análise”."})}):m.map(T=>a.jsxs("tr",{children:[a.jsx("td",{children:$h(T.updated_at)}),a.jsxs("td",{children:[T.nome,T.nicho?a.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",T.nicho]}):null]}),a.jsx("td",{children:T.plataforma}),a.jsx("td",{className:"action-icons",children:T.status==="em_analise"?a.jsxs(a.Fragment,{children:[a.jsx("span",{title:"Editar",onClick:()=>D(T),children:"✏️"}),a.jsx("span",{title:"AdsWords (palavras-chave)",onClick:()=>e("/adswords"),children:"✈️ AdsWord"}),a.jsx("span",{title:A===T.id?"Aprovando (análise IA se LLM ativo)…":"Aprovar",onClick:()=>W(T),children:A===T.id?"⏳":"✓ Aprovar"})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{title:"AdsPages (criar presell)",onClick:()=>e("/adspages"),children:"🛡️ AdsPages"}),a.jsx("span",{title:"AdsCreator (criar campanha)",onClick:()=>e("/adscreator"),children:"🎯 AdsCreator"}),a.jsx("span",{title:"AdsWords (palavras-chave)",onClick:()=>e("/adswords"),children:"✈️ AdsWord"}),od(T)?a.jsx("span",{title:"Ver análise IA",onClick:()=>C(T),children:"🧠"}):a.jsx("span",{title:A===T.id?"Analisando com IA…":"Gerar análise IA",onClick:()=>xe(T),children:A===T.id?"⏳":"🔬"}),a.jsx("span",{title:"Excluir",onClick:()=>_e(T),children:"🗑️"})]})})]},T.id))})]}),a.jsx(ve,{open:h,title:y?"Editar Produto":"Adicionar Produto",onClose:()=>S(!1),children:a.jsxs("form",{onSubmit:U,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Nome do produto"}),a.jsx("input",{required:!0,value:N.nome,onChange:T=>x({...N,nome:T.target.value}),placeholder:"Ex.: Prodentim"})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Plataforma"}),a.jsx("select",{value:N.plataforma,onChange:T=>x({...N,plataforma:T.target.value}),children:bh.map(T=>a.jsx("option",{value:T,children:T},T))})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Nicho"}),a.jsx("input",{value:N.nicho,onChange:T=>x({...N,nicho:T.target.value}),placeholder:"Ex.: saúde"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Link de afiliado / checkout"}),a.jsx("input",{value:N.link_afiliado,onChange:T=>x({...N,link_afiliado:T.target.value}),placeholder:"https://..."})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Comissão (R$)"}),a.jsx("input",{type:"number",step:"0.01",min:"0",value:N.comissao,onChange:T=>x({...N,comissao:T.target.value})})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Preço (R$)"}),a.jsx("input",{type:"number",step:"0.01",min:"0",value:N.preco,onChange:T=>x({...N,preco:T.target.value})})]})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:d,style:{width:"100%",marginTop:"10px"},children:d?"Salvando…":y?"Salvar alterações":"Salvar"})]})}),a.jsx(Fh,{produto:j,onClose:()=>C(null)})]})}function Ot(e){return(Number(e)||0).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}function Bh(){const{toast:e}=ie(),t=Re(),[n,r]=f.useState(null),[l,s]=f.useState(null),[i,u]=f.useState([]),[o,c]=f.useState(!0),[v,g]=f.useState(""),[h,S]=f.useState(""),[y,k]=f.useState(!1),N=f.useCallback(async()=>{c(!0);try{const[p,j]=await Promise.all([z.dashboard(),z.investimentos()]);r(p),s(j.resumo),u(j.registros)}catch(p){e(p.message||"Falha ao carregar o dashboard.")}finally{c(!1)}},[e]);f.useEffect(()=>{N()},[N]);const x=async p=>{if(p.preventDefault(),!!Number(v)){k(!0);try{await z.registrarInvestimento({valor:Number(v),data:h}),g(""),S(""),e("Investimento registrado!"),await N()}catch(j){e(j.message||"Falha ao registrar investimento.")}finally{k(!1)}}},d=async p=>{try{await z.removerInvestimento(p.id),await N()}catch(j){e(j.message||"Falha ao remover.")}};return o&&!n?a.jsx("div",{className:"loading-screen",children:"Carregando…"}):n?a.jsxs("section",{children:[a.jsx("h1",{children:"AdsDashboard"}),a.jsx("p",{className:"subtitle",children:"Tenha uma visão completa da sua operação — dados reais dos seus módulos."}),n.progresso&&n.progresso.status==="em_andamento"&&a.jsxs("div",{className:"form-card",style:{border:"1px solid var(--primary)"},children:[a.jsxs("div",{className:"flex-between",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[a.jsxs("strong",{children:["🤖 Lançamento em andamento — etapa ",n.progresso.etapa," de ",n.progresso.total]}),a.jsx("button",{className:"btn-outline",style:{fontSize:"11px",padding:"6px 12px"},onClick:()=>t("/adsbot"),children:"Continuar no AdsBot →"})]}),a.jsx("div",{className:"funnel-step-bar",style:{height:"12px"},children:a.jsx("div",{style:{width:`${n.progresso.percentual}%`,background:"var(--primary)",height:"100%",borderRadius:"4px"}})}),a.jsxs("p",{className:"placeholder-note",style:{marginTop:"8px"},children:["Faltam ",n.progresso.faltam," passo(s) para o Relatório de Lançamento."]})]}),a.jsxs("div",{className:"metrics-grid",children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Conversões (vendas)"}),a.jsx("div",{className:"value",children:n.vendas.total})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Receita"}),a.jsx("div",{className:"value green",children:Ot(n.vendas.receita)})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Comissão"}),a.jsx("div",{className:"value purple",children:Ot(n.vendas.comissao)})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Visitas rastreadas"}),a.jsx("div",{className:"value",children:n.tracking.visitas})]})]}),a.jsxs("div",{className:"metrics-grid",children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Investimento em tráfego"}),a.jsx("div",{className:"value",children:Ot((l==null?void 0:l.investimento)??0)})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"ROAS (Receita ÷ Investimento)"}),a.jsx("div",{className:l!=null&&l.tem_investimento?"value green":"value",style:{color:l!=null&&l.tem_investimento&&((l==null?void 0:l.roas)??0)>=2?void 0:l!=null&&l.tem_investimento&&((l==null?void 0:l.roas)??0)<1?"var(--danger)":void 0},children:l!=null&&l.tem_investimento?`${l.roas}x`:"—"})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Lucro Líquido"}),a.jsx("div",{className:((l==null?void 0:l.lucro_liquido)??0)>=0?"value green":"value",style:((l==null?void 0:l.lucro_liquido)??0)>=0?{}:{color:"var(--danger)"},children:Ot((l==null?void 0:l.lucro_liquido)??0)})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Lance diário (média)"}),a.jsx("div",{className:"value",children:"—"})]})]}),a.jsxs("div",{className:"form-card",children:[a.jsx("h3",{style:{fontSize:"15px",marginBottom:"12px"},children:"📥 Registrar investimento em tráfego (gasto do dia)"}),a.jsxs("form",{onSubmit:x,style:{display:"flex",gap:"10px",flexWrap:"wrap",alignItems:"flex-end"},children:[a.jsxs("div",{className:"form-group",style:{marginBottom:0,width:"160px"},children:[a.jsx("label",{children:"Valor gasto (R$)"}),a.jsx("input",{type:"number",step:"0.01",min:"0",required:!0,value:v,onChange:p=>g(p.target.value),placeholder:"Ex.: 120.00"})]}),a.jsxs("div",{className:"form-group",style:{marginBottom:0,width:"160px"},children:[a.jsx("label",{children:"Data (opcional)"}),a.jsx("input",{type:"date",value:h,onChange:p=>S(p.target.value)})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:y,children:y?"Salvando…":"Registrar"})]}),i.length>0&&a.jsxs("table",{style:{marginTop:"16px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Valor"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:i.slice(0,8).map(p=>{var j;return a.jsxs("tr",{children:[a.jsx("td",{children:p.data||((j=p.created_at)==null?void 0:j.slice(0,10))}),a.jsx("td",{children:Ot(p.valor)}),a.jsx("td",{className:"action-icons",children:a.jsx("span",{title:"Remover",onClick:()=>d(p),children:"🗑️"})})]},p.id)})})]}),a.jsxs("p",{className:"placeholder-note",style:{marginTop:"10px"},children:["ROAS = Receita ÷ Investimento · Lucro Líquido = Receita − Investimento.",l!=null&&l.comissao?` Comissão acumulada: ${Ot(l.comissao)}.`:""]})]}),a.jsxs("div",{className:"metrics-grid",children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Produtos"}),a.jsx("div",{className:"value",children:n.produtos.total}),a.jsxs("p",{style:{fontSize:"11px",color:"var(--text-muted)"},children:[n.produtos.aprovados," aprovados · ",n.produtos.em_analise," em análise"]})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Páginas"}),a.jsx("div",{className:"value",children:n.paginas.total}),a.jsxs("p",{style:{fontSize:"11px",color:"var(--text-muted)"},children:[n.paginas.publicadas," publicadas · ",n.paginas.rascunho," rascunho"]})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Campanhas"}),a.jsx("div",{className:"value",children:n.campanhas.total}),a.jsxs("p",{style:{fontSize:"11px",color:"var(--text-muted)"},children:[n.campanhas.publicadas," publicadas · ",n.campanhas.erro," com erro"]})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Infoprodutos"}),a.jsx("div",{className:"value",children:n.infoprodutos.total}),a.jsxs("p",{style:{fontSize:"11px",color:"var(--text-muted)"},children:[n.tracking.conversoes_pendentes," conversão(ões) GCLID pendente(s)"]})]})]}),a.jsxs("div",{className:"bottom-grid",children:[a.jsxs("div",{className:"traffic-flow-card",children:[a.jsx("h3",{children:"💸 Últimas vendas"}),n.ultimas_vendas.length===0?a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)",marginTop:"12px"},children:"Nenhuma venda registrada ainda."}):a.jsxs("table",{style:{marginTop:"12px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Produto"}),a.jsx("th",{children:"Fonte"}),a.jsx("th",{children:"Valor"})]})}),a.jsx("tbody",{children:n.ultimas_vendas.map(p=>{var j;return a.jsxs("tr",{children:[a.jsx("td",{children:(j=p.created_at)==null?void 0:j.slice(0,10)}),a.jsx("td",{children:p.produto_nome||`#${p.id}`}),a.jsx("td",{children:p.fonte}),a.jsx("td",{children:Ot(p.valor)})]},p.id)})})]})]}),a.jsxs("div",{className:"funnel-card",children:[a.jsx("h3",{children:"📄 Últimas páginas"}),n.ultimas_paginas.length===0?a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)",marginTop:"12px"},children:"Nenhuma página criada ainda."}):a.jsx("ul",{className:"placeholder-list",style:{marginTop:"12px"},children:n.ultimas_paginas.map(p=>a.jsxs("li",{children:[p.titulo," — ",p.status==="publicada"?"✅ publicada":"📝 rascunho"]},p.id))}),a.jsx("button",{className:"btn-primary",style:{width:"100%",marginTop:"16px"},onClick:()=>t("/adsbot"),children:"🤖 Novo Lançamento (AdsBot)"})]})]})]}):null}const Uh={nvidia:{kind:"openai",base_url:"https://integrate.api.nvidia.com/v1",model:""},gemini:{kind:"gemini",base_url:"",model:"gemini-2.5-flash"}},Vh=[{id:"tracking",emoji:"🎯",name:"Pixel de Rastreamento",fields:[{key:"pixel_url",label:"URL pública do /track (túnel ou domínio)",placeholder:"https://meu-tunel.exemplo.com/track"}]},{id:"gamma",emoji:"🎨",name:"Gamma AI",fields:[{key:"api_key",label:"API Key",secret:!0},{key:"base_url",label:"Base URL",placeholder:"https://api.app.gamma"}]},{id:"github",emoji:"🐙",name:"GitHub",fields:[{key:"token",label:"Token (PAT)",secret:!0},{key:"repo",label:"Repositório de páginas (opcional)",placeholder:"usuario/prodmaker-pages"}]},{id:"cloudflare",emoji:"☁️",name:"Cloudflare",fields:[{key:"api_token",label:"API Token",secret:!0},{key:"account_id",label:"Account ID"}]},{id:"telegram",emoji:"✈️",name:"Telegram",fields:[{key:"bot_token",label:"Bot Token",secret:!0},{key:"chat_id",label:"Chat ID"}]},{id:"pinterest",emoji:"📌",name:"Pinterest",fields:[{key:"email",label:"E-mail"},{key:"password",label:"Senha",secret:!0},{key:"board",label:"Board padrão"}]},{id:"google-ads",emoji:"🎯",name:"Google Ads",fields:[{key:"developer_token",label:"Developer Token",secret:!0},{key:"client_id",label:"OAuth Client ID"},{key:"client_secret",label:"OAuth Client Secret",secret:!0},{key:"refresh_token",label:"Refresh Token",secret:!0},{key:"customer_id",label:"Customer ID (XXX-XXX-XXXX)"},{key:"conversion_action",label:"Conversion Action (recurso)",placeholder:"customers/123/conversionActions/456"},{key:"api_version",label:"Versão da API",placeholder:"v22"}]},{id:"meta",emoji:"👥",name:"Meta Ads",fields:[{key:"app_id",label:"App ID"},{key:"app_secret",label:"App Secret",secret:!0},{key:"access_token",label:"Access Token (sistema)",secret:!0},{key:"ad_account_id",label:"Ad Account ID (act_...)"}]},{id:"tiktok",emoji:"🎵",name:"TikTok Ads",fields:[{key:"app_id",label:"App ID"},{key:"app_secret",label:"App Secret",secret:!0},{key:"access_token",label:"Access Token",secret:!0},{key:"advertiser_id",label:"Advertiser ID"}]},{id:"canva",emoji:"🖼️",name:"Canva (MCP)",soon:!0}];function Wh(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState({}),[s,i]=f.useState(null),[u,o]=f.useState({}),[c,v]=f.useState(null),[g,h]=f.useState(!1),[S,y]=f.useState(!1),k=f.useCallback(async()=>{try{const[m,w]=await Promise.all([z.llmProviders(),z.settings()]);n(m),l(w.api_keys||{})}catch(m){e(m.message||"Falha ao carregar configurações.")}},[e]);f.useEffect(()=>{k()},[k]);const N=m=>t.find(w=>w.id===m),x=m=>{const w=N(m)||{id:m,...Uh[m],api_key:"",priority:m==="nvidia"?1:2,active:!1};o({...w}),v(null),i(m)},d=m=>{o({...r[m.id]||{}}),v(null),i(m)},p=async()=>{y(!0);try{const m=t.filter(D=>D.id!==u.id);m.push({id:u.id,kind:u.kind,api_key:(u.api_key||"").trim(),base_url:(u.base_url||"").trim(),model:(u.model||"").trim(),priority:Number(u.priority)||99,active:!!u.active}),m.sort((D,U)=>(D.priority||99)-(U.priority||99));const w=(await z.llmProviders,null);await j(m),e(`Cartão ${u.id} salvo!`),i(null),await k()}catch(m){e(m.message||"Falha ao salvar.")}finally{y(!1)}},j=async m=>{await fetch("/api/llm/providers",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({providers:m})}).then(async w=>{if(!w.ok){const D=await w.json().catch(()=>({}));throw new Error(D.detail||`Erro ${w.status}`)}})},C=async m=>{y(!0);try{const w=await z.settings();w.api_keys={...w.api_keys||{},[m.id]:u},await z.saveSettings(w),e(`Cartão ${m.name} salvo!`),i(null),await k()}catch(w){e(w.message||"Falha ao salvar.")}finally{y(!1)}},A=async()=>{h(!0),v(null);try{const m=await z.llmTest(u.id);v({ok:!0,text:`OK — ${m.model||"modelo"} respondeu em ${m.latency_ms} ms`})}catch(m){v({ok:!1,text:m.message||"Falha no teste."})}finally{h(!1)}},E=m=>{const w=N(m);return!!(w&&w.active&&w.api_key)},P=(m,w)=>{const D=r[m]||{};return w.some(U=>(D[U.key]||"").trim())};return a.jsxs("section",{children:[a.jsx("h1",{children:"🔌 Chaves de API"}),a.jsx("p",{className:"subtitle",children:"Integrações do ProdMaker. As chaves ficam apenas no seu storage local — nunca no GitHub."}),a.jsx("h3",{style:{fontSize:"15px",margin:"24px 0 8px"},children:"🤖 Provedores LLM (pool com prioridade e failover)"}),a.jsx("div",{className:"api-grid",children:[{id:"nvidia",emoji:"🤖",name:"NVIDIA NIM"},{id:"gemini",emoji:"✨",name:"Gemini"}].map(m=>a.jsxs("div",{className:"api-card",onClick:()=>x(m.id),children:[a.jsxs("div",{className:"api-logo",children:[m.emoji," ",m.name]}),a.jsx("div",{className:"api-status",style:{color:E(m.id)?"var(--success)":"var(--text-muted)"},children:E(m.id)?"Configurado":"Não configurado"})]},m.id))}),a.jsx("h3",{style:{fontSize:"15px",margin:"28px 0 8px"},children:"🔌 Demais integrações"}),a.jsx("div",{className:"api-grid",children:Vh.map(m=>a.jsxs("div",{className:"api-card",style:m.soon?{opacity:.55,cursor:"default"}:{},onClick:()=>!m.soon&&d(m),title:m.soon?"Em breve":"Configurar",children:[a.jsxs("div",{className:"api-logo",children:[m.emoji," ",m.name]}),a.jsx("div",{className:"api-status",style:{color:P(m.id,m.fields||[])?"var(--success)":"var(--text-muted)"},children:m.soon?"Em breve":P(m.id,m.fields)?"Configurado":"Não configurado"})]},m.id))}),a.jsx(ve,{open:s==="nvidia"||s==="gemini",title:`Provedor LLM — ${s}`,onClose:()=>i(null),children:["nvidia","gemini"].includes(s)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"API Key"}),a.jsx("input",{type:"password",value:u.api_key||"",onChange:m=>o({...u,api_key:m.target.value}),placeholder:s==="nvidia"?"nvapi-...":"AIza..."})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Modelo"}),a.jsx("input",{value:u.model||"",onChange:m=>o({...u,model:m.target.value}),placeholder:s==="nvidia"?"ex.: nvidia/nemotron-...":"gemini-2.5-flash"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Prioridade (1 = primeiro)"}),a.jsx("input",{type:"number",min:"1",value:u.priority??2,onChange:m=>o({...u,priority:m.target.value})})]})]}),s==="nvidia"&&a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Base URL (compatível OpenAI)"}),a.jsx("input",{value:u.base_url||"",onChange:m=>o({...u,base_url:m.target.value}),placeholder:"https://integrate.api.nvidia.com/v1"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontWeight:600,marginBottom:"16px"},children:[a.jsx("input",{type:"checkbox",checked:!!u.active,onChange:m=>o({...u,active:m.target.checked}),style:{width:"auto"}}),"Ativo (participa do pool)"]}),c&&a.jsxs("div",{className:c.ok?"api-status":"login-error",style:{marginBottom:"12px",fontWeight:600},children:[c.ok?"✅":"❌"," ",c.text]}),a.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"10px"},children:[a.jsx("button",{className:"btn-outline",onClick:A,disabled:g||!(u.api_key||"").trim(),children:g?"Testando…":"Testar chamada"}),a.jsx("button",{className:"btn-primary",onClick:p,disabled:S,children:S?"Salvando…":"Salvar"})]})]})}),a.jsx(ve,{open:!!(s&&s.fields),title:`${(s==null?void 0:s.emoji)||""} ${(s==null?void 0:s.name)||""}`,onClose:()=>i(null),children:(s==null?void 0:s.fields)&&a.jsxs(a.Fragment,{children:[s.fields.map(m=>a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:m.label}),a.jsx("input",{type:m.secret?"password":"text",value:u[m.key]||"",onChange:w=>o({...u,[m.key]:w.target.value}),placeholder:m.placeholder||""})]},m.key)),a.jsx("div",{style:{display:"flex",gap:"10px",marginTop:"10px"},children:a.jsx("button",{className:"btn-primary",onClick:()=>C(s),disabled:S,children:S?"Salvando…":"Salvar"})})]})})]})}const Hh=["E-book","Planilha","Mini-curso","Desafio","Workshop"],Gh={titulo:"",prompt:"",formato:"E-book",nicho:"",dor:"",avatar:"",resultado:"",modo:"rapido"};function Qh(){const{toast:e}=ie(),t=Re(),[n,r]=f.useState(Gh),[l,s]=f.useState(!1),[i,u]=f.useState(""),[o,c]=f.useState(null),v=h=>S=>r({...n,[h]:S.target.value}),g=async h=>{h.preventDefault(),u(""),s(!0),c(null);try{const S=await z.createInfoproduto(n);c(S),e(`Infoproduto "${S.titulo}" gerado!`)}catch(S){u(S.message||"Falha ao gerar o infoproduto.")}finally{s(!1)}};return a.jsxs("section",{children:[a.jsx("h1",{children:"📖 Criar Infoproduto"}),a.jsx("p",{className:"subtitle",children:"Gere e-books, planilhas e mini-cursos em PDF com IA — Modo Rápido (LLM + PDF local) ou Premium (Gamma AI)."}),a.jsxs("div",{className:"form-card",children:[a.jsxs("form",{onSubmit:g,children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Modo"}),a.jsxs("select",{value:n.modo,onChange:v("modo"),children:[a.jsx("option",{value:"rapido",children:"⚡ Modo Rápido (open source — LLM + PDF local)"}),a.jsx("option",{value:"gamma",children:"🎨 Modo Premium (Gamma AI)"}),a.jsx("option",{value:"canva",disabled:!0,children:"🖼️ Modo Canva (MCP — em breve)"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Formato"}),a.jsx("select",{value:n.formato,onChange:v("formato"),children:Hh.map(h=>a.jsx("option",{value:h,children:h},h))})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Título desejado (máx. 6 palavras)"}),a.jsx("input",{required:!0,value:n.titulo,onChange:v("titulo"),placeholder:"Ex.: Cardápio 7 Dias: Receitas para Secar"})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Nicho"}),a.jsx("input",{value:n.nicho,onChange:v("nicho"),placeholder:"Ex.: emagrecimento"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Dor específica"}),a.jsx("input",{value:n.dor,onChange:v("dor"),placeholder:"Ex.: passar fome para emagrecer"})]})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Avatar (público-alvo)"}),a.jsx("input",{value:n.avatar,onChange:v("avatar"),placeholder:"Ex.: mulheres 30-50 que trabalham fora"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Resultado prometido"}),a.jsx("input",{value:n.resultado,onChange:v("resultado"),placeholder:"Ex.: secar em 7 dias sem passar fome"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Prompt / instruções adicionais"}),a.jsx("textarea",{rows:4,value:n.prompt,onChange:v("prompt"),placeholder:"Descreva o conteúdo desejado, tom, quantidade de páginas, bônus..."})]}),i&&a.jsxs("div",{className:"login-error",children:[i,/Chaves de API|provedor/i.test(i)&&a.jsxs(a.Fragment,{children:[" — configure em ",a.jsx("a",{href:"/api-keys",onClick:h=>{h.preventDefault(),t("/api-keys")},children:"Chaves de API"}),"."]})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:l,style:{width:"100%",marginTop:"10px"},children:l?n.modo==="gamma"?"🎨 Gerando na Gamma AI…":"✨ Gerando com IA…":"✨ Gerar Infoproduto"})]}),l&&a.jsx("p",{className:"placeholder-note",style:{marginTop:"12px"},children:"⏳ A geração usa o pool de LLM configurado e pode levar de 30 segundos a alguns minutos. Aguarde…"}),o&&a.jsxs("div",{className:"form-card",style:{marginTop:"20px",border:"1px solid var(--primary)",background:"var(--primary-light)"},children:[a.jsx("h3",{style:{marginBottom:"6px"},children:"✅ Infoproduto pronto!"}),a.jsxs("p",{style:{fontSize:"14px",marginBottom:"12px"},children:[a.jsx("strong",{children:o.titulo})," · ",o.formato," · provedor: ",o.provider]}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("a",{className:"btn-primary",style:{textDecoration:"none"},href:`/api/infoprodutos/${o.id}/download`,children:"⬇️ Baixar PDF"}),a.jsx("button",{className:"btn-outline",onClick:()=>t("/studio/biblioteca"),children:"Abrir Biblioteca"})]})]})]})]})}function qh(e){if(!e)return"—";const[t]=e.split(" "),[n,r,l]=t.split("-");return n?`${l}/${r}/${n.slice(2)}`:e}function Kh(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(!0),[s,i]=f.useState(null),[u,o]=f.useState(!1),c=f.useCallback(async()=>{l(!0);try{n(await z.infoprodutos())}catch(h){e(h.message||"Falha ao carregar a biblioteca.")}finally{l(!1)}},[e]);f.useEffect(()=>{c()},[c]);const v=async h=>{o(!0),i({titulo:h.titulo,markdown:""});try{const S=await z.infoprodutoMarkdown(h.id);i({titulo:h.titulo,markdown:S.markdown})}catch(S){i(null),e(S.message||"Markdown indisponível para este item.")}finally{o(!1)}},g=async h=>{if(window.confirm(`Excluir o infoproduto "${h.titulo}"?`))try{await z.deleteInfoproduto(h.id),e("Infoproduto excluído."),await c()}catch(S){e(S.message||"Falha ao excluir.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"📚 Biblioteca de Infoprodutos"}),a.jsx("p",{className:"subtitle",children:"Seus infoprodutos gerados — download do PDF e visualização do conteúdo."}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Criado"}),a.jsx("th",{children:"Título"}),a.jsx("th",{children:"Formato"}),a.jsx("th",{children:"Modo"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:r?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:5,children:"Carregando…"})}):t.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:5,children:"Nenhum infoproduto ainda. Gere o primeiro em “Criar Infoproduto”."})}):t.map(h=>a.jsxs("tr",{children:[a.jsx("td",{children:qh(h.created_at)}),a.jsxs("td",{children:[h.titulo,h.nicho?a.jsxs("span",{style:{color:"var(--text-muted)"},children:[" · ",h.nicho]}):null]}),a.jsx("td",{children:h.formato}),a.jsx("td",{children:h.modo==="gamma"?"🎨 Premium":"⚡ Rápido"}),a.jsxs("td",{className:"action-icons",children:[a.jsx("a",{href:`/api/infoprodutos/${h.id}/download`,title:"Baixar PDF",style:{color:"inherit",textDecoration:"none"},children:"⬇️ PDF"}),h.md_path&&a.jsx("span",{title:"Ver conteúdo",onClick:()=>v(h),children:"👁️"}),a.jsx("span",{title:"Excluir",onClick:()=>g(h),children:"🗑️"})]})]},h.id))})]}),a.jsx(ve,{open:!!s,title:`Conteúdo — ${(s==null?void 0:s.titulo)||""}`,onClose:()=>i(null),children:u?a.jsx("p",{className:"placeholder-note",children:"Carregando…"}):a.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit",fontSize:"14px",lineHeight:1.6,color:"var(--text-main)"},children:s==null?void 0:s.markdown})})]})}const Jh=["Português","Inglês","Espanhol"],Xh=[{value:"presell",label:"🛡️ Pre-Sell (afiliado)"},{value:"vendas",label:"💸 Página de Vendas (12 seções — produto próprio)"},{value:"clone",label:"🧬 Clonar página (higienizada)"}],Yh={tipo:"presell",produto_id:"",titulo:"",idioma:"Português",afiliado_link:"",checkout_link:"",avatar:"",resultado:"",tempo:"",dor:"",prompt:"",clone_url:""};function Zh(){const{toast:e}=ie(),t=Re(),[n,r]=f.useState([]),[l,s]=f.useState(Yh),[i,u]=f.useState(!1),[o,c]=f.useState(""),[v,g]=f.useState(null),[h,S]=f.useState(null),[y,k]=f.useState(""),[N,x]=f.useState(!1),d=f.useCallback(async()=>{try{r(await z.produtos())}catch{}},[]);f.useEffect(()=>{d()},[d]);const p=m=>w=>s({...l,[m]:w.target.value}),j=m=>{const w=m.target.value,D=n.find(U=>String(U.id)===String(w));s({...l,produto_id:w,titulo:D&&!l.titulo?`Presell — ${D.nome}`:l.titulo,afiliado_link:(D==null?void 0:D.link_afiliado)||l.afiliado_link,dor:(D==null?void 0:D.nicho)||l.dor})},C=async m=>{m.preventDefault(),c(""),u(!0),g(null);try{const w={...l,produto_id:l.produto_id?Number(l.produto_id):null},D=await z.createPagina(w);g(D),e(`Página "${D.titulo}" criada!`)}catch(w){c(w.message||"Falha ao criar a página.")}finally{u(!1)}},A=async m=>{try{const w=await z.paginaHtml(m.id);k(w.html),S({id:m.id,titulo:m.titulo})}catch(w){e(w.message||"HTML não encontrado.")}},E=async()=>{x(!0);try{await z.updatePaginaHtml(h.id,y),e("HTML atualizado!"),S(null)}catch(m){e(m.message||"Falha ao salvar o HTML.")}finally{x(!1)}},P=l.tipo==="clone";return a.jsxs("section",{children:[a.jsx("h1",{children:"🛡️ AdsPages"}),a.jsx("p",{className:"subtitle",children:"Crie e hospede presells nativas e páginas de vendas — HTML único, mobile-first, com pixel embutido."}),a.jsxs("div",{className:"form-card",children:[a.jsxs("form",{onSubmit:C,children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Tipo de página"}),a.jsx("select",{value:l.tipo,onChange:p("tipo"),children:Xh.map(m=>a.jsx("option",{value:m.value,children:m.label},m.value))})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Idioma"}),a.jsx("select",{value:l.idioma,onChange:p("idioma"),children:Jh.map(m=>a.jsx("option",{value:m,children:m},m))})]})]}),!P&&a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Produto (preenche automaticamente)"}),a.jsxs("select",{value:l.produto_id,onChange:j,children:[a.jsx("option",{value:"",children:"— sem produto vinculado —"}),n.map(m=>a.jsx("option",{value:m.id,children:m.nome},m.id))]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Título da página"}),a.jsx("input",{required:!0,value:l.titulo,onChange:p("titulo"),placeholder:"Ex.: Prodentim — Vale a pena?"})]})]}),P&&a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"URL para clonar"}),a.jsx("input",{required:!0,type:"url",value:l.clone_url,onChange:p("clone_url"),placeholder:"https://concorrente.com/oferta"}),a.jsx("p",{className:"placeholder-note",style:{marginTop:"6px"},children:"O clone remove scripts, iframes e pixels do original antes de salvar."})]}),!P&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Link de afiliado (CTA)"}),a.jsx("input",{value:l.afiliado_link,onChange:p("afiliado_link"),placeholder:"https://hop.clickbank.net/..."})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Link de checkout (se diferente)"}),a.jsx("input",{value:l.checkout_link,onChange:p("checkout_link"),placeholder:"https://checkout..."})]})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Avatar"}),a.jsx("input",{value:l.avatar,onChange:p("avatar"),placeholder:"Ex.: homens 40+ com dor nas costas"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Resultado prometido"}),a.jsx("input",{value:l.resultado,onChange:p("resultado"),placeholder:"Ex.: alívio em 7 dias"})]})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Tempo (para a promessa)"}),a.jsx("input",{value:l.tempo,onChange:p("tempo"),placeholder:"Ex.: 7 dias"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Dor principal"}),a.jsx("input",{value:l.dor,onChange:p("dor"),placeholder:"Ex.: passar fome"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Instruções adicionais (prompt)"}),a.jsx("textarea",{rows:3,value:l.prompt,onChange:p("prompt"),placeholder:"Tom, cores, urgência, bônus..."})]})]}),o&&a.jsxs("div",{className:"login-error",children:[o,/Chaves de API|provedor/i.test(o)&&a.jsxs(a.Fragment,{children:[" — configure em ",a.jsx("a",{href:"/api-keys",onClick:m=>{m.preventDefault(),t("/api-keys")},children:"Chaves de API"}),"."]})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:i,style:{width:"100%",marginTop:"10px"},children:i?P?"🧬 Clonando e higienizando…":"✨ Gerando página com IA…":P?"🧬 Clonar página":"✨ Criar página"})]}),v&&a.jsxs("div",{className:"form-card",style:{marginTop:"20px",border:"1px solid var(--primary)",background:"var(--primary-light)"},children:[a.jsx("h3",{style:{marginBottom:"6px"},children:"✅ Página pronta!"}),a.jsxs("p",{style:{fontSize:"14px",marginBottom:"12px"},children:[a.jsx("strong",{children:v.titulo})," · ",v.tipo," ",v.provider?`· gerada por ${v.provider}`:""]}),a.jsxs("div",{style:{display:"flex",gap:"10px",flexWrap:"wrap"},children:[a.jsx("a",{className:"btn-primary",style:{textDecoration:"none"},href:v.preview_url,target:"_blank",rel:"noreferrer",children:"👁️ Pré-visualizar"}),a.jsx("a",{className:"btn-outline",style:{textDecoration:"none"},href:`/api/paginas/${v.id}/download`,children:"⬇️ Download"}),a.jsx("button",{className:"btn-outline",onClick:()=>A(v),children:"✏️ Editar HTML"}),a.jsx("button",{className:"btn-outline",onClick:()=>t("/hosting/paginas"),children:"📚 Ver todas"})]})]})]}),a.jsxs(ve,{open:!!h,title:`Editar HTML — ${(h==null?void 0:h.titulo)||""}`,onClose:()=>S(null),children:[a.jsx("textarea",{value:y,onChange:m=>k(m.target.value),rows:18,style:{width:"100%",fontFamily:"monospace",fontSize:"12px",padding:"10px",borderRadius:"6px",border:"1px solid var(--border)",background:"var(--input-bg)",color:"var(--text-main)",outline:"none"}}),a.jsx("button",{className:"btn-primary",onClick:E,disabled:N,style:{marginTop:"12px",width:"100%"},children:N?"Salvando…":"Salvar HTML"})]})]})}function em(e){if(!e)return"—";const[t]=e.split(" "),[n,r,l]=t.split("-");return n?`${l}/${r}/${n.slice(2)}`:e}const tm={presell:"🛡️ Pre-sell",vendas:"💸 Vendas",clone:"🧬 Clone"};function nm(){var C,A,E,P;const{toast:e}=ie(),t=Re(),[n,r]=f.useState([]),[l,s]=f.useState(!0),[i,u]=f.useState(null),[o,c]=f.useState(""),[v,g]=f.useState(!1),[h,S]=f.useState(null),[y,k]=f.useState(null),N=f.useCallback(async()=>{s(!0);try{r(await z.paginas())}catch(m){e(m.message||"Falha ao carregar páginas.")}finally{s(!1)}},[e]);f.useEffect(()=>{N()},[N]);const x=async m=>{try{const w=await z.paginaHtml(m.id);c(w.html),u({id:m.id,titulo:m.titulo})}catch(w){e(w.message||"HTML não encontrado.")}},d=async()=>{g(!0);try{await z.updatePaginaHtml(i.id,o),e("HTML atualizado!"),u(null),await N()}catch(m){e(m.message||"Falha ao salvar.")}finally{g(!1)}},p=async m=>{S(m.id);try{const w=await z.publicarPagina(m.id);e(`"${m.titulo}" publicada no GitHub!`),k({titulo:m.titulo,result:w.publish_result}),await N()}catch(w){e(w.message||"Falha ao publicar.")}finally{S(null)}},j=async m=>{if(window.confirm(`Excluir a página "${m.titulo}"?`))try{await z.deletePagina(m.id),e("Página excluída."),await N()}catch(w){e(w.message||"Falha ao excluir.")}};return a.jsxs("section",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[a.jsx("h1",{children:"📄 Páginas Criadas"}),a.jsx("button",{className:"btn-primary",onClick:()=>t("/adspages"),children:"+ Criar página"})]}),a.jsx("p",{className:"subtitle",children:"Todas as presells e páginas de vendas — pré-visualize, edite, publique e acompanhe."}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Atualizada"}),a.jsx("th",{children:"Título"}),a.jsx("th",{children:"Tipo"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:l?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:5,children:"Carregando…"})}):n.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:5,children:"Nenhuma página criada ainda. Use o AdsPages para gerar a primeira."})}):n.map(m=>a.jsxs("tr",{children:[a.jsx("td",{children:em(m.updated_at)}),a.jsx("td",{children:m.titulo}),a.jsx("td",{children:tm[m.tipo]||m.tipo}),a.jsxs("td",{children:[m.status==="publicada"?a.jsx("span",{style:{color:"var(--success)",fontWeight:600},children:"✅ Publicada"}):a.jsx("span",{style:{color:"var(--text-muted)"},children:"📝 Rascunho"}),m.published_url&&a.jsx("div",{style:{fontSize:"11px"},children:a.jsx("a",{href:m.published_url,target:"_blank",rel:"noreferrer",style:{color:"var(--primary)"},children:m.published_url})})]}),a.jsxs("td",{className:"action-icons",children:[a.jsx("a",{href:m.preview_url,target:"_blank",rel:"noreferrer",title:"Pré-visualizar",style:{color:"inherit",textDecoration:"none"},children:"👁️"}),a.jsx("a",{href:`/api/paginas/${m.id}/download`,title:"Download HTML",style:{color:"inherit",textDecoration:"none"},children:"⬇️"}),a.jsx("span",{title:"Editar HTML",onClick:()=>x(m),children:"✏️"}),a.jsx("span",{title:h===m.id?"Publicando via GitHub…":"Publicar (GitHub → Cloudflare Pages)",onClick:()=>p(m),children:h===m.id?"⏳":"🚀"}),a.jsx("span",{title:"Excluir",onClick:()=>j(m),children:"🗑️"})]})]},m.id))})]}),a.jsx("p",{className:"placeholder-note",style:{marginTop:"16px"},children:"💡 Publicação: o HTML é enviado ao repositório GitHub configurado em Chaves de API. Se o repositório estiver conectado a um projeto no Cloudflare Pages, o deploy é automático."}),a.jsxs(ve,{open:!!i,title:`Editar HTML — ${(i==null?void 0:i.titulo)||""}`,onClose:()=>u(null),children:[a.jsx("textarea",{value:o,onChange:m=>c(m.target.value),rows:18,style:{width:"100%",fontFamily:"monospace",fontSize:"12px",padding:"10px",borderRadius:"6px",border:"1px solid var(--border)",background:"var(--input-bg)",color:"var(--text-main)",outline:"none"}}),a.jsx("button",{className:"btn-primary",onClick:d,disabled:v,style:{marginTop:"12px",width:"100%"},children:v?"Salvando…":"Salvar HTML"})]}),a.jsxs(ve,{open:!!y,title:`🚀 Publicada — ${(y==null?void 0:y.titulo)||""}`,onClose:()=>k(null),children:[a.jsxs("p",{style:{fontSize:"14px",marginBottom:"10px"},children:[a.jsx("strong",{children:"Arquivo:"})," ",(C=y==null?void 0:y.result)==null?void 0:C.path]}),a.jsx("p",{style:{marginBottom:"6px"},children:a.jsx("a",{href:(A=y==null?void 0:y.result)==null?void 0:A.commit_url,target:"_blank",rel:"noreferrer",style:{color:"var(--primary)"},children:"Commit no GitHub ↗"})}),a.jsx("p",{style:{marginBottom:"12px"},children:a.jsx("a",{href:(E=y==null?void 0:y.result)==null?void 0:E.pages_url,target:"_blank",rel:"noreferrer",style:{color:"var(--primary)"},children:"Página pública (GitHub Pages) ↗"})}),a.jsx("p",{className:"placeholder-note",children:(P=y==null?void 0:y.result)==null?void 0:P.aviso})]})]})}function _o(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function rm(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(!0),[s,i]=f.useState(!1),[u,o]=f.useState(""),[c,v]=f.useState(!1),[g,h]=f.useState(null),[S,y]=f.useState(null),[k,N]=f.useState(""),[x,d]=f.useState(""),p=f.useCallback(async()=>{l(!0);try{n(await z.dominios())}catch(w){e(w.message||"Falha ao carregar domínios.")}finally{l(!1)}},[e]);f.useEffect(()=>{p()},[p]);const j=async w=>{w.preventDefault(),v(!0);try{const D=await z.createDominio({nome:u});e(`Domínio "${D.nome}" adicionado!`),o(""),i(!1),await p()}catch(D){e(D.message||"Falha ao adicionar domínio.")}finally{v(!1)}},C=async(w,D="ns")=>{h(`${w.id}-${D}`);try{const U=await z.verificarDominio(w.id),W=U.verificacao||{};U.status==="online"?e(`✅ ${w.nome}: online na Cloudflare!`):e(D==="ns"?`⏳ ${w.nome}: NS ainda não apontado (${(W.ns||[]).join(", ")||"sem resposta DNS"}).`:`📋 ${w.nome}: registros A = ${(W.a||[]).join(", ")||"nenhum"}.`),await p()}catch(U){e(U.message||"Falha na verificação.")}finally{h(null)}},A=w=>{N(w.tags||""),y(w)},E=async()=>{try{await z.updateDominioTags(S.id,k),e("Tags/Pixels/Scripts salvos neste domínio."),y(null),await p()}catch(w){e(w.message||"Falha ao salvar.")}},P=async w=>{if(window.confirm(`Remover o domínio "${w.nome}"?`))try{await z.deleteDominio(w.id),e("Domínio removido."),await p()}catch(D){e(D.message||"Falha ao remover.")}},m=async w=>{try{await navigator.clipboard.writeText(w),d(w),e("Copiado: "+w)}catch{e("Não foi possível copiar — selecione manualmente.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"🌐 AdsHosting — Domínios"}),a.jsx("p",{className:"subtitle",children:"Gerencie seus domínios e publique presells com SSL, DNS e antibot. Configure a Cloudflare em Chaves de API para verificação automática."}),a.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:a.jsxs("div",{children:[a.jsxs("h3",{style:{fontSize:"16px"},children:["🌐 Domínios ",a.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)",fontWeight:"normal"},children:t.length})]}),a.jsx("p",{style:{fontSize:"13px",color:"var(--primary)",cursor:"pointer",marginTop:"5px"},onClick:()=>window.open("https://dash.cloudflare.com","_blank"),children:"Aponte os name servers no seu registrador ↗"})]})}),a.jsx("button",{className:"btn-primary",style:{width:"100%",padding:"12px",marginBottom:"20px"},onClick:()=>i(!0),children:"+ Adicionar Domínio"}),r?a.jsx("p",{className:"placeholder-note",children:"Carregando…"}):t.length===0?a.jsx("div",{className:"form-card",style:{textAlign:"center"},children:a.jsx("p",{style:{color:"var(--text-muted)"},children:"Nenhum domínio cadastrado. Adicione o primeiro para começar a hospedar presells."})}):a.jsx("div",{className:"domain-grid",children:t.map(w=>{var _e;const D=_o(w.ns_data,{}),U=_o(w.a_data,{}),W=w.status==="online",xe=(D.cf_name_servers&&D.cf_name_servers.length?D.cf_name_servers:D.ns||[]).slice(0,2);return a.jsxs("div",{className:"domain-card",children:[a.jsxs("div",{children:[a.jsx("div",{className:"domain-title",children:w.nome}),W?a.jsx("div",{className:"status-tag online",children:"✅ Domínio online e disponível na criação de presell."}):a.jsx("div",{className:"status-tag pending",children:"⏳ O domínio ainda não está apto para receber anúncios"}),W?a.jsxs("ul",{className:"domain-list",children:[a.jsxs("li",{children:["🔒 SSL: ",(_e=D.ns)!=null&&_e.length?"Ativo":"—"]}),a.jsxs("li",{children:["🌐 DNS: ",W?"Configurado":"—"]}),a.jsx("li",{children:"🛡️ Antibot: via pixel do ProdMaker"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{style:{fontSize:"13px",fontWeight:"bold",color:"var(--primary)",textAlign:"center",margin:"15px 0"},children:"Name Servers detectados"}),xe.length===0?a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",textAlign:"center",marginBottom:"15px"},children:"Nenhum NS detectado ainda — clique em “Verificar NS” após apontar no registrador."}):xe.map(T=>a.jsxs("div",{className:"input-group",onClick:()=>m(T),style:{cursor:"pointer"},title:"Clique para copiar",children:[a.jsx("input",{type:"text",value:T,readOnly:!0}),a.jsx("button",{type:"button",children:"📋"})]},T)),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:1.5,marginTop:"15px"},children:"No registrador, aponte os name servers da Cloudflare e aguarde (30 min a 48 h). Depois clique em Verificar."})]}),W&&U.a&&U.a.length>0&&a.jsxs("p",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"10px"},children:["Registros A: ",U.a.join(", ")]})]}),a.jsxs("div",{className:"domain-card-bottom",children:[a.jsxs("div",{className:"domain-actions",children:[a.jsx("button",{className:"btn-outline",onClick:()=>C(w,"a"),disabled:g===`${w.id}-a`,children:g===`${w.id}-a`?"…":"Verificar A"}),a.jsx("button",{className:"btn-outline",onClick:()=>C(w,"ns"),disabled:g===`${w.id}-ns`,children:g===`${w.id}-ns`?"…":"Verificar NS"}),a.jsx("button",{className:"btn-outline",style:{flex:"0.25"},onClick:()=>P(w),children:"🗑️"})]}),a.jsxs("button",{className:"btn-outline",style:{width:"100%",display:"flex",justifyContent:"space-between"},onClick:()=>A(w),children:["+ Tags, Pixels and Scripts (Opcional) ",a.jsx("span",{children:"📋"})]})]})]},w.id)})}),a.jsx(ve,{open:s,title:"Adicionar Domínio",onClose:()=>i(!1),children:a.jsxs("form",{onSubmit:j,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Domínio (sem https://)"}),a.jsx("input",{required:!0,value:u,onChange:w=>o(w.target.value),placeholder:"ex.: minhapresell.com"})]}),a.jsx("p",{className:"placeholder-note",style:{marginBottom:"12px"},children:"O domínio precisa estar cadastrado na sua conta Cloudflare (o ProdMaker verifica NS e status via API/DNS)."}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:c,style:{width:"100%"},children:c?"Adicionando…":"Adicionar"})]})}),a.jsxs(ve,{open:!!S,title:`Tags, Pixels e Scripts — ${(S==null?void 0:S.nome)||""}`,onClose:()=>y(null),children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Scripts adicionais (inseridos nas páginas publicadas neste domínio — futuro deploy)"}),a.jsx("textarea",{rows:8,value:k,onChange:w=>N(w.target.value),placeholder:"<!-- ex.: Google Tag Manager, Meta Pixel --><![CDATA[ ... ]]>",style:{fontFamily:"monospace",fontSize:"12px"}})]}),a.jsx("button",{className:"btn-primary",onClick:E,style:{width:"100%"},children:"Salvar"})]})]})}const Mr=["var(--primary)","#3b82f6","#db2777","#f59e0b","#10b981","#64748b"];function hl({data:e}){const t=e.reduce((l,s)=>l+s[1],0)||1;let n=0;const r=e.map((l,s)=>{const i=n/t*100;n+=l[1];const u=n/t*100;return`${Mr[s%Mr.length]} ${i}% ${u}%`});return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"donut-chart",style:{background:`conic-gradient(${r.join(", ")})`},children:a.jsx("div",{className:"donut-inner"})}),a.jsx("div",{className:"chart-legend",children:e.map((l,s)=>a.jsxs("div",{className:"legend-item",children:[a.jsx("span",{className:"legend-color",style:{background:Mr[s%Mr.length]}})," ",l[0]," (",l[1],")"]},l[0]))})]})}function am({fluxo:e}){if(!e||e.length===0)return a.jsx("div",{className:"traffic-flow-visual",style:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:"12px"},children:"Aguardando visitas rastreadas…"});const t=Math.max(...e.map(s=>s.visitas),1),n=e.map((s,i)=>{const u=e.length===1?500:i/(e.length-1)*1e3,o=200-s.visitas/t*180;return`${u},${o}`});n.length===1&&n.push(`1000,${n[0].split(",")[1]}`);const r=`M${n.join(" L")}`,l=`${r} L1000,200 L0,200 Z`;return a.jsx("div",{className:"traffic-flow-visual",children:a.jsxs("svg",{viewBox:"0 0 1000 200",preserveAspectRatio:"none",children:[a.jsx("path",{d:l,fill:"var(--primary-light)",opacity:"0.5"}),a.jsx("path",{d:r,fill:"none",stroke:"var(--primary)",strokeWidth:"3"})]})})}const lm=[{key:"visitas",label:"1. Visitas",emoji:"👥"},{key:"cliques",label:"2. Cliques de Oferta",emoji:"🖱️",color:"#3b82f6",badgeColor:"#e0f2fe",badgeText:"#0284c7"},{key:"checkouts",label:"3. Checkouts",emoji:"🛒",color:"#db2777",badgeColor:"#fce7f3",badgeText:"#db2777"},{key:"vendas",label:"4. Conversões (Vendas)",emoji:"💸",color:"var(--success)",badgeColor:"#dcfce7",badgeText:"#16a34a"}];function sm(){var P,m,w,D,U,W,xe,_e;const{toast:e}=ie(),t=Re(),[n,r]=f.useState(null),[l,s]=f.useState(!0),[i,u]=f.useState(null),[o,c]=f.useState(null),[v,g]=f.useState("json"),h=f.useCallback(async()=>{s(!0);try{r(await z.trackingDashboard())}catch(T){e(T.message||"Falha ao carregar o tracking.")}finally{s(!1)}},[e]);f.useEffect(()=>{h()},[h]);const S=async T=>{u(T),g("json"),c(null);try{c(await z.visitante(T))}catch(M){e(M.message||"Falha ao carregar o visitante.")}},y=async()=>{const T=((n==null?void 0:n.drenagem)||[]).map(M=>M.ip).join(`
|
|
68
|
-
`);try{await navigator.clipboard.writeText(T),e(`Lista de ${n.drenagem.length} IPs copiada!`)}catch{e("Não foi possível copiar.")}},k=async()=>{try{await navigator.clipboard.writeText(JSON.stringify((o==null?void 0:o.payload)||{},null,2)),e("JSON copiado!")}catch{e("Não foi possível copiar.")}};if(l&&!n)return a.jsx("div",{className:"loading-screen",children:"Carregando AdsPixel…"});if(!n)return null;const{resumo:N,drenagem:x,visitantes:d,origem:p,dispositivos:j,sistemas:C,funil:A,fluxo:E}=n;return a.jsxs("section",{children:[a.jsxs("div",{className:"pixel-header",children:[a.jsx("div",{className:"pixel-icon",children:"🎯"}),a.jsxs("div",{children:[a.jsx("h1",{children:"AdsPixel"}),a.jsx("p",{className:"subtitle",style:{margin:0},children:"Captura dados de cada visitante das suas páginas de presell — sem scripts de terceiros."})]})]}),N.visitas===0&&a.jsxs("div",{className:"form-card",style:{border:"1px solid var(--warning-border)",background:"var(--warning-bg)"},children:[a.jsx("h3",{style:{fontSize:"15px",marginBottom:"8px"},children:"Nenhuma visita rastreada ainda"}),a.jsxs("p",{style:{fontSize:"13px",color:"var(--text-muted)"},children:["Para começar a rastrear: 1) configure a URL pública do ",a.jsx("code",{children:"/track"})," no card"," ",a.jsx("strong",{children:"Pixel de Rastreamento"})," em"," ",a.jsx("a",{href:"/api-keys",onClick:T=>{T.preventDefault(),t("/api-keys")},children:"Chaves de API"})," ","(use um túnel como cloudflared apontando para http://localhost:8188/track); 2) gere e publique páginas no AdsPages — o pixel é embutido automaticamente."]})]}),a.jsxs("div",{className:"pixel-top-bar",children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[a.jsx("strong",{children:"Visitas em todas as páginas de Presell"}),a.jsxs("span",{className:"pixel-tag",children:[N.dias," dias"]}),a.jsxs("span",{className:"pixel-tag",style:{background:"transparent",border:"1px solid var(--border)"},children:[N.visitas," visitas · ",N.visitantes_unicos," visitantes únicos"]})]}),a.jsx("button",{className:"btn-outline",style:{fontSize:"12px",padding:"5px 10px"},onClick:h,children:"🔄 Atualizar dados"})]}),x.length>0&&a.jsxs("div",{className:"warning-box",children:[a.jsx("div",{className:"icon",children:"!"}),a.jsxs("div",{children:[a.jsxs("h4",{children:["POSSÍVEL DRENAGEM DE ORÇAMENTO • ",x.length," Visitantes com Cliques Repetidos"]}),a.jsx("p",{children:"Detector de Cliques Repetidos: visitantes que clicaram em anúncios/CTAs mais de uma vez sem converter podem estar consumindo seu orçamento sem gerar retorno."})]}),a.jsxs("button",{className:"btn-dark",onClick:y,children:["📋 Copiar Todos (",x.length," IPs)"]})]}),d.length>0&&a.jsx("div",{className:"visitor-grid",children:d.map(T=>{var M;return a.jsxs("div",{className:"visitor-card",onClick:()=>S(T.ip),title:"Ver detalhes",children:[a.jsxs("div",{className:"visitor-card-header",children:[a.jsxs("div",{className:"visitor-ip",children:[a.jsx("span",{children:"🛡️"})," ",T.ip]}),a.jsxs("span",{className:"visitor-badge",children:[T.cliques," cliques"]})]}),a.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:["ID ",T.visitor_id," · ",T.os," • ",T.browser]}),a.jsxs("div",{className:"visitor-card-details",children:[a.jsxs("span",{children:["Último: ",(M=T.ultimo)==null?void 0:M.slice(0,16)]}),a.jsx("span",{className:"visitor-card-link",children:"Ver detalhes >"})]})]},T.ip)})}),a.jsxs("div",{className:"metrics-grid",children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Visitas Humanas"}),a.jsx("div",{className:"value",children:N.visitas})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Cliques / CTR"}),a.jsxs("div",{className:"value",children:[N.ctr,"%"]})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Checkouts"}),a.jsx("div",{className:"value",children:N.checkouts})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Vendas"}),a.jsx("div",{className:"value",children:N.vendas})]})]}),a.jsxs("div",{className:"charts-grid",children:[a.jsxs("div",{className:"chart-card",children:[a.jsx("h3",{children:"Origem do Tráfego"}),a.jsx("p",{children:"De onde vêm os cliques rastreados"}),a.jsx(hl,{data:p})]}),a.jsxs("div",{className:"chart-card",children:[a.jsx("h3",{children:"Dispositivos"}),a.jsx("p",{children:"Smartphone, computador ou tablet"}),a.jsx(hl,{data:j})]}),a.jsxs("div",{className:"chart-card",children:[a.jsx("h3",{children:"Sistemas Operacionais"}),a.jsx("p",{children:"Sistema operacional dos visitantes"}),a.jsx(hl,{data:C})]})]}),a.jsxs("div",{className:"bottom-grid",children:[a.jsxs("div",{className:"traffic-flow-card",children:[a.jsx("h3",{children:"📈 Fluxo de Tráfego e Conversão ao Vivo"}),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)"},children:"Visitas rastreadas por hora do dia"}),a.jsx(am,{fluxo:E})]}),a.jsxs("div",{className:"funnel-card",children:[a.jsx("h3",{children:"⚡ Funil de Conversão do AdsPixel"}),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",marginBottom:"15px"},children:"Passagem de tráfego até a venda final"}),lm.map((T,M)=>{var L;const O=A[T.key]||0,F=M===0?100:((L=A.taxas)==null?void 0:L[T.key])??0;return a.jsxs("div",{className:"funnel-step",children:[a.jsxs("div",{className:"funnel-step-header",children:[a.jsxs("span",{children:[T.emoji," ",T.label]}),a.jsxs("span",{children:[O," ",a.jsxs("span",{style:{background:T.badgeColor||"var(--primary-light)",padding:"2px 6px",borderRadius:"4px",color:T.badgeText||"var(--primary)"},children:[F,"%"]})]})]}),a.jsx("div",{className:"funnel-step-bar",children:a.jsx("div",{style:{width:`${Math.max(F,O>0?2:0)}%`,background:T.color||"var(--primary)"}})})]},T.key)}),a.jsx("p",{className:"placeholder-note",style:{marginTop:"12px"},children:"Checkouts e vendas ativam com os webhooks de venda (próxima parte)."})]})]}),a.jsx(ve,{open:!!i,title:`Visitante — ${i||""}`,onClose:()=>u(null),children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"visitor-modal-header",children:a.jsx("span",{className:"badge-human",children:"Humano"})}),a.jsxs("div",{className:"visitor-details-grid",children:[a.jsxs("div",{className:"detail-box",children:[a.jsx("div",{className:"label",children:"📡 IP & ID"}),a.jsx("div",{className:"main-val",children:o.ip}),a.jsxs("div",{className:"sub-val",children:["ID ",o.visitor_id]})]}),a.jsxs("div",{className:"detail-box",children:[a.jsx("div",{className:"label",children:"🕒 ÚLTIMO ACESSO"}),a.jsx("div",{className:"main-val",children:((P=o.ultimo)==null?void 0:P.split(" ")[1])||"—"}),a.jsx("div",{className:"sub-val",children:((m=o.ultimo)==null?void 0:m.split(" ")[0])||"—"})]}),a.jsxs("div",{className:"detail-box",children:[a.jsx("div",{className:"label",children:"💻 DISPOSITIVO"}),a.jsxs("div",{className:"main-val",children:[(w=o.payload)==null?void 0:w.device," • ",(D=o.payload)==null?void 0:D.os]}),a.jsx("div",{className:"sub-val",children:(U=o.payload)==null?void 0:U.browser})]}),a.jsxs("div",{className:"detail-box",children:[a.jsx("div",{className:"label",children:"📢 ORIGEM"}),a.jsx("span",{className:"badge-origin",children:((W=o.payload)==null?void 0:W.utm_source)||((xe=o.payload)==null?void 0:xe.ref)||"Acesso direto"})]})]}),a.jsxs("div",{className:"modal-tabs",children:[a.jsx("div",{className:`modal-tab ${v==="ids"?"active":""}`,onClick:()=>g("ids"),children:"IDs de Rastreamento"}),a.jsx("div",{className:`modal-tab ${v==="json"?"active":""}`,onClick:()=>g("json"),children:"Payload JSON"})]}),v==="ids"?a.jsxs("div",{children:[a.jsxs("div",{className:"tracking-id-box",children:[a.jsx("div",{className:"label",children:"# VISITOR_ID"}),a.jsx("div",{className:"val",children:o.visitor_id})]}),((_e=o.payload)==null?void 0:_e.gclid)&&a.jsxs("div",{className:"tracking-id-box",children:[a.jsx("div",{className:"label",children:"# GCLID"}),a.jsx("div",{className:"val",children:o.payload.gclid})]})]}):a.jsxs("div",{className:"json-box",children:[a.jsx("button",{className:"json-copy-btn",onClick:k,children:"📋 Copiar"}),a.jsx("pre",{style:{whiteSpace:"pre-wrap",margin:0},children:JSON.stringify(o.payload,null,2)})]}),a.jsxs("h4",{style:{fontSize:"13px",margin:"18px 0 8px"},children:["Últimos eventos (",o.eventos.length,")"]}),a.jsxs("table",{style:{marginTop:0},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Quando"}),a.jsx("th",{children:"Evento"}),a.jsx("th",{children:"Página"})]})}),a.jsx("tbody",{children:o.eventos.slice(0,10).map((T,M)=>a.jsxs("tr",{children:[a.jsx("td",{children:T.created_at}),a.jsx("td",{children:T.event}),a.jsx("td",{children:T.page||"—"})]},M))})]})]}):a.jsx("p",{className:"placeholder-note",children:"Carregando…"})})]})}const im=[{id:"hotmart",label:"Hotmart"},{id:"clickbank",label:"ClickBank"},{id:"digistore24",label:"Digistore24"},{id:"kiify",label:"Kiify"},{id:"cakto",label:"Cakto"}],To={pendente:{text:"⏳ Pendente",color:"var(--text-muted)"},enviada:{text:"✅ Enviada",color:"var(--success)"},erro:{text:"❌ Erro",color:"var(--danger)"}},Lo={produto_nome:"",valor:"",comissao:"",gclid:"",comprador_email:"",transacao_id:""};function om(e){if(!e)return"—";const[t,n=""]=e.split(" "),[r,l,s]=t.split("-");return r?`${s}/${l} ${n.slice(0,5)}`:e}function Br(e){return(Number(e)||0).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}function um(){var F;const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(null),[s,i]=f.useState(!0),[u,o]=f.useState(!1),[c,v]=f.useState(Lo),[g,h]=f.useState(!1),[S,y]=f.useState(!1),[k,N]=f.useState(""),[x,d]=f.useState(!1),[p,j]=f.useState(!1),[C,A]=f.useState(null),[E,P]=f.useState(!1),m=f.useCallback(async()=>{i(!0);try{const[L,$]=await Promise.all([z.vendas(),z.vendasResumo()]);n(L),l($)}catch(L){e(L.message||"Falha ao carregar vendas.")}finally{i(!1)}},[e]);f.useEffect(()=>{m()},[m]);const w=L=>$=>v({...c,[L]:$.target.value}),D=async L=>{L.preventDefault(),h(!0);try{await z.createVenda({produto_nome:c.produto_nome,valor:Number(c.valor)||0,comissao:Number(c.comissao)||0,gclid:c.gclid,comprador_email:c.comprador_email,transacao_id:c.transacao_id}),e("Venda registrada!"),o(!1),v(Lo),await m()}catch($){e($.message||"Falha ao salvar a venda.")}finally{h(!1)}},U=async L=>{if(window.confirm(`Excluir a venda "${L.produto_nome||L.id}"?`))try{await z.deleteVenda(L.id),e("Venda excluída."),await m()}catch($){e($.message||"Falha ao excluir.")}},W=async()=>{var L;d(!0);try{const $=await z.importVendasCsv(k);e(`Importadas: ${$.importadas}${(L=$.erros)!=null&&L.length?` · erros: ${$.erros.length}`:""}`),y(!1),N(""),await m()}catch($){e($.message||"Falha ao importar CSV.")}finally{d(!1)}},xe=L=>{var H;const $=(H=L.target.files)==null?void 0:H[0];if(!$)return;const _=new FileReader;_.onload=()=>N(String(_.result||"")),_.readAsText($)},_e=async L=>{A(L.id);try{await z.uploadConversao(L.id),e(`Conversão #${L.id} enviada ao Google Ads!`),await m()}catch($){e($.message||"Falha ao enviar conversão."),await m()}finally{A(null)}},T=async()=>{var L,$;P(!0);try{const _=await z.uploadConversoesLote();e(`Enviadas: ${_.enviadas.length}${(L=_.erros)!=null&&L.length?` · erros: ${_.erros.length}`:""}`),($=_.erros)!=null&&$[0]&&e(_.erros[0]),await m()}catch(_){e(_.message||"Falha no upload em lote.")}finally{P(!1)}},M=async L=>{try{await navigator.clipboard.writeText(L),e("URL copiada!")}catch{e("Não foi possível copiar.")}},O=f.useMemo(()=>t.filter(L=>L.status==="aprovada"&&L.gclid&&L.conversao_status!=="enviada"),[t]);return a.jsxs("section",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[a.jsx("h1",{children:"💸 Minhas Vendas"}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("button",{className:"btn-outline",onClick:()=>y(!0),children:"📥 Importar CSV"}),a.jsx("button",{className:"btn-outline",onClick:()=>j(!0),children:"🔗 Webhooks"}),a.jsx("button",{className:"btn-primary",onClick:()=>o(!0),children:"+ Adicionar venda"})]})]}),a.jsx("p",{className:"subtitle",children:"Vendas rastreadas via webhooks (Hotmart, ClickBank, Digistore24, Kiify, Cakto), entrada manual ou CSV."}),a.jsxs("div",{className:"metrics-grid",children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Vendas aprovadas"}),a.jsx("div",{className:"value",children:(r==null?void 0:r.vendas)??"—"})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Receita"}),a.jsx("div",{className:"value green",children:r?Br(r.receita):"—"})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Comissão"}),a.jsx("div",{className:"value purple",children:r?Br(r.comissao):"—"})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Conversões pendentes"}),a.jsx("div",{className:"value",children:((F=r==null?void 0:r.conversoes)==null?void 0:F.pendentes)??"—"})]})]}),O.length>0&&a.jsxs("div",{className:"warning-box",children:[a.jsx("div",{className:"icon",children:"!"}),a.jsxs("div",{children:[a.jsxs("h4",{children:["📤 ",O.length," conversão(ões) GCLID pronta(s) para envio ao Google Ads"]}),a.jsx("p",{children:"Vendas aprovadas com GCLID rastreado. Envie em lote ou individualmente."})]}),a.jsx("button",{className:"btn-dark",onClick:T,disabled:E,children:E?"Enviando…":`📤 Enviar todas (${O.length})`})]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Produto"}),a.jsx("th",{children:"Fonte"}),a.jsx("th",{children:"Valor"}),a.jsx("th",{children:"Comissão"}),a.jsx("th",{children:"GCLID"}),a.jsx("th",{children:"Conversão"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:s?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:8,children:"Carregando…"})}):t.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:8,children:"Nenhuma venda registrada. Use webhooks, adição manual ou importe um CSV."})}):t.map(L=>{var $,_;return a.jsxs("tr",{children:[a.jsx("td",{children:om(L.created_at)}),a.jsxs("td",{children:[L.produto_nome||`#${L.id}`,L.transacao_id&&a.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:L.transacao_id})]}),a.jsx("td",{children:L.fonte}),a.jsx("td",{children:Br(L.valor)}),a.jsx("td",{children:Br(L.comissao)}),a.jsx("td",{style:{fontFamily:"monospace",fontSize:"11px"},children:L.gclid?a.jsxs("span",{title:L.gclid_match?"Rastreado até a visita de origem":"Sem visita correspondente",children:[L.gclid.slice(0,12),"… ",L.gclid_match?"🎯":""]}):"—"}),a.jsxs("td",{children:[a.jsx("span",{style:{color:(($=To[L.conversao_status])==null?void 0:$.color)||"var(--text-muted)",fontWeight:600,fontSize:"12px"},children:((_=To[L.conversao_status])==null?void 0:_.text)||L.conversao_status}),L.conversao_erro&&a.jsx("div",{style:{fontSize:"10px",color:"var(--danger)",maxWidth:"180px",wordBreak:"break-word"},children:L.conversao_erro.slice(0,80)})]}),a.jsxs("td",{className:"action-icons",children:[L.gclid&&L.conversao_status!=="enviada"&&a.jsx("span",{title:"Enviar conversão ao Google Ads",onClick:()=>_e(L),children:C===L.id?"⏳":"📤"}),a.jsx("span",{title:"Excluir",onClick:()=>U(L),children:"🗑️"})]})]},L.id)})})]}),a.jsx(ve,{open:u,title:"Adicionar Venda (manual)",onClose:()=>o(!1),children:a.jsxs("form",{onSubmit:D,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Produto"}),a.jsx("input",{required:!0,value:c.produto_nome,onChange:w("produto_nome"),placeholder:"Ex.: Prodentim"})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Valor (R$)"}),a.jsx("input",{type:"number",step:"0.01",min:"0",required:!0,value:c.valor,onChange:w("valor")})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Comissão (R$) — vazio = 50%"}),a.jsx("input",{type:"number",step:"0.01",min:"0",value:c.comissao,onChange:w("comissao")})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"GCLID (se conhecido — vindo do Google Ads)"}),a.jsx("input",{value:c.gclid,onChange:w("gclid"),placeholder:"EAIaIQobChMI..."})]}),a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"E-mail do comprador"}),a.jsx("input",{value:c.comprador_email,onChange:w("comprador_email")})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Transação"}),a.jsx("input",{value:c.transacao_id,onChange:w("transacao_id")})]})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:g,style:{width:"100%",marginTop:"10px"},children:g?"Salvando…":"Salvar venda"})]})}),a.jsxs(ve,{open:S,title:"Importar Vendas (CSV)",onClose:()=>y(!1),children:[a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:"Colunas aceitas (ordem livre): produto, valor, comissao, gclid, email, transacao, utm_source, utm_medium, utm_campaign."}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Arquivo CSV"}),a.jsx("input",{type:"file",accept:".csv,text/csv",onChange:xe,style:{padding:"10px"}})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"…ou cole o conteúdo"}),a.jsx("textarea",{rows:8,value:k,onChange:L=>N(L.target.value),placeholder:`produto,valor,comissao,gclid
|
|
69
|
-
Prodentim,99,49.5,EAIaIQ...`,style:{fontFamily:"monospace",fontSize:"12px"}})]}),a.jsx("button",{className:"btn-primary",onClick:W,disabled:x||!k.trim(),style:{width:"100%"},children:x?"Importando…":"Importar"})]}),a.jsxs(ve,{open:p,title:"🔗 Webhooks de Venda",onClose:()=>j(!1),children:[a.jsxs("p",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"16px"},children:["Configure estas URLs no painel de postback de cada plataforma. Use um túnel (cloudflared/ngrok) apontando para a porta do ProdMaker para que a plataforma alcance o ",a.jsx("code",{children:"/api/webhook/sale/..."}),"."]}),im.map(L=>{const $=`${window.location.origin}/api/webhook/sale/${L.id}`;return a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:L.label}),a.jsxs("div",{className:"input-group",style:{cursor:"pointer"},onClick:()=>M($),title:"Clique para copiar",children:[a.jsx("input",{readOnly:!0,value:$}),a.jsx("button",{type:"button",children:"📋"})]})]},L.id)})]})]})}function cm(e){return(Number(e)||0).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}function dm(){var x,d,p;const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(null),[s,i]=f.useState(!0),[u,o]=f.useState(null),[c,v]=f.useState(!1),g=f.useCallback(async()=>{i(!0);try{const[j,C]=await Promise.all([z.vendas(),z.vendasResumo()]);n(j),l(C)}catch(j){e(j.message||"Falha ao carregar conversões.")}finally{i(!1)}},[e]);f.useEffect(()=>{g()},[g]);const h=t.filter(j=>j.gclid),S=h.filter(j=>j.conversao_status!=="enviada"&&j.status==="aprovada"),y=async j=>{o(j.id);try{await z.uploadConversao(j.id),e(`Conversão #${j.id} enviada!`),await g()}catch(C){e(C.message||"Falha ao enviar."),await g()}finally{o(null)}},k=async()=>{var j,C;v(!0);try{const A=await z.uploadConversoesLote();e(`Enviadas: ${A.enviadas.length}${(j=A.erros)!=null&&j.length?` · erros: ${A.erros.length}`:""}`),(C=A.erros)!=null&&C[0]&&e(A.erros[0]),await g()}catch(A){e(A.message||"Falha no upload em lote.")}finally{v(!1)}},N={pendente:"⏳ Pendente",enviada:"✅ Enviada",erro:"❌ Erro"};return a.jsxs("section",{children:[a.jsx("h1",{children:"📤 Conversões Offline (GCLID)"}),a.jsx("p",{className:"subtitle",children:"Envie as vendas do Google Ads de volta como conversões offline usando o GCLID rastreado pelo AdsPixel."}),a.jsxs("div",{className:"form-card",children:[a.jsx("h3",{style:{fontSize:"15px",marginBottom:"10px"},children:"Status da fila"}),a.jsxs("div",{className:"metrics-grid",style:{marginBottom:"10px"},children:[a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Com GCLID"}),a.jsx("div",{className:"value",children:h.length})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Pendentes"}),a.jsx("div",{className:"value",children:S.length})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Enviadas"}),a.jsx("div",{className:"value green",children:((x=r==null?void 0:r.conversoes)==null?void 0:x.enviadas)??0})]}),a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Erros"}),a.jsx("div",{className:"value",style:{color:(((d=r==null?void 0:r.conversoes)==null?void 0:d.erros)||0)>0?"var(--danger)":void 0},children:((p=r==null?void 0:r.conversoes)==null?void 0:p.erros)??0})]})]}),a.jsx("button",{className:"btn-primary",onClick:k,disabled:c||S.length===0,style:{width:"100%"},children:c?"Enviando…":`📤 Enviar todas as pendentes (${S.length})`})]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Venda"}),a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Valor"}),a.jsx("th",{children:"GCLID"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:s?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Carregando…"})}):h.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Nenhuma venda com GCLID ainda. Vendas vindas de cliques do Google Ads (com gclid capturado pelo AdsPixel ou informado no webhook) aparecem aqui automaticamente."})}):h.map(j=>a.jsxs("tr",{children:[a.jsx("td",{children:j.produto_nome||`#${j.id}`}),a.jsx("td",{children:j.created_at}),a.jsx("td",{children:cm(j.valor)}),a.jsxs("td",{style:{fontFamily:"monospace",fontSize:"11px"},children:[j.gclid.slice(0,14),"…"]}),a.jsxs("td",{style:{fontWeight:600,fontSize:"12px",color:j.conversao_status==="erro"?"var(--danger)":j.conversao_status==="enviada"?"var(--success)":"var(--text-muted)"},children:[N[j.conversao_status]||j.conversao_status,j.conversao_erro&&a.jsx("div",{style:{fontWeight:400,fontSize:"10px",maxWidth:"220px",wordBreak:"break-word"},children:j.conversao_erro.slice(0,100)})]}),a.jsx("td",{className:"action-icons",children:j.conversao_status!=="enviada"&&j.status==="aprovada"&&a.jsx("span",{title:"Enviar conversão",onClick:()=>y(j),children:u===j.id?"⏳":"📤"})})]},j.id))})]}),a.jsx("p",{className:"placeholder-note",style:{marginTop:"16px"},children:"🔧 Requer Google Ads configurado em Chaves de API (developer token, client_id, client_secret, refresh_token, customer_id e conversion_action). Erros da API são exibidos com attribution."})]})}function pm(){const{toast:e}=ie(),t=Re(),[n,r]=f.useState([]),[l,s]=f.useState(""),[i,u]=f.useState({positivas:[],negativas:[]}),[o,c]=f.useState(!0),[v,g]=f.useState(!1),[h,S]=f.useState({tipo:"positiva",texto:""}),y=f.useCallback(async()=>{c(!0);try{const[C,A]=await Promise.all([z.produtos(),z.adswords(l?Number(l):void 0)]);r(C),u(A)}catch(C){e(C.message||"Falha ao carregar.")}finally{c(!1)}},[e,l]);f.useEffect(()=>{y()},[y]);const k=async()=>{g(!0);try{await z.adswordsGerar(l?Number(l):null),e("Palavras-chave geradas com IA!"),await y()}catch(C){e(C.message||"Falha na geração.")}finally{g(!1)}},N=async C=>{if(C.preventDefault(),!!h.texto.trim())try{await z.adswordsAdicionar({produto_id:l?Number(l):null,tipo:h.tipo,texto:h.texto.trim()}),S({...h,texto:""}),e("Palavra adicionada!"),await y()}catch(A){e(A.message||"Falha ao adicionar.")}},x=async C=>{try{await z.adswordsRemover(C.id),await y()}catch(A){e(A.message||"Falha ao remover.")}},d=async(C,A)=>{const E=C.map(P=>P.texto).join(`
|
|
70
|
-
`);try{await navigator.clipboard.writeText(E),e(`${A} copiada (${C.length})!`)}catch{e("Não foi possível copiar.")}},p=i.positivas||[],j=i.negativas||[];return a.jsxs("section",{children:[a.jsx("h1",{children:"✈️ AdsWords"}),a.jsx("p",{className:"subtitle",children:"Palavras-chave e negativas para Google Ads (correspondência de frase) — geradas por IA ou manuais."}),a.jsxs("div",{className:"form-card",children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Produto"}),a.jsxs("select",{value:l,onChange:C=>s(C.target.value),children:[a.jsx("option",{value:"",children:"— sem produto vinculado —"}),n.map(C=>a.jsx("option",{value:C.id,children:C.nome},C.id))]})]}),a.jsx("div",{className:"form-group",style:{display:"flex",alignItems:"flex-end"},children:a.jsx("button",{className:"btn-primary",onClick:k,disabled:v,style:{width:"100%"},children:v?"✨ Gerando com IA…":"✨ Gerar palavras-chave com IA"})})]}),a.jsxs("form",{onSubmit:N,style:{display:"flex",gap:"10px",marginTop:"6px"},children:[a.jsxs("select",{value:h.tipo,onChange:C=>S({...h,tipo:C.target.value}),style:{maxWidth:"140px"},children:[a.jsx("option",{value:"positiva",children:"Positiva"}),a.jsx("option",{value:"negativa",children:"Negativa"})]}),a.jsx("input",{style:{flex:1},placeholder:"Adicionar palavra manualmente…",value:h.texto,onChange:C=>S({...h,texto:C.target.value})}),a.jsx("button",{className:"btn-outline",type:"submit",children:"+ Adicionar"})]})]}),a.jsxs("div",{className:"charts-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[a.jsxs("div",{className:"chart-card",children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("h3",{children:["✅ Positivas (",p.length,")"]}),a.jsx("button",{className:"btn-outline",style:{fontSize:"11px",padding:"4px 10px"},onClick:()=>d(p,"Positivas"),disabled:p.length===0,children:"📋 Copiar"})]}),o?a.jsx("p",{className:"placeholder-note",children:"Carregando…"}):p.length===0?a.jsx("p",{className:"placeholder-note",children:"Nenhuma positiva ainda — gere com IA (precisa de LLM configurado em Chaves de API) ou adicione manualmente."}):a.jsxs("table",{style:{marginTop:"6px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Palavra"}),a.jsx("th",{children:"Corresp."}),a.jsx("th",{children:"Origem"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:p.map(C=>a.jsxs("tr",{children:[a.jsx("td",{children:C.texto}),a.jsx("td",{children:C.correspondencia}),a.jsx("td",{children:C.origem==="ia"?"IA":"manual"}),a.jsx("td",{className:"action-icons",children:a.jsx("span",{title:"Remover",onClick:()=>x(C),children:"🗑️"})})]},C.id))})]})]}),a.jsxs("div",{className:"chart-card",children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("h3",{children:["🚫 Negativas (",j.length,")"]}),a.jsx("button",{className:"btn-outline",style:{fontSize:"11px",padding:"4px 10px"},onClick:()=>d(j,"Negativas"),disabled:j.length===0,children:"📋 Copiar"})]}),o?a.jsx("p",{className:"placeholder-note",children:"Carregando…"}):j.length===0?a.jsx("p",{className:"placeholder-note",children:"Nenhuma negativa ainda. As negativas padrão do seed entram automaticamente na geração por IA."}):a.jsxs("table",{style:{marginTop:"6px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Palavra"}),a.jsx("th",{children:"Origem"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:j.map(C=>a.jsxs("tr",{children:[a.jsx("td",{children:C.texto}),a.jsx("td",{children:C.origem==="ia"?"IA":"manual"}),a.jsx("td",{className:"action-icons",children:a.jsx("span",{title:"Remover",onClick:()=>x(C),children:"🗑️"})})]},C.id))})]})]})]}),a.jsxs("p",{className:"placeholder-note",children:["Pronto? Use as palavras no ",a.jsx("a",{href:"/adscreator",onClick:C=>{C.preventDefault(),t("/adscreator")},children:"AdsCreator"})," ao montar a campanha."]})]})}const fm=[{id:"google",emoji:"🎯",label:"Google Ads",desc:"Search com CPA 60–80% da comissão + negativas"},{id:"meta",emoji:"👥",label:"Meta Ads",desc:"1 campanha → 1 conjunto → N criativos (Advantage+)"},{id:"tiktok",emoji:"🎵",label:"TikTok Ads",desc:"Vídeo 9:16 UGC, teste US$10–20/dia"}],Ao={rascunho:{text:"📝 Rascunho",color:"var(--text-muted)"},publicada:{text:"✅ Publicada",color:"var(--success)"},erro:{text:"❌ Erro",color:"var(--danger)"}};function Io(e){return(Number(e)||0).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}function hm(){var L,$;const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState([]),[s,i]=f.useState(!0),[u,o]=f.useState("google"),[c,v]=f.useState(""),[g,h]=f.useState(""),[S,y]=f.useState(""),[k,N]=f.useState(5),[x,d]=f.useState({positivas:[],negativas:[]}),[p,j]=f.useState([]),[C,A]=f.useState(!1),[E,P]=f.useState(!1),[m,w]=f.useState(null),[D,U]=f.useState(null),W=f.useCallback(async()=>{i(!0);try{const[_,H]=await Promise.all([z.produtos(),z.campanhas()]);n(_),l(H)}catch(_){e(_.message||"Falha ao carregar.")}finally{i(!1)}},[e]);f.useEffect(()=>{W()},[W]);const xe=f.useCallback(async _=>{try{const H=await z.adswords(_?Number(_):void 0);d(H)}catch{}},[]);f.useEffect(()=>{c?xe(c):d({positivas:[],negativas:[]})},[c,xe]);const _e=async()=>{A(!0);try{const _=await z.gerarCriativos({produto_id:c?Number(c):null,quantidade:3});j(_.criativos),e(`${_.criativos.length} criativo(s) gerado(s) por ${_.provider}!`)}catch(_){e(_.message||"Falha na geração de criativos.")}finally{A(!1)}},T=async _=>{_.preventDefault(),P(!0);try{const H={produto_id:c?Number(c):null,plataforma:u,nome:g,keywords:x.positivas.map(Ve=>({texto:Ve.texto,correspondencia:Ve.correspondencia})),negativas:x.negativas.map(Ve=>({texto:Ve.texto})),criativos:p};S&&(H.orcamento_diario=Number(S)),u==="meta"&&(H.quantidade_criativos=k);const De=await z.createCampanha(H);e(`Campanha "${De.nome}" salva como rascunho!`),h(""),y(""),j([]),await W()}catch(H){e(H.message||"Falha ao salvar a campanha.")}finally{P(!1)}},M=async _=>{try{const H=await z.getCampanha(_.id);w(H)}catch(H){e(H.message||"Falha ao abrir a campanha.")}},O=async _=>{U(_.id);try{await z.publicarCampanha(_.id),e(`Campanha "${_.nome}" publicada (PAUSADA para revisão)!`),await W()}catch(H){e(H.message||"Falha na publicação."),await W()}finally{U(null)}},F=async _=>{if(window.confirm(`Excluir a campanha "${_.nome}"?`))try{await z.deleteCampanha(_.id),await W()}catch(H){e(H.message||"Falha ao excluir.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"🎯 AdsCreator"}),a.jsx("p",{className:"subtitle",children:"Crie anúncios de alta conversão — Google, Meta e TikTok com os defaults validados."}),a.jsx("div",{className:"metrics-grid",style:{gridTemplateColumns:"repeat(3, 1fr)"},children:fm.map(_=>a.jsxs("div",{className:"metric-card",style:{cursor:"pointer",border:u===_.id?"2px solid var(--primary)":"1px solid var(--border)"},onClick:()=>o(_.id),children:[a.jsxs("h3",{children:[_.emoji," ",_.label,u===_.id?" ✓":""]}),a.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:_.desc})]},_.id))}),a.jsx("div",{className:"form-card",children:a.jsxs("form",{onSubmit:T,children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Produto (preenche comissão/preço)"}),a.jsxs("select",{value:c,onChange:_=>v(_.target.value),children:[a.jsx("option",{value:"",children:"— sem produto —"}),t.map(_=>a.jsx("option",{value:_.id,children:_.nome},_.id))]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Nome da campanha (opcional)"}),a.jsx("input",{value:g,onChange:_=>h(_.target.value),placeholder:"Ex.: ProdX — Search US"})]})]}),a.jsxs("div",{className:"form-row",children:[u==="meta"?a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Quantidade de criativos (mín. 5)"}),a.jsx("input",{type:"number",min:"5",max:"20",value:k,onChange:_=>N(Number(_.target.value))})]}):null,a.jsxs("div",{className:"form-group",children:[a.jsxs("label",{children:["Orçamento diário (",u==="tiktok"?"US$":"R$",")",u==="meta"?" — vazio = regra criativos × ½ ticket":u==="google"?" — vazio = R$110":" — vazio = US$15"]}),a.jsx("input",{type:"number",step:"0.01",min:"0",value:S,onChange:_=>y(_.target.value)})]}),a.jsx("div",{className:"form-group",style:{display:"flex",alignItems:"flex-end"},children:a.jsx("button",{className:"btn-outline",type:"button",onClick:_e,disabled:C,style:{width:"100%"},children:C?"✨ Gerando…":"✨ Gerar criativos com IA"})})]}),p.length>0&&a.jsx("div",{className:"placeholder-list",children:p.map((_,H)=>a.jsxs("li",{children:[a.jsxs("strong",{children:["[",H+1,"]"]})," ",_.gancho_3s||_.roteiro||"(sem gancho)"]},H))}),a.jsxs("p",{className:"placeholder-note",style:{marginBottom:"12px"},children:["Palavras do AdsWords serão usadas: ",((L=x.positivas)==null?void 0:L.length)||0," positiva(s) · ",(($=x.negativas)==null?void 0:$.length)||0," negativa(s)",c?"":" — selecione um produto para usar as palavras já geradas."]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:E,style:{width:"100%"},children:E?"Salvando…":"💾 Salvar campanha como rascunho"})]})}),a.jsxs("h3",{style:{fontSize:"16px",margin:"24px 0 8px"},children:["Campanhas (",r.length,")"]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Criada"}),a.jsx("th",{children:"Campanha"}),a.jsx("th",{children:"Plataforma"}),a.jsx("th",{children:"CPA alvo"}),a.jsx("th",{children:"Orçamento/dia"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:s?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:7,children:"Carregando…"})}):r.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:7,children:"Nenhuma campanha ainda. Monte a primeira acima."})}):r.map(_=>{var H,De,Ve;return a.jsxs("tr",{children:[a.jsx("td",{children:((H=_.created_at)==null?void 0:H.slice(0,10))||"—"}),a.jsx("td",{children:_.nome}),a.jsx("td",{children:_.plataforma}),a.jsx("td",{children:_.plataforma==="google"&&_.cpa_alvo?Io(_.cpa_alvo):"—"}),a.jsx("td",{children:Io(_.orcamento_diario)}),a.jsxs("td",{style:{color:(De=Ao[_.status])==null?void 0:De.color,fontWeight:600,fontSize:"12px"},children:[((Ve=Ao[_.status])==null?void 0:Ve.text)||_.status,_.erro&&a.jsx("div",{style:{fontSize:"10px",color:"var(--danger)",maxWidth:"180px",wordBreak:"break-word"},children:_.erro.slice(0,90)})]}),a.jsxs("td",{className:"action-icons",children:[a.jsx("span",{title:"Ver plano",onClick:()=>M(_),children:"👁️"}),a.jsx("span",{title:_.plataforma==="tiktok"?"Publicar marca como manual (TikTok)":"Publicar via API (PAUSADA)",onClick:()=>O(_),children:D===_.id?"⏳":"🚀"}),a.jsx("span",{title:"Excluir",onClick:()=>F(_),children:"🗑️"})]})]},_.id)})})]}),a.jsx(ve,{open:!!m,title:`Campanha — ${(m==null?void 0:m.nome)||""}`,onClose:()=>w(null),children:m&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{style:{fontSize:"14px",marginBottom:"8px"},children:"Plano (defaults validados)"}),a.jsx("div",{className:"json-box",style:{marginBottom:"16px"},children:a.jsx("pre",{style:{whiteSpace:"pre-wrap",margin:0,maxHeight:"220px",overflow:"auto"},children:JSON.stringify(m.plano,null,2)})}),a.jsx("h4",{style:{fontSize:"14px",marginBottom:"8px"},children:"Palavras-chave positivas"}),a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)"},children:(m.keywords||[]).map(_=>_.texto).join(" · ")||"—"}),a.jsx("h4",{style:{fontSize:"14px",margin:"12px 0 8px"},children:"Negativas"}),a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)"},children:(m.negativas||[]).map(_=>_.texto).join(" · ")||"—"}),m.resultado&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{style:{fontSize:"14px",margin:"12px 0 8px"},children:"Resultado da publicação"}),a.jsx("div",{className:"json-box",children:a.jsx("pre",{style:{whiteSpace:"pre-wrap",margin:0,maxHeight:"200px",overflow:"auto"},children:JSON.stringify(m.resultado,null,2)})})]}),a.jsx("button",{className:"btn-primary",style:{width:"100%",marginTop:"16px"},disabled:D===m.id,onClick:()=>{const _=m.id;w(null),O({id:_,nome:g,plataforma:u})},children:"🚀 Publicar agora (cria PAUSADA para revisão)"})]})})]})}const mm={1:{rota:"/",texto:"Adicione ou aprove um produto. Na aprovação (com LLM ativo) o plano de ataque é gerado automaticamente.",cta:"Ir para Seus Produtos"},2:{rota:"/adspages",texto:"Gere a pre-sell ou a página de vendas (12 seções) no AdsPages. O pixel é embutido automaticamente.",cta:"Ir para AdsPages"},3:{rota:"/hosting/paginas",texto:"Publique a página no GitHub (Cloudflare Pages conectado faz o deploy). Copie a URL pública.",cta:"Ir para Páginas Criadas"},4:{rota:"/adscreator",texto:"Monte as campanhas (Google/Meta/TikTok) com CPA alvo e palavras do AdsWords. Publique PAUSADA e revise.",cta:"Ir para AdsCreator"},5:{rota:"/tracking/visitas",texto:"Configure a URL pública do /track (túnel) e acompanhe visitas, cliques e drenagem em tempo real.",cta:"Ir para Minhas Visitas"},6:{rota:null,texto:"Revise e gere o Relatório de Lançamento com o checklist final.",cta:null}};function vm(){var d,p,j,C,A;const{toast:e}=ie(),t=Re(),[n,r]=f.useState(null),[l,s]=f.useState([]),[i,u]=f.useState(!0),[o,c]=f.useState(null),[v,g]=f.useState(!1),h=f.useCallback(async()=>{u(!0);try{let E=await z.lancamentoAtual();E||(E=await z.iniciarLancamento(null)),r(E),s(await z.lancamentoEtapas())}catch(E){e(E.message||"Falha ao carregar o lançamento.")}finally{u(!1)}},[e]);f.useEffect(()=>{h()},[h]);const S=async E=>{try{const P=await z.salvarEtapaLancamento(n.id,E,{[`etapa_${E}_ok`]:!0});r(P),e(`Etapa ${E} registrada!`)}catch(P){e(P.message||"Falha ao salvar a etapa.")}},y=async()=>{try{const E=await z.concluirLancamento(n.id);c(E),g(!0),e("Lançamento concluído! Relatório gerado."),await h()}catch(E){e(E.message||"Falha ao concluir.")}},k=async()=>{try{const E=await z.relatorioLancamento(n.id);c(E),g(!0)}catch(E){e(E.message||"Falha ao abrir o relatório.")}},N=n?n.status==="concluido"?100:Math.round((n.etapa_atual-1)/(l.length||6)*100):0,x=(n==null?void 0:n.status)==="concluido"?0:(l.length||6)-((n==null?void 0:n.etapa_atual)||1)+1;return i&&!n?a.jsx("div",{className:"loading-screen",children:"Carregando AdsBot…"}):a.jsxs("section",{children:[a.jsx("h1",{children:"🤖 AdsBot — Lançamento Assistido"}),a.jsx("p",{className:"subtitle",children:"Conduza seu lançamento passo a passo — o progresso fica salvo e você pode parar e voltar quando quiser."}),n&&a.jsxs("div",{className:"form-card",children:[a.jsxs("div",{className:"flex-between",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[a.jsx("strong",{children:n.status==="concluido"?"✅ Lançamento concluído":`Etapa ${n.etapa_atual} de ${l.length} — faltam ${x} passo(s)`}),a.jsxs("span",{style:{fontSize:"13px",color:"var(--primary)",fontWeight:700},children:[N,"%"]})]}),a.jsx("div",{className:"funnel-step-bar",style:{height:"12px"},children:a.jsx("div",{style:{width:`${N}%`,background:"var(--primary)",height:"100%",borderRadius:"4px"}})})]}),a.jsx("div",{className:"visitor-grid",style:{gridTemplateColumns:"repeat(3, 1fr)"},children:(l.length?l:Array.from({length:6},(E,P)=>({numero:P+1}))).map(E=>{var U;const P=E.numero,m=mm[P]||{},w=((U=n==null?void 0:n.dados)==null?void 0:U[`etapa_${P}_ok`])||((n==null?void 0:n.etapa_atual)||1)>P||(n==null?void 0:n.status)==="concluido",D=(n==null?void 0:n.etapa_atual)===P&&(n==null?void 0:n.status)!=="concluido";return a.jsxs("div",{className:"visitor-card",style:D?{border:"2px solid var(--primary)"}:{},children:[a.jsxs("div",{className:"visitor-card-header",children:[a.jsxs("div",{className:"visitor-ip",children:[w?"✅":"⬜"," ",E.emoji||"📋"," ",P,". ",E.nome||`Etapa ${P}`]}),D&&a.jsx("span",{className:"visitor-badge",style:{background:"var(--primary-light)",color:"var(--primary)"},children:"atual"})]}),a.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:1.5},children:m.texto||""}),a.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"8px",flexWrap:"wrap"},children:[m.rota&&a.jsx("button",{className:"btn-outline",style:{fontSize:"11px",padding:"6px 10px"},onClick:()=>t(m.rota),children:m.cta}),P===6?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn-primary",style:{fontSize:"11px",padding:"6px 10px"},onClick:k,children:"📄 Ver relatório"}),(n==null?void 0:n.status)!=="concluido"&&a.jsx("button",{className:"btn-outline",style:{fontSize:"11px",padding:"6px 10px"},onClick:y,children:"✅ Concluir lançamento"})]}):!w&&a.jsx("button",{className:"btn-primary",style:{fontSize:"11px",padding:"6px 10px"},onClick:()=>S(P),children:"✓ Marcar como feito"})]})]},P)})}),a.jsx(ve,{open:v,title:"📄 Relatório de Lançamento",onClose:()=>g(!1),children:o?a.jsxs(a.Fragment,{children:[a.jsx("h4",{style:{fontSize:"14px",marginBottom:"8px"},children:"🛍️ Produto"}),a.jsxs("p",{style:{fontSize:"14px"},children:[((d=o.produto)==null?void 0:d.nome)||"—"," · ",((p=o.produto)==null?void 0:p.plataforma)||""," · nicho ",((j=o.produto)==null?void 0:j.nicho)||"—"]}),((A=(C=o.analysis)==null?void 0:C.analise)==null?void 0:A.resumo)&&a.jsxs("p",{style:{fontSize:"13px",color:"var(--text-muted)",marginTop:"4px"},children:[a.jsx("strong",{children:"Resumo IA:"})," ",o.analysis.analise.resumo]}),a.jsxs("h4",{style:{fontSize:"14px",margin:"16px 0 8px"},children:["🛡️ Páginas (",o.paginas.length,")"]}),o.paginas.length===0?a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)"},children:"Nenhuma página vinculada."}):a.jsx("ul",{className:"placeholder-list",children:o.paginas.map(E=>a.jsxs("li",{children:[E.titulo," (",E.tipo,") — ",E.status,E.published_url?a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:E.published_url,target:"_blank",rel:"noreferrer",style:{color:"var(--primary)"},children:E.published_url})]}):""]},E.id))}),a.jsxs("h4",{style:{fontSize:"14px",margin:"16px 0 8px"},children:["🎯 Campanhas (",o.campanhas.length,")"]}),o.campanhas.length===0?a.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)"},children:"Nenhuma campanha vinculada."}):a.jsx("ul",{className:"placeholder-list",children:o.campanhas.map(E=>{var P,m,w,D;return a.jsxs("li",{children:[E.nome," — ",E.plataforma," · ",E.status," · CPA R$ ",((m=(P=E.cpa_alvo)==null?void 0:P.toFixed)==null?void 0:m.call(P,2))??E.cpa_alvo," · R$ ",((D=(w=E.orcamento_diario)==null?void 0:w.toFixed)==null?void 0:D.call(w,2))??E.orcamento_diario,"/dia"]},E.id)})}),a.jsx("h4",{style:{fontSize:"14px",margin:"16px 0 8px"},children:"✅ Checklist final"}),a.jsx("pre",{style:{whiteSpace:"pre-wrap",fontSize:"12px",color:"var(--text-muted)",fontFamily:"inherit"},children:o.checklist||"Checklist do seed indisponível."})]}):a.jsx("p",{className:"placeholder-note",children:"Carregando…"})})]})}function gm(){const{toast:e}=ie(),t=Re(),[n,r]=f.useState(null),[l,s]=f.useState([]),[i,u]=f.useState(""),[o,c]=f.useState(!0),[v,g]=f.useState(!1),[h,S]=f.useState(!1),y=f.useCallback(async()=>{c(!0);try{const[d,p]=await Promise.all([z.notificacoesConfig(),z.notificacoesHistorico()]);r(d),s(p),u((d.targets||[]).join(`
|
|
71
|
-
`))}catch(d){e(d.message||"Falha ao carregar notificações.")}finally{c(!1)}},[e]);f.useEffect(()=>{y()},[y]);const k=d=>{n&&r({...n,eventos:{...n.eventos,[d]:!n.eventos[d]}})},N=async()=>{g(!0);try{const d=i.split(`
|
|
72
|
-
`).map(j=>j.trim()).filter(Boolean),p=await z.salvarNotificacoes(n.eventos,d);r(p),u((p.targets||[]).join(`
|
|
73
|
-
`)),e("Configuração salva!")}catch(d){e(d.message||"Falha ao salvar.")}finally{g(!1)}},x=async()=>{S(!0);try{await z.testarNotificacao({titulo:"Teste ProdMaker",mensagem:"Notificação de teste do ProdMaker."}),e("Notificação de teste enviada!"),await y()}catch(d){e(d.message||"Falha no teste."),await y()}finally{S(!1)}};return o&&!n?a.jsx("div",{className:"loading-screen",children:"Carregando…"}):a.jsxs("section",{children:[a.jsx("h1",{children:"🔔 Notificações (AdsNotify)"}),a.jsx("p",{className:"subtitle",children:"Push de vendas e conclusões via apprise (Telegram, Discord, e-mail e mais)."}),a.jsxs("div",{className:"form-card",children:[a.jsx("h3",{style:{fontSize:"15px",marginBottom:"10px"},children:"Eventos notificados"}),n&&Object.entries(n.eventos_disponiveis||{}).map(([d,p])=>{var j;return a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",fontWeight:500,marginBottom:"10px",cursor:"pointer"},onClick:C=>C.preventDefault(),children:[a.jsx("input",{type:"checkbox",checked:!!((j=n.eventos)!=null&&j[d]),onChange:()=>k(d),style:{width:"auto"}}),p," ",a.jsxs("span",{style:{color:"var(--text-muted)",fontSize:"12px"},children:["(",d,")"]})]},d)}),a.jsx("h3",{style:{fontSize:"15px",margin:"18px 0 8px"},children:"Canais (URLs apprise — uma por linha)"}),a.jsx("textarea",{rows:4,value:i,onChange:d=>u(d.target.value),placeholder:`discords://WEBHOOK_ID/WEBHOOK_TOKEN
|
|
74
|
-
mailtos://usuario:senha@smtp.com`,style:{fontFamily:"monospace",fontSize:"12px"}}),a.jsxs("p",{className:"placeholder-note",style:{marginBottom:"12px"},children:[n!=null&&n.canal_telegram?"✅ Telegram configurado em Chaves de API — será usado automaticamente.":"💡 Dica: configure Bot Token + Chat ID em Chaves de API → Telegram para receber tudo no seu Telegram."," ",a.jsx("a",{href:"/api-keys",onClick:d=>{d.preventDefault(),t("/api-keys")},children:"Abrir Chaves de API"})]}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("button",{className:"btn-primary",onClick:N,disabled:v,children:v?"Salvando…":"Salvar"}),a.jsx("button",{className:"btn-outline",onClick:x,disabled:h,children:h?"Enviando…":"📨 Enviar teste"})]})]}),a.jsxs("h3",{style:{fontSize:"16px",margin:"24px 0 8px"},children:["Histórico (",l.length,")"]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Evento"}),a.jsx("th",{children:"Título"}),a.jsx("th",{children:"Canal"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:l.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:5,children:"Nenhuma notificação enviada ainda."})}):l.map(d=>a.jsxs("tr",{children:[a.jsx("td",{children:d.created_at}),a.jsx("td",{children:d.event}),a.jsxs("td",{children:[d.titulo,d.erro&&a.jsx("div",{style:{fontSize:"10px",color:"var(--danger)",maxWidth:"260px",wordBreak:"break-word"},children:d.erro.slice(0,90)})]}),a.jsx("td",{style:{fontSize:"11px"},children:d.canal||"—"}),a.jsx("td",{style:{fontWeight:600,fontSize:"12px",color:d.status==="enviada"?"var(--success)":d.status==="erro"?"var(--danger)":"var(--text-muted)"},children:d.status==="enviada"?"✅ enviada":d.status==="erro"?"❌ erro":"⏳ pendente"})]},d.id))})]})]})}const xm={ideia:"💡 Ideia",pronto:"📝 Pronto (imagem criada)",agendado:"📅 Agendado",publicado:"✅ Publicado"};function ym(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState([]),[s,i]=f.useState(""),[u,o]=f.useState(""),[c,v]=f.useState(""),[g,h]=f.useState(10),[S,y]=f.useState(!1),[k,N]=f.useState(!0),[x,d]=f.useState([]),p=f.useCallback(async()=>{N(!0);try{const[m,w]=await Promise.all([z.produtos(),z.pins(s?Number(s):void 0)]);n(m),l(w)}catch(m){e(m.message||"Falha ao carregar pins.")}finally{N(!1)}},[e,s]);f.useEffect(()=>{p()},[p]);const j=async m=>{m.preventDefault(),y(!0);try{const w=await z.pinsGerar({produto_id:s?Number(s):null,board:u,link:c,quantidade:g});e(`${w.gerados} ideias de pin geradas por ${w.provider}!`),await p()}catch(w){e(w.message||"Falha na geração de pins.")}finally{y(!1)}},C=m=>{d(w=>w.includes(m)?w.filter(D=>D!==m):[...w,m])},A=async(m,w)=>{try{await z.pinStatus(m.id,w),await p()}catch(D){e(D.message||"Falha ao atualizar.")}},E=async m=>{try{const w=await z.pinsExport(m),D=new Blob([w.csv],{type:"text/csv"}),U=URL.createObjectURL(D),W=document.createElement("a");W.href=U,W.download="prodmaker-pins.csv",W.click(),URL.revokeObjectURL(U),e("CSV exportado!")}catch(w){e(w.message||"Falha ao exportar.")}},P=async m=>{try{await z.pinRemover(m.id),d(w=>w.filter(D=>D!==m.id)),await p()}catch(w){e(w.message||"Falha ao remover.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"📌 Pinterest — Orgânico"}),a.jsx("p",{className:"subtitle",children:"Pins com SEO apontando para suas presells. Gere ideias por IA, crie as imagens (1000x1500) no Canva/IA e exporte o CSV."}),a.jsx("div",{className:"form-card",children:a.jsxs("form",{onSubmit:j,children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Produto"}),a.jsxs("select",{value:s,onChange:m=>i(m.target.value),children:[a.jsx("option",{value:"",children:"— sem produto —"}),t.map(m=>a.jsx("option",{value:m.id,children:m.nome},m.id))]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Board"}),a.jsx("input",{value:u,onChange:m=>o(m.target.value),placeholder:"Ex.: Saúde e Bem-estar"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Link do pin (presell)"}),a.jsx("input",{value:c,onChange:m=>v(m.target.value),placeholder:"https://..."})]}),a.jsxs("div",{className:"form-group",style:{maxWidth:"120px"},children:[a.jsx("label",{children:"Quantidade"}),a.jsx("input",{type:"number",min:"1",max:"20",value:g,onChange:m=>h(Number(m.target.value))})]})]}),a.jsx("button",{className:"btn-primary",type:"submit",disabled:S,style:{width:"100%"},children:S?"✨ Gerando ideias…":"✨ Gerar ideias de pins com IA"})]})}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"20px 0 8px"},children:[a.jsxs("h3",{style:{fontSize:"16px"},children:["Pins (",r.length,")"]}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsxs("button",{className:"btn-outline",style:{fontSize:"12px",padding:"6px 12px"},onClick:()=>E(x),disabled:x.length===0,children:["📥 Exportar selecionados (",x.length,")"]}),a.jsx("button",{className:"btn-outline",style:{fontSize:"12px",padding:"6px 12px"},onClick:()=>E(r.map(m=>m.id)),disabled:r.length===0,children:"📥 Exportar todos"})]})]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{}),a.jsx("th",{children:"Título"}),a.jsx("th",{children:"Texto na imagem"}),a.jsx("th",{children:"Board"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Ações"})]})}),a.jsx("tbody",{children:k?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Carregando…"})}):r.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Nenhum pin ainda. Gere ideias com IA (precisa de LLM em Chaves de API)."})}):r.map(m=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("input",{type:"checkbox",checked:x.includes(m.id),onChange:()=>C(m.id),style:{width:"auto"}})}),a.jsxs("td",{style:{maxWidth:"220px"},children:[m.titulo,a.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)",maxHeight:"34px",overflow:"hidden"},children:m.descricao})]}),a.jsx("td",{title:m.sugestao_imagem,children:m.texto_imagem}),a.jsx("td",{children:m.board||"—"}),a.jsx("td",{style:{fontSize:"12px",fontWeight:600},children:xm[m.status]||m.status}),a.jsxs("td",{className:"action-icons",children:[m.status==="ideia"&&a.jsx("span",{title:"Marcar como pronto (imagem criada)",onClick:()=>A(m,"pronto"),children:"📝"}),m.status==="pronto"&&a.jsx("span",{title:"Marcar como agendado",onClick:()=>A(m,"agendado"),children:"📅"}),a.jsx("span",{title:"Excluir",onClick:()=>P(m),children:"🗑️"})]})]},m.id))})]}),a.jsx("p",{className:"placeholder-note",style:{marginTop:"16px"},children:"💡 1 pin = 1 imagem vertical 1000x1500 (ou 1000x1000) com o texto em destaque — crie no Canva ou com IA. Mínimo de 5 pins por lançamento (padrão do seed). Agendamento automático via API do Pinterest exige credenciais em Chaves de API (card Pinterest) e pode exigir validação manual por conta."})]})}const jm=["campanha","pagina","infoproduto","venda","notificacao","visita"],Sm=["rascunho","publicada","erro","gerado","aprovada","pendente","enviada","ok"];function wm(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(!0),[s,i]=f.useState(""),[u,o]=f.useState(""),[c,v]=f.useState(""),g=f.useCallback(async()=>{l(!0);try{n(await z.logs())}catch(y){e(y.message||"Falha ao carregar logs.")}finally{l(!1)}},[e]);f.useEffect(()=>{g()},[g]);const h=f.useMemo(()=>{const y=c.trim().toLowerCase();return t.filter(k=>(!s||k.operacao===s)&&(!u||k.estado===u)&&(!y||(k.detalhe||"").toLowerCase().includes(y)||(k.origem||"").toLowerCase().includes(y)))},[t,s,u,c]),S=async y=>{try{await navigator.clipboard.writeText(`${y.data} | ${y.operacao} | ${y.estado} | ${y.origem} | ${y.detalhe}`),e("Linha copiada!")}catch{e("Não foi possível copiar.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"📋 Logs"}),a.jsx("p",{className:"subtitle",children:"Histórico unificado de operações — campanhas, páginas, vendas, notificações e visitas."}),a.jsxs("div",{className:"form-card",style:{display:"flex",gap:"10px",flexWrap:"wrap",alignItems:"flex-end"},children:[a.jsxs("div",{className:"form-group",style:{marginBottom:0,minWidth:"150px"},children:[a.jsx("label",{children:"Operação"}),a.jsxs("select",{value:s,onChange:y=>i(y.target.value),children:[a.jsx("option",{value:"",children:"Todas"}),jm.map(y=>a.jsx("option",{value:y,children:y},y))]})]}),a.jsxs("div",{className:"form-group",style:{marginBottom:0,minWidth:"130px"},children:[a.jsx("label",{children:"Estado"}),a.jsxs("select",{value:u,onChange:y=>o(y.target.value),children:[a.jsx("option",{value:"",children:"Todos"}),Sm.map(y=>a.jsx("option",{value:y,children:y},y))]})]}),a.jsxs("div",{className:"form-group",style:{marginBottom:0,flex:1,minWidth:"180px"},children:[a.jsx("label",{children:"Busca livre"}),a.jsx("input",{value:c,onChange:y=>v(y.target.value),placeholder:"produto, IP, erro..."})]}),a.jsx("button",{className:"btn-outline",onClick:g,style:{marginBottom:"0"},children:"🔄 Atualizar"})]}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Data"}),a.jsx("th",{children:"Operação"}),a.jsx("th",{children:"Estado"}),a.jsx("th",{children:"Origem"}),a.jsx("th",{children:"Detalhes"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:r?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Carregando…"})}):h.length===0?a.jsx("tr",{className:"empty-row",children:a.jsx("td",{colSpan:6,children:"Nenhum registro com os filtros atuais."})}):h.slice(0,200).map((y,k)=>a.jsxs("tr",{children:[a.jsx("td",{style:{whiteSpace:"nowrap"},children:y.data}),a.jsx("td",{children:y.operacao}),a.jsx("td",{style:{fontWeight:600,fontSize:"12px",color:y.estado==="erro"?"var(--danger)":y.estado==="publicada"||y.estado==="enviada"||y.estado==="agendado"?"var(--success)":"var(--text-muted)"},children:y.estado}),a.jsx("td",{children:y.origem}),a.jsx("td",{style:{maxWidth:"340px"},children:y.detalhe}),a.jsx("td",{className:"action-icons",children:a.jsx("span",{title:"Copiar",onClick:()=>S(y),children:"📋"})})]},`${y.data}-${k}`))})]}),a.jsxs("p",{className:"placeholder-note",style:{marginTop:"12px"},children:["Exibindo ",Math.min(h.length,200)," de ",h.length," registro(s) (limite de 200 por tela)."]})]})}const km=[{pergunta:"O que é o ProdMaker?",resposta:"Aplicativo local (SaaS na sua máquina) para criar infoprodutos, landing pages, campanhas de tráfego e tracking — tudo em um painel, acessado pelo navegador em http://localhost:8188."},{pergunta:"Como faço login?",resposta:"Use qualquer e-mail + o Código de Ativação Mestre impresso no terminal ao iniciar (padrão: 1234). O alias 'admin' também funciona. Para um código próprio, defina a variável PRODMAKER_MASTER_CODE antes de iniciar."},{pergunta:"O ProdMaker abre o navegador sozinho?",resposta:"Nunca (REGRA ZERO). Ao iniciar, o launcher apenas imprime a URL no terminal — você abre manualmente."},{pergunta:"Preciso de chaves de API?",resposta:"Para IA (NVIDIA NIM ou Google Gemini) sim — configure em Chaves de API. Sem chave, o app funciona mas a geração de conteúdo/páginas/criativos fica indisponível (mensagem clara informa). Para tracking local não precisa de nada."},{pergunta:"Como publico minhas páginas?",resposta:"Configure GitHub (PAT + repositório) em Chaves de API e publique em Páginas Criadas. Se o repositório estiver conectado a um projeto no Cloudflare Pages, o deploy acontece automaticamente."},{pergunta:"Como configuro o rastreamento?",resposta:"Em Chaves de API → Pixel de Rastreamento, informe a URL pública do /track (use um túnel cloudflared/ngrok apontando para localhost:8188). O pixel é embutido automaticamente nas páginas geradas."},{pergunta:"Como recebo notificações de vendas?",resposta:"Configure Bot Token + Chat ID do Telegram em Chaves de API (ou URLs apprise de Discord/e-mail em Notificações) e ligue os eventos desejados."},{pergunta:"Onde ficam meus dados?",resposta:"Na pasta PRODMAKER_HOME (padrão: C:\\Users\\<usuário>\\Documents\\REPOSITORIO\\ProdMaker ou seu ~\\ProdMaker) — nada sai da sua máquina, exceto o que as integrações configuradas enviam às plataformas."}];function Cm(){const{toast:e}=ie(),[t,n]=f.useState([]),[r,l]=f.useState(null),[s,i]=f.useState(null),u=f.useCallback(async()=>{try{n(await z.guias())}catch(c){e(c.message||"Falha ao carregar guias.")}},[e]);f.useEffect(()=>{u()},[u]);const o=async c=>{try{l(await z.guia(c))}catch(v){e(v.message||"Falha ao abrir guia.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"❓ FAQ & Documentação"}),a.jsx("p",{className:"subtitle",children:"Perguntas frequentes, guias de configuração e documentos legais."}),a.jsx("div",{className:"faq-container",children:km.map((c,v)=>a.jsxs("div",{className:`faq-item ${s===v?"active":""}`,children:[a.jsxs("button",{className:"faq-question",onClick:()=>i(s===v?null:v),children:[c.pergunta," ",a.jsx("span",{children:s===v?"▲":"▼"})]}),a.jsx("div",{className:"faq-answer",children:a.jsx("p",{children:c.resposta})})]},v))}),a.jsx("h3",{style:{fontSize:"16px",margin:"28px 0 10px"},children:"📚 Guias de referência"}),a.jsxs("div",{className:"metrics-grid",style:{gridTemplateColumns:"repeat(3, 1fr)"},children:[t.length===0?a.jsxs("div",{className:"metric-card",children:[a.jsx("h3",{children:"Sem guias"}),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)"},children:"Nenhum guia em seed/references."})]}):t.map(c=>a.jsxs("div",{className:"metric-card",style:{cursor:"pointer"},onClick:()=>o(c.arquivo),children:[a.jsx("h3",{children:c.titulo}),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)"},children:c.arquivo})]},c.arquivo)),a.jsxs("div",{className:"metric-card",style:{cursor:"pointer"},onClick:()=>window.open("/legal/index.html","_blank"),children:[a.jsx("h3",{children:"⚖️ Verificação de aplicação"}),a.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)"},children:"/legal — index, privacidade (LGPD), termos"})]})]}),r&&a.jsxs("div",{className:"form-card",style:{marginTop:"20px"},children:[a.jsx("h3",{style:{fontSize:"16px",marginBottom:"10px"},children:r.arquivo}),a.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit",fontSize:"13px",lineHeight:1.6,color:"var(--text-main)"},children:r.conteudo})]})]})}function Nm(){var h;const{toast:e}=ie(),[t,n]=f.useState(null),[r,l]=f.useState(!0),[s,i]=f.useState(!1),u=f.useCallback(async()=>{l(!0);try{n(await z.settings())}catch(S){e(S.message||"Falha ao carregar configurações.")}finally{l(!1)}},[e]);f.useEffect(()=>{u()},[u]);const o=((h=t==null?void 0:t.api_keys)==null?void 0:h["google-ads"])||{},c=!!(o.connected_at||(o.refresh_token||"").trim()),v=!!(o.client_id||"").trim(),g=async()=>{i(!0);try{const S=await z.googleOAuthUrl(),y=window.open(S.url,"google_oauth","width=520,height=640");if(!y){e("O navegador bloqueou o popup — permita popups para o ProdMaker.");return}const k=setInterval(async()=>{y.closed&&(clearInterval(k),i(!1),await u(),e("Verificando conexão do Google…"))},800)}catch(S){i(!1),e(S.message||"Falha ao iniciar o OAuth.")}};return a.jsxs("section",{children:[a.jsx("h1",{children:"🔑 Contas do Google"}),a.jsx("p",{className:"subtitle",children:"Conecte sua conta do Google Ads com 1 clique — o Refresh Token é gerado e salvo automaticamente."}),a.jsx("div",{className:"domain-grid",style:{gridTemplateColumns:"1fr"},children:a.jsxs("div",{className:"domain-card",style:{minHeight:"auto"},children:[a.jsxs("div",{children:[a.jsx("div",{className:"domain-title",children:"🔑 Google Ads"}),c?a.jsxs("div",{className:"status-tag online",children:["✅ Conta conectada ",o.connected_at?`em ${o.connected_at.slice(0,10)}`:""]}):a.jsx("div",{className:"status-tag pending",children:"⏳ Conta não conectada"}),a.jsxs("ul",{className:"domain-list",children:[a.jsxs("li",{children:["🧾 OAuth Client ID: ",v?"configurado":"— configure em Chaves de API"]}),a.jsxs("li",{children:["🔄 Refresh Token: ",c?"gerado automaticamente ✅":"— gerado ao conectar"]}),a.jsxs("li",{children:["🧮 Developer Token / Customer ID: ",(o.developer_token||"").trim()?"configurado":"— configure em Chaves de API"]})]}),a.jsxs("p",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:1.6},children:[a.jsx("strong",{children:"Como funciona:"})," salve o ",a.jsx("code",{children:"OAuth Client ID"})," e ",a.jsx("code",{children:"Client Secret"})," do Google Cloud em Chaves de API (card Google Ads) e clique em conectar. No Google Cloud, autorize a URL de redirect ",a.jsx("code",{children:"http://localhost:8188/api/google/callback"}),' (tipo "Web" ou "Desktop app"). O ProdMaker abre o consentimento, troca o código e salva o refresh token — sem colar nada à mão.']})]}),a.jsxs("div",{className:"domain-card-bottom",children:[a.jsx("div",{className:"domain-actions",children:a.jsx("button",{className:"btn-primary",onClick:g,disabled:s||!v,children:s?"Aguardando autorização…":c?"🔁 Reconectar conta":"🔗 Conectar com Google (1 clique)"})}),!v&&a.jsx("p",{style:{fontSize:"12px",color:"var(--warning)"},children:"Configure primeiro o OAuth Client ID em Chaves de API → Google Ads."})]})]})}),r&&a.jsx("p",{className:"placeholder-note",children:"Carregando…"})]})}const us=f.createContext(null),li=()=>f.useContext(us);function Em(){const[e,t]=f.useState(()=>localStorage.getItem("prodmaker_theme")||"light");f.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem("prodmaker_theme",e)},[e]);const n=f.useCallback(()=>t(r=>r==="light"?"dark":"light"),[]);return{theme:e,toggleTheme:n}}function Pm(){const[e,t]=f.useState(null),[n,r]=f.useState(!0),[l,s]=f.useState(""),{theme:i,toggleTheme:u}=Em(),o=Sr(),c=f.useCallback(async()=>{try{t(await z.session())}catch{t({authenticated:!1})}finally{r(!1)}},[]);f.useEffect(()=>{c()},[c]),f.useEffect(()=>{z.version().then(y=>s(y.version)).catch(()=>{})},[]);const v=f.useCallback(async(y,k)=>{const N=await z.login(y,k);return await c(),N},[c]),g=f.useCallback(async()=>{await z.logout().catch(()=>{}),await c()},[c]),h=o.pathname==="/login",S=e==null?void 0:e.authenticated;return h?a.jsx(us.Provider,{value:{session:e,loading:n,version:l,login:v,logout:g,theme:i,toggleTheme:u},children:a.jsx(Dh,{})}):n?a.jsx("div",{className:"loading-screen",children:"Carregando…"}):S?a.jsx(us.Provider,{value:{session:e,loading:n,version:l,login:v,logout:g,theme:i,toggleTheme:u},children:a.jsx(zh,{children:a.jsxs("div",{className:"app-shell",children:[a.jsx(Ah,{}),a.jsxs("main",{className:"main-content",children:[a.jsx(Ih,{}),a.jsx("div",{className:"content-wrapper",children:a.jsxs(Ph,{children:[a.jsx(te,{path:"/",element:a.jsx(Mh,{})}),a.jsx(te,{path:"/dashboard",element:a.jsx(Bh,{})}),a.jsx(te,{path:"/hosting/dominios",element:a.jsx(rm,{})}),a.jsx(te,{path:"/hosting/paginas",element:a.jsx(nm,{})}),a.jsx(te,{path:"/studio",element:a.jsx(Qh,{})}),a.jsx(te,{path:"/studio/biblioteca",element:a.jsx(Kh,{})}),a.jsx(te,{path:"/adspages",element:a.jsx(Zh,{})}),a.jsx(te,{path:"/adswords",element:a.jsx(pm,{})}),a.jsx(te,{path:"/adscreator",element:a.jsx(hm,{})}),a.jsx(te,{path:"/tracking/visitas",element:a.jsx(sm,{})}),a.jsx(te,{path:"/tracking/vendas",element:a.jsx(um,{})}),a.jsx(te,{path:"/tracking/gclid",element:a.jsx(dm,{})}),a.jsx(te,{path:"/adsbot",element:a.jsx(vm,{})}),a.jsx(te,{path:"/pinterest",element:a.jsx(ym,{})}),a.jsx(te,{path:"/contas-google",element:a.jsx(Nm,{})}),a.jsx(te,{path:"/api-keys",element:a.jsx(Wh,{})}),a.jsx(te,{path:"/notificacoes",element:a.jsx(gm,{})}),a.jsx(te,{path:"/logs",element:a.jsx(wm,{})}),a.jsx(te,{path:"/faq",element:a.jsx(Cm,{})}),a.jsx(te,{path:"*",element:a.jsx(wo,{to:"/",replace:!0})})]})})]})]})})}):a.jsx(wo,{to:"/login",replace:!0})}Gc(document.getElementById("root")).render(a.jsx(Vo.StrictMode,{children:a.jsx(Lh,{children:a.jsx(Pm,{})})}));
|