From b3bf026f2adbe5afa42a432f3da48231ad09c279 Mon Sep 17 00:00:00 2001 From: zhzLuke96 Date: Tue, 8 Oct 2024 12:43:09 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20lenML/to?= =?UTF-8?q?kenizers-arena@b3435a8b0ac2d75651995cbc13164b825bac65d1=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index-CIrhFpGY.js | 474 ++++++++++++++++++++++++++++++++++++++ assets/index-DgLYUnZy.css | 1 + index.html | 79 +++++++ 3 files changed, 554 insertions(+) create mode 100644 assets/index-CIrhFpGY.js create mode 100644 assets/index-DgLYUnZy.css create mode 100644 index.html diff --git a/assets/index-CIrhFpGY.js b/assets/index-CIrhFpGY.js new file mode 100644 index 0000000..6b78e41 --- /dev/null +++ b/assets/index-CIrhFpGY.js @@ -0,0 +1,474 @@ +var WO=Object.defineProperty;var HO=(e,t,r)=>t in e?WO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Qi=(e,t,r)=>(HO(e,typeof t!="symbol"?t+"":t,r),r);function Fw(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var $i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kw={exports:{}},Tc={},jw={exports:{}},Ne={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var al=Symbol.for("react.element"),VO=Symbol.for("react.portal"),qO=Symbol.for("react.fragment"),GO=Symbol.for("react.strict_mode"),YO=Symbol.for("react.profiler"),QO=Symbol.for("react.provider"),XO=Symbol.for("react.context"),JO=Symbol.for("react.forward_ref"),ZO=Symbol.for("react.suspense"),eD=Symbol.for("react.memo"),tD=Symbol.for("react.lazy"),Am=Symbol.iterator;function rD(e){return e===null||typeof e!="object"?null:(e=Am&&e[Am]||e["@@iterator"],typeof e=="function"?e:null)}var Uw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ww=Object.assign,Hw={};function Aa(e,t,r){this.props=e,this.context=t,this.refs=Hw,this.updater=r||Uw}Aa.prototype.isReactComponent={};Aa.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")};Aa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Vw(){}Vw.prototype=Aa.prototype;function rv(e,t,r){this.props=e,this.context=t,this.refs=Hw,this.updater=r||Uw}var nv=rv.prototype=new Vw;nv.constructor=rv;Ww(nv,Aa.prototype);nv.isPureReactComponent=!0;var Bm=Array.isArray,qw=Object.prototype.hasOwnProperty,iv={current:null},Gw={key:!0,ref:!0,__self:!0,__source:!0};function Yw(e,t,r){var n,i={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)qw.call(t,n)&&!Gw.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1>>1,ae=K[ie];if(0>>1;iei(ce,te))dei(Te,ce)?(K[ie]=Te,K[de]=te,ie=de):(K[ie]=ce,K[Ae]=te,ie=Ae);else if(dei(Te,te))K[ie]=Te,K[de]=te,ie=de;else break e}}return ee}function i(K,ee){var te=K.sortIndex-ee.sortIndex;return te!==0?te:K.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],c=[],d=1,h=null,p=3,m=!1,g=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(K){for(var ee=r(c);ee!==null;){if(ee.callback===null)n(c);else if(ee.startTime<=K)n(c),ee.sortIndex=ee.expirationTime,t(u,ee);else break;ee=r(c)}}function x(K){if(w=!1,k(K),!g)if(r(u)!==null)g=!0,V(O);else{var ee=r(c);ee!==null&&X(x,ee.startTime-K)}}function O(K,ee){g=!1,w&&(w=!1,S(A),A=-1),m=!0;var te=p;try{for(k(ee),h=r(u);h!==null&&(!(h.expirationTime>ee)||K&&!U());){var ie=h.callback;if(typeof ie=="function"){h.callback=null,p=h.priorityLevel;var ae=ie(h.expirationTime<=ee);ee=e.unstable_now(),typeof ae=="function"?h.callback=ae:h===r(u)&&n(u),k(ee)}else n(u);h=r(u)}if(h!==null)var Fe=!0;else{var Ae=r(c);Ae!==null&&X(x,Ae.startTime-ee),Fe=!1}return Fe}finally{h=null,p=te,m=!1}}var R=!1,T=null,A=-1,N=5,I=-1;function U(){return!(e.unstable_now()-IK||125ie?(K.sortIndex=te,t(c,K),r(u)===null&&K===r(c)&&(w?(S(A),A=-1):w=!0,X(x,te-ie))):(K.sortIndex=ae,t(u,K),g||m||(g=!0,V(O))),K},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(K){var ee=p;return function(){var te=p;p=ee;try{return K.apply(this,arguments)}finally{p=te}}}})(e1);Zw.exports=e1;var hD=Zw.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vD=F,Lr=hD;function re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Op=Object.prototype.hasOwnProperty,gD=/^[: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]*$/,Fm={},Km={};function mD(e){return Op.call(Km,e)?!0:Op.call(Fm,e)?!1:gD.test(e)?Km[e]=!0:(Fm[e]=!0,!1)}function yD(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _D(e,t,r,n){if(t===null||typeof t>"u"||yD(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 pr(e,t,r,n,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var er={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){er[e]=new pr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];er[t]=new pr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){er[e]=new pr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){er[e]=new pr(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){er[e]=new pr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){er[e]=new pr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){er[e]=new pr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){er[e]=new pr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){er[e]=new pr(e,5,!1,e.toLowerCase(),null,!1,!1)});var av=/[\-:]([a-z])/g;function sv(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(av,sv);er[t]=new pr(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(av,sv);er[t]=new pr(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(av,sv);er[t]=new pr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){er[e]=new pr(e,1,!1,e.toLowerCase(),null,!1,!1)});er.xlinkHref=new pr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){er[e]=new pr(e,1,!1,e.toLowerCase(),null,!0,!0)});function lv(e,t,r,n){var i=er.hasOwnProperty(t)?er[t]:null;(i!==null?i.type!==0:n||!(2l||i[a]!==o[l]){var u=` +`+i[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=l);break}}}finally{Lf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gs(e):""}function wD(e){switch(e.tag){case 5:return gs(e.type);case 16:return gs("Lazy");case 13:return gs("Suspense");case 19:return gs("SuspenseList");case 0:case 2:case 15:return e=Pf(e.type,!1),e;case 11:return e=Pf(e.type.render,!1),e;case 1:return e=Pf(e.type,!0),e;default:return""}}function Mp(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 Jo:return"Fragment";case Xo:return"Portal";case Dp:return"Profiler";case uv:return"StrictMode";case $p:return"Suspense";case Rp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n1:return(e.displayName||"Context")+".Consumer";case r1:return(e._context.displayName||"Context")+".Provider";case cv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fv:return t=e.displayName||null,t!==null?t:Mp(e.type)||"Memo";case ki:t=e._payload,e=e._init;try{return Mp(e(t))}catch{}}return null}function SD(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 Mp(t);case 8:return t===uv?"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 zi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function o1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kD(e){var t=o1(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jl(e){e._valueTracker||(e._valueTracker=kD(e))}function a1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=o1(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Vu(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 Lp(e,t){var r=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Um(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=zi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function s1(e,t){t=t.checked,t!=null&&lv(e,"checked",t,!1)}function Pp(e,t){s1(e,t);var r=zi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ip(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ip(e,t.type,zi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wm(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ip(e,t,r){(t!=="number"||Vu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ms=Array.isArray;function pa(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ul.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ks(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xs={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},ED=["Webkit","ms","Moz","O"];Object.keys(xs).forEach(function(e){ED.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xs[t]=xs[e]})});function f1(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xs.hasOwnProperty(e)&&xs[e]?(""+t).trim():t+"px"}function d1(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=f1(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var xD=St({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 Bp(e,t){if(t){if(xD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function zp(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 Fp=null;function dv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kp=null,ha=null,va=null;function qm(e){if(e=ul(e)){if(typeof Kp!="function")throw Error(re(280));var t=e.stateNode;t&&(t=Rc(t),Kp(e.stateNode,e.type,t))}}function p1(e){ha?va?va.push(e):va=[e]:ha=e}function h1(){if(ha){var e=ha,t=va;if(va=ha=null,qm(e),t)for(e=0;e>>=0,e===0?32:31-(ID(e)/ND|0)|0}var Wl=64,Hl=4194304;function ys(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 Qu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~i;l!==0?n=ys(l):(o&=a,o!==0&&(n=ys(o)))}else a=r&~i,a!==0?n=ys(a):o!==0&&(n=ys(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function sl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hn(t),e[t]=r}function FD(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Ts),ry=" ",ny=!1;function P1(e,t){switch(e){case"keyup":return h$.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zo=!1;function g$(e,t){switch(e){case"compositionend":return I1(t);case"keypress":return t.which!==32?null:(ny=!0,ry);case"textInput":return e=t.data,e===ry&&ny?null:e;default:return null}}function m$(e,t){if(Zo)return e==="compositionend"||!wv&&P1(e,t)?(e=M1(),Tu=mv=bi=null,Zo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sy(r)}}function z1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?z1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function F1(){for(var e=window,t=Vu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Vu(e.document)}return t}function Sv(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 T$(e){var t=F1(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&z1(r.ownerDocument.documentElement,r)){if(n!==null&&Sv(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=ly(r,o);var a=ly(r,n);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ea=null,qp=null,Os=null,Gp=!1;function uy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Gp||ea==null||ea!==Vu(n)||(n=ea,"selectionStart"in n&&Sv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Os&&qs(Os,n)||(Os=n,n=Zu(qp,"onSelect"),0na||(e.current=eh[na],eh[na]=null,na--)}function Ze(e,t){na++,eh[na]=e.current,e.current=t}var Fi={},sr=ji(Fi),Sr=ji(!1),go=Fi;function ka(e,t){var r=e.type.contextTypes;if(!r)return Fi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function kr(e){return e=e.childContextTypes,e!=null}function tc(){at(Sr),at(sr)}function gy(e,t,r){if(sr.current!==Fi)throw Error(re(168));Ze(sr,t),Ze(Sr,r)}function Y1(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(re(108,SD(e)||"Unknown",i));return St({},r,n)}function rc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fi,go=sr.current,Ze(sr,e),Ze(Sr,Sr.current),!0}function my(e,t,r){var n=e.stateNode;if(!n)throw Error(re(169));r?(e=Y1(e,t,go),n.__reactInternalMemoizedMergedChildContext=e,at(Sr),at(sr),Ze(sr,e)):at(Sr),Ze(Sr,r)}var Gn=null,Mc=!1,Gf=!1;function Q1(e){Gn===null?Gn=[e]:Gn.push(e)}function B$(e){Mc=!0,Q1(e)}function Ui(){if(!Gf&&Gn!==null){Gf=!0;var e=0,t=Ge;try{var r=Gn;for(Ge=1;e>=a,i-=a,Qn=1<<32-hn(t)+i|r<A?(N=T,T=null):N=T.sibling;var I=p(S,T,k[A],x);if(I===null){T===null&&(T=N);break}e&&T&&I.alternate===null&&t(S,T),y=o(I,y,A),R===null?O=I:R.sibling=I,R=I,T=N}if(A===k.length)return r(S,T),ht&&to(S,A),O;if(T===null){for(;AA?(N=T,T=null):N=T.sibling;var U=p(S,T,I.value,x);if(U===null){T===null&&(T=N);break}e&&T&&U.alternate===null&&t(S,T),y=o(U,y,A),R===null?O=U:R.sibling=U,R=U,T=N}if(I.done)return r(S,T),ht&&to(S,A),O;if(T===null){for(;!I.done;A++,I=k.next())I=h(S,I.value,x),I!==null&&(y=o(I,y,A),R===null?O=I:R.sibling=I,R=I);return ht&&to(S,A),O}for(T=n(S,T);!I.done;A++,I=k.next())I=m(T,S,A,I.value,x),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?A:I.key),y=o(I,y,A),R===null?O=I:R.sibling=I,R=I);return e&&T.forEach(function(q){return t(S,q)}),ht&&to(S,A),O}function C(S,y,k,x){if(typeof k=="object"&&k!==null&&k.type===Jo&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case Kl:e:{for(var O=k.key,R=y;R!==null;){if(R.key===O){if(O=k.type,O===Jo){if(R.tag===7){r(S,R.sibling),y=i(R,k.props.children),y.return=S,S=y;break e}}else if(R.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ki&&wy(O)===R.type){r(S,R.sibling),y=i(R,k.props),y.ref=es(S,R,k),y.return=S,S=y;break e}r(S,R);break}else t(S,R);R=R.sibling}k.type===Jo?(y=po(k.props.children,S.mode,x,k.key),y.return=S,S=y):(x=Pu(k.type,k.key,k.props,null,S.mode,x),x.ref=es(S,y,k),x.return=S,S=x)}return a(S);case Xo:e:{for(R=k.key;y!==null;){if(y.key===R)if(y.tag===4&&y.stateNode.containerInfo===k.containerInfo&&y.stateNode.implementation===k.implementation){r(S,y.sibling),y=i(y,k.children||[]),y.return=S,S=y;break e}else{r(S,y);break}else t(S,y);y=y.sibling}y=rd(k,S.mode,x),y.return=S,S=y}return a(S);case ki:return R=k._init,C(S,y,R(k._payload),x)}if(ms(k))return g(S,y,k,x);if(Ya(k))return w(S,y,k,x);Jl(S,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,y!==null&&y.tag===6?(r(S,y.sibling),y=i(y,k),y.return=S,S=y):(r(S,y),y=td(k,S.mode,x),y.return=S,S=y),a(S)):r(S,y)}return C}var xa=eS(!0),tS=eS(!1),oc=ji(null),ac=null,aa=null,Cv=null;function Tv(){Cv=aa=ac=null}function bv(e){var t=oc.current;at(oc),e._currentValue=t}function nh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ma(e,t){ac=e,Cv=aa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_r=!0),e.firstContext=null)}function Jr(e){var t=e._currentValue;if(Cv!==e)if(e={context:e,memoizedValue:t,next:null},aa===null){if(ac===null)throw Error(re(308));aa=e,ac.dependencies={lanes:0,firstContext:e}}else aa=aa.next=e;return t}var oo=null;function Ov(e){oo===null?oo=[e]:oo.push(e)}function rS(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Ov(t)):(r.next=i.next,i.next=r),t.interleaved=r,oi(e,n)}function oi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ei=!1;function Dv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nS(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 Zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ii(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ue&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,oi(e,r)}return i=n.interleaved,i===null?(t.next=t,Ov(n)):(t.next=i.next,i.next=t),n.interleaved=t,oi(e,r)}function Ou(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,hv(e,r)}}function Sy(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?i=o=a:o=o.next=a,r=r.next}while(r!==null);o===null?i=o=t:o=o.next=t}else i=o=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function sc(e,t,r,n){var i=e.updateQueue;Ei=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,a===null?o=c:a.next=c,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(o!==null){var h=i.baseState;a=0,d=c=u=null,l=o;do{var p=l.lane,m=l.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,w=l;switch(p=t,m=r,w.tag){case 1:if(g=w.payload,typeof g=="function"){h=g.call(m,h,p);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,p=typeof g=="function"?g.call(m,h,p):g,p==null)break e;h=St({},h,p);break e;case 2:Ei=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=m,u=h):d=d.next=m,a|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(u=h),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);_o|=a,e.lanes=a,e.memoizedState=h}}function ky(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Qf.transition;Qf.transition={};try{e(!1),t()}finally{Ge=r,Qf.transition=n}}function wS(){return Zr().memoizedState}function j$(e,t,r){var n=Ai(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},SS(e))kS(t,r);else if(r=rS(e,t,r,n),r!==null){var i=fr();vn(r,e,n,i),ES(r,t,n)}}function U$(e,t,r){var n=Ai(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(SS(e))kS(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,r);if(i.hasEagerState=!0,i.eagerState=l,mn(l,a)){var u=t.interleaved;u===null?(i.next=i,Ov(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=rS(e,t,i,n),r!==null&&(i=fr(),vn(r,e,n,i),ES(r,t,n))}}function SS(e){var t=e.alternate;return e===wt||t!==null&&t===wt}function kS(e,t){Ds=uc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ES(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,hv(e,r)}}var cc={readContext:Jr,useCallback:ir,useContext:ir,useEffect:ir,useImperativeHandle:ir,useInsertionEffect:ir,useLayoutEffect:ir,useMemo:ir,useReducer:ir,useRef:ir,useState:ir,useDebugValue:ir,useDeferredValue:ir,useTransition:ir,useMutableSource:ir,useSyncExternalStore:ir,useId:ir,unstable_isNewReconciler:!1},W$={readContext:Jr,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:Jr,useEffect:xy,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,$u(4194308,4,vS.bind(null,t,e),r)},useLayoutEffect:function(e,t){return $u(4194308,4,e,t)},useInsertionEffect:function(e,t){return $u(4,2,e,t)},useMemo:function(e,t){var r=Ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ln();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=j$.bind(null,wt,e),[n.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:Ey,useDebugValue:Av,useDeferredValue:function(e){return Ln().memoizedState=e},useTransition:function(){var e=Ey(!1),t=e[0];return e=K$.bind(null,e[1]),Ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=wt,i=Ln();if(ht){if(r===void 0)throw Error(re(407));r=r()}else{if(r=t(),Gt===null)throw Error(re(349));yo&30||sS(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,xy(uS.bind(null,n,o,e),[e]),n.flags|=2048,tl(9,lS.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Ln(),t=Gt.identifierPrefix;if(ht){var r=Xn,n=Qn;r=(n&~(1<<32-hn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[In]=t,e[Qs]=n,LS(e,t,!1,!1),t.stateNode=e;e:{switch(a=zp(r,n),r){case"dialog":nt("cancel",e),nt("close",e),i=n;break;case"iframe":case"object":case"embed":nt("load",e),i=n;break;case"video":case"audio":for(i=0;i<_s.length;i++)nt(_s[i],e);i=n;break;case"source":nt("error",e),i=n;break;case"img":case"image":case"link":nt("error",e),nt("load",e),i=n;break;case"details":nt("toggle",e),i=n;break;case"input":Um(e,n),i=Lp(e,n),nt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=St({},n,{value:void 0}),nt("invalid",e);break;case"textarea":Hm(e,n),i=Np(e,n),nt("invalid",e);break;default:i=n}Bp(r,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?d1(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&c1(e,u)):o==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Ks(e,u):typeof u=="number"&&Ks(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Fs.hasOwnProperty(o)?u!=null&&o==="onScroll"&&nt("scroll",e):u!=null&&lv(e,o,u,a))}switch(r){case"input":jl(e),Wm(e,n,!1);break;case"textarea":jl(e),Vm(e);break;case"option":n.value!=null&&e.setAttribute("value",""+zi(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?pa(e,!!n.multiple,o,!1):n.defaultValue!=null&&pa(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ec)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return or(t),null;case 6:if(e&&t.stateNode!=null)IS(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(re(166));if(r=ao(Js.current),ao(An.current),Xl(t)){if(n=t.stateNode,r=t.memoizedProps,n[In]=t,(o=n.nodeValue!==r)&&(e=Mr,e!==null))switch(e.tag){case 3:Ql(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ql(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[In]=t,t.stateNode=n}return or(t),null;case 13:if(at(_t),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&Rr!==null&&t.mode&1&&!(t.flags&128))Z1(),Ea(),t.flags|=98560,o=!1;else if(o=Xl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(re(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(re(317));o[In]=t}else Ea(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;or(t),o=!1}else pn!==null&&(_h(pn),pn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||_t.current&1?Ut===0&&(Ut=3):Wv())),t.updateQueue!==null&&(t.flags|=4),or(t),null);case 4:return Ca(),fh(e,t),e===null&&Gs(t.stateNode.containerInfo),or(t),null;case 10:return bv(t.type._context),or(t),null;case 17:return kr(t.type)&&tc(),or(t),null;case 19:if(at(_t),o=t.memoizedState,o===null)return or(t),null;if(n=(t.flags&128)!==0,a=o.rendering,a===null)if(n)ts(o,!1);else{if(Ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=lc(e),a!==null){for(t.flags|=128,ts(o,!1),n=a.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(_t,_t.current&1|2),t.child}e=e.sibling}o.tail!==null&&Rt()>ba&&(t.flags|=128,n=!0,ts(o,!1),t.lanes=4194304)}else{if(!n)if(e=lc(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ts(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ht)return or(t),null}else 2*Rt()-o.renderingStartTime>ba&&r!==1073741824&&(t.flags|=128,n=!0,ts(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Rt(),t.sibling=null,r=_t.current,Ze(_t,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return Uv(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?$r&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function J$(e,t){switch(Ev(t),t.tag){case 1:return kr(t.type)&&tc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(),at(Sr),at(sr),Mv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Rv(t),null;case 13:if(at(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return at(_t),null;case 4:return Ca(),null;case 10:return bv(t.type._context),null;case 22:case 23:return Uv(),null;case 24:return null;default:return null}}var eu=!1,ar=!1,Z$=typeof WeakSet=="function"?WeakSet:Set,ue=null;function sa(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Et(e,t,n)}else r.current=null}function dh(e,t,r){try{r()}catch(n){Et(e,t,n)}}var Iy=!1;function eR(e,t){if(Yp=Xu,e=F1(),Sv(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,l=-1,u=-1,c=0,d=0,h=e,p=null;t:for(;;){for(var m;h!==r||i!==0&&h.nodeType!==3||(l=a+i),h!==o||n!==0&&h.nodeType!==3||(u=a+n),h.nodeType===3&&(a+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===e)break t;if(p===r&&++c===i&&(l=a),p===o&&++d===n&&(u=a),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qp={focusedElem:e,selectionRange:r},Xu=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,C=g.memoizedState,S=t.stateNode,y=S.getSnapshotBeforeUpdate(t.elementType===t.type?w:un(t.type,w),C);S.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(x){Et(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return g=Iy,Iy=!1,g}function $s(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&dh(t,r,o)}i=i.next}while(i!==n)}}function Ic(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ph(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function NS(e){var t=e.alternate;t!==null&&(e.alternate=null,NS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[In],delete t[Qs],delete t[Zp],delete t[N$],delete t[A$])),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 AS(e){return e.tag===5||e.tag===3||e.tag===4}function Ny(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AS(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 hh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ec));else if(n!==4&&(e=e.child,e!==null))for(hh(e,t,r),e=e.sibling;e!==null;)hh(e,t,r),e=e.sibling}function vh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(vh(e,t,r),e=e.sibling;e!==null;)vh(e,t,r),e=e.sibling}var Qt=null,fn=!1;function mi(e,t,r){for(r=r.child;r!==null;)BS(e,t,r),r=r.sibling}function BS(e,t,r){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(bc,r)}catch{}switch(r.tag){case 5:ar||sa(r,t);case 6:var n=Qt,i=fn;Qt=null,mi(e,t,r),Qt=n,fn=i,Qt!==null&&(fn?(e=Qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Qt.removeChild(r.stateNode));break;case 18:Qt!==null&&(fn?(e=Qt,r=r.stateNode,e.nodeType===8?qf(e.parentNode,r):e.nodeType===1&&qf(e,r),Hs(e)):qf(Qt,r.stateNode));break;case 4:n=Qt,i=fn,Qt=r.stateNode.containerInfo,fn=!0,mi(e,t,r),Qt=n,fn=i;break;case 0:case 11:case 14:case 15:if(!ar&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&dh(r,t,a),i=i.next}while(i!==n)}mi(e,t,r);break;case 1:if(!ar&&(sa(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Et(r,t,l)}mi(e,t,r);break;case 21:mi(e,t,r);break;case 22:r.mode&1?(ar=(n=ar)||r.memoizedState!==null,mi(e,t,r),ar=n):mi(e,t,r);break;default:mi(e,t,r)}}function Ay(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Z$),t.forEach(function(n){var i=uR.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function an(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~o}if(n=i,n=Rt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*rR(n/1960))-n,10e?16:e,Oi===null)var n=!1;else{if(e=Oi,Oi=null,pc=0,Ue&6)throw Error(re(331));var i=Ue;for(Ue|=4,ue=e.current;ue!==null;){var o=ue,a=o.child;if(ue.flags&16){var l=o.deletions;if(l!==null){for(var u=0;uRt()-Kv?fo(e,0):Fv|=r),Er(e,t)}function VS(e,t){t===0&&(e.mode&1?(t=Hl,Hl<<=1,!(Hl&130023424)&&(Hl=4194304)):t=1);var r=fr();e=oi(e,t),e!==null&&(sl(e,t,r),Er(e,r))}function lR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),VS(e,r)}function uR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(re(314))}n!==null&&n.delete(t),VS(e,r)}var qS;qS=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sr.current)_r=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _r=!1,Q$(e,t,r);_r=!!(e.flags&131072)}else _r=!1,ht&&t.flags&1048576&&X1(t,ic,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ru(e,t),e=t.pendingProps;var i=ka(t,sr.current);ma(t,r),i=Pv(null,t,n,e,i,r);var o=Iv();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kr(n)?(o=!0,rc(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dv(t),i.updater=Pc,t.stateNode=i,i._reactInternals=t,oh(t,n,e,r),t=lh(null,t,n,!0,o,r)):(t.tag=0,ht&&o&&kv(t),cr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ru(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=fR(n),e=un(n,e),i){case 0:t=sh(null,t,n,e,r);break e;case 1:t=My(null,t,n,e,r);break e;case 11:t=$y(null,t,n,e,r);break e;case 14:t=Ry(null,t,n,un(n.type,e),r);break e}throw Error(re(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:un(n,i),sh(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:un(n,i),My(e,t,n,i,r);case 3:e:{if($S(t),e===null)throw Error(re(387));n=t.pendingProps,o=t.memoizedState,i=o.element,nS(e,t),sc(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Ta(Error(re(423)),t),t=Ly(e,t,n,r,i);break e}else if(n!==i){i=Ta(Error(re(424)),t),t=Ly(e,t,n,r,i);break e}else for(Rr=Pi(t.stateNode.containerInfo.firstChild),Mr=t,ht=!0,pn=null,r=tS(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ea(),n===i){t=ai(e,t,r);break e}cr(e,t,n,r)}t=t.child}return t;case 5:return iS(t),e===null&&rh(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Xp(n,i)?a=null:o!==null&&Xp(n,o)&&(t.flags|=32),DS(e,t),cr(e,t,a,r),t.child;case 6:return e===null&&rh(t),null;case 13:return RS(e,t,r);case 4:return $v(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=xa(t,null,n,r):cr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:un(n,i),$y(e,t,n,i,r);case 7:return cr(e,t,t.pendingProps,r),t.child;case 8:return cr(e,t,t.pendingProps.children,r),t.child;case 12:return cr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Ze(oc,n._currentValue),n._currentValue=a,o!==null)if(mn(o.value,a)){if(o.children===i.children&&!Sr.current){t=ai(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(o.tag===1){u=Zn(-1,r&-r),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}o.lanes|=r,u=o.alternate,u!==null&&(u.lanes|=r),nh(o.return,r,t),l.lanes|=r;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(re(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),nh(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}cr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ma(t,r),i=Jr(i),n=n(i),t.flags|=1,cr(e,t,n,r),t.child;case 14:return n=t.type,i=un(n,t.pendingProps),i=un(n.type,i),Ry(e,t,n,i,r);case 15:return bS(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:un(n,i),Ru(e,t),t.tag=1,kr(n)?(e=!0,rc(t)):e=!1,ma(t,r),xS(t,n,i),oh(t,n,i,r),lh(null,t,n,!0,e,r);case 19:return MS(e,t,r);case 22:return OS(e,t,r)}throw Error(re(156,t.tag))};function GS(e,t){return S1(e,t)}function cR(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,r,n){return new cR(e,t,r,n)}function Hv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fR(e){if(typeof e=="function")return Hv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cv)return 11;if(e===fv)return 14}return 2}function Bi(e,t){var r=e.alternate;return r===null?(r=Yr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Pu(e,t,r,n,i,o){var a=2;if(n=e,typeof e=="function")Hv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Jo:return po(r.children,i,o,t);case uv:a=8,i|=8;break;case Dp:return e=Yr(12,r,t,i|2),e.elementType=Dp,e.lanes=o,e;case $p:return e=Yr(13,r,t,i),e.elementType=$p,e.lanes=o,e;case Rp:return e=Yr(19,r,t,i),e.elementType=Rp,e.lanes=o,e;case i1:return Ac(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r1:a=10;break e;case n1:a=9;break e;case cv:a=11;break e;case fv:a=14;break e;case ki:a=16,n=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=Yr(a,r,t,i),t.elementType=e,t.type=n,t.lanes=o,t}function po(e,t,r,n){return e=Yr(7,e,n,t),e.lanes=r,e}function Ac(e,t,r,n){return e=Yr(22,e,n,t),e.elementType=i1,e.lanes=r,e.stateNode={isHidden:!1},e}function td(e,t,r){return e=Yr(6,e,null,t),e.lanes=r,e}function rd(e,t,r){return t=Yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dR(e,t,r,n,i){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=Nf(0),this.expirationTimes=Nf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nf(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Vv(e,t,r,n,i,o,a,l,u){return e=new dR(e,t,r,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Yr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dv(o),e}function pR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(JS)}catch(e){console.error(e)}}JS(),Jw.exports=Nr;var jc=Jw.exports;const yR=Cc(jc),_R=Fw({__proto__:null,default:yR},[jc]);var Hy=jc;bp.createRoot=Hy.createRoot,bp.hydrateRoot=Hy.hydrateRoot;var wr=function(){return wr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0?qt(Fa,--en):0,Da--,Bt===10&&(Da=1,Wc--),Bt}function gn(){return Bt=en2||Sh(Bt)>3?"":" "}function DR(e,t){for(;--t&&gn()&&!(Bt<48||Bt>102||Bt>57&&Bt<65||Bt>70&&Bt<97););return Vc(e,Nu()+(t<6&&ho()==32&&gn()==32))}function kh(e){for(;gn();)switch(Bt){case e:return en;case 34:case 39:e!==34&&e!==39&&kh(Bt);break;case 40:e===41&&kh(e);break;case 92:gn();break}return en}function $R(e,t){for(;gn()&&e+Bt!==57;)if(e+Bt===84&&ho()===47)break;return"/*"+Vc(t,en-1)+"*"+Xv(e===47?e:gn())}function RR(e){for(;!Sh(ho());)gn();return Vc(e,en)}function MR(e){return bR(Au("",null,null,null,[""],e=TR(e),0,[0],e))}function Au(e,t,r,n,i,o,a,l,u){for(var c=0,d=0,h=a,p=0,m=0,g=0,w=1,C=1,S=1,y=0,k="",x=i,O=o,R=n,T=k;C;)switch(g=y,y=gn()){case 40:if(g!=108&&qt(T,h-1)==58){Iu(T+=Re(nd(y),"&","&\f"),"&\f",tk(c?l[c-1]:0))!=-1&&(S=-1);break}case 34:case 39:case 91:T+=nd(y);break;case 9:case 10:case 13:case 32:T+=OR(g);break;case 92:T+=DR(Nu()-1,7);continue;case 47:switch(ho()){case 42:case 47:ws(LR($R(gn(),Nu()),t,r,u),u);break;default:T+="/"}break;case 123*w:l[c++]=Pn(T)*S;case 125*w:case 59:case 0:switch(y){case 0:case 125:C=0;case 59+d:S==-1&&(T=Re(T,/\f/g,"")),m>0&&Pn(T)-h&&ws(m>32?Gy(T+";",n,r,h-1,u):Gy(Re(T," ","")+";",n,r,h-2,u),u);break;case 59:T+=";";default:if(ws(R=qy(T,t,r,c,d,i,l,k,x=[],O=[],h,o),o),y===123)if(d===0)Au(T,t,R,R,x,o,h,l,O);else switch(p===99&&qt(T,3)===110?100:p){case 100:case 108:case 109:case 115:Au(e,R,R,n&&ws(qy(e,R,R,0,0,i,l,k,i,x=[],h,O),O),i,O,h,l,n?x:O);break;default:Au(T,R,R,R,[""],O,0,l,O)}}c=d=m=0,w=S=1,k=T="",h=a;break;case 58:h=1+Pn(T),m=g;default:if(w<1){if(y==123)--w;else if(y==125&&w++==0&&CR()==125)continue}switch(T+=Xv(y),y*w){case 38:S=d>0?1:(T+="\f",-1);break;case 44:l[c++]=(Pn(T)-1)*S,S=1;break;case 64:ho()===45&&(T+=nd(gn())),p=ho(),d=h=Pn(k=T+=RR(Nu())),y++;break;case 45:g===45&&Pn(T)==2&&(w=0)}}return o}function qy(e,t,r,n,i,o,a,l,u,c,d,h){for(var p=i-1,m=i===0?o:[""],g=nk(m),w=0,C=0,S=0;w0?m[y]+" "+k:Re(k,/&\f/g,m[y])))&&(u[S++]=x);return Hc(e,t,r,i===0?Uc:l,u,c,d,h)}function LR(e,t,r,n){return Hc(e,t,r,ZS,Xv(xR()),Oa(e,2,-2),0,n)}function Gy(e,t,r,n,i){return Hc(e,t,r,Qv,Oa(e,0,n),Oa(e,n+1,-1),n,i)}function ok(e,t,r){switch(kR(e,t)){case 5103:return qe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return qe+e+e;case 4789:return Ls+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return qe+e+Ls+e+it+e+e;case 5936:switch(qt(e,t+11)){case 114:return qe+e+it+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qe+e+it+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qe+e+it+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return qe+e+it+e+e;case 6165:return qe+e+it+"flex-"+e+e;case 5187:return qe+e+Re(e,/(\w+).+(:[^]+)/,qe+"box-$1$2"+it+"flex-$1$2")+e;case 5443:return qe+e+it+"flex-item-"+Re(e,/flex-|-self/g,"")+(qn(e,/flex-|baseline/)?"":it+"grid-row-"+Re(e,/flex-|-self/g,""))+e;case 4675:return qe+e+it+"flex-line-pack"+Re(e,/align-content|flex-|-self/g,"")+e;case 5548:return qe+e+it+Re(e,"shrink","negative")+e;case 5292:return qe+e+it+Re(e,"basis","preferred-size")+e;case 6060:return qe+"box-"+Re(e,"-grow","")+qe+e+it+Re(e,"grow","positive")+e;case 4554:return qe+Re(e,/([^-])(transform)/g,"$1"+qe+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,qe+"$1"),/(image-set)/,qe+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,qe+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,qe+"box-pack:$3"+it+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qe+e+e;case 4200:if(!qn(e,/flex-|baseline/))return it+"grid-column-align"+Oa(e,t)+e;break;case 2592:case 3360:return it+Re(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,i){return t=i,qn(n.props,/grid-\w+-end/)})?~Iu(e+(r=r[t].value),"span",0)?e:it+Re(e,"-start","")+e+it+"grid-row-span:"+(~Iu(r,"span",0)?qn(r,/\d+/):+qn(r,/\d+/)-+qn(e,/\d+/))+";":it+Re(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return qn(n.props,/grid-\w+-start/)})?e:it+Re(Re(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,qe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Pn(e)-1-t>6)switch(qt(e,t+1)){case 109:if(qt(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+qe+"$2-$3$1"+Ls+(qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Iu(e,"stretch",0)?ok(Re(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return Re(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,o,a,l,u,c){return it+i+":"+o+c+(a?it+i+"-span:"+(l?u:+u-+o)+c:"")+e});case 4949:if(qt(e,t+6)===121)return Re(e,":",":"+qe)+e;break;case 6444:switch(qt(e,qt(e,14)===45?18:11)){case 120:return Re(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+qe+(qt(e,14)===45?"inline-":"")+"box$3$1"+qe+"$2$3$1"+it+"$2box$3")+e;case 100:return Re(e,":",":"+it)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Re(e,"scroll-","scroll-snap-")+e}return e}function mc(e,t){for(var r="",n=0;n-1&&!e.return)switch(e.type){case Qv:e.return=ok(e.value,e.length,r);return;case ek:return mc([_i(e,{value:Re(e.value,"@","@"+qe)})],n);case Uc:if(e.length)return ER(r=e.props,function(i){switch(qn(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":jo(_i(e,{props:[Re(i,/:(read-\w+)/,":"+Ls+"$1")]})),jo(_i(e,{props:[i]})),wh(e,{props:Vy(r,n)});break;case"::placeholder":jo(_i(e,{props:[Re(i,/:(plac\w+)/,":"+qe+"input-$1")]})),jo(_i(e,{props:[Re(i,/:(plac\w+)/,":"+Ls+"$1")]})),jo(_i(e,{props:[Re(i,/:(plac\w+)/,it+"input-$1")]})),jo(_i(e,{props:[i]})),wh(e,{props:Vy(r,n)});break}return""})}}var BR={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Dr={},$a=typeof process<"u"&&Dr!==void 0&&(Dr.REACT_APP_SC_ATTR||Dr.SC_ATTR)||"data-styled",ak="active",sk="data-styled-version",qc="6.1.11",Jv=`/*!sc*/ +`,Zv=typeof window<"u"&&"HTMLElement"in window,zR=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Dr!==void 0&&Dr.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Dr.REACT_APP_SC_DISABLE_SPEEDY!==""?Dr.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Dr.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Dr!==void 0&&Dr.SC_DISABLE_SPEEDY!==void 0&&Dr.SC_DISABLE_SPEEDY!==""&&Dr.SC_DISABLE_SPEEDY!=="false"&&Dr.SC_DISABLE_SPEEDY),Gc=Object.freeze([]),Ra=Object.freeze({});function FR(e,t,r){return r===void 0&&(r=Ra),e.theme!==r.theme&&e.theme||t||r.theme}var lk=new Set(["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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","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","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),KR=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,jR=/(^-|-$)/g;function Yy(e){return e.replace(KR,"-").replace(jR,"")}var UR=/(a)(d)/gi,nu=52,Qy=function(e){return String.fromCharCode(e+(e>25?39:97))};function Eh(e){var t,r="";for(t=Math.abs(e);t>nu;t=t/nu|0)r=Qy(t%nu)+r;return(Qy(t%nu)+r).replace(UR,"$1-$2")}var id,uk=5381,ua=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ck=function(e){return ua(uk,e)};function WR(e){return Eh(ck(e)>>>0)}function HR(e){return e.displayName||e.name||"Component"}function od(e){return typeof e=="string"&&!0}var fk=typeof Symbol=="function"&&Symbol.for,dk=fk?Symbol.for("react.memo"):60115,VR=fk?Symbol.for("react.forward_ref"):60112,qR={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},GR={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},pk={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},YR=((id={})[VR]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},id[dk]=pk,id);function Xy(e){return("type"in(t=e)&&t.type.$$typeof)===dk?pk:"$$typeof"in e?YR[e.$$typeof]:qR;var t}var QR=Object.defineProperty,XR=Object.getOwnPropertyNames,Jy=Object.getOwnPropertySymbols,JR=Object.getOwnPropertyDescriptor,ZR=Object.getPrototypeOf,Zy=Object.prototype;function hk(e,t,r){if(typeof t!="string"){if(Zy){var n=ZR(t);n&&n!==Zy&&hk(e,n,r)}var i=XR(t);Jy&&(i=i.concat(Jy(t)));for(var o=Xy(e),a=Xy(t),l=0;l0?" Args: ".concat(t.join(", ")):""))}var eM=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;t>=o;)if((o<<=1)<0)throw fl(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var a=i;a=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],i=this.indexOfGroup(t),o=i+n,a=i;a=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(C+="".concat(S,","))}),u+="".concat(g).concat(w,'{content:"').concat(C,'"}').concat(Jv)},d=0;d0?".".concat(t):p},d=u.slice();d.push(function(p){p.type===Uc&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(fM,r).replace(n,c))}),a.prefix&&d.push(AR),d.push(PR);var h=function(p,m,g,w){m===void 0&&(m=""),g===void 0&&(g=""),w===void 0&&(w="&"),t=w,r=m,n=new RegExp("\\".concat(r,"\\b"),"g");var C=p.replace(dM,""),S=MR(g||m?"".concat(g," ").concat(m," { ").concat(C," }"):C);a.namespace&&(S=mk(S,a.namespace));var y=[];return mc(S,IR(d.concat(NR(function(k){return y.push(k)})))),y};return h.hash=u.length?u.reduce(function(p,m){return m.name||fl(15),ua(p,m.name)},uk).toString():"",h}var hM=new gk,Ch=pM(),yk=Qr.createContext({shouldForwardProp:void 0,styleSheet:hM,stylis:Ch});yk.Consumer;Qr.createContext(void 0);function r_(){return F.useContext(yk)}var vM=function(){function e(t,r){var n=this;this.inject=function(i,o){o===void 0&&(o=Ch);var a=n.name+o.hash;i.hasNameForId(n.id,a)||i.insertRules(n.id,a,o(n.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,tg(this,function(){throw fl(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Ch),this.name+t.hash},e}(),gM=function(e){return e>="A"&&e<="Z"};function n_(e){for(var t="",r=0;r>>0);if(!r.hasNameForId(this.componentId,a)){var l=n(o,".".concat(a),void 0,this.componentId);r.insertRules(this.componentId,a,l)}i=so(i,a),this.staticRulesId=a}else{for(var u=ua(this.baseHash,n.hash),c="",d=0;d>>0);r.hasNameForId(this.componentId,m)||r.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=so(i,m)}}return i},e}(),Sk=Qr.createContext(void 0);Sk.Consumer;var ad={};function wM(e,t,r){var n=eg(e),i=e,o=!od(e),a=t.attrs,l=a===void 0?Gc:a,u=t.componentId,c=u===void 0?function(x,O){var R=typeof x!="string"?"sc":Yy(x);ad[R]=(ad[R]||0)+1;var T="".concat(R,"-").concat(WR(qc+R+ad[R]));return O?"".concat(O,"-").concat(T):T}(t.displayName,t.parentComponentId):u,d=t.displayName,h=d===void 0?function(x){return od(x)?"styled.".concat(x):"Styled(".concat(HR(x),")")}(e):d,p=t.displayName&&t.componentId?"".concat(Yy(t.displayName),"-").concat(t.componentId):t.componentId||c,m=n&&i.attrs?i.attrs.concat(l).filter(Boolean):l,g=t.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;g=function(x,O){return w(x,O)&&C(x,O)}}else g=w}var S=new _M(r,p,n?i.componentStyle:void 0);function y(x,O){return function(R,T,A){var N=R.attrs,I=R.componentStyle,U=R.defaultProps,q=R.foldedComponentIds,G=R.styledComponentId,J=R.target,P=Qr.useContext(Sk),V=r_(),X=R.shouldForwardProp||V.shouldForwardProp,K=FR(T,P,U)||Ra,ee=function(ce,de,Te){for(var Mt,st=wr(wr({},de),{className:void 0,theme:Te}),Lt=0;Lt"u")throw new Error(t)}function So(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function EM(){return Math.random().toString(36).substr(2,8)}function s_(e,t){return{usr:e.state,key:e.key,idx:t}}function il(e,t,r,n){return r===void 0&&(r=null),yt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ui(t):t,{state:r,key:t&&t.key||n||EM()})}function ko(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ui(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function xM(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:o=!1}=n,a=i.history,l=At.Pop,u=null,c=d();c==null&&(c=0,a.replaceState(yt({},a.state,{idx:c}),""));function d(){return(a.state||{idx:null}).idx}function h(){l=At.Pop;let C=d(),S=C==null?null:C-c;c=C,u&&u({action:l,location:w.location,delta:S})}function p(C,S){l=At.Push;let y=il(w.location,C,S);r&&r(y,C),c=d()+1;let k=s_(y,c),x=w.createHref(y);try{a.pushState(k,"",x)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(x)}o&&u&&u({action:l,location:w.location,delta:1})}function m(C,S){l=At.Replace;let y=il(w.location,C,S);r&&r(y,C),c=d();let k=s_(y,c),x=w.createHref(y);a.replaceState(k,"",x),o&&u&&u({action:l,location:w.location,delta:0})}function g(C){let S=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof C=="string"?C:ko(C);return y=y.replace(/ $/,"%20"),Me(S,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,S)}let w={get action(){return l},get location(){return e(i,a)},listen(C){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(a_,h),u=C,()=>{i.removeEventListener(a_,h),u=null}},createHref(C){return t(i,C)},createURL:g,encodeLocation(C){let S=g(C);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:m,go(C){return a.go(C)}};return w}var pt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pt||(pt={}));const CM=new Set(["lazy","caseSensitive","path","id","index","children"]);function TM(e){return e.index===!0}function bh(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((i,o)=>{let a=[...r,o],l=typeof i.id=="string"?i.id:a.join("-");if(Me(i.index!==!0||!i.children,"Cannot specify children on an index route"),Me(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),TM(i)){let u=yt({},i,t(i),{id:l});return n[l]=u,u}else{let u=yt({},i,t(i),{id:l,children:void 0});return n[l]=u,i.children&&(u.children=bh(i.children,t,a,n)),u}})}function ca(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ui(t):t,i=si(n.pathname||"/",r);if(i==null)return null;let o=Ek(e);OM(o);let a=null;for(let l=0;a==null&&l{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(Me(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let c=ei([n,u.relativePath]),d=r.concat(u);o.children&&o.children.length>0&&(Me(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Ek(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:IM(c,o.index),routesMeta:d})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,a);else for(let u of xk(o.path))i(o,a,u)}),t}function xk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return i?[o,""]:[o];let a=xk(n.join("/")),l=[];return l.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function OM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:NM(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const DM=/^:[\w-]+$/,$M=3,RM=2,MM=1,LM=10,PM=-2,l_=e=>e==="*";function IM(e,t){let r=e.split("/"),n=r.length;return r.some(l_)&&(n+=PM),t&&(n+=RM),r.filter(i=>!l_(i)).reduce((i,o)=>i+(DM.test(o)?$M:o===""?MM:LM),n)}function NM(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function AM(e,t){let{routesMeta:r}=e,n={},i="/",o=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let w=l[h]||"";a=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=l[h];return m&&!g?c[p]=void 0:c[p]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function BM(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),So(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(n.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function zM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return So(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function si(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function FM(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?ui(e):e;return{pathname:r?r.startsWith("/")?r:KM(r,t):t,search:UM(n),hash:WM(i)}}function KM(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function sd(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ck(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function rg(e,t){let r=Ck(e);return t?r.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ng(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=ui(e):(i=yt({},e),Me(!i.pathname||!i.pathname.includes("?"),sd("?","pathname","search",i)),Me(!i.pathname||!i.pathname.includes("#"),sd("#","pathname","hash",i)),Me(!i.search||!i.search.includes("#"),sd("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,l;if(a==null)l=r;else{let h=t.length-1;if(!n&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}l=h>=0?t[h]:"/"}let u=FM(i,l),c=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const ei=e=>e.join("/").replace(/\/\/+/g,"/"),jM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,WM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class ig{constructor(t,r,n,i){i===void 0&&(i=!1),this.status=t,this.statusText=r||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function og(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Tk=["post","put","patch","delete"],HM=new Set(Tk),VM=["get",...Tk],qM=new Set(VM),GM=new Set([301,302,303,307,308]),YM=new Set([307,308]),ld={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},QM={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ns={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XM=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),bk="remix-router-transitions";function JM(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Me(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let L=e.detectErrorBoundary;i=B=>({hasErrorBoundary:L(B)})}else i=XM;let o={},a=bh(e.routes,i,void 0,o),l,u=e.basename||"/",c=e.unstable_dataStrategy||rL,d=yt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,m=null,g=null,w=null,C=e.hydrationData!=null,S=ca(a,e.history.location,u),y=null;if(S==null){let L=Hr(404,{pathname:e.history.location.pathname}),{matches:B,route:H}=y_(a);S=B,y={[H.id]:L}}let k,x=S.some(L=>L.route.lazy),O=S.some(L=>L.route.loader);if(x)k=!1;else if(!O)k=!0;else if(d.v7_partialHydration){let L=e.hydrationData?e.hydrationData.loaderData:null,B=e.hydrationData?e.hydrationData.errors:null,H=Z=>Z.route.loader?typeof Z.route.loader=="function"&&Z.route.loader.hydrate===!0?!1:L&&L[Z.route.id]!==void 0||B&&B[Z.route.id]!==void 0:!0;if(B){let Z=S.findIndex(se=>B[se.route.id]!==void 0);k=S.slice(0,Z+1).every(H)}else k=S.every(H)}else k=e.hydrationData!=null;let R,T={historyAction:e.history.action,location:e.history.location,matches:S,initialized:k,navigation:ld,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||y,fetchers:new Map,blockers:new Map},A=At.Pop,N=!1,I,U=!1,q=new Map,G=null,J=!1,P=!1,V=[],X=[],K=new Map,ee=0,te=-1,ie=new Map,ae=new Set,Fe=new Map,Ae=new Map,ce=new Set,de=new Map,Te=new Map,Mt=!1;function st(){if(h=e.history.listen(L=>{let{action:B,location:H,delta:Z}=L;if(Mt){Mt=!1;return}So(Te.size===0||Z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let se=Mo({currentLocation:T.location,nextLocation:H,historyAction:B});if(se&&Z!=null){Mt=!0,e.history.go(Z*-1),Ct(se,{state:"blocked",location:H,proceed(){Ct(se,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),e.history.go(Z)},reset(){let ke=new Map(T.blockers);ke.set(se,ns),Be({blockers:ke})}});return}return ut(B,H)}),r){hL(t,q);let L=()=>vL(t,q);t.addEventListener("pagehide",L),G=()=>t.removeEventListener("pagehide",L)}return T.initialized||ut(At.Pop,T.location,{initialHydration:!0}),R}function Lt(){h&&h(),G&&G(),p.clear(),I&&I.abort(),T.fetchers.forEach((L,B)=>Ke(B)),T.blockers.forEach((L,B)=>Kn(B))}function Wt(L){return p.add(L),()=>p.delete(L)}function Be(L,B){B===void 0&&(B={}),T=yt({},T,L);let H=[],Z=[];d.v7_fetcherPersist&&T.fetchers.forEach((se,ke)=>{se.state==="idle"&&(ce.has(ke)?Z.push(ke):H.push(ke))}),[...p].forEach(se=>se(T,{deletedFetchers:Z,unstable_viewTransitionOpts:B.viewTransitionOpts,unstable_flushSync:B.flushSync===!0})),d.v7_fetcherPersist&&(H.forEach(se=>T.fetchers.delete(se)),Z.forEach(se=>Ke(se)))}function ze(L,B,H){var Z,se;let{flushSync:ke}=H===void 0?{}:H,ve=T.actionData!=null&&T.navigation.formMethod!=null&&dn(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Z=L.state)==null?void 0:Z._isRedirect)!==!0,le;B.actionData?Object.keys(B.actionData).length>0?le=B.actionData:le=null:ve?le=T.actionData:le=null;let xe=B.loaderData?g_(T.loaderData,B.loaderData,B.matches||[],B.errors):T.loaderData,Ee=T.blockers;Ee.size>0&&(Ee=new Map(Ee),Ee.forEach((we,We)=>Ee.set(We,ns)));let Tt=N===!0||T.navigation.formMethod!=null&&dn(T.navigation.formMethod)&&((se=L.state)==null?void 0:se._isRedirect)!==!0;l&&(a=l,l=void 0),J||A===At.Pop||(A===At.Push?e.history.push(L,L.state):A===At.Replace&&e.history.replace(L,L.state));let bt;if(A===At.Pop){let we=q.get(T.location.pathname);we&&we.has(L.pathname)?bt={currentLocation:T.location,nextLocation:L}:q.has(L.pathname)&&(bt={currentLocation:L,nextLocation:T.location})}else if(U){let we=q.get(T.location.pathname);we?we.add(L.pathname):(we=new Set([L.pathname]),q.set(T.location.pathname,we)),bt={currentLocation:T.location,nextLocation:L}}Be(yt({},B,{actionData:le,loaderData:xe,historyAction:A,location:L,initialized:!0,navigation:ld,revalidation:"idle",restoreScrollPosition:pi(L,B.matches||T.matches),preventScrollReset:Tt,blockers:Ee}),{viewTransitionOpts:bt,flushSync:ke===!0}),A=At.Pop,N=!1,U=!1,J=!1,P=!1,V=[],X=[]}async function lt(L,B){if(typeof L=="number"){e.history.go(L);return}let H=Dh(T.location,T.matches,u,d.v7_prependBasename,L,d.v7_relativeSplatPath,B==null?void 0:B.fromRouteId,B==null?void 0:B.relative),{path:Z,submission:se,error:ke}=u_(d.v7_normalizeFormMethod,!1,H,B),ve=T.location,le=il(T.location,Z,B&&B.state);le=yt({},le,e.history.encodeLocation(le));let xe=B&&B.replace!=null?B.replace:void 0,Ee=At.Push;xe===!0?Ee=At.Replace:xe===!1||se!=null&&dn(se.formMethod)&&se.formAction===T.location.pathname+T.location.search&&(Ee=At.Replace);let Tt=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,bt=(B&&B.unstable_flushSync)===!0,we=Mo({currentLocation:ve,nextLocation:le,historyAction:Ee});if(we){Ct(we,{state:"blocked",location:le,proceed(){Ct(we,{state:"proceeding",proceed:void 0,reset:void 0,location:le}),lt(L,B)},reset(){let We=new Map(T.blockers);We.set(we,ns),Be({blockers:We})}});return}return await ut(Ee,le,{submission:se,pendingError:ke,preventScrollReset:Tt,replace:B&&B.replace,enableViewTransition:B&&B.unstable_viewTransition,flushSync:bt})}function Pe(){if(hr(),Be({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){ut(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}ut(A||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function ut(L,B,H){I&&I.abort(),I=null,A=L,J=(H&&H.startUninterruptedRevalidation)===!0,_n(T.location,T.matches),N=(H&&H.preventScrollReset)===!0,U=(H&&H.enableViewTransition)===!0;let Z=l||a,se=H&&H.overrideNavigation,ke=ca(Z,B,u),ve=(H&&H.flushSync)===!0;if(!ke){let we=Hr(404,{pathname:B.pathname}),{matches:We,route:Pt}=y_(Z);di(),ze(B,{matches:We,loaderData:{},errors:{[Pt.id]:we}},{flushSync:ve});return}if(T.initialized&&!P&&lL(T.location,B)&&!(H&&H.submission&&dn(H.submission.formMethod))){ze(B,{matches:ke},{flushSync:ve});return}I=new AbortController;let le=Uo(e.history,B,I.signal,H&&H.submission),xe;if(H&&H.pendingError)xe=[Ps(ke).route.id,{type:pt.error,error:H.pendingError}];else if(H&&H.submission&&dn(H.submission.formMethod)){let we=await Fr(le,B,H.submission,ke,{replace:H.replace,flushSync:ve});if(we.shortCircuited)return;xe=we.pendingActionResult,se=ud(B,H.submission),ve=!1,le=Uo(e.history,le.url,le.signal)}let{shortCircuited:Ee,loaderData:Tt,errors:bt}=await Ye(le,B,ke,se,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,ve,xe);Ee||(I=null,ze(B,yt({matches:ke},m_(xe),{loaderData:Tt,errors:bt})))}async function Fr(L,B,H,Z,se){se===void 0&&(se={}),hr();let ke=dL(B,H);Be({navigation:ke},{flushSync:se.flushSync===!0});let ve,le=Rh(Z,B);if(!le.route.action&&!le.route.lazy)ve={type:pt.error,error:Hr(405,{method:L.method,pathname:B.pathname,routeId:le.route.id})};else if(ve=(await tt("action",L,[le],Z))[0],L.signal.aborted)return{shortCircuited:!0};if(uo(ve)){let xe;return se&&se.replace!=null?xe=se.replace:xe=p_(ve.response.headers.get("Location"),new URL(L.url),u)===T.location.pathname+T.location.search,await gt(L,ve,{submission:H,replace:xe}),{shortCircuited:!0}}if(lo(ve))throw Hr(400,{type:"defer-action"});if(Gr(ve)){let xe=Ps(Z,le.route.id);return(se&&se.replace)!==!0&&(A=At.Push),{pendingActionResult:[xe.route.id,ve]}}return{pendingActionResult:[le.route.id,ve]}}async function Ye(L,B,H,Z,se,ke,ve,le,xe,Ee){let Tt=Z||ud(B,se),bt=se||ke||S_(Tt),we=l||a,[We,Pt]=c_(e.history,T,H,bt,B,d.v7_partialHydration&&le===!0,d.unstable_skipActionErrorRevalidation,P,V,X,ce,Fe,ae,we,u,Ee);if(di(De=>!(H&&H.some(Ot=>Ot.route.id===De))||We&&We.some(Ot=>Ot.route.id===De)),te=++ee,We.length===0&&Pt.length===0){let De=me();return ze(B,yt({matches:H,loaderData:{},errors:Ee&&Gr(Ee[1])?{[Ee[0]]:Ee[1].error}:null},m_(Ee),De?{fetchers:new Map(T.fetchers)}:{}),{flushSync:xe}),{shortCircuited:!0}}if(!J&&(!d.v7_partialHydration||!le)){Pt.forEach(Ot=>{let Kt=T.fetchers.get(Ot.key),Xe=is(void 0,Kt?Kt.data:void 0);T.fetchers.set(Ot.key,Xe)});let De;Ee&&!Gr(Ee[1])?De={[Ee[0]]:Ee[1].data}:T.actionData&&(Object.keys(T.actionData).length===0?De=null:De=T.actionData),Be(yt({navigation:Tt},De!==void 0?{actionData:De}:{},Pt.length>0?{fetchers:new Map(T.fetchers)}:{}),{flushSync:xe})}Pt.forEach(De=>{K.has(De.key)&&mt(De.key),De.controller&&K.set(De.key,De.controller)});let Gi=()=>Pt.forEach(De=>mt(De.key));I&&I.signal.addEventListener("abort",Gi);let{loaderResults:Kr,fetcherResults:wn}=await Ft(T.matches,H,We,Pt,L);if(L.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Gi),Pt.forEach(De=>K.delete(De.key));let It=__([...Kr,...wn]);if(It){if(It.idx>=We.length){let De=Pt[It.idx-We.length].key;ae.add(De)}return await gt(L,It.result,{replace:ve}),{shortCircuited:!0}}let{loaderData:$e,errors:gr}=v_(T,H,We,Kr,Ee,Pt,wn,de);de.forEach((De,Ot)=>{De.subscribe(Kt=>{(Kt||De.done)&&de.delete(Ot)})}),d.v7_partialHydration&&le&&T.errors&&Object.entries(T.errors).filter(De=>{let[Ot]=De;return!We.some(Kt=>Kt.route.id===Ot)}).forEach(De=>{let[Ot,Kt]=De;gr=Object.assign(gr||{},{[Ot]:Kt})});let Yi=me(),Oe=rr(te),Sn=Yi||Oe||Pt.length>0;return yt({loaderData:$e,errors:gr},Sn?{fetchers:new Map(T.fetchers)}:{})}function xt(L,B,H,Z){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");K.has(L)&&mt(L);let se=(Z&&Z.unstable_flushSync)===!0,ke=l||a,ve=Dh(T.location,T.matches,u,d.v7_prependBasename,H,d.v7_relativeSplatPath,B,Z==null?void 0:Z.relative),le=ca(ke,ve,u);if(!le){be(L,B,Hr(404,{pathname:ve}),{flushSync:se});return}let{path:xe,submission:Ee,error:Tt}=u_(d.v7_normalizeFormMethod,!0,ve,Z);if(Tt){be(L,B,Tt,{flushSync:se});return}let bt=Rh(le,xe);if(N=(Z&&Z.preventScrollReset)===!0,Ee&&dn(Ee.formMethod)){tr(L,B,xe,bt,le,se,Ee);return}Fe.set(L,{routeId:B,path:xe}),ct(L,B,xe,bt,le,se,Ee)}async function tr(L,B,H,Z,se,ke,ve){if(hr(),Fe.delete(L),!Z.route.action&&!Z.route.lazy){let Xe=Hr(405,{method:ve.formMethod,pathname:H,routeId:B});be(L,B,Xe,{flushSync:ke});return}let le=T.fetchers.get(L);ye(L,pL(ve,le),{flushSync:ke});let xe=new AbortController,Ee=Uo(e.history,H,xe.signal,ve);K.set(L,xe);let Tt=ee,we=(await tt("action",Ee,[Z],se))[0];if(Ee.signal.aborted){K.get(L)===xe&&K.delete(L);return}if(d.v7_fetcherPersist&&ce.has(L)){if(uo(we)||Gr(we)){ye(L,wi(void 0));return}}else{if(uo(we))if(K.delete(L),te>Tt){ye(L,wi(void 0));return}else return ae.add(L),ye(L,is(ve)),gt(Ee,we,{fetcherSubmission:ve});if(Gr(we)){be(L,B,we.error);return}}if(lo(we))throw Hr(400,{type:"defer-action"});let We=T.navigation.location||T.location,Pt=Uo(e.history,We,xe.signal),Gi=l||a,Kr=T.navigation.state!=="idle"?ca(Gi,T.navigation.location,u):T.matches;Me(Kr,"Didn't find any matches after fetcher action");let wn=++ee;ie.set(L,wn);let It=is(ve,we.data);T.fetchers.set(L,It);let[$e,gr]=c_(e.history,T,Kr,ve,We,!1,d.unstable_skipActionErrorRevalidation,P,V,X,ce,Fe,ae,Gi,u,[Z.route.id,we]);gr.filter(Xe=>Xe.key!==L).forEach(Xe=>{let jn=Xe.key,Po=T.fetchers.get(jn),$l=is(void 0,Po?Po.data:void 0);T.fetchers.set(jn,$l),K.has(jn)&&mt(jn),Xe.controller&&K.set(jn,Xe.controller)}),Be({fetchers:new Map(T.fetchers)});let Yi=()=>gr.forEach(Xe=>mt(Xe.key));xe.signal.addEventListener("abort",Yi);let{loaderResults:Oe,fetcherResults:Sn}=await Ft(T.matches,Kr,$e,gr,Pt);if(xe.signal.aborted)return;xe.signal.removeEventListener("abort",Yi),ie.delete(L),K.delete(L),gr.forEach(Xe=>K.delete(Xe.key));let De=__([...Oe,...Sn]);if(De){if(De.idx>=$e.length){let Xe=gr[De.idx-$e.length].key;ae.add(Xe)}return gt(Pt,De.result)}let{loaderData:Ot,errors:Kt}=v_(T,T.matches,$e,Oe,void 0,gr,Sn,de);if(T.fetchers.has(L)){let Xe=wi(we.data);T.fetchers.set(L,Xe)}rr(wn),T.navigation.state==="loading"&&wn>te?(Me(A,"Expected pending action"),I&&I.abort(),ze(T.navigation.location,{matches:Kr,loaderData:Ot,errors:Kt,fetchers:new Map(T.fetchers)})):(Be({errors:Kt,loaderData:g_(T.loaderData,Ot,Kr,Kt),fetchers:new Map(T.fetchers)}),P=!1)}async function ct(L,B,H,Z,se,ke,ve){let le=T.fetchers.get(L);ye(L,is(ve,le?le.data:void 0),{flushSync:ke});let xe=new AbortController,Ee=Uo(e.history,H,xe.signal);K.set(L,xe);let Tt=ee,we=(await tt("loader",Ee,[Z],se))[0];if(lo(we)&&(we=await Rk(we,Ee.signal,!0)||we),K.get(L)===xe&&K.delete(L),!Ee.signal.aborted){if(ce.has(L)){ye(L,wi(void 0));return}if(uo(we))if(te>Tt){ye(L,wi(void 0));return}else{ae.add(L),await gt(Ee,we);return}if(Gr(we)){be(L,B,we.error);return}Me(!lo(we),"Unhandled fetcher deferred data"),ye(L,wi(we.data))}}async function gt(L,B,H){let{submission:Z,fetcherSubmission:se,replace:ke}=H===void 0?{}:H;B.response.headers.has("X-Remix-Revalidate")&&(P=!0);let ve=B.response.headers.get("Location");Me(ve,"Expected a Location header on the redirect Response"),ve=p_(ve,new URL(L.url),u);let le=il(T.location,ve,{_isRedirect:!0});if(r){let We=!1;if(B.response.headers.has("X-Remix-Reload-Document"))We=!0;else if(ag.test(ve)){const Pt=e.history.createURL(ve);We=Pt.origin!==t.location.origin||si(Pt.pathname,u)==null}if(We){ke?t.location.replace(ve):t.location.assign(ve);return}}I=null;let xe=ke===!0?At.Replace:At.Push,{formMethod:Ee,formAction:Tt,formEncType:bt}=T.navigation;!Z&&!se&&Ee&&Tt&&bt&&(Z=S_(T.navigation));let we=Z||se;if(YM.has(B.response.status)&&we&&dn(we.formMethod))await ut(xe,le,{submission:yt({},we,{formAction:ve}),preventScrollReset:N});else{let We=ud(le,Z);await ut(xe,le,{overrideNavigation:We,fetcherSubmission:se,preventScrollReset:N})}}async function tt(L,B,H,Z){try{let se=await nL(c,L,B,H,Z,o,i);return await Promise.all(se.map((ke,ve)=>{if(uL(ke)){let le=ke.result;return{type:pt.redirect,response:aL(le,B,H[ve].route.id,Z,u,d.v7_relativeSplatPath)}}return oL(ke)}))}catch(se){return H.map(()=>({type:pt.error,error:se}))}}async function Ft(L,B,H,Z,se){let[ke,...ve]=await Promise.all([H.length?tt("loader",se,H,B):[],...Z.map(le=>{if(le.matches&&le.match&&le.controller){let xe=Uo(e.history,le.path,le.controller.signal);return tt("loader",xe,[le.match],le.matches).then(Ee=>Ee[0])}else return Promise.resolve({type:pt.error,error:Hr(404,{pathname:le.path})})})]);return await Promise.all([w_(L,H,ke,ke.map(()=>se.signal),!1,T.loaderData),w_(L,Z.map(le=>le.match),ve,Z.map(le=>le.controller?le.controller.signal:null),!0)]),{loaderResults:ke,fetcherResults:ve}}function hr(){P=!0,V.push(...di()),Fe.forEach((L,B)=>{K.has(B)&&(X.push(B),mt(B))})}function ye(L,B,H){H===void 0&&(H={}),T.fetchers.set(L,B),Be({fetchers:new Map(T.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function be(L,B,H,Z){Z===void 0&&(Z={});let se=Ps(T.matches,B);Ke(L),Be({errors:{[se.route.id]:H},fetchers:new Map(T.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function _e(L){return d.v7_fetcherPersist&&(Ae.set(L,(Ae.get(L)||0)+1),ce.has(L)&&ce.delete(L)),T.fetchers.get(L)||QM}function Ke(L){let B=T.fetchers.get(L);K.has(L)&&!(B&&B.state==="loading"&&ie.has(L))&&mt(L),Fe.delete(L),ie.delete(L),ae.delete(L),ce.delete(L),T.fetchers.delete(L)}function vr(L){if(d.v7_fetcherPersist){let B=(Ae.get(L)||0)-1;B<=0?(Ae.delete(L),ce.add(L)):Ae.set(L,B)}else Ke(L);Be({fetchers:new Map(T.fetchers)})}function mt(L){let B=K.get(L);Me(B,"Expected fetch controller: "+L),B.abort(),K.delete(L)}function Ie(L){for(let B of L){let H=_e(B),Z=wi(H.data);T.fetchers.set(B,Z)}}function me(){let L=[],B=!1;for(let H of ae){let Z=T.fetchers.get(H);Me(Z,"Expected fetcher: "+H),Z.state==="loading"&&(ae.delete(H),L.push(H),B=!0)}return Ie(L),B}function rr(L){let B=[];for(let[H,Z]of ie)if(Z0}function Qe(L,B){let H=T.blockers.get(L)||ns;return Te.get(L)!==B&&Te.set(L,B),H}function Kn(L){T.blockers.delete(L),Te.delete(L)}function Ct(L,B){let H=T.blockers.get(L)||ns;Me(H.state==="unblocked"&&B.state==="blocked"||H.state==="blocked"&&B.state==="blocked"||H.state==="blocked"&&B.state==="proceeding"||H.state==="blocked"&&B.state==="unblocked"||H.state==="proceeding"&&B.state==="unblocked","Invalid blocker state transition: "+H.state+" -> "+B.state);let Z=new Map(T.blockers);Z.set(L,B),Be({blockers:Z})}function Mo(L){let{currentLocation:B,nextLocation:H,historyAction:Z}=L;if(Te.size===0)return;Te.size>1&&So(!1,"A router only supports one blocker at a time");let se=Array.from(Te.entries()),[ke,ve]=se[se.length-1],le=T.blockers.get(ke);if(!(le&&le.state==="proceeding")&&ve({currentLocation:B,nextLocation:H,historyAction:Z}))return ke}function di(L){let B=[];return de.forEach((H,Z)=>{(!L||L(Z))&&(H.cancel(),B.push(Z),de.delete(Z))}),B}function Ht(L,B,H){if(m=L,w=B,g=H||null,!C&&T.navigation===ld){C=!0;let Z=pi(T.location,T.matches);Z!=null&&Be({restoreScrollPosition:Z})}return()=>{m=null,w=null,g=null}}function Lo(L,B){return g&&g(L,B.map(Z=>bM(Z,T.loaderData)))||L.key}function _n(L,B){if(m&&w){let H=Lo(L,B);m[H]=w()}}function pi(L,B){if(m){let H=Lo(L,B),Z=m[H];if(typeof Z=="number")return Z}return null}function hi(L){o={},l=bh(L,i,void 0,o)}return R={get basename(){return u},get future(){return d},get state(){return T},get routes(){return a},get window(){return t},initialize:st,subscribe:Wt,enableScrollRestoration:Ht,navigate:lt,fetch:xt,revalidate:Pe,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:_e,deleteFetcher:vr,dispose:Lt,getBlocker:Qe,deleteBlocker:Kn,_internalFetchControllers:K,_internalActiveDeferreds:de,_internalSetRoutes:hi},R}function ZM(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Dh(e,t,r,n,i,o,a,l){let u,c;if(a){u=[];for(let h of t)if(u.push(h),h.route.id===a){c=h;break}}else u=t,c=t[t.length-1];let d=ng(i||".",rg(u,o),si(e.pathname,r)||e.pathname,l==="path");return i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!sg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ei([r,d.pathname])),ko(d)}function u_(e,t,r,n){if(!n||!ZM(n))return{path:r};if(n.formMethod&&!fL(n.formMethod))return{path:r,error:Hr(405,{method:n.formMethod})};let i=()=>({path:r,error:Hr(400,{type:"invalid-body"})}),o=n.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),l=Dk(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!dn(a))return i();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,g)=>{let[w,C]=g;return""+m+w+"="+C+` +`},""):String(n.body);return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!dn(a))return i();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}Me(typeof FormData=="function","FormData is not available in this environment");let u,c;if(n.formData)u=$h(n.formData),c=n.formData;else if(n.body instanceof FormData)u=$h(n.body),c=n.body;else if(n.body instanceof URLSearchParams)u=n.body,c=h_(u);else if(n.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(n.body),c=h_(u)}catch{return i()}let d={formMethod:a,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(dn(d.formMethod))return{path:r,submission:d};let h=ui(r);return t&&h.search&&sg(h.search)&&u.append("index",""),h.search="?"+u,{path:ko(h),submission:d}}function eL(e,t){let r=e;if(t){let n=e.findIndex(i=>i.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function c_(e,t,r,n,i,o,a,l,u,c,d,h,p,m,g,w){let C=w?Gr(w[1])?w[1].error:w[1].data:void 0,S=e.createURL(t.location),y=e.createURL(i),k=w&&Gr(w[1])?w[0]:void 0,x=k?eL(r,k):r,O=w?w[1].statusCode:void 0,R=a&&O&&O>=400,T=x.filter((N,I)=>{let{route:U}=N;if(U.lazy)return!0;if(U.loader==null)return!1;if(o)return typeof U.loader!="function"||U.loader.hydrate?!0:t.loaderData[U.id]===void 0&&(!t.errors||t.errors[U.id]===void 0);if(tL(t.loaderData,t.matches[I],N)||u.some(J=>J===N.route.id))return!0;let q=t.matches[I],G=N;return f_(N,yt({currentUrl:S,currentParams:q.params,nextUrl:y,nextParams:G.params},n,{actionResult:C,unstable_actionStatus:O,defaultShouldRevalidate:R?!1:l||S.pathname+S.search===y.pathname+y.search||S.search!==y.search||Ok(q,G)}))}),A=[];return h.forEach((N,I)=>{if(o||!r.some(P=>P.route.id===N.routeId)||d.has(I))return;let U=ca(m,N.path,g);if(!U){A.push({key:I,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let q=t.fetchers.get(I),G=Rh(U,N.path),J=!1;p.has(I)?J=!1:c.includes(I)?J=!0:q&&q.state!=="idle"&&q.data===void 0?J=l:J=f_(G,yt({currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:r[r.length-1].params},n,{actionResult:C,unstable_actionStatus:O,defaultShouldRevalidate:R?!1:l})),J&&A.push({key:I,routeId:N.routeId,path:N.path,matches:U,match:G,controller:new AbortController})}),[T,A]}function tL(e,t,r){let n=!t||r.route.id!==t.route.id,i=e[r.route.id]===void 0;return n||i}function Ok(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function f_(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function d_(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let i=r[e.id];Me(i,"No route found in manifest");let o={};for(let a in n){let u=i[a]!==void 0&&a!=="hasErrorBoundary";So(!u,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!CM.has(a)&&(o[a]=n[a])}Object.assign(i,o),Object.assign(i,yt({},t(i),{lazy:void 0}))}function rL(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function nL(e,t,r,n,i,o,a,l){let u=n.reduce((h,p)=>h.add(p.route.id),new Set),c=new Set,d=await e({matches:i.map(h=>{let p=u.has(h.route.id);return yt({},h,{shouldLoad:p,resolve:g=>(c.add(h.route.id),p?iL(t,r,h,o,a,g,l):Promise.resolve({type:pt.data,result:void 0}))})}),request:r,params:i[0].params,context:l});return i.forEach(h=>Me(c.has(h.route.id),'`match.resolve()` was not called for route id "'+h.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((h,p)=>u.has(i[p].route.id))}async function iL(e,t,r,n,i,o,a){let l,u,c=d=>{let h,p=new Promise((w,C)=>h=C);u=()=>h(),t.signal.addEventListener("abort",u);let m=w=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:a},...w!==void 0?[w]:[]),g;return o?g=o(w=>m(w)):g=(async()=>{try{return{type:"data",result:await m()}}catch(w){return{type:"error",result:w}}})(),Promise.race([g,p])};try{let d=r.route[e];if(r.route.lazy)if(d){let h,[p]=await Promise.all([c(d).catch(m=>{h=m}),d_(r.route,i,n)]);if(h!==void 0)throw h;l=p}else if(await d_(r.route,i,n),d=r.route[e],d)l=await c(d);else if(e==="action"){let h=new URL(t.url),p=h.pathname+h.search;throw Hr(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:pt.data,result:void 0};else if(d)l=await c(d);else{let h=new URL(t.url),p=h.pathname+h.search;throw Hr(404,{pathname:p})}Me(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:pt.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return l}async function oL(e){let{result:t,type:r,status:n}=e;if($k(t)){let a;try{let l=t.headers.get("Content-Type");l&&/\bapplication\/json\b/.test(l)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(l){return{type:pt.error,error:l}}return r===pt.error?{type:pt.error,error:new ig(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:pt.data,data:a,statusCode:t.status,headers:t.headers}}if(r===pt.error)return{type:pt.error,error:t,statusCode:og(t)?t.status:n};if(cL(t)){var i,o;return{type:pt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:pt.data,data:t,statusCode:n}}function aL(e,t,r,n,i,o){let a=e.headers.get("Location");if(Me(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!ag.test(a)){let l=n.slice(0,n.findIndex(u=>u.route.id===r)+1);a=Dh(new URL(t.url),l,i,!0,a,o),e.headers.set("Location",a)}return e}function p_(e,t,r){if(ag.test(e)){let n=e,i=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=si(i.pathname,r)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function Uo(e,t,r,n){let i=e.createURL(Dk(t)).toString(),o={signal:r};if(n&&dn(n.formMethod)){let{formMethod:a,formEncType:l}=n;o.method=a.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=$h(n.formData):o.body=n.formData}return new Request(i,o)}function $h(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function h_(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function sL(e,t,r,n,i,o){let a={},l=null,u,c=!1,d={},h=n&&Gr(n[1])?n[1].error:void 0;return r.forEach((p,m)=>{let g=t[m].route.id;if(Me(!uo(p),"Cannot handle redirect results in processLoaderData"),Gr(p)){let w=p.error;h!==void 0&&(w=h,h=void 0),l=l||{};{let C=Ps(e,g);l[C.route.id]==null&&(l[C.route.id]=w)}a[g]=void 0,c||(c=!0,u=og(p.error)?p.error.status:500),p.headers&&(d[g]=p.headers)}else lo(p)?(i.set(g,p.deferredData),a[g]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(u=p.statusCode),p.headers&&(d[g]=p.headers)):(a[g]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(u=p.statusCode),p.headers&&(d[g]=p.headers))}),h!==void 0&&n&&(l={[n[0]]:h},a[n[0]]=void 0),{loaderData:a,errors:l,statusCode:u||200,loaderHeaders:d}}function v_(e,t,r,n,i,o,a,l){let{loaderData:u,errors:c}=sL(t,r,n,i,l);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function y_(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Hr(e,t){let{pathname:r,routeId:n,method:i,type:o}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",i&&r&&n?l="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",i&&r&&n?l="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new ig(e||500,a,new Error(l),!0)}function __(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(uo(r))return{result:r,idx:t}}}function Dk(e){let t=typeof e=="string"?ui(e):e;return ko(yt({},t,{hash:""}))}function lL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uL(e){return $k(e.result)&&GM.has(e.result.status)}function lo(e){return e.type===pt.deferred}function Gr(e){return e.type===pt.error}function uo(e){return(e&&e.type)===pt.redirect}function cL(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function $k(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fL(e){return qM.has(e.toLowerCase())}function dn(e){return HM.has(e.toLowerCase())}async function w_(e,t,r,n,i,o){for(let a=0;ah.route.id===u.route.id),d=c!=null&&!Ok(c,u)&&(o&&o[u.route.id])!==void 0;if(lo(l)&&(i||d)){let h=n[a];Me(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await Rk(l,h,i).then(p=>{p&&(r[a]=p||r[a])})}}}async function Rk(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:pt.data,data:e.deferredData.unwrappedData}}catch(i){return{type:pt.error,error:i}}return{type:pt.data,data:e.deferredData.data}}}function sg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Rh(e,t){let r=typeof t=="string"?ui(t).search:t.search;if(e[e.length-1].route.index&&sg(r||""))return e[e.length-1];let n=Ck(e);return n[n.length-1]}function S_(e){let{formMethod:t,formAction:r,formEncType:n,text:i,formData:o,json:a}=e;if(!(!t||!r||!n)){if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function ud(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dL(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function is(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pL(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function wi(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function hL(e,t){try{let r=e.sessionStorage.getItem(bk);if(r){let n=JSON.parse(r);for(let[i,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function vL(e,t){if(t.size>0){let r={};for(let[n,i]of t)r[n]=[...i];try{e.sessionStorage.setItem(bk,JSON.stringify(r))}catch(n){So(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + * React Router v6.23.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _c(){return _c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),F.useCallback(function(c,d){if(d===void 0&&(d={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let h=ng(c,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ei([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,a,o,e])}const yL=F.createContext(null);function _L(e){let t=F.useContext(Hi).outlet;return t&&F.createElement(yL.Provider,{value:e},t)}function Yc(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=F.useContext(Wi),{matches:i}=F.useContext(Hi),{pathname:o}=Ka(),a=JSON.stringify(rg(i,n.v7_relativeSplatPath));return F.useMemo(()=>ng(e,JSON.parse(a),o,r==="path"),[e,a,o,r])}function wL(e,t,r,n){pl()||Me(!1);let{navigator:i}=F.useContext(Wi),{matches:o}=F.useContext(Hi),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Ka(),d;d=c;let h=d.pathname||"/",p=h;if(u!=="/"){let w=u.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let m=ca(e,{pathname:p});return CL(m&&m.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ei([u,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:ei([u,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,r,n)}function SL(){let e=DL(),t=og(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},t),r?F.createElement("pre",{style:i},r):null,null)}const kL=F.createElement(SL,null);class EL extends F.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?F.createElement(Hi.Provider,{value:this.props.routeContext},F.createElement(Mk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xL(e){let{routeContext:t,match:r,children:n}=e,i=F.useContext(dl);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),F.createElement(Hi.Provider,{value:t},n)}function CL(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let a=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let d=a.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||Me(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((d,h,p)=>{let m,g=!1,w=null,C=null;r&&(m=l&&h.route.id?l[h.route.id]:void 0,w=h.route.errorElement||kL,u&&(c<0&&p===0?(g=!0,C=null):c===p&&(g=!0,C=h.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,p+1)),y=()=>{let k;return m?k=w:g?k=C:h.route.Component?k=F.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=d,F.createElement(xL,{match:h,routeContext:{outlet:d,matches:S,isDataRoute:r!=null},children:k})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?F.createElement(EL,{location:r.location,revalidation:r.revalidation,component:w,error:m,children:y(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):y()},null)}var Ik=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ik||{}),wc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wc||{});function TL(e){let t=F.useContext(dl);return t||Me(!1),t}function bL(e){let t=F.useContext(lg);return t||Me(!1),t}function OL(e){let t=F.useContext(Hi);return t||Me(!1),t}function Nk(e){let t=OL(),r=t.matches[t.matches.length-1];return r.route.id||Me(!1),r.route.id}function DL(){var e;let t=F.useContext(Mk),r=bL(wc.UseRouteError),n=Nk(wc.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function $L(){let{router:e}=TL(Ik.UseNavigateStable),t=Nk(wc.UseNavigateStable),r=F.useRef(!1);return Lk(()=>{r.current=!0}),F.useCallback(function(i,o){o===void 0&&(o={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_c({fromRouteId:t},o)))},[e,t])}function RL(e){return _L(e.context)}function ML(e){let{basename:t="/",children:r=null,location:n,navigationType:i=At.Pop,navigator:o,static:a=!1,future:l}=e;pl()&&Me(!1);let u=t.replace(/^\/*/,"/"),c=F.useMemo(()=>({basename:u,navigator:o,static:a,future:_c({v7_relativeSplatPath:!1},l)}),[u,l,o,a]);typeof n=="string"&&(n=ui(n));let{pathname:d="/",search:h="",hash:p="",state:m=null,key:g="default"}=n,w=F.useMemo(()=>{let C=si(d,u);return C==null?null:{location:{pathname:C,search:h,hash:p,state:m,key:g},navigationType:i}},[u,d,h,p,m,g,i]);return w==null?null:F.createElement(Wi.Provider,{value:c},F.createElement(ug.Provider,{children:r,value:w}))}new Promise(()=>{});function LL(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:F.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:F.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:F.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.23.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function PL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function IL(e,t){return e.button===0&&(!t||t==="_self")&&!PL(e)}const NL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],AL=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],BL="6";try{window.__reactRouterVersion=BL}catch{}function zL(e,t){return JM({basename:void 0,future:La({},void 0,{v7_prependBasename:!0}),history:kM({window:void 0}),hydrationData:FL(),routes:e,mapRouteProperties:LL,unstable_dataStrategy:void 0,window:void 0}).initialize()}function FL(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=La({},t,{errors:KL(t.errors)})),t}function KL(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,i]of t)if(i&&i.__type==="RouteErrorResponse")r[n]=new ig(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let o=new Error(i.message);o.stack="",r[n]=o}}else r[n]=i;return r}const Bk=F.createContext({isTransitioning:!1}),jL=F.createContext(new Map),UL="startTransition",k_=sD[UL],WL="flushSync",E_=_R[WL];function HL(e){k_?k_(e):e()}function os(e){E_?E_(e):e()}class VL{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function qL(e){let{fallbackElement:t,router:r,future:n}=e,[i,o]=F.useState(r.state),[a,l]=F.useState(),[u,c]=F.useState({isTransitioning:!1}),[d,h]=F.useState(),[p,m]=F.useState(),[g,w]=F.useState(),C=F.useRef(new Map),{v7_startTransition:S}=n||{},y=F.useCallback(T=>{S?HL(T):T()},[S]),k=F.useCallback((T,A)=>{let{deletedFetchers:N,unstable_flushSync:I,unstable_viewTransitionOpts:U}=A;N.forEach(G=>C.current.delete(G)),T.fetchers.forEach((G,J)=>{G.data!==void 0&&C.current.set(J,G.data)});let q=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!U||q){I?os(()=>o(T)):y(()=>o(T));return}if(I){os(()=>{p&&(d&&d.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let G=r.window.document.startViewTransition(()=>{os(()=>o(T))});G.finished.finally(()=>{os(()=>{h(void 0),m(void 0),l(void 0),c({isTransitioning:!1})})}),os(()=>m(G));return}p?(d&&d.resolve(),p.skipTransition(),w({state:T,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(l(T),c({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[r.window,p,d,C,y]);F.useLayoutEffect(()=>r.subscribe(k),[r,k]),F.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new VL)},[u]),F.useEffect(()=>{if(d&&a&&r.window){let T=a,A=d.promise,N=r.window.document.startViewTransition(async()=>{y(()=>o(T)),await A});N.finished.finally(()=>{h(void 0),m(void 0),l(void 0),c({isTransitioning:!1})}),m(N)}},[y,a,d,r.window]),F.useEffect(()=>{d&&a&&i.location.key===a.location.key&&d.resolve()},[d,p,i.location,a]),F.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),w(void 0))},[u.isTransitioning,g]),F.useEffect(()=>{},[]);let x=F.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:T=>r.navigate(T),push:(T,A,N)=>r.navigate(T,{state:A,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,A,N)=>r.navigate(T,{replace:!0,state:A,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[r]),O=r.basename||"/",R=F.useMemo(()=>({router:r,navigator:x,static:!1,basename:O}),[r,x,O]);return F.createElement(F.Fragment,null,F.createElement(dl.Provider,{value:R},F.createElement(lg.Provider,{value:i},F.createElement(jL.Provider,{value:C.current},F.createElement(Bk.Provider,{value:u},F.createElement(ML,{basename:O,location:i.location,navigationType:i.historyAction,navigator:x,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},i.initialized||r.future.v7_partialHydration?F.createElement(GL,{routes:r.routes,future:r.future,state:i}):t))))),null)}function GL(e){let{routes:t,future:r,state:n}=e;return wL(t,void 0,n,r)}const YL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XL=F.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:o,replace:a,state:l,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=t,p=Ak(t,NL),{basename:m}=F.useContext(Wi),g,w=!1;if(typeof c=="string"&&QL.test(c)&&(g=c,YL))try{let k=new URL(window.location.href),x=c.startsWith("//")?new URL(k.protocol+c):new URL(c),O=si(x.pathname,m);x.origin===k.origin&&O!=null?c=O+x.search+x.hash:w=!0}catch{}let C=gL(c,{relative:i}),S=eP(c,{replace:a,state:l,target:u,preventScrollReset:d,relative:i,unstable_viewTransition:h});function y(k){n&&n(k),k.defaultPrevented||S(k)}return F.createElement("a",La({},p,{href:g||C,onClick:w||o?n:y,ref:r,target:u}))}),JL=F.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:o="",end:a=!1,style:l,to:u,unstable_viewTransition:c,children:d}=t,h=Ak(t,AL),p=Yc(u,{relative:h.relative}),m=Ka(),g=F.useContext(lg),{navigator:w,basename:C}=F.useContext(Wi),S=g!=null&&tP(p)&&c===!0,y=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,k=m.pathname,x=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(k=k.toLowerCase(),x=x?x.toLowerCase():null,y=y.toLowerCase()),x&&C&&(x=si(x,C)||x);const O=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let R=k===y||!a&&k.startsWith(y)&&k.charAt(O)==="/",T=x!=null&&(x===y||!a&&x.startsWith(y)&&x.charAt(y.length)==="/"),A={isActive:R,isPending:T,isTransitioning:S},N=R?n:void 0,I;typeof o=="function"?I=o(A):I=[o,R?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof l=="function"?l(A):l;return F.createElement(XL,La({},h,{"aria-current":N,className:I,ref:r,style:U,to:u,unstable_viewTransition:c}),typeof d=="function"?d(A):d)});var Mh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Mh||(Mh={}));var x_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(x_||(x_={}));function ZL(e){let t=F.useContext(dl);return t||Me(!1),t}function eP(e,t){let{target:r,replace:n,state:i,preventScrollReset:o,relative:a,unstable_viewTransition:l}=t===void 0?{}:t,u=Pk(),c=Ka(),d=Yc(e,{relative:a});return F.useCallback(h=>{if(IL(h,r)){h.preventDefault();let p=n!==void 0?n:ko(c)===ko(d);u(e,{replace:p,state:i,preventScrollReset:o,relative:a,unstable_viewTransition:l})}},[c,u,d,n,i,r,e,o,a,l])}function tP(e,t){t===void 0&&(t={});let r=F.useContext(Bk);r==null&&Me(!1);let{basename:n}=ZL(Mh.useViewTransitionState),i=Yc(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=si(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=si(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Oh(i.pathname,a)!=null||Oh(i.pathname,o)!=null}var zk={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",a=0;at in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t)=>hl(e,"name",{value:t,configurable:!0}),ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uP=(e,t)=>{for(var r in t)hl(e,r,{get:t[r],enumerable:!0})},cP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oP(t))!sP.call(e,i)&&i!==r&&hl(e,i,{get:()=>t[i],enumerable:!(n=iP(t,i))||n.enumerable});return e},fP=(e,t,r)=>(r=e!=null?nP(aP(e)):{},cP(!e||!e.__esModule?hl(r,"default",{value:e,enumerable:!0}):r,e)),he=(e,t,r)=>(lP(e,typeof t!="symbol"?t+"":t,r),r),Br=ne((e,t)=>{var r=D(function(n){return n&&n.Math===Math&&n},"check");t.exports=r(typeof globalThis=="object"&&globalThis)||r(typeof window=="object"&&window)||r(typeof self=="object"&&self)||r(typeof global=="object"&&global)||r(typeof e=="object"&&e)||function(){return this}()||Function("return this")()}),Bn=ne((e,t)=>{t.exports=function(r){try{return!!r()}catch{return!0}}}),Vi=ne((e,t)=>{var r=Bn();t.exports=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})}),Fk=ne((e,t)=>{var r=Bn();t.exports=!r(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")})}),cg=ne((e,t)=>{var r=Fk(),n=Function.prototype.call;t.exports=r?n.bind(n):function(){return n.apply(n,arguments)}}),dP=ne(e=>{var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!t.call({1:2},1);e.f=n?D(function(i){var o=r(this,i);return!!o&&o.enumerable},"propertyIsEnumerable"):t}),Kk=ne((e,t)=>{t.exports=function(r,n){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:n}}}),zr=ne((e,t)=>{var r=Fk(),n=Function.prototype,i=n.call,o=r&&n.bind.bind(i,i);t.exports=r?o:function(a){return function(){return i.apply(a,arguments)}}}),jk=ne((e,t)=>{var r=zr(),n=r({}.toString),i=r("".slice);t.exports=function(o){return i(n(o),8,-1)}}),pP=ne((e,t)=>{var r=zr(),n=Bn(),i=jk(),o=Object,a=r("".split);t.exports=n(function(){return!o("z").propertyIsEnumerable(0)})?function(l){return i(l)==="String"?a(l,""):o(l)}:o}),Uk=ne((e,t)=>{t.exports=function(r){return r==null}}),Wk=ne((e,t)=>{var r=Uk(),n=TypeError;t.exports=function(i){if(r(i))throw new n("Can't call method on "+i);return i}}),vl=ne((e,t)=>{var r=pP(),n=Wk();t.exports=function(i){return r(n(i))}}),yn=ne((e,t)=>{var r=typeof document=="object"&&document.all;t.exports=typeof r>"u"&&r!==void 0?function(n){return typeof n=="function"||n===r}:function(n){return typeof n=="function"}}),gl=ne((e,t)=>{var r=yn();t.exports=function(n){return typeof n=="object"?n!==null:r(n)}}),fg=ne((e,t)=>{var r=Br(),n=yn(),i=D(function(o){return n(o)?o:void 0},"aFunction");t.exports=function(o,a){return arguments.length<2?i(r[o]):r[o]&&r[o][a]}}),hP=ne((e,t)=>{var r=zr();t.exports=r({}.isPrototypeOf)}),Qc=ne((e,t)=>{var r=Br(),n=r.navigator,i=n&&n.userAgent;t.exports=i?String(i):""}),Hk=ne((e,t)=>{var r=Br(),n=Qc(),i=r.process,o=r.Deno,a=i&&i.versions||o&&o.version,l=a&&a.v8,u,c;l&&(u=l.split("."),c=u[0]>0&&u[0]<4?1:+(u[0]+u[1])),!c&&n&&(u=n.match(/Edge\/(\d+)/),(!u||u[1]>=74)&&(u=n.match(/Chrome\/(\d+)/),u&&(c=+u[1]))),t.exports=c}),Vk=ne((e,t)=>{var r=Hk(),n=Bn(),i=Br(),o=i.String;t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var a=Symbol("symbol detection");return!o(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),qk=ne((e,t)=>{var r=Vk();t.exports=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),Gk=ne((e,t)=>{var r=fg(),n=yn(),i=hP(),o=qk(),a=Object;t.exports=o?function(l){return typeof l=="symbol"}:function(l){var u=r("Symbol");return n(u)&&i(u.prototype,a(l))}}),Yk=ne((e,t)=>{var r=String;t.exports=function(n){try{return r(n)}catch{return"Object"}}}),dg=ne((e,t)=>{var r=yn(),n=Yk(),i=TypeError;t.exports=function(o){if(r(o))return o;throw new i(n(o)+" is not a function")}}),vP=ne((e,t)=>{var r=dg(),n=Uk();t.exports=function(i,o){var a=i[o];return n(a)?void 0:r(a)}}),gP=ne((e,t)=>{var r=cg(),n=yn(),i=gl(),o=TypeError;t.exports=function(a,l){var u,c;if(l==="string"&&n(u=a.toString)&&!i(c=r(u,a))||n(u=a.valueOf)&&!i(c=r(u,a))||l!=="string"&&n(u=a.toString)&&!i(c=r(u,a)))return c;throw new o("Can't convert object to primitive value")}}),mP=ne((e,t)=>{t.exports=!1}),pg=ne((e,t)=>{var r=Br(),n=Object.defineProperty;t.exports=function(i,o){try{n(r,i,{value:o,configurable:!0,writable:!0})}catch{r[i]=o}return o}}),hg=ne((e,t)=>{var r=mP(),n=Br(),i=pg(),o="__core-js_shared__",a=t.exports=n[o]||i(o,{});(a.versions||(a.versions=[])).push({version:"3.38.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),Qk=ne((e,t)=>{var r=hg();t.exports=function(n,i){return r[n]||(r[n]=i||{})}}),Xk=ne((e,t)=>{var r=Wk(),n=Object;t.exports=function(i){return n(r(i))}}),Co=ne((e,t)=>{var r=zr(),n=Xk(),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||D(function(o,a){return i(n(o),a)},"hasOwn")}),Jk=ne((e,t)=>{var r=zr(),n=0,i=Math.random(),o=r(1 .toString);t.exports=function(a){return"Symbol("+(a===void 0?"":a)+")_"+o(++n+i,36)}}),Xc=ne((e,t)=>{var r=Br(),n=Qk(),i=Co(),o=Jk(),a=Vk(),l=qk(),u=r.Symbol,c=n("wks"),d=l?u.for||u:u&&u.withoutSetter||o;t.exports=function(h){return i(c,h)||(c[h]=a&&i(u,h)?u[h]:d("Symbol."+h)),c[h]}}),yP=ne((e,t)=>{var r=cg(),n=gl(),i=Gk(),o=vP(),a=gP(),l=Xc(),u=TypeError,c=l("toPrimitive");t.exports=function(d,h){if(!n(d)||i(d))return d;var p=o(d,c),m;if(p){if(h===void 0&&(h="default"),m=r(p,d,h),!n(m)||i(m))return m;throw new u("Can't convert object to primitive value")}return h===void 0&&(h="number"),a(d,h)}}),Zk=ne((e,t)=>{var r=yP(),n=Gk();t.exports=function(i){var o=r(i,"string");return n(o)?o:o+""}}),eE=ne((e,t)=>{var r=Br(),n=gl(),i=r.document,o=n(i)&&n(i.createElement);t.exports=function(a){return o?i.createElement(a):{}}}),tE=ne((e,t)=>{var r=Vi(),n=Bn(),i=eE();t.exports=!r&&!n(function(){return Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a!==7})}),rE=ne(e=>{var t=Vi(),r=cg(),n=dP(),i=Kk(),o=vl(),a=Zk(),l=Co(),u=tE(),c=Object.getOwnPropertyDescriptor;e.f=t?c:D(function(d,h){if(d=o(d),h=a(h),u)try{return c(d,h)}catch{}if(l(d,h))return i(!r(n.f,d,h),d[h])},"getOwnPropertyDescriptor")}),nE=ne((e,t)=>{var r=Vi(),n=Bn();t.exports=r&&n(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})}),Jc=ne((e,t)=>{var r=gl(),n=String,i=TypeError;t.exports=function(o){if(r(o))return o;throw new i(n(o)+" is not an object")}}),ml=ne(e=>{var t=Vi(),r=tE(),n=nE(),i=Jc(),o=Zk(),a=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",d="configurable",h="writable";e.f=t?n?D(function(p,m,g){if(i(p),m=o(m),i(g),typeof p=="function"&&m==="prototype"&&"value"in g&&h in g&&!g[h]){var w=u(p,m);w&&w[h]&&(p[m]=g.value,g={configurable:d in g?g[d]:w[d],enumerable:c in g?g[c]:w[c],writable:!1})}return l(p,m,g)},"defineProperty"):l:D(function(p,m,g){if(i(p),m=o(m),i(g),r)try{return l(p,m,g)}catch{}if("get"in g||"set"in g)throw new a("Accessors not supported");return"value"in g&&(p[m]=g.value),p},"defineProperty")}),iE=ne((e,t)=>{var r=Vi(),n=ml(),i=Kk();t.exports=r?function(o,a,l){return n.f(o,a,i(1,l))}:function(o,a,l){return o[a]=l,o}}),_P=ne((e,t)=>{var r=Vi(),n=Co(),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,a=n(i,"name"),l=a&&D(function(){},"something").name==="something",u=a&&(!r||r&&o(i,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}}),wP=ne((e,t)=>{var r=zr(),n=yn(),i=hg(),o=r(Function.toString);n(i.inspectSource)||(i.inspectSource=function(a){return o(a)}),t.exports=i.inspectSource}),SP=ne((e,t)=>{var r=Br(),n=yn(),i=r.WeakMap;t.exports=n(i)&&/native code/.test(String(i))}),oE=ne((e,t)=>{var r=Qk(),n=Jk(),i=r("keys");t.exports=function(o){return i[o]||(i[o]=n(o))}}),vg=ne((e,t)=>{t.exports={}}),kP=ne((e,t)=>{var r=SP(),n=Br(),i=gl(),o=iE(),a=Co(),l=hg(),u=oE(),c=vg(),d="Object already initialized",h=n.TypeError,p=n.WeakMap,m,g,w,C=D(function(x){return w(x)?g(x):m(x,{})},"enforce"),S=D(function(x){return function(O){var R;if(!i(O)||(R=g(O)).type!==x)throw new h("Incompatible receiver, "+x+" required");return R}},"getterFor");r||l.state?(y=l.state||(l.state=new p),y.get=y.get,y.has=y.has,y.set=y.set,m=D(function(x,O){if(y.has(x))throw new h(d);return O.facade=x,y.set(x,O),O},"set"),g=D(function(x){return y.get(x)||{}},"get"),w=D(function(x){return y.has(x)},"has")):(k=u("state"),c[k]=!0,m=D(function(x,O){if(a(x,k))throw new h(d);return O.facade=x,o(x,k,O),O},"set"),g=D(function(x){return a(x,k)?x[k]:{}},"get"),w=D(function(x){return a(x,k)},"has"));var y,k;t.exports={set:m,get:g,has:w,enforce:C,getterFor:S}}),EP=ne((e,t)=>{var r=zr(),n=Bn(),i=yn(),o=Co(),a=Vi(),l=_P().CONFIGURABLE,u=wP(),c=kP(),d=c.enforce,h=c.get,p=String,m=Object.defineProperty,g=r("".slice),w=r("".replace),C=r([].join),S=a&&!n(function(){return m(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),k=t.exports=function(x,O,R){g(p(O),0,7)==="Symbol("&&(O="["+w(p(O),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),R&&R.getter&&(O="get "+O),R&&R.setter&&(O="set "+O),(!o(x,"name")||l&&x.name!==O)&&(a?m(x,"name",{value:O,configurable:!0}):x.name=O),S&&R&&o(R,"arity")&&x.length!==R.arity&&m(x,"length",{value:R.arity});try{R&&o(R,"constructor")&&R.constructor?a&&m(x,"prototype",{writable:!1}):x.prototype&&(x.prototype=void 0)}catch{}var T=d(x);return o(T,"source")||(T.source=C(y,typeof O=="string"?O:"")),x};Function.prototype.toString=k(D(function(){return i(this)&&h(this).source||u(this)},"toString"),"toString")}),xP=ne((e,t)=>{var r=yn(),n=ml(),i=EP(),o=pg();t.exports=function(a,l,u,c){c||(c={});var d=c.enumerable,h=c.name!==void 0?c.name:l;if(r(u)&&i(u,h,c),c.global)d?a[l]=u:o(l,u);else{try{c.unsafe?a[l]&&(d=!0):delete a[l]}catch{}d?a[l]=u:n.f(a,l,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return a}}),CP=ne((e,t)=>{var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||D(function(i){var o=+i;return(o>0?n:r)(o)},"trunc")}),aE=ne((e,t)=>{var r=CP();t.exports=function(n){var i=+n;return i!==i||i===0?0:r(i)}}),TP=ne((e,t)=>{var r=aE(),n=Math.max,i=Math.min;t.exports=function(o,a){var l=r(o);return l<0?n(l+a,0):i(l,a)}}),bP=ne((e,t)=>{var r=aE(),n=Math.min;t.exports=function(i){var o=r(i);return o>0?n(o,9007199254740991):0}}),gg=ne((e,t)=>{var r=bP();t.exports=function(n){return r(n.length)}}),OP=ne((e,t)=>{var r=vl(),n=TP(),i=gg(),o=D(function(a){return function(l,u,c){var d=r(l),h=i(d);if(h===0)return!a&&-1;var p=n(c,h),m;if(a&&u!==u){for(;h>p;)if(m=d[p++],m!==m)return!0}else for(;h>p;p++)if((a||p in d)&&d[p]===u)return a||p||0;return!a&&-1}},"createMethod");t.exports={includes:o(!0),indexOf:o(!1)}}),sE=ne((e,t)=>{var r=zr(),n=Co(),i=vl(),o=OP().indexOf,a=vg(),l=r([].push);t.exports=function(u,c){var d=i(u),h=0,p=[],m;for(m in d)!n(a,m)&&n(d,m)&&l(p,m);for(;c.length>h;)n(d,m=c[h++])&&(~o(p,m)||l(p,m));return p}}),mg=ne((e,t)=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),DP=ne(e=>{var t=sE(),r=mg(),n=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||D(function(i){return t(i,n)},"getOwnPropertyNames")}),$P=ne(e=>{e.f=Object.getOwnPropertySymbols}),RP=ne((e,t)=>{var r=fg(),n=zr(),i=DP(),o=$P(),a=Jc(),l=n([].concat);t.exports=r("Reflect","ownKeys")||D(function(u){var c=i.f(a(u)),d=o.f;return d?l(c,d(u)):c},"ownKeys")}),MP=ne((e,t)=>{var r=Co(),n=RP(),i=rE(),o=ml();t.exports=function(a,l,u){for(var c=n(l),d=o.f,h=i.f,p=0;p{var r=Bn(),n=yn(),i=/#|\.prototype\./,o=D(function(d,h){var p=l[a(d)];return p===c?!0:p===u?!1:n(h)?r(h):!!h},"isForced"),a=o.normalize=function(d){return String(d).replace(i,".").toLowerCase()},l=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o}),lE=ne((e,t)=>{var r=Br(),n=rE().f,i=iE(),o=xP(),a=pg(),l=MP(),u=LP();t.exports=function(c,d){var h=c.target,p=c.global,m=c.stat,g,w,C,S,y,k;if(p?w=r:m?w=r[h]||a(h,{}):w=r[h]&&r[h].prototype,w)for(C in d){if(y=d[C],c.dontCallGetSet?(k=n(w,C),S=k&&k.value):S=w[C],g=u(p?C:h+(m?".":"#")+C,c.forced),!g&&S!==void 0){if(typeof y==typeof S)continue;l(y,S)}(c.sham||S&&S.sham)&&i(y,"sham",!0),o(w,C,y,c)}}}),PP=ne((e,t)=>{var r=Yk(),n=TypeError;t.exports=function(i,o){if(!delete i[o])throw new n("Cannot delete property "+r(o)+" of "+r(i))}}),IP=ne((e,t)=>{var r=Xc(),n=r("toStringTag"),i={};i[n]="z",t.exports=String(i)==="[object z]"}),NP=ne((e,t)=>{var r=IP(),n=yn(),i=jk(),o=Xc(),a=o("toStringTag"),l=Object,u=i(function(){return arguments}())==="Arguments",c=D(function(d,h){try{return d[h]}catch{}},"tryGet");t.exports=r?i:function(d){var h,p,m;return d===void 0?"Undefined":d===null?"Null":typeof(p=c(h=l(d),a))=="string"?p:u?i(h):(m=i(h))==="Object"&&n(h.callee)?"Arguments":m}}),AP=ne((e,t)=>{var r=NP(),n=String;t.exports=function(i){if(r(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return n(i)}}),BP=ne((e,t)=>{var r=zr();t.exports=r([].slice)}),zP=ne((e,t)=>{var r=BP(),n=Math.floor,i=D(function(o,a){var l=o.length;if(l<8)for(var u=1,c,d;u0;)o[d]=o[--d];d!==u++&&(o[d]=c)}else for(var h=n(l/2),p=i(r(o,0,h),a),m=i(r(o,h),a),g=p.length,w=m.length,C=0,S=0;C{var r=Bn();t.exports=function(n,i){var o=[][n];return!!o&&r(function(){o.call(null,i||function(){return 1},1)})}}),KP=ne((e,t)=>{var r=Qc(),n=r.match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]}),jP=ne((e,t)=>{var r=Qc();t.exports=/MSIE|Trident/.test(r)}),UP=ne((e,t)=>{var r=Qc(),n=r.match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]}),WP=ne(()=>{var e=lE(),t=zr(),r=dg(),n=Xk(),i=gg(),o=PP(),a=AP(),l=Bn(),u=zP(),c=FP(),d=KP(),h=jP(),p=Hk(),m=UP(),g=[],w=t(g.sort),C=t(g.push),S=l(function(){g.sort(void 0)}),y=l(function(){g.sort(null)}),k=c("sort"),x=!l(function(){if(p)return p<70;if(!(d&&d>3)){if(h)return!0;if(m)return m<603;var T="",A,N,I,U;for(A=65;A<76;A++){switch(N=String.fromCharCode(A),A){case 66:case 69:case 70:case 72:I=3;break;case 68:case 71:I=4;break;default:I=2}for(U=0;U<47;U++)g.push({k:N+U,v:I})}for(g.sort(function(q,G){return G.v-q.v}),U=0;Ua(N)?1:-1}},"getSortCompare");e({target:"Array",proto:!0,forced:O},{sort:D(function(T){T!==void 0&&r(T);var A=n(this);if(x)return T===void 0?w(A):w(A,T);var N=[],I=i(A),U,q;for(q=0;q{var r=gg();t.exports=function(n,i,o){for(var a=0,l=arguments.length>2?o:r(i),u=new n(l);l>a;)u[a]=i[a++];return u}}),VP=ne((e,t)=>{var r=Br();t.exports=function(n,i){var o=r[n],a=o&&o.prototype;return a&&a[i]}}),qP=ne((e,t)=>{var r=sE(),n=mg();t.exports=Object.keys||D(function(i){return r(i,n)},"keys")}),GP=ne(e=>{var t=Vi(),r=nE(),n=ml(),i=Jc(),o=vl(),a=qP();e.f=t&&!r?Object.defineProperties:D(function(l,u){i(l);for(var c=o(u),d=a(u),h=d.length,p=0,m;h>p;)n.f(l,m=d[p++],c[m]);return l},"defineProperties")}),YP=ne((e,t)=>{var r=fg();t.exports=r("document","documentElement")}),QP=ne((e,t)=>{var r=Jc(),n=GP(),i=mg(),o=vg(),a=YP(),l=eE(),u=oE(),c=">",d="<",h="prototype",p="script",m=u("IE_PROTO"),g=D(function(){},"EmptyConstructor"),w=D(function(x){return d+p+c+x+d+"/"+p+c},"scriptTag"),C=D(function(x){x.write(w("")),x.close();var O=x.parentWindow.Object;return x=null,O},"NullProtoObjectViaActiveX"),S=D(function(){var x=l("iframe"),O="java"+p+":",R;return x.style.display="none",a.appendChild(x),x.src=String(O),R=x.contentWindow.document,R.open(),R.write(w("document.F=Object")),R.close(),R.F},"NullProtoObjectViaIFrame"),y,k=D(function(){try{y=new ActiveXObject("htmlfile")}catch{}k=typeof document<"u"?document.domain&&y?C(y):S():C(y);for(var x=i.length;x--;)delete k[h][i[x]];return k()},"NullProtoObject");o[m]=!0,t.exports=Object.create||D(function(x,O){var R;return x!==null?(g[h]=r(x),R=new g,g[h]=null,R[m]=x):R=k(),O===void 0?R:n.f(R,O)},"create")}),XP=ne((e,t)=>{var r=Xc(),n=QP(),i=ml().f,o=r("unscopables"),a=Array.prototype;a[o]===void 0&&i(a,o,{configurable:!0,value:n(null)}),t.exports=function(l){a[o][l]=!0}}),uE=ne(()=>{var e=lE(),t=zr(),r=dg(),n=vl(),i=HP(),o=VP(),a=XP(),l=Array,u=t(o("Array","sort"));e({target:"Array",proto:!0},{toSorted:D(function(c){c!==void 0&&r(c);var d=n(this),h=i(l,d);return u(h,c)},"toSorted")}),a("toSorted")}),JP=ne((e,t)=>{var r=Br(),n=zr();t.exports=function(i,o){return n(r[i].prototype[o])}}),ZP=ne((e,t)=>{WP(),uE();var r=JP();t.exports=r("Array","toSorted")}),eI=ne((e,t)=>{var r=ZP();t.exports=r}),tI=ne(()=>{uE()}),rI=ne((e,t)=>{var r=eI();tI(),t.exports=r});fP(rI());var nI={};uP(nI,{AlbertTokenizer:()=>Bx,AutoTokenizer:()=>Cg,BartTokenizer:()=>dC,BertTokenizer:()=>Nx,BlenderbotSmallTokenizer:()=>oT,BlenderbotTokenizer:()=>nT,BloomTokenizer:()=>_C,CLIPTokenizer:()=>YC,CamembertTokenizer:()=>rC,CodeGenTokenizer:()=>qC,CodeLlamaTokenizer:()=>EC,CohereTokenizer:()=>pT,ConvBertTokenizer:()=>Qx,DebertaTokenizer:()=>Wx,DebertaV2Tokenizer:()=>Vx,DistilBertTokenizer:()=>eC,ElectraTokenizer:()=>aC,EsmTokenizer:()=>LC,FalconTokenizer:()=>DC,GPT2Tokenizer:()=>cC,GPTNeoXTokenizer:()=>RC,GemmaTokenizer:()=>AC,Grok1Tokenizer:()=>zC,HerbertTokenizer:()=>Gx,LlamaTokenizer:()=>SC,M2M100Tokenizer:()=>UC,MBart50Tokenizer:()=>vC,MBartTokenizer:()=>xg,MPNetTokenizer:()=>bC,MarianTokenizer:()=>ZC,MobileBertTokenizer:()=>Fx,NllbTokenizer:()=>KC,NougatTokenizer:()=>uT,PreTrainedTokenizer:()=>Se,Qwen2Tokenizer:()=>IC,RoFormerTokenizer:()=>Jx,RobertaTokenizer:()=>mC,SiglipTokenizer:()=>XC,SpeechT5Tokenizer:()=>sT,SqueezeBertTokenizer:()=>jx,T5Tokenizer:()=>lC,TokenizerModel:()=>Wa,VitsTokenizer:()=>fT,Wav2Vec2CTCTokenizer:()=>tT,WhisperTokenizer:()=>HC,XLMRobertaTokenizer:()=>CC,XLMTokenizer:()=>iC,is_chinese_char:()=>Eg});var cd,ja=(cd=class{constructor(){let e=D(function(...t){return e._call(...t)},"closure");return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error("Must implement _call method in subclass")}},D(cd,"Callable"),cd);function cE(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[r,t]))}D(cE,"reverseDictionary");function yg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}D(yg,"escapeRegExp");function fE(e){return Number.isInteger(e)||typeof e=="bigint"}D(fE,"isIntegralNumber");function Jt(...e){return Array.prototype.concat.apply([],e)}D(Jt,"mergeArrays");async function dE(e,t,r=!0,n={}){if(e.startsWith("http"))return fetch(e+t).then(i=>{if(!i.ok){if(r)throw new Error(`File not found at ${e}${t}`);return null}return i.arrayBuffer()});throw new Error("Filesystem not supported, please implement your own file reading logic.")}D(dE,"getModelFile");async function Lh(e,t,r=!0,n={}){let i=await dE(e,t,r,n);if(i===null)return{};let o=new TextDecoder("utf-8").decode(i);return JSON.parse(o)}D(Lh,"getModelJSON");function pE(e){if(e.length===0)throw Error("Array must not be empty");let t=e[0],r=0;for(let n=1;nt&&(t=e[n],r=n);return[Number(t),r]}D(hE,"max");function Ss(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}D(Ss,"round");var vE=class extends Error{constructor(t){super(t)}};D(vE,"TensorError");var iI=vE,gE=class{constructor(...t){throw new iI("You seem to be creating a tensor object. Unfortunately, the '@lenml/tokenizers' library does not support returning any ONNX-related object instances. Please try setting 'return_tensor=false' to avoid this error")}};D(gE,"Tensor");var Fu=gE,mE=class{constructor(t=(n,i)=>n>i,r=1/0){this._heap=[],this._comparator=t,this._maxSize=r}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...t){return this.extend(t)}extend(t){for(let r of t)if(this.size0&&this._swap(0,r),this._heap.pop(),this._siftDown(),t}replace(t){let r=this.peek();return this._heap[0]=t,this._siftDown(),r}_parent(t){return(t+1>>>1)-1}_left(t){return(t<<1)+1}_right(t){return t+1<<1}_greater(t,r){return this._comparator(this._heap[t],this._heap[r])}_swap(t,r){let n=this._heap[t];this._heap[t]=this._heap[r],this._heap[r]=n}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(t){for(;t>0&&this._greater(t,this._parent(t));)this._swap(t,this._parent(t)),t=this._parent(t)}_siftDown(){let t=0;for(;this._left(t)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);let i=new fd(this.bosTokenId,0,0,0,0),o=new fd(this.eosTokenId,1,this.len,0,0);this.nodes.push(i.clone()),this.nodes.push(o.clone()),this.beginNodes[this.len].push(o),this.endNodes[0].push(i)}insert(t,r,n,i){let o=this.nodes.length,a=new fd(i,o,t,r,n);this.beginNodes[t].push(a),this.endNodes[t+r].push(a),this.nodes.push(a)}viterbi(){let t=this.len,r=0;for(;r<=t;){if(this.beginNodes[r].length==0)return[];for(let a of this.beginNodes[r]){a.prev=null;let l=0,u=null;for(let c of this.endNodes[r]){let d=c.backtraceScore+a.score;(u===null||d>l)&&(u=c.clone(),l=d)}if(u!==null)a.prev=u,a.backtraceScore=l;else return[]}++r}let n=[],i=this.beginNodes[t][0].prev;if(i===null)return[];let o=i.clone();for(;o.prev!==null;)n.push(o.clone()),o=o.clone().prev.clone();return n.reverse(),n}piece(t){return this.sentence.slice(t.pos,t.pos+t.length)}tokens(){return this.viterbi().map(t=>this.piece(t))}tokenIds(){return this.viterbi().map(t=>t.tokenId)}};D(SE,"TokenLattice");var sI=SE,kE=class EE{constructor(t,r,n,i,o){this.tokenId=t,this.nodeId=r,this.pos=n,this.length=i,this.score=o,this.prev=null,this.backtraceScore=0}clone(){let t=new EE(this.tokenId,this.nodeId,this.pos,this.length,this.score);return t.prev=this.prev,t.backtraceScore=this.backtraceScore,t}};D(kE,"TokenLatticeNode");var fd=kE,j=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator"}),T_=Object.freeze({set:j.Set,for:j.For,in:j.In,is:j.Is,if:j.If,else:j.Else,endif:j.EndIf,elif:j.ElseIf,endfor:j.EndFor,and:j.And,or:j.Or,not:j.Not,"not in":j.NotIn,true:j.BooleanLiteral,false:j.BooleanLiteral}),dd,Xi=(dd=class{constructor(e,t){this.value=e,this.type=t}},D(dd,"Token"),dd);function Ph(e){return/\w/.test(e)}D(Ph,"isWord");function Ku(e){return/[0-9]/.test(e)}D(Ku,"isInteger");var lI=[["{%",j.OpenStatement],["%}",j.CloseStatement],["{{",j.OpenExpression],["}}",j.CloseExpression],["(",j.OpenParen],[")",j.CloseParen],["{",j.OpenCurlyBracket],["}",j.CloseCurlyBracket],["[",j.OpenSquareBracket],["]",j.CloseSquareBracket],[",",j.Comma],[".",j.Dot],[":",j.Colon],["|",j.Pipe],["<=",j.ComparisonBinaryOperator],[">=",j.ComparisonBinaryOperator],["==",j.ComparisonBinaryOperator],["!=",j.ComparisonBinaryOperator],["<",j.ComparisonBinaryOperator],[">",j.ComparisonBinaryOperator],["+",j.AdditiveBinaryOperator],["-",j.AdditiveBinaryOperator],["*",j.MultiplicativeBinaryOperator],["/",j.MultiplicativeBinaryOperator],["%",j.MultiplicativeBinaryOperator],["=",j.Equals]],uI=new Map([["n",` +`],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function xE(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,"{##}"),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,"$1")),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,"$1")),e.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}D(xE,"preprocess");function CE(e,t={}){var a,l,u;let r=[],n=xE(e,t),i=0,o=D(c=>{let d="";for(;c(n[i]);){if(n[i]==="\\"){if(++i,i>=n.length)throw new SyntaxError("Unexpected end of input");let h=n[i++],p=uI.get(h);if(p===void 0)throw new SyntaxError(`Unexpected escaped character: ${h}`);d+=p;continue}if(d+=n[i++],i>=n.length)throw new SyntaxError("Unexpected end of input")}return d},"consumeWhile");e:for(;i0){r.push(new Xi(h,j.Text));continue}}o(h=>/\s/.test(h));let d=n[i];if(d==="-"||d==="+"){let h=(l=r.at(-1))==null?void 0:l.type;if(h===j.Text||h===void 0)throw new SyntaxError(`Unexpected character: ${d}`);switch(h){case j.Identifier:case j.NumericLiteral:case j.BooleanLiteral:case j.StringLiteral:case j.CloseParen:case j.CloseSquareBracket:break;default:{++i;let p=o(Ku);r.push(new Xi(`${d}${p}`,p.length>0?j.NumericLiteral:j.UnaryOperator));continue}}}for(let[h,p]of lI)if(n.slice(i,i+h.length)===h){r.push(new Xi(h,p)),i+=h.length;continue e}if(d==="'"||d==='"'){++i;let h=o(p=>p!==d);r.push(new Xi(h,j.StringLiteral)),++i;continue}if(Ku(d)){let h=o(Ku);r.push(new Xi(h,j.NumericLiteral));continue}if(Ph(d)){let h=o(Ph),p=Object.hasOwn(T_,h)?T_[h]:j.Identifier;p===j.In&&((u=r.at(-1))==null?void 0:u.type)===j.Not?(r.pop(),r.push(new Xi("not in",j.NotIn))):r.push(new Xi(h,p));continue}throw new SyntaxError(`Unexpected character: ${d}`)}return r}D(CE,"tokenize");var pd,yl=(pd=class{constructor(){he(this,"type","Statement")}},D(pd,"Statement"),pd),hd,cI=(hd=class extends yl{constructor(e){super(),he(this,"type","Program"),this.body=e}},D(hd,"Program"),hd),vd,b_=(vd=class extends yl{constructor(e,t,r){super(),he(this,"type","If"),this.test=e,this.body=t,this.alternate=r}},D(vd,"If"),vd),gd,fI=(gd=class extends yl{constructor(e,t,r){super(),he(this,"type","For"),this.loopvar=e,this.iterable=t,this.body=r}},D(gd,"For"),gd),md,dI=(md=class extends yl{constructor(e,t){super(),he(this,"type","Set"),this.assignee=e,this.value=t}},D(md,"SetStatement"),md),yd,zn=(yd=class extends yl{constructor(){super(...arguments),he(this,"type","Expression")}},D(yd,"Expression"),yd),_d,pI=(_d=class extends zn{constructor(e,t,r){super(),he(this,"type","MemberExpression"),this.object=e,this.property=t,this.computed=r}},D(_d,"MemberExpression"),_d),wd,hI=(wd=class extends zn{constructor(e,t){super(),he(this,"type","CallExpression"),this.callee=e,this.args=t}},D(wd,"CallExpression"),wd),Sd,Wo=(Sd=class extends zn{constructor(e){super(),he(this,"type","Identifier"),this.value=e}},D(Sd,"Identifier"),Sd),kd,Ua=(kd=class extends zn{constructor(e){super(),he(this,"type","Literal"),this.value=e}},D(kd,"Literal"),kd),Ed,vI=(Ed=class extends Ua{constructor(){super(...arguments),he(this,"type","NumericLiteral")}},D(Ed,"NumericLiteral"),Ed),xd,O_=(xd=class extends Ua{constructor(){super(...arguments),he(this,"type","StringLiteral")}},D(xd,"StringLiteral"),xd),Cd,D_=(Cd=class extends Ua{constructor(){super(...arguments),he(this,"type","BooleanLiteral")}},D(Cd,"BooleanLiteral"),Cd),Td,gI=(Td=class extends Ua{constructor(){super(...arguments),he(this,"type","ArrayLiteral")}},D(Td,"ArrayLiteral"),Td),bd,$_=(bd=class extends Ua{constructor(){super(...arguments),he(this,"type","TupleLiteral")}},D(bd,"TupleLiteral"),bd),Od,mI=(Od=class extends Ua{constructor(){super(...arguments),he(this,"type","ObjectLiteral")}},D(Od,"ObjectLiteral"),Od),Dd,as=(Dd=class extends zn{constructor(e,t,r){super(),he(this,"type","BinaryExpression"),this.operator=e,this.left=t,this.right=r}},D(Dd,"BinaryExpression"),Dd),$d,yI=($d=class extends zn{constructor(e,t){super(),he(this,"type","FilterExpression"),this.operand=e,this.filter=t}},D($d,"FilterExpression"),$d),Rd,_I=(Rd=class extends zn{constructor(e,t,r){super(),he(this,"type","TestExpression"),this.operand=e,this.negate=t,this.test=r}},D(Rd,"TestExpression"),Rd),Md,wI=(Md=class extends zn{constructor(e,t){super(),he(this,"type","UnaryExpression"),this.operator=e,this.argument=t}},D(Md,"UnaryExpression"),Md),Ld,SI=(Ld=class extends zn{constructor(e=void 0,t=void 0,r=void 0){super(),he(this,"type","SliceExpression"),this.start=e,this.stop=t,this.step=r}},D(Ld,"SliceExpression"),Ld),Pd,kI=(Pd=class extends zn{constructor(e,t){super(),he(this,"type","KeywordArgumentExpression"),this.key=e,this.value=t}},D(Pd,"KeywordArgumentExpression"),Pd);function TE(e){let t=new cI([]),r=0;function n(P,V){let X=e[r++];if(!X||X.type!==P)throw new Error(`Parser Error: ${V}. ${X.type} !== ${P}.`);return X}D(n,"expect");function i(){switch(e[r].type){case j.Text:return l();case j.OpenStatement:return u();case j.OpenExpression:return c();default:throw new SyntaxError(`Unexpected token type: ${e[r].type}`)}}D(i,"parseAny");function o(...P){return r+P.length<=e.length&&P.some((V,X)=>V!==e[r+X].type)}D(o,"not");function a(...P){return r+P.length<=e.length&&P.every((V,X)=>V===e[r+X].type)}D(a,"is");function l(){return new O_(n(j.Text,"Expected text token").value)}D(l,"parseText");function u(){n(j.OpenStatement,"Expected opening statement token");let P;switch(e[r].type){case j.Set:++r,P=d(),n(j.CloseStatement,"Expected closing statement token");break;case j.If:++r,P=h(),n(j.OpenStatement,"Expected {% token"),n(j.EndIf,"Expected endif token"),n(j.CloseStatement,"Expected %} token");break;case j.For:++r,P=m(),n(j.OpenStatement,"Expected {% token"),n(j.EndFor,"Expected endfor token"),n(j.CloseStatement,"Expected %} token");break;default:throw new SyntaxError(`Unknown statement type: ${e[r].type}`)}return P}D(u,"parseJinjaStatement");function c(){n(j.OpenExpression,"Expected opening expression token");let P=g();return n(j.CloseExpression,"Expected closing expression token"),P}D(c,"parseJinjaExpression");function d(){let P=g();if(a(j.Equals)){++r;let V=d();return new dI(P,V)}return P}D(d,"parseSetStatement");function h(){var K,ee,te,ie,ae,Fe,Ae,ce;let P=g();n(j.CloseStatement,"Expected closing statement token");let V=[],X=[];for(;!(((K=e[r])==null?void 0:K.type)===j.OpenStatement&&(((ee=e[r+1])==null?void 0:ee.type)===j.ElseIf||((te=e[r+1])==null?void 0:te.type)===j.Else||((ie=e[r+1])==null?void 0:ie.type)===j.EndIf));)V.push(i());if(((ae=e[r])==null?void 0:ae.type)===j.OpenStatement&&((Fe=e[r+1])==null?void 0:Fe.type)!==j.EndIf)if(++r,a(j.ElseIf))n(j.ElseIf,"Expected elseif token"),X.push(h());else for(n(j.Else,"Expected else token"),n(j.CloseStatement,"Expected closing statement token");!(((Ae=e[r])==null?void 0:Ae.type)===j.OpenStatement&&((ce=e[r+1])==null?void 0:ce.type)===j.EndIf);)X.push(i());return new b_(P,V,X)}D(h,"parseIfStatement");function p(P=!1){let V=P?J:g,X=[V()],K=a(j.Comma);for(;K&&(++r,X.push(V()),!!a(j.Comma)););return K?new $_(X):X[0]}D(p,"parseExpressionSequence");function m(){let P=p(!0);if(!(P instanceof Wo||P instanceof $_))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${P.type} instead`);n(j.In,"Expected `in` keyword following loop variable");let V=g();n(j.CloseStatement,"Expected closing statement token");let X=[];for(;o(j.OpenStatement,j.EndFor);)X.push(i());return new fI(P,V,X)}D(m,"parseForStatement");function g(){return w()}D(g,"parseExpression");function w(){let P=C();if(a(j.If)){++r;let V=C();n(j.Else,"Expected else token");let X=C();return new b_(V,[P],[X])}return P}D(w,"parseTernaryExpression");function C(){let P=S();for(;a(j.Or);){let V=e[r];++r;let X=S();P=new as(V,P,X)}return P}D(C,"parseLogicalOrExpression");function S(){let P=y();for(;a(j.And);){let V=e[r];++r;let X=y();P=new as(V,P,X)}return P}D(S,"parseLogicalAndExpression");function y(){let P;for(;a(j.Not);){let V=e[r];++r;let X=y();P=new wI(V,X)}return P??k()}D(y,"parseLogicalNegationExpression");function k(){let P=x();for(;a(j.ComparisonBinaryOperator)||a(j.In)||a(j.NotIn);){let V=e[r];++r;let X=x();P=new as(V,P,X)}return P}D(k,"parseComparisonExpression");function x(){let P=U();for(;a(j.AdditiveBinaryOperator);){let V=e[r];++r;let X=U();P=new as(V,P,X)}return P}D(x,"parseAdditiveExpression");function O(){let P=I();return a(j.OpenParen)?R(P):P}D(O,"parseCallMemberExpression");function R(P){let V=new hI(P,T());return a(j.OpenParen)&&(V=R(V)),V}D(R,"parseCallExpression");function T(){n(j.OpenParen,"Expected opening parenthesis for arguments list");let P=A();return n(j.CloseParen,"Expected closing parenthesis for arguments list"),P}D(T,"parseArgs");function A(){let P=[];for(;!a(j.CloseParen);){let V=g();if(a(j.Equals)){if(++r,!(V instanceof Wo))throw new SyntaxError("Expected identifier for keyword argument");let X=g();V=new kI(V,X)}P.push(V),a(j.Comma)&&++r}return P}D(A,"parseArgumentsList");function N(){let P=[],V=!1;for(;!a(j.CloseSquareBracket);)a(j.Colon)?(P.push(void 0),++r,V=!0):(P.push(g()),a(j.Colon)&&(++r,V=!0));if(P.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(V){if(P.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new SI(...P)}return P[0]}D(N,"parseMemberExpressionArgumentsList");function I(){let P=J();for(;a(j.Dot)||a(j.OpenSquareBracket);){let V=e[r];++r;let X,K=V.type!==j.Dot;if(K)X=N(),n(j.CloseSquareBracket,"Expected closing square bracket");else if(X=J(),X.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");P=new pI(P,X,K)}return P}D(I,"parseMemberExpression");function U(){let P=q();for(;a(j.MultiplicativeBinaryOperator);){let V=e[r];++r;let X=q();P=new as(V,P,X)}return P}D(U,"parseMultiplicativeExpression");function q(){let P=G();for(;a(j.Is);){++r;let V=a(j.Not);V&&++r;let X=J();if(X instanceof D_&&(X=new Wo(X.value.toString())),!(X instanceof Wo))throw new SyntaxError("Expected identifier for the test");P=new _I(P,V,X)}return P}D(q,"parseTestExpression");function G(){let P=O();for(;a(j.Pipe);){++r;let V=J();if(!(V instanceof Wo))throw new SyntaxError("Expected identifier for the filter");a(j.OpenParen)&&(V=R(V)),P=new yI(P,V)}return P}D(G,"parseFilterExpression");function J(){let P=e[r];switch(P.type){case j.NumericLiteral:return++r,new vI(Number(P.value));case j.StringLiteral:return++r,new O_(P.value);case j.BooleanLiteral:return++r,new D_(P.value==="true");case j.Identifier:return++r,new Wo(P.value);case j.OpenParen:{++r;let V=p();if(e[r].type!==j.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${e[r].type} instead`);return++r,V}case j.OpenSquareBracket:{++r;let V=[];for(;!a(j.CloseSquareBracket);)V.push(g()),a(j.Comma)&&++r;return++r,new gI(V)}case j.OpenCurlyBracket:{++r;let V=new Map;for(;!a(j.CloseCurlyBracket);){let X=g();n(j.Colon,"Expected colon between key and value in object literal");let K=g();V.set(X,K),a(j.Comma)&&++r}return++r,new mI(V)}default:throw new SyntaxError(`Unexpected token: ${P.type}`)}}for(D(J,"parsePrimaryExpression");r=0?(t=(t??(t=0))<0?Math.max(e.length+t,0):Math.min(t,e.length),r=(r??(r=e.length))<0?Math.max(e.length+r,0):Math.min(r,e.length)):(t=(t??(t=e.length-1))<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),r=(r??(r=-1))<-1?Math.max(e.length+r,-1):Math.min(r,e.length-1));let o=[];for(let a=t;i*at.toUpperCase())}D(_g,"titleCase");var Id,ci=(Id=class{constructor(e=void 0){he(this,"type","RuntimeValue"),he(this,"value"),he(this,"builtins",new Map),this.value=e}__bool__(){return new $t(!!this.value)}},D(Id,"RuntimeValue"),Id),Nd,ot=(Nd=class extends ci{constructor(){super(...arguments),he(this,"type","NumericValue")}},D(Nd,"NumericValue"),Nd),Ad,je=(Ad=class extends ci{constructor(){super(...arguments),he(this,"type","StringValue"),he(this,"builtins",new Map([["upper",new Jn(()=>new je(this.value.toUpperCase()))],["lower",new Jn(()=>new je(this.value.toLowerCase()))],["strip",new Jn(()=>new je(this.value.trim()))],["title",new Jn(()=>new je(_g(this.value)))],["length",new ot(this.value.length)]]))}},D(Ad,"StringValue"),Ad),Bd,$t=(Bd=class extends ci{constructor(){super(...arguments),he(this,"type","BooleanValue")}},D(Bd,"BooleanValue"),Bd),zd,cn=(zd=class extends ci{constructor(){super(...arguments),he(this,"type","ObjectValue"),he(this,"builtins",new Map([["get",new Jn(([e,t])=>{if(!(e instanceof je))throw new Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new Is})],["items",new Jn(()=>new kt(Array.from(this.value.entries()).map(([e,t])=>new kt([new je(e),t]))))]]))}__bool__(){return new $t(this.value.size>0)}},D(zd,"ObjectValue"),zd),Fd,kt=(Fd=class extends ci{constructor(){super(...arguments),he(this,"type","ArrayValue"),he(this,"builtins",new Map([["length",new ot(this.value.length)]]))}__bool__(){return new $t(this.value.length>0)}},D(Fd,"ArrayValue"),Fd),Kd,EI=(Kd=class extends kt{constructor(){super(...arguments),he(this,"type","TupleValue")}},D(Kd,"TupleValue"),Kd),jd,Jn=(jd=class extends ci{constructor(){super(...arguments),he(this,"type","FunctionValue")}},D(jd,"FunctionValue"),jd),Ud,Is=(Ud=class extends ci{constructor(){super(...arguments),he(this,"type","NullValue")}},D(Ud,"NullValue"),Ud),Wd,ln=(Wd=class extends ci{constructor(){super(...arguments),he(this,"type","UndefinedValue")}},D(Wd,"UndefinedValue"),Wd),Hd,Nh=(Hd=class{constructor(e){he(this,"variables",new Map([["namespace",new Jn(t=>{if(t.length===0)return new cn(new Map);if(t.length!==1||!(t[0]instanceof cn))throw new Error("`namespace` expects either zero arguments or a single object argument");return t[0]})]])),he(this,"tests",new Map([["boolean",t=>t.type==="BooleanValue"],["callable",t=>t instanceof Jn],["odd",t=>{if(t.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${t.type}`);return t.value%2!==0}],["even",t=>{if(t.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${t.type}`);return t.value%2===0}],["false",t=>t.type==="BooleanValue"&&!t.value],["true",t=>t.type==="BooleanValue"&&t.value],["number",t=>t.type==="NumericValue"],["integer",t=>t.type==="NumericValue"&&Number.isInteger(t.value)],["iterable",t=>t instanceof kt||t instanceof je],["lower",t=>{let r=t.value;return t.type==="StringValue"&&r===r.toLowerCase()}],["upper",t=>{let r=t.value;return t.type==="StringValue"&&r===r.toUpperCase()}],["none",t=>t.type==="NullValue"],["defined",t=>t.type!=="UndefinedValue"],["undefined",t=>t.type==="UndefinedValue"],["equalto",(t,r)=>t.value===r.value]])),this.parent=e}set(e,t){return this.declareVariable(e,Ns(t))}declareVariable(e,t){if(this.variables.has(e))throw new SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw new Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new ln}catch{return new ln}}},D(Hd,"Environment"),Hd),Vd,xI=(Vd=class{constructor(e){he(this,"global"),this.global=e??new Nh}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let r=this.evaluate(e.left,t);switch(e.operator.value){case"and":return r.__bool__().value?this.evaluate(e.right,t):r;case"or":return r.__bool__().value?r:this.evaluate(e.right,t)}let n=this.evaluate(e.right,t);switch(e.operator.value){case"==":return new $t(r.value==n.value);case"!=":return new $t(r.value!=n.value)}if(r instanceof ln||n instanceof ln)throw new Error("Cannot perform operation on undefined values");if(r instanceof Is||n instanceof Is)throw new Error("Cannot perform operation on null values");if(r instanceof ot&&n instanceof ot)switch(e.operator.value){case"+":return new ot(r.value+n.value);case"-":return new ot(r.value-n.value);case"*":return new ot(r.value*n.value);case"/":return new ot(r.value/n.value);case"%":return new ot(r.value%n.value);case"<":return new $t(r.value":return new $t(r.value>n.value);case">=":return new $t(r.value>=n.value);case"<=":return new $t(r.value<=n.value)}else if(r instanceof kt&&n instanceof kt)switch(e.operator.value){case"+":return new kt(r.value.concat(n.value))}else if(n instanceof kt){let i=n.value.find(o=>o.value===r.value)!==void 0;switch(e.operator.value){case"in":return new $t(i);case"not in":return new $t(!i)}}if(r instanceof je||n instanceof je)switch(e.operator.value){case"+":return new je(r.value.toString()+n.value.toString())}if(r instanceof je&&n instanceof je)switch(e.operator.value){case"in":return new $t(n.value.includes(r.value));case"not in":return new $t(!n.value.includes(r.value))}if(r instanceof je&&n instanceof cn)switch(e.operator.value){case"in":return new $t(n.value.has(r.value));case"not in":return new $t(!n.value.has(r.value))}throw new SyntaxError(`Unknown operator "${e.operator.value}" between ${r.type} and ${n.type}`)}evaluateFilterExpression(e,t){let r=this.evaluate(e.operand,t);if(e.filter.type==="Identifier"){let n=e.filter;if(r instanceof kt)switch(n.value){case"list":return r;case"first":return r.value[0];case"last":return r.value[r.value.length-1];case"length":return new ot(r.value.length);case"reverse":return new kt(r.value.reverse());case"sort":return new kt(r.value.sort((i,o)=>{if(i.type!==o.type)throw new Error(`Cannot compare different types: ${i.type} and ${o.type}`);switch(i.type){case"NumericValue":return i.value-o.value;case"StringValue":return i.value.localeCompare(o.value);default:throw new Error(`Cannot compare type: ${i.type}`)}}));default:throw new Error(`Unknown ArrayValue filter: ${n.value}`)}else if(r instanceof je)switch(n.value){case"length":return new ot(r.value.length);case"upper":return new je(r.value.toUpperCase());case"lower":return new je(r.value.toLowerCase());case"title":return new je(_g(r.value));case"capitalize":return new je(r.value.charAt(0).toUpperCase()+r.value.slice(1));case"trim":return new je(r.value.trim());default:throw new Error(`Unknown StringValue filter: ${n.value}`)}else if(r instanceof ot)switch(n.value){case"abs":return new ot(Math.abs(r.value));default:throw new Error(`Unknown NumericValue filter: ${n.value}`)}else if(r instanceof cn)switch(n.value){case"items":return new kt(Array.from(r.value.entries()).map(([i,o])=>new kt([new je(i),o])));case"length":return new ot(r.value.size);default:throw new Error(`Unknown ObjectValue filter: ${n.value}`)}throw new Error(`Cannot apply filter "${n.value}" to type: ${r.type}`)}else if(e.filter.type==="CallExpression"){let n=e.filter;if(n.callee.type!=="Identifier")throw new Error(`Unknown filter: ${n.callee.type}`);let i=n.callee.value;if(r instanceof kt){switch(i){case"selectattr":{if(r.value.some(d=>!(d instanceof cn)))throw new Error("`selectattr` can only be applied to array of objects");if(n.args.some(d=>d.type!=="StringLiteral"))throw new Error("arguments of `selectattr` must be strings");let[o,a,l]=n.args.map(d=>this.evaluate(d,t)),u;if(a){let d=t.tests.get(a.value);if(!d)throw new Error(`Unknown test: ${a.value}`);u=d}else u=D((...d)=>d[0].__bool__().value,"testFunction");let c=r.value.filter(d=>{let h=d.value.get(o.value);return h?u(h,l):!1});return new kt(c)}}throw new Error(`Unknown ArrayValue filter: ${i}`)}else throw new Error(`Cannot apply filter "${i}" to type: ${r.type}`)}throw new Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let r=this.evaluate(e.operand,t),n=t.tests.get(e.test.value);if(!n)throw new Error(`Unknown test: ${e.test.value}`);let i=n(r);return new $t(e.negate?!i:i)}evaluateUnaryExpression(e,t){let r=this.evaluate(e.argument,t);switch(e.operator.value){case"not":return new $t(!r.value);default:throw new SyntaxError(`Unknown operator: ${e.operator.value}`)}}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let r="";for(let n of e){let i=this.evaluate(n,t);i.type!=="NullValue"&&i.type!=="UndefinedValue"&&(r+=i.value)}return new je(r)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let r=[],n=new Map;for(let o of e.args)if(o.type==="KeywordArgumentExpression"){let a=o;n.set(a.key.value,this.evaluate(a.value,t))}else r.push(this.evaluate(o,t));n.size>0&&r.push(new cn(n));let i=this.evaluate(e.callee,t);if(i.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(r,t)}evaluateSliceExpression(e,t,r){if(!(e instanceof kt||e instanceof je))throw new Error("Slice object must be an array or string");let n=this.evaluate(t.start,r),i=this.evaluate(t.stop,r),o=this.evaluate(t.step,r);if(!(n instanceof ot||n instanceof ln))throw new Error("Slice start must be numeric or undefined");if(!(i instanceof ot||i instanceof ln))throw new Error("Slice stop must be numeric or undefined");if(!(o instanceof ot||o instanceof ln))throw new Error("Slice step must be numeric or undefined");return e instanceof kt?new kt(Ih(e.value,n.value,i.value,o.value)):new je(Ih(Array.from(e.value),n.value,i.value,o.value).join(""))}evaluateMemberExpression(e,t){let r=this.evaluate(e.object,t),n;if(e.computed){if(e.property.type==="SliceExpression")return this.evaluateSliceExpression(r,e.property,t);n=this.evaluate(e.property,t)}else n=new je(e.property.value);let i;if(r instanceof cn){if(!(n instanceof je))throw new Error(`Cannot access property with non-string: got ${n.type}`);i=r.value.get(n.value)??r.builtins.get(n.value)}else if(r instanceof kt||r instanceof je)if(n instanceof ot)i=r.value.at(n.value),r instanceof je&&(i=new je(r.value.at(n.value)));else if(n instanceof je)i=r.builtins.get(n.value);else throw new Error(`Cannot access property with non-string/non-number: got ${n.type}`);else{if(!(n instanceof je))throw new Error(`Cannot access property with non-string: got ${n.type}`);i=r.builtins.get(n.value)}return i instanceof ci?i:new ln}evaluateSet(e,t){let r=this.evaluate(e.value,t);if(e.assignee.type==="Identifier"){let n=e.assignee.value;t.setVariable(n,r)}else if(e.assignee.type==="MemberExpression"){let n=e.assignee,i=this.evaluate(n.object,t);if(!(i instanceof cn))throw new Error("Cannot assign to member of non-object");if(n.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");i.value.set(n.property.value,r)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new Is}evaluateIf(e,t){let r=this.evaluate(e.test,t);return this.evaluateBlock(r.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let r=new Nh(t),n=this.evaluate(e.iterable,r);if(!(n instanceof kt))throw new Error(`Expected iterable type in for loop: got ${n.type}`);let i="";for(let o=0;o0?n.value[o-1]:new ln],["nextitem",od.value.length?"few":"many"} items to unpack`);for(let h=0;hthis.evaluate(r,t)));case"TupleLiteral":return new EI(e.value.map(r=>this.evaluate(r,t)));case"ObjectLiteral":{let r=new Map;for(let[n,i]of e.value){let o=this.evaluate(n,t);if(!(o instanceof je))throw new Error(`Object keys must be strings: got ${o.type}`);r.set(o.value,this.evaluate(i,t))}return new cn(r)}case"Identifier":return this.evaluateIdentifier(e,t);case"CallExpression":return this.evaluateCallExpression(e,t);case"MemberExpression":return this.evaluateMemberExpression(e,t);case"UnaryExpression":return this.evaluateUnaryExpression(e,t);case"BinaryExpression":return this.evaluateBinaryExpression(e,t);case"FilterExpression":return this.evaluateFilterExpression(e,t);case"TestExpression":return this.evaluateTestExpression(e,t);default:throw new SyntaxError(`Unknown node type: ${e.type}`)}}},D(Vd,"Interpreter"),Vd);function Ns(e){switch(typeof e){case"number":return new ot(e);case"string":return new je(e);case"boolean":return new $t(e);case"object":return e===null?new Is:Array.isArray(e)?new kt(e.map(Ns)):new cn(new Map(Object.entries(e).map(([t,r])=>[t,Ns(r)])));case"function":return new Jn((t,r)=>{let n=e(...t.map(i=>i.value))??null;return Ns(n)});default:throw new Error(`Cannot convert to runtime value: ${e}`)}}D(Ns,"convertToRuntimeValues");var qd,CI=(qd=class{constructor(e){he(this,"parsed");let t=CE(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=TE(t)}render(e){let t=new Nh;t.set("false",!1),t.set("true",!0),t.set("raise_exception",r=>{throw new Error(r)}),t.set("range",bE);for(let[r,n]of Object.entries(e))t.set(r,n);return new xI(t).run(this.parsed).value}},D(qd,"Template"),qd),OE=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],ju=new Map(OE),TI=new Map([...OE.map(([e,t])=>[t,e]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function DE(e){e=e.toLowerCase();let t=TI.get(e);if(t===void 0)if(ju.has(e))t=e;else{let r=e.length===2?ju.keys():ju.values();throw new Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(r)}`)}return t}D(DE,"whisper_language_to_code");var Gd="https://github.com/xenova/transformers.js/issues/new/choose";async function wg(e,t){let r=await Promise.all([Lh(e,"tokenizer.json",!0,t),Lh(e,"tokenizer_config.json",!0,t)]);return t.legacy!==null&&(r[1].legacy=t.legacy),r}D(wg,"loadTokenizer");function $E(e,t){let r=[],n=0;for(let i of e.matchAll(t)){let o=i[0];n0&&r.push(o),n=i.index+o.length}return n=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}D(Eg,"is_chinese_char");function ME(e,t,r){let n=[],i=0;for(;ithis.tokens_to_ids.get(r)??this.unk_token_id)}convert_ids_to_tokens(t){return t.map(r=>this.vocab[r]??this.unk_token)}};D(IE,"TokenizerModel");var Wa=IE,NE=class extends Wa{constructor(t){super(t),this.tokens_to_ids=Zc(t.vocab),this.unk_token_id=this.tokens_to_ids.get(t.unk_token),this.unk_token=t.unk_token,this.max_input_chars_per_word=t.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(let[r,n]of this.tokens_to_ids)this.vocab[n]=r}encode(t){let r=[];for(let n of t){let i=[...n];if(i.length>this.max_input_chars_per_word){r.push(this.unk_token);continue}let o=!1,a=0,l=[];for(;a0&&(d=this.config.continuing_subword_prefix+d),this.tokens_to_ids.has(d)){c=d;break}--u}if(c===null){o=!0;break}l.push(c),a=u}o?r.push(this.unk_token):r.push(...l)}return r}};D(NE,"WordPieceTokenizer");var $I=NE,AE=class extends Wa{constructor(t,r){super(t);let n=t.vocab.length;this.vocab=new Array(n),this.scores=new Array(n);for(let i=0;i[i,o])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=r.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=pE(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new aI,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(t){let r=t.sentence,n=r.length,i=0;for(;i{let e=[...Array.from({length:94},(i,o)=>o+33),...Array.from({length:12},(i,o)=>o+161),...Array.from({length:82},(i,o)=>o+174)],t=e.slice(),r=0;for(let i=0;i<256;++i)e.includes(i)||(e.push(i),t.push(256+r),r+=1);let n=t.map(i=>String.fromCharCode(i));return Object.fromEntries(e.map((i,o)=>[i,n[o]]))})(),MI=cE(BE),zE=class extends Wa{constructor(t){super(t),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=Zc(t.vocab),this.unk_token_id=this.tokens_to_ids.get(t.unk_token),this.unk_token=t.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(let[r,n]of this.tokens_to_ids)this.vocab[n]=r;this.bpe_ranks=new Map(t.merges.map((r,n)=>[r,n])),this.merges=t.merges.map(r=>r.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=t.end_of_word_suffix,this.continuing_subword_suffix=t.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(t){if(t.length===0)return[];let r=this.cache.get(t);if(r!==void 0)return r;let n=Array.from(t);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let i=[];if(n.length>1){let o=new oI((u,c)=>u.score`<0x${a.toString(16).toUpperCase().padStart(2,"0")}>`)):r.push(this.unk_token)}return r}};D(zE,"BPE");var LI=zE,FE=class extends Wa{constructor(t,r){super(t),this.tokens_to_ids=Zc(r.target_lang?t.vocab[r.target_lang]:t.vocab),this.bos_token=r.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=r.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=r.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=r.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(let[n,i]of this.tokens_to_ids)this.vocab[i]=n}encode(t){return t}};D(FE,"LegacyTokenizerModel");var PI=FE,KE=class extends ja{constructor(t){super(),this.config=t}static fromConfig(t){if(t===null)return null;switch(t.type){case"BertNormalizer":return new WI(t);case"Precompiled":return new uN(t);case"Sequence":return new UI(t);case"Replace":return new II(t);case"NFC":return new NI(t);case"NFKC":return new AI(t);case"NFKD":return new BI(t);case"Strip":return new zI(t);case"StripAccents":return new FI(t);case"Lowercase":return new KI(t);case"Prepend":return new jI(t);default:throw new Error(`Unknown Normalizer type: ${t.type}`)}}normalize(t){throw Error("normalize should be implemented in subclass.")}_call(t){return this.normalize(t)}};D(KE,"Normalizer");var Pr=KE,jE=class extends Pr{normalize(t){let r=_l(this.config.pattern);return r===null?t:t.replaceAll(r,this.config.content)}};D(jE,"Replace");var II=jE,UE=class extends Pr{normalize(t){return t=t.normalize("NFC"),t}};D(UE,"NFC");var NI=UE,WE=class extends Pr{normalize(t){return t=t.normalize("NFKC"),t}};D(WE,"NFKC");var AI=WE,HE=class extends Pr{normalize(t){return t=t.normalize("NFKD"),t}};D(HE,"NFKD");var BI=HE,VE=class extends Pr{normalize(t){return this.config.strip_left&&this.config.strip_right?t=t.trim():(this.config.strip_left&&(t=t.trimStart()),this.config.strip_right&&(t=t.trimEnd())),t}};D(VE,"StripNormalizer");var zI=VE,qE=class extends Pr{normalize(t){return t=kg(t),t}};D(qE,"StripAccents");var FI=qE,GE=class extends Pr{normalize(t){return t=t.toLowerCase(),t}};D(GE,"Lowercase");var KI=GE,YE=class extends Pr{normalize(t){return t=this.config.prepend+t,t}};D(YE,"Prepend");var jI=YE,QE=class extends Pr{constructor(t){super(t),this.normalizers=t.normalizers.map(r=>Pr.fromConfig(r))}normalize(t){return this.normalizers.reduce((r,n)=>n.normalize(r),t)}};D(QE,"NormalizerSequence");var UI=QE,XE=class extends Pr{_tokenize_chinese_chars(t){let r=[];for(let n=0;nthis.pre_tokenize_text(n,r)):this.pre_tokenize_text(t,r)).flat()}_call(t,r){return this.pre_tokenize(t,r)}};D(JE,"PreTokenizer");var tn=JE,ZE=class extends tn{constructor(t){super(),this.pattern=new RegExp(`[^\\s${Pa}]+|[${Pa}]`,"gu")}pre_tokenize_text(t,r){return t.trim().match(this.pattern)||[]}};D(ZE,"BertPreTokenizer");var HI=ZE,ex=class extends tn{constructor(t){super(),this.config=t,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=BE,this.text_encoder=new TextEncoder}pre_tokenize_text(t,r){return this.add_prefix_space&&!t.startsWith(" ")&&(t=" "+t),(this.use_regex?t.match(this.pattern)||[]:[t]).map(n=>Array.from(this.text_encoder.encode(n),i=>this.byte_encoder[i]).join(""))}};D(ex,"ByteLevelPreTokenizer");var VI=ex,tx=class extends tn{constructor(t){super(),this.config=t,this.pattern=_l(this.config.pattern,this.config.invert)}pre_tokenize_text(t,r){return this.pattern===null?[]:this.config.invert?t.match(this.pattern)||[]:$E(t,this.pattern)}};D(tx,"SplitPreTokenizer");var qI=tx,rx=class extends tn{constructor(t){super(),this.config=t,this.pattern=new RegExp(`[^${Pa}]+|[${Pa}]+`,"gu")}pre_tokenize_text(t,r){return t.match(this.pattern)||[]}};D(rx,"PunctuationPreTokenizer");var GI=rx,nx=class extends tn{constructor(t){super(),this.config=t;let r=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(r,"gu")}pre_tokenize_text(t,r){return t.match(this.pattern)||[]}};D(nx,"DigitsPreTokenizer");var YI=nx,ix=class extends ja{constructor(t){super(),this.config=t}static fromConfig(t){if(t===null)return null;switch(t.type){case"TemplateProcessing":return new QI(t);case"ByteLevel":return new fx(t);case"RobertaProcessing":return new lx(t);case"BertProcessing":return new ax(t);case"Sequence":return new XI(t);default:throw new Error(`Unknown PostProcessor type: ${t.type}`)}}post_process(t,...r){throw Error("post_process should be implemented in subclass.")}_call(t,...r){return this.post_process(t,...r)}};D(ix,"PostProcessor");var Ia=ix,ox=class extends Ia{constructor(t){super(t),this.cls=t.cls[0],this.sep=t.sep[0]}post_process(t,r=null,{add_special_tokens:n=!0}={}){n&&(t=Jt([this.cls],t,[this.sep]));let i=new Array(t.length).fill(0);if(r!==null){let o=n&&this instanceof lx?[this.sep]:[],a=n?[this.sep]:[];t=Jt(t,o,r,a),i=Jt(i,new Array(r.length+o.length+a.length).fill(1))}return{tokens:t,token_type_ids:i}}};D(ox,"BertProcessing");var ax=ox,sx=class extends ax{};D(sx,"RobertaProcessing");var lx=sx,ux=class extends Ia{constructor(t){super(t),this.single=t.single,this.pair=t.pair}post_process(t,r=null,{add_special_tokens:n=!0}={}){let i=r===null?this.single:this.pair,o=[],a=[];for(let l of i)"SpecialToken"in l?n&&(o.push(l.SpecialToken.id),a.push(l.SpecialToken.type_id)):"Sequence"in l&&(l.Sequence.id==="A"?(o=Jt(o,t),a=Jt(a,new Array(t.length).fill(l.Sequence.type_id))):l.Sequence.id==="B"&&(o=Jt(o,r),a=Jt(a,new Array(r.length).fill(l.Sequence.type_id))));return{tokens:o,token_type_ids:a}}};D(ux,"TemplateProcessing");var QI=ux,cx=class extends Ia{post_process(t,r=null){return r&&(t=Jt(t,r)),{tokens:t}}};D(cx,"ByteLevelPostProcessor");var fx=cx,dx=class extends Ia{constructor(t){super(t),this.processors=t.processors.map(r=>Ia.fromConfig(r))}post_process(t,r=null,n={}){let i;for(let o of this.processors)if(o instanceof fx)t=o.post_process(t).tokens,r&&(r=o.post_process(r).tokens);else{let a=o.post_process(t,r,n);t=a.tokens,i=a.token_type_ids}return{tokens:t,token_type_ids:i}}};D(dx,"PostProcessorSequence");var XI=dx,px=class extends ja{constructor(t){super(),this.config=t,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=t.trim_offsets}static fromConfig(t){if(t===null)return null;switch(t.type){case"WordPiece":return new rN(t);case"Metaspace":return new lN(t);case"ByteLevel":return new nN(t);case"Replace":return new JI(t);case"ByteFallback":return new ZI(t);case"Fuse":return new eN(t);case"Strip":return new tN(t);case"Sequence":return new oN(t);case"CTC":return new iN(t);case"BPEDecoder":return new aN(t);default:throw new Error(`Unknown Decoder type: ${t.type}`)}}_call(t){return this.decode(t)}decode(t){return this.decode_chain(t).join("")}decode_chain(t){throw Error("`decode_chain` should be implemented in subclass.")}};D(px,"Decoder");var Ir=px,hx=class extends Ir{decode_chain(t){let r=_l(this.config.pattern);return r===null?t:t.map(n=>n.replaceAll(r,this.config.content))}};D(hx,"ReplaceDecoder");var JI=hx,vx=class extends Ir{constructor(t){super(t),this.text_decoder=new TextDecoder}decode_chain(t){let r=[],n=[];for(let i of t){let o=null;if(i.length===6&&i.startsWith("<0x")&&i.endsWith(">")){let a=parseInt(i.slice(3,5),16);isNaN(a)||(o=a)}if(o!==null)n.push(o);else{if(n.length>0){let a=this.text_decoder.decode(Uint8Array.from(n));r.push(a),n=[]}r.push(i)}}if(n.length>0){let i=this.text_decoder.decode(Uint8Array.from(n));r.push(i),n=[]}return r}};D(vx,"ByteFallback");var ZI=vx,gx=class extends Ir{decode_chain(t){return[t.join("")]}};D(gx,"FuseDecoder");var eN=gx,mx=class extends Ir{constructor(t){super(t),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(t){return t.map(r=>{let n=0;for(let o=0;o(n!==0&&(r.startsWith(this.config.prefix)?r=r.replace(this.config.prefix,""):r=" "+r),this.cleanup&&(r=ef(r)),r))}};D(yx,"WordPieceDecoder");var rN=yx,_x=class extends Ir{constructor(t){super(t),this.byte_decoder=MI,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(t){let r=t.join(""),n=new Uint8Array([...r].map(i=>this.byte_decoder[i]));return this.text_decoder.decode(n)}decode_chain(t){let r=[],n=[];for(let i of t)this.added_tokens.find(o=>o.content===i)!==void 0?(n.length>0&&(r.push(this.convert_tokens_to_string(n)),n=[]),r.push(i)):n.push(i);return n.length>0&&r.push(this.convert_tokens_to_string(n)),r}};D(_x,"ByteLevelDecoder");var nN=_x,wx=class extends Ir{constructor(t){super(t),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(t){if(t.length===0)return"";let r=[t[0]];for(let i=1;ii!==this.pad_token).join("");return this.cleanup&&(n=ef(n).replaceAll(this.word_delimiter_token," ").trim()),n}decode_chain(t){return[this.convert_tokens_to_string(t)]}};D(wx,"CTCDecoder");var iN=wx,Sx=class extends Ir{constructor(t){super(t),this.decoders=t.decoders.map(r=>Ir.fromConfig(r))}decode_chain(t){return this.decoders.reduce((r,n)=>n.decode_chain(r),t)}};D(Sx,"DecoderSequence");var oN=Sx,kx=class extends Ir{constructor(t){super(t),this.suffix=this.config.suffix}decode_chain(t){return t.map((r,n)=>r.replaceAll(this.suffix,n===t.length-1?"":" "))}};D(kx,"BPEDecoder");var aN=kx,Ex=class extends Ir{decode_chain(t){let r="";for(let n=1;nr.normalize("NFKC")).join("~"):t=t.normalize("NFKC"),t}};D(bx,"Precompiled");var uN=bx,Ox=class extends tn{constructor(t){super(),this.tokenizers=t.pretokenizers.map(r=>tn.fromConfig(r))}pre_tokenize_text(t,r){return this.tokenizers.reduce((n,i)=>i.pre_tokenize(n,r),[t])}};D(Ox,"PreTokenizerSequence");var cN=Ox,Dx=class extends tn{constructor(t){super()}pre_tokenize_text(t,r){return t.match(/\w+|[^\w\s]+/g)||[]}};D(Dx,"WhitespacePreTokenizer");var fN=Dx,$x=class extends tn{constructor(t){super()}pre_tokenize_text(t,r){return LE(t)}};D($x,"WhitespaceSplit");var dN=$x,Rx=class extends tn{constructor(t){super(),this.config=t,this.pattern=_l(this.config.pattern),this.content=this.config.content}pre_tokenize_text(t,r){return this.pattern===null?[t]:[t.replaceAll(this.pattern,this.config.content)]}};D(Rx,"ReplacePreTokenizer");var pN=Rx,hN=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function Mx(e,t,r,n){for(let i of Object.keys(e)){let o=t-e[i].length,a=r(i),l=new Array(o).fill(a);e[i]=n==="right"?Jt(e[i],l):Jt(l,e[i])}}D(Mx,"padHelper");function Lx(e,t){for(let r of Object.keys(e))e[r].length=t}D(Lx,"truncateHelper");var Px=class extends ja{constructor(t,r){super(),he(this,"return_token_type_ids",!1),he(this,"padding_side","right"),this._tokenizer_config=r,this.normalizer=Pr.fromConfig(t.normalizer),this.pre_tokenizer=tn.fromConfig(t.pre_tokenizer),this.model=Wa.fromConfig(t.model,r),this.post_processor=Ia.fromConfig(t.post_processor),this.decoder=Ir.fromConfig(t.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(let n of t.added_tokens){let i=new DI(n);this.added_tokens.push(i),this.model.tokens_to_ids.set(i.content,i.id),this.model.vocab[i.id]=i.content,i.special&&(this.special_tokens.push(i.content),this.all_special_ids.push(i.id))}if(this.additional_special_tokens=r.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.toSorted((n,i)=>i.content.length-n.content.length).map(n=>`${n.lstrip?"\\s*":""}(${yg(n.content)})${n.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=r.model_max_length,this.remove_space=r.remove_space,this.clean_up_tokenization_spaces=r.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=r.do_lowercase_and_remove_accent??!1,r.padding_side&&(this.padding_side=r.padding_side),this.legacy=!1,this.chat_template=r.chat_template??null,Array.isArray(this.chat_template)){let n=Object.create(null);for(let{name:i,template:o}of this.chat_template){if(typeof i!="string"||typeof o!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');n[i]=o}this.chat_template=n}this._compiled_template_cache=new Map}getToken(...t){for(let r of t){let n=this._tokenizer_config[r];if(n)if(typeof n=="object"){if(n.__type==="AddedToken")return n.content;throw Error(`Unknown token: ${n}`)}else return n}return null}static async from_pretrained(t,{progress_callback:r=null,config:n=null,cache_dir:i=null,local_files_only:o=!1,revision:a="main",legacy:l=null}={}){let u=await wg(t,{progress_callback:r,config:n,cache_dir:i,local_files_only:o,revision:a,legacy:l});return new this(...u)}_call(t,{text_pair:r=null,add_special_tokens:n=!0,padding:i=!1,truncation:o=null,max_length:a=null,return_tensor:l=!1,return_token_type_ids:u=null}={}){let c=Array.isArray(t),d;if(c){if(t.length===0)throw Error("text array must be non-empty");if(r!==null){if(Array.isArray(r)){if(t.length!==r.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");d=t.map((p,m)=>this._encode_plus(p,{text_pair:r[m],add_special_tokens:n,return_token_type_ids:u}))}else d=t.map(p=>this._encode_plus(p,{add_special_tokens:n,return_token_type_ids:u}))}else{if(t==null)throw Error("text may not be null or undefined");if(Array.isArray(r))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(t,{text_pair:r,add_special_tokens:n,return_token_type_ids:u})]}if(a===null?i==="max_length"?a=this.model_max_length:a=hE(d.map(p=>p.input_ids.length))[0]:o||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),a=Math.min(a,this.model_max_length??1/0),i||o)for(let p=0;pa?o&&Lx(d[p],a):i&&Mx(d[p],a,m=>m==="input_ids"?this.pad_token_id:0,this.padding_side));let h={};if(l){if(!(i&&o)&&d.some(m=>{var g;for(let w of Object.keys(m))if(m[w].length!==((g=d[0][w])==null?void 0:g.length))return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");let p=[d.length,d[0].input_ids.length];for(let m of Object.keys(d[0]))h[m]=new Fu("int64",BigInt64Array.from(d.flatMap(g=>g[m]).map(BigInt)),p)}else{for(let p of Object.keys(d[0]))h[p]=d.map(m=>m[p]);if(!c)for(let p of Object.keys(h))h[p]=h[p][0]}return h}_encode_text(t){return t===null?null:(this.added_tokens_regex?t.split(this.added_tokens_regex).filter(r=>r):[t]).map((r,n)=>{if(this.added_tokens.find(i=>i.content===r)!==void 0)return r;{if(this.remove_space===!0&&(r=r.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(r=RE(r)),this.normalizer!==null&&(r=this.normalizer(r)),r.length===0)return[];let i=this.pre_tokenizer!==null?this.pre_tokenizer(r,{section_index:n}):[r];return this.model(i)}}).flat()}_encode_plus(t,{text_pair:r=null,add_special_tokens:n=!0,return_token_type_ids:i=null}={}){let{tokens:o,token_type_ids:a}=this._tokenize_helper(t,{pair:r,add_special_tokens:n}),l=this.model.convert_tokens_to_ids(o),u={input_ids:l,attention_mask:new Array(l.length).fill(1)};return(i??this.return_token_type_ids)&&a&&(u.token_type_ids=a),u}_tokenize_helper(t,{pair:r=null,add_special_tokens:n=!1}={}){let i=this._encode_text(t),o=this._encode_text(r);return this.post_processor?this.post_processor(i,o,{add_special_tokens:n}):{tokens:Jt(i??[],o??[])}}tokenize(t,{pair:r=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(t,{pair:r,add_special_tokens:n}).tokens}encode(t,{text_pair:r=null,add_special_tokens:n=!0,return_token_type_ids:i=null}={}){return this._encode_plus(t,{text_pair:r,add_special_tokens:n,return_token_type_ids:i}).input_ids}batch_decode(t,r={}){return t instanceof Fu&&(t=t.tolist()),t.map(n=>this.decode(n,r))}decode(t,r={}){if(t instanceof Fu&&(t=Sg(t)),!Array.isArray(t)||t.length===0||!fE(t[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(t,r)}decode_single(t,{skip_special_tokens:r=!1,clean_up_tokenization_spaces:n=null}){let i=this.model.convert_ids_to_tokens(t);r&&(i=i.filter(a=>!this.special_tokens.includes(a)));let o=this.decoder?this.decoder(i):i.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(o=o.replaceAll(this.decoder.end_of_word_suffix," "),r&&(o=o.trim())),(n??this.clean_up_tokenization_spaces)&&(o=ef(o)),o}apply_chat_template(t,{tools:r=null,documents:n=null,chat_template:i=null,add_generation_prompt:o=!1,tokenize:a=!0,padding:l=!1,truncation:u=!1,max_length:c=null,return_tensor:d=!1,return_dict:h=!1,tokenizer_kwargs:p={},...m}={}){if(this.chat_template&&typeof this.chat_template=="object"||this.chat_template===null){let S=this.chat_template;if(i!==null&&Object.hasOwn(S,i))i=S[i];else if(i===null&&"default"in S)i=S.default;else if(i===null)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(S).sort()}.`)}else if(this.chat_template)i=this.chat_template;else throw Error("Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating");if(typeof i!="string")throw Error(`chat_template must be a string, but got ${typeof i}`);let g=this._compiled_template_cache.get(i);g===void 0&&(g=new CI(i),this._compiled_template_cache.set(i,g));let w=Object.create(null);for(let S of hN){let y=this.getToken(S);y&&(w[S]=y)}let C=g.render({messages:t,add_generation_prompt:o,tools:r,documents:n,...w,...m});if(a){let S=this._call(C,{add_special_tokens:!1,padding:l,truncation:u,max_length:c,return_tensor:d,...p});return h?S:S.input_ids}return C}};D(Px,"PreTrainedTokenizer");var Se=Px,Ix=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Ix,"BertTokenizer");var Nx=Ix,Ax=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Ax,"AlbertTokenizer");var Bx=Ax,zx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(zx,"MobileBertTokenizer");var Fx=zx,Kx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Kx,"SqueezeBertTokenizer");var jx=Kx,Ux=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Ux,"DebertaTokenizer");var Wx=Ux,Hx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Hx,"DebertaV2Tokenizer");var Vx=Hx,qx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(qx,"HerbertTokenizer");var Gx=qx,Yx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Yx,"ConvBertTokenizer");var Qx=Yx,Xx=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(Xx,"RoFormerTokenizer");var Jx=Xx,Zx=class extends Se{};D(Zx,"DistilBertTokenizer");var eC=Zx,tC=class extends Se{};D(tC,"CamembertTokenizer");var rC=tC,nC=class extends Se{constructor(t,r){super(t,r),he(this,"return_token_type_ids",!0),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}};D(nC,"XLMTokenizer");var iC=nC,oC=class extends Se{constructor(){super(...arguments),he(this,"return_token_type_ids",!0)}};D(oC,"ElectraTokenizer");var aC=oC,sC=class extends Se{};D(sC,"T5Tokenizer");var lC=sC,uC=class extends Se{};D(uC,"GPT2Tokenizer");var cC=uC,fC=class extends Se{};D(fC,"BartTokenizer");var dC=fC,pC=class extends Se{constructor(t,r){super(t,r),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(n=>this.languageRegex.test(n)),this.lang_to_token=n=>n}_build_translation_inputs(t,r,n){return tf(this,t,r,n)}};D(pC,"MBartTokenizer");var xg=pC,hC=class extends xg{};D(hC,"MBart50Tokenizer");var vC=hC,gC=class extends Se{};D(gC,"RobertaTokenizer");var mC=gC,yC=class extends Se{constructor(t,r){var o,a;let n=".,!?…。,、।۔،",i=(a=(o=t.pre_tokenizer)==null?void 0:o.pretokenizers[0])==null?void 0:a.pattern;i&&i.Regex===` ?[^(\\s|[${n}])]+`&&(i.Regex=` ?[^\\s${n}]+`),super(t,r)}};D(yC,"BloomTokenizer");var _C=yC,ou="▁",wC=class extends Se{constructor(t,r){super(t,r),he(this,"padding_side","left"),this.legacy=r.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Cx({replacement:ou,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(t){if(t===null)return null;if(this.legacy||t.length===0)return super._encode_text(t);let r=super._encode_text(ou+t.replaceAll(ou," "));return r.length>1&&r[0]===ou&&this.special_tokens.includes(r[1])&&(r=r.slice(1)),r}};D(wC,"LlamaTokenizer");var SC=wC,kC=class extends Se{};D(kC,"CodeLlamaTokenizer");var EC=kC,xC=class extends Se{};D(xC,"XLMRobertaTokenizer");var CC=xC,TC=class extends Se{};D(TC,"MPNetTokenizer");var bC=TC,OC=class extends Se{};D(OC,"FalconTokenizer");var DC=OC,$C=class extends Se{};D($C,"GPTNeoXTokenizer");var RC=$C,MC=class extends Se{};D(MC,"EsmTokenizer");var LC=MC,PC=class extends Se{};D(PC,"Qwen2Tokenizer");var IC=PC,NC=class extends Se{};D(NC,"GemmaTokenizer");var AC=NC,BC=class extends Se{};D(BC,"Grok1Tokenizer");var zC=BC;function tf(e,t,r,n){if(!("language_codes"in e)||!Array.isArray(e.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in e)||!(e.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in e)||typeof e.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=n.src_lang,o=n.tgt_lang;if(!e.language_codes.includes(o))throw new Error(`Target language code "${o}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw new Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);for(let a of e.post_processor.config.single)if("SpecialToken"in a&&e.languageRegex.test(a.SpecialToken.id)){a.SpecialToken.id=e.lang_to_token(i);break}}return n.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(o)])[0],e._call(t,r)}D(tf,"_build_translation_inputs");var FC=class extends Se{constructor(t,r){super(t,r),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(n=>this.languageRegex.test(n)),this.lang_to_token=n=>n}_build_translation_inputs(t,r,n){return tf(this,t,r,n)}};D(FC,"NllbTokenizer");var KC=FC,jC=class extends Se{constructor(t,r){super(t,r),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(n=>this.languageRegex.test(n)).map(n=>n.slice(2,-2)),this.lang_to_token=n=>`__${n}__`}_build_translation_inputs(t,r,n){return tf(this,t,r,n)}};D(jC,"M2M100Tokenizer");var UC=jC,WC=class extends Se{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(t,{return_timestamps:r=!1,return_language:n=!1,time_precision:i=null,force_full_sequences:o=!0}={}){if(i===null)throw Error("Must specify time_precision");let a=null,l=r==="word";function u(){return{language:a,timestamp:[null,null],text:""}}D(u,"new_chunk");let c=[],d=u(),h=0,p=this.timestamp_begin,m=[],g=[],w=!1,C=null,S=new Set(this.all_special_ids);for(let x of t){let O=x.tokens,R=l?x.token_timestamps:null,T=null,A=p;if("stride"in x){let[U,q,G]=x.stride;if(h-=q,C=U-G,q&&(A=q/i+p),G)for(let J=O.length-1;J>=0;--J){let P=Number(O[J]);if(P>=p){if(T!==null&&(P-p)*i=p){let G=(q-p)*i+h,J=Ss(G,2);if(T!==null&&q>=T)w=!0;else if(w||m.length>0&&q0?(m.push(N),l&&g.push(I)):m.every(U=>U.length===0)&&(d=u(),m=[],N=[],g=[],I=[])}if(m.length>0){if(o&&r)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");let[x,O]=this.findLongestCommonSequence(m,g),R=this.decode(x);d.text=R,l&&(d.words=this.collateWordTimestamps(x,O,a)),c.push(d)}let y=Object.create(null),k=c.map(x=>x.text).join("");if(r||n){for(let x=0;x0,l=a?[]:null,u=a?r[0]:null;for(let c=1;cJ===I[P]&&u[O+P]<=r[c][A+P]).length:U=T.filter((J,P)=>J===I[P]).length;let q=x/1e4,G=U/x+q;U>1&&G>h&&(h=G,p=[O,R,A,N])}let[g,w,C,S]=p,y=Math.floor((w+g)/2),k=Math.floor((S+C)/2);o.push(...n.slice(0,y)),n=d.slice(k),i=n.length,a&&(l.push(...u.slice(0,y)),u=r[c].slice(k))}return o.push(...n),a?(l.push(...u),[o,l]):[o,[]]}collateWordTimestamps(t,r,n){let[i,o,a]=this.combineTokensIntoWords(t,n),l=[];for(let u=0;u=i){let l=((a-i)*n).toFixed(2);o.push(`<|${l}|>`),o.push([])}else o[o.length-1].push(a);return o=o.map(a=>typeof a=="string"?a:super.decode(a,r)),o.join("")}splitTokensOnUnicode(t){let r=this.decode(t,{decode_with_timestamps:!0}),n="�",i=[],o=[],a=[],l=[],u=[],c=0;for(let d=0;d=this.model.tokens_to_ids.get("<|endoftext|>"),g=d.startsWith(" "),w=d.trim(),C=u.test(w);if(m||g||C||o.length===0)o.push(d),a.push(h),l.push(p);else{let S=o.length-1;o[S]+=d,a[S].push(...h),l[S].push(...p)}}return[o,a,l]}mergePunctuations(t,r,n,i,o){let a=structuredClone(t),l=structuredClone(r),u=structuredClone(n),c=a.length-2,d=a.length-1;for(;c>=0;)a[c].startsWith(" ")&&i.includes(a[c].trim())?(a[d]=a[c]+a[d],l[d]=Jt(l[c],l[d]),u[d]=Jt(u[c],u[d]),a[c]="",l[c]=[],u[c]=[]):d=c,--c;for(c=0,d=1;dh),l.filter(h=>h.length>0),u.filter(h=>h.length>0)]}get_decoder_prompt_ids({language:t=null,task:r=null,no_timestamps:n=!0}={}){let i=[];if(t){let o=DE(t),a=this.model.tokens_to_ids.get(`<|${o}|>`);if(a===void 0)throw new Error(`Unable to find language "${o}" in model vocabulary. Please report this issue at ${Gd}.`);i.push(a)}else i.push(null);if(r){if(r=r.toLowerCase(),r!=="transcribe"&&r!=="translate")throw new Error(`Task "${r}" is not supported. Must be one of: ["transcribe", "translate"]`);let o=this.model.tokens_to_ids.get(`<|${r}|>`);if(o===void 0)throw new Error(`Unable to find task "${r}" in model vocabulary. Please report this issue at ${Gd}.`);i.push(o)}else i.push(null);if(n){let o=this.model.tokens_to_ids.get("<|notimestamps|>");if(o===void 0)throw new Error(`Unable to find "<|notimestamps|>" in model vocabulary. Please report this issue at ${Gd}.`);i.push(o)}return i.map((o,a)=>[a+1,o]).filter(o=>o[1]!==null)}};D(WC,"WhisperTokenizer");var HC=WC,VC=class extends Se{};D(VC,"CodeGenTokenizer");var qC=VC,GC=class extends Se{};D(GC,"CLIPTokenizer");var YC=GC,QC=class extends Se{};D(QC,"SiglipTokenizer");var XC=QC,JC=class extends Se{constructor(t,r){super(t,r),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(n=>this.languageRegex.test(n)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(t){if(t===null)return null;let[r,...n]=t.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(r);if(n.length===2){let[i,o]=n;return this.supported_language_codes.includes(i)||console.warn(`Unsupported language code "${i}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),Jt([i],super._encode_text(o))}}};D(JC,"MarianTokenizer");var ZC=JC,eT=class extends Se{};D(eT,"Wav2Vec2CTCTokenizer");var tT=eT,rT=class extends Se{};D(rT,"BlenderbotTokenizer");var nT=rT,iT=class extends Se{};D(iT,"BlenderbotSmallTokenizer");var oT=iT,aT=class extends Se{};D(aT,"SpeechT5Tokenizer");var sT=aT,lT=class extends Se{};D(lT,"NougatTokenizer");var uT=lT,cT=class extends Se{constructor(t,r){super(t,r),this.decoder=new sN({})}};D(cT,"VitsTokenizer");var fT=cT,dT=class extends Se{};D(dT,"CohereTokenizer");var pT=dT,Ah=class{static async from_pretrained(t,{progress_callback:r=null,config:n=null,cache_dir:i=null,local_files_only:o=!1,revision:a="main",legacy:l=null}={}){var p;let[u,c]=await wg(t,{progress_callback:r,config:n,cache_dir:i,local_files_only:o,revision:a,legacy:l}),d=((p=c.tokenizer_class)==null?void 0:p.replace(/Fast$/,""))??"PreTrainedTokenizer",h=this.TOKENIZER_CLASS_MAPPING[d];return h||(console.warn(`Unknown tokenizer class "${d}", attempting to construct from base class.`),h=Se),new h(u,c)}};D(Ah,"AutoTokenizer"),he(Ah,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:lC,DistilBertTokenizer:eC,CamembertTokenizer:rC,DebertaTokenizer:Wx,DebertaV2Tokenizer:Vx,BertTokenizer:Nx,HerbertTokenizer:Gx,ConvBertTokenizer:Qx,RoFormerTokenizer:Jx,XLMTokenizer:iC,ElectraTokenizer:aC,MobileBertTokenizer:Fx,SqueezeBertTokenizer:jx,AlbertTokenizer:Bx,GPT2Tokenizer:cC,BartTokenizer:dC,MBartTokenizer:xg,MBart50Tokenizer:vC,RobertaTokenizer:mC,WhisperTokenizer:HC,CodeGenTokenizer:qC,CLIPTokenizer:YC,SiglipTokenizer:XC,MarianTokenizer:ZC,BloomTokenizer:_C,NllbTokenizer:KC,M2M100Tokenizer:UC,LlamaTokenizer:SC,CodeLlamaTokenizer:EC,XLMRobertaTokenizer:CC,MPNetTokenizer:bC,FalconTokenizer:DC,GPTNeoXTokenizer:RC,EsmTokenizer:LC,Wav2Vec2CTCTokenizer:tT,BlenderbotTokenizer:nT,BlenderbotSmallTokenizer:oT,SpeechT5Tokenizer:sT,NougatTokenizer:uT,VitsTokenizer:fT,Qwen2Tokenizer:IC,GemmaTokenizer:AC,Grok1Tokenizer:zC,CohereTokenizer:pT,PreTrainedTokenizer:Se});var Cg=Ah;Cg.TOKENIZER_CLASS_MAPPING.ClaudeTokenizer=Se;var hT=class vT{static fromPreTrained(t){var a;let{tokenizerJSON:r,tokenizerConfig:n}=t;if(!r)throw new Error("tokenizerJSON is required.");if(!n)throw new Error("tokenizerConfig is required.");let i=((a=n.tokenizer_class)==null?void 0:a.replace(/Fast$/,""))??"PreTrainedTokenizer",o=Cg.TOKENIZER_CLASS_MAPPING[i];return o||(console.warn(`Unknown tokenizer class "${i}", attempting to construct from base class.`),o=Se),new o(r,n)}static async fromPreTrainedUrls(t,r){let n=(r==null?void 0:r.fetch)??globalThis.fetch.bind(globalThis),[i,o]=await Promise.all([n(t.tokenizerJSON).then(a=>a.json()),n(t.tokenizerConfig).then(a=>a.json())]);return vT.fromPreTrained({tokenizerJSON:{...i,...r==null?void 0:r.tokenizerJSON},tokenizerConfig:{...o,...r==null?void 0:r.tokenizerConfig}})}};D(hT,"TokenizerLoader");var vN=hT,gT={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(u,c,d){this.fn=u,this.context=c,this.once=d||!1}function o(u,c,d,h,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new i(d,h||u,p),g=r?r+c:c;return u._events[g]?u._events[g].fn?u._events[g]=[u._events[g],m]:u._events[g].push(m):(u._events[g]=m,u._eventsCount++),u}function a(u,c){--u._eventsCount===0?u._events=new n:delete u._events[c]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],d,h;if(this._eventsCount===0)return c;for(h in d=this._events)t.call(d,h)&&c.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},l.prototype.listeners=function(c){var d=r?r+c:c,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,m=h.length,g=new Array(m);p({name:e,url:`https://cdn.jsdelivr.net/npm/@lenml/tokenizer-${e}@${yN}/+esm`})),da=class da{constructor(){Qi(this,"events",new mN);Qi(this,"pkg_registry",{});Qi(this,"url_registry",{});Qi(this,"errors",{});if(da.instance)throw new Error("TokenizersHub is a singleton class")}get_status(){return{loaded:Object.keys(this.pkg_registry).length,downloaded:Object.keys(this.url_registry).length,errors:Object.keys(this.errors).length}}get_registry_status(){return{pkg_registry:this.pkg_registry,url_registry:this.url_registry,loaded_pkg:Object.keys(this.pkg_registry),loaded_url:Object.keys(this.url_registry)}}async getPackage(t){if(!this.pkg_registry[t]){const r=R_.find(n=>n.name===t);if(r){const n=await import(r.url),{fromPreTrained:i}=n;this.pkg_registry[t]=await i(),this.events.emit("change")}}return this.pkg_registry[t]}async loadFromUrl(t,r){return await vN.fromPreTrainedUrls({tokenizerJSON:t,tokenizerConfig:r})}async getFromUrl(t,r){if(this.url_registry[t])return this.url_registry[t];const n=await this.loadFromUrl(t,r);return this.url_registry[t]=n,this.events.emit("change"),n}get(t){switch(t.type){case"package":try{return this.getPackage(t.name)}catch(r){throw this.errors[t.name]=r,this.events.emit("change"),r}case"url":try{return this.getFromUrl(t.json_url,t.config_url)}catch(r){throw this.errors[t.json_url]=r,this.events.emit("change"),r}}}tokenize(t,r){const n=r.encode(t,{add_special_tokens:!1}),i=n.map(l=>r.decode_single([l],{}));let o=0;return n.map((l,u)=>{const c=i[u],d={token:c,encoding:l,start:o,end:o+c.length};return o+=c.length,d})}info(t){return{vocab_size:t.model.vocab.length,chat_template:t.chat_template,pad_token:t.getToken("pad_token")??t.pad_token,bos_token:t.getToken("bos_token")??t.pad_token,eos_token:t.getToken("eos_token")??t.pad_token}}};Qi(da,"instance",new da),Qi(da,"packages",R_);let ti=da;const _N=vt.div` + display: flex; + flex-direction: column; + + height: 100%; + width: 100%; +`,wN=vt.header` + display: flex; + align-items: center; + height: 32px; + padding-left: 8px; + + white-space: nowrap; + word-break: keep-all; + overflow: hidden; + text-overflow: ellipsis; + + background-color: #383838; + + user-select: none; + + .--header-item { + height: 100%; + display: flex; + align-items: center; + padding: 0 8px; + + color: white; + text-decoration: none; + + &.--btn-like { + &:hover { + background-color: #424242; + } + &:active { + background-color: #262626; + } + } + + &.--selected { + background-color: #424242; + } + } + + .--bolder { + font-weight: bold; + } + + box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; +`,SN=vt.div` + flex: 1; + display: flex; + + justify-content: center; + + padding: 1rem; + + overflow: auto; +`,kN=vt.div` + display: flex; + align-items: center; + height: 32px; + padding-left: 8px; + + white-space: nowrap; + word-break: keep-all; + overflow: hidden; + text-overflow: ellipsis; + + background-color: #383838; + user-select: none; + + gap: 8px; + + box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; + + .--op-5 { + opacity: 0.5; + } + .--red { + color: red; + } +`,M_=vt.div``,EN=vt.div``,xN=vt.div` + flex: 1; +`,CN=vt.a` + text-decoration: none; + color: white; + + &:hover { + text-decoration: underline; + } +`,TN=()=>{const[e,t]=F.useState({loaded:0,downloaded:0,errors:0});return F.useEffect(()=>{const r=()=>{t(ti.instance.get_status())};return ti.instance.events.on("change",r),()=>{ti.instance.events.off("change",r)}},[]),e},bN=()=>{const e=TN(),t=[{label:"⚔️",type:"emoji"},{label:"Tokenizers Arena",type:"text",className:"--bolder"},{label:"Home",type:"nav-link",path:"/"},{label:"Direct Tokenize",type:"nav-link",path:"/direct"},{label:"Side By Side",type:"nav-link",path:"/side-by-side"},{type:"hidden-divider"},{type:"link",label:"github",url:"https://github.com/lenML/tokenizers"}],r=[{label:`loaded: ${e.loaded}`,type:"text"},{label:`downloaded: ${e.downloaded}`,type:"text"},{label:`errors: ${e.errors}`,type:"text",className:e.errors?"--red":"--op-5"}];return Q.jsxs(_N,{children:[Q.jsx(wN,{children:t.map((n,i)=>{switch(n.type){case"emoji":return Q.jsx(EN,{className:fa("--header-item",n.className),children:n.label},i);case"text":return Q.jsx(M_,{className:fa("--header-item",n.className),children:n.label},i);case"hidden-divider":return Q.jsx(xN,{},i);case"link":return Q.jsx(CN,{className:fa("--header-item","--btn-like",n.className),href:n.url,target:"_blank",children:n.label},i);case"nav-link":return Q.jsx(JL,{className:({isActive:o})=>fa("--header-item","--btn-like",n.className,{"--selected":o}),to:n.path,children:n.label},i);default:return null}})}),Q.jsx(SN,{children:Q.jsx(RL,{})}),Q.jsx(kN,{children:r.map((n,i)=>{switch(n.type){case"text":return Q.jsx(M_,{className:n.className,children:n.label},i);default:return null}})})]})},ON=vt.div` + display: flex; + flex-direction: column; + + padding-top: 16px; + + label { + margin-bottom: 8px; + } + input { + width: 100%; + padding: 4px; + font-size: 16px; + } + button { + margin-top: 8px; + padding: 4px; + font-size: 16px; + } +`,DN=({onConfigChange:e})=>{const[t,r]=F.useState({json_url:"",config_url:""});return Q.jsxs(ON,{children:[Q.jsx("div",{children:Q.jsxs("label",{children:["JSON URL:",Q.jsx("input",{type:"text",onChange:n=>{r(i=>({...i,json_url:n.target.value}))},placeholder:"https://huggingface.co/.../tokenizer.json"})]})}),Q.jsx("div",{children:Q.jsxs("label",{children:["Config URL:",Q.jsx("input",{type:"text",onChange:n=>{r(i=>({...i,config_url:n.target.value}))},placeholder:"https://huggingface.co/.../config.json"})]})}),Q.jsx("div",{children:Q.jsx("button",{disabled:!t.json_url||!t.config_url,onClick:()=>{e({type:"url",...t})},children:"Load"})})]})},$N=vt.div` + display: flex; + + flex-direction: column; + + .packages { + display: flex; + flex-wrap: wrap; + gap: 8px; + button { + padding: 4px; + font-size: 16px; + } + } +`,RN=({onConfigChange:e})=>{const t=ti.packages;return Q.jsxs($N,{children:[Q.jsx("p",{children:"Choose a tokenizer package from the following list. These tokenizers are pre-package and stored in CDN."}),Q.jsx("div",{className:"packages",children:t.map(r=>Q.jsx("div",{children:Q.jsx("button",{onClick:()=>{e({type:"package",name:r.name})},children:r.name})},r.name))})]})},MN=vt.div` + display: flex; + flex-direction: column; + + .configure-tabs { + display: flex; + gap: 8px; + margin-bottom: 8px; + + button { + padding: 4px; + font-size: 16px; + + background-color: transparent; + border: none; + border-bottom: 1px solid transparent; + + cursor: pointer; + + &.--selected { + border-bottom-color: white; + color: white; + } + } + } +`,LN=({onConfigChange:e})=>{const[t,r]=F.useState("packages");return Q.jsxs(MN,{children:[Q.jsxs("div",{className:"configure-tabs",children:[Q.jsx("button",{className:fa({"--selected":t==="urls"}),onClick:()=>r("urls"),children:"From URLs"}),Q.jsx("button",{className:fa({"--selected":t==="packages"}),onClick:()=>r("packages"),children:"From Packages"})]}),t==="urls"&&Q.jsx(DN,{onConfigChange:e}),t==="packages"&&Q.jsx(RN,{onConfigChange:e})]})};var mT={exports:{}};(function(e,t){(function(r,n){e.exports=n()})($i,function(){var r=Array.prototype.slice;function n(s,f){f&&(s.prototype=Object.create(f.prototype)),s.prototype.constructor=s}function i(s){return u(s)?s:ze(s)}n(o,i);function o(s){return c(s)?s:lt(s)}n(a,i);function a(s){return d(s)?s:Pe(s)}n(l,i);function l(s){return u(s)&&!h(s)?s:ut(s)}function u(s){return!!(s&&s[m])}function c(s){return!!(s&&s[g])}function d(s){return!!(s&&s[w])}function h(s){return c(s)||d(s)}function p(s){return!!(s&&s[C])}i.isIterable=u,i.isKeyed=c,i.isIndexed=d,i.isAssociative=h,i.isOrdered=p,i.Keyed=o,i.Indexed=a,i.Set=l;var m="@@__IMMUTABLE_ITERABLE__@@",g="@@__IMMUTABLE_KEYED__@@",w="@@__IMMUTABLE_INDEXED__@@",C="@@__IMMUTABLE_ORDERED__@@",S="delete",y=5,k=1<>>0;if(""+v!==f||v===4294967295)return NaN;f=v}return f<0?q(s)+f:f}function J(){return!0}function P(s,f,v){return(s===0||v!==void 0&&s<=-v)&&(f===void 0||v!==void 0&&f>=v)}function V(s,f){return K(s,f,0)}function X(s,f){return K(s,f,f)}function K(s,f,v){return s===void 0?v:s<0?Math.max(0,f+s):f===void 0?s:Math.min(f,s)}var ee=0,te=1,ie=2,ae=typeof Symbol=="function"&&Symbol.iterator,Fe="@@iterator",Ae=ae||Fe;function ce(s){this.next=s}ce.prototype.toString=function(){return"[Iterator]"},ce.KEYS=ee,ce.VALUES=te,ce.ENTRIES=ie,ce.prototype.inspect=ce.prototype.toSource=function(){return this.toString()},ce.prototype[Ae]=function(){return this};function de(s,f,v,_){var E=s===0?f:s===1?v:[f,v];return _?_.value=E:_={value:E,done:!1},_}function Te(){return{value:void 0,done:!0}}function Mt(s){return!!Wt(s)}function st(s){return s&&typeof s.next=="function"}function Lt(s){var f=Wt(s);return f&&f.call(s)}function Wt(s){var f=s&&(ae&&s[ae]||s[Fe]);if(typeof f=="function")return f}function Be(s){return s&&typeof s.length=="number"}n(ze,i);function ze(s){return s==null?Ft():u(s)?s.toSeq():be(s)}ze.of=function(){return ze(arguments)},ze.prototype.toSeq=function(){return this},ze.prototype.toString=function(){return this.__toString("Seq {","}")},ze.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},ze.prototype.__iterate=function(s,f){return Ke(this,s,f,!0)},ze.prototype.__iterator=function(s,f){return vr(this,s,f,!0)},n(lt,ze);function lt(s){return s==null?Ft().toKeyedSeq():u(s)?c(s)?s.toSeq():s.fromEntrySeq():hr(s)}lt.prototype.toKeyedSeq=function(){return this},n(Pe,ze);function Pe(s){return s==null?Ft():u(s)?c(s)?s.entrySeq():s.toIndexedSeq():ye(s)}Pe.of=function(){return Pe(arguments)},Pe.prototype.toIndexedSeq=function(){return this},Pe.prototype.toString=function(){return this.__toString("Seq [","]")},Pe.prototype.__iterate=function(s,f){return Ke(this,s,f,!1)},Pe.prototype.__iterator=function(s,f){return vr(this,s,f,!1)},n(ut,ze);function ut(s){return(s==null?Ft():u(s)?c(s)?s.entrySeq():s:ye(s)).toSetSeq()}ut.of=function(){return ut(arguments)},ut.prototype.toSetSeq=function(){return this},ze.isSeq=gt,ze.Keyed=lt,ze.Set=ut,ze.Indexed=Pe;var Fr="@@__IMMUTABLE_SEQ__@@";ze.prototype[Fr]=!0,n(Ye,Pe);function Ye(s){this._array=s,this.size=s.length}Ye.prototype.get=function(s,f){return this.has(s)?this._array[G(this,s)]:f},Ye.prototype.__iterate=function(s,f){for(var v=this._array,_=v.length-1,E=0;E<=_;E++)if(s(v[f?_-E:E],E,this)===!1)return E+1;return E},Ye.prototype.__iterator=function(s,f){var v=this._array,_=v.length-1,E=0;return new ce(function(){return E>_?Te():de(s,E,v[f?_-E++:E++])})},n(xt,lt);function xt(s){var f=Object.keys(s);this._object=s,this._keys=f,this.size=f.length}xt.prototype.get=function(s,f){return f!==void 0&&!this.has(s)?f:this._object[s]},xt.prototype.has=function(s){return this._object.hasOwnProperty(s)},xt.prototype.__iterate=function(s,f){for(var v=this._object,_=this._keys,E=_.length-1,b=0;b<=E;b++){var $=_[f?E-b:b];if(s(v[$],$,this)===!1)return b+1}return b},xt.prototype.__iterator=function(s,f){var v=this._object,_=this._keys,E=_.length-1,b=0;return new ce(function(){var $=_[f?E-b:b];return b++>E?Te():de(s,$,v[$])})},xt.prototype[C]=!0,n(tr,Pe);function tr(s){this._iterable=s,this.size=s.length||s.size}tr.prototype.__iterateUncached=function(s,f){if(f)return this.cacheResult().__iterate(s,f);var v=this._iterable,_=Lt(v),E=0;if(st(_))for(var b;!(b=_.next()).done&&s(b.value,E++,this)!==!1;);return E},tr.prototype.__iteratorUncached=function(s,f){if(f)return this.cacheResult().__iterator(s,f);var v=this._iterable,_=Lt(v);if(!st(_))return new ce(Te);var E=0;return new ce(function(){var b=_.next();return b.done?b:de(s,E++,b.value)})},n(ct,Pe);function ct(s){this._iterator=s,this._iteratorCache=[]}ct.prototype.__iterateUncached=function(s,f){if(f)return this.cacheResult().__iterate(s,f);for(var v=this._iterator,_=this._iteratorCache,E=0;E<_.length;)if(s(_[E],E++,this)===!1)return E;for(var b;!(b=v.next()).done;){var $=b.value;if(_[E]=$,s($,E++,this)===!1)break}return E},ct.prototype.__iteratorUncached=function(s,f){if(f)return this.cacheResult().__iterator(s,f);var v=this._iterator,_=this._iteratorCache,E=0;return new ce(function(){if(E>=_.length){var b=v.next();if(b.done)return b;_[E]=b.value}return de(s,E,_[E++])})};function gt(s){return!!(s&&s[Fr])}var tt;function Ft(){return tt||(tt=new Ye([]))}function hr(s){var f=Array.isArray(s)?new Ye(s).fromEntrySeq():st(s)?new ct(s).fromEntrySeq():Mt(s)?new tr(s).fromEntrySeq():typeof s=="object"?new xt(s):void 0;if(!f)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+s);return f}function ye(s){var f=_e(s);if(!f)throw new TypeError("Expected Array or iterable object of values: "+s);return f}function be(s){var f=_e(s)||typeof s=="object"&&new xt(s);if(!f)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+s);return f}function _e(s){return Be(s)?new Ye(s):st(s)?new ct(s):Mt(s)?new tr(s):void 0}function Ke(s,f,v,_){var E=s._cache;if(E){for(var b=E.length-1,$=0;$<=b;$++){var M=E[v?b-$:$];if(f(M[1],_?M[0]:$,s)===!1)return $+1}return $}return s.__iterateUncached(f,v)}function vr(s,f,v,_){var E=s._cache;if(E){var b=E.length-1,$=0;return new ce(function(){var M=E[v?b-$:$];return $++>b?Te():de(f,_?M[0]:$-1,M[1])})}return s.__iteratorUncached(f,v)}function mt(s,f){return f?Ie(f,s,"",{"":s}):me(s)}function Ie(s,f,v,_){return Array.isArray(f)?s.call(_,v,Pe(f).map(function(E,b){return Ie(s,E,b,f)})):rr(f)?s.call(_,v,lt(f).map(function(E,b){return Ie(s,E,b,f)})):f}function me(s){return Array.isArray(s)?Pe(s).map(me).toList():rr(s)?lt(s).map(me).toMap():s}function rr(s){return s&&(s.constructor===Object||s.constructor===void 0)}function Qe(s,f){if(s===f||s!==s&&f!==f)return!0;if(!s||!f)return!1;if(typeof s.valueOf=="function"&&typeof f.valueOf=="function"){if(s=s.valueOf(),f=f.valueOf(),s===f||s!==s&&f!==f)return!0;if(!s||!f)return!1}return!!(typeof s.equals=="function"&&typeof f.equals=="function"&&s.equals(f))}function Kn(s,f){if(s===f)return!0;if(!u(f)||s.size!==void 0&&f.size!==void 0&&s.size!==f.size||s.__hash!==void 0&&f.__hash!==void 0&&s.__hash!==f.__hash||c(s)!==c(f)||d(s)!==d(f)||p(s)!==p(f))return!1;if(s.size===0&&f.size===0)return!0;var v=!h(s);if(p(s)){var _=s.entries();return f.every(function(z,W){var Y=_.next().value;return Y&&Qe(Y[1],z)&&(v||Qe(Y[0],W))})&&_.next().done}var E=!1;if(s.size===void 0)if(f.size===void 0)typeof s.cacheResult=="function"&&s.cacheResult();else{E=!0;var b=s;s=f,f=b}var $=!0,M=f.__iterate(function(z,W){if(v?!s.has(z):E?!Qe(z,s.get(W,O)):!Qe(s.get(W,O),z))return $=!1,!1});return $&&s.size===M}n(Ct,Pe);function Ct(s,f){if(!(this instanceof Ct))return new Ct(s,f);if(this._value=s,this.size=f===void 0?1/0:Math.max(0,f),this.size===0){if(Mo)return Mo;Mo=this}}Ct.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Ct.prototype.get=function(s,f){return this.has(s)?this._value:f},Ct.prototype.includes=function(s){return Qe(this._value,s)},Ct.prototype.slice=function(s,f){var v=this.size;return P(s,f,v)?this:new Ct(this._value,X(f,v)-V(s,v))},Ct.prototype.reverse=function(){return this},Ct.prototype.indexOf=function(s){return Qe(this._value,s)?0:-1},Ct.prototype.lastIndexOf=function(s){return Qe(this._value,s)?this.size:-1},Ct.prototype.__iterate=function(s,f){for(var v=0;v1?" by "+this._step:"")+" ]"},Ht.prototype.get=function(s,f){return this.has(s)?this._start+G(this,s)*this._step:f},Ht.prototype.includes=function(s){var f=(s-this._start)/this._step;return f>=0&&f=0&&vv?Te():de(s,b++,$)})},Ht.prototype.equals=function(s){return s instanceof Ht?this._start===s._start&&this._end===s._end&&this._step===s._step:Kn(this,s)};var Lo;n(_n,i);function _n(){throw TypeError("Abstract")}n(pi,_n);function pi(){}n(hi,_n);function hi(){}n(L,_n);function L(){}_n.Keyed=pi,_n.Indexed=hi,_n.Set=L;var B=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(f,v){f=f|0,v=v|0;var _=f&65535,E=v&65535;return _*E+((f>>>16)*E+_*(v>>>16)<<16>>>0)|0};function H(s){return s>>>1&1073741824|s&3221225471}function Z(s){if(s===!1||s===null||s===void 0||typeof s.valueOf=="function"&&(s=s.valueOf(),s===!1||s===null||s===void 0))return 0;if(s===!0)return 1;var f=typeof s;if(f==="number"){var v=s|0;for(v!==s&&(v^=s*4294967295);s>4294967295;)s/=4294967295,v^=s;return H(v)}if(f==="string")return s.length>Pt?se(s):ke(s);if(typeof s.hashCode=="function")return s.hashCode();if(f==="object")return ve(s);if(typeof s.toString=="function")return ke(s.toString());throw new Error("Value type "+f+" cannot be hashed.")}function se(s){var f=wn[s];return f===void 0&&(f=ke(s),Kr===Gi&&(Kr=0,wn={}),Kr++,wn[s]=f),f}function ke(s){for(var f=0,v=0;v0)switch(s.nodeType){case 1:return s.uniqueID;case 9:return s.documentElement&&s.documentElement.uniqueID}}var Tt=typeof WeakMap=="function",bt;Tt&&(bt=new WeakMap);var we=0,We="__immutablehash__";typeof Symbol=="function"&&(We=Symbol(We));var Pt=16,Gi=255,Kr=0,wn={};function It(s){di(s!==1/0,"Cannot perform this action with an infinite size.")}n($e,pi);function $e(s){return s==null?kn():gr(s)&&!p(s)?s:kn().withMutations(function(f){var v=o(s);It(v.size),v.forEach(function(_,E){return f.set(E,_)})})}$e.prototype.toString=function(){return this.__toString("Map {","}")},$e.prototype.get=function(s,f){return this._root?this._root.get(0,void 0,s,f):f},$e.prototype.set=function(s,f){return Qg(this,s,f)},$e.prototype.setIn=function(s,f){return this.updateIn(s,O,function(){return f})},$e.prototype.remove=function(s){return Qg(this,s,O)},$e.prototype.deleteIn=function(s){return this.updateIn(s,function(){return O})},$e.prototype.update=function(s,f,v){return arguments.length===1?s(this):this.updateIn([s],f,v)},$e.prototype.updateIn=function(s,f,v){v||(v=f,f=void 0);var _=tm(this,km(s),f,v);return _===O?void 0:_},$e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):kn()},$e.prototype.merge=function(){return Rl(this,void 0,arguments)},$e.prototype.mergeWith=function(s){var f=r.call(arguments,1);return Rl(this,s,f)},$e.prototype.mergeIn=function(s){var f=r.call(arguments,1);return this.updateIn(s,kn(),function(v){return typeof v.merge=="function"?v.merge.apply(v,f):f[f.length-1]})},$e.prototype.mergeDeep=function(){return Rl(this,Jg,arguments)},$e.prototype.mergeDeepWith=function(s){var f=r.call(arguments,1);return Rl(this,Zg(s),f)},$e.prototype.mergeDeepIn=function(s){var f=r.call(arguments,1);return this.updateIn(s,kn(),function(v){return typeof v.mergeDeep=="function"?v.mergeDeep.apply(v,f):f[f.length-1]})},$e.prototype.sort=function(s){return Dt(zo(this,s))},$e.prototype.sortBy=function(s,f){return Dt(zo(this,f,s))},$e.prototype.withMutations=function(s){var f=this.asMutable();return s(f),f.wasAltered()?f.__ensureOwner(this.__ownerID):this},$e.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new I)},$e.prototype.asImmutable=function(){return this.__ensureOwner()},$e.prototype.wasAltered=function(){return this.__altered},$e.prototype.__iterator=function(s,f){return new jn(this,s,f)},$e.prototype.__iterate=function(s,f){var v=this,_=0;return this._root&&this._root.iterate(function(E){return _++,s(E[1],E[0],v)},f),_},$e.prototype.__ensureOwner=function(s){return s===this.__ownerID?this:s?gf(this.size,this._root,s,this.__hash):(this.__ownerID=s,this.__altered=!1,this)};function gr(s){return!!(s&&s[Yi])}$e.isMap=gr;var Yi="@@__IMMUTABLE_MAP__@@",Oe=$e.prototype;Oe[Yi]=!0,Oe[S]=Oe.remove,Oe.removeIn=Oe.deleteIn;function Sn(s,f){this.ownerID=s,this.entries=f}Sn.prototype.get=function(s,f,v,_){for(var E=this.entries,b=0,$=E.length;b<$;b++)if(Qe(v,E[b][0]))return E[b][1];return _},Sn.prototype.update=function(s,f,v,_,E,b,$){for(var M=E===O,z=this.entries,W=0,Y=z.length;W=TO)return SO(s,z,_,E);var fe=s&&s===this.ownerID,Ce=fe?z:U(z);return oe?M?W===Y-1?Ce.pop():Ce[W]=Ce.pop():Ce[W]=[_,E]:Ce.push([_,E]),fe?(this.entries=Ce,this):new Sn(s,Ce)}};function De(s,f,v){this.ownerID=s,this.bitmap=f,this.nodes=v}De.prototype.get=function(s,f,v,_){f===void 0&&(f=Z(v));var E=1<<((s===0?f:f>>>s)&x),b=this.bitmap;return b&E?this.nodes[rm(b&E-1)].get(s+y,f,v,_):_},De.prototype.update=function(s,f,v,_,E,b,$){v===void 0&&(v=Z(_));var M=(f===0?v:v>>>f)&x,z=1<=bO)return EO(s,fe,W,M,Le);if(Y&&!Le&&fe.length===2&&Xg(fe[oe^1]))return fe[oe^1];if(Y&&Le&&fe.length===1&&Xg(Le))return Le;var dt=s&&s===this.ownerID,on=Y?Le?W:W^z:W|z,Tn=Y?Le?nm(fe,oe,Le,dt):CO(fe,oe,dt):xO(fe,oe,Le,dt);return dt?(this.bitmap=on,this.nodes=Tn,this):new De(s,on,Tn)};function Ot(s,f,v){this.ownerID=s,this.count=f,this.nodes=v}Ot.prototype.get=function(s,f,v,_){f===void 0&&(f=Z(v));var E=(s===0?f:f>>>s)&x,b=this.nodes[E];return b?b.get(s+y,f,v,_):_},Ot.prototype.update=function(s,f,v,_,E,b,$){v===void 0&&(v=Z(_));var M=(f===0?v:v>>>f)&x,z=E===O,W=this.nodes,Y=W[M];if(z&&!Y)return this;var oe=mf(Y,s,f+y,v,_,E,b,$);if(oe===Y)return this;var fe=this.count;if(!Y)fe++;else if(!oe&&(fe--,fe>>v)&x,$=(v===0?_:_>>>v)&x,M,z=b===$?[yf(s,f,v+y,_,E)]:(M=new Xe(f,_,E),b<$?[s,M]:[M,s]);return new De(f,1<>>=1)$[M]=v&1?f[b++]:void 0;return $[_]=E,new Ot(s,b+1,$)}function Rl(s,f,v){for(var _=[],E=0;E>1&1431655765),s=(s&858993459)+(s>>2&858993459),s=s+(s>>4)&252645135,s=s+(s>>8),s=s+(s>>16),s&127}function nm(s,f,v,_){var E=_?s:U(s);return E[f]=v,E}function xO(s,f,v,_){var E=s.length+1;if(_&&f+1===E)return s[f]=v,s;for(var b=new Array(E),$=0,M=0;M0&&_=0&&s>>f&x;if(_>=this.array.length)return new vi([],s);var E=_===0,b;if(f>0){var $=this.array[_];if(b=$&&$.removeBefore(s,f-y,v),b===$&&E)return this}if(E&&!b)return this;var M=Io(this,s);if(!E)for(var z=0;z<_;z++)M.array[z]=void 0;return b&&(M.array[_]=b),M},vi.prototype.removeAfter=function(s,f,v){if(v===(f?1<>>f&x;if(_>=this.array.length)return this;var E;if(f>0){var b=this.array[_];if(E=b&&b.removeAfter(s,f-y,v),E===b&&_===this.array.length-1)return this}var $=Io(this,s);return $.array.splice(_+1),E&&($.array[_]=E),$};var Ha={};function am(s,f){var v=s._origin,_=s._capacity,E=qa(_),b=s._tail;return $(s._root,s._level,0);function $(W,Y,oe){return Y===0?M(W,oe):z(W,Y,oe)}function M(W,Y){var oe=Y===E?b&&b.array:W&&W.array,fe=Y>v?0:v-Y,Ce=_-Y;return Ce>k&&(Ce=k),function(){if(fe===Ce)return Ha;var Le=f?--Ce:fe++;return oe&&oe[Le]}}function z(W,Y,oe){var fe,Ce=W&&W.array,Le=oe>v?0:v-oe>>Y,dt=(_-oe>>Y)+1;return dt>k&&(dt=k),function(){do{if(fe){var on=fe();if(on!==Ha)return on;fe=null}if(Le===dt)return Ha;var Tn=f?--dt:Le++;fe=$(Ce&&Ce[Tn],Y-y,oe+(Tn<=s.size||f<0)return s.withMutations(function($){f<0?gi($,f).set(0,v):gi($,0,f+1).set(f,v)});f+=s._origin;var _=s._tail,E=s._root,b=A(T);return f>=qa(s._capacity)?_=wf(_,s.__ownerID,0,f,v,b):E=wf(E,s.__ownerID,s._level,f,v,b),b.value?s.__ownerID?(s._root=E,s._tail=_,s.__hash=void 0,s.__altered=!0,s):Va(s._origin,s._capacity,s._level,E,_):s}function wf(s,f,v,_,E,b){var $=_>>>v&x,M=s&&$0){var W=s&&s.array[$],Y=wf(W,f,v-y,_,E,b);return Y===W?s:(z=Io(s,f),z.array[$]=Y,z)}return M&&s.array[$]===E?s:(N(b),z=Io(s,f),E===void 0&&$===z.array.length-1?z.array.pop():z.array[$]=E,z)}function Io(s,f){return f&&s&&f===s.ownerID?s:new vi(s?s.array.slice():[],f)}function lm(s,f){if(f>=qa(s._capacity))return s._tail;if(f<1<0;)v=v.array[f>>>_&x],_-=y;return v}}function gi(s,f,v){f!==void 0&&(f=f|0),v!==void 0&&(v=v|0);var _=s.__ownerID||new I,E=s._origin,b=s._capacity,$=E+f,M=v===void 0?b:v<0?b+v:E+v;if($===E&&M===b)return s;if($>=M)return s.clear();for(var z=s._level,W=s._root,Y=0;$+Y<0;)W=new vi(W&&W.array.length?[void 0,W]:[],_),z+=y,Y+=1<=1<oe?new vi([],_):Ce;if(Ce&&fe>oe&&$y;on-=y){var Tn=oe>>>on&x;dt=dt.array[Tn]=Io(dt.array[Tn],_)}dt.array[oe>>>y&x]=Ce}if(M=fe)$-=fe,M-=fe,z=y,W=null,Le=Le&&Le.removeBefore(_,0,$);else if($>E||fe>>z&x;if(zl!==fe>>>z&x)break;zl&&(Y+=(1<E&&(W=W.removeBefore(_,z,$-Y)),W&&feE&&(E=M.size),u($)||(M=M.map(function(z){return mt(z)})),_.push(M)}return E>s.size&&(s=s.setSize(E)),em(s,f,_)}function qa(s){return s>>y<=k&&E.size>=_.size*2?(z=E.filter(function(W,Y){return W!==void 0&&b!==Y}),M=z.toKeyedSeq().map(function(W){return W[0]}).flip().toMap(),s.__ownerID&&(M.__ownerID=z.__ownerID=s.__ownerID)):(M=_.remove(f),z=b===E.size-1?E.pop():E.set(b,void 0))}else if($){if(v===E.get(b)[1])return s;M=_,z=E.set(b,[f,v])}else M=_.set(f,E.size),z=E.set(E.size,[f,v]);return s.__ownerID?(s.size=M.size,s._map=M,s._list=z,s.__hash=void 0,s):Sf(M,z)}n(jr,lt);function jr(s,f){this._iter=s,this._useKeys=f,this.size=s.size}jr.prototype.get=function(s,f){return this._iter.get(s,f)},jr.prototype.has=function(s){return this._iter.has(s)},jr.prototype.valueSeq=function(){return this._iter.valueSeq()},jr.prototype.reverse=function(){var s=this,f=kf(this,!0);return this._useKeys||(f.valueSeq=function(){return s._iter.toSeq().reverse()}),f},jr.prototype.map=function(s,f){var v=this,_=pm(this,s,f);return this._useKeys||(_.valueSeq=function(){return v._iter.toSeq().map(s,f)}),_},jr.prototype.__iterate=function(s,f){var v=this,_;return this._iter.__iterate(this._useKeys?function(E,b){return s(E,b,v)}:(_=f?_m(this):0,function(E){return s(E,f?--_:_++,v)}),f)},jr.prototype.__iterator=function(s,f){if(this._useKeys)return this._iter.__iterator(s,f);var v=this._iter.__iterator(te,f),_=f?_m(this):0;return new ce(function(){var E=v.next();return E.done?E:de(s,f?--_:_++,E.value,E)})},jr.prototype[C]=!0,n(No,Pe);function No(s){this._iter=s,this.size=s.size}No.prototype.includes=function(s){return this._iter.includes(s)},No.prototype.__iterate=function(s,f){var v=this,_=0;return this._iter.__iterate(function(E){return s(E,_++,v)},f)},No.prototype.__iterator=function(s,f){var v=this._iter.__iterator(te,f),_=0;return new ce(function(){var E=v.next();return E.done?E:de(s,_++,E.value,E)})},n(Ao,ut);function Ao(s){this._iter=s,this.size=s.size}Ao.prototype.has=function(s){return this._iter.includes(s)},Ao.prototype.__iterate=function(s,f){var v=this;return this._iter.__iterate(function(_){return s(_,_,v)},f)},Ao.prototype.__iterator=function(s,f){var v=this._iter.__iterator(te,f);return new ce(function(){var _=v.next();return _.done?_:de(s,_.value,_.value,_)})},n(Bo,lt);function Bo(s){this._iter=s,this.size=s.size}Bo.prototype.entrySeq=function(){return this._iter.toSeq()},Bo.prototype.__iterate=function(s,f){var v=this;return this._iter.__iterate(function(_){if(_){ym(_);var E=u(_);return s(E?_.get(1):_[1],E?_.get(0):_[0],v)}},f)},Bo.prototype.__iterator=function(s,f){var v=this._iter.__iterator(te,f);return new ce(function(){for(;;){var _=v.next();if(_.done)return _;var E=_.value;if(E){ym(E);var b=u(E);return de(s,b?E.get(0):E[0],b?E.get(1):E[1],_)}}})},No.prototype.cacheResult=jr.prototype.cacheResult=Ao.prototype.cacheResult=Bo.prototype.cacheResult=Cf;function dm(s){var f=En(s);return f._iter=s,f.size=s.size,f.flip=function(){return s},f.reverse=function(){var v=s.reverse.apply(this);return v.flip=function(){return s.reverse()},v},f.has=function(v){return s.includes(v)},f.includes=function(v){return s.has(v)},f.cacheResult=Cf,f.__iterateUncached=function(v,_){var E=this;return s.__iterate(function(b,$){return v($,b,E)!==!1},_)},f.__iteratorUncached=function(v,_){if(v===ie){var E=s.__iterator(v,_);return new ce(function(){var b=E.next();if(!b.done){var $=b.value[0];b.value[0]=b.value[1],b.value[1]=$}return b})}return s.__iterator(v===te?ee:te,_)},f}function pm(s,f,v){var _=En(s);return _.size=s.size,_.has=function(E){return s.has(E)},_.get=function(E,b){var $=s.get(E,O);return $===O?b:f.call(v,$,E,s)},_.__iterateUncached=function(E,b){var $=this;return s.__iterate(function(M,z,W){return E(f.call(v,M,z,W),z,$)!==!1},b)},_.__iteratorUncached=function(E,b){var $=s.__iterator(ie,b);return new ce(function(){var M=$.next();if(M.done)return M;var z=M.value,W=z[0];return de(E,W,f.call(v,z[1],W,s),M)})},_}function kf(s,f){var v=En(s);return v._iter=s,v.size=s.size,v.reverse=function(){return s},s.flip&&(v.flip=function(){var _=dm(s);return _.reverse=function(){return s.flip()},_}),v.get=function(_,E){return s.get(f?_:-1-_,E)},v.has=function(_){return s.has(f?_:-1-_)},v.includes=function(_){return s.includes(_)},v.cacheResult=Cf,v.__iterate=function(_,E){var b=this;return s.__iterate(function($,M){return _($,M,b)},!E)},v.__iterator=function(_,E){return s.__iterator(_,!E)},v}function hm(s,f,v,_){var E=En(s);return _&&(E.has=function(b){var $=s.get(b,O);return $!==O&&!!f.call(v,$,b,s)},E.get=function(b,$){var M=s.get(b,O);return M!==O&&f.call(v,M,b,s)?M:$}),E.__iterateUncached=function(b,$){var M=this,z=0;return s.__iterate(function(W,Y,oe){if(f.call(v,W,Y,oe))return z++,b(W,_?Y:z-1,M)},$),z},E.__iteratorUncached=function(b,$){var M=s.__iterator(ie,$),z=0;return new ce(function(){for(;;){var W=M.next();if(W.done)return W;var Y=W.value,oe=Y[0],fe=Y[1];if(f.call(v,fe,oe,s))return de(b,_?oe:z++,fe,W)}})},E}function $O(s,f,v){var _=$e().asMutable();return s.__iterate(function(E,b){_.update(f.call(v,E,b,s),0,function($){return $+1})}),_.asImmutable()}function RO(s,f,v){var _=c(s),E=(p(s)?Dt():$e()).asMutable();s.__iterate(function($,M){E.update(f.call(v,$,M,s),function(z){return z=z||[],z.push(_?[M,$]:$),z})});var b=wm(s);return E.map(function($){return Je(s,b($))})}function Ef(s,f,v,_){var E=s.size;if(f!==void 0&&(f=f|0),v!==void 0&&(v=v|0),P(f,v,E))return s;var b=V(f,E),$=X(v,E);if(b!==b||$!==$)return Ef(s.toSeq().cacheResult(),f,v,_);var M=$-b,z;M===M&&(z=M<0?0:M);var W=En(s);return W.size=z===0?z:s.size&&z||void 0,!_&>(s)&&z>=0&&(W.get=function(Y,oe){return Y=G(this,Y),Y>=0&&Yz)return Te();var dt=fe.next();return _||Y===te?dt:Y===ee?de(Y,Le-1,void 0,dt):de(Y,Le-1,dt.value[1],dt)})},W}function MO(s,f,v){var _=En(s);return _.__iterateUncached=function(E,b){var $=this;if(b)return this.cacheResult().__iterate(E,b);var M=0;return s.__iterate(function(z,W,Y){return f.call(v,z,W,Y)&&++M&&E(z,W,$)}),M},_.__iteratorUncached=function(E,b){var $=this;if(b)return this.cacheResult().__iterator(E,b);var M=s.__iterator(ie,b),z=!0;return new ce(function(){if(!z)return Te();var W=M.next();if(W.done)return W;var Y=W.value,oe=Y[0],fe=Y[1];return f.call(v,fe,oe,$)?E===ie?W:de(E,oe,fe,W):(z=!1,Te())})},_}function vm(s,f,v,_){var E=En(s);return E.__iterateUncached=function(b,$){var M=this;if($)return this.cacheResult().__iterate(b,$);var z=!0,W=0;return s.__iterate(function(Y,oe,fe){if(!(z&&(z=f.call(v,Y,oe,fe))))return W++,b(Y,_?oe:W-1,M)}),W},E.__iteratorUncached=function(b,$){var M=this;if($)return this.cacheResult().__iterator(b,$);var z=s.__iterator(ie,$),W=!0,Y=0;return new ce(function(){var oe,fe,Ce;do{if(oe=z.next(),oe.done)return _||b===te?oe:b===ee?de(b,Y++,void 0,oe):de(b,Y++,oe.value[1],oe);var Le=oe.value;fe=Le[0],Ce=Le[1],W&&(W=f.call(v,Ce,fe,M))}while(W);return b===ie?oe:de(b,fe,Ce,oe)})},E}function LO(s,f){var v=c(s),_=[s].concat(f).map(function($){return u($)?v&&($=o($)):$=v?hr($):ye(Array.isArray($)?$:[$]),$}).filter(function($){return $.size!==0});if(_.length===0)return s;if(_.length===1){var E=_[0];if(E===s||v&&c(E)||d(s)&&d(E))return E}var b=new Ye(_);return v?b=b.toKeyedSeq():d(s)||(b=b.toSetSeq()),b=b.flatten(!0),b.size=_.reduce(function($,M){if($!==void 0){var z=M.size;if(z!==void 0)return $+z}},0),b}function gm(s,f,v){var _=En(s);return _.__iterateUncached=function(E,b){var $=0,M=!1;function z(W,Y){var oe=this;W.__iterate(function(fe,Ce){return(!f||Y0}function xf(s,f,v){var _=En(s);return _.size=new Ye(v).map(function(E){return E.size}).min(),_.__iterate=function(E,b){for(var $=this.__iterator(te,b),M,z=0;!(M=$.next()).done&&E(M.value,z++,this)!==!1;);return z},_.__iteratorUncached=function(E,b){var $=v.map(function(W){return W=i(W),Lt(b?W.reverse():W)}),M=0,z=!1;return new ce(function(){var W;return z||(W=$.map(function(Y){return Y.next()}),z=W.some(function(Y){return Y.done})),z?Te():de(E,M++,f.apply(null,W.map(function(Y){return Y.value})))})},_}function Je(s,f){return gt(s)?f:s.constructor(f)}function ym(s){if(s!==Object(s))throw new TypeError("Expected [K, V] tuple: "+s)}function _m(s){return It(s.size),q(s)}function wm(s){return c(s)?o:d(s)?a:l}function En(s){return Object.create((c(s)?lt:d(s)?Pe:ut).prototype)}function Cf(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):ze.prototype.cacheResult.call(this)}function Sm(s,f){return s>f?1:s=0;v--)f={value:arguments[v],next:f};return this.__ownerID?(this.size=s,this._head=f,this.__hash=void 0,this.__altered=!0,this):Ga(s,f)},Nt.prototype.pushAll=function(s){if(s=a(s),s.size===0)return this;It(s.size);var f=this.size,v=this._head;return s.reverse().forEach(function(_){f++,v={value:_,next:v}}),this.__ownerID?(this.size=f,this._head=v,this.__hash=void 0,this.__altered=!0,this):Ga(f,v)},Nt.prototype.pop=function(){return this.slice(1)},Nt.prototype.unshift=function(){return this.push.apply(this,arguments)},Nt.prototype.unshiftAll=function(s){return this.pushAll(s)},Nt.prototype.shift=function(){return this.pop.apply(this,arguments)},Nt.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):$f()},Nt.prototype.slice=function(s,f){if(P(s,f,this.size))return this;var v=V(s,this.size),_=X(f,this.size);if(_!==this.size)return hi.prototype.slice.call(this,s,f);for(var E=this.size-v,b=this._head;v--;)b=b.next;return this.__ownerID?(this.size=E,this._head=b,this.__hash=void 0,this.__altered=!0,this):Ga(E,b)},Nt.prototype.__ensureOwner=function(s){return s===this.__ownerID?this:s?Ga(this.size,this._head,s,this.__hash):(this.__ownerID=s,this.__altered=!1,this)},Nt.prototype.__iterate=function(s,f){if(f)return this.reverse().__iterate(s);for(var v=0,_=this._head;_&&s(_.value,v++,this)!==!1;)_=_.next;return v},Nt.prototype.__iterator=function(s,f){if(f)return this.reverse().__iterator(s);var v=0,_=this._head;return new ce(function(){if(_){var E=_.value;return _=_.next,de(s,v++,E)}return Te()})};function $m(s){return!!(s&&s[Rm])}Nt.isStack=$m;var Rm="@@__IMMUTABLE_STACK__@@",Fo=Nt.prototype;Fo[Rm]=!0,Fo.withMutations=Oe.withMutations,Fo.asMutable=Oe.asMutable,Fo.asImmutable=Oe.asImmutable,Fo.wasAltered=Oe.wasAltered;function Ga(s,f,v,_){var E=Object.create(Fo);return E.size=s,E._head=f,E.__ownerID=v,E.__hash=_,E.__altered=!1,E}var Mm;function $f(){return Mm||(Mm=Ga(0))}function Cn(s,f){var v=function(_){s.prototype[_]=f[_]};return Object.keys(f).forEach(v),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(f).forEach(v),s}i.Iterator=ce,Cn(i,{toArray:function(){It(this.size);var s=new Array(this.size||0);return this.valueSeq().__iterate(function(f,v){s[v]=f}),s},toIndexedSeq:function(){return new No(this)},toJS:function(){return this.toSeq().map(function(s){return s&&typeof s.toJS=="function"?s.toJS():s}).__toJS()},toJSON:function(){return this.toSeq().map(function(s){return s&&typeof s.toJSON=="function"?s.toJSON():s}).__toJS()},toKeyedSeq:function(){return new jr(this,!0)},toMap:function(){return $e(this.toKeyedSeq())},toObject:function(){It(this.size);var s={};return this.__iterate(function(f,v){s[v]=f}),s},toOrderedMap:function(){return Dt(this.toKeyedSeq())},toOrderedSet:function(){return xn(c(this)?this.valueSeq():this)},toSet:function(){return ft(c(this)?this.valueSeq():this)},toSetSeq:function(){return new Ao(this)},toSeq:function(){return d(this)?this.toIndexedSeq():c(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Nt(c(this)?this.valueSeq():this)},toList:function(){return rt(c(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(s,f){return this.size===0?s+f:s+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+f},concat:function(){var s=r.call(arguments,0);return Je(this,LO(this,s))},includes:function(s){return this.some(function(f){return Qe(f,s)})},entries:function(){return this.__iterator(ie)},every:function(s,f){It(this.size);var v=!0;return this.__iterate(function(_,E,b){if(!s.call(f,_,E,b))return v=!1,!1}),v},filter:function(s,f){return Je(this,hm(this,s,f,!0))},find:function(s,f,v){var _=this.findEntry(s,f);return _?_[1]:v},findEntry:function(s,f){var v;return this.__iterate(function(_,E,b){if(s.call(f,_,E,b))return v=[E,_],!1}),v},findLastEntry:function(s,f){return this.toSeq().reverse().findEntry(s,f)},forEach:function(s,f){return It(this.size),this.__iterate(f?s.bind(f):s)},join:function(s){It(this.size),s=s!==void 0?""+s:",";var f="",v=!0;return this.__iterate(function(_){v?v=!1:f+=s,f+=_!=null?_.toString():""}),f},keys:function(){return this.__iterator(ee)},map:function(s,f){return Je(this,pm(this,s,f))},reduce:function(s,f,v){It(this.size);var _,E;return arguments.length<2?E=!0:_=f,this.__iterate(function(b,$,M){E?(E=!1,_=b):_=s.call(v,_,b,$,M)}),_},reduceRight:function(s,f,v){var _=this.toKeyedSeq().reverse();return _.reduce.apply(_,arguments)},reverse:function(){return Je(this,kf(this,!0))},slice:function(s,f){return Je(this,Ef(this,s,f,!0))},some:function(s,f){return!this.every(Bl(s),f)},sort:function(s){return Je(this,zo(this,s))},values:function(){return this.__iterator(te)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(s,f){return q(s?this.toSeq().filter(s,f):this)},countBy:function(s,f){return $O(this,s,f)},equals:function(s){return Kn(this,s)},entrySeq:function(){var s=this;if(s._cache)return new Ye(s._cache);var f=s.toSeq().map(zO).toIndexedSeq();return f.fromEntrySeq=function(){return s.toSeq()},f},filterNot:function(s,f){return this.filter(Bl(s),f)},findLast:function(s,f,v){return this.toKeyedSeq().reverse().find(s,f,v)},first:function(){return this.find(J)},flatMap:function(s,f){return Je(this,PO(this,s,f))},flatten:function(s){return Je(this,gm(this,s,!0))},fromEntrySeq:function(){return new Bo(this)},get:function(s,f){return this.find(function(v,_){return Qe(_,s)},void 0,f)},getIn:function(s,f){for(var v=this,_=km(s),E;!(E=_.next()).done;){var b=E.value;if(v=v&&v.get?v.get(b,O):O,v===O)return f}return v},groupBy:function(s,f){return RO(this,s,f)},has:function(s){return this.get(s,O)!==O},hasIn:function(s){return this.getIn(s,O)!==O},isSubset:function(s){return s=typeof s.includes=="function"?s:i(s),this.every(function(f){return s.includes(f)})},isSuperset:function(s){return s=typeof s.isSubset=="function"?s:i(s),s.isSubset(this)},keySeq:function(){return this.toSeq().map(BO).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(s){return Pl(this,s)},maxBy:function(s,f){return Pl(this,f,s)},min:function(s){return Pl(this,s?Lm(s):Im)},minBy:function(s,f){return Pl(this,f?Lm(f):Im,s)},rest:function(){return this.slice(1)},skip:function(s){return this.slice(Math.max(0,s))},skipLast:function(s){return Je(this,this.toSeq().reverse().skip(s).reverse())},skipWhile:function(s,f){return Je(this,vm(this,s,f,!0))},skipUntil:function(s,f){return this.skipWhile(Bl(s),f)},sortBy:function(s,f){return Je(this,zo(this,f,s))},take:function(s){return this.slice(0,Math.max(0,s))},takeLast:function(s){return Je(this,this.toSeq().reverse().take(s).reverse())},takeWhile:function(s,f){return Je(this,MO(this,s,f))},takeUntil:function(s,f){return this.takeWhile(Bl(s),f)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=KO(this))}});var nr=i.prototype;nr[m]=!0,nr[Ae]=nr.values,nr.__toJS=nr.toArray,nr.__toStringMapper=Pm,nr.inspect=nr.toSource=function(){return this.toString()},nr.chain=nr.flatMap,nr.contains=nr.includes,function(){try{Object.defineProperty(nr,"length",{get:function(){if(!i.noLengthWarning){var s;try{throw new Error}catch(f){s=f.stack}if(s.indexOf("_wrapObject")===-1)return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+s),this.size}}})}catch{}}(),Cn(o,{flip:function(){return Je(this,dm(this))},findKey:function(s,f){var v=this.findEntry(s,f);return v&&v[0]},findLastKey:function(s,f){return this.toSeq().reverse().findKey(s,f)},keyOf:function(s){return this.findKey(function(f){return Qe(f,s)})},lastKeyOf:function(s){return this.findLastKey(function(f){return Qe(f,s)})},mapEntries:function(s,f){var v=this,_=0;return Je(this,this.toSeq().map(function(E,b){return s.call(f,[b,E],_++,v)}).fromEntrySeq())},mapKeys:function(s,f){var v=this;return Je(this,this.toSeq().flip().map(function(_,E){return s.call(f,_,E,v)}).flip())}});var Al=o.prototype;Al[g]=!0,Al[Ae]=nr.entries,Al.__toJS=nr.toObject,Al.__toStringMapper=function(s,f){return JSON.stringify(f)+": "+Pm(s)},Cn(a,{toKeyedSeq:function(){return new jr(this,!1)},filter:function(s,f){return Je(this,hm(this,s,f,!1))},findIndex:function(s,f){var v=this.findEntry(s,f);return v?v[0]:-1},indexOf:function(s){var f=this.toKeyedSeq().keyOf(s);return f===void 0?-1:f},lastIndexOf:function(s){var f=this.toKeyedSeq().reverse().keyOf(s);return f===void 0?-1:f},reverse:function(){return Je(this,kf(this,!1))},slice:function(s,f){return Je(this,Ef(this,s,f,!1))},splice:function(s,f){var v=arguments.length;if(f=Math.max(f|0,0),v===0||v===2&&!f)return this;s=V(s,s<0?this.count():this.size);var _=this.slice(0,s);return Je(this,v===1?_:_.concat(U(arguments,2),this.slice(s+f)))},findLastIndex:function(s,f){var v=this.toKeyedSeq().findLastKey(s,f);return v===void 0?-1:v},first:function(){return this.get(0)},flatten:function(s){return Je(this,gm(this,s,!1))},get:function(s,f){return s=G(this,s),s<0||this.size===1/0||this.size!==void 0&&s>this.size?f:this.find(function(v,_){return _===s},void 0,f)},has:function(s){return s=G(this,s),s>=0&&(this.size!==void 0?this.size===1/0||sf?-1:0}function KO(s){if(s.size===1/0)return 0;var f=p(s),v=c(s),_=f?1:0,E=s.__iterate(v?f?function(b,$){_=31*_+Nm(Z(b),Z($))|0}:function(b,$){_=_+Nm(Z(b),Z($))|0}:f?function(b){_=31*_+Z(b)|0}:function(b){_=_+Z(b)|0});return jO(E,_)}function jO(s,f){return f=B(f,3432918353),f=B(f<<15|f>>>-15,461845907),f=B(f<<13|f>>>-13,5),f=(f+3864292196|0)^s,f=B(f^f>>>16,2246822507),f=B(f^f>>>13,3266489909),f=H(f^f>>>16),f}function Nm(s,f){return s^f+2654435769+(s<<6)+(s>>2)|0}var UO={Iterable:i,Seq:ze,Collection:_n,Map:$e,OrderedMap:Dt,List:rt,Stack:Nt,Set:ft,OrderedSet:xn,Record:br,Range:Ht,Repeat:Ct,is:Qe,fromJS:mt};return UO})})(mT);var He=mT.exports,PN=He,IN=PN.OrderedMap,NN={createFromArray:function(t){return IN(t.map(function(r){return[r.getKey(),r]}))}},wl=NN;function AN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Tg=He,Bh=Tg.Map,zh=Tg.OrderedSet,BN=Tg.Record,yT=zh(),_T={style:yT,entity:null},zN=BN(_T),bg=function(e){AN(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.getStyle=function(){return this.get("style")},r.getEntity=function(){return this.get("entity")},r.hasStyle=function(i){return this.getStyle().includes(i)},t.applyStyle=function(i,o){var a=i.set("style",i.getStyle().add(o));return t.create(a)},t.removeStyle=function(i,o){var a=i.set("style",i.getStyle().remove(o));return t.create(a)},t.applyEntity=function(i,o){var a=i.getEntity()===o?i:i.set("entity",o);return t.create(a)},t.create=function(i){if(!i)return Og;var o={style:yT,entity:null},a=Bh(o).merge(i),l=Yd.get(a);if(l)return l;var u=new t(a);return Yd=Yd.set(a,u),u},t.fromJS=function(i){var o=i.style,a=i.entity;return new t({style:Array.isArray(o)?zh(o):o,entity:Array.isArray(a)?zh(a):a})},t}(zN),Og=new bg,Yd=Bh([[Bh(_T),Og]]);bg.EMPTY=Og;var rn=bg;function FN(e,t,r,n){if(e.size){var i=0;e.reduce(function(o,a,l){return t(o,a)||(r(o)&&n(i,l),i=l),a}),r(e.last())&&n(i,e.count())}}var Sl=FN;function KN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var jN=rn,L_=Sl,kl=He,wT=kl.List,UN=kl.Map,WN=kl.OrderedSet,HN=kl.Record,VN=kl.Repeat,qN=WN(),GN={key:"",type:"unstyled",text:"",characterList:wT(),depth:0,data:UN()},YN=HN(GN),QN=function(t){if(!t)return t;var r=t.characterList,n=t.text;return n&&!r&&(t.characterList=wT(VN(jN.EMPTY,n.length))),t},XN=function(e){KN(t,e);function t(n){return e.call(this,QN(n))||this}var r=t.prototype;return r.getKey=function(){return this.get("key")},r.getType=function(){return this.get("type")},r.getText=function(){return this.get("text")},r.getCharacterList=function(){return this.get("characterList")},r.getLength=function(){return this.getText().length},r.getDepth=function(){return this.get("depth")},r.getData=function(){return this.get("data")},r.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():qN},r.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},r.findStyleRanges=function(i,o){L_(this.getCharacterList(),JN,i,o)},r.findEntityRanges=function(i,o){L_(this.getCharacterList(),ZN,i,o)},t}(YN);function JN(e,t){return e.getStyle()===t.getStyle()}function ZN(e,t){return e.getEntity()===t.getEntity()}var To=XN;function eA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var tA=rn,P_=Sl,El=He,Fh=El.List,rA=El.Map,nA=El.OrderedSet,iA=El.Record,oA=El.Repeat,aA=nA(),I_={parent:null,characterList:Fh(),data:rA(),depth:0,key:"",text:"",type:"unstyled",children:Fh(),prevSibling:null,nextSibling:null},sA=function(t,r){return t.getStyle()===r.getStyle()},lA=function(t,r){return t.getEntity()===r.getEntity()},uA=function(t){if(!t)return t;var r=t.characterList,n=t.text;return n&&!r&&(t.characterList=Fh(oA(tA.EMPTY,n.length))),t},cA=function(e){eA(t,e);function t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I_;return e.call(this,uA(n))||this}var r=t.prototype;return r.getKey=function(){return this.get("key")},r.getType=function(){return this.get("type")},r.getText=function(){return this.get("text")},r.getCharacterList=function(){return this.get("characterList")},r.getLength=function(){return this.getText().length},r.getDepth=function(){return this.get("depth")},r.getData=function(){return this.get("data")},r.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():aA},r.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},r.getChildKeys=function(){return this.get("children")},r.getParentKey=function(){return this.get("parent")},r.getPrevSiblingKey=function(){return this.get("prevSibling")},r.getNextSiblingKey=function(){return this.get("nextSibling")},r.findStyleRanges=function(i,o){P_(this.getCharacterList(),sA,i,o)},r.findEntityRanges=function(i,o){P_(this.getCharacterList(),lA,i,o)},t}(iA(I_)),nn=cA,N_=rn,fA=He,dA=fA.Map,pA={add:function(t,r,n){return A_(t,r,n,!0)},remove:function(t,r,n){return A_(t,r,n,!1)}};function A_(e,t,r,n){var i=e.getBlockMap(),o=t.getStartKey(),a=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),c=i.skipUntil(function(d,h){return h===o}).takeUntil(function(d,h){return h===l}).concat(dA([[l,i.get(l)]])).map(function(d,h){var p,m;o===l?(p=a,m=u):(p=h===o?a:0,m=h===l?u:d.getLength());for(var g=d.getCharacterList(),w;p0)return" "+C}else if(S2?r-2:0),i=2;i=w.start});p.length!=1&&$A(!1);var m=p[0];if(d==="IMMUTABLE")return r.merge({anchorOffset:m.start,focusOffset:m.end,isBackward:!1});o||(a?u=m.end:l=m.start);var g=OA.getRemovalRange(l,u,t.getText().slice(m.start,m.end),m.start,n);return r.merge({anchorOffset:g.start,focusOffset:g.end,isBackward:!1})}var MA=RA,B_={},LA=Math.pow(2,24);function PA(){for(var e;e===void 0||B_.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*LA).toString(32);return B_[e]=!0,e}var Fn=PA,IA=nn,ST=Fn,NA=He,kT=NA.OrderedMap,AA=function(t){var r={},n;return kT(t.withMutations(function(i){i.forEach(function(o,a){var l=o.getKey(),u=o.getNextSiblingKey(),c=o.getPrevSiblingKey(),d=o.getChildKeys(),h=o.getParentKey(),p=ST();if(r[l]=p,u){var m=i.get(u);m?i.setIn([u,"prevSibling"],p):i.setIn([l,"nextSibling"],null)}if(c){var g=i.get(c);g?i.setIn([c,"nextSibling"],p):i.setIn([l,"prevSibling"],null)}if(h&&i.get(h)){var w=i.get(h),C=w.getChildKeys();i.setIn([h,"children"],C.set(C.indexOf(o.getKey()),p))}else i.setIn([l,"parent"],null),n&&(i.setIn([n.getKey(),"nextSibling"],p),i.setIn([l,"prevSibling"],r[n.getKey()])),n=i.get(l);d.forEach(function(S){var y=i.get(S);y?i.setIn([S,"parent"],p):i.setIn([l,"children"],o.getChildKeys().filter(function(k){return k!==S}))})})}).toArray().map(function(i){return[r[i.getKey()],i.set("key",r[i.getKey()])]}))},BA=function(t){return kT(t.toArray().map(function(r){var n=ST();return[n,r.set("key",n)]}))},zA=function(t){var r=t.first()instanceof IA;return r?AA(t):BA(t)},ET=zA,FA=rn,KA=Sl,jA=Ve;function UA(e,t){var r=e.getBlockMap(),n=e.getEntityMap(),i={},o=t.getStartKey(),a=t.getStartOffset(),l=r.get(o),u=z_(n,l,a);u!==l&&(i[o]=u);var c=t.getEndKey(),d=t.getEndOffset(),h=r.get(c);o===c&&(h=u);var p=z_(n,h,d);return p!==h&&(i[c]=p),Object.keys(i).length?e.merge({blockMap:r.merge(i),selectionAfter:t}):e.set("selectionAfter",t)}function WA(e,t,r){var n;return KA(e,function(i,o){return i.getEntity()===o.getEntity()},function(i){return i.getEntity()===t},function(i,o){i<=r&&o>=r&&(n={start:i,end:o})}),typeof n!="object"&&jA(!1),n}function z_(e,t,r){var n=t.getCharacterList(),i=r>0?n.get(r-1):void 0,o=r6&&arguments[6]!==void 0?arguments[6]:"REPLACE_WITH_NEW_DATA",u=n.get(o),c=u.getText(),d=u.getCharacterList(),h=o,p=a+i.getText().length,m=null;switch(l){case"MERGE_OLD_DATA_TO_NEW_DATA":m=i.getData().merge(u.getData());break;case"REPLACE_WITH_NEW_DATA":m=i.getData();break}var g=u.getType();c&&g==="unstyled"&&(g=i.getType());var w=u.merge({text:c.slice(0,a)+i.getText()+c.slice(a),characterList:XA(d,i.getCharacterList(),a),type:g,data:m});return t.merge({blockMap:n.set(o,w),selectionBefore:r,selectionAfter:r.merge({anchorKey:h,anchorOffset:p,focusKey:h,focusOffset:p,isBackward:!1})})},tB=function(t,r,n){var i=t.getText(),o=t.getCharacterList(),a=i.slice(0,r),l=o.slice(0,r),u=n.first();return t.merge({text:a+u.getText(),characterList:l.concat(u.getCharacterList()),type:a?t.getType():u.getType(),data:u.getData()})},rB=function(t,r,n){var i=t.getText(),o=t.getCharacterList(),a=i.length,l=i.slice(r,a),u=o.slice(r,a),c=n.last();return c.merge({text:c.getText()+l,characterList:c.getCharacterList().concat(u),data:c.getData()})},nB=function(t,r){var n=t.getKey(),i=t,o=[];for(r.get(n)&&o.push(n);i&&i.getNextSiblingKey();){var a=i.getNextSiblingKey();if(!a)break;o.push(a),i=r.get(a)}return o},iB=function(t,r,n,i){return t.withMutations(function(o){var a=n.getKey(),l=i.getKey(),u=n.getNextSiblingKey(),c=n.getParentKey(),d=nB(i,t),h=d[d.length-1];if(o.get(l)?(o.setIn([a,"nextSibling"],l),o.setIn([l,"prevSibling"],a)):(o.setIn([a,"nextSibling"],i.getNextSiblingKey()),o.setIn([i.getNextSiblingKey(),"prevSibling"],a)),o.setIn([h,"nextSibling"],u),u&&o.setIn([u,"prevSibling"],h),d.forEach(function(S){return o.setIn([S,"parent"],c)}),c){var p=t.get(c),m=p.getChildKeys(),g=m.indexOf(a),w=g+1,C=m.toArray();C.splice.apply(C,[w,0].concat(d)),o.setIn([c,"children"],ZA(C))}})},oB=function(t,r,n,i,o,a){var l=n.first()instanceof TT,u=[],c=i.size,d=n.get(o),h=i.first(),p=i.last(),m=p.getLength(),g=p.getKey(),w=l&&(!d.getChildKeys().isEmpty()||!h.getChildKeys().isEmpty());n.forEach(function(S,y){if(y!==o){u.push(S);return}w?u.push(S):u.push(tB(S,a,i)),i.slice(w?0:1,c-1).forEach(function(k){return u.push(k)}),u.push(rB(S,a,i))});var C=YA.createFromArray(u);return l&&(C=iB(C,n,d,h)),t.merge({blockMap:C,selectionBefore:r,selectionAfter:r.merge({anchorKey:g,anchorOffset:m,focusKey:g,focusOffset:m,isBackward:!1})})},aB=function(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA";r.isCollapsed()||F_(!1);var o=t.getBlockMap(),a=JA(n),l=r.getStartKey(),u=r.getStartOffset(),c=o.get(l);return c instanceof TT&&(c.getChildKeys().isEmpty()||F_(!1)),a.size===1?eB(t,r,o,a.first(),l,u,i):oB(t,r,o,a,l,u)},sB=aB,lB=He,uB=CT,cB=Ve,fB=lB.Repeat;function dB(e,t,r,n){t.isCollapsed()||cB(!1);var i=null;if(r!=null&&(i=r.length),i==null||i===0)return e;var o=e.getBlockMap(),a=t.getStartKey(),l=t.getStartOffset(),u=o.get(a),c=u.getText(),d=u.merge({text:c.slice(0,l)+r+c.slice(l,u.getLength()),characterList:uB(u.getCharacterList(),fB(n,i).toList(),l)}),h=l+i;return e.merge({blockMap:o.set(a,d),selectionAfter:t.merge({anchorOffset:h,focusOffset:h})})}var pB=dB,hB=He,vB=hB.Map;function gB(e,t,r){var n=t.getStartKey(),i=t.getEndKey(),o=e.getBlockMap(),a=o.toSeq().skipUntil(function(l,u){return u===n}).takeUntil(function(l,u){return u===i}).concat(vB([[i,o.get(i)]])).map(r);return e.merge({blockMap:o.merge(a),selectionBefore:t,selectionAfter:t})}var bT=gB,mB=nn,yB=function(t,r){var n=t instanceof mB;if(!n)return null;var i=t.getNextSiblingKey();if(i)return i;var o=t.getParentKey();if(!o)return null;for(var a=r.get(o);a&&!a.getNextSiblingKey();){var l=a.getParentKey();a=l?r.get(l):null}return a?a.getNextSiblingKey():null},OT=yB,_B=nn,Kh=OT,DT=He;DT.List;var K_=DT.Map,mr=function(t,r,n){if(t){var i=r.get(t);i&&r.set(t,n(i))}},Sc=function(t,r){var n=[];if(!t)return n;for(var i=r.get(t);i&&i.getParentKey();){var o=i.getParentKey();o&&n.push(o),i=o?r.get(o):null}return n},wB=function(t,r){var n=[];if(!t)return n;for(var i=Kh(t,r);i&&r.get(i);){var o=r.get(i);n.push(i),i=o.getParentKey()?Kh(o,r):null}return n},Ho=function(t,r,n){if(!t)return null;for(var i=n.get(t.getKey()).getNextSiblingKey();i&&!r.get(i);)i=n.get(i).getNextSiblingKey()||null;return i},Vo=function(t,r,n){if(!t)return null;for(var i=n.get(t.getKey()).getPrevSiblingKey();i&&!r.get(i);)i=n.get(i).getPrevSiblingKey()||null;return i},SB=function(t,r,n,i){return t.withMutations(function(o){if(mr(r.getKey(),o,function(d){return d.merge({nextSibling:Ho(d,o,i),prevSibling:Vo(d,o,i)})}),mr(n.getKey(),o,function(d){return d.merge({nextSibling:Ho(d,o,i),prevSibling:Vo(d,o,i)})}),Sc(r.getKey(),i).forEach(function(d){return mr(d,o,function(h){return h.merge({children:h.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Ho(h,o,i),prevSibling:Vo(h,o,i)})})}),mr(r.getNextSiblingKey(),o,function(d){return d.merge({prevSibling:r.getPrevSiblingKey()})}),mr(r.getPrevSiblingKey(),o,function(d){return d.merge({nextSibling:Ho(d,o,i)})}),mr(n.getNextSiblingKey(),o,function(d){return d.merge({prevSibling:Vo(d,o,i)})}),mr(n.getPrevSiblingKey(),o,function(d){return d.merge({nextSibling:n.getNextSiblingKey()})}),Sc(n.getKey(),i).forEach(function(d){mr(d,o,function(h){return h.merge({children:h.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Ho(h,o,i),prevSibling:Vo(h,o,i)})})}),wB(n,i).forEach(function(d){return mr(d,o,function(h){return h.merge({nextSibling:Ho(h,o,i),prevSibling:Vo(h,o,i)})})}),t.get(r.getKey())==null&&t.get(n.getKey())!=null&&n.getParentKey()===r.getKey()&&n.getPrevSiblingKey()==null){var a=r.getPrevSiblingKey();mr(n.getKey(),o,function(d){return d.merge({prevSibling:a})}),mr(a,o,function(d){return d.merge({nextSibling:n.getKey()})});var l=a?t.get(a):null,u=l?l.getParentKey():null;if(r.getChildKeys().forEach(function(d){mr(d,o,function(h){return h.merge({parent:u})})}),u!=null){var c=t.get(u);mr(u,o,function(d){return d.merge({children:c.getChildKeys().concat(r.getChildKeys())})})}mr(r.getChildKeys().find(function(d){var h=t.get(d);return h.getNextSiblingKey()===null}),o,function(d){return d.merge({nextSibling:r.getNextSiblingKey()})})}})},kB=function(t,r){if(r.isCollapsed())return t;var n=t.getBlockMap(),i=r.getStartKey(),o=r.getStartOffset(),a=r.getEndKey(),l=r.getEndOffset(),u=n.get(i),c=n.get(a),d=u instanceof _B,h=[];if(d){var p=c.getChildKeys(),m=Sc(a,n);c.getNextSiblingKey()&&(h=h.concat(m)),p.isEmpty()||(h=h.concat(m.concat([a]))),h=h.concat(Sc(Kh(c,n),n))}var g;u===c?g=EB(u.getCharacterList(),o,l):g=u.getCharacterList().slice(0,o).concat(c.getCharacterList().slice(l));var w=u.merge({text:u.getText().slice(0,o)+c.getText().slice(l),characterList:g}),C=d&&o===0&&l===0&&c.getParentKey()===i&&c.getPrevSiblingKey()==null,S=C?K_([[i,null]]):n.toSeq().skipUntil(function(k,x){return x===i}).takeUntil(function(k,x){return x===a}).filter(function(k,x){return h.indexOf(x)===-1}).concat(K_([[a,null]])).map(function(k,x){return x===i?w:null}),y=n.merge(S).filter(function(k){return!!k});return d&&u!==c&&(y=SB(y,u,c,n)),t.merge({blockMap:y,selectionBefore:r,selectionAfter:r.merge({anchorKey:i,anchorOffset:o,focusKey:i,focusOffset:o,isBackward:!1})})},EB=function(t,r,n){if(r===0)for(;rr;)t=t.pop(),n--;else{var i=t.slice(0,r),o=t.slice(n);t=i.concat(o).toList()}return t},xB=kB,CB=nn,TB=Fn,$T=He,j_=Ve,bB=bT,OB=$T.List,DB=$T.Map,au=function(t,r,n){if(t){var i=r.get(t);i&&r.set(t,n(i))}},$B=function(t,r,n){return t.withMutations(function(i){var o=r.getKey(),a=n.getKey();au(r.getParentKey(),i,function(l){var u=l.getChildKeys(),c=u.indexOf(o)+1,d=u.toArray();return d.splice(c,0,a),l.merge({children:OB(d)})}),au(r.getNextSiblingKey(),i,function(l){return l.merge({prevSibling:a})}),au(o,i,function(l){return l.merge({nextSibling:a})}),au(a,i,function(l){return l.merge({prevSibling:o})})})},RB=function(t,r){r.isCollapsed()||j_(!1);var n=r.getAnchorKey(),i=t.getBlockMap(),o=i.get(n),a=o.getText();if(!a){var l=o.getType();if(l==="unordered-list-item"||l==="ordered-list-item")return bB(t,r,function(S){return S.merge({type:"unstyled",depth:0})})}var u=r.getAnchorOffset(),c=o.getCharacterList(),d=TB(),h=o instanceof CB,p=o.merge({text:a.slice(0,u),characterList:c.slice(0,u)}),m=p.merge({key:d,text:a.slice(u),characterList:c.slice(u),data:DB()}),g=i.toSeq().takeUntil(function(S){return S===o}),w=i.toSeq().skipUntil(function(S){return S===o}).rest(),C=g.concat([[n,p],[d,m]],w).toOrderedMap();return h&&(o.getChildKeys().isEmpty()||j_(!1),C=$B(C,p,m)),t.merge({blockMap:C,selectionBefore:r,selectionAfter:r.merge({anchorKey:d,anchorOffset:0,focusKey:d,focusOffset:0,isBackward:!1})})},MB=RB,LB=rn,U_=hA,PB=SA,IB=MA,NB=rf,AB=He,BB=sB,zB=pB,FB=Ve,Qd=bT,ls=xT,us=xB,KB=MB,jB=AB.OrderedSet,Uu={replaceText:function(t,r,n,i,o){var a=ls(t,r),l=us(a,r),u=LB.create({style:i||jB(),entity:o||null});return zB(l,l.getSelectionAfter(),n,u)},insertText:function(t,r,n,i,o){return r.isCollapsed()||FB(!1),Uu.replaceText(t,r,n,i,o)},moveText:function(t,r,n){var i=NB(t,r),o=Uu.removeRange(t,r,"backward");return Uu.replaceWithFragment(o,n,i)},replaceWithFragment:function(t,r,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA",o=ls(t,r),a=us(o,r);return BB(a,a.getSelectionAfter(),n,i)},removeRange:function(t,r,n){var i,o,a,l;r.getIsBackward()&&(r=r.merge({anchorKey:r.getFocusKey(),anchorOffset:r.getFocusOffset(),focusKey:r.getAnchorKey(),focusOffset:r.getAnchorOffset(),isBackward:!1})),i=r.getAnchorKey(),o=r.getFocusKey(),a=t.getBlockForKey(i),l=t.getBlockForKey(o);var u=r.getStartOffset(),c=r.getEndOffset(),d=a.getEntityAt(u),h=l.getEntityAt(c-1);if(i===o&&d&&d===h){var p=IB(t.getEntityMap(),a,l,r,n);return us(t,p)}var m=ls(t,r);return us(m,r)},splitBlock:function(t,r){var n=ls(t,r),i=us(n,r);return KB(i,i.getSelectionAfter())},applyInlineStyle:function(t,r,n){return U_.add(t,r,n)},removeInlineStyle:function(t,r,n){return U_.remove(t,r,n)},setBlockType:function(t,r,n){return Qd(t,r,function(i){return i.merge({type:n,depth:0})})},setBlockData:function(t,r,n){return Qd(t,r,function(i){return i.merge({data:n})})},mergeBlockData:function(t,r,n){return Qd(t,r,function(i){return i.merge({data:i.getData().merge(n)})})},applyEntity:function(t,r,n){var i=ls(t,r);return PB(i,r,n)}},xr=Uu;function UB(e){return Object.keys(e).map(function(t){return e[t]})}var RT=UB;function WB(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}var MT=Sl,qB=RT,Dg=He,Qo=Dg.List,GB=Dg.Repeat,LT=Dg.Record,PT=function(){return!0},YB={start:null,end:null},jh=LT(YB),QB={start:null,end:null,decoratorKey:null,leaves:null},Xd=LT(QB),XB={generate:function(t,r,n){var i=r.getLength();if(!i)return Qo.of(new Xd({start:0,end:0,decoratorKey:null,leaves:Qo.of(new jh({start:0,end:0}))}));var o=[],a=n?n.getDecorations(r,t):Qo(GB(null,i)),l=r.getCharacterList();return MT(a,IT,PT,function(u,c){o.push(new Xd({start:u,end:c,decoratorKey:a.get(u),leaves:JB(l.slice(u,c).toList(),u)}))}),Qo(o)},fromJS:function(t){var r=t.leaves,n=VB(t,["leaves"]);return new Xd(WB({},n,{leaves:r!=null?Qo(Array.isArray(r)?r:qB(r)).map(function(i){return jh(i)}):null}))}};function JB(e,t){var r=[],n=e.map(function(i){return i.getStyle()}).toList();return MT(n,IT,PT,function(i,o){r.push(new jh({start:i+t,end:o+t}))}),Qo(r)}function IT(e,t){return e===t}var ZB=XB;function ez(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var tz=He,rz=tz.Record,nz=rz({type:"TOKEN",mutability:"IMMUTABLE",data:Object}),iz=function(e){ez(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.getType=function(){return this.get("type")},r.getMutability=function(){return this.get("mutability")},r.getData=function(){return this.get("data")},t}(nz),NT=iz;function oz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e=="x"?t:t&3|8;return r.toString(16)})}var az=oz;function sz(e){for(var t=1;t=h},r.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},r.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},r.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},r.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},r.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(i){return new t({anchorKey:i,anchorOffset:0,focusKey:i,focusOffset:0,isBackward:!1,hasFocus:!1})},t}(mz),of=yz,qi=function(e){return typeof window<"u"&&window.__DRAFT_GKX?!!window.__DRAFT_GKX[e]:!1},_z=new RegExp("\r","g");function wz(e){return e.replace(_z,"")}var AT=wz;function W_(e){for(var t=1;t1||escape(i.first().getText()).replace(/%u200B/g,"").length>0},r.createEntity=function(i,o,a){return On.__create(i,o,a),this},r.mergeEntityData=function(i,o){return On.__mergeData(i,o),this},r.replaceEntityData=function(i,o){return On.__replaceData(i,o),this},r.addEntity=function(i){return On.__add(i),this},r.getEntity=function(i){return On.__get(i)},r.getAllEntities=function(){return On.__getAll()},r.loadWithEntities=function(i){return On.__loadWithEntities(i)},t.createFromBlockArray=function(i,o){var a=Array.isArray(i)?i:i.contentBlocks,l=Ez.createFromArray(a),u=l.isEmpty()?new su:su.createEmpty(l.first().getKey());return new t({blockMap:l,entityMap:o||On,selectionBefore:u,selectionAfter:u})},t.createFromText=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:/\r\n?|\n/g,a=i.split(o),l=a.map(function(u){return u=Dz(u),new q_({key:Tz(),text:u,type:"unstyled",characterList:V_(Rz(H_.EMPTY,u.length))})});return t.createFromBlockArray(l)},t.fromJS=function(i){return new t(W_({},i,{blockMap:Lz(i.blockMap).map(t.createContentBlockFromJS),selectionBefore:new su(i.selectionBefore),selectionAfter:new su(i.selectionAfter)}))},t.createContentBlockFromJS=function(i){var o=i.characterList;return new q_(W_({},i,{data:Mz(i.data),characterList:o!=null?V_((Array.isArray(o)?o:bz(o)).map(function(a){return H_.fromJS(a)})):void 0}))},t}(Iz),$g=Nz,kc=Ve,Az="NEUTRAL",af="LTR",BT="RTL",Wu=null;function Ec(e){return e===af||e===BT}function zT(e){return Ec(e)||kc(!1),e===af?"ltr":"rtl"}function Bz(e,t){return Ec(e)||kc(!1),Ec(t)||kc(!1),e===t?null:zT(e)}function FT(e){Wu=e}function zz(){FT(af)}function Fz(){return Wu||this.initGlobalDir(),Wu||kc(!1),Wu}var Kz={NEUTRAL:Az,LTR:af,RTL:BT,isStrong:Ec,getHTMLDir:zT,getHTMLDirIfDifferent:Bz,setGlobalDir:FT,initGlobalDir:zz,getGlobalDir:Fz},sf=Kz,ri=sf,jz=Ve,As={L:"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",R:"֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",AL:"؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾"},Uz=new RegExp("["+As.L+As.R+As.AL+"]"),Wz=new RegExp("["+As.R+As.AL+"]");function KT(e){var t=Uz.exec(e);return t==null?null:t[0]}function jT(e){var t=KT(e);return t==null?ri.NEUTRAL:Wz.exec(t)?ri.RTL:ri.LTR}function UT(e,t){if(t=t||ri.NEUTRAL,!e.length)return t;var r=jT(e);return r===ri.NEUTRAL?t:r}function Rg(e,t){return t||(t=ri.getGlobalDir()),ri.isStrong(t)||jz(!1),UT(e,t)}function Hz(e,t){return Rg(e,t)===ri.LTR}function Vz(e,t){return Rg(e,t)===ri.RTL}var qz={firstStrongChar:KT,firstStrongCharDir:jT,resolveBlockDir:UT,getDirection:Rg,isDirectionLTR:Hz,isDirectionRTL:Vz},Mg=qz;function G_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gz=Mg,Y_=sf,Yz=Ve,Qz=function(){function e(r){G_(this,"_defaultDir",void 0),G_(this,"_lastDir",void 0),r?Y_.isStrong(r)||Yz(!1):r=Y_.getGlobalDir(),this._defaultDir=r,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(n){return this._lastDir=Gz.getDirection(n,this._lastDir),this._lastDir},e}(),Xz=Qz,Jz=function(t){if(t!=null)return t;throw new Error("Got unexpected null or undefined")},Cr=Jz,Zz=Xz,WT=He,eF=Cr,tF=WT.OrderedMap,lu,rF={getDirectionMap:function(t,r){lu?lu.reset():lu=new Zz;var n=t.getBlockMap(),i=n.valueSeq().map(function(a){return eF(lu).getDirection(a.getText())}),o=tF(n.keySeq().zip(i));return r!=null&&WT.is(r,o)?r:o}},nF=rF;function Q_(e){for(var t=1;t3&&arguments[3]!==void 0?arguments[3]:!0;if(n.getCurrentContent()===i)return n;var l=uu.getDirectionMap(i,n.getDirectionMap());if(!n.getAllowUndo())return t.set(n,{currentContent:i,directionMap:l,lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:null});var u=n.getSelection(),c=n.getCurrentContent(),d=n.getUndoStack(),h=i;u!==c.getSelectionAfter()||uF(n,o)?(d=d.push(c),h=h.set("selectionBefore",u)):(o==="insert-characters"||o==="backspace-character"||o==="delete-character")&&(h=h.set("selectionBefore",c.getSelectionBefore()));var p=n.getInlineStyleOverride(),m=["adjust-depth","change-block-type","split-block"];m.indexOf(o)===-1&&(p=null);var g={currentContent:h,directionMap:l,undoStack:d,redoStack:no(),lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:p};return t.set(n,g)},t.undo=function(n){if(!n.getAllowUndo())return n;var i=n.getUndoStack(),o=i.peek();if(!o)return n;var a=n.getCurrentContent(),l=uu.getDirectionMap(o,n.getDirectionMap());return t.set(n,{currentContent:o,directionMap:l,undoStack:i.shift(),redoStack:n.getRedoStack().push(a),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:a.getSelectionBefore()})},t.redo=function(n){if(!n.getAllowUndo())return n;var i=n.getRedoStack(),o=i.peek();if(!o)return n;var a=n.getCurrentContent(),l=uu.getDirectionMap(o,n.getDirectionMap());return t.set(n,{currentContent:o,directionMap:l,undoStack:n.getUndoStack().push(a),redoStack:i.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:o.getSelectionAfter()})};function t(r){HT(this,"_immutable",void 0),this._immutable=r}return e.getImmutable=function(){return this._immutable},t}();function Z_(e,t,r){return qT.set(e,{selection:t,forceSelection:r,nativelyRenderedContent:null,inlineStyleOverride:null})}function e0(e,t){return e.getBlockMap().map(function(r){return lf.generate(e,r,t)}).toOrderedMap()}function sF(e,t,r,n){var i=e.getCurrentContent().set("entityMap",r),o=i.getBlockMap(),a=e.getImmutable().get("treeMap");return a.merge(t.toSeq().filter(function(l,u){return l!==o.get(u)}).map(function(l){return lf.generate(i,l,n)}))}function lF(e,t,r,n,i){return r.merge(t.toSeq().filter(function(o){return n.getDecorations(o,e)!==i.getDecorations(o,e)}).map(function(o){return lf.generate(e,o,n)}))}function uF(e,t){var r=e.getLastChangeType();return t!==r||t!=="insert-characters"&&t!=="backspace-character"&&t!=="delete-character"}function cF(e,t){var r=t.getStartKey(),n=t.getStartOffset(),i=e.getBlockForKey(r);return n>0?i.getInlineStyleAt(n-1):i.getLength()?i.getInlineStyleAt(0):GT(e,r)}function fF(e,t){var r=t.getStartKey(),n=t.getStartOffset(),i=e.getBlockForKey(r);return n0?i.getInlineStyleAt(n-1):GT(e,r)}function GT(e,t){var r=e.getBlockMap().reverse().skipUntil(function(n,i){return i===t}).skip(1).skipUntil(function(n,i){return n.getLength()}).first();return r?r.getInlineStyleAt(r.getLength()-1):VT()}var et=qT,dF=nn,pF=OT,YT=He,cu=Ve,hF=YT.OrderedMap,vF=YT.List,Ji=function(t,r,n){if(t){var i=r.get(t);i&&r.set(t,n(i))}},gF=function(t,r,n,i,o){if(!o)return t;var a=i==="after",l=r.getKey(),u=n.getKey(),c=r.getParentKey(),d=r.getNextSiblingKey(),h=r.getPrevSiblingKey(),p=n.getParentKey(),m=a?n.getNextSiblingKey():u,g=a?u:n.getPrevSiblingKey();return t.withMutations(function(w){Ji(c,w,function(C){var S=C.getChildKeys();return C.merge({children:S.delete(S.indexOf(l))})}),Ji(h,w,function(C){return C.merge({nextSibling:d})}),Ji(d,w,function(C){return C.merge({prevSibling:h})}),Ji(m,w,function(C){return C.merge({prevSibling:l})}),Ji(g,w,function(C){return C.merge({nextSibling:l})}),Ji(p,w,function(C){var S=C.getChildKeys(),y=S.indexOf(u),k=a?y+1:y!==0?y-1:0,x=S.toArray();return x.splice(k,0,l),C.merge({children:vF(x)})}),Ji(l,w,function(C){return C.merge({nextSibling:m,prevSibling:g,parent:p})})})},mF=function(t,r,n,i){i==="replace"&&cu(!1);var o=n.getKey(),a=r.getKey();a===o&&cu(!1);var l=t.getBlockMap(),u=r instanceof dF,c=[r],d=l.delete(a);u&&(c=[],d=l.withMutations(function(S){var y=r.getNextSiblingKey(),k=pF(r,S);S.toSeq().skipUntil(function(x){return x.getKey()===a}).takeWhile(function(x){var O=x.getKey(),R=O===a,T=y&&O!==y,A=!y&&x.getParentKey()&&(!k||O!==k);return!!(R||T||A)}).forEach(function(x){c.push(x),S.delete(x.getKey())})}));var h=d.toSeq().takeUntil(function(S){return S===n}),p=d.toSeq().skipUntil(function(S){return S===n}).skip(1),m=c.map(function(S){return[S.getKey(),S]}),g=hF();if(i==="before"){var w=t.getBlockBefore(o);!w||w.getKey()!==r.getKey()||cu(!1),g=h.concat([].concat(m,[[o,n]]),p).toOrderedMap()}else if(i==="after"){var C=t.getBlockAfter(o);!C||C.getKey()!==a||cu(!1),g=h.concat([[o,n]].concat(m),p).toOrderedMap()}return t.merge({blockMap:gF(g,r,n,i,u),selectionBefore:t.getSelectionAfter(),selectionAfter:t.getSelectionAfter().merge({anchorKey:a,focusKey:a})})},yF=mF;function t0(e){for(var t=1;t0?Ie.length===2?typeof Ie[1]==l?this[Ie[0]]=Ie[1].call(this,rr):this[Ie[0]]=Ie[1]:Ie.length===3?typeof Ie[1]===l&&!(Ie[1].exec&&Ie[1].test)?this[Ie[0]]=rr?Ie[1].call(this,rr,Ie[2]):n:this[Ie[0]]=rr?rr.replace(Ie[1],Ie[2]):n:Ie.length===4&&(this[Ie[0]]=rr?Ie[3].call(this,rr.replace(Ie[1],Ie[2])):n):this[Ie]=rr||n;_e+=2}},xt=function(ye,be){for(var _e in be)if(typeof be[_e]===c&&be[_e].length>0){for(var Ke=0;Ke2&&(me[p]="iPad",me[g]=x),me},this.getEngine=function(){var me={};return me[m]=n,me[C]=n,Ye.call(me,Ke,mt.engine),me},this.getOS=function(){var me={};return me[m]=n,me[C]=n,Ye.call(me,Ke,mt.os),Ie&&!me[m]&&vr&&vr.platform&&vr.platform!="Unknown"&&(me[m]=vr.platform.replace(/chrome os/i,st).replace(/macos/i,Lt)),me},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ke},this.setUA=function(me){return Ke=typeof me===d&&me.length>A?Fr(me,A):me,this},this.setUA(Ke),this};tt.VERSION=i,tt.BROWSER=ze([m,C,h]),tt.CPU=ze([S]),tt.DEVICE=ze([p,w,g,y,k,O,x,R,T]),tt.ENGINE=tt.OS=ze([m,C]),e.exports&&(t=e.exports=tt),t.UAParser=tt;var Ft=typeof r!==u&&(r.jQuery||r.Zepto);if(Ft&&!Ft.ua){var hr=new tt;Ft.ua=hr.getResult(),Ft.ua.get=function(){return hr.getUA()},Ft.ua.set=function(ye){hr.setUA(ye);var be=hr.getResult();for(var _e in be)Ft.ua[_e]=be[_e]}}})(typeof window=="object"?window:$i)})(Wh,Wh.exports);var qF=Wh.exports,GF=qF,Ur="Unknown",YF={"Mac OS":"Mac OS X"};function QF(e){return YF[e]||e}function XF(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}var JF=new GF,Wr=JF.getResult(),ZF=XF(Wr.browser.version),e2={browserArchitecture:Wr.cpu.architecture||Ur,browserFullVersion:Wr.browser.version||Ur,browserMinorVersion:ZF.minor||Ur,browserName:Wr.browser.name||Ur,browserVersion:Wr.browser.major||Ur,deviceName:Wr.device.model||Ur,engineName:Wr.engine.name||Ur,engineVersion:Wr.engine.version||Ur,platformArchitecture:Wr.cpu.architecture||Ur,platformName:QF(Wr.os.name)||Ur,platformVersion:Wr.os.version||Ur,platformFullVersion:Wr.os.version||Ur},t2=e2,xc=Ve,ZT=/\./,r2=/\|\|/,n2=/\s+\-\s+/,i2=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,s0=/^(\d*)(.*)/;function o2(e,t){var r=e.split(r2);return r.length>1?r.some(function(n){return nb.contains(n,t)}):(e=r[0].trim(),a2(e,t))}function a2(e,t){var r=e.split(n2);if(r.length>0&&r.length<=2||xc(!1),r.length===1)return ep(r[0],t);var n=r[0],i=r[1];return l0(n)&&l0(i)||xc(!1),ep(">="+n,t)&&ep("<="+i,t)}function ep(e,t){if(e=e.trim(),e==="")return!0;var r=t.split(ZT),n=rb(e),i=n.modifier,o=n.rangeComponents;switch(i){case"<":return eb(r,o);case"<=":return s2(r,o);case">=":return tb(r,o);case">":return u2(r,o);case"~":case"~>":return c2(r,o);default:return l2(r,o)}}function eb(e,t){return Tl(e,t)===-1}function s2(e,t){var r=Tl(e,t);return r===-1||r===0}function l2(e,t){return Tl(e,t)===0}function tb(e,t){var r=Tl(e,t);return r===1||r===0}function u2(e,t){return Tl(e,t)===1}function c2(e,t){var r=t.slice(),n=t.slice();n.length>1&&n.pop();var i=n.length-1,o=parseInt(n[i],10);return Hh(o)&&(n[i]=o+1+""),tb(e,r)&&eb(e,n)}function rb(e){var t=e.split(ZT),r=t[0].match(i2);return r||xc(!1),{modifier:r[1],rangeComponents:[r[2]].concat(t.slice(1))}}function Hh(e){return!isNaN(e)&&isFinite(e)}function l0(e){return!rb(e).modifier}function u0(e,t){for(var r=e.length;rt?1:e0&&(r=n.childNodes.length)}if(r===0){var a=null;if(i!=null)a=i;else{var l=q2(n);a=co(Bs(l))}return{key:a,offset:0}}var u=n.childNodes[r-1],c=null,d=null;if(!Bs(u))c=co(i),d=g0(u);else{var h=G2(u);c=co(Bs(h)),d=g0(h)}return{key:c,offset:d}}function g0(e){var t=e.textContent;return t===` +`?0:t.length}var cb=V2,Y2=cb;function Q2(e,t){var r=t.ownerDocument.defaultView.getSelection(),n=r.anchorNode,i=r.anchorOffset,o=r.focusNode,a=r.focusOffset,l=r.rangeCount;return l===0||n==null||o==null?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:Y2(e,t,n,i,o,a)}var fb=Q2,X2=sb,m0=et,J2=lb,Z2=fb;function eK(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState,r=t.getSelection();X2.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:new Error().stack}),selectionState:JSON.stringify(r.toJS())})}return}var n=e.props.editorState,i=Z2(n,J2(e)),o=i.selectionState;o!==n.getSelection()&&(i.needsRecovery?n=m0.forceSelection(n,o):n=m0.acceptSelection(n,o),e.update(n))}var db=eK;function tK(e){return e!=null&&e!=""}var pb={notEmptyKey:tK},rK=pb,nK=rK.notEmptyKey;function iK(e,t){var r;if(t.isCollapsed()){var n=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(r=e.getBlockForKey(n).getEntityAt(i-1),r!==e.getBlockForKey(n).getEntityAt(i)?null:y0(e.getEntityMap(),r)):null}var o=t.getStartKey(),a=t.getStartOffset(),l=e.getBlockForKey(o);return r=a===l.getLength()?null:l.getEntityAt(a),y0(e.getEntityMap(),r)}function y0(e,t){if(nK(t)){var r=e.__get(t);return r.getMutability()==="MUTABLE"?t:null}return null}var Ag=iK,oK=z2,aK=xr,sK=fi,ds=et,rp=ff,lK=Tr,uK=db,hb=lb,cK=fb,fK=Ag,dK=Cr,pK=lK.isBrowser("IE"),hK=20,np=!1,vu=!1,zs=null;function vK(e){zs||(zs=new oK(hb(e)),zs.start())}var Vh={onCompositionStart:function(t){vu=!0,vK(t)},onCompositionEnd:function(t){np=!1,vu=!1,setTimeout(function(){np||Vh.resolveComposition(t)},hK)},onSelect:uK,onKeyDown:function(t,r){if(!vu){Vh.resolveComposition(t),t._onKeyDown(r);return}(r.which===rp.RIGHT||r.which===rp.LEFT)&&r.preventDefault()},onKeyPress:function(t,r){r.which===rp.RETURN&&r.preventDefault()},resolveComposition:function(t){if(!vu){var r=dK(zs).stopAndFlushMutations();zs=null,np=!0;var n=ds.set(t._latestEditorState,{inCompositionMode:!1});if(t.exitCurrentMode(),!r.size){t.update(n);return}var i=n.getCurrentContent();r.forEach(function(u,c){var d=sK.decode(c),h=d.blockKey,p=d.decoratorKey,m=d.leafKey,g=n.getBlockTree(h).getIn([p,"leaves",m]),w=g.start,C=g.end,S=n.getSelection().merge({anchorKey:h,focusKey:h,anchorOffset:w,focusOffset:C,isBackward:!1}),y=fK(i,S),k=i.getBlockForKey(h).getInlineStyleAt(w);i=aK.replaceText(i,S,u,k,y),n=ds.set(n,{currentContent:i})});var o=cK(n,hb(t)),a=o.selectionState;t.restoreEditorDOM();var l=pK?ds.forceSelection(n,a):ds.acceptSelection(n,a);t.update(ds.push(l,i,"insert-characters"))}}},gK=Vh,ip,_0;function mK(){if(_0)return ip;_0=1;var e=Oo;function t(){return t=e||function(u){for(var c=1;c"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yb=PK,IK=gb,qh=sb,NK=Tr,_b=zg,AK=yb,Fg=uf,BK=Ve,wb=Do,zK=NK.isBrowser("IE");function FK(e,t){if(!e)return"[empty]";var r=Sb(e,t);if(r.nodeType===Node.TEXT_NODE)return r.textContent;wb(r)||BK(!1);var n=r;return n.outerHTML}function Sb(e,t){var r=t!==void 0?t(e):[];if(e.nodeType===Node.TEXT_NODE){var n=e.textContent.length;return Fg(e).createTextNode("[text "+n+(r.length?" | "+r.join(", "):"")+"]")}var i=e.cloneNode();i.nodeType===1&&r.length&&i.setAttribute("data-labels",r.join(", "));for(var o=e.childNodes,a=0;a=u,w=c===r&&n<=d&&i>=d;if(g&&w){a.removeAllRanges(),gu(a,t,u-n,e),Hu(a,t,d-n,e);return}if(!h)g&&(a.removeAllRanges(),gu(a,t,u-n,e)),w&&Hu(a,t,d-n,e);else if(w&&(a.removeAllRanges(),gu(a,t,d-n,e)),g){var C=a.focusNode,S=a.focusOffset;a.removeAllRanges(),gu(a,t,u-n,e),Hu(a,C,S,e)}}}function Hu(e,t,r,n){var i=AK(),o=e.extend;if(o&&t!=null&&_b(i,t)){r>kb(t)&&qh.logSelectionStateFailure({anonymizedDom:Gh(t),extraParams:JSON.stringify({offset:r}),selectionState:JSON.stringify(n.toJS())});var a=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,r)}catch(u){throw qh.logSelectionStateFailure({anonymizedDom:Gh(t,function(c){var d=[];return c===i&&d.push("active element"),c===e.anchorNode&&d.push("selection anchor node"),c===e.focusNode&&d.push("selection focus node"),d}),extraParams:JSON.stringify({activeElementName:i?i.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:a,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:u?""+u:null,offset:r},null,2),selectionState:JSON.stringify(n.toJS(),null,2)}),u}}else if(t&&e.rangeCount>0){var l=e.getRangeAt(0);l.setEnd(t,r),e.addRange(l.cloneRange())}}function gu(e,t,r,n){var i=Fg(t).createRange();if(r>kb(t)&&(qh.logSelectionStateFailure({anonymizedDom:Gh(t),extraParams:JSON.stringify({offset:r}),selectionState:JSON.stringify(n.toJS())}),IK.handleExtensionCausedError()),i.setStart(t,r),zK)try{e.addRange(i)}catch{}else e.addRange(i)}var jK={setDraftEditorSelection:KK,addFocusToSelection:Hu},E0=Oo;function UK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WK(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function HK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var VK=TK,op=F,mu=Ve,qK=vb,GK=jK.setDraftEditorSelection,YK=function(e){WK(t,e);function t(){for(var n,i=arguments.length,o=new Array(i),a=0;a-1;function pj(e){return e=e||document,e.scrollingElement?e.scrollingElement:!dj&&e.compatMode==="CSS1Compat"?e.documentElement:e.body}var hj=pj;function vj(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}var gj=vj,mj=hj,yj=gj;function _j(e){var t=mj(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var r=yj(e),n=e===t?e.ownerDocument.documentElement:e,i=e.scrollWidth-n.clientWidth,o=e.scrollHeight-n.clientHeight;return r.x=Math.max(0,Math.min(r.x,i)),r.y=Math.max(0,Math.min(r.y,o)),r}var pf=_j;function Tb(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function bb(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function Ob(){return{width:window.innerWidth||Tb(),height:window.innerHeight||bb()}}Ob.withoutScrollbars=function(){return{width:Tb(),height:bb()}};var Db=Ob,lp,b0;function wj(){if(b0)return lp;b0=1;var e=Oo;function t(){return t=e||function(N){for(var I=1;I0&&window.scrollTo(X.x,X.y+K+S)}else{C(P)||w(!1);var ae=P,Fe=ae.offsetHeight+ae.offsetTop,Ae=V.offsetHeight+X.y;K=Fe-Ae,K>0&&c.setTop(V,c.getTop(V)+K+S)}}}},U.render=function(){var G=this,J=this.props,P=J.block,V=J.blockRenderMap,X=J.blockRendererFn,K=J.blockStyleFn,ee=J.contentState,te=J.decorator,ie=J.editorKey,ae=J.editorState,Fe=J.customStyleFn,Ae=J.customStyleMap,ce=J.direction,de=J.forceSelection,Te=J.selection,Mt=J.tree,st=null;P.children.size&&(st=P.children.reduce(function(Ye,xt){var tr=l.encode(xt,0,0),ct=ee.getBlockForKey(xt),gt=R(ct,X),tt=gt.CustomComponent||I,Ft=O(ct,V),hr=Ft.Element,ye=Ft.wrapperTemplate,be=T(ct,ie,tr,K,gt,null),_e=i({},G.props,{tree:ae.getBlockTree(xt),blockProps:gt.customProps,offsetKey:tr,block:ct});return Ye.push(u.createElement(hr,be,u.createElement(tt,_e))),!ye||k(ct,ee)||x(ye,hr,Ye),Ye},[]));var Lt=P.getKey(),Wt=l.encode(Lt,0,0),Be=R(P,X),ze=Be.CustomComponent,lt=ze!=null?u.createElement(ze,t({},this.props,{tree:ae.getBlockTree(Lt),blockProps:Be.customProps,offsetKey:Wt,block:P})):u.createElement(a,{block:P,children:st,contentState:ee,customStyleFn:Fe,customStyleMap:Ae,decorator:te,direction:ce,forceSelection:de,hasSelection:y(Te,Lt),selection:Te,tree:Mt});if(P.getParentKey())return lt;var Pe=O(P,V),ut=Pe.Element,Fr=T(P,ie,Wt,K,Be,this.wrapperRef);return u.createElement(ut,Fr,lt)},I}(u.Component);return lp=A,lp}var up,O0;function Sj(){if(O0)return up;O0=1;var e=Oo;function t(){return t=e||function(u){for(var c=1;c0&&window.scrollTo(u.x,u.y+c+R0)}else{Ij(a)||Pj(!1);var m=a.offsetHeight+a.offsetTop,g=l.offsetTop+l.offsetHeight,w=g+u.y;c=m-w,c>0&&$0.setTop(l,$0.getTop(l)+c+R0)}}}}},r._renderChildren=function(){var i=this,o=this.props.block,a=o.getKey(),l=o.getText(),u=this.props.tree.size-1,c=M0(this.props.selection,a);return this.props.tree.map(function(d,h){var p=d.get("leaves");if(p.size===0)return null;var m=p.size-1,g=p.map(function(I,U){var q=D0.encode(a,h,U),G=I.get("start"),J=I.get("end");return _u.createElement(Tj,{key:q,offsetKey:q,block:o,start:G,selection:c?i.props.selection:null,forceSelection:i.props.forceSelection,text:l.slice(G,J),styleSet:o.getInlineStyleAt(G),customStyleMap:i.props.customStyleMap,customStyleFn:i.props.customStyleFn,isLast:h===u&&U===m})}).toArray(),w=d.get("decoratorKey");if(w==null||!i.props.decorator)return g;var C=Nj(i.props.decorator),S=C.getComponentForKey(w);if(!S)return g;var y=C.getPropsForKey(w),k=D0.encode(a,h,0),x=p.first().get("start"),O=p.last().get("end"),R=l.slice(x,O),T=o.getEntityAt(d.get("start")),A=Dj.getHTMLDirIfDifferent(Oj.getDirection(R),i.props.direction),N={contentState:i.props.contentState,decoratedText:R,dir:A,start:x,end:O,blockKey:a,entityKey:T,offsetKey:k};return _u.createElement(S,Yh({},y,N,{key:k}),g)}).toArray()},r.render=function(){var i=this,o=this.props,a=o.direction,l=o.offsetKey,u=$j({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":a==="LTR","public/DraftStyleDefault/rtl":a==="RTL"});return _u.createElement("div",{"data-offset-key":l,className:u,ref:function(d){return i._node=d}},this._renderChildren())},t}(_u.Component),$b=Aj,cp,L0;function Bj(){if(L0)return cp;L0=1;function e(t){var r=t||"",n=arguments.length;if(n>1)for(var i=1;i=4,"public/DraftStyleDefault/listLTR":S==="LTR","public/DraftStyleDefault/listRTL":S==="RTL"})},p=function(m){i(g,m);function g(){return m.apply(this,arguments)||this}var w=g.prototype;return w.shouldComponentUpdate=function(S){var y=this.props.editorState,k=S.editorState,x=y.getDirectionMap(),O=k.getDirectionMap();if(x!==O)return!0;var R=y.getSelection().getHasFocus(),T=k.getSelection().getHasFocus();if(R!==T)return!0;var A=k.getNativelyRenderedContent(),N=y.isInCompositionMode(),I=k.isInCompositionMode();if(y===k||A!==null&&k.getCurrentContent()===A||N&&I)return!1;var U=y.getCurrentContent(),q=k.getCurrentContent(),G=y.getDecorator(),J=k.getDecorator();return N!==I||U!==q||G!==J||k.mustForceSelection()},w.render=function(){for(var S=this.props,y=S.blockRenderMap,k=S.blockRendererFn,x=S.blockStyleFn,O=S.customStyleMap,R=S.customStyleFn,T=S.editorState,A=S.editorKey,N=S.preventScroll,I=S.textDirectionality,U=T.getCurrentContent(),q=T.getSelection(),G=T.mustForceSelection(),J=T.getDecorator(),P=d(T.getDirectionMap()),V=U.getBlocksAsArray(),X=[],K=null,ee=null,te=0;teK;Pe=c(Pe,h(Fe,lt,ut,Mt))}var Fr=ce||o,Ye={className:Pe,"data-block":!0,"data-editor":A,"data-offset-key":st,key:ae};Te!==void 0&&(Ye=r({},Ye,{contentEditable:Te,suppressContentEditableWarning:!0}));var xt=l.createElement(ze,Ye,l.createElement(Fr,t({},Lt,{key:ae})));X.push({block:xt,wrapperTemplate:Be,key:ae,offsetKey:st}),Be?K=ie.getDepth():K=null,ee=Be}for(var tr=[],ct=0;ct0},e}(),Mb=r3,n3=Ve,N0=/\.textClipping$/,i3={"text/plain":!0,"text/html":!0,"text/rtf":!0},o3=5e3;function a3(e,t){var r=0,n=[];e.forEach(function(i){s3(i,function(o){r++,o&&n.push(o.slice(0,o3)),r==e.length&&t(n.join("\r"))})})}function s3(e,t){if(!$i.FileReader||e.type&&!(e.type in i3)){t("");return}if(e.type===""){var r="";N0.test(e.name)&&(r=e.name.replace(N0,"")),t(r);return}var n=new FileReader;n.onload=function(){var i=n.result;typeof i!="string"&&n3(!1),t(i)},n.onerror=function(){t("")},n.readAsText(e)}var Lb=a3;function l3(e){return e==="handled"||e===!0}var vf=l3,u3=Mb,Pb=xr,Ib=et,c3=cf,f3=uf,d3=Lb,p3=ub,h3=ab,A0=vf,dp=Cr;function v3(e,t){var r=null,n=null,i=f3(e.currentTarget);if(typeof i.caretRangeFromPoint=="function"){var o=i.caretRangeFromPoint(e.x,e.y);r=o.startContainer,n=o.startOffset}else if(e.rangeParent)r=e.rangeParent,n=e.rangeOffset;else return null;r=dp(r),n=dp(n);var a=dp(c3(r));return p3(t,a,n,a,n)}var g3={onDragEnd:function(t){t.exitCurrentMode(),B0(t)},onDrop:function(t,r){var n=new u3(r.nativeEvent.dataTransfer),i=t._latestEditorState,o=v3(r.nativeEvent,i);if(r.preventDefault(),t._dragCount=0,t.exitCurrentMode(),o!=null){var a=n.getFiles();if(a.length>0){if(t.props.handleDroppedFiles&&A0(t.props.handleDroppedFiles(o,a)))return;d3(a,function(u){u&&t.update(z0(i,o,u))});return}var l=t._internalDrag?"internal":"external";t.props.handleDrop&&A0(t.props.handleDrop(o,n,l))||(t._internalDrag?t.update(m3(i,o)):t.update(z0(i,o,n.getText()))),B0(t)}}};function B0(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var r=new MouseEvent("mouseup",{view:h3(t),bubbles:!0,cancelable:!0});t.dispatchEvent(r)}}function m3(e,t){var r=Pb.moveText(e.getCurrentContent(),e.getSelection(),t);return Ib.push(e,r,"insert-fragment")}function z0(e,t,r){var n=Pb.insertText(e.getCurrentContent(),t,r,e.getCurrentInlineStyle());return Ib.push(e,n,"insert-fragment")}var y3=g3;function _3(e){var t=e.getSelection(),r=t.getAnchorKey(),n=e.getBlockTree(r),i=t.getStartOffset(),o=!1;return n.some(function(a){return i===a.get("start")?(o=!0,!0):i"u"?$i:self);var S3=$i.setImmediate,k3=xr,Qh=et,E3=Tr,F0=Ag,x3=vf,C3=w3,K0=Cr,T3=S3,b3="'",O3="/",D3=E3.isBrowser("Firefox");function $3(e){return D3&&(e==b3||e==O3)}function j0(e,t,r,n,i){var o=k3.replaceText(e.getCurrentContent(),e.getSelection(),t,r,n);return Qh.push(e,o,"insert-characters",i)}function R3(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var r=e._latestEditorState,n=t.data;if(n){if(e.props.handleBeforeInput&&x3(e.props.handleBeforeInput(n,r,t.timeStamp))){t.preventDefault();return}var i=r.getSelection(),o=i.getStartOffset(),a=i.getAnchorKey();if(!i.isCollapsed()){t.preventDefault(),e.update(j0(r,n,r.getCurrentInlineStyle(),F0(r.getCurrentContent(),r.getSelection()),!0));return}var l=j0(r,n,r.getCurrentInlineStyle(),F0(r.getCurrentContent(),r.getSelection()),!1),u=!1;if(u||(u=C3(e._latestCommittedEditorState)),!u){var c=r.getBlockTree(a),d=l.getBlockTree(a);u=c.size!==d.size||c.zip(d).some(function(h){var p=h[0],m=h[1],g=p.get("start"),w=g+(g>=o?n.length:0),C=p.get("end"),S=C+(C>=o?n.length:0),y=m.get("start"),k=m.get("end"),x=m.get("decoratorKey");return p.get("decoratorKey")!==x||p.get("leaves").size!==m.get("leaves").size||w!==y||S!==k||x!=null&&k-y!==C-g})}if(u||(u=$3(n)),u||(u=K0(l.getDirectionMap()).get(a)!==K0(r.getDirectionMap()).get(a)),u){t.preventDefault(),l=Qh.set(l,{forceSelection:!0}),e.update(l);return}l=Qh.set(l,{nativelyRenderedContent:l.getCurrentContent()}),e._pendingStateFromBeforeInput=l,T3(function(){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)})}}var M3=R3,L3=et,U0=zg,P3=yb;function I3(e,t){var r=t.currentTarget.ownerDocument;if(!e.props.preserveSelectionOnBlur&&P3(r)===r.body){var n=r.defaultView.getSelection(),i=e.editor;n.rangeCount===1&&U0(i,n.anchorNode)&&U0(i,n.focusNode)&&n.removeAllRanges()}var o=e._latestEditorState,a=o.getSelection();if(a.getHasFocus()){var l=a.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(L3.acceptSelection(o,l))}}var N3=I3,A3=et;function B3(e,t){e.setMode("composite"),e.update(A3.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}var z3=B3,F3=rf;function K3(e){var t=e.getSelection();return t.isCollapsed()?null:F3(e.getCurrentContent(),t)}var Nb=K3,j3=Nb;function U3(e,t){var r=e._latestEditorState,n=r.getSelection();if(n.isCollapsed()){t.preventDefault();return}e.setClipboard(j3(e._latestEditorState))}var W3=U3;function H3(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}var V3=H3,q3=xr,G3=et,Y3=df,Q3=Nb,X3=pf,J3=V3;function Z3(e,t){var r=e._latestEditorState,n=r.getSelection(),i=t.target,o;if(n.isCollapsed()){t.preventDefault();return}if(J3(i)){var a=i;o=X3(Y3.getScrollParent(a))}var l=Q3(r);e.setClipboard(l),e.setMode("cut"),setTimeout(function(){e.restoreEditorDOM(o),e.exitCurrentMode(),e.update(eU(r))},0)}function eU(e){var t=q3.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return G3.push(e,t,"remove-range")}var tU=Z3;function rU(e,t){e.setMode("drag"),t.preventDefault()}var nU=rU;function iU(e){e._internalDrag=!0,e.setMode("drag")}var oU=iU,W0=et,aU=Tr;function sU(e,t){var r=e._latestEditorState,n=r.getSelection();if(!n.getHasFocus()){var i=n.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),aU.isBrowser("Chrome < 60.0.3081.0")?e.update(W0.forceSelection(r,i)):e.update(W0.acceptSelection(r,i))}}var lU=sU,uU=Ve,Ab=55296,cU=56319,fU=56320,Bb=57343,dU=/[\uD800-\uDFFF]/;function zb(e){return Ab<=e&&e<=Bb}function pU(e,t){if(0<=t&&tn||r<=0)return"";var i=0;if(t>0){for(;t>0&&i=n)return""}else if(t<0){for(i=n;t<0&&00&&oo){var u=n.getKeyBefore(i);if(u==null)a=i;else{a=u;var c=n.getBlockForKey(u);l=c.getText().length}}else l=o-t;return r.merge({focusKey:a,focusOffset:l,isBackward:!0})}var Ug=yU,_U=xr,wU=qi,H0=wU("draft_tree_data_support");function SU(e,t,r){var n=e.getSelection(),i=e.getCurrentContent(),o=n,a=n.getAnchorKey(),l=n.getFocusKey(),u=i.getBlockForKey(a);if(H0&&r==="forward"&&a!==l)return i;if(n.isCollapsed()){if(r==="forward"){if(e.isSelectionAtEndOfContent())return i;if(H0){var c=n.getAnchorOffset()===i.getBlockForKey(a).getLength();if(c){var d=i.getBlockForKey(u.nextSibling);if(!d||d.getLength()===0)return i}}}else if(e.isSelectionAtStartOfContent())return i;if(o=t(e),o===n)return i}return _U.removeRange(i,o,r)}var Ol=SU,kU=et,EU=Ro,xU=Ug,CU=Ol;function TU(e){var t=CU(e,function(n){var i=n.getSelection(),o=n.getCurrentContent(),a=i.getAnchorKey(),l=i.getAnchorOffset(),u=o.getBlockForKey(a).getText()[l-1];return xU(n,u?EU.getUTF16Length(u,0):1)},"backward");if(t===e.getCurrentContent())return e;var r=e.getSelection();return kU.push(e,t.set("selectionBefore",r),r.isCollapsed()?"backspace-character":"remove-range")}var Kb=TU,bU=xr,OU=fi,DU=et,$U=Tr,RU=pb,MU=RU.notEmptyKey,LU=cf,PU=Kb,IU=Cr,NU=$U.isEngine("Gecko"),AU=` + +`;function BU(e,t){switch(e){case"deleteContentBackward":return PU(t)}return t}function zU(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var r=e.editor,n=r.ownerDocument.defaultView.getSelection(),i=n.anchorNode,o=n.isCollapsed,a=(i==null?void 0:i.nodeType)!==Node.TEXT_NODE&&(i==null?void 0:i.nodeType)!==Node.ELEMENT_NODE;if(!(i==null||a)){if(i.nodeType===Node.TEXT_NODE&&(i.previousSibling!==null||i.nextSibling!==null)){var l=i.parentNode;if(l==null)return;i.nodeValue=l.textContent;for(var u=l.firstChild;u!=null;u=u.nextSibling)u!==i&&l.removeChild(u)}var c=i.textContent,d=e._latestEditorState,h=IU(LU(i)),p=OU.decode(h),m=p.blockKey,g=p.decoratorKey,w=p.leafKey,C=d.getBlockTree(m).getIn([g,"leaves",w]),S=C.start,y=C.end,k=d.getCurrentContent(),x=k.getBlockForKey(m),O=x.getText().slice(S,y);if(c.endsWith(AU)&&(c=c.slice(0,-1)),c===O){var R=t.nativeEvent.inputType;if(R){var T=BU(R,d);if(T!==d){e.restoreEditorDOM(),e.update(T);return}}return}var A=d.getSelection(),N=A.merge({anchorOffset:S,focusOffset:y,isBackward:!1}),I=x.getEntityAt(S),U=MU(I)?k.getEntity(I):null,q=U!=null?U.getMutability():null,G=q==="MUTABLE",J=G?"spellcheck-change":"apply-entity",P=bU.replaceText(k,N,c,x.getInlineStyleAt(S),G?x.getEntityAt(S):null),V,X,K,ee;if(NU)V=n.anchorOffset,X=n.focusOffset,K=S+Math.min(V,X),ee=K+Math.abs(V-X),V=K,X=ee;else{var te=c.length-O.length;K=A.getStartOffset(),ee=A.getEndOffset(),V=o?ee+te:K,X=ee+te}var ie=P.merge({selectionBefore:k.getSelectionAfter(),selectionAfter:A.merge({anchorOffset:V,focusOffset:X})});e.update(DU.push(d,ie,J))}}var FU=zU,KU=ff;function jU(e){return e.which===KU.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}var UU=jU,WU=Tr,HU=UU,pp=WU.isPlatform("Mac OS X"),jb={isCtrlKeyCommand:function(t){return!!t.ctrlKey&&!t.altKey},isOptionKeyCommand:function(t){return pp&&t.altKey},usesMacOSHeuristics:function(){return pp},hasCommandModifier:function(t){return pp?!!t.metaKey&&!t.altKey:jb.isCtrlKeyCommand(t)},isSoftNewlineEvent:HU},Wg=jb,V0=xr,q0=et,VU=rf,qU=Cr,hp=null,GU={cut:function(t){var r=t.getCurrentContent(),n=t.getSelection(),i=null;if(n.isCollapsed()){var o=n.getAnchorKey(),a=r.getBlockForKey(o).getLength();if(a===n.getAnchorOffset()){var l=r.getKeyAfter(o);if(l==null)return t;i=n.set("focusKey",l).set("focusOffset",0)}else i=n.set("focusOffset",a)}else i=n;i=qU(i),hp=VU(r,i);var u=V0.removeRange(r,i,"forward");return u===r?t:q0.push(t,u,"remove-range")},paste:function(t){if(!hp)return t;var r=V0.replaceWithFragment(t.getCurrentContent(),t.getSelection(),hp);return q0.push(t,r,"insert-fragment")}},YU=GU,QU=Tr,XU=Ve,JU=QU.isBrowser("Chrome");function ZU(e){for(var t=e.cloneRange(),r=[],n=e.endContainer;n!=null;n=n.parentNode){var i=n===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var o=Array.from(t.getClientRects());if(r.push(o),i){var a;return r.reverse(),(a=[]).concat.apply(a,r)}t.setEndBefore(n)}XU(!1)}var e4=JU?ZU:function(e){return Array.from(e.getClientRects())},Ub=e4,t4=Ro,r4=uf,G0=Ub,Xh=Ve;function n4(e){var t=getComputedStyle(e),r=r4(e),n=r.createElement("div");n.style.fontFamily=t.fontFamily,n.style.fontSize=t.fontSize,n.style.fontStyle=t.fontStyle,n.style.fontWeight=t.fontWeight,n.style.lineHeight=t.lineHeight,n.style.position="absolute",n.textContent="M";var i=r.body;i||Xh(!1),i.appendChild(n);var o=n.getBoundingClientRect();return i.removeChild(n),o.height}function Y0(e,t){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0;a=0;u--)if(!(l!=null&&u>0&&t4.isSurrogatePair(l,u-1)))if(e.setStart(o,u),Y0(G0(e),r))n=o,i=u;else break;if(u===-1||o.childNodes.length===0)break;o=o.childNodes[u],a=i4(o)}while(!0);return e.setStart(n,i),e}var a4=o4,s4=et,l4=a4,u4=cb,c4=Ug,f4=Ol;function d4(e,t){var r=f4(e,function(n){var i=n.getSelection();if(i.isCollapsed()&&i.getAnchorOffset()===0)return c4(n,1);var o=t.currentTarget.ownerDocument,a=o.defaultView.getSelection(),l=a.getRangeAt(0);return l=l4(l),u4(n,null,l.endContainer,l.endOffset,l.startContainer,l.startOffset).selectionState},"backward");return r===e.getCurrentContent()?e:s4.push(e,r,"remove-range")}var p4=d4,h4=`[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]`,v4={getPunctuation:function(){return h4}},g4=v4,m4=g4.getPunctuation(),Wb="['‘’]",wa="\\s|(?![_])"+m4,y4="^(?:"+wa+")*(?:"+Wb+"|(?!"+wa+").)*(?:(?!"+wa+").)",_4=new RegExp(y4),w4="(?:(?!"+wa+").)(?:"+Wb+"|(?!"+wa+").)*(?:"+wa+")*$",S4=new RegExp(w4);function Q0(e,t){var r=t?S4.exec(e):_4.exec(e);return r?r[0]:e}var k4={getBackward:function(t){return Q0(t,!0)},getForward:function(t){return Q0(t,!1)}},Hb=k4,E4=Hb,x4=et,X0=Ug,C4=Ol;function T4(e){var t=C4(e,function(r){var n=r.getSelection(),i=n.getStartOffset();if(i===0)return X0(r,1);var o=n.getStartKey(),a=r.getCurrentContent(),l=a.getBlockForKey(o).getText().slice(0,i),u=E4.getBackward(l);return X0(r,u.length||1)},"backward");return t===e.getCurrentContent()?e:x4.push(e,t,"remove-range")}var b4=T4;function O4(e,t){var r=e.getSelection(),n=r.getStartKey(),i=r.getStartOffset(),o=e.getCurrentContent(),a=n,l,u=o.getBlockForKey(n);return t>u.getText().length-i?(a=o.getKeyAfter(n),l=0):l=i+t,r.merge({focusKey:a,focusOffset:l})}var Vb=O4,D4=Hb,$4=et,R4=Vb,M4=Ol;function L4(e){var t=M4(e,function(r){var n=r.getSelection(),i=n.getStartOffset(),o=n.getStartKey(),a=r.getCurrentContent(),l=a.getBlockForKey(o).getText().slice(i),u=D4.getForward(l);return R4(r,u.length||1)},"forward");return t===e.getCurrentContent()?e:$4.push(e,t,"remove-range")}var P4=L4,I4=xr,N4=et;function A4(e){var t=I4.splitBlock(e.getCurrentContent(),e.getSelection());return N4.push(e,t,"split-block")}var B4=A4,z4=et;function F4(e){var t=e.getSelection(),r=t.getEndKey(),n=e.getCurrentContent(),i=n.getBlockForKey(r).getLength();return z4.set(e,{selection:t.merge({anchorKey:r,anchorOffset:i,focusKey:r,focusOffset:i,isBackward:!1}),forceSelection:!0})}var K4=F4,j4=et;function U4(e){var t=e.getSelection(),r=t.getStartKey();return j4.set(e,{selection:t.merge({anchorKey:r,anchorOffset:0,focusKey:r,focusOffset:0,isBackward:!1}),forceSelection:!0})}var W4=U4,H4=et,V4=Ro,q4=Vb,G4=Ol;function Y4(e){var t=G4(e,function(n){var i=n.getSelection(),o=n.getCurrentContent(),a=i.getAnchorKey(),l=i.getAnchorOffset(),u=o.getBlockForKey(a).getText()[l];return q4(n,u?V4.getUTF16Length(u,0):1)},"forward");if(t===e.getCurrentContent())return e;var r=e.getSelection();return H4.push(e,t.set("selectionBefore",r),r.isCollapsed()?"delete-character":"remove-range")}var Q4=Y4,J0=xr,Z0=et,X4=rf;function J4(e){var t=e.getSelection();if(!t.isCollapsed())return e;var r=t.getAnchorOffset();if(r===0)return e;var n=t.getAnchorKey(),i=e.getCurrentContent(),o=i.getBlockForKey(n),a=o.getLength();if(a<=1)return e;var l,u;r===a?(l=t.set("anchorOffset",r-1),u=t):(l=t.set("focusOffset",r+1),u=l.set("anchorOffset",r+1));var c=X4(i,l),d=J0.removeRange(i,l,"backward"),h=d.getSelectionAfter(),p=h.getAnchorOffset()-1,m=h.merge({anchorOffset:p,focusOffset:p}),g=J0.replaceWithFragment(d,m,c),w=Z0.push(e,g,"insert-fragment");return Z0.acceptSelection(w,u)}var Z4=J4,vp=et;function e5(e,t,r){var n=vp.undo(t);if(t.getLastChangeType()==="spellcheck-change"){var i=n.getCurrentContent();r(vp.set(n,{nativelyRenderedContent:i}));return}if(e.preventDefault(),!t.getNativelyRenderedContent()){r(n);return}r(vp.set(t,{nativelyRenderedContent:null})),setTimeout(function(){r(n)},0)}var t5=e5,r5=xr,qb=et,n5=Wg,Wn=ff,ew=YU,i5=Tr,tw=vf,o5=p4,a5=b4,s5=P4,l5=B4,u5=K4,c5=W4,f5=Kb,d5=Q4,p5=Z4,h5=t5,rw=n5.isOptionKeyCommand,nw=i5.isBrowser("Chrome");function v5(e,t,r){switch(e){case"redo":return qb.redo(t);case"delete":return d5(t);case"delete-word":return s5(t);case"backspace":return f5(t);case"backspace-word":return a5(t);case"backspace-to-start-of-line":return o5(t,r);case"split-block":return l5(t);case"transpose-characters":return p5(t);case"move-selection-to-start-of-block":return c5(t);case"move-selection-to-end-of-block":return u5(t);case"secondary-cut":return ew.cut(t);case"secondary-paste":return ew.paste(t);default:return t}}function g5(e,t){var r=t.which,n=e._latestEditorState;function i(u){var c=e.props[u];return c?(c(t),!0):!1}switch(r){case Wn.RETURN:if(t.preventDefault(),e.props.handleReturn&&tw(e.props.handleReturn(t,n)))return;break;case Wn.ESC:if(t.preventDefault(),i("onEscape"))return;break;case Wn.TAB:if(i("onTab"))return;break;case Wn.UP:if(i("onUpArrow"))return;break;case Wn.RIGHT:if(i("onRightArrow"))return;break;case Wn.DOWN:if(i("onDownArrow"))return;break;case Wn.LEFT:if(i("onLeftArrow"))return;break;case Wn.SPACE:nw&&rw(t)&&t.preventDefault()}var o=e.props.keyBindingFn(t);if(o==null||o===""){if(r===Wn.SPACE&&nw&&rw(t)){var a=r5.replaceText(n.getCurrentContent(),n.getSelection()," ");e.update(qb.push(n,a,"insert-characters"))}return}if(o==="undo"){h5(t,n,e.update);return}if(t.preventDefault(),!(e.props.handleKeyCommand&&tw(e.props.handleKeyCommand(o,n,t.timeStamp)))){var l=v5(o,n,t);l!==n&&e.update(l)}}var m5=g5;function y5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _5=function(){function e(r){y5(this,"_uri",void 0),this._uri=r}var t=e.prototype;return t.toString=function(){return this._uri},e}(),w5=_5,S5=Tr,k5=Ve,E5=S5.isBrowser("IE <= 9");function x5(e){var t,r=null;return!E5&&document.implementation&&document.implementation.createHTMLDocument&&(t=document.implementation.createHTMLDocument("foo"),t.documentElement||k5(!1),t.documentElement.innerHTML=e,r=t.getElementsByTagName("body")[0]),r}var Gb=x5,C5=Do;function T5(e){return!e||!e.ownerDocument?!1:C5(e)&&e.nodeName==="A"}var b5=T5,O5=Do;function D5(e){return!e||!e.ownerDocument?!1:O5(e)&&e.nodeName==="IMG"}var $5=D5,Zi;function gp(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0;return Object.keys(sw).some(function(n){t.classList.contains(n)&&(r=sw[n])}),r},J5=function(t){if(!Jb(t))return!1;var r=t;if(!r.href||r.protocol!=="http:"&&r.protocol!=="https:"&&r.protocol!=="mailto:"&&r.protocol!=="tel:")return!1;try{var n=new Yb(r.href);return!0}catch{return!1}},Z5=function(t){if(!Zb(t))return!1;var r=t;return!!(r.attributes.getNamedItem("src")&&r.attributes.getNamedItem("src").value)},e6=function(t,r){if(!Vg(t))return r;var n=t,i=n.style.fontWeight,o=n.style.fontStyle,a=n.style.textDecoration;return r.withMutations(function(l){H5.indexOf(i)>=0?l.add("BOLD"):V5.indexOf(i)>=0&&l.remove("BOLD"),o==="italic"?l.add("ITALIC"):o==="normal"&&l.remove("ITALIC"),a==="underline"&&l.add("UNDERLINE"),a==="line-through"&&l.add("STRIKETHROUGH"),a==="none"&&(l.remove("UNDERLINE"),l.remove("STRIKETHROUGH"))})},mp=function(t){return t==="ul"||t==="ol"},t6=function(){function e(r,n){Xt(this,"characterList",yi()),Xt(this,"currentBlockType","unstyled"),Xt(this,"currentDepth",0),Xt(this,"currentEntity",null),Xt(this,"currentText",""),Xt(this,"wrapper",null),Xt(this,"blockConfigs",[]),Xt(this,"contentBlocks",[]),Xt(this,"entityMap",iw),Xt(this,"blockTypeMap",void 0),Xt(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=r,this.disambiguate=n}var t=e.prototype;return t.clear=function(){this.characterList=yi(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=iw,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(n){var i;return this.contentBlocks=[],this.currentDepth=0,(i=this.blockConfigs).push.apply(i,this._toBlockConfigs([n],N5())),this._trimCurrentText(),this.currentText!==""&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return this.contentBlocks.length===0&&(aw?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.key||ow(),o=gp({key:i,type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:yi(),prevSibling:null,nextSibling:null,childConfigs:[]},n);return this.characterList=yi(),this.currentBlockType="unstyled",this.currentText="",o},t._toBlockConfigs=function(n,i){for(var o=[],a=0;ao?(this.currentText="",this.characterList=yi()):(this.currentText=this.currentText.slice(i,o),this.characterList=this.characterList.slice(i,o))},t._addTextNode=function(n,i){var o=n.textContent,a=o.trim();a===""&&this.wrapper!=="pre"&&(o=" "),this.wrapper!=="pre"&&(o=o.replace(K5,""),o=o.replace(F5,eO)),this._appendText(o,i)},t._addBreakNode=function(n,i){A5(n)&&this._appendText(` +`,i)},t._addImgNode=function(n,i){if(Zb(n)){var o=n,a={};G5.forEach(function(l){var u=o.getAttribute(l);u&&(a[l]=u)}),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",a),Qb("draftjs_fix_paste_for_img")?o.getAttribute("role")!=="presentation"&&this._appendText("📷",i):this._appendText("📷",i),this.currentEntity=null}},t._addAnchorNode=function(n,i,o){if(Jb(n)){var a=n,l={};q5.forEach(function(u){var c=a.getAttribute(u);c&&(l[u]=c)}),l.url=new Yb(a.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",l||{}),i.push.apply(i,this._toBlockConfigs(Array.from(n.childNodes),o)),this.currentEntity=null}},t._toContentBlocks=function(n){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=n.length-1,a=0;a<=o;a++){var l=n[a];l.parent=i,l.prevSibling=a>0?n[a-1].key:null,l.nextSibling=a1&&arguments[1]!==void 0?arguments[1]:I5,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P5;t=t.trim().replace(z5,"").replace(j5,eO).replace(U5,"").replace(W5,"");var i=r(t);if(!i)return null;var o=Y5(n),a=function(u,c){return u==="li"?c==="ol"?"ordered-list-item":"unordered-list-item":null};return new t6(o,a).addDOMNode(i).getContentBlocks()},tO=r6;function n6(e){for(var t=1;t0){if(e.props.handlePastedFiles&&dw(e.props.handlePastedFiles(n)))return;C6(n,function(R){if(R=R||i,!!R){var T=e._latestEditorState,A=pw(R),N=uw.create({style:T.getCurrentInlineStyle(),entity:fw(T.getCurrentContent(),T.getSelection())}),I=cw.getCurrentBlockType(T),U=_p.processText(A,N,I),q=yp.createFromArray(U),G=oO.replaceWithFragment(T.getCurrentContent(),T.getSelection(),q);e.update(aO.push(T,G,"insert-fragment"))}});return}}var o=[],a=r.getText(),l=r.getHTML(),u=e._latestEditorState;if(e.props.formatPastedText){var c=e.props.formatPastedText(a,l),d=c.text,h=c.html;a=d,l=h}if(!(e.props.handlePastedText&&dw(e.props.handlePastedText(a,l,u)))){if(a&&(o=pw(a)),!e.props.stripPastedStyles){var p=e.getClipboard();if(!e.props.formatPastedText&&r.isRichText()&&p){var m;if(((m=l)===null||m===void 0?void 0:m.indexOf(e.getEditorKey()))!==-1||o.length===1&&p.size===1&&p.first().getText()===a){e.update(Su(e._latestEditorState,p));return}}else if(p&&r.types.includes("com.apple.webarchive")&&!r.types.includes("text/html")&&b6(o,p)){e.update(Su(e._latestEditorState,p));return}if(l){var g=_p.processHTML(l,e.props.blockRenderMap);if(g){var w=g.contentBlocks,C=g.entityMap;if(w){var S=yp.createFromArray(w);e.update(Su(e._latestEditorState,S,C));return}}}e.setClipboard(null)}if(o.length){var y=uw.create({style:u.getCurrentInlineStyle(),entity:fw(u.getCurrentContent(),u.getSelection())}),k=cw.getCurrentBlockType(u),x=_p.processText(o,y,k),O=yp.createFromArray(x);e.update(Su(e._latestEditorState,O))}}}function Su(e,t,r){var n=oO.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return aO.push(e,n.set("entityMap",r),"insert-fragment")}function b6(e,t){return e.length===t.size&&t.valueSeq().every(function(r,n){return r.getText()===e[n]})}var O6=T6,sO=Tr,D6=M3,$6=N3,R6=z3,M6=W3,L6=tU,P6=nU,I6=oU,N6=lU,A6=FU,B6=m5,z6=O6,lO=db,F6=sO.isBrowser("Chrome"),K6=sO.isBrowser("Firefox"),hw=F6||K6?lO:function(e){},j6={onBeforeInput:D6,onBlur:$6,onCompositionStart:R6,onCopy:M6,onCut:L6,onDragOver:P6,onDragStart:I6,onFocus:N6,onInput:A6,onKeyDown:B6,onPaste:z6,onSelect:lO,onMouseUp:hw,onKeyUp:hw},U6=j6,W6=jc,H6=W6.unstable_flushControlled,V6=H6;function q6(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var wp=F,vw=bo,G6=function(e){q6(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.shouldComponentUpdate=function(i){return this.props.text!==i.text||this.props.editorState.getSelection().getHasFocus()!==i.editorState.getSelection().getHasFocus()},r.render=function(){var i=this.props.editorState.getSelection().getHasFocus(),o=vw({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":i}),a={whiteSpace:"pre-wrap"};return wp.createElement("div",{className:o},wp.createElement("div",{className:vw("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:a},this.props.text))},t}(wp.Component),Y6=G6,uO=Wg,vs=ff,cO=Tr,Di=cO.isPlatform("Mac OS X"),gw=Di&&cO.isBrowser("Firefox < 29"),xi=uO.hasCommandModifier,Hn=uO.isCtrlKeyCommand;function fO(e){return Di&&e.altKey||Hn(e)}function Q6(e){return xi(e)?e.shiftKey?"redo":"undo":null}function X6(e){return!Di&&e.shiftKey?null:fO(e)?"delete-word":"delete"}function J6(e){return xi(e)&&Di?"backspace-to-start-of-line":fO(e)?"backspace-word":"backspace"}function Z6(e){switch(e.keyCode){case 66:return xi(e)?"bold":null;case 68:return Hn(e)?"delete":null;case 72:return Hn(e)?"backspace":null;case 73:return xi(e)?"italic":null;case 74:return xi(e)?"code":null;case 75:return Di&&Hn(e)?"secondary-cut":null;case 77:return Hn(e)?"split-block":null;case 79:return Hn(e)?"split-block":null;case 84:return Di&&Hn(e)?"transpose-characters":null;case 85:return xi(e)?"underline":null;case 87:return Di&&Hn(e)?"backspace-word":null;case 89:return Hn(e)?Di?"secondary-paste":"redo":null;case 90:return Q6(e)||null;case vs.RETURN:return"split-block";case vs.DELETE:return X6(e);case vs.BACKSPACE:return J6(e);case vs.LEFT:return gw&&xi(e)?"move-selection-to-start-of-block":null;case vs.RIGHT:return gw&&xi(e)?"move-selection-to-end-of-block":null;default:return null}}var dO=Z6,e8=Oo;function Jh(){return Jh=e8||function(e){for(var t=1;t0)||(delete o.children,n.push(o))}),t.blocks=n,Es({},t,{blocks:n}))},fromRawStateToRawTreeState:function(t){var r=[],n=[];return t.blocks.forEach(function(i){var o=Cw(i),a=i.depth||0,l=Es({},i,{children:[]});if(!o){r.push(l);return}var u=n[0];if(u==null&&a===0)r.push(l);else if(u==null||u.depth=a;)n.shift(),u=n[0];a>0?u.children.push(l):r.push(l)}}),Es({},t,{blocks:r})}},X8=Q8,J8=rn,Z8=He,eW=Z8.List;function tW(e,t){var r=e.map(function(n,i){var o=t[i];return J8.create({style:n,entity:o})});return eW(r)}var rW=tW,nW=Ro,Tw=nW.substr;function iW(e,t){var r=Array(e.length).fill(null);return t&&t.forEach(function(n){for(var i=Tw(e,0,n.offset).length,o=i+Tw(e,n.offset,n.length).length,a=i;a0;){var c=u.pop(),d=c.parentRef,h=d.getChildKeys(),p=h.indexOf(c.key),m=Array.isArray(c.children);if(!m){m||Zh(!1);break}var g=c.children.map(Ep),w=new Ow(ol({},ev(c,r),{parent:d.getKey(),children:Mw(g.map(function(C){return C.key})),prevSibling:p===0?null:h.get(p-1),nextSibling:p===h.size-1?null:h.get(p+1)}));n=n.set(w.getKey(),w),u=Lw(u,g,w)}return n},wO())},EW=function(t,r){return wO(t.map(function(n){var i=new pW(ev(n,r));return[i.getKey(),i]}))},xW=function(t,r){var n=t.blocks.find(function(a){return Array.isArray(a.children)&&a.children.length>0}),i=Rw&&!n?Dw.fromRawStateToRawTreeState(t).blocks:t.blocks;if(!Rw)return EW(n?Dw.fromRawTreeStateToRawState(t).blocks:i,r);var o=kW(i,r);return o},CW=function(t){var r=t.entityMap,n={};return Object.keys(r).forEach(function(i){var o=r[i],a=o.type,l=o.mutability,u=o.data;n[i]=vW.__create(a,l,u||{})}),n},TW=function(t){Array.isArray(t.blocks)||Zh(!1);var r=CW(t),n=xW(t,r),i=n.isEmpty()?new $w:$w.createEmpty(n.first().getKey());return new hW({blockMap:n,entityMap:r,selectionBefore:i,selectionAfter:i})},bW=TW,OW=Ub;function DW(e){var t=OW(e),r=0,n=0,i=0,o=0;if(t.length){if(t.length>1&&t[0].width===0){var a=t[1];r=a.top,n=a.right,i=a.bottom,o=a.left}else{var l=t[0];r=l.top,n=l.right,i=l.bottom,o=l.left}for(var u=1;u=t&&(l=h.getKey(),u=Math.max(0,t-o)),c==null&&a>=r&&(c=h.getKey(),d=Math.max(0,r-o)),l!=null&&c!=null)break;if(h==null)throw"Unexpected undefined block";l==null&&(l=h.getKey(),u=h.getLength()),c==null&&(c=h.getKey(),d=h.getLength());let p=Yn.SelectionState.createEmpty("");return p.set("anchorKey",l).set("anchorOffset",u).set("focusKey",c).set("focusOffset",d),Yn.EditorState.forceSelection(e,p)}class ku{constructor(t,r){ur.set(this,void 0);let n,i=-1,o=()=>{};typeof t=="number"?(i=t,r=r??i):(r=-1,n=t,o=()=>{Pw(this,ur,Object.assign(Object.assign(Object.assign({},sn(this,ur,"f")),oH(sn(this,ur,"f").editorState)),{init:()=>{}}),"f")}),Pw(this,ur,{editorState:n,anchor:i,focus:r,init:o},"f")}get anchor(){return sn(this,ur,"f").init(),sn(this,ur,"f").anchor}set anchor(t){sn(this,ur,"f").init(),sn(this,ur,"f").anchor=t}get focus(){return sn(this,ur,"f").init(),sn(this,ur,"f").focus}set focus(t){sn(this,ur,"f").init(),sn(this,ur,"f").focus=t}get start(){return Math.min(this.anchor,this.focus)}set start(t){throw new ReferenceError(`start (${t}) is read only. use anchor instead`)}get end(){return Math.max(this.anchor,this.focus)}set end(t){throw new ReferenceError(`end (${t}) is read only. use focus instead`)}forceSelection(t){return aH(t,this.anchor,this.focus)}getHasFocus(){let t=sn(this,ur,"f").editorState;return t&&t.getSelection().getHasFocus()}}ur=new WeakMap;const Gg=(e,t,r)=>{let n;if(e instanceof RegExp)n=[uH(e,t,r)];else if(typeof e=="string")n=[cH(e,t,r)];else if(typeof e=="function")n=[lH(e,t,r)];else if(e instanceof Object&&"highlight"in e)n=dH(e,t,r);else if(e instanceof Array)e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"?n=[fH(e,t,r)]:n=sH(e,t,r);else throw new TypeError(`Not a Highlight type: ${e}`);return n};function sH(e,t,r){const n=e.map(i=>Gg(i,t,r));return Array.prototype.concat.apply([],n)}function lH(e,t,r){return{strategy:e,component:r,className:t}}function uH(e,t,r){return{strategy:(i,o)=>{let a,l;for(;(a=e.exec(i))!==null;)l=a.index,o(l,l+a[0].length)},className:t,component:r}}function cH(e,t,r){return{strategy:(i,o)=>{const a=i.toLowerCase(),l=e.toLowerCase();let u=0;for(;u=a.indexOf(l,u),u!==-1;)o(u,u+l.length),u+=l.length},component:r,className:t}}function fH(e,t,r){return{strategy:(i,o)=>{const a=Math.max(0,e[0]),l=Math.min(e[1],i.length);a{let r=[];for(const o of t){const a=o.strategy;a(e,(l,u)=>{l=0&&u<=e.length&&r.push({component:o.component,className:o.className,matchStart:l,matchEnd:u,matchText:e.slice(l,u)})})}let n=[];e:for(const o of r){for(let a=o.matchStart;ao.matchStart-a.matchStart)},hH=(e,t)=>{let r=e.getBlocksAsArray(),n=[],i=0;for(const o of r){let a=o.getLength();if(a==0)continue;let l=o.getText(),u=t.indexOf(l[0],i);i=u+a,n.push({blockStart:u,blockEnd:i,blockText:t.slice(u,i),blockKey:o.getKey()})}return n},vH=(e,t,r)=>{const n=hH(e,r);let i=[];e:for(const o of t)for(const a of n){if(a.blockStart>=o.matchEnd)continue e;if(a.blockEndQr.createElement("mark",{className:r},n.children),(n,i)=>n.decoratedText==i.decoratedText):n=>{var i,o,a;const l=(a=(o=(i=this.map.get(t))===null||i===void 0?void 0:i.get(r))===null||o===void 0?void 0:o.get(n.blockKey))===null||a===void 0?void 0:a.get(n.start);if(!l||!l.component)throw new Error("RHWTAInternalError");return Qr.createElement(l.component,Object.assign({},l),n.children)}}strategyFactory(t,r){return(n,i)=>{var o,a,l;const u=((l=(a=(o=this.map.get(t))===null||o===void 0?void 0:o.get(r))===null||a===void 0?void 0:a.get(n.getKey()))===null||l===void 0?void 0:l.values())||[];for(const c of u){const d=c.spanStart-c.blockStart,h=c.spanEnd-c.blockStart;i(d,h)}}}toDecorators(t){var r;const n=[];this.updateBlockSpans(t);for(const[i,o]of this.map.entries())for(const[a]of o.entries()){let l=(r=this.decoratorCache.get(i))===null||r===void 0?void 0:r.get(a);if(!l){l={component:this.componentFactory(i,a),strategy:this.strategyFactory(i,a)};let u=this.decoratorCache.get(i)||new Map;this.decoratorCache.set(i,u),u.set(a,l)}n.push(l)}return n}create(t,r,n){n=n||t.getPlainText();const i=Gg(r),o=pH(n,i),a=vH(t,o,n),l=this.toDecorators(a);return new Yn.CompositeDecorator(l)}}const mH=Qr.forwardRef((e,t)=>{let{value:r,onChange:n,highlight:i,placeholder:o="Enter some text...",selection:a}=e;const[,l]=F.useState({}),u=F.useRef({}),c=F.useRef(new gH);let d;const{prevValue:h,prevEditorState:p,nextValue:m,nextEditorState:g}=u.current;if(m==r)d=g;else if(h==r)d=p,!a&&m&&(a=new ku(d),a.focus=Math.max(a.anchor,a.focus),a.anchor=a.focus);else if(p){const k=Yn.ContentState.createFromText(r);if(d=Yn.EditorState.push(p,k,"change-block-data"),!a){let O,R;g?(a=new ku(g),O=r.replaceAll(`\r +`,` +`),R=O.length-m.length):(a=new ku(p),O=r.replaceAll(`\r +`,` +`),R=O.length-h.length),a.anchor+=R,a.focus+=R}}else{const k=Yn.ContentState.createFromText(r);d=Yn.EditorState.createWithContent(k)}const w=d.getCurrentContent();let C;C=F.useMemo(()=>i&&c.current.create(w,i,r),[w,i,r]),d=Yn.EditorState.set(d,{decorator:C}),a&&(d=a.forceSelection(d)),u.current={prevEditorState:d,prevValue:r};const S=k=>{const x=k.getCurrentContent().getPlainText();u.current=Object.assign(Object.assign({},u.current),{nextEditorState:k,nextValue:x});let O;O=new ku(k),n&&n(x,O),l({})},y=Object.assign({},e);return delete y.highlight,delete y.selection,delete y.placeholder,delete y.onChange,delete y.value,Qr.createElement(Yn.Editor,Object.assign({},y,{editorState:d,onChange:S,placeholder:o,ref:t}))}),xp=vt.div` + color: var(--gray-100); + font-weight: 700; +`,Cp=vt.div` + color: var(--gray-100); + font-size: 28px; + margin-top: 4px; +`,Tp=vt.div` + display: inline-block; + margin-right: 20px; + min-width: 80px; +`,yH=({value:e,tokens:t})=>{const r=F.useMemo(()=>{const n=t.length/e.length;return Number.isNaN(n)?0:(Math.round(n*100*100)/100).toFixed(2)},[t.length,e.length]);return Q.jsxs("div",{children:[Q.jsxs(Tp,{children:[Q.jsx(xp,{children:"Tokens"}),Q.jsx(Cp,{children:t.length})]}),Q.jsxs(Tp,{children:[Q.jsx(xp,{children:"Chars"}),Q.jsx(Cp,{children:e.length})]}),Q.jsxs(Tp,{children:[Q.jsx(xp,{children:"Compress Rate (tokens / chars)"}),Q.jsxs(Cp,{children:[r,"%"]})]})]})},_H=` +Many words map to one token, but some don't: indivisible. + +Unicode characters like emojis may be split into many tokens containing the underlying bytes: 🤚🏾 + +Sequences of characters commonly found next to each other may be grouped together: 1234567890 +`.trim(),Iw=vt.div` + box-sizing: border-box; + width: 100%; + flex: 1 0 auto; + font-size: 16px; + line-height: 24px; + margin: 0 auto; + max-width: 100%; + overflow: hidden; + + h3 { + font-size: 20px; + line-height: 28px; + } + p { + line-height: 1.5em; + margin-bottom: 1em; + margin-top: 1em; + } +`,wH=vt.div` + font-family: var(--monospace); + font-size: 15px; + min-height: 200px; + padding: 10px 12px; + width: 100%; + + background-clip: padding-box; + background-color: #1f1f1f; + border: 1px solid var(--input-border); + border-radius: 8px; + box-sizing: border-box; + color: var(--gray-200); + display: inline-block; + font-family: var(--sans-serif); + font-weight: 400; + line-height: 1.4; + margin: 0; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + vertical-align: top; + + max-height: 500px; + min-height: 200px; + + cursor: text; + + overflow: auto; + + mark { + background: var(--primary-300); + } + + &:focus-within { + border-color: var(--input-border-focus); + box-shadow: 0 0 0 0.2rem var(--primary-100a); + outline: 0; + } +`,SH=vt.div` + background: var(--gray-800); + border-radius: 3px; + margin-top: 1em; + max-height: 500px; + min-height: 200px; + overflow: auto; + padding: 10px 12px 45px; + position: relative; + transition: opacity 0.3s; + word-break: break-word; + + span { + font-family: var(--monospace); + font-size: 15px; + } +`,Nw=vt.button` + border: none; + border-radius: 8px; + box-sizing: border-box; + cursor: pointer; + display: inline-flex; + font-weight: 500; + justify-content: center; + line-height: 1.4; + position: relative; + transition: box-shadow 0.3s, background-color 0.3s, color 0.3s; + -webkit-user-select: none; + user-select: none; + + font-size: 14px; + line-height: 20px; + background-color: var(--gray-700); + color: var(--gray-200); + padding: 6px 12px; + + & + & { + margin-left: 8px; + } + + &:hover { + background-color: var(--gray-600); + } + &:active { + background-color: var(--gray-800); + } +`,Aw=["rgba(107,64,216,.3)","rgba(104,222,122,.4)","rgba(244,172,54,.4)","rgba(239,65,70,.4)","rgba(39,181,234,.4)"],kH=({setHighlight:e})=>{F.useEffect(()=>{const t=()=>{const a=window.getSelection();if(!a)return;const l=a.anchorNode,u=a.focusNode;if(!l||!u||l===u)return;const c=p=>p instanceof HTMLElement&&p.dataset.start&&p.dataset.end?[Number(p.dataset.start),Number(p.dataset.end)]:p.parentNode?c(p.parentNode):null,d=c(l),h=c(u);if(d&&h){const p=Math.min(...d,...h),m=Math.max(...d,...h);e([p,m])}};let r=!1;const n=()=>{r=!0,e(null)},i=()=>{r&&t(),r=!1},o=()=>{r&&t()};return window.addEventListener("mousedown",n),window.addEventListener("mouseup",i),window.addEventListener("mousemove",o),()=>{window.removeEventListener("mousedown",n),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",o)}},[e])},EH=e=>{const[t,r]=F.useState(null);return F.useEffect(()=>{(async()=>{const i=await ti.instance.get(e);r(()=>i)})()},[e]),{tokenizer:t}},xH=e=>{const[t,r]=F.useState(null);return F.useEffect(()=>{e&&r(()=>ti.instance.info(e))},[e]),t},CH=vt.div` + background-color: var(--gray-800); + margin-bottom: 1rem; + + .title { + cursor: pointer; + padding: 8px; + background-color: rgba(255, 255, 255, 0.2); + + .icon { + display: inline-flex; + justify-content: center; + align-items: center; + + height: 16px; + width: 16px; + } + } + + table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 1px solid var(--gray-700); + + td { + padding: 8px; + border: 1px solid var(--gray-700); + } + } +`,TH=({tokenizer:e,config:t})=>{const[r,n]=F.useState(!1),i=xH(e);if(!i)return null;const o=Q.jsx("table",{children:Q.jsx("tbody",{children:Object.entries(i).map(([l,u])=>{if(l==="chat_template"){let c=u;return u&&typeof u=="object"&&(c=u.default??Object.values(u)[0]),typeof c!="string"&&(c=""),Q.jsxs("tr",{children:[Q.jsx("td",{children:l}),Q.jsx("td",{children:Q.jsx("textarea",{readOnly:!0,placeholder:"No chat template provided.",value:c,style:{width:"100%",height:"100px",resize:"none"}})})]},l)}return Q.jsxs("tr",{children:[Q.jsx("td",{children:l}),Q.jsx("td",{children:Q.jsx("span",{children:u})})]},l)})})}),a=t?t.type==="package"?t.name:t.json_url.slice(t.json_url.lastIndexOf("/")+1,t.json_url.lastIndexOf(".")):"-";return Q.jsxs(CH,{children:[Q.jsxs("div",{className:"title",onClick:()=>{n(l=>!l)},children:[Q.jsx("span",{className:"icon",children:r?"-":"+"}),"Tokenizer info: ",a]}),r?o:null]})};function bH({config:e,onChange:t,inputValue:r,getInitValue:n}){const{tokenizer:i}=EH(e),[o,a]=F.useState(()=>(n==null?void 0:n())??"Potato potato tomato potato."),l=F.useRef(null),u=F.useMemo(()=>{if(!i)return[];try{return ti.instance.tokenize(o,i)}catch(g){return console.error(g),[]}},[i,o]);F.useEffect(()=>{typeof r=="string"&&a(r)},[r,t]);const[c,d]=F.useState(null),[h,p]=F.useState(null);kH({setHighlight:p});const m=g=>{a(g),t==null||t(g)};return i?Q.jsxs(Iw,{children:[Q.jsx(TH,{tokenizer:i,config:e}),Q.jsx(wH,{onClick:()=>{var g;(g=l.current)==null||g.focus()},children:Q.jsx(mH,{ref:l,highlight:h||c,value:o,onChange:g=>m(g)})}),Q.jsxs("div",{style:{marginTop:"1em",marginBottom:"1em"},children:[Q.jsx(Nw,{onClick:()=>m(""),children:"Clear"}),Q.jsx(Nw,{onClick:()=>m(_H),children:"Show Example"})]}),Q.jsx(yH,{value:o,tokens:u}),Q.jsx(SH,{children:u.map((g,w)=>{const C=Aw[w%Aw.length];return Q.jsx("span",{"data-token":g.token,"data-start":g.start,"data-end":g.end,onMouseMove:()=>{d([g.start,g.end])},onMouseLeave:()=>{d(null)},style:{backgroundColor:C},children:g.token},w+g.token)})})]}):Q.jsx(Iw,{children:Q.jsx("span",{children:"Tokenizer loading..."})})}const Bw={encode:e=>btoa(encodeURIComponent(e)),decode:e=>{if(!e)return e;try{return decodeURIComponent(atob(e))}catch(t){console.error(t)}return e}},Dl=()=>{const e=Ka(),t=Pk(),r=F.useCallback(o=>{const a=new URLSearchParams(e.search);return Bw.decode(a.get(o))},[e.search]),n=F.useCallback((o,a)=>{const l=new URLSearchParams(e.search);l.set(o,Bw.encode(a)),t({search:l.toString()},{replace:!0})},[e.search,t]),i=F.useCallback(o=>{const a=new URLSearchParams(e.search);a.delete(o),t({search:a.toString()},{replace:!0})},[e.search,t]);return{getQueryParam:r,setQueryParam:n,deleteQueryParam:i}},OH=vt.div` + display: flex; + flex-direction: column; + + height: max-content; + min-height: 100%; + width: 80%; + min-width: 640px; + + > p { + span { + user-select: none; + cursor: pointer; + + &:hover { + text-decoration: underline; + } + } + } +`,tv=({inputValue:e,onChange:t,initConfig:r,onConfigChanged:n})=>{const[i,o]=F.useState(r||null),{getQueryParam:a}=Dl();return Q.jsx(Q.Fragment,{children:i===null?Q.jsx(LN,{onConfigChange:l=>{o(l),n==null||n(l)}}):Q.jsx(bH,{config:i,inputValue:e,onChange:t,getInitValue:()=>a("content")})})},DH=()=>{const[e,t]=F.useState(1),{setQueryParam:r,getQueryParam:n,deleteQueryParam:i}=Dl(),[o,a]=F.useState(()=>{const u=n("config");if(!u)return null;try{return JSON.parse(u)}catch(c){console.error(c)}return null}),l=F.useCallback(u=>{r("config",JSON.stringify(u))},[r]);return Q.jsxs(OH,{children:[Q.jsx("p",{children:Q.jsx("span",{onClick:()=>{t(Date.now()),a(null),i("content"),i("config")},children:"[reset]"})}),Q.jsx(tv,{onConfigChanged:l,initConfig:o,onChange:u=>{u.length<1024&&r("content",u)}},e)]})},$H=vt.div` + display: flex; + flex-direction: row; + + height: max-content; + min-height: 100%; + width: 80%; + min-width: 640px; + + > div { + flex: 1; + } + + .divider { + flex: 0 0 1px; + width: 1px; + margin: 0 16px; + background-color: var(--gray-700); + } + + h3 small { + font-weight: 100; + cursor: pointer; + &:hover { + text-decoration: underline; + } + } +`,zw=e=>{const{getQueryParam:t}=Dl(),[r,n]=F.useState(()=>{const i=t(e);if(!i)return null;try{return JSON.parse(i)}catch(o){console.error(o)}return null});return[r,n]},RH=()=>{const{getQueryParam:e}=Dl();return F.useState(()=>e("content")||null)[0]},MH=()=>{const[e,t]=F.useState(1),[r,n]=F.useState(1),i=RH(),[o,a]=F.useState(i??"👋Your modifications on both sides will be synchronized for easy comparison."),{setQueryParam:l,deleteQueryParam:u}=Dl(),[c,d]=zw("left"),[h,p]=zw("right"),m=F.useCallback(g=>{a(g),g.length<1024&&l("content",g)},[a,l]);return Q.jsxs($H,{children:[Q.jsxs("div",{children:[Q.jsxs("h3",{children:["Tokenizer 1"," ",Q.jsx("small",{onClick:()=>{t(Date.now()),d(null),p(null),u("content"),u("left")},children:"[reset]"})," "]}),Q.jsx(tv,{inputValue:o,onChange:m,initConfig:c,onConfigChanged:g=>{l("left",JSON.stringify(g))}},e)]}),Q.jsx("div",{className:"divider"}),Q.jsxs("div",{children:[Q.jsxs("h3",{children:["Tokenizer 2"," ",Q.jsx("small",{onClick:()=>{n(Date.now()),d(null),p(null),u("content"),u("right")},children:"[reset]"})]}),Q.jsx(tv,{inputValue:o,onChange:m,initConfig:h,onConfigChanged:g=>{l("right",JSON.stringify(g))}},r)]})]})},LH=vt.div` + width: 800px; + flex: 1 0 auto; + font-size: 16px; + line-height: 24px; + margin: 0 auto; + max-width: 100%; + padding: 40px 56px; + overflow: hidden; + + h3 { + font-size: 20px; + line-height: 28px; + } + p { + line-height: 1.5em; + margin-bottom: 1em; + margin-top: 1em; + } +`,PH=vt.div` + align-items: center; + display: flex; + margin-bottom: 1.4em; + h1 { + flex: 1 1 auto; + margin: 0; + } +`,IH=()=>Q.jsxs(LH,{children:[Q.jsx(PH,{children:Q.jsx("h1",{children:"🦙 @lenml/tokenizers Playground"})}),Q.jsx("br",{}),Q.jsxs("div",{style:{display:"flex",gap:"8px"},children:[Q.jsx("a",{href:"https://www.npmjs.com/package/@lenml/tokenizers",target:"_blank",children:Q.jsx("img",{alt:"NPM Downloads",src:"https://img.shields.io/npm/dm/%40lenml%2Ftokenizers"})}),Q.jsx("a",{href:"https://www.npmjs.com/package/@lenml/tokenizers",target:"_blank",children:Q.jsx("img",{alt:"NPM Version",src:"https://img.shields.io/npm/v/%40lenml%2Ftokenizers"})}),Q.jsx("a",{href:"https://www.npmjs.com/package/@lenml/tokenizers",target:"_blank",children:Q.jsx("img",{alt:"NPM License",src:"https://img.shields.io/npm/l/%40lenml%2Ftokenizers"})})]}),Q.jsx("p",{children:"a lightweight no-dependency fork from transformers.js (only tokenizers)"}),Q.jsx("h3",{children:"Learn about language model tokenization"}),Q.jsx("p",{children:"Language models process text using tokens, which are common sequences of characters found in text. Models understand statistical relationships between tokens to predict the next token in a sequence."}),Q.jsxs("p",{children:["This playground uses the"," ",Q.jsx("a",{href:"https://github.com/lenML/tokenizers",children:"tokenizers"})," to tokenize text. The library supports vocabularies for models like llama2, mistral, and zephyr. Key features include: fast, TypeScript support, high test coverage."]}),Q.jsx("p",{children:"You can use the tool below to see how text gets tokenized into tokens, and the total token count. Note different models use different tokenizers, so the same text can tokenize differently."}),Q.jsx("p",{children:"Explore how text gets tokenized using this playground."})]}),NH=zL([{path:"",element:Q.jsx(bN,{}),children:[{index:!0,element:Q.jsx(IH,{})},{path:"direct",element:Q.jsx(DH,{})},{path:"side-by-side",element:Q.jsx(MH,{})},{path:"about",element:Q.jsx("div",{children:"About"})}]}]);function AH(){return Q.jsx(qL,{router:NH})}bp.createRoot(document.getElementById("root")).render(Q.jsx(Qr.StrictMode,{children:Q.jsx(AH,{})})); diff --git a/assets/index-DgLYUnZy.css b/assets/index-DgLYUnZy.css new file mode 100644 index 0000000..f7a839c --- /dev/null +++ b/assets/index-DgLYUnZy.css @@ -0,0 +1 @@ +:root{--primary: #10a37f;--primary-50: #ebfaeb;--primary-100: #d2f4d3;--primary-200: #b9eebc;--primary-300: #93e69c;--primary-400: #68de7a;--primary-500: #19c37d;--primary-600: #10a37f;--primary-700: #1a7f64;--primary-800: #1b5d4a;--primary-900: #183d31;--primary-50a: rgba(16,163,127,.2);--primary-100a: rgba(16,163,127,.3);--secondary: #5436da;--secondary-50: #ecebf9;--secondary-100: #d2cff2;--secondary-200: #b9b4ec;--secondary-300: #a198e6;--secondary-400: #897ce2;--secondary-500: #715fde;--secondary-600: #5436da;--secondary-700: #482da8;--secondary-800: #3b2479;--secondary-900: #281852;--secondary-100a: rgba(84,54,218,.3);--green-50: #ebfaeb;--green-100: #d2f4d3;--green-200: #b9eebc;--green-300: #93e69c;--green-400: #68de7a;--green-500: #19c37d;--green-600: #10a37f;--green-700: #1a7f64;--green-800: #1b5d4a;--green-900: #183d31;--green-100a: rgba(16,163,127,.3);--red-50: #fdebeb;--red-100: #f9cfcf;--red-200: #f6b2b3;--red-300: #f49394;--red-400: #f17173;--red-500: #ef4146;--red-600: #c23539;--red-700: #9d2b2e;--red-800: #7b2124;--red-900: #59181a;--red-100a: rgba(239,65,70,.3);--gray-50: #f7f7f8;--gray-100: #ececf1;--gray-200: #d9d9e3;--gray-300: #c5c5d2;--gray-400: #acacbe;--gray-500: #8e8ea0;--gray-600: #6e6e80;--gray-700: #565869;--gray-800: #353740;--gray-900: #202123;--warm-gray-100: #e6f3f3;--pink-100: #dd5ce5;--medium-wash: #eff7f8;--bg-color: #fff;--text-primary: #202123;--text-default: #353740;--text-secondary: #6e6e80;--text-disabled: #acacbe;--text-error: #ef4146;--font-size-small: 16px;--input-border: var(--gray-300);--input-border-focus: var(--primary-600);--input-focus-ring: 0px 0px 0px 1px #10a37f;--icon-warning-color: #f4ac36;--heading-margin-top: 30px;--heading-margin-bottom: 16px;--header-height: 52px;--sidenav-width: 57px;--content-width: 760px;--content-v-padding: 40px;--content-h-padding: 56px;--border-radius: 8px;--sans-serif: "Söhne",helvetica,sans-serif;--monospace: "Söhne Mono",sfmono-regular,consolas,liberation mono,menlo,courier,monospace;--mobile-breakpoint: 600px}:root{color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}html,body{height:100vh;width:100vw;overflow:hidden}#root{height:100%;width:100%} diff --git a/index.html b/index.html new file mode 100644 index 0000000..d2ab0cb --- /dev/null +++ b/index.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + Tokenizer Arena - Compare and Evaluate Tokenizers with @lenml/tokenizers + + + + + +
+ +