From d1f2b8ba956a48f3ff781902ff57282451d22e55 Mon Sep 17 00:00:00 2001 From: ccoreilly Date: Sun, 29 Dec 2024 21:55:39 +0000 Subject: [PATCH] deploy: 5654b4cc546d46ffe2999f15b7a715574e76bf60 --- .../{index-a151de39.js => index-a082a6c0.js} | 116 +++++++++--------- index.html | 2 +- 2 files changed, 59 insertions(+), 59 deletions(-) rename assets/{index-a151de39.js => index-a082a6c0.js} (61%) diff --git a/assets/index-a151de39.js b/assets/index-a082a6c0.js similarity index 61% rename from assets/index-a151de39.js rename to assets/index-a082a6c0.js index a98f93a..4c2e094 100644 --- a/assets/index-a151de39.js +++ b/assets/index-a082a6c0.js @@ -1,4 +1,4 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function T1(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var R1={exports:{}},lc={},P1={exports:{}},$e={};/** +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function R1(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var P1={exports:{}},lc={},O1={exports:{}},$e={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Da=Symbol.for("react.element"),iR=Symbol.for("react.portal"),oR=Symbol.for("react.fragment"),sR=Symbol.for("react.strict_mode"),aR=Symbol.for("react.profiler"),lR=Symbol.for("react.provider"),uR=Symbol.for("react.context"),cR=Symbol.for("react.forward_ref"),fR=Symbol.for("react.suspense"),dR=Symbol.for("react.memo"),pR=Symbol.for("react.lazy"),qv=Symbol.iterator;function hR(e){return e===null||typeof e!="object"?null:(e=qv&&e[qv]||e["@@iterator"],typeof e=="function"?e:null)}var O1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A1=Object.assign,L1={};function gs(e,t,n){this.props=e,this.context=t,this.refs=L1,this.updater=n||O1}gs.prototype.isReactComponent={};gs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};gs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $1(){}$1.prototype=gs.prototype;function gh(e,t,n){this.props=e,this.context=t,this.refs=L1,this.updater=n||O1}var mh=gh.prototype=new $1;mh.constructor=gh;A1(mh,gs.prototype);mh.isPureReactComponent=!0;var Jv=Array.isArray,D1=Object.prototype.hasOwnProperty,vh={current:null},I1={key:!0,ref:!0,__self:!0,__source:!0};function N1(e,t,n){var r,o={},a=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)D1.call(t,r)&&!I1.hasOwnProperty(r)&&(o[r]=t[r]);var c=arguments.length-2;if(c===1)o.children=n;else if(1>>1,Y=H[G];if(0>>1;Go(ue,U))Fo(me,ue)?(H[G]=me,H[F]=U,G=F):(H[G]=ue,H[ee]=U,G=ee);else if(Fo(me,U))H[G]=me,H[F]=U,G=F;else break e}}return z}function o(H,z){var U=H.sortIndex-z.sortIndex;return U!==0?U:H.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],p=[],h=1,y=null,m=3,b=!1,C=!1,O=!1,L=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(H){for(var z=n(p);z!==null;){if(z.callback===null)r(p);else if(z.startTime<=H)r(p),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(p)}}function k(H){if(O=!1,x(H),!C)if(n(f)!==null)C=!0,pe(E);else{var z=n(p);z!==null&&oe(k,z.startTime-H)}}function E(H,z){C=!1,O&&(O=!1,_(P),P=-1),b=!0;var U=m;try{for(x(z),y=n(f);y!==null&&(!(y.expirationTime>z)||H&&!X());){var G=y.callback;if(typeof G=="function"){y.callback=null,m=y.priorityLevel;var Y=G(y.expirationTime<=z);z=e.unstable_now(),typeof Y=="function"?y.callback=Y:y===n(f)&&r(f),x(z)}else r(f);y=n(f)}if(y!==null)var V=!0;else{var ee=n(p);ee!==null&&oe(k,ee.startTime-z),V=!1}return V}finally{y=null,m=U,b=!1}}var R=!1,D=null,P=-1,j=5,I=-1;function X(){return!(e.unstable_now()-IH||125G?(H.sortIndex=U,t(p,H),n(f)===null&&H===n(p)&&(O?(_(P),P=-1):O=!0,oe(k,U-G))):(H.sortIndex=Y,t(f,H),C||b||(C=!0,pe(E))),H},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(H){var z=m;return function(){var U=m;m=z;try{return H.apply(this,arguments)}finally{m=U}}}})(j1);U1.exports=j1;var CR=U1.exports;/** + */(function(e){function t(H,z){var U=H.length;H.push(z);e:for(;0>>1,Y=H[G];if(0>>1;Go(ue,U))Fo(me,ue)?(H[G]=me,H[F]=U,G=F):(H[G]=ue,H[ee]=U,G=ee);else if(Fo(me,U))H[G]=me,H[F]=U,G=F;else break e}}return z}function o(H,z){var U=H.sortIndex-z.sortIndex;return U!==0?U:H.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],p=[],h=1,y=null,m=3,b=!1,C=!1,O=!1,A=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(H){for(var z=n(p);z!==null;){if(z.callback===null)r(p);else if(z.startTime<=H)r(p),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(p)}}function k(H){if(O=!1,x(H),!C)if(n(f)!==null)C=!0,pe(E);else{var z=n(p);z!==null&&oe(k,z.startTime-H)}}function E(H,z){C=!1,O&&(O=!1,_(P),P=-1),b=!0;var U=m;try{for(x(z),y=n(f);y!==null&&(!(y.expirationTime>z)||H&&!X());){var G=y.callback;if(typeof G=="function"){y.callback=null,m=y.priorityLevel;var Y=G(y.expirationTime<=z);z=e.unstable_now(),typeof Y=="function"?y.callback=Y:y===n(f)&&r(f),x(z)}else r(f);y=n(f)}if(y!==null)var V=!0;else{var ee=n(p);ee!==null&&oe(k,ee.startTime-z),V=!1}return V}finally{y=null,m=U,b=!1}}var R=!1,D=null,P=-1,j=5,I=-1;function X(){return!(e.unstable_now()-IH||125G?(H.sortIndex=U,t(p,H),n(f)===null&&H===n(p)&&(O?(_(P),P=-1):O=!0,oe(k,U-G))):(H.sortIndex=Y,t(f,H),C||b||(C=!0,pe(E))),H},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(H){var z=m;return function(){var U=m;m=z;try{return H.apply(this,arguments)}finally{m=U}}}})(B1);j1.exports=B1;var ER=j1.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ER=B,An=CR;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fp=Object.prototype.hasOwnProperty,TR=/^[: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]*$/,t0={},n0={};function RR(e){return fp.call(n0,e)?!0:fp.call(t0,e)?!1:TR.test(e)?n0[e]=!0:(t0[e]=!0,!1)}function PR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function OR(e,t,n,r){if(t===null||typeof t>"u"||PR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rn(e,t,n,r,o,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jt[e]=new rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jt[t]=new rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jt[e]=new rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jt[e]=new rn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jt[e]=new rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jt[e]=new rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jt[e]=new rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jt[e]=new rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jt[e]=new rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wh=/[\-:]([a-z])/g;function xh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jt[e]=new rn(e,1,!1,e.toLowerCase(),null,!1,!1)});jt.xlinkHref=new rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jt[e]=new rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sh(e,t,n,r){var o=jt.hasOwnProperty(t)?jt[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fp=Object.prototype.hasOwnProperty,RR=/^[: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]*$/,t0={},n0={};function PR(e){return fp.call(n0,e)?!0:fp.call(t0,e)?!1:RR.test(e)?n0[e]=!0:(t0[e]=!0,!1)}function OR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function LR(e,t,n,r){if(t===null||typeof t>"u"||OR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rn(e,t,n,r,o,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jt[e]=new rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jt[t]=new rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jt[e]=new rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jt[e]=new rn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jt[e]=new rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jt[e]=new rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jt[e]=new rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jt[e]=new rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jt[e]=new rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wh=/[\-:]([a-z])/g;function xh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wh,xh);jt[t]=new rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jt[e]=new rn(e,1,!1,e.toLowerCase(),null,!1,!1)});jt.xlinkHref=new rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jt[e]=new rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sh(e,t,n,r){var o=jt.hasOwnProperty(t)?jt[t]:null;(o!==null?o.type!==0:r||!(2c||o[l]!==a[c]){var f=` -`+o[l].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=l&&0<=c);break}}}finally{yd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qs(e):""}function AR(e){switch(e.tag){case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return qs("Suspense");case 19:return qs("SuspenseList");case 0:case 2:case 15:return e=wd(e.type,!1),e;case 11:return e=wd(e.type.render,!1),e;case 1:return e=wd(e.type,!0),e;default:return""}}function gp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fo:return"Fragment";case zo:return"Portal";case dp:return"Profiler";case _h:return"StrictMode";case pp:return"Suspense";case hp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H1:return(e.displayName||"Context")+".Consumer";case W1:return(e._context.displayName||"Context")+".Provider";case bh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kh:return t=e.displayName||null,t!==null?t:gp(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return gp(e(t))}catch{}}return null}function LR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gp(t);case 8:return t===_h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function K1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $R(e){var t=K1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zl(e){e._valueTracker||(e._valueTracker=$R(e))}function G1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=K1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Eu(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 mp(e,t){var n=t.checked;return ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function i0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ci(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Y1(e,t){t=t.checked,t!=null&&Sh(e,"checked",t,!1)}function vp(e,t){Y1(e,t);var n=Ci(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yp(e,t.type,n):t.hasOwnProperty("defaultValue")&&yp(e,t.type,Ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function o0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yp(e,t,n){(t!=="number"||Eu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Js=Array.isArray;function es(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ha(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var na={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},DR=["Webkit","ms","Moz","O"];Object.keys(na).forEach(function(e){DR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),na[t]=na[e]})});function q1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||na.hasOwnProperty(e)&&na[e]?(""+t).trim():t+"px"}function J1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=q1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var IR=ct({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sp(e,t){if(t){if(IR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function _p(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bp=null;function Ch(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kp=null,ts=null,ns=null;function l0(e){if(e=Ma(e)){if(typeof kp!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=pc(t),kp(e.stateNode,e.type,t))}}function ew(e){ts?ns?ns.push(e):ns=[e]:ts=e}function tw(){if(ts){var e=ts,t=ns;if(ns=ts=null,l0(e),t)for(e=0;e>>=0,e===0?32:31-(KR(e)/GR|0)|0}var Ul=64,jl=4194304;function ea(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ou(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~o;c!==0?r=ea(c):(a&=l,a!==0&&(r=ea(a)))}else l=n&~o,l!==0?r=ea(l):a!==0&&(r=ea(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,a=t&-t,o>=a||o===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ia(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ur(t),e[t]=n}function ZR(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ia),v0=String.fromCharCode(32),y0=!1;function Sw(e,t){switch(e){case"keyup":return CP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _w(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Uo=!1;function TP(e,t){switch(e){case"compositionend":return _w(t);case"keypress":return t.which!==32?null:(y0=!0,v0);case"textInput":return e=t.data,e===v0&&y0?null:e;default:return null}}function RP(e,t){if(Uo)return e==="compositionend"||!$h&&Sw(e,t)?(e=ww(),pu=Oh=hi=null,Uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_0(n)}}function Ew(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ew(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tw(){for(var e=window,t=Eu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Eu(e.document)}return t}function Dh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function MP(e){var t=Tw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ew(n.ownerDocument.documentElement,n)){if(r!==null&&Dh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=r.end===void 0?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=b0(n,a);var l=b0(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jo=null,Op=null,sa=null,Ap=!1;function k0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ap||jo==null||jo!==Eu(r)||(r=jo,"selectionStart"in r&&Dh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sa&&xa(sa,r)||(sa=r,r=$u(Op,"onSelect"),0Ho||(e.current=Mp[Ho],Mp[Ho]=null,Ho--)}function qe(e,t){Ho++,Mp[Ho]=e.current,e.current=t}var Ei={},Yt=Ri(Ei),gn=Ri(!1),qi=Ei;function as(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in n)o[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function mn(e){return e=e.childContextTypes,e!=null}function Iu(){nt(gn),nt(Yt)}function A0(e,t,n){if(Yt.current!==Ei)throw Error(ne(168));qe(Yt,t),qe(gn,n)}function Nw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ne(108,LR(e)||"Unknown",o));return ct({},n,r)}function Nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,qi=Yt.current,qe(Yt,e),qe(gn,gn.current),!0}function L0(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=Nw(e,t,qi),r.__reactInternalMemoizedMergedChildContext=e,nt(gn),nt(Yt),qe(Yt,e)):nt(gn),qe(gn,n)}var Ur=null,hc=!1,$d=!1;function Mw(e){Ur===null?Ur=[e]:Ur.push(e)}function XP(e){hc=!0,Mw(e)}function Pi(){if(!$d&&Ur!==null){$d=!0;var e=0,t=We;try{var n=Ur;for(We=1;e>=l,o-=l,jr=1<<32-ur(t)+o|n<P?(j=D,D=null):j=D.sibling;var I=m(_,D,x[P],k);if(I===null){D===null&&(D=j);break}e&&D&&I.alternate===null&&t(_,D),v=a(I,v,P),R===null?E=I:R.sibling=I,R=I,D=j}if(P===x.length)return n(_,D),ot&&Hi(_,P),E;if(D===null){for(;PP?(j=D,D=null):j=D.sibling;var X=m(_,D,I.value,k);if(X===null){D===null&&(D=j);break}e&&D&&X.alternate===null&&t(_,D),v=a(X,v,P),R===null?E=X:R.sibling=X,R=X,D=j}if(I.done)return n(_,D),ot&&Hi(_,P),E;if(D===null){for(;!I.done;P++,I=x.next())I=y(_,I.value,k),I!==null&&(v=a(I,v,P),R===null?E=I:R.sibling=I,R=I);return ot&&Hi(_,P),E}for(D=r(_,D);!I.done;P++,I=x.next())I=b(D,_,P,I.value,k),I!==null&&(e&&I.alternate!==null&&D.delete(I.key===null?P:I.key),v=a(I,v,P),R===null?E=I:R.sibling=I,R=I);return e&&D.forEach(function(J){return t(_,J)}),ot&&Hi(_,P),E}function L(_,v,x,k){if(typeof x=="object"&&x!==null&&x.type===Fo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ml:e:{for(var E=x.key,R=v;R!==null;){if(R.key===E){if(E=x.type,E===Fo){if(R.tag===7){n(_,R.sibling),v=o(R,x.props.children),v.return=_,_=v;break e}}else if(R.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===ci&&I0(E)===R.type){n(_,R.sibling),v=o(R,x.props),v.ref=Hs(_,R,x),v.return=_,_=v;break e}n(_,R);break}else t(_,R);R=R.sibling}x.type===Fo?(v=Zi(x.props.children,_.mode,k,x.key),v.return=_,_=v):(k=Su(x.type,x.key,x.props,null,_.mode,k),k.ref=Hs(_,v,x),k.return=_,_=k)}return l(_);case zo:e:{for(R=x.key;v!==null;){if(v.key===R)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(_,v.sibling),v=o(v,x.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=jd(x,_.mode,k),v.return=_,_=v}return l(_);case ci:return R=x._init,L(_,v,R(x._payload),k)}if(Js(x))return C(_,v,x,k);if(Fs(x))return O(_,v,x,k);Yl(_,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(_,v.sibling),v=o(v,x),v.return=_,_=v):(n(_,v),v=Ud(x,_.mode,k),v.return=_,_=v),l(_)):n(_,v)}return L}var us=jw(!0),Bw=jw(!1),Fu=Ri(null),Uu=null,Go=null,zh=null;function Fh(){zh=Go=Uu=null}function Uh(e){var t=Fu.current;nt(Fu),e._currentValue=t}function Up(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function is(e,t){Uu=e,zh=Go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(hn=!0),e.firstContext=null)}function Xn(e){var t=e._currentValue;if(zh!==e)if(e={context:e,memoizedValue:t,next:null},Go===null){if(Uu===null)throw Error(ne(308));Go=e,Uu.dependencies={lanes:0,firstContext:e}}else Go=Go.next=e;return t}var Gi=null;function jh(e){Gi===null?Gi=[e]:Gi.push(e)}function Ww(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,jh(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gr(e,r)}function Gr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var fi=!1;function Bh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Gr(e,n)}return o=r.interleaved,o===null?(t.next=t,jh(r)):(t.next=o.next,o.next=t),r.interleaved=t,Gr(e,n)}function gu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Th(e,n)}}function N0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?o=a=l:a=a.next=l,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ju(e,t,n,r){var o=e.updateQueue;fi=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,c=o.shared.pending;if(c!==null){o.shared.pending=null;var f=c,p=f.next;f.next=null,l===null?a=p:l.next=p,l=f;var h=e.alternate;h!==null&&(h=h.updateQueue,c=h.lastBaseUpdate,c!==l&&(c===null?h.firstBaseUpdate=p:c.next=p,h.lastBaseUpdate=f))}if(a!==null){var y=o.baseState;l=0,h=p=f=null,c=a;do{var m=c.lane,b=c.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:b,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var C=e,O=c;switch(m=t,b=n,O.tag){case 1:if(C=O.payload,typeof C=="function"){y=C.call(b,y,m);break e}y=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=O.payload,m=typeof C=="function"?C.call(b,y,m):C,m==null)break e;y=ct({},y,m);break e;case 2:fi=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[c]:m.push(c))}else b={eventTime:b,lane:m,tag:c.tag,payload:c.payload,callback:c.callback,next:null},h===null?(p=h=b,f=y):h=h.next=b,l|=m;if(c=c.next,c===null){if(c=o.shared.pending,c===null)break;m=c,c=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(h===null&&(f=y),o.baseState=f,o.firstBaseUpdate=p,o.lastBaseUpdate=h,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);to|=l,e.lanes=l,e.memoizedState=y}}function M0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Id.transition;Id.transition={};try{e(!1),t()}finally{We=n,Id.transition=r}}function ax(){return Qn().memoizedState}function JP(e,t,n){var r=_i(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lx(e))ux(t,n);else if(n=Ww(e,t,n,r),n!==null){var o=tn();cr(n,e,r,o),cx(n,t,r)}}function eO(e,t,n){var r=_i(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lx(e))ux(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,c=a(l,n);if(o.hasEagerState=!0,o.eagerState=c,fr(c,l)){var f=t.interleaved;f===null?(o.next=o,jh(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}n=Ww(e,t,o,r),n!==null&&(o=tn(),cr(n,e,r,o),cx(n,t,r))}}function lx(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function ux(e,t){aa=Wu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Th(e,n)}}var Hu={readContext:Xn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},tO={readContext:Xn,useCallback:function(e,t){return wr().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:F0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vu(4194308,4,nx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vu(4194308,4,e,t)},useInsertionEffect:function(e,t){return vu(4,2,e,t)},useMemo:function(e,t){var n=wr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=JP.bind(null,ut,e),[r.memoizedState,e]},useRef:function(e){var t=wr();return e={current:e},t.memoizedState=e},useState:z0,useDebugValue:Qh,useDeferredValue:function(e){return wr().memoizedState=e},useTransition:function(){var e=z0(!1),t=e[0];return e=qP.bind(null,e[1]),wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ut,o=wr();if(ot){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),Dt===null)throw Error(ne(349));eo&30||Yw(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,F0(Qw.bind(null,r,a,e),[e]),r.flags|=2048,Ra(9,Xw.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=wr(),t=Dt.identifierPrefix;if(ot){var n=Br,r=jr;n=(r&~(1<<32-ur(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ea++,0")&&(f=f.replace("",e.displayName)),f}while(1<=l&&0<=c);break}}}finally{yd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qs(e):""}function AR(e){switch(e.tag){case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return qs("Suspense");case 19:return qs("SuspenseList");case 0:case 2:case 15:return e=wd(e.type,!1),e;case 11:return e=wd(e.type.render,!1),e;case 1:return e=wd(e.type,!0),e;default:return""}}function gp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fo:return"Fragment";case zo:return"Portal";case dp:return"Profiler";case _h:return"StrictMode";case pp:return"Suspense";case hp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case V1:return(e.displayName||"Context")+".Consumer";case H1:return(e._context.displayName||"Context")+".Provider";case bh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kh:return t=e.displayName||null,t!==null?t:gp(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return gp(e(t))}catch{}}return null}function $R(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gp(t);case 8:return t===_h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function G1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DR(e){var t=G1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zl(e){e._valueTracker||(e._valueTracker=DR(e))}function Y1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=G1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Eu(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 mp(e,t){var n=t.checked;return ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function i0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ci(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function X1(e,t){t=t.checked,t!=null&&Sh(e,"checked",t,!1)}function vp(e,t){X1(e,t);var n=Ci(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yp(e,t.type,n):t.hasOwnProperty("defaultValue")&&yp(e,t.type,Ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function o0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yp(e,t,n){(t!=="number"||Eu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Js=Array.isArray;function es(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ha(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var na={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},IR=["Webkit","ms","Moz","O"];Object.keys(na).forEach(function(e){IR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),na[t]=na[e]})});function J1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||na.hasOwnProperty(e)&&na[e]?(""+t).trim():t+"px"}function ew(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=J1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var NR=ct({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sp(e,t){if(t){if(NR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function _p(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bp=null;function Ch(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kp=null,ts=null,ns=null;function l0(e){if(e=Ma(e)){if(typeof kp!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=pc(t),kp(e.stateNode,e.type,t))}}function tw(e){ts?ns?ns.push(e):ns=[e]:ts=e}function nw(){if(ts){var e=ts,t=ns;if(ns=ts=null,l0(e),t)for(e=0;e>>=0,e===0?32:31-(GR(e)/YR|0)|0}var Ul=64,jl=4194304;function ea(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ou(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~o;c!==0?r=ea(c):(a&=l,a!==0&&(r=ea(a)))}else l=n&~o,l!==0?r=ea(l):a!==0&&(r=ea(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,a=t&-t,o>=a||o===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ia(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ur(t),e[t]=n}function qR(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ia),v0=String.fromCharCode(32),y0=!1;function _w(e,t){switch(e){case"keyup":return EP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Uo=!1;function RP(e,t){switch(e){case"compositionend":return bw(t);case"keypress":return t.which!==32?null:(y0=!0,v0);case"textInput":return e=t.data,e===v0&&y0?null:e;default:return null}}function PP(e,t){if(Uo)return e==="compositionend"||!$h&&_w(e,t)?(e=xw(),pu=Oh=hi=null,Uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_0(n)}}function Tw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rw(){for(var e=window,t=Eu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Eu(e.document)}return t}function Dh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function zP(e){var t=Rw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tw(n.ownerDocument.documentElement,n)){if(r!==null&&Dh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=r.end===void 0?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=b0(n,a);var l=b0(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jo=null,Op=null,sa=null,Lp=!1;function k0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lp||jo==null||jo!==Eu(r)||(r=jo,"selectionStart"in r&&Dh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sa&&xa(sa,r)||(sa=r,r=$u(Op,"onSelect"),0Ho||(e.current=Mp[Ho],Mp[Ho]=null,Ho--)}function qe(e,t){Ho++,Mp[Ho]=e.current,e.current=t}var Ei={},Yt=Ri(Ei),gn=Ri(!1),qi=Ei;function as(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in n)o[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function mn(e){return e=e.childContextTypes,e!=null}function Iu(){nt(gn),nt(Yt)}function L0(e,t,n){if(Yt.current!==Ei)throw Error(ne(168));qe(Yt,t),qe(gn,n)}function Mw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ne(108,$R(e)||"Unknown",o));return ct({},n,r)}function Nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,qi=Yt.current,qe(Yt,e),qe(gn,gn.current),!0}function A0(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=Mw(e,t,qi),r.__reactInternalMemoizedMergedChildContext=e,nt(gn),nt(Yt),qe(Yt,e)):nt(gn),qe(gn,n)}var Ur=null,hc=!1,$d=!1;function zw(e){Ur===null?Ur=[e]:Ur.push(e)}function QP(e){hc=!0,zw(e)}function Pi(){if(!$d&&Ur!==null){$d=!0;var e=0,t=We;try{var n=Ur;for(We=1;e>=l,o-=l,jr=1<<32-ur(t)+o|n<P?(j=D,D=null):j=D.sibling;var I=m(_,D,x[P],k);if(I===null){D===null&&(D=j);break}e&&D&&I.alternate===null&&t(_,D),v=a(I,v,P),R===null?E=I:R.sibling=I,R=I,D=j}if(P===x.length)return n(_,D),ot&&Hi(_,P),E;if(D===null){for(;PP?(j=D,D=null):j=D.sibling;var X=m(_,D,I.value,k);if(X===null){D===null&&(D=j);break}e&&D&&X.alternate===null&&t(_,D),v=a(X,v,P),R===null?E=X:R.sibling=X,R=X,D=j}if(I.done)return n(_,D),ot&&Hi(_,P),E;if(D===null){for(;!I.done;P++,I=x.next())I=y(_,I.value,k),I!==null&&(v=a(I,v,P),R===null?E=I:R.sibling=I,R=I);return ot&&Hi(_,P),E}for(D=r(_,D);!I.done;P++,I=x.next())I=b(D,_,P,I.value,k),I!==null&&(e&&I.alternate!==null&&D.delete(I.key===null?P:I.key),v=a(I,v,P),R===null?E=I:R.sibling=I,R=I);return e&&D.forEach(function(J){return t(_,J)}),ot&&Hi(_,P),E}function A(_,v,x,k){if(typeof x=="object"&&x!==null&&x.type===Fo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ml:e:{for(var E=x.key,R=v;R!==null;){if(R.key===E){if(E=x.type,E===Fo){if(R.tag===7){n(_,R.sibling),v=o(R,x.props.children),v.return=_,_=v;break e}}else if(R.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===ci&&I0(E)===R.type){n(_,R.sibling),v=o(R,x.props),v.ref=Hs(_,R,x),v.return=_,_=v;break e}n(_,R);break}else t(_,R);R=R.sibling}x.type===Fo?(v=Zi(x.props.children,_.mode,k,x.key),v.return=_,_=v):(k=Su(x.type,x.key,x.props,null,_.mode,k),k.ref=Hs(_,v,x),k.return=_,_=k)}return l(_);case zo:e:{for(R=x.key;v!==null;){if(v.key===R)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(_,v.sibling),v=o(v,x.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=jd(x,_.mode,k),v.return=_,_=v}return l(_);case ci:return R=x._init,A(_,v,R(x._payload),k)}if(Js(x))return C(_,v,x,k);if(Fs(x))return O(_,v,x,k);Yl(_,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(_,v.sibling),v=o(v,x),v.return=_,_=v):(n(_,v),v=Ud(x,_.mode,k),v.return=_,_=v),l(_)):n(_,v)}return A}var us=Bw(!0),Ww=Bw(!1),Fu=Ri(null),Uu=null,Go=null,zh=null;function Fh(){zh=Go=Uu=null}function Uh(e){var t=Fu.current;nt(Fu),e._currentValue=t}function Up(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function is(e,t){Uu=e,zh=Go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(hn=!0),e.firstContext=null)}function Xn(e){var t=e._currentValue;if(zh!==e)if(e={context:e,memoizedValue:t,next:null},Go===null){if(Uu===null)throw Error(ne(308));Go=e,Uu.dependencies={lanes:0,firstContext:e}}else Go=Go.next=e;return t}var Gi=null;function jh(e){Gi===null?Gi=[e]:Gi.push(e)}function Hw(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,jh(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gr(e,r)}function Gr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var fi=!1;function Bh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Gr(e,n)}return o=r.interleaved,o===null?(t.next=t,jh(r)):(t.next=o.next,o.next=t),r.interleaved=t,Gr(e,n)}function gu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Th(e,n)}}function N0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?o=a=l:a=a.next=l,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ju(e,t,n,r){var o=e.updateQueue;fi=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,c=o.shared.pending;if(c!==null){o.shared.pending=null;var f=c,p=f.next;f.next=null,l===null?a=p:l.next=p,l=f;var h=e.alternate;h!==null&&(h=h.updateQueue,c=h.lastBaseUpdate,c!==l&&(c===null?h.firstBaseUpdate=p:c.next=p,h.lastBaseUpdate=f))}if(a!==null){var y=o.baseState;l=0,h=p=f=null,c=a;do{var m=c.lane,b=c.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:b,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var C=e,O=c;switch(m=t,b=n,O.tag){case 1:if(C=O.payload,typeof C=="function"){y=C.call(b,y,m);break e}y=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=O.payload,m=typeof C=="function"?C.call(b,y,m):C,m==null)break e;y=ct({},y,m);break e;case 2:fi=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[c]:m.push(c))}else b={eventTime:b,lane:m,tag:c.tag,payload:c.payload,callback:c.callback,next:null},h===null?(p=h=b,f=y):h=h.next=b,l|=m;if(c=c.next,c===null){if(c=o.shared.pending,c===null)break;m=c,c=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(h===null&&(f=y),o.baseState=f,o.firstBaseUpdate=p,o.lastBaseUpdate=h,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);to|=l,e.lanes=l,e.memoizedState=y}}function M0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Id.transition;Id.transition={};try{e(!1),t()}finally{We=n,Id.transition=r}}function lx(){return Qn().memoizedState}function eO(e,t,n){var r=_i(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ux(e))cx(t,n);else if(n=Hw(e,t,n,r),n!==null){var o=tn();cr(n,e,r,o),fx(n,t,r)}}function tO(e,t,n){var r=_i(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ux(e))cx(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,c=a(l,n);if(o.hasEagerState=!0,o.eagerState=c,fr(c,l)){var f=t.interleaved;f===null?(o.next=o,jh(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}n=Hw(e,t,o,r),n!==null&&(o=tn(),cr(n,e,r,o),fx(n,t,r))}}function ux(e){var t=e.alternate;return e===ut||t!==null&&t===ut}function cx(e,t){aa=Wu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Th(e,n)}}var Hu={readContext:Xn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},nO={readContext:Xn,useCallback:function(e,t){return wr().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:F0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vu(4194308,4,rx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vu(4194308,4,e,t)},useInsertionEffect:function(e,t){return vu(4,2,e,t)},useMemo:function(e,t){var n=wr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=eO.bind(null,ut,e),[r.memoizedState,e]},useRef:function(e){var t=wr();return e={current:e},t.memoizedState=e},useState:z0,useDebugValue:Qh,useDeferredValue:function(e){return wr().memoizedState=e},useTransition:function(){var e=z0(!1),t=e[0];return e=JP.bind(null,e[1]),wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ut,o=wr();if(ot){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),Dt===null)throw Error(ne(349));eo&30||Xw(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,F0(Zw.bind(null,r,a,e),[e]),r.flags|=2048,Ra(9,Qw.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=wr(),t=Dt.identifierPrefix;if(ot){var n=Br,r=jr;n=(r&~(1<<32-ur(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ea++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Sr]=t,e[ba]=r,xx(e,t,!1,!1),t.stateNode=e;e:{switch(l=_p(n,r),n){case"dialog":tt("cancel",e),tt("close",e),o=r;break;case"iframe":case"object":case"embed":tt("load",e),o=r;break;case"video":case"audio":for(o=0;ods&&(t.flags|=128,r=!0,Vs(a,!1),t.lanes=4194304)}else{if(!r)if(e=Bu(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!ot)return Vt(t),null}else 2*yt()-a.renderingStartTime>ds&&n!==1073741824&&(t.flags|=128,r=!0,Vs(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yt(),t.sibling=null,n=at.current,qe(at,r?n&1|2:n&1),t):(Vt(t),null);case 22:case 23:return ng(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Tn&1073741824&&(Vt(t),t.subtreeFlags&6&&(t.flags|=8192)):Vt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function uO(e,t){switch(Nh(t),t.tag){case 1:return mn(t.type)&&Iu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cs(),nt(gn),nt(Yt),Vh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hh(t),null;case 13:if(nt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(at),null;case 4:return cs(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return ng(),null;case 24:return null;default:return null}}var Ql=!1,Gt=!1,cO=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pt(e,t,r)}else n.current=null}function Xp(e,t,n){try{n()}catch(r){pt(e,t,r)}}var Q0=!1;function fO(e,t){if(Lp=Au,e=Tw(),Dh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var l=0,c=-1,f=-1,p=0,h=0,y=e,m=null;t:for(;;){for(var b;y!==n||o!==0&&y.nodeType!==3||(c=l+o),y!==a||r!==0&&y.nodeType!==3||(f=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(b=y.firstChild)!==null;)m=y,y=b;for(;;){if(y===e)break t;if(m===n&&++p===o&&(c=l),m===a&&++h===r&&(f=l),(b=y.nextSibling)!==null)break;y=m,m=y.parentNode}y=b}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for($p={focusedElem:e,selectionRange:n},Au=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var O=C.memoizedProps,L=C.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?O:sr(t.type,O),L);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(k){pt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return C=Q0,Q0=!1,C}function la(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&Xp(t,n,a)}o=o.next}while(o!==r)}}function vc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function bx(e){var t=e.alternate;t!==null&&(e.alternate=null,bx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sr],delete t[ba],delete t[Np],delete t[GP],delete t[YP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kx(e){return e.tag===5||e.tag===3||e.tag===4}function Z0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Du));else if(r!==4&&(e=e.child,e!==null))for(Zp(e,t,n),e=e.sibling;e!==null;)Zp(e,t,n),e=e.sibling}function qp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qp(e,t,n),e=e.sibling;e!==null;)qp(e,t,n),e=e.sibling}var Ft=null,ar=!1;function ai(e,t,n){for(n=n.child;n!==null;)Cx(e,t,n),n=n.sibling}function Cx(e,t,n){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(uc,n)}catch{}switch(n.tag){case 5:Gt||Yo(n,t);case 6:var r=Ft,o=ar;Ft=null,ai(e,t,n),Ft=r,ar=o,Ft!==null&&(ar?(e=Ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ft.removeChild(n.stateNode));break;case 18:Ft!==null&&(ar?(e=Ft,n=n.stateNode,e.nodeType===8?Ld(e.parentNode,n):e.nodeType===1&&Ld(e,n),ya(e)):Ld(Ft,n.stateNode));break;case 4:r=Ft,o=ar,Ft=n.stateNode.containerInfo,ar=!0,ai(e,t,n),Ft=r,ar=o;break;case 0:case 11:case 14:case 15:if(!Gt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var a=o,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&Xp(n,t,l),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!Gt&&(Yo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){pt(n,t,c)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(Gt=(r=Gt)||n.memoizedState!==null,ai(e,t,n),Gt=r):ai(e,t,n);break;default:ai(e,t,n)}}function q0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cO),t.forEach(function(r){var o=xO.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function rr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~a}if(r=o,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pO(r/1960))-r,10e?16:e,gi===null)var r=!1;else{if(e=gi,gi=null,Gu=0,Me&6)throw Error(ne(331));var o=Me;for(Me|=4,fe=e.current;fe!==null;){var a=fe,l=a.child;if(fe.flags&16){var c=a.deletions;if(c!==null){for(var f=0;fyt()-eg?Qi(e,0):Jh|=n),vn(e,t)}function $x(e,t){t===0&&(e.mode&1?(t=jl,jl<<=1,!(jl&130023424)&&(jl=4194304)):t=1);var n=tn();e=Gr(e,t),e!==null&&(Ia(e,t,n),vn(e,n))}function wO(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$x(e,n)}function xO(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(t),$x(e,n)}var Dx;Dx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gn.current)hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return hn=!1,aO(e,t,n);hn=!!(e.flags&131072)}else hn=!1,ot&&t.flags&1048576&&zw(t,zu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yu(e,t),e=t.pendingProps;var o=as(t,Yt.current);is(t,n),o=Gh(null,t,r,e,o,n);var a=Yh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,mn(r)?(a=!0,Nu(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Bh(t),o.updater=mc,t.stateNode=o,o._reactInternals=t,Bp(t,r,e,n),t=Vp(null,t,r,!0,a,n)):(t.tag=0,ot&&a&&Ih(t),en(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_O(r),e=sr(r,e),o){case 0:t=Hp(null,t,r,e,n);break e;case 1:t=G0(null,t,r,e,n);break e;case 11:t=V0(null,t,r,e,n);break e;case 14:t=K0(null,t,r,sr(r.type,e),n);break e}throw Error(ne(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),Hp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),G0(e,t,r,o,n);case 3:e:{if(vx(t),e===null)throw Error(ne(387));r=t.pendingProps,a=t.memoizedState,o=a.element,Hw(e,t),ju(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=fs(Error(ne(423)),t),t=Y0(e,t,r,n,o);break e}else if(r!==o){o=fs(Error(ne(424)),t),t=Y0(e,t,r,n,o);break e}else for(Rn=wi(t.stateNode.containerInfo.firstChild),Pn=t,ot=!0,lr=null,n=Bw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ls(),r===o){t=Yr(e,t,n);break e}en(e,t,r,n)}t=t.child}return t;case 5:return Vw(t),e===null&&Fp(t),r=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,l=o.children,Dp(r,o)?l=null:a!==null&&Dp(r,a)&&(t.flags|=32),mx(e,t),en(e,t,l,n),t.child;case 6:return e===null&&Fp(t),null;case 13:return yx(e,t,n);case 4:return Wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=us(t,null,r,n):en(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),V0(e,t,r,o,n);case 7:return en(e,t,t.pendingProps,n),t.child;case 8:return en(e,t,t.pendingProps.children,n),t.child;case 12:return en(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,qe(Fu,r._currentValue),r._currentValue=l,a!==null)if(fr(a.value,l)){if(a.children===o.children&&!gn.current){t=Yr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){l=a.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(a.tag===1){f=Hr(-1,n&-n),f.tag=2;var p=a.updateQueue;if(p!==null){p=p.shared;var h=p.pending;h===null?f.next=f:(f.next=h.next,h.next=f),p.pending=f}}a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Up(a.return,n,t),c.lanes|=n;break}f=f.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ne(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Up(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}en(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,is(t,n),o=Xn(o),r=r(o),t.flags|=1,en(e,t,r,n),t.child;case 14:return r=t.type,o=sr(r,t.pendingProps),o=sr(r.type,o),K0(e,t,r,o,n);case 15:return hx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),yu(e,t),t.tag=1,mn(r)?(e=!0,Nu(t)):e=!1,is(t,n),fx(t,r,o),Bp(t,r,o,n),Vp(null,t,r,!0,e,n);case 19:return wx(e,t,n);case 22:return gx(e,t,n)}throw Error(ne(156,t.tag))};function Ix(e,t){return lw(e,t)}function SO(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(e,t,n,r){return new SO(e,t,n,r)}function ig(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _O(e){if(typeof e=="function")return ig(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bh)return 11;if(e===kh)return 14}return 2}function bi(e,t){var n=e.alternate;return n===null?(n=Kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Su(e,t,n,r,o,a){var l=2;if(r=e,typeof e=="function")ig(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Fo:return Zi(n.children,o,a,t);case _h:l=8,o|=8;break;case dp:return e=Kn(12,n,t,o|2),e.elementType=dp,e.lanes=a,e;case pp:return e=Kn(13,n,t,o),e.elementType=pp,e.lanes=a,e;case hp:return e=Kn(19,n,t,o),e.elementType=hp,e.lanes=a,e;case V1:return wc(n,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W1:l=10;break e;case H1:l=9;break e;case bh:l=11;break e;case kh:l=14;break e;case ci:l=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Kn(l,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Zi(e,t,n,r){return e=Kn(7,e,r,t),e.lanes=n,e}function wc(e,t,n,r){return e=Kn(22,e,r,t),e.elementType=V1,e.lanes=n,e.stateNode={isHidden:!1},e}function Ud(e,t,n){return e=Kn(6,e,null,t),e.lanes=n,e}function jd(e,t,n){return t=Kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bO(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sd(0),this.expirationTimes=Sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function og(e,t,n,r,o,a,l,c,f){return e=new bO(e,t,n,c,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bh(a),e}function kO(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fx)}catch(e){console.error(e)}}Fx(),F1.exports=Ln;var Fa=F1.exports,sy=Fa;cp.createRoot=sy.createRoot,cp.hydrateRoot=sy.hydrateRoot;var Ux={exports:{}},He={};/** +`+a.stack}return{value:e,source:t,stack:o,digest:null}}function zd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oO=typeof WeakMap=="function"?WeakMap:Map;function px(e,t,n){n=Hr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ku||(Ku=!0,Jp=r),Wp(e,t)},n}function hx(e,t,n){n=Hr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Wp(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Wp(e,t),typeof r!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function B0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oO;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=wO.bind(null,e,t,n),t.then(e,e))}function W0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function H0(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Hr(-1,1),t.tag=2,xi(n,t,1))),n.lanes|=1),e)}var sO=Xr.ReactCurrentOwner,hn=!1;function en(e,t,n,r){t.child=e===null?Ww(t,null,n,r):us(t,e.child,n,r)}function V0(e,t,n,r,o){n=n.render;var a=t.ref;return is(t,o),r=Gh(e,t,n,r,a,o),n=Yh(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Yr(e,t,o)):(ot&&n&&Ih(t),t.flags|=1,en(e,t,r,o),t.child)}function K0(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!ig(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,gx(e,t,a,r,o)):(e=Su(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&o)){var l=a.memoizedProps;if(n=n.compare,n=n!==null?n:xa,n(l,r)&&e.ref===t.ref)return Yr(e,t,o)}return t.flags|=1,e=bi(a,r),e.ref=t.ref,e.return=t,t.child=e}function gx(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(xa(a,r)&&e.ref===t.ref)if(hn=!1,t.pendingProps=r=a,(e.lanes&o)!==0)e.flags&131072&&(hn=!0);else return t.lanes=e.lanes,Yr(e,t,o)}return Hp(e,t,n,r,o)}function mx(e,t,n){var r=t.pendingProps,o=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(Xo,Tn),Tn|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qe(Xo,Tn),Tn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,qe(Xo,Tn),Tn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,qe(Xo,Tn),Tn|=r;return en(e,t,o,n),t.child}function vx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hp(e,t,n,r,o){var a=mn(n)?qi:Yt.current;return a=as(t,a),is(t,o),n=Gh(e,t,n,r,a,o),r=Yh(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Yr(e,t,o)):(ot&&r&&Ih(t),t.flags|=1,en(e,t,n,o),t.child)}function G0(e,t,n,r,o){if(mn(n)){var a=!0;Nu(t)}else a=!1;if(is(t,o),t.stateNode===null)yu(e,t),dx(t,n,r),Bp(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,c=t.memoizedProps;l.props=c;var f=l.context,p=n.contextType;typeof p=="object"&&p!==null?p=Xn(p):(p=mn(n)?qi:Yt.current,p=as(t,p));var h=n.getDerivedStateFromProps,y=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function";y||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==r||f!==p)&&j0(t,l,r,p),fi=!1;var m=t.memoizedState;l.state=m,ju(t,r,l,o),f=t.memoizedState,c!==r||m!==f||gn.current||fi?(typeof h=="function"&&(jp(t,n,h,r),f=t.memoizedState),(c=fi||U0(t,n,c,r,m,f,p))?(y||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=f),l.props=r,l.state=f,l.context=p,r=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Vw(e,t),c=t.memoizedProps,p=t.type===t.elementType?c:sr(t.type,c),l.props=p,y=t.pendingProps,m=l.context,f=n.contextType,typeof f=="object"&&f!==null?f=Xn(f):(f=mn(n)?qi:Yt.current,f=as(t,f));var b=n.getDerivedStateFromProps;(h=typeof b=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==y||m!==f)&&j0(t,l,r,f),fi=!1,m=t.memoizedState,l.state=m,ju(t,r,l,o);var C=t.memoizedState;c!==y||m!==C||gn.current||fi?(typeof b=="function"&&(jp(t,n,b,r),C=t.memoizedState),(p=fi||U0(t,n,p,r,m,C,f)||!1)?(h||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,C,f),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,C,f)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=C),l.props=r,l.state=C,l.context=f,r=p):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Vp(e,t,n,r,a,o)}function Vp(e,t,n,r,o,a){vx(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&A0(t,n,!1),Yr(e,t,a);r=t.stateNode,sO.current=t;var c=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=us(t,e.child,null,a),t.child=us(t,null,c,a)):en(e,t,c,a),t.memoizedState=r.state,o&&A0(t,n,!0),t.child}function yx(e){var t=e.stateNode;t.pendingContext?L0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&L0(e,t.context,!1),Wh(e,t.containerInfo)}function Y0(e,t,n,r,o){return ls(),Mh(o),t.flags|=256,en(e,t,n,r),t.child}var Kp={dehydrated:null,treeContext:null,retryLane:0};function Gp(e){return{baseLanes:e,cachePool:null,transitions:null}}function wx(e,t,n){var r=t.pendingProps,o=at.current,a=!1,l=(t.flags&128)!==0,c;if((c=l)||(c=e!==null&&e.memoizedState===null?!1:(o&2)!==0),c?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),qe(at,o&1),e===null)return Fp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=wc(l,r,0,null),e=Zi(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Gp(n),t.memoizedState=Kp,e):Zh(t,l));if(o=e.memoizedState,o!==null&&(c=o.dehydrated,c!==null))return aO(e,t,l,r,c,o,n);if(a){a=r.fallback,l=t.mode,o=e.child,c=o.sibling;var f={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=f,t.deletions=null):(r=bi(o,f),r.subtreeFlags=o.subtreeFlags&14680064),c!==null?a=bi(c,a):(a=Zi(a,l,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=e.child.memoizedState,l=l===null?Gp(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Kp,r}return a=e.child,e=a.sibling,r=bi(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zh(e,t){return t=wc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xl(e,t,n,r){return r!==null&&Mh(r),us(t,e.child,null,n),e=Zh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aO(e,t,n,r,o,a,l){if(n)return t.flags&256?(t.flags&=-257,r=zd(Error(ne(422))),Xl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=wc({mode:"visible",children:r.children},o,0,null),a=Zi(a,o,l,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&us(t,e.child,null,l),t.child.memoizedState=Gp(l),t.memoizedState=Kp,a);if(!(t.mode&1))return Xl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var c=r.dgst;return r=c,a=Error(ne(419)),r=zd(a,r,void 0),Xl(e,t,l,r)}if(c=(l&e.childLanes)!==0,hn||c){if(r=Dt,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==a.retryLane&&(a.retryLane=o,Gr(e,o),cr(r,e,o,-1))}return rg(),r=zd(Error(ne(421))),Xl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=xO.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Rn=wi(o.nextSibling),Pn=t,ot=!0,lr=null,e!==null&&(Wn[Hn++]=jr,Wn[Hn++]=Br,Wn[Hn++]=Ji,jr=e.id,Br=e.overflow,Ji=t),t=Zh(t,r.children),t.flags|=4096,t)}function X0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Up(e.return,t,n)}function Fd(e,t,n,r,o){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function xx(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(en(e,t,r.children,n),r=at.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&X0(e,n,t);else if(e.tag===19)X0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(qe(at,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Bu(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Fd(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Bu(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Fd(t,!0,n,null,a);break;case"together":Fd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),to|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,n=bi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lO(e,t,n){switch(t.tag){case 3:yx(t),ls();break;case 5:Kw(t);break;case 1:mn(t.type)&&Nu(t);break;case 4:Wh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;qe(Fu,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(qe(at,at.current&1),t.flags|=128,null):n&t.child.childLanes?wx(e,t,n):(qe(at,at.current&1),e=Yr(e,t,n),e!==null?e.sibling:null);qe(at,at.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return xx(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),qe(at,at.current),r)break;return null;case 22:case 23:return t.lanes=0,mx(e,t,n)}return Yr(e,t,n)}var Sx,Yp,_x,bx;Sx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yp=function(){};_x=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Yi(Cr.current);var a=null;switch(n){case"input":o=mp(e,o),r=mp(e,r),a=[];break;case"select":o=ct({},o,{value:void 0}),r=ct({},r,{value:void 0}),a=[];break;case"textarea":o=wp(e,o),r=wp(e,r),a=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Du)}Sp(n,r);var l;n=null;for(p in o)if(!r.hasOwnProperty(p)&&o.hasOwnProperty(p)&&o[p]!=null)if(p==="style"){var c=o[p];for(l in c)c.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else p!=="dangerouslySetInnerHTML"&&p!=="children"&&p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(pa.hasOwnProperty(p)?a||(a=[]):(a=a||[]).push(p,null));for(p in r){var f=r[p];if(c=o!=null?o[p]:void 0,r.hasOwnProperty(p)&&f!==c&&(f!=null||c!=null))if(p==="style")if(c){for(l in c)!c.hasOwnProperty(l)||f&&f.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in f)f.hasOwnProperty(l)&&c[l]!==f[l]&&(n||(n={}),n[l]=f[l])}else n||(a||(a=[]),a.push(p,n)),n=f;else p==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,c=c?c.__html:void 0,f!=null&&c!==f&&(a=a||[]).push(p,f)):p==="children"?typeof f!="string"&&typeof f!="number"||(a=a||[]).push(p,""+f):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&(pa.hasOwnProperty(p)?(f!=null&&p==="onScroll"&&tt("scroll",e),a||c===f||(a=[])):(a=a||[]).push(p,f))}n&&(a=a||[]).push("style",n);var p=a;(t.updateQueue=p)&&(t.flags|=4)}};bx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vs(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function uO(e,t,n){var r=t.pendingProps;switch(Nh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(t),null;case 1:return mn(t.type)&&Iu(),Vt(t),null;case 3:return r=t.stateNode,cs(),nt(gn),nt(Yt),Vh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,lr!==null&&(nh(lr),lr=null))),Yp(e,t),Vt(t),null;case 5:Hh(t);var o=Yi(Ca.current);if(n=t.type,e!==null&&t.stateNode!=null)_x(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ne(166));return Vt(t),null}if(e=Yi(Cr.current),Gl(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Sr]=t,r[ba]=a,e=(t.mode&1)!==0,n){case"dialog":tt("cancel",r),tt("close",r);break;case"iframe":case"object":case"embed":tt("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Sr]=t,e[ba]=r,Sx(e,t,!1,!1),t.stateNode=e;e:{switch(l=_p(n,r),n){case"dialog":tt("cancel",e),tt("close",e),o=r;break;case"iframe":case"object":case"embed":tt("load",e),o=r;break;case"video":case"audio":for(o=0;ods&&(t.flags|=128,r=!0,Vs(a,!1),t.lanes=4194304)}else{if(!r)if(e=Bu(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!ot)return Vt(t),null}else 2*yt()-a.renderingStartTime>ds&&n!==1073741824&&(t.flags|=128,r=!0,Vs(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yt(),t.sibling=null,n=at.current,qe(at,r?n&1|2:n&1),t):(Vt(t),null);case 22:case 23:return ng(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Tn&1073741824&&(Vt(t),t.subtreeFlags&6&&(t.flags|=8192)):Vt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function cO(e,t){switch(Nh(t),t.tag){case 1:return mn(t.type)&&Iu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cs(),nt(gn),nt(Yt),Vh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hh(t),null;case 13:if(nt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(at),null;case 4:return cs(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return ng(),null;case 24:return null;default:return null}}var Ql=!1,Gt=!1,fO=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pt(e,t,r)}else n.current=null}function Xp(e,t,n){try{n()}catch(r){pt(e,t,r)}}var Q0=!1;function dO(e,t){if(Ap=Lu,e=Rw(),Dh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var l=0,c=-1,f=-1,p=0,h=0,y=e,m=null;t:for(;;){for(var b;y!==n||o!==0&&y.nodeType!==3||(c=l+o),y!==a||r!==0&&y.nodeType!==3||(f=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(b=y.firstChild)!==null;)m=y,y=b;for(;;){if(y===e)break t;if(m===n&&++p===o&&(c=l),m===a&&++h===r&&(f=l),(b=y.nextSibling)!==null)break;y=m,m=y.parentNode}y=b}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for($p={focusedElem:e,selectionRange:n},Lu=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var O=C.memoizedProps,A=C.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?O:sr(t.type,O),A);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(k){pt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return C=Q0,Q0=!1,C}function la(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&Xp(t,n,a)}o=o.next}while(o!==r)}}function vc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function kx(e){var t=e.alternate;t!==null&&(e.alternate=null,kx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sr],delete t[ba],delete t[Np],delete t[YP],delete t[XP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cx(e){return e.tag===5||e.tag===3||e.tag===4}function Z0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Du));else if(r!==4&&(e=e.child,e!==null))for(Zp(e,t,n),e=e.sibling;e!==null;)Zp(e,t,n),e=e.sibling}function qp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qp(e,t,n),e=e.sibling;e!==null;)qp(e,t,n),e=e.sibling}var Ft=null,ar=!1;function ai(e,t,n){for(n=n.child;n!==null;)Ex(e,t,n),n=n.sibling}function Ex(e,t,n){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(uc,n)}catch{}switch(n.tag){case 5:Gt||Yo(n,t);case 6:var r=Ft,o=ar;Ft=null,ai(e,t,n),Ft=r,ar=o,Ft!==null&&(ar?(e=Ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ft.removeChild(n.stateNode));break;case 18:Ft!==null&&(ar?(e=Ft,n=n.stateNode,e.nodeType===8?Ad(e.parentNode,n):e.nodeType===1&&Ad(e,n),ya(e)):Ad(Ft,n.stateNode));break;case 4:r=Ft,o=ar,Ft=n.stateNode.containerInfo,ar=!0,ai(e,t,n),Ft=r,ar=o;break;case 0:case 11:case 14:case 15:if(!Gt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var a=o,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&Xp(n,t,l),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!Gt&&(Yo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){pt(n,t,c)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(Gt=(r=Gt)||n.memoizedState!==null,ai(e,t,n),Gt=r):ai(e,t,n);break;default:ai(e,t,n)}}function q0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fO),t.forEach(function(r){var o=SO.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function rr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~a}if(r=o,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hO(r/1960))-r,10e?16:e,gi===null)var r=!1;else{if(e=gi,gi=null,Gu=0,Me&6)throw Error(ne(331));var o=Me;for(Me|=4,fe=e.current;fe!==null;){var a=fe,l=a.child;if(fe.flags&16){var c=a.deletions;if(c!==null){for(var f=0;fyt()-eg?Qi(e,0):Jh|=n),vn(e,t)}function Dx(e,t){t===0&&(e.mode&1?(t=jl,jl<<=1,!(jl&130023424)&&(jl=4194304)):t=1);var n=tn();e=Gr(e,t),e!==null&&(Ia(e,t,n),vn(e,n))}function xO(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dx(e,n)}function SO(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(t),Dx(e,n)}var Ix;Ix=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gn.current)hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return hn=!1,lO(e,t,n);hn=!!(e.flags&131072)}else hn=!1,ot&&t.flags&1048576&&Fw(t,zu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yu(e,t),e=t.pendingProps;var o=as(t,Yt.current);is(t,n),o=Gh(null,t,r,e,o,n);var a=Yh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,mn(r)?(a=!0,Nu(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Bh(t),o.updater=mc,t.stateNode=o,o._reactInternals=t,Bp(t,r,e,n),t=Vp(null,t,r,!0,a,n)):(t.tag=0,ot&&a&&Ih(t),en(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=bO(r),e=sr(r,e),o){case 0:t=Hp(null,t,r,e,n);break e;case 1:t=G0(null,t,r,e,n);break e;case 11:t=V0(null,t,r,e,n);break e;case 14:t=K0(null,t,r,sr(r.type,e),n);break e}throw Error(ne(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),Hp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),G0(e,t,r,o,n);case 3:e:{if(yx(t),e===null)throw Error(ne(387));r=t.pendingProps,a=t.memoizedState,o=a.element,Vw(e,t),ju(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=fs(Error(ne(423)),t),t=Y0(e,t,r,n,o);break e}else if(r!==o){o=fs(Error(ne(424)),t),t=Y0(e,t,r,n,o);break e}else for(Rn=wi(t.stateNode.containerInfo.firstChild),Pn=t,ot=!0,lr=null,n=Ww(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ls(),r===o){t=Yr(e,t,n);break e}en(e,t,r,n)}t=t.child}return t;case 5:return Kw(t),e===null&&Fp(t),r=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,l=o.children,Dp(r,o)?l=null:a!==null&&Dp(r,a)&&(t.flags|=32),vx(e,t),en(e,t,l,n),t.child;case 6:return e===null&&Fp(t),null;case 13:return wx(e,t,n);case 4:return Wh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=us(t,null,r,n):en(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),V0(e,t,r,o,n);case 7:return en(e,t,t.pendingProps,n),t.child;case 8:return en(e,t,t.pendingProps.children,n),t.child;case 12:return en(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,qe(Fu,r._currentValue),r._currentValue=l,a!==null)if(fr(a.value,l)){if(a.children===o.children&&!gn.current){t=Yr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){l=a.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(a.tag===1){f=Hr(-1,n&-n),f.tag=2;var p=a.updateQueue;if(p!==null){p=p.shared;var h=p.pending;h===null?f.next=f:(f.next=h.next,h.next=f),p.pending=f}}a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Up(a.return,n,t),c.lanes|=n;break}f=f.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ne(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Up(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}en(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,is(t,n),o=Xn(o),r=r(o),t.flags|=1,en(e,t,r,n),t.child;case 14:return r=t.type,o=sr(r,t.pendingProps),o=sr(r.type,o),K0(e,t,r,o,n);case 15:return gx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),yu(e,t),t.tag=1,mn(r)?(e=!0,Nu(t)):e=!1,is(t,n),dx(t,r,o),Bp(t,r,o,n),Vp(null,t,r,!0,e,n);case 19:return xx(e,t,n);case 22:return mx(e,t,n)}throw Error(ne(156,t.tag))};function Nx(e,t){return uw(e,t)}function _O(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(e,t,n,r){return new _O(e,t,n,r)}function ig(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bO(e){if(typeof e=="function")return ig(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bh)return 11;if(e===kh)return 14}return 2}function bi(e,t){var n=e.alternate;return n===null?(n=Kn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Su(e,t,n,r,o,a){var l=2;if(r=e,typeof e=="function")ig(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Fo:return Zi(n.children,o,a,t);case _h:l=8,o|=8;break;case dp:return e=Kn(12,n,t,o|2),e.elementType=dp,e.lanes=a,e;case pp:return e=Kn(13,n,t,o),e.elementType=pp,e.lanes=a,e;case hp:return e=Kn(19,n,t,o),e.elementType=hp,e.lanes=a,e;case K1:return wc(n,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H1:l=10;break e;case V1:l=9;break e;case bh:l=11;break e;case kh:l=14;break e;case ci:l=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Kn(l,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Zi(e,t,n,r){return e=Kn(7,e,r,t),e.lanes=n,e}function wc(e,t,n,r){return e=Kn(22,e,r,t),e.elementType=K1,e.lanes=n,e.stateNode={isHidden:!1},e}function Ud(e,t,n){return e=Kn(6,e,null,t),e.lanes=n,e}function jd(e,t,n){return t=Kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kO(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sd(0),this.expirationTimes=Sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function og(e,t,n,r,o,a,l,c,f){return e=new kO(e,t,n,c,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bh(a),e}function CO(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ux)}catch(e){console.error(e)}}Ux(),U1.exports=An;var Fa=U1.exports,sy=Fa;cp.createRoot=sy.createRoot,cp.hydrateRoot=sy.hydrateRoot;var jx={exports:{}},He={};/** * @license React * react-is.production.min.js * @@ -45,28 +45,28 @@ Error generating stack: `+a.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ug=Symbol.for("react.element"),cg=Symbol.for("react.portal"),kc=Symbol.for("react.fragment"),Cc=Symbol.for("react.strict_mode"),Ec=Symbol.for("react.profiler"),Tc=Symbol.for("react.provider"),Rc=Symbol.for("react.context"),PO=Symbol.for("react.server_context"),Pc=Symbol.for("react.forward_ref"),Oc=Symbol.for("react.suspense"),Ac=Symbol.for("react.suspense_list"),Lc=Symbol.for("react.memo"),$c=Symbol.for("react.lazy"),OO=Symbol.for("react.offscreen"),jx;jx=Symbol.for("react.module.reference");function Zn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ug:switch(e=e.type,e){case kc:case Ec:case Cc:case Oc:case Ac:return e;default:switch(e=e&&e.$$typeof,e){case PO:case Rc:case Pc:case $c:case Lc:case Tc:return e;default:return t}}case cg:return t}}}He.ContextConsumer=Rc;He.ContextProvider=Tc;He.Element=ug;He.ForwardRef=Pc;He.Fragment=kc;He.Lazy=$c;He.Memo=Lc;He.Portal=cg;He.Profiler=Ec;He.StrictMode=Cc;He.Suspense=Oc;He.SuspenseList=Ac;He.isAsyncMode=function(){return!1};He.isConcurrentMode=function(){return!1};He.isContextConsumer=function(e){return Zn(e)===Rc};He.isContextProvider=function(e){return Zn(e)===Tc};He.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ug};He.isForwardRef=function(e){return Zn(e)===Pc};He.isFragment=function(e){return Zn(e)===kc};He.isLazy=function(e){return Zn(e)===$c};He.isMemo=function(e){return Zn(e)===Lc};He.isPortal=function(e){return Zn(e)===cg};He.isProfiler=function(e){return Zn(e)===Ec};He.isStrictMode=function(e){return Zn(e)===Cc};He.isSuspense=function(e){return Zn(e)===Oc};He.isSuspenseList=function(e){return Zn(e)===Ac};He.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kc||e===Ec||e===Cc||e===Oc||e===Ac||e===OO||typeof e=="object"&&e!==null&&(e.$$typeof===$c||e.$$typeof===Lc||e.$$typeof===Tc||e.$$typeof===Rc||e.$$typeof===Pc||e.$$typeof===jx||e.getModuleId!==void 0)};He.typeOf=Zn;Ux.exports=He;var Bx=Ux.exports;function AO(e){function t(Y,V,ee,ue,F){for(var me=0,te=0,De=0,Pe=0,be,Se,Qe=0,Ke=0,Te,wt=Te=be=0,Ce=0,Je=0,wn=0,Ge=0,bt=ee.length,on=bt-1,ft,_e="",ze="",Oi="",qn="",kt;Cebe)&&(Ge=(_e=_e.replace(" ",":")).length),0ue&&(ue=(V=V.trim()).charCodeAt(0)),ue){case 38:return V.replace(_,"$1"+Y.trim());case 58:return Y.trim()+V.replace(_,"$1"+Y.trim());default:if(0<1*ee&&0te.charCodeAt(8))break;case 115:F=F.replace(te,"-webkit-"+te)+";"+F;break;case 207:case 102:F=F.replace(te,"-webkit-"+(102ee.charCodeAt(0)&&(ee=ee.trim()),G=ee,ee=[G],0be)&&(Ge=(_e=_e.replace(" ",":")).length),0ue&&(ue=(V=V.trim()).charCodeAt(0)),ue){case 38:return V.replace(_,"$1"+Y.trim());case 58:return Y.trim()+V.replace(_,"$1"+Y.trim());default:if(0<1*ee&&0te.charCodeAt(8))break;case 115:F=F.replace(te,"-webkit-"+te)+";"+F;break;case 207:case 102:F=F.replace(te,"-webkit-"+(102ee.charCodeAt(0)&&(ee=ee.trim()),G=ee,ee=[G],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var qO=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,a=o.length,l=a;n>=l;)(l<<=1)<0&&Ua(16,""+n);this.groupSizes=new Uint32Array(l),this.groupSizes.set(o),this.length=l;for(var c=a;c=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],a=this.indexOfGroup(n),l=a+o,c=a;c=fa&&(fa=t+1),_u.set(e,t),Zu.set(t,e)},tA="style["+ps+'][data-styled-version="5.3.11"]',nA=new RegExp("^"+ps+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),rA=function(e,t,n){for(var r,o=n.split(","),a=0,l=o.length;a=0;p--){var h=f[p];if(h&&h.nodeType===1&&h.hasAttribute(ps))return h}}(n),a=o!==void 0?o.nextSibling:null;r.setAttribute(ps,"active"),r.setAttribute("data-styled-version","5.3.11");var l=oA();return l&&r.setAttribute("nonce",l),n.insertBefore(r,a),r},sA=function(){function e(n){var r=this.element=Gx(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var a=document.styleSheets,l=0,c=a.length;l=0){var o=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(o,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(y+=m+",")}),a+=""+p+h+'{content:"'+y+`"}/*!sc*/ -`}}}return a}(this)},e}(),cA=/(a)(d)/gi,hy=function(e){return String.fromCharCode(e+(e>25?39:97))};function ih(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=hy(t%52)+n;return(hy(t%52)+n).replace(cA,"$1-$2")}var Qo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Yx=function(e){return Qo(5381,e)};function Xx(e){for(var t=0;t>>0);if(!n.hasNameForId(o,c)){var f=r(l,"."+c,void 0,o);n.insertRules(o,c,f)}a.push(c),this.staticRulesId=c}else{for(var p=this.rules.length,h=Qo(this.baseHash,r.hash),y="",m=0;m>>0);if(!n.hasNameForId(o,L)){var _=r(y,"."+L,void 0,o);n.insertRules(o,L,_)}a.push(L)}}return a.join(" ")},e}(),pA=/^\s*\/\/.*$/gm,hA=[":","[",".","#"];function gA(e){var t,n,r,o,a=e===void 0?ki:e,l=a.options,c=l===void 0?ki:l,f=a.plugins,p=f===void 0?Qu:f,h=new AO(c),y=[],m=function(O){function L(_){if(_)try{O(_+"}")}catch{}}return function(_,v,x,k,E,R,D,P,j,I){switch(_){case 1:if(j===0&&v.charCodeAt(0)===64)return O(v+";"),"";break;case 2:if(P===0)return v+"/*|*/";break;case 3:switch(P){case 102:case 112:return O(x[0]+v),"";default:return v+(I===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(L)}}}(function(O){y.push(O)}),b=function(O,L,_){return L===0&&hA.indexOf(_[n.length])!==-1||_.match(o)?O:"."+t};function C(O,L,_,v){v===void 0&&(v="&");var x=O.replace(pA,""),k=L&&_?_+" "+L+" { "+x+" }":x;return t=v,n=L,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),h(_||!L?"":L,k)}return h.use([].concat(p,[function(O,L,_){O===2&&_.length&&_[0].lastIndexOf(n)>0&&(_[0]=_[0].replace(r,b))},m,function(O){if(O===-2){var L=y;return y=[],L}}])),C.hash=p.length?p.reduce(function(O,L){return L.name||Ua(15),Qo(O,L.name)},5381).toString():"",C}var Qx=Wr.createContext();Qx.Consumer;var Zx=Wr.createContext(),mA=(Zx.Consumer,new qu),oh=gA();function qx(){return B.useContext(Qx)||mA}function Jx(){return B.useContext(Zx)||oh}var eS=function(){function e(t,n){var r=this;this.inject=function(o,a){a===void 0&&(a=oh);var l=r.name+a.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,a(r.rules,l,"@keyframes"))},this.toString=function(){return Ua(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=oh),this.name+t.hash},e}(),vA=/([A-Z])/,yA=/([A-Z])/g,wA=/^ms-/,xA=function(e){return"-"+e.toLowerCase()};function gy(e){return vA.test(e)?e.replace(yA,xA).replace(wA,"-ms-"):e}var my=function(e){return e==null||e===!1||e===""};function ro(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],l=0,c=e.length;l1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,_A=/(^-|-$)/g;function Bd(e){return e.replace(SA,"-").replace(_A,"")}var wg=function(e){return ih(Yx(e)>>>0)};function eu(e){return typeof e=="string"&&!0}var sh=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},bA=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function kA(e,t,n){var r=e[n];sh(t)&&sh(r)?nS(r,t):e[n]=t}function nS(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(I[P]=R[P]);return I}(t,["componentId"]),E=x&&x+"-"+(eu(v)?v:Bd(dy(v)));return rS(v,_r({},k,{attrs:m,componentId:E}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?nS({},e.defaultProps,v):v}}),Object.defineProperty(C,"toString",{value:function(){return"."+C.styledComponentId}}),o&&XO(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var ah=function(e){return function t(n,r,o){if(o===void 0&&(o=ki),!Bx.isValidElementType(r))return Ua(1,String(r));var a=function(){return n(r,o,yg.apply(void 0,arguments))};return a.withConfig=function(l){return t(n,r,_r({},o,{},l))},a.attrs=function(l){return t(n,r,_r({},o,{attrs:Array.prototype.concat(o.attrs,l).filter(Boolean)}))},a}(rS,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){ah[e]=ah(e)});var CA=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=Xx(n),qu.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,o,a){var l=a(ro(this.rules,r,o,a).join(""),""),c=this.componentId+n;o.insertRules(c,c,l)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,o,a){n>2&&qu.registerId(this.componentId+n),this.removeStyles(n,o),this.createStyles(n,r,o,a)},e}();function EA(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r<]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function yy(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(PA[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(OA),a=null;(a=o.exec(e))!==null;)if(a[0].trim())if(a[1]){var l=a[1].trim(),c=[l,""];l.indexOf("=")>-1&&(c=l.split("=")),t.attrs[c[0]]=c[1],o.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var AA=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,LA=/^\s*$/,$A=Object.create(null);function iS(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(iS,"")+"";case"comment":return e+""}}var DA={parse:function(e,t){t||(t={}),t.components||(t.components=$A);var n,r=[],o=[],a=-1,l=!1;if(e.indexOf("<")!==0){var c=e.indexOf("<");r.push({type:"text",content:c===-1?e:e.substring(0,c)})}return e.replace(AA,function(f,p){if(l){if(f!=="")return;l=!1}var h,y=f.charAt(1)!=="/",m=f.startsWith("");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(LL),a=null;(a=o.exec(e))!==null;)if(a[0].trim())if(a[1]){var l=a[1].trim(),c=[l,""];l.indexOf("=")>-1&&(c=l.split("=")),t.attrs[c[0]]=c[1],o.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var AL=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,$L=/^\s*$/,DL=Object.create(null);function oS(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(oS,"")+"";case"comment":return e+""}}var IL={parse:function(e,t){t||(t={}),t.components||(t.components=DL);var n,r=[],o=[],a=-1,l=!1;if(e.indexOf("<")!==0){var c=e.indexOf("<");r.push({type:"text",content:c===-1?e:e.substring(0,c)})}return e.replace(AL,function(f,p){if(l){if(f!=="")return;l=!1}var h,y=f.charAt(1)!=="/",m=f.startsWith(" ${_y(ie.startTime+ie.duration)} ${ie.text} `).join(` `)} -`,J=new Blob([X],{type:"text/vtt"});return URL.createObjectURL(J)};return[P("text"),P("translated_text")]},[t]);B.useImperativeHandle(f,()=>({get currentTime(){return p.current?p.current.currentTime:0},setCurrentTime(P){p.current&&(p.current.currentTime=P,p.current.play(),v.current=null,Object.values(m.current).forEach(j=>{j.currentTime=P}),E(P))},play(){if(p.current){const P=p.current.play();P!==void 0&&P.then(()=>{Object.values(m.current).forEach(j=>{const I=j.play();I!==void 0&&I.catch(X=>{console.log("Audio play prevented:",X)})}),E(p.current.currentTime)}).catch(j=>{console.log("Video play prevented:",j)})}},pause(){p.current&&(p.current.pause(),Object.values(m.current).forEach(P=>{P.pause()}),_.current.forEach(P=>{try{P.stop(),P.disconnect()}catch(j){console.error("Error stopping audio source:",j)}}),_.current=[])}})),B.useEffect(()=>{h.current&&(h.current.src=x),y.current&&(y.current.src=k)},[x,k]),B.useEffect(()=>{h.current&&y.current&&(h.current.track.mode=a==="original"?"showing":"hidden",y.current.track.mode=a==="dubbed"?"showing":"hidden")},[a]),B.useEffect(()=>{p.current&&(p.current.src=e)},[e]),B.useEffect(()=>{const P=p.current;P&&(P.onerror=()=>{console.error("Video error:",P.error)})},[]);const E=P=>{if(L.current||(L.current=new AudioContext),console.log("[Audio] Stopping all buffer sources"),_.current.forEach(j=>{try{j.stop(),j.disconnect()}catch(I){console.error("Error stopping audio source:",I)}}),_.current=[],l&&o.includes("dubbed"))if(c){console.log("[Audio] Playing dubbed audio buffer in advanced mode");const j=L.current.createBufferSource();j.buffer=c,j.connect(L.current.destination),j.start(0,P),_.current.push(j)}else console.log("[Audio] No dubbed audio buffer available, using URL source")};B.useEffect(()=>(console.log("[Audio] Setting up audio elements",{advancedMode:l,hasDubbedBuffer:!!c,tracks:Object.keys(r)}),Object.values(m.current).forEach(P=>{P.pause()}),m.current={},Object.entries(r).forEach(([P,j])=>{if(l&&P==="dubbed"&&c){console.log("[Audio] Skipping dubbed audio URL in advanced mode (using buffer)");return}if(j.url){console.log(`[Audio] Creating audio element for ${P}`);const I=new Audio(j.url);I.preload="auto",I.muted=!o.includes(P),p.current&&(I.currentTime=p.current.currentTime),p.current&&!p.current.paused&&I.play().catch(X=>{console.log(`[Audio] Play prevented for ${P}:`,X)}),m.current[P]=I}}),()=>{console.log("[Audio] Cleaning up audio elements"),Object.values(m.current).forEach(P=>{P.pause()}),m.current={}}),[r,c,l]),B.useEffect(()=>{console.log("[Audio] Selected tracks changed:",o),Object.entries(m.current).forEach(([P,j])=>{const I=!o.includes(P);console.log(`[Audio] ${P} muted:`,I),j.muted=I}),p.current&&!p.current.paused&&E(p.current.currentTime)},[r,c,o]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{console.log("[Video] Play event"),Object.entries(m.current).forEach(([J,ie])=>{console.log(`[Audio] Playing ${J}`),ie.play().catch(re=>{console.log(`[Audio] Play prevented for ${J}:`,re)})}),E(P.currentTime)},I=()=>{console.log("[Video] Pause event"),Object.entries(m.current).forEach(([J,ie])=>{console.log(`[Audio] Pausing ${J}`),ie.pause()}),_.current.forEach(J=>{try{J.stop(),J.disconnect()}catch(ie){console.error("Error stopping audio source:",ie)}}),_.current=[]},X=()=>{console.log("[Video] Seeked event");const J=P.currentTime;Object.entries(m.current).forEach(([ie,re])=>{console.log(`[Audio] Seeking ${ie} to ${J}`),re.currentTime=J}),P.paused||E(J)};return P.addEventListener("play",j),P.addEventListener("pause",I),P.addEventListener("seeked",X),()=>{P.removeEventListener("play",j),P.removeEventListener("pause",I),P.removeEventListener("seeked",X)}},[r,c,o]),B.useEffect(()=>{m.current.dubbed&&o.includes("dubbed")&&c&&(m.current.dubbed.muted=!0)},[c,o]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{D()};return P.addEventListener("timeupdate",j),()=>{P.removeEventListener("timeupdate",j),b.current&&(b.current.close(),b.current=null)}},[t]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{C.current&&(C.current.stop(),C.current.disconnect()),D()};return P.addEventListener("seeked",j),()=>{P.removeEventListener("seeked",j)}},[t]);const R=P=>{if(P.buffer)try{if(b.current||(b.current=new AudioContext),C.current)try{C.current.stop(),C.current.disconnect()}catch(ie){console.error("Error stopping previous track:",ie)}const j=b.current.createBufferSource(),I=b.current.createGain();j.buffer=P.buffer,I.gain.value=Math.pow(10,P.volume_gain_db/20),j.connect(I),I.connect(b.current.destination);const X=Math.max(0,p.current.currentTime-P.start),J=P.end-P.start;j.start(0,X,J),C.current=j,O.current=I,setTimeout(()=>{try{j.stop(),j.disconnect()}catch(ie){console.error("Error stopping track:",ie)}finally{v.current=null,m.current.dubbed&&o.includes("dubbed")&&(m.current.dubbed.muted=!1)}},(J-X)*1e3)}catch(j){console.error("Error playing track buffer:",j),m.current.dubbed&&o.includes("dubbed")&&(m.current.dubbed.muted=!1)}},D=()=>{if(!p.current||l)return;const P=p.current.currentTime;console.log("currentTime",P);try{const j=t.find(I=>P>=I.start&&P<=I.end);if(j!=null&&j.deleted||j!=null&&j.buffer)m.current.dubbed&&(m.current.dubbed.muted=!0),j!=null&&j.buffer&&j!==v.current&&(v.current=j,R(j));else if(m.current.dubbed&&(m.current.dubbed.muted=!1),C.current)try{C.current.stop(),C.current.disconnect()}catch(I){console.error("Error stopping track:",I)}}catch(j){console.error("Error checking and playing tracks:",j),m.current.dubbed&&(m.current.dubbed.muted=!1)}};return A.jsx(ZA,{children:A.jsxs(qA,{ref:p,controls:!0,preload:"auto",isEditMode:t.length>0,children:[A.jsx("source",{src:e,type:n}),x&&A.jsx("track",{ref:h,kind:"captions",srcLang:"original",label:"Original"}),k&&A.jsx("track",{ref:y,kind:"captions",srcLang:"dubbed",label:"Dubbed"}),"Your browser does not support the video tag."]})})}),eL=le.div` +`,J=new Blob([X],{type:"text/vtt"});return URL.createObjectURL(J)};return[P("text"),P("translated_text")]},[t]);B.useImperativeHandle(f,()=>({get currentTime(){return p.current?p.current.currentTime:0},setCurrentTime(P){p.current&&(p.current.currentTime=P,p.current.play(),v.current=null,Object.values(m.current).forEach(j=>{j.currentTime=P}),E(P))},play(){if(p.current){const P=p.current.play();P!==void 0&&P.then(()=>{Object.values(m.current).forEach(j=>{const I=j.play();I!==void 0&&I.catch(X=>{console.log("Audio play prevented:",X)})}),E(p.current.currentTime)}).catch(j=>{console.log("Video play prevented:",j)})}},pause(){p.current&&(p.current.pause(),Object.values(m.current).forEach(P=>{P.pause()}),_.current.forEach(P=>{try{P.stop(),P.disconnect()}catch(j){console.error("Error stopping audio source:",j)}}),_.current=[])}})),B.useEffect(()=>{h.current&&(h.current.src=x),y.current&&(y.current.src=k)},[x,k]),B.useEffect(()=>{h.current&&y.current&&(h.current.track.mode=a==="original"?"showing":"hidden",y.current.track.mode=a==="dubbed"?"showing":"hidden")},[a]),B.useEffect(()=>{p.current&&(p.current.src=e)},[e]),B.useEffect(()=>{const P=p.current;P&&(P.onerror=()=>{console.error("Video error:",P.error)})},[]);const E=P=>{if(A.current||(A.current=new AudioContext),console.log("[Audio] Stopping all buffer sources"),_.current.forEach(j=>{try{j.stop(),j.disconnect()}catch(I){console.error("Error stopping audio source:",I)}}),_.current=[],l&&o.includes("dubbed"))if(c){console.log("[Audio] Playing dubbed audio buffer in advanced mode");const j=A.current.createBufferSource();j.buffer=c,j.connect(A.current.destination),j.start(0,P),_.current.push(j)}else console.log("[Audio] No dubbed audio buffer available, using URL source")};B.useEffect(()=>(console.log("[Audio] Setting up audio elements",{advancedMode:l,hasDubbedBuffer:!!c,tracks:Object.keys(r)}),Object.values(m.current).forEach(P=>{P.pause()}),m.current={},Object.entries(r).forEach(([P,j])=>{if(l&&P==="dubbed"&&c){console.log("[Audio] Skipping dubbed audio URL in advanced mode (using buffer)");return}if(j.url){console.log(`[Audio] Creating audio element for ${P}`);const I=new Audio(j.url);I.preload="auto",I.muted=!o.includes(P),p.current&&(I.currentTime=p.current.currentTime),p.current&&!p.current.paused&&I.play().catch(X=>{console.log(`[Audio] Play prevented for ${P}:`,X)}),m.current[P]=I}}),()=>{console.log("[Audio] Cleaning up audio elements"),Object.values(m.current).forEach(P=>{P.pause()}),m.current={}}),[r,c,l]),B.useEffect(()=>{console.log("[Audio] Selected tracks changed:",o),Object.entries(m.current).forEach(([P,j])=>{const I=!o.includes(P);console.log(`[Audio] ${P} muted:`,I),j.muted=I}),p.current&&!p.current.paused&&E(p.current.currentTime)},[r,c,o]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{console.log("[Video] Play event"),Object.entries(m.current).forEach(([J,ie])=>{console.log(`[Audio] Playing ${J}`),ie.play().catch(re=>{console.log(`[Audio] Play prevented for ${J}:`,re)})}),E(P.currentTime)},I=()=>{console.log("[Video] Pause event"),Object.entries(m.current).forEach(([J,ie])=>{console.log(`[Audio] Pausing ${J}`),ie.pause()}),_.current.forEach(J=>{try{J.stop(),J.disconnect()}catch(ie){console.error("Error stopping audio source:",ie)}}),_.current=[]},X=()=>{console.log("[Video] Seeked event");const J=P.currentTime;Object.entries(m.current).forEach(([ie,re])=>{console.log(`[Audio] Seeking ${ie} to ${J}`),re.currentTime=J}),P.paused||E(J)};return P.addEventListener("play",j),P.addEventListener("pause",I),P.addEventListener("seeked",X),()=>{P.removeEventListener("play",j),P.removeEventListener("pause",I),P.removeEventListener("seeked",X)}},[r,c,o]),B.useEffect(()=>{m.current.dubbed&&o.includes("dubbed")&&c&&(m.current.dubbed.muted=!0)},[c,o]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{D()};return P.addEventListener("timeupdate",j),()=>{P.removeEventListener("timeupdate",j),b.current&&(b.current.close(),b.current=null)}},[t]),B.useEffect(()=>{const P=p.current;if(!P)return;const j=()=>{C.current&&(C.current.stop(),C.current.disconnect()),D()};return P.addEventListener("seeked",j),()=>{P.removeEventListener("seeked",j)}},[t]);const R=P=>{if(P.buffer)try{if(b.current||(b.current=new AudioContext),C.current)try{C.current.stop(),C.current.disconnect()}catch(ie){console.error("Error stopping previous track:",ie)}const j=b.current.createBufferSource(),I=b.current.createGain();j.buffer=P.buffer,I.gain.value=Math.pow(10,P.volume_gain_db/20),j.connect(I),I.connect(b.current.destination);const X=Math.max(0,p.current.currentTime-P.start),J=P.end-P.start;j.start(0,X,J),C.current=j,O.current=I,setTimeout(()=>{try{j.stop(),j.disconnect()}catch(ie){console.error("Error stopping track:",ie)}finally{v.current=null,m.current.dubbed&&o.includes("dubbed")&&(m.current.dubbed.muted=!1)}},(J-X)*1e3)}catch(j){console.error("Error playing track buffer:",j),m.current.dubbed&&o.includes("dubbed")&&(m.current.dubbed.muted=!1)}},D=()=>{if(!p.current||l)return;const P=p.current.currentTime;console.log("currentTime",P);try{const j=t.find(I=>P>=I.start&&P<=I.end);if(j!=null&&j.deleted||j!=null&&j.buffer)m.current.dubbed&&(m.current.dubbed.muted=!0),j!=null&&j.buffer&&j!==v.current&&(v.current=j,R(j));else if(m.current.dubbed&&(m.current.dubbed.muted=!1),C.current)try{C.current.stop(),C.current.disconnect()}catch(I){console.error("Error stopping track:",I)}}catch(j){console.error("Error checking and playing tracks:",j),m.current.dubbed&&(m.current.dubbed.muted=!1)}};return L.jsx(qL,{children:L.jsxs(JL,{ref:p,controls:!0,preload:"auto",isEditMode:t.length>0,children:[L.jsx("source",{src:e,type:n}),x&&L.jsx("track",{ref:h,kind:"captions",srcLang:"original",label:"Original"}),k&&L.jsx("track",{ref:y,kind:"captions",srcLang:"dubbed",label:"Dubbed"}),"Your browser does not support the video tag."]})})}),tA=le.div` width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; -`,tL=le.audio` +`,nA=le.audio` width: 100%; -`,nL=B.forwardRef(({src:e,mediaType:t},n)=>{const r=B.useRef(null);return B.useImperativeHandle(n,()=>({get currentTime(){return r.current?r.current.currentTime:0},setCurrentTime(o){r.current&&(r.current.currentTime=o)},play(){var o;(o=r.current)==null||o.play()},pause(){var o;(o=r.current)==null||o.pause()}})),B.useEffect(()=>{r.current&&(r.current.src=e)},[e]),B.useEffect(()=>{const o=r.current;o&&(o.onerror=()=>{console.error("Audio error:",o.error)})},[]),A.jsx(eL,{children:A.jsxs(tL,{ref:r,controls:!0,children:[A.jsx("source",{src:e,type:t}),"Your browser does not support the audio tag."]})})}),rL=(e,t)=>e.mediaType.startsWith("video")?A.jsx(JA,{...e,ref:t}):A.jsx(nL,{...e,ref:t}),iL=B.forwardRef(rL);function oL(e,t,n){return Math.max(t,Math.min(e,n))}const rt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function by(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function ky(e,t,n,r=.15){return r===0?oL(e,t,n):en?+by(e-n,n-t,r)+n:e}function sL(e,[t,n],[r,o]){const[[a,l],[c,f]]=e;return[ky(t,a,l,r),ky(n,c,f,o)]}function aL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lL(e){var t=aL(e,"string");return typeof t=="symbol"?t:String(t)}function St(e,t,n){return t=lL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function mL(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function pS(e){return Hc(e)?mL(e)[0]:e}function uh(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,o=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,l=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:l,origin:[o,a]}}catch{}return null}function vL(e){return gL(e).map(t=>t.identifier)}function Ty(e,t){const[n,r]=Array.from(e.touches).filter(o=>t.includes(o.identifier));return uh(n,r)}function Kd(e){const t=pS(e);return Hc(e)?t.identifier:t.pointerId}function hs(e){const t=pS(e);return[t.clientX,t.clientY]}const Ry=40,Py=800;function hS(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return r===1?(t*=Ry,n*=Ry):r===2&&(t*=Py,n*=Py),[t,n]}function yL(e){var t,n;const{scrollX:r,scrollY:o,scrollLeft:a,scrollTop:l}=e.currentTarget;return[(t=r??a)!==null&&t!==void 0?t:0,(n=o??l)!==null&&n!==void 0?n:0]}function wL(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a})}return t}function ec(e,...t){return typeof e=="function"?e(...t):e}function xL(){}function SL(...e){return e.length===0?xL:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Oy(e,t){return Object.assign({},t,e||{})}const _L=32;class gS{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?ec(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let a=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,wL(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,a=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const R=n._delta.map(Math.abs);rt.addTo(n._distance,R)}this.axisIntent&&this.axisIntent(t);const[l,c]=n._movement,[f,p]=r.threshold,{_step:h,values:y}=n;if(r.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(l)>=f&&y[0]),h[1]===!1&&(h[1]=Math.abs(c)>=p&&y[1])):(h[0]===!1&&(h[0]=Math.abs(l)>=f&&Math.sign(l)*f),h[1]===!1&&(h[1]=Math.abs(c)>=p&&Math.sign(c)*p)),n.intentional=h[0]!==!1||h[1]!==!1,!n.intentional)return;const m=[0,0];if(r.hasCustomTransform){const[R,D]=y;m[0]=h[0]!==!1?R-h[0]:0,m[1]=h[1]!==!1?D-h[1]:0}else m[0]=h[0]!==!1?l-h[0]:0,m[1]=h[1]!==!1?c-h[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const b=n.offset,C=n._active&&!n._blocked||n.active;C&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=ec(r.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[O,L]=n.offset,[[_,v],[x,k]]=n._bounds;n.overflow=[O<_?-1:O>v?1:0,Lk?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const E=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=sL(n._bounds,n.offset,E),n.delta=rt.sub(n.offset,b),this.computeMovement(),C&&(!n.last||a>_L)){n.delta=rt.sub(n.offset,b);const R=n.delta.map(Math.abs);rt.addTo(n.distance,R),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[R[0]/a,R[1]/a],n.timeDelta=a)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(lt(lt(lt({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function bL([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class Ba extends gS{constructor(...t){super(...t),St(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=rt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=rt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[dS(t)]:r.axisThreshold;n.axis=bL(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const kL=e=>e,Ay=.15,mS={enabled(e=!0){return e},eventOptions(e,t,n){return lt(lt({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Ay,Ay];case!1:return[0,0];default:return rt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return rt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||kL},threshold(e){return rt.toVector(e,0)}},CL=0,ao=lt(lt({},mS),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=CL){return e},bounds(e={}){if(typeof e=="function")return a=>ao.bounds(e(a));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Ly={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class EL extends Ba{constructor(...t){super(...t),St(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=ao.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Kd(t),r._pointerActive=!0,this.computeValues(hs(t)),this.computeInitial(),n.preventScrollAxis&&dS(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Kd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const a=hs(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=rt.sub(a,n._values),this.computeValues(a)),rt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Kd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[a,l]=n._distance;if(n.tap=a<=r.tapsThreshold&&l<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[c,f]=n._delta,[p,h]=n._movement,[y,m]=r.swipe.velocity,[b,C]=r.swipe.distance,O=r.swipe.duration;if(n.elapsedTimey&&Math.abs(p)>b&&(n.swipe[0]=Math.sign(c)),_>m&&Math.abs(h)>C&&(n.swipe[1]=Math.sign(f))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,TL(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=Ly[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,rt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Ly&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function TL(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Wa=typeof window<"u"&&window.document&&window.document.createElement;function vS(){return Wa&&"ontouchstart"in window}function RL(){return vS()||Wa&&window.navigator.maxTouchPoints>1}function PL(){return Wa&&"onpointerdown"in window}function OL(){return Wa&&"exitPointerLock"in window.document}function AL(){try{return"constructor"in GestureEvent}catch{return!1}}const Vn={isBrowser:Wa,gesture:AL(),touch:vS(),touchscreen:RL(),pointer:PL(),pointerLock:OL()},LL=250,$L=180,DL=.5,IL=50,NL=250,ML=10,$y={mouse:0,touch:0,pen:8},zL=lt(lt({},ao),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Vn.pointerLock,Vn.touch&&n?"touch":this.pointerLock?"mouse":Vn.pointer&&!o?"pointer":Vn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?LL:void 0,!(!Vn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const a=rt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=DL,distance:t=IL,duration:n=NL}={}){return{velocity:this.transform(rt.toVector(e)),distance:this.transform(rt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return $L;case!1:return 0;default:return e}},axisThreshold(e){return e?lt(lt({},$y),e):$y},keyboardDisplacement(e=ML){return e}});function yS(e){const[t,n]=e.overflow,[r,o]=e._delta,[a,l]=e._direction;(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&o>0&&l<0||n>0&&o<0&&l>0)&&(e._movement[1]=e._movementBound[1])}const FL=30,UL=100;class jL extends gS{constructor(...t){super(...t),St(this,"ingKey","pinching"),St(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:n,lastOffset:r}=this.state;t==="wheel"?this.state.offset=rt.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:t,lastOffset:n}=this.state;this.state.movement=[t[0]/n[0],t[1]-n[1]]}axisIntent(){const t=this.state,[n,r]=t._movement;if(!t.axis){const o=Math.abs(n)*FL-Math.abs(r);o<0?t.axis="angle":o>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&(this.state.axis==="scale"?t[1]=0:this.state.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(a=>r.has(a))||r.size<2)return;this.start(t),n._touchIds=Array.from(r).slice(0,2);const o=Ty(t,n._touchIds);o&&this.pinchStart(t,o)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const n=this.state,r=n._pointerEvents,o=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(l=>o.has(l))||(r.size<2&&r.set(t.pointerId,t),n._pointerEvents.size<2))return;this.start(t);const a=uh(...Array.from(r.values()));a&&this.pinchStart(t,a)}pinchStart(t,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const n=Ty(t,this.state._touchIds);n&&this.pinchMove(t,n)}pointerMove(t){const n=this.state._pointerEvents;if(n.has(t.pointerId)&&n.set(t.pointerId,t),!this.state._active)return;const r=uh(...Array.from(n.values()));r&&this.pinchMove(t,r)}pinchMove(t,n){const r=this.state,o=r._values[1],a=n.angle-o;let l=0;Math.abs(a)>270&&(l+=Math.sign(a)),this.computeValues([n.distance,n.angle-360*l]),r.origin=n.origin,r.turns=l,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const n=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}n._pointerEvents.has(t.pointerId)&&n._pointerEvents.delete(t.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const n=this.state;n._active||(this.start(t),this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY];const r=n._movement;n._movement=[t.scale-1,t.rotation],n._delta=rt.sub(n._movement,r),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>t[r]):!t[n])||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||t.cancelable&&t.preventDefault();const r=this.state;r._delta=[-hS(t)[1]/UL*r.offset[0],0],rt.addTo(r._movement,r._delta),yS(r),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){const n=this.config.device;n&&(t(n,"start",this[n+"Start"].bind(this)),t(n,"change",this[n+"Move"].bind(this)),t(n,"end",this[n+"End"].bind(this)),t(n,"cancel",this[n+"End"].bind(this)),t("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}}const BL=lt(lt({},mS),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Vn.touch&&Vn.gesture)return"gesture";if(Vn.touch&&r)return"touch";if(Vn.touchscreen){if(Vn.pointer)return"pointer";if(Vn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=l=>{const c=Oy(ec(n,l),{min:-1/0,max:1/0});return[c.min,c.max]},a=l=>{const c=Oy(ec(r,l),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof n!="function"&&typeof r!="function"?[o(),a()]:l=>[o(l),a(l)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",rt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});class WL extends Ba{constructor(...t){super(...t),St(this,"ingKey","moving")}move(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(hs(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;const n=hs(t),r=this.state;r._delta=rt.sub(n,r._values),rt.addTo(r._movement,r._delta),this.computeValues(n),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}}const HL=lt(lt({},ao),{},{mouseOnly:(e=!0)=>e});class VL extends Ba{constructor(...t){super(...t),St(this,"ingKey","scrolling")}scroll(t){this.state._active||this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();const n=this.state,r=yL(t);n._delta=rt.sub(r,n._values),rt.addTo(n._movement,n._delta),this.computeValues(r),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}}const KL=ao;class GL extends Ba{constructor(...t){super(...t),St(this,"ingKey","wheeling")}wheel(t){this.state._active||this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){const n=this.state;n._delta=hS(t),rt.addTo(n._movement,n._delta),yS(n),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}}const YL=ao;class XL extends Ba{constructor(...t){super(...t),St(this,"ingKey","hovering")}enter(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.start(t),this.computeValues(hs(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&t.pointerType!=="mouse")return;const n=this.state;if(!n._active)return;n._active=!1;const r=hs(t);n._movement=n._delta=rt.sub(r,n._values),this.computeValues(r),this.compute(t),n.delta=n.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}}const QL=lt(lt({},ao),{},{mouseOnly:(e=!0)=>e}),Sg=new Map,ch=new Map;function ZL(e){Sg.set(e.key,e.engine),ch.set(e.key,e.resolver)}const qL={key:"drag",engine:EL,resolver:zL},JL={key:"hover",engine:XL,resolver:QL},e$={key:"move",engine:WL,resolver:HL},t$={key:"pinch",engine:jL,resolver:BL},n$={key:"scroll",engine:VL,resolver:KL},r$={key:"wheel",engine:GL,resolver:YL};function i$(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a=0)&&(n[o]=e[o]);return n}function o$(e,t){if(e==null)return{};var n=i$(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const s$={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Vn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},a$=["target","eventOptions","window","enabled","transform"];function ku(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=ku(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function l$(e,t,n={}){const r=e,{target:o,eventOptions:a,window:l,enabled:c,transform:f}=r,p=o$(r,a$);if(n.shared=ku({target:o,eventOptions:a,window:l,enabled:c,transform:f},s$),t){const h=ch.get(t);n[t]=ku(lt({shared:n.shared},p),h)}else for(const h in p){const y=ch.get(h);y&&(n[h]=ku(lt({shared:n.shared},p[h]),y))}return n}class wS{constructor(t,n){St(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,a){const l=this._listeners,c=hL(n,r),f=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},p=lt(lt({},f),a);t.addEventListener(c,o,p);const h=()=>{t.removeEventListener(c,o,p),l.delete(h)};return l.add(h),h}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class u${constructor(){St(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class c${constructor(t){St(this,"gestures",new Set),St(this,"_targetEventStore",new wS(this)),St(this,"gestureEventStores",{}),St(this,"gestureTimeoutStores",{}),St(this,"handlers",{}),St(this,"config",{}),St(this,"pointerIds",new Set),St(this,"touchIds",new Set),St(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),f$(this,t)}setEventIds(t){if(Hc(t))return this.touchIds=new Set(vL(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=l$(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const l of this.gestures){const c=this.config[l],f=Dy(r,c.eventOptions,!!o);if(c.enabled){const p=Sg.get(l);new p(this,t,l).bind(f)}}const a=Dy(r,n.eventOptions,!!o);for(const l in this.nativeHandlers)a(l,"",c=>this.nativeHandlers[l](lt(lt({},this.state.shared),{},{event:c,args:t})),void 0,!0)}for(const a in r)r[a]=SL(...r[a]);if(!o)return r;for(const a in r){const{device:l,capture:c,passive:f}=pL(a);this._targetEventStore.add(o,l,"",r[a],{capture:c,passive:f})}}}}function Lo(e,t){e.gestures.add(t),e.gestureEventStores[t]=new wS(e,t),e.gestureTimeoutStores[t]=new u$}function f$(e,t){t.drag&&Lo(e,"drag"),t.wheel&&Lo(e,"wheel"),t.scroll&&Lo(e,"scroll"),t.move&&Lo(e,"move"),t.pinch&&Lo(e,"pinch"),t.hover&&Lo(e,"hover")}const Dy=(e,t,n)=>(r,o,a,l={},c=!1)=>{var f,p;const h=(f=l.capture)!==null&&f!==void 0?f:t.capture,y=(p=l.passive)!==null&&p!==void 0?p:t.passive;let m=c?r:fL(r,o,h);n&&y&&(m+="Passive"),e[m]=e[m]||[],e[m].push(a)},d$=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function p$(e){const t={},n={},r=new Set;for(let o in e)d$.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}function $o(e,t,n,r,o,a){if(!e.has(n)||!Sg.has(r))return;const l=n+"Start",c=n+"End",f=p=>{let h;return p.first&&l in t&&t[l](p),n in t&&(h=t[n](p)),p.last&&c in t&&t[c](p),h};o[r]=f,a[r]=a[r]||{}}function h$(e,t){const[n,r,o]=p$(e),a={};return $o(o,n,"onDrag","drag",a,t),$o(o,n,"onWheel","wheel",a,t),$o(o,n,"onScroll","scroll",a,t),$o(o,n,"onPinch","pinch",a,t),$o(o,n,"onMove","move",a,t),$o(o,n,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:r}}function g$(e,t={},n,r){const o=Wr.useMemo(()=>new c$(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),Wr.useEffect(o.effect.bind(o)),Wr.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function m$(e){return e.forEach(ZL),function(n,r){const{handlers:o,nativeHandlers:a,config:l}=h$(n,r||{});return g$(o,l,void 0,a)}}function v$(e,t){return m$([qL,t$,n$,r$,e$,JL])(e,t||{})}var Vc={exports:{}},xS={},SS={exports:{}},y$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",w$=y$,x$=w$;function _S(){}function bS(){}bS.resetWarningCache=_S;var S$=function(){function e(r,o,a,l,c,f){if(f!==x$){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:bS,resetWarningCache:_S};return n.PropTypes=n,n};SS.exports=S$();var kS=SS.exports;function CS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;rt===n.identifier)||e.changedTouches&&(0,On.findInArray)(e.changedTouches,n=>t===n.identifier)}function W$(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function H$(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,rA=B.forwardRef(({src:e,mediaType:t},n)=>{const r=B.useRef(null);return B.useImperativeHandle(n,()=>({get currentTime(){return r.current?r.current.currentTime:0},setCurrentTime(o){r.current&&(r.current.currentTime=o)},play(){var o;(o=r.current)==null||o.play()},pause(){var o;(o=r.current)==null||o.pause()}})),B.useEffect(()=>{r.current&&(r.current.src=e)},[e]),B.useEffect(()=>{const o=r.current;o&&(o.onerror=()=>{console.error("Audio error:",o.error)})},[]),L.jsx(tA,{children:L.jsxs(nA,{ref:r,controls:!0,children:[L.jsx("source",{src:e,type:t}),"Your browser does not support the audio tag."]})})}),iA=(e,t)=>e.mediaType.startsWith("video")?L.jsx(eA,{...e,ref:t}):L.jsx(rA,{...e,ref:t}),oA=B.forwardRef(iA);function sA(e,t,n){return Math.max(t,Math.min(e,n))}const rt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function by(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function ky(e,t,n,r=.15){return r===0?sA(e,t,n):en?+by(e-n,n-t,r)+n:e}function aA(e,[t,n],[r,o]){const[[a,l],[c,f]]=e;return[ky(t,a,l,r),ky(n,c,f,o)]}function lA(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uA(e){var t=lA(e,"string");return typeof t=="symbol"?t:String(t)}function St(e,t,n){return t=uA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function vA(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function hS(e){return Hc(e)?vA(e)[0]:e}function uh(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,o=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,l=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:l,origin:[o,a]}}catch{}return null}function yA(e){return mA(e).map(t=>t.identifier)}function Ty(e,t){const[n,r]=Array.from(e.touches).filter(o=>t.includes(o.identifier));return uh(n,r)}function Kd(e){const t=hS(e);return Hc(e)?t.identifier:t.pointerId}function hs(e){const t=hS(e);return[t.clientX,t.clientY]}const Ry=40,Py=800;function gS(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return r===1?(t*=Ry,n*=Ry):r===2&&(t*=Py,n*=Py),[t,n]}function wA(e){var t,n;const{scrollX:r,scrollY:o,scrollLeft:a,scrollTop:l}=e.currentTarget;return[(t=r??a)!==null&&t!==void 0?t:0,(n=o??l)!==null&&n!==void 0?n:0]}function xA(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a})}return t}function ec(e,...t){return typeof e=="function"?e(...t):e}function SA(){}function _A(...e){return e.length===0?SA:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Oy(e,t){return Object.assign({},t,e||{})}const bA=32;class mS{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?ec(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let a=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,xA(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,a=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const R=n._delta.map(Math.abs);rt.addTo(n._distance,R)}this.axisIntent&&this.axisIntent(t);const[l,c]=n._movement,[f,p]=r.threshold,{_step:h,values:y}=n;if(r.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(l)>=f&&y[0]),h[1]===!1&&(h[1]=Math.abs(c)>=p&&y[1])):(h[0]===!1&&(h[0]=Math.abs(l)>=f&&Math.sign(l)*f),h[1]===!1&&(h[1]=Math.abs(c)>=p&&Math.sign(c)*p)),n.intentional=h[0]!==!1||h[1]!==!1,!n.intentional)return;const m=[0,0];if(r.hasCustomTransform){const[R,D]=y;m[0]=h[0]!==!1?R-h[0]:0,m[1]=h[1]!==!1?D-h[1]:0}else m[0]=h[0]!==!1?l-h[0]:0,m[1]=h[1]!==!1?c-h[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const b=n.offset,C=n._active&&!n._blocked||n.active;C&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=ec(r.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[O,A]=n.offset,[[_,v],[x,k]]=n._bounds;n.overflow=[O<_?-1:O>v?1:0,Ak?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const E=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=aA(n._bounds,n.offset,E),n.delta=rt.sub(n.offset,b),this.computeMovement(),C&&(!n.last||a>bA)){n.delta=rt.sub(n.offset,b);const R=n.delta.map(Math.abs);rt.addTo(n.distance,R),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[R[0]/a,R[1]/a],n.timeDelta=a)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(lt(lt(lt({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function kA([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class Ba extends mS{constructor(...t){super(...t),St(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=rt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=rt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[pS(t)]:r.axisThreshold;n.axis=kA(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const CA=e=>e,Ly=.15,vS={enabled(e=!0){return e},eventOptions(e,t,n){return lt(lt({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Ly,Ly];case!1:return[0,0];default:return rt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return rt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||CA},threshold(e){return rt.toVector(e,0)}},EA=0,ao=lt(lt({},vS),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=EA){return e},bounds(e={}){if(typeof e=="function")return a=>ao.bounds(e(a));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Ay={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class TA extends Ba{constructor(...t){super(...t),St(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=ao.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Kd(t),r._pointerActive=!0,this.computeValues(hs(t)),this.computeInitial(),n.preventScrollAxis&&pS(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Kd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const a=hs(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=rt.sub(a,n._values),this.computeValues(a)),rt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Kd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[a,l]=n._distance;if(n.tap=a<=r.tapsThreshold&&l<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[c,f]=n._delta,[p,h]=n._movement,[y,m]=r.swipe.velocity,[b,C]=r.swipe.distance,O=r.swipe.duration;if(n.elapsedTimey&&Math.abs(p)>b&&(n.swipe[0]=Math.sign(c)),_>m&&Math.abs(h)>C&&(n.swipe[1]=Math.sign(f))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,RA(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=Ay[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,rt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Ay&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function RA(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Wa=typeof window<"u"&&window.document&&window.document.createElement;function yS(){return Wa&&"ontouchstart"in window}function PA(){return yS()||Wa&&window.navigator.maxTouchPoints>1}function OA(){return Wa&&"onpointerdown"in window}function LA(){return Wa&&"exitPointerLock"in window.document}function AA(){try{return"constructor"in GestureEvent}catch{return!1}}const Vn={isBrowser:Wa,gesture:AA(),touch:yS(),touchscreen:PA(),pointer:OA(),pointerLock:LA()},$A=250,DA=180,IA=.5,NA=50,MA=250,zA=10,$y={mouse:0,touch:0,pen:8},FA=lt(lt({},ao),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Vn.pointerLock,Vn.touch&&n?"touch":this.pointerLock?"mouse":Vn.pointer&&!o?"pointer":Vn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?$A:void 0,!(!Vn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const a=rt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=IA,distance:t=NA,duration:n=MA}={}){return{velocity:this.transform(rt.toVector(e)),distance:this.transform(rt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return DA;case!1:return 0;default:return e}},axisThreshold(e){return e?lt(lt({},$y),e):$y},keyboardDisplacement(e=zA){return e}});function wS(e){const[t,n]=e.overflow,[r,o]=e._delta,[a,l]=e._direction;(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&o>0&&l<0||n>0&&o<0&&l>0)&&(e._movement[1]=e._movementBound[1])}const UA=30,jA=100;class BA extends mS{constructor(...t){super(...t),St(this,"ingKey","pinching"),St(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:n,lastOffset:r}=this.state;t==="wheel"?this.state.offset=rt.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:t,lastOffset:n}=this.state;this.state.movement=[t[0]/n[0],t[1]-n[1]]}axisIntent(){const t=this.state,[n,r]=t._movement;if(!t.axis){const o=Math.abs(n)*UA-Math.abs(r);o<0?t.axis="angle":o>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&(this.state.axis==="scale"?t[1]=0:this.state.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(a=>r.has(a))||r.size<2)return;this.start(t),n._touchIds=Array.from(r).slice(0,2);const o=Ty(t,n._touchIds);o&&this.pinchStart(t,o)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const n=this.state,r=n._pointerEvents,o=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(l=>o.has(l))||(r.size<2&&r.set(t.pointerId,t),n._pointerEvents.size<2))return;this.start(t);const a=uh(...Array.from(r.values()));a&&this.pinchStart(t,a)}pinchStart(t,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const n=Ty(t,this.state._touchIds);n&&this.pinchMove(t,n)}pointerMove(t){const n=this.state._pointerEvents;if(n.has(t.pointerId)&&n.set(t.pointerId,t),!this.state._active)return;const r=uh(...Array.from(n.values()));r&&this.pinchMove(t,r)}pinchMove(t,n){const r=this.state,o=r._values[1],a=n.angle-o;let l=0;Math.abs(a)>270&&(l+=Math.sign(a)),this.computeValues([n.distance,n.angle-360*l]),r.origin=n.origin,r.turns=l,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const n=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}n._pointerEvents.has(t.pointerId)&&n._pointerEvents.delete(t.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const n=this.state;n._active||(this.start(t),this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY];const r=n._movement;n._movement=[t.scale-1,t.rotation],n._delta=rt.sub(n._movement,r),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>t[r]):!t[n])||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||t.cancelable&&t.preventDefault();const r=this.state;r._delta=[-gS(t)[1]/jA*r.offset[0],0],rt.addTo(r._movement,r._delta),wS(r),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){const n=this.config.device;n&&(t(n,"start",this[n+"Start"].bind(this)),t(n,"change",this[n+"Move"].bind(this)),t(n,"end",this[n+"End"].bind(this)),t(n,"cancel",this[n+"End"].bind(this)),t("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}}const WA=lt(lt({},vS),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Vn.touch&&Vn.gesture)return"gesture";if(Vn.touch&&r)return"touch";if(Vn.touchscreen){if(Vn.pointer)return"pointer";if(Vn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=l=>{const c=Oy(ec(n,l),{min:-1/0,max:1/0});return[c.min,c.max]},a=l=>{const c=Oy(ec(r,l),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof n!="function"&&typeof r!="function"?[o(),a()]:l=>[o(l),a(l)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",rt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});class HA extends Ba{constructor(...t){super(...t),St(this,"ingKey","moving")}move(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(hs(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;const n=hs(t),r=this.state;r._delta=rt.sub(n,r._values),rt.addTo(r._movement,r._delta),this.computeValues(n),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}}const VA=lt(lt({},ao),{},{mouseOnly:(e=!0)=>e});class KA extends Ba{constructor(...t){super(...t),St(this,"ingKey","scrolling")}scroll(t){this.state._active||this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();const n=this.state,r=wA(t);n._delta=rt.sub(r,n._values),rt.addTo(n._movement,n._delta),this.computeValues(r),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}}const GA=ao;class YA extends Ba{constructor(...t){super(...t),St(this,"ingKey","wheeling")}wheel(t){this.state._active||this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){const n=this.state;n._delta=gS(t),rt.addTo(n._movement,n._delta),wS(n),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}}const XA=ao;class QA extends Ba{constructor(...t){super(...t),St(this,"ingKey","hovering")}enter(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.start(t),this.computeValues(hs(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&t.pointerType!=="mouse")return;const n=this.state;if(!n._active)return;n._active=!1;const r=hs(t);n._movement=n._delta=rt.sub(r,n._values),this.computeValues(r),this.compute(t),n.delta=n.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}}const ZA=lt(lt({},ao),{},{mouseOnly:(e=!0)=>e}),Sg=new Map,ch=new Map;function qA(e){Sg.set(e.key,e.engine),ch.set(e.key,e.resolver)}const JA={key:"drag",engine:TA,resolver:FA},e$={key:"hover",engine:QA,resolver:ZA},t$={key:"move",engine:HA,resolver:VA},n$={key:"pinch",engine:BA,resolver:WA},r$={key:"scroll",engine:KA,resolver:GA},i$={key:"wheel",engine:YA,resolver:XA};function o$(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a=0)&&(n[o]=e[o]);return n}function s$(e,t){if(e==null)return{};var n=o$(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const a$={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Vn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},l$=["target","eventOptions","window","enabled","transform"];function ku(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=ku(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function u$(e,t,n={}){const r=e,{target:o,eventOptions:a,window:l,enabled:c,transform:f}=r,p=s$(r,l$);if(n.shared=ku({target:o,eventOptions:a,window:l,enabled:c,transform:f},a$),t){const h=ch.get(t);n[t]=ku(lt({shared:n.shared},p),h)}else for(const h in p){const y=ch.get(h);y&&(n[h]=ku(lt({shared:n.shared},p[h]),y))}return n}class xS{constructor(t,n){St(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,a){const l=this._listeners,c=gA(n,r),f=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},p=lt(lt({},f),a);t.addEventListener(c,o,p);const h=()=>{t.removeEventListener(c,o,p),l.delete(h)};return l.add(h),h}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class c${constructor(){St(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class f${constructor(t){St(this,"gestures",new Set),St(this,"_targetEventStore",new xS(this)),St(this,"gestureEventStores",{}),St(this,"gestureTimeoutStores",{}),St(this,"handlers",{}),St(this,"config",{}),St(this,"pointerIds",new Set),St(this,"touchIds",new Set),St(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),d$(this,t)}setEventIds(t){if(Hc(t))return this.touchIds=new Set(yA(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=u$(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const l of this.gestures){const c=this.config[l],f=Dy(r,c.eventOptions,!!o);if(c.enabled){const p=Sg.get(l);new p(this,t,l).bind(f)}}const a=Dy(r,n.eventOptions,!!o);for(const l in this.nativeHandlers)a(l,"",c=>this.nativeHandlers[l](lt(lt({},this.state.shared),{},{event:c,args:t})),void 0,!0)}for(const a in r)r[a]=_A(...r[a]);if(!o)return r;for(const a in r){const{device:l,capture:c,passive:f}=hA(a);this._targetEventStore.add(o,l,"",r[a],{capture:c,passive:f})}}}}function Ao(e,t){e.gestures.add(t),e.gestureEventStores[t]=new xS(e,t),e.gestureTimeoutStores[t]=new c$}function d$(e,t){t.drag&&Ao(e,"drag"),t.wheel&&Ao(e,"wheel"),t.scroll&&Ao(e,"scroll"),t.move&&Ao(e,"move"),t.pinch&&Ao(e,"pinch"),t.hover&&Ao(e,"hover")}const Dy=(e,t,n)=>(r,o,a,l={},c=!1)=>{var f,p;const h=(f=l.capture)!==null&&f!==void 0?f:t.capture,y=(p=l.passive)!==null&&p!==void 0?p:t.passive;let m=c?r:dA(r,o,h);n&&y&&(m+="Passive"),e[m]=e[m]||[],e[m].push(a)},p$=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function h$(e){const t={},n={},r=new Set;for(let o in e)p$.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}function $o(e,t,n,r,o,a){if(!e.has(n)||!Sg.has(r))return;const l=n+"Start",c=n+"End",f=p=>{let h;return p.first&&l in t&&t[l](p),n in t&&(h=t[n](p)),p.last&&c in t&&t[c](p),h};o[r]=f,a[r]=a[r]||{}}function g$(e,t){const[n,r,o]=h$(e),a={};return $o(o,n,"onDrag","drag",a,t),$o(o,n,"onWheel","wheel",a,t),$o(o,n,"onScroll","scroll",a,t),$o(o,n,"onPinch","pinch",a,t),$o(o,n,"onMove","move",a,t),$o(o,n,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:r}}function m$(e,t={},n,r){const o=Wr.useMemo(()=>new f$(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),Wr.useEffect(o.effect.bind(o)),Wr.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function v$(e){return e.forEach(qA),function(n,r){const{handlers:o,nativeHandlers:a,config:l}=g$(n,r||{});return m$(o,l,void 0,a)}}function y$(e,t){return v$([JA,n$,r$,i$,t$,e$])(e,t||{})}var Vc={exports:{}},SS={},_S={exports:{}},w$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",x$=w$,S$=x$;function bS(){}function kS(){}kS.resetWarningCache=bS;var _$=function(){function e(r,o,a,l,c,f){if(f!==S$){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:kS,resetWarningCache:bS};return n.PropTypes=n,n};_S.exports=_$();var CS=_S.exports;function ES(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;rt===n.identifier)||e.changedTouches&&(0,On.findInArray)(e.changedTouches,n=>t===n.identifier)}function H$(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function V$(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&OS(e.body,"react-draggable-transparent-selection")}function V$(e){if(e)try{if(e.body&&AS(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function OS(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function AS(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.canDragX=Y$;Tr.canDragY=X$;Tr.createCoreData=Z$;Tr.createDraggableData=q$;Tr.getBoundPosition=K$;Tr.getControlPosition=Q$;Tr.snapToGrid=G$;var En=Er,Jo=ht;function K$(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:J$(r);const o=bg(e);if(typeof r=="string"){const{ownerDocument:a}=o,l=a.defaultView;let c;if(r==="parent"?c=o.parentNode:c=a.querySelector(r),!(c instanceof l.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const f=c,p=l.getComputedStyle(o),h=l.getComputedStyle(f);r={left:-o.offsetLeft+(0,En.int)(h.paddingLeft)+(0,En.int)(p.marginLeft),top:-o.offsetTop+(0,En.int)(h.paddingTop)+(0,En.int)(p.marginTop),right:(0,Jo.innerWidth)(f)-(0,Jo.outerWidth)(o)-o.offsetLeft+(0,En.int)(h.paddingRight)-(0,En.int)(p.marginRight),bottom:(0,Jo.innerHeight)(f)-(0,Jo.outerHeight)(o)-o.offsetTop+(0,En.int)(h.paddingBottom)-(0,En.int)(p.marginBottom)}}return(0,En.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,En.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,En.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,En.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function G$(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function Y$(e){return e.props.axis==="both"||e.props.axis==="x"}function X$(e){return e.props.axis==="both"||e.props.axis==="y"}function Q$(e,t,n){const r=typeof t=="number"?(0,Jo.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=bg(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Jo.offsetXYFromParent)(r||e,a,n.props.scale)}function Z$(e,t,n){const r=!(0,En.isNum)(e.lastX),o=bg(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function q$(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function J$(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function bg(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}var Kc={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.default=eD;function eD(){}Object.defineProperty(Kc,"__esModule",{value:!0});Kc.default=void 0;var Yd=nD(B),cn=kg(kS),tD=kg(Fa),Kt=ht,li=Tr,Xd=Er,Gs=kg(Gc);function kg(e){return e&&e.__esModule?e:{default:e}}function LS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(LS=function(r){return r?n:t})(e)}function nD(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=LS(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function Jt(e,t,n){return t=rD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rD(e){var t=iD(e,"string");return typeof t=="symbol"?t:String(t)}function iD(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const or={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ui=or.mouse,Yc=class extends Yd.Component{constructor(){super(...arguments),Jt(this,"dragging",!1),Jt(this,"lastX",NaN),Jt(this,"lastY",NaN),Jt(this,"touchIdentifier",null),Jt(this,"mounted",!1),Jt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Kt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Kt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Kt.getTouchIdentifier)(t);this.touchIdentifier=o;const a=(0,li.getControlPosition)(t,o,this);if(a==null)return;const{x:l,y:c}=a,f=(0,li.createCoreData)(this,l,c);(0,Gs.default)("DraggableCore: handleDragStart: %j",f),(0,Gs.default)("calling",this.props.onStart),!(this.props.onStart(t,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Kt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=l,this.lastY=c,(0,Kt.addEvent)(r,ui.move,this.handleDrag),(0,Kt.addEvent)(r,ui.stop,this.handleDragStop))}),Jt(this,"handleDrag",t=>{const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,f=o-this.lastY;if([c,f]=(0,li.snapToGrid)(this.props.grid,c,f),!c&&!f)return;r=this.lastX+c,o=this.lastY+f}const a=(0,li.createCoreData)(this,r,o);if((0,Gs.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(f)}return}this.lastX=r,this.lastY=o}),Jt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,p=o-this.lastY||0;[f,p]=(0,li.snapToGrid)(this.props.grid,f,p),r=this.lastX+f,o=this.lastY+p}const a=(0,li.createCoreData)(this,r,o);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,Kt.removeUserSelectStyles)(c.ownerDocument),(0,Gs.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,Gs.default)("DraggableCore: Removing handlers"),(0,Kt.removeEvent)(c.ownerDocument,ui.move,this.handleDrag),(0,Kt.removeEvent)(c.ownerDocument,ui.stop,this.handleDragStop))}),Jt(this,"onMouseDown",t=>(ui=or.mouse,this.handleDragStart(t))),Jt(this,"onMouseUp",t=>(ui=or.mouse,this.handleDragStop(t))),Jt(this,"onTouchStart",t=>(ui=or.touch,this.handleDragStart(t))),Jt(this,"onTouchEnd",t=>(ui=or.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Kt.addEvent)(t,or.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Kt.removeEvent)(n,or.mouse.move,this.handleDrag),(0,Kt.removeEvent)(n,or.touch.move,this.handleDrag),(0,Kt.removeEvent)(n,or.mouse.stop,this.handleDragStop),(0,Kt.removeEvent)(n,or.touch.stop,this.handleDragStop),(0,Kt.removeEvent)(t,or.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Kt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:tD.default.findDOMNode(this)}render(){return Yd.cloneElement(Yd.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Kc.default=Yc;Jt(Yc,"displayName","DraggableCore");Jt(Yc,"propTypes",{allowAnyClick:cn.default.bool,children:cn.default.node.isRequired,disabled:cn.default.bool,enableUserSelectHack:cn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:cn.default.arrayOf(cn.default.number),handle:cn.default.string,cancel:cn.default.string,nodeRef:cn.default.object,onStart:cn.default.func,onDrag:cn.default.func,onStop:cn.default.func,onMouseDown:cn.default.func,scale:cn.default.number,className:Xd.dontSetMe,style:Xd.dontSetMe,transform:Xd.dontSetMe});Jt(Yc,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var t=m(B),n=h(kS),r=h(Fa),o=h(b$),a=ht,l=Tr,c=Er,f=h(Kc),p=h(Gc);function h(v){return v&&v.__esModule?v:{default:v}}function y(v){if(typeof WeakMap!="function")return null;var x=new WeakMap,k=new WeakMap;return(y=function(E){return E?k:x})(v)}function m(v,x){if(!x&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var k=y(x);if(k&&k.has(v))return k.get(v);var E={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in v)if(D!=="default"&&Object.prototype.hasOwnProperty.call(v,D)){var P=R?Object.getOwnPropertyDescriptor(v,D):null;P&&(P.get||P.set)?Object.defineProperty(E,D,P):E[D]=v[D]}return E.default=v,k&&k.set(v,E),E}function b(){return b=Object.assign?Object.assign.bind():function(v){for(var x=1;x{if((0,p.default)("Draggable: onDragStart: %j",E),this.props.onStart(k,(0,l.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(k,E)=>{if(!this.state.dragging)return!1;(0,p.default)("Draggable: onDrag: %j",E);const R=(0,l.createDraggableData)(this,E),D={x:R.x,y:R.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:I}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[X,J]=(0,l.getBoundPosition)(this,D.x,D.y);D.x=X,D.y=J,D.slackX=this.state.slackX+(j-D.x),D.slackY=this.state.slackY+(I-D.y),R.x=D.x,R.y=D.y,R.deltaX=D.x-this.state.x,R.deltaY=D.y-this.state.y}if(this.props.onDrag(k,R)===!1)return!1;this.setState(D)}),C(this,"onDragStop",(k,E)=>{if(!this.state.dragging||this.props.onStop(k,(0,l.createDraggableData)(this,E))===!1)return!1;(0,p.default)("Draggable: onDragStop: %j",E);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:I}=this.props.position;D.x=j,D.y=I}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,k;return(x=(k=this.props)===null||k===void 0||(k=k.nodeRef)===null||k===void 0?void 0:k.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:k,children:E,defaultPosition:R,defaultClassName:D,defaultClassNameDragging:P,defaultClassNameDragged:j,position:I,positionOffset:X,scale:J,...ie}=this.props;let re={},ae=null;const oe=!!!I||this.state.dragging,H=I||R,z={x:(0,l.canDragX)(this)&&oe?this.state.x:H.x,y:(0,l.canDragY)(this)&&oe?this.state.y:H.y};this.state.isElementSVG?ae=(0,a.createSVGTransform)(z,X):re=(0,a.createCSSTransform)(z,X);const U=(0,o.default)(E.props.className||"",D,{[P]:this.state.dragging,[j]:this.state.dragged});return t.createElement(f.default,b({},ie,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:U,style:{...E.props.style,...re},transform:ae}))}}e.default=_,C(_,"displayName","Draggable"),C(_,"propTypes",{...f.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),C(_,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(xS);const{default:$S,DraggableCore:oD}=xS;Vc.exports=$S;Vc.exports.default=$S;Vc.exports.DraggableCore=oD;var sD=Vc.exports;const aD=ac(sD);var lD=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=globalThis&&globalThis.__assign||function(){return xt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof a>"u"?void 0:Number(a),minHeight:typeof l>"u"?void 0:Number(l)}},gD=function(e){return Array.isArray(e)?e:[e,e]},mD=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],jy="__resizable_base__",vD=function(e){fD(t,e);function t(n){var r,o,a,l,c=e.call(this,n)||this;return c.ratio=1,c.resizable=null,c.parentLeft=0,c.parentTop=0,c.resizableLeft=0,c.resizableRight=0,c.resizableTop=0,c.resizableBottom=0,c.targetLeft=0,c.targetTop=0,c.appendBase=function(){if(!c.resizable||!c.window)return null;var f=c.parentNode;if(!f)return null;var p=c.window.document.createElement("div");return p.style.width="100%",p.style.height="100%",p.style.position="absolute",p.style.transform="scale(0, 0)",p.style.left="0",p.style.flex="0 0 100%",p.classList?p.classList.add(jy):p.className+=jy,f.appendChild(p),p},c.removeBase=function(f){var p=c.parentNode;p&&p.removeChild(f)},c.state={isResizing:!1,width:(o=(r=c.propsSize)===null||r===void 0?void 0:r.width)!==null&&o!==void 0?o:"auto",height:(l=(a=c.propsSize)===null||a===void 0?void 0:a.height)!==null&&l!==void 0?l:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},c.onResizeStart=c.onResizeStart.bind(c),c.onMouseMove=c.onMouseMove.bind(c),c.onMouseUp=c.onMouseUp.bind(c),c}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||dD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,a=this.resizable.offsetHeight,l=this.resizable.style.position;l!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:a,this.resizable.style.position=l}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(c){var f;if(typeof n.state[c]>"u"||n.state[c]==="auto")return"auto";if(n.propsSize&&n.propsSize[c]&&(!((f=n.propsSize[c])===null||f===void 0)&&f.toString().endsWith("%"))){if(n.state[c].toString().endsWith("%"))return n.state[c].toString();var p=n.getParentSize(),h=Number(n.state[c].toString().replace("px","")),y=h/p[c]*100;return y+"%"}return Qd(n.state[c])},a=r&&typeof r.width<"u"&&!this.state.isResizing?Qd(r.width):o("width"),l=r&&typeof r.height<"u"&&!this.state.isResizing?Qd(r.height):o("height");return{width:a,height:l}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var a={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),a},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,a=this.state.direction,l=o&&Do("left",a),c=o&&Do("top",a),f,p;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(f=l?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),p=c?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=l?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=c?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=l?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=c?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n"u"?10:a.width,y=typeof o.width>"u"||o.width<0?n:o.width,m=typeof a.height>"u"?10:a.height,b=typeof o.height>"u"||o.height<0?r:o.height,C=f||0,O=p||0;if(c){var L=(m-C)*this.ratio+O,_=(b-C)*this.ratio+O,v=(h-O)/this.ratio+C,x=(y-O)/this.ratio+C,k=Math.max(h,L),E=Math.min(y,_),R=Math.max(m,v),D=Math.min(b,x);n=ru(n,k,E),r=ru(r,R,D)}else n=ru(n,h,y),r=ru(r,m,b);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var r=this.parentNode;if(r){var o=r.getBoundingClientRect();this.parentLeft=o.left*n,this.parentTop=o.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var a=this.props.bounds.getBoundingClientRect();this.targetLeft=a.left*n,this.targetTop=a.top*n}if(this.resizable){var l=this.resizable.getBoundingClientRect(),c=l.left,f=l.top,p=l.right,h=l.bottom;this.resizableLeft=c*n,this.resizableRight=p*n,this.resizableTop=f*n,this.resizableBottom=h*n}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,a=0;if(n.nativeEvent&&pD(n.nativeEvent)?(o=n.nativeEvent.clientX,a=n.nativeEvent.clientY):n.nativeEvent&&iu(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,a=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var l=this.props.onResizeStart(n,r,this.resizable);if(l===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var c,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var p=this.parentNode;if(p){var h=this.window.getComputedStyle(p).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",c=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var y={original:{x:o,y:a,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:c};this.setState(y)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&iu(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,a=o.maxWidth,l=o.maxHeight,c=o.minWidth,f=o.minHeight,p=iu(n)?n.touches[0].clientX:n.clientX,h=iu(n)?n.touches[0].clientY:n.clientY,y=this.state,m=y.direction,b=y.original,C=y.width,O=y.height,L=this.getParentSize(),_=hD(L,this.window.innerWidth,this.window.innerHeight,a,l,c,f);a=_.maxWidth,l=_.maxHeight,c=_.minWidth,f=_.minHeight;var v=this.calculateNewSizeFromDirection(p,h),x=v.newHeight,k=v.newWidth,E=this.calculateNewMaxFromBoundary(a,l);this.props.snap&&this.props.snap.x&&(k=Uy(k,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=Uy(x,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(k,x,{width:E.maxWidth,height:E.maxHeight},{width:c,height:f});if(k=R.newWidth,x=R.newHeight,this.props.grid){var D=Fy(k,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),P=Fy(x,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),j=this.props.snapGap||0,I=j===0||Math.abs(D-k)<=j?D:k,X=j===0||Math.abs(P-x)<=j?P:x;k=I,x=X}var J={width:k-b.width,height:x-b.height};if(C&&typeof C=="string"){if(C.endsWith("%")){var ie=k/L.width*100;k=ie+"%"}else if(C.endsWith("vw")){var re=k/this.window.innerWidth*100;k=re+"vw"}else if(C.endsWith("vh")){var ae=k/this.window.innerHeight*100;k=ae+"vh"}}if(O&&typeof O=="string"){if(O.endsWith("%")){var ie=x/L.height*100;x=ie+"%"}else if(O.endsWith("vw")){var re=x/this.window.innerWidth*100;x=re+"vw"}else if(O.endsWith("vh")){var ae=x/this.window.innerHeight*100;x=ae+"vh"}}var pe={width:this.createSizeForCssProperty(k,"width"),height:this.createSizeForCssProperty(x,"height")};this.flexDir==="row"?pe.flexBasis=pe.width:this.flexDir==="column"&&(pe.flexBasis=pe.height);var oe=this.state.width!==pe.width,H=this.state.height!==pe.height,z=this.state.flexBasis!==pe.flexBasis,U=oe||H||z;U&&Fa.flushSync(function(){r.setState(pe)}),this.props.onResize&&U&&this.props.onResize(n,m,this.resizable,J)}},t.prototype.onMouseUp=function(n){var r,o,a=this.state,l=a.isResizing,c=a.direction,f=a.original;if(!(!l||!this.resizable)){var p={width:this.size.width-f.width,height:this.size.height-f.height};this.props.onResizeStop&&this.props.onResizeStop(n,c,this.resizable,p),this.props.size&&this.setState({width:(r=this.props.size.width)!==null&&r!==void 0?r:"auto",height:(o=this.props.size.height)!==null&&o!==void 0?o:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var r,o;this.setState({width:(r=n.width)!==null&&r!==void 0?r:"auto",height:(o=n.height)!==null&&o!==void 0?o:"auto"})},t.prototype.renderResizer=function(n){var r=this,o=this.props,a=o.enable,l=o.handleStyles,c=o.handleClasses,f=o.handleWrapperStyle,p=o.handleWrapperClass,h=o.handleComponent;if(!a)return null;var y=n.filter(function(m){return a[m]!==!1}).map(function(m){return a[m]!==!1?B.createElement(cD,{key:m,direction:m,onResizeStart:r.onResizeStart,replaceStyles:l&&l[m],className:c&&c[m]},h&&h[m]?h[m]:null):null});return B.createElement("div",{className:p,style:f},y)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(l,c){return mD.indexOf(c)!==-1||(l[c]=n.props[c]),l},{}),o=xr(xr(xr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var a=this.props.as||"div";return B.createElement(a,xr({style:o,className:this.props.className},r,{ref:function(l){l&&(n.resizable=l)}}),this.state.isResizing&&B.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(B.PureComponent);/*! ***************************************************************************** +`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&LS(e.body,"react-draggable-transparent-selection")}function K$(e){if(e)try{if(e.body&&AS(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function LS(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function AS(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.canDragX=X$;Tr.canDragY=Q$;Tr.createCoreData=q$;Tr.createDraggableData=J$;Tr.getBoundPosition=G$;Tr.getControlPosition=Z$;Tr.snapToGrid=Y$;var En=Er,Jo=ht;function G$(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:eD(r);const o=bg(e);if(typeof r=="string"){const{ownerDocument:a}=o,l=a.defaultView;let c;if(r==="parent"?c=o.parentNode:c=a.querySelector(r),!(c instanceof l.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const f=c,p=l.getComputedStyle(o),h=l.getComputedStyle(f);r={left:-o.offsetLeft+(0,En.int)(h.paddingLeft)+(0,En.int)(p.marginLeft),top:-o.offsetTop+(0,En.int)(h.paddingTop)+(0,En.int)(p.marginTop),right:(0,Jo.innerWidth)(f)-(0,Jo.outerWidth)(o)-o.offsetLeft+(0,En.int)(h.paddingRight)-(0,En.int)(p.marginRight),bottom:(0,Jo.innerHeight)(f)-(0,Jo.outerHeight)(o)-o.offsetTop+(0,En.int)(h.paddingBottom)-(0,En.int)(p.marginBottom)}}return(0,En.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,En.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,En.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,En.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Y$(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function X$(e){return e.props.axis==="both"||e.props.axis==="x"}function Q$(e){return e.props.axis==="both"||e.props.axis==="y"}function Z$(e,t,n){const r=typeof t=="number"?(0,Jo.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=bg(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Jo.offsetXYFromParent)(r||e,a,n.props.scale)}function q$(e,t,n){const r=!(0,En.isNum)(e.lastX),o=bg(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function J$(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function eD(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function bg(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}var Kc={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.default=tD;function tD(){}Object.defineProperty(Kc,"__esModule",{value:!0});Kc.default=void 0;var Yd=rD(B),cn=kg(CS),nD=kg(Fa),Kt=ht,li=Tr,Xd=Er,Gs=kg(Gc);function kg(e){return e&&e.__esModule?e:{default:e}}function $S(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return($S=function(r){return r?n:t})(e)}function rD(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=$S(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function Jt(e,t,n){return t=iD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iD(e){var t=oD(e,"string");return typeof t=="symbol"?t:String(t)}function oD(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const or={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ui=or.mouse,Yc=class extends Yd.Component{constructor(){super(...arguments),Jt(this,"dragging",!1),Jt(this,"lastX",NaN),Jt(this,"lastY",NaN),Jt(this,"touchIdentifier",null),Jt(this,"mounted",!1),Jt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Kt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Kt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Kt.getTouchIdentifier)(t);this.touchIdentifier=o;const a=(0,li.getControlPosition)(t,o,this);if(a==null)return;const{x:l,y:c}=a,f=(0,li.createCoreData)(this,l,c);(0,Gs.default)("DraggableCore: handleDragStart: %j",f),(0,Gs.default)("calling",this.props.onStart),!(this.props.onStart(t,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Kt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=l,this.lastY=c,(0,Kt.addEvent)(r,ui.move,this.handleDrag),(0,Kt.addEvent)(r,ui.stop,this.handleDragStop))}),Jt(this,"handleDrag",t=>{const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,f=o-this.lastY;if([c,f]=(0,li.snapToGrid)(this.props.grid,c,f),!c&&!f)return;r=this.lastX+c,o=this.lastY+f}const a=(0,li.createCoreData)(this,r,o);if((0,Gs.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(f)}return}this.lastX=r,this.lastY=o}),Jt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,p=o-this.lastY||0;[f,p]=(0,li.snapToGrid)(this.props.grid,f,p),r=this.lastX+f,o=this.lastY+p}const a=(0,li.createCoreData)(this,r,o);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,Kt.removeUserSelectStyles)(c.ownerDocument),(0,Gs.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,Gs.default)("DraggableCore: Removing handlers"),(0,Kt.removeEvent)(c.ownerDocument,ui.move,this.handleDrag),(0,Kt.removeEvent)(c.ownerDocument,ui.stop,this.handleDragStop))}),Jt(this,"onMouseDown",t=>(ui=or.mouse,this.handleDragStart(t))),Jt(this,"onMouseUp",t=>(ui=or.mouse,this.handleDragStop(t))),Jt(this,"onTouchStart",t=>(ui=or.touch,this.handleDragStart(t))),Jt(this,"onTouchEnd",t=>(ui=or.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Kt.addEvent)(t,or.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Kt.removeEvent)(n,or.mouse.move,this.handleDrag),(0,Kt.removeEvent)(n,or.touch.move,this.handleDrag),(0,Kt.removeEvent)(n,or.mouse.stop,this.handleDragStop),(0,Kt.removeEvent)(n,or.touch.stop,this.handleDragStop),(0,Kt.removeEvent)(t,or.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Kt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:nD.default.findDOMNode(this)}render(){return Yd.cloneElement(Yd.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Kc.default=Yc;Jt(Yc,"displayName","DraggableCore");Jt(Yc,"propTypes",{allowAnyClick:cn.default.bool,children:cn.default.node.isRequired,disabled:cn.default.bool,enableUserSelectHack:cn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:cn.default.arrayOf(cn.default.number),handle:cn.default.string,cancel:cn.default.string,nodeRef:cn.default.object,onStart:cn.default.func,onDrag:cn.default.func,onStop:cn.default.func,onMouseDown:cn.default.func,scale:cn.default.number,className:Xd.dontSetMe,style:Xd.dontSetMe,transform:Xd.dontSetMe});Jt(Yc,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var t=m(B),n=h(CS),r=h(Fa),o=h(k$),a=ht,l=Tr,c=Er,f=h(Kc),p=h(Gc);function h(v){return v&&v.__esModule?v:{default:v}}function y(v){if(typeof WeakMap!="function")return null;var x=new WeakMap,k=new WeakMap;return(y=function(E){return E?k:x})(v)}function m(v,x){if(!x&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var k=y(x);if(k&&k.has(v))return k.get(v);var E={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in v)if(D!=="default"&&Object.prototype.hasOwnProperty.call(v,D)){var P=R?Object.getOwnPropertyDescriptor(v,D):null;P&&(P.get||P.set)?Object.defineProperty(E,D,P):E[D]=v[D]}return E.default=v,k&&k.set(v,E),E}function b(){return b=Object.assign?Object.assign.bind():function(v){for(var x=1;x{if((0,p.default)("Draggable: onDragStart: %j",E),this.props.onStart(k,(0,l.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(k,E)=>{if(!this.state.dragging)return!1;(0,p.default)("Draggable: onDrag: %j",E);const R=(0,l.createDraggableData)(this,E),D={x:R.x,y:R.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:I}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[X,J]=(0,l.getBoundPosition)(this,D.x,D.y);D.x=X,D.y=J,D.slackX=this.state.slackX+(j-D.x),D.slackY=this.state.slackY+(I-D.y),R.x=D.x,R.y=D.y,R.deltaX=D.x-this.state.x,R.deltaY=D.y-this.state.y}if(this.props.onDrag(k,R)===!1)return!1;this.setState(D)}),C(this,"onDragStop",(k,E)=>{if(!this.state.dragging||this.props.onStop(k,(0,l.createDraggableData)(this,E))===!1)return!1;(0,p.default)("Draggable: onDragStop: %j",E);const D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:I}=this.props.position;D.x=j,D.y=I}this.setState(D)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,k;return(x=(k=this.props)===null||k===void 0||(k=k.nodeRef)===null||k===void 0?void 0:k.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:k,children:E,defaultPosition:R,defaultClassName:D,defaultClassNameDragging:P,defaultClassNameDragged:j,position:I,positionOffset:X,scale:J,...ie}=this.props;let re={},ae=null;const oe=!!!I||this.state.dragging,H=I||R,z={x:(0,l.canDragX)(this)&&oe?this.state.x:H.x,y:(0,l.canDragY)(this)&&oe?this.state.y:H.y};this.state.isElementSVG?ae=(0,a.createSVGTransform)(z,X):re=(0,a.createCSSTransform)(z,X);const U=(0,o.default)(E.props.className||"",D,{[P]:this.state.dragging,[j]:this.state.dragged});return t.createElement(f.default,b({},ie,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:U,style:{...E.props.style,...re},transform:ae}))}}e.default=_,C(_,"displayName","Draggable"),C(_,"propTypes",{...f.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),C(_,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(SS);const{default:DS,DraggableCore:sD}=SS;Vc.exports=DS;Vc.exports.default=DS;Vc.exports.DraggableCore=sD;var aD=Vc.exports;const lD=ac(aD);var uD=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=globalThis&&globalThis.__assign||function(){return xt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof a>"u"?void 0:Number(a),minHeight:typeof l>"u"?void 0:Number(l)}},mD=function(e){return Array.isArray(e)?e:[e,e]},vD=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],jy="__resizable_base__",yD=function(e){dD(t,e);function t(n){var r,o,a,l,c=e.call(this,n)||this;return c.ratio=1,c.resizable=null,c.parentLeft=0,c.parentTop=0,c.resizableLeft=0,c.resizableRight=0,c.resizableTop=0,c.resizableBottom=0,c.targetLeft=0,c.targetTop=0,c.appendBase=function(){if(!c.resizable||!c.window)return null;var f=c.parentNode;if(!f)return null;var p=c.window.document.createElement("div");return p.style.width="100%",p.style.height="100%",p.style.position="absolute",p.style.transform="scale(0, 0)",p.style.left="0",p.style.flex="0 0 100%",p.classList?p.classList.add(jy):p.className+=jy,f.appendChild(p),p},c.removeBase=function(f){var p=c.parentNode;p&&p.removeChild(f)},c.state={isResizing:!1,width:(o=(r=c.propsSize)===null||r===void 0?void 0:r.width)!==null&&o!==void 0?o:"auto",height:(l=(a=c.propsSize)===null||a===void 0?void 0:a.height)!==null&&l!==void 0?l:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},c.onResizeStart=c.onResizeStart.bind(c),c.onMouseMove=c.onMouseMove.bind(c),c.onMouseUp=c.onMouseUp.bind(c),c}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||pD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,a=this.resizable.offsetHeight,l=this.resizable.style.position;l!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:a,this.resizable.style.position=l}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(c){var f;if(typeof n.state[c]>"u"||n.state[c]==="auto")return"auto";if(n.propsSize&&n.propsSize[c]&&(!((f=n.propsSize[c])===null||f===void 0)&&f.toString().endsWith("%"))){if(n.state[c].toString().endsWith("%"))return n.state[c].toString();var p=n.getParentSize(),h=Number(n.state[c].toString().replace("px","")),y=h/p[c]*100;return y+"%"}return Qd(n.state[c])},a=r&&typeof r.width<"u"&&!this.state.isResizing?Qd(r.width):o("width"),l=r&&typeof r.height<"u"&&!this.state.isResizing?Qd(r.height):o("height");return{width:a,height:l}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var a={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),a},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,a=this.state.direction,l=o&&Do("left",a),c=o&&Do("top",a),f,p;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(f=l?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),p=c?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=l?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=c?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=l?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=c?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n"u"?10:a.width,y=typeof o.width>"u"||o.width<0?n:o.width,m=typeof a.height>"u"?10:a.height,b=typeof o.height>"u"||o.height<0?r:o.height,C=f||0,O=p||0;if(c){var A=(m-C)*this.ratio+O,_=(b-C)*this.ratio+O,v=(h-O)/this.ratio+C,x=(y-O)/this.ratio+C,k=Math.max(h,A),E=Math.min(y,_),R=Math.max(m,v),D=Math.min(b,x);n=ru(n,k,E),r=ru(r,R,D)}else n=ru(n,h,y),r=ru(r,m,b);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var r=this.parentNode;if(r){var o=r.getBoundingClientRect();this.parentLeft=o.left*n,this.parentTop=o.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var a=this.props.bounds.getBoundingClientRect();this.targetLeft=a.left*n,this.targetTop=a.top*n}if(this.resizable){var l=this.resizable.getBoundingClientRect(),c=l.left,f=l.top,p=l.right,h=l.bottom;this.resizableLeft=c*n,this.resizableRight=p*n,this.resizableTop=f*n,this.resizableBottom=h*n}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,a=0;if(n.nativeEvent&&hD(n.nativeEvent)?(o=n.nativeEvent.clientX,a=n.nativeEvent.clientY):n.nativeEvent&&iu(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,a=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var l=this.props.onResizeStart(n,r,this.resizable);if(l===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var c,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var p=this.parentNode;if(p){var h=this.window.getComputedStyle(p).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",c=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var y={original:{x:o,y:a,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:c};this.setState(y)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&iu(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,a=o.maxWidth,l=o.maxHeight,c=o.minWidth,f=o.minHeight,p=iu(n)?n.touches[0].clientX:n.clientX,h=iu(n)?n.touches[0].clientY:n.clientY,y=this.state,m=y.direction,b=y.original,C=y.width,O=y.height,A=this.getParentSize(),_=gD(A,this.window.innerWidth,this.window.innerHeight,a,l,c,f);a=_.maxWidth,l=_.maxHeight,c=_.minWidth,f=_.minHeight;var v=this.calculateNewSizeFromDirection(p,h),x=v.newHeight,k=v.newWidth,E=this.calculateNewMaxFromBoundary(a,l);this.props.snap&&this.props.snap.x&&(k=Uy(k,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=Uy(x,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(k,x,{width:E.maxWidth,height:E.maxHeight},{width:c,height:f});if(k=R.newWidth,x=R.newHeight,this.props.grid){var D=Fy(k,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),P=Fy(x,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),j=this.props.snapGap||0,I=j===0||Math.abs(D-k)<=j?D:k,X=j===0||Math.abs(P-x)<=j?P:x;k=I,x=X}var J={width:k-b.width,height:x-b.height};if(C&&typeof C=="string"){if(C.endsWith("%")){var ie=k/A.width*100;k=ie+"%"}else if(C.endsWith("vw")){var re=k/this.window.innerWidth*100;k=re+"vw"}else if(C.endsWith("vh")){var ae=k/this.window.innerHeight*100;k=ae+"vh"}}if(O&&typeof O=="string"){if(O.endsWith("%")){var ie=x/A.height*100;x=ie+"%"}else if(O.endsWith("vw")){var re=x/this.window.innerWidth*100;x=re+"vw"}else if(O.endsWith("vh")){var ae=x/this.window.innerHeight*100;x=ae+"vh"}}var pe={width:this.createSizeForCssProperty(k,"width"),height:this.createSizeForCssProperty(x,"height")};this.flexDir==="row"?pe.flexBasis=pe.width:this.flexDir==="column"&&(pe.flexBasis=pe.height);var oe=this.state.width!==pe.width,H=this.state.height!==pe.height,z=this.state.flexBasis!==pe.flexBasis,U=oe||H||z;U&&Fa.flushSync(function(){r.setState(pe)}),this.props.onResize&&U&&this.props.onResize(n,m,this.resizable,J)}},t.prototype.onMouseUp=function(n){var r,o,a=this.state,l=a.isResizing,c=a.direction,f=a.original;if(!(!l||!this.resizable)){var p={width:this.size.width-f.width,height:this.size.height-f.height};this.props.onResizeStop&&this.props.onResizeStop(n,c,this.resizable,p),this.props.size&&this.setState({width:(r=this.props.size.width)!==null&&r!==void 0?r:"auto",height:(o=this.props.size.height)!==null&&o!==void 0?o:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var r,o;this.setState({width:(r=n.width)!==null&&r!==void 0?r:"auto",height:(o=n.height)!==null&&o!==void 0?o:"auto"})},t.prototype.renderResizer=function(n){var r=this,o=this.props,a=o.enable,l=o.handleStyles,c=o.handleClasses,f=o.handleWrapperStyle,p=o.handleWrapperClass,h=o.handleComponent;if(!a)return null;var y=n.filter(function(m){return a[m]!==!1}).map(function(m){return a[m]!==!1?B.createElement(fD,{key:m,direction:m,onResizeStart:r.onResizeStart,replaceStyles:l&&l[m],className:c&&c[m]},h&&h[m]?h[m]:null):null});return B.createElement("div",{className:p,style:f},y)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(l,c){return vD.indexOf(c)!==-1||(l[c]=n.props[c]),l},{}),o=xr(xr(xr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var a=this.props.as||"div";return B.createElement(a,xr({style:o,className:this.props.className},r,{ref:function(l){l&&(n.resizable=l)}}),this.state.isResizing&&B.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(B.PureComponent);/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the @@ -97,7 +97,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */var fh=function(e,t){return fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},fh(e,t)};function yD(e,t){fh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rt=function(){return Rt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,r=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:n,maxHeight:r}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/r;case"body":return document.body.offsetHeight/r;default:return n.offsetHeight}},t.prototype.getOffsetWidth=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/r;case"body":return document.body.offsetWidth/r;default:return n.offsetWidth}},t.prototype.onDragStart=function(n,r){this.props.onDragStart&&this.props.onDragStart(n,r);var o=this.getDraggablePosition();if(this.originalPosition=o,!!this.props.bounds){var a=this.getParent(),l=this.props.scale,c;if(this.props.bounds==="parent")c=a;else if(this.props.bounds==="body"){var f=a.getBoundingClientRect(),p=f.left,h=f.top,y=document.body.getBoundingClientRect(),m=-(p-a.offsetLeft*l-y.left)/l,b=-(h-a.offsetTop*l-y.top)/l,C=(document.body.offsetWidth-this.resizable.size.width*l)/l+m,O=(document.body.offsetHeight-this.resizable.size.height*l)/l+b;return this.setState({bounds:{top:b,right:C,bottom:O,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var L=a.getBoundingClientRect(),_=L.left,v=L.top,x=-(_-a.offsetLeft*l)/l,k=-(v-a.offsetTop*l)/l,C=(window.innerWidth-this.resizable.size.width*l)/l+x,O=(window.innerHeight-this.resizable.size.height*l)/l+k;return this.setState({bounds:{top:k,right:C,bottom:O,left:x}})}else typeof this.props.bounds=="string"?c=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(c=this.props.bounds);if(!(!(c instanceof HTMLElement)||!(a instanceof HTMLElement))){var E=c.getBoundingClientRect(),R=E.left,D=E.top,P=a.getBoundingClientRect(),j=P.left,I=P.top,X=(R-j)/l,J=D-I;if(this.resizable){this.updateOffsetFromParent();var ie=this.offsetFromParent;this.setState({bounds:{top:J-ie.top,right:X+(c.offsetWidth-this.resizable.size.width)-ie.left/l,bottom:J+(c.offsetHeight-this.resizable.size.height)-ie.top,left:X-ie.left/l}})}}}},t.prototype.onDrag=function(n,r){if(this.props.onDrag){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(n,Rt(Rt({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDrag(n,Rt(Rt({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(n,Rt(Rt({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onDragStop=function(n,r){if(this.props.onDragStop){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(n,Rt(Rt({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDragStop(n,Rt(Rt({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(n,Rt(Rt({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onResizeStart=function(n,r,o){n.stopPropagation(),this.setState({resizing:!0});var a=this.props.scale,l=this.offsetFromParent,c=this.getDraggablePosition();if(this.resizingPosition={x:c.x+l.left,y:c.y+l.top},this.originalPosition=c,this.props.bounds){var f=this.getParent(),p=void 0;this.props.bounds==="parent"?p=f:this.props.bounds==="body"?p=document.body:this.props.bounds==="window"?p=window:typeof this.props.bounds=="string"?p=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(p=this.props.bounds);var h=this.getSelfElement();if(h instanceof Element&&(p instanceof HTMLElement||p===window)&&f instanceof HTMLElement){var y=this.getMaxSizesFromProps(),m=y.maxWidth,b=y.maxHeight,C=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var O=Number(m.replace("%",""))/100;m=C.width*O}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(b&&typeof b=="string")if(b.endsWith("%")){var O=Number(b.replace("%",""))/100;b=C.height*O}else b.endsWith("px")&&(b=Number(b.replace("px","")));var L=h.getBoundingClientRect(),_=L.left,v=L.top,x=this.props.bounds==="window"?{left:0,top:0}:p.getBoundingClientRect(),k=x.left,E=x.top,R=this.getOffsetWidth(p),D=this.getOffsetHeight(p),P=r.toLowerCase().endsWith("left"),j=r.toLowerCase().endsWith("right"),I=r.startsWith("top"),X=r.startsWith("bottom");if((P||I)&&this.resizable){var J=(_-k)/a+this.resizable.size.width;this.setState({maxWidth:J>Number(m)?m:J})}if(j||this.props.lockAspectRatio&&!P&&!I){var J=R+(k-_)/a;this.setState({maxWidth:J>Number(m)?m:J})}if((I||P)&&this.resizable){var J=(v-E)/a+this.resizable.size.height;this.setState({maxHeight:J>Number(b)?b:J})}if(X||this.props.lockAspectRatio&&!I&&!P){var J=D+(E-v)/a;this.setState({maxHeight:J>Number(b)?b:J})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(n,r,o)},t.prototype.onResize=function(n,r,o,a){var l=this,c={x:this.originalPosition.x,y:this.originalPosition.y},f=-a.width,p=-a.height,h=["top","left","topLeft","bottomLeft","topRight"];h.includes(r)&&(r==="bottomLeft"?c.x+=f:(r==="topRight"||(c.x+=f),c.y+=p));var y=this.draggable.state;(c.x!==y.x||c.y!==y.y)&&Fa.flushSync(function(){l.draggable.setState(c)}),this.updateOffsetFromParent();var m=this.offsetFromParent,b=this.getDraggablePosition().x+m.left,C=this.getDraggablePosition().y+m.top;this.resizingPosition={x:b,y:C},this.props.onResize&&this.props.onResize(n,r,o,a,{x:b,y:C})},t.prototype.onResizeStop=function(n,r,o,a){this.setState({resizing:!1});var l=this.getMaxSizesFromProps(),c=l.maxWidth,f=l.maxHeight;this.setState({maxWidth:c,maxHeight:f}),this.props.onResizeStop&&this.props.onResizeStop(n,r,o,a,this.resizingPosition)},t.prototype.updateSize=function(n){this.resizable&&this.resizable.updateSize({width:n.width,height:n.height})},t.prototype.updatePosition=function(n){this.draggable.setState(n)},t.prototype.updateOffsetFromParent=function(){var n=this.props.scale,r=this.getParent(),o=this.getSelfElement();if(!r||o===null)return{top:0,left:0};var a=r.getBoundingClientRect(),l=a.left,c=a.top,f=o.getBoundingClientRect(),p=this.getDraggablePosition(),h=r.scrollLeft,y=r.scrollTop;this.offsetFromParent={left:f.left-l+h-p.x*n,top:f.top-c+y-p.y*n}},t.prototype.render=function(){var n=this,r=this.props,o=r.disableDragging,a=r.style,l=r.dragHandleClassName,c=r.position,f=r.onMouseDown,p=r.onMouseUp,h=r.dragAxis,y=r.dragGrid,m=r.bounds,b=r.enableUserSelectHack,C=r.cancel,O=r.children;r.onResizeStart,r.onResize,r.onResizeStop,r.onDragStart,r.onDrag,r.onDragStop;var L=r.resizeHandleStyles,_=r.resizeHandleClasses,v=r.resizeHandleComponent,x=r.enableResizing,k=r.resizeGrid,E=r.resizeHandleWrapperClass,R=r.resizeHandleWrapperStyle,D=r.scale,P=r.allowAnyClick,j=wD(r,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick"]),I=this.props.default?Rt({},this.props.default):void 0;delete j.default;var X=o||l?{cursor:"auto"}:{cursor:"move"},J=Rt(Rt(Rt({},xD),X),a),ie=this.offsetFromParent,re=ie.left,ae=ie.top,pe;c&&(pe={x:c.x-re,y:c.y-ae});var oe=this.state.resizing?void 0:pe,H=this.state.resizing?"both":h;return B.createElement(aD,{ref:function(z){z&&(n.draggable=z)},handle:l?".".concat(l):void 0,defaultPosition:I,onMouseDown:f,onMouseUp:p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:H,disabled:o,grid:y,bounds:m?this.state.bounds:void 0,position:oe,enableUserSelectHack:b,cancel:C,scale:D,allowAnyClick:P,nodeRef:this.resizableElement},B.createElement(vD,Rt({},j,{ref:function(z){z&&(n.resizable=z,n.resizableElement.current=z.resizable)},defaultSize:I,size:this.props.size,enable:typeof x=="boolean"?SD(x):x,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:J,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:k,handleWrapperClass:E,handleWrapperStyle:R,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:L,handleClasses:_,handleComponent:v,scale:this.props.scale}),O))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(B.PureComponent);const ge={white:"#ffffff",black:"#000000",primary:"#BA2626",primaryLight:"#f08080",secondary:"#8A0000",secondaryLight:"#ff6b6b",tertiary:"#DD0003",tertiaryLight:"#ff9999",quaternary:"#ff8000",quaternaryLight:"#ffb36b",desactivat:"#c6c6c6",desactivatLight:"#e5e5e5",background:"#f8f8f8",secondaryBackground:"#ffffff",border:"#c7c5c5",accent:"#3d3df7",accentLight:"#6a6af8",text:"#333333",timeline:"#ffe8cc",disabled:"#999999"},yn={fontFamily:"Open Sans,Helvetica,Arial,sans-serif",fontSize:{small:"12px",medium:"14px",large:"16px"}},vt=le.button` +***************************************************************************** */var fh=function(e,t){return fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},fh(e,t)};function wD(e,t){fh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rt=function(){return Rt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,r=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:n,maxHeight:r}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/r;case"body":return document.body.offsetHeight/r;default:return n.offsetHeight}},t.prototype.getOffsetWidth=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/r;case"body":return document.body.offsetWidth/r;default:return n.offsetWidth}},t.prototype.onDragStart=function(n,r){this.props.onDragStart&&this.props.onDragStart(n,r);var o=this.getDraggablePosition();if(this.originalPosition=o,!!this.props.bounds){var a=this.getParent(),l=this.props.scale,c;if(this.props.bounds==="parent")c=a;else if(this.props.bounds==="body"){var f=a.getBoundingClientRect(),p=f.left,h=f.top,y=document.body.getBoundingClientRect(),m=-(p-a.offsetLeft*l-y.left)/l,b=-(h-a.offsetTop*l-y.top)/l,C=(document.body.offsetWidth-this.resizable.size.width*l)/l+m,O=(document.body.offsetHeight-this.resizable.size.height*l)/l+b;return this.setState({bounds:{top:b,right:C,bottom:O,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var A=a.getBoundingClientRect(),_=A.left,v=A.top,x=-(_-a.offsetLeft*l)/l,k=-(v-a.offsetTop*l)/l,C=(window.innerWidth-this.resizable.size.width*l)/l+x,O=(window.innerHeight-this.resizable.size.height*l)/l+k;return this.setState({bounds:{top:k,right:C,bottom:O,left:x}})}else typeof this.props.bounds=="string"?c=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(c=this.props.bounds);if(!(!(c instanceof HTMLElement)||!(a instanceof HTMLElement))){var E=c.getBoundingClientRect(),R=E.left,D=E.top,P=a.getBoundingClientRect(),j=P.left,I=P.top,X=(R-j)/l,J=D-I;if(this.resizable){this.updateOffsetFromParent();var ie=this.offsetFromParent;this.setState({bounds:{top:J-ie.top,right:X+(c.offsetWidth-this.resizable.size.width)-ie.left/l,bottom:J+(c.offsetHeight-this.resizable.size.height)-ie.top,left:X-ie.left/l}})}}}},t.prototype.onDrag=function(n,r){if(this.props.onDrag){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(n,Rt(Rt({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDrag(n,Rt(Rt({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(n,Rt(Rt({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onDragStop=function(n,r){if(this.props.onDragStop){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(n,Rt(Rt({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDragStop(n,Rt(Rt({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(n,Rt(Rt({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onResizeStart=function(n,r,o){n.stopPropagation(),this.setState({resizing:!0});var a=this.props.scale,l=this.offsetFromParent,c=this.getDraggablePosition();if(this.resizingPosition={x:c.x+l.left,y:c.y+l.top},this.originalPosition=c,this.props.bounds){var f=this.getParent(),p=void 0;this.props.bounds==="parent"?p=f:this.props.bounds==="body"?p=document.body:this.props.bounds==="window"?p=window:typeof this.props.bounds=="string"?p=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(p=this.props.bounds);var h=this.getSelfElement();if(h instanceof Element&&(p instanceof HTMLElement||p===window)&&f instanceof HTMLElement){var y=this.getMaxSizesFromProps(),m=y.maxWidth,b=y.maxHeight,C=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var O=Number(m.replace("%",""))/100;m=C.width*O}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(b&&typeof b=="string")if(b.endsWith("%")){var O=Number(b.replace("%",""))/100;b=C.height*O}else b.endsWith("px")&&(b=Number(b.replace("px","")));var A=h.getBoundingClientRect(),_=A.left,v=A.top,x=this.props.bounds==="window"?{left:0,top:0}:p.getBoundingClientRect(),k=x.left,E=x.top,R=this.getOffsetWidth(p),D=this.getOffsetHeight(p),P=r.toLowerCase().endsWith("left"),j=r.toLowerCase().endsWith("right"),I=r.startsWith("top"),X=r.startsWith("bottom");if((P||I)&&this.resizable){var J=(_-k)/a+this.resizable.size.width;this.setState({maxWidth:J>Number(m)?m:J})}if(j||this.props.lockAspectRatio&&!P&&!I){var J=R+(k-_)/a;this.setState({maxWidth:J>Number(m)?m:J})}if((I||P)&&this.resizable){var J=(v-E)/a+this.resizable.size.height;this.setState({maxHeight:J>Number(b)?b:J})}if(X||this.props.lockAspectRatio&&!I&&!P){var J=D+(E-v)/a;this.setState({maxHeight:J>Number(b)?b:J})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(n,r,o)},t.prototype.onResize=function(n,r,o,a){var l=this,c={x:this.originalPosition.x,y:this.originalPosition.y},f=-a.width,p=-a.height,h=["top","left","topLeft","bottomLeft","topRight"];h.includes(r)&&(r==="bottomLeft"?c.x+=f:(r==="topRight"||(c.x+=f),c.y+=p));var y=this.draggable.state;(c.x!==y.x||c.y!==y.y)&&Fa.flushSync(function(){l.draggable.setState(c)}),this.updateOffsetFromParent();var m=this.offsetFromParent,b=this.getDraggablePosition().x+m.left,C=this.getDraggablePosition().y+m.top;this.resizingPosition={x:b,y:C},this.props.onResize&&this.props.onResize(n,r,o,a,{x:b,y:C})},t.prototype.onResizeStop=function(n,r,o,a){this.setState({resizing:!1});var l=this.getMaxSizesFromProps(),c=l.maxWidth,f=l.maxHeight;this.setState({maxWidth:c,maxHeight:f}),this.props.onResizeStop&&this.props.onResizeStop(n,r,o,a,this.resizingPosition)},t.prototype.updateSize=function(n){this.resizable&&this.resizable.updateSize({width:n.width,height:n.height})},t.prototype.updatePosition=function(n){this.draggable.setState(n)},t.prototype.updateOffsetFromParent=function(){var n=this.props.scale,r=this.getParent(),o=this.getSelfElement();if(!r||o===null)return{top:0,left:0};var a=r.getBoundingClientRect(),l=a.left,c=a.top,f=o.getBoundingClientRect(),p=this.getDraggablePosition(),h=r.scrollLeft,y=r.scrollTop;this.offsetFromParent={left:f.left-l+h-p.x*n,top:f.top-c+y-p.y*n}},t.prototype.render=function(){var n=this,r=this.props,o=r.disableDragging,a=r.style,l=r.dragHandleClassName,c=r.position,f=r.onMouseDown,p=r.onMouseUp,h=r.dragAxis,y=r.dragGrid,m=r.bounds,b=r.enableUserSelectHack,C=r.cancel,O=r.children;r.onResizeStart,r.onResize,r.onResizeStop,r.onDragStart,r.onDrag,r.onDragStop;var A=r.resizeHandleStyles,_=r.resizeHandleClasses,v=r.resizeHandleComponent,x=r.enableResizing,k=r.resizeGrid,E=r.resizeHandleWrapperClass,R=r.resizeHandleWrapperStyle,D=r.scale,P=r.allowAnyClick,j=xD(r,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick"]),I=this.props.default?Rt({},this.props.default):void 0;delete j.default;var X=o||l?{cursor:"auto"}:{cursor:"move"},J=Rt(Rt(Rt({},SD),X),a),ie=this.offsetFromParent,re=ie.left,ae=ie.top,pe;c&&(pe={x:c.x-re,y:c.y-ae});var oe=this.state.resizing?void 0:pe,H=this.state.resizing?"both":h;return B.createElement(lD,{ref:function(z){z&&(n.draggable=z)},handle:l?".".concat(l):void 0,defaultPosition:I,onMouseDown:f,onMouseUp:p,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:H,disabled:o,grid:y,bounds:m?this.state.bounds:void 0,position:oe,enableUserSelectHack:b,cancel:C,scale:D,allowAnyClick:P,nodeRef:this.resizableElement},B.createElement(yD,Rt({},j,{ref:function(z){z&&(n.resizable=z,n.resizableElement.current=z.resizable)},defaultSize:I,size:this.props.size,enable:typeof x=="boolean"?_D(x):x,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:J,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:k,handleWrapperClass:E,handleWrapperStyle:R,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:A,handleClasses:_,handleComponent:v,scale:this.props.scale}),O))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(B.PureComponent);const ge={white:"#ffffff",black:"#000000",primary:"#BA2626",primaryLight:"#f08080",secondary:"#8A0000",secondaryLight:"#ff6b6b",tertiary:"#DD0003",tertiaryLight:"#ff9999",quaternary:"#ff8000",quaternaryLight:"#ffb36b",desactivat:"#c6c6c6",desactivatLight:"#e5e5e5",background:"#f8f8f8",secondaryBackground:"#ffffff",border:"#c7c5c5",accent:"#3d3df7",accentLight:"#6a6af8",text:"#333333",timeline:"#ffe8cc",disabled:"#999999"},yn={fontFamily:"Open Sans,Helvetica,Arial,sans-serif",fontSize:{small:"12px",medium:"14px",large:"16px"}},vt=le.button` background-color: ${ge.primary}; color: ${ge.white}; border: none; @@ -127,7 +127,7 @@ and limitations under the License. font-size: ${yn.fontSize.medium}; color: ${ge.text}; background-color: ${ge.white}; -`,bD=le.select` +`,kD=le.select` width: 100%; padding: 10px; margin-bottom: 10px; @@ -159,7 +159,7 @@ and limitations under the License. align-items: center; justify-content: center; z-index: 1000; -`,kD=le.div` +`,CD=le.div` background-color: ${ge.background}; padding: 20px; border-radius: 5px; @@ -192,10 +192,10 @@ and limitations under the License. `,ph=le.p` margin: 0 0 20px 0; line-height: 1.5; -`,DS=le.p` +`,IS=le.p` color: ${ge.tertiary}; margin: 0 0 20px 0; -`,IS=le.pre` +`,NS=le.pre` background-color: #ffebee; // Light red background border: 1px solid ${ge.tertiary}; border-radius: 4px; @@ -208,7 +208,7 @@ and limitations under the License. word-wrap: break-word; max-height: 200px; overflow-y: auto; -`;var zt=[];for(var Jd=0;Jd<256;++Jd)zt.push((Jd+256).toString(16).slice(1));function CD(e,t=0){return(zt[e[t+0]]+zt[e[t+1]]+zt[e[t+2]]+zt[e[t+3]]+"-"+zt[e[t+4]]+zt[e[t+5]]+"-"+zt[e[t+6]]+zt[e[t+7]]+"-"+zt[e[t+8]]+zt[e[t+9]]+"-"+zt[e[t+10]]+zt[e[t+11]]+zt[e[t+12]]+zt[e[t+13]]+zt[e[t+14]]+zt[e[t+15]]).toLowerCase()}var su,ED=new Uint8Array(16);function TD(){if(!su&&(su=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!su))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return su(ED)}var RD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const By={randomUUID:RD};function Wy(e,t,n){if(By.randomUUID&&!t&&!e)return By.randomUUID();e=e||{};var r=e.random||(e.rng||TD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return CD(r)}const PD="https://api.softcatala.org/dubbing-service/v1";class OD{constructor(){this.providerName="matxa",this.voiceList=[{name:"quim-balear",id:"0",gender:"male",language:"cat",region:"balear",label:"Home - Balear (Quim)",provider:this.providerName},{name:"olga-balear",id:"1",gender:"female",language:"cat",region:"balear",label:"Dona - Balear (Olga)",provider:this.providerName},{name:"grau-central",id:"2",gender:"male",language:"cat",region:"central",label:"Home - Central (Grau)",provider:this.providerName},{name:"elia-central",id:"3",gender:"female",language:"cat",region:"central",label:"Dona - Central (Èlia)",provider:this.providerName},{name:"pere-nord",id:"4",gender:"male",language:"cat",region:"nord",label:"Home - Nord-occidental (Pere)",provider:this.providerName},{name:"emma-nord",id:"5",gender:"female",language:"cat",region:"nord",label:"Dona - Nord-occidental (Emma)",provider:this.providerName},{name:"lluc-valencia",id:"6",gender:"male",language:"cat",region:"valencia",label:"Home - Valencià (Lluc)",provider:this.providerName},{name:"gina-valencia",id:"7",gender:"female",language:"cat",region:"valencia",label:"Dona - Valencià (Gina)",provider:this.providerName}]}async voices(){return this.voiceList}async speak(t,n){const r=`${PD}/speak/?text=${encodeURIComponent(t)}&voice=${n.id}`;try{const o=await fetch(r);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.arrayBuffer()}catch(o){throw console.error("Error generating speech:",o),o}}getVoice(t){return this.voiceList.find(n=>n.id===t)||this.voiceList[0]}getProviderName(){return this.providerName}}const Aa=new OD,ep=()=>"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");class AD{constructor(){this.speakers=[]}setSpeakers(t){this.speakers=t.map(n=>({id:n.id||Wy(),name:n.name||"",voice:n.voice||Aa.getVoice("0"),color:n.color||ep()})).sort((n,r)=>n.name.localeCompare(r.name))}setSpeaker(t){this.speakers.find(n=>n.id===t.id)?this.updateSpeaker(t.id,t):this.speakers.push({id:t.id,name:t.name||"",voice:t.voice||Aa.getVoice("0"),color:t.color||ep()})}getSpeakers(){return this.speakers}addSpeaker(t,n,r=ep()){this.speakers.push({id:Wy(),name:t,voice:n,color:r})}updateSpeaker(t,n){const r=this.speakers.findIndex(o=>o.id===t);r!==-1&&(this.speakers[r]={...this.speakers[r],...n})}getSpeakerById(t){return this.speakers.find(n=>n.id===t)||this.speakers[0]}sortSpeakers(){this.speakers.sort((t,n)=>t.name.localeCompare(n.name))}}const Ot=new AD,LD=le.div` +`;var zt=[];for(var Jd=0;Jd<256;++Jd)zt.push((Jd+256).toString(16).slice(1));function ED(e,t=0){return(zt[e[t+0]]+zt[e[t+1]]+zt[e[t+2]]+zt[e[t+3]]+"-"+zt[e[t+4]]+zt[e[t+5]]+"-"+zt[e[t+6]]+zt[e[t+7]]+"-"+zt[e[t+8]]+zt[e[t+9]]+"-"+zt[e[t+10]]+zt[e[t+11]]+zt[e[t+12]]+zt[e[t+13]]+zt[e[t+14]]+zt[e[t+15]]).toLowerCase()}var su,TD=new Uint8Array(16);function RD(){if(!su&&(su=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!su))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return su(TD)}var PD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const By={randomUUID:PD};function Wy(e,t,n){if(By.randomUUID&&!t&&!e)return By.randomUUID();e=e||{};var r=e.random||(e.rng||RD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return ED(r)}const Hy="https://api.softcatala.org/dubbing-service/v1";class OD{constructor(){this.providerName="matxa",this.defaultVoiceList=[{name:"quim-balear",id:"0",gender:"male",language:"cat",region:"balear",label:"Home - Balear (Quim)",provider:this.providerName},{name:"olga-balear",id:"1",gender:"female",language:"cat",region:"balear",label:"Dona - Balear (Olga)",provider:this.providerName},{name:"grau-central",id:"2",gender:"male",language:"cat",region:"central",label:"Home - Central (Grau)",provider:this.providerName},{name:"elia-central",id:"3",gender:"female",language:"cat",region:"central",label:"Dona - Central (Èlia)",provider:this.providerName},{name:"pere-nord",id:"4",gender:"male",language:"cat",region:"nord",label:"Home - Nord-occidental (Pere)",provider:this.providerName},{name:"emma-nord",id:"5",gender:"female",language:"cat",region:"nord",label:"Dona - Nord-occidental (Emma)",provider:this.providerName},{name:"lluc-valencia",id:"6",gender:"male",language:"cat",region:"valencia",label:"Home - Valencià (Lluc)",provider:this.providerName},{name:"gina-valencia",id:"7",gender:"female",language:"cat",region:"valencia",label:"Dona - Valencià (Gina)",provider:this.providerName}],this.voiceList=[]}async fetchVoices(){try{const t=await fetch(`${Hy}/voices/`);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const n=await t.json();this.voiceList=n.map(r=>({...r,provider:this.providerName,label:this.createVoiceLabel(r)}))}catch(t){console.error("Error fetching voices:",t),this.voiceList=this.defaultVoiceList}}createVoiceLabel(t){const n=t.gender==="male"?"Home":"Dona",r=this.capitalizeFirstLetter(t.region),o=this.capitalizeFirstLetter(t.name.split("-")[0]);return`${n} - ${r} (${o})`}capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}async voices(){return this.voiceList.length===0&&await this.fetchVoices(),this.voiceList}async speak(t,n){const r=`${Hy}/speak/?text=${encodeURIComponent(t)}&voice=${n.id}`;try{const o=await fetch(r);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.arrayBuffer()}catch(o){throw console.error("Error generating speech:",o),o}}async getVoice(t){return this.voiceList.length===0&&await this.fetchVoices(),this.voiceList.find(n=>n.id===t)||this.voiceList[0]}getProviderName(){return this.providerName}}const La=new OD,ep=()=>"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");class LD{constructor(){this.speakers=[]}async setSpeakers(t){this.speakers=await Promise.all(t.map(async n=>({id:n.id||Wy(),name:n.name||"",voice:n.voice||await La.getVoice("0"),color:n.color||ep()}))),this.sortSpeakers()}async setSpeaker(t){this.speakers.find(n=>n.id===t.id)?this.updateSpeaker(t.id,t):this.speakers.push({id:t.id,name:t.name||"",voice:t.voice||await La.getVoice("0"),color:t.color||ep()})}getSpeakers(){return this.speakers}addSpeaker(t,n,r=ep()){this.speakers.push({id:Wy(),name:t,voice:n,color:r})}updateSpeaker(t,n){const r=this.speakers.findIndex(o=>o.id===t);r!==-1&&(this.speakers[r]={...this.speakers[r],...n})}getSpeakerById(t){return this.speakers.find(n=>n.id===t)||this.speakers[0]}sortSpeakers(){this.speakers.sort((t,n)=>t.name.localeCompare(n.name))}}const Ot=new LD,AD=le.div` background-color: ${e=>e.backgroundColor}; color: ${ge.black}; border-radius: 5px; @@ -222,7 +222,7 @@ and limitations under the License. display: flex; align-items: center; font-size: ${yn.fontSize.medium}; -`,$D=({track:e,onChange:t,zoomLevel:n,onEdit:r,isDubbingService:o,showSpeakerColors:a,isMediaFullyLoaded:l})=>{const[c,f]=B.useState(!1),p=B.useRef(null),h=(E,R)=>{p.current={x:E,y:R}},y=(E,R)=>{if(p.current){const D=Math.abs(E-p.current.x),P=Math.abs(R-p.current.y);D<5&&P<5&&!c&&l&&r(e)}p.current=null},m=E=>{h(E.clientX,E.clientY)},b=E=>{y(E.clientX,E.clientY)},C=E=>{const R=E.touches[0];h(R.clientX,R.clientY)},O=E=>{const R=E.changedTouches[0];y(R.clientX,R.clientY)},L=()=>{f(!0)},_=(E,R)=>{const D=Math.max(0,R.x/n),P={...e,start:D,end:D+(e.end-e.start)};console.log("Track dragged:",P),t(P,!0),f(!1)},v=(E,R,D,P,j)=>{let I=e.start,X=e.end;R.includes("left")&&(I=Math.max(0,j.x/n)),R.includes("right")&&(X=Math.max(I+.1,(j.x+D.offsetWidth)/n));const J={...e,start:I,end:X};console.log("Track resized:",J),t(J,!1)},x=Ot.getSpeakerById(e.speaker_id),k=a&&x?x.color:ge.quaternaryLight;return A.jsx(_D,{position:{x:e.start*n,y:0},size:{width:(e.end-e.start)*n,height:30},onDragStart:L,onDragStop:_,onResize:v,dragAxis:"x",bounds:"parent",enableResizing:{left:!0,right:!0},minWidth:10,disabled:!l,children:A.jsx(LD,{backgroundColor:k,onMouseDown:m,onMouseUp:b,onTouchStart:C,onTouchEnd:O,children:o?e.translated_text:e.text})})},DD=le.div` +`,$D=({track:e,onChange:t,zoomLevel:n,onEdit:r,isDubbingService:o,showSpeakerColors:a,isMediaFullyLoaded:l})=>{const[c,f]=B.useState(!1),p=B.useRef(null),h=(E,R)=>{p.current={x:E,y:R}},y=(E,R)=>{if(p.current){const D=Math.abs(E-p.current.x),P=Math.abs(R-p.current.y);D<5&&P<5&&!c&&l&&r(e)}p.current=null},m=E=>{h(E.clientX,E.clientY)},b=E=>{y(E.clientX,E.clientY)},C=E=>{const R=E.touches[0];h(R.clientX,R.clientY)},O=E=>{const R=E.changedTouches[0];y(R.clientX,R.clientY)},A=()=>{f(!0)},_=(E,R)=>{const D=Math.max(0,R.x/n),P={...e,start:D,end:D+(e.end-e.start)};console.log("Track dragged:",P),t(P,!0),f(!1)},v=(E,R,D,P,j)=>{let I=e.start,X=e.end;R.includes("left")&&(I=Math.max(0,j.x/n)),R.includes("right")&&(X=Math.max(I+.1,(j.x+D.offsetWidth)/n));const J={...e,start:I,end:X};console.log("Track resized:",J),t(J,!1)},x=Ot.getSpeakerById(e.speaker_id),k=a&&x?x.color:ge.quaternaryLight;return L.jsx(bD,{position:{x:e.start*n,y:0},size:{width:(e.end-e.start)*n,height:30},onDragStart:A,onDragStop:_,onResize:v,dragAxis:"x",bounds:"parent",enableResizing:{left:!0,right:!0},minWidth:10,disabled:!l,children:L.jsx(AD,{backgroundColor:k,onMouseDown:m,onMouseUp:b,onTouchStart:C,onTouchEnd:O,children:o?e.translated_text:e.text})})},DD=le.div` background-color: ${ge.background}; display: flex; flex-direction: column; @@ -284,18 +284,18 @@ and limitations under the License. border-radius: 50%; `,BD=le(FD)` cursor: pointer; -`,Hy=10,Vy=1,Ky=100,WD=({tracks:e,currentTime:t,onTimeChange:n,onEditTrack:r,isDubbingService:o,onTrackChange:a,showSpeakerColors:l,isMediaFullyLoaded:c=!0})=>{const{t:f}=so(),[p,h]=B.useState(Hy),y=B.useRef(null),m=(R,D,P)=>{a(R,D,P)},b=()=>h(R=>Math.min(R*1.5,Ky)),C=()=>h(R=>Math.max(R/1.5,Vy)),O=()=>h(Hy),L=B.useCallback((R,D)=>{h(P=>{const j=Math.min(Math.max(P*(1+R*.01),Vy),Ky);if(y.current){const I=y.current,X=I.scrollLeft,J=I.scrollWidth,ie=J/P*j,re=(X+D)*(ie/J)-D;requestAnimationFrame(()=>{I.scrollLeft=re})}return j})},[]),_=B.useCallback(R=>{const D=R.currentTarget.getBoundingClientRect(),j=(R.clientX-D.left)/p;n(j)},[p,n]),v=v$({onPinch:({delta:[R],origin:[D],event:P})=>{var I;P.preventDefault();const j=D-(((I=y.current)==null?void 0:I.getBoundingClientRect().left)||0);L(R,j)},onWheel:({delta:[,R],event:D})=>{var P;if(D.ctrlKey||D.metaKey){D.preventDefault();const j=(P=y.current)==null?void 0:P.getBoundingClientRect(),I=D.clientX-((j==null?void 0:j.left)||0);L(-R,I)}}},{eventOptions:{passive:!1}})(y);B.useEffect(()=>{const R=y.current;return R&&R.addEventListener("wheel",v.onWheel,{passive:!1}),()=>{R&&R.removeEventListener("wheel",v.onWheel)}},[v]);const x=Math.max(...e.map(R=>R.end),t),k=Math.max(x*p,100),E=()=>{const R=[];for(let D=0;D<=x;D+=5)R.push(A.jsx(UD,{style:{left:`${D*p}px`},children:HD(D)},D));return R};return A.jsxs(DD,{children:[A.jsx(ID,{ref:y,children:A.jsxs(ND,{id:"track-timeline",style:{width:`${k}px`},children:[A.jsx(BD,{style:{width:`${k}px`},onClick:_,children:E()}),A.jsx(MD,{style:{left:`${t*p}px`}}),e.filter(R=>!R.deleted).map((R,D)=>A.jsx(zD,{children:A.jsx($D,{track:R,onChange:(P,j)=>m(D,P,j),zoomLevel:p,onEdit:r,isDubbingService:o,showSpeakerColors:l,isMediaFullyLoaded:c})},R.id))]})}),A.jsxs(jD,{children:[A.jsx(tp,{onClick:C,title:f("zoomOut"),children:A.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"})]})}),A.jsx(tp,{onClick:b,title:f("zoomIn"),children:A.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"9",y1:"6",x2:"9",y2:"12",stroke:"currentColor",strokeWidth:"2"})]})}),A.jsx(tp,{onClick:O,title:f("resetZoom"),children:A.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),A.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),A.jsx("path",{d:"M9 6v3h3",stroke:"currentColor",strokeWidth:"2",fill:"none"})]})})]})]})},HD=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var nc={exports:{}};/** +`,Vy=10,Ky=1,Gy=100,WD=({tracks:e,currentTime:t,onTimeChange:n,onEditTrack:r,isDubbingService:o,onTrackChange:a,showSpeakerColors:l,isMediaFullyLoaded:c=!0})=>{const{t:f}=so(),[p,h]=B.useState(Vy),y=B.useRef(null),m=(R,D,P)=>{a(R,D,P)},b=()=>h(R=>Math.min(R*1.5,Gy)),C=()=>h(R=>Math.max(R/1.5,Ky)),O=()=>h(Vy),A=B.useCallback((R,D)=>{h(P=>{const j=Math.min(Math.max(P*(1+R*.01),Ky),Gy);if(y.current){const I=y.current,X=I.scrollLeft,J=I.scrollWidth,ie=J/P*j,re=(X+D)*(ie/J)-D;requestAnimationFrame(()=>{I.scrollLeft=re})}return j})},[]),_=B.useCallback(R=>{const D=R.currentTarget.getBoundingClientRect(),j=(R.clientX-D.left)/p;n(j)},[p,n]),v=y$({onPinch:({delta:[R],origin:[D],event:P})=>{var I;P.preventDefault();const j=D-(((I=y.current)==null?void 0:I.getBoundingClientRect().left)||0);A(R,j)},onWheel:({delta:[,R],event:D})=>{var P;if(D.ctrlKey||D.metaKey){D.preventDefault();const j=(P=y.current)==null?void 0:P.getBoundingClientRect(),I=D.clientX-((j==null?void 0:j.left)||0);A(-R,I)}}},{eventOptions:{passive:!1}})(y);B.useEffect(()=>{const R=y.current;return R&&R.addEventListener("wheel",v.onWheel,{passive:!1}),()=>{R&&R.removeEventListener("wheel",v.onWheel)}},[v]);const x=Math.max(...e.map(R=>R.end),t),k=Math.max(x*p,100),E=()=>{const R=[];for(let D=0;D<=x;D+=5)R.push(L.jsx(UD,{style:{left:`${D*p}px`},children:HD(D)},D));return R};return L.jsxs(DD,{children:[L.jsx(ID,{ref:y,children:L.jsxs(ND,{id:"track-timeline",style:{width:`${k}px`},children:[L.jsx(BD,{style:{width:`${k}px`},onClick:_,children:E()}),L.jsx(MD,{style:{left:`${t*p}px`}}),e.filter(R=>!R.deleted).map((R,D)=>L.jsx(zD,{children:L.jsx($D,{track:R,onChange:(P,j)=>m(D,P,j),zoomLevel:p,onEdit:r,isDubbingService:o,showSpeakerColors:l,isMediaFullyLoaded:c})},R.id))]})}),L.jsxs(jD,{children:[L.jsx(tp,{onClick:C,title:f("zoomOut"),children:L.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[L.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"})]})}),L.jsx(tp,{onClick:b,title:f("zoomIn"),children:L.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[L.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"9",y1:"6",x2:"9",y2:"12",stroke:"currentColor",strokeWidth:"2"})]})}),L.jsx(tp,{onClick:O,title:f("resetZoom"),children:L.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[L.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),L.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),L.jsx("path",{d:"M9 6v3h3",stroke:"currentColor",strokeWidth:"2",fill:"none"})]})})]})]})},HD=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var nc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */nc.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",p=500,h="__lodash_placeholder__",y=1,m=2,b=4,C=1,O=2,L=1,_=2,v=4,x=8,k=16,E=32,R=64,D=128,P=256,j=512,I=30,X="...",J=800,ie=16,re=1,ae=2,pe=3,oe=1/0,H=9007199254740991,z=17976931348623157e292,U=0/0,G=4294967295,Y=G-1,V=G>>>1,ee=[["ary",D],["bind",L],["bindKey",_],["curry",x],["curryRight",k],["flip",j],["partial",E],["partialRight",R],["rearg",P]],ue="[object Arguments]",F="[object Array]",me="[object AsyncFunction]",te="[object Boolean]",De="[object Date]",Pe="[object DOMException]",be="[object Error]",Se="[object Function]",Qe="[object GeneratorFunction]",Ke="[object Map]",Te="[object Number]",wt="[object Null]",Ce="[object Object]",Je="[object Promise]",wn="[object Proxy]",Ge="[object RegExp]",bt="[object Set]",on="[object String]",ft="[object Symbol]",_e="[object Undefined]",ze="[object WeakMap]",Oi="[object WeakSet]",qn="[object ArrayBuffer]",kt="[object DataView]",ys="[object Float32Array]",dr="[object Float64Array]",ws="[object Int8Array]",uo="[object Int16Array]",Ai="[object Int32Array]",co="[object Uint8Array]",xs="[object Uint8ClampedArray]",fo="[object Uint16Array]",Rr="[object Uint32Array]",Qc=/\b__p \+= '';/g,Ss=/\b(__p \+=) '' \+/g,Zc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ha=/&(?:amp|lt|gt|quot|#39);/g,Va=/[&<>"']/g,qc=RegExp(Ha.source),Jc=RegExp(Va.source),Li=/<%-([\s\S]+?)%>/g,Ka=/<%([\s\S]+?)%>/g,Ga=/<%=([\s\S]+?)%>/g,ef=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tf=/^\w*$/,nf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_s=/[\\^$.*+?()[\]{}|]/g,rf=RegExp(_s.source),de=/^\s+/,ye=/\s/,je=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,pr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,po=/[()=,{}\[\]\/\s]/,hr=/\\(\\)?/g,ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$i=/\w*$/,Di=/^[-+]0x[0-9a-f]+$/i,Zr=/^0b[01]+$/i,go=/^\[object .+?Constructor\]$/,mo=/^0o[0-7]+$/i,of=/^(?:0|[1-9]\d*)$/,XS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ya=/($^)/,QS=/['\n\r\u2028\u2029\\]/g,Xa="\\ud800-\\udfff",ZS="\\u0300-\\u036f",qS="\\ufe20-\\ufe2f",JS="\\u20d0-\\u20ff",Tg=ZS+qS+JS,Rg="\\u2700-\\u27bf",Pg="a-z\\xdf-\\xf6\\xf8-\\xff",e_="\\xac\\xb1\\xd7\\xf7",t_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",n_="\\u2000-\\u206f",r_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Og="A-Z\\xc0-\\xd6\\xd8-\\xde",Ag="\\ufe0e\\ufe0f",Lg=e_+t_+n_+r_,sf="['’]",i_="["+Xa+"]",$g="["+Lg+"]",Qa="["+Tg+"]",Dg="\\d+",o_="["+Rg+"]",Ig="["+Pg+"]",Ng="[^"+Xa+Lg+Dg+Rg+Pg+Og+"]",af="\\ud83c[\\udffb-\\udfff]",s_="(?:"+Qa+"|"+af+")",Mg="[^"+Xa+"]",lf="(?:\\ud83c[\\udde6-\\uddff]){2}",uf="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+Og+"]",zg="\\u200d",Fg="(?:"+Ig+"|"+Ng+")",a_="(?:"+vo+"|"+Ng+")",Ug="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",jg="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",Bg=s_+"?",Wg="["+Ag+"]?",l_="(?:"+zg+"(?:"+[Mg,lf,uf].join("|")+")"+Wg+Bg+")*",u_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",c_="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hg=Wg+Bg+l_,f_="(?:"+[o_,lf,uf].join("|")+")"+Hg,d_="(?:"+[Mg+Qa+"?",Qa,lf,uf,i_].join("|")+")",p_=RegExp(sf,"g"),h_=RegExp(Qa,"g"),cf=RegExp(af+"(?="+af+")|"+d_+Hg,"g"),g_=RegExp([vo+"?"+Ig+"+"+Ug+"(?="+[$g,vo,"$"].join("|")+")",a_+"+"+jg+"(?="+[$g,vo+Fg,"$"].join("|")+")",vo+"?"+Fg+"+"+Ug,vo+"+"+jg,c_,u_,Dg,f_].join("|"),"g"),m_=RegExp("["+zg+Xa+Tg+Ag+"]"),v_=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,y_=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],w_=-1,et={};et[ys]=et[dr]=et[ws]=et[uo]=et[Ai]=et[co]=et[xs]=et[fo]=et[Rr]=!0,et[ue]=et[F]=et[qn]=et[te]=et[kt]=et[De]=et[be]=et[Se]=et[Ke]=et[Te]=et[Ce]=et[Ge]=et[bt]=et[on]=et[ze]=!1;var Ze={};Ze[ue]=Ze[F]=Ze[qn]=Ze[kt]=Ze[te]=Ze[De]=Ze[ys]=Ze[dr]=Ze[ws]=Ze[uo]=Ze[Ai]=Ze[Ke]=Ze[Te]=Ze[Ce]=Ze[Ge]=Ze[bt]=Ze[on]=Ze[ft]=Ze[co]=Ze[xs]=Ze[fo]=Ze[Rr]=!0,Ze[be]=Ze[Se]=Ze[ze]=!1;var x_={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},S_={"&":"&","<":"<",">":">",'"':""","'":"'"},__={"&":"&","<":"<",">":">",""":'"',"'":"'"},b_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},k_=parseFloat,C_=parseInt,Vg=typeof zs=="object"&&zs&&zs.Object===Object&&zs,E_=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Vg||E_||Function("return this")(),ff=t&&!t.nodeType&&t,Ii=ff&&!0&&e&&!e.nodeType&&e,Kg=Ii&&Ii.exports===ff,df=Kg&&Vg.process,In=function(){try{var N=Ii&&Ii.require&&Ii.require("util").types;return N||df&&df.binding&&df.binding("util")}catch{}}(),Gg=In&&In.isArrayBuffer,Yg=In&&In.isDate,Xg=In&&In.isMap,Qg=In&&In.isRegExp,Zg=In&&In.isSet,qg=In&&In.isTypedArray;function xn(N,K,W){switch(W.length){case 0:return N.call(K);case 1:return N.call(K,W[0]);case 2:return N.call(K,W[0],W[1]);case 3:return N.call(K,W[0],W[1],W[2])}return N.apply(K,W)}function T_(N,K,W,ce){for(var ke=-1,Fe=N==null?0:N.length;++ke-1}function pf(N,K,W){for(var ce=-1,ke=N==null?0:N.length;++ce-1;);return W}function sm(N,K){for(var W=N.length;W--&&yo(K,N[W],0)>-1;);return W}function N_(N,K){for(var W=N.length,ce=0;W--;)N[W]===K&&++ce;return ce}var M_=vf(x_),z_=vf(S_);function F_(N){return"\\"+b_[N]}function U_(N,K){return N==null?n:N[K]}function wo(N){return m_.test(N)}function j_(N){return v_.test(N)}function B_(N){for(var K,W=[];!(K=N.next()).done;)W.push(K.value);return W}function Sf(N){var K=-1,W=Array(N.size);return N.forEach(function(ce,ke){W[++K]=[ke,ce]}),W}function am(N,K){return function(W){return N(K(W))}}function ei(N,K){for(var W=-1,ce=N.length,ke=0,Fe=[];++W-1}function Pb(i,s){var u=this.__data__,d=hl(u,i);return d<0?(++this.size,u.push([i,s])):u[d][1]=s,this}Pr.prototype.clear=Cb,Pr.prototype.delete=Eb,Pr.prototype.get=Tb,Pr.prototype.has=Rb,Pr.prototype.set=Pb;function Or(i){var s=-1,u=i==null?0:i.length;for(this.clear();++s=s?i:s)),i}function Fn(i,s,u,d,g,S){var T,$=s&y,M=s&m,Q=s&b;if(u&&(T=g?u(i,d,g,S):u(i)),T!==n)return T;if(!st(i))return i;var Z=Ee(i);if(Z){if(T=$k(i),!$)return sn(i,T)}else{var q=Wt(i),se=q==Se||q==Qe;if(si(i))return Wm(i,$);if(q==Ce||q==ue||se&&!g){if(T=M||se?{}:lv(i),!$)return M?_k(i,Vb(T,i)):Sk(i,wm(T,i))}else{if(!Ze[q])return g?i:{};T=Dk(i,q,$)}}S||(S=new er);var he=S.get(i);if(he)return he;S.set(i,T),Mv(i)?i.forEach(function(xe){T.add(Fn(xe,s,u,xe,i,S))}):Iv(i)&&i.forEach(function(xe,Le){T.set(Le,Fn(xe,s,u,Le,i,S))});var we=Q?M?Gf:Kf:M?ln:Lt,Oe=Z?n:we(i);return Nn(Oe||i,function(xe,Le){Oe&&(Le=xe,xe=i[Le]),Ps(T,Le,Fn(xe,s,u,Le,i,S))}),T}function Kb(i){var s=Lt(i);return function(u){return xm(u,i,s)}}function xm(i,s,u){var d=u.length;if(i==null)return!d;for(i=Xe(i);d--;){var g=u[d],S=s[g],T=i[g];if(T===n&&!(g in i)||!S(T))return!1}return!0}function Sm(i,s,u){if(typeof i!="function")throw new Mn(l);return Ns(function(){i.apply(n,u)},s)}function Os(i,s,u,d){var g=-1,S=Za,T=!0,$=i.length,M=[],Q=s.length;if(!$)return M;u&&(s=it(s,Sn(u))),d?(S=pf,T=!1):s.length>=o&&(S=bs,T=!1,s=new zi(s));e:for(;++g<$;){var Z=i[g],q=u==null?Z:u(Z);if(Z=d||Z!==0?Z:0,T&&q===q){for(var se=Q;se--;)if(s[se]===q)continue e;M.push(Z)}else S(s,q,d)||M.push(Z)}return M}var ni=Ym(gr),_m=Ym(Pf,!0);function Gb(i,s){var u=!0;return ni(i,function(d,g,S){return u=!!s(d,g,S),u}),u}function gl(i,s,u){for(var d=-1,g=i.length;++dg?0:g+u),d=d===n||d>g?g:Re(d),d<0&&(d+=g),d=u>d?0:Fv(d);u0&&u($)?s>1?Mt($,s-1,u,d,g):Jr(g,$):d||(g[g.length]=$)}return g}var Rf=Xm(),km=Xm(!0);function gr(i,s){return i&&Rf(i,s,Lt)}function Pf(i,s){return i&&km(i,s,Lt)}function ml(i,s){return qr(s,function(u){return Ir(i[u])})}function Ui(i,s){s=ii(s,i);for(var u=0,d=s.length;i!=null&&us}function Xb(i,s){return i!=null&&Be.call(i,s)}function Qb(i,s){return i!=null&&s in Xe(i)}function Zb(i,s,u){return i>=Bt(s,u)&&i=120&&Z.length>=120)?new zi(T&&Z):n}Z=i[0];var q=-1,se=$[0];e:for(;++q-1;)$!==i&&al.call($,M,1),al.call(i,M,1);return i}function Im(i,s){for(var u=i?s.length:0,d=u-1;u--;){var g=s[u];if(u==d||g!==S){var S=g;Dr(g)?al.call(i,g,1):Ff(i,g)}}return i}function Nf(i,s){return i+cl(gm()*(s-i+1))}function ck(i,s,u,d){for(var g=-1,S=Tt(ul((s-i)/(u||1)),0),T=W(S);S--;)T[d?S:++g]=i,i+=u;return T}function Mf(i,s){var u="";if(!i||s<1||s>H)return u;do s%2&&(u+=i),s=cl(s/2),s&&(i+=i);while(s);return u}function Ae(i,s){return ed(fv(i,s,un),i+"")}function fk(i){return ym(Oo(i))}function dk(i,s){var u=Oo(i);return Tl(u,Fi(s,0,u.length))}function $s(i,s,u,d){if(!st(i))return i;s=ii(s,i);for(var g=-1,S=s.length,T=S-1,$=i;$!=null&&++gg?0:g+s),u=u>g?g:u,u<0&&(u+=g),g=s>u?0:u-s>>>0,s>>>=0;for(var S=W(g);++d>>1,T=i[S];T!==null&&!bn(T)&&(u?T<=s:T=o){var Q=s?null:Ek(i);if(Q)return Ja(Q);T=!1,g=bs,M=new zi}else M=s?[]:$;e:for(;++d=d?i:Un(i,s,u)}var Bm=rb||function(i){return Nt.clearTimeout(i)};function Wm(i,s){if(s)return i.slice();var u=i.length,d=cm?cm(u):new i.constructor(u);return i.copy(d),d}function Wf(i){var s=new i.constructor(i.byteLength);return new ol(s).set(new ol(i)),s}function vk(i,s){var u=s?Wf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function yk(i){var s=new i.constructor(i.source,$i.exec(i));return s.lastIndex=i.lastIndex,s}function wk(i){return Rs?Xe(Rs.call(i)):{}}function Hm(i,s){var u=s?Wf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function Vm(i,s){if(i!==s){var u=i!==n,d=i===null,g=i===i,S=bn(i),T=s!==n,$=s===null,M=s===s,Q=bn(s);if(!$&&!Q&&!S&&i>s||S&&T&&M&&!$&&!Q||d&&T&&M||!u&&M||!g)return 1;if(!d&&!S&&!Q&&i=$)return M;var Q=u[d];return M*(Q=="desc"?-1:1)}}return i.index-s.index}function Km(i,s,u,d){for(var g=-1,S=i.length,T=u.length,$=-1,M=s.length,Q=Tt(S-T,0),Z=W(M+Q),q=!d;++$1?u[g-1]:n,T=g>2?u[2]:n;for(S=i.length>3&&typeof S=="function"?(g--,S):n,T&&Zt(u[0],u[1],T)&&(S=g<3?n:S,g=1),s=Xe(s);++d-1?g[S?s[T]:T]:n}}function qm(i){return $r(function(s){var u=s.length,d=u,g=zn.prototype.thru;for(i&&s.reverse();d--;){var S=s[d];if(typeof S!="function")throw new Mn(l);if(g&&!T&&Cl(S)=="wrapper")var T=new zn([],!0)}for(d=T?d:u;++d1&&Ne.reverse(),Z&&M$))return!1;var Q=S.get(i),Z=S.get(s);if(Q&&Z)return Q==s&&Z==i;var q=-1,se=!0,he=u&O?new zi:n;for(S.set(i,s),S.set(s,i);++q<$;){var we=i[q],Oe=s[q];if(d)var xe=T?d(Oe,we,q,s,i,S):d(we,Oe,q,i,s,S);if(xe!==n){if(xe)continue;se=!1;break}if(he){if(!gf(s,function(Le,Ne){if(!bs(he,Ne)&&(we===Le||g(we,Le,u,d,S)))return he.push(Ne)})){se=!1;break}}else if(!(we===Oe||g(we,Oe,u,d,S))){se=!1;break}}return S.delete(i),S.delete(s),se}function Rk(i,s,u,d,g,S,T){switch(u){case kt:if(i.byteLength!=s.byteLength||i.byteOffset!=s.byteOffset)return!1;i=i.buffer,s=s.buffer;case qn:return!(i.byteLength!=s.byteLength||!S(new ol(i),new ol(s)));case te:case De:case Te:return tr(+i,+s);case be:return i.name==s.name&&i.message==s.message;case Ge:case on:return i==s+"";case Ke:var $=Sf;case bt:var M=d&C;if($||($=Ja),i.size!=s.size&&!M)return!1;var Q=T.get(i);if(Q)return Q==s;d|=O,T.set(i,s);var Z=ov($(i),$(s),d,g,S,T);return T.delete(i),Z;case ft:if(Rs)return Rs.call(i)==Rs.call(s)}return!1}function Pk(i,s,u,d,g,S){var T=u&C,$=Kf(i),M=$.length,Q=Kf(s),Z=Q.length;if(M!=Z&&!T)return!1;for(var q=M;q--;){var se=$[q];if(!(T?se in s:Be.call(s,se)))return!1}var he=S.get(i),we=S.get(s);if(he&&we)return he==s&&we==i;var Oe=!0;S.set(i,s),S.set(s,i);for(var xe=T;++q1?"& ":"")+s[d],s=s.join(u>2?", ":" "),i.replace(je,`{ + */nc.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",p=500,h="__lodash_placeholder__",y=1,m=2,b=4,C=1,O=2,A=1,_=2,v=4,x=8,k=16,E=32,R=64,D=128,P=256,j=512,I=30,X="...",J=800,ie=16,re=1,ae=2,pe=3,oe=1/0,H=9007199254740991,z=17976931348623157e292,U=0/0,G=4294967295,Y=G-1,V=G>>>1,ee=[["ary",D],["bind",A],["bindKey",_],["curry",x],["curryRight",k],["flip",j],["partial",E],["partialRight",R],["rearg",P]],ue="[object Arguments]",F="[object Array]",me="[object AsyncFunction]",te="[object Boolean]",De="[object Date]",Pe="[object DOMException]",be="[object Error]",Se="[object Function]",Qe="[object GeneratorFunction]",Ke="[object Map]",Te="[object Number]",wt="[object Null]",Ce="[object Object]",Je="[object Promise]",wn="[object Proxy]",Ge="[object RegExp]",bt="[object Set]",on="[object String]",ft="[object Symbol]",_e="[object Undefined]",ze="[object WeakMap]",Oi="[object WeakSet]",qn="[object ArrayBuffer]",kt="[object DataView]",ys="[object Float32Array]",dr="[object Float64Array]",ws="[object Int8Array]",uo="[object Int16Array]",Li="[object Int32Array]",co="[object Uint8Array]",xs="[object Uint8ClampedArray]",fo="[object Uint16Array]",Rr="[object Uint32Array]",Qc=/\b__p \+= '';/g,Ss=/\b(__p \+=) '' \+/g,Zc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ha=/&(?:amp|lt|gt|quot|#39);/g,Va=/[&<>"']/g,qc=RegExp(Ha.source),Jc=RegExp(Va.source),Ai=/<%-([\s\S]+?)%>/g,Ka=/<%([\s\S]+?)%>/g,Ga=/<%=([\s\S]+?)%>/g,ef=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tf=/^\w*$/,nf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_s=/[\\^$.*+?()[\]{}|]/g,rf=RegExp(_s.source),de=/^\s+/,ye=/\s/,je=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,pr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,po=/[()=,{}\[\]\/\s]/,hr=/\\(\\)?/g,ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$i=/\w*$/,Di=/^[-+]0x[0-9a-f]+$/i,Zr=/^0b[01]+$/i,go=/^\[object .+?Constructor\]$/,mo=/^0o[0-7]+$/i,of=/^(?:0|[1-9]\d*)$/,QS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ya=/($^)/,ZS=/['\n\r\u2028\u2029\\]/g,Xa="\\ud800-\\udfff",qS="\\u0300-\\u036f",JS="\\ufe20-\\ufe2f",e_="\\u20d0-\\u20ff",Tg=qS+JS+e_,Rg="\\u2700-\\u27bf",Pg="a-z\\xdf-\\xf6\\xf8-\\xff",t_="\\xac\\xb1\\xd7\\xf7",n_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",r_="\\u2000-\\u206f",i_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Og="A-Z\\xc0-\\xd6\\xd8-\\xde",Lg="\\ufe0e\\ufe0f",Ag=t_+n_+r_+i_,sf="['’]",o_="["+Xa+"]",$g="["+Ag+"]",Qa="["+Tg+"]",Dg="\\d+",s_="["+Rg+"]",Ig="["+Pg+"]",Ng="[^"+Xa+Ag+Dg+Rg+Pg+Og+"]",af="\\ud83c[\\udffb-\\udfff]",a_="(?:"+Qa+"|"+af+")",Mg="[^"+Xa+"]",lf="(?:\\ud83c[\\udde6-\\uddff]){2}",uf="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+Og+"]",zg="\\u200d",Fg="(?:"+Ig+"|"+Ng+")",l_="(?:"+vo+"|"+Ng+")",Ug="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",jg="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",Bg=a_+"?",Wg="["+Lg+"]?",u_="(?:"+zg+"(?:"+[Mg,lf,uf].join("|")+")"+Wg+Bg+")*",c_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",f_="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hg=Wg+Bg+u_,d_="(?:"+[s_,lf,uf].join("|")+")"+Hg,p_="(?:"+[Mg+Qa+"?",Qa,lf,uf,o_].join("|")+")",h_=RegExp(sf,"g"),g_=RegExp(Qa,"g"),cf=RegExp(af+"(?="+af+")|"+p_+Hg,"g"),m_=RegExp([vo+"?"+Ig+"+"+Ug+"(?="+[$g,vo,"$"].join("|")+")",l_+"+"+jg+"(?="+[$g,vo+Fg,"$"].join("|")+")",vo+"?"+Fg+"+"+Ug,vo+"+"+jg,f_,c_,Dg,d_].join("|"),"g"),v_=RegExp("["+zg+Xa+Tg+Lg+"]"),y_=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,w_=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],x_=-1,et={};et[ys]=et[dr]=et[ws]=et[uo]=et[Li]=et[co]=et[xs]=et[fo]=et[Rr]=!0,et[ue]=et[F]=et[qn]=et[te]=et[kt]=et[De]=et[be]=et[Se]=et[Ke]=et[Te]=et[Ce]=et[Ge]=et[bt]=et[on]=et[ze]=!1;var Ze={};Ze[ue]=Ze[F]=Ze[qn]=Ze[kt]=Ze[te]=Ze[De]=Ze[ys]=Ze[dr]=Ze[ws]=Ze[uo]=Ze[Li]=Ze[Ke]=Ze[Te]=Ze[Ce]=Ze[Ge]=Ze[bt]=Ze[on]=Ze[ft]=Ze[co]=Ze[xs]=Ze[fo]=Ze[Rr]=!0,Ze[be]=Ze[Se]=Ze[ze]=!1;var S_={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},__={"&":"&","<":"<",">":">",'"':""","'":"'"},b_={"&":"&","<":"<",">":">",""":'"',"'":"'"},k_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},C_=parseFloat,E_=parseInt,Vg=typeof zs=="object"&&zs&&zs.Object===Object&&zs,T_=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Vg||T_||Function("return this")(),ff=t&&!t.nodeType&&t,Ii=ff&&!0&&e&&!e.nodeType&&e,Kg=Ii&&Ii.exports===ff,df=Kg&&Vg.process,In=function(){try{var N=Ii&&Ii.require&&Ii.require("util").types;return N||df&&df.binding&&df.binding("util")}catch{}}(),Gg=In&&In.isArrayBuffer,Yg=In&&In.isDate,Xg=In&&In.isMap,Qg=In&&In.isRegExp,Zg=In&&In.isSet,qg=In&&In.isTypedArray;function xn(N,K,W){switch(W.length){case 0:return N.call(K);case 1:return N.call(K,W[0]);case 2:return N.call(K,W[0],W[1]);case 3:return N.call(K,W[0],W[1],W[2])}return N.apply(K,W)}function R_(N,K,W,ce){for(var ke=-1,Fe=N==null?0:N.length;++ke-1}function pf(N,K,W){for(var ce=-1,ke=N==null?0:N.length;++ce-1;);return W}function sm(N,K){for(var W=N.length;W--&&yo(K,N[W],0)>-1;);return W}function M_(N,K){for(var W=N.length,ce=0;W--;)N[W]===K&&++ce;return ce}var z_=vf(S_),F_=vf(__);function U_(N){return"\\"+k_[N]}function j_(N,K){return N==null?n:N[K]}function wo(N){return v_.test(N)}function B_(N){return y_.test(N)}function W_(N){for(var K,W=[];!(K=N.next()).done;)W.push(K.value);return W}function Sf(N){var K=-1,W=Array(N.size);return N.forEach(function(ce,ke){W[++K]=[ke,ce]}),W}function am(N,K){return function(W){return N(K(W))}}function ei(N,K){for(var W=-1,ce=N.length,ke=0,Fe=[];++W-1}function Ob(i,s){var u=this.__data__,d=hl(u,i);return d<0?(++this.size,u.push([i,s])):u[d][1]=s,this}Pr.prototype.clear=Eb,Pr.prototype.delete=Tb,Pr.prototype.get=Rb,Pr.prototype.has=Pb,Pr.prototype.set=Ob;function Or(i){var s=-1,u=i==null?0:i.length;for(this.clear();++s=s?i:s)),i}function Fn(i,s,u,d,g,S){var T,$=s&y,M=s&m,Q=s&b;if(u&&(T=g?u(i,d,g,S):u(i)),T!==n)return T;if(!st(i))return i;var Z=Ee(i);if(Z){if(T=Dk(i),!$)return sn(i,T)}else{var q=Wt(i),se=q==Se||q==Qe;if(si(i))return Wm(i,$);if(q==Ce||q==ue||se&&!g){if(T=M||se?{}:lv(i),!$)return M?bk(i,Kb(T,i)):_k(i,wm(T,i))}else{if(!Ze[q])return g?i:{};T=Ik(i,q,$)}}S||(S=new er);var he=S.get(i);if(he)return he;S.set(i,T),Mv(i)?i.forEach(function(xe){T.add(Fn(xe,s,u,xe,i,S))}):Iv(i)&&i.forEach(function(xe,Ae){T.set(Ae,Fn(xe,s,u,Ae,i,S))});var we=Q?M?Gf:Kf:M?ln:At,Oe=Z?n:we(i);return Nn(Oe||i,function(xe,Ae){Oe&&(Ae=xe,xe=i[Ae]),Ps(T,Ae,Fn(xe,s,u,Ae,i,S))}),T}function Gb(i){var s=At(i);return function(u){return xm(u,i,s)}}function xm(i,s,u){var d=u.length;if(i==null)return!d;for(i=Xe(i);d--;){var g=u[d],S=s[g],T=i[g];if(T===n&&!(g in i)||!S(T))return!1}return!0}function Sm(i,s,u){if(typeof i!="function")throw new Mn(l);return Ns(function(){i.apply(n,u)},s)}function Os(i,s,u,d){var g=-1,S=Za,T=!0,$=i.length,M=[],Q=s.length;if(!$)return M;u&&(s=it(s,Sn(u))),d?(S=pf,T=!1):s.length>=o&&(S=bs,T=!1,s=new zi(s));e:for(;++g<$;){var Z=i[g],q=u==null?Z:u(Z);if(Z=d||Z!==0?Z:0,T&&q===q){for(var se=Q;se--;)if(s[se]===q)continue e;M.push(Z)}else S(s,q,d)||M.push(Z)}return M}var ni=Ym(gr),_m=Ym(Pf,!0);function Yb(i,s){var u=!0;return ni(i,function(d,g,S){return u=!!s(d,g,S),u}),u}function gl(i,s,u){for(var d=-1,g=i.length;++dg?0:g+u),d=d===n||d>g?g:Re(d),d<0&&(d+=g),d=u>d?0:Fv(d);u0&&u($)?s>1?Mt($,s-1,u,d,g):Jr(g,$):d||(g[g.length]=$)}return g}var Rf=Xm(),km=Xm(!0);function gr(i,s){return i&&Rf(i,s,At)}function Pf(i,s){return i&&km(i,s,At)}function ml(i,s){return qr(s,function(u){return Ir(i[u])})}function Ui(i,s){s=ii(s,i);for(var u=0,d=s.length;i!=null&&us}function Qb(i,s){return i!=null&&Be.call(i,s)}function Zb(i,s){return i!=null&&s in Xe(i)}function qb(i,s,u){return i>=Bt(s,u)&&i=120&&Z.length>=120)?new zi(T&&Z):n}Z=i[0];var q=-1,se=$[0];e:for(;++q-1;)$!==i&&al.call($,M,1),al.call(i,M,1);return i}function Im(i,s){for(var u=i?s.length:0,d=u-1;u--;){var g=s[u];if(u==d||g!==S){var S=g;Dr(g)?al.call(i,g,1):Ff(i,g)}}return i}function Nf(i,s){return i+cl(gm()*(s-i+1))}function fk(i,s,u,d){for(var g=-1,S=Tt(ul((s-i)/(u||1)),0),T=W(S);S--;)T[d?S:++g]=i,i+=u;return T}function Mf(i,s){var u="";if(!i||s<1||s>H)return u;do s%2&&(u+=i),s=cl(s/2),s&&(i+=i);while(s);return u}function Le(i,s){return ed(fv(i,s,un),i+"")}function dk(i){return ym(Oo(i))}function pk(i,s){var u=Oo(i);return Tl(u,Fi(s,0,u.length))}function $s(i,s,u,d){if(!st(i))return i;s=ii(s,i);for(var g=-1,S=s.length,T=S-1,$=i;$!=null&&++gg?0:g+s),u=u>g?g:u,u<0&&(u+=g),g=s>u?0:u-s>>>0,s>>>=0;for(var S=W(g);++d>>1,T=i[S];T!==null&&!bn(T)&&(u?T<=s:T=o){var Q=s?null:Tk(i);if(Q)return Ja(Q);T=!1,g=bs,M=new zi}else M=s?[]:$;e:for(;++d=d?i:Un(i,s,u)}var Bm=ib||function(i){return Nt.clearTimeout(i)};function Wm(i,s){if(s)return i.slice();var u=i.length,d=cm?cm(u):new i.constructor(u);return i.copy(d),d}function Wf(i){var s=new i.constructor(i.byteLength);return new ol(s).set(new ol(i)),s}function yk(i,s){var u=s?Wf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function wk(i){var s=new i.constructor(i.source,$i.exec(i));return s.lastIndex=i.lastIndex,s}function xk(i){return Rs?Xe(Rs.call(i)):{}}function Hm(i,s){var u=s?Wf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function Vm(i,s){if(i!==s){var u=i!==n,d=i===null,g=i===i,S=bn(i),T=s!==n,$=s===null,M=s===s,Q=bn(s);if(!$&&!Q&&!S&&i>s||S&&T&&M&&!$&&!Q||d&&T&&M||!u&&M||!g)return 1;if(!d&&!S&&!Q&&i=$)return M;var Q=u[d];return M*(Q=="desc"?-1:1)}}return i.index-s.index}function Km(i,s,u,d){for(var g=-1,S=i.length,T=u.length,$=-1,M=s.length,Q=Tt(S-T,0),Z=W(M+Q),q=!d;++$1?u[g-1]:n,T=g>2?u[2]:n;for(S=i.length>3&&typeof S=="function"?(g--,S):n,T&&Zt(u[0],u[1],T)&&(S=g<3?n:S,g=1),s=Xe(s);++d-1?g[S?s[T]:T]:n}}function qm(i){return $r(function(s){var u=s.length,d=u,g=zn.prototype.thru;for(i&&s.reverse();d--;){var S=s[d];if(typeof S!="function")throw new Mn(l);if(g&&!T&&Cl(S)=="wrapper")var T=new zn([],!0)}for(d=T?d:u;++d1&&Ne.reverse(),Z&&M$))return!1;var Q=S.get(i),Z=S.get(s);if(Q&&Z)return Q==s&&Z==i;var q=-1,se=!0,he=u&O?new zi:n;for(S.set(i,s),S.set(s,i);++q<$;){var we=i[q],Oe=s[q];if(d)var xe=T?d(Oe,we,q,s,i,S):d(we,Oe,q,i,s,S);if(xe!==n){if(xe)continue;se=!1;break}if(he){if(!gf(s,function(Ae,Ne){if(!bs(he,Ne)&&(we===Ae||g(we,Ae,u,d,S)))return he.push(Ne)})){se=!1;break}}else if(!(we===Oe||g(we,Oe,u,d,S))){se=!1;break}}return S.delete(i),S.delete(s),se}function Pk(i,s,u,d,g,S,T){switch(u){case kt:if(i.byteLength!=s.byteLength||i.byteOffset!=s.byteOffset)return!1;i=i.buffer,s=s.buffer;case qn:return!(i.byteLength!=s.byteLength||!S(new ol(i),new ol(s)));case te:case De:case Te:return tr(+i,+s);case be:return i.name==s.name&&i.message==s.message;case Ge:case on:return i==s+"";case Ke:var $=Sf;case bt:var M=d&C;if($||($=Ja),i.size!=s.size&&!M)return!1;var Q=T.get(i);if(Q)return Q==s;d|=O,T.set(i,s);var Z=ov($(i),$(s),d,g,S,T);return T.delete(i),Z;case ft:if(Rs)return Rs.call(i)==Rs.call(s)}return!1}function Ok(i,s,u,d,g,S){var T=u&C,$=Kf(i),M=$.length,Q=Kf(s),Z=Q.length;if(M!=Z&&!T)return!1;for(var q=M;q--;){var se=$[q];if(!(T?se in s:Be.call(s,se)))return!1}var he=S.get(i),we=S.get(s);if(he&&we)return he==s&&we==i;var Oe=!0;S.set(i,s),S.set(s,i);for(var xe=T;++q1?"& ":"")+s[d],s=s.join(u>2?", ":" "),i.replace(je,`{ /* [wrapped with `+s+`] */ -`)}function Nk(i){return Ee(i)||Wi(i)||!!(pm&&i&&i[pm])}function Dr(i,s){var u=typeof i;return s=s??H,!!s&&(u=="number"||u!="symbol"&&of.test(i))&&i>-1&&i%1==0&&i0){if(++s>=J)return arguments[0]}else s=0;return i.apply(n,arguments)}}function Tl(i,s){var u=-1,d=i.length,g=d-1;for(s=s===n?d:s;++u1?i[s-1]:n;return u=typeof u=="function"?(i.pop(),u):n,bv(i,u)});function kv(i){var s=w(i);return s.__chain__=!0,s}function GC(i,s){return s(i),i}function Rl(i,s){return s(i)}var YC=$r(function(i){var s=i.length,u=s?i[0]:0,d=this.__wrapped__,g=function(S){return Tf(S,i)};return s>1||this.__actions__.length||!(d instanceof Ie)||!Dr(u)?this.thru(g):(d=d.slice(u,+u+(s?1:0)),d.__actions__.push({func:Rl,args:[g],thisArg:n}),new zn(d,this.__chain__).thru(function(S){return s&&!S.length&&S.push(n),S}))});function XC(){return kv(this)}function QC(){return new zn(this.value(),this.__chain__)}function ZC(){this.__values__===n&&(this.__values__=zv(this.value()));var i=this.__index__>=this.__values__.length,s=i?n:this.__values__[this.__index__++];return{done:i,value:s}}function qC(){return this}function JC(i){for(var s,u=this;u instanceof pl;){var d=vv(u);d.__index__=0,d.__values__=n,s?g.__wrapped__=d:s=d;var g=d;u=u.__wrapped__}return g.__wrapped__=i,s}function eE(){var i=this.__wrapped__;if(i instanceof Ie){var s=i;return this.__actions__.length&&(s=new Ie(this)),s=s.reverse(),s.__actions__.push({func:Rl,args:[td],thisArg:n}),new zn(s,this.__chain__)}return this.thru(td)}function tE(){return Um(this.__wrapped__,this.__actions__)}var nE=xl(function(i,s,u){Be.call(i,u)?++i[u]:Ar(i,u,1)});function rE(i,s,u){var d=Ee(i)?Jg:Gb;return u&&Zt(i,s,u)&&(s=n),d(i,ve(s,3))}function iE(i,s){var u=Ee(i)?qr:bm;return u(i,ve(s,3))}var oE=Zm(yv),sE=Zm(wv);function aE(i,s){return Mt(Pl(i,s),1)}function lE(i,s){return Mt(Pl(i,s),oe)}function uE(i,s,u){return u=u===n?1:Re(u),Mt(Pl(i,s),u)}function Cv(i,s){var u=Ee(i)?Nn:ni;return u(i,ve(s,3))}function Ev(i,s){var u=Ee(i)?R_:_m;return u(i,ve(s,3))}var cE=xl(function(i,s,u){Be.call(i,u)?i[u].push(s):Ar(i,u,[s])});function fE(i,s,u,d){i=an(i)?i:Oo(i),u=u&&!d?Re(u):0;var g=i.length;return u<0&&(u=Tt(g+u,0)),Dl(i)?u<=g&&i.indexOf(s,u)>-1:!!g&&yo(i,s,u)>-1}var dE=Ae(function(i,s,u){var d=-1,g=typeof s=="function",S=an(i)?W(i.length):[];return ni(i,function(T){S[++d]=g?xn(s,T,u):As(T,s,u)}),S}),pE=xl(function(i,s,u){Ar(i,u,s)});function Pl(i,s){var u=Ee(i)?it:Pm;return u(i,ve(s,3))}function hE(i,s,u,d){return i==null?[]:(Ee(s)||(s=s==null?[]:[s]),u=d?n:u,Ee(u)||(u=u==null?[]:[u]),$m(i,s,u))}var gE=xl(function(i,s,u){i[u?0:1].push(s)},function(){return[[],[]]});function mE(i,s,u){var d=Ee(i)?hf:rm,g=arguments.length<3;return d(i,ve(s,4),u,g,ni)}function vE(i,s,u){var d=Ee(i)?P_:rm,g=arguments.length<3;return d(i,ve(s,4),u,g,_m)}function yE(i,s){var u=Ee(i)?qr:bm;return u(i,Ll(ve(s,3)))}function wE(i){var s=Ee(i)?ym:fk;return s(i)}function xE(i,s,u){(u?Zt(i,s,u):s===n)?s=1:s=Re(s);var d=Ee(i)?Bb:dk;return d(i,s)}function SE(i){var s=Ee(i)?Wb:hk;return s(i)}function _E(i){if(i==null)return 0;if(an(i))return Dl(i)?xo(i):i.length;var s=Wt(i);return s==Ke||s==bt?i.size:$f(i).length}function bE(i,s,u){var d=Ee(i)?gf:gk;return u&&Zt(i,s,u)&&(s=n),d(i,ve(s,3))}var kE=Ae(function(i,s){if(i==null)return[];var u=s.length;return u>1&&Zt(i,s[0],s[1])?s=[]:u>2&&Zt(s[0],s[1],s[2])&&(s=[s[0]]),$m(i,Mt(s,1),[])}),Ol=ib||function(){return Nt.Date.now()};function CE(i,s){if(typeof s!="function")throw new Mn(l);return i=Re(i),function(){if(--i<1)return s.apply(this,arguments)}}function Tv(i,s,u){return s=u?n:s,s=i&&s==null?i.length:s,Lr(i,D,n,n,n,n,s)}function Rv(i,s){var u;if(typeof s!="function")throw new Mn(l);return i=Re(i),function(){return--i>0&&(u=s.apply(this,arguments)),i<=1&&(s=n),u}}var rd=Ae(function(i,s,u){var d=L;if(u.length){var g=ei(u,Ro(rd));d|=E}return Lr(i,d,s,u,g)}),Pv=Ae(function(i,s,u){var d=L|_;if(u.length){var g=ei(u,Ro(Pv));d|=E}return Lr(s,d,i,u,g)});function Ov(i,s,u){s=u?n:s;var d=Lr(i,x,n,n,n,n,n,s);return d.placeholder=Ov.placeholder,d}function Av(i,s,u){s=u?n:s;var d=Lr(i,k,n,n,n,n,n,s);return d.placeholder=Av.placeholder,d}function Lv(i,s,u){var d,g,S,T,$,M,Q=0,Z=!1,q=!1,se=!0;if(typeof i!="function")throw new Mn(l);s=Bn(s)||0,st(u)&&(Z=!!u.leading,q="maxWait"in u,S=q?Tt(Bn(u.maxWait)||0,s):S,se="trailing"in u?!!u.trailing:se);function he(mt){var nr=d,Mr=g;return d=g=n,Q=mt,T=i.apply(Mr,nr),T}function we(mt){return Q=mt,$=Ns(Le,s),Z?he(mt):T}function Oe(mt){var nr=mt-M,Mr=mt-Q,Zv=s-nr;return q?Bt(Zv,S-Mr):Zv}function xe(mt){var nr=mt-M,Mr=mt-Q;return M===n||nr>=s||nr<0||q&&Mr>=S}function Le(){var mt=Ol();if(xe(mt))return Ne(mt);$=Ns(Le,Oe(mt))}function Ne(mt){return $=n,se&&d?he(mt):(d=g=n,T)}function kn(){$!==n&&Bm($),Q=0,d=M=g=$=n}function qt(){return $===n?T:Ne(Ol())}function Cn(){var mt=Ol(),nr=xe(mt);if(d=arguments,g=this,M=mt,nr){if($===n)return we(M);if(q)return Bm($),$=Ns(Le,s),he(M)}return $===n&&($=Ns(Le,s)),T}return Cn.cancel=kn,Cn.flush=qt,Cn}var EE=Ae(function(i,s){return Sm(i,1,s)}),TE=Ae(function(i,s,u){return Sm(i,Bn(s)||0,u)});function RE(i){return Lr(i,j)}function Al(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new Mn(l);var u=function(){var d=arguments,g=s?s.apply(this,d):d[0],S=u.cache;if(S.has(g))return S.get(g);var T=i.apply(this,d);return u.cache=S.set(g,T)||S,T};return u.cache=new(Al.Cache||Or),u}Al.Cache=Or;function Ll(i){if(typeof i!="function")throw new Mn(l);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function PE(i){return Rv(2,i)}var OE=mk(function(i,s){s=s.length==1&&Ee(s[0])?it(s[0],Sn(ve())):it(Mt(s,1),Sn(ve()));var u=s.length;return Ae(function(d){for(var g=-1,S=Bt(d.length,u);++g=s}),Wi=Em(function(){return arguments}())?Em:function(i){return dt(i)&&Be.call(i,"callee")&&!dm.call(i,"callee")},Ee=W.isArray,VE=Gg?Sn(Gg):Jb;function an(i){return i!=null&&$l(i.length)&&!Ir(i)}function gt(i){return dt(i)&&an(i)}function KE(i){return i===!0||i===!1||dt(i)&&Qt(i)==te}var si=sb||gd,GE=Yg?Sn(Yg):ek;function YE(i){return dt(i)&&i.nodeType===1&&!Ms(i)}function XE(i){if(i==null)return!0;if(an(i)&&(Ee(i)||typeof i=="string"||typeof i.splice=="function"||si(i)||Po(i)||Wi(i)))return!i.length;var s=Wt(i);if(s==Ke||s==bt)return!i.size;if(Is(i))return!$f(i).length;for(var u in i)if(Be.call(i,u))return!1;return!0}function QE(i,s){return Ls(i,s)}function ZE(i,s,u){u=typeof u=="function"?u:n;var d=u?u(i,s):n;return d===n?Ls(i,s,n,u):!!d}function od(i){if(!dt(i))return!1;var s=Qt(i);return s==be||s==Pe||typeof i.message=="string"&&typeof i.name=="string"&&!Ms(i)}function qE(i){return typeof i=="number"&&hm(i)}function Ir(i){if(!st(i))return!1;var s=Qt(i);return s==Se||s==Qe||s==me||s==wn}function Dv(i){return typeof i=="number"&&i==Re(i)}function $l(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=H}function st(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function dt(i){return i!=null&&typeof i=="object"}var Iv=Xg?Sn(Xg):nk;function JE(i,s){return i===s||Lf(i,s,Xf(s))}function e2(i,s,u){return u=typeof u=="function"?u:n,Lf(i,s,Xf(s),u)}function t2(i){return Nv(i)&&i!=+i}function n2(i){if(Fk(i))throw new ke(a);return Tm(i)}function r2(i){return i===null}function i2(i){return i==null}function Nv(i){return typeof i=="number"||dt(i)&&Qt(i)==Te}function Ms(i){if(!dt(i)||Qt(i)!=Ce)return!1;var s=sl(i);if(s===null)return!0;var u=Be.call(s,"constructor")&&s.constructor;return typeof u=="function"&&u instanceof u&&nl.call(u)==eb}var sd=Qg?Sn(Qg):rk;function o2(i){return Dv(i)&&i>=-H&&i<=H}var Mv=Zg?Sn(Zg):ik;function Dl(i){return typeof i=="string"||!Ee(i)&&dt(i)&&Qt(i)==on}function bn(i){return typeof i=="symbol"||dt(i)&&Qt(i)==ft}var Po=qg?Sn(qg):ok;function s2(i){return i===n}function a2(i){return dt(i)&&Wt(i)==ze}function l2(i){return dt(i)&&Qt(i)==Oi}var u2=kl(Df),c2=kl(function(i,s){return i<=s});function zv(i){if(!i)return[];if(an(i))return Dl(i)?Jn(i):sn(i);if(ks&&i[ks])return B_(i[ks]());var s=Wt(i),u=s==Ke?Sf:s==bt?Ja:Oo;return u(i)}function Nr(i){if(!i)return i===0?i:0;if(i=Bn(i),i===oe||i===-oe){var s=i<0?-1:1;return s*z}return i===i?i:0}function Re(i){var s=Nr(i),u=s%1;return s===s?u?s-u:s:0}function Fv(i){return i?Fi(Re(i),0,G):0}function Bn(i){if(typeof i=="number")return i;if(bn(i))return U;if(st(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=st(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=im(i);var u=Zr.test(i);return u||mo.test(i)?C_(i.slice(2),u?2:8):Di.test(i)?U:+i}function Uv(i){return mr(i,ln(i))}function f2(i){return i?Fi(Re(i),-H,H):i===0?i:0}function Ue(i){return i==null?"":_n(i)}var d2=Eo(function(i,s){if(Is(s)||an(s)){mr(s,Lt(s),i);return}for(var u in s)Be.call(s,u)&&Ps(i,u,s[u])}),jv=Eo(function(i,s){mr(s,ln(s),i)}),Il=Eo(function(i,s,u,d){mr(s,ln(s),i,d)}),p2=Eo(function(i,s,u,d){mr(s,Lt(s),i,d)}),h2=$r(Tf);function g2(i,s){var u=Co(i);return s==null?u:wm(u,s)}var m2=Ae(function(i,s){i=Xe(i);var u=-1,d=s.length,g=d>2?s[2]:n;for(g&&Zt(s[0],s[1],g)&&(d=1);++u1),S}),mr(i,Gf(i),u),d&&(u=Fn(u,y|m|b,Tk));for(var g=s.length;g--;)Ff(u,s[g]);return u});function D2(i,s){return Wv(i,Ll(ve(s)))}var I2=$r(function(i,s){return i==null?{}:lk(i,s)});function Wv(i,s){if(i==null)return{};var u=it(Gf(i),function(d){return[d]});return s=ve(s),Dm(i,u,function(d,g){return s(d,g[0])})}function N2(i,s,u){s=ii(s,i);var d=-1,g=s.length;for(g||(g=1,i=n);++ds){var d=i;i=s,s=d}if(u||i%1||s%1){var g=gm();return Bt(i+g*(s-i+k_("1e-"+((g+"").length-1))),s)}return Nf(i,s)}var G2=To(function(i,s,u){return s=s.toLowerCase(),i+(u?Kv(s):s)});function Kv(i){return ud(Ue(i).toLowerCase())}function Gv(i){return i=Ue(i),i&&i.replace(XS,M_).replace(h_,"")}function Y2(i,s,u){i=Ue(i),s=_n(s);var d=i.length;u=u===n?d:Fi(Re(u),0,d);var g=u;return u-=s.length,u>=0&&i.slice(u,g)==s}function X2(i){return i=Ue(i),i&&Jc.test(i)?i.replace(Va,z_):i}function Q2(i){return i=Ue(i),i&&rf.test(i)?i.replace(_s,"\\$&"):i}var Z2=To(function(i,s,u){return i+(u?"-":"")+s.toLowerCase()}),q2=To(function(i,s,u){return i+(u?" ":"")+s.toLowerCase()}),J2=Qm("toLowerCase");function eT(i,s,u){i=Ue(i),s=Re(s);var d=s?xo(i):0;if(!s||d>=s)return i;var g=(s-d)/2;return bl(cl(g),u)+i+bl(ul(g),u)}function tT(i,s,u){i=Ue(i),s=Re(s);var d=s?xo(i):0;return s&&d>>0,u?(i=Ue(i),i&&(typeof s=="string"||s!=null&&!sd(s))&&(s=_n(s),!s&&wo(i))?oi(Jn(i),0,u):i.split(s,u)):[]}var lT=To(function(i,s,u){return i+(u?" ":"")+ud(s)});function uT(i,s,u){return i=Ue(i),u=u==null?0:Fi(Re(u),0,i.length),s=_n(s),i.slice(u,u+s.length)==s}function cT(i,s,u){var d=w.templateSettings;u&&Zt(i,s,u)&&(s=n),i=Ue(i),s=Il({},s,d,rv);var g=Il({},s.imports,d.imports,rv),S=Lt(g),T=xf(g,S),$,M,Q=0,Z=s.interpolate||Ya,q="__p += '",se=_f((s.escape||Ya).source+"|"+Z.source+"|"+(Z===Ga?ho:Ya).source+"|"+(s.evaluate||Ya).source+"|$","g"),he="//# sourceURL="+(Be.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++w_+"]")+` -`;i.replace(se,function(xe,Le,Ne,kn,qt,Cn){return Ne||(Ne=kn),q+=i.slice(Q,Cn).replace(QS,F_),Le&&($=!0,q+=`' + -__e(`+Le+`) + +`)}function Mk(i){return Ee(i)||Wi(i)||!!(pm&&i&&i[pm])}function Dr(i,s){var u=typeof i;return s=s??H,!!s&&(u=="number"||u!="symbol"&&of.test(i))&&i>-1&&i%1==0&&i0){if(++s>=J)return arguments[0]}else s=0;return i.apply(n,arguments)}}function Tl(i,s){var u=-1,d=i.length,g=d-1;for(s=s===n?d:s;++u1?i[s-1]:n;return u=typeof u=="function"?(i.pop(),u):n,bv(i,u)});function kv(i){var s=w(i);return s.__chain__=!0,s}function YC(i,s){return s(i),i}function Rl(i,s){return s(i)}var XC=$r(function(i){var s=i.length,u=s?i[0]:0,d=this.__wrapped__,g=function(S){return Tf(S,i)};return s>1||this.__actions__.length||!(d instanceof Ie)||!Dr(u)?this.thru(g):(d=d.slice(u,+u+(s?1:0)),d.__actions__.push({func:Rl,args:[g],thisArg:n}),new zn(d,this.__chain__).thru(function(S){return s&&!S.length&&S.push(n),S}))});function QC(){return kv(this)}function ZC(){return new zn(this.value(),this.__chain__)}function qC(){this.__values__===n&&(this.__values__=zv(this.value()));var i=this.__index__>=this.__values__.length,s=i?n:this.__values__[this.__index__++];return{done:i,value:s}}function JC(){return this}function eE(i){for(var s,u=this;u instanceof pl;){var d=vv(u);d.__index__=0,d.__values__=n,s?g.__wrapped__=d:s=d;var g=d;u=u.__wrapped__}return g.__wrapped__=i,s}function tE(){var i=this.__wrapped__;if(i instanceof Ie){var s=i;return this.__actions__.length&&(s=new Ie(this)),s=s.reverse(),s.__actions__.push({func:Rl,args:[td],thisArg:n}),new zn(s,this.__chain__)}return this.thru(td)}function nE(){return Um(this.__wrapped__,this.__actions__)}var rE=xl(function(i,s,u){Be.call(i,u)?++i[u]:Lr(i,u,1)});function iE(i,s,u){var d=Ee(i)?Jg:Yb;return u&&Zt(i,s,u)&&(s=n),d(i,ve(s,3))}function oE(i,s){var u=Ee(i)?qr:bm;return u(i,ve(s,3))}var sE=Zm(yv),aE=Zm(wv);function lE(i,s){return Mt(Pl(i,s),1)}function uE(i,s){return Mt(Pl(i,s),oe)}function cE(i,s,u){return u=u===n?1:Re(u),Mt(Pl(i,s),u)}function Cv(i,s){var u=Ee(i)?Nn:ni;return u(i,ve(s,3))}function Ev(i,s){var u=Ee(i)?P_:_m;return u(i,ve(s,3))}var fE=xl(function(i,s,u){Be.call(i,u)?i[u].push(s):Lr(i,u,[s])});function dE(i,s,u,d){i=an(i)?i:Oo(i),u=u&&!d?Re(u):0;var g=i.length;return u<0&&(u=Tt(g+u,0)),Dl(i)?u<=g&&i.indexOf(s,u)>-1:!!g&&yo(i,s,u)>-1}var pE=Le(function(i,s,u){var d=-1,g=typeof s=="function",S=an(i)?W(i.length):[];return ni(i,function(T){S[++d]=g?xn(s,T,u):Ls(T,s,u)}),S}),hE=xl(function(i,s,u){Lr(i,u,s)});function Pl(i,s){var u=Ee(i)?it:Pm;return u(i,ve(s,3))}function gE(i,s,u,d){return i==null?[]:(Ee(s)||(s=s==null?[]:[s]),u=d?n:u,Ee(u)||(u=u==null?[]:[u]),$m(i,s,u))}var mE=xl(function(i,s,u){i[u?0:1].push(s)},function(){return[[],[]]});function vE(i,s,u){var d=Ee(i)?hf:rm,g=arguments.length<3;return d(i,ve(s,4),u,g,ni)}function yE(i,s,u){var d=Ee(i)?O_:rm,g=arguments.length<3;return d(i,ve(s,4),u,g,_m)}function wE(i,s){var u=Ee(i)?qr:bm;return u(i,Al(ve(s,3)))}function xE(i){var s=Ee(i)?ym:dk;return s(i)}function SE(i,s,u){(u?Zt(i,s,u):s===n)?s=1:s=Re(s);var d=Ee(i)?Wb:pk;return d(i,s)}function _E(i){var s=Ee(i)?Hb:gk;return s(i)}function bE(i){if(i==null)return 0;if(an(i))return Dl(i)?xo(i):i.length;var s=Wt(i);return s==Ke||s==bt?i.size:$f(i).length}function kE(i,s,u){var d=Ee(i)?gf:mk;return u&&Zt(i,s,u)&&(s=n),d(i,ve(s,3))}var CE=Le(function(i,s){if(i==null)return[];var u=s.length;return u>1&&Zt(i,s[0],s[1])?s=[]:u>2&&Zt(s[0],s[1],s[2])&&(s=[s[0]]),$m(i,Mt(s,1),[])}),Ol=ob||function(){return Nt.Date.now()};function EE(i,s){if(typeof s!="function")throw new Mn(l);return i=Re(i),function(){if(--i<1)return s.apply(this,arguments)}}function Tv(i,s,u){return s=u?n:s,s=i&&s==null?i.length:s,Ar(i,D,n,n,n,n,s)}function Rv(i,s){var u;if(typeof s!="function")throw new Mn(l);return i=Re(i),function(){return--i>0&&(u=s.apply(this,arguments)),i<=1&&(s=n),u}}var rd=Le(function(i,s,u){var d=A;if(u.length){var g=ei(u,Ro(rd));d|=E}return Ar(i,d,s,u,g)}),Pv=Le(function(i,s,u){var d=A|_;if(u.length){var g=ei(u,Ro(Pv));d|=E}return Ar(s,d,i,u,g)});function Ov(i,s,u){s=u?n:s;var d=Ar(i,x,n,n,n,n,n,s);return d.placeholder=Ov.placeholder,d}function Lv(i,s,u){s=u?n:s;var d=Ar(i,k,n,n,n,n,n,s);return d.placeholder=Lv.placeholder,d}function Av(i,s,u){var d,g,S,T,$,M,Q=0,Z=!1,q=!1,se=!0;if(typeof i!="function")throw new Mn(l);s=Bn(s)||0,st(u)&&(Z=!!u.leading,q="maxWait"in u,S=q?Tt(Bn(u.maxWait)||0,s):S,se="trailing"in u?!!u.trailing:se);function he(mt){var nr=d,Mr=g;return d=g=n,Q=mt,T=i.apply(Mr,nr),T}function we(mt){return Q=mt,$=Ns(Ae,s),Z?he(mt):T}function Oe(mt){var nr=mt-M,Mr=mt-Q,Zv=s-nr;return q?Bt(Zv,S-Mr):Zv}function xe(mt){var nr=mt-M,Mr=mt-Q;return M===n||nr>=s||nr<0||q&&Mr>=S}function Ae(){var mt=Ol();if(xe(mt))return Ne(mt);$=Ns(Ae,Oe(mt))}function Ne(mt){return $=n,se&&d?he(mt):(d=g=n,T)}function kn(){$!==n&&Bm($),Q=0,d=M=g=$=n}function qt(){return $===n?T:Ne(Ol())}function Cn(){var mt=Ol(),nr=xe(mt);if(d=arguments,g=this,M=mt,nr){if($===n)return we(M);if(q)return Bm($),$=Ns(Ae,s),he(M)}return $===n&&($=Ns(Ae,s)),T}return Cn.cancel=kn,Cn.flush=qt,Cn}var TE=Le(function(i,s){return Sm(i,1,s)}),RE=Le(function(i,s,u){return Sm(i,Bn(s)||0,u)});function PE(i){return Ar(i,j)}function Ll(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new Mn(l);var u=function(){var d=arguments,g=s?s.apply(this,d):d[0],S=u.cache;if(S.has(g))return S.get(g);var T=i.apply(this,d);return u.cache=S.set(g,T)||S,T};return u.cache=new(Ll.Cache||Or),u}Ll.Cache=Or;function Al(i){if(typeof i!="function")throw new Mn(l);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function OE(i){return Rv(2,i)}var LE=vk(function(i,s){s=s.length==1&&Ee(s[0])?it(s[0],Sn(ve())):it(Mt(s,1),Sn(ve()));var u=s.length;return Le(function(d){for(var g=-1,S=Bt(d.length,u);++g=s}),Wi=Em(function(){return arguments}())?Em:function(i){return dt(i)&&Be.call(i,"callee")&&!dm.call(i,"callee")},Ee=W.isArray,KE=Gg?Sn(Gg):ek;function an(i){return i!=null&&$l(i.length)&&!Ir(i)}function gt(i){return dt(i)&&an(i)}function GE(i){return i===!0||i===!1||dt(i)&&Qt(i)==te}var si=ab||gd,YE=Yg?Sn(Yg):tk;function XE(i){return dt(i)&&i.nodeType===1&&!Ms(i)}function QE(i){if(i==null)return!0;if(an(i)&&(Ee(i)||typeof i=="string"||typeof i.splice=="function"||si(i)||Po(i)||Wi(i)))return!i.length;var s=Wt(i);if(s==Ke||s==bt)return!i.size;if(Is(i))return!$f(i).length;for(var u in i)if(Be.call(i,u))return!1;return!0}function ZE(i,s){return As(i,s)}function qE(i,s,u){u=typeof u=="function"?u:n;var d=u?u(i,s):n;return d===n?As(i,s,n,u):!!d}function od(i){if(!dt(i))return!1;var s=Qt(i);return s==be||s==Pe||typeof i.message=="string"&&typeof i.name=="string"&&!Ms(i)}function JE(i){return typeof i=="number"&&hm(i)}function Ir(i){if(!st(i))return!1;var s=Qt(i);return s==Se||s==Qe||s==me||s==wn}function Dv(i){return typeof i=="number"&&i==Re(i)}function $l(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=H}function st(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function dt(i){return i!=null&&typeof i=="object"}var Iv=Xg?Sn(Xg):rk;function e2(i,s){return i===s||Af(i,s,Xf(s))}function t2(i,s,u){return u=typeof u=="function"?u:n,Af(i,s,Xf(s),u)}function n2(i){return Nv(i)&&i!=+i}function r2(i){if(Uk(i))throw new ke(a);return Tm(i)}function i2(i){return i===null}function o2(i){return i==null}function Nv(i){return typeof i=="number"||dt(i)&&Qt(i)==Te}function Ms(i){if(!dt(i)||Qt(i)!=Ce)return!1;var s=sl(i);if(s===null)return!0;var u=Be.call(s,"constructor")&&s.constructor;return typeof u=="function"&&u instanceof u&&nl.call(u)==tb}var sd=Qg?Sn(Qg):ik;function s2(i){return Dv(i)&&i>=-H&&i<=H}var Mv=Zg?Sn(Zg):ok;function Dl(i){return typeof i=="string"||!Ee(i)&&dt(i)&&Qt(i)==on}function bn(i){return typeof i=="symbol"||dt(i)&&Qt(i)==ft}var Po=qg?Sn(qg):sk;function a2(i){return i===n}function l2(i){return dt(i)&&Wt(i)==ze}function u2(i){return dt(i)&&Qt(i)==Oi}var c2=kl(Df),f2=kl(function(i,s){return i<=s});function zv(i){if(!i)return[];if(an(i))return Dl(i)?Jn(i):sn(i);if(ks&&i[ks])return W_(i[ks]());var s=Wt(i),u=s==Ke?Sf:s==bt?Ja:Oo;return u(i)}function Nr(i){if(!i)return i===0?i:0;if(i=Bn(i),i===oe||i===-oe){var s=i<0?-1:1;return s*z}return i===i?i:0}function Re(i){var s=Nr(i),u=s%1;return s===s?u?s-u:s:0}function Fv(i){return i?Fi(Re(i),0,G):0}function Bn(i){if(typeof i=="number")return i;if(bn(i))return U;if(st(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=st(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=im(i);var u=Zr.test(i);return u||mo.test(i)?E_(i.slice(2),u?2:8):Di.test(i)?U:+i}function Uv(i){return mr(i,ln(i))}function d2(i){return i?Fi(Re(i),-H,H):i===0?i:0}function Ue(i){return i==null?"":_n(i)}var p2=Eo(function(i,s){if(Is(s)||an(s)){mr(s,At(s),i);return}for(var u in s)Be.call(s,u)&&Ps(i,u,s[u])}),jv=Eo(function(i,s){mr(s,ln(s),i)}),Il=Eo(function(i,s,u,d){mr(s,ln(s),i,d)}),h2=Eo(function(i,s,u,d){mr(s,At(s),i,d)}),g2=$r(Tf);function m2(i,s){var u=Co(i);return s==null?u:wm(u,s)}var v2=Le(function(i,s){i=Xe(i);var u=-1,d=s.length,g=d>2?s[2]:n;for(g&&Zt(s[0],s[1],g)&&(d=1);++u1),S}),mr(i,Gf(i),u),d&&(u=Fn(u,y|m|b,Rk));for(var g=s.length;g--;)Ff(u,s[g]);return u});function I2(i,s){return Wv(i,Al(ve(s)))}var N2=$r(function(i,s){return i==null?{}:uk(i,s)});function Wv(i,s){if(i==null)return{};var u=it(Gf(i),function(d){return[d]});return s=ve(s),Dm(i,u,function(d,g){return s(d,g[0])})}function M2(i,s,u){s=ii(s,i);var d=-1,g=s.length;for(g||(g=1,i=n);++ds){var d=i;i=s,s=d}if(u||i%1||s%1){var g=gm();return Bt(i+g*(s-i+C_("1e-"+((g+"").length-1))),s)}return Nf(i,s)}var Y2=To(function(i,s,u){return s=s.toLowerCase(),i+(u?Kv(s):s)});function Kv(i){return ud(Ue(i).toLowerCase())}function Gv(i){return i=Ue(i),i&&i.replace(QS,z_).replace(g_,"")}function X2(i,s,u){i=Ue(i),s=_n(s);var d=i.length;u=u===n?d:Fi(Re(u),0,d);var g=u;return u-=s.length,u>=0&&i.slice(u,g)==s}function Q2(i){return i=Ue(i),i&&Jc.test(i)?i.replace(Va,F_):i}function Z2(i){return i=Ue(i),i&&rf.test(i)?i.replace(_s,"\\$&"):i}var q2=To(function(i,s,u){return i+(u?"-":"")+s.toLowerCase()}),J2=To(function(i,s,u){return i+(u?" ":"")+s.toLowerCase()}),eT=Qm("toLowerCase");function tT(i,s,u){i=Ue(i),s=Re(s);var d=s?xo(i):0;if(!s||d>=s)return i;var g=(s-d)/2;return bl(cl(g),u)+i+bl(ul(g),u)}function nT(i,s,u){i=Ue(i),s=Re(s);var d=s?xo(i):0;return s&&d>>0,u?(i=Ue(i),i&&(typeof s=="string"||s!=null&&!sd(s))&&(s=_n(s),!s&&wo(i))?oi(Jn(i),0,u):i.split(s,u)):[]}var uT=To(function(i,s,u){return i+(u?" ":"")+ud(s)});function cT(i,s,u){return i=Ue(i),u=u==null?0:Fi(Re(u),0,i.length),s=_n(s),i.slice(u,u+s.length)==s}function fT(i,s,u){var d=w.templateSettings;u&&Zt(i,s,u)&&(s=n),i=Ue(i),s=Il({},s,d,rv);var g=Il({},s.imports,d.imports,rv),S=At(g),T=xf(g,S),$,M,Q=0,Z=s.interpolate||Ya,q="__p += '",se=_f((s.escape||Ya).source+"|"+Z.source+"|"+(Z===Ga?ho:Ya).source+"|"+(s.evaluate||Ya).source+"|$","g"),he="//# sourceURL="+(Be.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++x_+"]")+` +`;i.replace(se,function(xe,Ae,Ne,kn,qt,Cn){return Ne||(Ne=kn),q+=i.slice(Q,Cn).replace(ZS,U_),Ae&&($=!0,q+=`' + +__e(`+Ae+`) + '`),qt&&(M=!0,q+=`'; `+qt+`; __p += '`),Ne&&(q+=`' + @@ -310,7 +310,7 @@ __p += '`),Ne&&(q+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+q+`return __p -}`;var Oe=Xv(function(){return Fe(S,he+"return "+q).apply(n,T)});if(Oe.source=q,od(Oe))throw Oe;return Oe}function fT(i){return Ue(i).toLowerCase()}function dT(i){return Ue(i).toUpperCase()}function pT(i,s,u){if(i=Ue(i),i&&(u||s===n))return im(i);if(!i||!(s=_n(s)))return i;var d=Jn(i),g=Jn(s),S=om(d,g),T=sm(d,g)+1;return oi(d,S,T).join("")}function hT(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.slice(0,lm(i)+1);if(!i||!(s=_n(s)))return i;var d=Jn(i),g=sm(d,Jn(s))+1;return oi(d,0,g).join("")}function gT(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.replace(de,"");if(!i||!(s=_n(s)))return i;var d=Jn(i),g=om(d,Jn(s));return oi(d,g).join("")}function mT(i,s){var u=I,d=X;if(st(s)){var g="separator"in s?s.separator:g;u="length"in s?Re(s.length):u,d="omission"in s?_n(s.omission):d}i=Ue(i);var S=i.length;if(wo(i)){var T=Jn(i);S=T.length}if(u>=S)return i;var $=u-xo(d);if($<1)return d;var M=T?oi(T,0,$).join(""):i.slice(0,$);if(g===n)return M+d;if(T&&($+=M.length-$),sd(g)){if(i.slice($).search(g)){var Q,Z=M;for(g.global||(g=_f(g.source,Ue($i.exec(g))+"g")),g.lastIndex=0;Q=g.exec(Z);)var q=Q.index;M=M.slice(0,q===n?$:q)}}else if(i.indexOf(_n(g),$)!=$){var se=M.lastIndexOf(g);se>-1&&(M=M.slice(0,se))}return M+d}function vT(i){return i=Ue(i),i&&qc.test(i)?i.replace(Ha,K_):i}var yT=To(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),ud=Qm("toUpperCase");function Yv(i,s,u){return i=Ue(i),s=u?n:s,s===n?j_(i)?X_(i):L_(i):i.match(s)||[]}var Xv=Ae(function(i,s){try{return xn(i,n,s)}catch(u){return od(u)?u:new ke(u)}}),wT=$r(function(i,s){return Nn(s,function(u){u=vr(u),Ar(i,u,rd(i[u],i))}),i});function xT(i){var s=i==null?0:i.length,u=ve();return i=s?it(i,function(d){if(typeof d[1]!="function")throw new Mn(l);return[u(d[0]),d[1]]}):[],Ae(function(d){for(var g=-1;++gH)return[];var u=G,d=Bt(i,G);s=ve(s),i-=G;for(var g=wf(d,s);++u0||s<0)?new Ie(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==n&&(s=Re(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Ie.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ie.prototype.toArray=function(){return this.take(G)},gr(Ie.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),d=/^(?:head|last)$/.test(s),g=w[d?"take"+(s=="last"?"Right":""):s],S=d||/^find/.test(s);g&&(w.prototype[s]=function(){var T=this.__wrapped__,$=d?[1]:arguments,M=T instanceof Ie,Q=$[0],Z=M||Ee(T),q=function(Le){var Ne=g.apply(w,Jr([Le],$));return d&&se?Ne[0]:Ne};Z&&u&&typeof Q=="function"&&Q.length!=1&&(M=Z=!1);var se=this.__chain__,he=!!this.__actions__.length,we=S&&!se,Oe=M&&!he;if(!S&&Z){T=Oe?T:new Ie(this);var xe=i.apply(T,$);return xe.__actions__.push({func:Rl,args:[q],thisArg:n}),new zn(xe,se)}return we&&Oe?i.apply(this,$):(xe=this.thru(q),we?d?xe.value()[0]:xe.value():xe)})}),Nn(["pop","push","shift","sort","splice","unshift"],function(i){var s=el[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);w.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var S=this.value();return s.apply(Ee(S)?S:[],g)}return this[u](function(T){return s.apply(Ee(T)?T:[],g)})}}),gr(Ie.prototype,function(i,s){var u=w[s];if(u){var d=u.name+"";Be.call(ko,d)||(ko[d]=[]),ko[d].push({name:s,func:u})}}),ko[Sl(n,_).name]=[{name:"wrapper",func:n}],Ie.prototype.clone=vb,Ie.prototype.reverse=yb,Ie.prototype.value=wb,w.prototype.at=YC,w.prototype.chain=XC,w.prototype.commit=QC,w.prototype.next=ZC,w.prototype.plant=JC,w.prototype.reverse=eE,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=tE,w.prototype.first=w.prototype.head,ks&&(w.prototype[ks]=qC),w},So=Q_();Ii?((Ii.exports=So)._=So,ff._=So):Nt._=So}).call(zs)})(nc,nc.exports);var VD=nc.exports;const KD=le.div` +}`;var Oe=Xv(function(){return Fe(S,he+"return "+q).apply(n,T)});if(Oe.source=q,od(Oe))throw Oe;return Oe}function dT(i){return Ue(i).toLowerCase()}function pT(i){return Ue(i).toUpperCase()}function hT(i,s,u){if(i=Ue(i),i&&(u||s===n))return im(i);if(!i||!(s=_n(s)))return i;var d=Jn(i),g=Jn(s),S=om(d,g),T=sm(d,g)+1;return oi(d,S,T).join("")}function gT(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.slice(0,lm(i)+1);if(!i||!(s=_n(s)))return i;var d=Jn(i),g=sm(d,Jn(s))+1;return oi(d,0,g).join("")}function mT(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.replace(de,"");if(!i||!(s=_n(s)))return i;var d=Jn(i),g=om(d,Jn(s));return oi(d,g).join("")}function vT(i,s){var u=I,d=X;if(st(s)){var g="separator"in s?s.separator:g;u="length"in s?Re(s.length):u,d="omission"in s?_n(s.omission):d}i=Ue(i);var S=i.length;if(wo(i)){var T=Jn(i);S=T.length}if(u>=S)return i;var $=u-xo(d);if($<1)return d;var M=T?oi(T,0,$).join(""):i.slice(0,$);if(g===n)return M+d;if(T&&($+=M.length-$),sd(g)){if(i.slice($).search(g)){var Q,Z=M;for(g.global||(g=_f(g.source,Ue($i.exec(g))+"g")),g.lastIndex=0;Q=g.exec(Z);)var q=Q.index;M=M.slice(0,q===n?$:q)}}else if(i.indexOf(_n(g),$)!=$){var se=M.lastIndexOf(g);se>-1&&(M=M.slice(0,se))}return M+d}function yT(i){return i=Ue(i),i&&qc.test(i)?i.replace(Ha,G_):i}var wT=To(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),ud=Qm("toUpperCase");function Yv(i,s,u){return i=Ue(i),s=u?n:s,s===n?B_(i)?Q_(i):$_(i):i.match(s)||[]}var Xv=Le(function(i,s){try{return xn(i,n,s)}catch(u){return od(u)?u:new ke(u)}}),xT=$r(function(i,s){return Nn(s,function(u){u=vr(u),Lr(i,u,rd(i[u],i))}),i});function ST(i){var s=i==null?0:i.length,u=ve();return i=s?it(i,function(d){if(typeof d[1]!="function")throw new Mn(l);return[u(d[0]),d[1]]}):[],Le(function(d){for(var g=-1;++gH)return[];var u=G,d=Bt(i,G);s=ve(s),i-=G;for(var g=wf(d,s);++u0||s<0)?new Ie(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==n&&(s=Re(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Ie.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ie.prototype.toArray=function(){return this.take(G)},gr(Ie.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),d=/^(?:head|last)$/.test(s),g=w[d?"take"+(s=="last"?"Right":""):s],S=d||/^find/.test(s);g&&(w.prototype[s]=function(){var T=this.__wrapped__,$=d?[1]:arguments,M=T instanceof Ie,Q=$[0],Z=M||Ee(T),q=function(Ae){var Ne=g.apply(w,Jr([Ae],$));return d&&se?Ne[0]:Ne};Z&&u&&typeof Q=="function"&&Q.length!=1&&(M=Z=!1);var se=this.__chain__,he=!!this.__actions__.length,we=S&&!se,Oe=M&&!he;if(!S&&Z){T=Oe?T:new Ie(this);var xe=i.apply(T,$);return xe.__actions__.push({func:Rl,args:[q],thisArg:n}),new zn(xe,se)}return we&&Oe?i.apply(this,$):(xe=this.thru(q),we?d?xe.value()[0]:xe.value():xe)})}),Nn(["pop","push","shift","sort","splice","unshift"],function(i){var s=el[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);w.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var S=this.value();return s.apply(Ee(S)?S:[],g)}return this[u](function(T){return s.apply(Ee(T)?T:[],g)})}}),gr(Ie.prototype,function(i,s){var u=w[s];if(u){var d=u.name+"";Be.call(ko,d)||(ko[d]=[]),ko[d].push({name:s,func:u})}}),ko[Sl(n,_).name]=[{name:"wrapper",func:n}],Ie.prototype.clone=yb,Ie.prototype.reverse=wb,Ie.prototype.value=xb,w.prototype.at=XC,w.prototype.chain=QC,w.prototype.commit=ZC,w.prototype.next=qC,w.prototype.plant=eE,w.prototype.reverse=tE,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=nE,w.prototype.first=w.prototype.head,ks&&(w.prototype[ks]=JC),w},So=Z_();Ii?((Ii.exports=So)._=So,ff._=So):Nt._=So}).call(zs)})(nc,nc.exports);var VD=nc.exports;const KD=le.div` background-color: ${ge.background}; padding-right: 10px; overflow-y: auto; @@ -366,21 +366,21 @@ function print() { __p += __j.call(arguments, '') } cursor: default; user-select: text; } -`,ZD=({tracks:e,onTrackChange:t,onTimeChange:n,onEditTrack:r,isDubbingService:o,showSpeakerColors:a,isMediaFullyLoaded:l=!0})=>{const{t:c}=so(),f=b=>{n(b-.2)},p=b=>{b.style.height="auto",b.style.height=`${Math.max(b.scrollHeight,b.clientHeight)}px`},h=B.useMemo(()=>VD.debounce((b,C)=>{t(b,C,!0)},1e3),[t]),y=B.useCallback((b,C)=>{const O=e.find(_=>_.id===b);if(!O)return;const L={...O};o?(L.translated_text=C.target.value,L.needsResynthesis=L.translated_text!==O.translated_text):L.text=C.target.value,t(b,L,!1),p(C.target),h(b,L)},[e,o,t,h]);B.useEffect(()=>{document.querySelectorAll(".track-textarea").forEach(p)},[e]),B.useEffect(()=>()=>{h.cancel()},[h]);const m=(b,C)=>{const O=e.find(_=>_.id===b);if(!O)return;const L={...O,deleted:C};t(b,L,!0)};return A.jsx(KD,{children:e.map((b,C)=>{var O;return A.jsxs(GD,{speakerColor:a?(O=Ot.getSpeakerById(b.speaker_id))==null?void 0:O.color:void 0,isDeleted:b.deleted,children:[A.jsx(YD,{onClick:()=>f(b.start),children:qD(b.start)}),A.jsxs(XD,{children:[A.jsx(QD,{className:"track-textarea",value:o?b.translated_text:b.text,onChange:L=>y(b.id,L),onFocus:L=>p(L.target),readOnly:b.deleted||!l,isDeleted:b.deleted}),b.deleted?A.jsx(qd,{onClick:()=>m(b.id,!1),title:c("undo"),disabled:!l,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})}):A.jsxs(A.Fragment,{children:[A.jsx(qd,{onClick:()=>r(b),title:c("edit"),disabled:!l,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",fill:"currentColor"})})}),A.jsx(qd,{onClick:()=>m(b.id,!0),title:c("delete"),disabled:!l,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",fill:"currentColor"})})})]})]})]},b.id)})})},qD=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var JD={exports:{}};(function(e){var t=function(n){var r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(z,U,G){z[U]=G.value},l,c=typeof Symbol=="function"?Symbol:{},f=c.iterator||"@@iterator",p=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function y(z,U,G){return Object.defineProperty(z,U,{value:G,enumerable:!0,configurable:!0,writable:!0}),z[U]}try{y({},"")}catch{y=function(U,G,Y){return U[G]=Y}}function m(z,U,G,Y){var V=U&&U.prototype instanceof x?U:x,ee=Object.create(V.prototype),ue=new pe(Y||[]);return a(ee,"_invoke",{value:J(z,G,ue)}),ee}n.wrap=m;function b(z,U,G){try{return{type:"normal",arg:z.call(U,G)}}catch(Y){return{type:"throw",arg:Y}}}var C="suspendedStart",O="suspendedYield",L="executing",_="completed",v={};function x(){}function k(){}function E(){}var R={};y(R,f,function(){return this});var D=Object.getPrototypeOf,P=D&&D(D(oe([])));P&&P!==r&&o.call(P,f)&&(R=P);var j=E.prototype=x.prototype=Object.create(R);k.prototype=E,a(j,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:k,configurable:!0}),k.displayName=y(E,h,"GeneratorFunction");function I(z){["next","throw","return"].forEach(function(U){y(z,U,function(G){return this._invoke(U,G)})})}n.isGeneratorFunction=function(z){var U=typeof z=="function"&&z.constructor;return U?U===k||(U.displayName||U.name)==="GeneratorFunction":!1},n.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,E):(z.__proto__=E,y(z,h,"GeneratorFunction")),z.prototype=Object.create(j),z},n.awrap=function(z){return{__await:z}};function X(z,U){function G(ee,ue,F,me){var te=b(z[ee],z,ue);if(te.type==="throw")me(te.arg);else{var De=te.arg,Pe=De.value;return Pe&&typeof Pe=="object"&&o.call(Pe,"__await")?U.resolve(Pe.__await).then(function(be){G("next",be,F,me)},function(be){G("throw",be,F,me)}):U.resolve(Pe).then(function(be){De.value=be,F(De)},function(be){return G("throw",be,F,me)})}}var Y;function V(ee,ue){function F(){return new U(function(me,te){G(ee,ue,me,te)})}return Y=Y?Y.then(F,F):F()}a(this,"_invoke",{value:V})}I(X.prototype),y(X.prototype,p,function(){return this}),n.AsyncIterator=X,n.async=function(z,U,G,Y,V){V===void 0&&(V=Promise);var ee=new X(m(z,U,G,Y),V);return n.isGeneratorFunction(U)?ee:ee.next().then(function(ue){return ue.done?ue.value:ee.next()})};function J(z,U,G){var Y=C;return function(ee,ue){if(Y===L)throw new Error("Generator is already running");if(Y===_){if(ee==="throw")throw ue;return H()}for(G.method=ee,G.arg=ue;;){var F=G.delegate;if(F){var me=ie(F,G);if(me){if(me===v)continue;return me}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(Y===C)throw Y=_,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);Y=L;var te=b(z,U,G);if(te.type==="normal"){if(Y=G.done?_:O,te.arg===v)continue;return{value:te.arg,done:G.done}}else te.type==="throw"&&(Y=_,G.method="throw",G.arg=te.arg)}}}function ie(z,U){var G=U.method,Y=z.iterator[G];if(Y===l)return U.delegate=null,G==="throw"&&z.iterator.return&&(U.method="return",U.arg=l,ie(z,U),U.method==="throw")||G!=="return"&&(U.method="throw",U.arg=new TypeError("The iterator does not provide a '"+G+"' method")),v;var V=b(Y,z.iterator,U.arg);if(V.type==="throw")return U.method="throw",U.arg=V.arg,U.delegate=null,v;var ee=V.arg;if(!ee)return U.method="throw",U.arg=new TypeError("iterator result is not an object"),U.delegate=null,v;if(ee.done)U[z.resultName]=ee.value,U.next=z.nextLoc,U.method!=="return"&&(U.method="next",U.arg=l);else return ee;return U.delegate=null,v}I(j),y(j,h,"Generator"),y(j,f,function(){return this}),y(j,"toString",function(){return"[object Generator]"});function re(z){var U={tryLoc:z[0]};1 in z&&(U.catchLoc=z[1]),2 in z&&(U.finallyLoc=z[2],U.afterLoc=z[3]),this.tryEntries.push(U)}function ae(z){var U=z.completion||{};U.type="normal",delete U.arg,z.completion=U}function pe(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(re,this),this.reset(!0)}n.keys=function(z){var U=Object(z),G=[];for(var Y in U)G.push(Y);return G.reverse(),function V(){for(;G.length;){var ee=G.pop();if(ee in U)return V.value=ee,V.done=!1,V}return V.done=!0,V}};function oe(z){if(z){var U=z[f];if(U)return U.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var G=-1,Y=function V(){for(;++G=0;--Y){var V=this.tryEntries[Y],ee=V.completion;if(V.tryLoc==="root")return G("end");if(V.tryLoc<=this.prev){var ue=o.call(V,"catchLoc"),F=o.call(V,"finallyLoc");if(ue&&F){if(this.prev=0;--G){var Y=this.tryEntries[G];if(Y.tryLoc<=this.prev&&o.call(Y,"finallyLoc")&&this.prev=0;--U){var G=this.tryEntries[U];if(G.finallyLoc===z)return this.complete(G.completion,G.afterLoc),ae(G),v}},catch:function(z){for(var U=this.tryEntries.length-1;U>=0;--U){var G=this.tryEntries[U];if(G.tryLoc===z){var Y=G.completion;if(Y.type==="throw"){var V=Y.arg;ae(G)}return V}}throw new Error("illegal catch attempt")},delegateYield:function(z,U,G){return this.delegate={iterator:oe(z),resultName:U,nextLoc:G},this.method==="next"&&(this.arg=l),v}},n}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}})(JD);var eI={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}},tI=(e,t)=>{const n=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach((r,o)=>{const a=e.lengthBytesUTF8(r)+1,l=e._malloc(a);e.stringToUTF8(r,l,a),e.setValue(n+Uint32Array.BYTES_PER_ELEMENT*o,l,"i32")}),[t.length,n]};const nI="@ffmpeg/ffmpeg",rI="0.11.6",iI="FFmpeg WebAssembly version",oI="src/index.js",sI="src/index.d.ts",aI={example:"examples"},lI={start:"node scripts/server.js","start:worker":"node scripts/worker-server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js","build:worker":"rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",prepublishOnly:"npm run build",lint:"eslint src",wait:"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node node_modules/mocha/bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},uI={"./src/node/index.js":"./src/browser/index.js"},cI={type:"git",url:"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},fI=["ffmpeg","WebAssembly","video"],dI="Jerome Wu ",pI="MIT",hI={url:"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},gI={node:">=12.16.1"},mI="https://github.com/ffmpegwasm/ffmpeg.wasm#readme",vI={"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},yI={"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.11.0","@types/emscripten":"^1.39.4","babel-eslint":"^10.1.0","babel-loader":"^8.1.0",chai:"^4.2.0",cors:"^2.8.5",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1",express:"^4.17.1",mocha:"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0",webpack:"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"},NS={name:nI,version:rI,description:iI,main:oI,types:sI,directories:aI,scripts:lI,browser:uI,repository:cI,keywords:fI,author:dI,license:pI,bugs:hI,engines:gI,homepage:mI,dependencies:vI,devDependencies:yI},wI=(typeof process<"u",`https://unpkg.com/@ffmpeg/core@${NS.devDependencies["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`),xI={corePath:wI};let Cg=!1,MS=()=>{};const SI=e=>{Cg=e},_I=e=>{MS=e},bI=(e,t)=>{MS({type:e,message:t}),Cg&&console.log(`[${e}] ${t}`)};var Xi={logging:Cg,setLogging:SI,setCustomLogger:_I,log:bI};const kI=e=>` +`,ZD=({tracks:e,onTrackChange:t,onTimeChange:n,onEditTrack:r,isDubbingService:o,showSpeakerColors:a,isMediaFullyLoaded:l=!0})=>{const{t:c}=so(),f=b=>{n(b-.2)},p=b=>{b.style.height="auto",b.style.height=`${Math.max(b.scrollHeight,b.clientHeight)}px`},h=B.useMemo(()=>VD.debounce((b,C)=>{t(b,C,!0)},1e3),[t]),y=B.useCallback((b,C)=>{const O=e.find(_=>_.id===b);if(!O)return;const A={...O};o?(A.translated_text=C.target.value,A.needsResynthesis=A.translated_text!==O.translated_text):A.text=C.target.value,t(b,A,!1),p(C.target),h(b,A)},[e,o,t,h]);B.useEffect(()=>{document.querySelectorAll(".track-textarea").forEach(p)},[e]),B.useEffect(()=>()=>{h.cancel()},[h]);const m=(b,C)=>{const O=e.find(_=>_.id===b);if(!O)return;const A={...O,deleted:C};t(b,A,!0)};return L.jsx(KD,{children:e.map((b,C)=>{var O;return L.jsxs(GD,{speakerColor:a?(O=Ot.getSpeakerById(b.speaker_id))==null?void 0:O.color:void 0,isDeleted:b.deleted,children:[L.jsx(YD,{onClick:()=>f(b.start),children:qD(b.start)}),L.jsxs(XD,{children:[L.jsx(QD,{className:"track-textarea",value:o?b.translated_text:b.text,onChange:A=>y(b.id,A),onFocus:A=>p(A.target),readOnly:b.deleted||!l,isDeleted:b.deleted}),b.deleted?L.jsx(qd,{onClick:()=>m(b.id,!1),title:c("undo"),disabled:!l,children:L.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:L.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})}):L.jsxs(L.Fragment,{children:[L.jsx(qd,{onClick:()=>r(b),title:c("edit"),disabled:!l,children:L.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:L.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",fill:"currentColor"})})}),L.jsx(qd,{onClick:()=>m(b.id,!0),title:c("delete"),disabled:!l,children:L.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:L.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",fill:"currentColor"})})})]})]})]},b.id)})})},qD=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var JD={exports:{}};(function(e){var t=function(n){var r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(z,U,G){z[U]=G.value},l,c=typeof Symbol=="function"?Symbol:{},f=c.iterator||"@@iterator",p=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function y(z,U,G){return Object.defineProperty(z,U,{value:G,enumerable:!0,configurable:!0,writable:!0}),z[U]}try{y({},"")}catch{y=function(U,G,Y){return U[G]=Y}}function m(z,U,G,Y){var V=U&&U.prototype instanceof x?U:x,ee=Object.create(V.prototype),ue=new pe(Y||[]);return a(ee,"_invoke",{value:J(z,G,ue)}),ee}n.wrap=m;function b(z,U,G){try{return{type:"normal",arg:z.call(U,G)}}catch(Y){return{type:"throw",arg:Y}}}var C="suspendedStart",O="suspendedYield",A="executing",_="completed",v={};function x(){}function k(){}function E(){}var R={};y(R,f,function(){return this});var D=Object.getPrototypeOf,P=D&&D(D(oe([])));P&&P!==r&&o.call(P,f)&&(R=P);var j=E.prototype=x.prototype=Object.create(R);k.prototype=E,a(j,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:k,configurable:!0}),k.displayName=y(E,h,"GeneratorFunction");function I(z){["next","throw","return"].forEach(function(U){y(z,U,function(G){return this._invoke(U,G)})})}n.isGeneratorFunction=function(z){var U=typeof z=="function"&&z.constructor;return U?U===k||(U.displayName||U.name)==="GeneratorFunction":!1},n.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,E):(z.__proto__=E,y(z,h,"GeneratorFunction")),z.prototype=Object.create(j),z},n.awrap=function(z){return{__await:z}};function X(z,U){function G(ee,ue,F,me){var te=b(z[ee],z,ue);if(te.type==="throw")me(te.arg);else{var De=te.arg,Pe=De.value;return Pe&&typeof Pe=="object"&&o.call(Pe,"__await")?U.resolve(Pe.__await).then(function(be){G("next",be,F,me)},function(be){G("throw",be,F,me)}):U.resolve(Pe).then(function(be){De.value=be,F(De)},function(be){return G("throw",be,F,me)})}}var Y;function V(ee,ue){function F(){return new U(function(me,te){G(ee,ue,me,te)})}return Y=Y?Y.then(F,F):F()}a(this,"_invoke",{value:V})}I(X.prototype),y(X.prototype,p,function(){return this}),n.AsyncIterator=X,n.async=function(z,U,G,Y,V){V===void 0&&(V=Promise);var ee=new X(m(z,U,G,Y),V);return n.isGeneratorFunction(U)?ee:ee.next().then(function(ue){return ue.done?ue.value:ee.next()})};function J(z,U,G){var Y=C;return function(ee,ue){if(Y===A)throw new Error("Generator is already running");if(Y===_){if(ee==="throw")throw ue;return H()}for(G.method=ee,G.arg=ue;;){var F=G.delegate;if(F){var me=ie(F,G);if(me){if(me===v)continue;return me}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(Y===C)throw Y=_,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);Y=A;var te=b(z,U,G);if(te.type==="normal"){if(Y=G.done?_:O,te.arg===v)continue;return{value:te.arg,done:G.done}}else te.type==="throw"&&(Y=_,G.method="throw",G.arg=te.arg)}}}function ie(z,U){var G=U.method,Y=z.iterator[G];if(Y===l)return U.delegate=null,G==="throw"&&z.iterator.return&&(U.method="return",U.arg=l,ie(z,U),U.method==="throw")||G!=="return"&&(U.method="throw",U.arg=new TypeError("The iterator does not provide a '"+G+"' method")),v;var V=b(Y,z.iterator,U.arg);if(V.type==="throw")return U.method="throw",U.arg=V.arg,U.delegate=null,v;var ee=V.arg;if(!ee)return U.method="throw",U.arg=new TypeError("iterator result is not an object"),U.delegate=null,v;if(ee.done)U[z.resultName]=ee.value,U.next=z.nextLoc,U.method!=="return"&&(U.method="next",U.arg=l);else return ee;return U.delegate=null,v}I(j),y(j,h,"Generator"),y(j,f,function(){return this}),y(j,"toString",function(){return"[object Generator]"});function re(z){var U={tryLoc:z[0]};1 in z&&(U.catchLoc=z[1]),2 in z&&(U.finallyLoc=z[2],U.afterLoc=z[3]),this.tryEntries.push(U)}function ae(z){var U=z.completion||{};U.type="normal",delete U.arg,z.completion=U}function pe(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(re,this),this.reset(!0)}n.keys=function(z){var U=Object(z),G=[];for(var Y in U)G.push(Y);return G.reverse(),function V(){for(;G.length;){var ee=G.pop();if(ee in U)return V.value=ee,V.done=!1,V}return V.done=!0,V}};function oe(z){if(z){var U=z[f];if(U)return U.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var G=-1,Y=function V(){for(;++G=0;--Y){var V=this.tryEntries[Y],ee=V.completion;if(V.tryLoc==="root")return G("end");if(V.tryLoc<=this.prev){var ue=o.call(V,"catchLoc"),F=o.call(V,"finallyLoc");if(ue&&F){if(this.prev=0;--G){var Y=this.tryEntries[G];if(Y.tryLoc<=this.prev&&o.call(Y,"finallyLoc")&&this.prev=0;--U){var G=this.tryEntries[U];if(G.finallyLoc===z)return this.complete(G.completion,G.afterLoc),ae(G),v}},catch:function(z){for(var U=this.tryEntries.length-1;U>=0;--U){var G=this.tryEntries[U];if(G.tryLoc===z){var Y=G.completion;if(Y.type==="throw"){var V=Y.arg;ae(G)}return V}}throw new Error("illegal catch attempt")},delegateYield:function(z,U,G){return this.delegate={iterator:oe(z),resultName:U,nextLoc:G},this.method==="next"&&(this.arg=l),v}},n}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}})(JD);var eI={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}},tI=(e,t)=>{const n=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach((r,o)=>{const a=e.lengthBytesUTF8(r)+1,l=e._malloc(a);e.stringToUTF8(r,l,a),e.setValue(n+Uint32Array.BYTES_PER_ELEMENT*o,l,"i32")}),[t.length,n]};const nI="@ffmpeg/ffmpeg",rI="0.11.6",iI="FFmpeg WebAssembly version",oI="src/index.js",sI="src/index.d.ts",aI={example:"examples"},lI={start:"node scripts/server.js","start:worker":"node scripts/worker-server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js","build:worker":"rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",prepublishOnly:"npm run build",lint:"eslint src",wait:"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node node_modules/mocha/bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},uI={"./src/node/index.js":"./src/browser/index.js"},cI={type:"git",url:"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},fI=["ffmpeg","WebAssembly","video"],dI="Jerome Wu ",pI="MIT",hI={url:"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},gI={node:">=12.16.1"},mI="https://github.com/ffmpegwasm/ffmpeg.wasm#readme",vI={"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},yI={"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.11.0","@types/emscripten":"^1.39.4","babel-eslint":"^10.1.0","babel-loader":"^8.1.0",chai:"^4.2.0",cors:"^2.8.5",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1",express:"^4.17.1",mocha:"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0",webpack:"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"},MS={name:nI,version:rI,description:iI,main:oI,types:sI,directories:aI,scripts:lI,browser:uI,repository:cI,keywords:fI,author:dI,license:pI,bugs:hI,engines:gI,homepage:mI,dependencies:vI,devDependencies:yI},wI=(typeof process<"u",`https://unpkg.com/@ffmpeg/core@${MS.devDependencies["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`),xI={corePath:wI};let Cg=!1,zS=()=>{};const SI=e=>{Cg=e},_I=e=>{zS=e},bI=(e,t)=>{zS({type:e,message:t}),Cg&&console.log(`[${e}] ${t}`)};var Xi={logging:Cg,setLogging:SI,setCustomLogger:_I,log:bI};const kI=e=>` createFFmpegCore is not defined. ffmpeg.wasm is unable to find createFFmpegCore after loading ffmpeg-core.js from ${e}. Use another URL when calling createFFmpeg(): const ffmpeg = createFFmpeg({ corePath: 'http://localhost:3000/ffmpeg-core.js', }); -`;var Gy={CREATE_FFMPEG_CORE_IS_NOT_DEFINED:kI};const Io=async(e,t)=>{Xi.log("info",`fetch ${e}`);const n=await(await fetch(e)).arrayBuffer();Xi.log("info",`${e} file size = ${n.byteLength} bytes`);const r=new Blob([n],{type:t}),o=URL.createObjectURL(r);return Xi.log("info",`${e} blob URL = ${o}`),o},CI=async({corePath:e,workerPath:t,wasmPath:n})=>{if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){if(typeof e!="string")throw Error("corePath should be a string!");const c=new URL(e,import.meta.url).href,f=await Io(c,"application/javascript"),p=await Io(n!==void 0?n:c.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),h=await Io(t!==void 0?t:c.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(y=>{if(globalThis.importScripts(f),typeof createFFmpegCore>"u")throw Error(Gy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(c));Xi.log("info","ffmpeg-core.js script loaded"),y({createFFmpegCore,corePath:f,wasmPath:p,workerPath:h})}):(Xi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:f,wasmPath:p,workerPath:h}))}if(typeof e!="string")throw Error("corePath should be a string!");const r=new URL(e,import.meta.url).href,o=await Io(r,"application/javascript"),a=await Io(n!==void 0?n:r.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await Io(t!==void 0?t:r.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(c=>{const f=document.createElement("script"),p=()=>{if(f.removeEventListener("load",p),typeof createFFmpegCore>"u")throw Error(Gy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(r));Xi.log("info","ffmpeg-core.js script loaded"),c({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l})};f.src=o,f.type="text/javascript",f.addEventListener("load",p),document.getElementsByTagName("head")[0].appendChild(f)}):(Xi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l}))},EI=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=({target:{error:{code:o}}})=>{n(Error(`File could not be read! Code=${o}`))},r.readAsArrayBuffer(e)}),TI=async e=>{let t=e;return typeof e>"u"?new Uint8Array:(typeof e=="string"?/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?t=atob(e.split(",")[1]).split("").map(n=>n.charCodeAt(0)):t=await(await fetch(new URL(e,import.meta.url).href)).arrayBuffer():(e instanceof File||e instanceof Blob)&&(t=await EI(e)),new Uint8Array(t))},RI=Object.freeze(Object.defineProperty({__proto__:null,defaultOptions:xI,fetchFile:TI,getCreateFFmpegCore:CI},Symbol.toStringTag,{value:"Module"})),zS=T1(RI),{defaultArgs:PI,baseOptions:OI}=eI,AI=tI,{defaultOptions:LI,getCreateFFmpegCore:$I}=zS,{version:DI}=NS,np=Error("ffmpeg.wasm is not ready, make sure you have completed load().");var II=(e={})=>{const{log:t,logger:n,progress:r,...o}={...OI,...LI,...e};let a=null,l=null,c=null,f=null,p=!1,h=()=>{},y=t,m=r,b=0,C=0,O=!1,L=0;const _=re=>{re==="FFMPEG_END"&&c!==null&&(c(),c=null,f=null,p=!1)},v=(re,ae)=>{h({type:re,message:ae}),y&&console.log(`[${re}] ${ae}`)},x=re=>{const[ae,pe,oe]=re.split(":");return parseFloat(ae)*60*60+parseFloat(pe)*60+parseFloat(oe)},k=(re,ae)=>{if(typeof re=="string")if(re.startsWith(" Duration")){const pe=re.split(", ")[0].split(": ")[1],oe=x(pe);ae({duration:oe,ratio:L}),(b===0||b>oe)&&(b=oe,O=!0)}else if(O&&re.startsWith(" Stream")){const pe=re.match(/([\d.]+) fps/);if(pe){const oe=parseFloat(pe[1]);C=b*oe}else C=0;O=!1}else if(re.startsWith("frame")||re.startsWith("size")){const pe=re.split("time=")[1].split(" ")[0],oe=x(pe),H=re.match(/frame=\s*(\d+)/);if(C&&H){const z=parseFloat(H[1]);L=Math.min(z/C,1)}else L=oe/b;ae({ratio:L,time:oe})}else re.startsWith("video:")&&(ae({ratio:1}),b=0)},E=({type:re,message:ae})=>{v(re,ae),k(ae,m),_(ae)},R=async()=>{if(v("info","load ffmpeg-core"),a===null){v("info","loading ffmpeg-core");const{createFFmpegCore:re,corePath:ae,workerPath:pe,wasmPath:oe}=await $I(o);a=await re({mainScriptUrlOrBlob:ae,printErr:H=>E({type:"fferr",message:H}),print:H=>E({type:"ffout",message:H}),locateFile:(H,z)=>{if(typeof window<"u"||typeof WorkerGlobalScope<"u"){if(typeof oe<"u"&&H.endsWith("ffmpeg-core.wasm"))return oe;if(typeof pe<"u"&&H.endsWith("ffmpeg-core.worker.js"))return pe}return z+H}}),l=a.cwrap(o.mainName||"proxy_main","number",["number","number"]),v("info","ffmpeg-core loaded")}else throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.")},D=()=>a!==null,P=(...re)=>{if(v("info",`run ffmpeg command: ${re.join(" ")}`),a===null)throw np;if(p)throw Error("ffmpeg.wasm can only run one command at a time");return p=!0,new Promise((ae,pe)=>{const oe=[...PI,...re].filter(H=>H.length!==0);c=ae,f=pe,l(...AI(a,oe))})},j=(re,...ae)=>{if(v("info",`run FS.${re} ${ae.map(pe=>typeof pe=="string"?pe:`<${pe.length} bytes binary file>`).join(" ")}`),a===null)throw np;{let pe=null;try{pe=a.FS[re](...ae)}catch{throw Error(re==="readdir"?`ffmpeg.FS('readdir', '${ae[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`:re==="readFile"?`ffmpeg.FS('readFile', '${ae[0]}') error. Check if the path exists`:"Oops, something went wrong in FS operation.")}return pe}},I=()=>{if(a===null)throw np;f&&f("ffmpeg has exited"),p=!1;try{a.exit(1)}catch(re){v(re.message),f&&f(re)}finally{a=null,l=null,c=null,f=null}},X=re=>{m=re},J=re=>{h=re},ie=re=>{y=re};return v("info",`use ffmpeg.wasm v${DI}`),{setProgress:X,setLogger:J,setLogging:ie,load:R,isLoaded:D,run:P,exit:I,FS:j}};const NI=II,{fetchFile:MI}=zS;var Eg={createFFmpeg:NI,fetchFile:MI};const rp=async(e,t)=>{const n=e.sampleRate;return e.createBuffer(1,Math.ceil(n*t),n)},zI=(e,t)=>{const n=t.reduce((a,l)=>a+l.length,0),r=e.createBuffer(1,n,e.sampleRate);let o=0;for(const a of t)r.copyToChannel(a.getChannelData(0),0,o),o+=a.length;return r},FI=e=>{const t=e.getChannelData(0);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},UI=async(e,t)=>{const n=e.sampleRate,r=e.numberOfChannels,o=Math.floor(e.length/t),a=new OfflineAudioContext(r,o,n),l=a.createBufferSource();return l.buffer=e,l.playbackRate.value=t,l.connect(a.destination),l.start(),await a.startRendering()};function jI(e){const t=e.numberOfChannels,n=e.sampleRate,r=1,o=16,a=o/8,l=t*a,f=e.getChannelData(0).length,p=new ArrayBuffer(44+f*l),h=new DataView(p);au(h,0,"RIFF"),h.setUint32(4,36+f*l,!0),au(h,8,"WAVE"),au(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,r,!0),h.setUint16(22,t,!0),h.setUint32(24,n,!0),h.setUint32(28,n*l,!0),h.setUint16(32,l,!0),h.setUint16(34,o,!0),au(h,36,"data"),h.setUint32(40,f*l,!0);const y=44;for(let m=0;m{fn.isLoaded()||await fn.load(),fn.FS("writeFile",e.name,await Eg.fetchFile(e)),await fn.run("-i",e.name,"-map","0:s:0","subtitles.srt");try{const t=fn.FS("readFile","subtitles.srt"),n=new TextDecoder().decode(t);return HI(n)}catch(t){return console.error("Error extracting tracks:",t),[]}},WI=async(e,t,n,r,o)=>{const{t:a}=ja();fn.isLoaded()||(o(a("loadingFFmpeg")),await fn.load());const l="input.mp4",c="output.mp4";if(o(a("preparingMedia")),fn.FS("writeFile",l,await Eg.fetchFile(e)),r.includes("original")){o(a("generatingOriginalSubtitles"));const y=Yy(t,!1);fn.FS("writeFile","original_subtitles.srt",y)}if(r.includes("dubbed")){o(a("generatingDubbedSubtitles"));const y=Yy(t,!0);fn.FS("writeFile","dubbed_subtitles.srt",y)}const f=["-i",l];r.includes("original")&&f.push("-i","original_subtitles.srt"),r.includes("dubbed")&&f.push("-i","dubbed_subtitles.srt");for(let y=0;y{f.push("-map",`${m+1+r.length}:a`,"-c:a","aac")});let p=0;r.includes("original")&&(f.push("-map",`${1+p}`,"-c:s","mov_text"),f.push("-metadata:s:s:0","language=spa"),p++),r.includes("dubbed")&&(f.push("-map",`${1+p}`,"-c:s","mov_text"),f.push("-metadata:s:s:1","language=cat")),n.forEach((y,m)=>{f.push(`-metadata:s:a:${m}`,`title=${y.label}`)}),f.push(c),o(a("rebuildingMediaOnDownload")),await fn.run(...f),o(a("preparingDownload"));const h=fn.FS("readFile",c);return new Blob([h.buffer],{type:"video/mp4"})},HI=e=>{const t=[],n=e.trim().split(` +`;var Yy={CREATE_FFMPEG_CORE_IS_NOT_DEFINED:kI};const Io=async(e,t)=>{Xi.log("info",`fetch ${e}`);const n=await(await fetch(e)).arrayBuffer();Xi.log("info",`${e} file size = ${n.byteLength} bytes`);const r=new Blob([n],{type:t}),o=URL.createObjectURL(r);return Xi.log("info",`${e} blob URL = ${o}`),o},CI=async({corePath:e,workerPath:t,wasmPath:n})=>{if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){if(typeof e!="string")throw Error("corePath should be a string!");const c=new URL(e,import.meta.url).href,f=await Io(c,"application/javascript"),p=await Io(n!==void 0?n:c.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),h=await Io(t!==void 0?t:c.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(y=>{if(globalThis.importScripts(f),typeof createFFmpegCore>"u")throw Error(Yy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(c));Xi.log("info","ffmpeg-core.js script loaded"),y({createFFmpegCore,corePath:f,wasmPath:p,workerPath:h})}):(Xi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:f,wasmPath:p,workerPath:h}))}if(typeof e!="string")throw Error("corePath should be a string!");const r=new URL(e,import.meta.url).href,o=await Io(r,"application/javascript"),a=await Io(n!==void 0?n:r.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await Io(t!==void 0?t:r.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(c=>{const f=document.createElement("script"),p=()=>{if(f.removeEventListener("load",p),typeof createFFmpegCore>"u")throw Error(Yy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(r));Xi.log("info","ffmpeg-core.js script loaded"),c({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l})};f.src=o,f.type="text/javascript",f.addEventListener("load",p),document.getElementsByTagName("head")[0].appendChild(f)}):(Xi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l}))},EI=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=({target:{error:{code:o}}})=>{n(Error(`File could not be read! Code=${o}`))},r.readAsArrayBuffer(e)}),TI=async e=>{let t=e;return typeof e>"u"?new Uint8Array:(typeof e=="string"?/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?t=atob(e.split(",")[1]).split("").map(n=>n.charCodeAt(0)):t=await(await fetch(new URL(e,import.meta.url).href)).arrayBuffer():(e instanceof File||e instanceof Blob)&&(t=await EI(e)),new Uint8Array(t))},RI=Object.freeze(Object.defineProperty({__proto__:null,defaultOptions:xI,fetchFile:TI,getCreateFFmpegCore:CI},Symbol.toStringTag,{value:"Module"})),FS=R1(RI),{defaultArgs:PI,baseOptions:OI}=eI,LI=tI,{defaultOptions:AI,getCreateFFmpegCore:$I}=FS,{version:DI}=MS,np=Error("ffmpeg.wasm is not ready, make sure you have completed load().");var II=(e={})=>{const{log:t,logger:n,progress:r,...o}={...OI,...AI,...e};let a=null,l=null,c=null,f=null,p=!1,h=()=>{},y=t,m=r,b=0,C=0,O=!1,A=0;const _=re=>{re==="FFMPEG_END"&&c!==null&&(c(),c=null,f=null,p=!1)},v=(re,ae)=>{h({type:re,message:ae}),y&&console.log(`[${re}] ${ae}`)},x=re=>{const[ae,pe,oe]=re.split(":");return parseFloat(ae)*60*60+parseFloat(pe)*60+parseFloat(oe)},k=(re,ae)=>{if(typeof re=="string")if(re.startsWith(" Duration")){const pe=re.split(", ")[0].split(": ")[1],oe=x(pe);ae({duration:oe,ratio:A}),(b===0||b>oe)&&(b=oe,O=!0)}else if(O&&re.startsWith(" Stream")){const pe=re.match(/([\d.]+) fps/);if(pe){const oe=parseFloat(pe[1]);C=b*oe}else C=0;O=!1}else if(re.startsWith("frame")||re.startsWith("size")){const pe=re.split("time=")[1].split(" ")[0],oe=x(pe),H=re.match(/frame=\s*(\d+)/);if(C&&H){const z=parseFloat(H[1]);A=Math.min(z/C,1)}else A=oe/b;ae({ratio:A,time:oe})}else re.startsWith("video:")&&(ae({ratio:1}),b=0)},E=({type:re,message:ae})=>{v(re,ae),k(ae,m),_(ae)},R=async()=>{if(v("info","load ffmpeg-core"),a===null){v("info","loading ffmpeg-core");const{createFFmpegCore:re,corePath:ae,workerPath:pe,wasmPath:oe}=await $I(o);a=await re({mainScriptUrlOrBlob:ae,printErr:H=>E({type:"fferr",message:H}),print:H=>E({type:"ffout",message:H}),locateFile:(H,z)=>{if(typeof window<"u"||typeof WorkerGlobalScope<"u"){if(typeof oe<"u"&&H.endsWith("ffmpeg-core.wasm"))return oe;if(typeof pe<"u"&&H.endsWith("ffmpeg-core.worker.js"))return pe}return z+H}}),l=a.cwrap(o.mainName||"proxy_main","number",["number","number"]),v("info","ffmpeg-core loaded")}else throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.")},D=()=>a!==null,P=(...re)=>{if(v("info",`run ffmpeg command: ${re.join(" ")}`),a===null)throw np;if(p)throw Error("ffmpeg.wasm can only run one command at a time");return p=!0,new Promise((ae,pe)=>{const oe=[...PI,...re].filter(H=>H.length!==0);c=ae,f=pe,l(...LI(a,oe))})},j=(re,...ae)=>{if(v("info",`run FS.${re} ${ae.map(pe=>typeof pe=="string"?pe:`<${pe.length} bytes binary file>`).join(" ")}`),a===null)throw np;{let pe=null;try{pe=a.FS[re](...ae)}catch{throw Error(re==="readdir"?`ffmpeg.FS('readdir', '${ae[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`:re==="readFile"?`ffmpeg.FS('readFile', '${ae[0]}') error. Check if the path exists`:"Oops, something went wrong in FS operation.")}return pe}},I=()=>{if(a===null)throw np;f&&f("ffmpeg has exited"),p=!1;try{a.exit(1)}catch(re){v(re.message),f&&f(re)}finally{a=null,l=null,c=null,f=null}},X=re=>{m=re},J=re=>{h=re},ie=re=>{y=re};return v("info",`use ffmpeg.wasm v${DI}`),{setProgress:X,setLogger:J,setLogging:ie,load:R,isLoaded:D,run:P,exit:I,FS:j}};const NI=II,{fetchFile:MI}=FS;var Eg={createFFmpeg:NI,fetchFile:MI};const rp=async(e,t)=>{const n=e.sampleRate;return e.createBuffer(1,Math.ceil(n*t),n)},zI=(e,t)=>{const n=t.reduce((a,l)=>a+l.length,0),r=e.createBuffer(1,n,e.sampleRate);let o=0;for(const a of t)r.copyToChannel(a.getChannelData(0),0,o),o+=a.length;return r},FI=e=>{const t=e.getChannelData(0);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},UI=async(e,t)=>{const n=e.sampleRate,r=e.numberOfChannels,o=Math.floor(e.length/t),a=new OfflineAudioContext(r,o,n),l=a.createBufferSource();return l.buffer=e,l.playbackRate.value=t,l.connect(a.destination),l.start(),await a.startRendering()};function jI(e){const t=e.numberOfChannels,n=e.sampleRate,r=1,o=16,a=o/8,l=t*a,f=e.getChannelData(0).length,p=new ArrayBuffer(44+f*l),h=new DataView(p);au(h,0,"RIFF"),h.setUint32(4,36+f*l,!0),au(h,8,"WAVE"),au(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,r,!0),h.setUint16(22,t,!0),h.setUint32(24,n,!0),h.setUint32(28,n*l,!0),h.setUint16(32,l,!0),h.setUint16(34,o,!0),au(h,36,"data"),h.setUint32(40,f*l,!0);const y=44;for(let m=0;m{fn.isLoaded()||await fn.load(),fn.FS("writeFile",e.name,await Eg.fetchFile(e)),await fn.run("-i",e.name,"-map","0:s:0","subtitles.srt");try{const t=fn.FS("readFile","subtitles.srt"),n=new TextDecoder().decode(t);return HI(n)}catch(t){return console.error("Error extracting tracks:",t),[]}},WI=async(e,t,n,r,o)=>{const{t:a}=ja();fn.isLoaded()||(o(a("loadingFFmpeg")),await fn.load());const l="input.mp4",c="output.mp4";if(o(a("preparingMedia")),fn.FS("writeFile",l,await Eg.fetchFile(e)),r.includes("original")){o(a("generatingOriginalSubtitles"));const y=Xy(t,!1);fn.FS("writeFile","original_subtitles.srt",y)}if(r.includes("dubbed")){o(a("generatingDubbedSubtitles"));const y=Xy(t,!0);fn.FS("writeFile","dubbed_subtitles.srt",y)}const f=["-i",l];r.includes("original")&&f.push("-i","original_subtitles.srt"),r.includes("dubbed")&&f.push("-i","dubbed_subtitles.srt");for(let y=0;y{f.push("-map",`${m+1+r.length}:a`,"-c:a","aac")});let p=0;r.includes("original")&&(f.push("-map",`${1+p}`,"-c:s","mov_text"),f.push("-metadata:s:s:0","language=spa"),p++),r.includes("dubbed")&&(f.push("-map",`${1+p}`,"-c:s","mov_text"),f.push("-metadata:s:s:1","language=cat")),n.forEach((y,m)=>{f.push(`-metadata:s:a:${m}`,`title=${y.label}`)}),f.push(c),o(a("rebuildingMediaOnDownload")),await fn.run(...f),o(a("preparingDownload"));const h=fn.FS("readFile",c);return new Blob([h.buffer],{type:"video/mp4"})},HI=e=>{const t=[],n=e.trim().split(` `);let r=0;return n.forEach(o=>{const a=o.split(` -`);if(a.length>=3){const l=a[1].split(" --> "),c=Xy(l[0]),f=Xy(l[1]),p=a.slice(2).join(` -`);t.push({id:++r,start:c,end:f,speaker_id:"",dubbed_path:"",chunk_size:0,path:"",text:p,for_dubbing:!1,ssml_gender:"",translated_text:"",pitch:0,speed:1,volume_gain_db:0,needsResynthesis:!1})}}),t},Yy=(e,t)=>e.map((n,r)=>{const o=Qy(n.start),a=Qy(n.end),l=t?n.translated_text:n.text;return`${r+1} +`);if(a.length>=3){const l=a[1].split(" --> "),c=Qy(l[0]),f=Qy(l[1]),p=a.slice(2).join(` +`);t.push({id:++r,start:c,end:f,speaker_id:"",dubbed_path:"",chunk_size:0,path:"",text:p,for_dubbing:!1,ssml_gender:"",translated_text:"",pitch:0,speed:1,volume_gain_db:0,needsResynthesis:!1})}}),t},Xy=(e,t)=>e.map((n,r)=>{const o=Zy(n.start),a=Zy(n.end),l=t?n.translated_text:n.text;return`${r+1} ${o} --> ${a} ${l}`}).join(` -`),Xy=e=>{const[t,n,r]=e.split(":").map(parseFloat);return t*3600+n*60+r},Qy=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=(e%60).toFixed(3);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${r.padStart(6,"0")}`},VI=le.div` +`),Qy=e=>{const[t,n,r]=e.split(":").map(parseFloat);return t*3600+n*60+r},Zy=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=(e%60).toFixed(3);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${r.padStart(6,"0")}`},VI=le.div` display: flex; justify-content: space-between; `,KI=le(vt)` @@ -392,7 +392,7 @@ ${l}`}).join(` display: flex; justify-content: flex-end; gap: 10px; -`,Zy=le(vt)` +`,qy=le(vt)` padding: 5px; display: flex; align-items: center; @@ -403,11 +403,11 @@ ${l}`}).join(` } `,ip=le.div` position: relative; -`,qy=le.div` +`,Jy=le.div` position: absolute; right: 5px; top: 5px; -`,YI=({track:e,onSave:t,onClose:n,isDubbingService:r})=>{const{t:o}=so(),[a,l]=B.useState(""),[c,f]=B.useState(""),[p,h]=B.useState(0),[y,m]=B.useState(0),[b,C]=B.useState(1),[O,L]=B.useState(""),[_,v]=B.useState([]);B.useEffect(()=>{e&&(l(e.text),f(e.translated_text||""),h(e.start),m(e.end),C(e.speed||1),L(e.speaker_id||"")),v(Ot.getSpeakers())},[e]);const x=()=>{if(e){const I=Ot.getSpeakerById(O),X=Ot.getSpeakerById(e.speaker_id),J={...e,text:a,translated_text:c,start:p,end:y,speed:b,speaker_id:O,needsResynthesis:c!==e.translated_text||I.voice!==X.voice},ie=p!==e.start||b!==e.speed||J.needsResynthesis;t(J,ie)}n()},k=B.useCallback(I=>{I.target===I.currentTarget&&n()},[n]);if(!e)return null;const E=()=>{if(e){const I={...e,deleted:!0};t(I,!0)}n()},R=()=>{e!=null&&e.original_text&&l(e.original_text)},D=()=>{e!=null&&e.original_translated_text&&f(e.original_translated_text)},P=a!==(e==null?void 0:e.original_text),j=c!==(e==null?void 0:e.original_translated_text);return A.jsx(tc,{onClick:k,children:A.jsxs(kD,{children:[r&&A.jsxs(A.Fragment,{children:[A.jsx(dn,{children:o("originalText")}),A.jsx(ip,{children:A.jsx(Zd,{value:a,onChange:I=>l(I.target.value),readOnly:!0})}),A.jsx(dn,{children:o("translatedText")}),A.jsxs(ip,{children:[A.jsx(Zd,{value:c,onChange:I=>f(I.target.value)}),j&&A.jsx(qy,{children:A.jsx(Zy,{onClick:D,title:o("undo"),children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})})})]})]}),!r&&A.jsxs(A.Fragment,{children:[A.jsx(dn,{children:o("text")}),A.jsxs(ip,{children:[A.jsx(Zd,{value:a,onChange:I=>l(I.target.value)}),P&&A.jsx(qy,{children:A.jsx(Zy,{onClick:R,title:o("undo"),children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})})})]})]}),A.jsx(dn,{children:o("startTime")}),A.jsx(Cu,{type:"number",value:p,onChange:I=>h(Number(I.target.value)),step:"0.1"}),A.jsx(dn,{children:o("endTime")}),A.jsx(Cu,{type:"number",value:y,onChange:I=>m(Number(I.target.value)),step:"0.1"}),A.jsx(dn,{children:o("speed")}),A.jsx(Cu,{type:"number",value:b,onChange:I=>C(Number(I.target.value)),step:"0.1",min:"1",max:"2"}),A.jsx(dn,{children:o("speaker")}),A.jsxs(bD,{value:O,onChange:I=>L(I.target.value),children:[A.jsx("option",{value:"",children:o("selectSpeaker")}),_.map(I=>A.jsxs("option",{value:I.id,children:[I.name," (",I.voice.label,")"]},I.id))]}),A.jsxs(VI,{children:[A.jsx(KI,{onClick:E,children:o("deleteTrack")}),A.jsxs(GI,{children:[A.jsx(vt,{onClick:n,children:o("cancel")}),A.jsx(vt,{onClick:x,children:o("save")})]})]})]})})},XI={"audio/mpeg":"mp3","audio/wav":"wav","application/ogg":"ogg","audio/flac":"flac","video/x-msvideo":"avi","video/mp4":"mp4","video/x-matroska":"mkv","video/quicktime":"mov","video/mts":"mts"},QI=e=>{if(!e)return"input";const t=e.match(/filename="?([^;]+)"?/i);return t?t[1].replace(/['"]/g,""):"input"},FS="https://api.softcatala.org/transcribe-service/v1",US=(e,t)=>`${FS}/get_file/?uuid=${e}&ext=bin`,ZI=async e=>{const t=await fetch(US(e),{method:"HEAD"});if(!t.ok)throw new Error("Failed to load video");const n=t.headers.get("content-type")||"video/mp4",r=t.headers.get("content-disposition");let o=QI(r);return o==="input"&&(o=`input.${XI[n]||"mp4"}`),{contentType:n,filename:o}},qI=async e=>{const t=await fetch(`${FS}/get_file/?uuid=${e}&ext=json`);if(!t.ok)throw new Error("Failed to load tracks");return t.json()},JI=e=>e.segments.map(t=>({id:t.id,start:t.start,end:t.end,speaker_id:t.speaker||"",path:"",text:t.text.trim(),for_dubbing:!1,ssml_gender:"",translated_text:"",assigned_voice:"",pitch:0,speed:1,volume_gain_db:0})),lu={getMediaUrl:US,loadTracksFromUUID:qI,parseTracksFromJSON:JI,getMediaMetadata:ZI},Qr="https://api.softcatala.org/dubbing-service/v1",eN=async e=>{const t=await fetch(`${Qr}/uuid_exists/?uuid=${e}`);if(!t.ok)throw new Error("UUID does not exist");return t.json()},tN=(e,t)=>`${Qr}/get_file/?uuid=${e}&ext=dub&revision=${t}`,nN=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=original_video`,rN=async e=>{const t=await fetch(BS(e));if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},iN=async e=>{const t=await fetch(WS(e));if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},oN=async e=>{const t=await fetch(jS(e));if(!t.ok)throw new Error("Failed to load background audio");return t.arrayBuffer()},sN=async e=>{const t=await fetch(`${Qr}/get_utterances?uuid=${e}`);if(!t.ok)throw new Error("Failed to load dubbing data");return t.json()},aN=e=>{const t=[];for(const n of e){Ot.setSpeaker({id:n.speaker_id,name:`${ja().t("speaker")} ${n.speaker_id.slice(-2)}`,voice:Aa.getVoice(n.assigned_voice)});const r=n.text||"",o=n.translated_text||"";t.push({id:n.id,start:n.start||0,end:n.end||0,speaker_id:n.speaker_id,path:n.path||"",text:r,original_text:r,for_dubbing:n.for_dubbing||!1,ssml_gender:n.gender||"",translated_text:o,original_translated_text:o,pitch:n.pitch||0,speed:n.speed||1,volume_gain_db:n.volume_gain_db||0,dubbed_path:n.dubbed_path,chunk_size:0,needsResynthesis:!1})}return Ot.sortSpeakers(),t},lN=async(e,t)=>{const n=await fetch(`${Qr}/get_dubbed_utterance/?uuid=${e}&id=${t}`);if(!n.ok)throw new Error(`Failed to load dubbed utterance: ${t}`);return n.arrayBuffer()},jS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=no_vocals`,BS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=vocals`,WS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=dubbed_vocals`,uN=async(e,t)=>{var o,a,l,c;const n=[];for(const f of t)!f.updated&&!f.deleted||n.push({id:f.id,start:f.start,end:f.end,speaker_id:f.speaker_id,path:f.path,text:f.text,for_dubbing:f.for_dubbing,gender:((a=(o=Ot.getSpeakerById(f.speaker_id))==null?void 0:o.voice)==null?void 0:a.gender)||f.ssml_gender,translated_text:f.translated_text||"",assigned_voice:((c=(l=Ot.getSpeakerById(f.speaker_id))==null?void 0:l.voice)==null?void 0:c.id)||"",pitch:f.pitch,speed:f.speed,volume_gain_db:f.volume_gain_db,dubbed_path:f.dubbed_path,operation:f.deleted?"delete":"update"});if(!(await fetch(`${Qr}/regenerate_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:e,utterance_update:n})})).ok)throw new Error("Failed to regenerate video")},ir={loadOriginalVocalsFromUUID:rN,loadBackgroundAudioFromUUID:oN,loadDubbedVocalsFromUUID:iN,loadTracksFromUUID:sN,parseTracksFromJSON:aN,uuidExists:eN,getMediaUrl:tN,getSilentVideoUrl:nN,loadDubbedUtterance:lN,getBackgroundAudioUrl:jS,getOriginalVocalsUrl:BS,getDubbedVocalsUrl:WS,regenerateVideo:uN};class cN{constructor(){this.providers=new Map,this.registerProvider(Aa.getProviderName(),Aa)}registerProvider(t,n){this.providers.set(t,n)}async speak(t,n){const r=this.providers.get(n.provider);if(!r)throw new Error(`Provider ${n.provider} not found`);return r.speak(t,n)}async voices(){const t=[];for(const[n,r]of this.providers){const o=await r.voices();t.push(...o)}return t}}const HS=new cN;class fN{constructor(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)}async recreateConstructedAudio(t,n){console.log("Recreating constructed audio in AudioService...");const r=t.filter(c=>!c.deleted).sort((c,f)=>c.start-f.start);if(console.log("dubbedTracks",r),r.length===0)throw new Error("No dubbed tracks found");const o=[];let a=0;if(r[0].start>0){const c=await rp(this.audioContext,r[0].start);o.push(c),a=r[0].start}for(const c of r){if(c.start>a){const h=c.start-a,y=await rp(this.audioContext,h);o.push(y),a=c.start}const f=c.id;let p=n[f];if(!(!p&&!c.needsResynthesis)){if(c.needsResynthesis)try{p=await this.resynthesizeTrack(c),n[f]=p,c.needsResynthesis=!1}catch(h){console.error(`Failed to resynthesize track ${c.id}:`,h);continue}if(p){let h;try{h=await this.audioContext.decodeAudioData(p.slice(0))}catch(m){console.error(`Failed to decode audio data for track ${c.id}:`,m);continue}const y=await UI(h,c.speed||1);o.push(y),a=c.start+y.duration}}}const l=t[t.length-1].end;if(a{for(let h=0;h{const{t:o}=so(),[a,l]=B.useState(""),[c,f]=B.useState(""),[p,h]=B.useState(0),[y,m]=B.useState(0),[b,C]=B.useState(1),[O,A]=B.useState(""),[_,v]=B.useState([]);B.useEffect(()=>{e&&(l(e.text),f(e.translated_text||""),h(e.start),m(e.end),C(e.speed||1),A(e.speaker_id||"")),v(Ot.getSpeakers())},[e]);const x=()=>{if(e){const I=Ot.getSpeakerById(O),X=Ot.getSpeakerById(e.speaker_id),J={...e,text:a,translated_text:c,start:p,end:y,speed:b,speaker_id:O,needsResynthesis:c!==e.translated_text||I.voice!==X.voice},ie=p!==e.start||b!==e.speed||J.needsResynthesis;t(J,ie)}n()},k=B.useCallback(I=>{I.target===I.currentTarget&&n()},[n]);if(!e)return null;const E=()=>{if(e){const I={...e,deleted:!0};t(I,!0)}n()},R=()=>{e!=null&&e.original_text&&l(e.original_text)},D=()=>{e!=null&&e.original_translated_text&&f(e.original_translated_text)},P=a!==(e==null?void 0:e.original_text),j=c!==(e==null?void 0:e.original_translated_text);return L.jsx(tc,{onClick:k,children:L.jsxs(CD,{children:[r&&L.jsxs(L.Fragment,{children:[L.jsx(dn,{children:o("originalText")}),L.jsx(ip,{children:L.jsx(Zd,{value:a,onChange:I=>l(I.target.value),readOnly:!0})}),L.jsx(dn,{children:o("translatedText")}),L.jsxs(ip,{children:[L.jsx(Zd,{value:c,onChange:I=>f(I.target.value)}),j&&L.jsx(Jy,{children:L.jsx(qy,{onClick:D,title:o("undo"),children:L.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:L.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})})})]})]}),!r&&L.jsxs(L.Fragment,{children:[L.jsx(dn,{children:o("text")}),L.jsxs(ip,{children:[L.jsx(Zd,{value:a,onChange:I=>l(I.target.value)}),P&&L.jsx(Jy,{children:L.jsx(qy,{onClick:R,title:o("undo"),children:L.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:L.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z",fill:"currentColor"})})})})]})]}),L.jsx(dn,{children:o("startTime")}),L.jsx(Cu,{type:"number",value:p,onChange:I=>h(Number(I.target.value)),step:"0.1"}),L.jsx(dn,{children:o("endTime")}),L.jsx(Cu,{type:"number",value:y,onChange:I=>m(Number(I.target.value)),step:"0.1"}),L.jsx(dn,{children:o("speed")}),L.jsx(Cu,{type:"number",value:b,onChange:I=>C(Number(I.target.value)),step:"0.1",min:"1",max:"2"}),L.jsx(dn,{children:o("speaker")}),L.jsxs(kD,{value:O,onChange:I=>A(I.target.value),children:[L.jsx("option",{value:"",children:o("selectSpeaker")}),_.map(I=>L.jsxs("option",{value:I.id,children:[I.name," (",I.voice.label,")"]},I.id))]}),L.jsxs(VI,{children:[L.jsx(KI,{onClick:E,children:o("deleteTrack")}),L.jsxs(GI,{children:[L.jsx(vt,{onClick:n,children:o("cancel")}),L.jsx(vt,{onClick:x,children:o("save")})]})]})]})})},XI={"audio/mpeg":"mp3","audio/wav":"wav","application/ogg":"ogg","audio/flac":"flac","video/x-msvideo":"avi","video/mp4":"mp4","video/x-matroska":"mkv","video/quicktime":"mov","video/mts":"mts"},QI=e=>{if(!e)return"input";const t=e.match(/filename="?([^;]+)"?/i);return t?t[1].replace(/['"]/g,""):"input"},US="https://api.softcatala.org/transcribe-service/v1",jS=(e,t)=>`${US}/get_file/?uuid=${e}&ext=bin`,ZI=async e=>{const t=await fetch(jS(e),{method:"HEAD"});if(!t.ok)throw new Error("Failed to load video");const n=t.headers.get("content-type")||"video/mp4",r=t.headers.get("content-disposition");let o=QI(r);return o==="input"&&(o=`input.${XI[n]||"mp4"}`),{contentType:n,filename:o}},qI=async e=>{const t=await fetch(`${US}/get_file/?uuid=${e}&ext=json`);if(!t.ok)throw new Error("Failed to load tracks");return t.json()},JI=async e=>e.segments.map(t=>({id:t.id,start:t.start,end:t.end,speaker_id:t.speaker||"",path:"",text:t.text.trim(),for_dubbing:!1,ssml_gender:"",translated_text:"",assigned_voice:"",pitch:0,speed:1,volume_gain_db:0})),lu={getMediaUrl:jS,loadTracksFromUUID:qI,parseTracksFromJSON:JI,getMediaMetadata:ZI},Qr="https://api.softcatala.org/dubbing-service/v1",eN=async e=>{const t=await fetch(`${Qr}/uuid_exists/?uuid=${e}`);if(!t.ok)throw new Error("UUID does not exist");return t.json()},tN=(e,t)=>`${Qr}/get_file/?uuid=${e}&ext=dub&revision=${t}`,nN=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=original_video`,rN=async e=>{const t=await fetch(WS(e));if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},iN=async e=>{const t=await fetch(HS(e));if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},oN=async e=>{const t=await fetch(BS(e));if(!t.ok)throw new Error("Failed to load background audio");return t.arrayBuffer()},sN=async e=>{const t=await fetch(`${Qr}/get_utterances?uuid=${e}`);if(!t.ok)throw new Error("Failed to load dubbing data");return t.json()},aN=async e=>{const t=[];for(const n of e){await Ot.setSpeaker({id:n.speaker_id,name:`${ja().t("speaker")} ${n.speaker_id.slice(-2)}`,voice:await La.getVoice(n.assigned_voice)});const r=n.text||"",o=n.translated_text||"";t.push({id:n.id,start:n.start||0,end:n.end||0,speaker_id:n.speaker_id,path:n.path||"",text:r,original_text:r,for_dubbing:n.for_dubbing||!1,ssml_gender:n.gender||"",translated_text:o,original_translated_text:o,pitch:n.pitch||0,speed:n.speed||1,volume_gain_db:n.volume_gain_db||0,dubbed_path:n.dubbed_path,chunk_size:0,needsResynthesis:!1})}return Ot.sortSpeakers(),t},lN=async(e,t)=>{const n=await fetch(`${Qr}/get_dubbed_utterance/?uuid=${e}&id=${t}`);if(!n.ok)throw new Error(`Failed to load dubbed utterance: ${t}`);return n.arrayBuffer()},BS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=no_vocals`,WS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=vocals`,HS=e=>`${Qr}/get_regenerate_file/?uuid=${e}&name=dubbed_vocals`,uN=async(e,t)=>{var o,a,l,c;const n=[];for(const f of t)!f.updated&&!f.deleted||n.push({id:f.id,start:f.start,end:f.end,speaker_id:f.speaker_id,path:f.path,text:f.text,for_dubbing:f.for_dubbing,gender:((a=(o=Ot.getSpeakerById(f.speaker_id))==null?void 0:o.voice)==null?void 0:a.gender)||f.ssml_gender,translated_text:f.translated_text||"",assigned_voice:((c=(l=Ot.getSpeakerById(f.speaker_id))==null?void 0:l.voice)==null?void 0:c.id)||"",pitch:f.pitch,speed:f.speed,volume_gain_db:f.volume_gain_db,dubbed_path:f.dubbed_path,operation:f.deleted?"delete":"update"});if(!(await fetch(`${Qr}/regenerate_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:e,utterance_update:n})})).ok)throw new Error("Failed to regenerate video")},ir={loadOriginalVocalsFromUUID:rN,loadBackgroundAudioFromUUID:oN,loadDubbedVocalsFromUUID:iN,loadTracksFromUUID:sN,parseTracksFromJSON:aN,uuidExists:eN,getMediaUrl:tN,getSilentVideoUrl:nN,loadDubbedUtterance:lN,getBackgroundAudioUrl:BS,getOriginalVocalsUrl:WS,getDubbedVocalsUrl:HS,regenerateVideo:uN};class cN{constructor(){this.providers=new Map,this.registerProvider(La.getProviderName(),La)}registerProvider(t,n){this.providers.set(t,n)}async speak(t,n){const r=this.providers.get(n.provider);if(!r)throw new Error(`Provider ${n.provider} not found`);return r.speak(t,n)}async voices(){const t=[];for(const[n,r]of this.providers){const o=await r.voices();t.push(...o)}return t}}const VS=new cN;class fN{constructor(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)}async recreateConstructedAudio(t,n){console.log("Recreating constructed audio in AudioService...");const r=t.filter(c=>!c.deleted).sort((c,f)=>c.start-f.start);if(console.log("dubbedTracks",r),r.length===0)throw new Error("No dubbed tracks found");const o=[];let a=0;if(r[0].start>0){const c=await rp(this.audioContext,r[0].start);o.push(c),a=r[0].start}for(const c of r){if(c.start>a){const h=c.start-a,y=await rp(this.audioContext,h);o.push(y),a=c.start}const f=c.id;let p=n[f];if(!(!p&&!c.needsResynthesis)){if(c.needsResynthesis)try{p=await this.resynthesizeTrack(c),n[f]=p,c.needsResynthesis=!1}catch(h){console.error(`Failed to resynthesize track ${c.id}:`,h);continue}if(p){let h;try{h=await this.audioContext.decodeAudioData(p.slice(0))}catch(m){console.error(`Failed to decode audio data for track ${c.id}:`,m);continue}const y=await UI(h,c.speed||1);o.push(y),a=c.start+y.duration}}}const l=t[t.length-1].end;if(a{for(let h=0;he.color}; margin-right: 10px; cursor: pointer; -`,r1=le.input` +`,i1=le.input` width: 60px; margin-left: 10px; -`,i1=le.select` +`,o1=le.select` margin-left: 10px; padding: 5px; border: 1px solid ${ge.border}; @@ -457,25 +457,25 @@ ${l}`}).join(` `,gN=le(vt)` width: 100%; margin-top: 5px; -`,mN=({audioTracks:e,selectedTracks:t,onAudioTrackToggle:n,selectedSubtitles:r,onSubtitlesChange:o,showSpeakerColors:a,onShowSpeakerColorsChange:l,onSpeakerVoiceChange:c,timelineVisible:f,onTimelineVisibleChange:p,isMediaFullyLoaded:h})=>{const{t:y}=so(),[m,b]=B.useState(""),[C,O]=B.useState(""),[L,_]=B.useState(Ot.getSpeakers()),[v,x]=B.useState([]),[k,E]=B.useState("#"+Math.floor(Math.random()*16777215).toString(16));B.useEffect(()=>{(async()=>{const X=await HS.voices();x(X)})()},[]);const R=(I,X)=>{Ot.updateSpeaker(I,{name:X}),_([...Ot.getSpeakers()])},D=(I,X)=>{Ot.updateSpeaker(I,{color:X}),_([...Ot.getSpeakers()])},P=async(I,X)=>{const J=v.find(ie=>ie.id===X);J&&(await c(I,J),_([...Ot.getSpeakers()]))},j=()=>{if(m.trim()&&C){const I=v.find(X=>X.id===C);I&&(Ot.addSpeaker(m.trim(),I,k),_([...Ot.getSpeakers()]),b(""),O(""),E("#"+Math.floor(Math.random()*16777215).toString(16)))}};return A.jsxs(dN,{children:[A.jsx("h3",{children:y("audioTracks")}),Object.entries(e).filter(([I])=>I!=="background").map(([I,X],J)=>A.jsxs(Ys,{children:[A.jsx(Jy,{type:"checkbox",id:`audio-track-${J}`,checked:t.includes(I),onChange:()=>n(I)}),A.jsx(dn,{htmlFor:`audio-track-${J}`,children:X.label})]},I)),A.jsx("h3",{children:y("subtitles")}),A.jsxs(pN,{children:[A.jsxs(Ys,{children:[A.jsx(op,{type:"radio",id:"subtitles-none",name:"subtitles",value:"none",checked:r==="none",onChange:()=>o("none")}),A.jsx(dn,{htmlFor:"subtitles-none",children:y("noSubtitles")})]}),A.jsxs(Ys,{children:[A.jsx(op,{type:"radio",id:"subtitles-original",name:"subtitles",value:"original",checked:r==="original",onChange:()=>o("original")}),A.jsx(dn,{htmlFor:"subtitles-original",children:y("originalSubtitles")})]}),A.jsxs(Ys,{children:[A.jsx(op,{type:"radio",id:"subtitles-dubbed",name:"subtitles",value:"dubbed",checked:r==="dubbed",onChange:()=>o("dubbed")}),A.jsx(dn,{htmlFor:"subtitles-dubbed",children:y("dubbedSubtitles")})]})]}),A.jsx("h3",{children:y("speakers")}),A.jsxs(Ys,{children:[A.jsx(Jy,{type:"checkbox",id:"show-speaker-colors",checked:a,onChange:I=>l(I.target.checked)}),A.jsx(dn,{htmlFor:"show-speaker-colors",children:y("showSpeakerColors")})]}),A.jsxs(hN,{children:[L.map(I=>A.jsxs(e1,{children:[A.jsx(n1,{color:I.color,onClick:()=>{document.getElementById(`color-${I.id}`).click()}}),A.jsx(t1,{value:I.name,onChange:X=>R(I.id,X.target.value),disabled:!h}),A.jsx(i1,{value:I.voice.id,onChange:X=>P(I.id,X.target.value),disabled:!h,children:v.map(X=>A.jsx("option",{value:X.id,children:X.label},X.id))}),A.jsx(r1,{id:`color-${I.id}`,type:"color",value:I.color,onChange:X=>D(I.id,X.target.value),hidden:!0})]},I.id)),A.jsxs(e1,{children:[A.jsx(n1,{color:k,onClick:()=>{document.getElementById("new-speaker-color").click()}}),A.jsx(t1,{value:m,onChange:I=>b(I.target.value),placeholder:y("newSpeakerName"),disabled:!h}),A.jsxs(i1,{value:C,onChange:I=>O(I.target.value),disabled:!h,children:[A.jsx("option",{value:"",children:y("selectVoice")}),v.map(I=>A.jsx("option",{value:I.id,children:I.label},I.id))]}),A.jsx(r1,{id:"new-speaker-color",type:"color",value:k,onChange:I=>E(I.target.value),hidden:!0})]}),A.jsx(gN,{onClick:j,disabled:!h||!m.trim()||!C,children:y("addSpeaker")})]})]})},o1=le.div` +`,mN=({audioTracks:e,selectedTracks:t,onAudioTrackToggle:n,selectedSubtitles:r,onSubtitlesChange:o,showSpeakerColors:a,onShowSpeakerColorsChange:l,onSpeakerVoiceChange:c,timelineVisible:f,onTimelineVisibleChange:p,isMediaFullyLoaded:h})=>{const{t:y}=so(),[m,b]=B.useState(""),[C,O]=B.useState(""),[A,_]=B.useState(Ot.getSpeakers()),[v,x]=B.useState([]),[k,E]=B.useState("#"+Math.floor(Math.random()*16777215).toString(16));B.useEffect(()=>{(async()=>{const X=await VS.voices();x(X)})()},[]);const R=(I,X)=>{Ot.updateSpeaker(I,{name:X}),_([...Ot.getSpeakers()])},D=(I,X)=>{Ot.updateSpeaker(I,{color:X}),_([...Ot.getSpeakers()])},P=async(I,X)=>{const J=v.find(ie=>ie.id===X);J&&(await c(I,J),_([...Ot.getSpeakers()]))},j=()=>{if(m.trim()&&C){const I=v.find(X=>X.id===C);I&&(Ot.addSpeaker(m.trim(),I,k),_([...Ot.getSpeakers()]),b(""),O(""),E("#"+Math.floor(Math.random()*16777215).toString(16)))}};return L.jsxs(dN,{children:[L.jsx("h3",{children:y("audioTracks")}),Object.entries(e).filter(([I])=>I!=="background").map(([I,X],J)=>L.jsxs(Ys,{children:[L.jsx(e1,{type:"checkbox",id:`audio-track-${J}`,checked:t.includes(I),onChange:()=>n(I)}),L.jsx(dn,{htmlFor:`audio-track-${J}`,children:X.label})]},I)),L.jsx("h3",{children:y("subtitles")}),L.jsxs(pN,{children:[L.jsxs(Ys,{children:[L.jsx(op,{type:"radio",id:"subtitles-none",name:"subtitles",value:"none",checked:r==="none",onChange:()=>o("none")}),L.jsx(dn,{htmlFor:"subtitles-none",children:y("noSubtitles")})]}),L.jsxs(Ys,{children:[L.jsx(op,{type:"radio",id:"subtitles-original",name:"subtitles",value:"original",checked:r==="original",onChange:()=>o("original")}),L.jsx(dn,{htmlFor:"subtitles-original",children:y("originalSubtitles")})]}),L.jsxs(Ys,{children:[L.jsx(op,{type:"radio",id:"subtitles-dubbed",name:"subtitles",value:"dubbed",checked:r==="dubbed",onChange:()=>o("dubbed")}),L.jsx(dn,{htmlFor:"subtitles-dubbed",children:y("dubbedSubtitles")})]})]}),L.jsx("h3",{children:y("speakers")}),L.jsxs(Ys,{children:[L.jsx(e1,{type:"checkbox",id:"show-speaker-colors",checked:a,onChange:I=>l(I.target.checked)}),L.jsx(dn,{htmlFor:"show-speaker-colors",children:y("showSpeakerColors")})]}),L.jsxs(hN,{children:[A.map(I=>L.jsxs(t1,{children:[L.jsx(r1,{color:I.color,onClick:()=>{document.getElementById(`color-${I.id}`).click()}}),L.jsx(n1,{value:I.name,onChange:X=>R(I.id,X.target.value),disabled:!h}),L.jsx(o1,{value:I.voice.id,onChange:X=>P(I.id,X.target.value),disabled:!h,children:v.map(X=>L.jsx("option",{value:X.id,children:X.label},X.id))}),L.jsx(i1,{id:`color-${I.id}`,type:"color",value:I.color,onChange:X=>D(I.id,X.target.value),hidden:!0})]},I.id)),L.jsxs(t1,{children:[L.jsx(r1,{color:k,onClick:()=>{document.getElementById("new-speaker-color").click()}}),L.jsx(n1,{value:m,onChange:I=>b(I.target.value),placeholder:y("newSpeakerName"),disabled:!h}),L.jsxs(o1,{value:C,onChange:I=>O(I.target.value),disabled:!h,children:[L.jsx("option",{value:"",children:y("selectVoice")}),v.map(I=>L.jsx("option",{value:I.id,children:I.label},I.id))]}),L.jsx(i1,{id:"new-speaker-color",type:"color",value:k,onChange:I=>E(I.target.value),hidden:!0})]}),L.jsx(gN,{onClick:j,disabled:!h||!m.trim()||!C,children:y("addSpeaker")})]})]})},s1=le.div` background-color: ${ge.background}; padding: 20px; border-radius: 5px; max-width: 500px; width: 100%; -`,s1=le.div` - margin-bottom: 20px; `,a1=le.div` + margin-bottom: 20px; +`,l1=le.div` display: flex; align-items: center; margin-bottom: 10px; -`,l1=le.input` +`,u1=le.input` margin-right: 10px; -`,u1=le.div` +`,c1=le.div` display: flex; justify-content: flex-end; gap: 10px; -`,vN=TA` +`,vN=RL` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,yN=le.div` @@ -493,7 +493,7 @@ ${l}`}).join(` padding: 20px; `,xN=le.div` text-align: center; -`,SN=({audioTracks:e,subtitles:t,onClose:n,onDownload:r,onRegenerate:o,progressMessage:a})=>{const{t:l}=so(),[c,f]=B.useState(["dubbed"]),[p,h]=B.useState([]),[y,m]=B.useState(!1),[b,C]=B.useState(null),O=k=>{f(E=>E.includes(k)?E.filter(R=>R!==k):[...E,k])},L=k=>{h(E=>E.includes(k)?E.filter(R=>R!==k):[...E,k])},_=async()=>{m(!0),C(null);try{await r(c,p),n()}catch(k){console.error("Error downloading video:",k),C(`${k}`)}finally{m(!1)}},v=()=>{o&&(o(),n())},x=B.useCallback(k=>{k.target===k.currentTarget&&n()},[n]);return b?A.jsx(tc,{children:A.jsxs(o1,{children:[A.jsx(dh,{children:l("downloadError")}),A.jsx(DS,{children:l("downloadErrorMessage")}),A.jsx(IS,{children:b}),A.jsxs(u1,{children:[A.jsx(vt,{onClick:n,children:l("cancel")}),o&&A.jsx(vt,{onClick:v,children:l("regenerate")})]})]})}):A.jsx(tc,{onClick:x,children:A.jsxs(o1,{children:[A.jsx(dh,{children:l(y?"preparingDownload":"selectTracksForDownload")}),y?A.jsxs(wN,{children:[A.jsx(yN,{}),A.jsx(xN,{children:A.jsx(ph,{children:a||l("downloading")})})]}):A.jsxs(A.Fragment,{children:[A.jsx(ph,{children:A.jsx(YA,{i18nKey:"downloadExplanation",components:{regenerateLink:A.jsx("span",{style:{color:ge.primary,cursor:"pointer"},onClick:v})}})}),A.jsxs(s1,{children:[A.jsx("h3",{children:l("audioTracks")}),Object.entries(e).filter(([k])=>k!=="background").map(([k,E],R)=>A.jsxs(a1,{children:[A.jsx(l1,{type:"checkbox",checked:c.includes(k),onChange:()=>O(k),disabled:y}),A.jsx(dn,{htmlFor:k,children:E.label})]},R))]}),A.jsxs(s1,{children:[A.jsx("h3",{children:l("subtitles")}),t.map(k=>A.jsxs(a1,{children:[A.jsx(l1,{type:"checkbox",checked:p.includes(k),onChange:()=>L(k),disabled:y}),A.jsx(dn,{htmlFor:k,children:l(`${k}Subtitles`)})]},k))]}),A.jsxs(u1,{children:[A.jsx(vt,{onClick:n,children:l("cancel")}),A.jsx(vt,{onClick:_,children:l("downloadResult")})]})]})]})})},_N=le.div` +`,SN=({audioTracks:e,subtitles:t,onClose:n,onDownload:r,onRegenerate:o,progressMessage:a})=>{const{t:l}=so(),[c,f]=B.useState(["dubbed"]),[p,h]=B.useState([]),[y,m]=B.useState(!1),[b,C]=B.useState(null),O=k=>{f(E=>E.includes(k)?E.filter(R=>R!==k):[...E,k])},A=k=>{h(E=>E.includes(k)?E.filter(R=>R!==k):[...E,k])},_=async()=>{m(!0),C(null);try{await r(c,p),n()}catch(k){console.error("Error downloading video:",k),C(`${k}`)}finally{m(!1)}},v=()=>{o&&(o(),n())},x=B.useCallback(k=>{k.target===k.currentTarget&&n()},[n]);return b?L.jsx(tc,{children:L.jsxs(s1,{children:[L.jsx(dh,{children:l("downloadError")}),L.jsx(IS,{children:l("downloadErrorMessage")}),L.jsx(NS,{children:b}),L.jsxs(c1,{children:[L.jsx(vt,{onClick:n,children:l("cancel")}),o&&L.jsx(vt,{onClick:v,children:l("regenerate")})]})]})}):L.jsx(tc,{onClick:x,children:L.jsxs(s1,{children:[L.jsx(dh,{children:l(y?"preparingDownload":"selectTracksForDownload")}),y?L.jsxs(wN,{children:[L.jsx(yN,{}),L.jsx(xN,{children:L.jsx(ph,{children:a||l("downloading")})})]}):L.jsxs(L.Fragment,{children:[L.jsx(ph,{children:L.jsx(XL,{i18nKey:"downloadExplanation",components:{regenerateLink:L.jsx("span",{style:{color:ge.primary,cursor:"pointer"},onClick:v})}})}),L.jsxs(a1,{children:[L.jsx("h3",{children:l("audioTracks")}),Object.entries(e).filter(([k])=>k!=="background").map(([k,E],R)=>L.jsxs(l1,{children:[L.jsx(u1,{type:"checkbox",checked:c.includes(k),onChange:()=>O(k),disabled:y}),L.jsx(dn,{htmlFor:k,children:E.label})]},R))]}),L.jsxs(a1,{children:[L.jsx("h3",{children:l("subtitles")}),t.map(k=>L.jsxs(l1,{children:[L.jsx(u1,{type:"checkbox",checked:p.includes(k),onChange:()=>A(k),disabled:y}),L.jsx(dn,{htmlFor:k,children:l(`${k}Subtitles`)})]},k))]}),L.jsxs(c1,{children:[L.jsx(vt,{onClick:n,children:l("cancel")}),L.jsx(vt,{onClick:_,children:l("downloadResult")})]})]})]})})},_N=le.div` background: white; padding: 20px; border-radius: 8px; @@ -504,7 +504,7 @@ ${l}`}).join(` justify-content: flex-end; gap: 10px; margin-top: 20px; -`,kN=({onClose:e,onRegenerate:t})=>{const{t:n}=so(),[r,o]=B.useState(!1),[a,l]=B.useState(!1),[c,f]=B.useState(null),p=async()=>{o(!0);try{await t(),l(!0)}catch(y){console.error("Error regenerating video:",y),f(`${y}`)}},h=B.useCallback(y=>{y.target===y.currentTarget&&e()},[e]);return A.jsx(tc,{onClick:h,children:A.jsxs(_N,{children:[A.jsx(dh,{children:n("regenerateTitle")}),c?A.jsxs(A.Fragment,{children:[A.jsx(DS,{children:n("errorRegenerating")}),A.jsx(IS,{children:c})]}):A.jsx(ph,{children:n(a?"regenerateRequestSent":"regenerateDescription")}),A.jsx(bN,{children:!a&&!c?A.jsxs(A.Fragment,{children:[A.jsx(vt,{onClick:e,children:n("cancel")}),A.jsx(vt,{onClick:p,disabled:r,children:n(r?"regenerating":"regenerate")})]}):A.jsx(vt,{onClick:e,children:n("close")})})]})})};EA` +`,kN=({onClose:e,onRegenerate:t})=>{const{t:n}=so(),[r,o]=B.useState(!1),[a,l]=B.useState(!1),[c,f]=B.useState(null),p=async()=>{o(!0);try{await t(),l(!0)}catch(y){console.error("Error regenerating video:",y),f(`${y}`)}},h=B.useCallback(y=>{y.target===y.currentTarget&&e()},[e]);return L.jsx(tc,{onClick:h,children:L.jsxs(_N,{children:[L.jsx(dh,{children:n("regenerateTitle")}),c?L.jsxs(L.Fragment,{children:[L.jsx(IS,{children:n("errorRegenerating")}),L.jsx(NS,{children:c})]}):L.jsx(ph,{children:n(a?"regenerateRequestSent":"regenerateDescription")}),L.jsx(bN,{children:!a&&!c?L.jsxs(L.Fragment,{children:[L.jsx(vt,{onClick:e,children:n("cancel")}),L.jsx(vt,{onClick:p,disabled:r,children:n(r?"regenerating":"regenerate")})]}):L.jsx(vt,{onClick:e,children:n("close")})})]})})};TL` body { margin: 0; padding: 0; @@ -561,13 +561,13 @@ ${l}`}).join(` flex-direction: column; min-height: 0; overflow: hidden; -`,AN=le.div` +`,LN=le.div` flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; -`,c1=le.div` +`,f1=le.div` position: absolute; top: 50%; left: 50%; @@ -575,7 +575,7 @@ ${l}`}).join(` text-align: center; font-size: 1.2em; color: ${ge.primary}; -`,LN=le.div` +`,AN=le.div` position: absolute; top: 50%; left: 50%; @@ -584,4 +584,4 @@ ${l}`}).join(` flex-direction: column; align-items: center; gap: 10px; -`;function $N(){const{t:e,i18n:t}=so(),[n,r]=B.useState(null),[o,a]=B.useState([]),[l,c]=B.useState(""),[f,p]=B.useState(0),[h,y]=B.useState(!1),[m,b]=B.useState("list"),[C,O]=B.useState(""),[L,_]=B.useState(""),v=B.useRef(null),[x,k]=B.useState(null),[E,R]=B.useState(!1),[D,P]=B.useState(null),[j,I]=B.useState(null),[X,J]=B.useState(null),[ie,re]=B.useState(null),[ae,pe]=B.useState("dubbing"),[oe,H]=B.useState(!1),[z,U]=B.useState({}),[G,Y]=B.useState({}),[V,ee]=B.useState(null),[ue,F]=B.useState(["background","dubbed"]),[me,te]=B.useState("none"),[De,Pe]=B.useState(!0),[be,Se]=B.useState(!1),[Qe,Ke]=B.useState("dubbing"),[Te,wt]=B.useState(0),[Ce,Je]=B.useState(null),[wn,Ge]=B.useState(!1),[bt,on]=B.useState(null),[ft,_e]=B.useState(!1),[ze,Oi]=B.useState(!1),[qn,kt]=B.useState(!1),[ys,dr]=B.useState("");B.useEffect(()=>{const de=new URLSearchParams(window.location.search),ye=de.get("uuid"),je=de.get("revision"),Ye=de.get("service");Ye?Ke(Ye):pe(Qe||"dubbing"),console.log("Initial useEffect - UUID param:",ye,"Service param:",Ye,"App mode:",Qe),je&&I(je),ye?(P(ye),co(null,ye,je)):re("errorLoadingUUID")},[Qe]);const ws=()=>{r(null),c(""),a([]),p(0),y(!1),O(""),_(""),v.current&&v.current.setCurrentTime(0),l&&URL.revokeObjectURL(l)},uo=de=>{v.current&&v.current.setCurrentTime(de)},Ai=B.useCallback(de=>{de.code==="Space"&&de.target===document.body&&(de.preventDefault(),v.current&&(h?(v.current.pause(),y(!1)):(v.current.play(),y(!0))))},[h]);B.useEffect(()=>(document.addEventListener("keydown",Ai),()=>{document.removeEventListener("keydown",Ai)}),[Ai,h]),B.useEffect(()=>{const ye=setInterval(()=>{v.current&&p(v.current.currentTime)},100);return()=>clearInterval(ye)},[]);const co=B.useCallback(async(de,ye,je)=>{if(console.log("handleFileOrUUIDSelect called with UUID:",ye),l&&URL.revokeObjectURL(l),a([]),re(null),H(!0),ye){r(null);try{if(console.log("Starting API calls for UUID:",ye),ae==="dubbing")await ir.uuidExists(ye),c(ir.getMediaUrl(ye,je??"")),O("video/mp4");else if(ae==="transcription"){const[Ye,Ct]=await Promise.all([lu.getMediaMetadata(ye),lu.loadTracksFromUUID(ye)]);c(lu.getMediaUrl(ye,je??"")),O(Ye.contentType),_(Ye.filename),a(lu.parseTracksFromJSON(Ct))}}catch(Ye){console.error("Error loading media or tracks from UUID:",Ye),re("errorLoadingUUID")}}else if(de){r(de),O(de.type),_(de.name);try{const Ye=URL.createObjectURL(de);c(Ye);const Ct=await BI(de);a(Ct)}catch(Ye){console.error("Error processing media file:",Ye),a([])}}H(!1)},[ae]),xs=B.useCallback(async(de,ye)=>{try{const je=ye.filter(hr=>hr.dubbed_path&&hr.for_dubbing),Ye=je.length;let Ct=0;const pr={};for(const hr of je){const ho=hr.id;if(ho){const $i=await ir.loadDubbedUtterance(de,hr.id);pr[ho]=$i,Ct++,wt(Ct/Ye*100)}}Y(pr);const po=await zr.recreateConstructedAudio(ye,pr);ee(po),R(!0)}catch(je){console.error("Error loading chunks in background:",je)}Ge(!0)},[]),fo=de=>{k(de)},Rr=B.useCallback(async de=>{if(console.log("serviceParam",ae,"advancedEditMode",E),ae==="dubbing")try{if(Je(e("reconstructingAudio")),E){console.log("Recreating constructed audio...");const ye=await zr.recreateConstructedAudio(de,G);console.log("Audio reconstruction complete. Updating audio tracks..."),console.log("result",ye),ee(ye)}else{for(const ye of de)if(ye.needsResynthesis){const je=await zr.resynthesizeTrack(ye);ye.buffer=await zr.decodeAudioData(je),ye.needsResynthesis=!1}a(de)}}catch(ye){console.error("Error recreating constructed audio:",ye)}finally{Je(null)}},[ae,G,e,E]),Qc=B.useCallback(async(de,ye)=>{x&&(Ss(x.id,de,ye),k(null))},[x,Rr]),Ss=B.useCallback((de,ye,je=!1)=>{console.log(`Track ${de} changed:`,ye),a(Ye=>{const Ct=Ye.map(pr=>pr.id===de?{...ye,updated:!0}:pr);return je&&(console.log("Track changed, calling recreateConstructedAudio..."),Rr(Ct)),Ct})},[Rr]),Zc=de=>{de.target.files&&de.target.files.length>0&&J(de.target.files[0])},Ha=()=>{X&&co(X,null,null)},Va=de=>{F(ye=>ye.includes(de)?ye.filter(je=>je!==de):[...ye,de])},qc=de=>{te(de)},Jc=de=>{Pe(de)},Li=ae==="dubbing",Ka=()=>{Se(!0)},Ga=()=>{Se(!1)},ef=async(de,ye)=>{var je,Ye;if(l&&o.length>0){let Ct=n||l;dr(e("downloadingBackgroundAudio"));const pr=await zr.downloadAudioURL(z.background.url),po=await zr.decodeAudioData(pr),hr=[];for(const Zr of de){dr(e("downloadingTrack",{track:(je=z[Zr])==null?void 0:je.label.toLowerCase()}));let go=null;if(Zr==="dubbed")go=V;else{const mo=z[Zr];if(mo){const of=await zr.downloadAudioURL(mo.url);go=await zr.decodeAudioData(of)}}if(go&&po){dr(e("mixingAudio",{track:(Ye=z[Zr])==null?void 0:Ye.label.toLowerCase()}));const mo=await zr.mixAudioBuffers(po,go);hr.push({buffer:mo,label:Zr})}else throw new Error(`Audio track ${Zr} not found`)}dr(e("rebuildingMediaOnDownload"));const ho=await WI(Ct,o,hr,ye,dr);dr(e("preparingDownload"));const $i=URL.createObjectURL(ho),Di=document.createElement("a");Di.href=$i,Di.download=`output_${L}`,document.body.appendChild(Di),Di.click(),document.body.removeChild(Di),URL.revokeObjectURL($i)}},tf=B.useCallback(async(de,ye)=>{Je(e("reconstructingAudio"));try{await Ot.updateSpeaker(de,{voice:ye});const je=o.map(Ye=>Ye.speaker_id===de?{...Ye,needsResynthesis:!0,updated:!0}:Ye);a(je),await Rr(je)}catch(je){console.error("Error updating speaker voice:",je)}finally{Je(null)}},[o,Rr]);B.useEffect(()=>{const de="ca";t.changeLanguage(de)},[t]);const nf=async()=>{Ge(!1),on(e("loadingMedia"));try{if(D){const de=await ir.loadTracksFromUUID(D),ye=ir.parseTracksFromJSON(de);a(ye),c(ir.getSilentVideoUrl(D)),U({background:{url:ir.getBackgroundAudioUrl(D),label:e("backgroundAudio")},original:{url:ir.getOriginalVocalsUrl(D),label:e("originalVocals")},dubbed:{url:ir.getDubbedVocalsUrl(D),label:e("dubbedVocals")}}),ye.length<100?xs(D,ye):Ge(!0)}}catch(de){console.error("Error loading edit mode:",de),re("errorLoadingUUID")}finally{on(null),_e(!0)}},_s=()=>{const de=new URLSearchParams(window.location.search),ye=de.get("uuid"),je=de.get("revision")??"";if(ye){const Ye=ir.getMediaUrl(ye,je),Ct=document.createElement("a");Ct.href=Ye,Ct.download="dubbed_video.mp4",document.body.appendChild(Ct),Ct.click(),document.body.removeChild(Ct)}},rf=async()=>{if(D)try{await ir.regenerateVideo(D,o)}catch(de){console.error("Error regenerating video:",de)}};return A.jsxs(CN,{children:[A.jsxs(EN,{children:[bt&&A.jsx(sp,{children:bt}),Te>0&&Te<100&&A.jsxs(sp,{children:[e("loadingChunks"),": ",Te.toFixed(0),"%"]}),Ce&&A.jsx(sp,{children:Ce}),A.jsxs(TN,{children:[l&&A.jsxs(A.Fragment,{children:[!D&&A.jsx(vt,{onClick:ws,children:e("closeMedia")}),Li&&A.jsxs(A.Fragment,{children:[!ft&&A.jsx(vt,{onClick:nf,children:e("edit")}),ft?E?A.jsx(vt,{onClick:Ka,disabled:!wn,children:e("downloadResult")}):A.jsx(vt,{onClick:()=>kt(!0),disabled:!wn,children:e("regenerate")}):A.jsx(vt,{onClick:_s,children:e("downloadResult")})]}),!Li&&A.jsx(vt,{onClick:Ka,children:e("downloadResult")})]}),!1]})]}),A.jsx(ON,{children:oe?A.jsx(c1,{children:e("loading")}):l?A.jsxs(A.Fragment,{children:[A.jsx(PN,{isEditMode:ft,children:A.jsx(iL,{src:l,tracks:ft?o:[],ref:v,mediaType:C,audioTracks:z,selectedAudioTracks:ue,selectedSubtitles:me,advancedEditMode:E,dubbedAudioBuffer:V})}),ft&&A.jsx(AN,{children:o.length>0&&A.jsxs(A.Fragment,{children:[A.jsxs(RN,{children:[ze&&A.jsx(ap,{active:m==="timeline",onClick:()=>b("timeline"),children:e("timeline")}),A.jsx(ap,{active:m==="list",onClick:()=>b("list"),children:e("list")}),A.jsx(ap,{active:m==="options",onClick:()=>b("options"),children:e("options")})]}),m==="timeline"&&ze?A.jsx(WD,{tracks:o,currentTime:f,onTimeChange:uo,onEditTrack:fo,isDubbingService:Li,onTrackChange:Ss,showSpeakerColors:De,isMediaFullyLoaded:wn}):m==="list"?A.jsx(ZD,{tracks:o,onTrackChange:Ss,onTimeChange:uo,onEditTrack:fo,isDubbingService:Li,showSpeakerColors:De,isMediaFullyLoaded:wn}):A.jsx(mN,{audioTracks:z,selectedTracks:ue,onAudioTrackToggle:Va,selectedSubtitles:me,onSubtitlesChange:qc,showSpeakerColors:De,onShowSpeakerColorsChange:Jc,tracks:o,onSpeakerVoiceChange:tf,timelineVisible:ze,onTimelineVisibleChange:de=>{Oi(de),!de&&m==="timeline"&&b("list")},isMediaFullyLoaded:wn})]})})]}):ie?A.jsx(c1,{children:e(ie)}):(!Qe||Qe==="file")&&!D?A.jsxs(LN,{children:[A.jsx(Cu,{type:"file",onChange:Zc}),A.jsx(vt,{onClick:Ha,disabled:!X,children:e("openFile")})]}):null}),x&&A.jsx(YI,{track:x,onSave:Qc,onClose:()=>k(null),isDubbingService:Li}),be&&A.jsx(SN,{audioTracks:z,subtitles:["original","dubbed"],onClose:Ga,onDownload:ef,onRegenerate:()=>kt(!0),progressMessage:ys}),qn&&A.jsx(kN,{onClose:()=>kt(!1),onRegenerate:rf})]})}const DN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class rc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||DN,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{let[c,f]=l;for(let p=0;p{let[c,f]=l;for(let p=0;p{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},f1=e=>e==null?"":""+e,IN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},NN=/###/g,d1=e=>e&&e.indexOf("###")>-1?e.replace(NN,"."):e,p1=e=>!e||typeof e=="string",da=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let o=0;for(;o{const{obj:r,k:o}=da(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],l=t.slice(0,t.length-1),c=da(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=da(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},MN=(e,t,n,r)=>{const{obj:o,k:a}=da(e,t,Object);o[a]=o[a]||[],o[a].push(n)},ic=(e,t)=>{const{obj:n,k:r}=da(e,t);if(n)return n[r]},zN=(e,t,n)=>{const r=ic(e,n);return r!==void 0?r:ic(t,n)},VS=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):VS(e[r],t[r],n):e[r]=t[r]);return e},No=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var FN={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const UN=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>FN[t]):e;class jN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const BN=[" ",",","?","!",";"],WN=new jN(20),HN=(e,t,n)=>{t=t||"",n=n||"";const r=BN.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=WN.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let a=!o.test(e);if(!a){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(a=!0)}return a},hh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;a-1&&fe&&e.replace("_","-");class g1 extends Xc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&a?c.push(...r.split(a)):c.push(r)));const f=ic(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||typeof r!="string"?f:hh(this.data&&this.data[t]&&this.data[t][n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),h1(this.data,c,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(typeof r[a]=="string"||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let f=ic(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?VS(f,r,a):f={...f,...r},h1(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var KS={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{this.processors[a]&&(t=this.processors[a].process(t,n,r,o))}),t}};const m1={};class sc extends Xc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=br.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!HN(t,r,o);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:a};const p=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(p[0])>-1)&&(a=p.shift()),t=p.join(o)}return typeof a=="string"&&(a=[a]),{key:t,namespaces:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),f=c[c.length-1],p=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(h){const k=n.nsSeparator||this.options.nsSeparator;return o?{res:`${f}${k}${l}`,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:`${f}${k}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:l}const y=this.resolve(t,n);let m=y&&y.res;const b=y&&y.usedKey||l,C=y&&y.exactUsedKey||l,O=Object.prototype.toString.apply(m),L=["[object Number]","[object Function]","[object RegExp]"],_=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&L.indexOf(O)<0&&!(typeof _=="string"&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,m,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=k,y.usedParams=this.getUsedParamsDetails(n),y):k}if(a){const k=Array.isArray(m),E=k?[]:{},R=k?C:b;for(const D in m)if(Object.prototype.hasOwnProperty.call(m,D)){const P=`${R}${a}${D}`;E[D]=this.translate(P,{...n,joinArrays:!1,ns:c}),E[D]===P&&(E[D]=m[D])}m=E}}else if(v&&typeof _=="string"&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,t,n,r));else{let k=!1,E=!1;const R=n.count!==void 0&&typeof n.count!="string",D=sc.hasDefaultValue(n),P=R?this.pluralResolver.getSuffix(p,n.count,n):"",j=n.ordinal&&R?this.pluralResolver.getSuffix(p,n.count,{ordinal:!1}):"",I=R&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),X=I&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${j}`]||n.defaultValue;!this.isValidLookup(m)&&D&&(k=!0,m=X),this.isValidLookup(m)||(E=!0,m=l);const ie=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:m,re=D&&X!==m&&this.options.updateMissing;if(E||k||re){if(this.logger.log(re?"updateKey":"missingKey",p,f,l,re?X:m),a){const H=this.resolve(l,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ae=[];const pe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pe&&pe[0])for(let H=0;H{const G=D&&U!==m?U:ie;this.options.missingKeyHandler?this.options.missingKeyHandler(H,f,z,G,re,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,f,z,G,re,n),this.emit("missingKey",H,f,z,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?ae.forEach(H=>{const z=this.pluralResolver.getSuffixes(H,n);I&&n[`defaultValue${this.options.pluralSeparator}zero`]&&z.indexOf(`${this.options.pluralSeparator}zero`)<0&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{oe([H],l+U,n[`defaultValue${U}`]||X)})}):oe(ae,l,X))}m=this.extendTranslation(m,t,n,y,r),E&&m===l&&this.options.appendNamespaceToMissingKey&&(m=`${f}:${l}`),(E||k)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}:${l}`:l,k?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(y.res=m,y.usedParams=this.getUsedParamsDetails(n),y):m}extendTranslation(t,n,r,o,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(p){const m=t.match(this.interpolator.nestingRegexp);h=m&&m.length}let y=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||o.usedLng,r),p){const m=t.match(this.interpolator.nestingRegexp),b=m&&m.length;h1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,l,c;return typeof t=="string"&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(f,n),h=p.key;o=h;let y=p.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const m=n.count!==void 0&&typeof n.count!="string",b=m&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),C=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",O=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(L=>{this.isValidLookup(r)||(c=L,!m1[`${O[0]}-${L}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(m1[`${O[0]}-${L}`]=!0,this.logger.warn(`key "${o}" for languages "${O.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(_=>{if(this.isValidLookup(r))return;l=_;const v=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,h,_,L,n);else{let k;m&&(k=this.pluralResolver.getSuffix(_,n.count,n));const E=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(v.push(h+k),n.ordinal&&k.indexOf(R)===0&&v.push(h+k.replace(R,this.options.pluralSeparator)),b&&v.push(h+E)),C){const D=`${h}${this.options.contextSeparator}${n.context}`;v.push(D),m&&(v.push(D+k),n.ordinal&&k.indexOf(R)===0&&v.push(D+k.replace(R,this.options.pluralSeparator)),b&&v.push(D+E))}}let x;for(;x=v.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(_,L,x,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const lp=e=>e.charAt(0).toUpperCase()+e.slice(1);class v1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=br.create("languageUtils")}getScriptPartFromCode(t){if(t=oc(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=oc(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let o=Intl.getCanonicalLocales(t)[0];if(o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o)return o}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lp(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lp(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=lp(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&a(this.formatLanguageCode(l))}),o}}let VN=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],KN={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const GN=["v1","v2","v3"],YN=["v4"],y1={zero:0,one:1,two:2,few:3,many:4,other:5},XN=()=>{const e={};return VN.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:KN[t.fc]}})}),e};class QN{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=br.create("pluralResolver"),(!this.options.compatibilityJSON||YN.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=XN(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=oc(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const l=new Intl.PluralRules(r,{type:o});return this.pluralRulesCache[a]=l,l}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,a)=>y1[o]-y1[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!GN.includes(this.options.compatibilityJSON)}}const w1=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=zN(e,t,n);return!a&&o&&typeof n=="string"&&(a=hh(e,n,r),a===void 0&&(a=hh(t,n,r))),a},up=e=>e.replace(/\$/g,"$$$$");class ZN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=br.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:p,unescapeSuffix:h,unescapePrefix:y,nestingPrefix:m,nestingPrefixEscaped:b,nestingSuffix:C,nestingSuffixEscaped:O,nestingOptionsSeparator:L,maxReplaces:_,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:UN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?No(a):l||"{{",this.suffix=c?No(c):f||"}}",this.formatSeparator=p||",",this.unescapePrefix=h?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?No(m):b||No("$t("),this.nestingSuffix=C?No(C):O||No(")"),this.nestingOptionsSeparator=L||",",this.maxReplaces=_||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=b=>{if(b.indexOf(this.formatSeparator)<0){const _=w1(n,f,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,r,{...o,...n,interpolationkey:b}):_}const C=b.split(this.formatSeparator),O=C.shift().trim(),L=C.join(this.formatSeparator).trim();return this.format(w1(n,f,O,this.options.keySeparator,this.options.ignoreJSONStructure),L,r,{...o,...n,interpolationkey:O})};this.resetRegExp();const h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>up(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?up(this.escape(b)):up(b)}].forEach(b=>{for(c=0;a=b.regex.exec(t);){const C=a[1].trim();if(l=p(C),l===void 0)if(typeof h=="function"){const L=h(t,a,o);l=typeof L=="string"?L:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))l="";else if(y){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=f1(l));const O=b.safeValue(l);if(t=t.replace(a[0],O),y?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=a[0].length):b.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l;const c=(f,p)=>{const h=this.nestingOptionsSeparator;if(f.indexOf(h)<0)return f;const y=f.split(new RegExp(`${h}[ ]*{`));let m=`{${y[1]}`;f=y[0],m=this.interpolate(m,l);const b=m.match(/'/g),C=m.match(/"/g);(b&&b.length%2===0&&!C||C.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),p&&(l={...p,...l})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,O),`${f}${h}${m}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;o=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let p=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const h=o[1].split(this.formatSeparator).map(y=>y.trim());o[1]=h.shift(),f=h,p=!0}if(a=n(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=f1(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),p&&(a=f.reduce((h,y)=>this.format(h,y,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const qN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),p=f.join(":").trim().replace(/^'+|'+$/g,""),h=c.trim();n[h]||(n[h]=p),p==="false"&&(n[h]=!1),p==="true"&&(n[h]=!0),isNaN(p)||(n[h]=parseInt(p,10))}})}return{formatName:t,formatOptions:n}},Mo=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const l=r+JSON.stringify(a);let c=t[l];return c||(c=e(oc(r),o),t[l]=c),c(n)}};class JN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=br.create("formatter"),this.options=t,this.formats={number:Mo((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Mo((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Mo((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Mo((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Mo((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Mo(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,f)=>{const{formatName:p,formatOptions:h}=qN(f);if(this.formats[p]){let y=c;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},b=m.locale||m.lng||o.locale||o.lng||r;y=this.formats[p](c,b,{...h,...o,...m})}catch(m){this.logger.warn(m)}return y}else this.logger.warn(`there was no format function for ${p}`);return c},t)}}const e3=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class t3 extends Xc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=br.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const a={},l={},c={},f={};return t.forEach(p=>{let h=!0;n.forEach(y=>{const m=`${p}|${y}`;!r.reload&&this.store.hasResourceBundle(p,y)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?l[m]===void 0&&(l[m]=!0):(this.state[m]=1,h=!1,l[m]===void 0&&(l[m]=!0),a[m]===void 0&&(a[m]=!0),f[y]===void 0&&(f[y]=!0)))}),h||(c[p]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const o=t.split("|"),a=o[0],l=o[1];n&&this.emit("failedLoading",a,l,n),!n&&r&&this.store.addResourceBundle(a,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{MN(f.loaded,[a],l),e3(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(p=>{c[p]||(c[p]={});const h=f.loaded[p];h.length&&h.forEach(y=>{c[p][y]===void 0&&(c[p][y]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:l});return}this.readingCalls++;const c=(p,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(p&&h&&o{this.read.call(this,t,n,r,o+1,a*2,l)},a);return}l(p,h)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const p=f(t,n);p&&typeof p.then=="function"?p.then(h=>c(null,h)).catch(c):c(null,p)}catch(p){c(p)}return}return f(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const f={...l,isUpdate:a},p=this.backend.create.bind(this.backend);if(p.length<6)try{let h;p.length===5?h=p(t,n,r,o,f):h=p(t,n,r,o),h&&typeof h.then=="function"?h.then(y=>c(null,y)).catch(c):c(null,h)}catch(h){c(h)}else p(t,n,r,o,c,f)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const x1=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),S1=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),uu=()=>{},n3=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class La extends Xc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=S1(t),this.services={},this.logger=br,this.modules={external:[]},n3(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=x1();this.options={...o,...this.options,...S1(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?br.init(a(this.modules.logger),this.options):br.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=JN);const y=new v1(this.options);this.store=new g1(this.options.resources,this.options);const m=this.services;m.logger=br,m.resourceStore=this.store,m.languageUtils=y,m.pluralResolver=new QN(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new ZN(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new t3(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(b){for(var C=arguments.length,O=new Array(C>1?C-1:0),L=1;L1?C-1:0),L=1;L{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=uu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const f=Xs(),p=()=>{const h=(y,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(m),r(y,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),f}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uu;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(p=>{p!=="cimode"&&a.indexOf(p)<0&&a.push(p)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=Xs();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=uu),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&KS.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=Xs();this.emit("languageChanging",t);const a=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,p)=>{p?(a(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(f,function(){return r.t(...arguments)})},c=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const p=typeof f=="string"?f:this.services.languageUtils.getBestMatchFromCodes(f);p&&(this.language||a(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(p)),this.loadResources(p,h=>{l(h,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const a=function(l,c){let f;if(typeof c!="object"){for(var p=arguments.length,h=new Array(p>2?p-2:0),y=2;y`${f.keyPrefix}${m}${C}`):b=f.keyPrefix?`${f.keyPrefix}${m}${l}`:l,o.t(b,f)};return typeof t=="string"?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const p=this.services.backendConnector.state[`${c}|${f}`];return p===-1||p===0||p===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(a,t)))}loadNamespaces(t,n){const r=Xs();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Xs();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],a=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return a.length?(this.options.preload=o.concat(a),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new v1(x1());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new La(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uu;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new La(o);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new g1(this.store.data,o),a.services.resourceStore=a.store),a.translator=new sc(a.services,o),a.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h0){var c=o.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+="; Max-Age=".concat(Math.floor(c))}if(o.domain){if(!b1.test(o.domain))throw new TypeError("option domain is invalid");l+="; Domain=".concat(o.domain)}if(o.path){if(!b1.test(o.path))throw new TypeError("option path is invalid");l+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(l+="; HttpOnly"),o.secure&&(l+="; Secure"),o.sameSite){var f=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(f){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l},k1={create:function(t,n,r,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),o&&(a.domain=o),document.cookie=c3(t,encodeURIComponent(n),a)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),a=o.split("&"),l=0;l0){var f=a[l].substring(0,c);f===t.lookupQuerystring&&(n=a[l].substring(c+1))}}}return n}},Qs=null,C1=function(){if(Qs!==null)return Qs;try{Qs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Qs=!1}return Qs},p3={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&C1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&C1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Zs=null,E1=function(){if(Zs!==null)return Zs;try{Zs=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Zs=!1}return Zs},h3={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&E1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&E1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},g3={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},m3={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},v3={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},y3={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function w3(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var YS=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r3(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s3(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=u3(r,this.options||{},w3()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(a){return a.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(f3),this.addDetector(d3),this.addDetector(p3),this.addDetector(h3),this.addDetector(g3),this.addDetector(m3),this.addDetector(v3),this.addDetector(y3)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(a){if(r.detectors[a]){var l=r.detectors[a].lookup(r.options);l&&typeof l=="string"&&(l=[l]),l&&(o=o.concat(l))}}),o=o.map(function(a){return r.options.convertDetectedLanguage(a)}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(n,o.options)}))}}]),e}();YS.type="languageDetector";const x3="Timeline",S3="List",_3="Download",b3="Zoom Out",k3="Zoom In",C3="Reset Zoom",E3="Close File",T3="Open file",R3="Select a file or enter UUID",P3="Enter UUID",O3="Submit",A3="Save",L3="Cancel",$3="Error loading video, maybe it doesn't exist",D3="Original Text",I3="Translated Text",N3="Start Time",M3="End Time",z3="Text",F3="Speed",U3="Options",j3="Audio Tracks",B3="Delete",W3="Subtitles",H3="No Subtitles",V3="Original Subtitles",K3="Dubbed Subtitles",G3="Speakers",Y3="New speaker name",X3="Speaker",Q3="Select a speaker",Z3="Show speaker colors",q3="Select tracks for download",J3="Rebuilding media, please wait...",eM="Loading...",tM="Loading files, please wait...",nM="Reconstructing audio, please wait...",rM="Original Vocals",iM="Dubbed Vocals",oM="Background Audio",sM="Missing UUID",aM="Loading media, please wait...",lM="Edit",uM="Advanced",cM="Enable Timeline (experimental)",fM="Regenerate",dM="Regenerate video",pM="Regenerating...",hM="Once you have made all the necessary edits you can send us back the modifications so we can regenrate the video. You will receive an email once the video is ready.",gM="Your request has been sent successfully. You will receive an email once the video is ready.",mM="Close",vM="Undo",yM="Error regenerating video. Please try again.",wM="Downloading...",xM="Download Error",SM="There was an error downloading your video. You may need to regenerate it first.",_M="Preparing download...",bM="Downloading background audio...",kM="Downloading {{track}}...",CM="Mixing {{track}} with background...",EM="Rebuilding media...",TM="Loading FFmpeg...",RM="Preparing media...",PM="Add speaker",OM="Select voice",AM="Select the audio and subtitles tracks you want to download. The video will be regenerated in your browser so it may be slow depending on your device. If you prefer, you can request that the video be regenerated on our server here.",LM={timeline:x3,list:S3,downloadResult:_3,zoomOut:b3,zoomIn:k3,resetZoom:C3,closeMedia:E3,openFile:T3,selectFileOrUUID:R3,enterUUID:P3,submit:O3,save:A3,cancel:L3,errorLoadingUUID:$3,originalText:D3,translatedText:I3,startTime:N3,endTime:M3,text:z3,speed:F3,options:U3,audioTracks:j3,deleteTrack:B3,subtitles:W3,noSubtitles:H3,originalSubtitles:V3,dubbedSubtitles:K3,speakers:G3,newSpeakerName:Y3,speaker:X3,selectSpeaker:Q3,showSpeakerColors:Z3,selectTracksForDownload:q3,rebuildingMedia:J3,loading:eM,loadingChunks:tM,reconstructingAudio:nM,originalVocals:rM,dubbedVocals:iM,backgroundAudio:oM,missingUUID:sM,loadingMedia:aM,edit:lM,advanced:uM,enableTimeline:cM,delete:"Delete",regenerate:fM,regenerateTitle:dM,regenerating:pM,regenerateDescription:hM,regenerateRequestSent:gM,close:mM,undo:vM,errorRegenerating:yM,downloading:wM,downloadError:xM,downloadErrorMessage:SM,preparingDownload:_M,downloadingBackgroundAudio:bM,downloadingTrack:kM,mixingAudio:CM,rebuildingMediaOnDownload:EM,loadingFFmpeg:TM,preparingMedia:RM,addSpeaker:PM,selectVoice:OM,downloadExplanation:AM},$M="Línea de Tiempo",DM="Lista",IM="Descargar",NM="Alejar",MM="Acercar",zM="Restablecer Zoom",FM="Cerrar Archivo",UM="Abrir archivo",jM="Selecciona un archivo o introduce UUID",BM="Introduce UUID",WM="Enviar",HM="Guardar",VM="Cancelar",KM="Error cargando el video, es posible que ya no exista",GM="Texto Original",YM="Texto Traducido",XM="Tiempo Inicial",QM="Tiempo Final",ZM="Texto",qM="Velocidad",JM="Opciones",ez="Pistas de Audio",tz="Eliminar",nz="Subtítulos",rz="Sin Subtítulos",iz="Subtítulos Originales",oz="Subtítulos Doblados",sz="Hablantes",az="Nombre del nuevo hablante",lz="Hablante",uz="Selecciona un hablante",cz="Mostrar colores de hablantes",fz="Selecciona las pistas para descargar",dz="Reconstruyendo el video, por favor, espera...",pz="Cargando...",hz="Cargando archivos, por favor, espera...",gz="Reconstruyendo audio, por favor, espera...",mz="Voces Originales",vz="Voces Dobladas",yz="Audio de Fondo",wz="Falta UUID",xz="Cargando vídeo, por favor, espera...",Sz="Edita",_z="Avançat",bz="Mostrar Línea de Tiempo (experimental)",kz="Regenera",Cz="Regenerar vídeo",Ez="Regenerando...",Tz="Después de haber hecho todas las modificaciones necesarias, puedes enviarnos las modificaciones para regenerar el vídeo. Recibirás un correo electrónico cuando el vídeo esté listo.",Rz="La petición ha sido enviada con éxito. Recibirás un correo electrónico cuando el vídeo esté listo.",Pz="Cerrar",Oz="Deshacer",Az="Error regenerando el vídeo. Por favor, inténtalo de nuevo.",Lz="Descargando...",$z="Error descargando el vídeo",Dz="Ha ocurrido un error descargando el vídeo. Es posible que necesite regenerarlo primero.",Iz="Preparando la descarga...",Nz="Descargando audio de fondo...",Mz="Descargando {{track}}...",zz="Mezclando {{track}} con audio de fondo...",Fz="Reconstruyendo el vídeo...",Uz="Cargando FFmpeg...",jz="Preparando el vídeo...",Bz="Añadir hablante",Wz="Seleccionar voz",Hz="Selecciona las pistas de audio y subtítulos que quieres descargar. El vídeo se regenerará en tu navegador, por lo que puede ser lento dependiendo de tu dispositivo. Si prefieres, puedes solicitar que el vídeo se regenera en nuestro servidor aquí.",Vz={timeline:$M,list:DM,downloadResult:IM,zoomOut:NM,zoomIn:MM,resetZoom:zM,closeMedia:FM,openFile:UM,selectFileOrUUID:jM,enterUUID:BM,submit:WM,save:HM,cancel:VM,errorLoadingUUID:KM,originalText:GM,translatedText:YM,startTime:XM,endTime:QM,text:ZM,speed:qM,options:JM,audioTracks:ez,deleteTrack:tz,subtitles:nz,noSubtitles:rz,originalSubtitles:iz,dubbedSubtitles:oz,speakers:sz,newSpeakerName:az,speaker:lz,selectSpeaker:uz,showSpeakerColors:cz,selectTracksForDownload:fz,rebuildingMedia:dz,loading:pz,loadingChunks:hz,reconstructingAudio:gz,originalVocals:mz,dubbedVocals:vz,backgroundAudio:yz,missingUUID:wz,loadingMedia:xz,edit:Sz,advanced:_z,enableTimeline:bz,delete:"Eliminar",regenerate:kz,regenerateTitle:Cz,regenerating:Ez,regenerateDescription:Tz,regenerateRequestSent:Rz,close:Pz,undo:Oz,errorRegenerating:Az,downloading:Lz,downloadError:$z,downloadErrorMessage:Dz,preparingDownload:Iz,downloadingBackgroundAudio:Nz,downloadingTrack:Mz,mixingAudio:zz,rebuildingMediaOnDownload:Fz,loadingFFmpeg:Uz,preparingMedia:jz,addSpeaker:Bz,selectVoice:Wz,downloadExplanation:Hz},Kz="Línia de temps",Gz="Llista",Yz="Descarrega",Xz="Allunya",Qz="Apropa",Zz="Restablir Zoom",qz="Tanca Arxiu",Jz="Obre Arxiu",eF="Selecciona un arxiu o introdueix UUID",tF="Introdueix UUID",nF="Envia",rF="Desa",iF="Cancel·la",oF="Error carregant el vídeo, potser ja no existeix",sF="Text original",aF="Text traduït",lF="Temps inicial",uF="Temps final",cF="Text",fF="Velocitat",dF="Opcions",pF="Pistes d'àudio",hF="Elimina",gF="Subtítols",mF="Sense subtítols",vF="Subtítols originals",yF="Subtítols doblats",wF="Parlants",xF="Nom del nou parlant",SF="Parlant",_F="Seleccionar un parlant",bF="Mostrar colors de parlants",kF="Descarregar resultat",CF="Reconstruint el vídeo, si us plau, espereu...",EF="Carregant...",TF="Carregant fitxers, si us plau, espereu...",RF="Reconstruint àudio, si us plau, espereu...",PF="Veus originals",OF="Veus doblades",AF="Àudio de fons",LF="Error carregant el vídeo, manca l'UUID",$F="Carregant vídeo, si us plau, espereu...",DF="Edita",IF="Avançat",NF="Mostrar Línia de Temps (experimental)",MF="Regenera",zF="Regenerar vídeo",FF="Regenerant...",UF="Després d'haver fet totes les modificacions necessàries, podeu enviar-nos les modificacions per regenerar el vídeo. Rebreu un correu electrònic quan el vídeo estigui llest.",jF="La petició ha estat enviada amb èxit. Rebreu un correu electrònic quan el vídeo estigui llest.",BF="Tanca",WF="Desfer",HF="Error regenerant el vídeo",VF="Descarregant...",KF="Error descarregant el vídeo",GF="Hi ha hagut un error descarregant el vídeo. Podeu provar a enviar-ho per a que sigui regenerat al nostre servidor.",YF="Preparant la descàrrega...",XF="Descarregant àudio de fons...",QF="Descarregant {{track}}...",ZF="Mixant {{track}} amb àudio de fons...",qF="Reconstruint el vídeo...",JF="Carregant FFmpeg...",eU="Preparant el vídeo...",tU="Afegir un parlant",nU="Seleccionar veu",rU="Seleccioneu les pistes d'àudio i subtítols que voleu descarregar. El video es regenerarà en el vostre navegador pel que depenent del vostre dispositiu pot ser lent. Si ho preferiu, podeu demanar que el vídeo sigui regenerat al nostre servidor fent clic aquí.",iU={timeline:Kz,list:Gz,downloadResult:Yz,zoomOut:Xz,zoomIn:Qz,resetZoom:Zz,closeMedia:qz,openFile:Jz,selectFileOrUUID:eF,enterUUID:tF,submit:nF,save:rF,cancel:iF,errorLoadingUUID:oF,originalText:sF,translatedText:aF,startTime:lF,endTime:uF,text:cF,speed:fF,options:dF,audioTracks:pF,deleteTrack:hF,subtitles:gF,noSubtitles:mF,originalSubtitles:vF,dubbedSubtitles:yF,speakers:wF,newSpeakerName:xF,speaker:SF,selectSpeaker:_F,showSpeakerColors:bF,selectTracksForDownload:kF,rebuildingMedia:CF,loading:EF,loadingChunks:TF,reconstructingAudio:RF,originalVocals:PF,dubbedVocals:OF,backgroundAudio:AF,missingUUID:LF,loadingMedia:$F,edit:DF,advanced:IF,enableTimeline:NF,delete:"Eliminar",regenerate:MF,regenerateTitle:zF,regenerating:FF,regenerateDescription:UF,regenerateRequestSent:jF,close:BF,undo:WF,errorRegenerating:HF,downloading:VF,downloadError:KF,downloadErrorMessage:GF,preparingDownload:YF,downloadingBackgroundAudio:XF,downloadingTrack:QF,mixingAudio:ZF,rebuildingMediaOnDownload:qF,loadingFFmpeg:JF,preparingMedia:eU,addSpeaker:tU,selectVoice:nU,downloadExplanation:rU};Xt.use(YS).use(KA).init({resources:{en:{translation:LM},es:{translation:Vz},ca:{translation:iU}},fallbackLng:"en",detection:{order:["navigator"]},interpolation:{escapeValue:!1}});cp.createRoot(document.getElementById("root")).render(A.jsx(Wr.StrictMode,{children:A.jsx($N,{})})); +`;function $N(){const{t:e,i18n:t}=so(),[n,r]=B.useState(null),[o,a]=B.useState([]),[l,c]=B.useState(""),[f,p]=B.useState(0),[h,y]=B.useState(!1),[m,b]=B.useState("list"),[C,O]=B.useState(""),[A,_]=B.useState(""),v=B.useRef(null),[x,k]=B.useState(null),[E,R]=B.useState(!1),[D,P]=B.useState(null),[j,I]=B.useState(null),[X,J]=B.useState(null),[ie,re]=B.useState(null),[ae,pe]=B.useState("dubbing"),[oe,H]=B.useState(!1),[z,U]=B.useState({}),[G,Y]=B.useState({}),[V,ee]=B.useState(null),[ue,F]=B.useState(["background","dubbed"]),[me,te]=B.useState("none"),[De,Pe]=B.useState(!0),[be,Se]=B.useState(!1),[Qe,Ke]=B.useState("dubbing"),[Te,wt]=B.useState(0),[Ce,Je]=B.useState(null),[wn,Ge]=B.useState(!1),[bt,on]=B.useState(null),[ft,_e]=B.useState(!1),[ze,Oi]=B.useState(!1),[qn,kt]=B.useState(!1),[ys,dr]=B.useState("");B.useEffect(()=>{const de=new URLSearchParams(window.location.search),ye=de.get("uuid"),je=de.get("revision"),Ye=de.get("service");Ye?Ke(Ye):pe(Qe||"dubbing"),console.log("Initial useEffect - UUID param:",ye,"Service param:",Ye,"App mode:",Qe),je&&I(je),ye?(P(ye),co(null,ye,je)):re("errorLoadingUUID")},[Qe]);const ws=()=>{r(null),c(""),a([]),p(0),y(!1),O(""),_(""),v.current&&v.current.setCurrentTime(0),l&&URL.revokeObjectURL(l)},uo=de=>{v.current&&v.current.setCurrentTime(de)},Li=B.useCallback(de=>{de.code==="Space"&&de.target===document.body&&(de.preventDefault(),v.current&&(h?(v.current.pause(),y(!1)):(v.current.play(),y(!0))))},[h]);B.useEffect(()=>(document.addEventListener("keydown",Li),()=>{document.removeEventListener("keydown",Li)}),[Li,h]),B.useEffect(()=>{const ye=setInterval(()=>{v.current&&p(v.current.currentTime)},100);return()=>clearInterval(ye)},[]);const co=B.useCallback(async(de,ye,je)=>{if(console.log("handleFileOrUUIDSelect called with UUID:",ye),l&&URL.revokeObjectURL(l),a([]),re(null),H(!0),ye){r(null);try{if(console.log("Starting API calls for UUID:",ye),ae==="dubbing")await ir.uuidExists(ye),c(ir.getMediaUrl(ye,je??"")),O("video/mp4");else if(ae==="transcription"){const[Ye,Ct]=await Promise.all([lu.getMediaMetadata(ye),lu.loadTracksFromUUID(ye)]);c(lu.getMediaUrl(ye,je??"")),O(Ye.contentType),_(Ye.filename),a(await lu.parseTracksFromJSON(Ct))}}catch(Ye){console.error("Error loading media or tracks from UUID:",Ye),re("errorLoadingUUID")}}else if(de){r(de),O(de.type),_(de.name);try{const Ye=URL.createObjectURL(de);c(Ye);const Ct=await BI(de);a(Ct)}catch(Ye){console.error("Error processing media file:",Ye),a([])}}H(!1)},[ae]),xs=B.useCallback(async(de,ye)=>{try{const je=ye.filter(hr=>hr.dubbed_path&&hr.for_dubbing),Ye=je.length;let Ct=0;const pr={};for(const hr of je){const ho=hr.id;if(ho){const $i=await ir.loadDubbedUtterance(de,hr.id);pr[ho]=$i,Ct++,wt(Ct/Ye*100)}}Y(pr);const po=await zr.recreateConstructedAudio(ye,pr);ee(po),R(!0)}catch(je){console.error("Error loading chunks in background:",je)}Ge(!0)},[]),fo=de=>{k(de)},Rr=B.useCallback(async de=>{if(console.log("serviceParam",ae,"advancedEditMode",E),ae==="dubbing")try{if(Je(e("reconstructingAudio")),E){console.log("Recreating constructed audio...");const ye=await zr.recreateConstructedAudio(de,G);console.log("Audio reconstruction complete. Updating audio tracks..."),console.log("result",ye),ee(ye)}else{for(const ye of de)if(ye.needsResynthesis){const je=await zr.resynthesizeTrack(ye);ye.buffer=await zr.decodeAudioData(je),ye.needsResynthesis=!1}a(de)}}catch(ye){console.error("Error recreating constructed audio:",ye)}finally{Je(null)}},[ae,G,e,E]),Qc=B.useCallback(async(de,ye)=>{x&&(Ss(x.id,de,ye),k(null))},[x,Rr]),Ss=B.useCallback((de,ye,je=!1)=>{console.log(`Track ${de} changed:`,ye),a(Ye=>{const Ct=Ye.map(pr=>pr.id===de?{...ye,updated:!0}:pr);return je&&(console.log("Track changed, calling recreateConstructedAudio..."),Rr(Ct)),Ct})},[Rr]),Zc=de=>{de.target.files&&de.target.files.length>0&&J(de.target.files[0])},Ha=()=>{X&&co(X,null,null)},Va=de=>{F(ye=>ye.includes(de)?ye.filter(je=>je!==de):[...ye,de])},qc=de=>{te(de)},Jc=de=>{Pe(de)},Ai=ae==="dubbing",Ka=()=>{Se(!0)},Ga=()=>{Se(!1)},ef=async(de,ye)=>{var je,Ye;if(l&&o.length>0){let Ct=n||l;dr(e("downloadingBackgroundAudio"));const pr=await zr.downloadAudioURL(z.background.url),po=await zr.decodeAudioData(pr),hr=[];for(const Zr of de){dr(e("downloadingTrack",{track:(je=z[Zr])==null?void 0:je.label.toLowerCase()}));let go=null;if(Zr==="dubbed")go=V;else{const mo=z[Zr];if(mo){const of=await zr.downloadAudioURL(mo.url);go=await zr.decodeAudioData(of)}}if(go&&po){dr(e("mixingAudio",{track:(Ye=z[Zr])==null?void 0:Ye.label.toLowerCase()}));const mo=await zr.mixAudioBuffers(po,go);hr.push({buffer:mo,label:Zr})}else throw new Error(`Audio track ${Zr} not found`)}dr(e("rebuildingMediaOnDownload"));const ho=await WI(Ct,o,hr,ye,dr);dr(e("preparingDownload"));const $i=URL.createObjectURL(ho),Di=document.createElement("a");Di.href=$i,Di.download=`output_${A}`,document.body.appendChild(Di),Di.click(),document.body.removeChild(Di),URL.revokeObjectURL($i)}},tf=B.useCallback(async(de,ye)=>{Je(e("reconstructingAudio"));try{await Ot.updateSpeaker(de,{voice:ye});const je=o.map(Ye=>Ye.speaker_id===de?{...Ye,needsResynthesis:!0,updated:!0}:Ye);a(je),await Rr(je)}catch(je){console.error("Error updating speaker voice:",je)}finally{Je(null)}},[o,Rr]);B.useEffect(()=>{const de="ca";t.changeLanguage(de)},[t]);const nf=async()=>{Ge(!1),on(e("loadingMedia"));try{if(D){const de=await ir.loadTracksFromUUID(D),ye=await ir.parseTracksFromJSON(de);a(ye),c(ir.getSilentVideoUrl(D)),U({background:{url:ir.getBackgroundAudioUrl(D),label:e("backgroundAudio")},original:{url:ir.getOriginalVocalsUrl(D),label:e("originalVocals")},dubbed:{url:ir.getDubbedVocalsUrl(D),label:e("dubbedVocals")}}),ye.length<100?xs(D,ye):Ge(!0)}}catch(de){console.error("Error loading edit mode:",de),re("errorLoadingUUID")}finally{on(null),_e(!0)}},_s=()=>{const de=new URLSearchParams(window.location.search),ye=de.get("uuid"),je=de.get("revision")??"";if(ye){const Ye=ir.getMediaUrl(ye,je),Ct=document.createElement("a");Ct.href=Ye,Ct.download="dubbed_video.mp4",document.body.appendChild(Ct),Ct.click(),document.body.removeChild(Ct)}},rf=async()=>{if(D)try{await ir.regenerateVideo(D,o)}catch(de){console.error("Error regenerating video:",de)}};return L.jsxs(CN,{children:[L.jsxs(EN,{children:[bt&&L.jsx(sp,{children:bt}),Te>0&&Te<100&&L.jsxs(sp,{children:[e("loadingChunks"),": ",Te.toFixed(0),"%"]}),Ce&&L.jsx(sp,{children:Ce}),L.jsxs(TN,{children:[l&&L.jsxs(L.Fragment,{children:[!D&&L.jsx(vt,{onClick:ws,children:e("closeMedia")}),Ai&&L.jsxs(L.Fragment,{children:[!ft&&L.jsx(vt,{onClick:nf,children:e("edit")}),ft?E?L.jsx(vt,{onClick:Ka,disabled:!wn,children:e("downloadResult")}):L.jsx(vt,{onClick:()=>kt(!0),disabled:!wn,children:e("regenerate")}):L.jsx(vt,{onClick:_s,children:e("downloadResult")})]}),!Ai&&L.jsx(vt,{onClick:Ka,children:e("downloadResult")})]}),!1]})]}),L.jsx(ON,{children:oe?L.jsx(f1,{children:e("loading")}):l?L.jsxs(L.Fragment,{children:[L.jsx(PN,{isEditMode:ft,children:L.jsx(oA,{src:l,tracks:ft?o:[],ref:v,mediaType:C,audioTracks:z,selectedAudioTracks:ue,selectedSubtitles:me,advancedEditMode:E,dubbedAudioBuffer:V})}),ft&&L.jsx(LN,{children:o.length>0&&L.jsxs(L.Fragment,{children:[L.jsxs(RN,{children:[ze&&L.jsx(ap,{active:m==="timeline",onClick:()=>b("timeline"),children:e("timeline")}),L.jsx(ap,{active:m==="list",onClick:()=>b("list"),children:e("list")}),L.jsx(ap,{active:m==="options",onClick:()=>b("options"),children:e("options")})]}),m==="timeline"&&ze?L.jsx(WD,{tracks:o,currentTime:f,onTimeChange:uo,onEditTrack:fo,isDubbingService:Ai,onTrackChange:Ss,showSpeakerColors:De,isMediaFullyLoaded:wn}):m==="list"?L.jsx(ZD,{tracks:o,onTrackChange:Ss,onTimeChange:uo,onEditTrack:fo,isDubbingService:Ai,showSpeakerColors:De,isMediaFullyLoaded:wn}):L.jsx(mN,{audioTracks:z,selectedTracks:ue,onAudioTrackToggle:Va,selectedSubtitles:me,onSubtitlesChange:qc,showSpeakerColors:De,onShowSpeakerColorsChange:Jc,tracks:o,onSpeakerVoiceChange:tf,timelineVisible:ze,onTimelineVisibleChange:de=>{Oi(de),!de&&m==="timeline"&&b("list")},isMediaFullyLoaded:wn})]})})]}):ie?L.jsx(f1,{children:e(ie)}):(!Qe||Qe==="file")&&!D?L.jsxs(AN,{children:[L.jsx(Cu,{type:"file",onChange:Zc}),L.jsx(vt,{onClick:Ha,disabled:!X,children:e("openFile")})]}):null}),x&&L.jsx(YI,{track:x,onSave:Qc,onClose:()=>k(null),isDubbingService:Ai}),be&&L.jsx(SN,{audioTracks:z,subtitles:["original","dubbed"],onClose:Ga,onDownload:ef,onRegenerate:()=>kt(!0),progressMessage:ys}),qn&&L.jsx(kN,{onClose:()=>kt(!1),onRegenerate:rf})]})}const DN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class rc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||DN,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{let[c,f]=l;for(let p=0;p{let[c,f]=l;for(let p=0;p{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},d1=e=>e==null?"":""+e,IN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},NN=/###/g,p1=e=>e&&e.indexOf("###")>-1?e.replace(NN,"."):e,h1=e=>!e||typeof e=="string",da=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let o=0;for(;o{const{obj:r,k:o}=da(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],l=t.slice(0,t.length-1),c=da(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=da(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},MN=(e,t,n,r)=>{const{obj:o,k:a}=da(e,t,Object);o[a]=o[a]||[],o[a].push(n)},ic=(e,t)=>{const{obj:n,k:r}=da(e,t);if(n)return n[r]},zN=(e,t,n)=>{const r=ic(e,n);return r!==void 0?r:ic(t,n)},KS=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):KS(e[r],t[r],n):e[r]=t[r]);return e},No=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var FN={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const UN=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>FN[t]):e;class jN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const BN=[" ",",","?","!",";"],WN=new jN(20),HN=(e,t,n)=>{t=t||"",n=n||"";const r=BN.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=WN.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let a=!o.test(e);if(!a){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(a=!0)}return a},hh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;a-1&&fe&&e.replace("_","-");class m1 extends Xc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&a?c.push(...r.split(a)):c.push(r)));const f=ic(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||typeof r!="string"?f:hh(this.data&&this.data[t]&&this.data[t][n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),g1(this.data,c,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(typeof r[a]=="string"||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let f=ic(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?KS(f,r,a):f={...f,...r},g1(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var GS={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{this.processors[a]&&(t=this.processors[a].process(t,n,r,o))}),t}};const v1={};class sc extends Xc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=br.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!HN(t,r,o);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:a};const p=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(p[0])>-1)&&(a=p.shift()),t=p.join(o)}return typeof a=="string"&&(a=[a]),{key:t,namespaces:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),f=c[c.length-1],p=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(h){const k=n.nsSeparator||this.options.nsSeparator;return o?{res:`${f}${k}${l}`,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:`${f}${k}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:l}const y=this.resolve(t,n);let m=y&&y.res;const b=y&&y.usedKey||l,C=y&&y.exactUsedKey||l,O=Object.prototype.toString.apply(m),A=["[object Number]","[object Function]","[object RegExp]"],_=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&A.indexOf(O)<0&&!(typeof _=="string"&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,m,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=k,y.usedParams=this.getUsedParamsDetails(n),y):k}if(a){const k=Array.isArray(m),E=k?[]:{},R=k?C:b;for(const D in m)if(Object.prototype.hasOwnProperty.call(m,D)){const P=`${R}${a}${D}`;E[D]=this.translate(P,{...n,joinArrays:!1,ns:c}),E[D]===P&&(E[D]=m[D])}m=E}}else if(v&&typeof _=="string"&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,t,n,r));else{let k=!1,E=!1;const R=n.count!==void 0&&typeof n.count!="string",D=sc.hasDefaultValue(n),P=R?this.pluralResolver.getSuffix(p,n.count,n):"",j=n.ordinal&&R?this.pluralResolver.getSuffix(p,n.count,{ordinal:!1}):"",I=R&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),X=I&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${j}`]||n.defaultValue;!this.isValidLookup(m)&&D&&(k=!0,m=X),this.isValidLookup(m)||(E=!0,m=l);const ie=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:m,re=D&&X!==m&&this.options.updateMissing;if(E||k||re){if(this.logger.log(re?"updateKey":"missingKey",p,f,l,re?X:m),a){const H=this.resolve(l,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ae=[];const pe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pe&&pe[0])for(let H=0;H{const G=D&&U!==m?U:ie;this.options.missingKeyHandler?this.options.missingKeyHandler(H,f,z,G,re,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,f,z,G,re,n),this.emit("missingKey",H,f,z,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?ae.forEach(H=>{const z=this.pluralResolver.getSuffixes(H,n);I&&n[`defaultValue${this.options.pluralSeparator}zero`]&&z.indexOf(`${this.options.pluralSeparator}zero`)<0&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{oe([H],l+U,n[`defaultValue${U}`]||X)})}):oe(ae,l,X))}m=this.extendTranslation(m,t,n,y,r),E&&m===l&&this.options.appendNamespaceToMissingKey&&(m=`${f}:${l}`),(E||k)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}:${l}`:l,k?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(y.res=m,y.usedParams=this.getUsedParamsDetails(n),y):m}extendTranslation(t,n,r,o,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(p){const m=t.match(this.interpolator.nestingRegexp);h=m&&m.length}let y=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||o.usedLng,r),p){const m=t.match(this.interpolator.nestingRegexp),b=m&&m.length;h1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,l,c;return typeof t=="string"&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const p=this.extractFromKey(f,n),h=p.key;o=h;let y=p.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const m=n.count!==void 0&&typeof n.count!="string",b=m&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),C=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",O=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(A=>{this.isValidLookup(r)||(c=A,!v1[`${O[0]}-${A}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(v1[`${O[0]}-${A}`]=!0,this.logger.warn(`key "${o}" for languages "${O.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(_=>{if(this.isValidLookup(r))return;l=_;const v=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,h,_,A,n);else{let k;m&&(k=this.pluralResolver.getSuffix(_,n.count,n));const E=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(v.push(h+k),n.ordinal&&k.indexOf(R)===0&&v.push(h+k.replace(R,this.options.pluralSeparator)),b&&v.push(h+E)),C){const D=`${h}${this.options.contextSeparator}${n.context}`;v.push(D),m&&(v.push(D+k),n.ordinal&&k.indexOf(R)===0&&v.push(D+k.replace(R,this.options.pluralSeparator)),b&&v.push(D+E))}}let x;for(;x=v.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(_,A,x,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const lp=e=>e.charAt(0).toUpperCase()+e.slice(1);class y1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=br.create("languageUtils")}getScriptPartFromCode(t){if(t=oc(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=oc(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let o=Intl.getCanonicalLocales(t)[0];if(o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o)return o}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lp(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lp(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=lp(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&a(this.formatLanguageCode(l))}),o}}let VN=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],KN={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const GN=["v1","v2","v3"],YN=["v4"],w1={zero:0,one:1,two:2,few:3,many:4,other:5},XN=()=>{const e={};return VN.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:KN[t.fc]}})}),e};class QN{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=br.create("pluralResolver"),(!this.options.compatibilityJSON||YN.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=XN(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=oc(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const l=new Intl.PluralRules(r,{type:o});return this.pluralRulesCache[a]=l,l}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,a)=>w1[o]-w1[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!GN.includes(this.options.compatibilityJSON)}}const x1=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=zN(e,t,n);return!a&&o&&typeof n=="string"&&(a=hh(e,n,r),a===void 0&&(a=hh(t,n,r))),a},up=e=>e.replace(/\$/g,"$$$$");class ZN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=br.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:p,unescapeSuffix:h,unescapePrefix:y,nestingPrefix:m,nestingPrefixEscaped:b,nestingSuffix:C,nestingSuffixEscaped:O,nestingOptionsSeparator:A,maxReplaces:_,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:UN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?No(a):l||"{{",this.suffix=c?No(c):f||"}}",this.formatSeparator=p||",",this.unescapePrefix=h?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?No(m):b||No("$t("),this.nestingSuffix=C?No(C):O||No(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=_||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=b=>{if(b.indexOf(this.formatSeparator)<0){const _=x1(n,f,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,r,{...o,...n,interpolationkey:b}):_}const C=b.split(this.formatSeparator),O=C.shift().trim(),A=C.join(this.formatSeparator).trim();return this.format(x1(n,f,O,this.options.keySeparator,this.options.ignoreJSONStructure),A,r,{...o,...n,interpolationkey:O})};this.resetRegExp();const h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>up(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?up(this.escape(b)):up(b)}].forEach(b=>{for(c=0;a=b.regex.exec(t);){const C=a[1].trim();if(l=p(C),l===void 0)if(typeof h=="function"){const A=h(t,a,o);l=typeof A=="string"?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))l="";else if(y){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=d1(l));const O=b.safeValue(l);if(t=t.replace(a[0],O),y?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=a[0].length):b.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l;const c=(f,p)=>{const h=this.nestingOptionsSeparator;if(f.indexOf(h)<0)return f;const y=f.split(new RegExp(`${h}[ ]*{`));let m=`{${y[1]}`;f=y[0],m=this.interpolate(m,l);const b=m.match(/'/g),C=m.match(/"/g);(b&&b.length%2===0&&!C||C.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),p&&(l={...p,...l})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,O),`${f}${h}${m}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;o=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let p=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const h=o[1].split(this.formatSeparator).map(y=>y.trim());o[1]=h.shift(),f=h,p=!0}if(a=n(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=d1(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),p&&(a=f.reduce((h,y)=>this.format(h,y,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const qN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),p=f.join(":").trim().replace(/^'+|'+$/g,""),h=c.trim();n[h]||(n[h]=p),p==="false"&&(n[h]=!1),p==="true"&&(n[h]=!0),isNaN(p)||(n[h]=parseInt(p,10))}})}return{formatName:t,formatOptions:n}},Mo=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const l=r+JSON.stringify(a);let c=t[l];return c||(c=e(oc(r),o),t[l]=c),c(n)}};class JN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=br.create("formatter"),this.options=t,this.formats={number:Mo((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Mo((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Mo((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Mo((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Mo((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Mo(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,f)=>{const{formatName:p,formatOptions:h}=qN(f);if(this.formats[p]){let y=c;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},b=m.locale||m.lng||o.locale||o.lng||r;y=this.formats[p](c,b,{...h,...o,...m})}catch(m){this.logger.warn(m)}return y}else this.logger.warn(`there was no format function for ${p}`);return c},t)}}const e3=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class t3 extends Xc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=br.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const a={},l={},c={},f={};return t.forEach(p=>{let h=!0;n.forEach(y=>{const m=`${p}|${y}`;!r.reload&&this.store.hasResourceBundle(p,y)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?l[m]===void 0&&(l[m]=!0):(this.state[m]=1,h=!1,l[m]===void 0&&(l[m]=!0),a[m]===void 0&&(a[m]=!0),f[y]===void 0&&(f[y]=!0)))}),h||(c[p]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const o=t.split("|"),a=o[0],l=o[1];n&&this.emit("failedLoading",a,l,n),!n&&r&&this.store.addResourceBundle(a,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{MN(f.loaded,[a],l),e3(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(p=>{c[p]||(c[p]={});const h=f.loaded[p];h.length&&h.forEach(y=>{c[p][y]===void 0&&(c[p][y]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:l});return}this.readingCalls++;const c=(p,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(p&&h&&o{this.read.call(this,t,n,r,o+1,a*2,l)},a);return}l(p,h)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const p=f(t,n);p&&typeof p.then=="function"?p.then(h=>c(null,h)).catch(c):c(null,p)}catch(p){c(p)}return}return f(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const f={...l,isUpdate:a},p=this.backend.create.bind(this.backend);if(p.length<6)try{let h;p.length===5?h=p(t,n,r,o,f):h=p(t,n,r,o),h&&typeof h.then=="function"?h.then(y=>c(null,y)).catch(c):c(null,h)}catch(h){c(h)}else p(t,n,r,o,c,f)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const S1=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),_1=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),uu=()=>{},n3=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Aa extends Xc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=_1(t),this.services={},this.logger=br,this.modules={external:[]},n3(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=S1();this.options={...o,...this.options,..._1(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?br.init(a(this.modules.logger),this.options):br.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=JN);const y=new y1(this.options);this.store=new m1(this.options.resources,this.options);const m=this.services;m.logger=br,m.resourceStore=this.store,m.languageUtils=y,m.pluralResolver=new QN(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new ZN(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new t3(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(b){for(var C=arguments.length,O=new Array(C>1?C-1:0),A=1;A1?C-1:0),A=1;A{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=uu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const f=Xs(),p=()=>{const h=(y,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(m),r(y,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),f}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uu;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(p=>{p!=="cimode"&&a.indexOf(p)<0&&a.push(p)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=Xs();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=uu),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&GS.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=Xs();this.emit("languageChanging",t);const a=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,p)=>{p?(a(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(f,function(){return r.t(...arguments)})},c=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const p=typeof f=="string"?f:this.services.languageUtils.getBestMatchFromCodes(f);p&&(this.language||a(p),this.translator.language||this.translator.changeLanguage(p),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(p)),this.loadResources(p,h=>{l(h,p)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const a=function(l,c){let f;if(typeof c!="object"){for(var p=arguments.length,h=new Array(p>2?p-2:0),y=2;y`${f.keyPrefix}${m}${C}`):b=f.keyPrefix?`${f.keyPrefix}${m}${l}`:l,o.t(b,f)};return typeof t=="string"?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const p=this.services.backendConnector.state[`${c}|${f}`];return p===-1||p===0||p===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(a,t)))}loadNamespaces(t,n){const r=Xs();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Xs();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],a=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return a.length?(this.options.preload=o.concat(a),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new y1(S1());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Aa(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uu;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new Aa(o);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new m1(this.store.data,o),a.services.resourceStore=a.store),a.translator=new sc(a.services,o),a.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h0){var c=o.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+="; Max-Age=".concat(Math.floor(c))}if(o.domain){if(!k1.test(o.domain))throw new TypeError("option domain is invalid");l+="; Domain=".concat(o.domain)}if(o.path){if(!k1.test(o.path))throw new TypeError("option path is invalid");l+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(l+="; HttpOnly"),o.secure&&(l+="; Secure"),o.sameSite){var f=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(f){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l},C1={create:function(t,n,r,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),o&&(a.domain=o),document.cookie=c3(t,encodeURIComponent(n),a)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),a=o.split("&"),l=0;l0){var f=a[l].substring(0,c);f===t.lookupQuerystring&&(n=a[l].substring(c+1))}}}return n}},Qs=null,E1=function(){if(Qs!==null)return Qs;try{Qs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Qs=!1}return Qs},p3={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&E1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&E1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Zs=null,T1=function(){if(Zs!==null)return Zs;try{Zs=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Zs=!1}return Zs},h3={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&T1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&T1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},g3={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},m3={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},v3={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},y3={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function w3(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var XS=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r3(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return s3(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=u3(r,this.options||{},w3()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(a){return a.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(f3),this.addDetector(d3),this.addDetector(p3),this.addDetector(h3),this.addDetector(g3),this.addDetector(m3),this.addDetector(v3),this.addDetector(y3)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(a){if(r.detectors[a]){var l=r.detectors[a].lookup(r.options);l&&typeof l=="string"&&(l=[l]),l&&(o=o.concat(l))}}),o=o.map(function(a){return r.options.convertDetectedLanguage(a)}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(n,o.options)}))}}]),e}();XS.type="languageDetector";const x3="Timeline",S3="List",_3="Download",b3="Zoom Out",k3="Zoom In",C3="Reset Zoom",E3="Close File",T3="Open file",R3="Select a file or enter UUID",P3="Enter UUID",O3="Submit",L3="Save",A3="Cancel",$3="Error loading video, maybe it doesn't exist",D3="Original Text",I3="Translated Text",N3="Start Time",M3="End Time",z3="Text",F3="Speed",U3="Options",j3="Audio Tracks",B3="Delete",W3="Subtitles",H3="No Subtitles",V3="Original Subtitles",K3="Dubbed Subtitles",G3="Speakers",Y3="New speaker name",X3="Speaker",Q3="Select a speaker",Z3="Show speaker colors",q3="Select tracks for download",J3="Rebuilding media, please wait...",eM="Loading...",tM="Loading files, please wait...",nM="Reconstructing audio, please wait...",rM="Original Vocals",iM="Dubbed Vocals",oM="Background Audio",sM="Missing UUID",aM="Loading media, please wait...",lM="Edit",uM="Advanced",cM="Enable Timeline (experimental)",fM="Regenerate",dM="Regenerate video",pM="Regenerating...",hM="Once you have made all the necessary edits you can send us back the modifications so we can regenrate the video. You will receive an email once the video is ready.",gM="Your request has been sent successfully. You will receive an email once the video is ready.",mM="Close",vM="Undo",yM="Error regenerating video. Please try again.",wM="Downloading...",xM="Download Error",SM="There was an error downloading your video. You may need to regenerate it first.",_M="Preparing download...",bM="Downloading background audio...",kM="Downloading {{track}}...",CM="Mixing {{track}} with background...",EM="Rebuilding media...",TM="Loading FFmpeg...",RM="Preparing media...",PM="Add speaker",OM="Select voice",LM="Select the audio and subtitles tracks you want to download. The video will be regenerated in your browser so it may be slow depending on your device. If you prefer, you can request that the video be regenerated on our server here.",AM={timeline:x3,list:S3,downloadResult:_3,zoomOut:b3,zoomIn:k3,resetZoom:C3,closeMedia:E3,openFile:T3,selectFileOrUUID:R3,enterUUID:P3,submit:O3,save:L3,cancel:A3,errorLoadingUUID:$3,originalText:D3,translatedText:I3,startTime:N3,endTime:M3,text:z3,speed:F3,options:U3,audioTracks:j3,deleteTrack:B3,subtitles:W3,noSubtitles:H3,originalSubtitles:V3,dubbedSubtitles:K3,speakers:G3,newSpeakerName:Y3,speaker:X3,selectSpeaker:Q3,showSpeakerColors:Z3,selectTracksForDownload:q3,rebuildingMedia:J3,loading:eM,loadingChunks:tM,reconstructingAudio:nM,originalVocals:rM,dubbedVocals:iM,backgroundAudio:oM,missingUUID:sM,loadingMedia:aM,edit:lM,advanced:uM,enableTimeline:cM,delete:"Delete",regenerate:fM,regenerateTitle:dM,regenerating:pM,regenerateDescription:hM,regenerateRequestSent:gM,close:mM,undo:vM,errorRegenerating:yM,downloading:wM,downloadError:xM,downloadErrorMessage:SM,preparingDownload:_M,downloadingBackgroundAudio:bM,downloadingTrack:kM,mixingAudio:CM,rebuildingMediaOnDownload:EM,loadingFFmpeg:TM,preparingMedia:RM,addSpeaker:PM,selectVoice:OM,downloadExplanation:LM},$M="Línea de Tiempo",DM="Lista",IM="Descargar",NM="Alejar",MM="Acercar",zM="Restablecer Zoom",FM="Cerrar Archivo",UM="Abrir archivo",jM="Selecciona un archivo o introduce UUID",BM="Introduce UUID",WM="Enviar",HM="Guardar",VM="Cancelar",KM="Error cargando el video, es posible que ya no exista",GM="Texto Original",YM="Texto Traducido",XM="Tiempo Inicial",QM="Tiempo Final",ZM="Texto",qM="Velocidad",JM="Opciones",ez="Pistas de Audio",tz="Eliminar",nz="Subtítulos",rz="Sin Subtítulos",iz="Subtítulos Originales",oz="Subtítulos Doblados",sz="Hablantes",az="Nombre del nuevo hablante",lz="Hablante",uz="Selecciona un hablante",cz="Mostrar colores de hablantes",fz="Selecciona las pistas para descargar",dz="Reconstruyendo el video, por favor, espera...",pz="Cargando...",hz="Cargando archivos, por favor, espera...",gz="Reconstruyendo audio, por favor, espera...",mz="Voces Originales",vz="Voces Dobladas",yz="Audio de Fondo",wz="Falta UUID",xz="Cargando vídeo, por favor, espera...",Sz="Edita",_z="Avançat",bz="Mostrar Línea de Tiempo (experimental)",kz="Regenera",Cz="Regenerar vídeo",Ez="Regenerando...",Tz="Después de haber hecho todas las modificaciones necesarias, puedes enviarnos las modificaciones para regenerar el vídeo. Recibirás un correo electrónico cuando el vídeo esté listo.",Rz="La petición ha sido enviada con éxito. Recibirás un correo electrónico cuando el vídeo esté listo.",Pz="Cerrar",Oz="Deshacer",Lz="Error regenerando el vídeo. Por favor, inténtalo de nuevo.",Az="Descargando...",$z="Error descargando el vídeo",Dz="Ha ocurrido un error descargando el vídeo. Es posible que necesite regenerarlo primero.",Iz="Preparando la descarga...",Nz="Descargando audio de fondo...",Mz="Descargando {{track}}...",zz="Mezclando {{track}} con audio de fondo...",Fz="Reconstruyendo el vídeo...",Uz="Cargando FFmpeg...",jz="Preparando el vídeo...",Bz="Añadir hablante",Wz="Seleccionar voz",Hz="Selecciona las pistas de audio y subtítulos que quieres descargar. El vídeo se regenerará en tu navegador, por lo que puede ser lento dependiendo de tu dispositivo. Si prefieres, puedes solicitar que el vídeo se regenera en nuestro servidor aquí.",Vz={timeline:$M,list:DM,downloadResult:IM,zoomOut:NM,zoomIn:MM,resetZoom:zM,closeMedia:FM,openFile:UM,selectFileOrUUID:jM,enterUUID:BM,submit:WM,save:HM,cancel:VM,errorLoadingUUID:KM,originalText:GM,translatedText:YM,startTime:XM,endTime:QM,text:ZM,speed:qM,options:JM,audioTracks:ez,deleteTrack:tz,subtitles:nz,noSubtitles:rz,originalSubtitles:iz,dubbedSubtitles:oz,speakers:sz,newSpeakerName:az,speaker:lz,selectSpeaker:uz,showSpeakerColors:cz,selectTracksForDownload:fz,rebuildingMedia:dz,loading:pz,loadingChunks:hz,reconstructingAudio:gz,originalVocals:mz,dubbedVocals:vz,backgroundAudio:yz,missingUUID:wz,loadingMedia:xz,edit:Sz,advanced:_z,enableTimeline:bz,delete:"Eliminar",regenerate:kz,regenerateTitle:Cz,regenerating:Ez,regenerateDescription:Tz,regenerateRequestSent:Rz,close:Pz,undo:Oz,errorRegenerating:Lz,downloading:Az,downloadError:$z,downloadErrorMessage:Dz,preparingDownload:Iz,downloadingBackgroundAudio:Nz,downloadingTrack:Mz,mixingAudio:zz,rebuildingMediaOnDownload:Fz,loadingFFmpeg:Uz,preparingMedia:jz,addSpeaker:Bz,selectVoice:Wz,downloadExplanation:Hz},Kz="Línia de temps",Gz="Llista",Yz="Descarrega",Xz="Allunya",Qz="Apropa",Zz="Restablir Zoom",qz="Tanca Arxiu",Jz="Obre Arxiu",eF="Selecciona un arxiu o introdueix UUID",tF="Introdueix UUID",nF="Envia",rF="Desa",iF="Cancel·la",oF="Error carregant el vídeo, potser ja no existeix",sF="Text original",aF="Text traduït",lF="Temps inicial",uF="Temps final",cF="Text",fF="Velocitat",dF="Opcions",pF="Pistes d'àudio",hF="Elimina",gF="Subtítols",mF="Sense subtítols",vF="Subtítols originals",yF="Subtítols doblats",wF="Parlants",xF="Nom del nou parlant",SF="Parlant",_F="Seleccionar un parlant",bF="Mostrar colors de parlants",kF="Descarregar resultat",CF="Reconstruint el vídeo, si us plau, espereu...",EF="Carregant...",TF="Carregant fitxers, si us plau, espereu...",RF="Reconstruint àudio, si us plau, espereu...",PF="Veus originals",OF="Veus doblades",LF="Àudio de fons",AF="Error carregant el vídeo, manca l'UUID",$F="Carregant vídeo, si us plau, espereu...",DF="Edita",IF="Avançat",NF="Mostrar Línia de Temps (experimental)",MF="Regenera",zF="Regenerar vídeo",FF="Regenerant...",UF="Després d'haver fet totes les modificacions necessàries, podeu enviar-nos les modificacions per regenerar el vídeo. Rebreu un correu electrònic quan el vídeo estigui llest.",jF="La petició ha estat enviada amb èxit. Rebreu un correu electrònic quan el vídeo estigui llest.",BF="Tanca",WF="Desfer",HF="Error regenerant el vídeo",VF="Descarregant...",KF="Error descarregant el vídeo",GF="Hi ha hagut un error descarregant el vídeo. Podeu provar a enviar-ho per a que sigui regenerat al nostre servidor.",YF="Preparant la descàrrega...",XF="Descarregant àudio de fons...",QF="Descarregant {{track}}...",ZF="Mixant {{track}} amb àudio de fons...",qF="Reconstruint el vídeo...",JF="Carregant FFmpeg...",eU="Preparant el vídeo...",tU="Afegir un parlant",nU="Seleccionar veu",rU="Seleccioneu les pistes d'àudio i subtítols que voleu descarregar. El video es regenerarà en el vostre navegador pel que depenent del vostre dispositiu pot ser lent. Si ho preferiu, podeu demanar que el vídeo sigui regenerat al nostre servidor fent clic aquí.",iU={timeline:Kz,list:Gz,downloadResult:Yz,zoomOut:Xz,zoomIn:Qz,resetZoom:Zz,closeMedia:qz,openFile:Jz,selectFileOrUUID:eF,enterUUID:tF,submit:nF,save:rF,cancel:iF,errorLoadingUUID:oF,originalText:sF,translatedText:aF,startTime:lF,endTime:uF,text:cF,speed:fF,options:dF,audioTracks:pF,deleteTrack:hF,subtitles:gF,noSubtitles:mF,originalSubtitles:vF,dubbedSubtitles:yF,speakers:wF,newSpeakerName:xF,speaker:SF,selectSpeaker:_F,showSpeakerColors:bF,selectTracksForDownload:kF,rebuildingMedia:CF,loading:EF,loadingChunks:TF,reconstructingAudio:RF,originalVocals:PF,dubbedVocals:OF,backgroundAudio:LF,missingUUID:AF,loadingMedia:$F,edit:DF,advanced:IF,enableTimeline:NF,delete:"Eliminar",regenerate:MF,regenerateTitle:zF,regenerating:FF,regenerateDescription:UF,regenerateRequestSent:jF,close:BF,undo:WF,errorRegenerating:HF,downloading:VF,downloadError:KF,downloadErrorMessage:GF,preparingDownload:YF,downloadingBackgroundAudio:XF,downloadingTrack:QF,mixingAudio:ZF,rebuildingMediaOnDownload:qF,loadingFFmpeg:JF,preparingMedia:eU,addSpeaker:tU,selectVoice:nU,downloadExplanation:rU};Xt.use(XS).use(GL).init({resources:{en:{translation:AM},es:{translation:Vz},ca:{translation:iU}},fallbackLng:"en",detection:{order:["navigator"]},interpolation:{escapeValue:!1}});cp.createRoot(document.getElementById("root")).render(L.jsx(Wr.StrictMode,{children:L.jsx($N,{})})); diff --git a/index.html b/index.html index d8c730e..d38ab59 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Subtitle/Dubs Editor - +