htmlcraft 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,737 @@
1
+ var z1=Object.defineProperty;var _1=(r,a,i)=>a in r?z1(r,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[a]=i;var _r=(r,a,i)=>_1(r,typeof a!="symbol"?a+"":a,i);(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(u){if(u.ep)return;u.ep=!0;const d=i(u);fetch(u.href,d)}})();var Op={exports:{}},ks={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and 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 pb;function k1(){if(pb)return ks;pb=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(s,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var m in u)m!=="key"&&(d[m]=u[m])}else d=u;return u=d.ref,{$$typeof:r,type:s,key:h,ref:u!==void 0?u:null,props:d}}return ks.Fragment=a,ks.jsx=i,ks.jsxs=i,ks}var hb;function H1(){return hb||(hb=1,Op.exports=k1()),Op.exports}var g=H1(),Dp={exports:{}},Hs={},Rp={exports:{}},jp={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and 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 mb;function L1(){return mb||(mb=1,(function(r){function a(z,ce){var ie=z.length;z.push(ce);e:for(;0<ie;){var Ge=ie-1>>>1,Ve=z[Ge];if(0<u(Ve,ce))z[Ge]=ce,z[ie]=Ve,ie=Ge;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var ce=z[0],ie=z.pop();if(ie!==ce){z[0]=ie;e:for(var Ge=0,Ve=z.length,St=Ve>>>1;Ge<St;){var rt=2*(Ge+1)-1,Pt=z[rt],O=rt+1,P=z[O];if(0>u(Pt,ie))O<Ve&&0>u(P,Pt)?(z[Ge]=P,z[O]=ie,Ge=O):(z[Ge]=Pt,z[rt]=ie,Ge=rt);else if(O<Ve&&0>u(P,ie))z[Ge]=P,z[O]=ie,Ge=O;else break e}}return ce}function u(z,ce){var ie=z.sortIndex-ce.sortIndex;return ie!==0?ie:z.id-ce.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();r.unstable_now=function(){return h.now()-m}}var y=[],b=[],E=1,v=null,C=3,A=!1,B=!1,D=!1,G=!1,ae=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var ce=i(b);ce!==null;){if(ce.callback===null)s(b);else if(ce.startTime<=z)s(b),ce.sortIndex=ce.expirationTime,a(y,ce);else break;ce=i(b)}}function re(z){if(D=!1,R(z),!B)if(i(y)!==null)B=!0,ve||(ve=!0,He());else{var ce=i(b);ce!==null&&Pe(re,ce.startTime-z)}}var ve=!1,Z=-1,Se=5,st=-1;function Ue(){return G?!0:!(r.unstable_now()-st<Se)}function De(){if(G=!1,ve){var z=r.unstable_now();st=z;var ce=!0;try{e:{B=!1,D&&(D=!1,se(Z),Z=-1),A=!0;var ie=C;try{t:{for(R(z),v=i(y);v!==null&&!(v.expirationTime>z&&Ue());){var Ge=v.callback;if(typeof Ge=="function"){v.callback=null,C=v.priorityLevel;var Ve=Ge(v.expirationTime<=z);if(z=r.unstable_now(),typeof Ve=="function"){v.callback=Ve,R(z),ce=!0;break t}v===i(y)&&s(y),R(z)}else s(y);v=i(y)}if(v!==null)ce=!0;else{var St=i(b);St!==null&&Pe(re,St.startTime-z),ce=!1}}break e}finally{v=null,C=ie,A=!1}ce=void 0}}finally{ce?He():ve=!1}}}var He;if(typeof Y=="function")He=function(){Y(De)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,pt=xe.port2;xe.port1.onmessage=De,He=function(){pt.postMessage(null)}}else He=function(){ae(De,0)};function Pe(z,ce){Z=ae(function(){z(r.unstable_now())},ce)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(z){z.callback=null},r.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<z?Math.floor(1e3/z):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_next=function(z){switch(C){case 1:case 2:case 3:var ce=3;break;default:ce=C}var ie=C;C=ce;try{return z()}finally{C=ie}},r.unstable_requestPaint=function(){G=!0},r.unstable_runWithPriority=function(z,ce){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ie=C;C=z;try{return ce()}finally{C=ie}},r.unstable_scheduleCallback=function(z,ce,ie){var Ge=r.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?Ge+ie:Ge):ie=Ge,z){case 1:var Ve=-1;break;case 2:Ve=250;break;case 5:Ve=1073741823;break;case 4:Ve=1e4;break;default:Ve=5e3}return Ve=ie+Ve,z={id:E++,callback:ce,priorityLevel:z,startTime:ie,expirationTime:Ve,sortIndex:-1},ie>Ge?(z.sortIndex=ie,a(b,z),i(y)===null&&z===i(b)&&(D?(se(Z),Z=-1):D=!0,Pe(re,ie-Ge))):(z.sortIndex=Ve,a(y,z),B||A||(B=!0,ve||(ve=!0,He()))),z},r.unstable_shouldYield=Ue,r.unstable_wrapCallback=function(z){var ce=C;return function(){var ie=C;C=ce;try{return z.apply(this,arguments)}finally{C=ie}}}})(jp)),jp}var gb;function U1(){return gb||(gb=1,Rp.exports=L1()),Rp.exports}var Mp={exports:{}},Ie={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and 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
+ */var yb;function B1(){if(yb)return Ie;yb=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.for("react.view_transition"),A=Symbol.iterator;function B(O){return O===null||typeof O!="object"?null:(O=A&&O[A]||O["@@iterator"],typeof O=="function"?O:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,ae={};function se(O,P,te){this.props=O,this.context=P,this.refs=ae,this.updater=te||D}se.prototype.isReactComponent={},se.prototype.setState=function(O,P){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,P,"setState")},se.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function Y(){}Y.prototype=se.prototype;function R(O,P,te){this.props=O,this.context=P,this.refs=ae,this.updater=te||D}var re=R.prototype=new Y;re.constructor=R,G(re,se.prototype),re.isPureReactComponent=!0;var ve=Array.isArray;function Z(){}var Se={H:null,A:null,T:null,S:null},st=Object.prototype.hasOwnProperty;function Ue(O,P,te){var we=te.ref;return{$$typeof:r,type:O,key:P,ref:we!==void 0?we:null,props:te}}function De(O,P){return Ue(O.type,P,O.props)}function He(O){return typeof O=="object"&&O!==null&&O.$$typeof===r}function xe(O){var P={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(te){return P[te]})}var pt=/\/+/g;function Pe(O,P){return typeof O=="object"&&O!==null&&O.key!=null?xe(""+O.key):P.toString(36)}function z(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(Z,Z):(O.status="pending",O.then(function(P){O.status==="pending"&&(O.status="fulfilled",O.value=P)},function(P){O.status==="pending"&&(O.status="rejected",O.reason=P)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function ce(O,P,te,we,Ye){var $e=typeof O;($e==="undefined"||$e==="boolean")&&(O=null);var Ae=!1;if(O===null)Ae=!0;else switch($e){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(O.$$typeof){case r:case a:Ae=!0;break;case E:return Ae=O._init,ce(Ae(O._payload),P,te,we,Ye)}}if(Ae)return Ye=Ye(O),Ae=we===""?"."+Pe(O,0):we,ve(Ye)?(te="",Ae!=null&&(te=Ae.replace(pt,"$&/")+"/"),ce(Ye,P,te,"",function(at){return at})):Ye!=null&&(He(Ye)&&(Ye=De(Ye,te+(Ye.key==null||O&&O.key===Ye.key?"":(""+Ye.key).replace(pt,"$&/")+"/")+Ae)),P.push(Ye)),1;Ae=0;var ge=we===""?".":we+":";if(ve(O))for(var Ne=0;Ne<O.length;Ne++)we=O[Ne],$e=ge+Pe(we,Ne),Ae+=ce(we,P,te,$e,Ye);else if(Ne=B(O),typeof Ne=="function")for(O=Ne.call(O),Ne=0;!(we=O.next()).done;)we=we.value,$e=ge+Pe(we,Ne++),Ae+=ce(we,P,te,$e,Ye);else if($e==="object"){if(typeof O.then=="function")return ce(z(O),P,te,we,Ye);throw P=String(O),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function ie(O,P,te){if(O==null)return O;var we=[],Ye=0;return ce(O,we,"","",function($e){return P.call(te,$e,Ye++)}),we}function Ge(O){if(O._status===-1){var P=O._result,te=P();te.then(function(we){(O._status===0||O._status===-1)&&(O._status=1,O._result=we,te.status===void 0&&(te.status="fulfilled",te.value=we))},function(we){(O._status===0||O._status===-1)&&(O._status=2,O._result=we,te.status===void 0&&(te.status="rejected",te.reason=we))}),O._status===-1&&(O._status=0,O._result=te)}if(O._status===1)return O._result.default;throw O._result}var Ve=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function St(O){var P=Se.T,te={};te.types=P!==null?P.types:null,Se.T=te;try{var we=O(),Ye=Se.S;Ye!==null&&Ye(te,we),typeof we=="object"&&we!==null&&typeof we.then=="function"&&we.then(Z,Ve)}catch($e){Ve($e)}finally{P!==null&&te.types!==null&&(P.types=te.types),Se.T=P}}function rt(O){var P=Se.T;if(P!==null){var te=P.types;te===null?P.types=[O]:te.indexOf(O)===-1&&te.push(O)}else St(rt.bind(null,O))}var Pt={map:ie,forEach:function(O,P,te){ie(O,function(){P.apply(this,arguments)},te)},count:function(O){var P=0;return ie(O,function(){P++}),P},toArray:function(O){return ie(O,function(P){return P})||[]},only:function(O){if(!He(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ie.Activity=v,Ie.Children=Pt,Ie.Component=se,Ie.Fragment=i,Ie.Profiler=u,Ie.PureComponent=R,Ie.StrictMode=s,Ie.Suspense=y,Ie.ViewTransition=C,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Se,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(O){return Se.H.useMemoCache(O)}},Ie.addTransitionType=rt,Ie.cache=function(O){return function(){return O.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(O,P,te){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var we=G({},O.props),Ye=O.key;if(P!=null)for($e in P.key!==void 0&&(Ye=""+P.key),P)!st.call(P,$e)||$e==="key"||$e==="__self"||$e==="__source"||$e==="ref"&&P.ref===void 0||(we[$e]=P[$e]);var $e=arguments.length-2;if($e===1)we.children=te;else if(1<$e){for(var Ae=Array($e),ge=0;ge<$e;ge++)Ae[ge]=arguments[ge+2];we.children=Ae}return Ue(O.type,Ye,we)},Ie.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:d,_context:O},O},Ie.createElement=function(O,P,te){var we,Ye={},$e=null;if(P!=null)for(we in P.key!==void 0&&($e=""+P.key),P)st.call(P,we)&&we!=="key"&&we!=="__self"&&we!=="__source"&&(Ye[we]=P[we]);var Ae=arguments.length-2;if(Ae===1)Ye.children=te;else if(1<Ae){for(var ge=Array(Ae),Ne=0;Ne<Ae;Ne++)ge[Ne]=arguments[Ne+2];Ye.children=ge}if(O&&O.defaultProps)for(we in Ae=O.defaultProps,Ae)Ye[we]===void 0&&(Ye[we]=Ae[we]);return Ue(O,$e,Ye)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(O){return{$$typeof:m,render:O}},Ie.isValidElement=He,Ie.lazy=function(O){return{$$typeof:E,_payload:{_status:-1,_result:O},_init:Ge}},Ie.memo=function(O,P){return{$$typeof:b,type:O,compare:P===void 0?null:P}},Ie.startTransition=St,Ie.unstable_useCacheRefresh=function(){return Se.H.useCacheRefresh()},Ie.use=function(O){return Se.H.use(O)},Ie.useActionState=function(O,P,te){return Se.H.useActionState(O,P,te)},Ie.useCallback=function(O,P){return Se.H.useCallback(O,P)},Ie.useContext=function(O){return Se.H.useContext(O)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(O,P){return Se.H.useDeferredValue(O,P)},Ie.useEffect=function(O,P){return Se.H.useEffect(O,P)},Ie.useEffectEvent=function(O){return Se.H.useEffectEvent(O)},Ie.useId=function(){return Se.H.useId()},Ie.useImperativeHandle=function(O,P,te){return Se.H.useImperativeHandle(O,P,te)},Ie.useInsertionEffect=function(O,P){return Se.H.useInsertionEffect(O,P)},Ie.useLayoutEffect=function(O,P){return Se.H.useLayoutEffect(O,P)},Ie.useMemo=function(O,P){return Se.H.useMemo(O,P)},Ie.useOptimistic=function(O,P){return Se.H.useOptimistic(O,P)},Ie.useReducer=function(O,P,te){return Se.H.useReducer(O,P,te)},Ie.useRef=function(O){return Se.H.useRef(O)},Ie.useState=function(O){return Se.H.useState(O)},Ie.useSyncExternalStore=function(O,P,te){return Se.H.useSyncExternalStore(O,P,te)},Ie.useTransition=function(){return Se.H.useTransition()},Ie.version="19.3.1",Ie}var bb;function uh(){return bb||(bb=1,Mp.exports=B1()),Mp.exports}var zp={exports:{}},bn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and 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 vb;function I1(){if(vb)return bn;vb=1;var r=uh();function a(E){var v="https://react.dev/errors/"+E;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)v+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+E+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),h=Symbol.for("react.optimistic_key");function m(E,v,C){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:A==null?null:A===h?h:""+A,children:E,containerInfo:v,implementation:C}}var y=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(E,v){if(E==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,bn.browser=function(E){return{$$typeof:d,_reason:E}},bn.createPortal=function(E,v){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(a(299));return m(E,v,null,C)},bn.flushSync=function(E){var v=y.T,C=s.p;try{if(y.T=null,s.p=2,E)return E()}finally{y.T=v,s.p=C,s.d.f()}},bn.preconnect=function(E,v){typeof E=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,s.d.C(E,v))},bn.prefetchDNS=function(E){typeof E=="string"&&s.d.D(E)},bn.preinit=function(E,v){if(typeof E=="string"&&v&&typeof v.as=="string"){var C=v.as,A=b(C,v.crossOrigin),B=typeof v.integrity=="string"?v.integrity:void 0,D=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;C==="style"?s.d.S(E,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:A,integrity:B,fetchPriority:D}):C==="script"&&s.d.X(E,{crossOrigin:A,integrity:B,fetchPriority:D,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},bn.preinitModule=function(E,v){if(typeof E=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var C=b(v.as,v.crossOrigin);s.d.M(E,{crossOrigin:C,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}}else v==null&&s.d.M(E)},bn.preload=function(E,v){if(typeof E=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var C=v.as,A=b(C,v.crossOrigin);s.d.L(E,C,{crossOrigin:A,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},bn.preloadModule=function(E,v){if(typeof E=="string")if(v){var C=b(v.as,v.crossOrigin);s.d.m(E,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:C,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}else s.d.m(E)},bn.requestFormReset=function(E){s.d.r(E)},bn.unstable_batchedUpdates=function(E,v){return E(v)},bn.useFormState=function(E,v,C){return y.H.useFormState(E,v,C)},bn.useFormStatus=function(){return y.H.useHostTransitionStatus()},bn.version="19.3.1",bn}var xb;function Ov(){if(xb)return zp.exports;xb=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),zp.exports=I1(),zp.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Sb;function q1(){if(Sb)return Hs;Sb=1;var r=U1(),a=uh(),i=Ov();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function h(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 m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(d(e)!==e)throw Error(s(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return y(o),e;if(c===l)return y(o),t;c=c.sibling}throw Error(s(188))}if(n.return!==l.return)n=o,l=c;else{for(var f=!1,x=o.child;x;){if(x===n){f=!0,n=o,l=c;break}if(x===l){f=!0,l=o,n=c;break}x=x.sibling}if(!f){for(x=c.child;x;){if(x===n){f=!0,n=c,l=o;break}if(x===l){f=!0,l=c,n=o;break}x=x.sibling}if(!f)throw Error(s(189))}}if(n.alternate!==l)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}function v(e,t,n,l,o,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,l,o,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&v(e.child,t,n,l,o,c))return!0;e=e.sibling}return!1}function C(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function A(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function B(e){var t=[null,null],n=C(e);return n===null||D(t,e,n.child,{foundSelf:!1}),t}function D(e,t,n,l){for(;n!==null;){if(n===t)l.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(l.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&D(e,t,n.child,l))return!0;n=n.sibling}return!1}function G(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var ae=null,se=null;function Y(e,t,n){return e===n?!0:e===t?(ae=e,!0):!1}function R(e,t,n){return e===n?(se=e,!1):e===t?(se!==null&&(ae=e),!0):!1}function re(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ve(e,t,n){for(var l=0,o=e;o;o=n(o))l++;o=0;for(var c=t;c;c=n(c))o++;for(;0<l-o;)e=n(e),l--;for(;0<o-l;)t=n(t),o--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var Z=Object.assign,Se=Symbol.for("react.element"),st=Symbol.for("react.transitional.element"),Ue=Symbol.for("react.portal"),De=Symbol.for("react.fragment"),He=Symbol.for("react.strict_mode"),xe=Symbol.for("react.profiler"),pt=Symbol.for("react.consumer"),Pe=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),Ge=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),St=Symbol.for("react.activity"),rt=Symbol.for("react.legacy_hidden"),Pt=Symbol.for("react.memo_cache_sentinel"),O=Symbol.for("react.view_transition"),P=Symbol.for("react.recoverable"),te=Symbol.iterator;function we(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Symbol.for("react.client.reference");function $e(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case De:return"Fragment";case xe:return"Profiler";case He:return"StrictMode";case ce:return"Suspense";case ie:return"SuspenseList";case St:return"Activity";case O:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Ue:return"Portal";case Pe:return e.displayName||"Context";case pt:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ge:return t=e.displayName||null,t!==null?t:$e(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return $e(e(t))}catch{}}return null}var Ae=Array.isArray,ge=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,at={pending:!1,data:null,method:null,action:null},kn=[],rn=-1;function Rt(e){return{current:e}}function wt(e){0>rn||(e.current=kn[rn],kn[rn]=null,rn--)}function tt(e,t){rn++,kn[rn]=e.current,e.current=t}var Vt=Rt(null),Wt=Rt(null),Lt=Rt(null),xn=Rt(null);function Hn(e,t){switch(tt(Lt,t),tt(Wt,e),tt(Vt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wy(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wy(t),e=Ey(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}wt(Vt),tt(Vt,e)}function Ut(){wt(Vt),wt(Wt),wt(Lt)}function Sn(e){var t=e.memoizedState;t!==null&&(yo._currentValue=t.memoizedState,tt(xn,e)),t=Vt.current;var n=Ey(t,e.type);t!==n&&(tt(Wt,e),tt(Vt,n))}function Ln(e){Wt.current===e&&(wt(Vt),wt(Wt)),xn.current===e&&(wt(xn),yo._currentValue=at)}var Zn,F;function ee(e){if(Zn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Zn=t&&t[1]||"",F=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Zn+e+F}var ne=!1;function pe(e,t){if(!e||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(de){var _=de}Reflect.construct(e,[],K)}else{try{K.call()}catch(de){_=de}K=!1;try{var U=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),K=!0,new e}finally{K&&(U!==void 0?Object.defineProperty(e.prototype,"props",U):delete e.prototype.props)}}}else{try{throw Error()}catch(de){_=de}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(de){if(de&&_&&typeof de.stack=="string")return[de.stack,_.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),f=c[0],x=c[1];if(f&&x){var N=f.split(`
44
+ `),H=x.split(`
45
+ `);for(o=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;o<H.length&&!H[o].includes("DetermineComponentFrameRoot");)o++;if(l===N.length||o===H.length)for(l=N.length-1,o=H.length-1;1<=l&&0<=o&&N[l]!==H[o];)o--;for(;1<=l&&0<=o;l--,o--)if(N[l]!==H[o]){if(l!==1||o!==1)do if(l--,o--,0>o||N[l]!==H[o]){var q=`
46
+ `+N[l].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=l&&0<=o);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function ue(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&t!==null?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return ee("Activity");case 30:return ee("ViewTransition");default:return""}}function he(e){try{var t="",n=null;do t+=ue(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var qe=Object.prototype.hasOwnProperty,Me=r.unstable_scheduleCallback,Fe=r.unstable_cancelCallback,vt=r.unstable_shouldYield,J=r.unstable_requestPaint,oe=r.unstable_now,Ze=r.unstable_getCurrentPriorityLevel,Le=r.unstable_ImmediatePriority,At=r.unstable_UserBlockingPriority,en=r.unstable_NormalPriority,Nl=r.unstable_LowPriority,oc=r.unstable_IdlePriority,Br=r.log,ad=r.unstable_setDisableYieldValue,Gl=null,zt=null;function Fn(e){if(typeof Br=="function"&&ad(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(Gl,e)}catch{}}var Tn=Math.clz32?Math.clz32:pr,fr=Math.log,hi=Math.LN2;function pr(e){return e>>>=0,e===0?32:31-(fr(e)/hi|0)|0}var Ir=256,qr=262144,mi=4194304;function Yl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ra(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~c,l!==0?o=Yl(l):(f&=x,f!==0?o=Yl(f):n||(n=x&~e,n!==0&&(o=Yl(n))))):(x=l&~c,x!==0?o=Yl(x):f!==0?o=Yl(f):n||(n=l&~e,n!==0&&(o=Yl(n)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:o}function Vl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Io(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-Tn(n),o=1<<l;t|=e[l],n&=~o}return t}function qo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sc(){var e=mi;return mi<<=1,(mi&62914560)===0&&(mi=4194304),e}function Go(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ja(e,t,n,l,o,c){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,N=e.expirationTimes,H=e.hiddenUpdates;for(n=f&~n;0<n;){var q=31-Tn(n),K=1<<q;x[q]=0,N[q]=-1;var _=H[q];if(_!==null)for(H[q]=null,q=0;q<_.length;q++){var U=_[q];U!==null&&(U.lane&=-536870913)}n&=~K}l!==0&&Yo(e,l,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Yo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Tn(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Gr(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Tn(n),o=1<<l;o&t|e[l]&t&&(e[l]|=t),n&=~o}}function hr(e,t){var n=t&-t;return n=(n&42)!==0?1:Kl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Kl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cn(){var e=Ne.p;return e!==0?e:(e=window.event,e===void 0?32:ib(e.type))}function mr(e,t){var n=Ne.p;try{return Ne.p=e,t()}finally{Ne.p=n}}var Ot=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Ot,tn="__reactProps$"+Ot,Nn="__reactContainer$"+Ot,Al="__reactEvents$"+Ot,yi="__reactListeners$"+Ot,gr="__reactHandles$"+Ot,bi="__reactResources$"+Ot,yr="__reactMarker$"+Ot,Ma="__reactLoad$"+Ot;function An(e){delete e[Kt],delete e[tn],delete e[yi],delete e[gr]}function Un(e){var t;if(t=e[Kt])return t;for(var n=e.parentNode;n;){if(t=n[Nn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Iy(e);e!==null;){if(n=e[Kt])return n;e=Iy(e)}return t}e=n,n=e.parentNode}return null}function Gt(e){if(e=e[Kt]||e[Nn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Jn(e){var t=e[bi];return t||(t=e[bi]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[yr]=!0}function Pn(e){e[Ma]=void 0}var za=new Set,Xt={};function ye(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for(Xt[e]=t,e=0;e<t.length;e++)za.add(t[e])}var be=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),_a={},vi={};function cc(e){return qe.call(vi,e)?!0:qe.call(_a,e)?!1:be.test(e)?vi[e]=!0:(_a[e]=!0,!1)}var Qe=!1;function xi(){var e=Qe;return Qe=!1,e}function Wn(e,t,n){if(cc(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Si(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function cl(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,l)}}function wn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $t(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){n=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tt(e){if(!e._valueTracker){var t=uc(e)?"checked":"value";e._valueTracker=$t(e,t,""+e[t])}}function ct(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=uc(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}var Vo=/[\n"\\]/g;function fn(e){return e.replace(Vo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bn(e,t,n,l,o,c,f,x){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?f==="number"&&e.value==t?ka(e,wn(e.value)):ka(e,wn(t)):n!=null?ka(e,wn(n)):l!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+wn(x):e.removeAttribute("name")}function Ko(e,t,n,l,o,c,f,x){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Tt(e);return}n=n!=null?""+wn(n):"",t=t!=null?""+wn(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Tt(e)}function ka(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function $l(e,t,n,l){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&l&&(e[n].defaultSelected=!0)}else{for(n=""+wn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Xo(e,t,n){if(t!=null&&(t=""+wn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wn(n):""}function dc(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(s(92));if(Ae(l)){if(1<l.length)throw Error(s(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=wn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Tt(e)}function Yr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var id=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function fc(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||id.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function pc(e,t,n){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Qe=!0);for(var o in t)l=t[o],t.hasOwnProperty(o)&&n[o]!==l&&(fc(e,o,l),Qe=!0)}else for(var c in t)t.hasOwnProperty(c)&&fc(e,c,t[c])}function $o(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var od=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wi=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function On(e){return wi.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ul(){}var Qo=null;function Zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vr=null,Kr=null;function hc(e){var t=Gt(e);if(t&&(e=t.stateNode)){var n=e[tn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Bn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+fn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var o=l[tn]||null;if(!o)throw Error(s(90));Bn(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&ct(l)}break e;case"textarea":Xo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&$l(e,!!n.multiple,t,!1)}}}var Fo=!1;function mc(e,t,n){if(Fo)return e(t,n);Fo=!0;try{var l=e(t);return l}finally{if(Fo=!1,(Vr!==null||Kr!==null)&&(vu(),Vr&&(t=Vr,e=Kr,Kr=Vr=null,hc(t),e)))for(t=0;t<e.length;t++)hc(e[t])}}function Ha(e,t){var n=e.stateNode;if(n===null)return null;var l=n[tn]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var Ol=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),La=!1;if(Ol)try{var Ua={};Object.defineProperty(Ua,"passive",{get:function(){La=!0}}),window.addEventListener("test",Ua,Ua),window.removeEventListener("test",Ua,Ua)}catch{La=!1}var Ql=null,Jo=null,Ei=null;function gc(){if(Ei)return Ei;var e,t=Jo,n=t.length,l,o="value"in Ql?Ql.value:Ql.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===o[c-l];l++);return Ei=o.slice(e,1<l?1-l:void 0)}function br(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 vr(){return!0}function Dn(){return!1}function Bt(e){function t(n,l,o,c,f){this._reactName=n,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(c):c[x]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?vr:Dn,this.isPropagationStopped=Dn,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=vr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vr)},persist:function(){},isPersistent:vr}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zl=Bt(Rn),Ba=Z({},Rn,{view:0,detail:0}),sd=Bt(Ba),Xr,Ti,Fl,$r=Z({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ji,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!==Fl&&(Fl&&e.type==="mousemove"?(Xr=e.screenX-Fl.screenX,Ti=e.screenY-Fl.screenY):Ti=Xr=0,Fl=e),Xr)},movementY:function(e){return"movementY"in e?e.movementY:Ti}}),Ci=Bt($r),yc=Z({},$r,{dataTransfer:0}),Qr=Bt(yc),bc=Z({},Ba,{relatedTarget:0}),Po=Bt(bc),cd=Z({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0}),vc=Bt(cd),Ni=Z({},Rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dl=Bt(Ni),Ai=Z({},Rn,{data:0}),Oi=Bt(Ai),Wo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Di={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"},Ri={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ud(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ri[e])?!!t[e]:!1}function ji(){return ud}var dd=Z({},Ba,{key:function(e){if(e.key){var t=Wo[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=br(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Di[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ji,charCode:function(e){return e.type==="keypress"?br(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?br(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fd=Bt(dd),Mi=Z({},$r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xc=Bt(Mi),Sc=Z({},Rn,{submitter:0}),pd=Bt(Sc),es=Z({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ji}),hd=Bt(es),md=Z({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0}),el=Bt(md),gd=Z({},$r,{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}),yd=Bt(gd),zi=Z({},Rn,{newState:0,oldState:0,source:0}),_i=Bt(zi),ki=[9,13,27,32],Hi=Ol&&"CompositionEvent"in window,Jl=null;Ol&&"documentMode"in document&&(Jl=document.documentMode);var bd=Ol&&"TextEvent"in window&&!Jl,tl=Ol&&(!Hi||Jl&&8<Jl&&11>=Jl),Li=" ",fl=!1;function wc(e,t){switch(e){case"keyup":return ki.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ui(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xr=!1;function Ec(e,t){switch(e){case"compositionend":return Ui(t);case"keypress":return t.which!==32?null:(fl=!0,Li);case"textInput":return e=t.data,e===Li&&fl?null:e;default:return null}}function Tc(e,t){if(xr)return e==="compositionend"||!Hi&&wc(e,t)?(e=gc(),Ei=Jo=Ql=null,xr=!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 tl&&t.locale!=="ko"?null:t.data;default:return null}}var vd={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 Cc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vd[e.type]:t==="textarea"}function p(e,t,n,l){Vr?Kr?Kr.push(l):Kr=[l]:Vr=l,t=Cu(t,"onChange"),0<t.length&&(n=new Zl("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var S=null,T=null;function M(e){gy(e,0)}function I(e){var t=jt(e);if(ct(t))return e}function $(e,t){if(e==="change")return t}var W=!1;if(Ol){var Q;if(Ol){var X="oninput"in document;if(!X){var Te=document.createElement("div");Te.setAttribute("oninput","return;"),X=typeof Te.oninput=="function"}Q=X}else Q=!1;W=Q&&(!document.documentMode||9<document.documentMode)}function le(){S&&(S.detachEvent("onpropertychange",fe),T=S=null)}function fe(e){if(e.propertyName==="value"&&I(T)){var t=[];p(t,T,e,Zo(e)),mc(M,t)}}function me(e,t,n){e==="focusin"?(le(),S=t,T=n,S.attachEvent("onpropertychange",fe)):e==="focusout"&&le()}function Be(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return I(T)}function Re(e,t){if(e==="click")return I(t)}function ze(e,t){if(e==="input"||e==="change")return I(t)}function ut(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:ut;function Dt(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var o=n[l];if(!qe.call(t,o)||!it(e[o],t[o]))return!1}return!0}function Sr(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 Dl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hh(e,t){var n=Dl(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dl(n)}}function Lh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Sr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sr(e.document)}return t}function xd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var qx=Ol&&"documentMode"in document&&11>=document.documentMode,Bi=null,Sd=null,ts=null,wd=!1;function Bh(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wd||Bi==null||Bi!==Sr(l)||(l=Bi,"selectionStart"in l&&xd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ts&&Dt(ts,l)||(ts=l,l=Cu(Sd,"onSelect"),0<l.length&&(t=new Zl("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Bi)))}function Ia(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ii={animationend:Ia("Animation","AnimationEnd"),animationiteration:Ia("Animation","AnimationIteration"),animationstart:Ia("Animation","AnimationStart"),transitionrun:Ia("Transition","TransitionRun"),transitionstart:Ia("Transition","TransitionStart"),transitioncancel:Ia("Transition","TransitionCancel"),transitionend:Ia("Transition","TransitionEnd")},Ed={},Ih={};Ol&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete Ii.animationend.animation,delete Ii.animationiteration.animation,delete Ii.animationstart.animation),"TransitionEvent"in window||delete Ii.transitionend.transition);function qa(e){if(Ed[e])return Ed[e];if(!Ii[e])return e;var t=Ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ih)return Ed[e]=t[n];return e}var qh=qa("animationend"),Gh=qa("animationiteration"),Yh=qa("animationstart"),Gx=qa("transitionrun"),Yx=qa("transitionstart"),Vx=qa("transitioncancel"),Vh=qa("transitionend"),Kh=new Map,Td="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Td.push("scrollEnd");function Rl(e,t){Kh.set(e,t),ye(t,[e])}var Kx=0;function wr(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=_l.identifierPrefix;var n=Kx++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Xh(e){if(e==null||typeof e=="string")return e;var t=null,n=io;if(n!==null)for(var l=0;l<n.length;l++){var o=e[n[l]];if(o!=null){if(o==="none")return"none";t=t==null?o:t+(" "+o)}}return t??e.default}function Er(e,t){return e=Xh(e),t=Xh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},pl=[],qi=0,Cd=0;function Ac(){for(var e=qi,t=Cd=qi=0;t<e;){var n=pl[t];pl[t++]=null;var l=pl[t];pl[t++]=null;var o=pl[t];pl[t++]=null;var c=pl[t];if(pl[t++]=null,l!==null&&o!==null){var f=l.pending;f===null?o.next=o:(o.next=f.next,f.next=o),l.pending=o}c!==0&&$h(n,o,c)}}function Oc(e,t,n,l){pl[qi++]=e,pl[qi++]=t,pl[qi++]=n,pl[qi++]=l,Cd|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Nd(e,t,n,l){return Oc(e,t,n,l),Dc(e)}function Ga(e,t){return Oc(e,null,null,t),Dc(e)}function $h(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-Tn(n),e=c.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=n|536870912),c):null}function Dc(e){if(50<Es)throw Es=0,bu=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gi={};function Xx(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(e,t,n,l){return new Xx(e,t,n,l)}function Ad(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tr(e,t){var n=e.alternate;return n===null?(n=In(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&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Qh(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Rc(e,t,n,l,o,c){var f=0;if(l=e,typeof l=="function")Ad(l)&&(f=1);else if(typeof l=="string")f=x1(e,n,Vt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case St:return e=In(31,n,t,o),e.elementType=St,e.lanes=c,e;case De:return Ya(n.children,o,c,t);case He:f=8,o|=24;break;case xe:return e=In(12,n,t,o|2),e.elementType=xe,e.lanes=c,e;case ce:return e=In(13,n,t,o),e.elementType=ce,e.lanes=c,e;case ie:return e=In(19,n,t,o),e.elementType=ie,e.lanes=c,e;case rt:case O:return e=o|32,e=In(30,n,t,e),e.elementType=O,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Pe:f=10;break e;case pt:f=9;break e;case z:f=11;break e;case Ge:f=14;break e;case Ve:f=16,l=null;break e}f=29,n=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=In(f,n,t,o),t.elementType=e,t.type=l,t.lanes=c,t}function Ya(e,t,n,l){return e=In(7,e,l,t),e.lanes=n,e}function Od(e,t,n){return e=In(6,e,null,t),e.lanes=n,e}function Zh(e){var t=In(18,null,null,0);return t.stateNode=e,t}function Dd(e,t,n){return t=In(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fh=new WeakMap;function hl(e,t){if(typeof e=="object"&&e!==null){var n=Fh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:he(t)},Fh.set(e,t),t)}return{value:e,source:t,stack:he(t)}}var Yi=[],Vi=0,jc=null,ns=0,ml=[],gl=0,Zr=null,Pl=1,Wl="";function Cr(e,t){Yi[Vi++]=ns,Yi[Vi++]=jc,jc=e,ns=t}function Jh(e,t,n){ml[gl++]=Pl,ml[gl++]=Wl,ml[gl++]=Zr,Zr=e;var l=Pl;e=Wl;var o=32-Tn(l)-1;l&=~(1<<o),n+=1;var c=32-Tn(t)+o;if(30<c){var f=o-o%5;c=(l&(1<<f)-1).toString(32),l>>=f,o-=f,Pl=1<<32-Tn(t)+o|n<<o|l,Wl=c+e}else Pl=1<<c|n<<o|l,Wl=e}function Mc(e){e.return!==null&&(Cr(e,1),Jh(e,1,0))}function Rd(e){for(;e===jc;)jc=Yi[--Vi],Yi[Vi]=null,ns=Yi[--Vi],Yi[Vi]=null;for(;e===Zr;)Zr=ml[--gl],ml[gl]=null,Wl=ml[--gl],ml[gl]=null,Pl=ml[--gl],ml[gl]=null}function Ph(e,t){ml[gl++]=Pl,ml[gl++]=Wl,ml[gl++]=Zr,Pl=t.id,Wl=t.overflow,Zr=e}var an=null,Ct=null,Je=!1,Fr=null,yl=!1,jd=Error(s(519));function Jr(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ls(hl(t,e)),jd}function Wh(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Kt]=e,t[tn]=l,n){case"dialog":et("cancel",t),et("close",t);break;case"iframe":case"object":case"embed":et("load",t);break;case"video":case"audio":for(n=0;n<Cs.length;n++)et(Cs[n],t);break;case"source":et("error",t);break;case"img":case"image":case"link":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"input":et("invalid",t),Ko(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":et("invalid",t);break;case"textarea":et("invalid",t),dc(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||xy(t.textContent,n)?(l.popover!=null&&(et("beforetoggle",t),et("toggle",t)),l.onScroll!=null&&et("scroll",t),l.onScrollEnd!=null&&et("scrollend",t),l.onClick!=null&&(t.onclick=ul),t=!0):t=!1,t||Jr(e,!0)}function zc(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:yl=!1;return;case 27:case 3:yl=!0;return;default:an=an.return}}function Ki(e){if(e!==an)return!1;if(!Je)return zc(e),Je=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||sp(e.type,e.memoizedProps)),n=!n),n&&Ct&&Jr(e),zc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ct=By(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ct=By(e)}else t===27?(t=Ct,pa(e.type)?(e=yp,yp=null,Ct=e):Ct=t):Ct=an?vl(e.stateNode.nextSibling):null;return!0}function Va(){Ct=an=null,Je=!1}function Md(){var e=Fr;return e!==null&&(Yn===null?Yn=e:Yn.push.apply(Yn,e),Fr=null),e}function ls(e){Fr===null?Fr=[e]:Fr.push(e)}var zd=Rt(null),Ka=null,Nr=null;function Pr(e,t,n){tt(zd,t._currentValue),t._currentValue=n}function Ar(e){e._currentValue=zd.current,wt(zd)}function _c(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function _d(e,t,n,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var x=c;c=o;for(var N=0;N<t.length;N++)if(x.context===t[N]){c.lanes|=n,x=c.alternate,x!==null&&(x.lanes|=n),_c(c.return,n,e),l||(f=null);break e}c=x.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(s(341));f.lanes|=n,c=f.alternate,c!==null&&(c.lanes|=n),_c(f,n,e),f=null}else o.tag===13&&o.memoizedState!==null&&o.memoizedState.dehydrated===null?(o.lanes|=n,f=o.alternate,f!==null&&(f.lanes|=n),_c(o.return,n,e),f=o.child,f=f!==null?f.sibling:null):f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function Xa(e,t,n,l){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(s(387));if(f=f.memoizedProps,f!==null){var x=o.type;it(o.pendingProps.value,f.value)||(e!==null?e.push(x):e=[x])}}else if(o===xn.current){if(f=o.alternate,f===null)throw Error(s(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(yo):e=[yo])}o=o.return}return e!==null&&_d(t,e,n,l),t.flags|=262144,e!==null}function kc(e){for(e=e.firstContext;e!==null;){if(!it(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $a(e){Ka=e,Nr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pn(e){return em(Ka,e)}function Hc(e,t){return Ka===null&&$a(e),em(e,t)}function em(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Nr===null){if(e===null)throw Error(s(308));Nr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Nr=Nr.next=t;return n}var $x=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Qx=r.unstable_scheduleCallback,Zx=r.unstable_NormalPriority,Qt={$$typeof:Pe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kd(){return{controller:new $x,data:new Map,refCount:0}}function rs(e){e.refCount--,e.refCount===0&&Qx(Zx,function(){e.controller.abort()})}function tm(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];n.indexOf(l)===-1&&n.push(l)}}}var as=null;function Fx(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var is=null,Hd=0,Qa=0,Xi=null;function Jx(e,t){if(is===null){var n=is=[];Hd=0,Qa=Wf(),Xi={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Hd++,t.then(nm,nm),t}function nm(){if(--Hd===0&&(as=null,is!==null)){Xi!==null&&(Xi.status="fulfilled");var e=is;is=null,Qa=0,Xi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Px(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),l}var lm=ge.S;ge.S=function(e,t){if(Zg=oe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Jx(e,t),as!==null)for(var n=uo;n!==null;)tm(n,as),n=n.next;if(n=e.types,n!==null){for(var l=uo;l!==null;)tm(l,n),l=l.next;if(Qa!==0){l=as,l===null&&(l=as=[]);for(var o=0;o<n.length;o++){var c=n[o];l.indexOf(c)===-1&&l.push(c)}}}lm!==null&&lm(e,t)};var Za=Rt(null);function Ld(){var e=Za.current;return e!==null?e:xt.pooledCache}function Lc(e,t){t===null?tt(Za,Za.current):tt(Za,t.pool)}function rm(){var e=Ld();return e===null?null:{parent:Qt._currentValue,pool:e}}var $i=Error(s(460)),Ud=Error(s(474)),Uc=Error(s(542)),Bc={then:function(){}};function am(e){return e=e.status,e==="fulfilled"||e==="rejected"}function im(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ul,ul),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sm(e),e===void 0&&!("reason"in t)?Error(s(600)):e;default:if(typeof t.status=="string")t.then(ul,ul);else{if(e=xt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sm(e),e}throw Ja=t,$i}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ja=n,$i):n}}var Ja=null;function om(){if(Ja===null)throw Error(s(459));var e=Ja;return Ja=null,e}function sm(e){if(e===$i||e===Uc)throw Error(s(483))}var Qi=null,os=0;function Ic(e){var t=os;return os+=1,Qi===null&&(Qi=[]),im(Qi,e,t)}function Wr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qc(e,t){throw t.$$typeof===Se?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cm(e){function t(k,j){if(e){var L=k.deletions;L===null?(k.deletions=[j],k.flags|=16):L.push(j)}}function n(k,j){if(!e)return null;for(;j!==null;)t(k,j),j=j.sibling;return null}function l(k){for(var j=new Map;k!==null;)k.key===null?j.set(k.index,k):j.set(k.key,k),k=k.sibling;return j}function o(k,j){return k=Tr(k,j),k.index=0,k.sibling=null,k}function c(k,j,L){return k.index=L,e?(L=k.alternate,L!==null?(L=L.index,L<j?(k.flags|=2,j):L):(k.flags|=134217730,j)):(k.flags|=1048576,j)}function f(k){return e&&k.alternate===null&&(k.flags|=134217730),k}function x(k,j,L,V){return j===null||j.tag!==6?(j=Od(L,k.mode,V),j.return=k,j):(j=o(j,L),j.return=k,j)}function N(k,j,L,V){var Ee=L.type;return Ee===De?(k=q(k,j,L.props.children,V,L.key),Wr(k,L),k):j!==null&&(j.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Ve&&Fa(Ee)===j.type)?(j=o(j,L.props),Wr(j,L),j.return=k,j):(j=Rc(L.type,L.key,L.props,null,k.mode,V),Wr(j,L),j.return=k,j)}function H(k,j,L,V){return j===null||j.tag!==4||j.stateNode.containerInfo!==L.containerInfo||j.stateNode.implementation!==L.implementation?(j=Dd(L,k.mode,V),j.return=k,j):(j=o(j,L.children||[]),j.return=k,j)}function q(k,j,L,V,Ee){return j===null||j.tag!==7?(j=Ya(L,k.mode,V,Ee),j.return=k,j):(j=o(j,L),j.return=k,j)}function K(k,j,L){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Od(""+j,k.mode,L),j.return=k,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case st:return L=Rc(j.type,j.key,j.props,null,k.mode,L),Wr(L,j),L.return=k,L;case Ue:return j=Dd(j,k.mode,L),j.return=k,j;case Ve:return j=Fa(j),K(k,j,L)}if(Ae(j)||we(j))return j=Ya(j,k.mode,L,null),j.return=k,j;if(typeof j.then=="function")return K(k,Ic(j),L);if(j.$$typeof===Pe)return K(k,Hc(k,j),L);qc(k,j)}return null}function _(k,j,L,V){var Ee=j!==null?j.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Ee!==null?null:x(k,j,""+L,V);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case st:return L.key===Ee?N(k,j,L,V):null;case Ue:return L.key===Ee?H(k,j,L,V):null;case Ve:return L=Fa(L),_(k,j,L,V)}if(Ae(L)||we(L))return Ee!==null?null:q(k,j,L,V,null);if(typeof L.then=="function")return _(k,j,Ic(L),V);if(L.$$typeof===Pe)return _(k,j,Hc(k,L),V);qc(k,L)}return null}function U(k,j,L,V,Ee){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return k=k.get(L)||null,x(j,k,""+V,Ee);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case st:return k=k.get(V.key===null?L:V.key)||null,N(j,k,V,Ee);case Ue:return k=k.get(V.key===null?L:V.key)||null,H(j,k,V,Ee);case Ve:return V=Fa(V),U(k,j,L,V,Ee)}if(Ae(V)||we(V))return k=k.get(L)||null,q(j,k,V,Ee,null);if(typeof V.then=="function")return U(k,j,L,Ic(V),Ee);if(V.$$typeof===Pe)return U(k,j,L,Hc(j,V),Ee);qc(j,V)}return null}function de(k,j,L,V){for(var Ee=null,lt=null,Oe=j,_e=j=0,Jt=null;Oe!==null&&_e<L.length;_e++){Oe.index>_e?(Jt=Oe,Oe=null):Jt=Oe.sibling;var ot=_(k,Oe,L[_e],V);if(ot===null){Oe===null&&(Oe=Jt);break}e&&Oe&&ot.alternate===null&&t(k,Oe),j=c(ot,j,_e),lt===null?Ee=ot:lt.sibling=ot,lt=ot,Oe=Jt}if(_e===L.length)return n(k,Oe),Je&&Cr(k,_e),Ee;if(Oe===null){for(;_e<L.length;_e++)Oe=K(k,L[_e],V),Oe!==null&&(j=c(Oe,j,_e),lt===null?Ee=Oe:lt.sibling=Oe,lt=Oe);return Je&&Cr(k,_e),Ee}for(Oe=l(Oe);_e<L.length;_e++)Jt=U(Oe,k,_e,L[_e],V),Jt!==null&&(e&&(ot=Jt.alternate,ot!==null&&Oe.delete(ot.key===null?_e:ot.key)),j=c(Jt,j,_e),lt===null?Ee=Jt:lt.sibling=Jt,lt=Jt);return e&&Oe.forEach(function(ba){return t(k,ba)}),Je&&Cr(k,_e),Ee}function Ce(k,j,L,V){if(L==null)throw Error(s(151));for(var Ee=null,lt=null,Oe=j,_e=j=0,Jt=null,ot=L.next();Oe!==null&&!ot.done;_e++,ot=L.next()){Oe.index>_e?(Jt=Oe,Oe=null):Jt=Oe.sibling;var ba=_(k,Oe,ot.value,V);if(ba===null){Oe===null&&(Oe=Jt);break}e&&Oe&&ba.alternate===null&&t(k,Oe),j=c(ba,j,_e),lt===null?Ee=ba:lt.sibling=ba,lt=ba,Oe=Jt}if(ot.done)return n(k,Oe),Je&&Cr(k,_e),Ee;if(Oe===null){for(;!ot.done;_e++,ot=L.next())ot=K(k,ot.value,V),ot!==null&&(j=c(ot,j,_e),lt===null?Ee=ot:lt.sibling=ot,lt=ot);return Je&&Cr(k,_e),Ee}for(Oe=l(Oe);!ot.done;_e++,ot=L.next())ot=U(Oe,k,_e,ot.value,V),ot!==null&&(e&&(Jt=ot.alternate,Jt!==null&&Oe.delete(Jt.key===null?_e:Jt.key)),j=c(ot,j,_e),lt===null?Ee=ot:lt.sibling=ot,lt=ot);return e&&Oe.forEach(function(M1){return t(k,M1)}),Je&&Cr(k,_e),Ee}function Xe(k,j,L,V){if(typeof L=="object"&&L!==null&&L.type===De&&L.key===null&&L.props.ref===void 0&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case st:e:{for(var Ee=L.key;j!==null;){if(j.key===Ee){if(Ee=L.type,Ee===De){if(j.tag===7){n(k,j.sibling),V=o(j,L.props.children),Wr(V,L),V.return=k,k=V;break e}}else if(j.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Ve&&Fa(Ee)===j.type){n(k,j.sibling),V=o(j,L.props),Wr(V,L),V.return=k,k=V;break e}n(k,j);break}else t(k,j);j=j.sibling}L.type===De?(V=Ya(L.props.children,k.mode,V,L.key),Wr(V,L),V.return=k,k=V):(V=Rc(L.type,L.key,L.props,null,k.mode,V),Wr(V,L),V.return=k,k=V)}return f(k);case Ue:e:{for(Ee=L.key;j!==null;){if(j.key===Ee)if(j.tag===4&&j.stateNode.containerInfo===L.containerInfo&&j.stateNode.implementation===L.implementation){n(k,j.sibling),V=o(j,L.children||[]),V.return=k,k=V;break e}else{n(k,j);break}else t(k,j);j=j.sibling}V=Dd(L,k.mode,V),V.return=k,k=V}return f(k);case Ve:return L=Fa(L),Xe(k,j,L,V)}if(Ae(L))return de(k,j,L,V);if(we(L)){if(Ee=we(L),typeof Ee!="function")throw Error(s(150));return L=Ee.call(L),Ce(k,j,L,V)}if(typeof L.then=="function")return Xe(k,j,Ic(L),V);if(L.$$typeof===Pe)return Xe(k,j,Hc(k,L),V);qc(k,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,j!==null&&j.tag===6?(n(k,j.sibling),V=o(j,L),V.return=k,k=V):(n(k,j),V=Od(L,k.mode,V),V.return=k,k=V),f(k)):n(k,j)}return function(k,j,L,V){try{os=0;var Ee=Xe(k,j,L,V);return Qi=null,Ee}catch(Oe){if(Oe===$i||Oe===Uc)throw Oe;var lt=In(29,Oe,null,k.mode);return lt.lanes=V,lt.return=k,lt}finally{}}}var Pa=cm(!0),um=cm(!1),ea=!1;function Bd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Id(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function na(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=Dc(e),$h(e,null,n),t}return Oc(e,l,t,n),Dc(e)}function ss(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Gr(e,n)}}function qd(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Gd=!1;function cs(){if(Gd){var e=Xi;if(e!==null)throw e}}function us(e,t,n,l){Gd=!1;var o=e.updateQueue;ea=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,x=o.shared.pending;if(x!==null){o.shared.pending=null;var N=x,H=N.next;N.next=null,f===null?c=H:f.next=H,f=N;var q=e.alternate;q!==null&&(q=q.updateQueue,x=q.lastBaseUpdate,x!==f&&(x===null?q.firstBaseUpdate=H:x.next=H,q.lastBaseUpdate=N))}if(c!==null){var K=o.baseState;f=0,q=H=N=null,x=c;do{var _=x.lane&-536870913,U=_!==x.lane;if(U?(nt&_)===_:(l&_)===_){_!==0&&_===Qa&&(Gd=!0),q!==null&&(q=q.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var de=e,Ce=x;_=t;var Xe=n;switch(Ce.tag){case 1:if(de=Ce.payload,typeof de=="function"){K=de.call(Xe,K,_);break e}K=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Ce.payload,_=typeof de=="function"?de.call(Xe,K,_):de,_==null)break e;K=Z({},K,_);break e;case 2:ea=!0}}_=x.callback,_!==null&&(e.flags|=64,U&&(e.flags|=8192),U=o.callbacks,U===null?o.callbacks=[_]:U.push(_))}else U={lane:_,tag:x.tag,payload:x.payload,callback:x.callback,next:null},q===null?(H=q=U,N=K):q=q.next=U,f|=_;if(x=x.next,x===null){if(x=o.shared.pending,x===null)break;U=x,x=U.next,U.next=null,o.lastBaseUpdate=U,o.shared.pending=null}}while(!0);q===null&&(N=K),o.baseState=N,o.firstBaseUpdate=H,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),ca|=f,e.lanes=f,e.memoizedState=K}}function dm(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function fm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)dm(n[e],t)}var la=Rt(null),Gc=Rt(0);function pm(e,t){e=Mr,tt(Gc,e),tt(la,t),Mr=e|t.baseLanes}function Yd(){tt(Gc,Mr),tt(la,la.current)}function Vd(){Mr=Gc.current,wt(la),wt(Gc)}var hn=Rt(null),En=null;function ra(e){var t=e.alternate;tt(mn,mn.current&1),tt(hn,e),En===null&&(t===null||la.current!==null||t.memoizedState!==null)&&(En=e)}function Kd(e){tt(mn,mn.current),tt(hn,e),En===null&&(En=e)}function hm(e){e.tag===22?(tt(mn,mn.current),tt(hn,e),En===null&&(En=e)):aa()}function aa(){tt(mn,mn.current),tt(hn,hn.current)}function nl(e){wt(hn),En===e&&(En=null),wt(mn)}var mn=Rt(0);function ds(e,t){tt(hn,hn.current),tt(mn,t)}function Xd(e){wt(mn),wt(hn),En===e&&(En=null)}function Yc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mp(n)||gp(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Or=0,Ke=null,yt=null,Zt=null,Vc=!1,Zi=!1,Wa=!1,Kc=0,fs=0,Fi=null,Wx=0;function It(){throw Error(s(321))}function $d(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!it(e[n],t[n]))return!1;return!0}function Qd(e,t,n,l,o,c){return Or=c,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ge.H=e===null||e.memoizedState===null?Jm:Pm,Wa=!1,c=n(l,o),Wa=!1,Zi&&(c=gm(t,n,l,o)),mm(e),c}function mm(e){ge.H=Pc;var t=yt!==null&&yt.next!==null;if(Or=0,Zt=yt=Ke=null,Vc=!1,fs=0,Fi=null,t)throw Error(s(300));e===null||Ft||(e=e.dependencies,e!==null&&kc(e)&&(Ft=!0))}function gm(e,t,n,l){Ke=e;var o=0;do{if(Zi&&(Fi=null),fs=0,Zi=!1,25<=o)throw Error(s(301));if(o+=1,Zt=yt=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}ge.H=o0,c=t(n,l)}while(Zi);return c}function e0(){var e=ge.H,t=e.useState()[0];return t=typeof t.then=="function"?ps(t):t,e=e.useState()[0],(yt!==null?yt.memoizedState:null)!==e&&(Ke.flags|=1024),t}function Zd(){var e=Kc!==0;return Kc=0,e}function Fd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Jd(e){if(Vc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vc=!1}Or=0,Zt=yt=Ke=null,Zi=!1,fs=Kc=0,Fi=null}function jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Ke.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function Yt(){if(yt===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=Zt===null?Ke.memoizedState:Zt.next;if(t!==null)Zt=t,yt=e;else{if(e===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},Zt===null?Ke.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function Xc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ps(e){var t=fs;return fs+=1,Fi===null&&(Fi=[]),e=im(Fi,e,t),t=Ke,(Zt===null?t.memoizedState:Zt.next)===null&&(t=t.alternate,ge.H=t===null||t.memoizedState===null?Jm:Pm),e}function $c(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ps(e);if(e.$$typeof===P)return;if(e.$$typeof===Pe)return pn(e)}throw Error(s(438,String(e)))}function Pd(e){var t=null,n=Ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Xc(),Ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=Pt;return t.index++,n}function Dr(e,t){return typeof t=="function"?t(e):t}function Qc(e){var t=Yt();return Wd(t,yt,e)}function Wd(e,t,n){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var o=e.baseQueue,c=l.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,l.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var x=f=null,N=null,H=t,q=!1;do{var K=H.lane&-536870913;if(K!==H.lane?(nt&K)===K:(Or&K)===K){var _=H.revertLane;if(_===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),K===Qa&&(q=!0);else if((Or&_)===_){H=H.next,_===Qa&&(q=!0);continue}else K={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},N===null?(x=N=K,f=c):N=N.next=K,Ke.lanes|=_,ca|=_;K=H.action,Wa&&n(c,K),c=H.hasEagerState?H.eagerState:n(c,K)}else _={lane:K,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},N===null?(x=N=_,f=c):N=N.next=_,Ke.lanes|=K,ca|=K;H=H.next}while(H!==null&&H!==t);if(N===null?f=c:N.next=x,!it(c,e.memoizedState)&&(Ft=!0,q&&(n=Xi,n!==null)))throw n;e.memoizedState=c,e.baseState=f,e.baseQueue=N,l.lastRenderedState=c}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function ef(e){var t=Yt(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var l=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);it(c,t.memoizedState)||(Ft=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function ym(e,t,n){var l=Ke,o=Yt(),c=Je;if(c){if(n===void 0)throw Error(s(407));n=n()}else n=t();var f=!it((yt||o).memoizedState,n);if(f&&(o.memoizedState=n,Ft=!0),o=o.queue,lf(xm.bind(null,l,o,e),[e]),e=o.getSnapshot!==t||f||Zt!==null&&(Zt.memoizedState.tag&1)!==0,Ji(e?9:8,{destroy:void 0},vm.bind(null,l,o,n,t),null),e){if(l.flags|=2048,xt===null)throw Error(s(349));c||(Or&127)!==0||bm(l,t,n)}return n}function bm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ke.updateQueue,t===null?(t=Xc(),Ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vm(e,t,n,l){t.value=n,t.getSnapshot=l,Sm(t)&&wm(e)}function xm(e,t,n){return n(function(){Sm(t)&&wm(e)})}function Sm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!it(e,n)}catch{return!0}}function wm(e){var t=Ga(e,2);t!==null&&Vn(t,e,2)}function tf(e){var t=jn();if(typeof e=="function"){var n=e;if(e=n(),Wa){Fn(!0);try{n()}finally{Fn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:e},t}function Em(e,t,n,l){return e.baseState=n,Wd(e,yt,typeof l=="function"?l:Dr)}function t0(e,t,n,l,o){if(Jc(e))throw Error(s(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};ge.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,Tm(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Tm(e,t){var n=t.action,l=t.payload,o=e.state;if(t.isTransition){var c=ge.T,f={};f.types=c!==null?c.types:null,ge.T=f;try{var x=n(o,l),N=ge.S;N!==null&&N(f,x),Cm(e,t,x)}catch(H){nf(e,t,H)}finally{c!==null&&f.types!==null&&(c.types=f.types),ge.T=c}}else try{c=n(o,l),Cm(e,t,c)}catch(H){nf(e,t,H)}}function Cm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Nm(e,t,l)},function(l){return nf(e,t,l)}):Nm(e,t,n)}function Nm(e,t,n){t.status="fulfilled",t.value=n,Am(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Tm(e,n)))}function nf(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Am(t),t=t.next;while(t!==l)}e.action=null}function Am(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Om(e,t){return t}function Dm(e,t){if(Je){var n=xt.formState;if(n!==null){e:{var l=Ke;if(Je){if(Ct){t:{for(var o=Ct,c=yl;o.nodeType!==8;){if(!c){o=null;break t}if(o=vl(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Ct=vl(o.nextSibling),l=o.data==="F!";break e}}Jr(l)}l=!1}l&&(t=n[0])}}return n=jn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Om,lastRenderedState:t},n.queue=l,n=Qm.bind(null,Ke,l),l.dispatch=n,l=tf(!1),c=cf.bind(null,Ke,!1,l.queue),l=jn(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,n=t0.bind(null,Ke,o,c,n),o.dispatch=n,l.memoizedState=e,[t,n,!1]}function Rm(e){var t=Yt();return jm(t,yt,e)}function jm(e,t,n){if(t=Wd(e,t,Om)[0],e=Qc(Dr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ps(t)}catch(f){throw f===$i?Uc:f}else l=t;t=Yt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(Ke.flags|=2048,Ji(9,{destroy:void 0},n0.bind(null,o,n),null)),[l,c,e]}function n0(e,t){e.action=t}function Mm(e){var t=Yt(),n=yt;if(n!==null)return jm(t,n,e);Yt(),t=t.memoizedState,n=Yt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ji(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ke.updateQueue,t===null&&(t=Xc(),Ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function zm(){return Yt().memoizedState}function Zc(e,t,n,l){var o=jn();Ke.flags|=e,o.memoizedState=Ji(1|t,{destroy:void 0},n,l===void 0?null:l)}function Fc(e,t,n,l){var o=Yt();l=l===void 0?null:l;var c=o.memoizedState.inst;yt!==null&&l!==null&&$d(l,yt.memoizedState.deps)?o.memoizedState=Ji(t,c,n,l):(Ke.flags|=e,o.memoizedState=Ji(1|t,c,n,l))}function _m(e,t){Zc(8390656,8,e,t)}function lf(e,t){Fc(2048,8,e,t)}function l0(e){Ke.flags|=4;var t=Ke.updateQueue;if(t===null)t=Xc(),Ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function km(e){var t=Yt().memoizedState;return l0({ref:t,nextImpl:e}),function(){if((dt&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Hm(e,t){return Fc(4,2,e,t)}function Lm(e,t){return Fc(4,4,e,t)}function Um(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bm(e,t,n){n=n!=null?n.concat([e]):null,Fc(4,4,Um.bind(null,t,e),n)}function rf(){}function Im(e,t){var n=Yt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&$d(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function qm(e,t){var n=Yt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&$d(t,l[1]))return l[0];if(l=e(),Wa){Fn(!0);try{e()}finally{Fn(!1)}}return n.memoizedState=[l,t],l}function af(e,t,n){return n===void 0||(Or&1073741824)!==0&&(nt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Jg(),Ke.lanes|=e,ca|=e,n)}function Gm(e,t,n,l){return it(n,t)?n:la.current!==null?(e=af(e,n,l),it(e,t)||(Ft=!0),e):(Or&106)===0||(Or&1073741824)!==0&&(nt&261930)===0?(Ft=!0,e.memoizedState=n):(e=Jg(),Ke.lanes|=e,ca|=e,t)}function Ym(e,t,n,l,o){var c=Ne.p;Ne.p=c!==0&&8>c?c:8;var f=ge.T,x={};x.types=f!==null?f.types:null,ge.T=x,cf(e,!1,t,n);try{var N=o(),H=ge.S;if(H!==null&&H(x,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var q=Px(N,l);hs(e,t,q,il(e))}else hs(e,t,l,il(e))}catch(K){hs(e,t,{then:function(){},status:"rejected",reason:K},il())}finally{Ne.p=c,f!==null&&x.types!==null&&(f.types=x.types),ge.T=f}}function r0(){}function of(e,t,n,l){if(e.tag!==5)throw Error(s(476));var o=Vm(e).queue;Ym(e,o,t,at,n===null?r0:function(){return Km(e),n(l)})}function Vm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:at,baseState:at,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:at},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dr,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Km(e){var t=Vm(e);t.next===null&&(t=e.alternate.memoizedState),hs(e,t.next.queue,{},il())}function sf(){return pn(yo)}function Xm(){return Yt().memoizedState}function $m(){return Yt().memoizedState}function a0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=il();e=ta(n);var l=na(t,e,n);l!==null&&(Vn(l,t,n),ss(l,t,n)),t={cache:kd()},e.payload=t;return}t=t.return}}function i0(e,t,n){var l=il();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Jc(e)?Zm(t,n):(n=Nd(e,t,n,l),n!==null&&(Vn(n,e,l),Fm(n,t,l)))}function Qm(e,t,n){var l=il();hs(e,t,n,l)}function hs(e,t,n,l){var o={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jc(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,x=c(f,n);if(o.hasEagerState=!0,o.eagerState=x,it(x,f))return Oc(e,t,o,0),xt===null&&Ac(),!1}catch{}finally{}if(n=Nd(e,t,o,l),n!==null)return Vn(n,e,l),Fm(n,t,l),!0}return!1}function cf(e,t,n,l){if(l={lane:2,revertLane:Wf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Jc(e)){if(t)throw Error(s(479))}else t=Nd(e,n,l,2),t!==null&&Vn(t,e,2)}function Jc(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function Zm(e,t){Zi=Vc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Gr(e,n)}}var Pc={readContext:pn,use:$c,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It,useEffectEvent:It},Jm={readContext:pn,use:$c,useCallback:function(e,t){return jn().memoizedState=[e,t===void 0?null:t],e},useContext:pn,useEffect:_m,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Zc(4194308,4,Um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zc(4194308,4,e,t)},useInsertionEffect:function(e,t){Zc(4,2,e,t)},useMemo:function(e,t){var n=jn();t=t===void 0?null:t;var l=e();if(Wa){Fn(!0);try{e()}finally{Fn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=jn();if(n!==void 0){var o=n(t);if(Wa){Fn(!0);try{n(t)}finally{Fn(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=i0.bind(null,Ke,e),[l.memoizedState,e]},useRef:function(e){var t=jn();return e={current:e},t.memoizedState=e},useState:function(e){e=tf(e);var t=e.queue,n=Qm.bind(null,Ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:rf,useDeferredValue:function(e,t){var n=jn();return af(n,e,t)},useTransition:function(){var e=tf(!1);return e=Ym.bind(null,Ke,e.queue,!0,!1),jn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ke,o=jn();if(Je){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),xt===null)throw Error(s(349));(nt&127)!==0||bm(l,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,_m(xm.bind(null,l,c,e),[e]),l.flags|=2048,Ji(9,{destroy:void 0},vm.bind(null,l,c,n,t),null),n},useId:function(){var e=jn(),t=xt.identifierPrefix;if(Je){var n=Wl,l=Pl;n=(l&~(1<<32-Tn(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Kc++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Wx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sf,useFormState:Dm,useActionState:Dm,useOptimistic:function(e){var t=jn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cf.bind(null,Ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:Pd,useCacheRefresh:function(){return jn().memoizedState=a0.bind(null,Ke)},useEffectEvent:function(e){var t=jn(),n={impl:e};return t.memoizedState=n,function(){if((dt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},Pm={readContext:pn,use:$c,useCallback:Im,useContext:pn,useEffect:lf,useImperativeHandle:Bm,useInsertionEffect:Hm,useLayoutEffect:Lm,useMemo:qm,useReducer:Qc,useRef:zm,useState:function(){return Qc(Dr)},useDebugValue:rf,useDeferredValue:function(e,t){var n=Yt();return Gm(n,yt.memoizedState,e,t)},useTransition:function(){var e=Qc(Dr)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:ps(e),t]},useSyncExternalStore:ym,useId:Xm,useHostTransitionStatus:sf,useFormState:Rm,useActionState:Rm,useOptimistic:function(e,t){var n=Yt();return Em(n,yt,e,t)},useMemoCache:Pd,useCacheRefresh:$m,useEffectEvent:km},o0={readContext:pn,use:$c,useCallback:Im,useContext:pn,useEffect:lf,useImperativeHandle:Bm,useInsertionEffect:Hm,useLayoutEffect:Lm,useMemo:qm,useReducer:ef,useRef:zm,useState:function(){return ef(Dr)},useDebugValue:rf,useDeferredValue:function(e,t){var n=Yt();return yt===null?af(n,e,t):Gm(n,yt.memoizedState,e,t)},useTransition:function(){var e=ef(Dr)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:ps(e),t]},useSyncExternalStore:ym,useId:Xm,useHostTransitionStatus:sf,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,t){var n=Yt();return yt!==null?Em(n,yt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Pd,useCacheRefresh:$m,useEffectEvent:km};function uf(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:Z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var df={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=il(),o=ta(l);o.payload=t,n!=null&&(o.callback=n),t=na(e,o,l),t!==null&&(Vn(t,e,l),ss(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=il(),o=ta(l);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=na(e,o,l),t!==null&&(Vn(t,e,l),ss(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=il(),l=ta(n);l.tag=2,t!=null&&(l.callback=t),t=na(e,l,n),t!==null&&(Vn(t,e,n),ss(t,e,n))}};function Wm(e,t,n,l,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,f):t.prototype&&t.prototype.isPureReactComponent?!Dt(n,l)||!Dt(o,c):!0}function eg(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&df.enqueueReplaceState(t,t.state,null)}function ei(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=Z({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function tg(e){Nc(e)}function ng(e){console.error(e)}function lg(e){Nc(e)}function Wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function rg(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function ff(e,t,n){return n=ta(n),n.tag=3,n.payload={element:null},n.callback=function(){Wc(e,t)},n}function ag(e){return e=ta(e),e.tag=3,e}function ig(e,t,n,l){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=l.value;e.payload=function(){return o(c)},e.callback=function(){rg(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){rg(t,n,l),typeof o!="function"&&(ua===null?ua=new Set([this]):ua.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function s0(e,t,n,l,o){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Xa(t,n,o,!0),n=hn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return En===null?xu():n.alternate===null&&qt===0&&(qt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,l===Bc?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Ff(e,l,o)),!1;case 22:return n.flags|=65536,l===Bc?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Ff(e,l,o)),!1}throw Error(s(435,n.tag))}return Ff(e,l,o),xu(),!1}if(Je)return t=hn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==jd&&(e=Error(s(422),{cause:l}),ls(hl(e,n)))):(l!==jd&&(t=Error(s(423),{cause:l}),ls(hl(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=hl(l,n),o=ff(e.stateNode,l,o),qd(e,o),qt!==4&&(qt=2)),!1;var c=Error(s(520),{cause:l});if(c=hl(c,n),ws===null?ws=[c]:ws.push(c),qt!==4&&(qt=2),t===null)return!0;l=hl(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=ff(n.stateNode,l,e),qd(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ua===null||!ua.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=ag(o),ig(o,e,n,l),qd(n,o),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var pf=Error(s(461)),Ft=!1;function nn(e,t,n,l){t.child=e===null?um(t,null,n,l):Pa(t,e.child,n,l)}function og(e,t,n,l,o){n=n.render;var c=t.ref;if("ref"in l){var f={};for(var x in l)x!=="ref"&&(f[x]=l[x])}else f=l;return $a(t),l=Qd(e,t,n,f,c,o),x=Zd(),e!==null&&!Ft?(Fd(e,t,o),Rr(e,t,o)):(Je&&x&&Mc(t),t.flags|=1,nn(e,t,l,o),t.child)}function sg(e,t,n,l,o){if(e===null){var c=n.type;return typeof c=="function"&&!Ad(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,cg(e,t,c,l,o)):(e=Rc(n.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Sf(e,o)){var f=c.memoizedProps;if(n=n.compare,n=n!==null?n:Dt,n(f,l)&&e.ref===t.ref)return Rr(e,t,o)}return t.flags|=1,e=Tr(c,l),e.ref=t.ref,e.return=t,t.child=e}function cg(e,t,n,l,o){if(e!==null){var c=e.memoizedProps;if(Dt(c,l)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=l=c,Sf(e,o))(e.flags&131072)!==0&&(Ft=!0);else return t.lanes=e.lanes,Rr(e,t,o)}return hf(e,t,n,l,o)}function ug(e,t,n,l){var o=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~c}else l=0,t.child=null;return dg(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Lc(t,c!==null?c.cachePool:null),c!==null?pm(t,c):Yd(),hm(t);else return l=t.lanes=536870912,dg(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(Lc(t,c.cachePool),pm(t,c),aa(),t.memoizedState=null):(e!==null&&Lc(t,null),Yd(),aa());return nn(e,t,o,n),t.child}function ms(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dg(e,t,n,l,o){var c=Ld();return c=c===null?null:{parent:Qt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Lc(t,null),Yd(),hm(t),e!==null&&Xa(e,t,l,!0),t.childLanes=o,null}function eu(e,t){return t=tu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fg(e,t,n){return Pa(t,e.child,null,n),e=eu(t,t.pendingProps),e.flags|=2,nl(t),t.memoizedState=null,e}function c0(e,t,n){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Je){if(l.mode==="hidden")return e=eu(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ms(null,e);if(Kd(t),(e=Ct)?(e=Uy(e,yl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zr!==null?{id:Pl,overflow:Wl}:null,retryLane:536870912,hydrationErrors:null},n=Zh(e),n.return=t,t.child=n,an=t,Ct=null)):e=null,e===null)throw Jr(t);return t.lanes=536870912,null}return eu(t,l)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Kd(t),o)if(t.flags&256)t.flags&=-257,t=fg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Ft||Xa(e,t,n,!1),o=(n&e.childLanes)!==0,Ft||o){if(la.current===null){if(l=xt,l!==null&&(f=hr(l,n),f!==0&&f!==c.retryLane))throw c.retryLane=f,Ga(e,f),Vn(l,e,f),pf;xu()}t=fg(e,t,n)}else e=c.treeContext,Ct=vl(f.nextSibling),an=t,Je=!0,Fr=null,yl=!1,e!==null&&Ph(t,e),t=eu(t,l),t.flags|=134221824;return t}return e=Tr(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hf(e,t,n,l,o){return $a(t),n=Qd(e,t,n,l,void 0,o),l=Zd(),e!==null&&!Ft?(Fd(e,t,o),Rr(e,t,o)):(Je&&l&&Mc(t),t.flags|=1,nn(e,t,n,o),t.child)}function pg(e,t,n,l,o,c){return $a(t),t.updateQueue=null,n=gm(t,l,n,o),mm(e),l=Zd(),e!==null&&!Ft?(Fd(e,t,c),Rr(e,t,c)):(Je&&l&&Mc(t),t.flags|=1,nn(e,t,n,c),t.child)}function hg(e,t,n,l,o){if($a(t),t.stateNode===null){var c=Gi,f=n.contextType;typeof f=="object"&&f!==null&&(c=pn(f)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=df,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},Bd(t),f=n.contextType,c.context=typeof f=="object"&&f!==null?pn(f):Gi,c.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(uf(t,n,f,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&df.enqueueReplaceState(c,c.state,null),us(t,l,c,o),cs(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var x=t.memoizedProps,N=ei(n,x);c.props=N;var H=c.context,q=n.contextType;f=Gi,typeof q=="object"&&q!==null&&(f=pn(q));var K=n.getDerivedStateFromProps;q=typeof K=="function"||typeof c.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x||H!==f)&&eg(t,c,l,f),ea=!1;var _=t.memoizedState;c.state=_,us(t,l,c,o),cs(),H=t.memoizedState,x||_!==H||ea?(typeof K=="function"&&(uf(t,n,K,l),H=t.memoizedState),(N=ea||Wm(t,n,N,l,_,H,f))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=H),c.props=l,c.state=H,c.context=f,l=N):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,Id(e,t),f=t.memoizedProps,q=ei(n,f),c.props=q,K=t.pendingProps,_=c.context,H=n.contextType,N=Gi,typeof H=="object"&&H!==null&&(N=pn(H)),x=n.getDerivedStateFromProps,(H=typeof x=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==K||_!==N)&&eg(t,c,l,N),ea=!1,_=t.memoizedState,c.state=_,us(t,l,c,o),cs();var U=t.memoizedState;f!==K||_!==U||ea||e!==null&&e.dependencies!==null&&kc(e.dependencies)?(typeof x=="function"&&(uf(t,n,x,l),U=t.memoizedState),(q=ea||Wm(t,n,q,l,_,U,N)||e!==null&&e.dependencies!==null&&kc(e.dependencies))?(H||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,U,N),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,U,N)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=U),c.props=l,c.state=U,c.context=N,l=q):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Pi(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Pa(t,e.child,null,o),t.child=Pa(t,null,n,o)):nn(e,t,n,o),t.memoizedState=c.state,e=t.child):e=Rr(e,t,o),e}function mg(e,t,n,l){return Va(),t.flags|=256,nn(e,t,n,l),t.child}var mf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(e){return{baseLanes:e,cachePool:rm()}}function yf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=al),e}function gg(e,t,n){var l=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(mn.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(o?ra(t):aa(),(e=Ct)?(e=Uy(e,yl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zr!==null?{id:Pl,overflow:Wl}:null,retryLane:536870912,hydrationErrors:null},n=Zh(e),n.return=t,t.child=n,an=t,Ct=null)):e=null,e===null)throw Jr(t);return gp(e)?t.lanes=32:t.lanes=536870912,null}return c=l.children,l=l.fallback,o?(aa(),o=t.mode,c=tu({mode:"hidden",children:c},o),l=Ya(l,o,n,null),c.return=t,l.return=t,c.sibling=l,t.child=c,l=t.child,l.memoizedState=gf(n),l.childLanes=yf(e,f,n),t.memoizedState=mf,ms(null,l)):(ra(t),bf(t,c))}var x=e.memoizedState;if(x!==null){var N=x.dehydrated;if(N!==null)return u0(e,t,c,f,l,N,x,n)}return o?(aa(),o=l.fallback,c=t.mode,x=e.child,N=x.sibling,l=Tr(x,{mode:"hidden",children:l.children}),l.subtreeFlags=x.subtreeFlags&1206910976,N!==null?o=Tr(N,o):(o=Ya(o,c,n,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,ms(null,l),l=t.child,o=e.child.memoizedState,o===null?o=gf(n):(c=o.cachePool,c!==null?(x=Qt._currentValue,c=c.parent!==x?{parent:x,pool:x}:c):c=rm(),o={baseLanes:o.baseLanes|n,cachePool:c}),l.memoizedState=o,l.childLanes=yf(e,f,n),t.memoizedState=mf,ms(e.child,l)):(ra(t),n=e.child,e=n.sibling,n=Tr(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function bf(e,t){return t=tu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function tu(e,t){return e=In(22,e,null,t),e.lanes=0,e}function nu(e,t,n){return Pa(t,e.child,null,n),e=bf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u0(e,t,n,l,o,c,f,x){if(n)return t.flags&256?(ra(t),t.flags&=-257,nu(e,t,x)):t.memoizedState!==null?(aa(),t.child=e.child,t.flags|=128,null):(aa(),c=o.fallback,f=t.mode,o=tu({mode:"visible",children:o.children},f),c=Ya(c,f,x,null),c.flags|=2,o.return=t,c.return=t,o.sibling=c,t.child=o,Pa(t,e.child,null,x),o=t.child,o.memoizedState=gf(x),o.childLanes=yf(e,l,x),t.memoizedState=mf,ms(null,o));if(ra(t),gp(c)){if(l=c.nextSibling&&c.nextSibling.dataset,l)var N=l.dgst;return l=N,l!==""&&(o=Error(s(419)),o.stack="",o.digest=l,ls({value:o,source:null,stack:null})),nu(e,t,x)}if(Ft||Xa(e,t,x,!1),l=(x&e.childLanes)!==0,Ft||l){if(la.current!==null)return nu(e,t,x);if(l=xt,l!==null&&(o=hr(l,x),o!==0&&o!==f.retryLane))throw f.retryLane=o,Ga(e,o),Vn(l,e,o),pf;return mp(c)||xu(),nu(e,t,x)}return mp(c)?(t.flags|=192,t.child=e.child,null):(e=f.treeContext,Ct=vl(c.nextSibling),an=t,Je=!0,Fr=null,yl=!1,e!==null&&Ph(t,e),t=bf(t,o.children),t.flags|=134221824,t)}function yg(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),_c(e.return,t,n)}function bg(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Yc(n)===null&&(t=e),e=e.sibling}return t}function lu(e,t,n,l,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=o,f.treeForkCount=c)}function vf(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function xf(e,t,n){var l=t.pendingProps,o=l.revealOrder,c=l.tail;l=l.children;var f=mn.current;if(t.flags&128)return ds(t,f),null;var x=(f&2)!==0;if(x?(f=f&1|2,t.flags|=128):f&=1,ds(t,f),o==="backwards"&&e!==null?(vf(e),nn(e,t,l,n),vf(e)):nn(e,t,l,n),l=Je?ns:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yg(e,n,t);else if(e.tag===19)yg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"backwards":n=bg(t.child),n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null,vf(t)),lu(t,!0,o,null,c,l);break;case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Yc(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}lu(t,!0,n,null,c,l);break;case"together":lu(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:n=bg(t.child),n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),lu(t,!1,o,n,c,l)}return t.child}function vg(e,t,n){var l=t.pendingProps;return Pr(t,t.type,l.value),nn(e,t,l.children,n),t.child}function Rr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ca|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&kc(e)))}function d0(e,t,n){switch(t.tag){case 3:Hn(t,t.stateNode.containerInfo),Pr(t,Qt,e.memoizedState.cache),Va();break;case 27:case 5:Sn(t);break;case 4:Hn(t,t.stateNode.containerInfo);break;case 10:Pr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Kd(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return ra(t),t.flags|=128,null;l=Xa(e,t,n,!1);var o=t.child.childLanes;return l||(n&o)!==0?gg(e,t,n):(ra(t),e=Rr(e,t,n),e!==null?e.sibling:null)}ra(t);break;case 19:if(t.flags&128)return xf(e,t,n);if(o=(e.flags&128)!==0,l=(n&t.childLanes)!==0,l||(Xa(e,t,n,!1),l=(n&t.childLanes)!==0),o){if(l)return xf(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ds(t,mn.current),l)break;return null;case 22:return t.lanes=0,ug(e,t,n,t.pendingProps);case 24:Pr(t,Qt,e.memoizedState.cache)}return Rr(e,t,n)}function xg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ft=!0;else{if(!Sf(e,n)&&(t.flags&128)===0)return Ft=!1,d0(e,t,n);Ft=(e.flags&131072)!==0}else Ft=!1,Je&&(t.flags&1048576)!==0&&Jh(t,ns,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e=="function")Ad(e)?(l=ei(e,l),t.tag=1,t=hg(null,t,e,l,n)):(t.tag=0,t=hf(null,t,e,l,n));else{if(e!=null){var o=e.$$typeof;if(o===z){t.tag=11,t=og(null,t,e,l,n);break e}else if(o===Ge){t.tag=14,t=sg(null,t,e,l,n);break e}else if(o===Pe){t.tag=10,t.type=e,t=vg(null,t,n);break e}}throw t=$e(e)||e,Error(s(306,t,""))}}return t;case 0:return hf(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,o=ei(l,t.pendingProps),hg(e,t,l,o,n);case 3:e:{if(Hn(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var c=t.memoizedState;o=c.element,Id(e,t),us(t,l,null,n);var f=t.memoizedState;if(l=f.cache,Pr(t,Qt,l),l!==c.cache&&_d(t,[Qt],n,!0),cs(),l=f.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=mg(e,t,l,n);break e}else if(l!==o){o=hl(Error(s(424)),t),ls(o),t=mg(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ct=vl(e.firstChild),an=t,Je=!0,Fr=null,yl=!0,n=um(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Va(),l===o){t=Rr(e,t,n);break e}nn(e,t,l,n)}t=t.child}return t;case 26:return Pi(e,t),e===null?(n=Ky(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(t.stateNode=Ty(t.type,t.pendingProps,Lt.current,t)):t.memoizedState=Ky(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Sn(t),e===null&&Je&&(l=t.stateNode=qy(t.type,t.pendingProps,Lt.current),an=t,yl=!0,o=Ct,pa(t.type)?(yp=o,Ct=vl(l.firstChild)):Ct=o),nn(e,t,t.pendingProps.children,n),Pi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((o=l=Ct)&&(l=a1(l,t.type,t.pendingProps,yl),l!==null?(t.stateNode=l,an=t,Ct=vl(l.firstChild),yl=!1,o=!0):o=!1),o||Jr(t)),Sn(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,l=c.children,sp(o,c)?l=null:f!==null&&sp(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Qd(e,t,e0,null,null,n),yo._currentValue=o),Pi(e,t),nn(e,t,l,n),t.child;case 6:return e===null&&Je&&((e=n=Ct)&&(n=i1(n,t.pendingProps,yl),n!==null?(t.stateNode=n,an=t,Ct=null,e=!0):e=!1),e||Jr(t)),null;case 13:return gg(e,t,n);case 4:return Hn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Pa(t,null,l,n):nn(e,t,l,n),t.child;case 11:return og(e,t,t.type,t.pendingProps,n);case 7:return l=t.pendingProps,Pi(e,t),nn(e,t,l,n),t.child;case 8:return nn(e,t,t.pendingProps.children,n),t.child;case 12:return nn(e,t,t.pendingProps.children,n),t.child;case 10:return vg(e,t,n);case 9:return o=t.type._context,l=t.pendingProps.children,$a(t),o=pn(o),l=l(o),t.flags|=1,nn(e,t,l,n),t.child;case 14:return sg(e,t,t.type,t.pendingProps,n);case 15:return cg(e,t,t.type,t.pendingProps,n);case 19:return xf(e,t,n);case 31:return c0(e,t,n);case 22:return ug(e,t,n,t.pendingProps);case 24:return $a(t),l=pn(Qt),e===null?(o=Ld(),o===null&&(o=xt,c=kd(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:l,cache:o},Bd(t),Pr(t,Qt,o)):((e.lanes&n)!==0&&(Id(e,t),us(t,null,null,n),cs()),o=e.memoizedState,c=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Pr(t,Qt,l)):(l=c.cache,Pr(t,Qt,l),l!==o.cache&&_d(t,[Qt],n,!0))),nn(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Je&&Mc(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Pi(e,t),nn(e,t,l.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function jr(e){e.flags|=4}function wf(e,t,n,l,o){var c;if((c=(e.mode&32)!==0)&&(c=n===null?Zy(t,l):Zy(t,l)&&(l.src!==n.src||l.srcSet!==n.srcSet)),c){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(ty())e.flags|=8192;else throw Ja=Bc,Ud}else e.flags&=-16777217}function Sg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fy(t))if(ty())e.flags|=8192;else throw Ja=Bc,Ud}function ru(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?sc():536870912,e.lanes|=t,lo|=t)}function gs(e,t){if(!Je)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags&1206910976,l|=o.flags&1206910976,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function f0(e,t,n){var l=t.pendingProps;switch(Rd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return Nt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ar(Qt),Ut(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?jr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Md())),Nt(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(jr(t),c!==null?(Nt(t),Sg(t,c)):(Nt(t),wf(t,o,null,l,n))):c?c!==e.memoizedState?(jr(t),Nt(t),Sg(t,c)):(Nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&jr(t),Nt(t),wf(t,o,e,l,n)),null;case 27:if(Ln(t),n=Lt.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jr(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Nt(t),t.subtreeFlags&=-33554433,null}e=Vt.current,Ki(t)?Wh(t):(e=qy(o,l,n),t.stateNode=e,jr(t))}return Nt(t),t.subtreeFlags&=-33554433,null;case 5:if(Ln(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jr(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return Nt(t),t.subtreeFlags&=-33554433,null}if(c=Vt.current,Ki(t))Wh(t);else{var f=As(Lt.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?f.createElement(o,{is:l.is}):f.createElement(o)}}c[Kt]=t,c[tn]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(yn(c,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&jr(t)}}return Nt(t),t.subtreeFlags&=-33554433,wf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&jr(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=Lt.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,o=an,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[Kt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||xy(e.nodeValue,n)),e||Jr(t,!0)}else e=As(e).createTextNode(l),e[Kt]=t,t.stateNode=e}return Nt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ki(t),n!==null){if(e===null){if(!l)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Kt]=t}else Va(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),e=!1}else n=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(nl(t),t):(nl(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Nt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ki(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(s(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(s(317));o[Kt]=t}else Va(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),o=!1}else o=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(nl(t),t):(nl(t),null)}return nl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==o&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ru(t,t.updateQueue),Nt(t),null);case 4:return Ut(),e===null&&lp(t.stateNode.containerInfo),t.flags|=67108864,Nt(t),null;case 10:return Ar(t.type),Nt(t),null;case 19:if(Xd(t),l=t.memoizedState,l===null)return Nt(t),null;if(o=(t.flags&128)!==0,c=l.rendering,c===null)if(o)gs(l,!1);else{if(qt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Yc(e),c!==null){for(t.flags|=128,gs(l,!1),e=c.updateQueue,t.updateQueue=e,ru(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qh(n,e),n=n.sibling;return ds(t,mn.current&1|2),Je&&Cr(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&oe()>gu&&(t.flags|=128,o=!0,gs(l,!1),t.lanes=4194304)}else{if(!o)if(e=Yc(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,ru(t,e),gs(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!c.alternate&&!Je)return Nt(t),null}else 2*oe()-l.renderingStartTime>gu&&n!==536870912&&(t.flags|=128,o=!0,gs(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}if(l.tail!==null){e=l.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=oe(),e.sibling=null,c=mn.current,c=o?c&1|2:c&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!n||Je?ds(t,c):(n=c,tt(hn,t),tt(mn,n),En===null&&(En=t)),Je&&Cr(t,l.treeForkCount),e}return Nt(t),null;case 22:case 23:return nl(t),Vd(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),n=t.updateQueue,n!==null&&ru(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&wt(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ar(Qt),Nt(t),null;case 25:return null;case 30:return t.flags|=33554432,Nt(t),null}throw Error(s(156,t.tag))}function p0(e,t){switch(Rd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ar(Qt),Ut(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ln(t),null;case 31:if(t.memoizedState!==null){if(nl(t),t.alternate===null)throw Error(s(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xd(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ut(),null;case 10:return Ar(t.type),null;case 22:case 23:return nl(t),Vd(),e!==null&&wt(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ar(Qt),null;case 25:return null;default:return null}}function wg(e,t){switch(Rd(t),t.tag){case 3:Ar(Qt),Ut();break;case 26:case 27:case 5:Ln(t);break;case 4:Ut();break;case 31:t.memoizedState!==null&&nl(t);break;case 13:nl(t);break;case 19:Xd(t);break;case 10:Ar(t.type);break;case 22:case 23:nl(t),Vd(),e!==null&&wt(Za);break;case 24:Ar(Qt)}}function ys(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var o=l.next;n=o;do{if((n.tag&e)===e){l=void 0;var c=n.create,f=n.inst;l=c(),f.destroy=l}n=n.next}while(n!==o)}}catch(x){mt(t,t.return,x)}}function ia(e,t,n){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var c=o.next;l=c;do{if((l.tag&e)===e){var f=l.inst,x=f.destroy;if(x!==void 0){f.destroy=void 0,o=t;var N=n,H=x;try{H()}catch(q){mt(o,N,q)}}}l=l.next}while(l!==c)}}catch(q){mt(t,t.return,q)}}function Eg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{fm(t,n)}catch(l){mt(e,e.return,l)}}}function Tg(e,t,n){n.props=ei(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){mt(e,t,l)}}function er(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var o=e.stateNode,c=wr(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=jy(c)),l=o.ref;break;case 7:if(e.stateNode===null){var f=new ol(e);v(e.child,!1,l1,f,void 0,void 0),e.stateNode=f}l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(x){mt(e,t,x)}}function gn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(o){mt(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){mt(e,t,o)}else n.current=null}function au(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Ly(e.stateNode,t[n])}function Cg(e){for(var t=e.return;t!==null&&(Tf(t)&&Ly(e.stateNode,t.stateNode),!Ef(t));)t=t.return}function bs(e){for(var t=e.return;t!==null&&(Tf(t)&&r1(e.stateNode,t.stateNode),!Ef(t));)t=t.return}function Ef(e){return e.tag===5||e.tag===3||e.tag===27}function Tf(e){return e&&e.tag===7&&e.stateNode!==null}function Cf(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(o){mt(e,e.return,o)}}function Nf(e,t,n){try{var l=e.stateNode;B0(l,e.type,n,t),l[tn]=t}catch(o){mt(e,e.return,o)}}function Ng(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pa(e.type)||e.tag===4}function Af(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ng(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&pa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Of(e,t,n,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(o,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(o),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ul)),au(e,l),Qe=!0;else if(o!==4&&(o===27&&(au(e,l),l=null,pa(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Of(e,t,n,l),e=e.sibling;e!==null;)Of(e,t,n,l),e=e.sibling}function iu(e,t,n,l){var o=e.tag;if(o===5||o===6)o=e.stateNode,t?n.insertBefore(o,t):n.appendChild(o),au(e,l),Qe=!0;else if(o!==4&&(o===27&&(au(e,l),l=null,pa(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(iu(e,t,n,l),e=e.sibling;e!==null;)iu(e,t,n,l),e=e.sibling}function Ag(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);yn(t,l,n),t[Kt]=e,t[tn]=n}catch(c){mt(e,e.return,c)}}var ou=!1,ll=null;function Og(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(ou=!0)}var tr=null;function Dg(){var e=tr;return tr=null,e}var qn=0;function Wi(e,t,n,l,o){return qn=0,Rg(e.child,t,n,l,o)}function Rg(e,t,n,l,o){for(var c=!1;e!==null;){if(e.tag===5){var f=e.stateNode;if(l!==null){var x=dp(f);l.push(x),x.view&&(c=!0)}else c||dp(f).view&&(c=!0);ou=!0,Dy(f,qn===0?t:t+"_"+qn,n),qn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&o||Rg(e.child,t,n,l,o)&&(c=!0));e=e.sibling}return c}function nr(e,t){for(;e!==null;)e.tag===5?Ry(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||nr(e.child,t)),e=e.sibling}function su(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(su(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(s(544));var n=t.name;t=Er(t.default,t.share),t!=="none"&&(Wi(e,n,t,null,!1)||nr(e.child,!1))}e=e.sibling}}function Df(e,t){if(e.tag===30){var n=e.stateNode,l=e.memoizedProps,o=wr(l,n),c=Er(l.default,n.paired?l.share:l.enter);c!=="none"?Wi(e,o,c,null,!1)?(su(e),n.paired||t||oo(e,l.onEnter)):nr(e.child,!1):su(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Df(e,t),e=e.sibling;else su(e)}function Rf(e){if(ll!==null&&ll.size!==0){var t=ll;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,l=n.name;if(l!=null&&l!=="auto"){var o=t.get(l);if(o!==void 0){var c=Er(n.default,n.share);if(c!=="none"&&(Wi(e,l,c,null,!1)?(c=e.stateNode,o.paired=c,c.paired=o,oo(e,n.onShare)):nr(e.child,!1)),t.delete(l),t.size===0)break}}}Rf(e)}e=e.sibling}}}function jf(e){if(e.tag===30){var t=e.memoizedProps,n=wr(t,e.stateNode),l=ll!==null?ll.get(n):void 0,o=Er(t.default,l!==void 0?t.share:t.exit);o!=="none"&&(Wi(e,n,o,null,!1)?l!==void 0?(o=e.stateNode,l.paired=o,o.paired=l,ll.delete(n),oo(e,t.onShare)):oo(e,t.onExit):nr(e.child,!1)),ll!==null&&Rf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jf(e),e=e.sibling;else ll!==null&&Rf(e)}function jg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=wr(t,e.stateNode);t=Er(t.default,t.update),e.flags&=-5,t!=="none"&&Wi(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&jg(e);e=e.sibling}}function Mf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,nr(e.child,!1))}Mf(e)}e=e.sibling}}function cu(e){if(e.tag===30)e.stateNode.paired=null,nr(e.child,!1),Mf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)cu(e),e=e.sibling;else Mf(e)}function Mg(e){for(e=e.child;e!==null;)e.tag===30?nr(e.child,!1):(e.subtreeFlags&33554432)!==0&&Mg(e),e=e.sibling}function zf(e,t,n,l,o,c,f){for(var x=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(c!==null&&qn<c.length){var H=c[qn],q=dp(N);(H.view||q.view)&&(x=!0);var K;if(K=(e.flags&4)===0)if(q.clip)K=!0;else{K=H.rect;var _=q.rect;K=K.y!==_.y||K.x!==_.x||K.height!==_.height||K.width!==_.width}K&&(e.flags|=4),q.abs?q=!H.abs:(H=H.rect,q=q.rect,q=H.height!==q.height||H.width!==q.width),q&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Dy(N,qn===0?n:n+"_"+qn,o),x&&(e.flags&4)!==0||(tr===null&&(tr=[]),tr.push(N,qn===0?l:l+"_"+qn,t.memoizedProps)),qn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f?e.flags|=t.flags&32:zf(e,t.child,n,l,o,c,f)&&(x=!0));t=t.sibling}return x}function zg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=e.stateNode,o=wr(n,l),c=Er(n.default,n.update),f;f=e.memoizedState,e.memoizedState=null,l=e;var x=e.child;qn=0,o=zf(l,x,o,o,c,f,!1),(e.flags&4)!==0&&o&&oo(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&zg(e);e=e.sibling}}var on=!1,ft=!1,lr=!1,_f=!1,_g=typeof WeakSet=="function"?WeakSet:Set,sn=null,rr=!1,vs=!1,uu=!1,kf=!1;function h0(e,t,n){if(e=e.containerInfo,ip=bo,e=Uh(e),xd(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var c=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var x=0,N=-1,H=-1,q=0,K=0,_=e,U=null;t:for(;;){for(var de;_!==l||c!==0&&_.nodeType!==3||(N=x+c),_!==f||o!==0&&_.nodeType!==3||(H=x+o),_.nodeType===3&&(x+=_.nodeValue.length),(de=_.firstChild)!==null;)U=_,_=de;for(;;){if(_===e)break t;if(U===l&&++q===c&&(N=x),U===f&&++K===o&&(H=x),(de=_.nextSibling)!==null)break;_=U,U=_.parentNode}_=de}l=N===-1||H===-1?null:{start:N,end:H}}else l=null}l=l||{start:0,end:0}}else l=null;for(op={focusedElem:e,selectionRange:l},bo=!1,n=(n&335544064)===n,sn=t,t=n?9270:1024;sn!==null;){if(e=sn,n&&(l=e.deletions,l!==null))for(c=0;c<l.length;c++)n&&jf(l[c]);if(e.alternate===null&&(e.flags&2)!==0)n&&Og(e),du(n);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&n&&jf(l),du(n);continue}else if(l!==null&&l.memoizedState!==null){n&&Og(e),du(n);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,sn=l):(n&&jg(e),du(n))}}ll=null}function du(e){for(;sn!==null;){var t=sn,n=e,l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((o&1024)!==0&&l!==null){n=void 0,o=l.memoizedProps,l=l.memoizedState;var c=t.stateNode;try{var f=ei(t.type,o);n=c.getSnapshotBeforeUpdate(f,l),c.__reactInternalSnapshotBeforeUpdate=n}catch(x){mt(t,t.return,x)}}break;case 3:if((o&1024)!==0){if(l=t.stateNode.containerInfo,n=l.nodeType,n===9)hp(l);else if(n===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":hp(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&l!==null&&(n=wr(l.memoizedProps,l.stateNode),o=t.memoizedProps,o=Er(o.default,o.update),o!=="none"&&Wi(l,n,o,l.memoizedState=[],!0));break;default:if((o&1024)!==0)throw Error(s(163))}if(l=t.sibling,l!==null){l.return=t.return,sn=l;break}sn=t.return}}function kg(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:ar(e,n),l&4&&ys(5,n);break;case 1:if(ar(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){mt(n,n.return,f)}else{var o=ei(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){mt(n,n.return,f)}}l&64&&Eg(n),l&512&&er(n,n.return);break;case 3:if(ar(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{fm(e,t)}catch(f){mt(n,n.return,f)}}break;case 27:t===null&&l&4&&Ag(n);case 26:case 5:ar(e,n),t===null&&l&4&&Cf(n),l&512&&er(n,n.return);break;case 12:ar(e,n);break;case 31:ar(e,n),l&4&&Bg(e,n);break;case 13:ar(e,n),l&4&&Ig(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=N0.bind(null,n),o1(e,n))));break;case 22:if(l=n.memoizedState!==null||on,!l){var c=t!==null&&t.memoizedState!==null||ft;t=on,o=ft,on=l,(ft=c)&&!o?(l=2,(n.subtreeFlags&8772)!==0&&(l|=1),zl(e,n,l)):ar(e,n),on=t,ft=o}break;case 30:ar(e,n),l&512&&er(n,n.return);break;case 7:l&512&&er(n,n.return);default:ar(e,n)}}function Hf(e,t){for(e=e.child;e!==null;)Hg(e,t),e=e.sibling}function Hg(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var l=n.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var o=e.stateNode,c=e.memoizedProps.style,f=c!=null&&c.hasOwnProperty("display")?c.display:null;o.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(N){mt(e,e.return,N)}Lf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Qe=!0}catch(N){mt(e,e.return,N)}break;case 18:try{var x=e.stateNode;t?Oy(x,!0):Oy(e.stateNode,!1)}catch(N){mt(e,e.return,N)}break;case 22:case 23:e.memoizedState===null&&Hf(e,t);break;default:Hf(e,t)}}function Lf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,l=t;switch(n.tag){case 4:Hg(n,l);break e;case 22:n.memoizedState===null&&Lf(n,l);break e;default:Lf(n,l)}}e=e.sibling}}function Lg(e){var t=e.alternate;t!==null&&(e.alternate=null,Lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&An(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Mt=null,Gn=!1;function jl(e,t,n){for(n=n.child;n!==null;)Ug(e,t,n),n=n.sibling}function Ug(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Gl,n)}catch{}switch(n.tag){case 26:ft||gn(n,t),jl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ft&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ft||gn(n,t),bs(n);var l=Mt,o=Gn;pa(n.type)&&(Mt=n.stateNode,Gn=!1),jl(e,t,n),Gy(n.stateNode,n.type,n.memoizedProps),Mt=l,Gn=o;break;case 5:ft||gn(n,t),bs(n);case 6:if(n.tag===6&&bs(n),l=Mt,o=Gn,Mt=null,jl(e,t,n),Mt=l,Gn=o,Mt!==null)if(Gn)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(n.stateNode),Qe=!0}catch(c){mt(n,t,c)}else try{Mt.removeChild(n.stateNode),Qe=!0}catch(c){mt(n,t,c)}break;case 18:Mt!==null&&(Gn?(e=Mt,Ay(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),vo(e)):Ay(Mt,n.stateNode));break;case 4:l=Mt,o=Gn,Mt=n.stateNode.containerInfo,Gn=!0,jl(e,t,n),Mt=l,Gn=o;break;case 0:case 11:case 14:case 15:ia(2,n,t),ft||ia(4,n,t),jl(e,t,n);break;case 1:ft||(gn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Tg(n,t,l)),jl(e,t,n);break;case 21:jl(e,t,n);break;case 22:ft=(l=ft)||n.memoizedState!==null,jl(e,t,n),ft=l;break;case 30:gn(n,t),jl(e,t,n);break;case 7:ft||gn(n,t),jl(e,t,n);break;default:jl(e,t,n)}}function Bg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vo(e)}catch(n){mt(t,t.return,n)}}}function Ig(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vo(e)}catch(n){mt(t,t.return,n)}}function m0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(s(435,e.tag))}}function fu(e,t){var n=m0(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var o=A0.bind(null,e,l);l.then(o,o)}})}function Mn(e,t,n){var l=t.deletions;if(l!==null)for(var o=0;o<l.length;o++){var c=l[o],f=e,x=t,N=x;e:for(;N!==null;){switch(N.tag){case 27:if(pa(N.type)){Mt=N.stateNode,Gn=!1;break e}break;case 5:Mt=N.stateNode,Gn=!1;break e;case 3:case 4:Mt=N.stateNode.containerInfo,Gn=!0;break e}N=N.return}if(Mt===null)throw Error(s(160));Ug(f,x,c),Mt=null,Gn=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)qg(t,e,n),t=t.sibling}var Ml=null;function qg(e,t,n){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(o&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var c=0;c<l.length;c++){var f=l[c];f.ref.impl=f.nextImpl}Mn(t,e,n),zn(e),o&4&&(ia(3,e,e.return),ys(3,e),ia(5,e,e.return));break;case 1:Mn(t,e,n),zn(e),o&512&&(ft||l===null||gn(l,l.return)),o&64&&on&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(c=Ml,Mn(t,e,n),zn(e),o&512&&(ft||l===null||gn(l,l.return)),o&4)if(o=l!==null?l.memoizedState:null,n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null)if(on)e.stateNode=Ty(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,o=c.ownerDocument||c;t:switch(t){case"title":l=o.getElementsByTagName("title")[0],(!l||l[yr]||l[Kt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=o.createElement(t),o.head.insertBefore(l,o.querySelector("head > title"))),yn(l,t,n),l[Kt]=e,Et(l),t=l;break e;case"link":if(c=Qy("link","href",o).get(t+(n.href||""))){for(f=0;f<c.length;f++)if(l=c[f],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){c.splice(f,1);break t}}l=o.createElement(t),yn(l,t,n),o.head.appendChild(l);break;case"meta":if(c=Qy("meta","content",o).get(t+(n.content||""))){for(f=0;f<c.length;f++)if(l=c[f],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){c.splice(f,1);break t}}l=o.createElement(t),yn(l,t,n),o.head.appendChild(l);break;default:throw Error(s(468,t))}l[Kt]=e,Et(l),t=l}e.stateNode=t}else on||Sp(c,e.type,e.stateNode);else e.stateNode=$y(c,n,e.memoizedProps);else o!==n?(o===null?(t=l.stateNode,t===null||ft||t.parentNode.removeChild(t)):o.count--,n===null?on||Sp(c,e.type,e.stateNode):$y(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Nf(e,e.memoizedProps,l.memoizedProps);break;case 27:Mn(t,e,n),zn(e),o&512&&(ft||l===null||gn(l,l.return)),l!==null&&o&4&&Nf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(c=lr,lr=!1,Mn(t,e,n),lr=c,zn(e),o&512&&(ft||l===null||gn(l,l.return)),e.flags&32){t=e.stateNode;try{Yr(t,""),Qe=!0}catch(q){mt(e,e.return,q)}}o&4&&e.stateNode!=null&&(t=e.memoizedProps,Nf(e,t,l!==null?l.memoizedProps:t)),o&1024&&(_f=!0);break;case 6:if(Mn(t,e,n),zn(e),o&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Qe=!0}catch(q){mt(e,e.return,q)}}break;case 3:if(Qe=!1,Au=null,c=Ml,Ml=Os(t.containerInfo),Mn(t,e,n),Ml=c,zn(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{vo(t.containerInfo)}catch(q){mt(e,e.return,q)}_f&&(_f=!1,Gg(e)),Qe=!1;break;case 4:o=lr,lr=on,l=xi(),c=Ml,Ml=Os(e.stateNode.containerInfo),Mn(t,e,n),zn(e),Ml=c,Qe&&vs&&(uu=!0),Qe=l,lr=o;break;case 12:Mn(t,e,n),zn(e);break;case 31:Mn(t,e,n),zn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,fu(e,t)));break;case 13:Mn(t,e,n),zn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(mu=oe()),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,fu(e,t)));break;case 22:c=e.memoizedState!==null,f=l!==null&&l.memoizedState!==null;var x=on,N=ft,H=lr;on=x||c,lr=H||c,ft=N||f,Mn(t,e,n),ft=N,lr=H,on=x,zn(e),o&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||l===null||f||on||ft||(t=f||ft,n=on,l=ft,on=c||on,ft=t,oa(e,2),on=n,ft=l),!c&&lr||Hf(e,c)),o&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,fu(e,n))));break;case 19:Mn(t,e,n),zn(e),o&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,fu(e,t)));break;case 30:o&512&&(ft||l===null||gn(l,l.return)),o=xi(),c=vs,f=(n&335544064)===n,x=e.memoizedProps,vs=f&&Er(x.default,x.update)!=="none",Mn(t,e,n),zn(e),f&&l!==null&&Qe&&(e.flags|=4),vs=c,Qe=o;break;case 21:break;case 7:o&512&&(ft||l===null||gn(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Mn(t,e,n),zn(e)}}function zn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Ng(l)){n=l;break}l=l.return}l=null;for(var o=e.return;o!==null;){if(Tf(o)){var c=o.stateNode;l===null?l=[c]:l.push(c)}if(Ef(o))break;o=o.return}var f=l;if(n==null)throw Error(s(160));switch(n.tag){case 27:var x=n.stateNode,N=Af(e);iu(e,N,x,f);break;case 5:var H=n.stateNode;n.flags&32&&(Yr(H,""),n.flags&=-33);var q=Af(e);iu(e,q,H,f);break;case 3:case 4:var K=n.stateNode.containerInfo,_=Af(e);Of(e,_,K,f);break;default:throw Error(s(161))}}catch(U){mt(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,bo=!0,t.reset(),bo=!1),e=e.sibling}}function eo(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Yg(t,e),t=t.sibling;else zg(t)}function Yg(e,t){var n=e.alternate;if(n===null)Df(e,!1);else switch(e.tag){case 3:if(kf=rr=!1,Dg(),eo(t,e),!rr&&!uu){if(e=tr,e!==null)for(var l=0;l<e.length;l+=3){n=e[l];var o=e[l+1];Ry(n,e[l+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+o+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),kf=!0}tr=null;break;case 5:eo(t,e);break;case 4:l=rr,rr=!1,eo(t,e),rr&&(uu=!0),rr=l;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Df(e,!1):eo(t,e));break;case 30:l=rr,o=Dg(),rr=!1,eo(t,e),rr&&(e.flags|=4);var c=e.memoizedProps,f=e.stateNode;t=wr(c,f),f=wr(n.memoizedProps,f);var x=Er(c.default,c.update);x==="none"?t=!1:(c=n.memoizedState,n.memoizedState=null,n=e.child,qn=0,t=zf(e,n,t,f,x,c,!0),qn!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(oo(e,e.memoizedProps.onUpdate),tr=o):o!==null&&(o.push.apply(o,tr),tr=o),rr=(e.flags&32)!==0?!0:l;break;default:eo(t,e)}}function ar(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kg(e,t.alternate,t),t=t.sibling}function oa(e,t){for(e=e.child;e!==null;){var n=e,l=t;switch(n.tag){case 0:case 11:case 14:case 15:ia(4,n,n.return),oa(n,l);break;case 1:gn(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Tg(n,n.return,o),oa(n,l);break;case 27:(l&2)!==0&&Gy(n.stateNode,n.type,n.memoizedProps);case 5:gn(n,n.return),n.tag!==5&&n.tag!==27||bs(n),oa(n,l);break;case 6:bs(n);break;case 26:gn(n,n.return),o=n.stateNode,n.memoizedState!==null||o===null||ft||o.parentNode.removeChild(o),oa(n,l);break;case 22:n.memoizedState===null&&oa(n,l);break;case 30:gn(n,n.return),oa(n,l);break;case 7:gn(n,n.return);default:oa(n,l)}e=e.sibling}}function zl(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var l=t.alternate,o=e,c=t,f=c.flags,x=(n&1)!==0;switch(c.tag){case 0:case 11:case 15:zl(o,c,n),ys(4,c);break;case 1:if(zl(o,c,n),l=c,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(q){mt(l,l.return,q)}if(l=c,o=l.updateQueue,o!==null){var N=l.stateNode;try{var H=o.shared.hiddenCallbacks;if(H!==null)for(o.shared.hiddenCallbacks=null,o=0;o<H.length;o++)dm(H[o],N)}catch(q){mt(l,l.return,q)}}x&&f&64&&Eg(c),er(c,c.return);break;case 27:(n&2)!==0&&Ag(c);case 5:c.tag!==5&&c.tag!==27||Cg(c),zl(o,c,n),x&&l===null&&f&4&&Cf(c),er(c,c.return);break;case 6:Cg(c);break;case 26:N=c.stateNode,c.memoizedState!==null||N===null||on||Sp(Os(N.ownerDocument),c.type,N),zl(o,c,n),x&&l===null&&f&4&&Cf(c),er(c,c.return);break;case 12:zl(o,c,n);break;case 31:zl(o,c,n),x&&f&4&&Bg(o,c);break;case 13:zl(o,c,n),x&&f&4&&Ig(o,c);break;case 22:c.memoizedState===null&&zl(o,c,n),er(c,c.return);break;case 30:zl(o,c,n),er(c,c.return);break;case 7:er(c,c.return);default:zl(o,c,n)}t=t.sibling}}function Uf(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&rs(n))}function Bf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rs(e))}function bl(e,t,n,l){var o=(n&335544064)===n;if(t.subtreeFlags&(o?10262:10256))for(t=t.child;t!==null;)Vg(e,t,n,l),t=t.sibling;else o&&Mg(t)}function Vg(e,t,n,l){var o=(n&335544064)===n;o&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&cu(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,l),c&2048&&ys(9,t);break;case 1:bl(e,t,n,l);break;case 3:bl(e,t,n,l),o&&kf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&rs(c)));break;case 12:if(c&2048){bl(e,t,n,l),c=t.stateNode;try{var f=t.memoizedProps,x=f.id,N=f.onPostCommit;typeof N=="function"&&N(x,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(H){mt(t,t.return,H)}}else bl(e,t,n,l);break;case 31:bl(e,t,n,l);break;case 13:bl(e,t,n,l);break;case 23:break;case 22:f=t.stateNode,x=t.alternate,t.memoizedState!==null?(o&&x!==null&&x.memoizedState===null&&cu(x),f._visibility&2?bl(e,t,n,l):xs(e,t)):(o&&x!==null&&x.memoizedState!==null&&cu(t),f._visibility&2?bl(e,t,n,l):(f._visibility|=2,to(e,t,n,l,(t.subtreeFlags&10256)!==0||!1))),c&2048&&Uf(x,t);break;case 24:bl(e,t,n,l),c&2048&&Bf(t.alternate,t);break;case 30:o&&(c=t.alternate,c!==null&&(nr(c.child,!0),nr(t.child,!0))),bl(e,t,n,l);break;default:bl(e,t,n,l)}}function to(e,t,n,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,x=n,N=l,H=f.flags;switch(f.tag){case 0:case 11:case 15:to(c,f,x,N,o),ys(8,f);break;case 23:break;case 22:var q=f.stateNode;f.memoizedState!==null?q._visibility&2?to(c,f,x,N,o):xs(c,f):(q._visibility|=2,to(c,f,x,N,o)),o&&H&2048&&Uf(f.alternate,f);break;case 24:to(c,f,x,N,o),o&&H&2048&&Bf(f.alternate,f);break;default:to(c,f,x,N,o)}t=t.sibling}}function xs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,o=l.flags;switch(l.tag){case 22:xs(n,l),o&2048&&Uf(l.alternate,l);break;case 24:xs(n,l),o&2048&&Bf(l.alternate,l);break;default:xs(n,l)}t=t.sibling}}var ti=8192;function ni(e,t,n){if(e.subtreeFlags&ti)for(e=e.child;e!==null;)Kg(e,t,n),e=e.sibling}function Kg(e,t,n){switch(e.tag){case 26:ni(e,t,n),e.flags&ti&&(e.memoizedState!==null?S1(n,Ml,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Py(n,e)));break;case 5:ni(e,t,n),e.flags&ti&&(e=e.stateNode,(t&335544128)===t&&Py(n,e));break;case 3:case 4:var l=Ml;Ml=Os(e.stateNode.containerInfo),ni(e,t,n),Ml=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=ti,ti=16777216,ni(e,t,n),ti=l):ni(e,t,n));break;case 30:if((e.flags&ti)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var o=e.stateNode;o.paired=null,ll===null&&(ll=new Map),ll.set(l,o)}ni(e,t,n);break;default:ni(e,t,n)}}function Xg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ss(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];sn=l,Qg(l,e)}Xg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$g(e),e=e.sibling}function $g(e){switch(e.tag){case 0:case 11:case 15:Ss(e),e.flags&2048&&ia(9,e,e.return);break;case 3:Ss(e);break;case 12:Ss(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,pu(e)):Ss(e);break;default:Ss(e)}}function pu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];sn=l,Qg(l,e)}Xg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ia(8,t,t.return),pu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,pu(t));break;default:pu(t)}e=e.sibling}}function Qg(e,t){for(;sn!==null;){var n=sn;switch(n.tag){case 0:case 11:case 15:ia(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:rs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,sn=l;else e:for(n=e;sn!==null;){l=sn;var o=l.sibling,c=l.return;if(Lg(l),l===n){sn=null;break e}if(o!==null){o.return=c,sn=o;break e}sn=c}}}var g0={getCacheForType:function(e){var t=pn(Qt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return pn(Qt).controller.signal}},y0=typeof WeakMap=="function"?WeakMap:Map,dt=0,xt=null,We=null,nt=0,ht=0,rl=null,sa=!1,no=!1,If=!1,Mr=0,qt=0,ca=0,li=0,hu=0,al=0,lo=0,ws=null,Yn=null,qf=!1,mu=0,Zg=0,gu=1/0,yu=null,ua=null,_t=0,_l=null,ri=null,ir=0,Gf=0,Yf=null,Fg=null,ro=null,ao=null,io=null,Es=0,bu=null;function il(){return(dt&2)!==0&&nt!==0?nt&-nt:ge.T!==null?Wf():Cn()}function Jg(){if(al===0)if((nt&536870912)===0||Je){var e=qr;qr<<=1,(qr&3932160)===0&&(qr=262144),al=e}else al=536870912;return e=hn.current,e!==null&&(e.flags|=32),al}function oo(e,t){if(t!=null){var n=e.stateNode,l=n.ref;l===null&&(l=n.ref=jy(wr(e.memoizedProps,n))),ao===null&&(ao=[]),ao.push(t.bind(null,l))}}function Vn(e,t,n){(e===xt&&(ht===2||ht===9)||e.cancelPendingCommit!==null)&&(so(e,0),da(e,nt,al,!1)),sl(e,n),((dt&2)===0||e!==xt)&&(e===xt&&((dt&2)===0&&(li|=n),qt===4&&da(e,nt,al,!1)),or(e))}function Pg(e,t,n){if((dt&6)!==0)throw Error(s(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Vl(e,t),o=l?x0(e,t):Kf(e,t,!0),c=l;do{if(o===0){no&&!l&&da(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!b0(n)){o=Kf(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var x=e;o=ws;var N=x.current.memoizedState.isDehydrated;if(N&&(so(x,f).flags|=256),f=Kf(x,f,!1),f!==2&&f!==6){if(If&&!N){x.errorRecoveryDisabledLanes|=c,li|=c,o=4;break e}c=Yn,Yn=o,c!==null&&(Yn===null?Yn=c:Yn.push.apply(Yn,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){so(e,0),da(e,t,0,!0);break}e:{switch(l=e,c=o,c){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:da(l,t,al,!sa);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(o=mu+300-oe(),10<o)){if(da(l,t,al,!sa),Ra(l,0,!0)!==0)break e;ir=t,l.timeoutHandle=up(Wg.bind(null,l,n,Yn,yu,qf,t,al,li,lo,sa,c,"Throttled",-0,0),o);break e}Wg(l,n,Yn,yu,qf,t,al,li,lo,sa,c,null,-0,0)}}break}while(!0);or(e)}function Wg(e,t,n,l,o,c,f,x,N,H,q,K,_,U){e.timeoutHandle=-1;var de=t.subtreeFlags,Ce=(c&335544064)===c;if(K=null,(Ce||de&8192||(de&16785408)===16785408)&&(K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ul},ll=null,Kg(t,c,K),Ce&&(de=K,Ce=e.containerInfo,Ce=(Ce.nodeType===9?Ce:Ce.ownerDocument).__reactViewTransition,Ce!=null&&(de.count++,de.waitingForViewTransition=!0,de=js.bind(de),Ce.finished.then(de,de))),de=(c&62914560)===c?mu-oe():(c&4194048)===c?Zg-oe():0,de=w1(K,de),de!==null)){ir=c,e.cancelPendingCommit=de(oy.bind(null,e,t,c,n,l,o,f,x,N,H,q,K,null,_,U)),da(e,c,f,!H);return}oy(e,t,c,n,l,o,f,x,N,H,q,K)}function b0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var o=n[l],c=o.getSnapshot;o=o.value;try{if(!it(c(),o))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 da(e,t,n,l){t=Io(e,t),t&=~hu,t&=~li,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var c=31-Tn(o),f=1<<c;l[c]=-1,o&=~f}n!==0&&Yo(e,n,t)}function vu(){return(dt&6)===0?(Ts(0),!1):!0}function Vf(){if(We!==null){if(ht===0)var e=We.return;else e=We,Nr=Ka=null,Jd(e),Qi=null,os=0,e=We;for(;e!==null;)wg(e.alternate,e),e=e.return;We=null}}function so(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,G0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ir=0,Vf(),xt=e,We=n=Tr(e.current,null),nt=t,ht=0,rl=null,sa=!1,no=Vl(e,t),If=!1,lo=al=hu=li=ca=qt=0,Yn=ws=null,qf=!1,Mr=Io(e,t),Ac(),n}function ey(e,t){Ke=null,ge.H=Pc,t===$i||t===Uc?(t=om(),ht=3):t===Ud?(t=om(),ht=4):ht=t===pf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,rl=t,We===null&&(qt=1,Wc(e,hl(t,e.current)))}function ty(){var e=hn.current;return e===null?!0:(nt&4194048)===nt?En===null:(nt&62914560)===nt||(nt&536870912)!==0?e===En:!1}function ny(){var e=ge.H;return ge.H=Pc,e===null?Pc:e}function ly(){var e=ge.A;return ge.A=g0,e}function xu(){qt=4,sa||(nt&4194048)!==nt&&hn.current!==null||(no=!0),(ca&134217727)===0&&(li&134217727)===0||xt===null||da(xt,nt,al,!1)}function Kf(e,t,n){var l=dt;dt|=2;var o=ny(),c=ly();(xt!==e||nt!==t)&&(yu=null,so(e,t)),t=!1;var f=qt;e:do try{if(ht!==0&&We!==null){var x=We,N=rl;switch(ht){case 8:Vf(),f=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(t=!0);var H=ht;if(ht=0,rl=null,co(e,x,N,H),n&&no){f=0;break e}break;default:H=ht,ht=0,rl=null,co(e,x,N,H)}}v0(),f=qt;break}catch(q){ey(e,q)}while(!0);return t&&e.shellSuspendCounter++,Nr=Ka=null,dt=l,ge.H=o,ge.A=c,We===null&&(xt=null,nt=0,Ac()),f}function v0(){for(;We!==null;)ry(We)}function x0(e,t){var n=dt;dt|=2;var l=ny(),o=ly();xt!==e||nt!==t?(yu=null,gu=oe()+500,so(e,t)):no=Vl(e,t);e:do try{if(ht!==0&&We!==null){t=We;var c=rl;t:switch(ht){case 1:ht=0,rl=null,co(e,t,c,1);break;case 2:case 9:if(am(c)){ht=0,rl=null,ay(t);break}t=function(){ht!==2&&ht!==9||xt!==e||(ht=7),or(e)},c.then(t,t);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:am(c)?(ht=0,rl=null,ay(t)):(ht=0,rl=null,co(e,t,c,7));break;case 5:var f=null;switch(We.tag){case 26:f=We.memoizedState;case 5:case 27:var x=We;if(f?Fy(f):x.stateNode.complete){ht=0,rl=null;var N=x.sibling;if(N!==null)We=N;else{var H=x.return;H!==null?(We=H,Su(H)):We=null}break t}}ht=0,rl=null,co(e,t,c,5);break;case 6:ht=0,rl=null,co(e,t,c,6);break;case 8:Vf(),qt=6;break e;default:throw Error(s(462))}}S0();break}catch(q){ey(e,q)}while(!0);return Nr=Ka=null,ge.H=l,ge.A=o,dt=n,We!==null?0:(xt=null,nt=0,Ac(),qt)}function S0(){for(;We!==null&&!vt();)ry(We)}function ry(e){var t=xg(e.alternate,e,Mr);e.memoizedProps=e.pendingProps,t===null?Su(e):We=t}function ay(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pg(n,t,t.pendingProps,t.type,void 0,nt);break;case 11:t=pg(n,t,t.pendingProps,t.type.render,t.ref,nt);break;case 5:Jd(t);var l=t;l===an&&(Je?(zc(l),l.tag===5&&l.stateNode!=null&&(Ct=l.stateNode)):(zc(l),Je=!0));default:wg(n,t),t=We=Qh(t,Mr),t=xg(n,t,Mr)}e.memoizedProps=e.pendingProps,t===null?Su(e):We=t}function co(e,t,n,l){Nr=Ka=null,Jd(t),Qi=null,os=0;var o=t.return;try{if(s0(e,o,t,n,nt)){qt=1,Wc(e,hl(n,e.current)),We=null;return}}catch(c){if(o!==null)throw We=o,c;qt=1,Wc(e,hl(n,e.current)),We=null;return}t.flags&32768?(Je||l===1?e=!0:no||(nt&536870912)!==0?e=!1:(sa=e=!0,(l===2||l===9||l===3||l===6)&&(l=hn.current,l!==null&&l.tag===13&&(l.flags|=16384))),iy(t,e)):Su(t)}function Su(e){var t=e;do{if((t.flags&32768)!==0){iy(t,sa);return}e=t.return;var n=f0(t.alternate,t,Mr);if(n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);qt===0&&(qt=5)}function iy(e,t){do{var n=p0(e.alternate,e);if(n!==null){n.flags&=32767,We=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){We=e;return}We=e=n}while(e!==null);qt=6,We=null}function oy(e,t,n,l,o,c,f,x,N,H,q,K){e.cancelPendingCommit=null;do wu();while(_t!==0);if((dt&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===xt&&(We=xt=null,nt=0),ri=t,_l=e,ir=n,Yf=o,Fg=l,w0(e,t,n,f,x,N,K)}}function w0(e,t,n,l,o,c,f){var x=t.lanes|t.childLanes;if(Gf=x,x|=Cd,ja(e,n,x,l,o,c),ao=null,(n&335544064)===n?(io=Fx(e),l=10262):(io=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,O0(en,function(){return Zf(),null})):(e.callbackNode=null,e.callbackPriority=0),ou=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null,o=Ne.p,Ne.p=2,c=dt,dt|=4;try{h0(e,t,n)}finally{dt=c,Ne.p=o,ge.T=l}}_t=1,ou?ro=Q0(f,e.containerInfo,io,Xf,$f,T0,Qf,Zf,E0):(Xf(),$f(),Qf())}function E0(e){if(_t!==0){var t=_l.onRecoverableError;t(e,{componentStack:null})}}function T0(){_t===3&&(_t=0,Yg(ri,_l),_t=4)}function Xf(){if(_t===1){_t=0;var e=_l,t=ri,n=ir,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ge.T,ge.T=null;var o=Ne.p;Ne.p=2;var c=dt;dt|=4;try{vs=uu=!1,qg(t,e,n),n=op;var f=Uh(e.containerInfo),x=n.focusedElem,N=n.selectionRange;if(f!==x&&x&&x.ownerDocument&&Lh(x.ownerDocument.documentElement,x)){if(N!==null&&xd(x)){var H=N.start,q=N.end;if(q===void 0&&(q=H),"selectionStart"in x)x.selectionStart=H,x.selectionEnd=Math.min(q,x.value.length);else{var K=x.ownerDocument||document,_=K&&K.defaultView||window;if(_.getSelection){var U=_.getSelection(),de=x.textContent.length,Ce=Math.min(N.start,de),Xe=N.end===void 0?Ce:Math.min(N.end,de);!U.extend&&Ce>Xe&&(f=Xe,Xe=Ce,Ce=f);var k=Hh(x,Ce),j=Hh(x,Xe);if(k&&j&&(U.rangeCount!==1||U.anchorNode!==k.node||U.anchorOffset!==k.offset||U.focusNode!==j.node||U.focusOffset!==j.offset)){var L=K.createRange();L.setStart(k.node,k.offset),U.removeAllRanges(),Ce>Xe?(U.addRange(L),U.extend(j.node,j.offset)):(L.setEnd(j.node,j.offset),U.addRange(L))}}}}for(K=[],U=x;U=U.parentNode;)U.nodeType===1&&K.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<K.length;x++){var V=K[x];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}bo=!!ip,op=ip=null}finally{dt=c,Ne.p=o,ge.T=l}}e.current=t,_t=2}}function $f(){if(_t===2){_t=0;var e=_l,t=ri,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=ge.T,ge.T=null;var l=Ne.p;Ne.p=2;var o=dt;dt|=4;try{kg(e,t.alternate,t)}finally{dt=o,Ne.p=l,ge.T=n}}_t=3}}function Qf(){if(_t===4||_t===3){_t=0;var e=ro;ro=null,J();var t=_l,n=ri,l=ir,o=Fg,c=(l&335544064)===l?10262:10256;if((n.subtreeFlags&c)!==0||(n.flags&c)!==0?_t=5:(_t=0,ri=_l=null,sy(t,t.pendingLanes)),c=t.pendingLanes,c===0&&(ua=null),gi(l),n=n.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Gl,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=ge.T,c=Ne.p,Ne.p=2,ge.T=null;try{for(var f=t.onRecoverableError,x=0;x<o.length;x++){var N=o[x];f(N.value,{componentStack:N.stack})}}finally{ge.T=n,Ne.p=c}}if(o=ao,f=io,io=null,o!==null&&(ao=null,f===null&&(f=[]),e!==null))for(N=0;N<o.length;N++)n=(0,o[N])(f),n!==void 0&&e.finished.finally(n);(ir&3)!==0&&wu(),or(t),c=t.pendingLanes,(l&261930)!==0&&(c&42)!==0?t===bu?Es++:(Es=0,bu=t):(Es=0,bu=null),Ts(0)}}function sy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rs(t)))}function wu(){return ro!==null&&(ro.skipTransition(),ro=null),Xf(),$f(),Qf(),Zf()}function Zf(){if(_t!==5)return!1;var e=_l,t=Gf;Gf=0;var n=gi(ir),l=ge.T,o=Ne.p;try{Ne.p=32>n?32:n,ge.T=null,n=Yf,Yf=null;var c=_l,f=ir;if(_t=0,ri=_l=null,ir=0,(dt&6)!==0)throw Error(s(331));var x=dt;if(dt|=4,$g(c.current),Vg(c,c.current,f,n),dt=x,Ts(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Gl,c)}catch{}return!0}finally{Ne.p=o,ge.T=l,sy(e,t)}}function cy(e,t,n){t=hl(n,t),t=ff(e.stateNode,t,2),e=na(e,t,2),e!==null&&(sl(e,2),or(e))}function mt(e,t,n){if(e.tag===3)cy(e,e,n);else for(;t!==null;){if(t.tag===3){cy(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ua===null||!ua.has(l))){e=hl(n,e),n=ag(2),l=na(t,n,2),l!==null&&(ig(n,l,t,e),sl(l,2),or(l));break}}t=t.return}}function Ff(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new y0;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(n)||(If=!0,o.add(n),e=C0.bind(null,e,t,n),t.then(e,e))}function C0(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,xt===e&&(nt&n)===n&&((qt===4||qt===3&&(nt&62914560)===nt&&300>oe()-mu)&&(dt&2)===0?so(e,0):hu|=n,lo===nt&&(lo=0)),or(e)}function uy(e,t){t===0&&(t=sc()),e=Ga(e,t),e!==null&&(sl(e,t),or(e))}function N0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uy(e,n)}function A0(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),uy(e,n)}function O0(e,t){return Me(e,t)}var uo=null,fo=null,Jf=!1,Eu=!1,Pf=!1,fa=0;function or(e){e!==fo&&e.next===null&&(fo===null?uo=fo=e:fo=fo.next=e),Eu=!0,Jf||(Jf=!0,R0())}function Ts(e,t){if(!Pf&&Eu){Pf=!0;do for(var n=!1,l=uo;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var c=0;else{var f=l.suspendedLanes,x=l.pingedLanes;c=(1<<31-Tn(42|e)+1)-1,c&=o&~(f&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,hy(l,c))}else c=nt,c=Ra(l,l===xt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Vl(l,c)||(n=!0,hy(l,c));l=l.next}while(n);Pf=!1}}function D0(){dy()}function dy(){Eu=Jf=!1;var e=0;fa!==0&&q0()&&(e=fa);for(var t=oe(),n=null,l=uo;l!==null;){var o=l.next,c=fy(l,t);c===0?(l.next=null,n===null?uo=o:n.next=o,o===null&&(fo=n)):(n=l,(e!==0||(c&3)!==0)&&(Eu=!0)),l=o}_t!==0&&_t!==5||Ts(e),fa!==0&&(fa=0)}function fy(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-Tn(c),x=1<<f,N=o[f];N===-1?((x&n)===0||(x&l)!==0)&&(o[f]=qo(x,t)):N<=t&&(e.expiredLanes|=x),c&=~x}if(t=xt,n=nt,n=Ra(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(ht===2||ht===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Fe(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Vl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Fe(l),gi(n)){case 2:case 8:n=At;break;case 32:n=en;break;case 268435456:n=oc;break;default:n=en}return l=py.bind(null,e),n=Me(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Fe(l),e.callbackPriority=2,e.callbackNode=null,2}function py(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(wu()&&e.callbackNode!==n)return null;var l=nt;return l=Ra(e,e===xt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Pg(e,l,t),fy(e,oe()),e.callbackNode!=null&&e.callbackNode===n?py.bind(null,e):null)}function hy(e,t){if(wu())return null;Pg(e,t,!0)}function R0(){Y0(function(){(dt&6)!==0?Me(Le,D0):dy()})}function Wf(){if(fa===0){var e=Qa;e===0&&(e=Ir,Ir<<=1,(Ir&261888)===0&&(Ir=256)),fa=e}return fa}function my(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:On(e)}function j0(e,t,n,l,o){if(t==="submit"&&n&&n.stateNode===o){var c=my((o[tn]||null).action),f=l.submitter;f&&(t=(t=f[tn]||null)?my(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var x=new Zl("action","action",null,l,o);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(fa!==0){var N=new FormData(o,f);of(n,{pending:!0,data:N,method:o.method,action:c},null,N)}}else typeof c=="function"&&(x.preventDefault(),N=new FormData(o,f),of(n,{pending:!0,data:N,method:o.method,action:c},c,N))},currentTarget:o}]})}}for(var ep=0;ep<Td.length;ep++){var tp=Td[ep],M0=tp.toLowerCase(),z0=tp[0].toUpperCase()+tp.slice(1);Rl(M0,"on"+z0)}Rl(qh,"onAnimationEnd"),Rl(Gh,"onAnimationIteration"),Rl(Yh,"onAnimationStart"),Rl("dblclick","onDoubleClick"),Rl("focusin","onFocus"),Rl("focusout","onBlur"),Rl(Gx,"onTransitionRun"),Rl(Yx,"onTransitionStart"),Rl(Vx,"onTransitionCancel"),Rl(Vh,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),ye("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ye("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ye("onBeforeInput",["compositionend","keypress","textInput","paste"]),ye("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ye("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ye("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cs="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(" "),_0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cs));function gy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],o=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var f=l.length-1;0<=f;f--){var x=l[f],N=x.instance,H=x.currentTarget;if(x=x.listener,N!==c&&o.isPropagationStopped())break e;c=x,o.currentTarget=H;try{c(o)}catch(q){Nc(q)}o.currentTarget=null,c=N}else for(f=0;f<l.length;f++){if(x=l[f],N=x.instance,H=x.currentTarget,x=x.listener,N!==c&&o.isPropagationStopped())break e;c=x,o.currentTarget=H;try{c(o)}catch(q){Nc(q)}o.currentTarget=null,c=N}}}}function et(e,t){var n=t[Al];n===void 0&&(n=t[Al]=new Set);var l=e+"__bubble";n.has(l)||(yy(t,e,2,!1),n.add(l))}function np(e,t,n){var l=0;t&&(l|=4),yy(n,e,l,t)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function lp(e){if(!e[Tu]){e[Tu]=!0,za.forEach(function(n){n!=="selectionchange"&&(_0.has(n)||np(n,!1,e),np(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tu]||(t[Tu]=!0,np("selectionchange",!1,t))}}function yy(e,t,n,l){switch(ib(t)){case 2:var o=N1;break;case 8:o=A1;break;default:o=Ep}n=o.bind(null,t,n,e),o=void 0,!La||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function rp(e,t,n,l,o){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var x=l.stateNode.containerInfo;if(x===o)break;if(f===4)for(f=l.return;f!==null;){var N=f.tag;if((N===3||N===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;x!==null;){if(f=Un(x),f===null)return;if(N=f.tag,N===5||N===6||N===26||N===27){l=c=f;continue e}x=x.parentNode}}l=l.return}mc(function(){var H=c,q=Zo(n),K=[];e:{var _=Kh.get(e);if(_!==void 0){var U=Zl,de=e;switch(e){case"keypress":if(br(n)===0)break e;case"keydown":case"keyup":U=fd;break;case"focusin":de="focus",U=Po;break;case"focusout":de="blur",U=Po;break;case"beforeblur":case"afterblur":U=Po;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":U=Ci;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=Qr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=hd;break;case qh:case Gh:case Yh:U=vc;break;case Vh:U=el;break;case"scroll":case"scrollend":U=sd;break;case"wheel":U=yd;break;case"copy":case"cut":case"paste":U=dl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=xc;break;case"submit":U=pd;break;case"toggle":case"beforetoggle":U=_i}var Ce=(t&4)!==0,Xe=!Ce&&(e==="scroll"||e==="scrollend"),k=Ce?_!==null?_+"Capture":null:_;Ce=[];for(var j=H,L;j!==null;){var V=j;if(L=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||L===null||k===null||(V=Ha(j,k),V!=null&&Ce.push(Ns(j,V,L))),Xe)break;j=j.return}0<Ce.length&&(_=new U(_,de,null,n,q),K.push({event:_,listeners:Ce}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",U&&n!==Qo&&(de=n.relatedTarget||n.fromElement)&&(Un(de)||de[Nn]))break e;(_||U)&&(de=q.window===q?q:(U=q.ownerDocument)?U.defaultView||U.parentWindow:window,_?(U=n.relatedTarget||n.toElement,_=H,U=U?Un(U):null,U!==null&&(Xe=d(U),Ce=U.tag,U!==Xe||Ce!==5&&Ce!==27&&Ce!==6)&&(U=null)):(_=null,U=H),_!==U&&(Ce=Ci,V="onMouseLeave",k="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=xc,V="onPointerLeave",k="onPointerEnter",j="pointer"),Xe=_==null?de:jt(_),L=U==null?de:jt(U),de=new Ce(V,j+"leave",_,n,q),de.target=Xe,de.relatedTarget=L,V=null,Un(q)===H&&(Ce=new Ce(k,j+"enter",U,n,q),Ce.target=L,Ce.relatedTarget=Xe,V=Ce),Xe=V,Ce=_&&U?ve(_,U,k0):null,_!==null&&by(K,de,_,Ce,!1),U!==null&&Xe!==null&&by(K,Xe,U,Ce,!0)))}e:{if(_=H?jt(H):window,U=_.nodeName&&_.nodeName.toLowerCase(),U==="select"||U==="input"&&_.type==="file")var Ee=$;else if(Cc(_))if(W)Ee=ze;else{Ee=Be;var lt=me}else U=_.nodeName,!U||U.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?H&&$o(H.elementType)&&(Ee=$):Ee=Re;if(Ee&&(Ee=Ee(e,H))){p(K,Ee,n,q);break e}lt&&lt(e,_,H)}switch(lt=H?jt(H):window,e){case"focusin":(Cc(lt)||lt.contentEditable==="true")&&(Bi=lt,Sd=H,ts=null);break;case"focusout":ts=Sd=Bi=null;break;case"mousedown":wd=!0;break;case"contextmenu":case"mouseup":case"dragend":wd=!1,Bh(K,n,q);break;case"selectionchange":if(qx)break;case"keydown":case"keyup":Bh(K,n,q)}var Oe;if(Hi)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else xr?wc(e,n)&&(_e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_e="onCompositionStart");_e&&(tl&&n.locale!=="ko"&&(xr||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&xr&&(Oe=gc()):(Ql=q,Jo="value"in Ql?Ql.value:Ql.textContent,xr=!0)),lt=Cu(H,_e),0<lt.length&&(_e=new Oi(_e,e,null,n,q),K.push({event:_e,listeners:lt}),Oe?_e.data=Oe:(Oe=Ui(n),Oe!==null&&(_e.data=Oe)))),(Oe=bd?Ec(e,n):Tc(e,n))&&(_e=Cu(H,"onBeforeInput"),0<_e.length&&(lt=new Oi("onBeforeInput","beforeinput",null,n,q),K.push({event:lt,listeners:_e}),lt.data=Oe)),j0(K,e,H,n,q)}gy(K,t)})}function Ns(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cu(e,t){for(var n=t+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Ha(e,n),o!=null&&l.unshift(Ns(e,o,c)),o=Ha(e,t),o!=null&&l.push(Ns(e,o,c))),e.tag===3)return l;e=e.return}return[]}function k0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function by(e,t,n,l,o){for(var c=t._reactName,f=[];n!==null&&n!==l;){var x=n,N=x.alternate,H=x.stateNode;if(x=x.tag,N!==null&&N===l)break;x!==5&&x!==26&&x!==27||H===null||(N=H,o?(H=Ha(n,c),H!=null&&f.unshift(Ns(n,H,N))):o||(H=Ha(n,c),H!=null&&f.push(Ns(n,H,N)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var H0=/\r\n?/g,L0=/\u0000|\uFFFD/g;function vy(e){return(typeof e=="string"?e:""+e).replace(H0,`
49
+ `).replace(L0,"")}function xy(e,t){return t=vy(t),vy(e)===t}function gt(e,t,n,l,o,c){switch(n){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Yr(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Yr(e,""+l);else return;break;case"className":Si(e,"class",l);break;case"tabIndex":Si(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Si(e,n,l);break;case"style":pc(e,l,c);return;case"data":if(t!=="object"){Si(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=On(l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&gt(e,t,"name",o.name,o,null),gt(e,t,"formEncType",o.formEncType,o,null),gt(e,t,"formMethod",o.formMethod,o,null),gt(e,t,"formTarget",o.formTarget,o,null)):(gt(e,t,"encType",o.encType,o,null),gt(e,t,"method",o.method,o,null),gt(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=On(l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ul);return;case"onScroll":l!=null&&et("scroll",e);return;case"onScrollEnd":l!=null&&et("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(s(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=On(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":et("beforetoggle",e),et("toggle",e),Wn(e,"popover",l);break;case"xlinkActuate":cl(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":cl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":cl(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":cl(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":cl(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":cl(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":cl(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":cl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":cl(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wn(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=od.get(n)||n,Wn(e,n,l);else return}Qe=!0}function ap(e,t,n,l,o,c){switch(n){case"style":pc(e,l,c);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(s(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof l=="string")Yr(e,l);else if(typeof l=="number"||typeof l=="bigint")Yr(e,""+l);else return;break;case"onScroll":l!=null&&et("scroll",e);return;case"onScrollEnd":l!=null&&et("scrollend",e);return;case"onClick":l!=null&&(e.onclick=ul);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Xt.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),c=n.slice(2,o?n.length-7:void 0),t=e[tn]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(c,t,o),typeof l=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(c,l,o);break e}Qe=!0,n in e?e[n]=l:l===!0?e.setAttribute(n,""):Wn(e,n,l)}return}Qe=!0}function yn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",e),et("load",e);var l=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var f=n[c];if(f!=null)switch(c){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:gt(e,t,c,f,n,null)}}o&&gt(e,t,"srcSet",n.srcSet,n,null),l&&gt(e,t,"src",n.src,n,null);return;case"input":et("invalid",e);var x=c=f=o=null,N=null,H=null;for(l in n)if(n.hasOwnProperty(l)){var q=n[l];if(q!=null)switch(l){case"name":o=q;break;case"type":f=q;break;case"checked":N=q;break;case"defaultChecked":H=q;break;case"value":c=q;break;case"defaultValue":x=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,t));break;default:gt(e,t,l,q,n,null)}}Ko(e,c,x,N,H,f,o,!1);return;case"select":et("invalid",e),l=f=c=null;for(o in n)if(n.hasOwnProperty(o)&&(x=n[o],x!=null))switch(o){case"value":c=x;break;case"defaultValue":f=x;break;case"multiple":l=x;default:gt(e,t,o,x,n,null)}t=c,n=f,e.multiple=!!l,t!=null?$l(e,!!l,t,!1):n!=null&&$l(e,!!l,n,!0);return;case"textarea":et("invalid",e),c=o=l=null;for(f in n)if(n.hasOwnProperty(f)&&(x=n[f],x!=null))switch(f){case"value":l=x;break;case"defaultValue":o=x;break;case"children":c=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(s(91));break;default:gt(e,t,f,x,n,null)}dc(e,l,o,c);return;case"option":for(N in n)if(n.hasOwnProperty(N)&&(l=n[N],l!=null))switch(N){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:gt(e,t,N,l,n,null)}return;case"dialog":et("beforetoggle",e),et("toggle",e),et("cancel",e),et("close",e);break;case"iframe":case"object":et("load",e);break;case"video":case"audio":for(l=0;l<Cs.length;l++)et(Cs[l],e);break;case"image":et("error",e),et("load",e);break;case"details":et("toggle",e);break;case"embed":case"source":case"link":et("error",e),et("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in n)if(n.hasOwnProperty(H)&&(l=n[H],l!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:gt(e,t,H,l,n,null)}return;default:if($o(t)){for(q in n)n.hasOwnProperty(q)&&(l=n[q],l!==void 0&&ap(e,t,q,l,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(l=n[x],l!=null&&gt(e,t,x,l,n,null))}var U0={};function B0(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,x=null,N=null,H=null,q=null;for(U in n){var K=n[U];if(n.hasOwnProperty(U)&&K!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":N=K;default:l.hasOwnProperty(U)||gt(e,t,U,null,l,K)}}for(var _ in l){var U=l[_];if(K=n[_],l.hasOwnProperty(_)&&(U!=null||K!=null))switch(_){case"type":U!==K&&(Qe=!0),c=U;break;case"name":U!==K&&(Qe=!0),o=U;break;case"checked":U!==K&&(Qe=!0),H=U;break;case"defaultChecked":U!==K&&(Qe=!0),q=U;break;case"value":U!==K&&(Qe=!0),f=U;break;case"defaultValue":U!==K&&(Qe=!0),x=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(137,t));break;default:U!==K&&gt(e,t,_,U,l,K)}}Bn(e,f,x,N,H,q,c,o);return;case"select":U=f=x=_=null;for(c in n)if(N=n[c],n.hasOwnProperty(c)&&N!=null)switch(c){case"value":break;case"multiple":U=N;default:l.hasOwnProperty(c)||gt(e,t,c,null,l,N)}for(o in l)if(c=l[o],N=n[o],l.hasOwnProperty(o)&&(c!=null||N!=null))switch(o){case"value":c!==N&&(Qe=!0),_=c;break;case"defaultValue":c!==N&&(Qe=!0),x=c;break;case"multiple":c!==N&&(Qe=!0),f=c;default:c!==N&&gt(e,t,o,c,l,N)}t=x,n=f,l=U,_!=null?$l(e,!!n,_,!1):!!l!=!!n&&(t!=null?$l(e,!!n,t,!0):$l(e,!!n,n?[]:"",!1));return;case"textarea":U=_=null;for(x in n)if(o=n[x],n.hasOwnProperty(x)&&o!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:gt(e,t,x,null,l,o)}for(f in l)if(o=l[f],c=n[f],l.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":o!==c&&(Qe=!0),_=o;break;case"defaultValue":o!==c&&(Qe=!0),U=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(s(91));break;default:o!==c&&gt(e,t,f,o,l,c)}Xo(e,_,U);return;case"option":for(var de in n)if(_=n[de],n.hasOwnProperty(de)&&_!=null&&!l.hasOwnProperty(de))switch(de){case"selected":e.selected=!1;break;default:gt(e,t,de,null,l,_)}for(N in l)if(_=l[N],U=n[N],l.hasOwnProperty(N)&&_!==U&&(_!=null||U!=null))switch(N){case"selected":_!==U&&(Qe=!0),e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:gt(e,t,N,_,l,U)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in n)_=n[Ce],n.hasOwnProperty(Ce)&&_!=null&&!l.hasOwnProperty(Ce)&&gt(e,t,Ce,null,l,_);for(H in l)if(_=l[H],U=n[H],l.hasOwnProperty(H)&&_!==U&&(_!=null||U!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(137,t));break;default:gt(e,t,H,_,l,U)}return;default:if($o(t)){for(var Xe in n)_=n[Xe],n.hasOwnProperty(Xe)&&_!==void 0&&!l.hasOwnProperty(Xe)&&ap(e,t,Xe,void 0,l,_);for(q in l)_=l[q],U=n[q],!l.hasOwnProperty(q)||_===U||_===void 0&&U===void 0||ap(e,t,q,_,l,U);return}}for(var k in n)_=n[k],n.hasOwnProperty(k)&&_!=null&&!l.hasOwnProperty(k)&&gt(e,t,k,null,l,_);for(K in l)_=l[K],U=n[K],!l.hasOwnProperty(K)||_===U||_==null&&U==null||gt(e,t,K,_,l,U)}function Sy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var o=n[l],c=o.transferSize,f=o.initiatorType,x=o.duration;if(c&&x&&Sy(f)){for(f=0,x=o.responseEnd,l+=1;l<n.length;l++){var N=n[l],H=N.startTime;if(H>x)break;var q=N.transferSize,K=N.initiatorType;q&&Sy(K)&&(N=N.responseEnd,f+=q*(N<x?1:(x-H)/(N-H)))}if(--l,t+=8*(c+f)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ip=null,op=null;function As(e){return e.nodeType===9?e:e.ownerDocument}function wy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ey(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ty(e,t,n,l){return n=As(n).createElement(e),n[Kt]=l,n[tn]=t,yn(n,e,t),Et(n),n}function sp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var cp=null;function q0(){var e=window.event;return e&&e.type==="popstate"?e===cp?!1:(cp=e,!0):(cp=null,!1)}var up=typeof setTimeout=="function"?setTimeout:void 0,G0=typeof clearTimeout=="function"?clearTimeout:void 0,Cy=typeof Promise=="function"?Promise:void 0,Ny=typeof requestAnimationFrame=="function"?requestAnimationFrame:up,Y0=typeof queueMicrotask=="function"?queueMicrotask:typeof Cy<"u"?function(e){return Cy.resolve(null).then(e).catch(V0)}:up;function V0(e){setTimeout(function(){throw e})}function pa(e){return e==="head"}function Ay(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(o),vo(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")bp(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,bp(n);for(var c=n.firstChild;c;){var f=c.nextSibling,x=c.nodeName;c[yr]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=f}}else n==="body"&&bp(e.ownerDocument.body);n=o}while(n);vo(t)}function Oy(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Dy(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var o=l=0;o<t.length;o++){var c=t[o];0<c.width&&0<c.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Ry(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function K0(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function dp(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return K0(t,n,e)}function X0(e){return e.documentElement.clientHeight}function $0(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Q0(e,t,n,l,o,c,f,x,N){var H=t.nodeType===9?t:t.ownerDocument;try{var q=H.startViewTransition({update:function(){var _=H.defaultView,U=_.navigation&&_.navigation.transition,de=H.fonts.status;l();var Ce=[];if(de==="loaded"&&(X0(H),H.fonts.status==="loading"&&Ce.push(H.fonts.ready)),de=Ce.length,e!==null)for(var Xe=e.suspenseyImages,k=0,j=0;j<Xe.length;j++){var L=Xe[j];if(!L.complete){var V=L.getBoundingClientRect();if(0<V.bottom&&0<V.right&&V.top<_.innerHeight&&V.left<_.innerWidth){if(k+=Jy(L),k>Ou){Ce.length=de;break}L=new Promise($0.bind(L)),Ce.push(L)}}}if(0<Ce.length)return _=Promise.race([Promise.all(Ce),new Promise(function(Ee){return setTimeout(Ee,500)})]).then(o,o),(U?Promise.allSettled([U.finished,_]):_).then(c,c);if(o(),U)return U.finished.then(c,c);c()},types:n});H.__reactViewTransition=q;var K=[];return q.ready.then(function(){for(var _=H.documentElement.getAnimations({subtree:!0}),U=0;U<_.length;U++){var de=_[U],Ce=de.effect,Xe=Ce.pseudoElement;if(Xe!=null&&Xe.startsWith("::view-transition")){K.push(de),de=Ce.getKeyframes();for(var k=Xe=void 0,j=!0,L=0;L<de.length;L++){var V=de[L],Ee=V.width;if(Xe===void 0)Xe=Ee;else if(Xe!==Ee){j=!1;break}if(Ee=V.height,k===void 0)k=Ee;else if(k!==Ee){j=!1;break}delete V.width,delete V.height,V.transform==="none"&&delete V.transform}j&&Xe!==void 0&&k!==void 0&&(Ce.setKeyframes(de),j=getComputedStyle(Ce.target,Ce.pseudoElement),j.width!==Xe||j.height!==k)&&(j=de[0],j.width=Xe,j.height=k,j=de[de.length-1],j.width=Xe,j.height=k,Ce.setKeyframes(de))}}f()},function(_){H.__reactViewTransition===q&&(H.__reactViewTransition=null);try{if(typeof _=="object"&&_!==null)switch(_.name){case"InvalidStateError":(_.message==="View transition was skipped because document visibility state is hidden."||_.message==="Skipping view transition because document visibility state has become hidden."||_.message==="Skipping view transition because viewport size changed."||_.message==="Transition was aborted because of invalid state")&&(_=null)}_!==null&&N(_)}finally{l(),o(),f()}}),q.finished.finally(function(){for(var _=0;_<K.length;_++)K[_].cancel();H.__reactViewTransition===q&&(H.__reactViewTransition=null),x()}),q}catch{return l(),o(),f(),null}}function ai(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ai.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Z({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ai.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),l=[],o=0;o<n.length;o++){var c=n[o].effect;c!==null&&c.target===e&&c.pseudoElement===t&&l.push(n[o])}return l},ai.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function jy(e){return{name:e,group:new ai("group",e),imagePair:new ai("image-pair",e),old:new ai("old",e),new:new ai("new",e)}}function ol(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}ol.prototype.addEventListener=function(e,t,n){var l=null,o=null;if(!(n!=null&&typeof n!="boolean"&&(l=n.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(zy(c,e,t,n)===-1){var f=this,x=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(x=function(N){f.removeEventListener(e,t,n),typeof t=="function"?t.call(this,N):t.handleEvent(N)}),l!==null&&(o=f.removeEventListener.bind(f,e,t,n),l.addEventListener("abort",o,{once:!0}),o=l.removeEventListener.bind(l,"abort",o)),l=po(n),c.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:x,cleanup:o}),v(this._fragmentFiber.child,!1,Z0,e,x,l)}this._eventListeners=c}};function Z0(e,t,n,l){return G(e).addEventListener(t,n,l),!1}ol.prototype.removeEventListener=function(e,t,n){var l=this._eventListeners;if(l!==null&&(t=zy(l,e,t,n),t!==-1)){var o=l[t];n=o.attachedListener;var c=o.cleanup;o=po(o.optionsOrUseCapture),v(this._fragmentFiber.child,!1,F0,e,n,o),l.splice(t,1),c!==null&&c()}};function F0(e,t,n,l){return G(e).removeEventListener(t,n,l),!1}function po(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function My(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function zy(e,t,n,l){if(e.length===0)return-1;l=My(l);for(var o=0;o<e.length;o++){var c=e[o];if(c.type===t&&c.listener===n&&My(c.optionsOrUseCapture)===l)return o}return-1}ol.prototype.dispatchEvent=function(e){var t=C(this._fragmentFiber);if(t===null)return!0;t=G(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var o=0;o<n.length;o++){var c=n[o];l.addEventListener(c.type,c.attachedListener,po(c.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),n)for(o=0;o<n.length;o++)c=n[o],l.removeEventListener(c.type,c.attachedListener,po(c.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},ol.prototype.focus=function(e){v(this._fragmentFiber.child,!0,_y,e,void 0,void 0)};function _y(e,t){return e.tag===6?!1:(e=G(e),s1(e,t))}ol.prototype.focusLast=function(e){var t=[];v(this._fragmentFiber.child,!0,fp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!_y(t[n],e);n--);};function fp(e,t){return t.push(e),!1}ol.prototype.blur=function(){var e=C(this._fragmentFiber);e!==null&&(e=G(e),e=As(e).activeElement,e!==null&&v(this._fragmentFiber.child,!1,J0,e,void 0,void 0))};function J0(e,t){return e.tag===6?!1:(e=G(e),e===t||e.contains(t)?(t.blur(),!0):!1)}ol.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),v(this._fragmentFiber.child,!1,P0,e,void 0,void 0)};function P0(e,t){return e.tag===6||(e=G(e),t.observe(e)),!1}ol.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),v(this._fragmentFiber.child,!1,W0,e,void 0,void 0);for(var n=t=0;n<kl.length;n++){var l=kl[n];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):kl[t++]=l}kl.length=t}};function W0(e,t){return e.tag===6||(e=G(e),t.unobserve(e)),!1}var kl=[],pp=!1;function e1(e,t,n){kl.push({fragmentInstance:e,observer:t,instance:n}),pp||(pp=!0,c1(function(){pp=!1;var l=kl;kl=[];for(var o=0;o<l.length;o++){var c=l[o];c.observer.unobserve(c.instance)}}))}ol.prototype.getClientRects=function(){var e=[];return v(this._fragmentFiber.child,!1,t1,e,void 0,void 0),e};function t1(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=G(e),t.push.apply(t,e.getClientRects());return!1}ol.prototype.getRootNode=function(e){var t=C(this._fragmentFiber);return t===null?this:G(t).getRootNode(e)},ol.prototype.compareDocumentPosition=function(e){var t=C(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];v(this._fragmentFiber.child,!1,fp,n,void 0,void 0);var l=G(t);if(n.length===0){if(n=l,A(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var o=l=n.compareDocumentPosition(e);return n===e?o=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=B(t)[1],n===null?o=Node.DOCUMENT_POSITION_PRECEDING:(e=G(n).compareDocumentPosition(e),o=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),o|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=G(n[0]),o=G(n[n.length-1]);var c=A(this._fragmentFiber)?t.parentElement:l;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY;var f=t.compareDocumentPosition(e),x=o.compareDocumentPosition(e),N=f&Node.DOCUMENT_POSITION_CONTAINED_BY||x&Node.DOCUMENT_POSITION_CONTAINED_BY;return x=l&&c&&f&Node.DOCUMENT_POSITION_FOLLOWING&&x&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||c&&o===e||N||x?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!c&&o===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:f,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||n1(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function n1(e,t,n,l,o){var c=Un(o);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){n=!0;break e}c=c.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=o.ownerDocument,o===c||o===c.documentElement||o===c.body;e:{for(c=t,t=C(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===n)&&(t=ve(n,c,re),t===null?t=!1:(v(t,!0,Y,c,n),c=ae,ae=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===l)&&(t=ve(l,c,re),t===null?t=!1:(v(t,!0,R,c,l),c=ae,se=ae=null,t=c!==null)),t):!1}function ky(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}ol.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(s(566));var t=[];v(this._fragmentFiber.child,!1,fp,t,void 0,void 0);var n=e!==!1;if(t.length===0){var l=B(this._fragmentFiber);if(l=n?l[1]||l[0]||C(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=G(l),ky(e,n);return}if(l=G(l),l.nodeType!==9){if(l.nodeType===11){n="host"in l?l.host:null,n!==null&&n.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=n?t.length-1:0;l!==(n?-1:t.length);){var o=t[l];o.tag===6?(o=G(o),ky(o,n)):G(o).scrollIntoView(e),l+=n?-1:1}};function l1(e,t){return e=G(e),Hy(e,t),!1}function Hy(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Ly(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];e.addEventListener(o.type,o.attachedListener,po(o.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){for(var f=0,x=0;x<kl.length;x++){var N=kl[x];(N.fragmentInstance!==t||N.observer!==c||N.instance!==e)&&(kl[f++]=N)}kl.length=f,c.observe(e)}),Hy(e,t))}function r1(e,t){var n=t._eventListeners;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];e.removeEventListener(o.type,o.attachedListener,po(o.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){typeof c.rootMargin=="string"?e1(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function hp(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":hp(n),An(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function a1(e,t,n,l){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[yr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=vl(e.nextSibling),e===null)break}return null}function i1(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=vl(e.nextSibling),e===null))return null;return e}function Uy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vl(e.nextSibling),e===null))return null;return e}function mp(e){return e.data==="$?"||e.data==="$~"}function gp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function o1(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function vl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var yp=null;function By(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return vl(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Iy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function s1(e,t){function n(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return l}function c1(e){Ny(function(){Ny(function(t){return e(t)})})}function qy(e,t,n){switch(t=As(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Gy(e,t,n){for(var l in n){var o=n[l];n.hasOwnProperty(l)&&o!=null&&gt(e,t,l,null,U0,o)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ul&&(e.onclick=null),An(e)}function bp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);An(e)}var xl=new Map,Yy=new Set;function Os(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var zr=Ne.d;Ne.d={f:u1,r:d1,D:f1,C:p1,L:h1,m:m1,X:y1,S:g1,M:b1};function u1(){var e=zr.f(),t=vu();return e||t}function d1(e){var t=Gt(e);t!==null&&t.tag===5&&t.type==="form"?Km(t):zr.r(e)}var ho=typeof document>"u"?null:document;function Vy(e,t,n){var l=ho;if(l&&typeof t=="string"&&t){var o=fn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Yy.has(o)||(Yy.add(o),e={rel:e,crossOrigin:n,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),yn(t,"link",e),Et(t),l.head.appendChild(t)))}}function f1(e){zr.D(e),Vy("dns-prefetch",e,null)}function p1(e,t){zr.C(e,t),Vy("preconnect",e,t)}function h1(e,t,n){zr.L(e,t,n);var l=ho;if(l&&e&&t){var o='link[rel="preload"][as="'+fn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+fn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+fn(n.imageSizes)+'"]')):o+='[href="'+fn(e)+'"]';var c=o;switch(t){case"style":c=mo(e);break;case"script":c=go(e)}if(!(xl.has(c)||(e=Z({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),xl.set(c,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(Ds(c))||t==="script"&&l.querySelector(Rs(c))))){var f=l.createElement("link");yn(f,"link",e),t==="style"&&(f[Ma]=!0,f.onload=f.onerror=function(){Pn(f)}),Et(f),l.head.appendChild(f)}}}function m1(e,t){zr.m(e,t);var n=ho;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+fn(l)+'"][href="'+fn(e)+'"]',c=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=go(e)}if(!xl.has(c)&&(e=Z({rel:"modulepreload",href:e},t),xl.set(c,e),n.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Rs(c)))return}l=n.createElement("link"),yn(l,"link",e),Et(l),n.head.appendChild(l)}}}function g1(e,t,n){zr.S(e,t,n);var l=ho;if(l&&e){var o=Jn(l).hoistableStyles,c=mo(e);t=t||"default";var f=o.get(c);if(!f){var x={loading:0,preload:null};if(f=l.querySelector(Ds(c)))x.loading=5;else{e=Z({rel:"stylesheet",href:e,"data-precedence":t},n),(n=xl.get(c))&&vp(e,n);var N=f=l.createElement("link");Et(N),yn(N,"link",e),N._p=new Promise(function(H,q){N.onload=H,N.onerror=q}),N.addEventListener("load",function(){x.loading|=1}),N.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Nu(f,t,l)}f={type:"stylesheet",instance:f,count:1,state:x},o.set(c,f)}}}function y1(e,t){zr.X(e,t);var n=ho;if(n&&e){var l=Jn(n).hoistableScripts,o=go(e),c=l.get(o);c||(c=n.querySelector(Rs(o)),c||(e=Z({src:e,async:!0},t),(t=xl.get(o))&&xp(e,t),c=n.createElement("script"),Et(c),yn(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function b1(e,t){zr.M(e,t);var n=ho;if(n&&e){var l=Jn(n).hoistableScripts,o=go(e),c=l.get(o);c||(c=n.querySelector(Rs(o)),c||(e=Z({src:e,async:!0,type:"module"},t),(t=xl.get(o))&&xp(e,t),c=n.createElement("script"),Et(c),yn(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function Ky(e,t,n,l){var o=(o=Lt.current)?Os(o):null;if(!o)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=mo(n.href),t=Jn(o).hoistableStyles,l=t.get(n),l||(l={type:"style",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=mo(n.href);var c=Jn(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(Ds(e)))?c._p||(f.instance=c,f.state.loading=5):(c=xl.get(e),c||(c={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xl.set(e,c)),v1(o,e,c,f.state))),t&&l===null)throw Error(s(528,""));return f}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=go(n),t=Jn(o).hoistableScripts,l=t.get(n),l||(l={type:"script",instance:null,count:0,state:null},t.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function mo(e){return'href="'+fn(e)+'"'}function Ds(e){return'link[rel="stylesheet"]['+e+"]"}function Xy(e){return Z({},e,{"data-precedence":e.precedence,precedence:null})}function v1(e,t,n,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ma]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Ma]=!0,t.onload=t.onerror=Pn.bind(null,t),yn(t,"link",n),Et(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function go(e){return'[src="'+fn(e)+'"]'}function Rs(e){return"script[async]"+e}function $y(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+fn(n.href)+'"]');if(l)return t.instance=l,Et(l),l;var o=Z({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Et(l),yn(l,"style",o),Nu(l,n.precedence,e),t.instance=l;case"stylesheet":o=mo(n.href);var c=e.querySelector(Ds(o));if(c)return t.state.loading|=4,t.instance=c,Et(c),c;l=Xy(n),(o=xl.get(o))&&vp(l,o),c=(e.ownerDocument||e).createElement("link"),Et(c);var f=c;return f._p=new Promise(function(x,N){f.onload=x,f.onerror=N}),yn(c,"link",l),t.state.loading|=4,Nu(c,n.precedence,e),t.instance=c;case"script":return c=go(n.src),(o=e.querySelector(Rs(c)))?(t.instance=o,Et(o),o):(l=n,(o=xl.get(c))&&(l=Z({},n),xp(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),Et(o),yn(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Nu(l,n.precedence,e));return t.instance}function Nu(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,c=o,f=0;f<l.length;f++){var x=l[f];if(x.dataset.precedence===t)c=x;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function vp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Au=null;function Qy(e,t,n){if(Au===null){var l=new Map,o=Au=new Map;o.set(n,l)}else o=Au,l=o.get(n),l||(l=new Map,o.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[yr]||c[Kt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var x=l.get(f);x?x.push(c):l.set(f,[c])}}return l}function Sp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function x1(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Fy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Py(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jy(t),e.suspenseyImages.push(t)),e=E1.bind(e),t.decode().then(e,e))}function S1(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=mo(l.href),c=t.querySelector(Ds(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=js.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Et(c);return}c=t.ownerDocument||t,l=Xy(l),(o=xl.get(o))&&vp(l,o),c=c.createElement("link"),Et(c);var f=c;f._p=new Promise(function(x,N){f.onload=x,f.onerror=N}),yn(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=js.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ou=0;function w1(e,t){return e.stylesheets&&e.count===0&&Ru(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ru(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Ou===0&&(Ou=62500*I0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ru(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Ou?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function Wy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ru(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function js(){this.count--,Wy(this)}function E1(){this.imgCount--,Wy(this)}var Du=null;function Ru(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Du=new Map,t.forEach(T1,e),Du=null,js.call(e))}function T1(e,t){if(!(t.state.loading&4)){var n=Du.get(e);if(n)var l=n.get(null);else{n=new Map,Du.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}o=t.instance,f=o.getAttribute("data-precedence"),c=n.get(f)||l,c===l&&n.set(null,o),n.set(f,o),this.count++,l=js.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var yo={$$typeof:Pe,Provider:null,Consumer:null,_currentValue:at,_currentValue2:at,_threadCount:0};function C1(e,t,n,l,o,c,f,x,N){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Go(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.hiddenUpdates=Go(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.transitionTypes=null,this.incompleteTransitions=new Map}function eb(e,t,n,l,o,c,f,x,N,H,q,K){return e=new C1(e,t,n,f,N,H,q,K,x),t=1,c===!0&&(t|=24),c=In(3,null,null,t),e.current=c,c.stateNode=e,t=kd(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},Bd(c),e}function tb(e){return e?(e=Gi,e):Gi}function nb(e,t,n,l,o,c){o=tb(o),l.context===null?l.context=o:l.pendingContext=o,l=ta(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=na(e,l,t),n!==null&&(Vn(n,e,t),ss(n,e,t))}function lb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wp(e,t){lb(e,t),(e=e.alternate)&&lb(e,t)}function rb(e){if(e.tag===13||e.tag===31){var t=Ga(e,67108864);t!==null&&Vn(t,e,67108864),wp(e,67108864)}}function ab(e){if(e.tag===13||e.tag===31){var t=il();t=Kl(t);var n=Ga(e,t);n!==null&&Vn(n,e,t),wp(e,t)}}var bo=!0;function N1(e,t,n,l){var o=ge.T;ge.T=null;var c=Ne.p;try{Ne.p=2,Ep(e,t,n,l)}finally{Ne.p=c,ge.T=o}}function A1(e,t,n,l){var o=ge.T;ge.T=null;var c=Ne.p;try{Ne.p=8,Ep(e,t,n,l)}finally{Ne.p=c,ge.T=o}}function Ep(e,t,n,l){if(bo){var o=Tp(l);if(o===null)rp(e,t,l,ju,n),ob(e,l);else if(D1(o,e,t,n,l))l.stopPropagation();else if(ob(e,l),t&4&&-1<O1.indexOf(e)){for(;o!==null;){var c=Gt(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=Yl(c.pendingLanes);if(f!==0){var x=c;for(x.pendingLanes|=2,x.entangledLanes|=2;f;){var N=1<<31-Tn(f);x.entanglements[1]|=N,f&=~N}or(c),(dt&6)===0&&(gu=oe()+500,Ts(0))}}break;case 31:case 13:x=Ga(c,2),x!==null&&Vn(x,c,2),vu(),wp(c,2)}if(c=Tp(l),c===null&&rp(e,t,l,ju,n),c===o)break;o=c}o!==null&&l.stopPropagation()}else rp(e,t,l,null,n)}}function Tp(e){return e=Zo(e),Cp(e)}var ju=null;function Cp(e){if(ju=null,e=Un(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(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 ju=e,null}function ib(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ze()){case Le:return 2;case At:return 8;case en:case Nl:return 32;case oc:return 268435456;default:return 32}default:return 32}}var Np=!1,ha=null,ma=null,ga=null,Ms=new Map,zs=new Map,ya=[],O1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ob(e,t){switch(e){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ma=null;break;case"mouseover":case"mouseout":ga=null;break;case"pointerover":case"pointerout":Ms.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function _s(e,t,n,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Gt(t),t!==null&&rb(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function D1(e,t,n,l,o){switch(t){case"focusin":return ha=_s(ha,e,t,n,l,o),!0;case"dragenter":return ma=_s(ma,e,t,n,l,o),!0;case"mouseover":return ga=_s(ga,e,t,n,l,o),!0;case"pointerover":var c=o.pointerId;return Ms.set(c,_s(Ms.get(c)||null,e,t,n,l,o)),!0;case"gotpointercapture":return c=o.pointerId,zs.set(c,_s(zs.get(c)||null,e,t,n,l,o)),!0}return!1}function sb(e){var t=Un(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,mr(e.priority,function(){ab(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,mr(e.priority,function(){ab(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 Mu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Qo=l,n.target.dispatchEvent(l),Qo=null}else return t=Gt(n),t!==null&&rb(t),e.blockedOn=n,!1;t.shift()}return!0}function cb(e,t,n){Mu(e)&&n.delete(t)}function R1(){Np=!1,ha!==null&&Mu(ha)&&(ha=null),ma!==null&&Mu(ma)&&(ma=null),ga!==null&&Mu(ga)&&(ga=null),Ms.forEach(cb),zs.forEach(cb)}function zu(e,t){e.blockedOn===t&&(e.blockedOn=null,Np||(Np=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,R1)))}var _u=null;function ub(e){_u!==e&&(_u=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){_u===e&&(_u=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(Cp(l||n)===null)continue;break}var c=Gt(n);c!==null&&(e.splice(t,3),t-=3,of(c,{pending:!0,data:o,method:n.method,action:l},l,o))}}))}function vo(e){function t(N){return zu(N,e)}ha!==null&&zu(ha,e),ma!==null&&zu(ma,e),ga!==null&&zu(ga,e),Ms.forEach(t),zs.forEach(t);for(var n=0;n<ya.length;n++){var l=ya[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ya.length&&(n=ya[0],n.blockedOn===null);)sb(n),n.blockedOn===null&&ya.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var o=n[l],c=n[l+1],f=o[tn]||null;if(typeof c=="function")f||ub(n);else if(f){var x=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[tn]||null)x=f.formAction;else if(Cp(o)!==null)continue}else x=f.action;typeof x=="function"?n[l+1]=x:(n.splice(l,3),l-=3),ub(n)}}}function db(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Ap(e){this._internalRoot=e}ku.prototype.render=Ap.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,l=il();nb(n,l,e,t,null,null)},ku.prototype.unmount=Ap.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nb(e.current,2,null,e,null,null),vu(),t[Nn]=null}};function ku(e){this._internalRoot=e}ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ya.length&&t!==0&&t<ya[n].priority;n++);ya.splice(n,0,e),n===0&&sb(e)}};var fb=a.version;if(fb!=="19.3.1")throw Error(s(527,fb,"19.3.1"));Ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=b(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var j1={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hu.isDisabled&&Hu.supportsFiber)try{Gl=Hu.inject(j1),zt=Hu}catch{}}return Hs.createRoot=function(e,t){if(!u(e))throw Error(s(299));var n=!1,l="",o=tg,c=ng,f=lg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=eb(e,1,!1,null,null,n,l,null,o,c,f,db),e[Nn]=t.current,lp(e),new Ap(t)},Hs.hydrateRoot=function(e,t,n){if(!u(e))throw Error(s(299));var l=!1,o="",c=tg,f=ng,x=lg,N=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=eb(e,1,!0,t,n??null,l,o,N,c,f,x,db),t.context=tb(null),n=t.current,l=il(),l=Kl(l),o=ta(l),o.callback=null,na(n,o,l),n=l,t.current.lanes=n,sl(t,n),or(t),e[Nn]=t.current,lp(e),new ku(t)},Hs.version="19.3.1",Hs}var wb;function G1(){if(wb)return Dp.exports;wb=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Dp.exports=q1(),Dp.exports}var Y1=G1(),w=uh(),_p=Ov();const V1=["[data-slide-id]",".slide",".page",".slide-page"],K1=1600,X1=900,Dv=String.raw`(?:\d+(?:\.\d+)?|\.\d+)`,$1=new RegExp(`^${Dv}(?:px)?$`,"i");function xo(r){return Number.isFinite(r)&&r>0}function Eb(r){const a=r==null?void 0:r.trim().match($1);return a?Number.parseFloat(a[0]):Number.NaN}function Tb(r,a){var d;const i=new RegExp(`(?:^|;)\\s*${a}\\s*:\\s*(${Dv})px`,"gi"),u=(d=Array.from(r.matchAll(i)).at(-1))==null?void 0:d[1];return u===void 0?Number.NaN:Number.parseFloat(u)}function Q1(r){const a=r.getAttribute("data-width"),i=r.getAttribute("data-height"),s=Eb(a),u=Eb(i),d=r.getAttribute("style")??"",h=Tb(d,"width"),m=Tb(d,"height");return{width:xo(s)?s:xo(h)?h:K1,height:xo(u)?u:xo(m)?m:X1,widthValid:a===null||xo(s),heightValid:i===null||xo(u)}}function kp(r,a){const i=r.getAttribute("data-slide-id"),s=i!==null&&i.trim()!=="";return{id:s?i.trim():`s${a+1}`,hasId:s,element:r,index:a,...Q1(r)}}function Ht(r){for(const s of V1){const u=Array.from(r.querySelectorAll(s));if(u.length>0)return u.map(kp)}const a=Array.from(r.querySelectorAll("section"));if(a.length>0){const s=new Map;for(const d of a){const h=d.parentElement;if(!h)continue;const m=s.get(h)??[];m.push(d),s.set(h,m)}let u;for(const d of s.values())(!u||d.length>u.length)&&(u=d);if(u&&u.length>0)return u.map(kp)}const i=r.body;return i?[{...kp(i,0),id:"body"}]:[]}class ql extends Error{constructor(a,i,s){super(i),this.code=a,this.details=s,this.name="DeckMutationError"}}function va(r,a){throw new ql(r,a)}function Rv(r,a){if("elementId"in a){const s=a.elementId.trim(),u=Array.from(r.querySelectorAll("[data-ppt-el]")).filter(d=>{var h;return((h=d.getAttribute("data-ppt-el"))==null?void 0:h.trim())===s});return u.length===0&&va("target-not-found",`Element "${s}" was not found.`),u.length>1&&va("target-ambiguous",`Element "${s}" matches more than one node.`),u[0]}if("selector"in a){let s;try{s=Array.from(r.querySelectorAll(a.selector))}catch{va("target-invalid",`Selector "${a.selector}" is not valid.`)}return s.length===0&&va("target-not-found",`Selector "${a.selector}" matched nothing.`),s.length>1&&va("target-ambiguous",`Selector "${a.selector}" matched ${s.length} nodes.`),s[0]}a.path.length===0&&va("target-invalid","Target path must not be empty.");let i=r;for(const s of a.path){(!Number.isInteger(s)||s<0)&&va("target-invalid","Target path must contain non-negative integers.");const u=i.children[s];u||va("target-not-found","Target path does not resolve inside the slide."),i=u}return i}function Qn(r,a){const i=Ht(r),s=i.find(u=>u.id===a&&u.hasId)??(a==="body"?i.find(u=>u.element===r.body):void 0);if(!s)throw new ql("slide-not-found",`Slide "${a}" was not found.`);return s}const Z1=String.raw`
50
+ (() => {
51
+ var slides = Array.prototype.slice.call(document.querySelectorAll('[data-slide-id]'));
52
+ if (!slides.length) return;
53
+ var index = 0;
54
+ var runtimeStyle = 'data-ppt-runtime-style';
55
+ var originalDisplay = slides.map(function (slide) { return slide.style.display; });
56
+ var sizes = slides.map(function (slide) { return measureSlide(slide); });
57
+ var controls = null;
58
+ var pageIndicator = null;
59
+ var previousButton = null;
60
+ var nextButton = null;
61
+ var sessionId = createSessionId();
62
+ var presentation = null;
63
+
64
+ var RUNTIME_STRINGS = {
65
+ en: {
66
+ group: 'Slide navigation',
67
+ previous: 'Previous slide',
68
+ next: 'Next slide',
69
+ page: '{index} / {total}',
70
+ presenterTitle: 'Presenter view',
71
+ waiting: 'Waiting for the main window…',
72
+ notConnected: 'Not connected yet.',
73
+ notes: 'Notes',
74
+ noNotes: 'No notes for this slide.',
75
+ nextSlide: 'Next slide',
76
+ nextPreview: 'Next slide preview',
77
+ lastSlidePlaceholder: '(Last slide)',
78
+ connected: 'Connected',
79
+ disconnected: 'Disconnected',
80
+ fullscreenUnsupported: 'This browser does not support fullscreen. Press F11.',
81
+ fullscreenDenied: 'Fullscreen was blocked. Press F11.',
82
+ presenterBlocked: 'The browser blocked the presenter window. Allow popups and press P.',
83
+ presenterUnsupported: 'This browser does not support presenter view.'
84
+ },
85
+ 'zh-Hant': {
86
+ group: '投影片導覽',
87
+ previous: '上一頁',
88
+ next: '下一頁',
89
+ page: '第 {index} / {total} 頁',
90
+ presenterTitle: '簡報者檢視',
91
+ waiting: '等待主視窗…',
92
+ notConnected: '尚未連線。',
93
+ notes: '備註',
94
+ noNotes: '此頁沒有備註。',
95
+ nextSlide: '下一頁',
96
+ nextPreview: '下一頁預覽',
97
+ lastSlidePlaceholder: '(最後一頁)',
98
+ connected: '已連線',
99
+ disconnected: '已中斷',
100
+ fullscreenUnsupported: '此瀏覽器不支援全螢幕;請按 F11 手動全螢幕。',
101
+ fullscreenDenied: '瀏覽器未允許全螢幕;請按 F11 手動全螢幕。',
102
+ presenterBlocked: '瀏覽器封鎖了簡報視窗。請允許此網站開啟彈出視窗,再按 P 重試。',
103
+ presenterUnsupported: '此瀏覽器不支援簡報者檢視。'
104
+ },
105
+ 'zh-Hans': {
106
+ group: '幻灯片导航',
107
+ previous: '上一页',
108
+ next: '下一页',
109
+ page: '第 {index} / {total} 页',
110
+ presenterTitle: '演讲者视图',
111
+ waiting: '等待主窗口…',
112
+ notConnected: '尚未连接。',
113
+ notes: '备注',
114
+ noNotes: '此页没有备注。',
115
+ nextSlide: '下一页',
116
+ nextPreview: '下一页预览',
117
+ lastSlidePlaceholder: '(最后一页)',
118
+ connected: '已连接',
119
+ disconnected: '已断开',
120
+ fullscreenUnsupported: '此浏览器不支持全屏;请按 F11 手动全屏。',
121
+ fullscreenDenied: '浏览器未允许全屏;请按 F11 手动全屏。',
122
+ presenterBlocked: '浏览器阻止了演讲者窗口。请允许此网站打开弹出窗口,再按 P 重试。',
123
+ presenterUnsupported: '此浏览器不支持演讲者视图。'
124
+ }
125
+ };
126
+
127
+ function runtimeLocale() {
128
+ var override = document.documentElement.getAttribute('data-ppt-locale');
129
+ var value = String(override || navigator.language || 'en').toLowerCase();
130
+ var subtags = value.split('-');
131
+ if (subtags[0] !== 'zh') return 'en';
132
+ if (subtags.indexOf('hant') !== -1) return 'zh-Hant';
133
+ if (subtags.indexOf('hans') !== -1) return 'zh-Hans';
134
+ if (value === 'zh-tw' || value === 'zh-hk' || value === 'zh-mo') {
135
+ return 'zh-Hant';
136
+ }
137
+ return 'zh-Hans';
138
+ }
139
+
140
+ var strings = RUNTIME_STRINGS[runtimeLocale()];
141
+
142
+ function pageLabel(pageIndex, total) {
143
+ return strings.page
144
+ .replace('{index}', String(pageIndex))
145
+ .replace('{total}', String(total));
146
+ }
147
+
148
+ Array.prototype.forEach.call(document.querySelectorAll('[data-ppt-deck]'), function (deck) {
149
+ deck.setAttribute('data-ppt-ready', '1');
150
+ });
151
+
152
+ document.documentElement.setAttribute('data-ppt-runtime-fit', '1');
153
+
154
+ function measureSlide(slide) {
155
+ return {
156
+ width: dimensionOf(slide, 'data-width', 'width', 1600),
157
+ height: dimensionOf(slide, 'data-height', 'height', 900)
158
+ };
159
+ }
160
+
161
+ function dimensionOf(slide, attribute, property, fallback) {
162
+ var value = Number(slide.getAttribute(attribute));
163
+ if (!(value > 0)) value = parseFloat(window.getComputedStyle(slide)[property]);
164
+ if (!(value > 0)) value = property === 'width' ? slide.offsetWidth : slide.offsetHeight;
165
+ return value > 0 ? value : fallback;
166
+ }
167
+
168
+ function layoutActiveSlide() {
169
+ var slide = slides[index];
170
+ if (!slide) return;
171
+ var size = sizes[index];
172
+ var viewportWidth = window.innerWidth || document.documentElement.clientWidth || size.width;
173
+ var viewportHeight = window.innerHeight || document.documentElement.clientHeight || size.height;
174
+ var scale = Math.min(viewportWidth / size.width, viewportHeight / size.height);
175
+ if (!(scale > 0) || !isFinite(scale)) scale = 1;
176
+ slide.style.setProperty('--ppt-fit-scale', String(scale));
177
+ slide.style.setProperty('--ppt-fit-left', (viewportWidth - size.width * scale) / 2 + 'px');
178
+ slide.style.setProperty('--ppt-fit-top', (viewportHeight - size.height * scale) / 2 + 'px');
179
+ }
180
+
181
+ function buildControls() {
182
+ if (slides.length < 2) return;
183
+ controls = document.createElement('div');
184
+ controls.setAttribute('data-ppt-runtime-controls', '1');
185
+ controls.setAttribute('data-testid', 'runtime-controls');
186
+ controls.setAttribute('role', 'group');
187
+ controls.setAttribute('aria-label', strings.group);
188
+ previousButton = document.createElement('button');
189
+ previousButton.type = 'button';
190
+ previousButton.setAttribute('data-testid', 'runtime-prev');
191
+ previousButton.setAttribute('aria-label', strings.previous);
192
+ previousButton.textContent = strings.previous;
193
+ pageIndicator = document.createElement('span');
194
+ pageIndicator.setAttribute('data-testid', 'runtime-page');
195
+ pageIndicator.setAttribute('aria-live', 'polite');
196
+ nextButton = document.createElement('button');
197
+ nextButton.type = 'button';
198
+ nextButton.setAttribute('data-testid', 'runtime-next');
199
+ nextButton.setAttribute('aria-label', strings.next);
200
+ nextButton.textContent = strings.next;
201
+ previousButton.addEventListener('click', function () { show(index - 1, true); });
202
+ nextButton.addEventListener('click', function () { show(index + 1, true); });
203
+ controls.appendChild(previousButton);
204
+ controls.appendChild(pageIndicator);
205
+ controls.appendChild(nextButton);
206
+ document.body.appendChild(controls);
207
+ }
208
+
209
+ function renderControls() {
210
+ if (!controls) return;
211
+ pageIndicator.textContent = pageLabel(index + 1, slides.length);
212
+ previousButton.disabled = index <= 0;
213
+ nextButton.disabled = index >= slides.length - 1;
214
+ }
215
+
216
+ function createSessionId() {
217
+ if (window.crypto && window.crypto.randomUUID) return window.crypto.randomUUID();
218
+ var values = new Uint8Array(16);
219
+ if (window.crypto && window.crypto.getRandomValues) window.crypto.getRandomValues(values);
220
+ else for (var i = 0; i < 16; i += 1) values[i] = Math.floor(Math.random() * 256);
221
+ var text = '';
222
+ for (var j = 0; j < values.length; j += 1) text += ('0' + values[j].toString(16)).slice(-2);
223
+ return text;
224
+ }
225
+
226
+ function isEditing(target) {
227
+ var element = target;
228
+ while (element) {
229
+ var tag = element.tagName;
230
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || element.isContentEditable) return true;
231
+ if (element === document.body) return false;
232
+ element = element.parentElement;
233
+ }
234
+ return false;
235
+ }
236
+
237
+ function isInteractive(target) {
238
+ var element = target;
239
+ while (element && element !== document.body) {
240
+ var tag = element.tagName;
241
+ if (tag === 'A' || tag === 'a' || tag === 'BUTTON' || tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA' || tag === 'LABEL' || tag === 'SUMMARY' || tag === 'DETAILS') return true;
242
+ if ((tag === 'VIDEO' || tag === 'AUDIO') && element.hasAttribute('controls')) return true;
243
+ var role = element.getAttribute('role');
244
+ if (role === 'button' || role === 'link') return true;
245
+ if (element.isContentEditable) return true;
246
+ element = element.parentElement;
247
+ }
248
+ return false;
249
+ }
250
+
251
+ function isControl(target) {
252
+ var element = target;
253
+ while (element && element !== document.body) {
254
+ if (element.hasAttribute && element.hasAttribute('data-ppt-runtime-controls')) return true;
255
+ element = element.parentElement;
256
+ }
257
+ return false;
258
+ }
259
+
260
+ function transitionOf(slide) {
261
+ var value = slide.getAttribute('data-ppt-transition');
262
+ return value === 'fade' || value === 'slide' ? value : 'none';
263
+ }
264
+
265
+ function animateSlide(slide) {
266
+ if (!window.matchMedia || !window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
267
+ var kind = transitionOf(slide);
268
+ if (kind !== 'none') {
269
+ slide.classList.remove('htmlppt-runtime-fade', 'htmlppt-runtime-slide');
270
+ void slide.offsetWidth;
271
+ slide.classList.add('htmlppt-runtime-' + kind);
272
+ window.setTimeout(function () {
273
+ slide.classList.remove('htmlppt-runtime-' + kind);
274
+ }, 500);
275
+ }
276
+ }
277
+ }
278
+
279
+ function postState() {
280
+ if (!presentation) return;
281
+ presentation.channel.postMessage({
282
+ sessionId: presentation.sessionId,
283
+ type: 'state',
284
+ index: index,
285
+ total: slides.length
286
+ });
287
+ }
288
+
289
+ function show(next, animate) {
290
+ var clamped = Math.max(0, Math.min(slides.length - 1, next));
291
+ var changed = clamped !== index;
292
+ index = clamped;
293
+ slides.forEach(function (slide, i) {
294
+ slide.style.display = i === index ? originalDisplay[i] : 'none';
295
+ });
296
+ layoutActiveSlide();
297
+ renderControls();
298
+ if (changed && animate !== false) animateSlide(slides[index]);
299
+ history.replaceState(null, '', '#/' + (index + 1));
300
+ postState();
301
+ }
302
+
303
+ function notice(message) {
304
+ var previous = document.querySelector('[data-ppt-runtime-notice]');
305
+ if (previous) previous.remove();
306
+ var element = document.createElement('div');
307
+ element.setAttribute('data-ppt-runtime-notice', '1');
308
+ element.setAttribute('data-testid', 'runtime-notice');
309
+ element.setAttribute('role', 'status');
310
+ element.textContent = message;
311
+ element.style.cssText = 'position:fixed;left:16px;top:16px;z-index:2147483647;max-width:380px;padding:8px 12px;border:1px solid rgba(245,158,11,.5);background:rgba(69,26,3,.92);color:#fef3c7;font:12px/1.5 system-ui,sans-serif;border-radius:6px';
312
+ document.body.appendChild(element);
313
+ window.setTimeout(function () {
314
+ element.remove();
315
+ }, 4000);
316
+ }
317
+
318
+ function toggleFullscreen() {
319
+ if (document.fullscreenElement) {
320
+ var exit = document.exitFullscreen();
321
+ if (exit && exit.catch) exit.catch(function () {});
322
+ return;
323
+ }
324
+ var request = document.documentElement.requestFullscreen;
325
+ if (!request) {
326
+ notice(strings.fullscreenUnsupported);
327
+ return;
328
+ }
329
+ var result;
330
+ try {
331
+ result = request.call(document.documentElement);
332
+ } catch (error) {
333
+ notice(strings.fullscreenDenied);
334
+ return;
335
+ }
336
+ if (result && result.catch) {
337
+ result.catch(function () {
338
+ notice(strings.fullscreenDenied);
339
+ });
340
+ }
341
+ }
342
+
343
+ var PRESENTER_CSS = 'html,body{margin:0;background:#0b0d12;color:#e4e4e7;font:14px/1.5 system-ui,sans-serif}' +
344
+ 'body{padding:20px;display:flex;flex-direction:column;gap:16px;min-height:100vh;box-sizing:border-box}' +
345
+ 'header{display:flex;justify-content:space-between;align-items:flex-end;border-bottom:1px solid #27272a;padding-bottom:12px}' +
346
+ 'h1{font-size:14px;margin:0;letter-spacing:.05em}' +
347
+ 'h2{font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:#71717a;margin:0 0 6px}' +
348
+ '.presenter-meta{display:flex;gap:16px;font-size:12px;color:#a1a1aa;margin:4px 0 0}' +
349
+ '[data-testid="presenter-status"]{color:#fcd34d}' +
350
+ '[data-testid="presenter-notes"]{min-height:96px;white-space:pre-wrap;border:1px solid #27272a;background:#18181b;padding:12px;border-radius:6px;margin:0}' +
351
+ '[data-testid="presenter-next-preview"]{display:flex;gap:16px;align-items:center;border:1px solid #27272a;background:#18181b;padding:12px;border-radius:6px;min-height:204px;box-sizing:border-box}' +
352
+ '.preview-holder{width:320px;height:180px;overflow:hidden;border-radius:4px;background:#fff;flex:none}' +
353
+ '.preview-holder iframe{width:1600px;height:900px;border:0;transform:scale(.2);transform-origin:top left;pointer-events:none;background:#fff}' +
354
+ '.presenter-actions{display:flex;gap:8px}' +
355
+ '.presenter-actions button{border:1px solid #3f3f46;background:transparent;color:#e4e4e7;border-radius:4px;padding:6px 12px;font-size:12px;cursor:pointer}' +
356
+ '.presenter-actions button:disabled{opacity:.4;cursor:default}';
357
+
358
+ function element(doc, tag, attributes, text) {
359
+ var node = doc.createElement(tag);
360
+ if (attributes) {
361
+ Object.keys(attributes).forEach(function (name) {
362
+ node.setAttribute(name, attributes[name]);
363
+ });
364
+ }
365
+ if (text !== undefined) node.textContent = text;
366
+ return node;
367
+ }
368
+
369
+ function buildPresenterWindow(win) {
370
+ var doc = win.document;
371
+ doc.documentElement.lang = runtimeLocale();
372
+ doc.title = strings.presenterTitle;
373
+ while (doc.body.firstChild) doc.body.removeChild(doc.body.firstChild);
374
+ doc.body.setAttribute('data-ppt-strings', JSON.stringify(strings));
375
+ doc.head.appendChild(element(doc, 'style', null, PRESENTER_CSS));
376
+ var root = element(doc, 'div', { 'data-testid': 'presenter-view' });
377
+ var header = element(doc, 'header');
378
+ var titleBlock = element(doc, 'div');
379
+ titleBlock.appendChild(element(doc, 'h1', null, strings.presenterTitle));
380
+ var pageMeta = element(doc, 'p', { class: 'presenter-meta' });
381
+ pageMeta.appendChild(element(doc, 'span', { 'data-testid': 'presenter-page' }, pageLabel(0, 0)));
382
+ titleBlock.appendChild(pageMeta);
383
+ header.appendChild(titleBlock);
384
+ var meta = element(doc, 'div', { class: 'presenter-meta' });
385
+ meta.appendChild(element(doc, 'span', { 'data-testid': 'presenter-status' }, strings.waiting));
386
+ meta.appendChild(element(doc, 'span', { 'data-testid': 'presenter-timer' }, '00:00'));
387
+ header.appendChild(meta);
388
+
389
+ var notesSection = element(doc, 'section');
390
+ notesSection.appendChild(element(doc, 'h2', null, strings.notes));
391
+ notesSection.appendChild(element(doc, 'p', { 'data-testid': 'presenter-notes' }, strings.notConnected));
392
+
393
+ var nextSection = element(doc, 'section');
394
+ nextSection.appendChild(element(doc, 'h2', null, strings.nextSlide));
395
+ var nextPreview = element(doc, 'div', { 'data-testid': 'presenter-next-preview' });
396
+ nextPreview.appendChild(element(doc, 'span', null, strings.lastSlidePlaceholder));
397
+ nextSection.appendChild(nextPreview);
398
+
399
+ var actions = element(doc, 'div', { class: 'presenter-actions' });
400
+ var previous = element(doc, 'button', { type: 'button', 'data-testid': 'presenter-prev' }, strings.previous);
401
+ previous.disabled = true;
402
+ var next = element(doc, 'button', { type: 'button', 'data-testid': 'presenter-next' }, strings.next);
403
+ next.disabled = true;
404
+ actions.appendChild(previous);
405
+ actions.appendChild(next);
406
+
407
+ root.appendChild(header);
408
+ root.appendChild(notesSection);
409
+ root.appendChild(nextSection);
410
+ root.appendChild(actions);
411
+ doc.body.appendChild(root);
412
+ }
413
+
414
+ function PRESENTER_CLIENT() {
415
+ var strings = {};
416
+ try {
417
+ var parsed = JSON.parse(document.body.getAttribute('data-ppt-strings') || '{}');
418
+ if (parsed && typeof parsed === 'object') strings = parsed;
419
+ } catch (error) {
420
+ strings = {};
421
+ }
422
+ function label(key, fallback) {
423
+ return typeof strings[key] === 'string' && strings[key] ? strings[key] : fallback;
424
+ }
425
+ function pageText(pageIndex, total) {
426
+ var format = label('page', '');
427
+ if (!format) return String(pageIndex) + ' / ' + String(total);
428
+ return format
429
+ .replace('{index}', String(pageIndex))
430
+ .replace('{total}', String(total));
431
+ }
432
+ var session = document.body.getAttribute('data-session-id');
433
+ if (!session) return;
434
+ var status = document.querySelector('[data-testid="presenter-status"]');
435
+ var timer = document.querySelector('[data-testid="presenter-timer"]');
436
+ var page = document.querySelector('[data-testid="presenter-page"]');
437
+ var notes = document.querySelector('[data-testid="presenter-notes"]');
438
+ var preview = document.querySelector('[data-testid="presenter-next-preview"]');
439
+ var prevButton = document.querySelector('[data-testid="presenter-prev"]');
440
+ var nextButton = document.querySelector('[data-testid="presenter-next"]');
441
+ var slides = [];
442
+ var headHtml = '';
443
+ var bodyFallback = false;
444
+ var previewKey = '';
445
+ var index = 0;
446
+ var total = 0;
447
+ var lastState = 0;
448
+ var started = Date.now();
449
+ var channel = new BroadcastChannel('htmlppt-presenter-' + session);
450
+
451
+ function setStatus(text) {
452
+ if (status) status.textContent = text;
453
+ }
454
+ function request() {
455
+ channel.postMessage({ sessionId: session, type: 'request' });
456
+ }
457
+ function notesOf(slide) {
458
+ if (!slide) return '';
459
+ var aside = slide.querySelector('[data-ppt-notes]');
460
+ return aside ? (aside.textContent || '').trim() : '';
461
+ }
462
+ function titleOf(slide) {
463
+ if (!slide) return '';
464
+ var heading = slide.querySelector('h1, h2, h3, [data-ppt-title]');
465
+ return heading ? (heading.textContent || '').replace(/\s+/g, ' ').trim() : '';
466
+ }
467
+ function renderPreview() {
468
+ if (!preview) return;
469
+ var next = slides[index + 1];
470
+ var key = index + '|' + bodyFallback + '|' + headHtml + '|' + (next ? next.outerHTML : '');
471
+ if (key === previewKey) return;
472
+ previewKey = key;
473
+ while (preview.firstChild) preview.removeChild(preview.firstChild);
474
+ if (!next) {
475
+ preview.appendChild(document.createTextNode(label('lastSlidePlaceholder', '(Last slide)')));
476
+ return;
477
+ }
478
+ var holder = document.createElement('div');
479
+ holder.className = 'preview-holder';
480
+ var width = Number(next.getAttribute('data-width')) || 1600;
481
+ var height = Number(next.getAttribute('data-height')) || 900;
482
+ var scale = 320 / width;
483
+ holder.style.height = Math.round(height * scale) + 'px';
484
+ var frame = document.createElement('iframe');
485
+ frame.setAttribute('sandbox', '');
486
+ frame.setAttribute('title', label('nextPreview', 'Next slide preview'));
487
+ frame.style.width = width + 'px';
488
+ frame.style.height = height + 'px';
489
+ frame.style.transform = 'scale(' + scale + ')';
490
+ frame.srcdoc = bodyFallback
491
+ ? '<!doctype html><html><head>' + headHtml + '</head><body>' + next.innerHTML + '</body></html>'
492
+ : '<!doctype html><html><head>' + headHtml + '</head><body><main data-ppt-deck>' + next.outerHTML + '</main></body></html>';
493
+ holder.appendChild(frame);
494
+ var caption = document.createElement('span');
495
+ caption.textContent = (index + 2) + '. ' + titleOf(next);
496
+ preview.appendChild(holder);
497
+ preview.appendChild(caption);
498
+ }
499
+ function render() {
500
+ if (notes) notes.textContent = notesOf(slides[index]) || label('noNotes', 'No notes for this slide.');
501
+ if (page) page.textContent = pageText(total === 0 ? 0 : index + 1, total);
502
+ renderPreview();
503
+ if (prevButton) prevButton.disabled = index <= 0;
504
+ if (nextButton) nextButton.disabled = total === 0 || index >= total - 1;
505
+ }
506
+ channel.onmessage = function (event) {
507
+ var message = event.data;
508
+ if (!message || message.sessionId !== session) return;
509
+ if (message.type === 'snapshot') {
510
+ var parsed = new DOMParser().parseFromString(message.html, 'text/html');
511
+ var found = parsed.querySelectorAll('[data-slide-id]');
512
+ slides = Array.prototype.slice.call(found.length ? found : [parsed.body]);
513
+ bodyFallback = found.length === 0;
514
+ headHtml = parsed.head ? parsed.head.innerHTML : '';
515
+ index = message.index;
516
+ total = message.total;
517
+ lastState = Date.now();
518
+ setStatus(label('connected', 'Connected'));
519
+ render();
520
+ } else if (message.type === 'state') {
521
+ index = message.index;
522
+ total = message.total;
523
+ lastState = Date.now();
524
+ setStatus(label('connected', 'Connected'));
525
+ render();
526
+ } else if (message.type === 'bye') {
527
+ setStatus(label('disconnected', 'Disconnected'));
528
+ }
529
+ };
530
+ function sendSlide(next) {
531
+ if (next < 0 || next >= total) return;
532
+ channel.postMessage({ sessionId: session, type: 'slide', index: next });
533
+ }
534
+ if (prevButton) prevButton.onclick = function () { sendSlide(index - 1); };
535
+ if (nextButton) nextButton.onclick = function () { sendSlide(index + 1); };
536
+ var poll = window.setInterval(request, 2000);
537
+ var clock = window.setInterval(function () {
538
+ var elapsed = Math.floor((Date.now() - started) / 1000);
539
+ var minutes = Math.floor(elapsed / 60);
540
+ var seconds = elapsed % 60;
541
+ if (timer) timer.textContent = ('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2);
542
+ if (lastState !== 0 && Date.now() - lastState > 6000) setStatus(label('disconnected', 'Disconnected'));
543
+ }, 1000);
544
+ window.addEventListener('pagehide', function () {
545
+ try {
546
+ channel.postMessage({ sessionId: session, type: 'bye' });
547
+ } catch (error) {}
548
+ channel.close();
549
+ window.clearInterval(poll);
550
+ window.clearInterval(clock);
551
+ });
552
+ request();
553
+ }
554
+
555
+ function snapshotHtml() {
556
+ var clone = document.documentElement.cloneNode(true);
557
+ clone.removeAttribute('data-ppt-runtime-fit');
558
+ var copied = clone.querySelectorAll('[data-slide-id]');
559
+ for (var i = 0; i < copied.length && i < originalDisplay.length; i += 1) {
560
+ copied[i].style.display = originalDisplay[i];
561
+ }
562
+ return '<!doctype html>' + clone.outerHTML;
563
+ }
564
+
565
+ function sendSnapshot() {
566
+ if (!presentation) return;
567
+ presentation.channel.postMessage({
568
+ sessionId: presentation.sessionId,
569
+ type: 'snapshot',
570
+ html: snapshotHtml(),
571
+ index: index,
572
+ total: slides.length
573
+ });
574
+ }
575
+
576
+ function closePresenter(notify) {
577
+ if (!presentation) return;
578
+ var current = presentation;
579
+ presentation = null;
580
+ window.clearInterval(current.closedTimer);
581
+ try {
582
+ if (notify) current.channel.postMessage({ sessionId: current.sessionId, type: 'bye' });
583
+ } catch (error) {}
584
+ try {
585
+ current.channel.close();
586
+ } catch (error) {}
587
+ if (notify && current.win && !current.win.closed) {
588
+ try {
589
+ current.win.close();
590
+ } catch (error) {}
591
+ }
592
+ }
593
+
594
+ function openPresenter() {
595
+ if (presentation && presentation.win && !presentation.win.closed) {
596
+ presentation.win.focus();
597
+ return;
598
+ }
599
+ if (presentation) closePresenter(false);
600
+ var win = window.open('', 'htmlppt-presenter-' + sessionId, 'popup=yes,width=960,height=720');
601
+ if (!win) {
602
+ notice(strings.presenterBlocked);
603
+ return;
604
+ }
605
+ var channel;
606
+ try {
607
+ channel = new BroadcastChannel('htmlppt-presenter-' + sessionId);
608
+ } catch (error) {
609
+ win.close();
610
+ notice(strings.presenterUnsupported);
611
+ return;
612
+ }
613
+ presentation = { sessionId: sessionId, channel: channel, win: win, closedTimer: null };
614
+ buildPresenterWindow(win);
615
+ win.document.body.setAttribute('data-session-id', sessionId);
616
+ var client = win.document.createElement('script');
617
+ client.textContent = '(' + PRESENTER_CLIENT.toString() + ')();';
618
+ win.document.body.appendChild(client);
619
+ var sentSnapshot = false;
620
+ channel.onmessage = function (event) {
621
+ var message = event.data;
622
+ if (!message || message.sessionId !== sessionId) return;
623
+ if (message.type === 'request') {
624
+ if (!sentSnapshot) {
625
+ sentSnapshot = true;
626
+ sendSnapshot();
627
+ }
628
+ postState();
629
+ } else if (message.type === 'slide') {
630
+ var requested = message.index;
631
+ if (typeof requested === 'number' && Math.floor(requested) === requested && requested >= 0 && requested < slides.length) {
632
+ show(requested, true);
633
+ }
634
+ } else if (message.type === 'bye') {
635
+ closePresenter(true);
636
+ }
637
+ };
638
+ presentation.closedTimer = window.setInterval(function () {
639
+ if (win.closed) closePresenter(false);
640
+ }, 1000);
641
+ sentSnapshot = true;
642
+ sendSnapshot();
643
+ postState();
644
+ }
645
+
646
+ document.addEventListener('keydown', function (event) {
647
+ if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey || isEditing(event.target)) return;
648
+ if (event.key === ' ' && isInteractive(event.target)) return;
649
+ if (event.key === 'ArrowRight' || event.key === ' ' || event.key === 'PageDown') {
650
+ event.preventDefault();
651
+ show(index + 1, true);
652
+ } else if (event.key === 'ArrowLeft' || event.key === 'PageUp') {
653
+ event.preventDefault();
654
+ show(index - 1, true);
655
+ } else if (event.key === 'Home') {
656
+ event.preventDefault();
657
+ show(0, true);
658
+ } else if (event.key === 'End') {
659
+ event.preventDefault();
660
+ show(slides.length - 1, true);
661
+ } else if (event.key === 'f' || event.key === 'F') {
662
+ event.preventDefault();
663
+ toggleFullscreen();
664
+ } else if (event.key === 'p' || event.key === 'P') {
665
+ event.preventDefault();
666
+ openPresenter();
667
+ } else if (event.key === 'Escape' && document.fullscreenElement) {
668
+ var exit = document.exitFullscreen();
669
+ if (exit && exit.catch) exit.catch(function () {});
670
+ }
671
+ });
672
+
673
+ document.addEventListener('click', function (event) {
674
+ if (event.defaultPrevented || isInteractive(event.target) || isControl(event.target)) return;
675
+ show(index + 1, true);
676
+ });
677
+
678
+ window.addEventListener('resize', layoutActiveSlide);
679
+
680
+ window.addEventListener('hashchange', function () {
681
+ var match = /#\/(\d+)/.exec(location.hash);
682
+ if (match) show(Number(match[1]) - 1, true);
683
+ });
684
+
685
+ if (!document.querySelector('[' + runtimeStyle + ']')) {
686
+ var style = document.createElement('style');
687
+ style.setAttribute(runtimeStyle, '1');
688
+ style.textContent = '@media print{[data-slide-id]{break-after:page;page-break-after:always}}' +
689
+ '[data-ppt-notes]{display:none!important}' +
690
+ '@media screen{' +
691
+ 'html[data-ppt-runtime-fit="1"],html[data-ppt-runtime-fit="1"] body{overflow:hidden}' +
692
+ 'html[data-ppt-runtime-fit="1"] [data-slide-id]{position:fixed!important;left:var(--ppt-fit-left,0);top:var(--ppt-fit-top,0);margin:0!important;transform:scale(var(--ppt-fit-scale,1));transform-origin:top left}' +
693
+ '}' +
694
+ '[data-ppt-runtime-controls]{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:2147483646;display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.22);background:rgba(12,14,20,.72);color:#f4f4f5;font:13px/1.2 system-ui,sans-serif;backdrop-filter:blur(8px)}' +
695
+ '[data-ppt-runtime-controls] button{border:1px solid rgba(255,255,255,.28);background:transparent;color:inherit;font:inherit;padding:5px 12px;border-radius:999px;cursor:pointer}' +
696
+ '[data-ppt-runtime-controls] button:hover:not(:disabled){border-color:rgba(255,255,255,.6);background:rgba(255,255,255,.1)}' +
697
+ '[data-ppt-runtime-controls] button:disabled{opacity:.35;cursor:default}' +
698
+ '[data-ppt-runtime-controls] [data-testid="runtime-page"]{min-width:48px;text-align:center;font-variant-numeric:tabular-nums;color:rgba(244,244,245,.85)}' +
699
+ '@media print{[data-ppt-runtime-controls]{display:none!important}}' +
700
+ '@keyframes htmlppt-runtime-fade{from{opacity:0}to{opacity:1}}' +
701
+ '@keyframes htmlppt-runtime-slide{from{opacity:.4;translate:6% 0}to{opacity:1;translate:0 0}}' +
702
+ '.htmlppt-runtime-fade{animation:htmlppt-runtime-fade 450ms ease-out}' +
703
+ '.htmlppt-runtime-slide{animation:htmlppt-runtime-slide 450ms ease-out}' +
704
+ '@media (prefers-reduced-motion: reduce){.htmlppt-runtime-fade,.htmlppt-runtime-slide{animation:none}}';
705
+ document.head.appendChild(style);
706
+ }
707
+
708
+ var printState = null;
709
+ window.addEventListener('beforeprint', function () {
710
+ if (printState) return;
711
+ printState = slides.map(function (slide) { return slide.style.display; });
712
+ slides.forEach(function (slide, i) { slide.style.display = originalDisplay[i]; });
713
+ });
714
+ window.addEventListener('afterprint', function () {
715
+ printState = null;
716
+ show(index, false);
717
+ });
718
+
719
+ window.addEventListener('pagehide', function () {
720
+ closePresenter(true);
721
+ });
722
+
723
+ buildControls();
724
+
725
+ var initial = /#\/(\d+)/.exec(location.hash);
726
+ show(initial ? Number(initial[1]) - 1 : 0, false);
727
+ })();
728
+ `,jv="<!doctype html>",F1="<!-- Edited with htmlcraft. Format: htmldeck/v1. -->";function vn(r){return`${jv}
729
+ ${r.documentElement.outerHTML}`}function J1(r){return r.querySelectorAll("[data-slide-id]").length>1&&r.querySelector('[data-ppt-runtime="1"]')===null&&r.querySelector("script")===null}function P1(r){const a=r.cloneNode(!0),i=a.createElement("script");return i.setAttribute("data-ppt-runtime","1"),i.textContent=Z1,a.body.appendChild(i),a}function W1(r){const a=J1(r)?P1(r):r;return`${jv}
730
+ ${F1}
731
+ ${a.documentElement.outerHTML}`}function Cb(r,a){let i=1;for(;a.has(`${r}${i}`);)i+=1;return`${r}${i}`}const nc={slideId:r=>Cb("s",r),elementId:r=>Cb("e",r)},eS=new Set(["SCRIPT","STYLE","TEMPLATE","LINK","META"]),tS=["data-ppt-editing","data-ppt-frame-slide"],nS=/(?:^|;)\s*position\s*:/i;function lS(r){return!eS.has(r.tagName.toUpperCase())&&!r.hasAttribute("data-ppt-notes")}function rS(r){return Array.from(r.children).filter(lS)}function Hp(r){var i;const a=(i=r.getAttribute("data-ppt-el"))==null?void 0:i.trim();return a||null}function aS(r){const a=r.getAttribute("style");if(a&&nS.test(a))return!1;const i=(a==null?void 0:a.trim())??"";return r.setAttribute("style",i?`${i.replace(/;?$/,";")} position: relative;`:"position: relative;"),!0}function Lp(r,a={}){var m,y;const i=a.ids??nc,s=Ht(r),u=new Set(s.map(b=>{var E;return(E=b.element.getAttribute("data-slide-id"))==null?void 0:E.trim()}).filter(b=>!!b));let d=!1;const h=[];for(const b of s){if(b.element!==r.body&&!b.hasId){const B=i.slideId(u);b.element.setAttribute("data-slide-id",B),u.add(B),d=!0}const E=rS(b.element),v=new Set,C=Hp(b.element);C&&v.add(C);for(const B of Array.from(b.element.querySelectorAll("[data-ppt-el]"))){const D=Hp(B);D&&v.add(D)}const A=[];for(const B of E){let D=Hp(B);D||(D=i.elementId(v,b.index),B.setAttribute("data-ppt-el",D),v.add(D),d=!0),A.push(D)}b.element!==r.body&&((m=a.isStaticPosition)!=null&&m.call(a,b.element))&&(d=aS(b.element)||d),h.push({id:b.element===r.body?"body":((y=b.element.getAttribute("data-slide-id"))==null?void 0:y.trim())??"",elementIds:A})}for(const b of tS)for(const E of Array.from(r.querySelectorAll(`[${b}]`)))E.removeAttribute(b),d=!0;return{changed:d,slides:h}}const iS=/^-?[a-zA-Z][a-zA-Z0-9-]*$/,oS=/^--[a-zA-Z0-9_-]+$/,sS=new Set(["none","fade","slide"]),Mv=new Set(["SCRIPT","STYLE","TEMPLATE","LINK","META"]);function Tl(r,a){throw new ql(r,a)}function cS(r){return iS.test(r)||oS.test(r)}function ui(r,a){return r.appendChild(a),Mv.has(a.tagName)||zv(r,a),a}function zv(r,a){var u,d,h;if((u=a.getAttribute("data-ppt-el"))!=null&&u.trim())return;const i=new Set,s=(d=r.getAttribute("data-ppt-el"))==null?void 0:d.trim();s&&i.add(s);for(const m of Array.from(r.querySelectorAll("[data-ppt-el]"))){const y=(h=m.getAttribute("data-ppt-el"))==null?void 0:h.trim();y&&i.add(y)}a.setAttribute("data-ppt-el",nc.elementId(i,0))}function uS(r,a){var u;const i=Object.entries(a);for(const[d]of i)cS(d)||Tl("invalid-style-property",`"${d}" is not a valid CSS property name.`);const s=r;for(const[d,h]of i)h===null||h===""?s.style.removeProperty(d):s.style.setProperty(d,h);((u=s.getAttribute("style"))==null?void 0:u.trim())===""&&s.removeAttribute("style")}function lc(r){const a=Ht(r);return(a.length===0||a.length===1&&a[0].element===r.body)&&Tl("slide-operations-unavailable","Slide operations are unavailable on the body fallback."),a}function _v(r){var i;const a=new Set;for(const s of r){a.add(s.id);const u=(i=s.element.getAttribute("data-slide-id"))==null?void 0:i.trim();u&&a.add(u)}return a}function dS(r,a,i){const s=i.createElement("aside");s.setAttribute("data-ppt-notes",""),s.setAttribute("hidden",""),s.textContent=a,r.appendChild(s)}function kv(r,a,i){const s=Array.from(r.children).filter(h=>h.hasAttribute("data-ppt-notes")),[u,...d]=s;for(const h of d)h.remove();if(!a){u==null||u.remove();return}if(u){u.textContent=a;return}dS(r,a,i)}function fS(r,a={}){const i=lc(r),u=(a.ids??nc).slideId(_v(i)),d=a.afterSlideId?i.find(b=>b.id===a.afterSlideId):i[i.length-1];d||Tl("slide-not-found",`Slide "${a.afterSlideId}" was not found.`);const h=d.element,m=r.createElement(h.tagName.toLowerCase());h.hasAttribute("class")&&m.setAttribute("class",h.getAttribute("class")??""),m.setAttribute("data-slide-id",u),m.setAttribute("data-width",String(a.width??d.width)),m.setAttribute("data-height",String(a.height??d.height)),a.transition&&m.setAttribute("data-ppt-transition",a.transition),m.innerHTML=a.html??"<h1>New slide</h1>";for(const b of Array.from(m.children))!b.hasAttribute("data-ppt-notes")&&!Mv.has(b.tagName)&&zv(m,b);a.notes!==void 0&&a.notes!==""&&kv(m,a.notes,r);const y=h.parentElement;return y||Tl("slide-operations-unavailable","Slides must have a parent element."),y.insertBefore(m,h.nextElementSibling),u}function pS(r,a){const i=lc(r),s=i.find(m=>m.id===a);s||Tl("slide-not-found",`Slide "${a}" was not found.`);const u=nc.slideId(_v(i)),d=s.element.cloneNode(!0);d.setAttribute("data-slide-id",u);const h=s.element.parentElement;return h||Tl("slide-operations-unavailable","Slides must have a parent element."),h.insertBefore(d,s.element.nextElementSibling),u}function hS(r,a){var u;const i=lc(r);i.length===1&&Tl("last-slide","The last slide cannot be deleted.");const s=i.find(d=>d.id===a);s||Tl("slide-not-found",`Slide "${a}" was not found.`),(u=s.element.parentElement)==null||u.removeChild(s.element)}function mS(r,a){const i=lc(r),s=i[i.length-1].element,u=s.parentElement;u||Tl("slide-operations-unavailable","Slides must have a parent element.");const d=s.nextElementSibling;for(const h of a)u.insertBefore(h,d)}function gS(r,a){const i=lc(r),s=i.map(d=>d.id);(a.length!==s.length||new Set(a).size!==s.length||a.some(d=>!s.includes(d)))&&Tl("invalid-order","The new order must list every slide id exactly once.");const u=[];for(const d of a){const h=i.find(m=>m.id===d);h||Tl("invalid-order","The new order must list every slide id exactly once."),u.push(h.element)}mS(r,u)}function yS(r,a,i){const s=Qn(r,a);kv(s.element,i,r)}function bS(r,a,i){sS.has(i)||Tl("invalid-transition",`Transition "${i}" is not one of none, fade, slide.`),Qn(r,a).element.setAttribute("data-ppt-transition",i)}const vS=new Set(["SCRIPT","STYLE","TEMPLATE","LINK","META"]),dh="[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)",xS=new RegExp(`^(${dh})(?:px)?$`,"i"),SS=new RegExp(`^(${dh})deg$`,"i"),wS=new RegExp(`^(${dh})%$`),Ls="data-ppt-display";function kt(r,a){throw new ql(r,a)}function Lr(r){return!vS.has(r.tagName.toUpperCase())&&!r.hasAttribute("data-ppt-notes")}function rc(r,a){const i=Rv(r,a);return(i.parentElement!==r||!Lr(i))&&kt("target-invalid","Object operations require a direct, non-notes object child of the slide."),i}function fh(r,a,i){a.length<i&&kt("invalid-selection",`Select at least ${i} distinct objects.`);const s=a.map(u=>rc(r,u));return new Set(s).size!==s.length&&kt("invalid-selection","Select each object only once."),s}function ko(r){const a=xS.exec(r.trim());if(!a||!/px$/i.test(r.trim())&&Number(a[1])!==0)return;const i=Number(a[1]);return Number.isFinite(i)?i:void 0}const ES=1e7;function dn(r){return(!Number.isFinite(r)||Math.abs(r)>ES)&&kt("invalid-geometry","Coordinates are outside the supported precision range."),Math.round(r*1e10)/1e10}function Hv(r){return Number.isFinite(r)||kt("unsupported-transform","Rotation must be a finite number of degrees."),Math.round((r%360+360)%360*1e10)/1e10}function TS(r){const a=[];let i=0,s="",u=0;for(let d=0;d<r.length;d+=1){const h=r[d];if(s){h==="\\"?d+=1:h===s&&(s="");continue}h==='"'||h==="'"?s=h:h==="("?u+=1:h===")"?u=Math.max(0,u-1):h===";"&&u===0&&(a.push(r.slice(i,d)),i=d+1)}return a.push(r.slice(i)),a}function di(r){const a=new Map,i=r.getAttribute("style")??"";for(const s of TS(i)){let u="",d=0,h=-1;for(let C=0;C<s.length;C+=1){const A=s[C];if(u){A==="\\"?C+=1:A===u&&(u="");continue}if(A==='"'||A==="'")u=A;else if(A==="(")d+=1;else if(A===")")d=Math.max(0,d-1);else if(A===":"&&d===0){h=C;break}}if(h<0)continue;const m=s.slice(0,h).trim().toLowerCase();if(!/^-?[a-z][a-z0-9-]*$/.test(m))continue;let y=s.slice(h+1).trim(),b=!1;const E=/!\s*important\s*$/i.exec(y);if(E&&(b=!0,y=y.slice(0,E.index).trim()),!y)continue;const v=a.get(m);v!=null&&v.important&&!b||a.set(m,{value:y,important:b})}return a}const CS={a:1,b:0,c:0,d:1,e:0,f:0,ox:0,oy:0,angle:0};function Up(r,a){return{a:r.a*a.a+r.c*a.b,b:r.b*a.a+r.d*a.b,c:r.a*a.c+r.c*a.d,d:r.b*a.c+r.d*a.d,e:r.a*a.e+r.c*a.f+r.e,f:r.b*a.e+r.d*a.f+r.f}}function NS(r,a,i){const s=a-r.ox,u=i-r.oy;return{x:r.ox+r.a*s+r.c*u+r.e,y:r.oy+r.b*s+r.d*u+r.f}}function Ao(r,a,i,s,u){const d=NS(r,s,u);return{x:a+d.x,y:i+d.y}}function AS(r,a){const i=[Ao(a,r.x,r.y,0,0),Ao(a,r.x,r.y,r.width,0),Ao(a,r.x,r.y,0,r.height),Ao(a,r.x,r.y,r.width,r.height)];return{left:dn(Math.min(...i.map(s=>s.x))),top:dn(Math.min(...i.map(s=>s.y))),right:dn(Math.max(...i.map(s=>s.x))),bottom:dn(Math.max(...i.map(s=>s.y))),center:Ao(a,r.x,r.y,r.width/2,r.height/2)}}function OS(r,a,i){const s=()=>kt("unsupported-transform","Use a center, pixel or percentage transform-origin.");if(!r)return{ox:a/2,oy:i/2};const u=r.trim().split(/\s+/);u.length>3&&s();const d=(y,b)=>{const E=y.toLowerCase();if(E==="center")return .5;if(b&&E==="left")return 0;if(b&&E==="right")return 1;if(!b&&E==="top")return 0;if(!b&&E==="bottom")return 1;const v=wS.exec(E);if(v)return Number(v[1])/100;const C=ko(E);return C===void 0?void 0:b?C/a:C/i};if(u.length===1){const y=d(u[0],!0);if(y!==void 0)return{ox:y*a,oy:i/2};const b=d(u[0],!1);return b===void 0&&s(),{ox:a/2,oy:b*i}}const h=d(u[0],!0),m=d(u[1],!1);return(h===void 0||m===void 0)&&s(),u[2]&&ko(u[2])!==0&&s(),{ox:h*a,oy:m*i}}function Lv(r,a,i){var A,B,D,G;const s=()=>kt("unsupported-transform","Use 2D translate/rotate or an equivalent rigid matrix; flatten scale, skew and 3D transforms first."),u=di(r);for(const ae of["translate","rotate","scale","perspective","offset-path"]){const se=(A=u.get(ae))==null?void 0:A.value;se&&se!=="none"&&s()}const d=OS((B=u.get("transform-origin"))==null?void 0:B.value,a,i),h=((G=(D=u.get("transform"))==null?void 0:D.value)==null?void 0:G.trim())??"none";if(h==="none")return{...CS,...d};let m={a:1,b:0,c:0,d:1,e:0,f:0},y=h;for(;y;){const ae=/^(translateX|translateY|translate|rotate|matrix)\(([^()]*)\)\s*/i.exec(y);if(!ae)return s();const se=ae[1].toLowerCase(),Y=ae[2].trim().split(/\s*,\s*|\s+/);if(se==="rotate"){const R=SS.exec(Y[0]??""),re=R?Number(R[1]):Number.NaN;(Y.length!==1||!Number.isFinite(re))&&s();const ve=re*Math.PI/180;m=Up(m,{a:Math.cos(ve),b:Math.sin(ve),c:-Math.sin(ve),d:Math.cos(ve),e:0,f:0})}else if(se==="matrix"){Y.length!==6&&s();const R=Y.map(re=>Number(re));R.some(re=>!Number.isFinite(re))&&s(),m=Up(m,{a:R[0],b:R[1],c:R[2],d:R[3],e:R[4],f:R[5]})}else{const R=Y.map(ko);(R.some(Z=>Z===void 0)||Y.length>(se==="translate"?2:1))&&s();const re=se==="translatey"?0:R[0],ve=se==="translatex"?0:se==="translatey"?R[0]:R[1]??0;m=Up(m,{a:1,b:0,c:0,d:1,e:re,f:ve})}y=y.slice(ae[0].length)}const b=m.a*m.a+m.b*m.b,E=m.c*m.c+m.d*m.d,v=m.a*m.d-m.b*m.c,C=m.a*m.c+m.b*m.d;return(Math.abs(b-1)>1e-6||Math.abs(E-1)>1e-6||Math.abs(v-1)>1e-6||Math.abs(C)>1e-6)&&s(),{...m,...d,angle:Hv(Math.atan2(m.b,m.a)*180/Math.PI)}}function Lu(r,a){if(!r)return;const i=r.trim().toLowerCase();if(["auto","none","0","0px","initial","unset","revert"].includes(i))return;const s=ko(i);return s===void 0&&kt("invalid-geometry",`Use a pixel ${a} or remove it before changing object geometry.`),s}function Fs(r){const a=di(r),i=D=>{var G;return(G=a.get(D))==null?void 0:G.value},s=()=>kt("invalid-geometry","Pin objects to absolute left/top/width/height pixel boxes, without margins or opposing insets; use border-box for padding/borders."),u=["left","top","width","height"].map(D=>ko(i(D)??""));if(i("position")!=="absolute"||u.some(D=>D===void 0))return s();const[d,h,m,y]=u;if(m<0||y<0)return s();for(const D of["right","bottom"]){const G=i(D);G&&G!=="auto"&&s()}for(const D of["margin","margin-left","margin-top","margin-right","margin-bottom"]){const G=i(D);G&&!G.split(/\s+/).every(ae=>ko(ae)===0)&&s()}if(i("box-sizing")!=="border-box")for(const[D,G]of a)/^(padding|border)(-|$)/.test(D)&&!["0","0px","none"].includes(G.value)&&s();const b=Lu(i("min-width"),"min-width"),E=Lu(i("max-width"),"max-width"),v=Lu(i("min-height"),"min-height"),C=Lu(i("max-height"),"max-height");(b!==void 0&&m<b||E!==void 0&&m>E||v!==void 0&&y<v||C!==void 0&&y>C)&&kt("invalid-geometry","Min/max constraints change the pinned box; flatten or remove them before changing object geometry.");const A=Lv(r,m,y),B=AS({x:d,y:h,width:m,height:y},A);return{element:r,x:d,y:h,width:m,height:y,angle:A.angle,...B}}function Uv(r){return{left:Math.min(...r.map(a=>a.left)),top:Math.min(...r.map(a=>a.top)),right:Math.max(...r.map(a=>a.right)),bottom:Math.max(...r.map(a=>a.bottom))}}function ph(r,a,i,s){r.style.setProperty(a,i,s?"important":"");const u=typeof r.style.getPropertyPriority=="function"?r.style.getPropertyPriority(a)==="important":!1;if(s&&!u){r.style.removeProperty(a);const d=r.style.cssText.trim();r.setAttribute("style",`${d}${d&&!d.endsWith(";")?";":""}${a}:${i} !important`)}}function Js(r,a,i){var u;const s=((u=di(r).get(a))==null?void 0:u.important)??!1;ph(r,a,i,s)}function Ps(r,a,i){const s=dn(a),u=dn(i);Js(r,"left",`${s}px`),Js(r,"top",`${u}px`)}function Oa(r,a=r.parentElement){var ae;const i=di(r),s=se=>{var Y;return(Y=i.get(se))==null?void 0:Y.value},u=(ae=s("z-index"))==null?void 0:ae.trim();u&&u!=="auto"&&(!/^[+-]?\d+$/.test(u)||!Number.isSafeInteger(Number(u)))&&kt("unsupported-stacking","Use an inline safe integer z-index (or auto) before changing object order.");const d=s("position"),h=s("display")??"",m=a?ci(a,"display")??"":"",y=!!(d&&d!=="static"),b=y||["flex","inline-flex","grid","inline-grid"].includes(m),E=b&&u&&u!=="auto"?Number(u):0,v=["transform","translate","rotate","scale","perspective","filter","backdrop-filter"].some(se=>{const Y=s(se);return Y&&Y!=="none"}),C=s("opacity"),A=!!(b&&u&&u!=="auto"||v||["fixed","sticky"].includes(d??"")||C&&Number(C)<1||s("isolation")==="isolate"||s("mix-blend-mode")&&s("mix-blend-mode")!=="normal"||/\b(layout|paint|strict|content)\b/.test(s("contain")??"")||/\b(transform|opacity|filter|perspective)\b/.test(s("will-change")??"")),B=/^(inline|inline-block|inline-flex|inline-grid)$/.test(h)||!h&&["SPAN","B","I","EM","STRONG","IMG","A"].includes(r.tagName.toUpperCase()),D=s("float");return{phase:E<0?0:E>0?5:y||A?4:D&&D!=="none"?2:B?3:1,z:E,context:A,positioned:y,indexed:b}}function ci(r,a){var i;return(i=di(r).get(a))==null?void 0:i.value}function Ur(r,a){return r.layer.phase-a.layer.phase||r.layer.z-a.layer.z||r.tree-a.tree}function zo(r,a=Array.from(r.children).filter(Lr)){const i=[];let s=0;const u=(d,h,m)=>{const y=Oa(d,m?r:d.parentElement);if((m||y.positioned||y.context)&&i.push({element:d,owner:h,layer:y,tree:s++}),!y.context)for(const b of Array.from(d.children))Lr(b)&&u(b,h,!1)};for(const d of a)u(d,d,!0);return i}function Xs(r,a=Array.from(r.children).filter(Lr)){return a.map((i,s)=>({element:i,owner:i,layer:Oa(i,r),tree:s})).sort(Ur).map(({element:i})=>i)}function DS(){return kt("unsupported-stacking","An escaping descendant layer would cross unrelated content. Flatten its stacking into an explicit object context, or separate it into a top-level object, before grouping or reordering.")}function Wu(r,a){for(const i of r){if(i.element===i.owner||!a.has(i.owner))continue;const s=r.find(u=>u.element===i.owner);for(const u of r){if(i.owner===u.owner)continue;const d=a.get(i.owner)||i,h=a.get(u.owner)||u;if(d===h)continue;const m=Math.sign(Ur(i,u));m!==Math.sign(Ur(s,u))&&m!==Math.sign(Ur(d,h))&&DS()}}}function hh(r,a){return{...r,layer:{...r.layer,z:a,phase:a<0?0:a>0?5:4,context:!0}}}function RS(r){const a=s=>["transform","translate","rotate","scale","perspective","filter","backdrop-filter"].some(u=>{const d=ci(s,u);return d&&d!=="none"})||/\b(layout|paint|strict|content)\b/.test(ci(s,"contain")??"")||/\b(transform|perspective|filter)\b/.test(ci(s,"will-change")??""),i=s=>{if(!a(s))for(const u of Array.from(s.children).filter(Lr))ci(u,"position")==="absolute"&&kt("unsupported-stacking","Positioning this static object would change a descendant containing block. Pin or flatten that descendant into the object before reordering."),Oa(u).positioned||i(u)};Oa(r).positioned||i(r)}function Bv(r,a){if(!Oa(r).indexed){Js(r,"position","relative");for(const i of["inset","inset-inline","inset-block","inset-inline-start","inset-inline-end","inset-block-start","inset-block-end","left","top","right","bottom"])r.style.removeProperty(i)}Js(r,"z-index",String(a))}function Iv(r,a,i){const s=a.flatMap((b,E)=>Oa(b,r).indexed||b===i?[]:[E]),u=s[0]??-1,d=s[s.length-1]??-1;s.length&&d-u+1!==s.length&&kt("unsupported-stacking","Pin the intervening static objects to absolute boxes before inserting a layer between them; their flow layout must not move.");const h=new Map;a.forEach((b,E)=>{!Oa(b,r).indexed&&b!==i||h.set(b,u<0?E:E<u?E-u:E-d)});const m=zo(r,Array.from(r.children).filter(Lr)),y=new Map(m.filter(b=>h.has(b.element)).map(b=>[b.element,hh(b,h.get(b.element))]));return Wu(m,y),h}function qv(r){for(const[a,i]of r)Bv(a,i)}function jS(r,a,i){const s=Qn(r,a).element,u=fh(s,i.map(R=>({elementId:R})),2);u.some(R=>R.hasAttribute("data-ppt-group")||R.querySelector("[data-ppt-group]"))&&kt("target-invalid","Select top-level non-group objects; nested groups are not supported.");const d=u.map(Fs),m=Xs(s).filter(R=>u.includes(R)),y=m[m.length-1],b=zo(s),E=b.find(R=>R.element===y);Wu(b,new Map(m.map(R=>[R,E])));const v=new Set([s,...Array.from(s.querySelectorAll("[data-ppt-el]"))].map(R=>{var re;return((re=R.getAttribute("data-ppt-el"))==null?void 0:re.trim())||""}).filter(Boolean)),C=nc.elementId(v,0),A=r.createElement("div"),B=Uv(d),D=dn(B.left),G=dn(B.top),ae=dn(B.right-B.left),se=dn(B.bottom-B.top),Y=d.map(R=>({element:R.element,x:dn(R.x-B.left),y:dn(R.y-B.top)}));A.setAttribute("data-ppt-group",""),A.setAttribute("data-ppt-el",C),A.style.position="absolute",Ps(A,D,G),A.style.width=`${ae}px`,A.style.height=`${se}px`,A.style.zIndex=String(E.layer.z),s.insertBefore(A,y);for(const R of m)A.appendChild(R);for(const R of Y)Ps(R.element,R.x,R.y);return C}function MS(r){var s;const a=new Set(["position","left","top","right","bottom","width","height","transform","transform-origin","translate","rotate","scale","perspective","offset-path","z-index","box-sizing"]),i={display:["block"],opacity:["1"],overflow:["visible"],background:["transparent","none"],"background-color":["transparent"],filter:["none"],"backdrop-filter":["none"],"will-change":["auto"],isolation:["auto"],"mix-blend-mode":["normal"],contain:["none"],"clip-path":["none"],mask:["none"],"pointer-events":["auto","inherit"]};for(const[u,d]of di(r))a.has(u)||d.value==="inherit"||/^(padding|border|margin)(-|$)/.test(u)&&["0","0px","none"].includes(d.value)||(s=i[u])!=null&&s.includes(d.value)||kt("unsupported-group-style",`Remove or flatten the group's "${u}" style before ungrouping; removing this wrapper would change its children's appearance.`)}function zS(r,a,i){const s=Qn(r,a).element,u=rc(s,i);u.hasAttribute("data-ppt-group")||kt("target-invalid","Select a top-level group to ungroup."),Array.from(u.childNodes).some(R=>{var re;return R.nodeType===3&&((re=R.textContent)==null?void 0:re.trim())})&&kt("target-invalid","Wrap loose group text in an object before ungrouping."),MS(u);const d=Array.from(u.children);(d.length<2||d.some(R=>!Lr(R)||R.hasAttribute("data-ppt-group")||R.querySelector("[data-ppt-group]")))&&kt("target-invalid","Groups must contain at least two non-group object children and no notes or scripts.");const h=d.map(R=>{var ve;const re=(ve=R.getAttribute("data-ppt-el"))==null?void 0:ve.trim();return re||kt("target-invalid","Every grouped child must have a stable data-ppt-el ID."),Rv(s,{elementId:re}),re}),m=Fs(u),y=Lv(u,m.width,m.height),b=d.map(R=>Fs(R));let E=Xs(s);const v=Xs(u),C=ci(u,"z-index"),A=ci(u,"transform");if(C&&C!=="auto"||A&&A!=="none")E.splice(E.indexOf(u),1,...v);else{const R=Array.from(s.children).flatMap(re=>re===u?d:[re]).filter(Lr);E=Xs(s,R)}const B=b.map(R=>{const re=Ao(y,m.x,m.y,R.center.x,R.center.y);return{element:R.element,x:dn(re.x-R.width/2),y:dn(re.y-R.height/2),angle:Hv(y.angle+R.angle)}}),D=Array.from(s.children).flatMap(R=>R===u?d:[R]).filter(Lr),G=zo(s,D),ae=zo(s).sort(Ur).flatMap(R=>R.element!==u?[R.element]:Oa(u).context?zo(u).sort(Ur).map(re=>re.element):[]),se=[...G].sort(Ur).map(R=>R.element),Y=ae.length===se.length&&ae.every((R,re)=>R===se[re])?new Map:Iv(s,E);Wu(G,new Map(G.filter(R=>Y.has(R.element)).map(R=>[R.element,hh(R,Y.get(R.element))])));for(const R of B){Ps(R.element,R.x,R.y);for(const re of["transform-origin","translate","rotate","scale","perspective","offset-path"])R.element.style.removeProperty(re);R.angle?Js(R.element,"transform",`rotate(${R.angle}deg)`):R.element.style.removeProperty("transform")}for(const R of Array.from(u.childNodes))s.insertBefore(R,u);return u.remove(),qv(Y),h}function _S(r,a,i,s){const u=rc(Qn(r,a).element,i);s?u.setAttribute("data-ppt-locked","true"):u.removeAttribute("data-ppt-locked")}function kS(r,a){var s;if(a!==null&&!a.trim()&&(a=null),a===null){r.style.removeProperty("display"),(s=r.getAttribute("style"))!=null&&s.trim()||r.removeAttribute("style");return}const i=/^([a-z-]+(?:\s+[a-z-]+)*)(\s*!important)?$/i.exec(a.trim());i||kt("invalid-display","Saved display metadata is invalid; remove the data-ppt-display attribute before unhiding."),r.style.removeProperty("display"),ph(r,"display",i[1],!!i[2])}function HS(r,a,i,s){const u=rc(Qn(r,a).element,i);if(s){if(!u.hasAttribute(Ls)){const d=di(u).get("display");u.setAttribute(Ls,d?`${d.value}${d.important?" !important":""}`:"")}ph(u,"display","none",!0)}else if(u.hasAttribute(Ls)){const d=u.getAttribute(Ls);kS(u,d),u.removeAttribute(Ls)}}function ed(r,a,i,s){const u=Qn(r,a).element,d=rc(u,i),h=Xs(u),m=zo(u),y=m.find(A=>A.element===d),b=h.indexOf(d),E=s==="front"?h.length-1:s==="back"?0:s==="forward"?Math.min(b+1,h.length-1):Math.max(b-1,0),v=s==="front"||s==="forward";if(E===b){const A=[...m].sort(Ur);if((v?A.slice(-A.filter(D=>D.owner===d).length):A.slice(0,A.filter(D=>D.owner===d).length)).every(D=>D.owner===d))return}h.splice(b,1),h.splice(E,0,d),y.layer.indexed||RS(d);const C=new Set(m.flatMap(({layer:A})=>[A.z,A.z+1,A.z-1]));for(const A of C){if(!Number.isSafeInteger(A)||Math.abs(A)>2147483647)continue;const B=hh(y,A);if(m.filter(D=>D.owner!==d).every(D=>Math.sign(Ur(B,D))===Math.sign(E-h.indexOf(D.owner)))){Wu(m,new Map([[d,B]])),Bv(d,A);return}}qv(Iv(u,h,d))}function LS(r,a,i){ed(r,a,i,"front")}function US(r,a,i){ed(r,a,i,"back")}function BS(r,a,i){ed(r,a,i,"forward")}function IS(r,a,i){ed(r,a,i,"backward")}function qS(r,a,i,s){const u=Qn(r,a).element;["left","center","right","top","middle","bottom"].includes(s)||kt("invalid-alignment","Choose left, center, right, top, middle or bottom alignment.");const d=fh(u,i,2).map(Fs),h=Uv(d),m=d.map(y=>{let b=0,E=0;return s==="left"&&(b=h.left-y.left),s==="center"&&(b=(h.left+h.right-y.left-y.right)/2),s==="right"&&(b=h.right-y.right),s==="top"&&(E=h.top-y.top),s==="middle"&&(E=(h.top+h.bottom-y.top-y.bottom)/2),s==="bottom"&&(E=h.bottom-y.bottom),{element:y.element,x:dn(y.x+b),y:dn(y.y+E)}});for(const y of m)Ps(y.element,y.x,y.y)}function GS(r,a,i,s){const u=Qn(r,a).element;["horizontal","vertical"].includes(s)||kt("invalid-distribution","Choose horizontal or vertical distribution.");const d=fh(u,i,3).map(Fs),h=s==="horizontal",m=h?"left":"top",y=h?"right":"bottom",b=Array.from(u.children);d.sort((B,D)=>B[m]-D[m]||b.indexOf(B.element)-b.indexOf(D.element));const E=d.reduce((B,D)=>B+D[y]-D[m],0),v=(d[d.length-1][y]-d[0][m]-E)/(d.length-1),C=[];let A=d[0][y]+v;for(const B of d.slice(1,-1)){const D=A-B[m];C.push({element:B.element,x:dn(B.x+(h?D:0)),y:dn(B.y+(h?0:D))}),A+=B[y]-B[m]+v}for(const B of C)Ps(B.element,B.x,B.y)}const YS=new Set(["http:","https:","mailto:"]),VS=/^-?[a-z][a-z0-9-]*$/i;function mh(r){const a=r.startContainer.ownerDocument;if(!a)throw new Error("The range is not attached to a document.");return a}function Gv(r){return r.nodeType===1?r:r.parentElement}function Yv(r,a){const i=a.ownerDocument,s=i==null?void 0:i.getSelection();if(!s)return;const u=i.createRange();u.selectNodeContents(a),s.removeAllRanges(),s.addRange(u),r.setStart(u.startContainer,u.startOffset),r.setEnd(u.endContainer,u.endOffset)}function td(r){const a=r.parentNode;if(!a)return;const i=r.ownerDocument.createDocumentFragment();for(;r.firstChild;)i.appendChild(r.firstChild);a.replaceChild(i,r)}function KS(r,a){const s=mh(r).createElement("span");for(const[u,d]of Object.entries(a))VS.test(u)&&s.style.setProperty(u,d);return r.collapsed||s.appendChild(r.extractContents()),r.insertNode(s),Yv(r,s),s}function XS(r){r.removeAttribute("style");const a=r.tagName.toLowerCase();(a==="span"||a==="font"||a==="b"||a==="i"||a==="u"||a==="s"||a==="strike"||a==="strong"||a==="em"||a==="mark")&&td(r)}function $S(r){var y;const a=mh(r);if(r.collapsed){(y=Gv(r.startContainer))==null||y.removeAttribute("style");return}const i=r.extractContents();for(const b of Array.from(i.querySelectorAll("*")))XS(b);const s=a.createElement("span");s.appendChild(i),r.insertNode(s);const u=s.firstChild,d=s.lastChild;if(td(s),!u||!d)return;const h=a.getSelection();if(!h)return;const m=a.createRange();m.setStartBefore(u),m.setEndAfter(d),h.removeAllRanges(),h.addRange(m),r.setStart(m.startContainer,m.startOffset),r.setEnd(m.endContainer,m.endOffset)}function QS(r,a,i){const s=a.closest("li"),u=s==null?void 0:s.parentElement;if(s&&u&&/^(ul|ol)$/i.test(u.tagName)){if(u.tagName.toLowerCase()===i)return ZS(r,s,u);const m=r.createElement(i);for(;u.firstChild;)m.appendChild(u.firstChild);return u.replaceWith(m),s}const d=r.createElement(i),h=r.createElement("li");for(Vv(a,h);a.firstChild;)h.appendChild(a.firstChild);return d.appendChild(h),a.replaceWith(d),h}function Vv(r,a){for(const i of Array.from(r.attributes)){const{name:s,value:u}=i;(s==="style"||s==="class"||s.startsWith("data-ppt-")&&s!=="data-ppt-editing")&&a.setAttribute(s,u)}}function ZS(r,a,i){const s=i.parentElement;if(!s)throw new Error("The list is not attached to the document.");const u=Array.from(i.children),d=u.indexOf(a),h=u.slice(0,d),m=u.slice(d+1),y=r.createElement("p");for(Vv(a,y);a.firstChild;)y.appendChild(a.firstChild);let b=null;if(h.length>0){b=i.cloneNode(!1);for(const v of h)b.appendChild(v)}let E=null;if(m.length>0){E=i.cloneNode(!1);for(const v of m)E.appendChild(v)}return s.replaceChild(y,i),b&&s.insertBefore(b,y),E&&s.insertBefore(E,y.nextSibling),y}function FS(r,a){const i=a.trim().toLowerCase();if(i!=="left"&&i!=="center"&&i!=="right"&&i!=="justify"){r.style.removeProperty("text-align");return}r.style.textAlign=i}function JS(r){const a=r.trim();if(a==="")return"";if(a.startsWith("#"))return a;let i;try{i=new URL(a)}catch{throw new Error("Enter an absolute URL such as https://example.com, a mailto: address, or a #fragment.")}if(!YS.has(i.protocol))throw new Error("Links must use http:, https:, mailto:, or a #fragment.");return a}function PS(r){var a;return((a=Gv(r))==null?void 0:a.closest("a"))??null}function Nb(r){for(const a of Array.from(r.querySelectorAll("a")))td(a)}function WS(r,a){const i=mh(r),s=JS(a),u=PS(r.startContainer),d=u&&u.contains(r.endContainer)?u:null;if(s===""){if(d)return td(d),null;if(r.collapsed)return null;const y=r.extractContents();return Nb(y),r.insertNode(y),null}if(d)return d.setAttribute("href",s),d;if(r.collapsed)throw new Error("Select text to add a link.");const h=r.extractContents();Nb(h);const m=i.createElement("a");return m.setAttribute("href",s),m.appendChild(h),r.insertNode(m),Yv(r,m),m}function ew(r){const a=r.replace(/\r\n?/g,`
732
+ `).replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<[^>]*>/g,"");return Array.from(a,i=>{const s=i.charCodeAt(0);return s<=8||s===11||s===12||s>=14&&s<=31?"":i}).join("")}const gh=8*1024*1024,tw=new Set(["image/png","image/jpeg","image/gif","image/webp","image/avif","image/svg+xml"]),nw={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",svg:"image/svg+xml"},$s="PNG, JPEG, GIF, WebP, AVIF, or SVG";function $n(r){throw new ql("invalid-image",r)}function yh(r){return r>=1024*1024?`${(r/(1024*1024)).toFixed(1)} MB`:r>=1024?`${Math.round(r/1024)} KB`:`${r} B`}function bh(r){return tw.has(r.trim().toLowerCase())}function Kv(r){var i,s;const a=(s=(i=/\.([a-z0-9]+)$/i.exec(r))==null?void 0:i[1])==null?void 0:s.toLowerCase();return a?nw[a]??null:null}function lw(r,a){if(!a)return r.length;const i=r.replace(/\s/g,""),s=i.endsWith("==")?2:i.endsWith("=")?1:0;return Math.max(0,Math.floor(i.length*3/4)-s)}function vh(r){const a=r.trim();if(a||$n(`Choose an image file or URL. Supported types: ${$s}.`),/^data:/i.test(a)){const s=a.indexOf(",");s===-1&&$n("The image data URL is malformed.");const d=a.slice(5,s).split(";").map(E=>E.trim()),h=(d[0]??"").toLowerCase(),m=d.some(E=>E.toLowerCase()==="base64");bh(h)||$n(`Unsupported image type "${h||"unknown"}". Use ${$s}.`);const y=a.slice(s+1);y||$n("The image data URL is empty.");const b=lw(y,m);return b===0&&$n("The image data URL is empty."),b>gh&&$n(`The image is ${yh(b)}; the limit is 8 MB. Resize or compress it before inserting.`),a}let i;try{i=new URL(a)}catch{$n(`Image sources must be a data URL, an absolute http(s) URL, or a supported local file (${$s}).`)}return i.protocol!=="http:"&&i.protocol!=="https:"&&$n("Image URLs must use http: or https:."),a}function rw(r,a){const i=a.trim().toLowerCase();bh(i)||$n(`Unsupported image type "${a}". Use ${$s}.`),r.byteLength===0&&$n("The image file is empty."),r.byteLength>gh&&$n(`The image is ${yh(r.byteLength)}; the limit is 8 MB. Resize or compress it before inserting.`);let s="";for(let u=0;u<r.length;u+=32768)s+=String.fromCharCode(...r.subarray(u,u+32768));return`data:${i};base64,${btoa(s)}`}async function Xv(r){const a=r.type.trim().toLowerCase(),i=bh(a)?a:Kv(r.name);i||$n(`Unsupported image type "${r.type||r.name}". Use ${$s}.`),r.size===0&&$n(`The image file "${r.name}" is empty.`),r.size>gh&&$n(`The image "${r.name}" is ${yh(r.size)}; the limit is 8 MB. Resize or compress it before inserting.`);const s=await new Promise((u,d)=>{const h=new FileReader;h.onload=()=>u(h.result instanceof ArrayBuffer?h.result:new ArrayBuffer(0)),h.onerror=()=>d(new ql("invalid-image",`Could not read "${r.name}". Re-select the file and try again.`)),h.readAsArrayBuffer(r)});return rw(new Uint8Array(s),i)}const Ku="data-ppt-crop",aw="http://www.w3.org/2000/svg",Ab=1e3;function Bl(r){throw new ql("invalid-appearance",r)}function _o(r){throw new ql("invalid-image",r)}function xh(r){return r.tagName.toLowerCase()==="svg"}function $v(r){return Array.from(r.querySelectorAll("line, polygon, polyline, path, rect, circle, ellipse"))}function Uu(r,a){const i=r.trim();return i||Bl(`${a} must not be empty.`),/url\s*\(/i.test(i)&&Bl(`${a} must be a color, not a URL reference.`),i}function iw(r,a){if(xh(r)){const s=$v(r);if(s.length===0&&Bl("The SVG shape has no paintable geometry."),"fill"in a&&a.fill!==void 0){const u=a.fill===null||a.fill===""?null:Uu(a.fill,"Fill");for(const d of s)d.tagName.toLowerCase()!=="line"&&(u===null?d.removeAttribute("fill"):d.setAttribute("fill",u))}if("stroke"in a&&a.stroke!==void 0){const u=a.stroke===null||a.stroke===""?null:Uu(a.stroke,"Stroke");for(const d of s)u===null?d.removeAttribute("stroke"):d.setAttribute("stroke",u)}if("strokeWidth"in a){const u=a.strokeWidth;if(u!=null){(!Number.isFinite(u)||u<0)&&Bl("Stroke width must be a non-negative number.");for(const d of s)u===0?d.removeAttribute("stroke-width"):d.setAttribute("stroke-width",String(u))}}"radius"in a&&a.radius!==null&&Bl("SVG shapes do not support a corner radius."),"opacity"in a&&Ob(r,a.opacity);return}const i=r;if(i.style||Bl("This element cannot carry shape styles."),"fill"in a&&a.fill!==void 0&&(a.fill===null||a.fill===""?(i.style.removeProperty("background"),i.style.removeProperty("background-color")):i.style.backgroundColor=Uu(a.fill,"Fill")),"stroke"in a||"strokeWidth"in a){const s=parseFloat(i.style.borderTopWidth||"0"),u=a.strokeWidth===null||a.strokeWidth===void 0?s:a.strokeWidth;(!Number.isFinite(u)||u<0)&&Bl("Stroke width must be a non-negative number.");const d=a.stroke===void 0?i.style.borderTopColor:a.stroke===null||a.stroke===""?"":Uu(a.stroke,"Stroke");if(u>0&&d)i.style.borderStyle="solid",i.style.borderWidth=`${u}px`,i.style.borderColor=d;else for(const h of["border","border-width","border-style","border-color"])i.style.removeProperty(h)}if("radius"in a&&a.radius!==void 0){const s=a.radius;s===null?i.style.removeProperty("border-radius"):((!Number.isFinite(s)||s<0)&&Bl("Corner radius must be a non-negative number."),i.style.borderRadius=`${s}px`)}"opacity"in a&&Ob(i,a.opacity)}function Ob(r,a){const i=r;if(a==null){i.style.removeProperty("opacity");return}(!Number.isFinite(a)||a<0||a>1)&&Bl("Opacity must be between 0 and 1."),i.style.opacity=String(a)}function ow(r){if(xh(r)){const s=$v(r),u=s.find(d=>d.tagName.toLowerCase()!=="line")??s[0];return{fill:(u==null?void 0:u.getAttribute("fill"))??"",stroke:(u==null?void 0:u.getAttribute("stroke"))??"",strokeWidth:(u==null?void 0:u.getAttribute("stroke-width"))??"",radius:"",opacity:r.style.opacity}}const a=r,i=parseFloat(a.style.borderTopWidth||"0");return{fill:a.style.background||a.style.backgroundColor||"",stroke:i>0?a.style.borderTopColor:"",strokeWidth:i>0?a.style.borderTopWidth:"",radius:a.style.borderRadius??"",opacity:a.style.opacity}}function $p(r,a){if(xh(r)){let s=r.querySelector("text");if(!a.trim()){s==null||s.remove();return}s||(s=r.ownerDocument.createElementNS(aw,"text"),s.setAttribute("x","50%"),s.setAttribute("y","50%"),s.setAttribute("text-anchor","middle"),s.setAttribute("dominant-baseline","central"),s.setAttribute("font-size","16"),s.setAttribute("fill","#ffffff"),r.appendChild(s)),s.textContent=a;return}r.tagName.toLowerCase()==="img"&&Bl("Images do not contain shape text.");const i=r;"textContent"in i||Bl("This element cannot carry shape text."),i.textContent=a}function Db(r,a){r.tagName.toLowerCase()!=="img"&&_o("Only image objects can be replaced.");const i=vh(a);r.setAttribute("src",i)}function sw(r,a){r.tagName.toLowerCase()!=="img"&&_o("Only image objects have alt text.");const i=a.replace(/[\r\n]+/g," ").trim();i.length>Ab&&_o(`Alt text must be at most ${Ab} characters.`),r.setAttribute("alt",i)}function cw(r,a){r.tagName.toLowerCase()!=="img"&&_o("Only image objects can be cropped.");const i=r;if(a===null){r.removeAttribute(Ku),i.style.removeProperty("clip-path");return}const s=[a.top,a.right,a.bottom,a.left];s.some(b=>!Number.isFinite(b)||b<0||b>90)&&_o("Crop insets must be between 0 and 90 percent."),(a.top+a.bottom>=100||a.left+a.right>=100)&&_o("Crop leaves no visible image; reduce the insets.");const u=s.map(b=>Math.round(b*100)/100);if(u.every(b=>b===0)){r.removeAttribute(Ku),i.style.removeProperty("clip-path");return}const[d,h,m,y]=u;r.setAttribute(Ku,`${d} ${h} ${m} ${y}`),i.style.clipPath=`inset(${d}% ${h}% ${m}% ${y}%)`}function uw(r){const a=r.getAttribute(Ku);if(!a)return null;const i=a.split(/\s+/).map(m=>Number(m));if(i.length!==4||i.some(m=>!Number.isFinite(m)||m<0||m>90))return null;const[s,u,d,h]=i;return s+d>=100||h+u>=100?null:{top:s,right:u,bottom:d,left:h}}const Vs="http://www.w3.org/2000/svg";function Qp(r){throw new ql("invalid-insert",r)}function Sh(r){for(const[a,i]of Object.entries({x:r.x,y:r.y,width:r.width,height:r.height}))Number.isFinite(i)||Qp(`Insertion ${a} must be a finite number.`);(r.width<=0||r.height<=0)&&Qp("Insertion width and height must be positive.")}function Qs(r,a){r.style.position="absolute",r.style.left=`${a.x}px`,r.style.top=`${a.y}px`,r.style.width=`${a.width}px`,r.style.height=`${a.height}px`,r.style.margin="0"}function dw(r,a){Sh(a);const i=r.ownerDocument.createElement("div");return Qs(i,a),i.style.padding="8px",i.style.boxSizing="border-box",i.style.overflow="hidden",i.textContent=a.text,ui(r,i)}function fw(r,a){var d,h;Sh(a);const i=r.ownerDocument,s=a.fill??"#4f7cff";if(a.shape==="line"||a.shape==="arrow"){const m=i.createElementNS(Vs,"svg");Qs(m,a),m.setAttribute("viewBox",`0 0 ${a.width} ${a.height}`),m.setAttribute("preserveAspectRatio","none"),m.setAttribute("aria-hidden","true");const y=a.stroke??s,b=a.strokeWidth??Math.min(8,a.height);if(a.shape==="line")m.appendChild(Rb(i,0,a.height/2,a.width,a.height/2,y,b));else{const E=Math.max(6,Math.min(a.width*.3,a.height*.8,48)),v=Math.max(4,Math.min(a.height/2,a.width/4,20));a.width>E&&m.appendChild(Rb(i,0,a.height/2,a.width-E,a.height/2,y,b));const C=i.createElementNS(Vs,"polygon");C.setAttribute("points",`${a.width},${a.height/2} ${a.width-E},${a.height/2-v} ${a.width-E},${a.height/2+v}`),C.setAttribute("fill",y),m.appendChild(C)}return(d=a.text)!=null&&d.trim()&&$p(m,a.text),ui(r,m)}if(a.shape==="triangle"){const m=i.createElementNS(Vs,"svg");Qs(m,a),m.setAttribute("viewBox",`0 0 ${a.width} ${a.height}`),m.setAttribute("preserveAspectRatio","none"),m.setAttribute("aria-hidden","true");const y=i.createElementNS(Vs,"polygon");return y.setAttribute("points",`${a.width/2},0 ${a.width},${a.height} 0,${a.height}`),y.setAttribute("fill",s),a.stroke&&(y.setAttribute("stroke",a.stroke),y.setAttribute("stroke-width",String(a.strokeWidth??2))),m.appendChild(y),(h=a.text)!=null&&h.trim()&&$p(m,a.text),ui(r,m)}a.shape!=="rect"&&a.shape!=="rounded-rect"&&a.shape!=="ellipse"&&Qp(`Unsupported shape "${String(a.shape)}".`);const u=i.createElement("div");return Qs(u,a),u.style.background=s,u.style.boxSizing="border-box",a.stroke&&(u.style.border=`${a.strokeWidth??2}px solid ${a.stroke}`),a.shape==="ellipse"?u.style.borderRadius="50%":a.shape==="rounded-rect"?u.style.borderRadius=`${a.radius??24}px`:a.radius!==void 0&&(u.style.borderRadius=`${a.radius}px`),a.text!==void 0&&(u.textContent=a.text),ui(r,u)}function Rb(r,a,i,s,u,d,h){const m=r.createElementNS(Vs,"line");return m.setAttribute("x1",String(a)),m.setAttribute("y1",String(i)),m.setAttribute("x2",String(s)),m.setAttribute("y2",String(u)),m.setAttribute("stroke",d),m.setAttribute("stroke-width",String(h)),m.setAttribute("vector-effect","non-scaling-stroke"),m}function pw(r,a){Sh(a);const i=r.ownerDocument.createElement("img");return Qs(i,a),i.style.objectFit="fill",i.setAttribute("src",vh(a.source)),i.setAttribute("alt",a.alt??""),ui(r,i)}const hw=50,mw=20,gw="8px 12px",yw="1px solid #b9b2a3";function Cl(r){throw new ql("invalid-table",r)}function jb(r,a,i){return(!Number.isInteger(r)||r<1)&&Cl(`${i} must be a positive integer.`),r>a&&Cl(`${i} must be at most ${a}.`),r}function Da(r){return r.tagName.toLowerCase()!=="table"&&Cl("The target is not a table."),r.querySelector("table")&&Cl("Nested tables are not supported."),r}function fi(r){const a=[];for(const i of Array.from(r.children)){const s=i.tagName.toLowerCase();if(s==="tr")a.push(i);else if(s==="thead"||s==="tbody"||s==="tfoot")for(const u of Array.from(i.children))u.tagName.toLowerCase()==="tr"&&a.push(u)}return a}function Na(r){return Array.from(r.children).filter(a=>{const i=a.tagName.toLowerCase();return i==="td"||i==="th"})}function wh(r){return fi(r).reduce((a,i)=>Math.max(a,Na(i).length),0)}function nd(r){for(const a of Array.from(r.querySelectorAll("td, th")))for(const i of["colspan","rowspan"]){const s=a.getAttribute(i);s!==null&&Number(s)>1&&Cl("Tables with merged cells do not support row or column changes.")}}function Qv(r,a){const i=fi(r);return(!Number.isInteger(a)||a<0||a>=i.length)&&Cl(`Row ${a} is outside this table (0-${i.length-1}).`),i}function Zv(r,a){const i=wh(r);return(!Number.isInteger(a)||a<0||a>=i)&&Cl(`Column ${a} is outside this table (0-${i-1}).`),i}function Fu(r,a){const i=r.createElement(a?"th":"td");return a&&i.setAttribute("scope","col"),i.setAttribute("style",`border: ${yw}; padding: ${gw};`),i}function bw(r,a){const i=jb(a.rows,hw,"Table rows"),s=jb(a.columns,mw,"Table columns");[a.x,a.y,a.width].filter(y=>y!==void 0).some(y=>!Number.isFinite(y))&&Cl("Table geometry must be finite."),a.width!==void 0&&a.width<=0&&Cl("Table width must be positive.");const d=r.ownerDocument,h=d.createElement("table");h.style.position="absolute",h.style.left=`${a.x??0}px`,h.style.top=`${a.y??0}px`,a.width!==void 0&&(h.style.width=`${a.width}px`),h.style.margin="0",h.style.borderCollapse="collapse";const m=d.createElement("tbody");for(let y=0;y<i;y+=1){const b=d.createElement("tr"),E=y===0;for(let v=0;v<s;v+=1)b.appendChild(Fu(d,E));m.appendChild(b)}return h.appendChild(m),ui(r,h)}function vw(r){return fi(Da(r)).length}function xw(r){return wh(Da(r))}function Sw(r,a,i){var v;const s=Da(r);nd(s);const u=Qv(s,a),d=i==="above"?a:a+1,h=wh(s),m=s.ownerDocument,y=m.createElement("tr");if(d===0&&Fv(s)){const C=s.tBodies[0]??s.appendChild(m.createElement("tbody")),A=u[0];for(const D of Na(A))Zp(m,D,!1);C.insertBefore(A,C.firstChild);const B=s.tHead??(()=>{const D=m.createElement("thead");return s.insertBefore(D,C),D})();for(let D=0;D<h;D+=1)y.appendChild(Fu(m,!0));B.appendChild(y);return}for(let C=0;C<h;C+=1)y.appendChild(Fu(m,!1));const b=u[d];if(b){(v=b.parentElement)==null||v.insertBefore(y,b);return}(s.tBodies[0]??s.appendChild(m.createElement("tbody"))).appendChild(y)}function ww(r,a){var u;const i=Da(r);nd(i);const s=Qv(i,a);s.length===1&&Cl("A table must keep at least one row."),(u=s[a])==null||u.remove()}function Ew(r,a,i){var h;const s=Da(r);nd(s),Zv(s,a);const u=i==="left"?a:a+1,d=fi(s);for(const m of d){const y=Na(m),b=((h=y[0])==null?void 0:h.tagName.toLowerCase())==="th",E=Fu(s.ownerDocument,b),v=y[u];v?m.insertBefore(E,v):m.appendChild(E)}}function Tw(r,a){var u;const i=Da(r);nd(i),Zv(i,a)===1&&Cl("A table must keep at least one column.");for(const d of fi(i))(u=Na(d)[a])==null||u.remove()}function Zp(r,a,i){const s=i?"th":"td";if(a.tagName.toLowerCase()===s)return a;const u=r.createElement(s);for(const d of Array.from(a.attributes))d.name!=="scope"&&u.setAttribute(d.name,d.value);for(i&&u.setAttribute("scope","col");a.firstChild;)u.appendChild(a.firstChild);return a.replaceWith(u),u}function Fv(r){const a=Da(r),i=fi(a)[0],s=i?Na(i)[0]:void 0;return(s==null?void 0:s.tagName.toLowerCase())==="th"}function Cw(r){var m,y;const a=Da(r),i=a.ownerDocument,s=fi(a);s.length===0&&Cl("The table has no rows.");const u=s[0];if(((m=Na(u)[0])==null?void 0:m.tagName.toLowerCase())==="th"){const b=a.tBodies[0]??(()=>{const v=i.createElement("tbody");return a.appendChild(v),v})(),E=a.tHead?Array.from(a.tHead.children).filter(v=>v.tagName.toLowerCase()==="tr"):[u];for(const v of E){for(const C of Na(v))Zp(i,C,!1);b.insertBefore(v,b.firstChild)}return(y=a.tHead)==null||y.remove(),!1}const h=a.tHead??i.createElement("thead");a.tHead||a.insertBefore(h,a.firstChild);for(const b of Na(u))Zp(i,b,!0);return h.appendChild(u),!0}const Jv="data-ppt-chart",Fp=["#4f7cff","#e8a33d","#22a06b","#d64545","#8b5cf6","#0891b2"],Mb=50,zb=20;function bt(r){throw new ql("invalid-chart",r)}function Il(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Nw(r,a){const i=r.trim();return i||bt(`${a} must not be empty.`),/url\s*\(/i.test(i)&&bt(`${a} must be a color, not a URL reference.`),!/^#[0-9a-f]{3,8}$/i.test(i)&&!/^(?:rgb|rgba|hsl|hsla)\([0-9.,%\s/+-]+\)$/i.test(i)&&!/^[a-z]{3,20}$/i.test(i)&&bt(`${a} must be a CSS color.`),i}function _b(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function kb(r,a){return(typeof r!="string"||!r.trim())&&bt(`${a} must be a non-empty string.`),r.trim()}function ld(r){var b;let a=r;if(typeof r=="string")try{a=JSON.parse(r)}catch(E){bt(`Chart data is not valid JSON: ${E instanceof Error?E.message:String(E)}`)}_b(a)||bt("Chart data must be a JSON object.");const i=a.type;i!=="bar"&&i!=="line"&&i!=="pie"&&bt('Chart type must be "bar", "line", or "pie".');const s=a.labels;(!Array.isArray(s)||s.length===0)&&bt("Chart labels must be a non-empty array."),s.length>Mb&&bt(`Chart labels must contain at most ${Mb} entries.`);const u=s.map((E,v)=>kb(E,`labels[${v}]`)),d=a.series;(!Array.isArray(d)||d.length===0)&&bt("Chart series must be a non-empty array."),d.length>zb&&bt(`Chart series must contain at most ${zb} entries.`);const h=d.map((E,v)=>{_b(E)||bt(`series[${v}] must be an object.`);const C=kb(E.name,`series[${v}].name`),A=E.values;Array.isArray(A)||bt(`series[${v}].values must be an array of numbers.`),A.length!==u.length&&bt(`series[${v}].values has ${A.length} numbers but labels has ${u.length}.`);const B=A.map((D,G)=>((typeof D!="number"||!Number.isFinite(D))&&bt(`series[${v}].values[${G}] must be a finite number.`),D));return{name:C,values:B}});if(i==="pie"){h.length!==1&&bt("Pie charts require exactly one series.");const E=((b=h[0])==null?void 0:b.values)??[];E.some(v=>v<0)&&bt("Pie chart values must not be negative."),E.every(v=>v===0)&&bt("Pie chart values must include at least one value above zero.")}a.title!==void 0&&typeof a.title!="string"&&bt("Chart title must be a string.");const m=typeof a.title=="string"?a.title.trim():"";m.length>200&&bt("Chart title must be at most 200 characters.");let y;if(a.colors!==void 0){(!Array.isArray(a.colors)||a.colors.length===0)&&bt("Chart colors must be a non-empty array of CSS colors."),y=a.colors.map((v,C)=>Nw(typeof v=="string"?v:"",`colors[${C}]`));const E=i==="pie"?u.length:h.length;y.length<E&&bt(`Chart colors must include at least ${E} entries.`)}return a.legend!==void 0&&typeof a.legend!="boolean"&&bt("Chart legend must be a boolean."),a.valueLabels!==void 0&&typeof a.valueLabels!="boolean"&&bt("Chart valueLabels must be a boolean."),{type:i,title:m,labels:u,series:h,colors:y??Array.from({length:i==="pie"?u.length:h.length},(E,v)=>Fp[v%Fp.length]),legend:a.legend===!0||a.legend===void 0&&h.length>1,valueLabels:a.valueLabels===!0}}function Eh(r){const a=r.getAttribute(Jv);return a||bt("The selected object is not a chart."),ld(a)}function Aw(r){return Math.round(r*100)/100}function ke(r){return String(Aw(r))}function Ow(r,a,i){(!Number.isFinite(a)||!Number.isFinite(i)||a<160||i<120)&&bt("Chart size must be at least 160x120 pixels.");const s=Math.round(a),u=Math.round(i),d=r.colors??Fp,h=r.title?34:0,m=r.legend?24:0,y=24,b=56,v={x:b,y:y+h+m,width:Math.max(10,s-b-y),height:Math.max(10,u-(y+h+m)-38)},C=[];if(C.push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${u}" width="${s}" height="${u}" role="img">`),C.push(`<title>${Il(r.title||"Chart")}</title>`),C.push(`<rect width="${s}" height="${u}" fill="#ffffff"/>`),r.title&&C.push(`<text x="${y}" y="${y+18}" font-family="Inter, sans-serif" font-size="16" font-weight="600" fill="#17181c">${Il(r.title)}</text>`),r.legend){const A=r.type==="pie"?r.labels.map((G,ae)=>({name:G,color:d[ae%d.length]})):r.series.map((G,ae)=>({name:G.name,color:d[ae%d.length]}));let B=y;const D=y+h+12;for(const G of A){C.push(`<rect x="${ke(B)}" y="${ke(D-9)}" width="10" height="10" rx="2" fill="${Il(G.color)}"/>`);const ae=Il(G.name);C.push(`<text x="${ke(B+15)}" y="${ke(D)}" font-family="Inter, sans-serif" font-size="11" fill="#4a4f59">${ae}</text>`),B+=15+G.name.length*6.4+18}}return r.type==="pie"?C.push(jw(r,d,v)):r.type==="bar"?C.push(...Dw(r,d,v)):C.push(...Rw(r,d,v)),C.push("</svg>"),C.join("")}function Pv(r){const a=r.series.flatMap(u=>u.values);let i=Math.min(0,...a),s=Math.max(0,...a);if(i===s)s=i+1;else{const u=(s-i)*.08;s+=u,i<0&&(i-=u)}return{min:i,max:s}}function Zs(r,a,i){return i.y+i.height-(r-a.min)/(a.max-a.min)*i.height}function Dw(r,a,i){const s=[],u=Pv(r);for(let y=0;y<=4;y+=1){const b=u.min+(u.max-u.min)*y/4,E=Zs(b,u,i);s.push(`<line x1="${ke(i.x)}" y1="${ke(E)}" x2="${ke(i.x+i.width)}" y2="${ke(E)}" stroke="#e5e7eb" stroke-width="1"/>`),s.push(`<text x="${ke(i.x-8)}" y="${ke(E+4)}" text-anchor="end" font-family="Inter, sans-serif" font-size="10" fill="#6b7280">${ke(b)}</text>`)}const d=i.width/r.labels.length,h=Math.max(2,d*.72/r.series.length),m=Zs(0,u,i);return r.series.forEach((y,b)=>{const E=a[b%a.length];y.values.forEach((v,C)=>{const A=Zs(v,u,i),B=i.x+C*d+d*.14+b*h,D=Math.min(A,m),G=Math.max(1,Math.abs(m-A));s.push(`<rect x="${ke(B)}" y="${ke(D)}" width="${ke(h-1)}" height="${ke(G)}" fill="${Il(E)}" rx="1"/>`),r.valueLabels&&s.push(`<text x="${ke(B+h/2)}" y="${ke(v>=0?D-4:D+G+12)}" text-anchor="middle" font-family="Inter, sans-serif" font-size="10" fill="#374151">${ke(v)}</text>`)})}),r.labels.forEach((y,b)=>{s.push(`<text x="${ke(i.x+b*d+d/2)}" y="${ke(i.y+i.height+18)}" text-anchor="middle" font-family="Inter, sans-serif" font-size="11" fill="#4a4f59">${Il(y)}</text>`)}),s}function Rw(r,a,i){const s=[],u=Pv(r);for(let h=0;h<=4;h+=1){const m=u.min+(u.max-u.min)*h/4,y=Zs(m,u,i);s.push(`<line x1="${ke(i.x)}" y1="${ke(y)}" x2="${ke(i.x+i.width)}" y2="${ke(y)}" stroke="#e5e7eb" stroke-width="1"/>`),s.push(`<text x="${ke(i.x-8)}" y="${ke(y+4)}" text-anchor="end" font-family="Inter, sans-serif" font-size="10" fill="#6b7280">${ke(m)}</text>`)}const d=r.labels.length>1?i.width/(r.labels.length-1):0;return r.series.forEach((h,m)=>{const y=a[m%a.length],b=h.values.map((E,v)=>{const C=i.x+(r.labels.length>1?v*d:i.width/2),A=Zs(E,u,i);return{x:C,y:A,value:E}});s.push(`<polyline fill="none" stroke="${Il(y)}" stroke-width="2.5" points="${b.map(E=>`${ke(E.x)},${ke(E.y)}`).join(" ")}"/>`);for(const E of b)s.push(`<circle cx="${ke(E.x)}" cy="${ke(E.y)}" r="3" fill="${Il(y)}"/>`),r.valueLabels&&s.push(`<text x="${ke(E.x)}" y="${ke(E.y-8)}" text-anchor="middle" font-family="Inter, sans-serif" font-size="10" fill="#374151">${ke(E.value)}</text>`)}),r.labels.forEach((h,m)=>{const y=i.x+(r.labels.length>1?m*d:i.width/2);s.push(`<text x="${ke(y)}" y="${ke(i.y+i.height+18)}" text-anchor="middle" font-family="Inter, sans-serif" font-size="11" fill="#4a4f59">${Il(h)}</text>`)}),s}function jw(r,a,i){var E;const s=[],u=((E=r.series[0])==null?void 0:E.values)??[],d=u.reduce((v,C)=>v+C,0),h=Math.max(10,Math.min(i.width,i.height)/2-12),m=i.x+i.width/2,y=i.y+i.height/2;let b=-Math.PI/2;return u.forEach((v,C)=>{const A=b,B=v/d*Math.PI*2;if(b+=B,v===0)return;const D=b,G=B>Math.PI?1:0,ae=m+h*Math.cos(A),se=y+h*Math.sin(A),Y=m+h*Math.cos(D),R=y+h*Math.sin(D),re=a[C%a.length];if(u.filter(ve=>ve>0).length===1?s.push(`<circle cx="${ke(m)}" cy="${ke(y)}" r="${ke(h)}" fill="${Il(re)}"/>`):s.push(`<path d="M ${ke(m)} ${ke(y)} L ${ke(ae)} ${ke(se)} A ${ke(h)} ${ke(h)} 0 ${G} 1 ${ke(Y)} ${ke(R)} Z" fill="${Il(re)}"/>`),r.valueLabels){const ve=A+B/2;s.push(`<text x="${ke(m+h*.62*Math.cos(ve))}" y="${ke(y+h*.62*Math.sin(ve)+4)}" text-anchor="middle" font-family="Inter, sans-serif" font-size="11" fill="#ffffff">${ke(v/d*100)}%</text>`)}}),s.join("")}function Mw(r){var y,b;const a=r,i=(E,v)=>{const C=/^([0-9.]+)px$/.exec(E.trim());if(!C)return null;const A=Number(C[1]);return Number.isFinite(A)&&A>=v?A:null},s=a.style?i(a.style.width,160):null,u=a.style?i(a.style.height,120):null,d=(b=(y=r.querySelector("svg"))==null?void 0:y.getAttribute("viewBox"))==null?void 0:b.split(/\s+/).map(E=>Number(E)),h=s??(d==null?void 0:d[2])??640,m=u??(d==null?void 0:d[3])??360;return{width:h,height:m}}function Th(r,a,i,s){const u=ld(a),d=i!==void 0&&s!==void 0?{width:i,height:s}:Mw(r);r.setAttribute(Jv,JSON.stringify(u)),r.innerHTML=Ow(u,d.width,d.height)}function zw(r,a){for(const u of[a.x,a.y,a.width,a.height])Number.isFinite(u)||bt("Chart geometry must be finite numbers.");(a.width<160||a.height<120)&&bt("Chart size must be at least 160x120 pixels.");const i=ld(a.data),s=r.ownerDocument.createElement("figure");return s.style.position="absolute",s.style.left=`${a.x}px`,s.style.top=`${a.y}px`,s.style.width=`${a.width}px`,s.style.height=`${a.height}px`,s.style.margin="0",s.style.overflow="hidden",Th(s,i,a.width,a.height),ui(r,s)}const _w={type:"bar",title:"Chart",labels:["Q1","Q2","Q3","Q4"],series:[{name:"Series 1",values:[12,20,16,28]}],colors:["#4f7cff"],legend:!1,valueLabels:!0};function Ro(r){return r?r.closest("figure[data-ppt-chart]"):null}function kw(r){return`${JSON.stringify(Eh(r),null,2)}
733
+ `}function Wv(r){const a=Ro(r);return a?(Th(a,Eh(a)),!0):!1}function Hw(r){for(const a of Array.from(r.querySelectorAll("figure[data-ppt-chart]")))try{Wv(a)}catch{}}function Hb(r){if(Ro(r)===r)try{Wv(r)}catch{}Hw(r)}function Lw(r,a){try{const i=ld(a);return Th(r,i),{ok:!0,data:i}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}const Uw={text:{width:480,height:120},shape:{width:320,height:200},table:{width:960,height:300},chart:{width:800,height:450},image:{width:480,height:270}};function Bw(r,a){const i=Uw[a],s=Math.max(0,Math.round((r.width-i.width)/2)),u=Math.max(0,Math.round((r.height-i.height)/2));return{x:s,y:u,width:i.width,height:i.height}}async function Iw(r,a){const i=Bw(a,r.kind);if(r.kind==="text"){const u=r.text??"Text box";return{apply:d=>dw(d,{...i,text:u})}}if(r.kind==="shape")return{apply:u=>fw(u,{...i,shape:r.shape})};if(r.kind==="table")return{apply:u=>bw(u,{rows:r.rows,columns:r.columns,x:i.x,y:i.y,width:i.width})};if(r.kind==="chart")return{apply:u=>zw(u,{data:_w,x:i.x,y:i.y,width:i.width,height:i.height})};const s=r.file?await Xv(r.file):vh(r.url??"");return{apply:u=>pw(u,{...i,source:s})}}const qw=new Set(["P","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","DIV","TD","TH","FIGCAPTION","PRE"]);function Ch(r){return r?r.nodeType===Node.ELEMENT_NODE?r:r.parentElement:null}function Gw(r){let a=r;for(;a&&!qw.has(a.tagName);)a=a.parentElement;return a??r}function jo(r){const a=r.getSelection();return!a||a.rangeCount===0?null:a.getRangeAt(0)}function Yw(r,a,i){const s=jo(r);if(s&&a.contains(s.commonAncestorContainer))return s;if(i&&a.contains(i.commonAncestorContainer))return i;const u=r.createRange();return u.selectNodeContents(a),u}function Lb(r){const a=r.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return a?`#${a.slice(1,4).map(s=>Number(s).toString(16).padStart(2,"0")).join("")}`:r.startsWith("#")?r:""}function Vw(r){return(r.split(",")[0]??"").trim().replace(/^["']|["']$/g,"")}function kr(r,a,i=jo(r)){var D;const s=Ch(i==null?void 0:i.startContainer),u=s&&a.contains(s)?s:a,d=(D=r.defaultView)==null?void 0:D.getComputedStyle(u),h=(d==null?void 0:d.fontWeight)??"400",m=h==="bold"?700:h==="normal"?400:Number.parseInt(h,10),y=(d==null?void 0:d.textDecorationLine)??"none",b=(d==null?void 0:d.textAlign)??"left",E=(d==null?void 0:d.backgroundColor)??"",v=u.closest("li"),C=v==null?void 0:v.parentElement,A=u.closest("a"),B=Number.parseFloat((d==null?void 0:d.fontSize)??"16");return{bold:Number.isFinite(m)?m>=600:!1,italic:(d==null?void 0:d.fontStyle)==="italic",underline:y.includes("underline"),strike:y.includes("line-through"),color:Lb((d==null?void 0:d.color)??""),highlight:E===""||E==="transparent"||/rgba\(.*,\s*0\)$/.test(E)?"":Lb(E),fontFamily:Vw((d==null?void 0:d.fontFamily)??""),fontSize:Number.isFinite(B)?Math.round(B):16,lineHeight:d!=null&&d.lineHeight&&d.lineHeight!=="normal"?d.lineHeight:"",align:b==="center"||b==="right"||b==="justify"?b:"left",list:C&&/^(UL|OL)$/.test(C.tagName)?C.tagName.toLowerCase():null,link:(A==null?void 0:A.getAttribute("href"))??null}}function Kw(r,a,i){var u;let s=Ch(r);for(;s;){const d=((u=s.style)==null?void 0:u.getPropertyValue(i))??"";if(d)return d;if(s===a)return"";s=s.parentElement}return""}function Bu(r,a,i,s){if(i.some(h=>s(Kw(r.startContainer,a,h))))return!0;if(r.collapsed)return!1;const u=Ch(r.commonAncestorContainer)??a;return[u,...Array.from(u.querySelectorAll("[style]"))].some(h=>i.some(m=>{var y;return s(((y=h.style)==null?void 0:y.getPropertyValue(m))??"")}))}function Xw(r){return r==="bold"||Number.parseInt(r,10)>=600}function Ub(r){return a=>a.includes(r)}function xa(r,a,i){if(r.collapsed&&(r.selectNodeContents(a),r.collapsed)){const s=a.ownerDocument,u=s.createElement("span");for(const[y,b]of Object.entries(i))u.style.setProperty(y,b);const d=s.createRange();d.selectNodeContents(a),d.collapse(!1),d.insertNode(u);const h=s.createRange();h.selectNodeContents(u),h.collapse(!1);const m=s.getSelection();m==null||m.removeAllRanges(),m==null||m.addRange(h);return}KS(r,i)}function Bp(r,a,i,s=null){const u=Yw(r,a,s),d=Gw(a);switch(i.type){case"bold":xa(u,d,{"font-weight":Bu(u,a,["font-weight"],Xw)?"normal":"bold"});return;case"italic":xa(u,d,{"font-style":Bu(u,a,["font-style"],h=>h==="italic")?"normal":"italic"});return;case"underline":xa(u,d,{"text-decoration-line":Bu(u,a,["text-decoration-line","text-decoration"],Ub("underline"))?"none":"underline"});return;case"strike":xa(u,d,{"text-decoration-line":Bu(u,a,["text-decoration-line","text-decoration"],Ub("line-through"))?"none":"line-through"});return;case"color":xa(u,d,{color:i.value});return;case"highlight":xa(u,d,{"background-color":i.value});return;case"fontFamily":xa(u,d,{"font-family":i.value});return;case"fontSize":xa(u,d,{"font-size":i.value});return;case"lineHeight":d.style.lineHeight=i.value;return;case"align":FS(d,i.value);return;case"list":QS(r,d,i.value);return;case"link":WS(u,i.value);return;case"clear":{const h=u;h.collapsed&&h.selectNodeContents(d),$S(h);return}}}function $w(r){const a=[];for(const i of Array.from(r.children)){const s=i.tagName.toLowerCase();if(s==="tr")a.push(i);else if(s==="thead"||s==="tbody"||s==="tfoot")for(const u of Array.from(i.children))u.tagName.toLowerCase()==="tr"&&a.push(u)}return a}function Qw(r){return Array.from(r.children).filter(a=>{const i=a.tagName.toLowerCase();return i==="td"||i==="th"})}function Ip(r,a){let i=r,s=null,u=[],d=null,h=[];for(let b=0;b<a.length;b+=1){const E=i.children[a[b]??-1];if(!E)return null;i=E;const v=i.tagName.toLowerCase();v==="table"?(s=i,u=a.slice(0,b+1)):(v==="td"||v==="th")&&(d=i,h=a.slice(0,b+1))}if(!s||!d||!s.contains(d)||s.querySelector("table"))return null;const m=$w(s).indexOf(d.parentElement),y=Qw(d.parentElement).indexOf(d);if(m<0||y<0)return null;try{return{table:s,tablePath:u,cell:d,cellPath:h,row:m,column:y,rows:vw(s),columns:xw(s),header:Fv(s)}}catch{return null}}const Nh={"common.close":"Close","common.cancel":"Cancel","common.apply":"Apply","common.saving":"Saving…","common.saved":"Saved","common.ready":"Synced","common.external":"Updated externally","common.conflict":"Conflict","common.loadFailed":"Load failed","common.saveFailed":"Save failed","common.loading":"Loading…","status.opened":"Opened","status.drafted":"Draft saved","toolbar.add":"Add","toolbar.duplicate":"Duplicate","toolbar.deleteSlide":"Delete","toolbar.addHint":"Add after the current slide","toolbar.duplicateHint":"Duplicate the current slide","toolbar.deleteHint":"Delete the current slide","toolbar.keepOneSlide":"Keep at least one slide","toolbar.previous":"Previous","toolbar.next":"Next","toolbar.viewGroup":"View mode","toolbar.viewNormal":"Normal","toolbar.viewSorter":"Sorter","toolbar.shortcuts":"Shortcuts","toolbar.shortcutsTitle":"Keyboard shortcuts (?)","toolbar.play":"Play","toolbar.standaloneBadge":"Standalone","toolbar.standaloneHint":"No host connection; download HTML or press Ctrl+S to write the file","path.label":"Deck path","path.open":"Open…","path.openHint":"Open another HTML deck","path.invalid":"Invalid path. Enter an HTML file path.","path.notFound":"File not found.","path.extension":"Only .html or .htm files are supported.","path.invalidDeck":"This file is not a valid deck.","path.alreadyOpen":"Already open in another host: {url}","path.alreadyOpenOther":"This deck is already open in another host.","path.hostClosing":"The editor is closing. Try again shortly.","path.loadFailedKept":"Load failed; the current deck was kept.","path.openFailed":"Could not open the file.","path.saveIncomplete":"The save did not finish, so another file cannot be opened.","path.unauthorized":"Not authorized. Refresh the page.","path.unreadable":"Could not read the file.","insert.group":"Insert object","insert.text":"Text","insert.shape":"Shape","insert.table":"Table","insert.chart":"Chart","insert.chartHint":"Insert a chart","insert.image":"Image","insert.imageHint":"Insert an image","insert.rect":"Rectangle","insert.rounded":"Rounded rectangle","insert.ellipse":"Ellipse","insert.triangle":"Triangle","insert.line":"Line","insert.arrow":"Arrow","insert.rows":"Rows","insert.columns":"Columns","insert.rowsLabel":"Table rows","insert.columnsLabel":"Table columns","insert.createTable":"Insert table","insert.uploadImage":"Upload image…","insert.imageUrl":"Image URL…","insert.shapeHint":"Insert a shape","insert.tableHint":"Insert a table","insert.textHint":"Insert a text box","export.label":"Export","export.title":"Export (Ctrl+Shift+E)","export.busy":"Exporting…","export.format":"Export format","export.html":"HTML deck","export.pdf":"PDF document","export.png":"PNG images","export.hostOnly":"PDF/PNG need the host","export.hostOnlyHint":"Needs a local host and Chromium; open the deck with htmlcraft open.","export.standaloneUnsupported":"PDF/PNG are unavailable in standalone mode; use htmlcraft open.","export.downloaded":"Downloaded {name}.","export.downloadedAnnouncement":"Downloaded the HTML file.","export.exported":"Exported {count} files: {files}","export.exportedAnnouncement":"Exported {count} files.","export.htmlHint":"Static HTML without editor traces","export.pdfHint":"One page per slide; needs local Chromium","export.pngHint":"One 2x image per slide; needs local Chromium","inspector.panel":"Properties panel","inspector.tabs":"Property tabs","inspector.design":"Design","inspector.text":"Text","inspector.notes":"Notes","inspector.objects":"Objects","inspector.enterComponent":"Enter","inspector.objectActions":"Object actions","inspector.noObjects":"No objects on this slide.","inspector.invalidNumber":"Invalid number. Fix it or press Escape to cancel.","inspector.invalidValue":"Invalid value. Fix it or press Escape to cancel.","inspector.invalidBackground":"Invalid background value. Fix it or press Escape to cancel.","inspector.clearBackgroundFailed":"Could not clear the background.","inspector.emptyText":"(No text)","inspector.group":"Group","inspector.locked":"Locked","inspector.hidden":"Hidden","inspector.unlock":"Unlock","inspector.unlockItem":"Unlock","inspector.unlockItemLabel":"Unlock {name}","inspector.show":"Show","inspector.showItem":"Show","inspector.showItemLabel":"Show {name}","inspector.hide":"Hide","inspector.ungroup":"Ungroup","inspector.toFront":"Bring to front","inspector.forward":"Bring forward","inspector.backward":"Send backward","inspector.toBack":"Send to back","inspector.alignLeft":"Align left","inspector.alignCenter":"Align center","inspector.alignRight":"Align right","inspector.alignTop":"Align top","inspector.alignMiddle":"Align middle","inspector.alignBottom":"Align bottom","inspector.distributeH":"Distribute horizontally","inspector.distributeV":"Distribute vertically","inspector.hiddenHint":"This object is hidden. Show it before changing its position.","inspector.lockedHint":"This object is locked. Unlock it before changing its position.","inspector.multiHint":"Selected {count} objects; align, distribute, group, or drag to move.","inspector.groupHint":"Groups can only be moved and rotated; ungroup to resize.","inspector.nestedStructuralHint":"Position, size, appearance, and text apply to this object. Reorder and group act on top-level objects only.","inspector.nestedStructuralHintLimited":"Reorder and group act on top-level objects only.","inspector.nestedMultiStructuralHint":"Multiple nested objects selected. Only moving with the drag or arrow keys applies; duplicate, delete, reorder, and group act on top-level objects only.","inspector.appearance":"Appearance","inspector.objectAppearance":"Object appearance","inspector.image":"Image","inspector.imageUrlAction":"Image URL…","inspector.replaceImage":"Replace image…","inspector.alt":"Alt text","inspector.crop":"Crop (%)","inspector.top":"Top","inspector.right":"Right","inspector.bottom":"Bottom","inspector.left":"Left","inspector.radius":"Radius","inspector.opacity":"Opacity","inspector.fill":"Fill","inspector.borderColor":"Border color","inspector.borderWidth":"Border width","inspector.shapeText":"Shape text","inspector.geometry":"Position and size","inspector.width":"Width","inspector.height":"Height","inspector.rotation":"Rotation","inspector.slide":"Slide settings","inspector.transition":"Transition","inspector.transitionNone":"None","inspector.transitionFade":"Fade","inspector.transitionSlide":"Slide","inspector.preview":"Preview","inspector.notApplied":"Transition not applied yet.","inspector.background":"Background","inspector.backgroundKind":"Background kind","inspector.backgroundKindColor":"Color","inspector.backgroundKindGradient":"Gradient","inspector.backgroundValue":"Background value","inspector.backgroundImage":"Image URL","inspector.clearBackground":"Clear background","inspector.speakerNotes":"Speaker notes","inspector.notesPlaceholder":"Enter notes…","inspector.notesHint":"Notes are stored in a hidden block inside the slide.","inspector.textIdle":"Select a text object on the slide.","inspector.textSelected":"Formatting applies to: {text}","inspector.textEmpty":"This text box is empty. Use Edit text to type.","inspector.editText":"Edit text","inspector.textMulti":"Select one object to edit its text.","inspector.alignObject":"Align object","inspector.chart":"Chart","inspector.untitled":"Untitled","inspector.editChart":"Edit chart data…","inspector.chartDialog":"Edit chart","inspector.chartHint":"The values array of each series must be the same length as labels. Ctrl+Enter applies, Escape cancels.","inspector.chartJson":"Chart JSON","text.group":"Text","text.toolbar":"Text formatting","text.bold":"Bold","text.italic":"Italic","text.underline":"Underline","text.strike":"Strikethrough","text.color":"Text color","text.colorSwatch":"Text color {color}","text.highlight":"Highlight","text.highlightSwatch":"Highlight color {color}","text.font":"Font","text.size":"Size","text.align":"Align","text.lineHeight":"Line height","text.bullet":"• List","text.bulletLabel":"Bullet list","text.ordered":"1. List","text.orderedLabel":"Numbered list","text.link":"Link","text.clear":"Clear formatting","text.selection":"Selected text","table.tools":"Table tools","table.position":"Row {row}/{rows} · Column {column}/{columns}","table.rowAbove":"Row above","table.rowBelow":"Row below","table.deleteRow":"Delete row","table.columnLeft":"Column left","table.columnRight":"Column right","table.deleteColumn":"Delete column","table.header":"Header row","table.removeHeader":"Remove header row","table.cellFill":"Cell fill","table.cellBorder":"Cell border","table.cellBorderLabel":"Cell border color","canvas.selected":"Selected","shortcuts.title":"Keyboard shortcuts","shortcuts.note":"Navigation keys stay with text input while focus is in a field or a text edit.","shortcuts.close":"Close shortcuts","shortcuts.closeHelp":"Close shortcuts help","shortcuts.playGroup":"Playback and presenting","shortcuts.playFromStart":"Play from the first slide","shortcuts.playFromCurrent":"Play from the current slide","shortcuts.openPresenter":"Open the presenter window","shortcuts.toggleFullscreen":"Toggle fullscreen","shortcuts.nextSlide":"Next slide","shortcuts.previousSlide":"Previous slide","shortcuts.firstLast":"First / last slide","shortcuts.exitPlay":"Exit playback or clear the selection","shortcuts.editGroup":"Editing","shortcuts.undo":"Undo","shortcuts.redo":"Redo","shortcuts.duplicateSelection":"Duplicate selected objects","shortcuts.selectAll":"Select all","shortcuts.deleteSelection":"Delete selected objects","shortcuts.copyPaste":"Copy / paste","shortcuts.groupUngroup":"Group / ungroup","shortcuts.editText":"Edit selected text","shortcuts.bold":"Bold","shortcuts.italic":"Italic","shortcuts.underline":"Underline","shortcuts.nudge":"Nudge 1px / 10px","shortcuts.arrowKeys":"Arrow keys / Shift+Arrow keys","shortcuts.viewGroup":"View and file","shortcuts.zoom":"Zoom in / out","shortcuts.fit":"Fit to window","shortcuts.save":"Save now","shortcuts.help":"Open this help","sorter.title":"Sorter","sorter.hint":"Drag slides to reorder","sorter.current":"✓ Current","sorter.copy":"Copy","sorter.copyLabel":"Duplicate slide {index}","sorter.delete":"Delete","sorter.deleteLabel":"Delete slide {index}","sorter.page":"Slide {index}","sorter.pageTitle":"Slide {index}: {title}","rail.untitled":"Untitled slide","rail.current":"Current slide","rail.preview":"Slide preview","rail.thumbnail":"Slide thumbnail","rail.pageTitle":"Slide {index}: {title}","play.label":"Play mode","play.presenter":"Presenter","play.openPresenter":"Open presenter view (P)","play.start":"Play slides","play.fitGroup":"Screen fit","play.fit":"Fit","play.fill":"Fill","play.instructions":"Use the arrow keys, Space, or PageDown to change slides; Escape exits play; P opens the presenter window.","presenter.waiting":"Waiting for the main window…","presenter.connected":"Connected","presenter.disconnected":"Disconnected","presenter.title":"Presenter view","presenter.page":"Slide {index} / {total}","presenter.previous":"Previous","presenter.next":"Next","presenter.lastSlide":"(Last slide)","presenter.notes":"Notes","presenter.currentNotes":"Current notes","presenter.noNotes":"No notes for this slide.","presenter.disconnectedHelp":"Not connected to the main window. Reopen the presenter view from the editor.","app.invalidData":"Invalid data","app.deselected":"Selection cleared","app.fullscreenUnsupported":"Fullscreen is unavailable in this browser or environment. Press F11 for fullscreen; Escape returns to the editor.","app.fullscreenDenied":"The browser denied fullscreen. Press F11 for fullscreen; Escape returns to the editor.","app.fullscreenExitedHint":"Fullscreen exited. Press F to re-enter; Escape returns to the editor.","app.presenterBlockedHint":"The browser blocked the presenter window. Allow pop-ups for this site, then press P or Presenter to retry.","app.replaceImageFailed":"Could not replace the image. Select the object again and retry.","app.imageUrlPromptDetail":"Image URL (https:// or data:image/...)","app.linkPromptDetail":"Link URL (http:, https:, mailto:, or #fragment; leave empty to remove the link)","app.chartNotSelected":"The selected object is not a chart.","app.chartApplyFailed":"Could not apply the chart data.","recovery.available":"Unsaved edits are available","recovery.found":"Unsaved edits from a previous session: {path}","recovery.restore":"Restore","recovery.discard":"Discard","conflict.switched":"The host switched to another file; reload to continue.","conflict.external":"The file changed externally and this tab has unsaved changes.","conflict.reload":"Reload","conflict.overwrite":"Overwrite","editor.noSlides":"No slides found.","editor.newSlideTitle":"New slide","editor.newTextBox":"Text box","editor.context.enter":"Enter {name}","editor.context.goTo":"Go to {name}","editor.context.label":"Editing context","editor.context.slide":"Slide","editor.context.unknown":"Unknown","editor.pendingEditFailed":"Could not apply the pending edit.","editor.pendingEditInstruction":"Apply or cancel the pending edit before overwriting.","editor.reloadFailed":"Could not reload the deck.","editor.notice.pinned":"This element was positioned by its container; it is now absolutely positioned.","editor.notice.undo":"Undo","editor.notice.dismiss":"Dismiss","editor.hint.not-text":"Only text elements edit inline. Double-click a container background to enter it.","editor.hint.has-children":"This element has children. Enter the container, then edit its text.","editor.hint.empty":"This element has no text yet. Add text through the Text tools first.","editor.hint.locked":"This object is locked. Unlock it before editing its content.","editor.hint.hidden":"This object is hidden. Unhide it before editing its content.","editor.hint.group":"Groups edit as one object. Ungroup it to edit the parts.","editor.hint.table-cell-move":"This is a table cell. Select the table to move it.","editor.hint.paste-kind":"This SVG component can only be pasted inside an SVG.","standalone.title":"Standalone editor","standalone.description":"No local host is connected. Open or drop an HTML deck to edit it. Browsers with File System Access write back to the original file; others can download the exported HTML.","standalone.open":"Open HTML…","standalone.upload":"Or upload an HTML file","standalone.fileType":"Choose an HTML file.","standalone.commandHint":"PDF/PNG need a local Chromium and host. Open the deck with:","a11y.selectedCount":"Selected {count} objects","a11y.selectedTag":"Selected {tag}","a11y.selectedSummary":"Selected {tag}: {summary}","a11y.slide":"Slide {index} of {total}","a11y.contextLevel":"Editing inside {name}","a11y.contextSlide":"Editing the slide","locale.label":"Language","theme.label":"Theme","theme.light":"Light","theme.dark":"Dark","theme.system":"System"},Zw={"common.close":"關閉","common.cancel":"取消","common.apply":"套用","common.saving":"儲存中…","common.saved":"已儲存","common.ready":"已同步","common.external":"外部更新","common.conflict":"衝突","common.loadFailed":"載入失敗","common.saveFailed":"儲存失敗","common.loading":"載入中…","status.opened":"已開啟","status.drafted":"已暫存","toolbar.add":"新增","toolbar.duplicate":"複製","toolbar.deleteSlide":"刪除","toolbar.addHint":"在目前投影片後新增","toolbar.duplicateHint":"複製目前投影片","toolbar.deleteHint":"刪除目前投影片","toolbar.keepOneSlide":"至少需要保留一頁","toolbar.previous":"上一頁","toolbar.next":"下一頁","toolbar.viewGroup":"檢視模式","toolbar.viewNormal":"一般","toolbar.viewSorter":"排序","toolbar.shortcuts":"快速鍵","toolbar.shortcutsTitle":"鍵盤快速鍵(?)","toolbar.play":"播放","toolbar.standaloneBadge":"獨立模式","toolbar.standaloneHint":"未連上 host;下載 HTML 或按 Ctrl+S 才會寫出檔案","path.label":"簡報路徑","path.open":"開啟…","path.openHint":"開啟另一個 HTML 檔","path.invalid":"路徑無效;請輸入 HTML 檔案路徑。","path.notFound":"找不到檔案。","path.extension":"只支援 .html 或 .htm 檔案。","path.invalidDeck":"這個檔案不是有效的簡報。","path.alreadyOpen":"已在另一個 host 開啟:{url}","path.alreadyOpenOther":"此簡報已在另一個 host 開啟。","path.hostClosing":"編輯器正在關閉,請稍後再試。","path.loadFailedKept":"載入失敗,已保留目前簡報。","path.openFailed":"開啟失敗。","path.saveIncomplete":"儲存未完成,無法開啟另一個檔案。","path.unauthorized":"未授權,請重新整理頁面。","path.unreadable":"無法讀取檔案。","insert.group":"插入物件","insert.text":"文字","insert.shape":"形狀","insert.table":"表格","insert.chart":"圖表","insert.chartHint":"插入圖表","insert.image":"圖片","insert.imageHint":"插入圖片","insert.rect":"矩形","insert.rounded":"圓角矩形","insert.ellipse":"橢圓","insert.triangle":"三角形","insert.line":"線條","insert.arrow":"箭頭","insert.rows":"列","insert.columns":"欄","insert.rowsLabel":"表格列數","insert.columnsLabel":"表格欄數","insert.createTable":"插入表格","insert.uploadImage":"上傳圖片…","insert.imageUrl":"圖片網址…","insert.shapeHint":"插入形狀","insert.tableHint":"插入表格","insert.textHint":"插入文字方塊","export.label":"匯出","export.title":"匯出(Ctrl+Shift+E)","export.busy":"匯出中…","export.format":"匯出格式","export.html":"HTML 簡報","export.pdf":"PDF 文件","export.png":"PNG 圖片","export.hostOnly":"需要 host 才能匯出 PDF/PNG","export.hostOnlyHint":"需要本機 host 與 Chromium;請使用 htmlcraft open 開啟。","export.standaloneUnsupported":"獨立模式不支援 PDF/PNG;請用 htmlcraft open 開啟檔案。","export.downloaded":"已下載 {name}。","export.downloadedAnnouncement":"已下載 HTML 檔。","export.exported":"已匯出 {count} 個檔案:{files}","export.exportedAnnouncement":"已匯出 {count} 個檔案。","export.htmlHint":"匯出不含編輯器痕跡的靜態 HTML","export.pdfHint":"每張投影片一頁,需要本機 Chromium","export.pngHint":"每張投影片一張 2x 圖片,需要本機 Chromium","inspector.panel":"屬性面板","inspector.tabs":"屬性分頁","inspector.design":"設計","inspector.text":"文字","inspector.notes":"備註","inspector.objects":"物件","inspector.enterComponent":"進入","inspector.objectActions":"物件操作","inspector.noObjects":"此頁沒有物件。","inspector.invalidNumber":"數值無效,請修正或按 Escape 取消。","inspector.invalidValue":"值無效,請修正或按 Escape 取消。","inspector.invalidBackground":"背景值無效,請修正或按 Escape 取消。","inspector.clearBackgroundFailed":"無法清除背景。","inspector.emptyText":"(無文字)","inspector.group":"群組","inspector.locked":"鎖定","inspector.hidden":"隱藏","inspector.unlock":"解除鎖定","inspector.unlockItem":"解鎖","inspector.unlockItemLabel":"解鎖 {name}","inspector.show":"顯示物件","inspector.showItem":"顯示","inspector.showItemLabel":"顯示 {name}","inspector.hide":"隱藏物件","inspector.ungroup":"取消群組","inspector.toFront":"最前","inspector.forward":"上移","inspector.backward":"下移","inspector.toBack":"最後","inspector.alignLeft":"左對齊","inspector.alignCenter":"置中","inspector.alignRight":"右對齊","inspector.alignTop":"頂端","inspector.alignMiddle":"垂直置中","inspector.alignBottom":"底部","inspector.distributeH":"水平等距","inspector.distributeV":"垂直等距","inspector.hiddenHint":"物件已隱藏,請先顯示後再調整位置。","inspector.lockedHint":"物件已鎖定,請先解除鎖定再調整位置。","inspector.multiHint":"已選取 {count} 個物件;可對齊、分佈、群組,或拖曳移動。","inspector.groupHint":"群組僅支援移動與旋轉;取消群組後可調整大小。","inspector.nestedStructuralHint":"位置、大小、外觀與文字會套用到這個物件;排序與群組只作用於最上層物件。","inspector.nestedStructuralHintLimited":"排序與群組只作用於最上層物件。","inspector.nestedMultiStructuralHint":"已選取多個巢狀物件;僅支援拖曳或方向鍵移動,複製、刪除、排序與群組只作用於最上層物件。","inspector.appearance":"外觀","inspector.objectAppearance":"物件外觀","inspector.image":"圖片","inspector.imageUrlAction":"圖片網址…","inspector.replaceImage":"更換圖片…","inspector.alt":"替代文字","inspector.crop":"裁切(%)","inspector.top":"上","inspector.right":"右","inspector.bottom":"下","inspector.left":"左","inspector.radius":"圓角","inspector.opacity":"不透明度","inspector.fill":"填色","inspector.borderColor":"邊框顏色","inspector.borderWidth":"邊框寬度","inspector.shapeText":"圖形文字","inspector.geometry":"位置與尺寸","inspector.width":"寬","inspector.height":"高","inspector.rotation":"旋轉","inspector.slide":"投影片設定","inspector.transition":"轉場","inspector.transitionNone":"無","inspector.transitionFade":"淡入","inspector.transitionSlide":"滑動","inspector.preview":"預覽","inspector.notApplied":"轉場尚未套用。","inspector.background":"背景","inspector.backgroundKind":"背景類型","inspector.backgroundKindColor":"顏色","inspector.backgroundKindGradient":"漸層","inspector.backgroundValue":"背景值","inspector.backgroundImage":"圖片 URL","inspector.clearBackground":"清除背景","inspector.speakerNotes":"講者備註","inspector.notesPlaceholder":"輸入備註…","inspector.notesHint":"備註以隱藏的區塊儲存在投影片內。","inspector.textIdle":"在投影片上選取文字物件。","inspector.textSelected":"格式套用至:{text}","inspector.textEmpty":"這個文字方塊是空的,請使用「編輯文字」輸入。","inspector.editText":"編輯文字","inspector.textMulti":"選取單一物件以編輯文字。","inspector.alignObject":"物件對齊","inspector.chart":"圖表","inspector.untitled":"未命名","inspector.editChart":"編輯圖表資料…","inspector.chartDialog":"編輯圖表","inspector.chartHint":"series 的 values 長度必須等於 labels。Ctrl+Enter 套用,Escape 取消。","inspector.chartJson":"圖表 JSON","text.group":"文字","text.toolbar":"文字格式","text.bold":"粗體","text.italic":"斜體","text.underline":"底線","text.strike":"刪除線","text.color":"文字顏色","text.colorSwatch":"文字顏色 {color}","text.highlight":"螢光標示","text.highlightSwatch":"螢光色 {color}","text.font":"字型","text.size":"字級","text.align":"對齊","text.lineHeight":"行高","text.bullet":"• 清單","text.bulletLabel":"項目符號","text.ordered":"1. 清單","text.orderedLabel":"編號清單","text.link":"連結","text.clear":"清除格式","text.selection":"選取文字","table.tools":"表格工具","table.position":"列 {row}/{rows} · 欄 {column}/{columns}","table.rowAbove":"上方列","table.rowBelow":"下方列","table.deleteRow":"刪列","table.columnLeft":"左方欄","table.columnRight":"右方欄","table.deleteColumn":"刪欄","table.header":"標題列","table.removeHeader":"取消標題列","table.cellFill":"儲存格底色","table.cellBorder":"框線","table.cellBorderLabel":"儲存格框線顏色","canvas.selected":"選取","shortcuts.title":"鍵盤快速鍵","shortcuts.note":"焦點在輸入框或文字編輯中時,導覽鍵保留給文字輸入。","shortcuts.close":"關閉快速鍵","shortcuts.closeHelp":"關閉快速鍵說明","shortcuts.playGroup":"播放與簡報","shortcuts.playFromStart":"從第一頁開始播放","shortcuts.playFromCurrent":"從目前頁開始播放","shortcuts.openPresenter":"開啟簡報者視窗","shortcuts.toggleFullscreen":"切換全螢幕","shortcuts.nextSlide":"下一頁","shortcuts.previousSlide":"上一頁","shortcuts.firstLast":"第一頁 / 最後一頁","shortcuts.exitPlay":"離開播放或取消選取","shortcuts.editGroup":"編輯","shortcuts.undo":"復原","shortcuts.redo":"重做","shortcuts.duplicateSelection":"複製選取物件","shortcuts.selectAll":"全選","shortcuts.deleteSelection":"刪除選取物件","shortcuts.copyPaste":"複製 / 貼上","shortcuts.groupUngroup":"群組 / 取消群組","shortcuts.editText":"編輯選取文字","shortcuts.bold":"粗體","shortcuts.italic":"斜體","shortcuts.underline":"底線","shortcuts.nudge":"微調 1px / 10px","shortcuts.arrowKeys":"方向鍵 / Shift+方向鍵","shortcuts.viewGroup":"檢視與檔案","shortcuts.zoom":"放大 / 縮小","shortcuts.fit":"符合視窗","shortcuts.save":"立即儲存","shortcuts.help":"開啟此說明","sorter.title":"排序檢視","sorter.hint":"拖曳投影片以重新排序","sorter.current":"✓ 目前","sorter.copy":"複製","sorter.copyLabel":"複製第 {index} 頁","sorter.delete":"刪除","sorter.deleteLabel":"刪除第 {index} 頁","sorter.page":"第 {index} 頁","sorter.pageTitle":"第 {index} 頁:{title}","rail.untitled":"未命名投影片","rail.current":"目前投影片","rail.preview":"投影片預覽","rail.thumbnail":"投影片縮圖","rail.pageTitle":"第 {index} 頁:{title}","play.label":"播放模式","play.presenter":"簡報者","play.openPresenter":"開啟簡報者檢視(P)","play.start":"播放投影片","play.fitGroup":"畫面縮放","play.fit":"適應","play.fill":"填滿","play.instructions":"使用方向鍵、Space 或 PageDown 換頁;Escape 離開播放;P 開啟簡報者視窗。","presenter.waiting":"等待主視窗…","presenter.connected":"已連線","presenter.disconnected":"已中斷","presenter.title":"簡報者檢視","presenter.page":"第 {index} / {total} 頁","presenter.previous":"上一頁","presenter.next":"下一頁","presenter.lastSlide":"(最後一頁)","presenter.notes":"備註","presenter.currentNotes":"目前備註","presenter.noNotes":"此頁沒有備註。","presenter.disconnectedHelp":"未連線到主視窗。請從編輯器重新開啟簡報者檢視。","app.invalidData":"資料無效","app.deselected":"已取消選取","app.fullscreenUnsupported":"此瀏覽器或環境不支援全螢幕。按 F11 可手動全螢幕;Escape 返回編輯器。","app.fullscreenDenied":"瀏覽器未允許全螢幕。按 F11 可手動全螢幕;Escape 返回編輯器。","app.fullscreenExitedHint":"已離開全螢幕。按 F 重新進入,Escape 返回編輯器。","app.presenterBlockedHint":"瀏覽器封鎖了簡報者視窗。請允許此網站開啟彈出視窗,再按 P 或「簡報者」重試。","app.replaceImageFailed":"無法更換圖片;請重新選取物件後再試。","app.imageUrlPromptDetail":"圖片網址(https:// 或 data:image/...)","app.linkPromptDetail":"連結網址(http:、https:、mailto: 或 #片段;留空移除連結)","app.chartNotSelected":"選取的物件不是圖表。","app.chartApplyFailed":"無法套用圖表資料。","recovery.available":"有未儲存的編輯","recovery.found":"發現上次未儲存的編輯:{path}","recovery.restore":"恢復","recovery.discard":"捨棄","conflict.switched":"主機已切換到另一個檔案;只能重新載入。","conflict.external":"外部已修改檔案,本機有尚未儲存的變更。","conflict.reload":"重新載入","conflict.overwrite":"覆寫","editor.noSlides":"找不到投影片。","editor.newSlideTitle":"新投影片","editor.newTextBox":"新文字方塊","editor.context.enter":"進入 {name}","editor.context.goTo":"前往 {name}","editor.context.label":"編輯脈絡","editor.context.slide":"投影片","editor.context.unknown":"未知","editor.pendingEditFailed":"無法套用編輯。","editor.pendingEditInstruction":"請先套用或取消尚未完成的編輯,再覆寫。","editor.reloadFailed":"無法重新載入簡報。","editor.notice.pinned":"這個物件原本由容器排版定位,現在改為絕對定位。","editor.notice.undo":"復原","editor.notice.dismiss":"關閉","editor.hint.not-text":"只有文字元素可以就地編輯。連按兩下容器空白處即可進入容器。","editor.hint.has-children":"這個元素含有子元素。請先進入容器,再編輯其中的文字。","editor.hint.empty":"這個元素尚無文字。請先用「文字」工具加入文字。","editor.hint.locked":"這個物件已鎖定。請先解鎖,再編輯其內容。","editor.hint.hidden":"這個物件已隱藏。請先顯示,再編輯其內容。","editor.hint.group":"群組會作為單一物件編輯。請先取消群組,再編輯其中的元件。","editor.hint.table-cell-move":"這是表格儲存格,請選取整個表格再移動。","editor.hint.paste-kind":"這個 SVG 元件只能貼到 SVG 內。","standalone.title":"獨立編輯模式","standalone.description":"未連上本機 host。開啟或拖入一份 HTML 簡報即可編輯;支援 File System Access 的瀏覽器會直接寫回原檔,其他瀏覽器可下載匯出的 HTML。","standalone.open":"開啟 HTML…","standalone.upload":"或上傳 HTML 檔","standalone.fileType":"請選擇 HTML 檔。","standalone.commandHint":"PDF/PNG 需要本機 Chromium 與 host,請改用以下指令開啟:","a11y.selectedCount":"已選取 {count} 個物件","a11y.selectedTag":"已選取 {tag}","a11y.selectedSummary":"已選取 {tag}:{summary}","a11y.slide":"第 {index} 頁,共 {total} 頁","a11y.contextLevel":"正在編輯 {name}","a11y.contextSlide":"正在編輯投影片","locale.label":"語言","theme.label":"主題","theme.light":"淺色","theme.dark":"深色","theme.system":"跟隨系統"},Fw={"common.close":"关闭","common.cancel":"取消","common.apply":"应用","common.saving":"保存中…","common.saved":"已保存","common.ready":"已同步","common.external":"外部更新","common.conflict":"冲突","common.loadFailed":"加载失败","common.saveFailed":"保存失败","common.loading":"加载中…","status.opened":"已打开","status.drafted":"已暂存","toolbar.add":"新建","toolbar.duplicate":"复制","toolbar.deleteSlide":"删除","toolbar.addHint":"在当前幻灯片后新建","toolbar.duplicateHint":"复制当前幻灯片","toolbar.deleteHint":"删除当前幻灯片","toolbar.keepOneSlide":"至少需要保留一页","toolbar.previous":"上一页","toolbar.next":"下一页","toolbar.viewGroup":"视图模式","toolbar.viewNormal":"普通","toolbar.viewSorter":"排序","toolbar.shortcuts":"快捷键","toolbar.shortcutsTitle":"键盘快捷键(?)","toolbar.play":"播放","toolbar.standaloneBadge":"独立模式","toolbar.standaloneHint":"未连接 host;下载 HTML 或按 Ctrl+S 才会写出文件","path.label":"演示文稿路径","path.open":"打开…","path.openHint":"打开另一个 HTML 文件","path.invalid":"路径无效;请输入 HTML 文件路径。","path.notFound":"找不到文件。","path.extension":"仅支持 .html 或 .htm 文件。","path.invalidDeck":"这个文件不是有效的演示文稿。","path.alreadyOpen":"已在另一个 host 打开:{url}","path.alreadyOpenOther":"此演示文稿已在另一个 host 打开。","path.hostClosing":"编辑器正在关闭,请稍后再试。","path.loadFailedKept":"加载失败,已保留当前演示文稿。","path.openFailed":"打开失败。","path.saveIncomplete":"保存未完成,无法打开另一个文件。","path.unauthorized":"未授权,请刷新页面。","path.unreadable":"无法读取文件。","insert.group":"插入对象","insert.text":"文字","insert.shape":"形状","insert.table":"表格","insert.chart":"图表","insert.chartHint":"插入图表","insert.image":"图片","insert.imageHint":"插入图片","insert.rect":"矩形","insert.rounded":"圆角矩形","insert.ellipse":"椭圆","insert.triangle":"三角形","insert.line":"线条","insert.arrow":"箭头","insert.rows":"行","insert.columns":"列","insert.rowsLabel":"表格行数","insert.columnsLabel":"表格列数","insert.createTable":"插入表格","insert.uploadImage":"上传图片…","insert.imageUrl":"图片网址…","insert.shapeHint":"插入形状","insert.tableHint":"插入表格","insert.textHint":"插入文本框","export.label":"导出","export.title":"导出(Ctrl+Shift+E)","export.busy":"导出中…","export.format":"导出格式","export.html":"HTML 演示文稿","export.pdf":"PDF 文件","export.png":"PNG 图片","export.hostOnly":"需要 host 才能导出 PDF/PNG","export.hostOnlyHint":"需要本地 host 与 Chromium;请使用 htmlcraft open 打开。","export.standaloneUnsupported":"独立模式不支持 PDF/PNG;请用 htmlcraft open 打开文件。","export.downloaded":"已下载 {name}。","export.downloadedAnnouncement":"已下载 HTML 文件。","export.exported":"已导出 {count} 个文件:{files}","export.exportedAnnouncement":"已导出 {count} 个文件。","export.htmlHint":"导出不含编辑器痕迹的静态 HTML","export.pdfHint":"每张幻灯片一页,需要本地 Chromium","export.pngHint":"每张幻灯片一张 2x 图片,需要本地 Chromium","inspector.panel":"属性面板","inspector.tabs":"属性标签页","inspector.design":"设计","inspector.text":"文字","inspector.notes":"备注","inspector.objects":"对象","inspector.enterComponent":"进入","inspector.objectActions":"对象操作","inspector.noObjects":"此页没有对象。","inspector.invalidNumber":"数值无效,请修正或按 Escape 取消。","inspector.invalidValue":"值无效,请修正或按 Escape 取消。","inspector.invalidBackground":"背景值无效,请修正或按 Escape 取消。","inspector.clearBackgroundFailed":"无法清除背景。","inspector.emptyText":"(无文字)","inspector.group":"编组","inspector.locked":"锁定","inspector.hidden":"隐藏","inspector.unlock":"取消锁定","inspector.unlockItem":"解锁","inspector.unlockItemLabel":"解锁 {name}","inspector.show":"显示对象","inspector.showItem":"显示","inspector.showItemLabel":"显示 {name}","inspector.hide":"隐藏对象","inspector.ungroup":"取消编组","inspector.toFront":"最前","inspector.forward":"上移","inspector.backward":"下移","inspector.toBack":"最后","inspector.alignLeft":"左对齐","inspector.alignCenter":"居中","inspector.alignRight":"右对齐","inspector.alignTop":"顶端","inspector.alignMiddle":"垂直居中","inspector.alignBottom":"底部","inspector.distributeH":"水平等距","inspector.distributeV":"垂直等距","inspector.hiddenHint":"对象已隐藏,请先显示后再调整位置。","inspector.lockedHint":"对象已锁定,请先取消锁定再调整位置。","inspector.multiHint":"已选择 {count} 个对象;可对齐、分布、编组,或拖动移动。","inspector.groupHint":"编组仅支持移动与旋转;取消编组后可调整大小。","inspector.nestedStructuralHint":"位置、大小、外观与文字会应用到该对象;排序与编组只作用于顶层对象。","inspector.nestedStructuralHintLimited":"排序与编组只作用于顶层对象。","inspector.nestedMultiStructuralHint":"已选择多个嵌套对象;仅支持拖动或方向键移动,复制、删除、排序与编组只作用于顶层对象。","inspector.appearance":"外观","inspector.objectAppearance":"对象外观","inspector.image":"图片","inspector.imageUrlAction":"图片网址…","inspector.replaceImage":"更换图片…","inspector.alt":"替代文本","inspector.crop":"裁剪(%)","inspector.top":"上","inspector.right":"右","inspector.bottom":"下","inspector.left":"左","inspector.radius":"圆角","inspector.opacity":"不透明度","inspector.fill":"填充","inspector.borderColor":"边框颜色","inspector.borderWidth":"边框宽度","inspector.shapeText":"形状文字","inspector.geometry":"位置与大小","inspector.width":"宽","inspector.height":"高","inspector.rotation":"旋转","inspector.slide":"幻灯片设置","inspector.transition":"切换","inspector.transitionNone":"无","inspector.transitionFade":"淡入","inspector.transitionSlide":"滑动","inspector.preview":"预览","inspector.notApplied":"切换尚未应用。","inspector.background":"背景","inspector.backgroundKind":"背景类型","inspector.backgroundKindColor":"颜色","inspector.backgroundKindGradient":"渐变","inspector.backgroundValue":"背景值","inspector.backgroundImage":"图片 URL","inspector.clearBackground":"清除背景","inspector.speakerNotes":"演讲者备注","inspector.notesPlaceholder":"输入备注…","inspector.notesHint":"备注以隐藏的区块存储在幻灯片内。","inspector.textIdle":"在幻灯片上选择文本对象。","inspector.textSelected":"格式应用于:{text}","inspector.textEmpty":"此文本框为空,请使用“编辑文字”输入。","inspector.editText":"编辑文字","inspector.textMulti":"选择一个对象以编辑文本。","inspector.alignObject":"对象对齐","inspector.chart":"图表","inspector.untitled":"未命名","inspector.editChart":"编辑图表数据…","inspector.chartDialog":"编辑图表","inspector.chartHint":"series 的 values 长度必须等于 labels。Ctrl+Enter 应用,Escape 取消。","inspector.chartJson":"图表 JSON","text.group":"文字","text.toolbar":"文字格式","text.bold":"粗体","text.italic":"斜体","text.underline":"下划线","text.strike":"删除线","text.color":"文字颜色","text.colorSwatch":"文字颜色 {color}","text.highlight":"高亮","text.highlightSwatch":"荧光色 {color}","text.font":"字体","text.size":"字号","text.align":"对齐","text.lineHeight":"行高","text.bullet":"• 列表","text.bulletLabel":"项目符号","text.ordered":"1. 列表","text.orderedLabel":"编号列表","text.link":"链接","text.clear":"清除格式","text.selection":"选中的文字","table.tools":"表格工具","table.position":"行 {row}/{rows} · 列 {column}/{columns}","table.rowAbove":"上方行","table.rowBelow":"下方行","table.deleteRow":"删除行","table.columnLeft":"左侧列","table.columnRight":"右侧列","table.deleteColumn":"删除列","table.header":"标题行","table.removeHeader":"取消标题行","table.cellFill":"单元格底色","table.cellBorder":"边框","table.cellBorderLabel":"单元格边框颜色","canvas.selected":"已选择","shortcuts.title":"键盘快捷键","shortcuts.note":"焦点在输入框或文本编辑中时,导航键保留给文本输入。","shortcuts.close":"关闭快捷键","shortcuts.closeHelp":"关闭快捷键说明","shortcuts.playGroup":"播放与演示","shortcuts.playFromStart":"从第一页开始播放","shortcuts.playFromCurrent":"从当前页开始播放","shortcuts.openPresenter":"打开演讲者窗口","shortcuts.toggleFullscreen":"切换全屏","shortcuts.nextSlide":"下一页","shortcuts.previousSlide":"上一页","shortcuts.firstLast":"第一页 / 最后一页","shortcuts.exitPlay":"退出播放或取消选择","shortcuts.editGroup":"编辑","shortcuts.undo":"撤销","shortcuts.redo":"重做","shortcuts.duplicateSelection":"复制选中对象","shortcuts.selectAll":"全选","shortcuts.deleteSelection":"删除选中对象","shortcuts.copyPaste":"复制 / 粘贴","shortcuts.groupUngroup":"编组 / 取消编组","shortcuts.editText":"编辑选中文本","shortcuts.bold":"加粗","shortcuts.italic":"斜体","shortcuts.underline":"下划线","shortcuts.nudge":"微调 1px / 10px","shortcuts.arrowKeys":"方向键 / Shift+方向键","shortcuts.viewGroup":"视图与文件","shortcuts.zoom":"放大 / 缩小","shortcuts.fit":"适应窗口","shortcuts.save":"立即保存","shortcuts.help":"打开此帮助","sorter.title":"排序视图","sorter.hint":"拖动幻灯片以重新排序","sorter.current":"✓ 当前","sorter.copy":"复制","sorter.copyLabel":"复制第 {index} 页","sorter.delete":"删除","sorter.deleteLabel":"删除第 {index} 页","sorter.page":"第 {index} 页","sorter.pageTitle":"第 {index} 页:{title}","rail.untitled":"未命名幻灯片","rail.current":"当前幻灯片","rail.preview":"幻灯片预览","rail.thumbnail":"幻灯片缩略图","rail.pageTitle":"第 {index} 页:{title}","play.label":"播放模式","play.presenter":"演讲者","play.openPresenter":"打开演讲者视图(P)","play.start":"播放幻灯片","play.fitGroup":"画面缩放","play.fit":"适应","play.fill":"填满","play.instructions":"使用方向键、Space 或 PageDown 换页;Escape 退出播放;P 打开演讲者窗口。","presenter.waiting":"等待主窗口…","presenter.connected":"已连接","presenter.disconnected":"已断开","presenter.title":"演讲者视图","presenter.page":"第 {index} / {total} 页","presenter.previous":"上一页","presenter.next":"下一页","presenter.lastSlide":"(最后一页)","presenter.notes":"备注","presenter.currentNotes":"当前备注","presenter.noNotes":"此页没有备注。","presenter.disconnectedHelp":"未连接到主窗口。请从编辑器重新打开演讲者视图。","app.invalidData":"数据无效","app.deselected":"已取消选择","app.fullscreenUnsupported":"此浏览器或环境不支持全屏。按 F11 可手动全屏;Escape 返回编辑器。","app.fullscreenDenied":"浏览器未允许全屏。按 F11 可手动全屏;Escape 返回编辑器。","app.fullscreenExitedHint":"已退出全屏。按 F 重新进入,Escape 返回编辑器。","app.presenterBlockedHint":"浏览器阻止了演讲者窗口。请允许此网站打开弹出窗口,再按 P 或「演讲者」重试。","app.replaceImageFailed":"无法更换图片;请重新选择对象后再试。","app.imageUrlPromptDetail":"图片网址(https:// 或 data:image/...)","app.linkPromptDetail":"链接网址(http:、https:、mailto: 或 #片段;留空移除链接)","app.chartNotSelected":"选中的对象不是图表。","app.chartApplyFailed":"无法应用图表数据。","recovery.available":"有未保存的编辑","recovery.found":"发现上次未保存的编辑:{path}","recovery.restore":"恢复","recovery.discard":"放弃","conflict.switched":"主机已切换到另一个文件;只能重新加载。","conflict.external":"文件已被外部修改,本机有尚未保存的更改。","conflict.reload":"重新加载","conflict.overwrite":"覆盖","editor.noSlides":"找不到幻灯片。","editor.newSlideTitle":"新建幻灯片","editor.newTextBox":"新文本框","editor.context.enter":"进入 {name}","editor.context.goTo":"前往 {name}","editor.context.label":"编辑上下文","editor.context.slide":"幻灯片","editor.context.unknown":"未知","editor.pendingEditFailed":"无法应用编辑。","editor.pendingEditInstruction":"请先应用或取消尚未完成的编辑,再覆盖。","editor.reloadFailed":"无法重新加载演示文稿。","editor.notice.pinned":"这个对象原本由容器排版定位,现在改为绝对定位。","editor.notice.undo":"撤销","editor.notice.dismiss":"关闭","editor.hint.not-text":"只有文字元素可以就地编辑。双击容器空白处即可进入容器。","editor.hint.has-children":"这个元素包含子元素。请先进入容器,再编辑其中的文字。","editor.hint.empty":"这个元素还没有文字。请先用「文字」工具添加文字。","editor.hint.locked":"这个对象已锁定。请先解锁,再编辑其内容。","editor.hint.hidden":"这个对象已隐藏。请先显示,再编辑其内容。","editor.hint.group":"编组会作为单个对象编辑。请先取消编组,再编辑其中的组件。","editor.hint.table-cell-move":"这是表格单元格,请选取整个表格再移动。","editor.hint.paste-kind":"这个 SVG 组件只能粘贴到 SVG 内。","standalone.title":"独立编辑模式","standalone.description":"未连接本地 host。打开或拖入一份 HTML 演示文稿即可编辑;支持 File System Access 的浏览器会直接写回原文件,其他浏览器可下载导出的 HTML。","standalone.open":"打开 HTML…","standalone.upload":"或上传 HTML 文件","standalone.fileType":"请选择 HTML 文件。","standalone.commandHint":"PDF/PNG 需要本地 Chromium 与 host,请改用以下命令打开:","a11y.selectedCount":"已选择 {count} 个对象","a11y.selectedTag":"已选择 {tag}","a11y.selectedSummary":"已选择 {tag}:{summary}","a11y.slide":"第 {index} 页,共 {total} 页","a11y.contextLevel":"正在编辑 {name}","a11y.contextSlide":"正在编辑幻灯片","locale.label":"语言","theme.label":"主题","theme.light":"浅色","theme.dark":"深色","theme.system":"跟随系统"},ex="htmlcraft.locale",Jw={en:Nh,"zh-Hant":Zw,"zh-Hans":Fw},Pw=new Set(["en","zh-Hant","zh-Hans"]);function Ww(r){return Pw.has(r)}function eE(r){const a=r.toLowerCase(),i=a.split("-");return i[0]!=="zh"?"en":i.includes("hant")?"zh-Hant":i.includes("hans")?"zh-Hans":a==="zh-tw"||a==="zh-hk"||a==="zh-mo"?"zh-Hant":"zh-Hans"}function tE(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function nE(r){const a=tE();let i=null;if(a)try{i=a.getItem(ex)}catch{i=null}return i&&Ww(i)?i:eE(typeof navigator>"u"?"en":navigator.language)}function Bb(r,a){return Object.prototype.hasOwnProperty.call(r,a)?r[a]:void 0}function lE(r,a){return a?r.replace(/\{(\w+)\}/g,(i,s)=>Object.prototype.hasOwnProperty.call(a,s)?String(a[s]):i):r}const tx=w.createContext(null);function rE({children:r,initialLocale:a}){const[i,s]=w.useState(()=>a??nE()),u=w.useCallback(m=>{s(m);try{typeof localStorage<"u"&&localStorage.setItem(ex,m)}catch{}},[]);w.useEffect(()=>{document.documentElement.lang=i},[i]);const d=w.useCallback((m,y)=>lE(Bb(Jw[i],m)??Bb(Nh,m)??m,y),[i]),h=w.useMemo(()=>({locale:i,setLocale:u,t:d}),[i,u,d]);return g.jsx(tx.Provider,{value:h,children:r})}function ln(){const r=w.useContext(tx);if(!r)throw new Error("useI18n must be used inside LocaleProvider");return r}const aE=["#111827","#ffffff","#dc2626","#ea580c","#ca8a04","#16a34a","#0284c7","#7c3aed","#db2777","#475569"],iE=["#fff59d","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#e9d5ff","#f5d0fe","#e5e7eb"],Ib=[{label:"Arial",value:"Arial"},{label:"Times New Roman",value:"Times New Roman"},{label:"Georgia",value:"Georgia"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"},{label:"Trebuchet MS",value:"Trebuchet MS"},{label:"System UI",value:"system-ui"}],oE=[12,14,16,18,24,32,40,48,64,96],sE=["1","1.15","1.3","1.5","2"],oi="rounded border border-line-strong px-1.5 py-1 text-xs text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",cE="rounded border border-accent/80 bg-accent-soft px-1.5 py-1 text-xs text-accent",Us="absolute left-0 top-full z-20 mt-1 flex max-h-64 w-max flex-wrap gap-1 rounded border border-line-strong bg-raised p-2 shadow-[0_24px_60px_var(--editor-shadow-panel)]";function Sa(r){return r?cE:oi}function qb({state:r,error:a,mode:i="editing",onCommand:s,onLink:u}){var B;const{t:d}=ln(),[h,m]=w.useState(null),y=w.useRef({color:null,highlight:null,font:null,size:null,line:null}),b=D=>{var G;m(null),(G=y.current[D])==null||G.focus()},E=(D,G)=>{D.key==="Escape"&&(D.preventDefault(),D.stopPropagation(),b(G))},v=D=>({ref:G=>{y.current[D]=G},onKeyDown:G=>{h===D&&E(G,D)}}),C=D=>{m(null),s(D)},A=D=>{m(G=>G===D?null:D)};return g.jsxs("div",{"data-testid":"text-toolbar","data-mode":i,role:"toolbar","aria-label":d("text.toolbar"),className:"relative flex flex-wrap items-center gap-1 border-b border-accent/20 bg-accent-soft px-4 py-1.5",onPointerDown:D=>D.preventDefault(),children:[g.jsx("span",{className:"mr-1 text-xs text-accent",children:d(i==="selection"?"text.selection":"text.group")}),g.jsx("button",{type:"button","data-testid":"text-bold",title:d("text.bold"),"aria-label":d("text.bold"),"aria-pressed":r.bold,className:Sa(r.bold),onClick:()=>C({type:"bold"}),children:"B"}),g.jsx("button",{type:"button","data-testid":"text-italic",title:d("text.italic"),"aria-label":d("text.italic"),"aria-pressed":r.italic,className:`${Sa(r.italic)} italic`,onClick:()=>C({type:"italic"}),children:"I"}),g.jsx("button",{type:"button","data-testid":"text-underline",title:d("text.underline"),"aria-label":d("text.underline"),"aria-pressed":r.underline,className:`${Sa(r.underline)} underline`,onClick:()=>C({type:"underline"}),children:"U"}),g.jsx("button",{type:"button","data-testid":"text-strike",title:d("text.strike"),"aria-label":d("text.strike"),"aria-pressed":r.strike,className:`${Sa(r.strike)} line-through`,onClick:()=>C({type:"strike"}),children:"S"}),g.jsx("span",{className:"mx-1 h-4 w-px bg-line"}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"text-color",title:d("text.color"),"aria-label":d("text.color"),className:oi,"aria-expanded":h==="color",...v("color"),onClick:()=>A("color"),children:g.jsx("span",{"data-testid":"text-color-indicator",className:"inline-block h-3 w-3 rounded-sm border border-line-strong align-middle",style:{backgroundColor:r.color||"#111827"}})}),h==="color"&&g.jsx("div",{"data-testid":"text-menu-color",className:Us,onKeyDown:D=>E(D,"color"),children:aE.map(D=>g.jsx("button",{type:"button","data-testid":`text-color-${D.slice(1)}`,"aria-label":d("text.colorSwatch",{color:D}),title:D,className:"h-6 w-6 rounded border border-line-strong",style:{backgroundColor:D},onClick:()=>C({type:"color",value:D})},D))})]}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"text-highlight",title:d("text.highlight"),"aria-label":d("text.highlight"),className:oi,"aria-expanded":h==="highlight",...v("highlight"),onClick:()=>A("highlight"),children:g.jsx("span",{className:"inline-block h-3 w-3 rounded-sm border border-line-strong align-middle",style:{backgroundColor:r.highlight||"#fff59d"}})}),h==="highlight"&&g.jsx("div",{"data-testid":"text-menu-highlight",className:Us,onKeyDown:D=>E(D,"highlight"),children:iE.map(D=>g.jsx("button",{type:"button","data-testid":`text-highlight-${D.slice(1)}`,"aria-label":d("text.highlightSwatch",{color:D}),title:D,className:"h-6 w-6 rounded border border-line-strong",style:{backgroundColor:D},onClick:()=>C({type:"highlight",value:D})},D))})]}),g.jsxs("div",{className:"relative",children:[g.jsxs("button",{type:"button","data-testid":"text-font",title:d("text.font"),"aria-label":d("text.font"),className:oi,"aria-expanded":h==="font",...v("font"),onClick:()=>A("font"),children:[((B=Ib.find(D=>D.value===r.fontFamily))==null?void 0:B.label)??r.fontFamily??d("text.font"),g.jsx("span",{className:"ml-1 text-[10px]",children:"▾"})]}),h==="font"&&g.jsx("div",{"data-testid":"text-menu-font",className:`${Us} flex-col`,onKeyDown:D=>E(D,"font"),children:Ib.map(D=>g.jsx("button",{type:"button","data-testid":`text-font-${D.value.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,className:"rounded px-2 py-1 text-left text-xs text-ink hover:bg-hover",style:{fontFamily:D.value},onClick:()=>C({type:"fontFamily",value:D.value}),children:D.label},D.value))})]}),g.jsxs("div",{className:"relative",children:[g.jsxs("button",{type:"button","data-testid":"text-size",title:d("text.size"),"aria-label":d("text.size"),className:oi,"aria-expanded":h==="size",...v("size"),onClick:()=>A("size"),children:[r.fontSize,g.jsx("span",{className:"ml-1 text-[10px]",children:"▾"})]}),h==="size"&&g.jsx("div",{"data-testid":"text-menu-size",className:Us,onKeyDown:D=>E(D,"size"),children:oE.map(D=>g.jsx("button",{type:"button","data-testid":`text-size-${D}`,className:"rounded px-2 py-1 text-xs text-ink hover:bg-hover",onClick:()=>C({type:"fontSize",value:`${D}px`}),children:D},D))})]}),g.jsx("span",{className:"mx-1 h-4 w-px bg-line"}),["left","center","right","justify"].map(D=>g.jsx("button",{type:"button","data-testid":`text-align-${D}`,title:`${d("text.align")} ${D}`,"aria-label":`${d("text.align")} ${D}`,"aria-pressed":r.align===D,className:Sa(r.align===D),onClick:()=>C({type:"align",value:D}),children:D==="left"?"⇤":D==="center"?"↔":D==="right"?"⇥":"☰"},D)),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"text-line-height",title:d("text.lineHeight"),"aria-label":d("text.lineHeight"),className:oi,"aria-expanded":h==="line",...v("line"),onClick:()=>A("line"),children:d("text.lineHeight")}),h==="line"&&g.jsx("div",{"data-testid":"text-menu-line",className:Us,onKeyDown:D=>E(D,"line"),children:sE.map(D=>g.jsx("button",{type:"button","data-testid":`text-line-${D.replace(".","-")}`,className:"rounded px-2 py-1 text-xs text-ink hover:bg-hover",onClick:()=>C({type:"lineHeight",value:D}),children:D},D))})]}),g.jsx("span",{className:"mx-1 h-4 w-px bg-line"}),g.jsx("button",{type:"button","data-testid":"text-ul",title:d("text.bulletLabel"),"aria-label":d("text.bulletLabel"),"aria-pressed":r.list==="ul",className:Sa(r.list==="ul"),onClick:()=>C({type:"list",value:"ul"}),children:d("text.bullet")}),g.jsx("button",{type:"button","data-testid":"text-ol",title:d("text.orderedLabel"),"aria-label":d("text.orderedLabel"),"aria-pressed":r.list==="ol",className:Sa(r.list==="ol"),onClick:()=>C({type:"list",value:"ol"}),children:d("text.ordered")}),g.jsx("button",{type:"button","data-testid":"text-link",title:d("text.link"),"aria-label":d("text.link"),className:Sa(r.link!==null),onClick:u,children:d("text.link")}),g.jsx("button",{type:"button","data-testid":"text-clear",title:d("text.clear"),"aria-label":d("text.clear"),className:oi,onClick:()=>C({type:"clear"}),children:d("text.clear")}),a&&g.jsx("span",{"data-testid":"text-error",role:"alert",className:"ml-2 text-xs text-danger",children:a})]})}const ii="rounded border border-line-strong px-2 py-1 text-xs text-muted transition-colors hover:bg-hover hover:text-ink disabled:cursor-not-allowed disabled:opacity-40",Gb="flex items-center gap-1 text-[11px] text-muted";function So(r,a){return/^#[0-9a-f]{6}$/i.test(r)?r:a}function uE({state:r,disabled:a=!1,onAction:i,onCellStyle:s}){const{t:u}=ln(),[d,h]=w.useState(So(r.fill,"#ffffff")),[m,y]=w.useState(So(r.border,"#b9b2a3"));return w.useEffect(()=>{h(So(r.fill,"#ffffff")),y(So(r.border,"#b9b2a3"))},[r.fill,r.border,r.row,r.column]),g.jsxs("div",{"data-testid":"table-toolbar",role:"toolbar","aria-label":u("table.tools"),className:"flex flex-nowrap items-center gap-1 overflow-x-auto whitespace-nowrap [scrollbar-width:thin] border-b border-line bg-surface px-3 py-2 [&>*]:shrink-0",children:[g.jsx("span",{className:"mr-1 font-mono text-[11px] text-muted",children:u("table.position",{row:r.row+1,rows:r.rows,column:r.column+1,columns:r.columns})}),g.jsx("button",{type:"button","data-testid":"table-row-above",className:ii,disabled:a,onClick:()=>i({type:"row",position:"above"}),children:u("table.rowAbove")}),g.jsx("button",{type:"button","data-testid":"table-row-below",className:ii,disabled:a,onClick:()=>i({type:"row",position:"below"}),children:u("table.rowBelow")}),g.jsx("button",{type:"button","data-testid":"table-row-delete",className:ii,disabled:a||r.rows<=1,onClick:()=>i({type:"delete-row"}),children:u("table.deleteRow")}),g.jsx("button",{type:"button","data-testid":"table-col-left",className:ii,disabled:a,onClick:()=>i({type:"column",position:"left"}),children:u("table.columnLeft")}),g.jsx("button",{type:"button","data-testid":"table-col-right",className:ii,disabled:a,onClick:()=>i({type:"column",position:"right"}),children:u("table.columnRight")}),g.jsx("button",{type:"button","data-testid":"table-col-delete",className:ii,disabled:a||r.columns<=1,onClick:()=>i({type:"delete-column"}),children:u("table.deleteColumn")}),g.jsx("button",{type:"button","data-testid":"table-header-toggle",className:ii,disabled:a,"aria-pressed":r.header,onClick:()=>i({type:"toggle-header"}),children:r.header?u("table.removeHeader"):u("table.header")}),g.jsxs("label",{className:Gb,children:[u("table.cellFill"),g.jsx("input",{type:"color","data-testid":"table-cell-fill","aria-label":u("table.cellFill"),value:d,disabled:a,onChange:b=>h(b.target.value),onBlur:()=>{d!==So(r.fill,"#ffffff")&&s({background:d})},className:"h-6 w-8 cursor-pointer rounded border border-line-strong bg-transparent"})]}),g.jsxs("label",{className:Gb,children:[u("table.cellBorder"),g.jsx("input",{type:"color","data-testid":"table-cell-border","aria-label":u("table.cellBorderLabel"),value:m,disabled:a,onChange:b=>y(b.target.value),onBlur:()=>{m!==So(r.border,"#b9b2a3")&&s({"border-color":m})},className:"h-6 w-8 cursor-pointer rounded border border-line-strong bg-transparent"})]})]})}const dE=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","summary",'[tabindex]:not([tabindex="-1"])'].join(",");function Yb(r){return Array.from(r.querySelectorAll(dE)).filter(a=>a.getAttribute("aria-hidden")!=="true")}function fE(r,a,i){return a<=0?-1:i?r<=0?a-1:r-1:r>=a-1?0:r+1}function nx({label:r,onClose:a,testId:i,initialFocus:s,panelClassName:u="",children:d}){const h=w.useRef(null),m=w.useRef(null),y=w.useRef(null);w.useEffect(()=>{y.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const E=m.current,v=E?(s?E.querySelector(s):null)??Yb(E)[0]:null;return v==null||v.focus(),()=>{const C=y.current;y.current=null,C!=null&&C.isConnected&&C.focus()}},[s]),w.useEffect(()=>{const E=v=>{var se,Y,R;if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),a();return}if(v.key!=="Tab")return;const C=m.current;if(!C)return;const A=Yb(C);if(A.length===0){v.preventDefault();return}const B=document.activeElement;if(!(B instanceof HTMLElement)||!C.contains(B)){v.preventDefault(),(se=v.shiftKey?A[A.length-1]:A[0])==null||se.focus();return}const D=A.indexOf(B);if(D===-1){v.preventDefault(),(Y=A[0])==null||Y.focus();return}const G=A.length-1;(!v.shiftKey&&D===G||v.shiftKey&&D===0)&&(v.preventDefault(),(R=A[fE(D,A.length,v.shiftKey)])==null||R.focus())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[a]);const b=E=>{var v;E.target===E.currentTarget&&(E.preventDefault(),(v=m.current)==null||v.focus())};return g.jsx("div",{ref:h,"data-testid":i,role:"dialog","aria-modal":"true","aria-label":r,className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay p-6",onPointerDown:b,children:g.jsx("div",{ref:m,tabIndex:-1,className:`flex max-h-full flex-col gap-3 rounded-lg border border-line-strong bg-surface p-4 shadow-[0_24px_60px_var(--editor-shadow-panel)] outline-none ${u}`,children:d})})}function pE({json:r,error:a,onChange:i,onApply:s,onCancel:u}){const{t:d}=ln(),h=m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),s())};return g.jsx(nx,{label:d("inspector.chartDialog"),testId:"chart-dialog",onClose:u,initialFocus:'[data-testid="chart-json"]',panelClassName:"w-[640px]",children:g.jsxs("div",{className:"flex flex-col gap-3",onKeyDown:h,children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-sm font-semibold text-ink",children:d("inspector.chartDialog")}),g.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted",children:[g.jsx("code",{className:"rounded bg-chip px-1 py-0.5",children:"type (bar/line/pie) · labels · series"})," ",d("inspector.chartHint")]})]}),g.jsx("textarea",{"data-testid":"chart-json","aria-label":d("inspector.chartJson"),value:r,rows:18,spellCheck:!1,onChange:m=>i(m.target.value),className:"w-full resize-y rounded border border-line-strong bg-input px-3 py-2 font-mono text-xs leading-relaxed text-ink outline-none focus:border-accent/70"}),a&&g.jsx("p",{"data-testid":"chart-error",role:"alert",className:"text-[11px] text-danger",children:a}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx("button",{type:"button","data-testid":"chart-cancel",onClick:u,className:"rounded border border-line-strong px-3 py-1.5 text-xs text-muted transition-colors hover:bg-hover hover:text-ink",children:d("common.cancel")}),g.jsx("button",{type:"button","data-testid":"chart-apply",onClick:s,className:"rounded border border-accent/70 bg-accent-soft px-3 py-1.5 text-xs text-accent transition-colors hover:bg-accent/20",children:d("common.apply")})]})]})})}const hE=[{title:"shortcuts.playGroup",rows:[{keys:"F5",description:"shortcuts.playFromStart"},{keys:"Shift+F5",description:"shortcuts.playFromCurrent"},{keys:"P",description:"shortcuts.openPresenter"},{keys:"F",description:"shortcuts.toggleFullscreen"},{keys:"→ / Space / PageDown",description:"shortcuts.nextSlide"},{keys:"← / PageUp",description:"shortcuts.previousSlide"},{keys:"Home / End",description:"shortcuts.firstLast"},{keys:"Escape",description:"shortcuts.exitPlay"}]},{title:"shortcuts.editGroup",rows:[{keys:"Ctrl+Z",description:"shortcuts.undo"},{keys:"Ctrl+Y / Ctrl+Shift+Z",description:"shortcuts.redo"},{keys:"Ctrl+D",description:"shortcuts.duplicateSelection"},{keys:"Ctrl+A",description:"shortcuts.selectAll"},{keys:"Delete / Backspace",description:"shortcuts.deleteSelection"},{keys:"Ctrl+C / Ctrl+V",description:"shortcuts.copyPaste"},{keys:"Ctrl+G / Ctrl+Shift+G",description:"shortcuts.groupUngroup"},{keys:"Enter",description:"shortcuts.editText"},{keys:"Ctrl+B",description:"shortcuts.bold"},{keys:"Ctrl+I",description:"shortcuts.italic"},{keys:"Ctrl+U",description:"shortcuts.underline"},{keys:"",keysMessage:"shortcuts.arrowKeys",description:"shortcuts.nudge"}]},{title:"shortcuts.viewGroup",rows:[{keys:"Ctrl+= / Ctrl+-",description:"shortcuts.zoom"},{keys:"Ctrl+0",description:"shortcuts.fit"},{keys:"Ctrl+S",description:"shortcuts.save"},{keys:"?",description:"shortcuts.help"}]}];function mE({onClose:r}){const{t:a}=ln();return g.jsxs(nx,{label:a("shortcuts.title"),testId:"shortcuts-dialog",onClose:r,panelClassName:"w-[560px]",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-sm font-semibold text-ink",children:a("shortcuts.title")}),g.jsx("p",{className:"mt-1 text-[11px] text-muted",children:a("shortcuts.note")})]}),g.jsx("button",{type:"button","data-testid":"shortcuts-dialog-close","aria-label":a("shortcuts.close"),onClick:r,className:"rounded border border-line-strong px-2 py-1 text-xs text-ink transition-colors hover:bg-hover",children:a("common.close")})]}),g.jsx("div",{className:"max-h-[60vh] overflow-y-auto pr-1",children:hE.map(i=>g.jsxs("section",{className:"mb-3 last:mb-0",children:[g.jsx("h3",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[0.14em] text-muted",children:a(i.title)}),g.jsx("dl",{className:"flex flex-col gap-1",children:i.rows.map(s=>g.jsxs("div",{className:"flex items-baseline justify-between gap-4 text-xs",children:[g.jsx("dt",{children:g.jsx("kbd",{className:"rounded border border-line-strong bg-chip px-1.5 py-0.5 font-mono text-[11px] text-ink",children:s.keysMessage?a(s.keysMessage):s.keys})}),g.jsx("dd",{className:"text-right text-muted",children:a(s.description)})]},s.keys||s.description))})]},i.title))}),g.jsx("div",{className:"flex justify-end",children:g.jsx("button",{type:"button","data-testid":"shortcuts-dialog-done","aria-label":a("shortcuts.closeHelp"),onClick:r,className:"rounded border border-accent/70 bg-accent-soft px-3 py-1.5 text-xs text-accent transition-colors hover:bg-accent/20",children:a("common.close")})})]})}const Ho="http://www.w3.org/2000/svg",gE=new Set(["SCRIPT","STYLE","TEMPLATE","LINK","META"]),yE=new Set(["DEFS","TITLE","DESC","METADATA","SYMBOL","CLIPPATH","MASK","PATTERN","MARKER","LINEARGRADIENT","RADIALGRADIENT","FILTER","TSPAN","TEXTPATH"]),bE=new Set(["H1","H2","H3","P","LI","SPAN","TD","TH","BLOCKQUOTE","FIGCAPTION"]);function ac(r){return!(gE.has(r.tagName.toUpperCase())||r.closest("[data-ppt-notes]")||r.namespaceURI===Ho&&yE.has(r.tagName.toUpperCase()))}function vE(r){return Array.from(r.children).some(ac)}function Ah(r){var a;return r.hasAttribute("data-ppt-group")||r.getAttribute("data-ppt-locked")==="true"||((a=r.style)==null?void 0:a.display)==="none"}function xE(r){const a=r.closest("[data-slide-id], .slide, .page, .slide-page");for(let i=r.parentElement;i&&i!==a;i=i.parentElement)if(Ah(i))return!0;return!1}function Aa(r){if(Ah(r)||xE(r)||!vE(r))return!1;const a=r.tagName.toUpperCase();return bE.has(a)?!1:a==="DIV"?!Array.from(r.children).every(i=>i.tagName==="BR"):!0}function ur(r){return Array.from(r.children).filter(ac)}function je(r,a){let i=r;for(const s of a){if(!i)return null;i=i.children[s]??null}return i}function SE(r){if(!r)return null;const a=r;return a.nodeType===1?a:null}function Vb(r){var i;const a=(i=r.getAttribute("data-ppt-el"))==null?void 0:i.trim();return a||null}function wE(r,a){let i=r,s=i.parentElement;for(;s&&s!==a;)i=s,s=i.parentElement;return s===a?i:null}function EE(r,a,i){const s=je(r,i);if(!s||!s.contains(a)||a===s||!ac(a)||!Aa(a))return null;const u=Oh(a,s);return u?[...i,...u]:null}function lx(r){var i;const a=(i=r.getAttribute("class"))==null?void 0:i.trim().split(/\s+/)[0];return a?`.${a}`:r.tagName.toLowerCase()}function Oh(r,a){const i=[];let s=r;for(;s!==a;){const u=s.parentElement;if(!u)return null;i.unshift(Array.from(u.children).indexOf(s)),s=u}return i}function Kb(r,a,i={}){const s=SE(r);if(!s||s===a||!a.contains(s))return null;const u=i.slideIndex??0,d=i.containerPath??[],h=je(a,d);if(!h||!h.contains(s)||s===h)return null;const m=wE(s,h);if(!m||!ac(m))return null;const y=Array.from(h.children).indexOf(m);if(y===-1)return null;if(i.altKey){const b=Oh(s,h);return b?{slideIndex:u,path:[...d,...b],elementId:Vb(s)}:null}return{slideIndex:u,path:[...d,y],elementId:Vb(m)}}const Xb=40;function TE(r){return(r.textContent??"").replace(/\s+/g," ").trim()}function $b(r,a,i){if(a<=0||!r)return i("app.deselected");if(a>1)return i("a11y.selectedCount",{count:a});const s=r.tagName.toLowerCase(),u=TE(r);if(!u)return i("a11y.selectedTag",{tag:s});const d=u.length>Xb?`${u.slice(0,Xb-1)}…`:u;return i("a11y.selectedSummary",{tag:s,summary:d})}function CE(r,a,i){return i("a11y.slide",{index:r+1,total:a})}function NE(r,a){return r?a("a11y.contextLevel",{name:lx(r)}):a("a11y.contextSlide")}const AE="http://www.w3.org/1999/xhtml",Qb="http://www.w3.org/2000/svg";function OE(r){var s;const a=r.style;if(!a||typeof a!="object")return null;const i=r.tagName.toLowerCase();if(r.namespaceURI===Qb){const u=((s=r.parentElement)==null?void 0:s.namespaceURI)===Qb;return i==="svg"&&!u?"shape":null}return r.namespaceURI===AE?i==="img"?"image":"shape":null}class rx extends Error{constructor(i){super(`Failed to load deck (${i})`);_r(this,"status");this.name="DeckAuthError",this.status=i}}async function Jp(){const r=await fetch("/api/deck");if(!r.ok)throw new rx(r.status);return await r.json()}class Pp extends Error{constructor(i,s){super("Deck was modified outside the editor");_r(this,"revision");_r(this,"filePath");this.name="DeckConflictError",this.revision=i,this.filePath=s}}function DE(r,a){if(a!==null&&typeof a=="object"){const i=a;if(i.error==="conflict")return new Pp(typeof i.revision=="string"?i.revision:"",typeof i.filePath=="string"&&i.filePath?i.filePath:void 0)}return r===409?new Pp(""):null}async function Dh(r){const a=await r.text();try{return{detail:a,payload:JSON.parse(a)}}catch{return{detail:a,payload:null}}}async function ax(r,a,i={}){const s=await fetch("/api/deck",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({html:r,baseRevision:a,...i.force?{force:!0}:{}})});if(!s.ok){const{detail:u,payload:d}=await Dh(s),h=DE(s.status,d);throw h||new Error(`Save failed (${s.status}): ${u}`)}return await s.json()}class ix extends Error{constructor(i,s,u,d){super(u);_r(this,"status");_r(this,"code");_r(this,"url");this.name="DeckOpenError",this.status=i,this.code=s,this.url=d}}async function RE(r){const a=await fetch("/api/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:r})});if(!a.ok){const{payload:i}=await Dh(a),s=i!==null&&typeof i=="object"?i:{};throw new ix(a.status,typeof s.error=="string"?s.error:"open-failed",typeof s.message=="string"?s.message:"",typeof s.url=="string"?s.url:void 0)}return await a.json()}function ox(r,a){fetch("/api/deck",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({html:r,baseRevision:a}),keepalive:!0}).catch(()=>{})}function jE(){return{load:()=>Jp(),save:(r,a,i)=>ax(r,a,i),flush:(r,a)=>ox(r,a)}}async function ME(r,a){const i=await fetch("/api/export",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({format:r})});if(!i.ok){const{detail:u,payload:d}=await Dh(i),h=d!==null&&typeof d=="object"&&typeof d.message=="string"?d.message:u||`Export failed (${i.status})`;throw new Error(h)}const s=await i.json();if(!Array.isArray(s.files))throw new Error("Export response did not list files.");return s.files.filter(u=>typeof u=="string")}function zE(){return"/api/events"}function _E(r){return r==="editor"||r==="external"||r==="mcp"?r:void 0}function kE(r,a){let i;try{i=JSON.parse(a)}catch{return null}if(i===null||typeof i!="object")return null;const s=i;return typeof s.revision!="string"||!s.revision?null:{type:r,revision:s.revision,...r==="revision"?{source:_E(s.source)}:{},...typeof s.filePath=="string"&&s.filePath?{filePath:s.filePath}:{}}}function HE(r){const a=new EventSource(zE()),i=s=>u=>{const h=kE(s,String(u.data));h&&r(h)};return a.addEventListener("hello",i("hello")),a.addEventListener("revision",i("revision")),a}const LE=[{description:"HTML deck",accept:{"text/html":[".html",".htm"]}}],UE=300;async function sx(){const r=window.showOpenFilePicker;if(typeof r=="function")try{const[a]=await r({multiple:!1,types:LE});return a?{file:await a.getFile(),handle:a}:null}catch(a){if(a.name==="AbortError")return null;throw a}return new Promise(a=>{const i=document.createElement("input");i.type="file",i.accept=".html,.htm,text/html",i.style.display="none",i.dataset.testid="file-picker-input";let s=!1,u;const d=v=>{s||(s=!0,u!==void 0&&(clearTimeout(u),u=void 0),window.removeEventListener("focus",b),document.removeEventListener("visibilitychange",E),i.removeEventListener("change",h),i.removeEventListener("cancel",m),i.remove(),a(v))},h=()=>{var C;const v=((C=i.files)==null?void 0:C[0])??null;d(v?{file:v,handle:null}:null)},m=()=>d(null),y=()=>{s||u!==void 0||(u=setTimeout(()=>{var v;u=void 0,!s&&!((v=i.files)!=null&&v.length)&&d(null)},UE))},b=()=>y(),E=()=>{document.visibilityState==="visible"&&y()};i.addEventListener("change",h),i.addEventListener("cancel",m),window.addEventListener("focus",b),document.addEventListener("visibilitychange",E),document.body.append(i),i.click()})}const BE="htmlppt-editor",IE=1,dr="drafts";let Iu=null;function rd(){return typeof indexedDB>"u"?Promise.resolve(null):Iu||(Iu=new Promise(r=>{let a;try{a=indexedDB.open(BE,IE)}catch{r(null);return}a.onupgradeneeded=()=>{const i=a.result;i.objectStoreNames.contains(dr)||i.createObjectStore(dr,{keyPath:"key"})},a.onsuccess=()=>r(a.result),a.onerror=()=>r(null),a.onblocked=()=>r(null)}),Iu)}function cx(r){return new Promise(a=>{r.onsuccess=()=>a(r.result),r.onerror=()=>a(null)})}function ux(r){return new Promise(a=>{r.oncomplete=()=>a(!0),r.onerror=()=>a(!1),r.onabort=()=>a(!1)})}function Oo(r){return r.trim().replace(/\\/g,"/")}function qE(r,a){return!!(r&&r.html&&r.html!==a)}async function GE(r){const a=await rd();if(!a)return null;try{const i=a.transaction(dr,"readonly");return await cx(i.objectStore(dr).get(r))??null}catch{return null}}async function YE(){const r=await rd();if(!r)return[];try{const a=r.transaction(dr,"readonly");return(await cx(a.objectStore(dr).getAll())??[]).sort((s,u)=>u.savedAt-s.savedAt)}catch{return[]}}async function dx(r){const a=await rd();if(!a)return!1;try{const i=a.transaction(dr,"readwrite");return i.objectStore(dr).put(r),await ux(i)}catch{return!1}}async function Bs(r){const a=await rd();if(!a)return!1;try{const i=a.transaction(dr,"readwrite");return i.objectStore(dr).delete(r),await ux(i)}catch{return!1}}const VE={en:"en-US","zh-Hant":"zh-TW","zh-Hans":"zh-CN"};function KE(r,a,i){try{return new Intl.DateTimeFormat(VE[a],{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23",...i?{timeZone:i}:{}}).format(r)}catch{return""}}function XE(r){let a=2166136261,i=16777619;for(let s=0;s<r.length;s+=1){const u=r.charCodeAt(s);a=Math.imul(a^u,16777619)>>>0,i=Math.imul(i^u,2246822507)>>>0}return`${a.toString(16).padStart(8,"0")}${i.toString(16).padStart(8,"0")}`}async function Wp(r){var s;const a=(s=globalThis.crypto)==null?void 0:s.subtle;if(!a)return XE(r);const i=await a.digest("SHA-256",new TextEncoder().encode(r));return Array.from(new Uint8Array(i)).map(u=>u.toString(16).padStart(2,"0")).join("")}function $E(r){const a=async i=>{const s=r();if(!s)throw new Error("No deck is open.");if(s.handle){const u=await s.handle.createWritable();try{await u.write(i)}finally{await u.close()}}else await dx({key:Oo(s.name),filePath:s.name,html:i,savedAt:Date.now()});return{revision:await Wp(i)}};return{load:async()=>{throw new Error("Open an HTML file before using standalone mode.")},save:i=>a(i),flush:i=>{a(i).catch(()=>{})}}}function fx(r,a=".export.html"){return`${(r.replace(/\\/g,"/").split("/").pop()??"deck.html").replace(/\.html?$/i,"")||"deck"}${a}`}function Zb(r,a,i=".export.html"){const s=new Blob([r],{type:"text/html;charset=utf-8"}),u=URL.createObjectURL(s),d=document.createElement("a");d.href=u,d.download=fx(a,i),d.rel="noopener",document.body.appendChild(d),d.click(),d.remove(),setTimeout(()=>URL.revokeObjectURL(u),0)}const qp="rounded border border-line-strong px-3 py-2 text-sm text-ink transition-colors hover:border-accent/70 hover:bg-hover disabled:opacity-40";function QE({drafts:r,error:a,busy:i,onOpenFile:s,onError:u,onRestore:d,onDiscard:h}){const{t:m,locale:y}=ln(),[b,E]=w.useState(!1),v=async()=>{try{const A=await sx();if(!A)return;s(A.file,A.handle)}catch(A){u(A instanceof Error?A.message:String(A))}},C=A=>{var D;A.preventDefault(),E(!1);const B=(D=A.dataTransfer.files)==null?void 0:D[0];B&&s(B,null)};return g.jsx("div",{className:"flex h-screen items-center justify-center bg-canvas p-8 text-ink",children:g.jsxs("section",{"aria-labelledby":"standalone-title",className:"w-full max-w-xl rounded border border-line-strong bg-surface p-8 shadow-[0_24px_60px_var(--editor-shadow-panel)]",children:[g.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-accent",children:"htmlcraft"}),g.jsx("h1",{id:"standalone-title",className:"mt-2 text-xl font-semibold",children:m("standalone.title")}),g.jsx("p",{className:"mt-2 text-sm text-muted",children:m("standalone.description")}),g.jsxs("div",{"data-testid":"standalone-drop",onDragOver:A=>{A.preventDefault(),E(!0)},onDragLeave:()=>E(!1),onDrop:C,className:`mt-6 flex flex-col items-center gap-3 rounded border-2 border-dashed p-8 transition-colors ${b?"border-accent/70 bg-accent-soft":"border-line-strong"}`,children:[g.jsx("button",{type:"button","data-testid":"standalone-open",className:qp,disabled:i,onClick:()=>void v(),children:m("standalone.open")}),g.jsxs("label",{className:"cursor-pointer text-xs text-muted underline-offset-2 hover:text-ink hover:underline",children:[m("standalone.upload"),g.jsx("input",{"data-testid":"standalone-file",type:"file",accept:".html,.htm,text/html",className:"hidden",disabled:i,onChange:A=>{var D;const B=(D=A.target.files)==null?void 0:D[0];A.target.value="",B&&s(B,null)}})]})]}),a&&g.jsx("p",{"data-testid":"standalone-error",role:"alert",className:"mt-4 rounded border border-danger bg-danger-soft px-3 py-2 text-xs text-danger",children:a}),r.length>0&&g.jsxs("div",{className:"mt-6",children:[g.jsx("h2",{className:"text-sm font-medium text-ink",children:m("recovery.available")}),g.jsx("ul",{className:"mt-2 space-y-2",children:r.map(A=>g.jsxs("li",{"data-testid":"recovery-draft",className:"flex flex-wrap items-center gap-3 rounded border border-warning bg-warning-soft px-3 py-2 text-xs text-warning",children:[g.jsx("span",{className:"min-w-0 flex-1 truncate",children:A.filePath}),g.jsx("span",{"data-testid":"recovery-time",className:"text-warning",children:KE(A.savedAt,y)}),g.jsx("button",{type:"button","data-testid":"recovery-restore",className:qp,disabled:i,onClick:()=>d(A),children:m("recovery.restore")}),g.jsx("button",{type:"button","data-testid":"recovery-discard",className:qp,disabled:i,onClick:()=>h(A),children:m("recovery.discard")})]},A.key))})]}),g.jsxs("p",{className:"mt-6 text-xs text-muted",children:[m("standalone.commandHint")," ",g.jsx("code",{className:"rounded bg-chip px-1 py-0.5",children:"htmlcraft open deck.html"})]})]})})}const ZE="data-ppt-locked",px="data-ppt-group";function cn(r){return(r==null?void 0:r.getAttribute(ZE))==="true"}function _n(r){return(r==null?void 0:r.hasAttribute(px))===!0}function un(r){var a;return((a=r==null?void 0:r.style)==null?void 0:a.display)==="none"}function El(r,a){for(let i=1;i<a.length;i+=1){const s=je(r,a.slice(0,i));if(!s)return null;if(cn(s)||un(s)||_n(s))return s}return null}function Xu(r,a){const i=je(r,a);return i?cn(i)||un(i)||_n(i)?i:El(r,a):null}function FE(r){return r.type==="group"||r.type==="align"||r.type==="distribute"}function Fb(r){return r.type==="group"||r.type==="align"?2:r.type==="distribute"?3:1}function JE(r,a){var i;return{slideIndex:a,path:[],elementId:((i=r.getAttribute("data-ppt-el"))==null?void 0:i.trim())||null}}function PE(r){var i;const a=(i=r.getAttribute("data-ppt-el"))==null?void 0:i.trim();return a?{elementId:a}:{path:[]}}function WE(r,a,i){const s=Ht(r)[a];if(!s)return[];const u=ur(s.element);return i.flatMap(d=>{var b;const h=(b=d.getAttribute("data-ppt-el"))==null?void 0:b.trim(),m=h?u.find(E=>{var v;return((v=E.getAttribute("data-ppt-el"))==null?void 0:v.trim())===h}):d;if(!m)return[];const y=Array.from(s.element.children).indexOf(m);return y<0?[]:[{...JE(m,a),path:[y]}]})}function eT(r,a,i){const s=Ht(r)[a];if(!s)throw new Error("The active slide is missing from the deck.");const u=i.elementId?ur(s.element).find(d=>{var h;return((h=d.getAttribute("data-ppt-el"))==null?void 0:h.trim())===i.elementId})??null:je(s.element,i.path);if(!u||u.parentElement!==s.element)throw new Error("Select top-level slide objects before running this action.");if(!ur(s.element).includes(u))throw new Error("Notes, scripts and styles are not editable objects.");return u}function Jb(r){if(cn(r))throw new Error("Unlock the selected object before changing it.")}function Pb(r){if(un(r))throw new Error("Show the selected object before changing it.")}function tT(r,a,i){if(a.target.path.join(".")!==i.path.join("."))throw new Error("Object measurements do not match the current selection.");if(a.offset.x!==0||a.offset.y!==0)throw new Error("The object is positioned against a transformed wrapper. Pin it to the slide before grouping or aligning.");const s=r.style;s.position="absolute",s.left=`${a.rect.x}px`,s.top=`${a.rect.y}px`,s.width=`${a.rect.width}px`,s.height=`${a.rect.height}px`,s.margin="0",s.boxSizing="border-box",s.removeProperty("right"),s.removeProperty("bottom")}function nT(r,a,i,s,u){const d=Ht(r)[a];if(!d)throw new Error("The active slide is missing from the deck.");if(s.length<Fb(i))throw new Error(`Select at least ${Fb(i)} objects for this action.`);if((i.type==="ungroup"||i.type==="order"||i.type==="lock"||i.type==="hide")&&s.length!==1)throw new Error("Select exactly one object for this action.");const h=new Set,m=s.map(b=>{const E=b.elementId??b.path.join(".");if(h.has(E))throw new Error("Select each object only once.");h.add(E);const v=eT(r,a,b);if(i.type==="ungroup"){if(!_n(v))throw new Error("Select a group to ungroup.");Jb(v),Pb(v)}else i.type==="lock"||i.type==="hide"||(Jb(v),Pb(v));return v});if(i.type==="group"){for(const b of m)if(_n(b)||b.querySelector(`[${px}]`))throw new Error("Select top-level non-group objects; nested groups are not supported.")}if(FE(i)){if(u.length!==s.length)throw new Error("Every selected object must be measured before changing layout.");m.forEach((b,E)=>{tT(b,u[E],s[E])})}const y=m.map(b=>{var E;return((E=b.getAttribute("data-ppt-el"))==null?void 0:E.trim())??""});if(y.some(b=>!b))throw new Error("Objects need stable data-ppt-el IDs before object actions.");return{slide:d,elements:m,ids:y}}function lT(r,a,i,s,u){const{slide:d,elements:h,ids:m}=nT(r,a,i,s,u),y=d.id;switch(i.type){case"group":{const b=jS(r,y,m),E=ur(d.element).find(v=>{var C;return((C=v.getAttribute("data-ppt-el"))==null?void 0:C.trim())===b});if(!E)throw new Error("The group was created without a resolvable ID.");return[E]}case"ungroup":{const b=zS(r,y,PE(h[0])),E=ur(d.element);return b.flatMap(v=>{const C=E.find(A=>{var B;return((B=A.getAttribute("data-ppt-el"))==null?void 0:B.trim())===v});return C?[C]:[]})}case"align":return qS(r,y,m.map(b=>({elementId:b})),i.mode),h;case"distribute":return GS(r,y,m.map(b=>({elementId:b})),i.axis),h;case"order":{const b={elementId:m[0]};return i.direction==="front"?LS(r,y,b):i.direction==="forward"?BS(r,y,b):i.direction==="backward"?IS(r,y,b):US(r,y,b),h}case"lock":for(const b of m)_S(r,y,{elementId:b},i.locked);return h;case"hide":for(const b of m)HS(r,y,{elementId:b},i.hidden);return h}}function Wb(r,a,i,s,u,d){const h=d?vn(r):"",m=lT(r,a,i,s,u);return d&&vn(r)===h?{changed:!1,targets:[]}:{changed:!0,targets:WE(r,a,m)}}function rT(r,a,i,s,u=[]){const d=r.cloneNode(!0);return Wb(d,a,i,s,u,!0).changed?Wb(r,a,i,s,u,!1):{changed:!1,targets:[]}}const eh={"not-text":"editor.hint.not-text","has-children":"editor.hint.has-children",empty:"editor.hint.empty",locked:"editor.hint.locked",hidden:"editor.hint.hidden",group:"editor.hint.group","table-cell":"editor.hint.table-cell-move","paste-kind":"editor.hint.paste-kind"};function hx(r){return r?cn(r)?"locked":un(r)?"hidden":_n(r)?"group":null:null}const Ju="h1, h2, h3, p, li, span, td, th, blockquote, figcaption, div",aT=new Set(["H1","H2","H3","P","LI","SPAN","TD","TH","BLOCKQUOTE","FIGCAPTION","DIV"]);function iT(r){for(let a=r;a;a=a.parentElement){if(cn(a))return"locked";if(un(a))return"hidden";if(_n(a))return"group"}return null}function mx(r){var u;const a=iT(r);if(a)return a;const i=r.closest(Ju);if(!i)return"not-text";const s=i.tagName.toUpperCase();return aT.has(s)?s==="DIV"&&!Array.from(i.children).every(d=>d.tagName.toUpperCase()==="BR")?r===i?"has-children":"not-text":!((u=i.textContent)!=null&&u.trim())&&s!=="DIV"&&s!=="TD"&&s!=="TH"?"empty":null:"not-text"}function oT(r,a){const i=r.filePath!==void 0&&a.filePath!==void 0&&r.filePath!==a.filePath;if(!r.revision||r.revision===a.revision&&!i)return{type:"ignore"};const s=r.filePath?{filePath:r.filePath}:{};return a.dirty?{type:"conflict",revision:r.revision,source:r.source,...s}:{type:"apply",revision:r.revision,source:r.source,...s}}function sT(r){return{applyExternal:r==="reload",force:r==="overwrite",clearConflict:!0}}const cT=800;function uT(r,a){let i=null;const s=()=>{i!==null&&(clearTimeout(i),i=null)};return{schedule(){s(),i=setTimeout(()=>{i=null,a()},r)},cancel:s,flush(){i!==null&&(s(),a())}}}function dT(r,a){const i=[];let s=a;for(;s&&s!==r;){const u=s.parentElement;if(!u)return null;i.unshift(Array.from(u.children).indexOf(s)),s=u}return s===r?i:null}function fT(r,a){for(const i of Array.from(r.querySelectorAll("[data-ppt-el]")))if(i.getAttribute("data-ppt-el")===a)return i;return null}function pT(r,a,i){const s=[];for(const u of r){if(!u.elementId)continue;const d=a[u.slideIndex];if(!d)continue;const h=i.findIndex(E=>E.id===d.id);if(h<0)continue;const m=i[h];if(!m)continue;const y=fT(m.element,u.elementId);if(!y)continue;const b=dT(m.element,y);b&&s.push({slideIndex:h,path:b,elementId:u.elementId})}return s}function hT(r,a,i,s){return{x:(r-i.x)/s,y:(a-i.y)/s}}function th(r,a,i,s){const u=[r,r+a/2,r+a];for(let d=0;d<i.length;d+=1){const h=i[d],m=s[d];u.push(h,h+m/2,h+m)}return u}function qu(r,a,i){let s=null;for(const u of a){const d=u-r;Math.abs(d)>i||(!s||Math.abs(d)<Math.abs(s.delta))&&(s={delta:d,position:u})}return s}function ev(r,a,i,s,u,d,h){const m=[r,r+a/2,r+a],y=th(i,s,u,d);let b=null;for(const E of y)for(const v of m){const C=E-v;Math.abs(C)>h||(!b||Math.abs(C)<Math.abs(b.delta))&&(b={delta:C,position:E})}return b}function mT(r,a,i,s){const u=ev(r.x,r.width,s.x,s.width,a.map(y=>y.x),a.map(y=>y.width),i),d=ev(r.y,r.height,s.y,s.height,a.map(y=>y.y),a.map(y=>y.height),i),h={...r},m=[];return u&&(h.x+=u.delta,m.push({axis:"x",position:u.position})),d&&(h.y+=d.delta,m.push({axis:"y",position:d.position})),{rect:h,guides:m}}function gT(r,a,i,s,u,d){const h=th(u.x,u.width,i.map(G=>G.x),i.map(G=>G.width)),m=th(u.y,u.height,i.map(G=>G.y),i.map(G=>G.height)),y=a.includes("e"),b=a.includes("w"),E=a.includes("n"),v=a.includes("s"),C=y?qu(r.x+r.width,h,s):b?qu(r.x,h,s):null,A=v?qu(r.y+r.height,m,s):E?qu(r.y,m,s):null,B={...r},D=[];return C&&(y?B.width+=C.delta:(B.x+=C.delta,B.width-=C.delta),D.push({axis:"x",position:C.position})),A&&(v?B.height+=A.delta:(B.y+=A.delta,B.height-=A.delta),D.push({axis:"y",position:A.position})),B.width<d||B.height<d?{rect:r,guides:[]}:{rect:B,guides:D}}function yT(r,a,i,s){const u=a.includes("w"),d=a.includes("e"),h=a.includes("n"),m=a.includes("s");let{x:y,y:b,width:E,height:v}=r;return d&&(E=Math.max(s,r.width+i.dx)),u&&(E=Math.max(s,r.width-i.dx),y=r.x+r.width-E),m&&(v=Math.max(s,r.height+i.dy)),h&&(v=Math.max(s,r.height-i.dy),b=r.y+r.height-v),{x:y,y:b,width:E,height:v}}function pi(r){return(r%360+360)%360}function bT(r,a,i,s){const u=Math.max(s.x,s.x+s.width-r.width),d=Math.max(s.y,s.y+s.height-r.height);return{...r,x:Math.min(Math.max(r.x+a,s.x),u),y:Math.min(Math.max(r.y+i,s.y),d)}}const vT=new Set(["SVG","IMG","CANVAS","VIDEO","IFRAME"]);function xT(r){return r.tagName.toUpperCase()==="FIGURE"&&r.hasAttribute("data-ppt-chart")}function ST(r){const a=r.ownerDocument.defaultView,i=a==null?void 0:a.getComputedStyle(r);return{display:(i==null?void 0:i.display)??"block",position:(i==null?void 0:i.position)??"static"}}function wl(r){if(r.namespaceURI!==Ho)return!1;if(r.closest("svg")!==r)return!0;const a=r.parentElement;return!a||a.namespaceURI!==Ho?!1:a.tagName.toLowerCase()!=="foreignobject"}function Xn(r){const a=r.closest("table");return a!==null&&a!==r}function wT(r,a){for(let i=a;i&&i!==r;i=i.parentElement)if(Ah(i))return i;return null}function ET(r,a){let i=null;for(let s=a;s&&s!==r;s=s.parentElement){if(xT(s))return s;!i&&s.namespaceURI===Ho&&s.tagName.toUpperCase()==="SVG"&&(i=s)}return i}function gx(r,a,i={}){if(a===r||!r.contains(a)||!ac(a))return null;const s=wT(r,a);if(s)return s;const u=ET(r,a);if(u)return u;const d=i.getStyle??ST;for(let h=a;h&&h!==r;h=h.parentElement){const m=h.tagName.toUpperCase();if(vT.has(m))return h;const y=d(h);if(y.display!=="inline"&&y.display!=="contents"||y.position==="absolute"||y.position==="fixed")return h}return null}function nh(r,a){return Oh(a,r)}function yx(r){var s;const a=r.tagName.toLowerCase(),i=(s=r.getAttribute("class"))==null?void 0:s.trim().split(/\s+/)[0];return i?`${a}.${i}`:a}function tv(r,a){return r.length<a.length&&r.every((i,s)=>i===a[s])}function TT(r){const a=[];for(const i of r){const s=i.join(".");if(!a.some(u=>u.join(".")===s)){for(let u=a.length-1;u>=0;u-=1){const d=a[u];d&&tv(i,d)&&a.splice(u,1)}a.some(u=>tv(u,i))||a.push([...i])}}return a}const Kn="data-ppt-editing",Pu="data-ppt-frame-slide",Ws="data-ppt-preview-slide";let lh=null;const CT=`
734
+ html, body { margin: 0 !important; padding: 0 !important; overflow: hidden !important; }
735
+ [data-slide-id] { margin: 0 !important; }
736
+ [data-ppt-notes] { display: none !important; }
737
+ `;function Ks(r){return new DOMParser().parseFromString(r,"text/html")}function NT(r){return r.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function bx(r){return Array.from(r.attributes).map(a=>{const i=NT(a.value);return` ${a.name}="${i}"`}).join("")}function AT(r){return`<${r.tagName.toLowerCase()}${bx(r)}>`}function OT(r){return`</${r.tagName.toLowerCase()}>`}function DT(r,a){const i=[];let s=a.parentElement;for(;s&&s!==r.body;)i.unshift(s),s=s.parentElement;return i}function Lo(r,a,i={}){const s=i.markFrame!==!1;let u=null;s&&(u=crypto.randomUUID(),lh=u);const d=`${r.body?bx(r.body):""}${a.element.tagName==="BODY"?` ${Ws}=""`:""}`;let h;if(a.element.tagName==="BODY")h=a.element.innerHTML;else{const m=DT(r,a.element),y=m.map(AT).join(""),b=[...m].reverse().map(OT).join(""),E=a.element.cloneNode(!0);E.setAttribute(Ws,""),u&&E.setAttribute(Pu,u),h=`${y}${E.outerHTML}${b}`}return`<!doctype html><html><head>${r.head.innerHTML}<style data-ppt-editor-base>${CT}</style></head><body${d}>${h}</body></html>`}function vx(r,a){const i=a.body;if(!i)return null;if(r.element.tagName==="BODY")return i;if(!lh)return null;const s=i.querySelector(`[${Pu}="${lh}"]`);return(s==null?void 0:s.tagName)===r.element.tagName?s:null}function si(r,a){return vx(r,a)}function nv(r,a,i){const s=Ht(r)[a];if(!s)throw new Error(`Slide ${a+1} is missing from the deck.`);const u=vx(s,i);if(!u)throw new Error("Slide is missing from the editor frame.");if(u.querySelectorAll(`[${Kn}]`).forEach(d=>{d.removeAttribute("contenteditable"),d.removeAttribute(Kn)}),s.element.tagName==="BODY")s.element.innerHTML=u.innerHTML;else{const d=u.cloneNode(!0);for(const h of Array.from(d.attributes))d.removeAttribute(h.name);for(const h of Array.from(s.element.attributes))d.setAttribute(h.name,h.value);s.element.outerHTML=d.outerHTML}return vn(r)}function RT(r){return r.defaultView}function xx(r,a){var i;return((i=RT(r))==null?void 0:i.getComputedStyle(a))??null}function rh(r,a){var i;return((i=xx(r,a))==null?void 0:i.display)??""}function jT(r){const a=r.style;a&&(a.display==="none"&&a.removeProperty("display"),(a.visibility==="hidden"||a.visibility==="collapse")&&a.removeProperty("visibility"),a.opacity==="0"&&a.removeProperty("opacity"),a.getPropertyValue("content-visibility")==="hidden"&&a.removeProperty("content-visibility"))}function MT(r,a){const i=[],s=u=>{for(const d of Array.from(u)){if("selectorText"in d&&"style"in d){const h=d;try{a.matches(h.selectorText)&&h.style.getPropertyValue("display")==="none"&&(i.push({style:h.style,value:"none",priority:h.style.getPropertyPriority("display")}),h.style.removeProperty("display"))}catch{}}if("cssRules"in d)try{s(d.cssRules)}catch{}}};for(const u of Array.from(r.styleSheets))try{s(u.cssRules)}catch{}return i}function zT(r,a){if(rh(r,a)!=="none")return;const i=MT(r,a),s=rh(r,a);for(const u of i)u.style.setProperty("display",u.value,u.priority);a.style.setProperty("display",s==="none"?"block":s,"important")}function _T(r,a){const i=xx(r,a);if(!i)return;const s=a.style;i.visibility!=="visible"&&s.setProperty("visibility","visible","important"),i.opacity==="0"&&s.setProperty("opacity","1","important"),i.getPropertyValue("content-visibility")==="hidden"&&s.setProperty("content-visibility","visible","important")}function Rh(r){if(!r.body)return null;const a=r.querySelector(`[${Ws}]`)??r.body,i=[];for(let u=a;u;u=u.parentElement)i.push(u);const s=a.hasAttribute("hidden")||rh(r,a)==="none";for(const u of i)u.removeAttribute("hidden"),jT(u);s&&a.classList.add("active");for(const u of i)zT(r,u),_T(r,u);return a}const Sx="htmlcraft.play-fit";function kT(r,a,i){if(!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.width<=0||r.height<=0||!Number.isFinite(a.width)||!Number.isFinite(a.height)||a.width<=0||a.height<=0)return 1;const s=Math.min(a.width/r.width,a.height/r.height),u=Math.max(a.width/r.width,a.height/r.height),d=i==="fill"?u:s;return Number.isFinite(d)&&d>0?d:1}function HT(r){return r==="fill"?"fill":"fit"}function LT(r){if(!r)return"fit";try{return HT(r.getItem(Sx))}catch{return"fit"}}function UT(r,a){if(a)try{a.setItem(Sx,r)}catch{}}function jh(r,a){return!r||!a?r===a:Math.abs(r.left-a.left)<.5&&Math.abs(r.top-a.top)<.5&&Math.abs(r.width-a.width)<.5&&Math.abs(r.height-a.height)<.5}function BT(r,a){if(!r)return null;const i=r.getBoundingClientRect();return!Number.isFinite(i.left)||!Number.isFinite(i.top)||!Number.isFinite(i.width)||!Number.isFinite(i.height)||i.width<=0||i.height<=0||i.left<-1||i.top<-1||i.right>a.width+1||i.bottom>a.height+1?null:{left:i.left,top:i.top,width:i.width,height:i.height}}function Mh(r){var s,u;const a=r.querySelector(`[${Ws}]`)??r.body,i={width:((s=r.documentElement)==null?void 0:s.clientWidth)??0,height:((u=r.documentElement)==null?void 0:u.clientHeight)??0};return BT(a,i)}function IT(r){return{left:0,top:0,width:r.width,height:r.height}}function lv(r,a){return a&&a.id===r.id?a.box:IT(r)}function qT(r,a){return{width:r.width*a,height:r.height*a,translateX:0-r.left*a,translateY:0-r.top*a}}function GT(r,a){const i=r.width>0?a/r.width:1;return{scale:i,height:r.height*i,translateX:0-r.left*i,translateY:0-r.top*i}}function YT(r,a){return r===null||a===null?r===a:r.id===a.id&&jh(r.box,a.box)}function VT(r){return r.tagName!=="DIV"?!0:Array.from(r.children).every(a=>a.tagName==="BR")}function KT(r,a){for(let i=r;i;i=i.parentElement){if(cn(i))return"locked";if(un(i))return"hidden";if(_n(i))return"group";if(i===a)break}return null}function XT(r){const a=[];return r.matches(Ju)&&a.push(r),a.push(...Array.from(r.querySelectorAll(Ju))),a}function $T(r,a){var m;const i=je(r,a),s=je(r,[a[0]??-1]);if(!i||!s)return{status:"blocked",reason:"not-text"};const u=hx(s);if(u)return{status:"blocked",reason:u};let d=null,h=!1;for(const y of XT(i)){if(!VT(y))continue;const b=KT(y,s);if(b){d=b;continue}const E=!((m=y.textContent)!=null&&m.trim());if(E&&y.tagName!=="DIV"&&y.tagName!=="TD"&&y.tagName!=="TH"){h=!0;continue}return{status:"editable",leaf:y,empty:E}}return d?{status:"blocked",reason:d}:h?{status:"blocked",reason:"empty"}:{status:"blocked",reason:mx(i)??"not-text"}}const QT=/^(-?(?:\d+|\d*\.\d+))px$/;function Ca(r){return`${r}px`}function Gu(r){const a=QT.exec(r.trim());return(a==null?void 0:a[1])===void 0?null:Number(a[1])}function Uo(r){return r.style??null}function ZT(r,a){const i=Uo(r);if(!i||i.position!=="absolute"&&i.position!=="fixed")return null;const s=Gu(i.left),u=Gu(i.top),d=Gu(i.width),h=Gu(i.height);if(s===null||u===null||d===null||h===null)return null;const m=a?Bo(r,a):{x:0,y:0};return{x:s+m.x,y:u+m.y,width:d,height:h}}function Bo(r,a){const i=r.offsetParent;if(!i||i===a)return{x:0,y:0};const s=i.getBoundingClientRect(),u=a.getBoundingClientRect();return{x:s.left-u.left,y:s.top-u.top}}function $u(r,a,i){const s=Uo(r);if(!s)return;const u=i?Bo(r,i):{x:0,y:0};s.position="absolute",s.left=Ca(a.x-u.x),s.top=Ca(a.y-u.y),s.width=Ca(a.width),s.height=Ca(a.height),s.margin="0",s.boxSizing="border-box"}function rv(r,a,i){const s=Uo(r);if(!s)return;const u=i?Bo(r,i):{x:0,y:0};s.left=Ca(a.x-u.x),s.top=Ca(a.y-u.y),s.width=Ca(a.width),s.height=Ca(a.height)}function Ul(r,a){const i=ZT(r,a);if(i)return i;const s=r.getBoundingClientRect(),u=a.getBoundingClientRect();return{x:s.left-u.left,y:s.top-u.top,width:s.width,height:s.height}}function av(r){var s;const a=r,i=(s=a.getScreenCTM)==null?void 0:s.call(a);if(!i)return null;try{return i.inverse()}catch{return null}}function iv(r,a){const i=r.parentElement,u=r.tagName.toLowerCase()==="svg"&&typeof(i==null?void 0:i.getScreenCTM)=="function"?JT(r)??av(r):av(r);return u?{x:Math.round((u.a*a.x+u.c*a.y)*1e3)/1e3,y:Math.round((u.b*a.x+u.d*a.y)*1e3)/1e3}:{x:a.x,y:a.y}}function FT(r){const a=r.a*r.d-r.b*r.c;return!Number.isFinite(a)||a===0?null:{a:r.d/a,b:-r.b/a,c:-r.c/a,d:r.a/a}}function JT(r){var y;const a=r.parentElement,i=((y=a==null?void 0:a.getScreenCTM)==null?void 0:y.call(a))??null;if(!i)return null;const s=wx(r),[u=1,d=0,h=0,m=1]=s??[];return FT({a:i.a*u+i.c*d,b:i.b*u+i.d*d,c:i.a*h+i.c*m,d:i.b*h+i.d*m})}const PT=/^matrix\(\s*([^)]+)\)$/;function WT(r){const a=PT.exec(r);if(!(a!=null&&a[1]))return null;const i=a[1].split(",").map(s=>Number(s.trim()));return i.length===6&&i.every(Number.isFinite)?i:null}function wx(r){var s,u;const a=(s=r.transform)==null?void 0:s.baseVal,i=(u=a==null?void 0:a.consolidate())==null?void 0:u.matrix;return i?[i.a,i.b,i.c,i.d,i.e,i.f]:null}function eC(r,a){return r.every((i,s)=>{const u=a[s]??0;return Math.abs(i-u)<=Math.max(.001,Math.abs(u)*1e-4)})}const tC=["translate","rotate","scale"];function nC(r){return tC.some(a=>{const i=(r[a]??"").trim();return i!==""&&i!=="none"})}function Do(r){var h,m,y;if((((m=(h=Uo(r))==null?void 0:h.transform)==null?void 0:m.trim())??"")!=="")return!0;const i=(y=r.ownerDocument.defaultView)==null?void 0:y.getComputedStyle(r);if(!i)return!1;if(nC(i))return!0;const s=i.transform??"";if(s.trim()===""||s==="none")return!1;const u=wx(r);if(!u)return!0;const d=WT(s.trim());return d===null||!eC(d,u)}function ah(r,a,i){const s=`translate(${i.x} ${i.y})`,u=a.trim(),d=u!==""&&u.toLowerCase()!=="none";r.setAttribute("transform",d?`${u} ${s}`:s)}function lC(r,a){return r.map(i=>({...i.start,x:i.start.x+a.x,y:i.start.y+a.y}))}function rC(r,a,i,s){return yT(r.start,a,{dx:i.x,dy:i.y},s)}function aC(r){return{x:r.x+r.width/2,y:r.y+r.height/2}}const iC=/rotate\(\s*(-?(?:\d+|\d*\.\d+))deg\s*\)/;function Ll(r){var s;const a=((s=Uo(r))==null?void 0:s.transform)??"",i=iC.exec(a);return(i==null?void 0:i[1])===void 0?0:pi(Number(i[1]))}function Ex(r,a){const i=Uo(r);i&&(i.transformOrigin="50% 50%",i.transform=`rotate(${pi(a)}deg)`)}function ov(r,a){const i=Math.atan2(a.y-r.y,a.x-r.x);return pi(i*180/Math.PI+90)}function oC(r,a){const i=pi(a-r);return i>180?i-360:i}function sC(r,a=15){return pi(Math.round(r/a)*a)}function Tx(r){const a=r.style;return a?a.position==="absolute"||a.position==="fixed":!1}function Qu(r){return!!r.style&&!Tx(r)}function cC(r){return r.some(a=>Qu(a))}function uC(r,a){return r&&!a}function dC(r,a,i){return r&&(a||i)}const fC=/^-?(?:\d+\.?\d*|\.\d+)$/,sv=48;function pC(r){return r==="width"||r==="height"}function Cx(r,a){return Number.isFinite(a)?!(pC(r)&&a<=0):!1}function ic(r,a){return Ht(r)[a]??null}function Nx(r,a){return a.hasId||a.element===r.body}function hC(r,a){return{...Ul(r,a),rotation:Ll(r)}}function cv(r,a){return{rect:Ul(r,a),rotation:Ll(r),offset:Bo(r,a)}}function ih(r){const a=Math.round(r*100)/100;return String(Object.is(a,-0)?0:a)}function oh(r,a){const i=a.trim();if(!fC.test(i))return null;const s=Number(i);return Cx(r,s)?r==="rotation"?pi(s):s:null}function mC(r,a,i){if(i===null)return null;const s=oh(r,a);if(s===null||s===i)return null;const u=oh(r,ih(i));return s===u?null:s}function gC(r,a,i,s,u){if(!Cx(s,u))return!1;const d=ic(r,a.slideIndex);if(!d)return!1;const h=je(d.element,a.path);if(!h)return!1;const m=h.style;if(!m)return!1;if(s==="rotation")return Ex(h,u),!0;const y=Tx(h);y||$u(h,i.rect,d.element);const b=i.offset;if(s==="x"||s==="y"){const E=s==="x"?u:i.rect.x,v=s==="y"?u:i.rect.y;return m.left=`${E-b.x}px`,m.top=`${v-b.y}px`,!0}return y||(m.left=`${i.rect.x-b.x}px`,m.top=`${i.rect.y-b.y}px`),s==="width"?m.width=`${u}px`:m.height=`${u}px`,!0}function yC(r){var i;const a=((i=r.textContent)==null?void 0:i.replace(/\s+/g," ").trim())??"";return a.length>sv?`${a.slice(0,sv-1)}…`:a}function bC(r){const a=Array.from(r.children);return ur(r).map(i=>{var u,d;const s=a.indexOf(i);return{path:[s],index:s,tag:i.tagName.toLowerCase(),elementId:((u=i.getAttribute("data-ppt-el"))==null?void 0:u.trim())||null,text:yC(i),locked:i.getAttribute("data-ppt-locked")==="true",hidden:((d=i.style)==null?void 0:d.display)==="none",group:i.hasAttribute("data-ppt-group"),canUnhide:i.hasAttribute("data-ppt-display"),hasChildren:Aa(i)}})}function vC(r){return r?Array.from(r.children).find(a=>a.hasAttribute("data-ppt-notes"))??null:null}function Ax(r){var a;return((a=vC(r))==null?void 0:a.textContent)??""}function xC(r,a,i){const s=ic(r,a);return!s||!Nx(r,s)?!1:(yS(r,s.id,i),!0)}function Ox(r){const a=r==null?void 0:r.getAttribute("data-ppt-transition");return a==="fade"||a==="slide"?a:"none"}function SC(r,a,i){const s=ic(r,a);return!s||!Nx(r,s)?!1:(bS(r,s.id,i),!0)}function wC(r){return r.replace(/\\(["\\])/g,"$1")}function EC(r){return`url("${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}const TC=/^url\(\s*(['"]?)(.*?)\1\s*\)$/i;function CC(r){const a=r==null?void 0:r.style;if(!a)return null;const i=a.getPropertyValue("background-image").trim(),s=TC.exec(i);if(s)return{kind:"image",value:wC(s[2]??"")};const u=a.getPropertyValue("background").trim();if(i&&/gradient\(/i.test(i))return{kind:"gradient",value:u||i};if(u)return{kind:/gradient\(/i.test(u)?"gradient":"color",value:u};const d=a.getPropertyValue("background-color").trim();return d?{kind:"color",value:d}:null}function NC(r){const a=r.value.trim();return!a||/[\r\n]/.test(a)||r.kind==="gradient"&&!/gradient\(/i.test(a)?null:r.kind==="image"?EC(a):a}function AC(r,a,i){const s=NC(i);if(s===null)return!1;const u=i.kind==="image"?"background-image":"background",d=r.createElement("div");if(d.style.setProperty(u,s),!d.style.getPropertyValue(u).trim())return!1;const h=ic(r,a),m=h==null?void 0:h.element,y=m==null?void 0:m.style;return y?(y.removeProperty("background"),y.removeProperty("background-color"),y.removeProperty("background-image"),y.setProperty(u,s),!0):!1}function OC(r,a){var u;const i=ic(r,a),s=(u=i==null?void 0:i.element)==null?void 0:u.style;return s?(s.removeProperty("background"),s.removeProperty("background-color"),s.removeProperty("background-image"),!0):!1}function Hr(r,a,i){return!r||!a(r)?!1:(i(),!0)}const DC=["nw","n","ne","e","se","s","sw","w"],RC={nw:{left:"0%",top:"0%"},n:{left:"50%",top:"0%"},ne:{left:"100%",top:"0%"},e:{left:"100%",top:"50%"},se:{left:"100%",top:"100%"},s:{left:"50%",top:"100%"},sw:{left:"0%",top:"100%"},w:{left:"0%",top:"50%"}};function jC({boxes:r,guides:a,hover:i=null,scale:s,readOnly:u,handles:d="all",onResizeStart:h,onRotateStart:m}){const{t:y}=ln();return g.jsxs("div",{className:"pointer-events-none absolute inset-0 z-10","data-testid":"canvas-overlay",children:[i&&g.jsx("div",{"data-testid":"hover-outline",className:"pointer-events-none absolute border border-dashed border-selection/70",style:{left:i.rect.x*s,top:i.rect.y*s,width:i.rect.width*s,height:i.rect.height*s},children:g.jsx("span",{"data-testid":"hover-label",className:"absolute left-0 top-0 -translate-y-full rounded bg-selection px-1 text-[10px] font-semibold text-selection-contrast",children:i.label})}),a.map((b,E)=>b.axis==="x"?g.jsx("div",{"data-testid":"guide-x",className:"absolute top-0 h-full w-px bg-danger/80",style:{left:b.position*s}},`x-${E}`):g.jsx("div",{"data-testid":"guide-y",className:"absolute left-0 h-px w-full bg-danger/80",style:{top:b.position*s}},`y-${E}`)),r.map((b,E)=>{const v=E===0&&!u&&d!=="none",C=v&&d!=="rotate";return g.jsxs("div",{"data-testid":"selection-outline","data-readonly":v?void 0:"true","data-primary":E===0?"true":void 0,"data-selected-id":b.elementId??void 0,"data-selected-path":b.path.join("."),className:`pointer-events-none absolute ${E===0?"border-2":"border"} border-selection shadow-[0_0_0_1px_var(--editor-selection-contrast)]`,style:{left:b.rect.x*s,top:b.rect.y*s,width:b.rect.width*s,height:b.rect.height*s,transform:b.rotation===0?void 0:`rotate(${b.rotation}deg)`},children:[E===0&&g.jsx("span",{"data-testid":"selection-marker","aria-hidden":"true",className:"absolute left-0 top-0 rounded-br bg-selection px-1 text-[10px] font-semibold text-selection-contrast",children:y("canvas.selected")}),v&&g.jsxs(g.Fragment,{children:[C&&DC.map(A=>g.jsx("div",{"data-testid":`handle-${A}`,className:"pointer-events-auto absolute h-2.5 w-2.5 rounded-[2px] border border-selection-contrast bg-selection",style:{...RC[A],transform:"translate(-50%, -50%)"},onPointerDown:B=>h(A,B)},A)),g.jsx("div",{"data-testid":"rotate-handle",className:"pointer-events-auto absolute left-1/2 h-3 w-3 rounded-full border border-selection-contrast bg-selection",style:{top:0,transform:"translate(-50%, calc(-100% - 16px))"},onPointerDown:m})]})]},b.path.join(".")||E)})]})}const MC={status:"idle",canEdit:!1,canFormat:!1},Ta="rounded border border-line-strong px-2 py-1 text-[11px] text-muted transition-colors hover:bg-hover hover:text-ink disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent";function Sl({testId:r,label:a,disabled:i,onClick:s}){return g.jsx("button",{type:"button","data-testid":r,disabled:i,onClick:s,className:Ta,children:a})}const uv=[{id:"design",labelKey:"inspector.design"},{id:"text",labelKey:"inspector.text"},{id:"notes",labelKey:"inspector.notes"}],Mo="w-full rounded border border-line-strong bg-input px-2 py-1 text-xs tabular-nums text-ink outline-none transition-colors focus:border-accent/70 disabled:opacity-50",wa="flex flex-col gap-2 border-b border-line px-3 py-3 last:border-b-0",Ea="text-[11px] font-semibold uppercase tracking-[0.14em] text-muted";function Is({pendingActions:r,field:a,label:i,value:s,disabled:u,onCommit:d}){const{t:h}=ln(),m=s===null?"":ih(s),[y,b]=w.useState(m),[E,v]=w.useState(!1),C=w.useRef(!1),A=`geometry-${a}`;w.useEffect(()=>{C.current||b(m)},[m]);const B=()=>{C.current=!1,v(!1),b(m)},D=G=>{b(G),v(!1),C.current=G!==m,r.changePendingEdit(A,C.current?{apply:()=>{if(s===null||oh(a,G)===null)return v(!0),!1;const ae=mC(a,G,s);return ae!==null&&!d(a,ae)?(B(),!0):(C.current=!1,b(ae===null?m:ih(ae)),v(!1),!0)},discard:B}:null)};return g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[11px] text-muted",children:i}),g.jsx("input",{type:"text",inputMode:"decimal","data-testid":`field-${a}`,"aria-label":i,value:y,disabled:u,"aria-invalid":E,onBlur:()=>r.settlePendingEdits(A),onChange:G=>D(G.target.value),onKeyDown:G=>{G.key==="Enter"?(G.preventDefault(),G.currentTarget.blur()):G.key==="Escape"&&(r.cancelPendingEdit(A),G.currentTarget.blur())},className:Mo}),E&&g.jsx("span",{role:"alert",className:"text-[11px] text-danger",children:h("inspector.invalidNumber")})]})}function sr({pendingActions:r,owner:a,testId:i,label:s,value:u,disabled:d,placeholder:h,onCommit:m}){const{t:y}=ln(),[b,E]=w.useState(u),[v,C]=w.useState(!1),A=w.useRef(!1),B=`style-${a}`;w.useEffect(()=>{A.current||E(u)},[u]);const D=()=>{A.current=!1,C(!1),E(u)},G=ae=>{E(ae),C(!1),A.current=ae!==u,r.changePendingEdit(B,A.current?{apply:()=>m(ae)?(A.current=!1,C(!1),!0):(C(!0),!1),discard:D}:null)};return g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[11px] text-muted",children:s}),g.jsx("input",{type:"text","data-testid":i,"aria-label":s,value:b,disabled:d,placeholder:h,"aria-invalid":v,onBlur:()=>r.settlePendingEdits(B),onChange:ae=>G(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"?(ae.preventDefault(),ae.currentTarget.blur()):ae.key==="Escape"&&(r.cancelPendingEdit(B),ae.currentTarget.blur())},className:Mo}),v&&g.jsx("span",{role:"alert",className:"text-[11px] text-danger",children:y("inspector.invalidValue")})]})}function wo(r){const a=r.trim();if(!a)return null;const i=Number(a);return Number.isFinite(i)?i:null}const zC="#000000",_C=1;function kC(r){const a=parseFloat(r);return Number.isFinite(a)&&a>0?a:_C}function HC({pendingActions:r,slide:a,selection:i,selectionCount:s=i?1:0,nestedSelectionCount:u=0,blockedByAncestor:d=!1,geometryUnavailable:h=!1,contextPath:m,onEnterContext:y,geometry:b,style:E=null,chart:v=null,styleDisabled:C=!1,objectActions:A,onSelectObject:B,onObjectCommand:D,onObjectRecovery:G,onCommitGeometry:ae,onSetAppearance:se,onSetShapeText:Y,onSetImageAlt:R,onSetImageCrop:re,onReplaceImageFile:ve,onReplaceImageUrl:Z,onEditChart:Se,onPreviewTransition:st,onSetTransition:Ue,onSetBackground:De,onClearBackground:He,onSetNotes:xe,textAction:pt=MC,onEditText:Pe=()=>{}}){const{t:z}=ln(),[ce,ie]=w.useState("design"),Ge=w.useRef(null),Ve=w.useRef(null),St=w.useRef({design:null,text:null,notes:null}),rt=Ax(a==null?void 0:a.element),[Pt,O]=w.useState(rt),P=w.useRef(!1),te=CC(a==null?void 0:a.element),[we,Ye]=w.useState((te==null?void 0:te.kind)??"color"),[$e,Ae]=w.useState((te==null?void 0:te.value)??""),[ge,Ne]=w.useState(""),at=w.useRef(!1),kn=Ox(a==null?void 0:a.element),[rn,Rt]=w.useState(kn),wt=rn!==kn;w.useEffect(()=>{Rt(kn)},[kn,a==null?void 0:a.id]),w.useEffect(()=>{P.current||O(rt)},[rt]),w.useEffect(()=>{at.current||(Ye((te==null?void 0:te.kind)??"color"),Ae((te==null?void 0:te.value)??""),Ne(""))},[te==null?void 0:te.kind,te==null?void 0:te.value,a==null?void 0:a.id]);const tt=m??[],Vt=a&&tt.length>0?je(a.element,tt):null,Wt=Vt!==null&&Aa(Vt),Lt=Wt?tt:[],xn=Wt&&Vt?Vt:(a==null?void 0:a.element)??null,Hn=xn?bC(xn):[],Ut=s>1,Sn=i!==null&&i.path.length>1,Ln=Ut,Zn=i==null?void 0:i.path.slice(Lt.length)[0],F=Ln||d||h||A.locked||A.hidden,ee=F||A.group,ne=a&&i?je(a.element,i.path):null,ue=i!==null&&s===1&&y!==void 0&&i.path.join(".")!==Lt.join(".")&&ne!==null&&Aa(ne)&&i?[...i.path]:null,he=(J,oe)=>{var Ze;ie(J),oe&&((Ze=St.current[J])==null||Ze.focus())},qe=(J,oe)=>{const Ze=uv.map(Nl=>Nl.id),Le=Ze.indexOf(oe);let At;if(J.key==="ArrowRight")At=(Le+1)%Ze.length;else if(J.key==="ArrowLeft")At=(Le-1+Ze.length)%Ze.length;else if(J.key==="Home")At=0;else if(J.key==="End")At=Ze.length-1;else return;J.preventDefault();const en=Ze[At];en&&he(en,!0)},Me=(J,oe)=>{Ye(J),Ae(oe),Ne(""),at.current=J!==((te==null?void 0:te.kind)??"color")||oe!==((te==null?void 0:te.value)??""),r.changePendingEdit("background",at.current?{apply:()=>!oe.trim()||!De({kind:J,value:oe.trim()})?(Ne(z("inspector.invalidBackground")),!1):(at.current=!1,Ae(oe.trim()),Ne(""),!0),discard:()=>{at.current=!1,Ye((te==null?void 0:te.kind)??"color"),Ae((te==null?void 0:te.value)??""),Ne("")}}:null)},Fe=()=>r.settlePendingEdits("background"),vt=()=>{r.cancelPendingEdit("background"),Ne(He()?"":z("inspector.clearBackgroundFailed")),Ae("")};return g.jsxs("aside",{"data-testid":"inspector","aria-label":z("inspector.panel"),className:"flex w-72 shrink-0 flex-col overflow-y-auto border-l border-line bg-surface",children:[g.jsx("div",{role:"tablist","aria-label":z("inspector.tabs"),className:"flex border-b border-line",children:uv.map(J=>{const oe=ce===J.id;return g.jsx("button",{type:"button",role:"tab",id:`inspector-tab-${J.id}`,"aria-selected":oe,"aria-controls":`inspector-panel-${J.id}`,"data-testid":`inspector-tab-${J.id}`,ref:Ze=>{St.current[J.id]=Ze},tabIndex:oe?0:-1,onClick:()=>he(J.id,!1),onKeyDown:Ze=>qe(Ze,J.id),className:`flex-1 border-b-2 px-2 py-2 text-xs transition-colors ${oe?"border-accent text-accent":"border-transparent text-muted hover:text-ink"}`,children:z(J.labelKey)},J.id)})}),g.jsxs("div",{role:"tabpanel",id:"inspector-panel-design","aria-labelledby":"inspector-tab-design","data-testid":"inspector-panel-design",hidden:ce!=="design",children:[g.jsxs("section",{"aria-label":z("inspector.objects"),className:wa,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h3",{className:Ea,children:z("inspector.objects")}),ue&&ne&&g.jsx("button",{type:"button","data-testid":"inspector-enter-component","aria-label":z("editor.context.enter",{name:yx(ne)}),onClick:()=>{y==null||y(ue),window.requestAnimationFrame(()=>{var J;return(J=Ve.current)==null?void 0:J.focus()})},className:Ta,children:z("inspector.enterComponent")})]}),Hn.length===0?g.jsx("p",{className:"text-xs text-muted",children:z("inspector.noObjects")}):g.jsx("ul",{ref:Ve,tabIndex:-1,"data-testid":"object-list",className:"flex flex-col gap-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:Hn.map(J=>{var en;const oe=Zn===J.path[0],Ze=xn==null?void 0:xn.children[J.index],Le=(en=Ze==null?void 0:Ze.getAttribute("class"))==null?void 0:en.trim().split(/\s+/)[0],At=[...Lt,...J.path];return g.jsxs("li",{className:`flex items-stretch gap-1 rounded border transition-colors ${oe?"border-accent/70 bg-accent-soft":"border-line hover:border-line-strong"}`,children:[g.jsxs("button",{type:"button","data-testid":"object-row","data-object-id":J.elementId??void 0,"data-object-path":At.join("."),"aria-current":oe?"true":void 0,onClick:()=>B(At),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left text-xs ${oe?"text-accent":"text-muted"}`,children:[g.jsx("span",{className:"rounded bg-chip px-1 py-0.5 font-mono text-[10px] text-muted",children:J.tag}),J.elementId&&g.jsx("span",{className:"font-mono text-[10px] text-accent",children:J.elementId}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:J.text||z("inspector.emptyText")}),J.group&&g.jsx("span",{className:"rounded bg-chip px-1 py-0.5 text-[10px] text-muted",children:z("inspector.group")}),J.locked&&g.jsx("span",{"data-testid":"object-locked-badge",className:"rounded bg-danger-soft px-1 py-0.5 text-[10px] text-danger",children:z("inspector.locked")}),J.hidden&&g.jsx("span",{"data-testid":"object-hidden-badge",className:"rounded bg-warning-soft px-1 py-0.5 text-[10px] text-warning",children:z("inspector.hidden")})]}),J.hasChildren&&y?g.jsx("button",{type:"button","aria-label":z("editor.context.enter",{name:Le||J.tag}),onClick:()=>y([...Lt,J.index]),className:"shrink-0 px-2 text-[13px] leading-none text-muted transition-colors hover:text-ink",children:"›"}):null,J.locked&&g.jsx("button",{type:"button","data-testid":"object-unlock","aria-label":z("inspector.unlockItemLabel",{name:J.text||J.elementId||J.tag}),onClick:()=>G(At,"unlock"),className:"shrink-0 px-2 text-[11px] text-danger underline-offset-2 hover:underline",children:z("inspector.unlockItem")}),J.hidden&&J.canUnhide&&g.jsx("button",{type:"button","data-testid":"object-unhide","aria-label":z("inspector.showItemLabel",{name:J.text||J.elementId||J.tag}),onClick:()=>G(At,"unhide"),className:"shrink-0 px-2 text-[11px] text-warning underline-offset-2 hover:underline",children:z("inspector.showItem")})]},J.path.join("."))})})]}),i&&g.jsxs("section",{"data-testid":"object-actions","aria-label":z("inspector.objectActions"),className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.objectActions")}),g.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[g.jsx(Sl,{testId:"object-group",label:z("inspector.group"),disabled:!A.canGroup,onClick:()=>D({type:"group"})}),g.jsx(Sl,{testId:"object-ungroup",label:z("inspector.ungroup"),disabled:!A.canUngroup,onClick:()=>D({type:"ungroup"})}),g.jsx(Sl,{testId:"object-order-front",label:z("inspector.toFront"),disabled:!A.canOrder,onClick:()=>D({type:"order",direction:"front"})}),g.jsx(Sl,{testId:"object-order-forward",label:z("inspector.forward"),disabled:!A.canOrder,onClick:()=>D({type:"order",direction:"forward"})}),g.jsx(Sl,{testId:"object-order-backward",label:z("inspector.backward"),disabled:!A.canOrder,onClick:()=>D({type:"order",direction:"backward"})}),g.jsx(Sl,{testId:"object-order-back",label:z("inspector.toBack"),disabled:!A.canOrder,onClick:()=>D({type:"order",direction:"back"})})]}),g.jsx("h4",{className:"text-[11px] text-muted",children:z("inspector.alignObject")}),g.jsx("div",{className:"grid grid-cols-3 gap-1",children:[["left",z("inspector.alignLeft")],["center",z("inspector.alignCenter")],["right",z("inspector.alignRight")],["top",z("inspector.alignTop")],["middle",z("inspector.alignMiddle")],["bottom",z("inspector.alignBottom")]].map(([J,oe])=>g.jsx(Sl,{testId:`align-${J}`,label:oe,disabled:!A.canAlign,onClick:()=>D({type:"align",mode:J})},J))}),g.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[g.jsx(Sl,{testId:"distribute-horizontal",label:z("inspector.distributeH"),disabled:!A.canDistribute,onClick:()=>D({type:"distribute",axis:"horizontal"})}),g.jsx(Sl,{testId:"distribute-vertical",label:z("inspector.distributeV"),disabled:!A.canDistribute,onClick:()=>D({type:"distribute",axis:"vertical"})})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[g.jsx(Sl,{testId:"object-lock",label:A.locked?z("inspector.unlock"):z("inspector.locked"),disabled:!A.canToggle,onClick:()=>D({type:"lock",locked:!A.locked})}),g.jsx(Sl,{testId:"object-hide",label:A.hidden?z("inspector.show"):z("inspector.hide"),disabled:!A.canToggle,onClick:()=>D({type:"hide",hidden:!A.hidden})})]})]}),i&&v&&g.jsxs("section",{"data-testid":"chart-object","aria-label":z("inspector.chart"),className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.chart")}),g.jsxs("p",{"data-testid":"chart-summary",className:"text-xs text-muted",children:[v.type," · ",v.title||z("inspector.untitled")]}),g.jsx("button",{type:"button","data-testid":"chart-edit",disabled:C,onClick:Se,className:Ta,children:z("inspector.editChart")})]}),i&&E&&g.jsxs("section",{"data-testid":"object-style","aria-label":z("inspector.objectAppearance"),className:wa,children:[g.jsx("h3",{className:Ea,children:E.kind==="image"?z("inspector.image"):z("inspector.appearance")}),E.kind==="image"?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{type:"button","data-testid":"image-replace-upload",disabled:C,onClick:()=>{var J;return(J=Ge.current)==null?void 0:J.click()},className:Ta,children:z("inspector.replaceImage")}),g.jsx("button",{type:"button","data-testid":"image-replace-url",disabled:C,onClick:Z,className:Ta,children:z("inspector.imageUrlAction")})]}),g.jsx("input",{ref:Ge,type:"file","data-testid":"image-replace-input",accept:"image/png,image/jpeg,image/gif,image/webp,image/avif,image/svg+xml",className:"hidden",onChange:J=>{var Ze;const oe=(Ze=J.target.files)==null?void 0:Ze[0];J.target.value="",oe&&ve(oe)}}),g.jsx(sr,{pendingActions:r,owner:"image-alt",testId:"image-alt",label:z("inspector.alt"),value:E.alt,disabled:C,onCommit:R}),g.jsx("span",{className:"text-[11px] text-muted",children:z("inspector.crop")}),g.jsx("div",{className:"grid grid-cols-4 gap-1",children:[["top",z("inspector.top")],["right",z("inspector.right")],["bottom",z("inspector.bottom")],["left",z("inspector.left")]].map(([J,oe])=>g.jsx(sr,{pendingActions:r,owner:`crop-${J}`,testId:`image-crop-${J}`,label:oe,value:String(E.crop[J]),disabled:C,onCommit:Ze=>{const Le=wo(Ze);if(Le===null)return!1;const At={...E.crop,[J]:Le},en=Object.values(At).every(Nl=>Nl===0);return re(en?null:At)}},J))}),g.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.jsx(sr,{pendingActions:r,owner:"image-radius",testId:"image-radius",label:z("inspector.radius"),value:E.appearance.radius,disabled:C,onCommit:J=>{const oe=wo(J);return J.trim()&&oe===null?!1:se({radius:oe})}}),g.jsx(sr,{pendingActions:r,owner:"image-opacity",testId:"image-opacity",label:z("inspector.opacity"),value:E.appearance.opacity,disabled:C,onCommit:J=>{const oe=wo(J);return J.trim()&&oe===null?!1:se({opacity:oe})}})]})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.jsx(sr,{pendingActions:r,owner:"fill",testId:"style-fill",label:z("inspector.fill"),value:E.appearance.fill,disabled:C,placeholder:"#4f7cff",onCommit:J=>se({fill:J.trim()||null})}),g.jsx(sr,{pendingActions:r,owner:"stroke",testId:"style-stroke",label:z("inspector.borderColor"),value:E.appearance.stroke,disabled:C,placeholder:"#000000",onCommit:J=>{const oe=J.trim()||null;return E.svg?se({stroke:oe}):se({stroke:oe,strokeWidth:kC(E.appearance.strokeWidth)})}}),g.jsx(sr,{pendingActions:r,owner:"stroke-width",testId:"style-stroke-width",label:z("inspector.borderWidth"),value:E.appearance.strokeWidth,disabled:C,placeholder:"0",onCommit:J=>{const oe=wo(J);if(J.trim()&&oe===null)return!1;const Ze=oe??0;return E.appearance.stroke.trim()?se({strokeWidth:Ze}):se({strokeWidth:Ze,stroke:Ze>0?zC:null})}}),!E.svg&&g.jsx(sr,{pendingActions:r,owner:"radius",testId:"style-radius",label:z("inspector.radius"),value:E.appearance.radius,disabled:C,onCommit:J=>{const oe=wo(J);return J.trim()&&oe===null?!1:se({radius:oe})}}),g.jsx(sr,{pendingActions:r,owner:"opacity",testId:"style-opacity",label:z("inspector.opacity"),value:E.appearance.opacity,disabled:C,onCommit:J=>{const oe=wo(J);return J.trim()&&oe===null?!1:se({opacity:oe})}})]}),E.svg&&g.jsx(sr,{pendingActions:r,owner:"shape-text",testId:"style-shape-text",label:z("inspector.shapeText"),value:E.text,disabled:C,onCommit:Y})]})]}),i?g.jsxs("section",{"data-testid":"inspector-geometry","aria-label":z("inspector.geometry"),className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.geometry")}),A.hidden?g.jsx("p",{"data-testid":"object-state-message",className:"text-[11px] text-muted",children:z("inspector.hiddenHint")}):A.locked?g.jsx("p",{"data-testid":"object-state-message",className:"text-[11px] text-muted",children:z("inspector.lockedHint")}):Ut?u>0?g.jsx("p",{"data-testid":"inspector-nested-structural",className:"text-[11px] text-muted",children:z("inspector.nestedMultiStructuralHint")}):g.jsx("p",{className:"text-[11px] text-muted",children:z("inspector.multiHint",{count:s})}):A.group?g.jsx("p",{"data-testid":"object-state-message",className:"text-[11px] text-muted",children:z("inspector.groupHint")}):Sn&&g.jsx("p",{"data-testid":"inspector-nested-structural",className:"text-[11px] text-muted",children:z(h?"inspector.nestedStructuralHintLimited":"inspector.nestedStructuralHint")}),g.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.jsx(Is,{field:"x",label:"X",value:(b==null?void 0:b.x)??null,disabled:F||b===null,pendingActions:r,onCommit:ae}),g.jsx(Is,{field:"y",label:"Y",value:(b==null?void 0:b.y)??null,disabled:F||b===null,pendingActions:r,onCommit:ae}),g.jsx(Is,{field:"width",label:z("inspector.width"),value:(b==null?void 0:b.width)??null,disabled:ee||b===null,pendingActions:r,onCommit:ae}),g.jsx(Is,{field:"height",label:z("inspector.height"),value:(b==null?void 0:b.height)??null,disabled:ee||b===null,pendingActions:r,onCommit:ae}),g.jsx("div",{className:"col-span-2",children:g.jsx(Is,{field:"rotation",label:z("inspector.rotation"),value:(b==null?void 0:b.rotation)??null,disabled:F||b===null,pendingActions:r,onCommit:ae})})]})]}):g.jsxs("section",{"data-testid":"slide-settings","aria-label":z("inspector.slide"),className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.slide")}),g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[11px] text-muted",children:z("inspector.transition")}),g.jsxs("select",{"data-testid":"transition-select","aria-label":z("inspector.transition"),value:rn,onChange:J=>Rt(J.target.value),className:Mo,children:[g.jsx("option",{value:"none",children:z("inspector.transitionNone")}),g.jsx("option",{value:"fade",children:z("inspector.transitionFade")}),g.jsx("option",{value:"slide",children:z("inspector.transitionSlide")})]}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx("button",{type:"button","data-testid":"transition-preview",disabled:rn==="none",onClick:()=>st(rn),className:Ta,children:z("inspector.preview")}),g.jsx("button",{type:"button","data-testid":"transition-apply",disabled:!wt,onClick:()=>Ue(rn),className:Ta,children:z("common.apply")}),g.jsx("button",{type:"button","data-testid":"transition-cancel",disabled:!wt,onClick:()=>Rt(kn),className:Ta,children:z("common.cancel")})]}),wt&&g.jsx("span",{className:"text-[11px] text-warning",children:z("inspector.notApplied")})]}),g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[11px] text-muted",children:z("inspector.background")}),g.jsxs("div",{className:"flex gap-1",children:[g.jsxs("select",{"data-testid":"background-kind","aria-label":z("inspector.backgroundKind"),value:we,onChange:J=>Me(J.target.value,""),onKeyDown:J=>{J.key==="Escape"&&r.cancelPendingEdit("background")},className:`${Mo} w-24 shrink-0`,children:[g.jsx("option",{value:"color",children:z("inspector.backgroundKindColor")}),g.jsx("option",{value:"gradient",children:z("inspector.backgroundKindGradient")}),g.jsx("option",{value:"image",children:z("inspector.backgroundImage")})]}),g.jsx("input",{type:"text","data-testid":"background-value","aria-label":z("inspector.backgroundValue"),value:$e,placeholder:we==="color"?"#f7f5ef":we==="gradient"?"linear-gradient(…)":"https://…",onChange:J=>Me(we,J.target.value),onKeyDown:J=>{J.key==="Enter"?(J.preventDefault(),Fe()):J.key==="Escape"&&r.cancelPendingEdit("background")},className:Mo})]}),g.jsxs("div",{className:"flex justify-end gap-1",children:[g.jsx("button",{type:"button","data-testid":"clear-background",onClick:vt,disabled:te===null,className:"rounded border border-line-strong px-2 py-1 text-[11px] text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",children:z("inspector.clearBackground")}),g.jsx("button",{type:"button","data-testid":"apply-background",onClick:Fe,disabled:!$e.trim(),className:"rounded border border-line-strong px-2 py-1 text-[11px] text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",children:z("common.apply")})]}),ge&&g.jsx("p",{"data-testid":"background-error",role:"alert",className:"text-[11px] text-danger",children:ge})]})]})]}),g.jsx("div",{role:"tabpanel",id:"inspector-panel-text","aria-labelledby":"inspector-tab-text","data-testid":"inspector-panel-text",hidden:ce!=="text",children:g.jsxs("div",{className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.text")}),pt.status==="idle"&&g.jsx("p",{"data-testid":"inspector-text-idle",className:"text-xs text-muted",children:z("inspector.textIdle")}),pt.status==="multi"&&g.jsx("p",{"data-testid":"inspector-text-multi",className:"text-xs text-muted",children:z("inspector.textMulti")}),pt.status==="blocked"&&g.jsx("p",{"data-testid":"inspector-text-blocked",className:"text-xs text-muted",children:z(eh[pt.reason??"not-text"])}),pt.status==="editable"&&g.jsxs(g.Fragment,{children:[g.jsx(Sl,{testId:"inspector-edit-text",label:z("inspector.editText"),onClick:Pe}),g.jsx("p",{"data-testid":"inspector-text-hint",className:"text-xs text-muted",children:pt.text?z("inspector.textSelected",{text:pt.text}):z("inspector.textEmpty")})]})]})}),g.jsx("div",{role:"tabpanel",id:"inspector-panel-notes","aria-labelledby":"inspector-tab-notes","data-testid":"inspector-panel-notes",hidden:ce!=="notes",children:g.jsxs("div",{className:wa,children:[g.jsx("h3",{className:Ea,children:z("inspector.speakerNotes")}),g.jsx("textarea",{"data-testid":"notes-input","aria-label":z("inspector.speakerNotes"),value:Pt,rows:8,placeholder:z("inspector.notesPlaceholder"),onChange:J=>{const oe=J.target.value;O(oe),P.current=oe!==rt,r.changePendingEdit("notes",P.current?{apply:()=>(xe(oe),P.current=!1,!0),discard:()=>{P.current=!1,O(rt)}}:null)},onBlur:()=>r.settlePendingEdits("notes"),onKeyDown:J=>{J.key==="Escape"&&r.cancelPendingEdit("notes")},className:`${Mo} resize-y font-sans`},(a==null?void 0:a.id)??"no-slide"),g.jsx("p",{className:"text-[11px] text-muted",children:z("inspector.notesHint")})]})})]})}function dv(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function LC(){const[r,a]=w.useState(()=>{var i,s;return((s=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-reduced-motion: reduce)"))==null?void 0:s.matches)===!0});return w.useLayoutEffect(()=>{var u,d;const i=(u=window.matchMedia)==null?void 0:u.call(window,"(prefers-reduced-motion: reduce)");if(!i)return;const s=()=>a(i.matches);return s(),(d=i.addEventListener)==null||d.call(i,"change",s),()=>{var h;return(h=i.removeEventListener)==null?void 0:h.call(i,"change",s)}},[]),r}const UC='a,button,input,select,textarea,label,summary,details,video[controls],audio[controls],[role="button"],[role="link"],[contenteditable]:not([contenteditable="false"])';function Dx(r){return!r||typeof r.closest!="function"?!1:r.closest(UC)!==null}function BC({slide:r,srcDoc:a,transition:i,fullscreen:s,fullscreenNotice:u,presenterError:d,onKeyDown:h,onAdvance:m,onOpenPresenter:y}){const{t:b}=ln(),E=w.useRef(null),v=w.useRef(null),C=w.useRef(h);C.current=h;const A=w.useRef(m);A.current=m;const B=LC(),[D,G]=w.useState(()=>LT(dv())),[ae,se]=w.useState(()=>({width:window.innerWidth,height:window.innerHeight})),[Y,R]=w.useState(null),re=w.useRef(null),ve=De=>{G(De),UT(De,dv())};w.useLayoutEffect(()=>{const De=()=>se({width:window.innerWidth,height:window.innerHeight});return De(),window.addEventListener("resize",De),document.addEventListener("fullscreenchange",De),()=>{window.removeEventListener("resize",De),document.removeEventListener("fullscreenchange",De)}},[]),w.useEffect(()=>()=>{var De;(De=re.current)==null||De.disconnect(),re.current=null},[]),w.useEffect(()=>{var De;(De=v.current)==null||De.focus()},[]);const Z=De=>{var Pe;const He=De.currentTarget.contentDocument;if(!He)return;Rh(He),(Pe=re.current)==null||Pe.disconnect();const xe=()=>{const z=Mh(He);R(ce=>ce&&ce.id===r.id&&jh(ce.box,z)?ce:z?{id:r.id,box:z}:null)};xe();const pt=He.querySelector(`[${Ws}]`)??He.body;if(pt&&typeof ResizeObserver<"u"){const z=new ResizeObserver(xe);z.observe(pt),re.current=z}He.addEventListener("keydown",z=>{C.current(z,He)}),He.addEventListener("click",z=>{Dx(z.target)||A.current()})},Se=i!=="none"&&!B,st=(Y==null?void 0:Y.id)===r.id?Y.box:{left:0,top:0,width:r.width,height:r.height},Ue=kT(st,ae,D);return g.jsxs("div",{ref:v,"data-testid":"play-view","data-fullscreen":s,role:"region","aria-label":b("play.label"),tabIndex:-1,className:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black outline-none",onClick:De=>{De.target===De.currentTarget&&m()},children:[g.jsx("p",{className:"sr-only",children:b("play.instructions")}),u&&g.jsx("div",{"data-testid":"fullscreen-warning",role:"status",className:"absolute left-4 top-4 z-20 max-w-sm rounded border border-amber-400/40 bg-amber-950/80 px-3 py-2 text-xs text-amber-100",children:u}),d&&g.jsx("div",{"data-testid":"presenter-error",role:"alert",className:"absolute left-4 top-20 z-20 max-w-sm rounded border border-rose-400/40 bg-rose-950/80 px-3 py-2 text-xs text-rose-100",children:d}),g.jsxs("div",{className:"absolute right-4 top-4 z-20 flex items-center gap-2",children:[g.jsxs("div",{role:"group","aria-label":b("play.fitGroup"),className:"flex overflow-hidden rounded border border-white/40 bg-black/50 text-xs text-zinc-200",children:[g.jsx("button",{type:"button","data-testid":"play-fit","aria-pressed":D==="fit",onClick:()=>ve("fit"),className:"px-2 py-1 transition-colors hover:bg-white/10 aria-pressed:bg-white/20",children:b("play.fit")}),g.jsx("button",{type:"button","data-testid":"play-fill","aria-pressed":D==="fill",onClick:()=>ve("fill"),className:"px-2 py-1 transition-colors hover:bg-white/10 aria-pressed:bg-white/20",children:b("play.fill")})]}),g.jsx("button",{type:"button","data-testid":"presenter-open",title:b("play.openPresenter"),"aria-haspopup":"dialog",onClick:y,className:"rounded border border-white/40 bg-black/50 px-3 py-1.5 text-xs text-zinc-200 transition-colors hover:border-white/60",children:b("play.presenter")})]}),g.jsx("div",{"data-testid":"play-slide","data-transition":i,className:`relative overflow-hidden ${Se?`play-slide--${i}`:""}`,style:{width:st.width*Ue,height:st.height*Ue},onClick:De=>{De.target===De.currentTarget&&m()},children:g.jsx("iframe",{ref:E,"data-testid":"play-frame",title:b("play.start"),sandbox:"allow-same-origin",srcDoc:a,onLoad:Z,className:"absolute left-0 top-0 border-0 bg-white",style:{width:r.width,height:r.height,transform:`translate(${-st.left*Ue}px, ${-st.top*Ue}px) scale(${Ue})`,transformOrigin:"top left"}})},r.id)]})}const IC=/^[A-Za-z0-9-]{8,64}$/;function sh(r){return`htmlppt-presenter-${r}`}function qC(r){return typeof r=="string"&&IC.test(r)}function ec(r){return typeof r=="number"&&Number.isInteger(r)}function fv(r,a){if(typeof r!="object"||r===null)return null;const i=r,{index:s,total:u}=i;return!ec(s)||!ec(u)||u<1||u>a||s<0||s>=u?null:{index:s,total:u}}function Rx(r,a){if(typeof r!="object"||r===null)return null;const i=r;if(i.sessionId!==a)return null;if(i.type==="request")return{sessionId:a,type:"request"};if(i.type==="bye")return{sessionId:a,type:"bye"};if(i.type==="slide")return!ec(i.index)||i.index<0?null:{sessionId:a,type:"slide",index:i.index};if(i.type==="state"){const s=fv(i,1e4);return s?{sessionId:a,type:"state",...s}:null}if(i.type==="snapshot"){if(typeof i.html!="string"||i.html.length===0)return null;const s=fv(i,1e4);return s?{sessionId:a,type:"snapshot",html:i.html,...s}:null}return null}function GC(r,a){return!ec(r)||!ec(a)||a<1||r<0||r>=a?null:r}function tc(r,a){return a<=0?0:Math.max(0,Math.min(r,a-1))}function YC(r,a){return Ht(r).findIndex(i=>i.id===a)}function VC(r,a,i){const s=r.map(d=>d.id),[u]=s.splice(a,1);return u!==void 0&&s.splice(i,0,u),s}async function jx(r,a){const i=r.master;if(!i)return null;const s={slideId:null};let u=!1;try{await r.commit(m=>{s.slideId=a(m),u=!0})}catch{if(!u)return null}const d=s.slideId;if(!d)return null;const h=YC(i,d);return h<0?null:(r.showSlide(h),h)}async function KC(r,a,i=r.activeIndex){const s=r.slides[i];return!r.master||!s?null:jx(r,u=>fS(u,{afterSlideId:s.id,html:a}))}async function XC(r,a=r.activeIndex){const i=r.slides[a];return!r.master||!i?null:jx(r,s=>pS(s,i.id))}async function $C(r,a=r.activeIndex){var y;const i=r.master,s=r.slides[a];if(!i||!s||r.slides.length<=1)return!1;const u=((y=r.slides[r.activeIndex])==null?void 0:y.id)??null;let d=!1;try{await r.commit(b=>{hS(b,s.id),d=!0})}catch{if(!d)return!1}if(!d)return!1;const h=Ht(i),m=u?h.findIndex(b=>b.id===u):-1;return r.showSlide(m>=0?m:tc(a,h.length)),!0}async function QC(r,a){var m;const i=r.master;if(!i||a.length!==r.slides.length)return!1;const s=((m=r.slides[r.activeIndex])==null?void 0:m.id)??null;let u=!1;try{await r.commit(y=>{gS(y,[...a]),u=!0})}catch{if(!u)return!1}if(!u)return!1;const d=Ht(i),h=s?d.findIndex(y=>y.id===s):-1;return r.showSlide(h>=0?h:tc(r.activeIndex,d.length)),!0}function zh(r,a){var u;const i=r.element.querySelector("h1, h2, h3, [data-ppt-title]");return((u=i==null?void 0:i.textContent)==null?void 0:u.replace(/\s+/g," ").trim())||a}function _h({master:r,slide:a,width:i,className:s=""}){const{t:u}=ln(),d=w.useMemo(()=>r?Lo(r,a,{markFrame:!1}):"",[r,a]),[h,m]=w.useState(null),y=h??{left:0,top:0,width:a.width,height:a.height},b=GT(y,i);return g.jsx("div",{"data-testid":"slide-miniature",className:`relative overflow-hidden bg-white ${s}`,style:{width:i,height:Math.round(b.height)},"aria-hidden":"true",children:d&&g.jsx("iframe",{title:u("rail.thumbnail"),sandbox:"allow-same-origin",srcDoc:d,tabIndex:-1,onLoad:E=>{const v=E.currentTarget.contentDocument;if(!v)return;Rh(v);const C=Mh(v);C&&m(A=>jh(A,C)?A:C)},className:"pointer-events-none absolute left-0 top-0 border-0",style:{width:a.width,height:a.height,transform:`translate(${b.translateX}px, ${b.translateY}px) scale(${b.scale})`,transformOrigin:"top left"}})})}const ZC=152;function FC({master:r,slides:a,activeIndex:i,onSelect:s}){const{t:u}=ln(),d=w.useRef(null);return w.useEffect(()=>{var h;(h=d.current)==null||h.scrollIntoView({block:"nearest"})},[i,a.length]),g.jsx("aside",{"data-testid":"thumbnail-rail","aria-label":u("rail.thumbnail"),className:"flex w-48 shrink-0 flex-col gap-2 overflow-y-auto border-r border-line p-3",children:a.map((h,m)=>{const y=m===i,b=zh(h,u("rail.untitled"));return g.jsxs("div",{ref:y?d:void 0,"data-testid":"thumbnail","data-slide-id":h.id,"data-slide-title":b,"aria-current":y?"page":void 0,className:`relative flex flex-col gap-1 rounded border p-1 transition-colors ${y?"border-accent/70 bg-accent-soft":"border-line hover:border-line-strong"}`,children:[g.jsx(_h,{master:r,slide:h,width:ZC,className:"rounded-[2px] shadow-[0_4px_12px_var(--editor-shadow-panel)]"}),y&&g.jsx("span",{"data-testid":"thumbnail-active-marker","aria-hidden":"true",title:u("rail.current"),className:"absolute right-1 top-1 rounded bg-accent px-1 py-0.5 text-[10px] font-semibold text-on-accent",children:"✓"}),g.jsxs("span",{className:`flex items-center gap-1 px-1 pb-0.5 text-[11px] ${y?"text-accent":"text-muted"}`,children:[g.jsx("span",{className:"tabular-nums",children:m+1}),g.jsx("span",{className:"truncate",children:b})]}),g.jsx("button",{type:"button","aria-label":u("rail.pageTitle",{index:m+1,title:b}),"aria-current":y?"page":void 0,onClick:()=>s(m),className:"absolute inset-0 rounded focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"})]},h.id)})})}const JC=4,PC=320;function WC({master:r,slides:a,activeIndex:i,onSelect:s,onReorder:u,onDuplicate:d,onDelete:h,canDelete:m}){const{t:y}=ln(),b=w.useRef(null),[E,v]=w.useState(null),[C,A]=w.useState(null),B=()=>{b.current=null,v(null),A(null)},D=(Y,R)=>{Y.button!==0||Y.target.closest("button")||(Y.currentTarget.setPointerCapture(Y.pointerId),b.current={pointerId:Y.pointerId,from:R,startX:Y.clientX,startY:Y.clientY,moved:!1,target:R})},G=Y=>{const R=b.current;if(!R||R.pointerId!==Y.pointerId)return;if(!R.moved){if(Math.hypot(Y.clientX-R.startX,Y.clientY-R.startY)<JC)return;R.moved=!0,v(R.from)}Y.preventDefault();const re=document.elementFromPoint(Y.clientX,Y.clientY),ve=re==null?void 0:re.closest("[data-sorter-index]"),Z=ve?Number(ve.getAttribute("data-sorter-index")):Number.NaN,Se=Number.isInteger(Z)?Z:null;R.target=Se,A(Se)},ae=Y=>{const R=b.current;if(!R||R.pointerId!==Y.pointerId)return;Y.currentTarget.hasPointerCapture(Y.pointerId)&&Y.currentTarget.releasePointerCapture(Y.pointerId);const{from:re,moved:ve,target:Z}=R;if(B(),!ve){s(re);return}Z!==null&&Z!==re&&u(VC(a,re,Z))},se=(Y,R)=>{Y.target===Y.currentTarget&&(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),s(R))};return g.jsxs("main",{"data-testid":"sorter-view",className:"min-h-0 flex-1 overflow-auto bg-canvas p-6",children:[g.jsxs("div",{className:"mb-4 flex items-baseline justify-between",children:[g.jsx("h2",{className:"text-sm font-semibold text-ink",children:y("sorter.title")}),g.jsx("p",{className:"text-xs text-muted",children:y("sorter.hint")})]}),g.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:a.map((Y,R)=>{const re=R===i,ve=zh(Y,y("rail.untitled")),Z=E!==null&&C===R&&C!==E;return g.jsxs("div",{"data-sorter-index":R,onPointerDown:Se=>D(Se,R),onPointerMove:G,onPointerUp:ae,onPointerCancel:B,className:`relative flex cursor-grab flex-col gap-2 rounded-lg border p-2 transition-colors ${re?"border-accent/70 bg-accent-soft":"border-line bg-surface hover:border-line-strong"} ${E===R?"opacity-50":""} ${Z?"ring-2 ring-accent":""}`,children:[g.jsx("div",{role:"listbox","aria-label":y("sorter.page",{index:R+1}),className:"rounded",children:g.jsxs("div",{role:"option",tabIndex:0,"aria-selected":re,"aria-current":re?"page":void 0,"aria-label":y("sorter.pageTitle",{index:R+1,title:ve}),"data-testid":"sorter-slide","data-slide-id":Y.id,"data-slide-title":ve,onKeyDown:Se=>se(Se,R),className:"relative flex flex-col gap-2 rounded focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[g.jsx("span",{"data-testid":"sorter-slide-number",className:"absolute left-1 top-1 z-10 rounded bg-overlay-solid px-1.5 py-0.5 text-[11px] tabular-nums text-on-overlay",children:R+1}),re&&g.jsx("span",{"data-testid":"sorter-active-marker","aria-hidden":"true",className:"absolute right-1 top-1 z-10 rounded bg-accent px-1.5 py-0.5 text-[10px] font-semibold text-on-accent",children:y("sorter.current")}),g.jsx(_h,{master:r,slide:Y,width:PC,className:"rounded-[3px] shadow-[0_4px_12px_var(--editor-shadow-panel)]"}),g.jsx("span",{className:`truncate px-1 text-xs ${re?"text-accent":"text-muted"}`,children:ve})]})}),g.jsxs("div",{className:"flex justify-end gap-1",children:[g.jsx("button",{type:"button","data-testid":"sorter-duplicate","aria-label":y("sorter.copyLabel",{index:R+1}),onClick:Se=>{Se.detail<=1&&d(R)},className:"rounded border border-line-strong px-2 py-1 text-[11px] text-muted hover:bg-hover hover:text-ink",children:y("sorter.copy")}),g.jsx("button",{type:"button","data-testid":"sorter-delete","aria-label":y("sorter.deleteLabel",{index:R+1}),onClick:Se=>{Se.detail<=1&&h(R)},disabled:!m,className:"rounded border border-line-strong px-2 py-1 text-[11px] text-muted hover:bg-hover hover:text-ink disabled:opacity-40",children:y("sorter.delete")})]})]},Y.id)})})]})}const kh="htmlcraft.theme",eN=new Set(["light","dark","system"]);function Mx(r){return typeof r=="string"&&eN.has(r)}function tN(r,a){return r==="system"?a?"dark":"light":r}function nN(){try{return typeof localStorage>"u"?null:localStorage.getItem(kh)}catch{return null}}function lN(r){let a=null;try{a=r?r.getItem(kh):nN()}catch{a=null}return Mx(a)?a:"system"}function rN(r,a){document.documentElement.dataset.theme=r,document.documentElement.dataset.themeMode=a,document.documentElement.style.colorScheme=r}const zx=w.createContext(null);function pv(){return typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function aN({children:r,initialMode:a}){const[i,s]=w.useState(()=>a??lN()),[u,d]=w.useState(pv),h=tN(i,u),m=w.useCallback(b=>{if(Mx(b)){b==="system"&&d(pv()),s(b);try{localStorage.setItem(kh,b)}catch{}}},[]);w.useLayoutEffect(()=>{rN(h,i)},[h,i]),w.useEffect(()=>{if(i!=="system"||typeof window.matchMedia!="function")return;const b=window.matchMedia("(prefers-color-scheme: dark)"),E=v=>{d(v.matches)};return d(b.matches),b.addEventListener("change",E),()=>b.removeEventListener("change",E)},[i]);const y=w.useMemo(()=>({mode:i,resolved:h,setMode:m}),[i,h,m]);return g.jsx(zx.Provider,{value:y,children:r})}function iN(){const r=w.useContext(zx);if(!r)throw new Error("useTheme must be used inside ThemeProvider");return r}const oN="rounded border border-line-strong px-2 py-1 text-xs text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",sN="rounded px-2 py-1 text-left text-xs text-ink transition-colors hover:bg-hover disabled:opacity-40",cN=[{format:"html",label:"export.html",hint:"export.htmlHint",hostOnly:!1},{format:"pdf",label:"export.pdf",hint:"export.pdfHint",hostOnly:!0},{format:"png",label:"export.png",hint:"export.pngHint",hostOnly:!0}];function uN({signal:r,exporting:a,standalone:i,onExport:s}){const{t:u}=ln(),[d,h]=w.useState(!1),m=w.useRef(null),y=w.useRef(null);w.useEffect(()=>{r>0&&h(!0)},[r]),w.useEffect(()=>{if(!d)return;const v=C=>{var B,D;const A=C.target;(B=y.current)!=null&&B.contains(A)||(D=m.current)!=null&&D.contains(A)||h(!1)};return document.addEventListener("pointerdown",v,!0),()=>document.removeEventListener("pointerdown",v,!0)},[d]),w.useEffect(()=>{var C;if(!d)return;const v=(C=y.current)==null?void 0:C.querySelector("button:not(:disabled)");v==null||v.focus()},[d]);const b=(v=!0)=>{var C;h(!1),v&&((C=m.current)==null||C.focus())},E=v=>{b(),s(v)};return g.jsxs("div",{className:"relative",children:[g.jsx("button",{ref:m,type:"button","data-testid":"export-open","aria-haspopup":"menu","aria-expanded":d,className:oN,disabled:a!==null,title:u("export.title"),onClick:()=>h(v=>!v),onKeyDown:v=>{v.key==="Escape"&&d&&(v.preventDefault(),v.stopPropagation(),b())},children:u(a?"export.busy":"export.label")}),d&&g.jsx("div",{ref:y,role:"menu","aria-label":u("export.format"),"data-testid":"export-menu",className:"absolute right-0 top-full z-20 mt-1 flex w-56 flex-col gap-1 rounded border border-line-strong bg-raised p-2 shadow-[0_24px_60px_var(--editor-shadow-panel)]",onKeyDown:v=>{var D,G;if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),b();return}if(v.key!=="ArrowDown"&&v.key!=="ArrowUp")return;v.preventDefault();const C=Array.from(((D=y.current)==null?void 0:D.querySelectorAll("button:not(:disabled)"))??[]);if(C.length===0)return;const A=C.indexOf(document.activeElement),B=v.key==="ArrowDown"?1:-1;(G=C[(A+B+C.length)%C.length])==null||G.focus()},children:cN.map(({format:v,label:C,hint:A,hostOnly:B})=>{const D=a!==null||i&&B;return g.jsxs("button",{type:"button",role:"menuitem","data-testid":`export-${v}`,className:sN,disabled:D,title:u(i&&B?"export.hostOnlyHint":A),onClick:()=>E(v),children:[g.jsx("span",{className:"block",children:u(C)}),g.jsx("span",{className:"block text-[10px] text-muted",children:u(i&&B?"export.hostOnly":A)})]},v)})})]})}const qs="rounded border border-line-strong px-2 py-1 text-xs text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",Gp="absolute left-0 top-full z-20 mt-1 flex w-max flex-col gap-1 rounded border border-line-strong bg-raised p-2 shadow-[0_24px_60px_var(--editor-shadow-panel)]",hv="w-16 rounded border border-line-strong bg-input px-2 py-1 text-xs text-ink outline-none focus:border-accent/70",dN=[{shape:"rect",label:"insert.rect"},{shape:"rounded-rect",label:"insert.rounded"},{shape:"ellipse",label:"insert.ellipse"},{shape:"triangle",label:"insert.triangle"},{shape:"line",label:"insert.line"},{shape:"arrow",label:"insert.arrow"}];function fN({onInsertText:r,onInsertShape:a,onInsertTable:i,onInsertChart:s,onInsertImageFile:u,onInsertImageUrl:d}){const{t:h}=ln(),[m,y]=w.useState(null),[b,E]=w.useState("3"),[v,C]=w.useState("3"),A=w.useRef(null),B=w.useRef({shape:null,table:null,image:null}),D=R=>{var re;y(null),(re=B.current[R])==null||re.focus()},G=(R,re)=>{R.key==="Escape"&&(R.preventDefault(),R.stopPropagation(),D(re))},ae=(R,re)=>{const ve=Number(R);return Number.isInteger(ve)&&ve>=1&&ve<=re?ve:null},se=ae(b,50),Y=ae(v,20);return g.jsxs("div",{className:"flex items-center gap-1",role:"group","aria-label":h("insert.group"),children:[g.jsx("button",{type:"button","data-testid":"insert-text",title:h("insert.textHint"),className:qs,onClick:r,children:h("insert.text")}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"insert-shape",title:h("insert.shapeHint"),"aria-expanded":m==="shape",ref:R=>{B.current.shape=R},className:qs,onClick:()=>y(R=>R==="shape"?null:"shape"),onKeyDown:R=>{m==="shape"&&G(R,"shape")},children:h("insert.shape")}),m==="shape"&&g.jsx("div",{"data-testid":"insert-menu-shape",className:Gp,onKeyDown:R=>G(R,"shape"),children:dN.map(({shape:R,label:re})=>g.jsx("button",{type:"button","data-testid":`insert-shape-${R}`,className:"rounded px-2 py-1 text-left text-xs text-ink hover:bg-hover",onClick:()=>{y(null),a(R)},children:h(re)},R))})]}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"insert-table",title:h("insert.tableHint"),"aria-expanded":m==="table",ref:R=>{B.current.table=R},className:qs,onClick:()=>y(R=>R==="table"?null:"table"),onKeyDown:R=>{m==="table"&&G(R,"table")},children:h("insert.table")}),m==="table"&&g.jsxs("div",{"data-testid":"insert-menu-table",className:Gp,onKeyDown:R=>G(R,"table"),children:[g.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted",children:[h("insert.rows"),g.jsx("input",{type:"number",min:1,max:50,"data-testid":"table-rows","aria-label":h("insert.rowsLabel"),value:b,onChange:R=>E(R.target.value),className:hv})]}),g.jsxs("label",{className:"flex items-center justify-between gap-2 text-xs text-muted",children:[h("insert.columns"),g.jsx("input",{type:"number",min:1,max:20,"data-testid":"table-columns","aria-label":h("insert.columnsLabel"),value:v,onChange:R=>C(R.target.value),className:hv})]}),g.jsx("button",{type:"button","data-testid":"table-insert",disabled:se===null||Y===null,className:"rounded bg-accent-soft px-2 py-1 text-xs text-accent transition-colors hover:bg-accent/20 disabled:opacity-40",onClick:()=>{se===null||Y===null||(y(null),i(se,Y))},children:h("insert.createTable")})]})]}),g.jsx("button",{type:"button","data-testid":"insert-chart",title:h("insert.chartHint"),className:qs,onClick:s,children:h("insert.chart")}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{type:"button","data-testid":"insert-image",title:h("insert.imageHint"),"aria-expanded":m==="image",ref:R=>{B.current.image=R},className:qs,onClick:()=>y(R=>R==="image"?null:"image"),onKeyDown:R=>{m==="image"&&G(R,"image")},children:h("insert.image")}),m==="image"&&g.jsxs("div",{"data-testid":"insert-menu-image",className:Gp,onKeyDown:R=>G(R,"image"),children:[g.jsx("button",{type:"button","data-testid":"insert-image-upload",className:"rounded px-2 py-1 text-left text-xs text-ink hover:bg-hover",onClick:()=>{var R;y(null),(R=A.current)==null||R.click()},children:h("insert.uploadImage")}),g.jsx("button",{type:"button","data-testid":"insert-image-url",className:"rounded px-2 py-1 text-left text-xs text-ink hover:bg-hover",onClick:()=>{y(null),d()},children:h("insert.imageUrl")})]}),g.jsx("input",{ref:A,"data-testid":"insert-image-input",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp,image/avif,image/svg+xml",className:"hidden",onChange:R=>{var ve;const re=(ve=R.target.files)==null?void 0:ve[0];R.target.value="",re&&u(re)}})]})]})}function pN({value:r,editable:a,opening:i,error:s,onOpen:u,onPick:d}){const{t:h}=ln(),[m,y]=w.useState(r),b=w.useRef(!1),E=w.useRef(!1),v=w.useRef(!1);w.useEffect(()=>{b.current||y(r)},[r]);const C=()=>{if(!a||i||E.current)return;const A=m.trim();!A||A===r||(E.current=!0,u(A),queueMicrotask(()=>{E.current=!1}))};return g.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[g.jsx("input",{"data-testid":"deck-path","aria-label":h("path.label"),"aria-invalid":s?!0:void 0,"aria-describedby":s?"deck-path-error":void 0,className:"w-64 truncate rounded border border-line-strong bg-input px-2 py-1 text-xs text-ink outline-none focus:border-accent/70",value:m,readOnly:!a,disabled:i,onChange:A=>y(A.target.value),onFocus:()=>{b.current=!0},onKeyDown:A=>{A.key==="Enter"?(A.preventDefault(),C()):A.key==="Escape"&&(v.current=!0,y(r),A.currentTarget.blur())},onBlur:()=>{b.current=!1;const A=v.current;v.current=!1,A||C()}}),g.jsx("button",{type:"button","data-testid":"deck-picker",className:"rounded border border-line-strong px-2 py-1 text-xs text-muted hover:bg-hover hover:text-ink",title:h("path.openHint"),"aria-label":h("path.openHint"),disabled:i,onPointerDown:A=>A.preventDefault(),onClick:d,children:h("path.open")}),s&&g.jsx("span",{id:"deck-path-error",role:"alert",className:"max-w-64 truncate text-xs text-danger",title:s,children:s})]})}const hN={loading:"common.loading",ready:"common.ready",saving:"common.saving",saved:"common.saved",external:"common.external",conflict:"common.conflict","load-error":"common.loadFailed",error:"common.saveFailed"},Hl="rounded border border-line-strong px-2 py-1 text-xs text-muted transition-colors hover:bg-hover hover:text-ink disabled:opacity-40",mv="rounded border border-accent/70 bg-accent-soft px-2 py-1 text-xs text-accent";function mN({filePath:r,pathEditable:a,openingDeck:i,openDeckError:s,onOpenDeck:u,onPickDeck:d,status:h,activeIndex:m,slideCount:y,view:b,canDelete:E,onAddSlide:v,onDuplicateSlide:C,onDeleteSlide:A,onInsertText:B,onInsertShape:D,onInsertTable:G,onInsertChart:ae,onInsertImageFile:se,onInsertImageUrl:Y,onUndo:R,onRedo:re,onPlay:ve,onOpenHelp:Z,onViewChange:Se,onPreviousSlide:st,onNextSlide:Ue,onExport:De,exporting:He,exportSignal:xe,standaloneUpload:pt=!1,standaloneMode:Pe=!1}){const{locale:z,setLocale:ce,t:ie}=ln(),{mode:Ge,setMode:Ve}=iN(),St=[["light",ie("theme.light")],["dark",ie("theme.dark")],["system",ie("theme.system")]];return g.jsxs("header",{"data-testid":"toolbar",className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line px-4 py-2",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("span",{className:"text-sm font-semibold tracking-wide",children:"htmlcraft"}),g.jsx(pN,{value:r,editable:a,opening:i,error:s,onOpen:u,onPick:d})]}),g.jsx("span",{"data-testid":"save-status",role:"status",className:`text-xs ${h==="error"||h==="load-error"?"text-danger":h==="conflict"||h==="external"?"text-warning":"text-muted"}`,children:ie(Pe&&h==="ready"?"status.opened":h==="saved"&&pt?"status.drafted":hN[h])}),Pe&&g.jsx("span",{"data-testid":"standalone-badge",className:"rounded border border-accent/40 px-2 py-0.5 text-[10px] text-accent",title:ie("toolbar.standaloneHint"),children:ie("toolbar.standaloneBadge")}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{type:"button","data-testid":"add-slide",className:Hl,title:ie("toolbar.addHint"),onClick:rt=>{rt.detail<=1&&v()},children:ie("toolbar.add")}),g.jsx("button",{type:"button","data-testid":"duplicate-slide",className:Hl,title:ie("toolbar.duplicateHint"),onClick:rt=>{rt.detail<=1&&C()},children:ie("toolbar.duplicate")}),g.jsx("button",{type:"button","data-testid":"delete-slide",className:Hl,title:ie(E?"toolbar.deleteHint":"toolbar.keepOneSlide"),onClick:rt=>{rt.detail<=1&&A()},disabled:!E,children:ie("toolbar.deleteSlide")})]}),g.jsx(fN,{onInsertText:B,onInsertShape:D,onInsertTable:G,onInsertChart:ae,onInsertImageFile:se,onInsertImageUrl:Y}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{type:"button","data-testid":"undo",className:Hl,title:ie("shortcuts.undo"),onClick:R,children:ie("shortcuts.undo")}),g.jsx("button",{type:"button","data-testid":"redo",className:Hl,title:ie("shortcuts.redo"),onClick:re,children:ie("shortcuts.redo")})]}),g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[g.jsx("button",{type:"button",className:Hl,onClick:st,disabled:m<=0,children:ie("toolbar.previous")}),g.jsxs("span",{"data-testid":"slide-counter",className:"tabular-nums",children:[y===0?0:m+1," / ",y]}),g.jsx("button",{type:"button",className:Hl,onClick:Ue,disabled:m>=y-1,children:ie("toolbar.next")})]}),g.jsxs("div",{className:"flex items-center gap-1",role:"group","aria-label":ie("toolbar.viewGroup"),children:[g.jsx("button",{type:"button","data-testid":"view-normal","aria-pressed":b==="normal",className:b==="normal"?mv:Hl,onClick:()=>Se("normal"),children:ie("toolbar.viewNormal")}),g.jsx("button",{type:"button","data-testid":"view-sorter","aria-pressed":b==="sorter",className:b==="sorter"?mv:Hl,onClick:()=>Se("sorter"),children:ie("toolbar.viewSorter")})]}),g.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[g.jsxs("select",{"data-testid":"locale-select","aria-label":ie("locale.label"),value:z,onChange:rt=>ce(rt.target.value),className:"rounded border border-line-strong bg-input px-2 py-1 text-xs text-ink",children:[g.jsx("option",{value:"en",children:"English"}),g.jsx("option",{value:"zh-Hant",children:"繁體中文"}),g.jsx("option",{value:"zh-Hans",children:"简体中文"})]}),g.jsx("div",{role:"group","aria-label":ie("theme.label"),"data-testid":"theme-select",className:"flex items-center gap-1",children:St.map(([rt,Pt])=>g.jsx("button",{type:"button","data-testid":`theme-${rt}`,"aria-pressed":Ge===rt,className:Ge===rt?"rounded border border-accent/70 bg-accent-soft px-2 py-1 text-xs text-accent":"rounded border border-line-strong px-2 py-1 text-xs text-muted hover:bg-hover hover:text-ink",onClick:()=>Ve(rt),children:Pt},rt))}),g.jsx("button",{type:"button","data-testid":"shortcuts-open","aria-label":ie("toolbar.shortcuts"),"aria-haspopup":"dialog",title:ie("toolbar.shortcutsTitle"),className:Hl,onClick:Z,children:ie("toolbar.shortcuts")}),g.jsx("button",{type:"button","data-testid":"play",className:Hl,title:ie("toolbar.play"),onClick:ve,children:ie("toolbar.play")}),g.jsx(uN,{signal:xe,exporting:He,standalone:Pe,onExport:De})]})]})}const gv={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},gN="input, textarea, select",yN='[contenteditable]:not([contenteditable="false"]), [data-ppt-editing]';function bN(r){if(!r)return null;const a=r;return a.nodeType===1?a:a.nodeType===3?a.parentElement:null}function Zu(r){const a=bN(r);return a?a.closest(gN)||a.isContentEditable?!0:a.closest(yN)!==null:!1}function _x(r){return!!(r.ctrlKey||r.metaKey)}function kx(r){return r.key.length===1?r.key.toLowerCase():r.key}function yv(r,a){return{type:"nudge",dx:r,dy:a}}function vN(r){if(r.isComposing||Zu(r.target)||r.altKey)return null;const a=kx(r),i=!!r.shiftKey;if(_x(r))return i?a==="z"?{type:"redo"}:a==="e"?{type:"export"}:a==="g"?{type:"ungroup"}:a==="="||a==="+"?{type:"zoom-in"}:null:a==="z"?{type:"undo"}:a==="y"?{type:"redo"}:a==="s"?{type:"save"}:a==="d"?{type:"duplicate"}:a==="g"?{type:"group"}:a==="a"?{type:"select-all"}:a==="c"?{type:"copy"}:a==="v"?{type:"paste"}:a==="="||a==="+"?{type:"zoom-in"}:a==="-"?{type:"zoom-out"}:a==="0"?{type:"zoom-fit"}:null;if(i){const u=gv[a];return u?yv(u[0]*10,u[1]*10):a==="F5"?{type:"play-from-current"}:a==="?"?{type:"help"}:null}if(a==="Delete"||a==="Backspace")return{type:"delete"};if(a==="Escape")return{type:"escape"};if(a==="Enter")return{type:"edit"};if(a==="F5")return{type:"play"};if(a==="?")return{type:"help"};const s=gv[a];return s?yv(s[0],s[1]):null}function xN(r){if(r.isComposing||r.repeat||r.altKey||r.shiftKey||!_x(r))return null;const a=kx(r);return a==="b"?{type:"bold"}:a==="i"?{type:"italic"}:a==="u"?{type:"underline"}:null}const bv=100,SN=500;class wN{constructor(){_r(this,"entries",[]);_r(this,"index",-1)}get canUndo(){return this.index>0}get canRedo(){return this.index>=0&&this.index<this.entries.length-1}push(a,i){const s=Date.now(),u=this.index<this.entries.length-1;u&&(this.entries=this.entries.slice(0,this.index+1));const d=this.entries[this.index];if(!u&&d&&i.coalesceKey!==void 0&&d.coalesceKey===i.coalesceKey&&s-d.pushedAt<=SN){d.value=a,d.meta=i.meta,d.pushedAt=s;return}this.entries.push({value:a,meta:i.meta,coalesceKey:i.coalesceKey,pushedAt:s}),this.entries.length>bv&&this.entries.splice(0,this.entries.length-bv),this.index=this.entries.length-1}updateCurrentMeta(a){const i=this.entries[this.index];i&&(i.meta=a)}undo(){return this.canUndo?(this.index-=1,this.entryAtCurrent()):null}redo(){return this.canRedo?(this.index+=1,this.entryAtCurrent()):null}clear(){this.entries=[],this.index=-1}entryAtCurrent(){const a=this.entries[this.index];return a?{value:a.value,meta:a.meta}:null}}const EN=/^(-?(?:\d+|\d*\.\d+))px$/;function vv(r){const a=EN.exec(r.trim());return(a==null?void 0:a[1])===void 0?null:Number(a[1])}function Hx(r,a,i){if(wl(r)){if(Do(r)||i!=null&&i.cssTransformOwned)return;ah(r,r.getAttribute("transform")??"",{x:20,y:20});return}const s=r.style;if(!s)return;const u=(i==null?void 0:i.position)||s.position;if(u!=="absolute"&&u!=="fixed"&&u!=="relative"){s.position="relative",s.left="20px",s.top="20px";return}s.position!==u&&(s.position=u);const d=vv(s.left),h=vv(s.top);if(u==="relative"){s.left=`${(d??0)+20}px`,s.top=`${(h??0)+20}px`;return}if(d!==null&&h!==null){s.left=`${d+20}px`,s.top=`${h+20}px`;return}let m=i;if(!m){const y=Ul(r,a),b=Bo(r,a);m={x:y.x-b.x,y:y.y-b.y,position:u}}s.left=`${(d??m.x)+20}px`,s.top=`${(h??m.y)+20}px`}function Lx(r){var i;const a=(i=r.getAttribute("data-ppt-el"))==null?void 0:i.trim();return a||null}function TN(r,a){const i=new Set(ur(r)),s=new Set;for(const u of a){if(u.length!==1)continue;const d=r.children[u[0]??-1];d&&i.has(d)&&s.add(d)}return Array.from(r.children).filter(u=>s.has(u)).map(u=>u.outerHTML)}function Ux(r){const a=new Set(Array.from(r.querySelectorAll("[data-ppt-el]"),s=>{var u;return((u=s.getAttribute("data-ppt-el"))==null?void 0:u.trim())??""}));let i=1;for(const s of a){const u=/^e(\d+)$/.exec(s);u!=null&&u[1]&&(i=Math.max(i,Number(u[1])+1))}return()=>{for(;a.has(`e${i}`);)i+=1;const s=`e${i}`;return i+=1,a.add(s),s}}function CN(r,a,i,s){var m;const u=(m=Ht(r)[a])==null?void 0:m.element;if(!u||i.length===0)return[];const d=Ux(u),h=[];for(const y of i){if(!y.trim())continue;const b=r.createElement("div");b.innerHTML=y;const E=b.firstElementChild;if(!E)continue;const v=Array.from(E.querySelectorAll("[data-ppt-el]"));E.setAttribute("data-ppt-el",d());for(const C of v)C.setAttribute("data-ppt-el",d());u.appendChild(E),Hx(E,u,(s==null?void 0:s(E))??null),h.push({slideIndex:a,path:[Array.from(u.children).indexOf(E)],elementId:Lx(E)})}return h}function NN(r,a,i){var h;const s=(h=Ht(r)[a])==null?void 0:h.element;if(!s)return 0;const u=new Set(ur(s)),d=new Set;for(const m of i){if(m.length!==1)continue;const y=s.children[m[0]??-1];y&&u.has(y)&&d.add(y)}for(const m of d)s.removeChild(m);return d.size}function AN(r,a,i){const s=a.importNode(r,!0);s.hasAttribute("data-ppt-el")&&s.setAttribute("data-ppt-el",i());for(const u of Array.from(s.querySelectorAll("[data-ppt-el]")))u.setAttribute("data-ppt-el",i());return s}function ON(r,a,i){var h;const s=(h=Ht(r)[a])==null?void 0:h.element;if(!s)return 0;const u=new Set;for(const m of i){if(m.length===0)continue;const y=je(s,m);y&&y!==s&&u.add(y)}let d=0;for(const m of u){let y=!0;for(let b=m.parentElement;b&&b!==s;b=b.parentElement)if(u.has(b)){y=!1;break}y&&m.parentElement&&(m.parentElement.removeChild(m),d+=1)}return d}function Yp(r,a,i,s,u,d){var E;const h=(E=Ht(r)[a])==null?void 0:E.element,m=h?je(h,s):null;if(!h||!m)return null;const y=AN(i,r,Ux(h)),b=u?je(h,u):null;return b&&b.parentElement===m?m.insertBefore(y,b.nextSibling):m.appendChild(y),Hx(y,h,(d==null?void 0:d(y,s))??null),{slideIndex:a,path:[...s,Array.from(m.children).indexOf(y)],elementId:Lx(y)}}const DN=r=>Nh[r];function ch(r,a){return!!(r!=null&&r.filePath&&(!a||r.filePath!==a))}const RN="[data-ppt-editing], [data-ppt-frame-slide]";function Vp(r){return r.querySelector(RN)!==null}function jN(){return{master:null,slides:[],activeIndex:0,selection:null,selections:[],scale:1,status:"loading",dirty:!1,pending:!1,recoveryBusy:!1,documentEpoch:0,conflict:null,srcDoc:"",filePath:"",error:""}}function Kp(r,a){return r.slideIndex===a.slideIndex&&r.path.length===a.path.length&&r.path.every((i,s)=>i===a.path[s])}function Gs(r){return r instanceof Error?r.message:String(r)}function Eo(r,a){const i=Ht(r),s=tc(a,i.length),u=i[s];return{slides:i,activeIndex:s,srcDoc:u?Lo(r,u):""}}function MN(r={}){const[a,i]=w.useState(jN),s=w.useRef(a),u=w.useRef(null),d=w.useRef([]),h=w.useRef(0),m=w.useRef(""),y=w.useRef(Promise.resolve()),b=w.useRef(0),E=w.useRef(0),v=w.useRef(0),C=w.useRef(0),A=w.useRef(0),B=w.useRef(new Map),D=w.useRef(!1),G=w.useRef(new wN),ae=w.useRef([]),se=w.useRef(r.persistence??jE()),Y=w.useRef(r.measurePastedObject);Y.current=r.measurePastedObject;const R=r.translate??DN,re=w.useRef(()=>{}),ve=w.useRef(()=>{}),Z=w.useRef(()=>{}),Se=w.useRef([]),st=w.useRef(new Set),Ue=w.useRef(!1),De=w.useRef(!1),He=w.useRef(null);He.current===null&&(He.current=uT(cT,()=>{re.current()})),w.useEffect(()=>{const F=He.current;return()=>F==null?void 0:F.cancel()},[]);const xe=w.useCallback(F=>{const ee={...s.current,...F};s.current=ee,i(ee)},[]),pt=w.useCallback(()=>{const F=B.current.size>0;xe({pending:F}),!F&&s.current.dirty&&ve.current()},[xe]),Pe=w.useCallback((F,ee)=>{var ne;v.current+=1,ee?B.current.set(F,ee):B.current.delete(F),(ne=He.current)==null||ne.cancel(),pt()},[pt]),z=w.useCallback(F=>{const ee=B.current.get(F);B.current.delete(F),ee==null||ee.discard(),pt()},[pt]),ce=w.useCallback(F=>{if(D.current)return!0;D.current=!0;try{for(const[ee,ne]of B.current)if(!(F!==void 0&&ee!==F)&&(B.current.delete(ee),!ne.apply()))return B.current.set(ee,ne),xe({error:R("editor.pendingEditFailed")}),!1;return!0}finally{D.current=!1,pt()}},[pt,R,xe]),ie=w.useCallback((F,ee=null)=>{const ne=b.current,pe=C.current;E.current+=1;const ue=y.current.then(async()=>{var he,qe;if(b.current===ne)try{const Me=await F(m.current);Me.revision!==m.current&&st.current.add(Me.revision),m.current=Me.revision;const Fe=s.current.conflict===ee?null:s.current.conflict,vt=C.current!==pe;xe({status:Fe?"conflict":vt?"saving":"saved",dirty:vt,error:"",conflict:Fe}),vt&&ve.current()}catch(Me){if(Me instanceof Pp){(he=He.current)==null||he.cancel();const Fe=Me.filePath??((qe=s.current.conflict)==null?void 0:qe.filePath);xe({conflict:{revision:Me.revision,...Fe?{filePath:Fe}:{}},status:"conflict",error:""})}else xe({status:"error",error:Gs(Me),dirty:!0});throw Me}});return y.current=ue.then(()=>{},()=>{}),ue.finally(()=>{E.current-=1,Z.current()})},[xe]);ve.current=()=>{var F;!s.current.conflict&&!B.current.size&&!De.current&&((F=He.current)==null||F.schedule())},re.current=()=>{if(s.current.conflict||B.current.size||De.current)return;const F=u.current;if(!F)return;const ee=vn(F);xe({status:"saving",error:""}),ie(ne=>se.current.save(ee,ne)).catch(()=>{})};const Ge=w.useCallback(async F=>{var ee;b.current+=1,(ee=He.current)==null||ee.cancel(),Se.current=[],await y.current,xe({status:"loading",error:""});try{const ne=F??await se.current.load(),pe=Ks(ne.html);Vp(pe)||Lp(pe);const ue=Eo(pe,0);u.current=pe,m.current=ne.revision,d.current=ue.slides,h.current=ue.activeIndex,G.current.clear(),G.current.push(vn(pe),{meta:ue.activeIndex}),xe({master:pe,slides:ue.slides,activeIndex:ue.activeIndex,srcDoc:ue.srcDoc,selection:null,selections:[],status:"ready",dirty:!1,conflict:null,documentEpoch:s.current.documentEpoch+1,filePath:ne.filePath,error:""})}catch(ne){xe({status:"load-error",error:Gs(ne)})}},[xe]),Ve=w.useCallback(async(F,ee,ne,pe)=>{var Ze,Le,At;if(await y.current,A.current!==ne)return;if(v.current!==ee){(Ze=He.current)==null||Ze.cancel(),xe({conflict:{revision:F.revision,source:pe,filePath:F.filePath},status:"conflict",error:""});return}(Le=He.current)==null||Le.cancel();for(const en of B.current.values())en.discard();B.current.clear();const ue=Ks(F.html);Vp(ue)||Lp(ue);const he=Ht(ue),qe=d.current,Me=((At=qe[h.current])==null?void 0:At.id)??null;let Fe=h.current;if(Me){const en=he.findIndex(Nl=>Nl.id===Me);en>=0&&(Fe=en)}const vt=tc(Fe,he.length),J=pT(s.current.selections,qe,he);u.current=ue,m.current=F.revision,d.current=he,h.current=vt,G.current.clear(),G.current.push(vn(ue),{meta:vt});const oe=he[vt];xe({master:ue,slides:he,activeIndex:vt,srcDoc:oe?Lo(ue,oe):"",selection:J[0]??null,selections:J,status:"ready",dirty:!1,pending:!1,documentEpoch:s.current.documentEpoch+1,conflict:null,filePath:F.filePath,error:""})},[xe]),St=w.useCallback(async()=>{var F,ee;if(!Ue.current){Ue.current=!0;try{for(;Se.current.length>0;){if(E.current>0||De.current)return;if(!m.current){Se.current=[];break}const ne=Se.current.findIndex(Me=>st.current.has(Me.revision));if(ne>=0){for(const Me of Se.current.splice(0,ne+1))st.current.delete(Me.revision);continue}const pe=Se.current.shift();if(!pe)break;const ue=oT(pe,{revision:m.current,dirty:s.current.dirty||s.current.pending||s.current.conflict!==null,filePath:s.current.filePath});if(ue.type==="ignore")continue;if(ue.type==="conflict"){(F=He.current)==null||F.cancel();const Me=ue.filePath??((ee=s.current.conflict)==null?void 0:ee.filePath);xe({conflict:{revision:ue.revision,source:ue.source,...Me?{filePath:Me}:{}},status:"conflict",error:""});continue}xe({status:"external",error:""});const he=v.current,qe=A.current;try{const Me=await se.current.load();if(A.current!==qe)continue;if(Me.revision===m.current&&Me.filePath===s.current.filePath&&v.current===he){xe({status:"ready"});continue}await Ve(Me,he,qe,ue.source)}catch(Me){A.current===qe&&xe({status:"error",error:Gs(Me)})}}}finally{Ue.current=!1}}},[Ve,xe]),rt=w.useCallback(F=>{m.current&&(Se.current.push(F),Z.current())},[]);Z.current=()=>{St()};const Pt=w.useCallback(F=>{if(!ce())return;const ee=u.current;if(!ee)return;const ne=Eo(ee,F);d.current=ne.slides,h.current=ne.activeIndex,G.current.updateCurrentMeta(ne.activeIndex),xe({slides:ne.slides,activeIndex:ne.activeIndex,srcDoc:ne.srcDoc,selection:null,selections:[]})},[ce,xe]),O=w.useCallback(F=>{if(!ce())return;const ee=[];for(const ue of F)ee.some(he=>Kp(he,ue))||ee.push(ue);const pe=TT(ee.map(ue=>ue.path)).map(ue=>ee.find(he=>he.path.join(".")===ue.join("."))).filter(ue=>ue!==void 0);xe({selection:pe[0]??null,selections:pe})},[ce,xe]),P=w.useCallback(F=>{O(F?[F]:[])},[O]),te=w.useCallback(F=>{O(F)},[O]),we=w.useCallback(F=>{var he;const ne=s.current.selections;if(!(((he=ne[0])==null?void 0:he.slideIndex)===F.slideIndex)){O([F]);return}const ue=ne.some(qe=>Kp(qe,F));O(ue?ne.filter(qe=>!Kp(qe,F)):[...ne,F])},[O]),Ye=w.useCallback(()=>{const F=d.current[h.current];if(!F)return;const ee=ur(F.element).map(ne=>{var pe;return{slideIndex:h.current,path:[Array.from(F.element.children).indexOf(ne)],elementId:((pe=ne.getAttribute("data-ppt-el"))==null?void 0:pe.trim())||null}});O(ee)},[O]),$e=w.useCallback(()=>{ce()&&xe({selection:null,selections:[]})},[ce,xe]),Ae=w.useCallback(F=>{xe({scale:Number.isFinite(F)&&F>0?F:1})},[xe]),ge=w.useCallback((F,ee,ne={})=>{if(!ce())return null;const pe=u.current;if(!pe)return null;const he=Ht(pe)[F];if(!he)return null;ee(he.element,pe),v.current+=1,C.current+=1;const qe=vn(pe);G.current.push(qe,{coalesceKey:ne.coalesceKey,meta:h.current});const Me=Eo(pe,h.current);return d.current=Me.slides,h.current=Me.activeIndex,xe({slides:Me.slides,activeIndex:Me.activeIndex,srcDoc:Me.srcDoc,dirty:!0}),ve.current(),qe},[ce,xe]),Ne=w.useCallback(async F=>{if(!ce())return;const ee=u.current,ne=d.current[h.current];if(!ee||!ne)return;let pe;try{const he=F(ee,ne);pe=typeof he=="string"?he:vn(ee)}catch(he){throw xe({status:"error",error:Gs(he)}),he}v.current+=1,C.current+=1,G.current.push(pe,{meta:h.current});const ue=Ht(ee);d.current=ue,xe({slides:ue,dirty:!0,status:s.current.conflict?"conflict":"saving"}),ve.current()},[ce,xe]),at=w.useCallback(async F=>{if(!ce())return;const ee=u.current;if(!ee)return;let ne;try{if(F(ee)===!1)return;ne=vn(ee)}catch(ue){throw xe({status:"error",error:Gs(ue)}),ue}v.current+=1,C.current+=1,G.current.push(ne,{meta:h.current});const pe=Eo(ee,h.current);d.current=pe.slides,h.current=pe.activeIndex,xe({slides:pe.slides,activeIndex:pe.activeIndex,srcDoc:pe.srcDoc,dirty:!0,status:s.current.conflict?"conflict":"saving"}),ve.current()},[ce,xe]),kn=w.useCallback(()=>{const F=s.current.selections.filter(pe=>pe.slideIndex===h.current);if(F.length===0)return;const ee=d.current[h.current];if(!ee)return;const ne=[];for(const pe of F){const ue=je(ee.element,pe.path);if(!ue||Xn(ue))continue;const he=ue.namespaceURI===Ho;ne.push({node:ue.cloneNode(!0),svg:he,internal:he&&wl(ue)})}ne.length>0&&(ae.current=ne)},[]),rn=w.useCallback(async F=>{const ee=h.current;F.length===0||!u.current||d.current[ee]&&await at(ne=>{const pe=CN(ne,ee,F,Y.current);if(pe.length===0)return!1;h.current===ee&&O(pe)})},[O,at]),Rt=w.useCallback(async()=>{const F=ae.current;if(F.length===0)return"empty";const ee=d.current[h.current];if(!ee)return"empty";const ne=s.current.selections.filter(Fe=>Fe.slideIndex===h.current);if(ne.length===1){const Fe=ne[0],vt=Fe&&Fe.path.length>1?je(ee.element,Fe.path):null;if(vt&&Xn(vt))return"table-cell"}if(ne.length>1&&ne.some(Fe=>Fe.path.length>1))return"refused";const pe=ne.length===1?ne[0]:null,ue=(pe==null?void 0:pe.path)??null,he=ue!==null&&ue.length>1?ue.slice(0,-1):null;if(he!==null&&ue!==null&&El(ee.element,ue)!==null||he!==null&&F.length>1)return"refused";let qe=!1,Me=0;return await at(Fe=>{const vt=[],J=he!==null?je(ee.element,he):null;for(const oe of F){if(he!==null&&ue!==null&&J!==null){if(oe.svg===(J.namespaceURI===Ho)){const At=Yp(Fe,h.current,oe.node,he,ue,Y.current);At&&vt.push(At);continue}if(oe.internal){qe=!0;continue}}else if(oe.internal){qe=!0;continue}const Ze=Yp(Fe,h.current,oe.node,[],null,Y.current);Ze&&vt.push(Ze)}if(vt.length===0)return!1;Me=vt.length,O(vt)}),qe?"kind-mismatch":Me>0?"pasted":"empty"},[O,at]),wt=w.useCallback(async()=>{const F=s.current,ee=d.current[h.current];if(!ee)return;const ne=F.selections.filter(he=>he.slideIndex===h.current);if(ne.length===0||ne.length>1&&ne.some(he=>he.path.length>1))return;if(ne.length!==1||ne[0].path.length<2){const he=TN(ee.element,ne.map(qe=>qe.path));he.length>0&&await rn(he);return}const pe=ne[0],ue=je(ee.element,pe.path);!ue||!ue.parentElement||Xn(ue)||El(ee.element,pe.path)===null&&await at(he=>{const qe=Yp(he,h.current,ue,pe.path.slice(0,-1),pe.path,Y.current);if(!qe)return!1;O([qe])})},[O,at,rn]),tt=w.useCallback(async()=>{const F=s.current,ee=h.current,ne=d.current[ee];if(!ne)return;const pe=F.selections.filter(he=>he.slideIndex===ee);if(pe.length===0)return;const ue=pe.some(he=>he.path.length>1);if(!(pe.length>1&&ue)){if(pe.length===1&&pe[0].path.length>1){const he=je(ne.element,pe[0].path);if(!he||Xn(he)||El(ne.element,pe[0].path))return}await at(he=>{(ue?ON(he,ee,pe.map(Me=>Me.path)):NN(he,ee,pe.map(Me=>Me.path)))>0&&h.current===ee&&O([])})}},[O,at]),Vt=w.useCallback(async()=>{var ne;if(De.current||!ce())return;const F=u.current;if(!F||s.current.conflict)return;const ee=vn(F);(ne=He.current)==null||ne.cancel(),xe({status:"saving",error:""}),await ie(pe=>se.current.save(ee,pe))},[ie,ce,xe]),Wt=w.useCallback(F=>{var Fe,vt;b.current+=1,(Fe=He.current)==null||Fe.cancel();for(const J of B.current.values())J.discard();B.current.clear();const ee=Ks(F);Vp(ee)||Lp(ee);const pe=((vt=d.current[h.current])==null?void 0:vt.id)??null,ue=Eo(ee,0);let he=0;if(pe){const J=ue.slides.findIndex(oe=>oe.id===pe);J>=0&&(he=J)}const qe=tc(he,ue.slides.length),Me=ue.slides[qe];u.current=ee,d.current=ue.slides,h.current=qe,G.current.clear(),G.current.push(vn(ee),{meta:qe}),xe({master:ee,slides:ue.slides,activeIndex:qe,srcDoc:Me?Lo(ee,Me):"",selection:null,selections:[],dirty:!0,pending:!1,status:"saving",conflict:null,documentEpoch:s.current.documentEpoch+1,error:""}),ve.current()},[xe]),Lt=w.useCallback(F=>{const ee=Ks(F.value),ne=Eo(ee,F.meta);u.current=ee,d.current=ne.slides,h.current=ne.activeIndex,v.current+=1,C.current+=1,xe({master:ee,slides:ne.slides,activeIndex:ne.activeIndex,srcDoc:ne.srcDoc,dirty:!0,status:s.current.conflict?"conflict":"saving",selection:null,selections:[],error:""}),ve.current()},[xe]),xn=w.useCallback(()=>{if(!ce())return;const F=G.current.undo();F!==null&&Lt(F)},[Lt,ce]),Hn=w.useCallback(()=>{if(!ce())return;const F=G.current.redo();F!==null&&Lt(F)},[Lt,ce]),Ut=w.useCallback(async F=>{var pe;if(De.current)return;const ee=v.current,ne=++A.current;b.current+=1,(pe=He.current)==null||pe.cancel(),De.current=!0,xe({status:"loading",recoveryBusy:!0,error:""});try{await y.current;const ue=F??await se.current.load();await Ve(ue,ee,ne)}catch{xe({status:"error",error:R("editor.reloadFailed")})}finally{De.current=!1,xe({recoveryBusy:!1}),s.current.dirty&&ve.current(),Z.current()}},[Ve,R,xe]),Sn=w.useCallback(async()=>{var ne;if(ch(s.current.conflict,s.current.filePath)){xe({status:"conflict",error:R("conflict.switched")});return}const F=u.current;if(!F||De.current)return;if(B.current.size){xe({error:R("editor.pendingEditInstruction")});return}A.current+=1,De.current=!0;const ee=vn(F);(ne=He.current)==null||ne.cancel(),xe({status:"saving",recoveryBusy:!0,error:""});try{await ie(pe=>se.current.save(ee,pe,{force:!0}),s.current.conflict)}catch{}finally{De.current=!1,xe({recoveryBusy:!1}),Z.current(),s.current.dirty&&ve.current()}},[ie,R,xe]),Ln=w.useCallback(()=>{const F=u.current;!F||!s.current.dirty||s.current.pending||s.current.conflict||De.current||se.current.flush(vn(F),m.current)},[]),Zn=w.useMemo(()=>({changePendingEdit:Pe,cancelPendingEdit:z,settlePendingEdits:ce,load:Ge,showSlide:Pt,select:P,selectTargets:te,toggleSelect:we,selectAll:Ye,clearSelection:$e,setScale:Ae,applySlideMutation:ge,commit:Ne,commitMaster:at,saveNow:Vt,copySelection:kn,pasteObjects:Rt,duplicateSelection:wt,deleteSelection:tt,undo:xn,redo:Hn,reload:Ut,overwrite:Sn,restoreDraft:Wt,receiveRevision:rt,flushBeforeUnload:Ln}),[Pe,z,ce,Ge,Pt,P,te,we,Ye,$e,Ae,ge,Ne,at,Vt,kn,Rt,wt,tt,xn,Hn,Ut,Sn,Wt,rt,Ln]);return{state:a,actions:Zn}}const zN=6e3,_N=6,xv=4,Sv=2,kN=.1,HN=3,wv=1.2,To="data-ppt-hover";function Yu(r,a){return r.slideIndex===a.slideIndex&&r.path.length===a.path.length&&r.path.every((i,s)=>i===a.path[s])}function LN(r){return r instanceof Error?r.message:String(r)}function Co(r){const a=r;return a&&a.nodeType===1?a:null}function UN(r,a){const i=gx(r,a);return!i||!Aa(i)?null:nh(r,i)}function Vu(r,a,i){if(!r||!a)return null;const s=si(a,r);return s?$T(s,i):null}function BN(r,a){const i=r.createRange(),s=a.firstChild;return s?(i.setStart(s,0),i.setEnd(a,a.childNodes.length)):i.selectNodeContents(a),i}function Ys(r){if(!r)return!1;if(r.closest(`[${Kn}]`)||r.isContentEditable)return!0;const a=r.tagName.toUpperCase();return a==="INPUT"||a==="TEXTAREA"||a==="SELECT"}function Ev(r,a,i){const s=i.getBoundingClientRect();return{x:r-s.left,y:a-s.top}}function Tv(r,a){return ur(r).filter(i=>!a.includes(i)).map(i=>Ul(i,r))}function Xp(r,a){return{x:0,y:0,width:r,height:a}}function cr(r,a){return{...r,x:r.x+a.x,y:r.y+a.y}}function Cv(r,a){return r.map(i=>({...i,position:i.position+(i.axis==="x"?a.x:a.y)}))}function No(r){const a=r.getBoundingClientRect();return{x:a.left,y:a.top}}const IN={canGroup:!1,canUngroup:!1,canAlign:!1,canDistribute:!1,canOrder:!1,canToggle:!1,locked:!1,hidden:!1,group:!1};function qN(r,a,i){if(!r)return null;const s=[];for(const u of a){if(u.slideIndex!==i||u.path.length!==1)return null;const d=je(r.element,u.path);if(!d)return null;s.push(d)}return s}function Nv(r,a){return Xu(r,a)!==null}function GN(r,a,i){const s=qN(r,a,i);if(!s||s.length===0)return IN;const u=s.every(m=>!cn(m)),d=s.every(m=>!un(m)),h=s.length===1?s[0]??null:null;return{canGroup:s.length>=2&&u&&d&&s.every(m=>!_n(m)&&!m.querySelector("[data-ppt-group]")),canUngroup:!!(h&&_n(h)&&u&&d),canAlign:s.length>=2&&u&&d,canDistribute:s.length>=3&&u&&d,canOrder:!!(h&&u&&d),canToggle:!!h,locked:cn(h),hidden:un(h),group:_n(h)}}function YN(r,a,i){if(!r||a.length!==1)return null;const s=a[0];if(!s||s.slideIndex!==i||s.path.length<2)return null;const u=je(r.element,s.path);return u?{locked:cn(u),hidden:un(u),group:_n(u)}:null}function VN(r){if(!r)return"";try{return new URL(r).origin}catch{return""}}function KN(r,a){switch(r.code){case"invalid-path":return a("path.invalid");case"not-found":return a("path.notFound");case"unsupported-extension":return a("path.extension");case"invalid-deck":return a("path.invalidDeck");case"unauthorized":return a("path.unauthorized");case"host-closing":return a("path.hostClosing");case"deck-unreadable":return a("path.unreadable");case"deck-already-open":{const i=VN(r.url);return i?a("path.alreadyOpen",{url:i}):a("path.alreadyOpenOther")}default:return r.message||a("path.openFailed")}}function XN(){const{locale:r,t:a}=ln(),i=w.useRef(null),s=w.useRef(null),u=w.useCallback((p,S)=>{var W;const T=(W=i.current)==null?void 0:W.contentDocument;if(!T)return null;const M=T.querySelector(`[${Pu}]`)??T.body;if(!M)return null;const I=S&&S.length>0?je(M,S)??M:M,$=M.ownerDocument.importNode(p,!0);I.appendChild($);try{const Q=M.ownerDocument.defaultView,X=(Q==null?void 0:Q.getComputedStyle($).position)??"",Te=Ul($,M),le=Bo($,M),fe=wl($)&&Do($);return{x:Te.x-le.x,y:Te.y-le.y,position:X,cssTransformOwned:fe}}finally{$.remove()}},[]),d=w.useRef(null),h=w.useMemo(()=>$E(()=>d.current),[]),m=w.useMemo(()=>({load:()=>Jp(),save:(p,S,T)=>d.current?h.save(p,S,T):ax(p,S,T),flush:(p,S)=>{d.current?h.flush(p,S):ox(p,S)}}),[h]),{state:y,actions:b}=MN({measurePastedObject:u,persistence:m,translate:a}),{slides:E,activeIndex:v,srcDoc:C,scale:A,status:B,error:D,filePath:G,selection:ae,selections:se,master:Y,dirty:R,conflict:re}=y,ve=ch(re,G),Z=E[v],[Se,st]=w.useState("normal"),[Ue,De]=w.useState(!1),[He,xe]=w.useState(!1),[pt,Pe]=w.useState(""),z=w.useRef(""),ce=w.useRef(r),[ie,Ge]=w.useState("off"),[Ve,St]=w.useState(""),[rt,Pt]=w.useState(""),O=w.useRef(!1),P=w.useRef(null),te=w.useRef(null),[we,Ye]=w.useState(null),$e=w.useRef(0),[Ae,ge]=w.useState([]),Ne=Ae.join("."),at=w.useRef(Ae);at.current=Ae;const kn=w.useRef({key:Ne,slideId:Z==null?void 0:Z.id,resetBySlide:!1}),[rn,Rt]=w.useState([]),[wt,tt]=w.useState(null),[Vt,Wt]=w.useState([]),[Lt,xn]=w.useState(null),Hn=w.useRef(""),Ut=w.useRef(null),Sn=w.useRef(null),Ln=w.useRef(!1),Zn=w.useRef(null),[F,ee]=w.useState(0),[ne,pe]=w.useState(null),ue=w.useRef(null);ue.current=ne;const he=Z?lv(Z,ne):null,qe=he?qT(he,A):null,[Me,Fe]=w.useState(""),[vt,J]=w.useState({width:0,height:0}),[oe,Ze]=w.useState("unknown"),[Le,At]=w.useState(null),[en,Nl]=w.useState([]),[oc,Br]=w.useState(""),[ad,Gl]=w.useState(!1),[zt,Fn]=w.useState(!1),[Tn,fr]=w.useState(null),[hi,pr]=w.useState(null),Ir=w.useRef(null),qr=w.useRef(null),[mi,Yl]=w.useState(null),[Ra,Vl]=w.useState(""),[Io,qo]=w.useState(""),[sc,Go]=w.useState(0),[sl,ja]=w.useState(!1),Yo=w.useRef(!1),Gr=w.useRef(null),[hr,Kl]=w.useState(null),gi=w.useRef(0),Cn=w.useCallback(p=>{gi.current+=1,Kl({reason:p,gesture:gi.current})},[]),mr=w.useCallback(p=>{uC(p,Yo.current)&&(Yo.current=!0,ja(!0))},[]);w.useEffect(()=>{if(!sl){Gr.current=null;return}const p=Gr.current;if(!p){Gr.current={master:Y,slides:E};return}(p.master!==Y||p.slides!==E)&&(Gr.current=null,ja(!1))},[Y,sl,E]),w.useEffect(()=>{if(hr===null)return;const p=window.setTimeout(()=>Kl(null),zN);return()=>window.clearTimeout(p)},[hr]),w.useEffect(()=>{ge(p=>p.length===0?p:[])},[v,Z==null?void 0:Z.id,Y]),w.useEffect(()=>{if(Ae.length===0)return;const p=Z?je(Z.element,Ae):null;(!p||!Aa(p))&&ge([])},[Z,Ae]);const Ot=w.useRef(null),Kt=w.useRef(()=>{}),tn=w.useRef(new WeakMap),[Nn,Al]=w.useState(null),[yi,gr]=w.useState(null),bi=w.useRef(null);bi.current=yi;const yr=w.useRef(!1),Ma=w.useRef(()=>{}),[An,Un]=w.useState(null),Gt=w.useRef(null),jt=w.useRef(null),Jn=w.useRef(!1),Et=w.useRef(null),Pn=w.useRef(null),za=w.useRef(()=>{}),Xt=w.useRef(null),ye=w.useRef(y);ye.current=y;const[,Xl]=w.useReducer(p=>p+1,0),be=w.useRef(b);be.current=b;const _a=w.useRef(()=>{}),vi=w.useRef(()=>{}),cc=w.useRef(()=>{});w.useEffect(()=>()=>{Et.current!==null&&(window.clearTimeout(Et.current),Et.current=null),Pn.current!==null&&(window.clearTimeout(Pn.current),Pn.current=null),Ut.current!==null&&(window.cancelAnimationFrame(Ut.current),Ut.current=null),Zn.current=null},[]);const Qe=w.useCallback(()=>({master:ye.current.master,slides:ye.current.slides,activeIndex:ye.current.activeIndex,commit:be.current.commit,showSlide:be.current.showSlide}),[]),xi=w.useRef(!1),Wn=w.useCallback(async p=>{if(!(xi.current||!be.current.settlePendingEdits())){xi.current=!0,Fe("");try{await p()}catch(S){Fe(LN(S))}finally{xi.current=!1}}},[]),Si=w.useCallback(()=>{Wn(()=>KC(Qe(),"<h1>"+a("editor.newSlideTitle")+"</h1>"))},[Wn,Qe,a]),cl=w.useCallback(p=>{Wn(()=>XC(Qe(),p))},[Wn,Qe]),wn=w.useCallback(p=>{Wn(()=>$C(Qe(),p))},[Wn,Qe]),uc=w.useCallback(p=>{Wn(()=>QC(Qe(),p))},[Wn,Qe]),$t=w.useCallback(async(p=()=>{})=>{try{await be.current.commitMaster(p),Fe("")}catch{}},[]),Tt=w.useCallback(()=>{var S;Ut.current!==null&&(window.cancelAnimationFrame(Ut.current),Ut.current=null),Hn.current="",Sn.current=null,xn(null);const p=(S=i.current)==null?void 0:S.contentDocument;p!=null&&p.documentElement&&p.documentElement.removeAttribute(To)},[]),ct=w.useCallback(()=>{Tt(),Rt([]),tt(null),Wt([])},[Tt]),Vo=w.useCallback(p=>{var S;if(p.length>0){const T=ye.current,M=(S=T.slides[T.activeIndex])==null?void 0:S.element,I=M?je(M,p):null;if(!I||!Aa(I))return}ge(p),be.current.clearSelection(),ct()},[ct]),fn=w.useCallback(async()=>{const p=document.documentElement;if(!document.fullscreenEnabled||typeof p.requestFullscreen!="function"){Ge("unavailable"),St(a("app.fullscreenUnsupported"));return}try{await p.requestFullscreen(),Ge("active"),St("")}catch{Ge("unavailable"),St(a("app.fullscreenDenied"))}},[a]),Bn=w.useCallback(p=>{const S=te.current;if(S){te.current=null,window.clearInterval(S.closeTimer);try{p&&S.channel.postMessage({sessionId:S.sessionId,type:"bye"})}catch{}try{S.channel.close()}catch{}p&&!S.window.closed&&S.window.close()}},[]),Ko=w.useCallback(()=>{O.current=!1,Bn(!0),De(!1),Pt(""),St(""),Ge("off"),P.current=null,document.fullscreenElement&&document.exitFullscreen().catch(()=>{})},[Bn]),ka=w.useCallback(()=>{if(!Ue)return;const p=te.current;if(p&&!p.window.closed){p.window.focus();return}p&&Bn(!1);const S=P.current??crypto.randomUUID();P.current=S;const T=window.open(`/?presenter=1&session=${encodeURIComponent(S)}`,sh(S),"popup=yes,width=960,height=720");if(!T){Pt(a("app.presenterBlockedHint"));return}const M=new BroadcastChannel(sh(S)),I={sessionId:S,channel:M,window:T,closeTimer:0};te.current=I;let $=null,W="";const Q=()=>{const X=ye.current;X.master&&($!==X.slides&&(W=vn(X.master),$=X.slides,M.postMessage({sessionId:S,type:"snapshot",html:W,index:X.activeIndex,total:X.slides.length})),M.postMessage({sessionId:S,type:"state",index:X.activeIndex,total:X.slides.length}))};M.onmessage=X=>{const Te=Rx(X.data,S);if(Te)if(Te.type==="request")Q();else if(Te.type==="slide"){const le=ye.current,fe=GC(Te.index,le.slides.length);fe!==null&&be.current.showSlide(fe)}else Te.type==="bye"&&Bn(!1)},I.closeTimer=window.setInterval(()=>{T.closed&&Bn(!1)},1e3),Pt("")},[Bn,Ue,a]),$l=w.useCallback(p=>{!be.current.settlePendingEdits()||ye.current.slides.length===0||(be.current.clearSelection(),ct(),p||be.current.showSlide(0),P.current=crypto.randomUUID(),O.current=!0,Pt(""),St(""),Ge("off"),fn(),De(!0))},[ct,fn]);w.useEffect(()=>{const p=()=>{const S=document.fullscreenElement!==null;Ge(S?"active":"off"),S&&St(""),!S&&O.current&&St(a("app.fullscreenExitedHint"))};return document.addEventListener("fullscreenchange",p),()=>document.removeEventListener("fullscreenchange",p)},[a]),w.useEffect(()=>{if(!Ue)return;const p=te.current;if(p){if(p.window.closed){Bn(!1);return}p.channel.postMessage({sessionId:p.sessionId,type:"state",index:v,total:E.length})}},[Ue,v,E.length,Bn]);const Xo=w.useCallback(p=>{if(p==="overwrite"&&ch(ye.current.conflict,ye.current.filePath))return;sT(p).applyExternal?be.current.reload():be.current.overwrite()},[]),dc=w.useCallback(p=>{var I;if(!be.current.settlePendingEdits())return;const S=ye.current,T=S.slides[S.activeIndex];if(!T)return;const M=je(T.element,p);M&&be.current.select({slideIndex:S.activeIndex,path:p,elementId:((I=M.getAttribute("data-ppt-el"))==null?void 0:I.trim())||null})},[]),Yr=w.useCallback((p,S)=>{var me;if(!be.current.settlePendingEdits())return!1;const T=ye.current,M=T.selection,I=T.slides[T.activeIndex],$=(me=i.current)==null?void 0:me.contentDocument;if(!M||M.slideIndex!==T.activeIndex||T.selections.length!==1||!I||!$)return!1;const W=je(I.element,[M.path[0]??-1]);if(!W||cn(W)||un(W)||El(I.element,M.path)||_n(W)&&(p==="width"||p==="height"))return!1;const Q=si(I,$);if(!Q)return!1;const X=je(Q,M.path);if(!X||wl(X)||Xn(X)||cn(X)||un(X)||_n(X)&&(p==="width"||p==="height"))return!1;const Te=p!=="rotation"&&Qu(X),le=cv(X,Q),fe=Hr(T.master,Be=>{var ze;const Re=gC(Be,M,le,p,S);if(Re&&(p==="width"||p==="height")){const ut=(ze=Ht(Be)[M.slideIndex])==null?void 0:ze.element,it=ut?je(ut,M.path):null;if(it)try{Hb(it)}catch{}}return Re},()=>void $t());return fe&&mr(Te),fe},[$t,mr]),id=w.useCallback(p=>{if(!be.current.settlePendingEdits())return;const S=ye.current,T=S.master;if(!T)return;const M=S.activeIndex;Hr(T,I=>SC(I,M,p),()=>void $t())},[$t]),fc=w.useCallback(p=>{var T,M;p==="none"||((M=(T=window.matchMedia)==null?void 0:T.call(window,"(prefers-reduced-motion: reduce)"))==null?void 0:M.matches)===!0||($e.current+=1,Ye({transition:p,id:$e.current}))},[]),pc=w.useCallback(p=>{if(!be.current.settlePendingEdits())return!1;const S=ye.current,T=S.master;if(!T)return!1;const M=S.activeIndex;return Hr(T,I=>AC(I,M,p),()=>void $t())},[$t]),$o=w.useCallback(()=>{if(!be.current.settlePendingEdits())return!1;const p=ye.current,S=p.master;if(!S)return!1;const T=p.activeIndex;return Hr(S,M=>OC(M,T),()=>void $t())},[$t]),od=w.useCallback(p=>{var le;if(!be.current.settlePendingEdits())return;const S=ye.current,T=S.master,M=S.slides[S.activeIndex];if(!T||!M||Ax(M.element)===p)return;const I=S.activeIndex,$=Array.from(M.element.children);if(!Hr(T,fe=>xC(fe,I,p),()=>void $t()))return;const Q=(le=Ht(T)[I])==null?void 0:le.element;if(!Q)return;const X=Array.from(Q.children);(X.length!==$.length||X.some((fe,me)=>fe!==$[me]))&&(be.current.clearSelection(),ct())},[ct,$t]),wi=w.useCallback((p,S,T)=>{if(!be.current.settlePendingEdits())return!1;const M=ye.current.master;if(!M)return!1;try{return Hr(M,I=>{const $=Qn(I,p);if(Nv($.element,S))return!1;const W=je($.element,[...S]);return W?(T(W),!0):!1},()=>void $t())}catch{return!1}},[$t]),On=w.useCallback(p=>{const S=ye.current,T=S.selection,M=S.slides[S.activeIndex];return!T||T.slideIndex!==S.activeIndex||S.selections.length!==1||!M||Nv(M.element,T.path)?!1:wi(M.id,T.path,p)},[wi]),ul=w.useCallback(p=>On(S=>iw(S,p)),[On]),Qo=w.useCallback(p=>On(S=>$p(S,p)),[On]),Zo=w.useCallback(p=>On(S=>sw(S,p)),[On]),Vr=w.useCallback(p=>On(S=>cw(S,p)),[On]),Kr=w.useCallback(p=>{const S=ye.current,T=S.selection,M=S.slides[S.activeIndex];if(!T||T.slideIndex!==S.activeIndex||S.selections.length!==1||!M)return;const I=M.id,$=[...T.path];(async()=>{try{const W=await Xv(p);wi(I,$,Q=>Db(Q,W))||Fe(a("app.replaceImageFailed"))}catch(W){Fe(W instanceof Error?W.message:String(W))}})()},[wi,a]),hc=w.useCallback(()=>{const p=window.prompt(a("app.imageUrlPromptDetail"),"https://");p!==null&&On(S=>Db(S,p))},[On,a]),Fo=w.useCallback(p=>{if(!be.current.settlePendingEdits())return;const S=ye.current,T=S.slides[S.activeIndex],M=S.selection;if(!M||M.slideIndex!==S.activeIndex||!T||!S.master)return;const I=Ip(T.element,M.path);if(I&&je(T.element,I.tablePath)&&!Xu(T.element,I.tablePath))try{Hr(S.master,W=>{const Q=Qn(W,T.id),X=je(Q.element,I.tablePath);return X?(p.type==="row"?Sw(X,I.row,p.position):p.type==="delete-row"?ww(X,I.row):p.type==="column"?Ew(X,I.column,p.position):p.type==="delete-column"?Tw(X,I.column):Cw(X),!0):!1},()=>void $t())&&(be.current.clearSelection(),ct())}catch($){Fe($ instanceof Error?$.message:String($))}},[ct,$t]),mc=w.useCallback(p=>{if(!be.current.settlePendingEdits())return!1;const S=ye.current,T=S.slides[S.activeIndex],M=S.selection;if(!M||M.slideIndex!==S.activeIndex||!T||!S.master)return!1;const I=Ip(T.element,M.path);if(!I||!je(T.element,I.tablePath)||Xu(T.element,I.tablePath))return!1;try{return Hr(S.master,$=>{const W=Qn($,T.id),Q=je(W.element,I.cellPath);return Q?(uS(Q,p),!0):!1},()=>void $t())}catch{return!1}},[$t]),Ha=w.useCallback(()=>{const p=ye.current,S=p.slides[p.activeIndex],T=p.selection;if(!T||T.slideIndex!==p.activeIndex||!S)return;const M=je(S.element,T.path),I=Ro(M);if(I)try{Un({json:kw(I),error:""})}catch($){Fe($ instanceof Error?$.message:String($))}},[]),Ol=w.useCallback(()=>{var le;const p=An;if(!p||!be.current.settlePendingEdits())return;const S=ye.current,T=S.slides[S.activeIndex],M=S.selection;if(!M||M.slideIndex!==S.activeIndex||!T||!S.master){Un(null);return}if(!je(T.element,[M.path[0]??-1])||Xu(T.element,M.path))return;const $=Ro(je(T.element,M.path)),W=$?nh(T.element,$):null,Q=((le=$==null?void 0:$.getAttribute("data-ppt-el"))==null?void 0:le.trim())||null;let X="";if(!Hr(S.master,fe=>{const me=Qn(fe,T.id),Be=je(me.element,M.path),Re=Ro(Be);if(!Re)return X=a("app.chartNotSelected"),!1;const ze=Lw(Re,p.json);return ze.ok?!0:(X=ze.error,!1)},()=>void $t())){Un({...p,error:X||a("app.chartApplyFailed")});return}W!==null?be.current.selectTargets([{slideIndex:S.activeIndex,path:W,elementId:Q}]):be.current.clearSelection(),Un(null)},[An,$t,a]),La=w.useCallback(async(p,S)=>{if(!p.name||!/\.html?$/i.test(p.name)){Br(a("standalone.fileType"));return}Gl(!0),Br("");try{const T=await p.text();d.current={name:p.name,handle:S},At({name:p.name,canWrite:S!==null}),Ze("standalone"),pr(null),Ir.current=null,await b.load({html:T,revision:await Wp(T),filePath:p.name})}catch(T){Br(T instanceof Error?T.message:String(T))}finally{Gl(!1)}},[b,a]),Ua=w.useCallback(async p=>{if(!(oe!=="host"||zt)&&(fr(null),!!b.settlePendingEdits())){Fn(!0);try{if(await b.saveNow(),_p.flushSync(()=>Xl()),ye.current.dirty){fr(a("path.saveIncomplete"));return}if(ye.current.conflict||ye.current.error)return;const S=await RE(p);await b.load(S),_p.flushSync(()=>Xl());const T=ye.current;if(T.status==="load-error"||T.filePath!==S.filePath){fr(a("path.loadFailedKept"));return}window.history.replaceState(null,"",S.url)}catch(S){fr(S instanceof ix?KN(S,a):S instanceof Error?S.message:String(S))}finally{Fn(!1)}}},[oe,zt,b,a]),Ql=w.useCallback(async()=>{if(!zt){fr(null),Fn(!0);try{const p=await sx();if(!p||!b.settlePendingEdits())return;if(await b.saveNow(),_p.flushSync(()=>Xl()),ye.current.dirty){fr(a("path.saveIncomplete"));return}if(ye.current.conflict||ye.current.error)return;await La(p.file,p.handle)}catch(p){fr(p instanceof Error?p.message:String(p))}finally{Fn(!1)}}},[zt,b,La,a]);w.useEffect(()=>{var T,M;if(!zt)return;const p=document.activeElement;p instanceof HTMLElement&&p.blur();const S=(M=(T=i.current)==null?void 0:T.contentDocument)==null?void 0:M.activeElement;S instanceof HTMLElement&&S.blur()},[zt]);const Jo=w.useCallback(async p=>{Gl(!0),Br("");try{d.current={name:p.filePath,handle:null},At({name:p.filePath,canWrite:!1}),Ze("standalone"),Nl(S=>S.filter(T=>T.key!==p.key)),await b.load({html:p.html,revision:await Wp(p.html),filePath:p.filePath}),b.restoreDraft(p.html)}catch(S){Br(S instanceof Error?S.message:String(S))}finally{Gl(!1)}},[b]),Ei=w.useCallback(p=>{Bs(p.key),Nl(S=>S.filter(T=>T.key!==p.key))},[]),gc=w.useCallback(async p=>{const S=ye.current;if(S.master){if(qo(""),Vl(""),oe==="standalone"){const T=(Le==null?void 0:Le.name)??S.filePath;if(p!=="html"){qo(a("export.standaloneUnsupported"));return}Zb(W1(S.master),T),Bs(Oo(T)),pr(null),Vl(a("export.downloaded",{name:fx(T)}));return}Yl(p);try{const T=await ME(p);Vl(a("export.exported",{count:T.length,files:T.join(r==="en"?", ":"、")})),Pe(a("export.exportedAnnouncement",{count:T.length}))}catch(T){qo(T instanceof Error?T.message:String(T))}finally{Yl(null)}}},[r,oe,Le==null?void 0:Le.name,a]);w.useEffect(()=>{let p=!1;return(async()=>{try{const S=await Jp();if(p)return;Ze("host"),await b.load(S)}catch(S){if(p)return;if(S instanceof rx&&(S.status===401||S.status===403||S.status>=500)){Ze("host"),await b.load();return}Ze("standalone"),Nl(await YE())}})(),()=>{p=!0}},[b]),w.useEffect(()=>{if(oe!=="host"||!G||!window.location.pathname.startsWith("/d/"))return;const p=G.split(/[\\/]/).pop()??"";if(!p)return;const S=`/d/${encodeURIComponent(p)}`;window.location.pathname!==S&&window.history.replaceState(null,"",S)},[oe,G]),w.useEffect(()=>{if(!Y||!R||oe==="unknown")return;const p=G||(Le==null?void 0:Le.name)||"",S=Oo(p);if(!S)return;const T=vn(Y);if(qr.current===T)return;qr.current=null;const M=window.setTimeout(()=>{dx({key:S,filePath:p,html:T,savedAt:Date.now()})},250);return()=>window.clearTimeout(M)},[Y,R,C,E,G,Le==null?void 0:Le.name,oe]),w.useEffect(()=>{if(R||B!=="saved"||oe==="standalone"&&!(Le!=null&&Le.canWrite))return;const p=Oo(G||(Le==null?void 0:Le.name)||"");p&&(Bs(p),pr(null))},[R,B,oe,Le==null?void 0:Le.canWrite,Le==null?void 0:Le.name,G]),w.useEffect(()=>{if(!Y)return;const p=Oo(G||(Le==null?void 0:Le.name)||"");if(!p||Ir.current===p)return;Ir.current=p;let S=!1;return GE(p).then(T=>{!S&&qE(T,vn(Y))&&pr(T)}),()=>{S=!0}},[Y,G,Le==null?void 0:Le.name]);const br=w.useRef(null);w.useEffect(()=>{br.current||!Y||oe!=="host"||(br.current=HE(p=>{be.current.receiveRevision(p)}))},[Y,oe]),w.useEffect(()=>()=>{var p;(p=br.current)==null||p.close(),br.current=null},[]),w.useEffect(()=>{const p=S=>{!ye.current.dirty&&!ye.current.pending||(be.current.flushBeforeUnload(),S.preventDefault(),S.returnValue="")};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[]),w.useEffect(()=>{const p=()=>Bn(!0);return window.addEventListener("pagehide",p),()=>window.removeEventListener("pagehide",p)},[Bn]);const vr=w.useCallback(()=>{if(!s.current)return;const p=ye.current,S=p.slides[p.activeIndex];if(!S)return;const T=lv(S,ue.current),M=s.current.getBoundingClientRect(),I=Math.max(.1,(M.width-96)/T.width),$=Math.max(.1,(M.height-96)/T.height);be.current.setScale(Math.min(I,$,1))},[]);w.useEffect(()=>{const p=s.current;if(!p)return;const S=()=>{const M=p.getBoundingClientRect();J(I=>I.width===M.width&&I.height===M.height?I:{width:M.width,height:M.height})};if(S(),typeof ResizeObserver>"u")return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S);const T=new ResizeObserver(S);return T.observe(p),()=>T.disconnect()},[Se,Ue]),w.useEffect(()=>{vr()},[Z==null?void 0:Z.id,he==null?void 0:he.width,he==null?void 0:he.height,vt.width,vt.height,vr,Se]);const Dn=w.useCallback(()=>{var M;const p=(M=i.current)==null?void 0:M.contentDocument,S=ye.current,T=S.slides[S.activeIndex];return!p||!T?null:si(T,p)},[]),Bt=w.useCallback((p,S,T)=>{const M=i.current;if(!M)return{x:0,y:0};const I=M.getBoundingClientRect(),$=hT(p,S,{x:I.left,y:I.top,width:I.width,height:I.height},ye.current.scale),W=T.getBoundingClientRect();return{x:$.x-W.left,y:$.y-W.top}},[]),Rn=w.useCallback(async()=>{var S;const p=(S=i.current)==null?void 0:S.contentDocument;if(!p)return!1;try{return await be.current.commit((T,M)=>nv(T,M.index,p)),!0}catch{return!1}},[]),Zl=w.useCallback(async p=>{var I,$;if(yr.current||!be.current.settlePendingEdits())return;const S=ye.current;if(S.selections.length!==1||!S.selection)return;const T=(I=i.current)==null?void 0:I.contentDocument;if(!T)return;const M=Vu(T,S.slides[S.activeIndex],S.selection.path);if(!M||M.status!=="editable"){gr(null);return}try{($=T.getSelection())==null||$.removeAllRanges(),Bp(T,M.leaf,p,null),yr.current=!0,await Rn()&&gr(Q=>Q&&{...Q,error:""})}catch(W){const Q=W instanceof Error?W.message:String(W);gr(X=>X&&{...X,error:Q})}finally{yr.current=!1}},[Rn]),Ba=w.useCallback(()=>{const p=bi.current;if(!p)return;Jn.current=!0;let S=null;try{S=window.prompt(a("app.linkPromptDetail"),p.state.link||"https://")}finally{Jn.current=!1}S!==null&&Zl({type:"link",value:S})},[Zl,a]),sd=w.useCallback(p=>{p===Se||!be.current.settlePendingEdits()||(be.current.clearSelection(),ct(),st(p))},[ct,Se]),Xr=w.useCallback(()=>{var Q;Tt();const p=ye.current;if(p.selections.length===0){ct();return}const S=(Q=i.current)==null?void 0:Q.contentDocument,T=p.slides[p.activeIndex];if(!S||!T){ct();return}const M=si(T,S);if(!M){ct();return}const I=No(M),$=[];let W=null;for(const X of p.selections){if(X.slideIndex!==p.activeIndex)continue;const Te=je(M,X.path);!Te||un(Te)||($.push({rect:cr(Ul(Te,M),I),rotation:Ll(Te),path:X.path,elementId:X.elementId}),W||(W=hC(Te,M)))}if($.length===0){ct();return}Rt($),tt(W)},[Tt,ct]);w.useEffect(()=>{Xr()},[Xr,se,v,C,E,F]),w.useEffect(()=>{Tt()},[Tt,A]),w.useEffect(()=>{const p=S=>{var T;S.key==="Alt"&&((T=Zn.current)==null||T.call(Zn,S.altKey))};return document.addEventListener("keydown",p),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",p)}},[]);const Ti=w.useCallback(()=>{const p=i.current,S=ye.current;if(!p)return;const T=S.master,M=T?Ht(T)[S.activeIndex]:null;T&&M?p.srcdoc=Lo(T,M):S.srcDoc&&(p.srcdoc=S.srcDoc)},[]),Fl=w.useCallback(()=>{var p;return Ot.current?(be.current.cancelPendingEdit("gesture"),Ot.current=null,(p=Xt.current)==null||p.call(Xt),Xt.current=null,ct(),be.current.clearSelection(),Ti(),!0):!1},[ct,Ti]),$r=w.useCallback((p,S)=>{const T=Ot.current;if(!T||S.pointerId!==T.pointerId)return;const M=ye.current.scale;if(!T.moved){const X=Sv/M;if(Math.hypot(p.x-T.start.x,p.y-T.start.y)<X)return;if(T.moved=!0,T.kind==="drag"){const le=T.targets.filter(fe=>fe.mode==="html");T.pinned=cC(le.map(fe=>fe.element)),le.forEach(fe=>$u(fe.element,fe.start,T.slide))}else T.kind==="resize"&&(T.pinned=Qu(T.target.element)),$u(T.target.element,T.target.start,T.slide)}be.current.changePendingEdit("gesture",{apply:()=>(Kt.current(),!0),discard:()=>{var X;Ot.current=null,(X=Xt.current)==null||X.call(Xt),Xt.current=null,Wt([])}}),S.preventDefault();const I=T.altKey||S.altKey,$=_N/M;if(T.kind==="drag"){let X=p.x-T.start.x,Te=p.y-T.start.y,le=[];const fe=T.targets[0];if(!I&&T.targets.every(Re=>Re.mode==="html")&&fe){const Re={...fe.start,x:fe.start.x+X,y:fe.start.y+Te},ze=mT(Re,T.siblingRects,$,T.bounds);X+=ze.rect.x-Re.x,Te+=ze.rect.y-Re.y,le=ze.guides}const Be=lC(T.targets,{x:X,y:Te});Be.forEach((Re,ze)=>{const ut=T.targets[ze];ut&&(ut.mode==="svg"?ah(ut.element,ut.authoredTransform,iv(ut.element,{x:X,y:Te})):rv(ut.element,Re,T.slide))}),Rt(T.targets.map((Re,ze)=>({rect:cr(Be[ze]??Re.start,T.slideOffset),rotation:Re.rotation,path:Re.path,elementId:Re.elementId}))),Wt(Cv(le,T.slideOffset));return}if(T.kind==="resize"){let X=rC(T.target,T.handle,{x:p.x-T.start.x,y:p.y-T.start.y},xv),Te=[];if(!I){const le=gT(X,T.handle,T.siblingRects,$,T.bounds,xv);X=le.rect,Te=le.guides}rv(T.target.element,X,T.slide),Rt([{rect:cr(X,T.slideOffset),rotation:Ll(T.target.element),path:T.path,elementId:T.elementId}]),Wt(Cv(Te,T.slideOffset));return}const W=ov(T.center,p);let Q=pi(T.startRotation+oC(T.startPointerAngle,W));S.shiftKey&&!I&&(Q=sC(Q,15)),Ex(T.target.element,Q),Rt([{rect:cr(T.target.start,No(T.slide)),rotation:Q,path:T.path,elementId:T.elementId}]),Wt([])},[]),Ci=w.useCallback(()=>{var S;const p=Ot.current;if(p){if(Ot.current=null,(S=Xt.current)==null||S.call(Xt),Xt.current=null,Wt([]),!p.moved){Xr();return}p.kind==="resize"&&Hb(p.target.element),Rn().then(T=>{T&&mr(p.pinned)})}},[Rn,Xr,mr]);Kt.current=Ci;const yc=w.useCallback(()=>{var p;(p=Ot.current)!=null&&p.moved?be.current.settlePendingEdits("gesture"):Ci()},[Ci]),Qr=w.useCallback(p=>{var W,Q;(W=Xt.current)==null||W.call(Xt),Xt.current=null;const S=((Q=i.current)==null?void 0:Q.contentDocument)??null,T=X=>$r(Ev(X.clientX,X.clientY,p),X),M=X=>$r(Bt(X.clientX,X.clientY,p),X),I=X=>{const Te=Ot.current;!Te||X.pointerId!==Te.pointerId||yc()},$=X=>{const Te=Ot.current;!Te||X.pointerId!==Te.pointerId||Fl()};S==null||S.addEventListener("pointermove",T),S==null||S.addEventListener("pointerup",I),S==null||S.addEventListener("pointercancel",$),window.addEventListener("pointermove",M),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",$),Xt.current=()=>{S==null||S.removeEventListener("pointermove",T),S==null||S.removeEventListener("pointerup",I),S==null||S.removeEventListener("pointercancel",$),window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",$)}},[Fl,yc,$r,Bt]),bc=w.useCallback((p,S,T,M,I)=>{const $=ye.current,W=$.slides[$.activeIndex];!W||p.length===0||(Tt(),Ot.current={kind:"drag",pointerId:M,start:T,altKey:I,moved:!1,pinned:!1,slide:S,slideOffset:No(S),targets:p.map(Q=>{const X=wl(Q.element);return{element:Q.element,start:Ul(Q.element,S),rotation:Ll(Q.element),path:Q.selection.path,elementId:Q.selection.elementId,mode:X?"svg":"html",authoredTransform:X?Q.element.getAttribute("transform")??"":""}}),siblingRects:Tv(S,p.map(Q=>Q.element)),bounds:Xp(W.width,W.height)},Qr(S))},[Qr,Tt]),Po=w.useCallback((p,S)=>{if(S.button!==0)return;const T=ye.current,M=T.selection,I=T.slides[T.activeIndex],$=Dn();if(!M||T.selections.length!==1||!I||!$)return;const W=je($,M.path);!W||wl(W)||Xn(W)||cn(W)||_n(W)||El($,M.path)!==null||(S.preventDefault(),S.stopPropagation(),Tt(),S.currentTarget.setPointerCapture(S.pointerId),Ot.current={kind:"resize",pointerId:S.pointerId,start:Bt(S.clientX,S.clientY,$),altKey:S.altKey,moved:!1,pinned:!1,slide:$,slideOffset:No($),target:{element:W,start:Ul(W,$)},path:M.path,elementId:M.elementId,handle:p,siblingRects:Tv($,[W]),bounds:Xp(I.width,I.height)},Qr($))},[Qr,Tt,Dn,Bt]),cd=w.useCallback(p=>{if(p.button!==0)return;const S=ye.current,T=S.selection,M=Dn();if(!T||S.selections.length!==1||!M)return;const I=je(M,T.path);if(!I||wl(I)||Xn(I)||cn(I)||un(I)||El(M,T.path)!==null)return;p.preventDefault(),p.stopPropagation(),Tt(),p.currentTarget.setPointerCapture(p.pointerId);const $=Ul(I,M),W=aC($),Q=Bt(p.clientX,p.clientY,M);Ot.current={kind:"rotate",pointerId:p.pointerId,start:Q,altKey:p.altKey,moved:!1,pinned:!1,slide:M,target:{element:I,start:$},path:T.path,elementId:T.elementId,center:W,startPointerAngle:ov(W,Q),startRotation:Ll(I)},Qr(M)},[Qr,Tt,Dn,Bt]),vc=w.useCallback((p,S)=>{const T=ye.current,M=T.slides[T.activeIndex],I=Dn();if(!M||!I)return!1;const $=T.selections.filter(me=>me.slideIndex===T.activeIndex);if($.length===0)return!1;const W=No(I),Q=[];let X=!1,Te=!1,le=0,fe=0;for(const me of $){const Be=je(I,me.path);if(!Be)continue;Xn(Be)||(fe+=1);const Re=Ul(Be,I),ze=El(I,me.path);if(cn(Be)||un(Be)||ze!==null){!un(Be)&&!un(ze)&&Q.push({rect:cr(Re,W),rotation:Ll(Be),path:me.path,elementId:me.elementId});continue}if(Xn(Be)){le+=1,Q.push({rect:cr(Re,W),rotation:Ll(Be),path:me.path,elementId:me.elementId});continue}const ut=wl(Be);if(ut&&Do(Be)){Q.push({rect:cr(Re,W),rotation:Ll(Be),path:me.path,elementId:me.elementId});continue}const Dt=bT(Re,p,S,Xp(M.width,M.height));if(Dt.x===Re.x&&Dt.y===Re.y){Q.push({rect:cr(Re,W),rotation:Ll(Be),path:me.path,elementId:me.elementId});continue}ut?ah(Be,Be.getAttribute("transform")??"",iv(Be,{x:Dt.x-Re.x,y:Dt.y-Re.y})):(Qu(Be)&&(Te=!0),$u(Be,Dt,I)),X=!0,Q.push({rect:cr(Dt,W),rotation:Ll(Be),path:me.path,elementId:me.elementId})}return X?(Rt(Q),Wt([]),Rn().then(me=>{me&&mr(Te)}),!0):(le>0&&fe===0&&Cn("table-cell"),!1)},[Rn,Dn,Cn,mr]),Ni=w.useCallback(p=>{Kl(null),Tt();const S=p.ownerDocument,T=jo(S);Gt.current=p,jt.current=T&&p.contains(T.commonAncestorContainer)?T:null,Al({state:kr(S,p,jt.current),error:""})},[Tt]),dl=w.useCallback(()=>{Gt.current=null,jt.current=null,Al(null)},[]);w.useEffect(()=>{var M;if(Nn){gr(null);return}const p=ye.current;if(p.selections.length!==1||!p.selection||p.selection.slideIndex!==p.activeIndex){gr(null);return}const S=(M=i.current)==null?void 0:M.contentDocument,T=Vu(S,p.slides[p.activeIndex],p.selection.path);if(!S||!T||T.status!=="editable"||T.empty){gr(null);return}gr({state:kr(S,T.leaf,BN(S,T.leaf)),error:"",path:p.selection.path})},[Nn,ae,se,v,E,Y,F]),w.useEffect(()=>{dC(sl,y.pending,Nn!==null)&&(Gr.current=null,ja(!1))},[sl,y.pending,Nn]);const Ai=w.useCallback(p=>{!p.isConnected||!p.hasAttribute(Kn)||Gt.current!==p||(p.innerHTML!==tn.current.get(p)&&za.current(p),be.current.settlePendingEdits("text"),p.removeAttribute(Kn),p.removeAttribute("contenteditable"),dl())},[dl]);w.useEffect(()=>{const p=S=>{if(Jn.current)return;const T=S.target;if(!(T instanceof Element))return;const M=T.closest('[data-testid="text-toolbar"]');if(!M)return;const I=S.relatedTarget;I instanceof Node&&M.contains(I)||(Pn.current!==null&&window.clearTimeout(Pn.current),Pn.current=window.setTimeout(()=>{Pn.current=null;const $=Gt.current;if(!$)return;const W=document.activeElement;W!==i.current&&(W instanceof Element&&W.closest('[data-testid="text-toolbar"]')||Ai($))},0))};return document.addEventListener("focusout",p,!0),()=>{document.removeEventListener("focusout",p,!0),Pn.current!==null&&(window.clearTimeout(Pn.current),Pn.current=null)}},[Ai]);const Oi=w.useCallback(()=>{var I;const p=ye.current;if(p.selections.length!==1||!p.selection||p.selection.slideIndex!==p.activeIndex||p.selection.path.length<1)return!1;const S=(I=i.current)==null?void 0:I.contentDocument;if(!S)return!1;const T=Vu(S,p.slides[p.activeIndex],p.selection.path);if(!T||T.status!=="editable")return!1;const M=T.leaf;return tn.current.set(M,M.innerHTML),M.setAttribute("contenteditable","true"),M.setAttribute(Kn,"true"),M.focus(),Ni(M),!0},[Ni]),Wo=w.useCallback(p=>{const S=Math.min(HN,Math.max(kN,ye.current.scale*p));be.current.setScale(S)},[]),Di=w.useCallback(async(p,S,T={})=>{if(S.length===0||!be.current.settlePendingEdits())return;const M=ye.current;if(!M.slides[M.activeIndex]||!M.master)return;const $=M.activeIndex;let W=[];if(p.type==="group"||p.type==="align"||p.type==="distribute"){const Q=Dn();if(!Q)return;try{W=S.map(X=>{const Te=je(Q,X.path);if(!Te)throw new Error("Select the object again before changing layout.");const le=cv(Te,Q);return{target:X,rect:le.rect,offset:le.offset}})}catch{return}}try{await be.current.commitMaster(Q=>{const X=rT(Q,$,p,S,W);return X.changed?(T.selectResult!==!1&&X.targets.length>0&&be.current.selectTargets(X.targets),!0):!1})}catch{}},[Dn]),Ri=w.useCallback(p=>{const S=ye.current,T=S.selections.filter(M=>M.slideIndex===S.activeIndex);Di(p,T)},[Di]),ud=w.useCallback((p,S)=>{const T=ye.current;if(!T.slides[T.activeIndex])return;const M={slideIndex:T.activeIndex,path:p,elementId:null};Di(S==="unlock"?{type:"lock",locked:!1}:{type:"hide",hidden:!1},[M],{selectResult:!1})},[Di]),ji=w.useCallback(()=>{const p=ye.current,S=p.selection;if(!S||p.selections.length!==1||S.slideIndex!==p.activeIndex)return!1;const T=Dn();if(!T)return!1;const M=je(T,S.path);return!M||!Aa(M)?!1:(ge([...S.path]),be.current.clearSelection(),ct(),!0)},[ct,Dn]),dd=w.useCallback((p,S)=>{if(p.defaultPrevented||Ot.current||O.current||He||An||Gt.current)return;const T=S??document;if(Ys(Co(p.target))||Ys(T.activeElement)||Zu(p.target))return;const M=at.current;if(p.key==="Escape"){if(M.length===0||document.querySelector('[aria-expanded="true"]'))return;p.preventDefault(),p.stopPropagation(),ge(M.slice(0,-1)),be.current.clearSelection(),ct();return}if(p.key!=="Enter"||p.altKey||p.ctrlKey||p.metaKey||p.shiftKey)return;const I=Co(p.target);I!=null&&I.closest('button, a, [role="button"], [role="tab"]')||ji()&&(p.preventDefault(),p.stopPropagation())},[An,ct,ji,He]);vi.current=dd;const fd=w.useCallback((p,S)=>{if(p.defaultPrevented)return;const M=Ys((S??document).activeElement)||Zu(p.target),I=ye.current;if(Ue){if(p.key==="F5"){p.preventDefault(),!p.altKey&&!p.ctrlKey&&!p.metaKey&&!p.shiftKey&&be.current.showSlide(0);return}if(p.key==="Escape"){p.preventDefault(),Ko();return}if(M||(p.key===" "||p.key==="Spacebar")&&Dx(p.target)||p.altKey||p.ctrlKey||p.metaKey||p.shiftKey)return;switch(p.key){case"p":case"P":p.preventDefault(),ka();return;case"f":case"F":p.preventDefault(),document.fullscreenElement?document.exitFullscreen().catch(()=>{}):fn();return;case"ArrowLeft":case"PageUp":p.preventDefault(),be.current.showSlide(I.activeIndex-1);return;case"ArrowRight":case" ":case"Spacebar":case"PageDown":p.preventDefault(),be.current.showSlide(I.activeIndex+1);return;case"Home":p.preventDefault(),be.current.showSlide(0);return;case"End":p.preventDefault(),be.current.showSlide(I.slides.length-1);return;default:return}}const $=xN(p);if($){const Q=Co(p.target),X=Q==null?void 0:Q.closest("input, textarea, select"),Te=Zu(p.target)&&!Gt.current;if(!He&&!An&&!X&&!Te&&(Gt.current||bi.current)){p.preventDefault(),Ma.current($);return}}if(M)return;if(He||An){(p.key==="F5"||(p.ctrlKey||p.metaKey)&&p.key.toLowerCase()==="s")&&p.preventDefault();return}const W=vN(p);if(W){if(W.type==="escape"){if(Fl()){p.preventDefault();return}I.selection&&(p.preventDefault(),be.current.clearSelection(),ct());return}if(Ot.current){p.preventDefault();return}switch(W.type){case"undo":p.preventDefault(),be.current.undo();return;case"redo":p.preventDefault(),be.current.redo();return;case"save":if(p.preventDefault(),d.current&&!d.current.handle){const Q=ye.current.master,X=d.current.name;if(Q){const Te=vn(Q);qr.current=Te,Bs(Oo(X)).finally(()=>{Zb(Te,X,".html"),pr(null),Pe(a("export.downloadedAnnouncement"))})}return}be.current.saveNow().catch(()=>{});return;case"group":if(I.selections.length<2)return;p.preventDefault(),Ri({type:"group"});return;case"ungroup":if(I.selections.length!==1)return;p.preventDefault(),Ri({type:"ungroup"});return;case"export":p.preventDefault(),Go(Q=>Q+1);return;case"help":p.preventDefault(),xe(!0);return;case"select-all":p.preventDefault(),be.current.selectAll();return;case"copy":if(I.selections.length===0)return;p.preventDefault(),be.current.copySelection();return;case"paste":p.preventDefault(),be.current.pasteObjects().then(Q=>{Q==="kind-mismatch"&&Cn("paste-kind"),Q==="table-cell"&&Cn("table-cell")}).catch(()=>{});return;case"duplicate":if(I.selections.length===0)return;p.preventDefault(),be.current.duplicateSelection().catch(()=>{});return;case"delete":{if(I.selections.length===0)return;const Q=Dn();if(Q!==null&&I.selections.some(Te=>{if(Te.slideIndex!==I.activeIndex)return!1;const le=je(Q,Te.path);return le!==null&&Xn(le)})){p.preventDefault(),Cn("table-cell");return}p.preventDefault(),be.current.deleteSelection().catch(()=>{});return}case"zoom-in":p.preventDefault(),Wo(wv);return;case"zoom-out":p.preventDefault(),Wo(1/wv);return;case"zoom-fit":p.preventDefault(),vr();return;case"edit":{const Q=Co(p.target);if(Q!=null&&Q.closest('button, a, [role="button"], [role="tab"]'))return;Oi()&&p.preventDefault();return}case"play":case"play-from-current":p.preventDefault(),$l(W.type==="play-from-current");return;case"nudge":{if(I.selections.length>0){p.preventDefault(),vc(W.dx,W.dy);return}W.dx!==0&&(p.preventDefault(),be.current.showSlide(I.activeIndex+(W.dx>0?1:-1)));return}}}},[Fl,An,ct,vr,Dn,Ri,vc,Ue,He,Cn,$l,Oi,Ko,ka,fn,a,Wo]),Mi=w.useCallback((p,S,T)=>{var Q;const M=ye.current,I=at.current;if(I.length>0)return Kb(p,S,{slideIndex:M.activeIndex,altKey:T,containerPath:I});if(T)return Kb(p,S,{slideIndex:M.activeIndex,altKey:!0});const $=gx(S,p),W=$?nh(S,$):null;return!$||!W?null:{slideIndex:M.activeIndex,path:W,elementId:((Q=$.getAttribute("data-ppt-el"))==null?void 0:Q.trim())||null}},[]),xc=w.useCallback((p,S)=>{if(p.button!==0)return;const T=ye.current,M=T.slides[T.activeIndex];if(!M)return;const I=Co(p.target);if(!I)return;const $=si(M,S);if(!$||!$.contains(I)||Ys(I)||!be.current.settlePendingEdits())return;const W=Mi(I,$,p.altKey);if(!W){if(Ae.length>0){const me=je($,Ae);me&&!me.contains(I)&&ge([])}be.current.clearSelection(),ct();return}if(p.shiftKey){p.preventDefault(),be.current.toggleSelect(W);return}const Q=T.selections.some(me=>Yu(me,W));Q||be.current.select(W);const X=je($,W.path),Te=X!==null&&wl(X)&&Do(X);if(!X||cn(X)||un(X)||El($,W.path)!==null||Te){X&&p.preventDefault();return}if(Xn(X)){const me=p.clientX,Be=p.clientY,Re=Sv/ye.current.scale,ze=()=>{S.removeEventListener("pointermove",ut),S.removeEventListener("pointerup",ze),S.removeEventListener("pointercancel",ze),window.removeEventListener("pointerup",ze),window.removeEventListener("pointercancel",ze)},ut=it=>{Math.hypot(it.clientX-me,it.clientY-Be)<Re||(ze(),Cn("table-cell"))};S.addEventListener("pointermove",ut),S.addEventListener("pointerup",ze),S.addEventListener("pointercancel",ze),window.addEventListener("pointerup",ze),window.addEventListener("pointercancel",ze);return}const fe=(Q?T.selections:[W]).filter(me=>me.slideIndex===T.activeIndex).map(me=>({selection:me,element:je($,me.path)})).filter(me=>me.element!==null&&!Xn(me.element)&&!cn(me.element)&&!un(me.element)&&El($,me.selection.path)===null&&!(wl(me.element)&&Do(me.element))).sort((me,Be)=>Yu(me.selection,W)?-1:Yu(Be.selection,W)?1:0);fe.length!==0&&(p.preventDefault(),bc(fe,$,Ev(p.clientX,p.clientY,$),p.pointerId,p.altKey))},[bc,ct,Mi,Ae,Cn]);_a.current=fd,cc.current=xc,w.useEffect(()=>{const p=S=>_a.current(S,document);return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[]),w.useEffect(()=>{const p=S=>vi.current(S,document);return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[]);const Sc=w.useCallback(async p=>{var T;const S=(T=i.current)==null?void 0:T.contentDocument;if(S)try{await b.commit((M,I)=>(p.removeAttribute(Kn),p.removeAttribute("contenteditable"),nv(M,I.index,S))),dl()}catch{p.setAttribute("contenteditable","true"),p.setAttribute(Kn,"true")}},[b,dl]),pd=w.useCallback(()=>{var X,Te;const p=(X=i.current)==null?void 0:X.contentDocument;if(!p)return;Tt(),Rh(p),ee(le=>le+1);const S=Mh(p),T=(Te=ye.current.slides[ye.current.activeIndex])==null?void 0:Te.id;if(S&&T){const le={id:T,box:S};pe(fe=>YT(fe,le)?fe:le)}p.addEventListener("dblclick",le=>{const fe=Co(le.target);if(!fe||!p.body.contains(fe))return;const me=p.querySelector(`[${Pu}]`)??p.body;let Be=fe;for(;Be.parentElement&&Be.parentElement!==me;)Be=Be.parentElement;const Re=hx(Be);if(Re){Cn(Re);return}const ze=mx(fe);if(ze==="locked"||ze==="hidden"||ze==="group"){Cn(ze);return}if(ze===null){const Dl=fe.closest(Ju);le.preventDefault(),Dl.hasAttribute(Kn)||tn.current.set(Dl,Dl.innerHTML),Dl.setAttribute("contenteditable","true"),Dl.setAttribute(Kn,"true"),Dl.focus(),Ni(Dl);return}const ut=ye.current,it=ut.slides[ut.activeIndex],Dt=it?si(it,p):null;if(!Dt)return;const Sr=at.current.length>0?EE(Dt,fe,at.current):UN(Dt,fe);if(!Sr){(at.current.length>0?je(Dt,at.current):null)!==fe&&Cn(ze);return}le.preventDefault(),ge(Sr),be.current.clearSelection(),ct()}),p.addEventListener("keydown",le=>vi.current(le,p),!0),p.addEventListener("keydown",le=>{if(le.key==="Escape"){const fe=p.querySelector(`[${Kn}]`);if(fe){fe.blur(),le.preventDefault();return}}_a.current(le,p)});const M=le=>{be.current.changePendingEdit("text",le.innerHTML===tn.current.get(le)?null:{apply:()=>(Sc(le),!0),discard:()=>{le.removeAttribute(Kn),le.removeAttribute("contenteditable"),dl()}})};za.current=M,p.addEventListener("input",le=>{const fe=le.target,me=fe==null?void 0:fe.closest(`[${Kn}]`);me&&M(me)}),p.addEventListener("paste",le=>{var it;const fe=Gt.current,me=le.target;if(!fe||!me||!fe.contains(me))return;const Be=ew(((it=le.clipboardData)==null?void 0:it.getData("text/plain"))??"");if(le.preventDefault(),!Be)return;const Re=p.getSelection(),ze=Re&&Re.rangeCount>0?Re.getRangeAt(0):jt.current;if(!ze||!fe.contains(ze.commonAncestorContainer))return;ze.deleteContents();const ut=p.createTextNode(Be);ze.insertNode(ut),ze.setStartAfter(ut),ze.collapse(!0),Re==null||Re.removeAllRanges(),Re==null||Re.addRange(ze),jt.current=ze,M(fe),Al(Dt=>Dt&&{state:kr(p,fe,ze),error:Dt.error})}),p.addEventListener("selectionchange",()=>{const le=Gt.current;if(!le||!le.isConnected)return;const fe=jo(p);fe&&le.contains(fe.commonAncestorContainer)&&(jt.current=fe),Al(me=>me&&{state:kr(p,le,jt.current),error:me.error})}),p.addEventListener("focusout",le=>{if(Jn.current)return;const fe=le.target;fe!=null&&fe.hasAttribute(Kn)&&(Et.current!==null&&window.clearTimeout(Et.current),Et.current=window.setTimeout(()=>{Et.current=null;const me=document.activeElement;me instanceof Element&&me.closest('[data-testid="text-toolbar"]')||Ai(fe)},0))}),p.addEventListener("click",le=>{var me;((me=le.target)==null?void 0:me.closest("a"))&&le.preventDefault()}),p.addEventListener("pointerdown",le=>{cc.current(le,p)}),p.querySelectorAll("[data-ppt-editor-style]").forEach(le=>le.remove());const I=p.createElement("style");I.setAttribute("data-ppt-editor-style",""),I.textContent=`html[${To}="move"], html[${To}="move"] * { cursor: move !important; }html[${To}="blocked"], html[${To}="blocked"] * { cursor: default !important; }`,p.head.appendChild(I);const $=(le,fe)=>{const me=ye.current;if(Ot.current||Gt.current){Tt();return}const Be=me.slides[me.activeIndex],Re=Be?si(Be,p):null,ze=p.elementFromPoint(le.x,le.y);if(!Be||!Re||!ze||!Re.contains(ze)){Tt();return}if(Ys(ze)){Tt();return}const ut=Mi(ze,Re,fe),it=ut?je(Re,ut.path):null;if(!ut||!it||me.selection&&Yu(me.selection,ut)&&me.selections.length===1){Tt();return}const Dt=ut.path.join(".");if(Hn.current===Dt)return;Hn.current=Dt;const Sr=!Xn(it)&&!(wl(it)&&Do(it))&&!cn(it)&&El(Re,ut.path)===null;xn({path:ut.path,rect:cr(Ul(it,Re),No(Re)),label:yx(it),draggable:Sr}),p.documentElement.setAttribute(To,Sr?"move":"blocked")},W=le=>{if(Sn.current={x:le.clientX,y:le.clientY},Ln.current=le.altKey,Ut.current!==null)return;const fe=Sn.current;Ut.current=window.requestAnimationFrame(()=>{Ut.current=null,$(fe,Ln.current)})},Q=le=>{le.key!=="Alt"||!Sn.current||(Ln.current=le.altKey,$(Sn.current,le.altKey))};Zn.current=le=>{Sn.current&&(Ln.current=le,$(Sn.current,le))},p.addEventListener("pointermove",W),p.addEventListener("pointerleave",Tt),p.addEventListener("keydown",Q),p.addEventListener("keyup",Q),p.addEventListener("pointerout",le=>{le.relatedTarget||Tt()})},[Ni,Tt,ct,Sc,Mi,dl,Ai,Cn]),es=w.useCallback(p=>{var M;const S=(M=i.current)==null?void 0:M.contentDocument,T=Gt.current;if(!S||!T||!T.isConnected){dl();return}try{Bp(S,T,p,jt.current),jt.current=jo(S)??jt.current,za.current(T),Al({state:kr(S,T,jt.current),error:""}),T.focus()}catch(I){Al({state:kr(S,T,jt.current),error:I instanceof Error?I.message:String(I)}),T.focus()}},[dl]),hd=w.useCallback(()=>{var I;const p=(I=i.current)==null?void 0:I.contentDocument,S=Gt.current;if(!p||!S||!S.isConnected){dl();return}const T=kr(p,S,jt.current).link??"";Jn.current=!0;let M=null;try{M=window.prompt(a("app.linkPromptDetail"),T||"https://")}finally{Jn.current=!1}if(M!==null)try{Bp(p,S,{type:"link",value:M},jt.current),jt.current=jo(p)??jt.current,za.current(S),Al({state:kr(p,S,jt.current),error:""}),S.focus()}catch($){Al({state:kr(p,S,jt.current),error:$ instanceof Error?$.message:String($)}),S.focus()}},[dl,a]),md=w.useCallback(p=>{const S={type:p.type};if(Gt.current){es(S);return}Zl(S)},[Zl,es]);Ma.current=md;const el=w.useCallback(async p=>{var I;if(!be.current.settlePendingEdits())return;const S=ye.current,T=S.slides[S.activeIndex];if(!T||!S.master)return;const M=S.activeIndex;Fe("");try{const $=await Iw(p,{width:T.width,height:T.height}),W=ye.current;if(W.activeIndex!==M||((I=W.slides[M])==null?void 0:I.id)!==T.id)return;await be.current.commitMaster(Q=>{var me;const X=Qn(Q,T.id),Te=$.apply(X.element),le=[Array.from(X.element.children).indexOf(Te)],fe=ye.current.activeIndex;return fe===M&&((me=ye.current.slides[M])==null?void 0:me.id)===T.id&&be.current.selectTargets([{slideIndex:fe,path:le,elementId:Te.getAttribute("data-ppt-el")}]),!0})}catch($){Fe($ instanceof Error?$.message:String($))}},[]),gd=w.useCallback(p=>{el({kind:"shape",shape:p})},[el]),yd=w.useCallback(()=>{const p=window.prompt(a("app.imageUrlPromptDetail"),"https://");p!==null&&el({kind:"image",url:p})},[el,a]);w.useEffect(()=>{var W;if(!F)return;const p=(W=i.current)==null?void 0:W.contentDocument;if(!p)return;const S=Q=>{const X=Array.from(Q??[]).find(Te=>Te.type.startsWith("image/")||Kv(Te.name)!==null);X&&el({kind:"image",file:X})},T=Q=>{var X;(X=Q.dataTransfer)!=null&&X.types.includes("Files")&&(Q.preventDefault(),Q.dataTransfer.dropEffect="copy")},M=Q=>{var X;(X=Q.dataTransfer)!=null&&X.files.length&&(Q.preventDefault(),S(Q.dataTransfer.files))},I=Q=>{var le;if(Gt.current)return;const X=Array.from(((le=Q.clipboardData)==null?void 0:le.items)??[]).find(fe=>fe.kind==="file"&&fe.type.startsWith("image/")),Te=X==null?void 0:X.getAsFile();Te&&(Q.preventDefault(),el({kind:"image",file:Te}))},$=[p,window];for(const Q of $)Q.addEventListener("dragover",T),Q.addEventListener("drop",M),Q.addEventListener("paste",I);return()=>{for(const Q of $)Q.removeEventListener("dragover",T),Q.removeEventListener("drop",M),Q.removeEventListener("paste",I)}},[F,el]);const zi=p=>{b.showSlide(p)},_i=se.map(p=>`${p.slideIndex}:${p.path.join(".")}`).join("|");w.useEffect(()=>{const p=ce.current!==r;if(z.current===_i&&!p)return;if(z.current=_i,ce.current=r,!_i){Pe($b(null,0,a));return}const S=ye.current,T=S.slides[S.activeIndex],M=S.selection,I=T&&M?je(T.element,M.path):null;Pe($b(I,S.selections.length,a))},[r,_i,a]),w.useEffect(()=>{E.length!==0&&Pe(CE(v,E.length,a))},[v,Z==null?void 0:Z.id,E.length,a]),w.useEffect(()=>{const p=kn.current,S=p.slideId!==(Z==null?void 0:Z.id);if(p.slideId=Z==null?void 0:Z.id,S&&(p.resetBySlide=Ae.length>0,Kl(null)),p.key===Ne)return;if(p.key=Ne,S){p.resetBySlide=!1;return}if(p.resetBySlide&&(p.resetBySlide=!1,Ne===""))return;Kl(null);const T=Ae.length>0&&Z?je(Z.element,Ae):null;Pe(NE(T,a))},[Z,Ae,Ne,a]);const ki=GN(Z,se,v),Hi=YN(Z,se,v),Jl=Hi?{...ki,...Hi}:ki,bd=(()=>{var M;if(!Z||!ae||se.length!==1)return null;const p=je(Z.element,ae.path);if(!p)return null;const S=OE(p);if(!S)return null;const T=p.tagName.toLowerCase();return{kind:S,svg:T==="svg",appearance:ow(p),text:T==="svg"?((M=p.querySelector("text"))==null?void 0:M.textContent)??"":"",alt:p.getAttribute("alt")??"",crop:uw(p)??{top:0,right:0,bottom:0,left:0}}})(),tl=Z&&ae?Ip(Z.element,ae.path):null,Li=tl&&se.length===1?{row:tl.row,column:tl.column,rows:tl.rows,columns:tl.columns,header:tl.header,fill:tl.cell.style.background||tl.cell.style.backgroundColor,border:tl.cell.style.borderTopColor||tl.cell.style.borderColor}:null,fl=Z&&ae?je(Z.element,ae.path):null,wc=(()=>{if(se.length!==1)return null;const p=Ro(fl);if(!p)return null;try{const S=Eh(p);return{type:S.type,title:S.title??""}}catch{return{type:"invalid",title:a("app.invalidData")}}})(),Ui=Z&&ae?El(Z.element,ae.path):null,xr=ae!==null&&ae.path.length>1&&Ui!==null,Ec=fl?wl(fl):!1,Tc=fl?Xn(fl):!1,vd=Ui!==null||Ec||Tc||fl&&cn(fl)?"none":fl&&_n(fl)?"rotate":"all",Cc=w.useMemo(()=>{var M,I;if(y.selections.length>1)return{status:"multi",canEdit:!1,canFormat:!1};if(y.selections.length!==1||!y.selection||y.selection.slideIndex!==y.activeIndex)return{status:"idle",canEdit:!1,canFormat:!1};const p=Vu((M=i.current)==null?void 0:M.contentDocument,y.slides[y.activeIndex],y.selection.path);if(!p)return{status:"idle",canEdit:!1,canFormat:!1};if(p.status==="blocked")return{status:"blocked",canEdit:!1,canFormat:!1,reason:p.reason};const S=((I=p.leaf.textContent)==null?void 0:I.replace(/\s+/g," ").trim())??"",T=S.length>40?`${S.slice(0,40)}…`:S;return{status:"editable",canEdit:!0,canFormat:!p.empty,text:T}},[y,F]);return oe==="standalone"&&!Y?g.jsx(QE,{drafts:en,error:oc||(B==="load-error"?D:""),busy:ad,onOpenFile:(p,S)=>void La(p,S),onError:Br,onRestore:p=>void Jo(p),onDiscard:Ei}):Ue&&Z?g.jsx(BC,{slide:Z,srcDoc:Y?Lo(Y,Z,{markFrame:!1}):C,transition:Ox(Z.element),fullscreen:ie,fullscreenNotice:Ve||void 0,presenterError:rt||void 0,onKeyDown:(p,S)=>_a.current(p,S),onAdvance:()=>{const p=ye.current;be.current.showSlide(Math.min(p.slides.length-1,p.activeIndex+1))},onOpenPresenter:ka}):g.jsxs("div",{className:"flex h-screen flex-col bg-canvas text-ink","aria-busy":zt||void 0,children:[g.jsx("p",{"data-testid":"a11y-status",className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:pt}),g.jsx(mN,{filePath:G,pathEditable:oe==="host",openingDeck:zt,openDeckError:Tn,onOpenDeck:p=>void Ua(p),onPickDeck:()=>void Ql(),status:B,activeIndex:v,slideCount:E.length,view:Se,canDelete:E.length>1,onAddSlide:Si,onDuplicateSlide:()=>cl(),onDeleteSlide:()=>wn(),onInsertText:()=>void el({kind:"text",text:a("editor.newTextBox")}),onInsertShape:gd,onInsertTable:(p,S)=>void el({kind:"table",rows:p,columns:S}),onInsertChart:()=>void el({kind:"chart"}),onInsertImageFile:p=>void el({kind:"image",file:p}),onInsertImageUrl:yd,onUndo:b.undo,onRedo:b.redo,onPlay:()=>$l(!1),onOpenHelp:()=>xe(!0),onViewChange:sd,onPreviousSlide:()=>zi(v-1),onNextSlide:()=>zi(v+1),onExport:gc,exporting:mi,exportSignal:sc,standaloneMode:oe==="standalone",standaloneUpload:oe==="standalone"&&(Le==null?void 0:Le.canWrite)===!1}),Nn&&g.jsx(qb,{state:Nn.state,error:Nn.error||void 0,onCommand:es,onLink:hd}),An&&g.jsx(pE,{json:An.json,error:An.error,onChange:p=>Un(S=>S&&{json:p,error:""}),onApply:Ol,onCancel:()=>Un(null)}),He&&g.jsx(mE,{onClose:()=>xe(!1)}),(D||Me||Io)&&g.jsx("div",{"data-testid":"editor-error",className:"max-h-24 overflow-auto border-b border-danger bg-danger-soft px-4 py-2 text-xs text-danger",children:[D,Me,Io].filter(Boolean).join(" · ")}),Ra&&g.jsxs("div",{"data-testid":"export-result",role:"status",className:"flex items-center gap-3 border-b border-success bg-success-soft px-4 py-2 text-xs text-success",children:[g.jsx("span",{className:"min-w-0 flex-1 truncate",children:Ra}),g.jsx("button",{type:"button","data-testid":"export-dismiss",className:"rounded border border-success px-2 py-0.5 text-success",onClick:()=>Vl(""),children:a("common.close")})]}),hi&&g.jsxs("div",{"data-testid":"recovery-banner",role:"alert",className:"flex flex-wrap items-center gap-3 border-b border-warning bg-warning-soft px-4 py-2 text-xs text-warning",children:[g.jsx("span",{className:"min-w-0 flex-1 truncate",children:a("recovery.found",{path:hi.filePath})}),g.jsx("button",{type:"button","data-testid":"recovery-restore",className:"rounded border border-warning px-2 py-1 text-xs text-warning",onClick:()=>{b.restoreDraft(hi.html),pr(null)},children:a("recovery.restore")}),g.jsx("button",{type:"button","data-testid":"recovery-discard",className:"rounded border border-warning px-2 py-1 text-xs text-warning",onClick:()=>{Bs(hi.key),pr(null)},children:a("recovery.discard")})]}),re&&g.jsxs("div",{"data-testid":"conflict-banner",role:"alert",className:"flex flex-wrap items-center gap-3 border-b border-warning bg-warning-soft px-4 py-2 text-xs text-warning",children:[g.jsx("span",{children:a(ve?"conflict.switched":"conflict.external")}),!ve&&y.pending&&g.jsx("span",{"data-testid":"pending-edit-instruction",children:a("editor.pendingEditInstruction")}),g.jsx("button",{type:"button","data-testid":"conflict-reload",disabled:y.recoveryBusy,onPointerDown:p=>p.preventDefault(),className:"rounded border border-warning px-2 py-1 text-xs text-warning transition-colors",onClick:()=>Xo("reload"),children:a("conflict.reload")}),!ve&&g.jsx("button",{type:"button","data-testid":"conflict-overwrite",disabled:y.recoveryBusy||y.pending,onPointerDown:p=>p.preventDefault(),className:"rounded border border-warning px-2 py-1 text-xs text-warning transition-colors",onClick:()=>Xo("overwrite"),children:a("conflict.overwrite")})]}),Ae.length>0&&Z?g.jsxs("nav",{"data-testid":"edit-context","aria-label":a("editor.context.label"),className:"flex flex-wrap items-center gap-1 border-b border-line bg-surface px-4 py-1 text-xs text-muted",children:[g.jsx("button",{type:"button","aria-label":a("editor.context.slide"),className:"rounded px-1.5 py-0.5 transition-colors hover:bg-hover hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",onClick:()=>Vo([]),children:a("editor.context.slide")}),Ae.map((p,S)=>{const T=Ae.slice(0,S+1),M=je(Z.element,T),I=M?lx(M):a("editor.context.unknown");return g.jsxs(w.Fragment,{children:[g.jsx("span",{"aria-hidden":"true",children:"›"}),g.jsx("button",{type:"button","aria-label":a("editor.context.goTo",{name:I}),className:"rounded px-1.5 py-0.5 transition-colors hover:bg-hover hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",onClick:()=>Vo(T),children:I})]},T.join("."))})]}):null,Se==="sorter"?g.jsx(WC,{master:Y,slides:E,activeIndex:v,onSelect:zi,onReorder:uc,onDuplicate:p=>cl(p),onDelete:p=>wn(p),canDelete:E.length>1}):g.jsxs("div",{className:"flex min-h-0 flex-1",children:[g.jsx(FC,{master:Y,slides:E,activeIndex:v,onSelect:zi}),g.jsxs("main",{ref:s,"data-testid":"canvas-preview",onPointerDown:p=>{p.target===p.currentTarget&&(ge(S=>S.length===0?S:[]),b.clearSelection(),ct())},className:"relative flex min-w-0 flex-1 items-center justify-center overflow-hidden bg-canvas p-12",children:[yi&&!Nn&&g.jsx("div",{className:`pointer-events-none absolute inset-x-0 z-30 flex justify-center ${Li?"top-16":"top-2"}`,children:g.jsx("div",{className:"pointer-events-auto overflow-hidden rounded-md border border-line-strong shadow-[0_16px_40px_var(--editor-shadow-panel)]",children:g.jsx(qb,{mode:"selection",state:yi.state,error:yi.error||void 0,onCommand:p=>void Zl(p),onLink:Ba})})}),Li&&g.jsx("div",{className:"absolute inset-x-0 top-0 z-30",children:g.jsx(uE,{state:Li,disabled:ki.locked||ki.hidden,onAction:Fo,onCellStyle:mc})}),Z&&qe?g.jsxs("div",{"data-testid":"canvas-stage",className:"relative shadow-[0_24px_80px_var(--editor-shadow-stage)]",style:{width:qe.width,height:qe.height},children:[g.jsx("div",{className:"absolute inset-0 overflow-hidden",children:g.jsx("iframe",{ref:i,title:a("rail.preview"),sandbox:"allow-same-origin",srcDoc:C,onLoad:pd,className:"absolute left-0 top-0 border-0 bg-white",style:{width:Z.width,height:Z.height,transform:`translate(${qe.translateX}px, ${qe.translateY}px) scale(${A})`,transformOrigin:"top left"}},y.documentEpoch)}),g.jsx("div",{className:"pointer-events-none absolute z-10",style:{left:qe.translateX,top:qe.translateY,width:Z.width*A,height:Z.height*A},children:g.jsx(jC,{boxes:rn,guides:Vt,hover:Lt?{rect:Lt.rect,label:Lt.label}:null,scale:A,readOnly:rn.length>1||Ui!==null,handles:vd,onResizeStart:Po,onRotateStart:cd})}),we&&g.jsx("div",{"data-testid":"transition-preview-overlay","data-transition":we.transition,className:`htmlppt-transition-preview htmlppt-transition-preview--${we.transition}`,onAnimationEnd:()=>Ye(p=>(p==null?void 0:p.id)===we.id?null:p)},we.id)]}):B==="loading"?g.jsx("p",{className:"text-sm text-muted",children:a("common.loading")}):g.jsx("p",{className:"text-sm text-muted",children:a("editor.noSlides")}),g.jsx("span",{"data-testid":"pin-notice-status",role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:sl?a("editor.notice.pinned"):""}),sl&&g.jsx("div",{className:"pointer-events-none absolute bottom-1 left-4 z-20",children:g.jsxs("div",{"data-testid":"pin-notice",className:"pointer-events-auto flex items-center gap-2 rounded-lg border border-line-strong bg-surface px-3 py-1 text-xs text-muted shadow-[0_12px_32px_var(--editor-shadow-panel)]",children:[g.jsx("span",{className:"whitespace-nowrap",children:a("editor.notice.pinned")}),g.jsx("button",{type:"button","data-testid":"pin-notice-undo",className:"rounded border border-line px-2 py-0.5 text-ink transition-colors hover:bg-hover",onClick:()=>{be.current.undo(),ja(!1)},children:a("editor.notice.undo")}),g.jsx("button",{type:"button","data-testid":"pin-notice-dismiss","aria-label":a("editor.notice.dismiss"),className:"rounded border border-line px-2 py-0.5 text-muted transition-colors hover:bg-hover hover:text-ink",onClick:()=>ja(!1),children:"×"})]})}),g.jsx("span",{"data-testid":"edit-hint-status",role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:hr?a(eh[hr.reason]):""}),hr&&g.jsx("div",{className:"pointer-events-none absolute bottom-4 left-1/2 z-20 -translate-x-1/2",children:g.jsxs("div",{"data-testid":"edit-hint",className:"pointer-events-auto flex max-w-lg flex-wrap items-center gap-2 rounded-lg border border-line-strong bg-surface px-3 py-2 text-xs text-muted shadow-[0_12px_32px_var(--editor-shadow-panel)]",children:[g.jsx("span",{className:"min-w-0 flex-1",children:a(eh[hr.reason])}),g.jsx("button",{type:"button","data-testid":"edit-hint-dismiss","aria-label":a("editor.notice.dismiss"),className:"rounded border border-line px-2 py-0.5 text-muted transition-colors hover:bg-hover hover:text-ink",onClick:()=>Kl(null),children:"×"})]})})]}),g.jsx(HC,{pendingActions:b,slide:Z,selection:ae,selectionCount:se.length,nestedSelectionCount:se.filter(p=>p.path.length>1).length,blockedByAncestor:xr,geometryUnavailable:Ec||Tc,contextPath:Ae,onEnterContext:Vo,geometry:wt,style:bd,chart:wc,styleDisabled:xr||Jl.locked||Jl.hidden||Jl.group,objectActions:Jl,onSelectObject:dc,onObjectCommand:Ri,onObjectRecovery:ud,onCommitGeometry:Yr,onSetAppearance:ul,onSetShapeText:Qo,onSetImageAlt:Zo,onSetImageCrop:Vr,onReplaceImageFile:Kr,onReplaceImageUrl:hc,onEditChart:Ha,onPreviewTransition:fc,onSetTransition:id,onSetBackground:pc,onClearBackground:$o,onSetNotes:od,textAction:Cc,onEditText:()=>{Oi()}},`${y.documentEpoch}:${Z==null?void 0:Z.id}`)]}),zt&&g.jsx("div",{"data-testid":"opening-overlay","aria-hidden":"true",className:"fixed inset-0 z-50 cursor-progress bg-overlay/20",onPointerDown:p=>{p.preventDefault(),p.stopPropagation()}})]})}const $N={connecting:"presenter.waiting",connected:"presenter.connected",disconnected:"presenter.disconnected"};function QN(r){const a=Math.floor(r/60).toString().padStart(2,"0"),i=(r%60).toString().padStart(2,"0");return`${a}:${i}`}function ZN(r){const a=Array.from((r==null?void 0:r.children)??[]).find(i=>i.hasAttribute("data-ppt-notes"));return((a==null?void 0:a.textContent)??"").trim()}function FN({sessionId:r}){const{t:a}=ln(),[i,s]=w.useState(""),[u,d]=w.useState(0),[h,m]=w.useState("connecting"),[y,b]=w.useState(0),E=w.useRef(null),v=w.useRef(0);w.useEffect(()=>{const se=Date.now(),Y=window.setInterval(()=>b(Math.floor((Date.now()-se)/1e3)),1e3);if(!qC(r))return m("disconnected"),()=>window.clearInterval(Y);const R=new BroadcastChannel(sh(r));E.current=R;const re=()=>R.postMessage({sessionId:r,type:"request"});R.onmessage=st=>{const Ue=Rx(st.data,r);Ue&&(Ue.type==="snapshot"?(s(Ue.html),d(Ue.index),m("connected"),v.current=Date.now()):Ue.type==="state"?(d(Ue.index),m("connected"),v.current=Date.now()):Ue.type==="bye"&&m("disconnected"))},re();const ve=window.setInterval(re,2e3),Z=window.setInterval(()=>{Date.now()-v.current>6e3&&m("disconnected")},1e3),Se=()=>R.postMessage({sessionId:r,type:"bye"});return window.addEventListener("pagehide",Se),()=>{window.clearInterval(Y),window.clearInterval(ve),window.clearInterval(Z),window.removeEventListener("pagehide",Se),R.close(),E.current=null}},[r]);const C=w.useMemo(()=>i?Ks(i):null,[i]),A=w.useMemo(()=>C?Ht(C):[],[C]),B=A[u],D=A[u+1],G=h==="connected"&&A.length>0,ae=se=>{var Y;!G||se<0||se>=A.length||(Y=E.current)==null||Y.postMessage({sessionId:r,type:"slide",index:se})};return w.useEffect(()=>{const se=Y=>{var Se;if(Y.defaultPrevented||Y.altKey||Y.ctrlKey||Y.metaKey)return;if(Y.key==="Escape"){Y.preventDefault(),window.close();return}const R=Y.target,re=!!((Se=R==null?void 0:R.closest)!=null&&Se.call(R,"button, a, input, select, textarea"));if((Y.key===" "||Y.key==="Spacebar")&&re)return;const ve=E.current,Z=st=>{const Ue=u+st;!G||!ve||Ue<0||Ue>=A.length||(Y.preventDefault(),ve.postMessage({sessionId:r,type:"slide",index:Ue}))};Y.key==="ArrowRight"||Y.key==="ArrowDown"||Y.key==="PageDown"||Y.key===" "||Y.key==="Spacebar"?Z(1):(Y.key==="ArrowLeft"||Y.key==="ArrowUp"||Y.key==="PageUp")&&Z(-1)};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[G,u,r,A.length]),g.jsxs("main",{"data-testid":"presenter-view",className:"flex min-h-screen flex-col gap-4 bg-[#0b0d12] p-6 text-zinc-100",children:[g.jsxs("header",{className:"flex items-center justify-between border-b border-white/10 pb-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-sm font-semibold tracking-wide",children:a("presenter.title")}),g.jsx("p",{className:"text-xs text-zinc-400",children:a("presenter.page",{index:A.length===0?0:u+1,total:A.length})}),g.jsx("p",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":"presenter-announcement",children:a("a11y.slide",{index:A.length===0?0:u+1,total:A.length})})]}),g.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[g.jsx("span",{"data-testid":"presenter-status",role:"status",className:h==="connected"?"text-emerald-300":"text-amber-300",children:a($N[h])}),g.jsx("span",{"data-testid":"presenter-timer",className:"tabular-nums",children:QN(y)})]})]}),g.jsxs("section",{"aria-label":a("presenter.currentNotes"),className:"flex flex-col gap-2",children:[g.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-zinc-400",children:a("presenter.notes")}),g.jsx("p",{"data-testid":"presenter-notes",className:"min-h-24 whitespace-pre-wrap rounded border border-white/10 bg-white/5 p-3 text-sm leading-relaxed",children:ZN(B==null?void 0:B.element)||a("presenter.noNotes")})]}),g.jsxs("section",{"aria-label":a("presenter.next"),className:"flex flex-col gap-2",children:[g.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-zinc-400",children:a("presenter.next")}),g.jsx("div",{"data-testid":"presenter-next-preview",className:"flex items-center gap-4 rounded border border-white/10 bg-white/5 p-3",children:D&&C?g.jsxs(g.Fragment,{children:[g.jsx(_h,{master:C,slide:D,width:320,className:"rounded shadow-md shadow-black/40"}),g.jsxs("span",{className:"text-sm text-zinc-300",children:[u+2,". ",zh(D,a("rail.untitled"))]})]}):g.jsx("span",{className:"text-sm text-zinc-400",children:a("presenter.lastSlide")})})]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("button",{type:"button","data-testid":"presenter-prev",disabled:!G||u<=0,onClick:()=>ae(u-1),className:"rounded border border-white/40 px-3 py-1.5 text-xs text-zinc-200 transition-colors hover:border-white/60 disabled:opacity-40",children:a("presenter.previous")}),g.jsx("button",{type:"button","data-testid":"presenter-next",disabled:!G||u>=A.length-1,onClick:()=>ae(u+1),className:"rounded border border-white/40 px-3 py-1.5 text-xs text-zinc-200 transition-colors hover:border-white/60 disabled:opacity-40",children:a("presenter.next")})]}),h==="disconnected"&&g.jsx("p",{role:"alert",className:"text-xs text-amber-300",children:a("presenter.disconnectedHelp")})]})}const Bx=document.getElementById("root");if(!Bx)throw new Error("Missing #root element");const Ix=new URLSearchParams(location.search),Av=Ix.get("session");Y1.createRoot(Bx).render(g.jsx(rE,{children:Ix.get("presenter")==="1"&&Av?g.jsx(FN,{sessionId:Av}):g.jsx(aN,{children:g.jsx(XN,{})})}));