polotno-node 2.10.0 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,298 +0,0 @@
1
- (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 a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var N_={exports:{}},ht={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Tc=Symbol.for("react.element"),EE=Symbol.for("react.portal"),OE=Symbol.for("react.fragment"),xE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),CE=Symbol.for("react.provider"),kE=Symbol.for("react.context"),TE=Symbol.for("react.forward_ref"),AE=Symbol.for("react.suspense"),RE=Symbol.for("react.memo"),ME=Symbol.for("react.lazy"),o3=Symbol.iterator;function LE(e){return e===null||typeof e!="object"?null:(e=o3&&e[o3]||e["@@iterator"],typeof e=="function"?e:null)}var I_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D_=Object.assign,j_={};function Hs(e,t,r){this.props=e,this.context=t,this.refs=j_,this.updater=r||I_}Hs.prototype.isReactComponent={};Hs.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")};Hs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F_(){}F_.prototype=Hs.prototype;function bm(e,t,r){this.props=e,this.context=t,this.refs=j_,this.updater=r||I_}var _m=bm.prototype=new F_;_m.constructor=bm;D_(_m,Hs.prototype);_m.isPureReactComponent=!0;var l3=Array.isArray,z_=Object.prototype.hasOwnProperty,wm={current:null},B_={key:!0,ref:!0,__self:!0,__source:!0};function U_(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)z_.call(t,n)&&!B_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];i.children=u}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Tc,type:e,key:a,ref:o,props:i,_owner:wm.current}}function NE(e,t){return{$$typeof:Tc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tc}function IE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var s3=/\/+/g;function f1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?IE(""+e.key):t.toString(36)}function wd(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Tc:case EE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+f1(o,0):n,l3(i)?(r="",e!=null&&(r=e.replace(s3,"$&/")+"/"),wd(i,t,r,"",function(f){return f})):i!=null&&(Sm(i)&&(i=NE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(s3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",l3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+f1(a,l);o+=wd(a,t,r,u,i)}else if(u=LE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+f1(a,l++),o+=wd(a,t,r,u,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Vf(e,t,r){if(e==null)return e;var n=[],i=0;return wd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function DE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Xr={current:null},Sd={transition:null},jE={ReactCurrentDispatcher:Xr,ReactCurrentBatchConfig:Sd,ReactCurrentOwner:wm};function H_(){throw Error("act(...) is not supported in production builds of React.")}ht.Children={map:Vf,forEach:function(e,t,r){Vf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Vf(e,function(){t++}),t},toArray:function(e){return Vf(e,function(t){return t})||[]},only:function(e){if(!Sm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ht.Component=Hs;ht.Fragment=OE;ht.Profiler=PE;ht.PureComponent=bm;ht.StrictMode=xE;ht.Suspense=AE;ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jE;ht.act=H_;ht.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=D_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=wm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)z_.call(t,u)&&!B_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];n.children=l}return{$$typeof:Tc,type:e.type,key:i,ref:a,props:n,_owner:o}};ht.createContext=function(e){return e={$$typeof:kE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:CE,_context:e},e.Consumer=e};ht.createElement=U_;ht.createFactory=function(e){var t=U_.bind(null,e);return t.type=e,t};ht.createRef=function(){return{current:null}};ht.forwardRef=function(e){return{$$typeof:TE,render:e}};ht.isValidElement=Sm;ht.lazy=function(e){return{$$typeof:ME,_payload:{_status:-1,_result:e},_init:DE}};ht.memo=function(e,t){return{$$typeof:RE,type:e,compare:t===void 0?null:t}};ht.startTransition=function(e){var t=Sd.transition;Sd.transition={};try{e()}finally{Sd.transition=t}};ht.unstable_act=H_;ht.useCallback=function(e,t){return Xr.current.useCallback(e,t)};ht.useContext=function(e){return Xr.current.useContext(e)};ht.useDebugValue=function(){};ht.useDeferredValue=function(e){return Xr.current.useDeferredValue(e)};ht.useEffect=function(e,t){return Xr.current.useEffect(e,t)};ht.useId=function(){return Xr.current.useId()};ht.useImperativeHandle=function(e,t,r){return Xr.current.useImperativeHandle(e,t,r)};ht.useInsertionEffect=function(e,t){return Xr.current.useInsertionEffect(e,t)};ht.useLayoutEffect=function(e,t){return Xr.current.useLayoutEffect(e,t)};ht.useMemo=function(e,t){return Xr.current.useMemo(e,t)};ht.useReducer=function(e,t,r){return Xr.current.useReducer(e,t,r)};ht.useRef=function(e){return Xr.current.useRef(e)};ht.useState=function(e){return Xr.current.useState(e)};ht.useSyncExternalStore=function(e,t,r){return Xr.current.useSyncExternalStore(e,t,r)};ht.useTransition=function(){return Xr.current.useTransition()};ht.version="18.3.1";N_.exports=ht;var Je=N_.exports;const dt=Ph(Je);var jd={},$_={exports:{}},kn={},G_={exports:{}},V_={};/**
10
- * @license React
11
- * scheduler.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */(function(e){function t(U,j){var A=U.length;U.push(j);e:for(;0<A;){var L=A-1>>>1,z=U[L];if(0<i(z,j))U[L]=j,U[A]=z,A=L;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var j=U[0],A=U.pop();if(A!==j){U[0]=A;e:for(var L=0,z=U.length,q=z>>>1;L<q;){var K=2*(L+1)-1,F=U[K],$=K+1,B=U[$];if(0>i(F,A))$<z&&0>i(B,F)?(U[L]=B,U[$]=A,L=$):(U[L]=F,U[K]=A,L=K);else if($<z&&0>i(B,A))U[L]=B,U[$]=A,L=$;else break e}}return j}function i(U,j){var A=U.sortIndex-j.sortIndex;return A!==0?A:U.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],h=1,E=null,w=3,p=!1,S=!1,b=!1,m=typeof setTimeout=="function"?setTimeout:null,v=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 d(U){for(var j=r(f);j!==null;){if(j.callback===null)n(f);else if(j.startTime<=U)n(f),j.sortIndex=j.expirationTime,t(u,j);else break;j=r(f)}}function g(U){if(b=!1,d(U),!S)if(r(u)!==null)S=!0,Q(_);else{var j=r(f);j!==null&&W(g,j.startTime-U)}}function _(U,j){S=!1,b&&(b=!1,v(P),P=-1),p=!0;var A=w;try{for(d(j),E=r(u);E!==null&&(!(E.expirationTime>j)||U&&!k());){var L=E.callback;if(typeof L=="function"){E.callback=null,w=E.priorityLevel;var z=L(E.expirationTime<=j);j=e.unstable_now(),typeof z=="function"?E.callback=z:E===r(u)&&n(u),d(j)}else n(u);E=r(u)}if(E!==null)var q=!0;else{var K=r(f);K!==null&&W(g,K.startTime-j),q=!1}return q}finally{E=null,w=A,p=!1}}var T=!1,C=null,P=-1,O=5,x=-1;function k(){return!(e.unstable_now()-x<O)}function M(){if(C!==null){var U=e.unstable_now();x=U;var j=!0;try{j=C(!0,U)}finally{j?I():(T=!1,C=null)}}else T=!1}var I;if(typeof y=="function")I=function(){y(M)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,G=H.port2;H.port1.onmessage=M,I=function(){G.postMessage(null)}}else I=function(){m(M,0)};function Q(U){C=U,T||(T=!0,I())}function W(U,j){P=m(function(){U(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){S||p||(S=!0,Q(_))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(U){switch(w){case 1:case 2:case 3:var j=3;break;default:j=w}var A=w;w=j;try{return U()}finally{w=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,j){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var A=w;w=U;try{return j()}finally{w=A}},e.unstable_scheduleCallback=function(U,j,A){var L=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?L+A:L):A=L,U){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=A+z,U={id:h++,callback:j,priorityLevel:U,startTime:A,expirationTime:z,sortIndex:-1},A>L?(U.sortIndex=A,t(f,U),r(u)===null&&U===r(f)&&(b?(v(P),P=-1):b=!0,W(g,A-L))):(U.sortIndex=z,t(u,U),S||p||(S=!0,Q(_))),U},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(U){var j=w;return function(){var A=w;w=j;try{return U.apply(this,arguments)}finally{w=A}}}})(V_);G_.exports=V_;var Uu=G_.exports;/**
18
- * @license React
19
- * react-dom.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var FE=Je,Pn=Uu;function Pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var q_=new Set,tc={};function hl(e,t){_s(e,t),_s(e+"Capture",t)}function _s(e,t){for(tc[e]=t,e=0;e<t.length;e++)q_.add(t[e])}var ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,zE=/^[: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]*$/,u3={},c3={};function BE(e){return rv.call(c3,e)?!0:rv.call(u3,e)?!1:zE.test(e)?c3[e]=!0:(u3[e]=!0,!1)}function UE(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 HE(e,t,r,n){if(t===null||typeof t>"u"||UE(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 Zr(e,t,r,n,i,a,o){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=a,this.removeEmptyString=o}var Ar={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ar[e]=new Zr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ar[t]=new Zr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ar[e]=new Zr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ar[e]=new Zr(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){Ar[e]=new Zr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ar[e]=new Zr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ar[e]=new Zr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ar[e]=new Zr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ar[e]=new Zr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function Om(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(Em,Om);Ar[t]=new Zr(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(Em,Om);Ar[t]=new Zr(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(Em,Om);Ar[t]=new Zr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ar[e]=new Zr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ar.xlinkHref=new Zr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ar[e]=new Zr(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,r,n){var i=Ar.hasOwnProperty(t)?Ar[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(HE(t,r,i,n)&&(r=null),n||i===null?BE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var xa=FE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qf=Symbol.for("react.element"),Ql=Symbol.for("react.portal"),Jl=Symbol.for("react.fragment"),Pm=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),W_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),av=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),Wa=Symbol.for("react.lazy"),Y_=Symbol.for("react.offscreen"),f3=Symbol.iterator;function Ou(e){return e===null||typeof e!="object"?null:(e=f3&&e[f3]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,d1;function Du(e){if(d1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);d1=t&&t[1]||""}return`
26
- `+d1+e}var h1=!1;function p1(e,t){if(!e||h1)return"";h1=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
27
- `),a=n.stack.split(`
28
- `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var u=`
29
- `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{h1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Du(e):""}function $E(e){switch(e.tag){case 5:return Du(e.type);case 16:return Du("Lazy");case 13:return Du("Suspense");case 19:return Du("SuspenseList");case 0:case 2:case 15:return e=p1(e.type,!1),e;case 11:return e=p1(e.type.render,!1),e;case 1:return e=p1(e.type,!0),e;default:return""}}function ov(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 Jl:return"Fragment";case Ql:return"Portal";case nv:return"Profiler";case Pm:return"StrictMode";case iv:return"Suspense";case av:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K_:return(e.displayName||"Context")+".Consumer";case W_:return(e._context.displayName||"Context")+".Provider";case Cm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case Wa:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function GE(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 ov(t);case 8:return t===Pm?"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 fo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function X_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function VE(e){var t=X_(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,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wf(e){e._valueTracker||(e._valueTracker=VE(e))}function Z_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=X_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Fd(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 lv(e,t){var r=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function d3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=fo(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 Q_(e,t){t=t.checked,t!=null&&xm(e,"checked",t,!1)}function sv(e,t){Q_(e,t);var r=fo(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")?uv(e,t.type,r):t.hasOwnProperty("defaultValue")&&uv(e,t.type,fo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function h3(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 uv(e,t,r){(t!=="number"||Fd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ju=Array.isArray;function hs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+fo(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Pe(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function p3(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Pe(92));if(ju(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:fo(r)}}function J_(e,t){var r=fo(t.value),n=fo(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function g3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function e6(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?e6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Kf,t6=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Kf=Kf||document.createElement("div"),Kf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Kf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Hu={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},qE=["Webkit","ms","Moz","O"];Object.keys(Hu).forEach(function(e){qE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hu[t]=Hu[e]})});function r6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Hu.hasOwnProperty(e)&&Hu[e]?(""+t).trim():t+"px"}function n6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=r6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var WE=Kt({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 dv(e,t){if(t){if(WE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Pe(62))}}function hv(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 pv=null;function Tm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,ps=null,gs=null;function v3(e){if(e=Mc(e)){if(typeof gv!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=Rh(t),gv(e.stateNode,e.type,t))}}function i6(e){ps?gs?gs.push(e):gs=[e]:ps=e}function a6(){if(ps){var e=ps,t=gs;if(gs=ps=null,v3(e),t)for(e=0;e<t.length;e++)v3(t[e])}}function o6(e,t){return e(t)}function l6(){}var g1=!1;function s6(e,t,r){if(g1)return e(t,r);g1=!0;try{return o6(e,t,r)}finally{g1=!1,(ps!==null||gs!==null)&&(l6(),a6())}}function nc(e,t){var r=e.stateNode;if(r===null)return null;var n=Rh(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Pe(231,t,typeof r));return r}var vv=!1;if(ba)try{var xu={};Object.defineProperty(xu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{vv=!1}function KE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(h){this.onError(h)}}var $u=!1,zd=null,Bd=!1,mv=null,YE={onError:function(e){$u=!0,zd=e}};function XE(e,t,r,n,i,a,o,l,u){$u=!1,zd=null,KE.apply(YE,arguments)}function ZE(e,t,r,n,i,a,o,l,u){if(XE.apply(this,arguments),$u){if($u){var f=zd;$u=!1,zd=null}else throw Error(Pe(198));Bd||(Bd=!0,mv=f)}}function pl(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function u6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m3(e){if(pl(e)!==e)throw Error(Pe(188))}function QE(e){var t=e.alternate;if(!t){if(t=pl(e),t===null)throw Error(Pe(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return m3(i),e;if(a===n)return m3(i),t;a=a.sibling}throw Error(Pe(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Pe(189))}}if(r.alternate!==n)throw Error(Pe(190))}if(r.tag!==3)throw Error(Pe(188));return r.stateNode.current===r?e:t}function c6(e){return e=QE(e),e!==null?f6(e):null}function f6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=f6(e);if(t!==null)return t;e=e.sibling}return null}var d6=Pn.unstable_scheduleCallback,y3=Pn.unstable_cancelCallback,JE=Pn.unstable_shouldYield,eO=Pn.unstable_requestPaint,tr=Pn.unstable_now,tO=Pn.unstable_getCurrentPriorityLevel,Am=Pn.unstable_ImmediatePriority,h6=Pn.unstable_UserBlockingPriority,Ud=Pn.unstable_NormalPriority,rO=Pn.unstable_LowPriority,p6=Pn.unstable_IdlePriority,Ch=null,Ui=null;function nO(e){if(Ui&&typeof Ui.onCommitFiberRoot=="function")try{Ui.onCommitFiberRoot(Ch,e,void 0,(e.current.flags&128)===128)}catch{}}var ci=Math.clz32?Math.clz32:oO,iO=Math.log,aO=Math.LN2;function oO(e){return e>>>=0,e===0?32:31-(iO(e)/aO|0)|0}var Yf=64,Xf=4194304;function Fu(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 Hd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Fu(l):(a&=o,a!==0&&(n=Fu(a)))}else o=r&~i,o!==0?n=Fu(o):a!==0&&(n=Fu(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-ci(t),i=1<<r,n|=e[r],t&=~i;return n}function lO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ci(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=lO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function yv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function g6(){var e=Yf;return Yf<<=1,!(Yf&4194240)&&(Yf=64),e}function v1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ac(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ci(t),e[t]=r}function uO(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<r;){var i=31-ci(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ci(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var xt=0;function v6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var m6,Mm,y6,b6,_6,bv=!1,Zf=[],to=null,ro=null,no=null,ic=new Map,ac=new Map,Ya=[],cO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function b3(e,t){switch(e){case"focusin":case"focusout":to=null;break;case"dragenter":case"dragleave":ro=null;break;case"mouseover":case"mouseout":no=null;break;case"pointerover":case"pointerout":ic.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(t.pointerId)}}function Pu(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mc(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fO(e,t,r,n,i){switch(t){case"focusin":return to=Pu(to,e,t,r,n,i),!0;case"dragenter":return ro=Pu(ro,e,t,r,n,i),!0;case"mouseover":return no=Pu(no,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return ic.set(a,Pu(ic.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,ac.set(a,Pu(ac.get(a)||null,e,t,r,n,i)),!0}return!1}function w6(e){var t=Ko(e.target);if(t!==null){var r=pl(t);if(r!==null){if(t=r.tag,t===13){if(t=u6(r),t!==null){e.blockedOn=t,_6(e.priority,function(){y6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ed(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_v(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);pv=n,r.target.dispatchEvent(n),pv=null}else return t=Mc(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function _3(e,t,r){Ed(e)&&r.delete(t)}function dO(){bv=!1,to!==null&&Ed(to)&&(to=null),ro!==null&&Ed(ro)&&(ro=null),no!==null&&Ed(no)&&(no=null),ic.forEach(_3),ac.forEach(_3)}function Cu(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,dO)))}function oc(e){function t(i){return Cu(i,e)}if(0<Zf.length){Cu(Zf[0],e);for(var r=1;r<Zf.length;r++){var n=Zf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(to!==null&&Cu(to,e),ro!==null&&Cu(ro,e),no!==null&&Cu(no,e),ic.forEach(t),ac.forEach(t),r=0;r<Ya.length;r++)n=Ya[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ya.length&&(r=Ya[0],r.blockedOn===null);)w6(r),r.blockedOn===null&&Ya.shift()}var vs=xa.ReactCurrentBatchConfig,$d=!0;function hO(e,t,r,n){var i=xt,a=vs.transition;vs.transition=null;try{xt=1,Lm(e,t,r,n)}finally{xt=i,vs.transition=a}}function pO(e,t,r,n){var i=xt,a=vs.transition;vs.transition=null;try{xt=4,Lm(e,t,r,n)}finally{xt=i,vs.transition=a}}function Lm(e,t,r,n){if($d){var i=_v(e,t,r,n);if(i===null)P1(e,t,n,Gd,r),b3(e,n);else if(fO(i,e,t,r,n))n.stopPropagation();else if(b3(e,n),t&4&&-1<cO.indexOf(e)){for(;i!==null;){var a=Mc(i);if(a!==null&&m6(a),a=_v(e,t,r,n),a===null&&P1(e,t,n,Gd,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else P1(e,t,n,null,r)}}var Gd=null;function _v(e,t,r,n){if(Gd=null,e=Tm(n),e=Ko(e),e!==null)if(t=pl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=u6(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gd=e,null}function S6(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tO()){case Am:return 1;case h6:return 4;case Ud:case rO:return 16;case p6:return 536870912;default:return 16}default:return 16}}var Qa=null,Nm=null,Od=null;function E6(){if(Od)return Od;var e,t=Nm,r=t.length,n,i="value"in Qa?Qa.value:Qa.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return Od=i.slice(e,1<n?1-n:void 0)}function xd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qf(){return!0}function w3(){return!1}function Tn(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Qf:w3,this.isPropagationStopped=w3,this}return Kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Qf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Qf)},persist:function(){},isPersistent:Qf}),t}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Tn($s),Rc=Kt({},$s,{view:0,detail:0}),gO=Tn(Rc),m1,y1,ku,kh=Kt({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ku&&(ku&&e.type==="mousemove"?(m1=e.screenX-ku.screenX,y1=e.screenY-ku.screenY):y1=m1=0,ku=e),m1)},movementY:function(e){return"movementY"in e?e.movementY:y1}}),S3=Tn(kh),vO=Kt({},kh,{dataTransfer:0}),mO=Tn(vO),yO=Kt({},Rc,{relatedTarget:0}),b1=Tn(yO),bO=Kt({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),_O=Tn(bO),wO=Kt({},$s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),SO=Tn(wO),EO=Kt({},$s,{data:0}),E3=Tn(EO),OO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},PO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PO[e])?!!t[e]:!1}function Dm(){return CO}var kO=Kt({},Rc,{key:function(e){if(e.key){var t=OO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(e){return e.type==="keypress"?xd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TO=Tn(kO),AO=Kt({},kh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O3=Tn(AO),RO=Kt({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),MO=Tn(RO),LO=Kt({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),NO=Tn(LO),IO=Kt({},kh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),DO=Tn(IO),jO=[9,13,27,32],jm=ba&&"CompositionEvent"in window,Gu=null;ba&&"documentMode"in document&&(Gu=document.documentMode);var FO=ba&&"TextEvent"in window&&!Gu,O6=ba&&(!jm||Gu&&8<Gu&&11>=Gu),x3=" ",P3=!1;function x6(e,t){switch(e){case"keyup":return jO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function zO(e,t){switch(e){case"compositionend":return P6(t);case"keypress":return t.which!==32?null:(P3=!0,x3);case"textInput":return e=t.data,e===x3&&P3?null:e;default:return null}}function BO(e,t){if(es)return e==="compositionend"||!jm&&x6(e,t)?(e=E6(),Od=Nm=Qa=null,es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return O6&&t.locale!=="ko"?null:t.data;default:return null}}var UO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function C3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!UO[e.type]:t==="textarea"}function C6(e,t,r,n){i6(n),t=Vd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vu=null,lc=null;function HO(e){F6(e,0)}function Th(e){var t=ns(e);if(Z_(t))return e}function $O(e,t){if(e==="change")return t}var k6=!1;if(ba){var _1;if(ba){var w1="oninput"in document;if(!w1){var k3=document.createElement("div");k3.setAttribute("oninput","return;"),w1=typeof k3.oninput=="function"}_1=w1}else _1=!1;k6=_1&&(!document.documentMode||9<document.documentMode)}function T3(){Vu&&(Vu.detachEvent("onpropertychange",T6),lc=Vu=null)}function T6(e){if(e.propertyName==="value"&&Th(lc)){var t=[];C6(t,lc,e,Tm(e)),s6(HO,t)}}function GO(e,t,r){e==="focusin"?(T3(),Vu=t,lc=r,Vu.attachEvent("onpropertychange",T6)):e==="focusout"&&T3()}function VO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Th(lc)}function qO(e,t){if(e==="click")return Th(t)}function WO(e,t){if(e==="input"||e==="change")return Th(t)}function KO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vi=typeof Object.is=="function"?Object.is:KO;function sc(e,t){if(vi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!rv.call(t,i)||!vi(e[i],t[i]))return!1}return!0}function A3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function R3(e,t){var r=A3(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=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=A3(r)}}function A6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?A6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R6(){for(var e=window,t=Fd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fd(e.document)}return t}function Fm(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 YO(e){var t=R6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&A6(r.ownerDocument.documentElement,r)){if(n!==null&&Fm(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,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=R3(r,a);var o=R3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var XO=ba&&"documentMode"in document&&11>=document.documentMode,ts=null,wv=null,qu=null,Sv=!1;function M3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||ts==null||ts!==Fd(n)||(n=ts,"selectionStart"in n&&Fm(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}),qu&&sc(qu,n)||(qu=n,n=Vd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ts)))}function Jf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var rs={animationend:Jf("Animation","AnimationEnd"),animationiteration:Jf("Animation","AnimationIteration"),animationstart:Jf("Animation","AnimationStart"),transitionend:Jf("Transition","TransitionEnd")},S1={},M6={};ba&&(M6=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function Ah(e){if(S1[e])return S1[e];if(!rs[e])return e;var t=rs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in M6)return S1[e]=t[r];return e}var L6=Ah("animationend"),N6=Ah("animationiteration"),I6=Ah("animationstart"),D6=Ah("transitionend"),j6=new Map,L3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yo(e,t){j6.set(e,t),hl(t,[e])}for(var E1=0;E1<L3.length;E1++){var O1=L3[E1],ZO=O1.toLowerCase(),QO=O1[0].toUpperCase()+O1.slice(1);yo(ZO,"on"+QO)}yo(L6,"onAnimationEnd");yo(N6,"onAnimationIteration");yo(I6,"onAnimationStart");yo("dblclick","onDoubleClick");yo("focusin","onFocus");yo("focusout","onBlur");yo(D6,"onTransitionEnd");_s("onMouseEnter",["mouseout","mouseover"]);_s("onMouseLeave",["mouseout","mouseover"]);_s("onPointerEnter",["pointerout","pointerover"]);_s("onPointerLeave",["pointerout","pointerover"]);hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hl("onBeforeInput",["compositionend","keypress","textInput","paste"]);hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),JO=new Set("cancel close invalid load scroll toggle".split(" ").concat(zu));function N3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ZE(n,t,void 0,e),e.currentTarget=null}function F6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==a&&i.isPropagationStopped())break e;N3(i,l,f),a=u}else for(o=0;o<n.length;o++){if(l=n[o],u=l.instance,f=l.currentTarget,l=l.listener,u!==a&&i.isPropagationStopped())break e;N3(i,l,f),a=u}}}if(Bd)throw e=mv,Bd=!1,mv=null,e}function Ft(e,t){var r=t[Cv];r===void 0&&(r=t[Cv]=new Set);var n=e+"__bubble";r.has(n)||(z6(t,e,2,!1),r.add(n))}function x1(e,t,r){var n=0;t&&(n|=4),z6(r,e,n,t)}var ed="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[ed]){e[ed]=!0,q_.forEach(function(r){r!=="selectionchange"&&(JO.has(r)||x1(r,!1,e),x1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ed]||(t[ed]=!0,x1("selectionchange",!1,t))}}function z6(e,t,r,n){switch(S6(t)){case 1:var i=hO;break;case 4:i=pO;break;default:i=Lm}r=i.bind(null,t,r,e),i=void 0,!vv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function P1(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ko(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}s6(function(){var f=a,h=Tm(r),E=[];e:{var w=j6.get(e);if(w!==void 0){var p=Im,S=e;switch(e){case"keypress":if(xd(r)===0)break e;case"keydown":case"keyup":p=TO;break;case"focusin":S="focus",p=b1;break;case"focusout":S="blur",p=b1;break;case"beforeblur":case"afterblur":p=b1;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=S3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=mO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=MO;break;case L6:case N6:case I6:p=_O;break;case D6:p=NO;break;case"scroll":p=gO;break;case"wheel":p=DO;break;case"copy":case"cut":case"paste":p=SO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=O3}var b=(t&4)!==0,m=!b&&e==="scroll",v=b?w!==null?w+"Capture":null:w;b=[];for(var y=f,d;y!==null;){d=y;var g=d.stateNode;if(d.tag===5&&g!==null&&(d=g,v!==null&&(g=nc(y,v),g!=null&&b.push(cc(y,g,d)))),m)break;y=y.return}0<b.length&&(w=new p(w,S,null,r,h),E.push({event:w,listeners:b}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",w&&r!==pv&&(S=r.relatedTarget||r.fromElement)&&(Ko(S)||S[_a]))break e;if((p||w)&&(w=h.window===h?h:(w=h.ownerDocument)?w.defaultView||w.parentWindow:window,p?(S=r.relatedTarget||r.toElement,p=f,S=S?Ko(S):null,S!==null&&(m=pl(S),S!==m||S.tag!==5&&S.tag!==6)&&(S=null)):(p=null,S=f),p!==S)){if(b=S3,g="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(b=O3,g="onPointerLeave",v="onPointerEnter",y="pointer"),m=p==null?w:ns(p),d=S==null?w:ns(S),w=new b(g,y+"leave",p,r,h),w.target=m,w.relatedTarget=d,g=null,Ko(h)===f&&(b=new b(v,y+"enter",S,r,h),b.target=d,b.relatedTarget=m,g=b),m=g,p&&S)t:{for(b=p,v=S,y=0,d=b;d;d=ql(d))y++;for(d=0,g=v;g;g=ql(g))d++;for(;0<y-d;)b=ql(b),y--;for(;0<d-y;)v=ql(v),d--;for(;y--;){if(b===v||v!==null&&b===v.alternate)break t;b=ql(b),v=ql(v)}b=null}else b=null;p!==null&&I3(E,w,p,b,!1),S!==null&&m!==null&&I3(E,m,S,b,!0)}}e:{if(w=f?ns(f):window,p=w.nodeName&&w.nodeName.toLowerCase(),p==="select"||p==="input"&&w.type==="file")var _=$O;else if(C3(w))if(k6)_=WO;else{_=VO;var T=GO}else(p=w.nodeName)&&p.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(_=qO);if(_&&(_=_(e,f))){C6(E,_,r,h);break e}T&&T(e,w,f),e==="focusout"&&(T=w._wrapperState)&&T.controlled&&w.type==="number"&&uv(w,"number",w.value)}switch(T=f?ns(f):window,e){case"focusin":(C3(T)||T.contentEditable==="true")&&(ts=T,wv=f,qu=null);break;case"focusout":qu=wv=ts=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,M3(E,r,h);break;case"selectionchange":if(XO)break;case"keydown":case"keyup":M3(E,r,h)}var C;if(jm)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else es?x6(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(O6&&r.locale!=="ko"&&(es||P!=="onCompositionStart"?P==="onCompositionEnd"&&es&&(C=E6()):(Qa=h,Nm="value"in Qa?Qa.value:Qa.textContent,es=!0)),T=Vd(f,P),0<T.length&&(P=new E3(P,e,null,r,h),E.push({event:P,listeners:T}),C?P.data=C:(C=P6(r),C!==null&&(P.data=C)))),(C=FO?zO(e,r):BO(e,r))&&(f=Vd(f,"onBeforeInput"),0<f.length&&(h=new E3("onBeforeInput","beforeinput",null,r,h),E.push({event:h,listeners:f}),h.data=C))}F6(E,t)})}function cc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Vd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=nc(e,r),a!=null&&n.unshift(cc(e,a,i)),a=nc(e,t),a!=null&&n.push(cc(e,a,i))),e=e.return}return n}function ql(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function I3(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===n)break;l.tag===5&&f!==null&&(l=f,i?(u=nc(r,a),u!=null&&o.unshift(cc(r,u,l))):i||(u=nc(r,a),u!=null&&o.push(cc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var ex=/\r\n?/g,tx=/\u0000|\uFFFD/g;function D3(e){return(typeof e=="string"?e:""+e).replace(ex,`
30
- `).replace(tx,"")}function td(e,t,r){if(t=D3(t),D3(e)!==t&&r)throw Error(Pe(425))}function qd(){}var Ev=null,Ov=null;function xv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pv=typeof setTimeout=="function"?setTimeout:void 0,rx=typeof clearTimeout=="function"?clearTimeout:void 0,j3=typeof Promise=="function"?Promise:void 0,nx=typeof queueMicrotask=="function"?queueMicrotask:typeof j3<"u"?function(e){return j3.resolve(null).then(e).catch(ix)}:Pv;function ix(e){setTimeout(function(){throw e})}function C1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),oc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);oc(t)}function io(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function F3(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Gs=Math.random().toString(36).slice(2),ji="__reactFiber$"+Gs,fc="__reactProps$"+Gs,_a="__reactContainer$"+Gs,Cv="__reactEvents$"+Gs,ax="__reactListeners$"+Gs,ox="__reactHandles$"+Gs;function Ko(e){var t=e[ji];if(t)return t;for(var r=e.parentNode;r;){if(t=r[_a]||r[ji]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=F3(e);e!==null;){if(r=e[ji])return r;e=F3(e)}return t}e=r,r=e.parentNode}return null}function Mc(e){return e=e[ji]||e[_a],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ns(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Pe(33))}function Rh(e){return e[fc]||null}var kv=[],is=-1;function bo(e){return{current:e}}function zt(e){0>is||(e.current=kv[is],kv[is]=null,is--)}function Lt(e,t){is++,kv[is]=e.current,e.current=t}var ho={},$r=bo(ho),fn=bo(!1),rl=ho;function ws(e,t){var r=e.type.contextTypes;if(!r)return ho;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dn(e){return e=e.childContextTypes,e!=null}function Wd(){zt(fn),zt($r)}function z3(e,t,r){if($r.current!==ho)throw Error(Pe(168));Lt($r,t),Lt(fn,r)}function B6(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(Pe(108,GE(e)||"Unknown",i));return Kt({},r,n)}function Kd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ho,rl=$r.current,Lt($r,e),Lt(fn,fn.current),!0}function B3(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=B6(e,t,rl),n.__reactInternalMemoizedMergedChildContext=e,zt(fn),zt($r),Lt($r,e)):zt(fn),Lt(fn,r)}var ca=null,Mh=!1,k1=!1;function U6(e){ca===null?ca=[e]:ca.push(e)}function lx(e){Mh=!0,U6(e)}function _o(){if(!k1&&ca!==null){k1=!0;var e=0,t=xt;try{var r=ca;for(xt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ca=null,Mh=!1}catch(i){throw ca!==null&&(ca=ca.slice(e+1)),d6(Am,_o),i}finally{xt=t,k1=!1}}return null}var as=[],os=0,Yd=null,Xd=0,Hn=[],$n=0,nl=null,da=1,ha="";function qo(e,t){as[os++]=Xd,as[os++]=Yd,Yd=e,Xd=t}function H6(e,t,r){Hn[$n++]=da,Hn[$n++]=ha,Hn[$n++]=nl,nl=e;var n=da;e=ha;var i=32-ci(n)-1;n&=~(1<<i),r+=1;var a=32-ci(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,da=1<<32-ci(t)+i|r<<i|n,ha=a+e}else da=1<<a|r<<i|n,ha=e}function zm(e){e.return!==null&&(qo(e,1),H6(e,1,0))}function Bm(e){for(;e===Yd;)Yd=as[--os],as[os]=null,Xd=as[--os],as[os]=null;for(;e===nl;)nl=Hn[--$n],Hn[$n]=null,ha=Hn[--$n],Hn[$n]=null,da=Hn[--$n],Hn[$n]=null}var xn=null,On=null,Ht=!1,ui=null;function $6(e,t){var r=qn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function U3(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xn=e,On=io(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=nl!==null?{id:da,overflow:ha}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=qn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xn=e,On=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Av(e){if(Ht){var t=On;if(t){var r=t;if(!U3(e,t)){if(Tv(e))throw Error(Pe(418));t=io(r.nextSibling);var n=xn;t&&U3(e,t)?$6(n,r):(e.flags=e.flags&-4097|2,Ht=!1,xn=e)}}else{if(Tv(e))throw Error(Pe(418));e.flags=e.flags&-4097|2,Ht=!1,xn=e}}}function H3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xn=e}function rd(e){if(e!==xn)return!1;if(!Ht)return H3(e),Ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xv(e.type,e.memoizedProps)),t&&(t=On)){if(Tv(e))throw G6(),Error(Pe(418));for(;t;)$6(e,t),t=io(t.nextSibling)}if(H3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Pe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){On=io(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}On=null}}else On=xn?io(e.stateNode.nextSibling):null;return!0}function G6(){for(var e=On;e;)e=io(e.nextSibling)}function Ss(){On=xn=null,Ht=!1}function Um(e){ui===null?ui=[e]:ui.push(e)}var sx=xa.ReactCurrentBatchConfig;function Tu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Pe(309));var n=r.stateNode}if(!n)throw Error(Pe(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Pe(284));if(!r._owner)throw Error(Pe(290,e))}return e}function nd(e,t){throw e=Object.prototype.toString.call(t),Error(Pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $3(e){var t=e._init;return t(e._payload)}function V6(e){function t(v,y){if(e){var d=v.deletions;d===null?(v.deletions=[y],v.flags|=16):d.push(y)}}function r(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function n(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function i(v,y){return v=so(v,y),v.index=0,v.sibling=null,v}function a(v,y,d){return v.index=d,e?(d=v.alternate,d!==null?(d=d.index,d<y?(v.flags|=2,y):d):(v.flags|=2,y)):(v.flags|=1048576,y)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,y,d,g){return y===null||y.tag!==6?(y=I1(d,v.mode,g),y.return=v,y):(y=i(y,d),y.return=v,y)}function u(v,y,d,g){var _=d.type;return _===Jl?h(v,y,d.props.children,g,d.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Wa&&$3(_)===y.type)?(g=i(y,d.props),g.ref=Tu(v,y,d),g.return=v,g):(g=Md(d.type,d.key,d.props,null,v.mode,g),g.ref=Tu(v,y,d),g.return=v,g)}function f(v,y,d,g){return y===null||y.tag!==4||y.stateNode.containerInfo!==d.containerInfo||y.stateNode.implementation!==d.implementation?(y=D1(d,v.mode,g),y.return=v,y):(y=i(y,d.children||[]),y.return=v,y)}function h(v,y,d,g,_){return y===null||y.tag!==7?(y=Jo(d,v.mode,g,_),y.return=v,y):(y=i(y,d),y.return=v,y)}function E(v,y,d){if(typeof y=="string"&&y!==""||typeof y=="number")return y=I1(""+y,v.mode,d),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qf:return d=Md(y.type,y.key,y.props,null,v.mode,d),d.ref=Tu(v,null,y),d.return=v,d;case Ql:return y=D1(y,v.mode,d),y.return=v,y;case Wa:var g=y._init;return E(v,g(y._payload),d)}if(ju(y)||Ou(y))return y=Jo(y,v.mode,d,null),y.return=v,y;nd(v,y)}return null}function w(v,y,d,g){var _=y!==null?y.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return _!==null?null:l(v,y,""+d,g);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case qf:return d.key===_?u(v,y,d,g):null;case Ql:return d.key===_?f(v,y,d,g):null;case Wa:return _=d._init,w(v,y,_(d._payload),g)}if(ju(d)||Ou(d))return _!==null?null:h(v,y,d,g,null);nd(v,d)}return null}function p(v,y,d,g,_){if(typeof g=="string"&&g!==""||typeof g=="number")return v=v.get(d)||null,l(y,v,""+g,_);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case qf:return v=v.get(g.key===null?d:g.key)||null,u(y,v,g,_);case Ql:return v=v.get(g.key===null?d:g.key)||null,f(y,v,g,_);case Wa:var T=g._init;return p(v,y,d,T(g._payload),_)}if(ju(g)||Ou(g))return v=v.get(d)||null,h(y,v,g,_,null);nd(y,g)}return null}function S(v,y,d,g){for(var _=null,T=null,C=y,P=y=0,O=null;C!==null&&P<d.length;P++){C.index>P?(O=C,C=null):O=C.sibling;var x=w(v,C,d[P],g);if(x===null){C===null&&(C=O);break}e&&C&&x.alternate===null&&t(v,C),y=a(x,y,P),T===null?_=x:T.sibling=x,T=x,C=O}if(P===d.length)return r(v,C),Ht&&qo(v,P),_;if(C===null){for(;P<d.length;P++)C=E(v,d[P],g),C!==null&&(y=a(C,y,P),T===null?_=C:T.sibling=C,T=C);return Ht&&qo(v,P),_}for(C=n(v,C);P<d.length;P++)O=p(C,v,P,d[P],g),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?P:O.key),y=a(O,y,P),T===null?_=O:T.sibling=O,T=O);return e&&C.forEach(function(k){return t(v,k)}),Ht&&qo(v,P),_}function b(v,y,d,g){var _=Ou(d);if(typeof _!="function")throw Error(Pe(150));if(d=_.call(d),d==null)throw Error(Pe(151));for(var T=_=null,C=y,P=y=0,O=null,x=d.next();C!==null&&!x.done;P++,x=d.next()){C.index>P?(O=C,C=null):O=C.sibling;var k=w(v,C,x.value,g);if(k===null){C===null&&(C=O);break}e&&C&&k.alternate===null&&t(v,C),y=a(k,y,P),T===null?_=k:T.sibling=k,T=k,C=O}if(x.done)return r(v,C),Ht&&qo(v,P),_;if(C===null){for(;!x.done;P++,x=d.next())x=E(v,x.value,g),x!==null&&(y=a(x,y,P),T===null?_=x:T.sibling=x,T=x);return Ht&&qo(v,P),_}for(C=n(v,C);!x.done;P++,x=d.next())x=p(C,v,P,x.value,g),x!==null&&(e&&x.alternate!==null&&C.delete(x.key===null?P:x.key),y=a(x,y,P),T===null?_=x:T.sibling=x,T=x);return e&&C.forEach(function(M){return t(v,M)}),Ht&&qo(v,P),_}function m(v,y,d,g){if(typeof d=="object"&&d!==null&&d.type===Jl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case qf:e:{for(var _=d.key,T=y;T!==null;){if(T.key===_){if(_=d.type,_===Jl){if(T.tag===7){r(v,T.sibling),y=i(T,d.props.children),y.return=v,v=y;break e}}else if(T.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Wa&&$3(_)===T.type){r(v,T.sibling),y=i(T,d.props),y.ref=Tu(v,T,d),y.return=v,v=y;break e}r(v,T);break}else t(v,T);T=T.sibling}d.type===Jl?(y=Jo(d.props.children,v.mode,g,d.key),y.return=v,v=y):(g=Md(d.type,d.key,d.props,null,v.mode,g),g.ref=Tu(v,y,d),g.return=v,v=g)}return o(v);case Ql:e:{for(T=d.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===d.containerInfo&&y.stateNode.implementation===d.implementation){r(v,y.sibling),y=i(y,d.children||[]),y.return=v,v=y;break e}else{r(v,y);break}else t(v,y);y=y.sibling}y=D1(d,v.mode,g),y.return=v,v=y}return o(v);case Wa:return T=d._init,m(v,y,T(d._payload),g)}if(ju(d))return S(v,y,d,g);if(Ou(d))return b(v,y,d,g);nd(v,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,y!==null&&y.tag===6?(r(v,y.sibling),y=i(y,d),y.return=v,v=y):(r(v,y),y=I1(d,v.mode,g),y.return=v,v=y),o(v)):r(v,y)}return m}var Es=V6(!0),q6=V6(!1),Zd=bo(null),Qd=null,ls=null,Hm=null;function $m(){Hm=ls=Qd=null}function Gm(e){var t=Zd.current;zt(Zd),e._currentValue=t}function Rv(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 ms(e,t){Qd=e,Hm=ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sn=!0),e.firstContext=null)}function Yn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},ls===null){if(Qd===null)throw Error(Pe(308));ls=e,Qd.dependencies={lanes:0,firstContext:e}}else ls=ls.next=e;return t}var Yo=null;function Vm(e){Yo===null?Yo=[e]:Yo.push(e)}function W6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Vm(t)):(r.next=i.next,i.next=r),t.interleaved=r,wa(e,n)}function wa(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 Ka=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K6(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 pa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ao(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,yt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,wa(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,wa(e,r)}function Pd(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,Rm(e,r)}}function G3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 Jd(e,t,r,n){var i=e.updateQueue;Ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=f:l.next=f,h.lastBaseUpdate=u))}if(a!==null){var E=i.baseState;o=0,h=f=u=null,l=a;do{var w=l.lane,p=l.eventTime;if((n&w)===w){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var S=e,b=l;switch(w=t,p=r,b.tag){case 1:if(S=b.payload,typeof S=="function"){E=S.call(p,E,w);break e}E=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,w=typeof S=="function"?S.call(p,E,w):S,w==null)break e;E=Kt({},E,w);break e;case 2:Ka=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else p={eventTime:p,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(f=h=p,u=E):h=h.next=p,o|=w;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;w=l,l=w.next,w.next=null,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);if(h===null&&(u=E),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);al|=o,e.lanes=o,e.memoizedState=E}}function V3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Pe(191,i));i.call(n)}}}var Lc={},Hi=bo(Lc),dc=bo(Lc),hc=bo(Lc);function Xo(e){if(e===Lc)throw Error(Pe(174));return e}function Wm(e,t){switch(Lt(hc,t),Lt(dc,e),Lt(Hi,Lc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fv(t,e)}zt(Hi),Lt(Hi,t)}function Os(){zt(Hi),zt(dc),zt(hc)}function Y6(e){Xo(hc.current);var t=Xo(Hi.current),r=fv(t,e.type);t!==r&&(Lt(dc,e),Lt(Hi,r))}function Km(e){dc.current===e&&(zt(Hi),zt(dc))}var qt=bo(0);function eh(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var T1=[];function Ym(){for(var e=0;e<T1.length;e++)T1[e]._workInProgressVersionPrimary=null;T1.length=0}var Cd=xa.ReactCurrentDispatcher,A1=xa.ReactCurrentBatchConfig,il=0,Wt=null,cr=null,wr=null,th=!1,Wu=!1,pc=0,ux=0;function Br(){throw Error(Pe(321))}function Xm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!vi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(il=a,Wt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cd.current=e===null||e.memoizedState===null?hx:px,e=r(n,i),Wu){a=0;do{if(Wu=!1,pc=0,25<=a)throw Error(Pe(301));a+=1,wr=cr=null,t.updateQueue=null,Cd.current=gx,e=r(n,i)}while(Wu)}if(Cd.current=rh,t=cr!==null&&cr.next!==null,il=0,wr=cr=Wt=null,th=!1,t)throw Error(Pe(300));return e}function Qm(){var e=pc!==0;return pc=0,e}function Di(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Wt.memoizedState=wr=e:wr=wr.next=e,wr}function Xn(){if(cr===null){var e=Wt.alternate;e=e!==null?e.memoizedState:null}else e=cr.next;var t=wr===null?Wt.memoizedState:wr.next;if(t!==null)wr=t,cr=e;else{if(e===null)throw Error(Pe(310));cr=e,e={memoizedState:cr.memoizedState,baseState:cr.baseState,baseQueue:cr.baseQueue,queue:cr.queue,next:null},wr===null?Wt.memoizedState=wr=e:wr=wr.next=e}return wr}function gc(e,t){return typeof t=="function"?t(e):t}function R1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=cr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var h=f.lane;if((il&h)===h)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var E={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=E,o=n):u=u.next=E,Wt.lanes|=h,al|=h}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,vi(n,t.memoizedState)||(sn=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Wt.lanes|=a,al|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function M1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);vi(a,t.memoizedState)||(sn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function X6(){}function Z6(e,t){var r=Wt,n=Xn(),i=t(),a=!vi(n.memoizedState,i);if(a&&(n.memoizedState=i,sn=!0),n=n.queue,Jm(ew.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||wr!==null&&wr.memoizedState.tag&1){if(r.flags|=2048,vc(9,J6.bind(null,r,n,i,t),void 0,null),Sr===null)throw Error(Pe(349));il&30||Q6(r,t,i)}return i}function Q6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Wt.updateQueue,t===null?(t={lastEffect:null,stores:null},Wt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function J6(e,t,r,n){t.value=r,t.getSnapshot=n,tw(t)&&rw(e)}function ew(e,t,r){return r(function(){tw(t)&&rw(e)})}function tw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!vi(e,r)}catch{return!0}}function rw(e){var t=wa(e,1);t!==null&&fi(t,e,1,-1)}function q3(e){var t=Di();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gc,lastRenderedState:e},t.queue=e,e=e.dispatch=dx.bind(null,Wt,e),[t.memoizedState,e]}function vc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Wt.updateQueue,t===null?(t={lastEffect:null,stores:null},Wt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function nw(){return Xn().memoizedState}function kd(e,t,r,n){var i=Di();Wt.flags|=e,i.memoizedState=vc(1|t,r,void 0,n===void 0?null:n)}function Lh(e,t,r,n){var i=Xn();n=n===void 0?null:n;var a=void 0;if(cr!==null){var o=cr.memoizedState;if(a=o.destroy,n!==null&&Xm(n,o.deps)){i.memoizedState=vc(t,r,a,n);return}}Wt.flags|=e,i.memoizedState=vc(1|t,r,a,n)}function W3(e,t){return kd(8390656,8,e,t)}function Jm(e,t){return Lh(2048,8,e,t)}function iw(e,t){return Lh(4,2,e,t)}function aw(e,t){return Lh(4,4,e,t)}function ow(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function lw(e,t,r){return r=r!=null?r.concat([e]):null,Lh(4,4,ow.bind(null,t,e),r)}function ey(){}function sw(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function uw(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function cw(e,t,r){return il&21?(vi(r,t)||(r=g6(),Wt.lanes|=r,al|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sn=!0),e.memoizedState=r)}function cx(e,t){var r=xt;xt=r!==0&&4>r?r:4,e(!0);var n=A1.transition;A1.transition={};try{e(!1),t()}finally{xt=r,A1.transition=n}}function fw(){return Xn().memoizedState}function fx(e,t,r){var n=lo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},dw(e))hw(t,r);else if(r=W6(e,t,r,n),r!==null){var i=Kr();fi(r,e,n,i),pw(r,t,n)}}function dx(e,t,r){var n=lo(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(dw(e))hw(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,vi(l,o)){var u=t.interleaved;u===null?(i.next=i,Vm(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=W6(e,t,i,n),r!==null&&(i=Kr(),fi(r,e,n,i),pw(r,t,n))}}function dw(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function hw(e,t){Wu=th=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function pw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var rh={readContext:Yn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},hx={readContext:Yn,useCallback:function(e,t){return Di().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:W3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,kd(4194308,4,ow.bind(null,t,e),r)},useLayoutEffect:function(e,t){return kd(4194308,4,e,t)},useInsertionEffect:function(e,t){return kd(4,2,e,t)},useMemo:function(e,t){var r=Di();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Di();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=fx.bind(null,Wt,e),[n.memoizedState,e]},useRef:function(e){var t=Di();return e={current:e},t.memoizedState=e},useState:q3,useDebugValue:ey,useDeferredValue:function(e){return Di().memoizedState=e},useTransition:function(){var e=q3(!1),t=e[0];return e=cx.bind(null,e[1]),Di().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Wt,i=Di();if(Ht){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),Sr===null)throw Error(Pe(349));il&30||Q6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,W3(ew.bind(null,n,a,e),[e]),n.flags|=2048,vc(9,J6.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Di(),t=Sr.identifierPrefix;if(Ht){var r=ha,n=da;r=(n&~(1<<32-ci(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=pc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=ux++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},px={readContext:Yn,useCallback:sw,useContext:Yn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:R1,useRef:nw,useState:function(){return R1(gc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return cw(t,cr.memoizedState,e)},useTransition:function(){var e=R1(gc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1},gx={readContext:Yn,useCallback:sw,useContext:Yn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:M1,useRef:nw,useState:function(){return M1(gc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return cr===null?t.memoizedState=e:cw(t,cr.memoizedState,e)},useTransition:function(){var e=M1(gc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1};function li(e,t){if(e&&e.defaultProps){t=Kt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Mv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Kt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Nh={isMounted:function(e){return(e=e._reactInternals)?pl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Kr(),i=lo(e),a=pa(n,i);a.payload=t,r!=null&&(a.callback=r),t=ao(e,a,i),t!==null&&(fi(t,e,i,n),Pd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Kr(),i=lo(e),a=pa(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ao(e,a,i),t!==null&&(fi(t,e,i,n),Pd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kr(),n=lo(e),i=pa(r,n);i.tag=2,t!=null&&(i.callback=t),t=ao(e,i,n),t!==null&&(fi(t,e,n,r),Pd(t,e,n))}};function K3(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!sc(r,n)||!sc(i,a):!0}function gw(e,t,r){var n=!1,i=ho,a=t.contextType;return typeof a=="object"&&a!==null?a=Yn(a):(i=dn(t)?rl:$r.current,n=t.contextTypes,a=(n=n!=null)?ws(e,i):ho),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Nh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Y3(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Nh.enqueueReplaceState(t,t.state,null)}function Lv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},qm(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Yn(a):(a=dn(t)?rl:$r.current,i.context=ws(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Mv(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Nh.enqueueReplaceState(i,i.state,null),Jd(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function xs(e,t){try{var r="",n=t;do r+=$E(n),n=n.return;while(n);var i=r}catch(a){i=`
31
- Error generating stack: `+a.message+`
32
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function L1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Nv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var vx=typeof WeakMap=="function"?WeakMap:Map;function vw(e,t,r){r=pa(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ih||(ih=!0,Gv=n),Nv(e,t)},r}function mw(e,t,r){r=pa(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Nv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Nv(e,t),typeof n!="function"&&(oo===null?oo=new Set([this]):oo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function X3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new vx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Ax.bind(null,e,t,r),t.then(e,e))}function Z3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Q3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=pa(-1,1),t.tag=2,ao(r,t,1))),r.lanes|=1),e)}var mx=xa.ReactCurrentOwner,sn=!1;function Wr(e,t,r,n){t.child=e===null?q6(t,null,r,n):Es(t,e.child,r,n)}function J3(e,t,r,n,i){r=r.render;var a=t.ref;return ms(t,i),n=Zm(e,t,r,n,a,i),r=Qm(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Sa(e,t,i)):(Ht&&r&&zm(t),t.flags|=1,Wr(e,t,n,i),t.child)}function e5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,yw(e,t,a,n,i)):(e=Md(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:sc,r(o,n)&&e.ref===t.ref)return Sa(e,t,i)}return t.flags|=1,e=so(a,n),e.ref=t.ref,e.return=t,t.child=e}function yw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(sc(a,n)&&e.ref===t.ref)if(sn=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sn=!0);else return t.lanes=e.lanes,Sa(e,t,i)}return Iv(e,t,r,n,i)}function bw(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(us,Sn),Sn|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Lt(us,Sn),Sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Lt(us,Sn),Sn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Lt(us,Sn),Sn|=n;return Wr(e,t,i,r),t.child}function _w(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Iv(e,t,r,n,i){var a=dn(r)?rl:$r.current;return a=ws(t,a),ms(t,i),r=Zm(e,t,r,n,a,i),n=Qm(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Sa(e,t,i)):(Ht&&n&&zm(t),t.flags|=1,Wr(e,t,r,i),t.child)}function t5(e,t,r,n,i){if(dn(r)){var a=!0;Kd(t)}else a=!1;if(ms(t,i),t.stateNode===null)Td(e,t),gw(t,r,n),Lv(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=Yn(f):(f=dn(r)?rl:$r.current,f=ws(t,f));var h=r.getDerivedStateFromProps,E=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";E||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&Y3(t,o,n,f),Ka=!1;var w=t.memoizedState;o.state=w,Jd(t,n,o,i),u=t.memoizedState,l!==n||w!==u||fn.current||Ka?(typeof h=="function"&&(Mv(t,r,h,n),u=t.memoizedState),(l=Ka||K3(t,r,l,n,w,u,f))?(E||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,K6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:li(t.type,l),o.props=f,E=t.pendingProps,w=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Yn(u):(u=dn(r)?rl:$r.current,u=ws(t,u));var p=r.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==E||w!==u)&&Y3(t,o,n,u),Ka=!1,w=t.memoizedState,o.state=w,Jd(t,n,o,i);var S=t.memoizedState;l!==E||w!==S||fn.current||Ka?(typeof p=="function"&&(Mv(t,r,p,n),S=t.memoizedState),(f=Ka||K3(t,r,f,n,w,S,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,S,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,S,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=S),o.props=n,o.state=S,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),n=!1)}return Dv(e,t,r,n,a,i)}function Dv(e,t,r,n,i,a){_w(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&B3(t,r,!1),Sa(e,t,a);n=t.stateNode,mx.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Es(t,e.child,null,a),t.child=Es(t,null,l,a)):Wr(e,t,l,a),t.memoizedState=n.state,i&&B3(t,r,!0),t.child}function ww(e){var t=e.stateNode;t.pendingContext?z3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&z3(e,t.context,!1),Wm(e,t.containerInfo)}function r5(e,t,r,n,i){return Ss(),Um(i),t.flags|=256,Wr(e,t,r,n),t.child}var jv={dehydrated:null,treeContext:null,retryLane:0};function Fv(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sw(e,t,r){var n=t.pendingProps,i=qt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Lt(qt,i&1),e===null)return Av(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=jh(o,n,0,null),e=Jo(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Fv(r),t.memoizedState=jv,e):ty(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return yx(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=so(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=so(l,a):(a=Jo(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Fv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=jv,n}return a=e.child,e=a.sibling,n=so(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ty(e,t){return t=jh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function id(e,t,r,n){return n!==null&&Um(n),Es(t,e.child,null,r),e=ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yx(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=L1(Error(Pe(422))),id(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=jh({mode:"visible",children:n.children},i,0,null),a=Jo(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Es(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return id(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Pe(419)),n=L1(a,n,void 0),id(e,t,o,n)}if(l=(o&e.childLanes)!==0,sn||l){if(n=Sr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,wa(e,i),fi(n,e,i,-1))}return ly(),n=L1(Error(Pe(421))),id(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Rx.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,On=io(i.nextSibling),xn=t,Ht=!0,ui=null,e!==null&&(Hn[$n++]=da,Hn[$n++]=ha,Hn[$n++]=nl,da=e.id,ha=e.overflow,nl=t),t=ty(t,n.children),t.flags|=4096,t)}function n5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rv(e.return,t,r)}function N1(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function Ew(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Wr(e,t,n.children,r),n=qt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&n5(e,r,t);else if(e.tag===19)n5(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Lt(qt,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&eh(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),N1(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eh(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}N1(t,!0,r,null,a);break;case"together":N1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Td(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Sa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),al|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Pe(153));if(t.child!==null){for(e=t.child,r=so(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=so(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function bx(e,t,r){switch(t.tag){case 3:ww(t),Ss();break;case 5:Y6(t);break;case 1:dn(t.type)&&Kd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Lt(Zd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Lt(qt,qt.current&1),t.flags|=128,null):r&t.child.childLanes?Sw(e,t,r):(Lt(qt,qt.current&1),e=Sa(e,t,r),e!==null?e.sibling:null);Lt(qt,qt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ew(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lt(qt,qt.current),n)break;return null;case 22:case 23:return t.lanes=0,bw(e,t,r)}return Sa(e,t,r)}var Ow,zv,xw,Pw;Ow=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zv=function(){};xw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Xo(Hi.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Kt({},i,{value:void 0}),n=Kt({},n,{value:void 0}),a=[];break;case"textarea":i=cv(e,i),n=cv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=qd)}dv(r,n);var o;r=null;for(f in i)if(!n.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(tc.hasOwnProperty(f)?a||(a=[]):(a=a||[]).push(f,null));for(f in n){var u=n[f];if(l=i!=null?i[f]:void 0,n.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(a||(a=[]),a.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(a=a||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(tc.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Ft("scroll",e),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(t.updateQueue=f)&&(t.flags|=4)}};Pw=function(e,t,r,n){r!==n&&(t.flags|=4)};function Au(e,t){if(!Ht)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ur(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function _x(e,t,r){var n=t.pendingProps;switch(Bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ur(t),null;case 1:return dn(t.type)&&Wd(),Ur(t),null;case 3:return n=t.stateNode,Os(),zt(fn),zt($r),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(rd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ui!==null&&(Wv(ui),ui=null))),zv(e,t),Ur(t),null;case 5:Km(t);var i=Xo(hc.current);if(r=t.type,e!==null&&t.stateNode!=null)xw(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Pe(166));return Ur(t),null}if(e=Xo(Hi.current),rd(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[ji]=t,n[fc]=a,e=(t.mode&1)!==0,r){case"dialog":Ft("cancel",n),Ft("close",n);break;case"iframe":case"object":case"embed":Ft("load",n);break;case"video":case"audio":for(i=0;i<zu.length;i++)Ft(zu[i],n);break;case"source":Ft("error",n);break;case"img":case"image":case"link":Ft("error",n),Ft("load",n);break;case"details":Ft("toggle",n);break;case"input":d3(n,a),Ft("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ft("invalid",n);break;case"textarea":p3(n,a),Ft("invalid",n)}dv(r,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&td(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&td(n.textContent,l,e),i=["children",""+l]):tc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ft("scroll",n)}switch(r){case"input":Wf(n),h3(n,a,!0);break;case"textarea":Wf(n),g3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=qd)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=e6(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[ji]=t,e[fc]=n,Ow(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":Ft("cancel",e),Ft("close",e),i=n;break;case"iframe":case"object":case"embed":Ft("load",e),i=n;break;case"video":case"audio":for(i=0;i<zu.length;i++)Ft(zu[i],e);i=n;break;case"source":Ft("error",e),i=n;break;case"img":case"image":case"link":Ft("error",e),Ft("load",e),i=n;break;case"details":Ft("toggle",e),i=n;break;case"input":d3(e,n),i=lv(e,n),Ft("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Kt({},n,{value:void 0}),Ft("invalid",e);break;case"textarea":p3(e,n),i=cv(e,n),Ft("invalid",e);break;default:i=n}dv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?n6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&t6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&rc(e,u):typeof u=="number"&&rc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(tc.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Ft("scroll",e):u!=null&&xm(e,a,u,o))}switch(r){case"input":Wf(e),h3(e,n,!1);break;case"textarea":Wf(e),g3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+fo(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?hs(e,!!n.multiple,a,!1):n.defaultValue!=null&&hs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=qd)}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 Ur(t),null;case 6:if(e&&t.stateNode!=null)Pw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Pe(166));if(r=Xo(hc.current),Xo(Hi.current),rd(t)){if(n=t.stateNode,r=t.memoizedProps,n[ji]=t,(a=n.nodeValue!==r)&&(e=xn,e!==null))switch(e.tag){case 3:td(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&td(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ji]=t,t.stateNode=n}return Ur(t),null;case 13:if(zt(qt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ht&&On!==null&&t.mode&1&&!(t.flags&128))G6(),Ss(),t.flags|=98560,a=!1;else if(a=rd(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Pe(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Pe(317));a[ji]=t}else Ss(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ur(t),a=!1}else ui!==null&&(Wv(ui),ui=null),a=!0;if(!a)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||qt.current&1?dr===0&&(dr=3):ly())),t.updateQueue!==null&&(t.flags|=4),Ur(t),null);case 4:return Os(),zv(e,t),e===null&&uc(t.stateNode.containerInfo),Ur(t),null;case 10:return Gm(t.type._context),Ur(t),null;case 17:return dn(t.type)&&Wd(),Ur(t),null;case 19:if(zt(qt),a=t.memoizedState,a===null)return Ur(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)Au(a,!1);else{if(dr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eh(e),o!==null){for(t.flags|=128,Au(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Lt(qt,qt.current&1|2),t.child}e=e.sibling}a.tail!==null&&tr()>Ps&&(t.flags|=128,n=!0,Au(a,!1),t.lanes=4194304)}else{if(!n)if(e=eh(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Au(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ht)return Ur(t),null}else 2*tr()-a.renderingStartTime>Ps&&r!==1073741824&&(t.flags|=128,n=!0,Au(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=tr(),t.sibling=null,r=qt.current,Lt(qt,n?r&1|2:r&1),t):(Ur(t),null);case 22:case 23:return oy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Sn&1073741824&&(Ur(t),t.subtreeFlags&6&&(t.flags|=8192)):Ur(t),null;case 24:return null;case 25:return null}throw Error(Pe(156,t.tag))}function wx(e,t){switch(Bm(t),t.tag){case 1:return dn(t.type)&&Wd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Os(),zt(fn),zt($r),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Km(t),null;case 13:if(zt(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));Ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(qt),null;case 4:return Os(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var ad=!1,Hr=!1,Sx=typeof WeakSet=="function"?WeakSet:Set,He=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Zt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Zt(e,t,n)}}var i5=!1;function Ex(e,t){if(Ev=$d,e=R6(),Fm(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,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,h=0,E=e,w=null;t:for(;;){for(var p;E!==r||i!==0&&E.nodeType!==3||(l=o+i),E!==a||n!==0&&E.nodeType!==3||(u=o+n),E.nodeType===3&&(o+=E.nodeValue.length),(p=E.firstChild)!==null;)w=E,E=p;for(;;){if(E===e)break t;if(w===r&&++f===i&&(l=o),w===a&&++h===n&&(u=o),(p=E.nextSibling)!==null)break;E=w,w=E.parentNode}E=p}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ov={focusedElem:e,selectionRange:r},$d=!1,He=t;He!==null;)if(t=He,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,He=e;else for(;He!==null;){t=He;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var b=S.memoizedProps,m=S.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?b:li(t.type,b),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(g){Zt(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,He=e;break}He=t.return}return S=i5,i5=!1,S}function Ku(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 a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function Ih(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 Uv(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 Cw(e){var t=e.alternate;t!==null&&(e.alternate=null,Cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[fc],delete t[Cv],delete t[ax],delete t[ox])),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 kw(e){return e.tag===5||e.tag===3||e.tag===4}function a5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kw(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 Hv(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=qd));else if(n!==4&&(e=e.child,e!==null))for(Hv(e,t,r),e=e.sibling;e!==null;)Hv(e,t,r),e=e.sibling}function $v(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($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}var Cr=null,si=!1;function Ga(e,t,r){for(r=r.child;r!==null;)Tw(e,t,r),r=r.sibling}function Tw(e,t,r){if(Ui&&typeof Ui.onCommitFiberUnmount=="function")try{Ui.onCommitFiberUnmount(Ch,r)}catch{}switch(r.tag){case 5:Hr||ss(r,t);case 6:var n=Cr,i=si;Cr=null,Ga(e,t,r),Cr=n,si=i,Cr!==null&&(si?(e=Cr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Cr.removeChild(r.stateNode));break;case 18:Cr!==null&&(si?(e=Cr,r=r.stateNode,e.nodeType===8?C1(e.parentNode,r):e.nodeType===1&&C1(e,r),oc(e)):C1(Cr,r.stateNode));break;case 4:n=Cr,i=si,Cr=r.stateNode.containerInfo,si=!0,Ga(e,t,r),Cr=n,si=i;break;case 0:case 11:case 14:case 15:if(!Hr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Bv(r,t,o),i=i.next}while(i!==n)}Ga(e,t,r);break;case 1:if(!Hr&&(ss(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Zt(r,t,l)}Ga(e,t,r);break;case 21:Ga(e,t,r);break;case 22:r.mode&1?(Hr=(n=Hr)||r.memoizedState!==null,Ga(e,t,r),Hr=n):Ga(e,t,r);break;default:Ga(e,t,r)}}function o5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Sx),t.forEach(function(n){var i=Mx.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ii(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Cr=l.stateNode,si=!1;break e;case 3:Cr=l.stateNode.containerInfo,si=!0;break e;case 4:Cr=l.stateNode.containerInfo,si=!0;break e}l=l.return}if(Cr===null)throw Error(Pe(160));Tw(a,o,i),Cr=null,si=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Zt(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Aw(t,e),t=t.sibling}function Aw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ii(t,e),Ni(e),n&4){try{Ku(3,e,e.return),Ih(3,e)}catch(b){Zt(e,e.return,b)}try{Ku(5,e,e.return)}catch(b){Zt(e,e.return,b)}}break;case 1:ii(t,e),Ni(e),n&512&&r!==null&&ss(r,r.return);break;case 5:if(ii(t,e),Ni(e),n&512&&r!==null&&ss(r,r.return),e.flags&32){var i=e.stateNode;try{rc(i,"")}catch(b){Zt(e,e.return,b)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Q_(i,a),hv(l,o);var f=hv(l,a);for(o=0;o<u.length;o+=2){var h=u[o],E=u[o+1];h==="style"?n6(i,E):h==="dangerouslySetInnerHTML"?t6(i,E):h==="children"?rc(i,E):xm(i,h,E,f)}switch(l){case"input":sv(i,a);break;case"textarea":J_(i,a);break;case"select":var w=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?hs(i,!!a.multiple,p,!1):w!==!!a.multiple&&(a.defaultValue!=null?hs(i,!!a.multiple,a.defaultValue,!0):hs(i,!!a.multiple,a.multiple?[]:"",!1))}i[fc]=a}catch(b){Zt(e,e.return,b)}}break;case 6:if(ii(t,e),Ni(e),n&4){if(e.stateNode===null)throw Error(Pe(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){Zt(e,e.return,b)}}break;case 3:if(ii(t,e),Ni(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{oc(t.containerInfo)}catch(b){Zt(e,e.return,b)}break;case 4:ii(t,e),Ni(e);break;case 13:ii(t,e),Ni(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=tr())),n&4&&o5(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Hr=(f=Hr)||h,ii(t,e),Hr=f):ii(t,e),Ni(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!h&&e.mode&1)for(He=e,h=e.child;h!==null;){for(E=He=h;He!==null;){switch(w=He,p=w.child,w.tag){case 0:case 11:case 14:case 15:Ku(4,w,w.return);break;case 1:ss(w,w.return);var S=w.stateNode;if(typeof S.componentWillUnmount=="function"){n=w,r=w.return;try{t=n,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(b){Zt(n,r,b)}}break;case 5:ss(w,w.return);break;case 22:if(w.memoizedState!==null){s5(E);continue}}p!==null?(p.return=w,He=p):s5(E)}h=h.sibling}e:for(h=null,E=e;;){if(E.tag===5){if(h===null){h=E;try{i=E.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=E.stateNode,u=E.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=r6("display",o))}catch(b){Zt(e,e.return,b)}}}else if(E.tag===6){if(h===null)try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(b){Zt(e,e.return,b)}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===e)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===e)break e;for(;E.sibling===null;){if(E.return===null||E.return===e)break e;h===E&&(h=null),E=E.return}h===E&&(h=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:ii(t,e),Ni(e),n&4&&o5(e);break;case 21:break;default:ii(t,e),Ni(e)}}function Ni(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(kw(r)){var n=r;break e}r=r.return}throw Error(Pe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(rc(i,""),n.flags&=-33);var a=a5(e);$v(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=a5(e);Hv(e,l,o);break;default:throw Error(Pe(161))}}catch(u){Zt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ox(e,t,r){He=e,Rw(e)}function Rw(e,t,r){for(var n=(e.mode&1)!==0;He!==null;){var i=He,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||ad;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Hr;l=ad;var f=Hr;if(ad=o,(Hr=u)&&!f)for(He=i;He!==null;)o=He,u=o.child,o.tag===22&&o.memoizedState!==null?u5(i):u!==null?(u.return=o,He=u):u5(i);for(;a!==null;)He=a,Rw(a),a=a.sibling;He=i,ad=l,Hr=f}l5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,He=a):l5(e)}}function l5(e){for(;He!==null;){var t=He;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Hr||Ih(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Hr)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:li(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&V3(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}V3(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var E=h.dehydrated;E!==null&&oc(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pe(163))}Hr||t.flags&512&&Uv(t)}catch(w){Zt(t,t.return,w)}}if(t===e){He=null;break}if(r=t.sibling,r!==null){r.return=t.return,He=r;break}He=t.return}}function s5(e){for(;He!==null;){var t=He;if(t===e){He=null;break}var r=t.sibling;if(r!==null){r.return=t.return,He=r;break}He=t.return}}function u5(e){for(;He!==null;){var t=He;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ih(4,t)}catch(u){Zt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Zt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Zt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Zt(t,o,u)}}}catch(u){Zt(t,t.return,u)}if(t===e){He=null;break}var l=t.sibling;if(l!==null){l.return=t.return,He=l;break}He=t.return}}var xx=Math.ceil,nh=xa.ReactCurrentDispatcher,ry=xa.ReactCurrentOwner,Wn=xa.ReactCurrentBatchConfig,yt=0,Sr=null,ir=null,Tr=0,Sn=0,us=bo(0),dr=0,mc=null,al=0,Dh=0,ny=0,Yu=null,ln=null,iy=0,Ps=1/0,ua=null,ih=!1,Gv=null,oo=null,od=!1,Ja=null,ah=0,Xu=0,Vv=null,Ad=-1,Rd=0;function Kr(){return yt&6?tr():Ad!==-1?Ad:Ad=tr()}function lo(e){return e.mode&1?yt&2&&Tr!==0?Tr&-Tr:sx.transition!==null?(Rd===0&&(Rd=g6()),Rd):(e=xt,e!==0||(e=window.event,e=e===void 0?16:S6(e.type)),e):1}function fi(e,t,r,n){if(50<Xu)throw Xu=0,Vv=null,Error(Pe(185));Ac(e,r,n),(!(yt&2)||e!==Sr)&&(e===Sr&&(!(yt&2)&&(Dh|=r),dr===4&&Xa(e,Tr)),hn(e,n),r===1&&yt===0&&!(t.mode&1)&&(Ps=tr()+500,Mh&&_o()))}function hn(e,t){var r=e.callbackNode;sO(e,t);var n=Hd(e,e===Sr?Tr:0);if(n===0)r!==null&&y3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&y3(r),t===1)e.tag===0?lx(c5.bind(null,e)):U6(c5.bind(null,e)),nx(function(){!(yt&6)&&_o()}),r=null;else{switch(v6(n)){case 1:r=Am;break;case 4:r=h6;break;case 16:r=Ud;break;case 536870912:r=p6;break;default:r=Ud}r=zw(r,Mw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mw(e,t){if(Ad=-1,Rd=0,yt&6)throw Error(Pe(327));var r=e.callbackNode;if(ys()&&e.callbackNode!==r)return null;var n=Hd(e,e===Sr?Tr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=oh(e,n);else{t=n;var i=yt;yt|=2;var a=Nw();(Sr!==e||Tr!==t)&&(ua=null,Ps=tr()+500,Qo(e,t));do try{kx();break}catch(l){Lw(e,l)}while(!0);$m(),nh.current=a,yt=i,ir!==null?t=0:(Sr=null,Tr=0,t=dr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=mc,Qo(e,0),Xa(e,n),hn(e,tr()),r;if(t===6)Xa(e,n);else{if(i=e.current.alternate,!(n&30)&&!Px(i)&&(t=oh(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=mc,Qo(e,0),Xa(e,n),hn(e,tr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Pe(345));case 2:Wo(e,ln,ua);break;case 3:if(Xa(e,n),(n&130023424)===n&&(t=iy+500-tr(),10<t)){if(Hd(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Kr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pv(Wo.bind(null,e,ln,ua),t);break}Wo(e,ln,ua);break;case 4:if(Xa(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-ci(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=tr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xx(n/1960))-n,10<n){e.timeoutHandle=Pv(Wo.bind(null,e,ln,ua),n);break}Wo(e,ln,ua);break;case 5:Wo(e,ln,ua);break;default:throw Error(Pe(329))}}}return hn(e,tr()),e.callbackNode===r?Mw.bind(null,e):null}function qv(e,t){var r=Yu;return e.current.memoizedState.isDehydrated&&(Qo(e,t).flags|=256),e=oh(e,t),e!==2&&(t=ln,ln=r,t!==null&&Wv(t)),e}function Wv(e){ln===null?ln=e:ln.push.apply(ln,e)}function Px(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!vi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xa(e,t){for(t&=~ny,t&=~Dh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ci(t),n=1<<r;e[r]=-1,t&=~n}}function c5(e){if(yt&6)throw Error(Pe(327));ys();var t=Hd(e,0);if(!(t&1))return hn(e,tr()),null;var r=oh(e,t);if(e.tag!==0&&r===2){var n=yv(e);n!==0&&(t=n,r=qv(e,n))}if(r===1)throw r=mc,Qo(e,0),Xa(e,t),hn(e,tr()),r;if(r===6)throw Error(Pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wo(e,ln,ua),hn(e,tr()),null}function ay(e,t){var r=yt;yt|=1;try{return e(t)}finally{yt=r,yt===0&&(Ps=tr()+500,Mh&&_o())}}function ol(e){Ja!==null&&Ja.tag===0&&!(yt&6)&&ys();var t=yt;yt|=1;var r=Wn.transition,n=xt;try{if(Wn.transition=null,xt=1,e)return e()}finally{xt=n,Wn.transition=r,yt=t,!(yt&6)&&_o()}}function oy(){Sn=us.current,zt(us)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,rx(r)),ir!==null)for(r=ir.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Wd();break;case 3:Os(),zt(fn),zt($r),Ym();break;case 5:Km(n);break;case 4:Os();break;case 13:zt(qt);break;case 19:zt(qt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(Sr=e,ir=e=so(e.current,null),Tr=Sn=t,dr=0,mc=null,ny=Dh=al=0,ln=Yu=null,Yo!==null){for(t=0;t<Yo.length;t++)if(r=Yo[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}Yo=null}return e}function Lw(e,t){do{var r=ir;try{if($m(),Cd.current=rh,th){for(var n=Wt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}th=!1}if(il=0,wr=cr=Wt=null,Wu=!1,pc=0,ry.current=null,r===null||r.return===null){dr=1,mc=t,ir=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Tr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,h=l,E=h.tag;if(!(h.mode&1)&&(E===0||E===11||E===15)){var w=h.alternate;w?(h.updateQueue=w.updateQueue,h.memoizedState=w.memoizedState,h.lanes=w.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=Z3(o);if(p!==null){p.flags&=-257,Q3(p,o,l,a,t),p.mode&1&&X3(a,f,t),t=p,u=f;var S=t.updateQueue;if(S===null){var b=new Set;b.add(u),t.updateQueue=b}else S.add(u);break e}else{if(!(t&1)){X3(a,f,t),ly();break e}u=Error(Pe(426))}}else if(Ht&&l.mode&1){var m=Z3(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),Q3(m,o,l,a,t),Um(xs(u,l));break e}}a=u=xs(u,l),dr!==4&&(dr=2),Yu===null?Yu=[a]:Yu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=vw(a,u,t);G3(a,v);break e;case 1:l=u;var y=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(oo===null||!oo.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var g=mw(a,l,t);G3(a,g);break e}}a=a.return}while(a!==null)}Dw(r)}catch(_){t=_,ir===r&&r!==null&&(ir=r=r.return);continue}break}while(!0)}function Nw(){var e=nh.current;return nh.current=rh,e===null?rh:e}function ly(){(dr===0||dr===3||dr===2)&&(dr=4),Sr===null||!(al&268435455)&&!(Dh&268435455)||Xa(Sr,Tr)}function oh(e,t){var r=yt;yt|=2;var n=Nw();(Sr!==e||Tr!==t)&&(ua=null,Qo(e,t));do try{Cx();break}catch(i){Lw(e,i)}while(!0);if($m(),yt=r,nh.current=n,ir!==null)throw Error(Pe(261));return Sr=null,Tr=0,dr}function Cx(){for(;ir!==null;)Iw(ir)}function kx(){for(;ir!==null&&!JE();)Iw(ir)}function Iw(e){var t=Fw(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Dw(e):ir=t,ry.current=null}function Dw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=wx(r,t),r!==null){r.flags&=32767,ir=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dr=6,ir=null;return}}else if(r=_x(r,t,Sn),r!==null){ir=r;return}if(t=t.sibling,t!==null){ir=t;return}ir=t=e}while(t!==null);dr===0&&(dr=5)}function Wo(e,t,r){var n=xt,i=Wn.transition;try{Wn.transition=null,xt=1,Tx(e,t,r,n)}finally{Wn.transition=i,xt=n}return null}function Tx(e,t,r,n){do ys();while(Ja!==null);if(yt&6)throw Error(Pe(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Pe(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(uO(e,a),e===Sr&&(ir=Sr=null,Tr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||od||(od=!0,zw(Ud,function(){return ys(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Wn.transition,Wn.transition=null;var o=xt;xt=1;var l=yt;yt|=4,ry.current=null,Ex(e,r),Aw(r,e),YO(Ov),$d=!!Ev,Ov=Ev=null,e.current=r,Ox(r),eO(),yt=l,xt=o,Wn.transition=a}else e.current=r;if(od&&(od=!1,Ja=e,ah=i),a=e.pendingLanes,a===0&&(oo=null),nO(r.stateNode),hn(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(ih)throw ih=!1,e=Gv,Gv=null,e;return ah&1&&e.tag!==0&&ys(),a=e.pendingLanes,a&1?e===Vv?Xu++:(Xu=0,Vv=e):Xu=0,_o(),null}function ys(){if(Ja!==null){var e=v6(ah),t=Wn.transition,r=xt;try{if(Wn.transition=null,xt=16>e?16:e,Ja===null)var n=!1;else{if(e=Ja,Ja=null,ah=0,yt&6)throw Error(Pe(331));var i=yt;for(yt|=4,He=e.current;He!==null;){var a=He,o=a.child;if(He.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(He=f;He!==null;){var h=He;switch(h.tag){case 0:case 11:case 15:Ku(8,h,a)}var E=h.child;if(E!==null)E.return=h,He=E;else for(;He!==null;){h=He;var w=h.sibling,p=h.return;if(Cw(h),h===f){He=null;break}if(w!==null){w.return=p,He=w;break}He=p}}}var S=a.alternate;if(S!==null){var b=S.child;if(b!==null){S.child=null;do{var m=b.sibling;b.sibling=null,b=m}while(b!==null)}}He=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,He=o;else e:for(;He!==null;){if(a=He,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ku(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,He=v;break e}He=a.return}}var y=e.current;for(He=y;He!==null;){o=He;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,He=d;else e:for(o=y;He!==null;){if(l=He,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ih(9,l)}}catch(_){Zt(l,l.return,_)}if(l===o){He=null;break e}var g=l.sibling;if(g!==null){g.return=l.return,He=g;break e}He=l.return}}if(yt=i,_o(),Ui&&typeof Ui.onPostCommitFiberRoot=="function")try{Ui.onPostCommitFiberRoot(Ch,e)}catch{}n=!0}return n}finally{xt=r,Wn.transition=t}}return!1}function f5(e,t,r){t=xs(r,t),t=vw(e,t,1),e=ao(e,t,1),t=Kr(),e!==null&&(Ac(e,1,t),hn(e,t))}function Zt(e,t,r){if(e.tag===3)f5(e,e,r);else for(;t!==null;){if(t.tag===3){f5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(oo===null||!oo.has(n))){e=xs(r,e),e=mw(t,e,1),t=ao(t,e,1),e=Kr(),t!==null&&(Ac(t,1,e),hn(t,e));break}}t=t.return}}function Ax(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Kr(),e.pingedLanes|=e.suspendedLanes&r,Sr===e&&(Tr&r)===r&&(dr===4||dr===3&&(Tr&130023424)===Tr&&500>tr()-iy?Qo(e,0):ny|=r),hn(e,t)}function jw(e,t){t===0&&(e.mode&1?(t=Xf,Xf<<=1,!(Xf&130023424)&&(Xf=4194304)):t=1);var r=Kr();e=wa(e,t),e!==null&&(Ac(e,t,r),hn(e,r))}function Rx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),jw(e,r)}function Mx(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(Pe(314))}n!==null&&n.delete(t),jw(e,r)}var Fw;Fw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||fn.current)sn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sn=!1,bx(e,t,r);sn=!!(e.flags&131072)}else sn=!1,Ht&&t.flags&1048576&&H6(t,Xd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Td(e,t),e=t.pendingProps;var i=ws(t,$r.current);ms(t,r),i=Zm(null,t,n,e,i,r);var a=Qm();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,dn(n)?(a=!0,Kd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Nh,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,Ht&&a&&zm(t),Wr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Td(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Nx(n),e=li(n,e),i){case 0:t=Iv(null,t,n,e,r);break e;case 1:t=t5(null,t,n,e,r);break e;case 11:t=J3(null,t,n,e,r);break e;case 14:t=e5(null,t,n,li(n.type,e),r);break e}throw Error(Pe(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:li(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:li(n,i),t5(e,t,n,i,r);case 3:e:{if(ww(t),e===null)throw Error(Pe(387));n=t.pendingProps,a=t.memoizedState,i=a.element,K6(e,t),Jd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=xs(Error(Pe(423)),t),t=r5(e,t,n,r,i);break e}else if(n!==i){i=xs(Error(Pe(424)),t),t=r5(e,t,n,r,i);break e}else for(On=io(t.stateNode.containerInfo.firstChild),xn=t,Ht=!0,ui=null,r=q6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ss(),n===i){t=Sa(e,t,r);break e}Wr(e,t,n,r)}t=t.child}return t;case 5:return Y6(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,xv(n,i)?o=null:a!==null&&xv(n,a)&&(t.flags|=32),_w(e,t),Wr(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return Sw(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Es(t,null,n,r):Wr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:li(n,i),J3(e,t,n,i,r);case 7:return Wr(e,t,t.pendingProps,r),t.child;case 8:return Wr(e,t,t.pendingProps.children,r),t.child;case 12:return Wr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Lt(Zd,n._currentValue),n._currentValue=o,a!==null)if(vi(a.value,o)){if(a.children===i.children&&!fn.current){t=Sa(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=pa(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Rv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Pe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Rv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Wr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ms(t,r),i=Yn(i),n=n(i),t.flags|=1,Wr(e,t,n,r),t.child;case 14:return n=t.type,i=li(n,t.pendingProps),i=li(n.type,i),e5(e,t,n,i,r);case 15:return yw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:li(n,i),Td(e,t),t.tag=1,dn(n)?(e=!0,Kd(t)):e=!1,ms(t,r),gw(t,n,i),Lv(t,n,i,r),Dv(null,t,n,!0,e,r);case 19:return Ew(e,t,r);case 22:return bw(e,t,r)}throw Error(Pe(156,t.tag))};function zw(e,t){return d6(e,t)}function Lx(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 qn(e,t,r,n){return new Lx(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nx(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===km)return 14}return 2}function so(e,t){var r=e.alternate;return r===null?(r=qn(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 Md(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")sy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Jl:return Jo(r.children,i,a,t);case Pm:o=8,i|=8;break;case nv:return e=qn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=qn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=qn(19,r,t,i),e.elementType=av,e.lanes=a,e;case Y_:return jh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W_:o=10;break e;case K_:o=9;break e;case Cm:o=11;break e;case km:o=14;break e;case Wa:o=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=qn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Jo(e,t,r,n){return e=qn(7,e,n,t),e.lanes=r,e}function jh(e,t,r,n){return e=qn(22,e,n,t),e.elementType=Y_,e.lanes=r,e.stateNode={isHidden:!1},e}function I1(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function D1(e,t,r){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ix(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=v1(0),this.expirationTimes=v1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(e,t,r,n,i,a,o,l,u){return e=new Ix(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=qn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(a),e}function Dx(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ql,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Bw(e){if(!e)return ho;e=e._reactInternals;e:{if(pl(e)!==e||e.tag!==1)throw Error(Pe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Pe(171))}if(e.tag===1){var r=e.type;if(dn(r))return B6(e,r,t)}return t}function Uw(e,t,r,n,i,a,o,l,u){return e=uy(r,n,!0,e,i,a,o,l,u),e.context=Bw(null),r=e.current,n=Kr(),i=lo(r),a=pa(n,i),a.callback=t??null,ao(r,a,i),e.current.lanes=i,Ac(e,i,n),hn(e,n),e}function Fh(e,t,r,n){var i=t.current,a=Kr(),o=lo(i);return r=Bw(r),t.context===null?t.context=r:t.pendingContext=r,t=pa(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ao(i,t,o),e!==null&&(fi(e,i,o,a),Pd(e,i,o)),o}function lh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function d5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cy(e,t){d5(e,t),(e=e.alternate)&&d5(e,t)}function jx(){return null}var Hw=typeof reportError=="function"?reportError:function(e){console.error(e)};function fy(e){this._internalRoot=e}zh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Pe(409));Fh(e,t,null,null)};zh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ol(function(){Fh(null,e,null,null)}),t[_a]=null}};function zh(e){this._internalRoot=e}zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=b6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ya.length&&t!==0&&t<Ya[r].priority;r++);Ya.splice(r,0,e),r===0&&w6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function h5(){}function Fx(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=lh(o);a.call(f)}}var o=Uw(t,n,e,0,null,!1,!1,"",h5);return e._reactRootContainer=o,e[_a]=o.current,uc(e.nodeType===8?e.parentNode:e),ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=lh(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",h5);return e._reactRootContainer=u,e[_a]=u.current,uc(e.nodeType===8?e.parentNode:e),ol(function(){Fh(t,u,r,n)}),u}function Uh(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=lh(o);l.call(u)}}Fh(t,o,e,i)}else o=Fx(r,t,e,i,n);return lh(o)}m6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Fu(t.pendingLanes);r!==0&&(Rm(t,r|1),hn(t,tr()),!(yt&6)&&(Ps=tr()+500,_o()))}break;case 13:ol(function(){var n=wa(e,1);if(n!==null){var i=Kr();fi(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=wa(e,134217728);if(t!==null){var r=Kr();fi(t,e,134217728,r)}cy(e,134217728)}};y6=function(e){if(e.tag===13){var t=lo(e),r=wa(e,t);if(r!==null){var n=Kr();fi(r,e,t,n)}cy(e,t)}};b6=function(){return xt};_6=function(e,t){var r=xt;try{return xt=e,t()}finally{xt=r}};gv=function(e,t,r){switch(t){case"input":if(sv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Rh(n);if(!i)throw Error(Pe(90));Z_(n),sv(n,i)}}}break;case"textarea":J_(e,r);break;case"select":t=r.value,t!=null&&hs(e,!!r.multiple,t,!1)}};o6=ay;l6=ol;var zx={usingClientEntryPoint:!1,Events:[Mc,ns,Rh,i6,a6,ay]},Ru={findFiberByHostInstance:Ko,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bx={bundleType:Ru.bundleType,version:Ru.version,rendererPackageName:Ru.rendererPackageName,rendererConfig:Ru.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=c6(e),e===null?null:e.stateNode},findFiberByHostInstance:Ru.findFiberByHostInstance||jx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ld.isDisabled&&ld.supportsFiber)try{Ch=ld.inject(Bx),Ui=ld}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zx;kn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(t))throw Error(Pe(200));return Dx(e,t,null,r)};kn.createRoot=function(e,t){if(!dy(e))throw Error(Pe(299));var r=!1,n="",i=Hw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uy(e,1,!1,null,null,r,!1,n,i),e[_a]=t.current,uc(e.nodeType===8?e.parentNode:e),new fy(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Pe(188)):(e=Object.keys(e).join(","),Error(Pe(268,e)));return e=c6(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return ol(e)};kn.hydrate=function(e,t,r){if(!Bh(t))throw Error(Pe(200));return Uh(null,e,t,!0,r)};kn.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Hw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Uw(t,null,e,1,r??null,i,!1,a,o),e[_a]=t.current,uc(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new zh(t)};kn.render=function(e,t,r){if(!Bh(t))throw Error(Pe(200));return Uh(null,e,t,!1,r)};kn.unmountComponentAtNode=function(e){if(!Bh(e))throw Error(Pe(40));return e._reactRootContainer?(ol(function(){Uh(null,null,e,!1,function(){e._reactRootContainer=null,e[_a]=null})}),!0):!1};kn.unstable_batchedUpdates=ay;kn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Bh(r))throw Error(Pe(200));if(e==null||e._reactInternals===void 0)throw Error(Pe(38));return Uh(e,t,r,!1,n)};kn.version="18.3.1-next-f1338f8080-20240426";function $w(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($w)}catch(e){console.error(e)}}$w(),$_.exports=kn;var Gw=$_.exports,p5=Gw;jd.createRoot=p5.createRoot,jd.hydrateRoot=p5.hydrateRoot;var Vw={};function nt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Ux={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ux}var qw=Object.assign,sh=Object.getOwnPropertyDescriptor,$i=Object.defineProperty,Nc=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var Hx=typeof Proxy<"u",$x=Object.toString();function Ww(){Hx||nt("Proxy not available")}function Kw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var cs=function(){};function Cn(e){return typeof e=="function"}function ll(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Hh(e){return e!==null&&typeof e=="object"}function Ea(e){if(!Hh(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===$x}function Yw(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Ic(e,t,r){$i(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Xw(e,t,r){$i(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function wo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Hh(n)&&n[r]===!0}}function Vs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Gx(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function fa(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Zw=typeof Object.getOwnPropertySymbols<"u";function Vx(e){var t=Object.keys(e);if(!Zw)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Nc.propertyIsEnumerable.call(e,n)})):t}var Cs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Zw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Qw(e){return e===null?null:typeof e=="object"?""+e:e}function ga(e,t){return Nc.hasOwnProperty.call(e,t)}var qx=Object.getOwnPropertyDescriptors||function(t){var r={};return Cs(t).forEach(function(n){r[n]=sh(t,n)}),r};function g5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Wx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yx(n.key),n)}}function $h(e,t,r){return t&&Wx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Xx(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po.apply(null,arguments)}function Jw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Yv(e,t)}function Kx(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yx(e){var t=Kx(e,"string");return typeof t=="symbol"?t:t+""}function Xx(e,t){if(e){if(typeof e=="string")return g5(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g5(e,t):void 0}}var Bi=Symbol("mobx-stored-annotations");function di(e){function t(r,n){if(Dc(n))return e.decorate_20223_(r,n);qs(r,n,e)}return Object.assign(t,e)}function qs(e,t,r){ga(e,Bi)||Ic(e,Bi,po({},e[Bi])),aP(r)||(e[Bi][t]=r)}function Zx(e){return ga(e,Bi)||Ic(e,Bi,po({},e[Bi])),e[Bi]}function Dc(e){return typeof e=="object"&&typeof e.kind=="string"}var We=Symbol("mobx administration"),jc=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return y8(this)},t.reportChanged=function(){un(),b8(this),cn()},t.toString=function(){return this.name_},e}(),gy=wo("Atom",jc);function yc(e,t,r){t===void 0&&(t=cs),r===void 0&&(r=cs);var n=new jc(e);return t!==cs&&k8(n,t),r!==cs&&wy(n,r),n}function Qx(e,t){return e===t}function Jx(e,t){return Ry(e,t)}function eP(e,t){return Ry(e,t,1)}function tP(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sl={identity:Qx,structural:Jx,default:tP,shallow:eP};function ul(e,t,r){return Zh(e)?e:Array.isArray(e)?Tt.array(e,{name:r}):Ea(e)?Tt.object(e,void 0,{name:r}):Vs(e)?Tt.map(e,{name:r}):fa(e)?Tt.set(e,{name:r}):typeof e=="function"&&!zc(e)&&!Rs(e)?Yw(e)?fl(e):Ts(r,e):e}function rP(e,t,r){if(e==null||Er(e)||Qr(e)||Rr(e)||Yr(e))return e;if(Array.isArray(e))return Tt.array(e,{name:r,deep:!1});if(Ea(e))return Tt.object(e,void 0,{name:r,deep:!1});if(Vs(e))return Tt.map(e,{name:r,deep:!1});if(fa(e))return Tt.set(e,{name:r,deep:!1})}function Gh(e){return e}function nP(e,t){return Ry(e,t)?t:e}var e8="override",iP=di({annotationType_:e8,make_:oP,extend_:lP,decorate_20223_:sP});function aP(e){return e.annotationType_===e8}function oP(e,t){return 0}function lP(e,t,r,n){nt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function sP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Fc(e,t){return{annotationType_:e,options_:t,make_:uP,extend_:cP,decorate_20223_:fP}}function uP(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(zc(r.value))return 1;var a=t8(e,this,t,r,!1);return $i(n,t,a),2}function cP(e,t,r,n){var i=t8(e,this,t,r);return e.defineProperty_(t,i,n)}function fP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var h,E,w,p;return go((h=(E=a.options_)==null?void 0:E.name)!=null?h:n.toString(),f,(w=(p=a.options_)==null?void 0:p.autoAction)!=null?w:!1)};if(r=="field"){i(function(){qs(this,n,a)});return}if(r=="method"){var l;return zc(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}nt("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
- '`+a.annotationType_+"' can only be used on properties with a function value."))}function dP(e,t,r,n){t.annotationType_,n.value}function t8(e,t,r,n,i){var a,o,l,u,f,h,E;i===void 0&&(i=Me.safeDescriptors),dP(e,t,r,n);var w=n.value;if((a=t.options_)!=null&&a.bound){var p;w=w.bind((p=e.proxy_)!=null?p:e.target_)}return{value:go((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),w,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(h=t.options_)!=null&&h.bound?(E=e.proxy_)!=null?E:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function r8(e,t){return{annotationType_:e,options_:t,make_:hP,extend_:pP,decorate_20223_:gP}}function hP(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!ga(e.target_,t)||!Rs(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Rs(r.value))return 1;var a=n8(e,this,t,r,!1,!1);return $i(n,t,a),2}function pP(e,t,r,n){var i,a=n8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function gP(e,t){var r,n=t.name,i=t.addInitializer;return Rs(e)||(e=fl(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function vP(e,t,r,n){t.annotationType_,n.value}function n8(e,t,r,n,i,a){a===void 0&&(a=Me.safeDescriptors),vP(e,t,r,n);var o=n.value;if(Rs(o)||(o=fl(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function vy(e,t){return{annotationType_:e,options_:t,make_:mP,extend_:yP,decorate_20223_:bP}}function mP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function yP(e,t,r,n){return _P(e,this,t,r),e.defineComputedProperty_(t,po({},this.options_,{get:r.get,set:r.set}),n)}function bP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=ml(this)[We],o=po({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new qi(o))}),function(){return this[We].getObservablePropValue_(n)}}function _P(e,t,r,n){t.annotationType_,n.get}function Vh(e,t){return{annotationType_:e,options_:t,make_:wP,extend_:SP,decorate_20223_:EP}}function wP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function SP(e,t,r,n){var i,a;return OP(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:ul,n)}function EP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,h,E=ml(l)[We],w=new uo(u,(f=(h=r.options_)==null?void 0:h.enhancer)!=null?f:ul,"ObservableObject."+i.toString(),!1);E.values_.set(i,w),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[We].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[We].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function OP(e,t,r,n){t.annotationType_}var xP="true",PP=i8();function i8(e){return{annotationType_:xP,options_:e,make_:CP,extend_:kP,decorate_20223_:TP}}function CP(e,t,r,n){var i,a;if(r.get)return gl.make_(e,t,r,n);if(r.set){var o=go(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:($i(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(Yw(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?fl.bound:fl;return f.make_(e,t,r,n)}var h=(l=this.options_)!=null&&l.autoBind?Ts.bound:Ts;return h.make_(e,t,r,n)}var E=((i=this.options_)==null?void 0:i.deep)===!1?Tt.ref:Tt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var w;r.value=r.value.bind((w=e.proxy_)!=null?w:e.target_)}return E.make_(e,t,r,n)}function kP(e,t,r,n){var i,a;if(r.get)return gl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:go(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Tt.ref:Tt;return l.extend_(e,t,r,n)}function TP(e,t){nt("'"+this.annotationType_+"' cannot be used as a decorator")}var AP="observable",RP="observable.ref",MP="observable.shallow",LP="observable.struct",a8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(a8);function sd(e){return e||a8}var Xv=Vh(AP),NP=Vh(RP,{enhancer:Gh}),IP=Vh(MP,{enhancer:rP}),DP=Vh(LP,{enhancer:nP}),o8=di(Xv);function ud(e){return e.deep===!0?ul:e.deep===!1?Gh:FP(e.defaultDecorator)}function jP(e){var t;return e?(t=e.defaultDecorator)!=null?t:i8(e):void 0}function FP(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:ul}function l8(e,t,r){if(Dc(t))return Xv.decorate_20223_(e,t);if(ll(t)){qs(e,t,Xv);return}return Zh(e)?e:Ea(e)?Tt.object(e,t,r):Array.isArray(e)?Tt.array(e,t):Vs(e)?Tt.map(e,t):fa(e)?Tt.set(e,t):typeof e=="object"&&e!==null?e:Tt.box(e,t)}qw(l8,o8);var zP={box:function(t,r){var n=sd(r);return new uo(t,ud(n),n.name,!0,n.equals)},array:function(t,r){var n=sd(r);return(Me.useProxies===!1||n.proxy===!1?VC:IC)(t,ud(n),n.name)},map:function(t,r){var n=sd(r);return new Jh(t,ud(n),n.name)},set:function(t,r){var n=sd(r);return new Ty(t,ud(n),n.name)},object:function(t,r,n){return So(function(){return Sy(Me.useProxies===!1||(n==null?void 0:n.proxy)===!1?ml({},n):RC({},n),t,r)})},ref:di(NP),shallow:di(IP),deep:o8,struct:di(DP)},Tt=qw(l8,zP),s8="computed",BP="computed.struct",Zv=vy(s8),UP=vy(BP,{equals:sl.structural}),gl=function(t,r){if(Dc(r))return Zv.decorate_20223_(t,r);if(ll(r))return qs(t,r,Zv);if(Ea(t))return di(vy(s8,t));var n=Ea(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new qi(n)};Object.assign(gl,Zv);gl.struct=di(UP);var v5,m5,uh=0,HP=1,$P=(v5=(m5=sh(function(){},"name"))==null?void 0:m5.configurable)!=null?v5:!1,y5={value:"action",configurable:!0,writable:!1,enumerable:!1};function go(e,t,r,n){r===void 0&&(r=!1);function i(){return u8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},$P&&(y5.value=e,$i(i,"name",y5)),i}function u8(e,t,r,n,i){var a=c8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{f8(a)}}function c8(e,t,r,n){var i=!1,a=0,o=Me.trackingDerivation,l=!t||!o;un();var u=Me.allowStateChanges;l&&(vl(),u=qh(!0));var f=Kh(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:HP++,parentActionId_:uh};return uh=h.actionId_,h}function f8(e){uh!==e.actionId_&&nt(30),uh=e.parentActionId_,e.error_!==void 0&&(Me.suppressReactionErrors=!0),Wh(e.prevAllowStateChanges_),bs(e.prevAllowStateReads_),cn(),e.runAsAction_&&va(e.prevDerivation_),Me.suppressReactionErrors=!1}function my(e,t){var r=qh(e);try{return t()}finally{Wh(r)}}function qh(e){var t=Me.allowStateChanges;return Me.allowStateChanges=e,t}function Wh(e){Me.allowStateChanges=e}var uo=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=sl.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}Jw(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Me.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Gn(this)){var a=Vn(this,{object:this,type:Gi,newValue:i});if(!a)return Me.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Me.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),hi(this)&&pi(this,{type:Gi,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Bc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Gi,newValue:this.value_,oldValue:void 0}),Uc(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Qw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(jc),yy=wo("ObservableValue",uo);function cd(e,t){return!!(e&t)}function fd(e,t,r){return r?e|=t:e&=~t,e}var qi=function(){function e(r){this.dependenciesState_=St.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new fh(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ch.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||nt(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=go("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?sl.structural:sl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){JP(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&nt(32,this.name_,this.derivation),Me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),un(),this.value_=this.computeValue_(!1),cn());else if(y8(this),Qv(this)){var n=Me.trackingContext;this.keepAlive_&&!n&&(Me.trackingContext=this),this.trackAndCompute()&&QP(this),Me.trackingContext=n}var i=this.value_;if(Ld(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&nt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else nt(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===St.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Ld(n)||Ld(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=qh(!1),a;if(n)a=d8(this,this.derivation,this.scope_);else if(Me.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new fh(o)}return Wh(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(Jv(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return _y(function(){var u=a.get();if(!o||i){var f=vl();n({observableKind:"computed",debugObjectName:a.name_,type:Gi,object:a,newValue:u,oldValue:l}),va(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Qw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},$h(e,[{key:"isComputing",get:function(){return cd(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=fd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return cd(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=fd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return cd(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=fd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return cd(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=fd(this.flags_,e.isPendingUnobservationMask_,n)}}])}();qi.isComputingMask_=1;qi.isRunningSetterMask_=2;qi.isBeingObservedMask_=4;qi.isPendingUnobservationMask_=8;var cl=wo("ComputedValue",qi),St;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(St||(St={}));var ch;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(ch||(ch={}));var fh=function(t){this.cause=void 0,this.cause=t};function Ld(e){return e instanceof fh}function Qv(e){switch(e.dependenciesState_){case St.UP_TO_DATE_:return!1;case St.NOT_TRACKING_:case St.STALE_:return!0;case St.POSSIBLY_STALE_:{for(var t=Kh(!0),r=vl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(cl(o)){if(Me.disableErrorBoundaries)o.get();else try{o.get()}catch{return va(r),bs(t),!0}if(e.dependenciesState_===St.STALE_)return va(r),bs(t),!0}}return h8(e),va(r),bs(t),!1}}}function GP(){return Me.trackingDerivation!==null}function d8(e,t,r){var n=Kh(!0);h8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Me.runId;var i=Me.trackingDerivation;Me.trackingDerivation=e,Me.inBatch++;var a;if(Me.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new fh(o)}return Me.inBatch--,Me.trackingDerivation=i,VP(e),bs(n),a}function VP(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=St.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue_===0&&(l.diffValue_=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue_===0&&v8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,ZP(f,e))}n!==St.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Jv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)v8(t[r],e);e.dependenciesState_=St.NOT_TRACKING_}function by(e){var t=vl();try{return e()}finally{va(t)}}function vl(){var e=Me.trackingDerivation;return Me.trackingDerivation=null,e}function va(e){Me.trackingDerivation=e}function Kh(e){var t=Me.allowStateReads;return Me.allowStateReads=e,t}function bs(e){Me.allowStateReads=e}function h8(e){if(e.dependenciesState_!==St.UP_TO_DATE_){e.dependenciesState_=St.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=St.UP_TO_DATE_}}var qP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Zu=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Nd=!0,p8=!1,Me=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Nd=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Zu().version&&(Nd=!1),Nd?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Zu):(setTimeout(function(){p8||nt(35)},1),new Zu)}();function WP(){if((Me.pendingReactions.length||Me.inBatch||Me.isRunningReactions)&&nt(36),p8=!0,Nd){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Me=new Zu}}function g8(){return Me}function KP(){var e=new Zu;for(var t in e)qP.indexOf(t)===-1&&(Me[t]=e[t]);Me.allowStateChanges=!Me.enforceActions}function YP(e){return e.observers_&&e.observers_.size>0}function XP(e){return e.observers_}function ZP(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function v8(e,t){e.observers_.delete(t),e.observers_.size===0&&m8(e)}function m8(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Me.pendingUnobservations.push(e))}function un(){Me.inBatch++}function cn(){if(--Me.inBatch===0){_8();for(var e=Me.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof qi&&r.suspend_())}Me.pendingUnobservations=[]}}function y8(e){var t=Me.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Me.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Me.inBatch>0&&m8(e),!1)}function b8(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=St.STALE_}))}function QP(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.POSSIBLY_STALE_?t.dependenciesState_=St.STALE_:t.dependenciesState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.UP_TO_DATE_)}))}function JP(e){e.lowestObserverState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&(t.dependenciesState_=St.POSSIBLY_STALE_,t.onBecomeStale_())}))}var ks=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=St.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=ch.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Me.pendingReactions.push(this),_8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){un(),this.isScheduled_=!1;var n=Me.trackingContext;if(Me.trackingContext=this,Qv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Me.trackingContext=n,cn()}},t.track=function(n){if(!this.isDisposed_){un(),this.isRunning_=!0;var i=Me.trackingContext;Me.trackingContext=this;var a=d8(this,n,void 0);Me.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Jv(this),Ld(a)&&this.reportExceptionInDerivation_(a.cause),cn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Me.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Me.suppressReactionErrors||console.error(a,n),Me.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(un(),Jv(this),cn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[We]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function eC(e){return Me.globalReactionErrorHandlers.push(e),function(){var t=Me.globalReactionErrorHandlers.indexOf(e);t>=0&&Me.globalReactionErrorHandlers.splice(t,1)}}var tC=100,em=function(t){return t()};function _8(){Me.inBatch>0||Me.isRunningReactions||em(rC)}function rC(){Me.isRunningReactions=!0;for(var e=Me.pendingReactions,t=0;e.length>0;){++t===tC&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Me.isRunningReactions=!1}var dh=wo("Reaction",ks);function nC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function Qu(){return!1}function w8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var S8="action",iC="action.bound",E8="autoAction",aC="autoAction.bound",O8="<unnamed action>",tm=Fc(S8),oC=Fc(iC,{bound:!0}),rm=Fc(E8,{autoAction:!0}),lC=Fc(aC,{autoAction:!0,bound:!0});function x8(e){var t=function(n,i){if(Cn(n))return go(n.name||O8,n,e);if(Cn(i))return go(n,i,e);if(Dc(i))return(e?rm:tm).decorate_20223_(n,i);if(ll(i))return qs(n,i,e?rm:tm);if(ll(n))return di(Fc(e?E8:S8,{name:n,autoAction:e}))};return t}var ar=x8(!1);Object.assign(ar,tm);var Ts=x8(!0);Object.assign(Ts,rm);ar.bound=di(oC);Ts.bound=di(lC);function As(e){return u8(e.name||O8,!1,e,this,void 0)}function zc(e){return Cn(e)&&e.isMobxAction===!0}function _y(e,t){var r,n,i,a;t===void 0&&(t=py);var o=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",l=!t.scheduler&&!t.delay,u;if(l)u=new ks(o,function(){this.track(E)},t.onError,t.requiresObservable);else{var f=P8(t),h=!1;u=new ks(o,function(){h||(h=!0,f(function(){h=!1,u.isDisposed_||u.track(E)}))},t.onError,t.requiresObservable)}function E(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var sC=function(t){return t()};function P8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:sC}function C8(e,t,r){var n,i,a;r===void 0&&(r=py);var o=(n=r.name)!=null?n:"Reaction",l=ar(o,r.onError?uC(r.onError,t):t),u=!r.scheduler&&!r.delay,f=P8(r),h=!0,E=!1,w,p=r.compareStructural?sl.structural:r.equals||sl.default,S=new ks(o,function(){h||u?b():E||(E=!0,f(b))},r.onError,r.requiresObservable);function b(){if(E=!1,!S.isDisposed_){var m=!1,v=w;S.track(function(){var y=my(!1,function(){return e(S)});m=h||!p(w,y),w=y}),(h&&r.fireImmediately||!h&&m)&&l(w,v,S),h=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||S.schedule_(),S.getDisposer_((a=r)==null?void 0:a.signal)}function uC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var cC="onBO",fC="onBUO";function k8(e,t,r){return T8(cC,e,t,r)}function wy(e,t,r){return T8(fC,e,t,r)}function T8(e,t,r,n){var i=typeof n=="function"?Wi(t,r):Wi(t),a=Cn(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var dC="never",dd="always",hC="observed";function A8(e){e.isolateGlobalState===!0&&WP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Me.useProxies=t===dd?!0:t===dC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Me.verifyProxies=!0),r!==void 0){var n=r===dd?dd:r===hC;Me.enforceActions=n,Me.allowStateChanges=!(n===!0||n===dd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Me[i]=!!e[i])}),Me.allowStateReads=!Me.observableRequiresReaction,e.reactionScheduler&&nC(e.reactionScheduler)}function Sy(e,t,r,n){var i=qx(t);return So(function(){var a=ml(e,n)[We];Cs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function R8(e,t){return M8(Wi(e,t))}function M8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=gC(e.observing_).map(M8)),t}function pC(e,t){return L8(Wi(e,t))}function L8(e){var t={name:e.name_};return YP(e)&&(t.observers=Array.from(XP(e)).map(L8)),t}function gC(e){return Array.from(new Set(e))}var vC=0;function Yh(){this.message="FLOW_CANCELLED"}Yh.prototype=Object.create(Error.prototype);function mC(e){return e instanceof Yh}var j1=r8("flow"),yC=r8("flow.bound",{bound:!0}),fl=Object.assign(function(t,r){if(Dc(r))return j1.decorate_20223_(t,r);if(ll(r))return qs(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++vC,h=ar(i+" - runid: "+f+" - init",n).apply(l,u),E,w=void 0,p=new Promise(function(S,b){var m=0;E=b;function v(g){w=void 0;var _;try{_=ar(i+" - runid: "+f+" - yield "+m++,h.next).call(h,g)}catch(T){return b(T)}d(_)}function y(g){w=void 0;var _;try{_=ar(i+" - runid: "+f+" - yield "+m++,h.throw).call(h,g)}catch(T){return b(T)}d(_)}function d(g){if(Cn(g==null?void 0:g.then)){g.then(d,b);return}return g.done?S(g.value):(w=Promise.resolve(g.value),w.then(v,y))}v(void 0)});return p.cancel=ar(i+" - runid: "+f+" - cancel",function(){try{w&&b5(w);var S=h.return(void 0),b=Promise.resolve(S.value);b.then(cs,cs),b5(b),E(new Yh)}catch(m){E(m)}}),p};return a.isMobXFlow=!0,a},j1);fl.bound=di(yC);function b5(e){Cn(e.cancel)&&e.cancel()}function bC(e){return e}function Rs(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Rr(e)||Qr(e)||yy(e)?n=mi(e):Er(e)&&(n=mi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Xh(e,t,r){return Cn(r)?wC(e,t,r):_C(e,t)}function _C(e,t){return mi(e).intercept_(t)}function wC(e,t,r){return mi(e,t).intercept_(r)}function N8(e,t){if(t===void 0)return cl(e);if(Er(e)===!1||!e[We].values_.has(t))return!1;var r=Wi(e,t);return cl(r)}function SC(e){return N8(e)}function I8(e,t){return N8(e,t)}function D8(e,t){return e?t!==void 0?Er(e)?e[We].values_.has(t):!1:Er(e)||!!e[We]||gy(e)||dh(e)||cl(e):!1}function Zh(e){return D8(e)}function j8(e,t){return D8(e,t)}function bc(e){if(Er(e))return e[We].keys_();if(Rr(e)||Yr(e))return Array.from(e.keys());if(Qr(e))return e.map(function(t,r){return r});nt(5)}function Oy(e){if(Er(e))return bc(e).map(function(t){return e[t]});if(Rr(e))return bc(e).map(function(t){return e.get(t)});if(Yr(e))return Array.from(e.values());if(Qr(e))return e.slice();nt(6)}function F8(e){if(Er(e))return bc(e).map(function(t){return[t,e[t]]});if(Rr(e))return bc(e).map(function(t){return[t,e.get(t)]});if(Yr(e))return Array.from(e.entries());if(Qr(e))return e.map(function(t,r){return[r,t]});nt(7)}function xy(e,t,r){if(arguments.length===2&&!Yr(e)){un();var n=t;try{for(var i in n)xy(e,i,n[i])}finally{cn()}return}Er(e)?e[We].set_(t,r):Rr(e)?e.set(t,r):Yr(e)?e.add(t):Qr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&nt("Invalid index: '"+t+"'"),un(),t>=e.length&&(e.length=t+1),e[t]=r,cn()):nt(8)}function EC(e,t){Er(e)?e[We].delete_(t):Rr(e)||Yr(e)?e.delete(t):Qr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):nt(9)}function z8(e,t){if(Er(e))return e[We].has_(t);if(Rr(e))return e.has(t);if(Yr(e))return e.has(t);if(Qr(e))return t>=0&&t<e.length;nt(10)}function OC(e,t){if(z8(e,t)){if(Er(e))return e[We].get_(t);if(Rr(e))return e.get(t);if(Qr(e))return e[t];nt(11)}}function Py(e,t,r){if(Er(e))return e[We].defineProperty_(t,r);nt(39)}function B8(e){if(Er(e))return e[We].ownKeys_();nt(38)}function Qh(e,t,r,n){return Cn(r)?PC(e,t,r,n):xC(e,t,r)}function xC(e,t,r){return mi(e).observe_(t,r)}function PC(e,t,r,n){return mi(e,t).observe_(r,n)}function hd(e,t,r){return e.set(t,r),r}function Zl(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Zh(e))return e;if(yy(e)||cl(e))return Zl(e.get(),t);if(t.has(e))return t.get(e);if(Qr(e)){var r=hd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Zl(o,t)}),r}if(Yr(e)){var n=hd(t,e,new Set);return e.forEach(function(o){n.add(Zl(o,t))}),n}if(Rr(e)){var i=hd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Zl(o,t))}),i}else{var a=hd(t,e,{});return B8(e).forEach(function(o){Nc.propertyIsEnumerable.call(e,o)&&(a[o]=Zl(e[o],t))}),a}}function CC(e,t){return Zl(e,new Map)}function kC(){}function Fi(e,t){t===void 0&&(t=void 0),un();try{return e.apply(t)}finally{cn()}}function nm(e,t,r){return arguments.length===1||t&&typeof t=="object"?TC(e,t):U8(e,t,r||{})}function U8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[We].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=go("When-effect",t),o=_y(function(l){var u=my(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function TC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=U8(e,o,po({},t,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Wl(e){return e[We]}var AC={has:function(t,r){return Wl(t).has_(r)},get:function(t,r){return Wl(t).get_(r)},set:function(t,r,n){var i;return ll(r)?(i=Wl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return ll(r)?(n=Wl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Wl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Wl(t).ownKeys_()},preventExtensions:function(t){nt(13)}};function RC(e,t){var r,n;return Ww(),e=ml(e,t),(n=(r=e[We]).proxy_)!=null?n:r.proxy_=new Proxy(e,AC)}function Gn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Bc(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Kw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Vn(e,t){var r=vl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&nt(14),!!t);i++);return t}finally{va(r)}}function hi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Uc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Kw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function pi(e,t){var r=vl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);va(r)}}function Cy(e,t,r){return So(function(){var n,i=ml(e,r)[We];(n=t)!=null||(t=Zx(e)),Cs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function MC(e,t,r){return Ea(e)?Sy(e,e,t,r):(So(function(){var n=ml(e,r)[We];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Cs(e),Cs(i)));a.delete("constructor"),a.delete(We),Ic(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var _5="splice",Gi="update",LC=1e4,NC={get:function(t,r){var n=t[We];return r===We?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):ga(hh,r)?hh[r]:t[r]},set:function(t,r,n){var i=t[We];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){nt(15)}},ky=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new jc(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Bc(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Uc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&nt("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&nt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&q8(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=Kv),Gn(this)){var u=Vn(this,{object:this.proxy_,type:_5,index:n,removedCount:i,added:a});if(!u)return Kv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(E){return o.enhancer_(E,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<LC){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var h=0;h<u.length;h++)this.values_[n+a.length+h]=u[h];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Qu(),l=hi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Gi,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&pi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Qu(),l=hi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:_5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&pi(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&nt(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Gn(this)){var l=Vn(this,{type:Gi,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function IC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Ww(),So(function(){var i=new ky(r,t,n,!1);Xw(i.values_,We,i);var a=new Proxy(i.values_,NC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var hh={clear:function(){return this.splice(0)},replace:function(t){var r=this[We];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[We];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[We].spliceWithArray_(t,r,n)},push:function(){for(var t=this[We],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[We].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[We],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return Me.trackingDerivation&&nt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Me.trackingDerivation&&nt(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[We],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Nt("at",An);Nt("concat",An);Nt("flat",An);Nt("includes",An);Nt("indexOf",An);Nt("join",An);Nt("lastIndexOf",An);Nt("slice",An);Nt("toString",An);Nt("toLocaleString",An);Nt("toSorted",An);Nt("toSpliced",An);Nt("with",An);Nt("every",yi);Nt("filter",yi);Nt("find",yi);Nt("findIndex",yi);Nt("findLast",yi);Nt("findLastIndex",yi);Nt("flatMap",yi);Nt("forEach",yi);Nt("map",yi);Nt("some",yi);Nt("toReversed",yi);Nt("reduce",H8);Nt("reduceRight",H8);function Nt(e,t){typeof Array.prototype[e]=="function"&&(hh[e]=t(e))}function An(e){return function(){var t=this[We];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function yi(e){return function(t,r){var n=this,i=this[We];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function H8(e){return function(){var t=this,r=this[We];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var DC=wo("ObservableArrayAdministration",ky);function Qr(e){return Hh(e)&&DC(e[We])}var jC={},eo="add",ph="delete",Jh=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[We]=jC,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Cn(Map)||nt(18),So(function(){a.keysAtom_=yc("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Me.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new uo(this.has_(n),Gh,"ObservableMap.key?",!1);this.hasMap_.set(n,o),wy(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(Gn(this)){var o=Vn(this,{type:a?Gi:eo,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,Gn(this)){var a=Vn(this,{type:ph,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Qu(),l=hi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:ph,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Fi(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var h=i.data_.get(n);h.setNewValue_(void 0),i.data_.delete(n)}),l&&pi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Me.UNCHANGED){var o=Qu(),l=hi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Gi,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&pi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Fi(function(){var f,h=new uo(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,h),i=h.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Qu(),l=hi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:eo,object:this,name:n,newValue:i}:null;l&&pi(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return _c({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return _c({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=fs(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Rr(n)&&(n=new Map(n)),Fi(function(){Ea(n)?Vx(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):Vs(n)?(Gx(n)||nt(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&nt(20,n)}),this},t.clear=function(){var n=this;Fi(function(){by(function(){for(var i=fs(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Fi(function(){for(var a=FC(n),o=new Map,l=!1,u=fs(i.data_.keys()),f;!(f=u()).done;){var h=f.value;if(!a.has(h)){var E=i.delete(h);if(E)l=!0;else{var w=i.data_.get(h);o.set(h,w)}}}for(var p=fs(a.entries()),S;!(S=p()).done;){var b=S.value,m=b[0],v=b[1],y=i.data_.has(m);if(i.set(m,v),i.data_.has(m)){var d=i.data_.get(m);o.set(m,d),y||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var g=i.data_.keys(),_=o.keys(),T=g.next(),C=_.next();!T.done;){if(T.value!==C.value){i.keysAtom_.reportChanged();break}T=g.next(),C=_.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},$h(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Rr=wo("ObservableMap",Jh);function FC(e){if(Vs(e)||Rr(e))return e;if(Array.isArray(e))return new Map(e);if(Ea(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return nt(21,e)}var zC={},Ty=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[We]=zC,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Cn(Set)||nt(22),this.enhancer_=function(o,l){return n(o,l,i)},So(function(){a.atom_=yc(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Fi(function(){by(function(){for(var i=fs(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=fs(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,Gn(this)){var a=Vn(this,{type:eo,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Fi(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=hi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:eo,object:this,newValue:n}:null;l&&pi(this,u)}return this},t.delete=function(n){var i=this;if(Gn(this)){var a=Vn(this,{type:ph,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=hi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:ph,object:this,oldValue:n}:null;return Fi(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&pi(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return _c({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return _c({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.intersection=function(n){if(fa(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(fa(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(fa(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(fa(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Yr(n)&&(n=new Set(n)),Fi(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):fa(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&nt("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},$h(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Yr=wo("ObservableSet",Ty),w5=Object.create(null),S5="remove",$8=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=PP),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new jc("ObservableObject.keys"),this.isPlainObject_=Ea(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof qi)return a.set(i),!0;if(Gn(this)){var o=Vn(this,{type:Gi,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Me.UNCHANGED){var l=hi(this),u=!1,f=l||u?{type:Gi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&pi(this,f)}return!0},t.get_=function(n){return Me.trackingDerivation&&!ga(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),ga(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!Me.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new uo(n in this.target_,Gh,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Bi])!=null&&a[n])return;nt(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Nc;){var l=sh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}O5(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&O5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{un();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=po({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else $i(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{cn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{un();var l=this.delete_(n);if(!l)return l;if(Gn(this)){var u=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:i});if(!u)return null;i=u.newValue}var f=E5(n),h={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else $i(this.target_,n,h);var E=new uo(i,a,"ObservableObject.key",!1);this.values_.set(n,E),this.notifyPropertyAddition_(n,E.value_)}finally{cn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{un();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=E5(n),f={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else $i(this.target_,n,f);this.values_.set(n,new qi(i)),this.notifyPropertyAddition_(n,void 0)}finally{cn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!ga(this.target_,n))return!0;if(Gn(this)){var a=Vn(this,{object:this.proxy_||this.target_,name:n,type:S5});if(!a)return null}try{var o;un();var l=hi(this),u=!1,f=this.values_.get(n),h=void 0;if(!f&&(l||u)){var E;h=(E=sh(this.target_,n))==null?void 0:E.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(f&&(this.values_.delete(n),f instanceof uo&&(h=f.value_),b8(f)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var w={type:S5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&pi(this,w)}}finally{cn()}return!0},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=hi(this),l=!1;if(o||l){var u=o||l?{type:eo,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&pi(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Cs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function ml(e,t){var r;if(ga(e,We))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new $8(e,new Map,String(n),jP(t));return Ic(e,We,i),e}var BC=wo("ObservableObjectAdministration",$8);function E5(e){return w5[e]||(w5[e]={get:function(){return this[We].getObservablePropValue_(e)},set:function(r){return this[We].setObservablePropValue_(e,r)}})}function Er(e){return Hh(e)?BC(e[We]):!1}function O5(e,t,r){var n;(n=e.target_[Bi])==null||delete n[r]}var UC=V8(0),HC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),z1=0,G8=function(){};function $C(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}$C(G8,Array.prototype);var Ay=function(e){function t(n,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,So(function(){var u=new ky(a,i,o,!0);u.proxy_=l,Xw(l,We,u),n&&n.length&&l.spliceWithArray(0,0,n),HC&&Object.defineProperty(l,"0",UC)}),l}Jw(t,e);var r=t.prototype;return r.concat=function(){this[We].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Qr(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return _c({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},$h(t,[{key:"length",get:function(){return this[We].getArrayLength_()},set:function(i){this[We].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(G8);Object.entries(hh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Ic(Ay.prototype,t,r)});function V8(e){return{enumerable:!1,configurable:!0,get:function(){return this[We].get_(e)},set:function(r){this[We].set_(e,r)}}}function GC(e){$i(Ay.prototype,""+e,V8(e))}function q8(e){if(e>z1){for(var t=z1;t<e+100;t++)GC(t);z1=e}}q8(1e3);function VC(e,t,r){return new Ay(e,t,r)}function Wi(e,t){if(typeof e=="object"&&e!==null){if(Qr(e))return t!==void 0&&nt(23),e[We].atom_;if(Yr(e))return e.atom_;if(Rr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||nt(25,t,gh(e)),r}if(Er(e)){if(!t)return nt(26);var n=e[We].values_.get(t);return n||nt(27,t,gh(e)),n}if(gy(e)||cl(e)||dh(e))return e}else if(Cn(e)&&dh(e[We]))return e[We];nt(28)}function mi(e,t){if(e||nt(29),t!==void 0)return mi(Wi(e,t));if(gy(e)||cl(e)||dh(e)||Rr(e)||Yr(e))return e;if(e[We])return e[We];nt(24,e)}function gh(e,t){var r;if(t!==void 0)r=Wi(e,t);else{if(zc(e))return e.name;Er(e)||Rr(e)||Yr(e)?r=mi(e):r=Wi(e)}return r.name_}function So(e){var t=vl(),r=qh(!0);un();try{return e()}finally{cn(),Wh(r),va(t)}}var x5=Nc.toString;function Ry(e,t,r){return r===void 0&&(r=-1),im(e,t,r)}function im(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=x5.call(e);if(o!==x5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=P5(e),t=P5(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(Cn(u)&&u instanceof u&&Cn(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var h=n.length;h--;)if(n[h]===e)return i[h]===t;if(n.push(e),i.push(t),l){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!im(e[h],t[h],r-1,n,i))return!1}else{var E=Object.keys(e),w;if(h=E.length,Object.keys(t).length!==h)return!1;for(;h--;)if(w=E[h],!(ga(t,w)&&im(e[w],t[w],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function P5(e){return Qr(e)?e.slice():Vs(e)||Rr(e)||fa(e)||Yr(e)?Array.from(e.entries()):e}function _c(e){return e[Symbol.iterator]=qC,e}function qC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&nt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:w8,extras:{getDebugName:gh},$mobx:We});const WC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:We,FlowCancellationError:Yh,ObservableMap:Jh,ObservableSet:Ty,Reaction:ks,_allowStateChanges:my,_allowStateChangesInsideComputed:As,_allowStateReadsEnd:bs,_allowStateReadsStart:Kh,_autoAction:Ts,_endAction:f8,_getAdministration:mi,_getGlobalState:g8,_interceptReads:Ey,_isComputingDerivation:GP,_resetGlobalState:KP,_startAction:c8,action:ar,autorun:_y,comparer:sl,computed:gl,configure:A8,createAtom:yc,defineProperty:Py,entries:F8,extendObservable:Sy,flow:fl,flowResult:bC,get:OC,getAtom:Wi,getDebugName:gh,getDependencyTree:R8,getObserverTree:pC,has:z8,intercept:Xh,isAction:zc,isBoxedObservable:yy,isComputed:SC,isComputedProp:I8,isFlow:Rs,isFlowCancellationError:mC,isObservable:Zh,isObservableArray:Qr,isObservableMap:Rr,isObservableObject:Er,isObservableProp:j8,isObservableSet:Yr,keys:bc,makeAutoObservable:MC,makeObservable:Cy,observable:Tt,observe:Qh,onBecomeObserved:k8,onBecomeUnobserved:wy,onReactionError:eC,override:iP,ownKeys:B8,reaction:C8,remove:EC,runInAction:As,set:xy,spy:w8,toJS:CC,trace:kC,transaction:Fi,untracked:by,values:Oy,when:nm},Symbol.toStringTag,{value:"Module"}));if(!Je.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Cy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function KC(e){e()}function W8(e){e||(e=KC),A8({reactionScheduler:e})}var YC=function(){return!0};function XC(e){return R8(e)}var K8=!1;function Y8(e){K8=e}function My(){return K8}var ZC=1e4,QC=1e4,JC=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=ZC),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,QC))}}),e}(),ek=typeof FinalizationRegistry<"u"?FinalizationRegistry:JC,vh=new ek(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),X8={exports:{}},Z8={};/**
35
- * @license React
36
- * use-sync-external-store-shim.production.min.js
37
- *
38
- * Copyright (c) Facebook, Inc. and its affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var Ms=Je;function tk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rk=typeof Object.is=="function"?Object.is:tk,nk=Ms.useState,ik=Ms.useEffect,ak=Ms.useLayoutEffect,ok=Ms.useDebugValue;function lk(e,t){var r=t(),n=nk({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return ak(function(){i.value=r,i.getSnapshot=t,B1(i)&&a({inst:i})},[e,r,t]),ik(function(){return B1(i)&&a({inst:i}),e(function(){B1(i)&&a({inst:i})})},[e]),ok(r),r}function B1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!rk(e,r)}catch{return!0}}function sk(e,t){return t()}var uk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sk:lk;Z8.useSyncExternalStore=Ms.useSyncExternalStore!==void 0?Ms.useSyncExternalStore:uk;X8.exports=Z8;var ck=X8.exports;function C5(e){e.reaction=new ks("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Ly(e,t){if(t===void 0&&(t="observed"),My())return e();var r=dt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return vh.unregister(n),n.onStoreChange=l,n.reaction||(C5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(C5(i),vh.register(r,i,i)),dt.useDebugValue(i.reaction,XC),ck.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var U1,H1,Q8=typeof Symbol=="function"&&Symbol.for,fk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,k5=Q8?Symbol.for("react.forward_ref"):typeof Je.forwardRef=="function"&&Je.forwardRef(function(e){return null}).$$typeof,T5=Q8?Symbol.for("react.memo"):typeof Je.memo=="function"&&Je.memo(function(e){return null}).$$typeof;function dk(e,t){var r;if(T5&&e.$$typeof===T5)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(My())return e;var n=(r=t==null?void 0:t.forwardRef)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(k5&&e.$$typeof===k5&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Ly(function(){return i(l,u)},a)};return o.displayName=e.displayName,fk&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=Je.forwardRef(o)),o=Je.memo(o),pk(e,o),o}var hk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function pk(e,t){Object.keys(e).forEach(function(r){hk[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function J8(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Ly(n)}J8.displayName="Observer";function gk(e,t){return Je.useState(function(){return Tt(e(),t,{autoBind:!0})})[0]}function e9(e){var t=Je.useState(function(){return Tt(e,{},{deep:!1})})[0];return As(function(){Object.assign(t,e)}),t}function vk(e,t){var r=t&&e9(t);return Je.useState(function(){return Tt(e(r),void 0,{autoBind:!0})})[0]}var $1;W8(Gw.unstable_batchedUpdates);var mk=($1=vh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function yk(e,t){return t===void 0&&(t="observed"),Ly(e,t)}function bk(e){Y8(e)}const _k=Object.freeze(Object.defineProperty({__proto__:null,Observer:J8,_observerFinalizationRegistry:vh,clearTimers:mk,enableStaticRendering:Y8,isObserverBatched:YC,isUsingStaticRendering:My,observer:dk,observerBatching:W8,useAsObservableSource:e9,useLocalObservable:gk,useLocalStore:vk,useObserver:yk,useStaticRendering:bk},Symbol.toStringTag,{value:"Module"})),bi=mo(_k);var t9={};const Xi=mo(WC);var Ny={exports:{}},ep={},mh={},ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof me<"u"?me:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.13",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)})(ut);var Yt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ut;class r{constructor(g=[1,0,0,1,0,0]){this.dirty=!1,this.m=g&&g.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(g){g.m[0]=this.m[0],g.m[1]=this.m[1],g.m[2]=this.m[2],g.m[3]=this.m[3],g.m[4]=this.m[4],g.m[5]=this.m[5]}point(g){var _=this.m;return{x:_[0]*g.x+_[2]*g.y+_[4],y:_[1]*g.x+_[3]*g.y+_[5]}}translate(g,_){return this.m[4]+=this.m[0]*g+this.m[2]*_,this.m[5]+=this.m[1]*g+this.m[3]*_,this}scale(g,_){return this.m[0]*=g,this.m[1]*=g,this.m[2]*=_,this.m[3]*=_,this}rotate(g){var _=Math.cos(g),T=Math.sin(g),C=this.m[0]*_+this.m[2]*T,P=this.m[1]*_+this.m[3]*T,O=this.m[0]*-T+this.m[2]*_,x=this.m[1]*-T+this.m[3]*_;return this.m[0]=C,this.m[1]=P,this.m[2]=O,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(g,_){var T=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,P=this.m[2]+this.m[0]*g,O=this.m[3]+this.m[1]*g;return this.m[0]=T,this.m[1]=C,this.m[2]=P,this.m[3]=O,this}multiply(g){var _=this.m[0]*g.m[0]+this.m[2]*g.m[1],T=this.m[1]*g.m[0]+this.m[3]*g.m[1],C=this.m[0]*g.m[2]+this.m[2]*g.m[3],P=this.m[1]*g.m[2]+this.m[3]*g.m[3],O=this.m[0]*g.m[4]+this.m[2]*g.m[5]+this.m[4],x=this.m[1]*g.m[4]+this.m[3]*g.m[5]+this.m[5];return this.m[0]=_,this.m[1]=T,this.m[2]=C,this.m[3]=P,this.m[4]=O,this.m[5]=x,this}invert(){var g=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*g,T=-this.m[1]*g,C=-this.m[2]*g,P=this.m[0]*g,O=g*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=g*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=T,this.m[2]=C,this.m[3]=P,this.m[4]=O,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var g=this.m[0],_=this.m[1],T=this.m[2],C=this.m[3],P=this.m[4],O=this.m[5],x=g*C-_*T;let k={x:P,y:O,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(g!=0||_!=0){var M=Math.sqrt(g*g+_*_);k.rotation=_>0?Math.acos(g/M):-Math.acos(g/M),k.scaleX=M,k.scaleY=x/M,k.skewX=(g*T+_*C)/x,k.skewY=0}else if(T!=0||C!=0){var I=Math.sqrt(T*T+C*C);k.rotation=Math.PI/2-(C>0?Math.acos(-T/I):-Math.acos(T/I)),k.scaleX=x/I,k.scaleY=I,k.skewX=0,k.skewY=(g*T+_*C)/x}return k.rotation=e.Util._getRotation(k.rotation),k}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",h="",E="0",w="Konva warning: ",p="Konva error: ",S="rgb(",b={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},m=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,v=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};e.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===n},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===a},_isBoolean(d){return Object.prototype.toString.call(d)===o},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;var g=d[0];return g==="#"||g==="."||g===g.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){v.push(d),v.length===1&&y(function(){const g=v;v=[],g.forEach(function(_){_()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,g){var _=e.Util.createImageElement();_.onload=function(){g(_)},_.src=d},_rgbToHex(d,g,_){return((1<<24)+(d<<16)+(g<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);var g=parseInt(d,16);return{r:g>>16&255,g:g>>8&255,b:g&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=E+d;return f+d},getRGB(d){var g;return d in b?(g=b[d],{r:g[0],g:g[1],b:g[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===S?(g=m.exec(d.replace(/ /g,"")),{r:parseInt(g[1],10),g:parseInt(g[2],10),b:parseInt(g[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",e.Util._namedColorToRBA(d)||e.Util._hex3ColorToRGBA(d)||e.Util._hex4ColorToRGBA(d)||e.Util._hex6ColorToRGBA(d)||e.Util._hex8ColorToRGBA(d)||e.Util._rgbColorToRGBA(d)||e.Util._rgbaColorToRGBA(d)||e.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var g=b[d.toLowerCase()];return g?{r:g[0],g:g[1],b:g[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var g=d.split(/ *, */).map(Number);return{r:g[0],g:g[1],b:g[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var g=d.split(/ *, */).map((_,T)=>_.slice(-1)==="%"?T===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:g[0],g:g[1],b:g[2],a:g[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[g,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),T=Number(_[0])/360,C=Number(_[1])/100,P=Number(_[2])/100;let O,x,k;if(C===0)return k=P*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};P<.5?O=P*(1+C):O=P+C-P*C;const M=2*P-O,I=[0,0,0];for(let H=0;H<3;H++)x=T+1/3*-(H-1),x<0&&x++,x>1&&x--,6*x<1?k=M+(O-M)*6*x:2*x<1?k=O:3*x<2?k=M+(O-M)*(2/3-x)*6:k=M,I[H]=k*255;return{r:Math.round(I[0]),g:Math.round(I[1]),b:Math.round(I[2]),a:1}}},haveIntersection(d,g){return!(g.x>d.x+d.width||g.x+g.width<d.x||g.y>d.y+d.height||g.y+g.height<d.y)},cloneObject(d){var g={};for(var _ in d)this._isPlainObject(d[_])?g[_]=this.cloneObject(d[_]):this._isArray(d[_])?g[_]=this.cloneArray(d[_]):g[_]=d[_];return g},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(d)},_radToDeg(d){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(d)},_getRotation(d){return t.Konva.angleDeg?e.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(p+d)},error(d){console.error(p+d)},warn(d){t.Konva.showWarnings&&console.warn(w+d)},each(d,g){for(var _ in d)g(_,d[_])},_inRange(d,g,_){return g<=d&&d<_},_getProjectionToSegment(d,g,_,T,C,P){var O,x,k,M=(d-_)*(d-_)+(g-T)*(g-T);if(M==0)O=d,x=g,k=(C-_)*(C-_)+(P-T)*(P-T);else{var I=((C-d)*(_-d)+(P-g)*(T-g))/M;I<0?(O=d,x=g,k=(d-C)*(d-C)+(g-P)*(g-P)):I>1?(O=_,x=T,k=(_-C)*(_-C)+(T-P)*(T-P)):(O=d+I*(_-d),x=g+I*(T-g),k=(O-C)*(O-C)+(x-P)*(x-P))}return[O,x,k]},_getProjectionToLine(d,g,_){var T=e.Util.cloneObject(d),C=Number.MAX_VALUE;return g.forEach(function(P,O){if(!(!_&&O===g.length-1)){var x=g[(O+1)%g.length],k=e.Util._getProjectionToSegment(P.x,P.y,x.x,x.y,d.x,d.y),M=k[0],I=k[1],H=k[2];H<C&&(T.x=M,T.y=I,C=H)}}),T},_prepareArrayForTween(d,g,_){var T,C=[],P=[];if(d.length>g.length){var O=g;g=d,d=O}for(T=0;T<d.length;T+=2)C.push({x:d[T],y:d[T+1]});for(T=0;T<g.length;T+=2)P.push({x:g[T],y:g[T+1]});var x=[];return P.forEach(function(k){var M=e.Util._getProjectionToLine(k,C,_);x.push(M.x),x.push(M.y)}),x},_prepareToStringify(d){var g;d.visitedByCircularReferenceRemoval=!0;for(var _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(g=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||e.Util._isElement(d[_]))if(g.configurable)delete d[_];else return null;else if(e.Util._prepareToStringify(d[_])===null)if(g.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,g){for(var _ in g)d[_]=g[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(g=>{g.width=0,g.height=0})},drawRoundedRectPath(d,g,_,T){let C=0,P=0,O=0,x=0;typeof T=="number"?C=P=O=x=Math.min(T,g/2,_/2):(C=Math.min(T[0]||0,g/2,_/2),P=Math.min(T[1]||0,g/2,_/2),x=Math.min(T[2]||0,g/2,_/2),O=Math.min(T[3]||0,g/2,_/2)),d.moveTo(C,0),d.lineTo(g-P,0),d.arc(g-P,P,P,Math.PI*3/2,0,!1),d.lineTo(g,_-x),d.arc(g-x,_-x,x,0,Math.PI/2,!1),d.lineTo(O,_),d.arc(O,_-O,O,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(Yt);var $t={},ct={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.getComponentValidator=qe.getBooleanValidator=qe.getNumberArrayValidator=qe.getFunctionValidator=qe.getStringOrGradientValidator=qe.getStringValidator=qe.getNumberOrAutoValidator=qe.getNumberOrArrayOfNumbersValidator=qe.getNumberValidator=qe.alphaComponent=qe.RGBComponent=void 0;const Pa=ut,Qt=Yt;function Ca(e){return Qt.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Qt.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function wk(e){return e>255?255:e<0?0:Math.round(e)}qe.RGBComponent=wk;function Sk(e){return e>1?1:e<1e-4?1e-4:e}qe.alphaComponent=Sk;function Ek(){if(Pa.Konva.isUnminified)return function(e,t){return Qt.Util._isNumber(e)||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}qe.getNumberValidator=Ek;function Ok(e){if(Pa.Konva.isUnminified)return function(t,r){let n=Qt.Util._isNumber(t),i=Qt.Util._isArray(t)&&t.length==e;return!n&&!i&&Qt.Util.warn(Ca(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}qe.getNumberOrArrayOfNumbersValidator=Ok;function xk(){if(Pa.Konva.isUnminified)return function(e,t){var r=Qt.Util._isNumber(e),n=e==="auto";return r||n||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}qe.getNumberOrAutoValidator=xk;function Pk(){if(Pa.Konva.isUnminified)return function(e,t){return Qt.Util._isString(e)||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}qe.getStringValidator=Pk;function Ck(){if(Pa.Konva.isUnminified)return function(e,t){const r=Qt.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}qe.getStringOrGradientValidator=Ck;function kk(){if(Pa.Konva.isUnminified)return function(e,t){return Qt.Util._isFunction(e)||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}qe.getFunctionValidator=kk;function Tk(){if(Pa.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(Qt.Util._isArray(e)?e.forEach(function(n){Qt.Util._isNumber(n)||Qt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}qe.getNumberArrayValidator=Tk;function Ak(){if(Pa.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Qt.Util.warn(Ca(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}qe.getBooleanValidator=Ak;function Rk(e){if(Pa.Konva.isUnminified)return function(t,r){return t==null||Qt.Util.isObject(t)||Qt.Util.warn(Ca(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}qe.getComponentValidator=Rk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Yt,r=qe;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var h=l.length,E=t.Util._capitalize,w=n+E(o),p=i+E(o),S,b;a.prototype[w]=function(){var v={};for(S=0;S<h;S++)b=l[S],v[b]=this.getAttr(o+E(b));return v};var m=(0,r.getComponentValidator)(l);a.prototype[p]=function(v){var y=this.attrs[o],d;u&&(v=u.call(this,v)),m&&m.call(this,v,o);for(d in v)v.hasOwnProperty(d)&&this._setAttr(o+E(d),v[d]);return v||l.forEach(g=>{this._setAttr(o+E(g),void 0)}),this._fireChangeEvent(o,y,v),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(h);var E=this.attrs[o];return E===void 0?l:E},e.Factory.addSetter(a,o,u,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],h=n+t.Util._capitalize(l),E=i+t.Util._capitalize(l);function w(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=w,a.prototype[h]=w,a.prototype[E]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ct);var gi={},ma={};Object.defineProperty(ma,"__esModule",{value:!0});ma.HitContext=ma.SceneContext=ma.Context=void 0;const r9=Yt,Mk=ut;function Lk(e){var t=[],r=e.length,n=r9.Util,i,a;for(i=0;i<r;i++)a=e[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),t.push(a);return t}var A5=",",Nk="(",Ik=")",Dk="([",jk="])",Fk=";",zk="()",Bk="=",R5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Uk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Hk=100;class tp{constructor(t){this.canvas=t,Mk.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,r){var n=this.traceArr,i=n.length,a="",o,l,u,f;for(o=0;o<i;o++)l=n[o],u=l.method,u?(f=l.args,a+=u,t?a+=zk:r9.Util._isArray(f[0])?a+=Dk+f.join(A5)+jk:(r&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),a+=Nk+f.join(A5)+Ik)):(a+=l.property,t||(a+=Bk+l.val)),a+=Fk;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=Hk&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var h=arguments,E=this._context;h.length===3?E.drawImage(t,r,n):h.length===5?E.drawImage(t,r,n,i,a):h.length===9&&E.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=R5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=Lk(Array.prototype.slice.call(arguments,0)),f=u.apply(t,arguments),t._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(R5[i]);t.setAttr=function(){n.apply(t,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:l,val:u})}}_applyGlobalCompositeOperation(t){const r=t.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}ma.Context=tp;Uk.forEach(function(e){Object.defineProperty(tp.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class $k extends tp{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=u.x*f,E=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(h),Math.abs(E))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*E)}}ma.SceneContext=$k;class Gk extends tp{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const a=t.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),i=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),a||this.restore()}}}ma.HitContext=Gk;Object.defineProperty(gi,"__esModule",{value:!0});gi.HitCanvas=gi.SceneCanvas=gi.Canvas=void 0;const yh=Yt,n9=ma,i9=ut,Vk=ct,qk=qe;var pd;function Wk(){if(pd)return pd;var e=yh.Util.createCanvasElement(),t=e.getContext("2d");return pd=function(){var r=i9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),yh.Util.releaseCanvas(e),pd}class rp{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||i9.Konva.pixelRatio||Wk();this.pixelRatio=n,this._canvas=yh.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var r=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,r){this.setWidth(t||0),this.setHeight(r||0)}toDataURL(t,r){try{return this._canvas.toDataURL(t,r)}catch{try{return this._canvas.toDataURL()}catch(i){return yh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}gi.Canvas=rp;Vk.Factory.addGetterSetter(rp,"pixelRatio",void 0,(0,qk.getNumberValidator)());class Kk extends rp{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new n9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}gi.SceneCanvas=Kk;class Yk extends rp{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new n9.HitContext(this),this.setSize(t.width,t.height)}}gi.HitCanvas=Yk;var np={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ut,r=Yt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(w=>w.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var h=l.dragDistance(),E=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(E<h||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(h=>h.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(np);Object.defineProperty($t,"__esModule",{value:!0});$t.Node=void 0;const gt=Yt,Hc=ct,Mu=gi,Va=ut,Un=np,rr=qe;var Id="absoluteOpacity",gd="allEventListeners",sa="absoluteTransform",M5="absoluteScale",$o="canvas",Xk="Change",Zk="children",Qk="konva",am="listening",L5="mouseenter",N5="mouseleave",I5="set",D5="Shape",Dd=" ",j5="stage",qa="transform",Jk="Stage",om="visible",eT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Dd);let tT=1,lt=class lm{constructor(t){this._id=tT++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===qa||t===sa)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,r){var n=this._cache.get(t),i=t===qa||t===sa,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(t,n)),n}_calculate(t,r,n){if(!this._attachedDepsListeners.get(t)){const i=r.map(a=>a+"Change.konva").join(Dd);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get($o)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===sa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has($o)){const{scene:t,filter:r,hit:n}=this._cache.get($o);gt.Util.releaseCanvas(t,r,n),this._cache.delete($o)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,h=r.drawBorder||!1,E=r.hitCanvasPixelRatio||1;if(!i||!a){gt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const w=Math.abs(Math.round(n.x)-l)>.5?1:0,p=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+w,a+=f*2+p,l-=f,u-=f;var S=new Mu.SceneCanvas({pixelRatio:o,width:i,height:a}),b=new Mu.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),m=new Mu.HitCanvas({pixelRatio:E,width:i,height:a}),v=S.getContext(),y=m.getContext();return m.isCache=!0,S.isCache=!0,this._cache.delete($o),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(S.getContext()._context.imageSmoothingEnabled=!1,b.getContext()._context.imageSmoothingEnabled=!1),v.save(),y.save(),v.translate(-l,-u),y.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Id),this._clearSelfAndDescendantCache(M5),this.drawScene(S,this),this.drawHit(m,this),this._isUnderCache=!1,v.restore(),y.restore(),h&&(v.save(),v.beginPath(),v.rect(0,0,i,a),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set($o,{scene:S,filter:b,hit:m,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has($o)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var h=u.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var h=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/h,n.getHeight()/h),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){gt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(E){gt.Util.error("Unable to apply filter. "+E.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(gd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Dd),i=n.length,a,o,l,u,f;for(a=0;a<i;a++)o=n[a],l=o.split("."),u=l[0],f=l[1]||"",this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:f,handler:r});return this}off(t,r){var n=(t||"").split(Dd),i=n.length,a,o,l,u,f,h;if(this._cache&&this._cache.delete(gd),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],h=u[1],f)this.eventListeners[f]&&this._off(f,h,r);else for(o in this.eventListeners)this._off(o,h,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=gt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),Un.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(sa),this._clearSelfAndDescendantCache(Id),this._clearSelfAndDescendantCache(M5),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(om),this._clearSelfAndDescendantCache(am)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var r="get"+gt.Util._capitalize(t);return gt.Util._isFunction(this[r])?this[r]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),r=[];t;)r.push(t),t=t.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var r,n;if(!t)return this;for(r in t)r!==Zk&&(n=I5+gt.Util._capitalize(r),gt.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(am,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(om,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,r=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),i=!1;Un.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Va.Konva.hitOnDragEnabled&&(i||Va.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(h){for(i=[],a=h.length,o=0;o<a;o++)l=h[o],n++,l.nodeType!==D5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==Jk&&f&&u(f.getChildren()),n}getDepth(){for(var t=0,r=this.parent;r;)t++,r=r.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(qa),this._clearSelfAndDescendantCache(sa)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var r=t.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(t){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),a=new gt.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(qa);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(qa),this._clearSelfAndDescendantCache(sa),this}_setTransform(t){var r;for(r in t)this.attrs[r]=t[r]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var r=t.x,n=t.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,r){var n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return gt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return gt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return gt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&gt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Id,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(t*=r.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),r,n,i,a,o;const l={attrs:{},className:this.getClassName()};for(r in t)n=t[r],o=gt.Util.isObject(n)&&!gt.Util._isPlainObject(n)&&!gt.Util._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete t[r],a=i?i.call(this):null,t[r]=n,a!==n&&(l.attrs[r]=n));return gt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,r,n){var i=[];r&&this._isMatch(t)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,r,n){return this.findAncestors(t,r,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var r=t.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],gt.Util.isValidSelector(a)||(gt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),gt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),gt.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(j5,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,r={},n){return r.target=r.target||this,n?this._fireAndBubble(t,r):this._fire(t,r),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(sa,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new gt.Transform,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?r.multiply(i.getTransform()):a==="position"&&r.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),r;r=this._cache.get(sa)||new gt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,l=this.attrs.offsetY||0;r.translate(i-o,a-l)}return r.dirty=!1,r}getAbsoluteScale(t){for(var r=this;r;)r._isUnderCache&&(t=r),r=r.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(qa,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(qa)||new gt.Transform;n.reset();var i=this.x(),a=this.y(),o=Va.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,E=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||h!==0)&&n.skew(f,h),(l!==1||u!==1)&&n.scale(l,u),(E!==0||w!==0)&&n.translate(-1*E,-1*w),n.dirty=!1,n}clone(t){var r=gt.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in t)r[n]=t[n];var u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)l=i[o],l.name.indexOf(Qk)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(t){t=t||{};var r=this.getClientRect(),n=this.getStage(),i=t.x!==void 0?t.x:Math.floor(r.x),a=t.y!==void 0?t.y:Math.floor(r.y),o=t.pixelRatio||1,l=new Mu.SceneCanvas({width:t.width||Math.ceil(r.width)||(n?n.width():0),height:t.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();const f=new Mu.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l,void 0,f),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var r=t.mimeType||null,n=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(r,n);return t.callback&&t.callback(i),i}toImage(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,gt.Util._urlToImage(this.toDataURL(t),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{r(a),i==null||i(a)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){n(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Va.Konva.dragDistance}_off(t,r,n){var i=this.eventListeners[t],a,o,l;for(a=0;a<i.length;a++)if(o=i[a].name,l=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===l)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,r,n){this._fire(t+Xk,{oldVal:r,newVal:n})}addName(t){if(!this.hasName(t)){var r=this.name(),n=r?r+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var r=(this.name()||"").split(/\s/g),n=r.indexOf(t);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(t,r){var n=this[I5+gt.Util._capitalize(t)];return gt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(Va.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!gt.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===D5&&(r.target=this);var i=(t===L5||t===N5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===L5||t===N5)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,r,n):this._fireAndBubble.call(this.parent,t,r))}}_getProtoListeners(t){var r,n,i;const a=(r=this._cache.get(gd))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[t];if(o===void 0){o=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(i=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[t]=o,this._cache.set(gd,a)}return o}_fire(t,r){r=r||{},r.currentTarget=this,r.type=t;const n=this._getProtoListeners(t);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[t];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var r=t?t.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;Un.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}}startDrag(t,r=!0){Un.DD._dragElements.has(this._id)||this._createDragElement(t);const n=Un.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},r)}_setDragPosition(t,r){const n=this.getStage()._getPointerById(r.pointerId);if(n){var i={x:n.x-r.offset.x,y:n.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:gt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const r=Un.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Un.DD._endDragBefore(t),Un.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Un.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var r=t.evt.button!==void 0,n=!r||Va.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Un.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const r=Un.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Un.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-t.x,y:-t.y,width:r.width()+2*t.x,height:r.height()+2*t.y};return gt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return gt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=lm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),Va.Konva[n]||(gt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Va.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(lm._createNode(i[l]));return a}};$t.Node=lt;lt.prototype.nodeType="Node";lt.prototype._attrsAffectingSize=[];lt.prototype.eventListeners={};lt.prototype.on.call(lt.prototype,eT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(qa),this._clearSelfAndDescendantCache(sa)});lt.prototype.on.call(lt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});lt.prototype.on.call(lt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});lt.prototype.on.call(lt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Id)});const Rt=Hc.Factory.addGetterSetter;Rt(lt,"zIndex");Rt(lt,"absolutePosition");Rt(lt,"position");Rt(lt,"x",0,(0,rr.getNumberValidator)());Rt(lt,"y",0,(0,rr.getNumberValidator)());Rt(lt,"globalCompositeOperation","source-over",(0,rr.getStringValidator)());Rt(lt,"opacity",1,(0,rr.getNumberValidator)());Rt(lt,"name","",(0,rr.getStringValidator)());Rt(lt,"id","",(0,rr.getStringValidator)());Rt(lt,"rotation",0,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"scale",["x","y"]);Rt(lt,"scaleX",1,(0,rr.getNumberValidator)());Rt(lt,"scaleY",1,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"skew",["x","y"]);Rt(lt,"skewX",0,(0,rr.getNumberValidator)());Rt(lt,"skewY",0,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"offset",["x","y"]);Rt(lt,"offsetX",0,(0,rr.getNumberValidator)());Rt(lt,"offsetY",0,(0,rr.getNumberValidator)());Rt(lt,"dragDistance",null,(0,rr.getNumberValidator)());Rt(lt,"width",0,(0,rr.getNumberValidator)());Rt(lt,"height",0,(0,rr.getNumberValidator)());Rt(lt,"listening",!0,(0,rr.getBooleanValidator)());Rt(lt,"preventDefault",!0,(0,rr.getBooleanValidator)());Rt(lt,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(lt,"visible",!0,(0,rr.getBooleanValidator)());Rt(lt,"transformsEnabled","all",(0,rr.getStringValidator)());Rt(lt,"size");Rt(lt,"dragBoundFunc");Rt(lt,"draggable",!1,(0,rr.getBooleanValidator)());Hc.Factory.backCompat(lt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var yl={};Object.defineProperty(yl,"__esModule",{value:!0});yl.Container=void 0;const Ws=ct,G1=$t,ip=qe;class bl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){t(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var r=this._generalFind(t,!0);return r.length>0?r[0]:void 0}_generalFind(t,r){var n=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&n.push(i),!!(a&&r)}),n}_descendants(t){let r=!1;const n=this.getChildren();for(const i of n){if(r=t(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(t),r))return!0}return!1}toObject(){var t=G1.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(r=>{t.children.push(r.toObject())}),t}isAncestorOf(t){for(var r=t.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(t){var r=G1.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var h=this.getAbsoluteTransform(r).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof u=="number"||f;const E=n===this;if(h){o.save();var w=this.getAbsoluteTransform(n),p=w.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let v;if(f)v=f.call(this,o,this);else{var S=this.clipX(),b=this.clipY();o.rect(S||0,b||0,l,u)}o.clip.apply(o,v),p=w.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}var m=!E&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(v){v[t](r,n,i)}),m&&o.restore(),h&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},h=this;(r=this.children)===null||r===void 0||r.forEach(function(b){if(b.visible()){var m=b.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});m.width===0&&m.height===0||(a===void 0?(a=m.x,o=m.y,l=m.x+m.width,u=m.y+m.height):(a=Math.min(a,m.x),o=Math.min(o,m.y),l=Math.max(l,m.x+m.width),u=Math.max(u,m.y+m.height)))}});for(var E=this.find("Shape"),w=!1,p=0;p<E.length;p++){var S=E[p];if(S._isVisible(this)){w=!0;break}}return w&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}yl.Container=bl;Ws.Factory.addComponentsGetterSetter(bl,"clip",["x","y","width","height"]);Ws.Factory.addGetterSetter(bl,"clipX",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipY",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipWidth",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipHeight",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipFunc");var a9={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.releaseCapture=En.setPointerCapture=En.hasPointerCapture=En.createEvent=En.getCapturedShape=void 0;const rT=ut,wc=new Map,o9=rT.Konva._global.PointerEvent!==void 0;function nT(e){return wc.get(e)}En.getCapturedShape=nT;function Iy(e){return{evt:e,pointerId:e.pointerId}}En.createEvent=Iy;function iT(e,t){return wc.get(e)===t}En.hasPointerCapture=iT;function aT(e,t){l9(e),t.getStage()&&(wc.set(e,t),o9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}En.setPointerCapture=aT;function l9(e,t){const r=wc.get(e);if(!r)return;const n=r.getStage();n&&n.content,wc.delete(e),o9&&r._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}En.releaseCapture=l9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Yt,r=ct,n=yl,i=ut,a=gi,o=np,l=ut,u=En;var f="Stage",h="string",E="px",w="mouseout",p="mouseleave",S="mouseover",b="mouseenter",m="mousemove",v="mousedown",y="mouseup",d="pointermove",g="pointerdown",_="pointerup",T="pointercancel",C="lostpointercapture",P="pointerout",O="pointerleave",x="pointerover",k="pointerenter",M="contextmenu",I="touchstart",H="touchend",G="touchmove",Q="touchcancel",W="wheel",U=5,j=[[b,"_pointerenter"],[v,"_pointerdown"],[m,"_pointermove"],[y,"_pointerup"],[p,"_pointerleave"],[I,"_pointerdown"],[G,"_pointermove"],[H,"_pointerup"],[Q,"_pointercancel"],[S,"_pointerover"],[W,"_wheel"],[M,"_contextmenu"],[g,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[T,"_pointercancel"],[C,"_lostpointercapture"]];const A={mouse:{[P]:w,[O]:p,[x]:S,[k]:b,[d]:m,[g]:v,[_]:y,[T]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[P]:"touchout",[O]:"touchleave",[x]:"touchover",[k]:"touchenter",[d]:G,[g]:I,[_]:H,[T]:Q,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[P]:P,[O]:O,[x]:x,[k]:k,[d]:d,[g]:g,[_]:_,[T]:T,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},L=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",z=$=>{const B=L($);if(B==="pointer")return i.Konva.pointerEventsEnabled&&A.pointer;if(B==="touch")return A.touch;if(B==="mouse")return A.mouse};function q($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const K="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class F extends n.Container{constructor(B){super(q(B)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{q(this.attrs)}),this._checkVisibility()}_validateAdd(B){const Y=B.getType()==="Layer",X=B.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const B=this.visible()?"":"none";this.content.style.display=B}setContainer(B){if(typeof B===h){if(B.charAt(0)==="."){var Y=B.slice(1);B=document.getElementsByClassName(Y)[0]}else{var X;B.charAt(0)!=="#"?X=B:X=B.slice(1),B=document.getElementById(X)}if(!B)throw"Can not find container in document with id "+X}return this._setAttr("container",B),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),B.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var B=this.children,Y=B.length,X;for(X=0;X<Y;X++)B[X].clear();return this}clone(B){return B||(B={}),B.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,B)}destroy(){super.destroy();var B=this.content;B&&t.Util._isInDocument(B)&&this.container().removeChild(B);var Y=e.stages.indexOf(this);return Y>-1&&e.stages.splice(Y,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const B=this._pointerPositions[0]||this._changedPointerPositions[0];return B?{x:B.x,y:B.y}:(t.Util.warn(K),null)}_getPointerById(B){return this._pointerPositions.find(Y=>Y.id===B)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(B){B=B||{},B.x=B.x||0,B.y=B.y||0,B.width=B.width||this.width(),B.height=B.height||this.height();var Y=new a.SceneCanvas({width:B.width,height:B.height,pixelRatio:B.pixelRatio||1}),X=Y.getContext()._context,Z=this.children;return(B.x||B.y)&&X.translate(-1*B.x,-1*B.y),Z.forEach(function(te){if(te.isVisible()){var ee=te._toKonvaCanvas(B);X.drawImage(ee._canvas,B.x,B.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),Y}getIntersection(B){if(!B)return null;var Y=this.children,X=Y.length,Z=X-1,te;for(te=Z;te>=0;te--){const ee=Y[te].getIntersection(B);if(ee)return ee}return null}_resizeDOM(){var B=this.width(),Y=this.height();this.content&&(this.content.style.width=B+E,this.content.style.height=Y+E),this.bufferCanvas.setSize(B,Y),this.bufferHitCanvas.setSize(B,Y),this.children.forEach(X=>{X.setSize({width:B,height:Y}),X.draw()})}add(B,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(B);var Z=this.children.length;return Z>U&&t.Util.warn("The stage has "+Z+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),B.setSize({width:this.width(),height:this.height()}),B.draw(),i.Konva.isBrowser&&this.content.appendChild(B.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(B){return u.hasPointerCapture(B,this)}setPointerCapture(B){u.setPointerCapture(B,this)}releaseCapture(B){u.releaseCapture(B,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&j.forEach(([B,Y])=>{this.content.addEventListener(B,X=>{this[Y](X)},{passive:!1})})}_pointerenter(B){this.setPointersPositions(B);const Y=z(B.type);Y&&this._fire(Y.pointerenter,{evt:B,target:this,currentTarget:this})}_pointerover(B){this.setPointersPositions(B);const Y=z(B.type);Y&&this._fire(Y.pointerover,{evt:B,target:this,currentTarget:this})}_getTargetShape(B){let Y=this[B+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(B){const Y=z(B.type),X=L(B.type);if(Y){this.setPointersPositions(B);var Z=this._getTargetShape(X),te=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Z&&te?(Z._fireAndBubble(Y.pointerout,{evt:B}),Z._fireAndBubble(Y.pointerleave,{evt:B}),this._fire(Y.pointerleave,{evt:B,target:this,currentTarget:this}),this[X+"targetShape"]=null):te&&(this._fire(Y.pointerleave,{evt:B,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:B,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(B){const Y=z(B.type),X=L(B.type);if(Y){this.setPointersPositions(B);var Z=!1;this._changedPointerPositions.forEach(te=>{var ee=this.getIntersection(te);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ee||!ee.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ee.setPointerCapture(te.id),this[X+"ClickStartShape"]=ee,ee._fireAndBubble(Y.pointerdown,{evt:B,pointerId:te.id}),Z=!0;const ne=B.type.indexOf("touch")>=0;ee.preventDefault()&&B.cancelable&&ne&&B.preventDefault()}),Z||this._fire(Y.pointerdown,{evt:B,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(B){const Y=z(B.type),X=L(B.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&B.cancelable&&B.preventDefault(),this.setPointersPositions(B);var Z=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Z)return;var te={};let ee=!1;var ne=this._getTargetShape(X);this._changedPointerPositions.forEach(ie=>{const ce=u.getCapturedShape(ie.id)||this.getIntersection(ie),Oe=ie.id,Te={evt:B,pointerId:Oe};var ae=ne!==ce;if(ae&&ne&&(ne._fireAndBubble(Y.pointerout,{...Te},ce),ne._fireAndBubble(Y.pointerleave,{...Te},ce)),ce){if(te[ce._id])return;te[ce._id]=!0}ce&&ce.isListening()?(ee=!0,ae&&(ce._fireAndBubble(Y.pointerover,{...Te},ne),ce._fireAndBubble(Y.pointerenter,{...Te},ne),this[X+"targetShape"]=ce),ce._fireAndBubble(Y.pointermove,{...Te})):ne&&(this._fire(Y.pointerover,{evt:B,target:this,currentTarget:this,pointerId:Oe}),this[X+"targetShape"]=null)}),ee||this._fire(Y.pointermove,{evt:B,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(B){const Y=z(B.type),X=L(B.type);if(!Y)return;this.setPointersPositions(B);const Z=this[X+"ClickStartShape"],te=this[X+"ClickEndShape"];var ee={};let ne=!1;this._changedPointerPositions.forEach(ie=>{const ce=u.getCapturedShape(ie.id)||this.getIntersection(ie);if(ce){if(ce.releaseCapture(ie.id),ee[ce._id])return;ee[ce._id]=!0}const Oe=ie.id,Te={evt:B,pointerId:Oe};let ae=!1;i.Konva["_"+X+"InDblClickWindow"]?(ae=!0,clearTimeout(this[X+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ce&&ce.isListening()?(ne=!0,this[X+"ClickEndShape"]=ce,ce._fireAndBubble(Y.pointerup,{...Te}),i.Konva["_"+X+"ListenClick"]&&Z&&Z===ce&&(ce._fireAndBubble(Y.pointerclick,{...Te}),ae&&te&&te===ce&&ce._fireAndBubble(Y.pointerdblclick,{...Te}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:B,target:this,currentTarget:this,pointerId:Oe}),ae&&this._fire(Y.pointerdblclick,{evt:B,target:this,currentTarget:this,pointerId:Oe}))}),ne||this._fire(Y.pointerup,{evt:B,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,B.cancelable&&X!=="touch"&&B.preventDefault()}_contextmenu(B){this.setPointersPositions(B);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(M,{evt:B}):this._fire(M,{evt:B,target:this,currentTarget:this})}_wheel(B){this.setPointersPositions(B);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(W,{evt:B}):this._fire(W,{evt:B,target:this,currentTarget:this})}_pointercancel(B){this.setPointersPositions(B);const Y=u.getCapturedShape(B.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(_,u.createEvent(B)),u.releaseCapture(B.pointerId)}_lostpointercapture(B){u.releaseCapture(B.pointerId)}setPointersPositions(B){var Y=this._getContentPosition(),X=null,Z=null;B=B||window.event,B.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(B.touches,te=>{this._pointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(B.changedTouches||B.touches,te=>{this._changedPointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})})):(X=(B.clientX-Y.left)/Y.scaleX,Z=(B.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Z},this._pointerPositions=[{x:X,y:Z,id:t.Util._getFirstPointerId(B)}],this._changedPointerPositions=[{x:X,y:Z,id:t.Util._getFirstPointerId(B)}])}_setPointerPosition(B){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(B)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var B=this.content.getBoundingClientRect();return{top:B.top,left:B.left,scaleX:B.width/this.content.clientWidth||1,scaleY:B.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var B=this.container();if(!B)throw"Stage has no container. A container is required.";B.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),B.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(B){B.batchDraw()}),this}}e.Stage=F,F.prototype.nodeType=f,(0,l._registerNode)(F),r.Factory.addGetterSetter(F,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach($=>{$.batchDraw()})})})(a9);var $c={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ut,r=Yt,n=ct,i=$t,a=qe,o=ut,l=En;var u="hasShadow",f="shadowRGBA",h="patternImage",E="linearGradient",w="radialGradient";let p;function S(){return p||(p=r.Util.createCanvasElement().getContext("2d"),p)}e.shapes={};function b(O){const x=this.attrs.fillRule;x?O.fill(x):O.fill()}function m(O){O.stroke()}function v(O){O.fill()}function y(O){O.stroke()}function d(){this._clearCache(u)}function g(){this._clearCache(f)}function _(){this._clearCache(h)}function T(){this._clearCache(E)}function C(){this._clearCache(w)}class P extends i.Node{constructor(x){super(x);let k;for(;k=r.Util.getRandomColor(),!(k&&!(k in e.shapes)););this.colorKey=k,e.shapes[k]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var x=S();const k=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(k&&k.setTransform){const M=new r.Transform;M.translate(this.fillPatternX(),this.fillPatternY()),M.rotate(t.Konva.getAngle(this.fillPatternRotation())),M.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),M.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const I=M.getMatrix(),H=typeof DOMMatrix>"u"?{a:I[0],b:I[1],c:I[2],d:I[3],e:I[4],f:I[5]}:new DOMMatrix(I);k.setTransform(H)}return k}}_getLinearGradient(){return this._getCache(E,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var k=S(),M=this.fillLinearGradientStartPoint(),I=this.fillLinearGradientEndPoint(),H=k.createLinearGradient(M.x,M.y,I.x,I.y),G=0;G<x.length;G+=2)H.addColorStop(x[G],x[G+1]);return H}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var k=S(),M=this.fillRadialGradientStartPoint(),I=this.fillRadialGradientEndPoint(),H=k.createRadialGradient(M.x,M.y,this.fillRadialGradientStartRadius(),I.x,I.y,this.fillRadialGradientEndRadius()),G=0;G<x.length;G+=2)H.addColorStop(x[G],x[G+1]);return H}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=r.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var k=this.getStage();if(!k)return!1;const M=k.bufferHitCanvas;return M.getContext().clear(),this.drawHit(M,void 0,!0),M.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var k;if(!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const I=x||this.hasFill(),H=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(I&&H&&G)return!0;const Q=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(I&&H&&Q&&W)}setStrokeHitEnabled(x){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){let k=!1,M=this.getParent();for(;M;){if(M.isCached()){k=!0;break}M=M.getParent()}const I=x.skipTransform,H=x.relativeTo||k&&this.getStage()||void 0,G=this.getSelfRect(),W=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,U=G.width+W,j=G.height+W,A=!x.skipShadow&&this.hasShadow(),L=A?this.shadowOffsetX():0,z=A?this.shadowOffsetY():0,q=U+Math.abs(L),K=j+Math.abs(z),F=A&&this.shadowBlur()||0,$=q+F*2,B=K+F*2,Y={width:$,height:B,x:-(W/2+F)+Math.min(L,0)+G.x,y:-(W/2+F)+Math.min(z,0)+G.y};return I?Y:this._transformedRect(Y,H)}drawScene(x,k,M){var I=this.getLayer(),H=x||I.getCanvas(),G=H.getContext(),Q=this._getCanvasCache(),W=this.getSceneFunc(),U=this.hasShadow(),j,A,L=H.isCache,z=k===this;if(!this.isVisible()&&!z)return this;if(Q){G.save();var q=this.getAbsoluteTransform(k).getMatrix();return G.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!L){j=this.getStage();const $=M||j.bufferCanvas;A=$.getContext(),A.clear(),A.save(),A._applyLineJoin(this);var K=this.getAbsoluteTransform(k).getMatrix();A.transform(K[0],K[1],K[2],K[3],K[4],K[5]),W.call(this,A,this),A.restore();var F=$.pixelRatio;U&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage($._canvas,0,0,$.width/F,$.height/F)}else{if(G._applyLineJoin(this),!z){var K=this.getAbsoluteTransform(k).getMatrix();G.transform(K[0],K[1],K[2],K[3],K[4],K[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}U&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(x,k,M=!1){if(!this.shouldDrawHit(k,M))return this;var I=this.getLayer(),H=x||I.hitCanvas,G=H&&H.getContext(),Q=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),U=W&&W.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),U){G.save();var j=this.getAbsoluteTransform(k).getMatrix();return G.transform(j[0],j[1],j[2],j[3],j[4],j[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Q)return this;if(G.save(),G._applyLineJoin(this),!(this===k)){var L=this.getAbsoluteTransform(k).getMatrix();G.transform(L[0],L[1],L[2],L[3],L[4],L[5])}return Q.call(this,G,this),G.restore(),this}drawHitFromCache(x=0){var k=this._getCanvasCache(),M=this._getCachedSceneCanvas(),I=k.hit,H=I.getContext(),G=I.getWidth(),Q=I.getHeight(),W,U,j,A,L,z;H.clear(),H.drawImage(M._canvas,0,0,G,Q);try{for(W=H.getImageData(0,0,G,Q),U=W.data,j=U.length,A=r.Util._hexToRgb(this.colorKey),L=0;L<j;L+=4)z=U[L+3],z>x?(U[L]=A.r,U[L+1]=A.g,U[L+2]=A.b,U[L+3]=255):U[L+3]=0;H.putImageData(W,0,0)}catch(q){r.Util.error("Unable to draw hit graph from cached scene canvas. "+q.message)}return this}hasPointerCapture(x){return l.hasPointerCapture(x,this)}setPointerCapture(x){l.setPointerCapture(x,this)}releaseCapture(x){l.releaseCapture(x,this)}}e.Shape=P,P.prototype._fillFunc=b,P.prototype._strokeFunc=m,P.prototype._fillFuncHit=v,P.prototype._strokeFuncHit=y,P.prototype._centroid=!1,P.prototype.nodeType="Shape",(0,o._registerNode)(P),P.prototype.eventListeners={},P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),n.Factory.addGetterSetter(P,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(P,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(P,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(P,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"lineJoin"),n.Factory.addGetterSetter(P,"lineCap"),n.Factory.addGetterSetter(P,"sceneFunc"),n.Factory.addGetterSetter(P,"hitFunc"),n.Factory.addGetterSetter(P,"dash"),n.Factory.addGetterSetter(P,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(P,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(P,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternImage"),n.Factory.addGetterSetter(P,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(P,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(P,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(P,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(P,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(P,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(P,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(P,"fillEnabled",!0),n.Factory.addGetterSetter(P,"strokeEnabled",!0),n.Factory.addGetterSetter(P,"shadowEnabled",!0),n.Factory.addGetterSetter(P,"dashEnabled",!0),n.Factory.addGetterSetter(P,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(P,"fillPriority","color"),n.Factory.addComponentsGetterSetter(P,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(P,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(P,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(P,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(P,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(P,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(P,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(P,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(P,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(P,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(P,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(P,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(P,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(P,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(P,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(P,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(P,"fillPatternRotation",0),n.Factory.addGetterSetter(P,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(P,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(gr);Object.defineProperty($c,"__esModule",{value:!0});$c.Layer=void 0;const la=Yt,V1=yl,Kl=$t,Dy=ct,F5=gi,oT=qe,lT=gr,sT=ut;var uT="#",cT="beforeDraw",fT="draw",s9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],dT=s9.length;let Ks=class extends V1.Container{constructor(t){super(t),this.canvas=new F5.SceneCanvas,this.hitCanvas=new F5.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),t<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[t+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Kl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Kl.Node.prototype.moveUp.call(this);if(!t)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Kl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Kl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Kl.Node.prototype.remove.call(this),t&&t.parentNode&&la.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:r}){return this.canvas.setSize(t,r),this.hitCanvas.setSize(t,r),this._setSmoothEnabled(),this}_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&la.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Kl.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){la.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){la.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,la.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<dT;i++){const a=s9[i],o=this._getIntersection({x:t.x+a.x*r,y:t.y+a.y*r}),l=o.shape;if(l)return l;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(t){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,i=n[3];if(i===255){const a=la.Util._rgbToHex(n[0],n[1],n[2]),o=lT.shapes[uT+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,r){var n=this.getLayer(),i=t||n&&n.getCanvas();return this._fire(cT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,r),this._fire(fT,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){la.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return la.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return la.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};$c.Layer=Ks;Ks.prototype.nodeType="Layer";(0,sT._registerNode)(Ks);Dy.Factory.addGetterSetter(Ks,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Ks,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Ks,"hitGraphEnabled",!0,(0,oT.getBooleanValidator)());var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.FastLayer=void 0;const hT=Yt,pT=$c,gT=ut;let jy=class extends pT.Layer{constructor(t){super(t),this.listening(!1),hT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ap.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,gT._registerNode)(jy);var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Group=void 0;const vT=Yt,mT=yl,yT=ut;let Fy=class extends mT.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&vT.Util.throw("You may only add groups and shapes to groups.")}};Ys.Group=Fy;Fy.prototype.nodeType="Group";(0,yT._registerNode)(Fy);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.Animation=void 0;const q1=ut,z5=Yt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class zi{constructor(t,r){this.id=zi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=t,this.setLayers(r)}setLayers(t){let r=[];return t&&(r=Array.isArray(t)?t:[t]),this.layers=r,this}getLayers(){return this.layers}addLayer(t){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const r=zi.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),zi._addAnimation(this),this}stop(){return zi._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const r=t.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const t={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(W1());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const h=a[f];h._id!==void 0&&(t[h._id]=h)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=zi;t.animations.length?(t._runFrames(),z5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,z5.Util.requestAnimFrame(this._animationLoop))}}Xs.Animation=zi;zi.animations=[];zi.animIdCounter=0;zi.animRunning=!1;var u9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Yt,r=Xs,n=$t,i=ut;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,h=["fill","stroke","shadowColor"];class E{constructor(S,b,m,v,y,d,g){this.prop=S,this.propFunc=b,this.begin=v,this._pos=v,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=g,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=m,this._change=y-this.begin,this.pause()}fire(S){var b=this[S];b&&b()}setTime(S){S>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():S<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=S,this.update())}getTime(){return this._time}setPosition(S){this.prevPos=this._pos,this.propFunc(S),this._pos=S}getPosition(S){return S===void 0&&(S=this._time),this.func(S,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(S){this.pause(),this._time=S,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var S=this.getTimer()-this._startTime;this.state===l?this.setTime(S):this.state===u&&this.setTime(this.duration-S)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(S){var b=this,m=S.node,v=m._id,y,d=S.easing||e.Easings.Linear,g=!!S.yoyo,_;typeof S.duration>"u"?y=.3:S.duration===0?y=.001:y=S.duration,this.node=m,this._id=f++;var T=m.getLayer()||(m instanceof i.Konva.Stage?m.getLayers():null);T||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){b.tween.onEnterFrame()},T),this.tween=new E(_,function(C){b._tweenFunc(C)},d,0,1,y*1e3,g),this._addListeners(),w.attrs[v]||(w.attrs[v]={}),w.attrs[v][this._id]||(w.attrs[v][this._id]={}),w.tweens[v]||(w.tweens[v]={});for(_ in S)a[_]===void 0&&this._addAttr(_,S[_]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,b){var m=this.node,v=m._id,y,d,g,_,T,C,P,O;if(g=w.tweens[v][S],g&&delete w.attrs[v][g][S],y=m.getAttr(S),t.Util._isArray(b))if(d=[],T=Math.max(b.length,y.length),S==="points"&&b.length!==y.length&&(b.length>y.length?(P=y,y=t.Util._prepareArrayForTween(y,b,m.closed())):(C=b,b=t.Util._prepareArrayForTween(b,y,m.closed()))),S.indexOf("fill")===0)for(_=0;_<T;_++)if(_%2===0)d.push(b[_]-y[_]);else{var x=t.Util.colorToRGBA(y[_]);O=t.Util.colorToRGBA(b[_]),y[_]=x,d.push({r:O.r-x.r,g:O.g-x.g,b:O.b-x.b,a:O.a-x.a})}else for(_=0;_<T;_++)d.push(b[_]-y[_]);else h.indexOf(S)!==-1?(y=t.Util.colorToRGBA(y),O=t.Util.colorToRGBA(b),d={r:O.r-y.r,g:O.g-y.g,b:O.b-y.b,a:O.a-y.a}):d=b-y;w.attrs[v][this._id][S]={start:y,diff:d,end:b,trueEnd:C,trueStart:P},w.tweens[v][S]=this._id}_tweenFunc(S){var b=this.node,m=w.attrs[b._id][this._id],v,y,d,g,_,T,C,P;for(v in m){if(y=m[v],d=y.start,g=y.diff,P=y.end,t.Util._isArray(d))if(_=[],C=Math.max(d.length,P.length),v.indexOf("fill")===0)for(T=0;T<C;T++)T%2===0?_.push((d[T]||0)+g[T]*S):_.push("rgba("+Math.round(d[T].r+g[T].r*S)+","+Math.round(d[T].g+g[T].g*S)+","+Math.round(d[T].b+g[T].b*S)+","+(d[T].a+g[T].a*S)+")");else for(T=0;T<C;T++)_.push((d[T]||0)+g[T]*S);else h.indexOf(v)!==-1?_="rgba("+Math.round(d.r+g.r*S)+","+Math.round(d.g+g.g*S)+","+Math.round(d.b+g.b*S)+","+(d.a+g.a*S)+")":_=d+g*S;b.setAttr(v,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var S=this.node,b=w.attrs[S._id][this._id];b.points&&b.points.trueEnd&&S.setAttr("points",b.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var S=this.node,b=w.attrs[S._id][this._id];b.points&&b.points.trueStart&&S.points(b.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(S){return this.tween.seek(S*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var S=this.node._id,b=this._id,m=w.tweens[S],v;this.pause();for(v in m)delete w.tweens[S][v];delete w.attrs[S][b]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(p){var S=p.onFinish;p.node=this,p.onFinish=function(){this.destroy(),S&&S()};var b=new w(p);b.play()},e.Easings={BackEaseIn(p,S,b,m){var v=1.70158;return b*(p/=m)*p*((v+1)*p-v)+S},BackEaseOut(p,S,b,m){var v=1.70158;return b*((p=p/m-1)*p*((v+1)*p+v)+1)+S},BackEaseInOut(p,S,b,m){var v=1.70158;return(p/=m/2)<1?b/2*(p*p*(((v*=1.525)+1)*p-v))+S:b/2*((p-=2)*p*(((v*=1.525)+1)*p+v)+2)+S},ElasticEaseIn(p,S,b,m,v,y){var d=0;return p===0?S:(p/=m)===1?S+b:(y||(y=m*.3),!v||v<Math.abs(b)?(v=b,d=y/4):d=y/(2*Math.PI)*Math.asin(b/v),-(v*Math.pow(2,10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/y))+S)},ElasticEaseOut(p,S,b,m,v,y){var d=0;return p===0?S:(p/=m)===1?S+b:(y||(y=m*.3),!v||v<Math.abs(b)?(v=b,d=y/4):d=y/(2*Math.PI)*Math.asin(b/v),v*Math.pow(2,-10*p)*Math.sin((p*m-d)*(2*Math.PI)/y)+b+S)},ElasticEaseInOut(p,S,b,m,v,y){var d=0;return p===0?S:(p/=m/2)===2?S+b:(y||(y=m*(.3*1.5)),!v||v<Math.abs(b)?(v=b,d=y/4):d=y/(2*Math.PI)*Math.asin(b/v),p<1?-.5*(v*Math.pow(2,10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/y))+S:v*Math.pow(2,-10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/y)*.5+b+S)},BounceEaseOut(p,S,b,m){return(p/=m)<1/2.75?b*(7.5625*p*p)+S:p<2/2.75?b*(7.5625*(p-=1.5/2.75)*p+.75)+S:p<2.5/2.75?b*(7.5625*(p-=2.25/2.75)*p+.9375)+S:b*(7.5625*(p-=2.625/2.75)*p+.984375)+S},BounceEaseIn(p,S,b,m){return b-e.Easings.BounceEaseOut(m-p,0,b,m)+S},BounceEaseInOut(p,S,b,m){return p<m/2?e.Easings.BounceEaseIn(p*2,0,b,m)*.5+S:e.Easings.BounceEaseOut(p*2-m,0,b,m)*.5+b*.5+S},EaseIn(p,S,b,m){return b*(p/=m)*p+S},EaseOut(p,S,b,m){return-b*(p/=m)*(p-2)+S},EaseInOut(p,S,b,m){return(p/=m/2)<1?b/2*p*p+S:-b/2*(--p*(p-2)-1)+S},StrongEaseIn(p,S,b,m){return b*(p/=m)*p*p*p*p+S},StrongEaseOut(p,S,b,m){return b*((p=p/m-1)*p*p*p*p+1)+S},StrongEaseInOut(p,S,b,m){return(p/=m/2)<1?b/2*p*p*p*p*p+S:b/2*((p-=2)*p*p*p*p+2)+S},Linear(p,S,b,m){return b*p/m+S}}})(u9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ut,r=Yt,n=$t,i=yl,a=a9,o=$c,l=ap,u=Ys,f=np,h=gr,E=Xs,w=u9,p=ma,S=gi;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:E.Animation,Tween:w.Tween,Easings:w.Easings,Context:p.Context,Canvas:S.Canvas}),e.default=e.Konva})(mh);var op={};Object.defineProperty(op,"__esModule",{value:!0});op.Arc=void 0;const lp=ct,bT=gr,B5=ut,sp=qe,_T=ut;let ka=class extends bT.Shape{_sceneFunc(t){var r=B5.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,r,n),t.arc(0,0,this.innerRadius(),r,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=B5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),h=o*r,E=l*(l>0?t:r),w=u*(u>0?r:t);return{x:f,y:n?-1*w:E,width:h-f,height:w-E}}};op.Arc=ka;ka.prototype._centroid=!0;ka.prototype.className="Arc";ka.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_T._registerNode)(ka);lp.Factory.addGetterSetter(ka,"innerRadius",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(ka,"outerRadius",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(ka,"angle",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(ka,"clockwise",!1,(0,sp.getBooleanValidator)());var up={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Line=void 0;const cp=ct,wT=gr,c9=qe,ST=ut;function sm(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),h=o*u/(l+u),E=r-f*(i-e),w=n-f*(a-t),p=r+h*(i-e),S=n+h*(a-t);return[E,w,p,S]}function U5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=sm(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(e[i]),n.push(e[i+1]),n.push(a[2]),n.push(a[3]));return n}let Eo=class extends wT.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(t.beginPath(),t.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)t.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||t.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)t.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)t.lineTo(r[f],r[f+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():U5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=sm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=sm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=U5(t,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],t[r-2],t[r-1],a[2],a[3],i[0],i[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);return{x:r,y:i,width:n-r,height:a-i}}};Gc.Line=Eo;Eo.prototype.className="Line";Eo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,ST._registerNode)(Eo);cp.Factory.addGetterSetter(Eo,"closed",!1);cp.Factory.addGetterSetter(Eo,"bezier",!1);cp.Factory.addGetterSetter(Eo,"tension",0,(0,c9.getNumberValidator)());cp.Factory.addGetterSetter(Eo,"points",[],(0,c9.getNumberArrayValidator)());var Zs={},f9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,h,E;f=u/2,h=0;for(let p=0;p<20;p++)E=f*e.tValues[20][p]+f,h+=e.cValues[20][p]*n(o,l,E);return f*h};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],E=2*o[1]-2*o[0],w=2*l[1]-2*l[0],p=4*(f*f+h*h),S=4*(f*E+h*w),b=E*E+w*w;if(p===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const m=S/(2*p),v=b/p,y=u+m,d=v-m*m,g=y*y+d>0?Math.sqrt(y*y+d):0,_=m*m+d>0?Math.sqrt(m*m+d):0,T=m+Math.sqrt(m*m+d)!==0?d*Math.log(Math.abs((y+g)/(m+_))):0;return Math.sqrt(p)/2*(y*g-m*_+T)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),h=i(1,u,l),E=f*f+h*h;return Math.sqrt(E)}const i=(o,l,u)=>{const f=u.length-1;let h,E;if(f===0)return 0;if(o===0){E=0;for(let w=0;w<=f;w++)E+=e.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*u[w];return E}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(u[w+1]-u[w]);return i(o-1,l,h)}},a=(o,l,u)=>{let f=1,h=o/l,E=(o-u(h))/l,w=0;for(;f>.001;){const p=u(h+E),S=Math.abs(o-p)/l;if(S<f)f=S,h+=E;else{const b=u(h-E),m=Math.abs(o-b)/l;m<f?(f=m,h-=E):E/=2}if(w++,w>500)break}return h};e.t2length=a})(f9);Object.defineProperty(Zs,"__esModule",{value:!0});Zs.Path=void 0;const ET=ct,OT=gr,xT=ut,Yl=f9;let Vc=class on extends OT.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=on.parsePathData(this.data()),this.pathLength=on.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],h=o[3],E=o[4],w=o[5],p=o[6],S=o[7],b=f>h?f:h,m=f>h?1:f/h,v=f>h?h/f:1;t.translate(l,u),t.rotate(p),t.scale(m,v),t.arc(0,0,b,E,E+w,1-S),t.scale(1/m,1/v),t.rotate(-p),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var h=f.points[4],E=f.points[5],w=f.points[4]+E,p=Math.PI/180;if(Math.abs(h-w)<p&&(p=Math.abs(h-w)),E<0)for(let S=h-p;S>w;S-=p){const b=on.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],S,0);t.push(b.x,b.y)}else for(let S=h+p;S<w;S+=p){const b=on.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],S,0);t.push(b.x,b.y)}}else if(f.command==="C")for(let S=0;S<=1;S+=.01){const b=on.getPointOnCubicBezier(S,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(b.x,b.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return on.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return on.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return on.getPointOnCubicBezier((0,Yl.t2length)(t,on.getPathLength(r),b=>(0,Yl.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],b)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return on.getPointOnQuadraticBezier((0,Yl.t2length)(t,on.getPathLength(r),b=>(0,Yl.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],b)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],h=l[2],E=l[3],w=l[4],p=l[5],S=l[6];return w+=p*t/o.pathLength,on.getPointOnEllipticalArc(u,f,h,E,w,S)}return null}static getPointOnLine(t,r,n,i,a,o,l){o=o??r,l=l??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:l+(a>n?t:-t)};const f=(a-n)/(i-r),h=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),E=f*h;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+h,y:l+E};const w=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),p=r+w*(i-r),S=n+w*(a-n),b=this.getLineLength(o,l,p,S),m=Math.sqrt(t*t-b*b),v=Math.sqrt(m*m/(1+f*f))*(i<r?-1:1),y=f*v;return{x:p+v,y:S+y}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function h(m){return m*m*m}function E(m){return 3*m*m*(1-m)}function w(m){return 3*m*(1-m)*(1-m)}function p(m){return(1-m)*(1-m)*(1-m)}var S=u*h(t)+o*E(t)+i*w(t)+r*p(t),b=f*h(t)+l*E(t)+a*w(t)+n*p(t);return{x:S,y:b}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(p){return p*p}function f(p){return 2*p*(1-p)}function h(p){return(1-p)*(1-p)}var E=o*u(t)+i*f(t)+r*h(t),w=l*u(t)+a*f(t)+n*h(t);return{x:E,y:w}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,E;for(i=1;i<a.length;i++){var w=a[i],p=w.charAt(0);for(w=w.slice(1),l.length=0;E=h.exec(w);)l.push(E[0]);for(var S=[],b=0,m=l.length;b<m;b++){if(l[b]==="00"){S.push(0,0);continue}var v=parseFloat(l[b]);isNaN(v)?S.push(0):S.push(v)}for(;S.length>0&&!isNaN(S[0]);){var y="",d=[],g=u,_=f,T,C,P,O,x,k,M,I,H,G;switch(p){case"l":u+=S.shift(),f+=S.shift(),y="L",d.push(u,f);break;case"L":u=S.shift(),f=S.shift(),d.push(u,f);break;case"m":var Q=S.shift(),W=S.shift();if(u+=Q,f+=W,y="M",o.length>2&&o[o.length-1].command==="z"){for(var U=o.length-2;U>=0;U--)if(o[U].command==="M"){u=o[U].points[0]+Q,f=o[U].points[1]+W;break}}d.push(u,f),p="l";break;case"M":u=S.shift(),f=S.shift(),y="M",d.push(u,f),p="L";break;case"h":u+=S.shift(),y="L",d.push(u,f);break;case"H":u=S.shift(),y="L",d.push(u,f);break;case"v":f+=S.shift(),y="L",d.push(u,f);break;case"V":f=S.shift(),y="L",d.push(u,f);break;case"C":d.push(S.shift(),S.shift(),S.shift(),S.shift()),u=S.shift(),f=S.shift(),d.push(u,f);break;case"c":d.push(u+S.shift(),f+S.shift(),u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),y="C",d.push(u,f);break;case"S":C=u,P=f,T=o[o.length-1],T.command==="C"&&(C=u+(u-T.points[2]),P=f+(f-T.points[3])),d.push(C,P,S.shift(),S.shift()),u=S.shift(),f=S.shift(),y="C",d.push(u,f);break;case"s":C=u,P=f,T=o[o.length-1],T.command==="C"&&(C=u+(u-T.points[2]),P=f+(f-T.points[3])),d.push(C,P,u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),y="C",d.push(u,f);break;case"Q":d.push(S.shift(),S.shift()),u=S.shift(),f=S.shift(),d.push(u,f);break;case"q":d.push(u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),y="Q",d.push(u,f);break;case"T":C=u,P=f,T=o[o.length-1],T.command==="Q"&&(C=u+(u-T.points[0]),P=f+(f-T.points[1])),u=S.shift(),f=S.shift(),y="Q",d.push(C,P,u,f);break;case"t":C=u,P=f,T=o[o.length-1],T.command==="Q"&&(C=u+(u-T.points[0]),P=f+(f-T.points[1])),u+=S.shift(),f+=S.shift(),y="Q",d.push(C,P,u,f);break;case"A":O=S.shift(),x=S.shift(),k=S.shift(),M=S.shift(),I=S.shift(),H=u,G=f,u=S.shift(),f=S.shift(),y="A",d=this.convertEndpointToCenterParameterization(H,G,u,f,M,I,O,x,k);break;case"a":O=S.shift(),x=S.shift(),k=S.shift(),M=S.shift(),I=S.shift(),H=u,G=f,u+=S.shift(),f+=S.shift(),y="A",d=this.convertEndpointToCenterParameterization(H,G,u,f,M,I,O,x,k);break}o.push({command:y||p,points:d,start:{x:g,y:_},pathLength:this.calcLength(g,_,y||p,d)})}(p==="z"||p==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=on;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,Yl.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Yl.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var h=i[4],E=i[5],w=i[4]+E,p=Math.PI/180;if(Math.abs(h-w)<p&&(p=Math.abs(h-w)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),E<0)for(u=h-p;u>w;u-=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=h+p;u<w;u+=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var h=f*(Math.PI/180),E=Math.cos(h)*(t-n)/2+Math.sin(h)*(r-i)/2,w=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(r-i)/2,p=E*E/(l*l)+w*w/(u*u);p>1&&(l*=Math.sqrt(p),u*=Math.sqrt(p));var S=Math.sqrt((l*l*(u*u)-l*l*(w*w)-u*u*(E*E))/(l*l*(w*w)+u*u*(E*E)));a===o&&(S*=-1),isNaN(S)&&(S=0);var b=S*l*w/u,m=S*-u*E/l,v=(t+n)/2+Math.cos(h)*b-Math.sin(h)*m,y=(r+i)/2+Math.sin(h)*b+Math.cos(h)*m,d=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},g=function(x,k){return(x[0]*k[0]+x[1]*k[1])/(d(x)*d(k))},_=function(x,k){return(x[0]*k[1]<x[1]*k[0]?-1:1)*Math.acos(g(x,k))},T=_([1,0],[(E-b)/l,(w-m)/u]),C=[(E-b)/l,(w-m)/u],P=[(-1*E-b)/l,(-1*w-m)/u],O=_(C,P);return g(C,P)<=-1&&(O=Math.PI),g(C,P)>=1&&(O=0),o===0&&O>0&&(O=O-2*Math.PI),o===1&&O<0&&(O=O+2*Math.PI),[v,y,l,u,T,O,h,o]}};Zs.Path=Vc;Vc.prototype.className="Path";Vc.prototype._attrsAffectingSize=["data"];(0,xT._registerNode)(Vc);ET.Factory.addGetterSetter(Vc,"data");Object.defineProperty(up,"__esModule",{value:!0});up.Arrow=void 0;const fp=ct,PT=Gc,d9=qe,CT=ut,H5=Zs;let _l=class extends PT.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],p=H5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),S=H5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/p),w[0],w[1],w[2],w[3],w[4],w[5]);u=n[l-2]-S.x,f=n[l-1]-S.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var h=(Math.atan2(f,u)+r)%r,E=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,E/2),t.lineTo(-o,-E/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,E/2),t.lineTo(-o,-E/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};up.Arrow=_l;_l.prototype.className="Arrow";(0,CT._registerNode)(_l);fp.Factory.addGetterSetter(_l,"pointerLength",10,(0,d9.getNumberValidator)());fp.Factory.addGetterSetter(_l,"pointerWidth",10,(0,d9.getNumberValidator)());fp.Factory.addGetterSetter(_l,"pointerAtBeginning",!1);fp.Factory.addGetterSetter(_l,"pointerAtEnding",!0);var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Circle=void 0;const kT=ct,TT=gr,AT=qe,RT=ut;let Qs=class extends TT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};dp.Circle=Qs;Qs.prototype._centroid=!0;Qs.prototype.className="Circle";Qs.prototype._attrsAffectingSize=["radius"];(0,RT._registerNode)(Qs);kT.Factory.addGetterSetter(Qs,"radius",0,(0,AT.getNumberValidator)());var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Ellipse=void 0;const zy=ct,MT=gr,h9=qe,LT=ut;let Oo=class extends MT.Shape{_sceneFunc(t){var r=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),r!==n&&t.scale(1,n/r),t.arc(0,0,r,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};hp.Ellipse=Oo;Oo.prototype.className="Ellipse";Oo.prototype._centroid=!0;Oo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,LT._registerNode)(Oo);zy.Factory.addComponentsGetterSetter(Oo,"radius",["x","y"]);zy.Factory.addGetterSetter(Oo,"radiusX",0,(0,h9.getNumberValidator)());zy.Factory.addGetterSetter(Oo,"radiusY",0,(0,h9.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Image=void 0;const K1=Yt,wl=ct,NT=gr,IT=ut,qc=qe;let Zi=class p9 extends NT.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?o=[a,this.cropX(),this.cropY(),l,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var r=this.width(),n=this.height(),i=this.cornerRadius();t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,r;return(t=this.attrs.width)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var t,r;return(t=this.attrs.height)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(t,r,n=null){var i=K1.Util.createImageElement();i.onload=function(){var a=new p9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};pp.Image=Zi;Zi.prototype.className="Image";(0,IT._registerNode)(Zi);wl.Factory.addGetterSetter(Zi,"cornerRadius",0,(0,qc.getNumberOrArrayOfNumbersValidator)(4));wl.Factory.addGetterSetter(Zi,"image");wl.Factory.addComponentsGetterSetter(Zi,"crop",["x","y","width","height"]);wl.Factory.addGetterSetter(Zi,"cropX",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropY",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropWidth",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Zi,"cropHeight",0,(0,qc.getNumberValidator)());var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Tag=Ls.Label=void 0;const gp=ct,DT=gr,jT=Ys,By=qe,g9=ut;var v9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],FT="Change.konva",zT="none",um="up",cm="right",fm="down",dm="left",BT=v9.length;let Uy=class extends jT.Group{constructor(t){super(t),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var r=this,n,i=function(){r._sync()};for(n=0;n<BT;n++)t.on(v9[n]+FT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case um:l=n/2,u=-1*f;break;case cm:l=n+o,u=i/2;break;case fm:l=n/2,u=i+f;break;case dm:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),t.setAttrs({x:-1*l,y:-1*u})}}};Ls.Label=Uy;Uy.prototype.className="Label";(0,g9._registerNode)(Uy);let Sl=class extends DT.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,h=0,E=0;typeof l=="number"?u=f=h=E=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),E=Math.min(l[2]||0,r/2,n/2),h=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===um&&(t.lineTo((r-a)/2,0),t.lineTo(r/2,-1*o),t.lineTo((r+a)/2,0)),t.lineTo(r-f,0),t.arc(r-f,f,f,Math.PI*3/2,0,!1),i===cm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-E),t.arc(r-E,n-E,E,0,Math.PI/2,!1),i===fm&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(h,n),t.arc(h,n-h,h,Math.PI/2,Math.PI,!1),i===dm&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*a,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===um?(r-=i,l+=i):a===fm?l+=i:a===dm?(t-=n*1.5,o+=n):a===cm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};Ls.Tag=Sl;Sl.prototype.className="Tag";(0,g9._registerNode)(Sl);gp.Factory.addGetterSetter(Sl,"pointerDirection",zT);gp.Factory.addGetterSetter(Sl,"pointerWidth",0,(0,By.getNumberValidator)());gp.Factory.addGetterSetter(Sl,"pointerHeight",0,(0,By.getNumberValidator)());gp.Factory.addGetterSetter(Sl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Wc={};Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Rect=void 0;const UT=ct,HT=gr,$T=ut,GT=Yt,VT=qe;let vp=class extends HT.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?GT.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Wc.Rect=vp;vp.prototype.className="Rect";(0,$T._registerNode)(vp);UT.Factory.addGetterSetter(vp,"cornerRadius",0,(0,VT.getNumberOrArrayOfNumbersValidator)(4));var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.RegularPolygon=void 0;const m9=ct,qT=gr,y9=qe,WT=ut;let El=class extends qT.Shape{_sceneFunc(t){const r=this._getPoints();t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)t.lineTo(r[n].x,r[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<t;i++)n.push({x:r*Math.sin(i*2*Math.PI/t),y:-1*r*Math.cos(i*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var r=t[0].x,n=t[0].y,i=t[0].x,a=t[0].y;return t.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};mp.RegularPolygon=El;El.prototype.className="RegularPolygon";El.prototype._centroid=!0;El.prototype._attrsAffectingSize=["radius"];(0,WT._registerNode)(El);m9.Factory.addGetterSetter(El,"radius",0,(0,y9.getNumberValidator)());m9.Factory.addGetterSetter(El,"sides",0,(0,y9.getNumberValidator)());var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Ring=void 0;const b9=ct,KT=gr,_9=qe,YT=ut;var $5=Math.PI*2;let Ol=class extends KT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,$5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),$5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};yp.Ring=Ol;Ol.prototype.className="Ring";Ol.prototype._centroid=!0;Ol.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,YT._registerNode)(Ol);b9.Factory.addGetterSetter(Ol,"innerRadius",0,(0,_9.getNumberValidator)());b9.Factory.addGetterSetter(Ol,"outerRadius",0,(0,_9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Sprite=void 0;const xl=ct,XT=gr,ZT=Xs,w9=qe,QT=ut;let Qi=class extends XT.Shape{constructor(t){super(t),this._updated=!0,this.anim=new ZT.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],h=a[i+3],E=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,h),t.closePath(),t.fillStrokeShape(this)),E)if(o){var w=o[r],p=n*2;t.drawImage(E,l,u,f,h,w[p+0],w[p+1],f,h)}else t.drawImage(E,l,u,f,h,0,0,f,h)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],h=n*2;t.rect(f[h+0],f[h+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};bp.Sprite=Qi;Qi.prototype.className="Sprite";(0,QT._registerNode)(Qi);xl.Factory.addGetterSetter(Qi,"animation");xl.Factory.addGetterSetter(Qi,"animations");xl.Factory.addGetterSetter(Qi,"frameOffsets");xl.Factory.addGetterSetter(Qi,"image");xl.Factory.addGetterSetter(Qi,"frameIndex",0,(0,w9.getNumberValidator)());xl.Factory.addGetterSetter(Qi,"frameRate",17,(0,w9.getNumberValidator)());xl.Factory.backCompat(Qi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Star=void 0;const Hy=ct,JT=gr,$y=qe,eA=ut;let xo=class extends JT.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};_p.Star=xo;xo.prototype.className="Star";xo.prototype._centroid=!0;xo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,eA._registerNode)(xo);Hy.Factory.addGetterSetter(xo,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"outerRadius",0,(0,$y.getNumberValidator)());var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.Text=dl.stringToArray=void 0;const hm=Yt,Gr=ct,tA=gr,Y1=ut,Po=qe,rA=ut;function S9(e){return Array.from(e)}dl.stringToArray=S9;var Xl="auto",nA="center",E9="inherit",Lu="justify",iA="Change.konva",aA="2d",G5="-",O9="left",oA="text",lA="Text",sA="top",uA="bottom",V5="middle",x9="normal",cA="px ",vd=" ",fA="right",q5="rtl",dA="word",hA="char",W5="none",X1="…",P9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],pA=P9.length;function gA(e){return e.split(",").map(t=>{t=t.trim();const r=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return r&&!n&&(t=`"${t}"`),t}).join(", ")}var md;function Z1(){return md||(md=hm.Util.createCanvasElement().getContext(aA),md)}function vA(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function mA(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function yA(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Jt=class extends tA.Shape{constructor(t){super(yA(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<pA;r++)this.on(P9[r]+iA,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,h=this.align(),E=this.getWidth(),w=this.letterSpacing(),p=this.fill(),S=this.textDecoration(),b=S.indexOf("underline")!==-1,m=S.indexOf("line-through")!==-1,v;u=u===E9?t.direction:u;var y=o/2,d=V5;if(Y1.Konva._fixTextRendering){var g=this.measureSize("M");d="alphabetic",y=(g.fontBoundingBoxAscent-g.fontBoundingBoxDescent)/2+o/2}var _=0,T=0;for(u===q5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",O9),l===V5?f=(this.getHeight()-n*o-i*2)/2:l===uA&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),v=0;v<n;v++){var _=0,T=0,C=r[v],P=C.text,O=C.width,x=C.lastInParagraph,k,M,I;if(t.save(),h===fA?_+=E-O-i*2:h===nA&&(_+=(E-O-i*2)/2),b){t.save(),t.beginPath();let j=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const A=_,L=y+T+j;t.moveTo(A,L),k=P.split(" ").length-1,M=k===0,I=h===Lu&&!x?E-i*2:O,t.lineTo(A+Math.round(I),L),t.lineWidth=a/15;const z=this._getLinearGradient();t.strokeStyle=z||p,t.stroke(),t.restore()}if(m){t.save(),t.beginPath();let j=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(_,y+T+j),k=P.split(" ").length-1,M=k===0,I=h===Lu&&x&&!M?E-i*2:O,t.lineTo(_+Math.round(I),y+T+j),t.lineWidth=a/15;const A=this._getLinearGradient();t.strokeStyle=A||p,t.stroke(),t.restore()}if(u!==q5&&(w!==0||h===Lu)){k=P.split(" ").length-1;for(var H=S9(P),G=0;G<H.length;G++){var Q=H[G];Q===" "&&!x&&h===Lu&&(_+=(E-i*2-O)/k),this._partialTextX=_,this._partialTextY=y+T,this._partialText=Q,t.fillStrokeShape(this),_+=this.measureSize(Q).width+w}}else w!==0&&t.setAttr("letterSpacing",`${w}px`),this._partialTextX=_,this._partialTextY=y+T,this._partialText=P,t.fillStrokeShape(this);t.restore(),n>1&&(y+=o)}}}_hitFunc(t){var r=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var r=hm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(oA,r),this}getWidth(){var t=this.attrs.width===Xl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Xl||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var r,n,i,a,o,l,u,f,h,E,w,p=Z1(),S=this.fontSize(),b;p.save(),p.font=this._getContextFont(),b=p.measureText(t),p.restore();const m=S/100;return{actualBoundingBoxAscent:(r=b.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*m,actualBoundingBoxDescent:(n=b.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=b.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*m,actualBoundingBoxRight:(a=b.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*m,alphabeticBaseline:(o=b.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(l=b.emHeightAscent)!==null&&l!==void 0?l:100*m,emHeightDescent:(u=b.emHeightDescent)!==null&&u!==void 0?u:-20*m,fontBoundingBoxAscent:(f=b.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*m,fontBoundingBoxDescent:(h=b.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*m,hangingBaseline:(E=b.hangingBaseline)!==null&&E!==void 0?E:72.80000305175781*m,ideographicBaseline:(w=b.ideographicBaseline)!==null&&w!==void 0?w:-21*m,width:b.width,height:S}}_getContextFont(){return this.fontStyle()+vd+this.fontVariant()+vd+(this.fontSize()+cA)+gA(this.fontFamily())}_addTextLine(t){this.align()===Lu&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var r=this.letterSpacing(),n=t.length;return Z1().measureText(t).width+(n?r*(n-1):0)}_setTextData(){var t=this.text().split(`
43
- `),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Xl&&a!==void 0,u=o!==Xl&&o!==void 0,f=this.padding(),h=a-f*2,E=o-f*2,w=0,p=this.wrap(),S=p!==W5,b=p!==hA&&S,m=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var v=m?this._getTextWidth(X1):0,y=0,d=t.length;y<d;++y){var g=t[y],_=this._getTextWidth(g);if(l&&_>h)for(;g.length>0;){for(var T=0,C=g.length,P="",O=0;T<C;){var x=T+C>>>1,k=g.slice(0,x+1),M=this._getTextWidth(k)+v;M<=h?(T=x+1,P=k,O=M):C=x}if(P){if(b){var I,H=g[P.length],G=H===vd||H===G5;G&&O<=h?I=P.length:I=Math.max(P.lastIndexOf(vd),P.lastIndexOf(G5))+1,I>0&&(T=I,P=P.slice(0,T),O=this._getTextWidth(P))}P=P.trimRight(),this._addTextLine(P),n=Math.max(n,O),w+=i;var Q=this._shouldHandleEllipsis(w);if(Q){this._tryToAddEllipsisToLastLine();break}if(g=g.slice(T),g=g.trimLeft(),g.length>0&&(_=this._getTextWidth(g),_<=h)){this._addTextLine(g),w+=i,n=Math.max(n,_);break}}else break}else this._addTextLine(g),w+=i,n=Math.max(n,_),this._shouldHandleEllipsis(w)&&y<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&w+i>E)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Xl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==W5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Xl&&t!==void 0,n=this.padding(),i=t-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+X1)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+X1)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return t&&r?!0:super._useBufferCanvas()}};dl.Text=Jt;Jt.prototype._fillFunc=vA;Jt.prototype._strokeFunc=mA;Jt.prototype.className=lA;Jt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,rA._registerNode)(Jt);Gr.Factory.overWriteSetter(Jt,"width",(0,Po.getNumberOrAutoValidator)());Gr.Factory.overWriteSetter(Jt,"height",(0,Po.getNumberOrAutoValidator)());Gr.Factory.addGetterSetter(Jt,"direction",E9);Gr.Factory.addGetterSetter(Jt,"fontFamily","Arial");Gr.Factory.addGetterSetter(Jt,"fontSize",12,(0,Po.getNumberValidator)());Gr.Factory.addGetterSetter(Jt,"fontStyle",x9);Gr.Factory.addGetterSetter(Jt,"fontVariant",x9);Gr.Factory.addGetterSetter(Jt,"padding",0,(0,Po.getNumberValidator)());Gr.Factory.addGetterSetter(Jt,"align",O9);Gr.Factory.addGetterSetter(Jt,"verticalAlign",sA);Gr.Factory.addGetterSetter(Jt,"lineHeight",1,(0,Po.getNumberValidator)());Gr.Factory.addGetterSetter(Jt,"wrap",dA);Gr.Factory.addGetterSetter(Jt,"ellipsis",!1,(0,Po.getBooleanValidator)());Gr.Factory.addGetterSetter(Jt,"letterSpacing",0,(0,Po.getNumberValidator)());Gr.Factory.addGetterSetter(Jt,"text","",(0,Po.getStringValidator)());Gr.Factory.addGetterSetter(Jt,"textDecoration","");var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.TextPath=void 0;const Q1=Yt,_i=ct,bA=gr,Nu=Zs,J1=dl,C9=qe,_A=ut;var wA="",k9="normal";function T9(e){e.fillText(this.partialText,0,0)}function A9(e){e.strokeText(this.partialText,0,0)}let vr=class extends bA.Shape{constructor(t){super(t),this.dummyCanvas=Q1.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Nu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Nu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Nu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&t.beginPath();for(var o=0;o<a.length;o++){t.save();var l=a[o].p0;t.translate(l.x,l.y),t.rotate(a[o].rotation),this.partialText=a[o].text,t.fillStrokeShape(this),r==="underline"&&(o===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}r==="underline"&&(t.strokeStyle=n,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;t.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;t.lineTo(a.x,a.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Q1.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return J1.Text.prototype.setText.call(this,t)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(t){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(t);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),i=this.align(),a=this.kerningFunc(),o=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-o/2)),i==="right"&&(l=Math.max(0,this.pathLength-o));const u=(0,J1.stringToArray)(this.text());let f=l;for(var h=0;h<u.length;h++){const E=this._getPointAtLength(f);if(!E)return;let w=this._getTextSize(u[h]).width+n;if(u[h]===" "&&i==="justify"){const y=this.text().split(" ").length-1;w+=(this.pathLength-o)/y}const p=this._getPointAtLength(f+w);if(!p)return;const S=Nu.Path.getLineLength(E.x,E.y,p.x,p.y);let b=0;if(a)try{b=a(u[h-1],u[h])*this.fontSize()}catch{b=0}E.x+=b,p.x+=b,this.textWidth+=b;const m=Nu.Path.getPointOnLine(b+S/2,E.x,E.y,p.x,p.y),v=Math.atan2(p.y-E.y,p.x-E.x);this.glyphInfo.push({transposeX:m.x,transposeY:m.y,text:u[h],rotation:v,p0:E,p1:p}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};wp.TextPath=vr;vr.prototype._fillFunc=T9;vr.prototype._strokeFunc=A9;vr.prototype._fillFuncHit=T9;vr.prototype._strokeFuncHit=A9;vr.prototype.className="TextPath";vr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,_A._registerNode)(vr);_i.Factory.addGetterSetter(vr,"data");_i.Factory.addGetterSetter(vr,"fontFamily","Arial");_i.Factory.addGetterSetter(vr,"fontSize",12,(0,C9.getNumberValidator)());_i.Factory.addGetterSetter(vr,"fontStyle",k9);_i.Factory.addGetterSetter(vr,"align","left");_i.Factory.addGetterSetter(vr,"letterSpacing",0,(0,C9.getNumberValidator)());_i.Factory.addGetterSetter(vr,"textBaseline","middle");_i.Factory.addGetterSetter(vr,"fontVariant",k9);_i.Factory.addGetterSetter(vr,"text",wA);_i.Factory.addGetterSetter(vr,"textDecoration",null);_i.Factory.addGetterSetter(vr,"kerningFunc",null);var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Transformer=void 0;const kt=Yt,Et=ct,K5=$t,SA=gr,EA=Wc,Y5=Ys,ai=ut,Co=qe,OA=ut;var R9="tr-konva",xA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${R9}`).join(" "),X5="nodesRect",PA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],CA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const kA="ontouchstart"in ai.Konva._global;function TA(e,t,r){if(e==="rotater")return r;t+=kt.Util.degToRad(CA[e]||0);var n=(kt.Util.radToDeg(t)%360+360)%360;return kt.Util._inRange(n,315+22.5,360)||kt.Util._inRange(n,0,22.5)?"ns-resize":kt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":kt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":kt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":kt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":kt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":kt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":kt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(kt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var bh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Z5=1e8;function AA(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function M9(e,t,r){const n=r.x+(e.x-r.x)*Math.cos(t)-(e.y-r.y)*Math.sin(t),i=r.y+(e.x-r.x)*Math.sin(t)+(e.y-r.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:i}}function RA(e,t){const r=AA(e);return M9(e,t,r)}function MA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=ai.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let pm=0,vt=class extends Y5.Group{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(xA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return kt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return R9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(kt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=r,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(o,a),i.on(PA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let r;t.on(`dragstart.${this._getEventNamespace()}`,n=>{r=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=t.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===t||l.isDragging())return;const u=l.getAbsolutePosition();l.setAbsolutePosition({x:u.x+a,y:u.y+o}),l.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(X5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(X5,this.__getNodeRect)}__getNodeShape(t,r=this.rotation(),n){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),l=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y;const f=(ai.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return M9(h,-ai.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Z5,y:-Z5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var E=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],w=f.getAbsoluteTransform();E.forEach(function(p){var S=w.point(p);r.push(S)})});const n=new kt.Transform;n.rotate(-ai.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var h=n.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:ai.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),bh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new EA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:kA?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{var i=ai.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=TA(t,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var t=new SA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,n){var i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*kt.Util._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",r=>{r.cancelBubble=!0}),t.on("dragmove",r=>{r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(t){if(!this._transforming){this._movingAnchorName=t.target.name().split(" ")[0];var r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var o=t.target.getAbsolutePosition(),l=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},pm++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const h=a.getAbsolutePosition();if(!(f.x===h.x&&f.y===h.y)){if(this._movingAnchorName==="rotater"){var E=this._getNodeRect();r=a.x()-E.width/2,n=-a.y()+E.height/2;let I=Math.atan2(-n,r)+Math.PI/2;E.height<0&&(I-=Math.PI);var w=ai.Konva.getAngle(this.rotation());const H=w+I,G=ai.Konva.getAngle(this.rotationSnapTolerance()),W=MA(this.rotationSnaps(),H,G)-E.rotation,U=RA(E,W);this._fitNodesInto(U,t);return}var p=this.shiftBehavior(),S;p==="inverted"?S=this.keepRatio()&&!t.shiftKey:p==="none"?S=this.keepRatio():S=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(S){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-a.x(),2)+Math.pow(b.y-a.y(),2));var m=this.findOne(".top-left").x()>b.x?-1:1,v=this.findOne(".top-left").y()>b.y?-1:1;r=i*this.cos*m,n=i*this.sin*v,this.findOne(".top-left").x(b.x-r),this.findOne(".top-left").y(b.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(S){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-b.x,2)+Math.pow(b.y-a.y(),2));var m=this.findOne(".top-right").x()<b.x?-1:1,v=this.findOne(".top-right").y()>b.y?-1:1;r=i*this.cos*m,n=i*this.sin*v,this.findOne(".top-right").x(b.x+r),this.findOne(".top-right").y(b.y-n)}var y=a.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(S){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-a.x(),2)+Math.pow(a.y()-b.y,2));var m=b.x<a.x()?-1:1,v=a.y()<b.y?-1:1;r=i*this.cos*m,n=i*this.sin*v,a.x(b.x-r),a.y(b.y+n)}y=a.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(S){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-b.x,2)+Math.pow(a.y()-b.y,2));var m=this.findOne(".bottom-right").x()<b.x?-1:1,v=this.findOne(".bottom-right").y()<b.y?-1:1;r=i*this.cos*m,n=i*this.sin*v,this.findOne(".bottom-right").x(b.x+r),this.findOne(".bottom-right").y(b.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var g=this.findOne(".top-left"),_=this.findOne(".bottom-right"),T=g.x(),C=g.y(),P=this.getWidth()-_.x(),O=this.getHeight()-_.y();_.move({x:-T,y:-C}),g.move({x:P,y:O})}var x=this.findOne(".top-left").getAbsolutePosition();r=x.x,n=x.y;var k=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),M=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:k,height:M,rotation:ai.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();pm--,this._fire("transformend",{evt:t,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,r){var n=this._getNodeRect();const i=1;if(kt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(kt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new kt.Transform;if(a.rotate(ai.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=a.point({x:-this.padding()*2,y:0});t.x+=w.x,t.y+=w.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=a.point({x:0,y:-this.padding()*2});t.x+=w.x,t.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(n,t);w?t=w:kt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new kt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new kt.Transform,f=t.width/o,h=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(h))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,h));const E=u.multiply(l.invert());this._nodes.forEach(w=>{var p;const S=w.getParent().getAbsoluteTransform(),b=w.getTransform().copy();b.translate(w.offsetX(),w.offsetY());const m=new kt.Transform;m.multiply(S.copy().invert()).multiply(E).multiply(S).multiply(b);const v=m.decompose();w.setAttrs(v),(p=w.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(kt.Util._getRotation(t.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:r,target:w}),w._fire("transform",{evt:r,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(kt.Util._getRotation(r.rotation));var n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),u=this.anchorSize();const f=this.find("._anchor");f.forEach(E=>{E.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*kt.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const h=this.anchorStyleFunc();h&&f.forEach(E=>{h(E)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Y5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return K5.Node.prototype.toObject.call(this)}clone(t){var r=K5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Sp.Transformer=vt;vt.isTransforming=()=>pm>0;function LA(e){return e instanceof Array||kt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){bh.indexOf(t)===-1&&kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+bh.join(", "))}),e||[]}vt.prototype.className="Transformer";(0,OA._registerNode)(vt);Et.Factory.addGetterSetter(vt,"enabledAnchors",bh,LA);Et.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,Co.getBooleanValidator)());Et.Factory.addGetterSetter(vt,"resizeEnabled",!0);Et.Factory.addGetterSetter(vt,"anchorSize",10,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"rotateEnabled",!0);Et.Factory.addGetterSetter(vt,"rotateLineVisible",!0);Et.Factory.addGetterSetter(vt,"rotationSnaps",[]);Et.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");Et.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderEnabled",!0);Et.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"anchorFill","white");Et.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderDash");Et.Factory.addGetterSetter(vt,"keepRatio",!0);Et.Factory.addGetterSetter(vt,"shiftBehavior","default");Et.Factory.addGetterSetter(vt,"centeredScaling",!1);Et.Factory.addGetterSetter(vt,"ignoreStroke",!1);Et.Factory.addGetterSetter(vt,"padding",0,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"node");Et.Factory.addGetterSetter(vt,"nodes");Et.Factory.addGetterSetter(vt,"boundBoxFunc");Et.Factory.addGetterSetter(vt,"anchorDragBoundFunc");Et.Factory.addGetterSetter(vt,"anchorStyleFunc");Et.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);Et.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);Et.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Wedge=void 0;const Op=ct,NA=gr,IA=ut,L9=qe,DA=ut;let Ta=class extends NA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,IA.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};Ep.Wedge=Ta;Ta.prototype.className="Wedge";Ta.prototype._centroid=!0;Ta.prototype._attrsAffectingSize=["radius"];(0,DA._registerNode)(Ta);Op.Factory.addGetterSetter(Ta,"radius",0,(0,L9.getNumberValidator)());Op.Factory.addGetterSetter(Ta,"angle",0,(0,L9.getNumberValidator)());Op.Factory.addGetterSetter(Ta,"clockwise",!1);Op.Factory.backCompat(Ta,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Blur=void 0;const Q5=ct,jA=$t,FA=qe;function J5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var zA=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],BA=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function UA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,h,E,w,p,S,b,m,v,y,d,g,_,T,C,P,O,x,k,M,I=t+t+1,H=n-1,G=i-1,Q=t+1,W=Q*(Q+1)/2,U=new J5,j=null,A=U,L=null,z=null,q=zA[t],K=BA[t];for(l=1;l<I;l++)A=A.next=new J5,l===Q&&(j=A);for(A.next=U,E=h=0,o=0;o<i;o++){for(g=_=T=C=w=p=S=b=0,m=Q*(P=r[h]),v=Q*(O=r[h+1]),y=Q*(x=r[h+2]),d=Q*(k=r[h+3]),w+=W*P,p+=W*O,S+=W*x,b+=W*k,A=U,l=0;l<Q;l++)A.r=P,A.g=O,A.b=x,A.a=k,A=A.next;for(l=1;l<Q;l++)u=h+((H<l?H:l)<<2),w+=(A.r=P=r[u])*(M=Q-l),p+=(A.g=O=r[u+1])*M,S+=(A.b=x=r[u+2])*M,b+=(A.a=k=r[u+3])*M,g+=P,_+=O,T+=x,C+=k,A=A.next;for(L=U,z=j,a=0;a<n;a++)r[h+3]=k=b*q>>K,k!==0?(k=255/k,r[h]=(w*q>>K)*k,r[h+1]=(p*q>>K)*k,r[h+2]=(S*q>>K)*k):r[h]=r[h+1]=r[h+2]=0,w-=m,p-=v,S-=y,b-=d,m-=L.r,v-=L.g,y-=L.b,d-=L.a,u=E+((u=a+t+1)<H?u:H)<<2,g+=L.r=r[u],_+=L.g=r[u+1],T+=L.b=r[u+2],C+=L.a=r[u+3],w+=g,p+=_,S+=T,b+=C,L=L.next,m+=P=z.r,v+=O=z.g,y+=x=z.b,d+=k=z.a,g-=P,_-=O,T-=x,C-=k,z=z.next,h+=4;E+=n}for(a=0;a<n;a++){for(_=T=C=g=p=S=b=w=0,h=a<<2,m=Q*(P=r[h]),v=Q*(O=r[h+1]),y=Q*(x=r[h+2]),d=Q*(k=r[h+3]),w+=W*P,p+=W*O,S+=W*x,b+=W*k,A=U,l=0;l<Q;l++)A.r=P,A.g=O,A.b=x,A.a=k,A=A.next;for(f=n,l=1;l<=t;l++)h=f+a<<2,w+=(A.r=P=r[h])*(M=Q-l),p+=(A.g=O=r[h+1])*M,S+=(A.b=x=r[h+2])*M,b+=(A.a=k=r[h+3])*M,g+=P,_+=O,T+=x,C+=k,A=A.next,l<G&&(f+=n);for(h=a,L=U,z=j,o=0;o<i;o++)u=h<<2,r[u+3]=k=b*q>>K,k>0?(k=255/k,r[u]=(w*q>>K)*k,r[u+1]=(p*q>>K)*k,r[u+2]=(S*q>>K)*k):r[u]=r[u+1]=r[u+2]=0,w-=m,p-=v,S-=y,b-=d,m-=L.r,v-=L.g,y-=L.b,d-=L.a,u=a+((u=o+Q)<G?u:G)*n<<2,w+=g+=L.r=r[u],p+=_+=L.g=r[u+1],S+=T+=L.b=r[u+2],b+=C+=L.a=r[u+3],L=L.next,m+=P=z.r,v+=O=z.g,y+=x=z.b,d+=k=z.a,g-=P,_-=O,T-=x,C-=k,z=z.next,h+=n}}const HA=function(t){var r=Math.round(this.blurRadius());r>0&&UA(t,r)};xp.Blur=HA;Q5.Factory.addGetterSetter(jA.Node,"blurRadius",0,(0,FA.getNumberValidator)(),Q5.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Brighten=void 0;const e4=ct,$A=$t,GA=qe,VA=function(e){var t=this.brightness()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=t,r[i+1]+=t,r[i+2]+=t};Pp.Brighten=VA;e4.Factory.addGetterSetter($A.Node,"brightness",0,(0,GA.getNumberValidator)(),e4.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Contrast=void 0;const t4=ct,qA=$t,WA=qe,KA=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};Cp.Contrast=KA;t4.Factory.addGetterSetter(qA.Node,"contrast",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Emboss=void 0;const vo=ct,Tp=$t,YA=Yt,N9=qe,XA=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,h=u*4,E=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:YA.Util.error("Unknown emboss direction: "+n)}do{var w=(E-1)*h,p=a;E+p<1&&(p=0),E+p>f&&(p=0);var S=(E-1+p)*u*4,b=u;do{var m=w+(b-1)*4,v=o;b+v<1&&(v=0),b+v>u&&(v=0);var y=S+(b-1+v)*4,d=l[m]-l[y],g=l[m+1]-l[y+1],_=l[m+2]-l[y+2],T=d,C=T>0?T:-T,P=g>0?g:-g,O=_>0?_:-_;if(P>C&&(T=g),O>C&&(T=_),T*=t,i){var x=l[m]+T,k=l[m+1]+T,M=l[m+2]+T;l[m]=x>255?255:x<0?0:x,l[m+1]=k>255?255:k<0?0:k,l[m+2]=M>255?255:M<0?0:M}else{var I=r-T;I<0?I=0:I>255&&(I=255),l[m]=l[m+1]=l[m+2]=I}}while(--b)}while(--E)};kp.Emboss=XA;vo.Factory.addGetterSetter(Tp.Node,"embossStrength",.5,(0,N9.getNumberValidator)(),vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossWhiteLevel",.5,(0,N9.getNumberValidator)(),vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossDirection","top-left",null,vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossBlend",!1,null,vo.Factory.afterSetFilter);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.Enhance=void 0;const r4=ct,ZA=$t,QA=qe;function eg(e,t,r,n,i){var a=r-t,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(e-t)/a,l=o*l+n,l)}const JA=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],h=f,E,w,p=this.enhance();if(p!==0){for(w=0;w<r;w+=4)a=t[w+0],a<n?n=a:a>i&&(i=a),u=t[w+1],u<o?o=u:u>l&&(l=u),E=t[w+2],E<f?f=E:E>h&&(h=E);i===n&&(i=255,n=0),l===o&&(l=255,o=0),h===f&&(h=255,f=0);var S,b,m,v,y,d,g,_,T;for(p>0?(b=i+p*(255-i),m=n-p*(n-0),y=l+p*(255-l),d=o-p*(o-0),_=h+p*(255-h),T=f-p*(f-0)):(S=(i+n)*.5,b=i+p*(i-S),m=n+p*(n-S),v=(l+o)*.5,y=l+p*(l-v),d=o+p*(o-v),g=(h+f)*.5,_=h+p*(h-g),T=f+p*(f-g)),w=0;w<r;w+=4)t[w+0]=eg(t[w+0],n,i,m,b),t[w+1]=eg(t[w+1],o,l,d,y),t[w+2]=eg(t[w+2],f,h,T,_)}};Ap.Enhance=JA;r4.Factory.addGetterSetter(ZA.Node,"enhance",0,(0,QA.getNumberValidator)(),r4.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Grayscale=void 0;const eR=function(e){var t=e.data,r=t.length,n,i;for(n=0;n<r;n+=4)i=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=i,t[n+1]=i,t[n+2]=i};Rp.Grayscale=eR;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.HSL=void 0;const Ns=ct,Gy=$t,Vy=qe;Ns.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);Ns.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);Ns.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);const tR=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),h=.299*n+.701*u+.167*f,E=.587*n-.587*u+.33*f,w=.114*n-.114*u-.497*f,p=.299*n-.299*u-.328*f,S=.587*n+.413*u+.035*f,b=.114*n-.114*u+.293*f,m=.299*n-.3*u+1.25*f,v=.587*n-.586*u-1.05*f,y=.114*n+.886*u-.2*f,d,g,_,T;for(l=0;l<r;l+=4)d=t[l+0],g=t[l+1],_=t[l+2],T=t[l+3],t[l+0]=h*d+E*g+w*_+o,t[l+1]=p*d+S*g+b*_+o,t[l+2]=m*d+v*g+y*_+o,t[l+3]=T};Mp.HSL=tR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.HSV=void 0;const Is=ct,qy=$t,Wy=qe,rR=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,h=.587*n-.587*l+.33*u,E=.114*n-.114*l-.497*u,w=.299*n-.299*l-.328*u,p=.587*n+.413*l+.035*u,S=.114*n-.114*l+.293*u,b=.299*n-.3*l+1.25*u,m=.587*n-.586*l-1.05*u,v=.114*n+.886*l-.2*u,y,d,g,_;for(o=0;o<r;o+=4)y=t[o+0],d=t[o+1],g=t[o+2],_=t[o+3],t[o+0]=f*y+h*d+E*g,t[o+1]=w*y+p*d+S*g,t[o+2]=b*y+m*d+v*g,t[o+3]=_};Lp.HSV=rR;Is.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Invert=void 0;const nR=function(e){var t=e.data,r=t.length,n;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};Np.Invert=nR;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Kaleidoscope=void 0;const _h=ct,I9=$t,n4=Yt,D9=qe;var iR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,E,w=0,p=0,S=0,b=0,m,v=Math.sqrt(l*l+u*u);h=a-l,E=o-u,m=Math.sqrt(h*h+E*E),v=m>v?m:v;var y=o,d=a,g,_,T=360/d*Math.PI/180,C,P;for(_=0;_<d;_+=1)for(C=Math.sin(_*T),P=Math.cos(_*T),g=0;g<y;g+=1)h=Math.floor(l+v*g/y*P),E=Math.floor(u+v*g/y*C),f=(E*a+h)*4,w=n[f+0],p=n[f+1],S=n[f+2],b=n[f+3],f=(_+g*a)*4,i[f+0]=w,i[f+1]=p,i[f+2]=S,i[f+3]=b},aR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,E,w,p,S=0,b=0,m=0,v=0,y,d=Math.sqrt(l*l+u*u);h=a-l,E=o-u,y=Math.sqrt(h*h+E*E),d=y>d?y:d;var g=o,_=a,T,C,P=0,O,x;for(h=0;h<a;h+=1)for(E=0;E<o;E+=1)w=h-l,p=E-u,T=Math.sqrt(w*w+p*p)*g/d,C=(Math.atan2(p,w)*180/Math.PI+360+P)%360,C=C*_/360,O=Math.floor(C),x=Math.floor(T),f=(x*a+O)*4,S=n[f+0],b=n[f+1],m=n[f+2],v=n[f+3],f=(E*a+h)*4,i[f+0]=S,i[f+1]=b,i[f+2]=m,i[f+3]=v};const oR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,h,E,w,p=Math.round(this.kaleidoscopePower()),S=Math.round(this.kaleidoscopeAngle()),b=Math.floor(t*(S%360)/360);if(!(p<1)){var m=n4.Util.createCanvasElement();m.width=t,m.height=r;var v=m.getContext("2d").getImageData(0,0,t,r);n4.Util.releaseCanvas(m),iR(e,v,{polarCenterX:t/2,polarCenterY:r/2});for(var y=t/Math.pow(2,p);y<=8;)y=y*2,p-=1;y=Math.ceil(y);var d=y,g=0,_=d,T=1;for(b+y>t&&(g=d,_=0,T=-1),i=0;i<r;i+=1)for(n=g;n!==_;n+=T)a=Math.round(n+b)%t,E=(t*i+a)*4,l=v.data[E+0],u=v.data[E+1],f=v.data[E+2],h=v.data[E+3],w=(t*i+n)*4,v.data[w+0]=l,v.data[w+1]=u,v.data[w+2]=f,v.data[w+3]=h;for(i=0;i<r;i+=1)for(d=Math.floor(y),o=0;o<p;o+=1){for(n=0;n<d+1;n+=1)E=(t*i+n)*4,l=v.data[E+0],u=v.data[E+1],f=v.data[E+2],h=v.data[E+3],w=(t*i+d*2-n-1)*4,v.data[w+0]=l,v.data[w+1]=u,v.data[w+2]=f,v.data[w+3]=h;d*=2}aR(v,e,{polarRotation:0})}};Ip.Kaleidoscope=oR;_h.Factory.addGetterSetter(I9.Node,"kaleidoscopePower",2,(0,D9.getNumberValidator)(),_h.Factory.afterSetFilter);_h.Factory.addGetterSetter(I9.Node,"kaleidoscopeAngle",0,(0,D9.getNumberValidator)(),_h.Factory.afterSetFilter);var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Mask=void 0;const i4=ct,lR=$t,sR=qe;function yd(e,t,r){var n=(r*e.width+t)*4,i=[];return i.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),i}function Iu(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function uR(e){for(var t=[0,0,0],r=0;r<e.length;r++)t[0]+=e[r][0],t[1]+=e[r][1],t[2]+=e[r][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function cR(e,t){var r=yd(e,0,0),n=yd(e,e.width-1,0),i=yd(e,0,e.height-1),a=yd(e,e.width-1,e.height-1),o=t||10;if(Iu(r,n)<o&&Iu(n,a)<o&&Iu(a,i)<o&&Iu(i,r)<o){for(var l=uR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var h=Iu(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=h<o?0:255}return u}}function fR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function dR(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,m=n[E*i+w];h+=e[b]*m}}o[f]=h===255*8?255:0}return o}function hR(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,m=n[E*i+w];h+=e[b]*m}}o[f]=h>=255*4?255:0}return o}function pR(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,m=n[E*i+w];h+=e[b]*m}}o[f]=h}return o}const gR=function(e){var t=this.threshold(),r=cR(e,t);return r&&(r=dR(r,e.width,e.height),r=hR(r,e.width,e.height),r=pR(r,e.width,e.height),fR(e,r)),e};Dp.Mask=gR;i4.Factory.addGetterSetter(lR.Node,"threshold",0,(0,sR.getNumberValidator)(),i4.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Noise=void 0;const a4=ct,vR=$t,mR=qe,yR=function(e){var t=this.noise()*255,r=e.data,n=r.length,i=t/2,a;for(a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};jp.Noise=yR;a4.Factory.addGetterSetter(vR.Node,"noise",.2,(0,mR.getNumberValidator)(),a4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Pixelate=void 0;const o4=ct,bR=Yt,_R=$t,wR=qe,SR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,h,E=Math.ceil(r/t),w=Math.ceil(n/t),p,S,b,m,v,y,d,g=e.data;if(t<=0){bR.Util.error("pixelSize value can not be <= 0");return}for(v=0;v<E;v+=1)for(y=0;y<w;y+=1){for(l=0,u=0,f=0,h=0,p=v*t,S=p+t,b=y*t,m=b+t,d=0,i=p;i<S;i+=1)if(!(i>=r))for(a=b;a<m;a+=1)a>=n||(o=(r*a+i)*4,l+=g[o+0],u+=g[o+1],f+=g[o+2],h+=g[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,h=h/d,i=p;i<S;i+=1)if(!(i>=r))for(a=b;a<m;a+=1)a>=n||(o=(r*a+i)*4,g[o+0]=l,g[o+1]=u,g[o+2]=f,g[o+3]=h)}};Fp.Pixelate=SR;o4.Factory.addGetterSetter(_R.Node,"pixelSize",8,(0,wR.getNumberValidator)(),o4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Posterize=void 0;const l4=ct,ER=$t,OR=qe,xR=function(e){var t=Math.round(this.levels()*254)+1,r=e.data,n=r.length,i=255/t,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};zp.Posterize=xR;l4.Factory.addGetterSetter(ER.Node,"levels",.5,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.RGB=void 0;const wh=ct,Ky=$t,PR=qe,CR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255,t[o]=l*n,t[o+1]=l*i,t[o+2]=l*a,t[o+3]=t[o+3]};Bp.RGB=CR;wh.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});wh.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});wh.Factory.addGetterSetter(Ky.Node,"blue",0,PR.RGBComponent,wh.Factory.afterSetFilter);var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.RGBA=void 0;const Sc=ct,Hp=$t,kR=qe,TR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha(),l,u;for(l=0;l<r;l+=4)u=1-o,t[l]=n*o+t[l]*u,t[l+1]=i*o+t[l+1]*u,t[l+2]=a*o+t[l+2]*u};Up.RGBA=TR;Sc.Factory.addGetterSetter(Hp.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sc.Factory.addGetterSetter(Hp.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sc.Factory.addGetterSetter(Hp.Node,"blue",0,kR.RGBComponent,Sc.Factory.afterSetFilter);Sc.Factory.addGetterSetter(Hp.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Sepia=void 0;const AR=function(e){var t=e.data,r=t.length,n,i,a,o;for(n=0;n<r;n+=4)i=t[n+0],a=t[n+1],o=t[n+2],t[n+0]=Math.min(255,i*.393+a*.769+o*.189),t[n+1]=Math.min(255,i*.349+a*.686+o*.168),t[n+2]=Math.min(255,i*.272+a*.534+o*.131)};$p.Sepia=AR;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Solarize=void 0;const RR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],h=t[u+1],E=t[u+2];f>127&&(f=255-f),h>127&&(h=255-h),E>127&&(E=255-E),t[u]=f,t[u+1]=h,t[u+2]=E}while(--l)}while(--a)};Gp.Solarize=RR;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Threshold=void 0;const s4=ct,MR=$t,LR=qe,NR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};Vp.Threshold=NR;s4.Factory.addGetterSetter(MR.Node,"threshold",.5,(0,LR.getNumberValidator)(),s4.Factory.afterSetFilter);Object.defineProperty(ep,"__esModule",{value:!0});ep.Konva=void 0;const u4=mh,IR=op,DR=up,jR=dp,FR=hp,zR=pp,c4=Ls,BR=Gc,UR=Zs,HR=Wc,$R=mp,GR=yp,VR=bp,qR=_p,WR=dl,KR=wp,YR=Sp,XR=Ep,ZR=xp,QR=Pp,JR=Cp,eM=kp,tM=Ap,rM=Rp,nM=Mp,iM=Lp,aM=Np,oM=Ip,lM=Dp,sM=jp,uM=Fp,cM=zp,fM=Bp,dM=Up,hM=$p,pM=Gp,gM=Vp;ep.Konva=u4.Konva.Util._assign(u4.Konva,{Arc:IR.Arc,Arrow:DR.Arrow,Circle:jR.Circle,Ellipse:FR.Ellipse,Image:zR.Image,Label:c4.Label,Tag:c4.Tag,Line:BR.Line,Path:UR.Path,Rect:HR.Rect,RegularPolygon:$R.RegularPolygon,Ring:GR.Ring,Sprite:VR.Sprite,Star:qR.Star,Text:WR.Text,TextPath:KR.TextPath,Transformer:YR.Transformer,Wedge:XR.Wedge,Filters:{Blur:ZR.Blur,Brighten:QR.Brighten,Contrast:JR.Contrast,Emboss:eM.Emboss,Enhance:tM.Enhance,Grayscale:rM.Grayscale,HSL:nM.HSL,HSV:iM.HSV,Invert:aM.Invert,Kaleidoscope:oM.Kaleidoscope,Mask:lM.Mask,Noise:sM.Noise,Pixelate:uM.Pixelate,Posterize:cM.Posterize,RGB:fM.RGB,RGBA:dM.RGBA,Sepia:hM.Sepia,Solarize:pM.Solarize,Threshold:gM.Threshold}});var vM=Ny.exports;Object.defineProperty(vM,"__esModule",{value:!0});const mM=ep;Ny.exports=mM.Konva;var wi=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=mh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=mh;e.exports=n.Konva})(gm,gm.exports);var yM=gm.exports;const Ec=Ph(yM);var j9={exports:{}};/**
44
- * @license React
45
- * react-reconciler.production.min.js
46
- *
47
- * Copyright (c) Facebook, Inc. and its affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */var bM=function(t){var r={},n=Je,i=Uu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,R=1;R<arguments.length;R++)c+="&args[]="+encodeURIComponent(arguments[R]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),_=Symbol.iterator;function T(s){return s===null||typeof s!="object"?null:(s=_&&s[_]||s["@@iterator"],typeof s=="function"?s:null)}function C(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case h:return"Fragment";case f:return"Portal";case w:return"Profiler";case E:return"StrictMode";case m:return"Suspense";case v:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case S:return(s.displayName||"Context")+".Consumer";case p:return(s._context.displayName||"Context")+".Provider";case b:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case y:return c=s.displayName||null,c!==null?c:C(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return C(s(c))}catch{}}return null}function P(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(c);case 8:return c===E?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function O(s){var c=s,R=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(R=c.return),s=c.return;while(s)}return c.tag===3?R:null}function x(s){if(O(s)!==s)throw Error(o(188))}function k(s){var c=s.alternate;if(!c){if(c=O(s),c===null)throw Error(o(188));return c!==s?null:s}for(var R=s,N=c;;){var D=R.return;if(D===null)break;var V=D.alternate;if(V===null){if(N=D.return,N!==null){R=N;continue}break}if(D.child===V.child){for(V=D.child;V;){if(V===R)return x(D),s;if(V===N)return x(D),c;V=V.sibling}throw Error(o(188))}if(R.return!==N.return)R=D,N=V;else{for(var J=!1,le=D.child;le;){if(le===R){J=!0,R=D,N=V;break}if(le===N){J=!0,N=D,R=V;break}le=le.sibling}if(!J){for(le=V.child;le;){if(le===R){J=!0,R=V,N=D;break}if(le===N){J=!0,N=V,R=D;break}le=le.sibling}if(!J)throw Error(o(189))}}if(R.alternate!==N)throw Error(o(190))}if(R.tag!==3)throw Error(o(188));return R.stateNode.current===R?s:c}function M(s){return s=k(s),s!==null?I(s):null}function I(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=I(s);if(c!==null)return c;s=s.sibling}return null}function H(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=H(s);if(c!==null)return c}s=s.sibling}return null}var G=Array.isArray,Q=t.getPublicInstance,W=t.getRootHostContext,U=t.getChildHostContext,j=t.prepareForCommit,A=t.resetAfterCommit,L=t.createInstance,z=t.appendInitialChild,q=t.finalizeInitialChildren,K=t.prepareUpdate,F=t.shouldSetTextContent,$=t.createTextInstance,B=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Z=t.isPrimaryRenderer,te=t.supportsMutation,ee=t.supportsPersistence,ne=t.supportsHydration,ie=t.getInstanceFromNode,ce=t.preparePortalMount,Oe=t.getCurrentEventPriority,Te=t.detachDeletedInstance,ae=t.supportsMicrotasks,de=t.scheduleMicrotask,ye=t.supportsTestSelectors,ve=t.findFiberRoot,re=t.getBoundingRect,oe=t.getTextContent,be=t.isHiddenSubtree,Ee=t.matchAccessibilityRole,Ge=t.setFocusIfFocusable,et=t.setupIntersectionObserver,Ae=t.appendChild,Ce=t.appendChildToContainer,ke=t.commitTextUpdate,Ne=t.commitMount,Ze=t.commitUpdate,ue=t.insertBefore,fe=t.insertInContainerBefore,Ye=t.removeChild,_e=t.removeChildFromContainer,De=t.resetTextContent,Le=t.hideInstance,we=t.hideTextInstance,Qe=t.unhideInstance,Se=t.unhideTextInstance,Ke=t.clearContainer,Mr=t.cloneInstance,xe=t.createContainerChildSet,Fe=t.appendChildToContainerChildSet,tt=t.finalizeContainerChildren,mt=t.replaceContainerChildren,Ot=t.cloneHiddenInstance,Lr=t.cloneHiddenTextInstance,Vr=t.canHydrateInstance,Or=t.canHydrateTextInstance,Rn=t.canHydrateSuspenseInstance,mn=t.isSuspenseInstancePending,yn=t.isSuspenseInstanceFallback,Zn=t.getSuspenseInstanceFallbackErrorDetails,Ei=t.registerSuspenseInstanceRetry,Ie=t.getNextHydratableSibling,rt=t.getFirstHydratableChild,pt=t.getFirstHydratableChildWithinContainer,Xt=t.getFirstHydratableChildWithinSuspenseInstance,Ct=t.hydrateInstance,or=t.hydrateTextInstance,Nr=t.hydrateSuspenseInstance,lr=t.getNextHydratableInstanceAfterSuspenseInstance,Mn=t.commitHydratedContainer,Oi=t.commitHydratedSuspenseInstance,Ji=t.clearSuspenseBoundary,Ma=t.clearSuspenseBoundaryFromContainer,au=t.shouldDeleteUnhydratedTailInstances,Ro=t.didNotMatchHydratedContainerTextInstance,Mo=t.didNotMatchHydratedTextInstance,xi;function La(s){if(xi===void 0)try{throw Error()}catch(R){var c=R.stack.trim().match(/\n( *(at )?)/);xi=c&&c[1]||""}return`
52
- `+xi+s}var Rl=!1;function t0(s,c){if(!s||Rl)return"";Rl=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Re){var N=Re}Reflect.construct(s,[],c)}else{try{c.call()}catch(Re){N=Re}s.call(c.prototype)}else{try{throw Error()}catch(Re){N=Re}s()}}catch(Re){if(Re&&N&&typeof Re.stack=="string"){for(var D=Re.stack.split(`
53
- `),V=N.stack.split(`
54
- `),J=D.length-1,le=V.length-1;1<=J&&0<=le&&D[J]!==V[le];)le--;for(;1<=J&&0<=le;J--,le--)if(D[J]!==V[le]){if(J!==1||le!==1)do if(J--,le--,0>le||D[J]!==V[le]){var pe=`
55
- `+D[J].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=J&&0<=le);break}}}finally{Rl=!1,Error.prepareStackTrace=R}return(s=s?s.displayName||s.name:"")?La(s):""}var RS=Object.prototype.hasOwnProperty,r0=[],Ml=-1;function Na(s){return{current:s}}function Dt(s){0>Ml||(s.current=r0[Ml],r0[Ml]=null,Ml--)}function Mt(s,c){Ml++,r0[Ml]=s.current,s.current=c}var Ia={},Ir=Na(Ia),Jr=Na(!1),Lo=Ia;function Ll(s,c){var R=s.type.contextTypes;if(!R)return Ia;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var D={},V;for(V in R)D[V]=c[V];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=D),D}function en(s){return s=s.childContextTypes,s!=null}function Jc(){Dt(Jr),Dt(Ir)}function x2(s,c,R){if(Ir.current!==Ia)throw Error(o(168));Mt(Ir,c),Mt(Jr,R)}function P2(s,c,R){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return R;N=N.getChildContext();for(var D in N)if(!(D in c))throw Error(o(108,P(s)||"Unknown",D));return a({},R,N)}function ef(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Ia,Lo=Ir.current,Mt(Ir,s),Mt(Jr,Jr.current),!0}function C2(s,c,R){var N=s.stateNode;if(!N)throw Error(o(169));R?(s=P2(s,c,Lo),N.__reactInternalMemoizedMergedChildContext=s,Dt(Jr),Dt(Ir),Mt(Ir,s)):Dt(Jr),Mt(Jr,R)}var Qn=Math.clz32?Math.clz32:NS,MS=Math.log,LS=Math.LN2;function NS(s){return s>>>=0,s===0?32:31-(MS(s)/LS|0)|0}var tf=64,rf=4194304;function ou(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function nf(s,c){var R=s.pendingLanes;if(R===0)return 0;var N=0,D=s.suspendedLanes,V=s.pingedLanes,J=R&268435455;if(J!==0){var le=J&~D;le!==0?N=ou(le):(V&=J,V!==0&&(N=ou(V)))}else J=R&~D,J!==0?N=ou(J):V!==0&&(N=ou(V));if(N===0)return 0;if(c!==0&&c!==N&&!(c&D)&&(D=N&-N,V=c&-c,D>=V||D===16&&(V&4194240)!==0))return c;if(N&4&&(N|=R&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)R=31-Qn(c),D=1<<R,N|=s[R],c&=~D;return N}function IS(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function DS(s,c){for(var R=s.suspendedLanes,N=s.pingedLanes,D=s.expirationTimes,V=s.pendingLanes;0<V;){var J=31-Qn(V),le=1<<J,pe=D[J];pe===-1?(!(le&R)||le&N)&&(D[J]=IS(le,c)):pe<=c&&(s.expiredLanes|=le),V&=~le}}function n0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function k2(){var s=tf;return tf<<=1,!(tf&4194240)&&(tf=64),s}function i0(s){for(var c=[],R=0;31>R;R++)c.push(s);return c}function lu(s,c,R){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Qn(c),s[c]=R}function jS(s,c){var R=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var N=s.eventTimes;for(s=s.expirationTimes;0<R;){var D=31-Qn(R),V=1<<D;c[D]=0,N[D]=-1,s[D]=-1,R&=~V}}function a0(s,c){var R=s.entangledLanes|=c;for(s=s.entanglements;R;){var N=31-Qn(R),D=1<<N;D&c|s[N]&c&&(s[N]|=c),R&=~D}}var bt=0;function T2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var o0=i.unstable_scheduleCallback,A2=i.unstable_cancelCallback,FS=i.unstable_shouldYield,zS=i.unstable_requestPaint,mr=i.unstable_now,l0=i.unstable_ImmediatePriority,BS=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,US=i.unstable_IdlePriority,af=null,Pi=null;function HS(s){if(Pi&&typeof Pi.onCommitFiberRoot=="function")try{Pi.onCommitFiberRoot(af,s,void 0,(s.current.flags&128)===128)}catch{}}function $S(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Jn=typeof Object.is=="function"?Object.is:$S,ea=null,of=!1,u0=!1;function R2(s){ea===null?ea=[s]:ea.push(s)}function GS(s){of=!0,R2(s)}function Ci(){if(!u0&&ea!==null){u0=!0;var s=0,c=bt;try{var R=ea;for(bt=1;s<R.length;s++){var N=R[s];do N=N(!0);while(N!==null)}ea=null,of=!1}catch(D){throw ea!==null&&(ea=ea.slice(s+1)),o0(l0,Ci),D}finally{bt=c,u0=!1}}return null}var Nl=[],Il=0,lf=null,sf=0,Ln=[],Nn=0,No=null,ta=1,ra="";function Io(s,c){Nl[Il++]=sf,Nl[Il++]=lf,lf=s,sf=c}function M2(s,c,R){Ln[Nn++]=ta,Ln[Nn++]=ra,Ln[Nn++]=No,No=s;var N=ta;s=ra;var D=32-Qn(N)-1;N&=~(1<<D),R+=1;var V=32-Qn(c)+D;if(30<V){var J=D-D%5;V=(N&(1<<J)-1).toString(32),N>>=J,D-=J,ta=1<<32-Qn(c)+D|R<<D|N,ra=V+s}else ta=1<<V|R<<D|N,ra=s}function c0(s){s.return!==null&&(Io(s,1),M2(s,1,0))}function f0(s){for(;s===lf;)lf=Nl[--Il],Nl[Il]=null,sf=Nl[--Il],Nl[Il]=null;for(;s===No;)No=Ln[--Nn],Ln[Nn]=null,ra=Ln[--Nn],Ln[Nn]=null,ta=Ln[--Nn],Ln[Nn]=null}var bn=null,In=null,Bt=!1,su=!1,ei=null;function L2(s,c){var R=Bn(5,null,null,0);R.elementType="DELETED",R.stateNode=c,R.return=s,c=s.deletions,c===null?(s.deletions=[R],s.flags|=16):c.push(R)}function N2(s,c){switch(s.tag){case 5:return c=Vr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,bn=s,In=rt(c),!0):!1;case 6:return c=Or(c,s.pendingProps),c!==null?(s.stateNode=c,bn=s,In=null,!0):!1;case 13:if(c=Rn(c),c!==null){var R=No!==null?{id:ta,overflow:ra}:null;return s.memoizedState={dehydrated:c,treeContext:R,retryLane:1073741824},R=Bn(18,null,null,0),R.stateNode=c,R.return=s,s.child=R,bn=s,In=null,!0}return!1;default:return!1}}function d0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function h0(s){if(Bt){var c=In;if(c){var R=c;if(!N2(s,c)){if(d0(s))throw Error(o(418));c=Ie(R);var N=bn;c&&N2(s,c)?L2(N,R):(s.flags=s.flags&-4097|2,Bt=!1,bn=s)}}else{if(d0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Bt=!1,bn=s}}}function I2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;bn=s}function uf(s){if(!ne||s!==bn)return!1;if(!Bt)return I2(s),Bt=!0,!1;if(s.tag!==3&&(s.tag!==5||au(s.type)&&!F(s.type,s.memoizedProps))){var c=In;if(c){if(d0(s))throw D2(),Error(o(418));for(;c;)L2(s,c),c=Ie(c)}}if(I2(s),s.tag===13){if(!ne)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));In=lr(s)}else In=bn?Ie(s.stateNode):null;return!0}function D2(){for(var s=In;s;)s=Ie(s)}function Dl(){ne&&(In=bn=null,su=Bt=!1)}function p0(s){ei===null?ei=[s]:ei.push(s)}var VS=l.ReactCurrentBatchConfig;function cf(s,c){if(Jn(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var R=Object.keys(s),N=Object.keys(c);if(R.length!==N.length)return!1;for(N=0;N<R.length;N++){var D=R[N];if(!RS.call(c,D)||!Jn(s[D],c[D]))return!1}return!0}function qS(s){switch(s.tag){case 5:return La(s.type);case 16:return La("Lazy");case 13:return La("Suspense");case 19:return La("SuspenseList");case 0:case 2:case 15:return s=t0(s.type,!1),s;case 11:return s=t0(s.type.render,!1),s;case 1:return s=t0(s.type,!0),s;default:return""}}function uu(s,c,R){if(s=R.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(R._owner){if(R=R._owner,R){if(R.tag!==1)throw Error(o(309));var N=R.stateNode}if(!N)throw Error(o(147,s));var D=N,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(J){var le=D.refs;J===null?delete le[V]:le[V]=J},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!R._owner)throw Error(o(290,s))}return s}function ff(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function j2(s){var c=s._init;return c(s._payload)}function F2(s){function c(he,se){if(s){var ge=he.deletions;ge===null?(he.deletions=[se],he.flags|=16):ge.push(se)}}function R(he,se){if(!s)return null;for(;se!==null;)c(he,se),se=se.sibling;return null}function N(he,se){for(he=new Map;se!==null;)se.key!==null?he.set(se.key,se):he.set(se.index,se),se=se.sibling;return he}function D(he,se){return he=Ha(he,se),he.index=0,he.sibling=null,he}function V(he,se,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<se?(he.flags|=2,se):ge):(he.flags|=2,se)):(he.flags|=1048576,se)}function J(he){return s&&he.alternate===null&&(he.flags|=2),he}function le(he,se,ge,ze){return se===null||se.tag!==6?(se=u1(ge,he.mode,ze),se.return=he,se):(se=D(se,ge),se.return=he,se)}function pe(he,se,ge,ze){var Xe=ge.type;return Xe===h?$e(he,se,ge.props.children,ze,ge.key):se!==null&&(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&j2(Xe)===se.type)?(ze=D(se,ge.props),ze.ref=uu(he,se,ge),ze.return=he,ze):(ze=Hf(ge.type,ge.key,ge.props,null,he.mode,ze),ze.ref=uu(he,se,ge),ze.return=he,ze)}function Re(he,se,ge,ze){return se===null||se.tag!==4||se.stateNode.containerInfo!==ge.containerInfo||se.stateNode.implementation!==ge.implementation?(se=c1(ge,he.mode,ze),se.return=he,se):(se=D(se,ge.children||[]),se.return=he,se)}function $e(he,se,ge,ze,Xe){return se===null||se.tag!==7?(se=Ho(ge,he.mode,ze,Xe),se.return=he,se):(se=D(se,ge),se.return=he,se)}function it(he,se,ge){if(typeof se=="string"&&se!==""||typeof se=="number")return se=u1(""+se,he.mode,ge),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case u:return ge=Hf(se.type,se.key,se.props,null,he.mode,ge),ge.ref=uu(he,null,se),ge.return=he,ge;case f:return se=c1(se,he.mode,ge),se.return=he,se;case d:var ze=se._init;return it(he,ze(se._payload),ge)}if(G(se)||T(se))return se=Ho(se,he.mode,ge,null),se.return=he,se;ff(he,se)}return null}function je(he,se,ge,ze){var Xe=se!==null?se.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return Xe!==null?null:le(he,se,""+ge,ze);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===Xe?pe(he,se,ge,ze):null;case f:return ge.key===Xe?Re(he,se,ge,ze):null;case d:return Xe=ge._init,je(he,se,Xe(ge._payload),ze)}if(G(ge)||T(ge))return Xe!==null?null:$e(he,se,ge,ze,null);ff(he,ge)}return null}function jt(he,se,ge,ze,Xe){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return he=he.get(ge)||null,le(se,he,""+ze,Xe);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case u:return he=he.get(ze.key===null?ge:ze.key)||null,pe(se,he,ze,Xe);case f:return he=he.get(ze.key===null?ge:ze.key)||null,Re(se,he,ze,Xe);case d:var st=ze._init;return jt(he,se,ge,st(ze._payload),Xe)}if(G(ze)||T(ze))return he=he.get(ge)||null,$e(se,he,ze,Xe,null);ff(se,ze)}return null}function At(he,se,ge,ze){for(var Xe=null,st=null,at=se,_t=se=0,_r=null;at!==null&&_t<ge.length;_t++){at.index>_t?(_r=at,at=null):_r=at.sibling;var wt=je(he,at,ge[_t],ze);if(wt===null){at===null&&(at=_r);break}s&&at&&wt.alternate===null&&c(he,at),se=V(wt,se,_t),st===null?Xe=wt:st.sibling=wt,st=wt,at=_r}if(_t===ge.length)return R(he,at),Bt&&Io(he,_t),Xe;if(at===null){for(;_t<ge.length;_t++)at=it(he,ge[_t],ze),at!==null&&(se=V(at,se,_t),st===null?Xe=at:st.sibling=at,st=at);return Bt&&Io(he,_t),Xe}for(at=N(he,at);_t<ge.length;_t++)_r=jt(at,he,_t,ge[_t],ze),_r!==null&&(s&&_r.alternate!==null&&at.delete(_r.key===null?_t:_r.key),se=V(_r,se,_t),st===null?Xe=_r:st.sibling=_r,st=_r);return s&&at.forEach(function($a){return c(he,$a)}),Bt&&Io(he,_t),Xe}function an(he,se,ge,ze){var Xe=T(ge);if(typeof Xe!="function")throw Error(o(150));if(ge=Xe.call(ge),ge==null)throw Error(o(151));for(var st=Xe=null,at=se,_t=se=0,_r=null,wt=ge.next();at!==null&&!wt.done;_t++,wt=ge.next()){at.index>_t?(_r=at,at=null):_r=at.sibling;var $a=je(he,at,wt.value,ze);if($a===null){at===null&&(at=_r);break}s&&at&&$a.alternate===null&&c(he,at),se=V($a,se,_t),st===null?Xe=$a:st.sibling=$a,st=$a,at=_r}if(wt.done)return R(he,at),Bt&&Io(he,_t),Xe;if(at===null){for(;!wt.done;_t++,wt=ge.next())wt=it(he,wt.value,ze),wt!==null&&(se=V(wt,se,_t),st===null?Xe=wt:st.sibling=wt,st=wt);return Bt&&Io(he,_t),Xe}for(at=N(he,at);!wt.done;_t++,wt=ge.next())wt=jt(at,he,_t,wt.value,ze),wt!==null&&(s&&wt.alternate!==null&&at.delete(wt.key===null?_t:wt.key),se=V(wt,se,_t),st===null?Xe=wt:st.sibling=wt,st=wt);return s&&at.forEach(function(SE){return c(he,SE)}),Bt&&Io(he,_t),Xe}function oa(he,se,ge,ze){if(typeof ge=="object"&&ge!==null&&ge.type===h&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var Xe=ge.key,st=se;st!==null;){if(st.key===Xe){if(Xe=ge.type,Xe===h){if(st.tag===7){R(he,st.sibling),se=D(st,ge.props.children),se.return=he,he=se;break e}}else if(st.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&j2(Xe)===st.type){R(he,st.sibling),se=D(st,ge.props),se.ref=uu(he,st,ge),se.return=he,he=se;break e}R(he,st);break}else c(he,st);st=st.sibling}ge.type===h?(se=Ho(ge.props.children,he.mode,ze,ge.key),se.return=he,he=se):(ze=Hf(ge.type,ge.key,ge.props,null,he.mode,ze),ze.ref=uu(he,se,ge),ze.return=he,he=ze)}return J(he);case f:e:{for(st=ge.key;se!==null;){if(se.key===st)if(se.tag===4&&se.stateNode.containerInfo===ge.containerInfo&&se.stateNode.implementation===ge.implementation){R(he,se.sibling),se=D(se,ge.children||[]),se.return=he,he=se;break e}else{R(he,se);break}else c(he,se);se=se.sibling}se=c1(ge,he.mode,ze),se.return=he,he=se}return J(he);case d:return st=ge._init,oa(he,se,st(ge._payload),ze)}if(G(ge))return At(he,se,ge,ze);if(T(ge))return an(he,se,ge,ze);ff(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,se!==null&&se.tag===6?(R(he,se.sibling),se=D(se,ge),se.return=he,he=se):(R(he,se),se=u1(ge,he.mode,ze),se.return=he,he=se),J(he)):R(he,se)}return oa}var jl=F2(!0),z2=F2(!1),df=Na(null),hf=null,Fl=null,g0=null;function v0(){g0=Fl=hf=null}function B2(s,c,R){Z?(Mt(df,c._currentValue),c._currentValue=R):(Mt(df,c._currentValue2),c._currentValue2=R)}function m0(s){var c=df.current;Dt(df),Z?s._currentValue=c:s._currentValue2=c}function y0(s,c,R){for(;s!==null;){var N=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),s===R)break;s=s.return}}function zl(s,c){hf=s,g0=Fl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(tn=!0),s.firstContext=null)}function Dn(s){var c=Z?s._currentValue:s._currentValue2;if(g0!==s)if(s={context:s,memoizedValue:c,next:null},Fl===null){if(hf===null)throw Error(o(308));Fl=s,hf.dependencies={lanes:0,firstContext:s}}else Fl=Fl.next=s;return c}var Do=null;function b0(s){Do===null?Do=[s]:Do.push(s)}function U2(s,c,R,N){var D=c.interleaved;return D===null?(R.next=R,b0(c)):(R.next=D.next,D.next=R),c.interleaved=R,ki(s,N)}function ki(s,c){s.lanes|=c;var R=s.alternate;for(R!==null&&(R.lanes|=c),R=s,s=s.return;s!==null;)s.childLanes|=c,R=s.alternate,R!==null&&(R.childLanes|=c),R=s,s=s.return;return R.tag===3?R.stateNode:null}var Da=!1;function _0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H2(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function na(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ja(s,c,R){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,ft&2){var D=N.pending;return D===null?c.next=c:(c.next=D.next,D.next=c),N.pending=c,ki(s,R)}return D=N.interleaved,D===null?(c.next=c,b0(N)):(c.next=D.next,D.next=c),N.interleaved=c,ki(s,R)}function pf(s,c,R){if(c=c.updateQueue,c!==null&&(c=c.shared,(R&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,R|=N,c.lanes=R,a0(s,R)}}function $2(s,c){var R=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,R===N)){var D=null,V=null;if(R=R.firstBaseUpdate,R!==null){do{var J={eventTime:R.eventTime,lane:R.lane,tag:R.tag,payload:R.payload,callback:R.callback,next:null};V===null?D=V=J:V=V.next=J,R=R.next}while(R!==null);V===null?D=V=c:V=V.next=c}else D=V=c;R={baseState:N.baseState,firstBaseUpdate:D,lastBaseUpdate:V,shared:N.shared,effects:N.effects},s.updateQueue=R;return}s=R.lastBaseUpdate,s===null?R.firstBaseUpdate=c:s.next=c,R.lastBaseUpdate=c}function gf(s,c,R,N){var D=s.updateQueue;Da=!1;var V=D.firstBaseUpdate,J=D.lastBaseUpdate,le=D.shared.pending;if(le!==null){D.shared.pending=null;var pe=le,Re=pe.next;pe.next=null,J===null?V=Re:J.next=Re,J=pe;var $e=s.alternate;$e!==null&&($e=$e.updateQueue,le=$e.lastBaseUpdate,le!==J&&(le===null?$e.firstBaseUpdate=Re:le.next=Re,$e.lastBaseUpdate=pe))}if(V!==null){var it=D.baseState;J=0,$e=Re=pe=null,le=V;do{var je=le.lane,jt=le.eventTime;if((N&je)===je){$e!==null&&($e=$e.next={eventTime:jt,lane:0,tag:le.tag,payload:le.payload,callback:le.callback,next:null});e:{var At=s,an=le;switch(je=c,jt=R,an.tag){case 1:if(At=an.payload,typeof At=="function"){it=At.call(jt,it,je);break e}it=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=an.payload,je=typeof At=="function"?At.call(jt,it,je):At,je==null)break e;it=a({},it,je);break e;case 2:Da=!0}}le.callback!==null&&le.lane!==0&&(s.flags|=64,je=D.effects,je===null?D.effects=[le]:je.push(le))}else jt={eventTime:jt,lane:je,tag:le.tag,payload:le.payload,callback:le.callback,next:null},$e===null?(Re=$e=jt,pe=it):$e=$e.next=jt,J|=je;if(le=le.next,le===null){if(le=D.shared.pending,le===null)break;je=le,le=je.next,je.next=null,D.lastBaseUpdate=je,D.shared.pending=null}}while(!0);if($e===null&&(pe=it),D.baseState=pe,D.firstBaseUpdate=Re,D.lastBaseUpdate=$e,c=D.shared.interleaved,c!==null){D=c;do J|=D.lane,D=D.next;while(D!==c)}else V===null&&(D.shared.lanes=0);Fo|=J,s.lanes=J,s.memoizedState=it}}function G2(s,c,R){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var N=s[c],D=N.callback;if(D!==null){if(N.callback=null,N=R,typeof D!="function")throw Error(o(191,D));D.call(N)}}}var cu={},jn=Na(cu),fu=Na(cu),Bl=Na(cu);function Ti(s){if(s===cu)throw Error(o(174));return s}function w0(s,c){Mt(Bl,c),Mt(fu,s),Mt(jn,cu),s=W(c),Dt(jn),Mt(jn,s)}function Ul(){Dt(jn),Dt(fu),Dt(Bl)}function V2(s){var c=Ti(Bl.current),R=Ti(jn.current);c=U(R,s.type,c),R!==c&&(Mt(fu,s),Mt(jn,c))}function S0(s){fu.current===s&&(Dt(jn),Dt(fu))}var Gt=Na(0);function vf(s){for(var c=s;c!==null;){if(c.tag===13){var R=c.memoizedState;if(R!==null&&(R=R.dehydrated,R===null||mn(R)||yn(R)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var s=0;s<E0.length;s++){var c=E0[s];Z?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var mf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,jo=0,Vt=null,sr=null,yr=null,yf=!1,du=!1,hu=0,WS=0;function Dr(){throw Error(o(321))}function P0(s,c){if(c===null)return!1;for(var R=0;R<c.length&&R<s.length;R++)if(!Jn(s[R],c[R]))return!1;return!0}function C0(s,c,R,N,D,V){if(jo=V,Vt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,mf.current=s===null||s.memoizedState===null?ZS:QS,s=R(N,D),du){V=0;do{if(du=!1,hu=0,25<=V)throw Error(o(301));V+=1,yr=sr=null,c.updateQueue=null,mf.current=JS,s=R(N,D)}while(du)}if(mf.current=wf,c=sr!==null&&sr.next!==null,jo=0,yr=sr=Vt=null,yf=!1,c)throw Error(o(300));return s}function k0(){var s=hu!==0;return hu=0,s}function Ai(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yr===null?Vt.memoizedState=yr=s:yr=yr.next=s,yr}function Fn(){if(sr===null){var s=Vt.alternate;s=s!==null?s.memoizedState:null}else s=sr.next;var c=yr===null?Vt.memoizedState:yr.next;if(c!==null)yr=c,sr=s;else{if(s===null)throw Error(o(310));sr=s,s={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},yr===null?Vt.memoizedState=yr=s:yr=yr.next=s}return yr}function pu(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=Fn(),R=c.queue;if(R===null)throw Error(o(311));R.lastRenderedReducer=s;var N=sr,D=N.baseQueue,V=R.pending;if(V!==null){if(D!==null){var J=D.next;D.next=V.next,V.next=J}N.baseQueue=D=V,R.pending=null}if(D!==null){V=D.next,N=N.baseState;var le=J=null,pe=null,Re=V;do{var $e=Re.lane;if((jo&$e)===$e)pe!==null&&(pe=pe.next={lane:0,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),N=Re.hasEagerState?Re.eagerState:s(N,Re.action);else{var it={lane:$e,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null};pe===null?(le=pe=it,J=N):pe=pe.next=it,Vt.lanes|=$e,Fo|=$e}Re=Re.next}while(Re!==null&&Re!==V);pe===null?J=N:pe.next=le,Jn(N,c.memoizedState)||(tn=!0),c.memoizedState=N,c.baseState=J,c.baseQueue=pe,R.lastRenderedState=N}if(s=R.interleaved,s!==null){D=s;do V=D.lane,Vt.lanes|=V,Fo|=V,D=D.next;while(D!==s)}else D===null&&(R.lanes=0);return[c.memoizedState,R.dispatch]}function A0(s){var c=Fn(),R=c.queue;if(R===null)throw Error(o(311));R.lastRenderedReducer=s;var N=R.dispatch,D=R.pending,V=c.memoizedState;if(D!==null){R.pending=null;var J=D=D.next;do V=s(V,J.action),J=J.next;while(J!==D);Jn(V,c.memoizedState)||(tn=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),R.lastRenderedState=V}return[V,N]}function q2(){}function W2(s,c){var R=Vt,N=Fn(),D=c(),V=!Jn(N.memoizedState,D);if(V&&(N.memoizedState=D,tn=!0),N=N.queue,R0(X2.bind(null,R,N,s),[s]),N.getSnapshot!==c||V||yr!==null&&yr.memoizedState.tag&1){if(R.flags|=2048,gu(9,Y2.bind(null,R,N,D,c),void 0,null),br===null)throw Error(o(349));jo&30||K2(R,c,D)}return D}function K2(s,c,R){s.flags|=16384,s={getSnapshot:c,value:R},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.stores=[s]):(R=c.stores,R===null?c.stores=[s]:R.push(s))}function Y2(s,c,R,N){c.value=R,c.getSnapshot=N,Z2(c)&&Q2(s)}function X2(s,c,R){return R(function(){Z2(c)&&Q2(s)})}function Z2(s){var c=s.getSnapshot;s=s.value;try{var R=c();return!Jn(s,R)}catch{return!0}}function Q2(s){var c=ki(s,1);c!==null&&zn(c,s,1,-1)}function J2(s){var c=Ai();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pu,lastRenderedState:s},c.queue=s,s=s.dispatch=XS.bind(null,Vt,s),[c.memoizedState,s]}function gu(s,c,R,N){return s={tag:s,create:c,destroy:R,deps:N,next:null},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.lastEffect=s.next=s):(R=c.lastEffect,R===null?c.lastEffect=s.next=s:(N=R.next,R.next=s,s.next=N,c.lastEffect=s)),s}function eb(){return Fn().memoizedState}function bf(s,c,R,N){var D=Ai();Vt.flags|=s,D.memoizedState=gu(1|c,R,void 0,N===void 0?null:N)}function _f(s,c,R,N){var D=Fn();N=N===void 0?null:N;var V=void 0;if(sr!==null){var J=sr.memoizedState;if(V=J.destroy,N!==null&&P0(N,J.deps)){D.memoizedState=gu(c,R,V,N);return}}Vt.flags|=s,D.memoizedState=gu(1|c,R,V,N)}function tb(s,c){return bf(8390656,8,s,c)}function R0(s,c){return _f(2048,8,s,c)}function rb(s,c){return _f(4,2,s,c)}function nb(s,c){return _f(4,4,s,c)}function ib(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function ab(s,c,R){return R=R!=null?R.concat([s]):null,_f(4,4,ib.bind(null,c,s),R)}function M0(){}function ob(s,c){var R=Fn();c=c===void 0?null:c;var N=R.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(R.memoizedState=[s,c],s)}function lb(s,c){var R=Fn();c=c===void 0?null:c;var N=R.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(s=s(),R.memoizedState=[s,c],s)}function sb(s,c,R){return jo&21?(Jn(R,c)||(R=k2(),Vt.lanes|=R,Fo|=R,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,tn=!0),s.memoizedState=R)}function KS(s,c){var R=bt;bt=R!==0&&4>R?R:4,s(!0);var N=x0.transition;x0.transition={};try{s(!1),c()}finally{bt=R,x0.transition=N}}function ub(){return Fn().memoizedState}function YS(s,c,R){var N=Ba(s);if(R={lane:N,action:R,hasEagerState:!1,eagerState:null,next:null},cb(s))fb(c,R);else if(R=U2(s,c,R,N),R!==null){var D=zr();zn(R,s,N,D),db(R,c,N)}}function XS(s,c,R){var N=Ba(s),D={lane:N,action:R,hasEagerState:!1,eagerState:null,next:null};if(cb(s))fb(c,D);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var J=c.lastRenderedState,le=V(J,R);if(D.hasEagerState=!0,D.eagerState=le,Jn(le,J)){var pe=c.interleaved;pe===null?(D.next=D,b0(c)):(D.next=pe.next,pe.next=D),c.interleaved=D;return}}catch{}finally{}R=U2(s,c,D,N),R!==null&&(D=zr(),zn(R,s,N,D),db(R,c,N))}}function cb(s){var c=s.alternate;return s===Vt||c!==null&&c===Vt}function fb(s,c){du=yf=!0;var R=s.pending;R===null?c.next=c:(c.next=R.next,R.next=c),s.pending=c}function db(s,c,R){if(R&4194240){var N=c.lanes;N&=s.pendingLanes,R|=N,c.lanes=R,a0(s,R)}}var wf={readContext:Dn,useCallback:Dr,useContext:Dr,useEffect:Dr,useImperativeHandle:Dr,useInsertionEffect:Dr,useLayoutEffect:Dr,useMemo:Dr,useReducer:Dr,useRef:Dr,useState:Dr,useDebugValue:Dr,useDeferredValue:Dr,useTransition:Dr,useMutableSource:Dr,useSyncExternalStore:Dr,useId:Dr,unstable_isNewReconciler:!1},ZS={readContext:Dn,useCallback:function(s,c){return Ai().memoizedState=[s,c===void 0?null:c],s},useContext:Dn,useEffect:tb,useImperativeHandle:function(s,c,R){return R=R!=null?R.concat([s]):null,bf(4194308,4,ib.bind(null,c,s),R)},useLayoutEffect:function(s,c){return bf(4194308,4,s,c)},useInsertionEffect:function(s,c){return bf(4,2,s,c)},useMemo:function(s,c){var R=Ai();return c=c===void 0?null:c,s=s(),R.memoizedState=[s,c],s},useReducer:function(s,c,R){var N=Ai();return c=R!==void 0?R(c):c,N.memoizedState=N.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},N.queue=s,s=s.dispatch=YS.bind(null,Vt,s),[N.memoizedState,s]},useRef:function(s){var c=Ai();return s={current:s},c.memoizedState=s},useState:J2,useDebugValue:M0,useDeferredValue:function(s){return Ai().memoizedState=s},useTransition:function(){var s=J2(!1),c=s[0];return s=KS.bind(null,s[1]),Ai().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,R){var N=Vt,D=Ai();if(Bt){if(R===void 0)throw Error(o(407));R=R()}else{if(R=c(),br===null)throw Error(o(349));jo&30||K2(N,c,R)}D.memoizedState=R;var V={value:R,getSnapshot:c};return D.queue=V,tb(X2.bind(null,N,V,s),[s]),N.flags|=2048,gu(9,Y2.bind(null,N,V,R,c),void 0,null),R},useId:function(){var s=Ai(),c=br.identifierPrefix;if(Bt){var R=ra,N=ta;R=(N&~(1<<32-Qn(N)-1)).toString(32)+R,c=":"+c+"R"+R,R=hu++,0<R&&(c+="H"+R.toString(32)),c+=":"}else R=WS++,c=":"+c+"r"+R.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},QS={readContext:Dn,useCallback:ob,useContext:Dn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:T0,useRef:eb,useState:function(){return T0(pu)},useDebugValue:M0,useDeferredValue:function(s){var c=Fn();return sb(c,sr.memoizedState,s)},useTransition:function(){var s=T0(pu)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1},JS={readContext:Dn,useCallback:ob,useContext:Dn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:A0,useRef:eb,useState:function(){return A0(pu)},useDebugValue:M0,useDeferredValue:function(s){var c=Fn();return sr===null?c.memoizedState=s:sb(c,sr.memoizedState,s)},useTransition:function(){var s=A0(pu)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1};function ti(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var R in s)c[R]===void 0&&(c[R]=s[R]);return c}return c}function L0(s,c,R,N){c=s.memoizedState,R=R(N,c),R=R==null?c:a({},c,R),s.memoizedState=R,s.lanes===0&&(s.updateQueue.baseState=R)}var Sf={isMounted:function(s){return(s=s._reactInternals)?O(s)===s:!1},enqueueSetState:function(s,c,R){s=s._reactInternals;var N=zr(),D=Ba(s),V=na(N,D);V.payload=c,R!=null&&(V.callback=R),c=ja(s,V,D),c!==null&&(zn(c,s,D,N),pf(c,s,D))},enqueueReplaceState:function(s,c,R){s=s._reactInternals;var N=zr(),D=Ba(s),V=na(N,D);V.tag=1,V.payload=c,R!=null&&(V.callback=R),c=ja(s,V,D),c!==null&&(zn(c,s,D,N),pf(c,s,D))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var R=zr(),N=Ba(s),D=na(R,N);D.tag=2,c!=null&&(D.callback=c),c=ja(s,D,N),c!==null&&(zn(c,s,N,R),pf(c,s,N))}};function hb(s,c,R,N,D,V,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,V,J):c.prototype&&c.prototype.isPureReactComponent?!cf(R,N)||!cf(D,V):!0}function pb(s,c,R){var N=!1,D=Ia,V=c.contextType;return typeof V=="object"&&V!==null?V=Dn(V):(D=en(c)?Lo:Ir.current,N=c.contextTypes,V=(N=N!=null)?Ll(s,D):Ia),c=new c(R,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Sf,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=D,s.__reactInternalMemoizedMaskedChildContext=V),c}function gb(s,c,R,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(R,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(R,N),c.state!==s&&Sf.enqueueReplaceState(c,c.state,null)}function N0(s,c,R,N){var D=s.stateNode;D.props=R,D.state=s.memoizedState,D.refs={},_0(s);var V=c.contextType;typeof V=="object"&&V!==null?D.context=Dn(V):(V=en(c)?Lo:Ir.current,D.context=Ll(s,V)),D.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(L0(s,c,V,R),D.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof D.getSnapshotBeforeUpdate=="function"||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(c=D.state,typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount(),c!==D.state&&Sf.enqueueReplaceState(D,D.state,null),gf(s,R,D,N),D.state=s.memoizedState),typeof D.componentDidMount=="function"&&(s.flags|=4194308)}function Hl(s,c){try{var R="",N=c;do R+=qS(N),N=N.return;while(N);var D=R}catch(V){D=`
56
- Error generating stack: `+V.message+`
57
- `+V.stack}return{value:s,source:c,stack:D,digest:null}}function I0(s,c,R){return{value:s,source:null,stack:R??null,digest:c??null}}function D0(s,c){try{console.error(c.value)}catch(R){setTimeout(function(){throw R})}}var eE=typeof WeakMap=="function"?WeakMap:Map;function vb(s,c,R){R=na(-1,R),R.tag=3,R.payload={element:null};var N=c.value;return R.callback=function(){Df||(Df=!0,r1=N),D0(s,c)},R}function mb(s,c,R){R=na(-1,R),R.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var D=c.value;R.payload=function(){return N(D)},R.callback=function(){D0(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(R.callback=function(){D0(s,c),typeof N!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),R}function yb(s,c,R){var N=s.pingCache;if(N===null){N=s.pingCache=new eE;var D=new Set;N.set(c,D)}else D=N.get(c),D===void 0&&(D=new Set,N.set(c,D));D.has(R)||(D.add(R),s=pE.bind(null,s,c,R),c.then(s,s))}function bb(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function _b(s,c,R,N,D){return s.mode&1?(s.flags|=65536,s.lanes=D,s):(s===c?s.flags|=65536:(s.flags|=128,R.flags|=131072,R.flags&=-52805,R.tag===1&&(R.alternate===null?R.tag=17:(c=na(-1,1),c.tag=2,ja(R,c,1))),R.lanes|=1),s)}var tE=l.ReactCurrentOwner,tn=!1;function qr(s,c,R,N){c.child=s===null?z2(c,null,R,N):jl(c,s.child,R,N)}function wb(s,c,R,N,D){R=R.render;var V=c.ref;return zl(c,D),N=C0(s,c,R,N,V,D),R=k0(),s!==null&&!tn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~D,ia(s,c,D)):(Bt&&R&&c0(c),c.flags|=1,qr(s,c,N,D),c.child)}function Sb(s,c,R,N,D){if(s===null){var V=R.type;return typeof V=="function"&&!s1(V)&&V.defaultProps===void 0&&R.compare===null&&R.defaultProps===void 0?(c.tag=15,c.type=V,Eb(s,c,V,N,D)):(s=Hf(R.type,null,N,c,c.mode,D),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&D)){var J=V.memoizedProps;if(R=R.compare,R=R!==null?R:cf,R(J,N)&&s.ref===c.ref)return ia(s,c,D)}return c.flags|=1,s=Ha(V,N),s.ref=c.ref,s.return=c,c.child=s}function Eb(s,c,R,N,D){if(s!==null){var V=s.memoizedProps;if(cf(V,N)&&s.ref===c.ref)if(tn=!1,c.pendingProps=N=V,(s.lanes&D)!==0)s.flags&131072&&(tn=!0);else return c.lanes=s.lanes,ia(s,c,D)}return j0(s,c,R,N,D)}function Ob(s,c,R){var N=c.pendingProps,D=N.children,V=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Gl,_n),_n|=R;else{if(!(R&1073741824))return s=V!==null?V.baseLanes|R:R,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Mt(Gl,_n),_n|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=V!==null?V.baseLanes:R,Mt(Gl,_n),_n|=N}else V!==null?(N=V.baseLanes|R,c.memoizedState=null):N=R,Mt(Gl,_n),_n|=N;return qr(s,c,D,R),c.child}function xb(s,c){var R=c.ref;(s===null&&R!==null||s!==null&&s.ref!==R)&&(c.flags|=512,c.flags|=2097152)}function j0(s,c,R,N,D){var V=en(R)?Lo:Ir.current;return V=Ll(c,V),zl(c,D),R=C0(s,c,R,N,V,D),N=k0(),s!==null&&!tn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~D,ia(s,c,D)):(Bt&&N&&c0(c),c.flags|=1,qr(s,c,R,D),c.child)}function Pb(s,c,R,N,D){if(en(R)){var V=!0;ef(c)}else V=!1;if(zl(c,D),c.stateNode===null)Of(s,c),pb(c,R,N),N0(c,R,N,D),N=!0;else if(s===null){var J=c.stateNode,le=c.memoizedProps;J.props=le;var pe=J.context,Re=R.contextType;typeof Re=="object"&&Re!==null?Re=Dn(Re):(Re=en(R)?Lo:Ir.current,Re=Ll(c,Re));var $e=R.getDerivedStateFromProps,it=typeof $e=="function"||typeof J.getSnapshotBeforeUpdate=="function";it||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==N||pe!==Re)&&gb(c,J,N,Re),Da=!1;var je=c.memoizedState;J.state=je,gf(c,N,J,D),pe=c.memoizedState,le!==N||je!==pe||Jr.current||Da?(typeof $e=="function"&&(L0(c,R,$e,N),pe=c.memoizedState),(le=Da||hb(c,R,le,N,je,pe,Re))?(it||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(c.flags|=4194308)):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=pe),J.props=N,J.state=pe,J.context=Re,N=le):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{J=c.stateNode,H2(s,c),le=c.memoizedProps,Re=c.type===c.elementType?le:ti(c.type,le),J.props=Re,it=c.pendingProps,je=J.context,pe=R.contextType,typeof pe=="object"&&pe!==null?pe=Dn(pe):(pe=en(R)?Lo:Ir.current,pe=Ll(c,pe));var jt=R.getDerivedStateFromProps;($e=typeof jt=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==it||je!==pe)&&gb(c,J,N,pe),Da=!1,je=c.memoizedState,J.state=je,gf(c,N,J,D);var At=c.memoizedState;le!==it||je!==At||Jr.current||Da?(typeof jt=="function"&&(L0(c,R,jt,N),At=c.memoizedState),(Re=Da||hb(c,R,Re,N,je,At,pe)||!1)?($e||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(N,At,pe),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(N,At,pe)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||le===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=At),J.props=N,J.state=At,J.context=pe,N=Re):(typeof J.componentDidUpdate!="function"||le===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),N=!1)}return F0(s,c,R,N,V,D)}function F0(s,c,R,N,D,V){xb(s,c);var J=(c.flags&128)!==0;if(!N&&!J)return D&&C2(c,R,!1),ia(s,c,V);N=c.stateNode,tE.current=c;var le=J&&typeof R.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&J?(c.child=jl(c,s.child,null,V),c.child=jl(c,null,le,V)):qr(s,c,le,V),c.memoizedState=N.state,D&&C2(c,R,!0),c.child}function Cb(s){var c=s.stateNode;c.pendingContext?x2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&x2(s,c.context,!1),w0(s,c.containerInfo)}function kb(s,c,R,N,D){return Dl(),p0(D),c.flags|=256,qr(s,c,R,N),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Tb(s,c,R){var N=c.pendingProps,D=Gt.current,V=!1,J=(c.flags&128)!==0,le;if((le=J)||(le=s!==null&&s.memoizedState===null?!1:(D&2)!==0),le?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(D|=1),Mt(Gt,D&1),s===null)return h0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?yn(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=N.children,s=N.fallback,V?(N=c.mode,V=c.child,J={mode:"hidden",children:J},!(N&1)&&V!==null?(V.childLanes=0,V.pendingProps=J):V=$f(J,N,0,null),s=Ho(s,N,R,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=B0(R),c.memoizedState=z0,s):U0(c,J));if(D=s.memoizedState,D!==null&&(le=D.dehydrated,le!==null))return rE(s,c,J,N,le,D,R);if(V){V=N.fallback,J=c.mode,D=s.child,le=D.sibling;var pe={mode:"hidden",children:N.children};return!(J&1)&&c.child!==D?(N=c.child,N.childLanes=0,N.pendingProps=pe,c.deletions=null):(N=Ha(D,pe),N.subtreeFlags=D.subtreeFlags&14680064),le!==null?V=Ha(le,V):(V=Ho(V,J,R,null),V.flags|=2),V.return=c,N.return=c,N.sibling=V,c.child=N,N=V,V=c.child,J=s.child.memoizedState,J=J===null?B0(R):{baseLanes:J.baseLanes|R,cachePool:null,transitions:J.transitions},V.memoizedState=J,V.childLanes=s.childLanes&~R,c.memoizedState=z0,N}return V=s.child,s=V.sibling,N=Ha(V,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=R),N.return=c,N.sibling=null,s!==null&&(R=c.deletions,R===null?(c.deletions=[s],c.flags|=16):R.push(s)),c.child=N,c.memoizedState=null,N}function U0(s,c){return c=$f({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Ef(s,c,R,N){return N!==null&&p0(N),jl(c,s.child,null,R),s=U0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function rE(s,c,R,N,D,V,J){if(R)return c.flags&256?(c.flags&=-257,N=I0(Error(o(422))),Ef(s,c,J,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=N.fallback,D=c.mode,N=$f({mode:"visible",children:N.children},D,0,null),V=Ho(V,D,J,null),V.flags|=2,N.return=c,V.return=c,N.sibling=V,c.child=N,c.mode&1&&jl(c,s.child,null,J),c.child.memoizedState=B0(J),c.memoizedState=z0,V);if(!(c.mode&1))return Ef(s,c,J,null);if(yn(D))return N=Zn(D).digest,V=Error(o(419)),N=I0(V,N,void 0),Ef(s,c,J,N);if(R=(J&s.childLanes)!==0,tn||R){if(N=br,N!==null){switch(J&-J){case 4:D=2;break;case 16:D=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:D=32;break;case 536870912:D=268435456;break;default:D=0}D=D&(N.suspendedLanes|J)?0:D,D!==0&&D!==V.retryLane&&(V.retryLane=D,ki(s,D),zn(N,s,D,-1))}return l1(),N=I0(Error(o(421))),Ef(s,c,J,N)}return mn(D)?(c.flags|=128,c.child=s.child,c=gE.bind(null,s),Ei(D,c),null):(s=V.treeContext,ne&&(In=Xt(D),bn=c,Bt=!0,ei=null,su=!1,s!==null&&(Ln[Nn++]=ta,Ln[Nn++]=ra,Ln[Nn++]=No,ta=s.id,ra=s.overflow,No=c)),c=U0(c,N.children),c.flags|=4096,c)}function Ab(s,c,R){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),y0(s.return,c,R)}function H0(s,c,R,N,D){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:R,tailMode:D}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=N,V.tail=R,V.tailMode=D)}function Rb(s,c,R){var N=c.pendingProps,D=N.revealOrder,V=N.tail;if(qr(s,c,N.children,R),N=Gt.current,N&2)N=N&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Ab(s,R,c);else if(s.tag===19)Ab(s,R,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}N&=1}if(Mt(Gt,N),!(c.mode&1))c.memoizedState=null;else switch(D){case"forwards":for(R=c.child,D=null;R!==null;)s=R.alternate,s!==null&&vf(s)===null&&(D=R),R=R.sibling;R=D,R===null?(D=c.child,c.child=null):(D=R.sibling,R.sibling=null),H0(c,!1,D,R,V);break;case"backwards":for(R=null,D=c.child,c.child=null;D!==null;){if(s=D.alternate,s!==null&&vf(s)===null){c.child=D;break}s=D.sibling,D.sibling=R,R=D,D=s}H0(c,!0,R,null,V);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Of(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function ia(s,c,R){if(s!==null&&(c.dependencies=s.dependencies),Fo|=c.lanes,!(R&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,R=Ha(s,s.pendingProps),c.child=R,R.return=c;s.sibling!==null;)s=s.sibling,R=R.sibling=Ha(s,s.pendingProps),R.return=c;R.sibling=null}return c.child}function nE(s,c,R){switch(c.tag){case 3:Cb(c),Dl();break;case 5:V2(c);break;case 1:en(c.type)&&ef(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:B2(c,c.type._context,c.memoizedProps.value);break;case 13:var N=c.memoizedState;if(N!==null)return N.dehydrated!==null?(Mt(Gt,Gt.current&1),c.flags|=128,null):R&c.child.childLanes?Tb(s,c,R):(Mt(Gt,Gt.current&1),s=ia(s,c,R),s!==null?s.sibling:null);Mt(Gt,Gt.current&1);break;case 19:if(N=(R&c.childLanes)!==0,s.flags&128){if(N)return Rb(s,c,R);c.flags|=128}var D=c.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),Mt(Gt,Gt.current),N)break;return null;case 22:case 23:return c.lanes=0,Ob(s,c,R)}return ia(s,c,R)}function Ri(s){s.flags|=4}function Mb(s,c){if(s!==null&&s.child===c.child)return!0;if(c.flags&16)return!1;for(s=c.child;s!==null;){if(s.flags&12854||s.subtreeFlags&12854)return!1;s=s.sibling}return!0}var vu,mu,xf,Pf;if(te)vu=function(s,c){for(var R=c.child;R!==null;){if(R.tag===5||R.tag===6)z(s,R.stateNode);else if(R.tag!==4&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===c)break;for(;R.sibling===null;){if(R.return===null||R.return===c)return;R=R.return}R.sibling.return=R.return,R=R.sibling}},mu=function(){},xf=function(s,c,R,N,D){if(s=s.memoizedProps,s!==N){var V=c.stateNode,J=Ti(jn.current);R=K(V,R,s,N,D,J),(c.updateQueue=R)&&Ri(c)}},Pf=function(s,c,R,N){R!==N&&Ri(c)};else if(ee){vu=function(s,c,R,N){for(var D=c.child;D!==null;){if(D.tag===5){var V=D.stateNode;R&&N&&(V=Ot(V,D.type,D.memoizedProps,D)),z(s,V)}else if(D.tag===6)V=D.stateNode,R&&N&&(V=Lr(V,D.memoizedProps,D)),z(s,V);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)V=D.child,V!==null&&(V.return=D),vu(s,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===c)break;for(;D.sibling===null;){if(D.return===null||D.return===c)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};var Lb=function(s,c,R,N){for(var D=c.child;D!==null;){if(D.tag===5){var V=D.stateNode;R&&N&&(V=Ot(V,D.type,D.memoizedProps,D)),Fe(s,V)}else if(D.tag===6)V=D.stateNode,R&&N&&(V=Lr(V,D.memoizedProps,D)),Fe(s,V);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)V=D.child,V!==null&&(V.return=D),Lb(s,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===c)break;for(;D.sibling===null;){if(D.return===null||D.return===c)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};mu=function(s,c){var R=c.stateNode;if(!Mb(s,c)){s=R.containerInfo;var N=xe(s);Lb(N,c,!1,!1),R.pendingChildren=N,Ri(c),tt(s,N)}},xf=function(s,c,R,N,D){var V=s.stateNode,J=s.memoizedProps;if((s=Mb(s,c))&&J===N)c.stateNode=V;else{var le=c.stateNode,pe=Ti(jn.current),Re=null;J!==N&&(Re=K(le,R,J,N,D,pe)),s&&Re===null?c.stateNode=V:(V=Mr(V,Re,R,J,N,c,s,le),q(V,R,N,D,pe)&&Ri(c),c.stateNode=V,s?Ri(c):vu(V,c,!1,!1))}},Pf=function(s,c,R,N){R!==N?(s=Ti(Bl.current),R=Ti(jn.current),c.stateNode=$(N,s,R,c),Ri(c)):c.stateNode=s.stateNode}}else mu=function(){},xf=function(){},Pf=function(){};function yu(s,c){if(!Bt)switch(s.tailMode){case"hidden":c=s.tail;for(var R=null;c!==null;)c.alternate!==null&&(R=c),c=c.sibling;R===null?s.tail=null:R.sibling=null;break;case"collapsed":R=s.tail;for(var N=null;R!==null;)R.alternate!==null&&(N=R),R=R.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function jr(s){var c=s.alternate!==null&&s.alternate.child===s.child,R=0,N=0;if(c)for(var D=s.child;D!==null;)R|=D.lanes|D.childLanes,N|=D.subtreeFlags&14680064,N|=D.flags&14680064,D.return=s,D=D.sibling;else for(D=s.child;D!==null;)R|=D.lanes|D.childLanes,N|=D.subtreeFlags,N|=D.flags,D.return=s,D=D.sibling;return s.subtreeFlags|=N,s.childLanes=R,c}function iE(s,c,R){var N=c.pendingProps;switch(f0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jr(c),null;case 1:return en(c.type)&&Jc(),jr(c),null;case 3:return R=c.stateNode,Ul(),Dt(Jr),Dt(Ir),O0(),R.pendingContext&&(R.context=R.pendingContext,R.pendingContext=null),(s===null||s.child===null)&&(uf(c)?Ri(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ei!==null&&(a1(ei),ei=null))),mu(s,c),jr(c),null;case 5:S0(c),R=Ti(Bl.current);var D=c.type;if(s!==null&&c.stateNode!=null)xf(s,c,D,N,R),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return jr(c),null}if(s=Ti(jn.current),uf(c)){if(!ne)throw Error(o(175));s=Ct(c.stateNode,c.type,c.memoizedProps,R,s,c,!su),c.updateQueue=s,s!==null&&Ri(c)}else{var V=L(D,N,R,s,c);vu(V,c,!1,!1),c.stateNode=V,q(V,D,N,R,s)&&Ri(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return jr(c),null;case 6:if(s&&c.stateNode!=null)Pf(s,c,s.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(o(166));if(s=Ti(Bl.current),R=Ti(jn.current),uf(c)){if(!ne)throw Error(o(176));if(s=c.stateNode,R=c.memoizedProps,(N=or(s,R,c,!su))&&(D=bn,D!==null))switch(D.tag){case 3:Ro(D.stateNode.containerInfo,s,R,(D.mode&1)!==0);break;case 5:Mo(D.type,D.memoizedProps,D.stateNode,s,R,(D.mode&1)!==0)}N&&Ri(c)}else c.stateNode=$(N,s,R,c)}return jr(c),null;case 13:if(Dt(Gt),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Bt&&In!==null&&c.mode&1&&!(c.flags&128))D2(),Dl(),c.flags|=98560,D=!1;else if(D=uf(c),N!==null&&N.dehydrated!==null){if(s===null){if(!D)throw Error(o(318));if(!ne)throw Error(o(344));if(D=c.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(o(317));Nr(D,c)}else Dl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;jr(c),D=!1}else ei!==null&&(a1(ei),ei=null),D=!0;if(!D)return c.flags&65536?c:null}return c.flags&128?(c.lanes=R,c):(R=N!==null,R!==(s!==null&&s.memoizedState!==null)&&R&&(c.child.flags|=8192,c.mode&1&&(s===null||Gt.current&1?ur===0&&(ur=3):l1())),c.updateQueue!==null&&(c.flags|=4),jr(c),null);case 4:return Ul(),mu(s,c),s===null&&ce(c.stateNode.containerInfo),jr(c),null;case 10:return m0(c.type._context),jr(c),null;case 17:return en(c.type)&&Jc(),jr(c),null;case 19:if(Dt(Gt),D=c.memoizedState,D===null)return jr(c),null;if(N=(c.flags&128)!==0,V=D.rendering,V===null)if(N)yu(D,!1);else{if(ur!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=vf(s),V!==null){for(c.flags|=128,yu(D,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=R,R=c.child;R!==null;)N=R,D=s,N.flags&=14680066,V=N.alternate,V===null?(N.childLanes=0,N.lanes=D,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=V.childLanes,N.lanes=V.lanes,N.child=V.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=V.memoizedProps,N.memoizedState=V.memoizedState,N.updateQueue=V.updateQueue,N.type=V.type,D=V.dependencies,N.dependencies=D===null?null:{lanes:D.lanes,firstContext:D.firstContext}),R=R.sibling;return Mt(Gt,Gt.current&1|2),c.child}s=s.sibling}D.tail!==null&&mr()>t1&&(c.flags|=128,N=!0,yu(D,!1),c.lanes=4194304)}else{if(!N)if(s=vf(V),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),yu(D,!0),D.tail===null&&D.tailMode==="hidden"&&!V.alternate&&!Bt)return jr(c),null}else 2*mr()-D.renderingStartTime>t1&&R!==1073741824&&(c.flags|=128,N=!0,yu(D,!1),c.lanes=4194304);D.isBackwards?(V.sibling=c.child,c.child=V):(s=D.last,s!==null?s.sibling=V:c.child=V,D.last=V)}return D.tail!==null?(c=D.tail,D.rendering=c,D.tail=c.sibling,D.renderingStartTime=mr(),c.sibling=null,s=Gt.current,Mt(Gt,N?s&1|2:s&1),c):(jr(c),null);case 22:case 23:return o1(),R=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==R&&(c.flags|=8192),R&&c.mode&1?_n&1073741824&&(jr(c),te&&c.subtreeFlags&6&&(c.flags|=8192)):jr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function aE(s,c){switch(f0(c),c.tag){case 1:return en(c.type)&&Jc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ul(),Dt(Jr),Dt(Ir),O0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return S0(c),null;case 13:if(Dt(Gt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));Dl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Dt(Gt),null;case 4:return Ul(),null;case 10:return m0(c.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var Cf=!1,Fr=!1,oE=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function $l(s,c){var R=s.ref;if(R!==null)if(typeof R=="function")try{R(null)}catch(N){Ut(s,c,N)}else R.current=null}function $0(s,c,R){try{R()}catch(N){Ut(s,c,N)}}var Nb=!1;function lE(s,c){for(j(s.containerInfo),Ue=c;Ue!==null;)if(s=Ue,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Ue=c;else for(;Ue!==null;){s=Ue;try{var R=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(R!==null){var N=R.memoizedProps,D=R.memoizedState,V=s.stateNode,J=V.getSnapshotBeforeUpdate(s.elementType===s.type?N:ti(s.type,N),D);V.__reactInternalSnapshotBeforeUpdate=J}break;case 3:te&&Ke(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(le){Ut(s,s.return,le)}if(c=s.sibling,c!==null){c.return=s.return,Ue=c;break}Ue=s.return}return R=Nb,Nb=!1,R}function bu(s,c,R){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var D=N=N.next;do{if((D.tag&s)===s){var V=D.destroy;D.destroy=void 0,V!==void 0&&$0(c,R,V)}D=D.next}while(D!==N)}}function kf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var R=c=c.next;do{if((R.tag&s)===s){var N=R.create;R.destroy=N()}R=R.next}while(R!==c)}}function G0(s){var c=s.ref;if(c!==null){var R=s.stateNode;switch(s.tag){case 5:s=Q(R);break;default:s=R}typeof c=="function"?c(s):c.current=s}}function Ib(s){var c=s.alternate;c!==null&&(s.alternate=null,Ib(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Te(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Db(s){return s.tag===5||s.tag===3||s.tag===4}function jb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Db(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function V0(s,c,R){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?fe(R,s,c):Ce(R,s);else if(N!==4&&(s=s.child,s!==null))for(V0(s,c,R),s=s.sibling;s!==null;)V0(s,c,R),s=s.sibling}function q0(s,c,R){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?ue(R,s,c):Ae(R,s);else if(N!==4&&(s=s.child,s!==null))for(q0(s,c,R),s=s.sibling;s!==null;)q0(s,c,R),s=s.sibling}var xr=null,ri=!1;function Mi(s,c,R){for(R=R.child;R!==null;)W0(s,c,R),R=R.sibling}function W0(s,c,R){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(af,R)}catch{}switch(R.tag){case 5:Fr||$l(R,c);case 6:if(te){var N=xr,D=ri;xr=null,Mi(s,c,R),xr=N,ri=D,xr!==null&&(ri?_e(xr,R.stateNode):Ye(xr,R.stateNode))}else Mi(s,c,R);break;case 18:te&&xr!==null&&(ri?Ma(xr,R.stateNode):Ji(xr,R.stateNode));break;case 4:te?(N=xr,D=ri,xr=R.stateNode.containerInfo,ri=!0,Mi(s,c,R),xr=N,ri=D):(ee&&(N=R.stateNode.containerInfo,D=xe(N),mt(N,D)),Mi(s,c,R));break;case 0:case 11:case 14:case 15:if(!Fr&&(N=R.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){D=N=N.next;do{var V=D,J=V.destroy;V=V.tag,J!==void 0&&(V&2||V&4)&&$0(R,c,J),D=D.next}while(D!==N)}Mi(s,c,R);break;case 1:if(!Fr&&($l(R,c),N=R.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=R.memoizedProps,N.state=R.memoizedState,N.componentWillUnmount()}catch(le){Ut(R,c,le)}Mi(s,c,R);break;case 21:Mi(s,c,R);break;case 22:R.mode&1?(Fr=(N=Fr)||R.memoizedState!==null,Mi(s,c,R),Fr=N):Mi(s,c,R);break;default:Mi(s,c,R)}}function Fb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var R=s.stateNode;R===null&&(R=s.stateNode=new oE),c.forEach(function(N){var D=vE.bind(null,s,N);R.has(N)||(R.add(N),N.then(D,D))})}}function ni(s,c){var R=c.deletions;if(R!==null)for(var N=0;N<R.length;N++){var D=R[N];try{var V=s,J=c;if(te){var le=J;e:for(;le!==null;){switch(le.tag){case 5:xr=le.stateNode,ri=!1;break e;case 3:xr=le.stateNode.containerInfo,ri=!0;break e;case 4:xr=le.stateNode.containerInfo,ri=!0;break e}le=le.return}if(xr===null)throw Error(o(160));W0(V,J,D),xr=null,ri=!1}else W0(V,J,D);var pe=D.alternate;pe!==null&&(pe.return=null),D.return=null}catch(Re){Ut(D,c,Re)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)zb(c,s),c=c.sibling}function zb(s,c){var R=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ni(c,s),Li(s),N&4){try{bu(3,s,s.return),kf(3,s)}catch(je){Ut(s,s.return,je)}try{bu(5,s,s.return)}catch(je){Ut(s,s.return,je)}}break;case 1:ni(c,s),Li(s),N&512&&R!==null&&$l(R,R.return);break;case 5:if(ni(c,s),Li(s),N&512&&R!==null&&$l(R,R.return),te){if(s.flags&32){var D=s.stateNode;try{De(D)}catch(je){Ut(s,s.return,je)}}if(N&4&&(D=s.stateNode,D!=null)){var V=s.memoizedProps;if(R=R!==null?R.memoizedProps:V,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Ze(D,c,N,R,V,s)}catch(je){Ut(s,s.return,je)}}}break;case 6:if(ni(c,s),Li(s),N&4&&te){if(s.stateNode===null)throw Error(o(162));D=s.stateNode,V=s.memoizedProps,R=R!==null?R.memoizedProps:V;try{ke(D,R,V)}catch(je){Ut(s,s.return,je)}}break;case 3:if(ni(c,s),Li(s),N&4){if(te&&ne&&R!==null&&R.memoizedState.isDehydrated)try{Mn(c.containerInfo)}catch(je){Ut(s,s.return,je)}if(ee){D=c.containerInfo,V=c.pendingChildren;try{mt(D,V)}catch(je){Ut(s,s.return,je)}}}break;case 4:if(ni(c,s),Li(s),N&4&&ee){V=s.stateNode,D=V.containerInfo,V=V.pendingChildren;try{mt(D,V)}catch(je){Ut(s,s.return,je)}}break;case 13:ni(c,s),Li(s),D=s.child,D.flags&8192&&(V=D.memoizedState!==null,D.stateNode.isHidden=V,!V||D.alternate!==null&&D.alternate.memoizedState!==null||(e1=mr())),N&4&&Fb(s);break;case 22:var J=R!==null&&R.memoizedState!==null;if(s.mode&1?(Fr=(R=Fr)||J,ni(c,s),Fr=R):ni(c,s),Li(s),N&8192){if(R=s.memoizedState!==null,(s.stateNode.isHidden=R)&&!J&&s.mode&1)for(Ue=s,N=s.child;N!==null;){for(c=Ue=N;Ue!==null;){J=Ue;var le=J.child;switch(J.tag){case 0:case 11:case 14:case 15:bu(4,J,J.return);break;case 1:$l(J,J.return);var pe=J.stateNode;if(typeof pe.componentWillUnmount=="function"){var Re=J,$e=J.return;try{var it=Re;pe.props=it.memoizedProps,pe.state=it.memoizedState,pe.componentWillUnmount()}catch(je){Ut(Re,$e,je)}}break;case 5:$l(J,J.return);break;case 22:if(J.memoizedState!==null){Hb(c);continue}}le!==null?(le.return=J,Ue=le):Hb(c)}N=N.sibling}if(te){e:if(N=null,te)for(c=s;;){if(c.tag===5){if(N===null){N=c;try{D=c.stateNode,R?Le(D):Qe(c.stateNode,c.memoizedProps)}catch(je){Ut(s,s.return,je)}}}else if(c.tag===6){if(N===null)try{V=c.stateNode,R?we(V):Se(V,c.memoizedProps)}catch(je){Ut(s,s.return,je)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;N===c&&(N=null),c=c.return}N===c&&(N=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ni(c,s),Li(s),N&4&&Fb(s);break;case 21:break;default:ni(c,s),Li(s)}}function Li(s){var c=s.flags;if(c&2){try{if(te){e:{for(var R=s.return;R!==null;){if(Db(R)){var N=R;break e}R=R.return}throw Error(o(160))}switch(N.tag){case 5:var D=N.stateNode;N.flags&32&&(De(D),N.flags&=-33);var V=jb(s);q0(s,V,D);break;case 3:case 4:var J=N.stateNode.containerInfo,le=jb(s);V0(s,le,J);break;default:throw Error(o(161))}}}catch(pe){Ut(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function sE(s,c,R){Ue=s,Bb(s)}function Bb(s,c,R){for(var N=(s.mode&1)!==0;Ue!==null;){var D=Ue,V=D.child;if(D.tag===22&&N){var J=D.memoizedState!==null||Cf;if(!J){var le=D.alternate,pe=le!==null&&le.memoizedState!==null||Fr;le=Cf;var Re=Fr;if(Cf=J,(Fr=pe)&&!Re)for(Ue=D;Ue!==null;)J=Ue,pe=J.child,J.tag===22&&J.memoizedState!==null?$b(D):pe!==null?(pe.return=J,Ue=pe):$b(D);for(;V!==null;)Ue=V,Bb(V),V=V.sibling;Ue=D,Cf=le,Fr=Re}Ub(s)}else D.subtreeFlags&8772&&V!==null?(V.return=D,Ue=V):Ub(s)}}function Ub(s){for(;Ue!==null;){var c=Ue;if(c.flags&8772){var R=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Fr||kf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Fr)if(R===null)N.componentDidMount();else{var D=c.elementType===c.type?R.memoizedProps:ti(c.type,R.memoizedProps);N.componentDidUpdate(D,R.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&G2(c,V,N);break;case 3:var J=c.updateQueue;if(J!==null){if(R=null,c.child!==null)switch(c.child.tag){case 5:R=Q(c.child.stateNode);break;case 1:R=c.child.stateNode}G2(c,J,R)}break;case 5:var le=c.stateNode;R===null&&c.flags&4&&Ne(le,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ne&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var Re=pe.memoizedState;if(Re!==null){var $e=Re.dehydrated;$e!==null&&Oi($e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Fr||c.flags&512&&G0(c)}catch(it){Ut(c,c.return,it)}}if(c===s){Ue=null;break}if(R=c.sibling,R!==null){R.return=c.return,Ue=R;break}Ue=c.return}}function Hb(s){for(;Ue!==null;){var c=Ue;if(c===s){Ue=null;break}var R=c.sibling;if(R!==null){R.return=c.return,Ue=R;break}Ue=c.return}}function $b(s){for(;Ue!==null;){var c=Ue;try{switch(c.tag){case 0:case 11:case 15:var R=c.return;try{kf(4,c)}catch(pe){Ut(c,R,pe)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var D=c.return;try{N.componentDidMount()}catch(pe){Ut(c,D,pe)}}var V=c.return;try{G0(c)}catch(pe){Ut(c,V,pe)}break;case 5:var J=c.return;try{G0(c)}catch(pe){Ut(c,J,pe)}}}catch(pe){Ut(c,c.return,pe)}if(c===s){Ue=null;break}var le=c.sibling;if(le!==null){le.return=c.return,Ue=le;break}Ue=c.return}}var Tf=0,Af=1,Rf=2,Mf=3,Lf=4;if(typeof Symbol=="function"&&Symbol.for){var _u=Symbol.for;Tf=_u("selector.component"),Af=_u("selector.has_pseudo_class"),Rf=_u("selector.role"),Mf=_u("selector.test_id"),Lf=_u("selector.text")}function K0(s){var c=ie(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=ve(s),s===null)throw Error(o(362));return s.stateNode.current}function Y0(s,c){switch(c.$$typeof){case Tf:if(s.type===c.value)return!0;break;case Af:e:{c=c.value,s=[s,0];for(var R=0;R<s.length;){var N=s[R++],D=s[R++],V=c[D];if(N.tag!==5||!be(N)){for(;V!=null&&Y0(N,V);)D++,V=c[D];if(D===c.length){c=!0;break e}else for(N=N.child;N!==null;)s.push(N,D),N=N.sibling}}c=!1}return c;case Rf:if(s.tag===5&&Ee(s.stateNode,c.value))return!0;break;case Lf:if((s.tag===5||s.tag===6)&&(s=oe(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Mf:if(s.tag===5&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function X0(s){switch(s.$$typeof){case Tf:return"<"+(C(s.value)||"Unknown")+">";case Af:return":has("+(X0(s)||"")+")";case Rf:return'[role="'+s.value+'"]';case Lf:return'"'+s.value+'"';case Mf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Gb(s,c){var R=[];s=[s,0];for(var N=0;N<s.length;){var D=s[N++],V=s[N++],J=c[V];if(D.tag!==5||!be(D)){for(;J!=null&&Y0(D,J);)V++,J=c[V];if(V===c.length)R.push(D);else for(D=D.child;D!==null;)s.push(D,V),D=D.sibling}}return R}function Z0(s,c){if(!ye)throw Error(o(363));s=K0(s),s=Gb(s,c),c=[],s=Array.from(s);for(var R=0;R<s.length;){var N=s[R++];if(N.tag===5)be(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var uE=Math.ceil,Nf=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,er=l.ReactCurrentBatchConfig,ft=0,br=null,nr=null,Pr=0,_n=0,Gl=Na(0),ur=0,wu=null,Fo=0,If=0,J0=0,Su=null,rn=null,e1=0,t1=1/0,aa=null;function Vl(){t1=mr()+500}var Df=!1,r1=null,Fa=null,jf=!1,za=null,Ff=0,Eu=0,n1=null,zf=-1,Bf=0;function zr(){return ft&6?mr():zf!==-1?zf:zf=mr()}function Ba(s){return s.mode&1?ft&2&&Pr!==0?Pr&-Pr:VS.transition!==null?(Bf===0&&(Bf=k2()),Bf):(s=bt,s!==0?s:Oe()):1}function zn(s,c,R,N){if(50<Eu)throw Eu=0,n1=null,Error(o(185));lu(s,R,N),(!(ft&2)||s!==br)&&(s===br&&(!(ft&2)&&(If|=R),ur===4&&Ua(s,Pr)),nn(s,N),R===1&&ft===0&&!(c.mode&1)&&(Vl(),of&&Ci()))}function nn(s,c){var R=s.callbackNode;DS(s,c);var N=nf(s,s===br?Pr:0);if(N===0)R!==null&&A2(R),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(R!=null&&A2(R),c===1)s.tag===0?GS(qb.bind(null,s)):R2(qb.bind(null,s)),ae?de(function(){!(ft&6)&&Ci()}):o0(l0,Ci),R=null;else{switch(T2(N)){case 1:R=l0;break;case 4:R=BS;break;case 16:R=s0;break;case 536870912:R=US;break;default:R=s0}R=t3(R,Vb.bind(null,s))}s.callbackPriority=c,s.callbackNode=R}}function Vb(s,c){if(zf=-1,Bf=0,ft&6)throw Error(o(327));var R=s.callbackNode;if(Uo()&&s.callbackNode!==R)return null;var N=nf(s,s===br?Pr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=Uf(s,N);else{c=N;var D=ft;ft|=2;var V=Yb();(br!==s||Pr!==c)&&(aa=null,Vl(),zo(s,c));do try{dE();break}catch(le){Kb(s,le)}while(!0);v0(),Nf.current=V,ft=D,nr!==null?c=0:(br=null,Pr=0,c=ur)}if(c!==0){if(c===2&&(D=n0(s),D!==0&&(N=D,c=i1(s,D))),c===1)throw R=wu,zo(s,0),Ua(s,N),nn(s,mr()),R;if(c===6)Ua(s,N);else{if(D=s.current.alternate,!(N&30)&&!cE(D)&&(c=Uf(s,N),c===2&&(V=n0(s),V!==0&&(N=V,c=i1(s,V))),c===1))throw R=wu,zo(s,0),Ua(s,N),nn(s,mr()),R;switch(s.finishedWork=D,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:Bo(s,rn,aa);break;case 3:if(Ua(s,N),(N&130023424)===N&&(c=e1+500-mr(),10<c)){if(nf(s,0)!==0)break;if(D=s.suspendedLanes,(D&N)!==N){zr(),s.pingedLanes|=s.suspendedLanes&D;break}s.timeoutHandle=B(Bo.bind(null,s,rn,aa),c);break}Bo(s,rn,aa);break;case 4:if(Ua(s,N),(N&4194240)===N)break;for(c=s.eventTimes,D=-1;0<N;){var J=31-Qn(N);V=1<<J,J=c[J],J>D&&(D=J),N&=~V}if(N=D,N=mr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*uE(N/1960))-N,10<N){s.timeoutHandle=B(Bo.bind(null,s,rn,aa),N);break}Bo(s,rn,aa);break;case 5:Bo(s,rn,aa);break;default:throw Error(o(329))}}}return nn(s,mr()),s.callbackNode===R?Vb.bind(null,s):null}function i1(s,c){var R=Su;return s.current.memoizedState.isDehydrated&&(zo(s,c).flags|=256),s=Uf(s,c),s!==2&&(c=rn,rn=R,c!==null&&a1(c)),s}function a1(s){rn===null?rn=s:rn.push.apply(rn,s)}function cE(s){for(var c=s;;){if(c.flags&16384){var R=c.updateQueue;if(R!==null&&(R=R.stores,R!==null))for(var N=0;N<R.length;N++){var D=R[N],V=D.getSnapshot;D=D.value;try{if(!Jn(V(),D))return!1}catch{return!1}}}if(R=c.child,c.subtreeFlags&16384&&R!==null)R.return=c,c=R;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ua(s,c){for(c&=~J0,c&=~If,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var R=31-Qn(c),N=1<<R;s[R]=-1,c&=~N}}function qb(s){if(ft&6)throw Error(o(327));Uo();var c=nf(s,0);if(!(c&1))return nn(s,mr()),null;var R=Uf(s,c);if(s.tag!==0&&R===2){var N=n0(s);N!==0&&(c=N,R=i1(s,N))}if(R===1)throw R=wu,zo(s,0),Ua(s,c),nn(s,mr()),R;if(R===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,Bo(s,rn,aa),nn(s,mr()),null}function Wb(s){za!==null&&za.tag===0&&!(ft&6)&&Uo();var c=ft;ft|=1;var R=er.transition,N=bt;try{if(er.transition=null,bt=1,s)return s()}finally{bt=N,er.transition=R,ft=c,!(ft&6)&&Ci()}}function o1(){_n=Gl.current,Dt(Gl)}function zo(s,c){s.finishedWork=null,s.finishedLanes=0;var R=s.timeoutHandle;if(R!==X&&(s.timeoutHandle=X,Y(R)),nr!==null)for(R=nr.return;R!==null;){var N=R;switch(f0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&Jc();break;case 3:Ul(),Dt(Jr),Dt(Ir),O0();break;case 5:S0(N);break;case 4:Ul();break;case 13:Dt(Gt);break;case 19:Dt(Gt);break;case 10:m0(N.type._context);break;case 22:case 23:o1()}R=R.return}if(br=s,nr=s=Ha(s.current,null),Pr=_n=c,ur=0,wu=null,J0=If=Fo=0,rn=Su=null,Do!==null){for(c=0;c<Do.length;c++)if(R=Do[c],N=R.interleaved,N!==null){R.interleaved=null;var D=N.next,V=R.pending;if(V!==null){var J=V.next;V.next=D,N.next=J}R.pending=N}Do=null}return s}function Kb(s,c){do{var R=nr;try{if(v0(),mf.current=wf,yf){for(var N=Vt.memoizedState;N!==null;){var D=N.queue;D!==null&&(D.pending=null),N=N.next}yf=!1}if(jo=0,yr=sr=Vt=null,du=!1,hu=0,Q0.current=null,R===null||R.return===null){ur=1,wu=c,nr=null;break}e:{var V=s,J=R.return,le=R,pe=c;if(c=Pr,le.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Re=pe,$e=le,it=$e.tag;if(!($e.mode&1)&&(it===0||it===11||it===15)){var je=$e.alternate;je?($e.updateQueue=je.updateQueue,$e.memoizedState=je.memoizedState,$e.lanes=je.lanes):($e.updateQueue=null,$e.memoizedState=null)}var jt=bb(J);if(jt!==null){jt.flags&=-257,_b(jt,J,le,V,c),jt.mode&1&&yb(V,Re,c),c=jt,pe=Re;var At=c.updateQueue;if(At===null){var an=new Set;an.add(pe),c.updateQueue=an}else At.add(pe);break e}else{if(!(c&1)){yb(V,Re,c),l1();break e}pe=Error(o(426))}}else if(Bt&&le.mode&1){var oa=bb(J);if(oa!==null){!(oa.flags&65536)&&(oa.flags|=256),_b(oa,J,le,V,c),p0(Hl(pe,le));break e}}V=pe=Hl(pe,le),ur!==4&&(ur=2),Su===null?Su=[V]:Su.push(V),V=J;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var he=vb(V,pe,c);$2(V,he);break e;case 1:le=pe;var se=V.type,ge=V.stateNode;if(!(V.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(Fa===null||!Fa.has(ge)))){V.flags|=65536,c&=-c,V.lanes|=c;var ze=mb(V,le,c);$2(V,ze);break e}}V=V.return}while(V!==null)}Zb(R)}catch(Xe){c=Xe,nr===R&&R!==null&&(nr=R=R.return);continue}break}while(!0)}function Yb(){var s=Nf.current;return Nf.current=wf,s===null?wf:s}function l1(){(ur===0||ur===3||ur===2)&&(ur=4),br===null||!(Fo&268435455)&&!(If&268435455)||Ua(br,Pr)}function Uf(s,c){var R=ft;ft|=2;var N=Yb();(br!==s||Pr!==c)&&(aa=null,zo(s,c));do try{fE();break}catch(D){Kb(s,D)}while(!0);if(v0(),ft=R,Nf.current=N,nr!==null)throw Error(o(261));return br=null,Pr=0,ur}function fE(){for(;nr!==null;)Xb(nr)}function dE(){for(;nr!==null&&!FS();)Xb(nr)}function Xb(s){var c=e3(s.alternate,s,_n);s.memoizedProps=s.pendingProps,c===null?Zb(s):nr=c,Q0.current=null}function Zb(s){var c=s;do{var R=c.alternate;if(s=c.return,c.flags&32768){if(R=aE(R,c),R!==null){R.flags&=32767,nr=R;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ur=6,nr=null;return}}else if(R=iE(R,c,_n),R!==null){nr=R;return}if(c=c.sibling,c!==null){nr=c;return}nr=c=s}while(c!==null);ur===0&&(ur=5)}function Bo(s,c,R){var N=bt,D=er.transition;try{er.transition=null,bt=1,hE(s,c,R,N)}finally{er.transition=D,bt=N}return null}function hE(s,c,R,N){do Uo();while(za!==null);if(ft&6)throw Error(o(327));R=s.finishedWork;var D=s.finishedLanes;if(R===null)return null;if(s.finishedWork=null,s.finishedLanes=0,R===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=R.lanes|R.childLanes;if(jS(s,V),s===br&&(nr=br=null,Pr=0),!(R.subtreeFlags&2064)&&!(R.flags&2064)||jf||(jf=!0,t3(s0,function(){return Uo(),null})),V=(R.flags&15990)!==0,R.subtreeFlags&15990||V){V=er.transition,er.transition=null;var J=bt;bt=1;var le=ft;ft|=4,Q0.current=null,lE(s,R),zb(R,s),A(s.containerInfo),s.current=R,sE(R),zS(),ft=le,bt=J,er.transition=V}else s.current=R;if(jf&&(jf=!1,za=s,Ff=D),V=s.pendingLanes,V===0&&(Fa=null),HS(R.stateNode),nn(s,mr()),c!==null)for(N=s.onRecoverableError,R=0;R<c.length;R++)D=c[R],N(D.value,{componentStack:D.stack,digest:D.digest});if(Df)throw Df=!1,s=r1,r1=null,s;return Ff&1&&s.tag!==0&&Uo(),V=s.pendingLanes,V&1?s===n1?Eu++:(Eu=0,n1=s):Eu=0,Ci(),null}function Uo(){if(za!==null){var s=T2(Ff),c=er.transition,R=bt;try{if(er.transition=null,bt=16>s?16:s,za===null)var N=!1;else{if(s=za,za=null,Ff=0,ft&6)throw Error(o(331));var D=ft;for(ft|=4,Ue=s.current;Ue!==null;){var V=Ue,J=V.child;if(Ue.flags&16){var le=V.deletions;if(le!==null){for(var pe=0;pe<le.length;pe++){var Re=le[pe];for(Ue=Re;Ue!==null;){var $e=Ue;switch($e.tag){case 0:case 11:case 15:bu(8,$e,V)}var it=$e.child;if(it!==null)it.return=$e,Ue=it;else for(;Ue!==null;){$e=Ue;var je=$e.sibling,jt=$e.return;if(Ib($e),$e===Re){Ue=null;break}if(je!==null){je.return=jt,Ue=je;break}Ue=jt}}}var At=V.alternate;if(At!==null){var an=At.child;if(an!==null){At.child=null;do{var oa=an.sibling;an.sibling=null,an=oa}while(an!==null)}}Ue=V}}if(V.subtreeFlags&2064&&J!==null)J.return=V,Ue=J;else e:for(;Ue!==null;){if(V=Ue,V.flags&2048)switch(V.tag){case 0:case 11:case 15:bu(9,V,V.return)}var he=V.sibling;if(he!==null){he.return=V.return,Ue=he;break e}Ue=V.return}}var se=s.current;for(Ue=se;Ue!==null;){J=Ue;var ge=J.child;if(J.subtreeFlags&2064&&ge!==null)ge.return=J,Ue=ge;else e:for(J=se;Ue!==null;){if(le=Ue,le.flags&2048)try{switch(le.tag){case 0:case 11:case 15:kf(9,le)}}catch(Xe){Ut(le,le.return,Xe)}if(le===J){Ue=null;break e}var ze=le.sibling;if(ze!==null){ze.return=le.return,Ue=ze;break e}Ue=le.return}}if(ft=D,Ci(),Pi&&typeof Pi.onPostCommitFiberRoot=="function")try{Pi.onPostCommitFiberRoot(af,s)}catch{}N=!0}return N}finally{bt=R,er.transition=c}}return!1}function Qb(s,c,R){c=Hl(R,c),c=vb(s,c,1),s=ja(s,c,1),c=zr(),s!==null&&(lu(s,1,c),nn(s,c))}function Ut(s,c,R){if(s.tag===3)Qb(s,s,R);else for(;c!==null;){if(c.tag===3){Qb(c,s,R);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Fa===null||!Fa.has(N))){s=Hl(R,s),s=mb(c,s,1),c=ja(c,s,1),s=zr(),c!==null&&(lu(c,1,s),nn(c,s));break}}c=c.return}}function pE(s,c,R){var N=s.pingCache;N!==null&&N.delete(c),c=zr(),s.pingedLanes|=s.suspendedLanes&R,br===s&&(Pr&R)===R&&(ur===4||ur===3&&(Pr&130023424)===Pr&&500>mr()-e1?zo(s,0):J0|=R),nn(s,c)}function Jb(s,c){c===0&&(s.mode&1?(c=rf,rf<<=1,!(rf&130023424)&&(rf=4194304)):c=1);var R=zr();s=ki(s,c),s!==null&&(lu(s,c,R),nn(s,R))}function gE(s){var c=s.memoizedState,R=0;c!==null&&(R=c.retryLane),Jb(s,R)}function vE(s,c){var R=0;switch(s.tag){case 13:var N=s.stateNode,D=s.memoizedState;D!==null&&(R=D.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),Jb(s,R)}var e3;e3=function(s,c,R){if(s!==null)if(s.memoizedProps!==c.pendingProps||Jr.current)tn=!0;else{if(!(s.lanes&R)&&!(c.flags&128))return tn=!1,nE(s,c,R);tn=!!(s.flags&131072)}else tn=!1,Bt&&c.flags&1048576&&M2(c,sf,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Of(s,c),s=c.pendingProps;var D=Ll(c,Ir.current);zl(c,R),D=C0(null,c,N,s,D,R);var V=k0();return c.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,en(N)?(V=!0,ef(c)):V=!1,c.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,_0(c),D.updater=Sf,c.stateNode=D,D._reactInternals=c,N0(c,N,s,R),c=F0(null,c,N,!0,V,R)):(c.tag=0,Bt&&V&&c0(c),qr(null,c,D,R),c=c.child),c;case 16:N=c.elementType;e:{switch(Of(s,c),s=c.pendingProps,D=N._init,N=D(N._payload),c.type=N,D=c.tag=yE(N),s=ti(N,s),D){case 0:c=j0(null,c,N,s,R);break e;case 1:c=Pb(null,c,N,s,R);break e;case 11:c=wb(null,c,N,s,R);break e;case 14:c=Sb(null,c,N,ti(N.type,s),R);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,D=c.pendingProps,D=c.elementType===N?D:ti(N,D),j0(s,c,N,D,R);case 1:return N=c.type,D=c.pendingProps,D=c.elementType===N?D:ti(N,D),Pb(s,c,N,D,R);case 3:e:{if(Cb(c),s===null)throw Error(o(387));N=c.pendingProps,V=c.memoizedState,D=V.element,H2(s,c),gf(c,N,null,R);var J=c.memoizedState;if(N=J.element,ne&&V.isDehydrated)if(V={element:N,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){D=Hl(Error(o(423)),c),c=kb(s,c,N,R,D);break e}else if(N!==D){D=Hl(Error(o(424)),c),c=kb(s,c,N,R,D);break e}else for(ne&&(In=pt(c.stateNode.containerInfo),bn=c,Bt=!0,ei=null,su=!1),R=z2(c,null,N,R),c.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(Dl(),N===D){c=ia(s,c,R);break e}qr(s,c,N,R)}c=c.child}return c;case 5:return V2(c),s===null&&h0(c),N=c.type,D=c.pendingProps,V=s!==null?s.memoizedProps:null,J=D.children,F(N,D)?J=null:V!==null&&F(N,V)&&(c.flags|=32),xb(s,c),qr(s,c,J,R),c.child;case 6:return s===null&&h0(c),null;case 13:return Tb(s,c,R);case 4:return w0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=jl(c,null,N,R):qr(s,c,N,R),c.child;case 11:return N=c.type,D=c.pendingProps,D=c.elementType===N?D:ti(N,D),wb(s,c,N,D,R);case 7:return qr(s,c,c.pendingProps,R),c.child;case 8:return qr(s,c,c.pendingProps.children,R),c.child;case 12:return qr(s,c,c.pendingProps.children,R),c.child;case 10:e:{if(N=c.type._context,D=c.pendingProps,V=c.memoizedProps,J=D.value,B2(c,N,J),V!==null)if(Jn(V.value,J)){if(V.children===D.children&&!Jr.current){c=ia(s,c,R);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var le=V.dependencies;if(le!==null){J=V.child;for(var pe=le.firstContext;pe!==null;){if(pe.context===N){if(V.tag===1){pe=na(-1,R&-R),pe.tag=2;var Re=V.updateQueue;if(Re!==null){Re=Re.shared;var $e=Re.pending;$e===null?pe.next=pe:(pe.next=$e.next,$e.next=pe),Re.pending=pe}}V.lanes|=R,pe=V.alternate,pe!==null&&(pe.lanes|=R),y0(V.return,R,c),le.lanes|=R;break}pe=pe.next}}else if(V.tag===10)J=V.type===c.type?null:V.child;else if(V.tag===18){if(J=V.return,J===null)throw Error(o(341));J.lanes|=R,le=J.alternate,le!==null&&(le.lanes|=R),y0(J,R,c),J=V.sibling}else J=V.child;if(J!==null)J.return=V;else for(J=V;J!==null;){if(J===c){J=null;break}if(V=J.sibling,V!==null){V.return=J.return,J=V;break}J=J.return}V=J}qr(s,c,D.children,R),c=c.child}return c;case 9:return D=c.type,N=c.pendingProps.children,zl(c,R),D=Dn(D),N=N(D),c.flags|=1,qr(s,c,N,R),c.child;case 14:return N=c.type,D=ti(N,c.pendingProps),D=ti(N.type,D),Sb(s,c,N,D,R);case 15:return Eb(s,c,c.type,c.pendingProps,R);case 17:return N=c.type,D=c.pendingProps,D=c.elementType===N?D:ti(N,D),Of(s,c),c.tag=1,en(N)?(s=!0,ef(c)):s=!1,zl(c,R),pb(c,N,D),N0(c,N,D,R),F0(null,c,N,!0,s,R);case 19:return Rb(s,c,R);case 22:return Ob(s,c,R)}throw Error(o(156,c.tag))};function t3(s,c){return o0(s,c)}function mE(s,c,R,N){this.tag=s,this.key=R,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,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 Bn(s,c,R,N){return new mE(s,c,R,N)}function s1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function yE(s){if(typeof s=="function")return s1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===b)return 11;if(s===y)return 14}return 2}function Ha(s,c){var R=s.alternate;return R===null?(R=Bn(s.tag,c,s.key,s.mode),R.elementType=s.elementType,R.type=s.type,R.stateNode=s.stateNode,R.alternate=s,s.alternate=R):(R.pendingProps=c,R.type=s.type,R.flags=0,R.subtreeFlags=0,R.deletions=null),R.flags=s.flags&14680064,R.childLanes=s.childLanes,R.lanes=s.lanes,R.child=s.child,R.memoizedProps=s.memoizedProps,R.memoizedState=s.memoizedState,R.updateQueue=s.updateQueue,c=s.dependencies,R.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},R.sibling=s.sibling,R.index=s.index,R.ref=s.ref,R}function Hf(s,c,R,N,D,V){var J=2;if(N=s,typeof s=="function")s1(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case h:return Ho(R.children,D,V,c);case E:J=8,D|=8;break;case w:return s=Bn(12,R,c,D|2),s.elementType=w,s.lanes=V,s;case m:return s=Bn(13,R,c,D),s.elementType=m,s.lanes=V,s;case v:return s=Bn(19,R,c,D),s.elementType=v,s.lanes=V,s;case g:return $f(R,D,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case p:J=10;break e;case S:J=9;break e;case b:J=11;break e;case y:J=14;break e;case d:J=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Bn(J,R,c,D),c.elementType=s,c.type=N,c.lanes=V,c}function Ho(s,c,R,N){return s=Bn(7,s,N,c),s.lanes=R,s}function $f(s,c,R,N){return s=Bn(22,s,N,c),s.elementType=g,s.lanes=R,s.stateNode={isHidden:!1},s}function u1(s,c,R){return s=Bn(6,s,null,c),s.lanes=R,s}function c1(s,c,R){return c=Bn(4,s.children!==null?s.children:[],s.key,c),c.lanes=R,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function bE(s,c,R,N,D){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i0(0),this.expirationTimes=i0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i0(0),this.identifierPrefix=N,this.onRecoverableError=D,ne&&(this.mutableSourceEagerHydrationData=null)}function r3(s,c,R,N,D,V,J,le,pe){return s=new bE(s,c,R,le,pe),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Bn(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:N,isDehydrated:R,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(V),s}function n3(s){if(!s)return Ia;s=s._reactInternals;e:{if(O(s)!==s||s.tag!==1)throw Error(o(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(en(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var R=s.type;if(en(R))return P2(s,R,c)}return c}function i3(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=M(c),s===null?null:s.stateNode}function a3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var R=s.retryLane;s.retryLane=R!==0&&R<c?R:c}}function Gf(s,c){a3(s,c),(s=s.alternate)&&a3(s,c)}function _E(s){return s=M(s),s===null?null:s.stateNode}function wE(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=ki(s,134217728);if(c!==null){var R=zr();zn(c,s,134217728,R)}Gf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=ki(s,1);if(c!==null){var R=zr();zn(c,s,1,R)}Gf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Ba(s),R=ki(s,c);if(R!==null){var N=zr();zn(R,s,c,N)}Gf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var R=ou(c.pendingLanes);R!==0&&(a0(c,R|1),nn(c,mr()),!(ft&6)&&(Vl(),Ci()))}break;case 13:Wb(function(){var N=ki(s,1);if(N!==null){var D=zr();zn(N,s,1,D)}}),Gf(s,1)}},r.batchedUpdates=function(s,c){var R=ft;ft|=1;try{return s(c)}finally{ft=R,ft===0&&(Vl(),of&&Ci())}},r.createComponentSelector=function(s){return{$$typeof:Tf,value:s}},r.createContainer=function(s,c,R,N,D,V,J){return r3(s,c,!1,null,R,N,D,V,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Af,value:s}},r.createHydrationContainer=function(s,c,R,N,D,V,J,le,pe){return s=r3(R,N,!0,s,D,V,J,le,pe),s.context=n3(null),R=s.current,N=zr(),D=Ba(R),V=na(N,D),V.callback=c??null,ja(R,V,D),s.current.lanes=D,lu(s,D,N),nn(s,N),s},r.createPortal=function(s,c,R){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:s,containerInfo:c,implementation:R}},r.createRoleSelector=function(s){return{$$typeof:Rf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Mf,value:s}},r.createTextSelector=function(s){return{$$typeof:Lf,value:s}},r.deferredUpdates=function(s){var c=bt,R=er.transition;try{return er.transition=null,bt=16,s()}finally{bt=c,er.transition=R}},r.discreteUpdates=function(s,c,R,N,D){var V=bt,J=er.transition;try{return er.transition=null,bt=1,s(c,R,N,D)}finally{bt=V,er.transition=J,ft===0&&Vl()}},r.findAllNodes=Z0,r.findBoundingRects=function(s,c){if(!ye)throw Error(o(363));c=Z0(s,c),s=[];for(var R=0;R<c.length;R++)s.push(re(c[R]));for(c=s.length-1;0<c;c--){R=s[c];for(var N=R.x,D=N+R.width,V=R.y,J=V+R.height,le=c-1;0<=le;le--)if(c!==le){var pe=s[le],Re=pe.x,$e=Re+pe.width,it=pe.y,je=it+pe.height;if(N>=Re&&V>=it&&D<=$e&&J<=je){s.splice(c,1);break}else if(N!==Re||R.width!==pe.width||je<V||it>J){if(!(V!==it||R.height!==pe.height||$e<N||Re>D)){Re>N&&(pe.width+=Re-N,pe.x=N),$e<D&&(pe.width=D-Re),s.splice(c,1);break}}else{it>V&&(pe.height+=it-V,pe.y=V),je<J&&(pe.height=J-it),s.splice(c,1);break}}}return s},r.findHostInstance=i3,r.findHostInstanceWithNoPortals=function(s){return s=k(s),s=s!==null?H(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return i3(s)},r.flushControlled=function(s){var c=ft;ft|=1;var R=er.transition,N=bt;try{er.transition=null,bt=1,s()}finally{bt=N,er.transition=R,ft=c,ft===0&&(Vl(),Ci())}},r.flushPassiveEffects=Uo,r.flushSync=Wb,r.focusWithin=function(s,c){if(!ye)throw Error(o(363));for(s=K0(s),c=Gb(s,c),c=Array.from(c),s=0;s<c.length;){var R=c[s++];if(!be(R)){if(R.tag===5&&Ge(R.stateNode))return!0;for(R=R.child;R!==null;)c.push(R),R=R.sibling}}return!1},r.getCurrentUpdatePriority=function(){return bt},r.getFindAllNodesFailureDescription=function(s,c){if(!ye)throw Error(o(363));var R=0,N=[];s=[K0(s),0];for(var D=0;D<s.length;){var V=s[D++],J=s[D++],le=c[J];if((V.tag!==5||!be(V))&&(Y0(V,le)&&(N.push(X0(le)),J++,J>R&&(R=J)),J<c.length))for(V=V.child;V!==null;)s.push(V,J),V=V.sibling}if(R<c.length){for(s=[];R<c.length;R++)s.push(X0(c[R]));return`findAllNodes was able to match part of the selector:
58
- `+(N.join(" > ")+`
59
-
60
- No matching component was found for:
61
- `)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Q(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:_E,findFiberByHostInstance:s.findFiberByHostInstance||wE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{af=c.inject(s),Pi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,R,N){if(!ye)throw Error(o(363));s=Z0(s,c);var D=et(s,R,N).disconnect;return{disconnect:function(){D()}}},r.registerMutableSourceForHydration=function(s,c){var R=c._getVersion;R=R(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,R]:s.mutableSourceEagerHydrationData.push(c,R)},r.runWithPriority=function(s,c){var R=bt;try{return bt=s,c()}finally{bt=R}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,R,N){var D=c.current,V=zr(),J=Ba(D);return R=n3(R),c.context===null?c.context=R:c.pendingContext=R,c=na(V,J),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=ja(D,c,J),s!==null&&(zn(s,D,J,V),pf(s,D,J)),J},r};j9.exports=bM;var _M=j9.exports;const wM=Ph(_M);var F9={exports:{}},Pl={};/**
62
- * @license React
63
- * react-reconciler-constants.production.min.js
64
- *
65
- * Copyright (c) Facebook, Inc. and its affiliates.
66
- *
67
- * This source code is licensed under the MIT license found in the
68
- * LICENSE file in the root directory of this source tree.
69
- */Pl.ConcurrentRoot=1;Pl.ContinuousEventPriority=4;Pl.DefaultEventPriority=16;Pl.DiscreteEventPriority=1;Pl.IdleEventPriority=536870912;Pl.LegacyRoot=0;F9.exports=Pl;var z9=F9.exports;const f4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let d4=!1,h4=!1;const Yy=".react-konva-event";let B9=!1;function SM(e){B9=e}const EM=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
- Position of a node will be changed during drag&drop, so you should update state of the react app as well.
71
- Consider to add onDragMove or onDragEnd events.
72
- For more info see: https://github.com/konvajs/react-konva/issues/256
73
- `,OM=`ReactKonva: You are using "zIndex" attribute for a Konva node.
74
- react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
75
- For more info see: https://github.com/konvajs/react-konva/issues/194
76
- `,xM={};function qp(e,t,r=xM){if(!d4&&"zIndex"in t&&(console.warn(OM),d4=!0),!h4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(EM),h4=!0)}for(var a in r)if(!f4[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var h=B9||t._useStrictMode,E={},w=!1;const p={};for(var a in t)if(!f4[a]){var o=a.slice(0,2)==="on",S=r[a]!==t[a];if(o&&S){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(p[u]=t[a])}!o&&(t[a]!==r[a]||h&&t[a]!==e.getAttr(a))&&(w=!0,E[a]=t[a])}w&&(e.setAttrs(E),ko(e));for(var u in p)e.on(u+Yy,p[u])}function ko(e){if(!ut.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const U9={},PM={};Ec.Node.prototype._applyProps=qp;function CM(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),ko(e)}function kM(e,t,r){let n=Ec[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=Ec.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return qp(u,a),u}function TM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function AM(e,t,r){return!1}function RM(e){return e}function MM(){return null}function LM(){return null}function NM(e,t,r,n){return PM}function IM(){}function DM(e){}function jM(e,t){return!1}function FM(){return U9}function zM(){return U9}const BM=setTimeout,UM=clearTimeout,HM=-1;function $M(e,t){return!1}const GM=!1,VM=!0,qM=!0;function WM(e,t){t.parent===e?t.moveToTop():e.add(t),ko(e)}function KM(e,t){t.parent===e?t.moveToTop():e.add(t),ko(e)}function H9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),ko(e)}function YM(e,t,r){H9(e,t,r)}function XM(e,t){t.destroy(),t.off(Yy),ko(e)}function ZM(e,t){t.destroy(),t.off(Yy),ko(e)}function QM(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function JM(e,t,r){}function eL(e,t,r,n,i){qp(e,i,n)}function tL(e){e.hide(),ko(e)}function rL(e){}function nL(e,t){(t.visible==null||t.visible)&&e.show()}function iL(e,t){}function aL(e){}function oL(){}const lL=()=>z9.DefaultEventPriority,sL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WM,appendChildToContainer:KM,appendInitialChild:CM,cancelTimeout:UM,clearContainer:aL,commitMount:JM,commitTextUpdate:QM,commitUpdate:eL,createInstance:kM,createTextInstance:TM,detachDeletedInstance:oL,finalizeInitialChildren:AM,getChildHostContext:zM,getCurrentEventPriority:lL,getPublicInstance:RM,getRootHostContext:FM,hideInstance:tL,hideTextInstance:rL,idlePriority:Uu.unstable_IdlePriority,insertBefore:H9,insertInContainerBefore:YM,isPrimaryRenderer:GM,noTimeout:HM,now:Uu.unstable_now,prepareForCommit:MM,preparePortalMount:LM,prepareUpdate:NM,removeChild:XM,removeChildFromContainer:ZM,resetAfterCommit:IM,resetTextContent:DM,run:Uu.unstable_runWithPriority,scheduleTimeout:BM,shouldDeprioritizeSubtree:jM,shouldSetTextContent:$M,supportsMutation:qM,unhideInstance:nL,unhideTextInstance:iL,warnsIfNotActing:VM},Symbol.toStringTag,{value:"Module"}));var uL=Object.defineProperty,cL=Object.defineProperties,fL=Object.getOwnPropertyDescriptors,p4=Object.getOwnPropertySymbols,dL=Object.prototype.hasOwnProperty,hL=Object.prototype.propertyIsEnumerable,g4=(e,t,r)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v4=(e,t)=>{for(var r in t||(t={}))dL.call(t,r)&&g4(e,r,t[r]);if(p4)for(var r of p4(t))hL.call(t,r)&&g4(e,r,t[r]);return e},pL=(e,t)=>cL(e,fL(t)),m4,y4;typeof window<"u"&&((m4=window.document)!=null&&m4.createElement||((y4=window.navigator)==null?void 0:y4.product)==="ReactNative")?Je.useLayoutEffect:Je.useEffect;function $9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=$9(n,t,r);if(i)return i;n=n.sibling}}function G9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const b4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=b4;return}return b4.apply(this,arguments)};const Xy=G9(Je.createContext(null));class V9 extends Je.Component{render(){return Je.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function gL(){const e=Je.useContext(Xy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Je.useId();return Je.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=$9(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function vL(){const e=gL(),[t]=Je.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Xy&&!t.has(i)&&t.set(i,Je.useContext(G9(i)))}r=r.return}return t}function q9(){const e=vL();return Je.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>Je.createElement(t,null,Je.createElement(r.Provider,pL(v4({},n),{value:e.get(r)}))),t=>Je.createElement(V9,v4({},t))),[e])}function mL(e){const t=dt.useRef({});return dt.useLayoutEffect(()=>{t.current=e}),dt.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const yL=e=>{const t=dt.useRef(),r=dt.useRef(),n=dt.useRef(),i=mL(e),a=q9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return dt.useLayoutEffect(()=>(r.current=new Ec.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=ds.createContainer(r.current,z9.LegacyRoot,!1,null),ds.updateContainer(dt.createElement(a,{},e.children),n.current),()=>{Ec.isBrowser&&(o(null),ds.updateContainer(null,n.current,null),r.current.destroy())}),[]),dt.useLayoutEffect(()=>{o(r.current),qp(r.current,e,i),ds.updateContainer(dt.createElement(a,{},e.children),n.current,null)}),dt.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},bL="Layer",_L="FastLayer",Sh="Group",wL="Label",SL="Rect",EL="Circle",OL="Ellipse",xL="Wedge",PL="Line",CL="Sprite",kL="Image",TL="Text",AL="TextPath",RL="Star",ML="Ring",LL="Arc",NL="Tag",IL="Path",DL="RegularPolygon",jL="Arrow",FL="Shape",zL="Transformer",ds=wM(sL);ds.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:dt.version,rendererPackageName:"react-konva"});const BL=dt.forwardRef((e,t)=>dt.createElement(V9,{},dt.createElement(yL,{...e,forwardedRef:t}))),UL=SM,HL=Object.freeze(Object.defineProperty({__proto__:null,Arc:LL,Arrow:jL,Circle:EL,Ellipse:OL,FastLayer:_L,Group:Sh,Image:kL,KonvaRenderer:ds,Label:wL,Layer:bL,Line:PL,Path:IL,Rect:SL,RegularPolygon:DL,Ring:ML,Shape:FL,Sprite:CL,Stage:BL,Star:RL,Tag:NL,Text:TL,TextPath:AL,Transformer:zL,Wedge:xL,useStrictMode:UL},Symbol.toStringTag,{value:"Module"})),Aa=mo(HL);var Go=Je,Wp=function(t,r,n){const i=Go.useRef("loading"),a=Go.useRef(),[o,l]=Go.useState(0),u=Go.useRef(),f=Go.useRef(),h=Go.useRef();return(u.current!==t||f.current!==r||h.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,h.current=n),Go.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){i.current="loaded",a.current=E,l(Math.random())}function p(){i.current="failed",a.current=void 0,l(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",p),r&&(E.crossOrigin=r),n&&(E.referrerPolicy=n),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",p)}},[t,r,n]),[a.current,i.current]};const $L=Ph(Wp);var W9={},Zy={},GL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const VL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function K9(e=()=>{}){const t=dt.useRef(e);return t.current=e,dt.useCallback((...r)=>t.current.apply(null,r),[])}const qL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=q9(),o=dt.useRef(null);dt.useRef();const[l]=dt.useState(()=>document.createElement("div")),u=dt.useMemo(()=>jd.createRoot(l),[l]),f=n??!0,h=K9(()=>{if(f&&o.current){let b=o.current.getAbsoluteTransform().decompose();i&&(b=i(b)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${b.x}px, ${b.y}px) rotate(${b.rotation}deg) scaleX(${b.scaleX}) scaleY(${b.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const E=r||{},{style:w}=E,p=GL(E,["style"]);Object.assign(l.style,w),Object.assign(l,p)});return dt.useLayoutEffect(()=>{var E;const w=o.current;if(!w)return;const p=(E=w.getStage())===null||E===void 0?void 0:E.container();if(p)return p.appendChild(l),f&&VL(p)&&(p.style.position="relative"),w.on("absoluteTransformChange",h),h(),()=>{var S;w.off("absoluteTransformChange",h),(S=l.parentNode)===null||S===void 0||S.removeChild(l)}},[f]),dt.useLayoutEffect(()=>{h()},[r,i]),dt.useLayoutEffect(()=>{u.render(dt.createElement(a,null,e))}),dt.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),dt.createElement(Sh,Object.assign({ref:o},t))},WL=({selector:e,enabled:t,children:r})=>{const n=dt.useRef(null),i=dt.useRef(null),a=dt.useRef(),o=t??!0;return dt.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),dt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),dt.createElement(Sh,{name:"_outer_portal",ref:n},dt.createElement(Sh,{name:"_inner_portal",ref:i},r))},KL=Object.freeze(Object.defineProperty({__proto__:null,Html:qL,Portal:WL,useEvent:K9,useImage:$L},Symbol.toStringTag,{value:"Module"})),Kc=mo(KL);function YL(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function Y9(e,t,r){const n=t-1,i=r[Z9(n,r.length)];return i.marker!=="Z"?i:Y9(e,n,r)}function X9(e,t,r){const n=t+1,i=r[Z9(n,r.length)];return i.marker==="Z"?X9(e,n,r):i}function XL(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(l,u){return l[u].marker==="M"?l[u]:a(l,u-1)};var i=a;let o=a(r,t);e.values.x=o.values.x,e.values.y=o.values.y}return e}function ZL(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function Z9(e,t){return(e%t+t)%t}function QL(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function vm(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,vm(e,t-1)),e[t].marker==="Z"&&vm(e,t-1)}function JL(e,t,r){const n=w4(e.values,r.values),i=w4(t.values,e.values);return Math.min(i,n)}function _4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function w4(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function S4(e,t){return Math.sin(e)*t}function E4(e,t){return Math.cos(e)*t}function O4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function eN(e,t){return t*Math.tan(e)}function tN(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=O4(e/2,-t):(r=O4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function rN(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function Q9(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return ZL(n.marker,a)}).map(XL)}function J9(e,t,r){let n=[],i=[];return r&&e.forEach(a=>YL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(QL),vm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const E=Y9(l,u,f),w=X9(l,u,f),p=_4(l.values,E.values),S=_4(l.values,w.values),b=S-p,m=b*(180/Math.PI),v=JL(l,E,w),y=Math.abs(eN(b/2,v/2)),d=Math.min(t,y),g=tN(b,d),_=g.offset,T=g.sweepFlag,C=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const P=[l.values.x+S4(p,_),l.values.y+E4(p,_)],O=[l.values.x+S4(S,_),l.values.y+E4(S,_)];C?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(P[0].toFixed(3)),y:parseFloat(P[1].toFixed(3))}}),!C&&(w.marker==="L"||w.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:m,largeArc:0,sweep:T,x:parseFloat(O[0].toFixed(3)),y:parseFloat(O[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:rN(i),commands:i}}function nN(e,t,r){return J9([...Q9(e)],t,r)}const iN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:Q9,roundCommands:J9,roundCorners:nN},Symbol.toStringTag,{value:"Module"})),aN=mo(iN);var Yc={},Qy={},Jy={},Cl=Cl||{};Cl.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var r=e.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+e.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,n=e.visit(t.at),i=e.visit(t.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(t){var r="",n=e.visit(t.at);return n&&(r+=n),r},"visit_extent-keyword":function(t){var r=t.value,n=e.visit(t.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var n=t,i=e.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",n=t.length;return t.forEach(function(i,a){r+=e.visit(i),a<n-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return e.visit_array(t,r);if(t.type){var n=e["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return e.visit(t)}}();var Cl=Cl||{};Cl.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(W){var U=new Error(t+": "+W);throw U.source=t,U}function n(){var W=i();return t.length>0&&r("Invalid input not EOF"),W}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,E)||o("repeating-radial-gradient",e.repeatingRadialGradient,E)}function o(W,U,j){return l(U,function(A){var L=j();return L&&(G(e.comma)||r("Missing comma before color stops")),{type:W,orientation:L,colorStops:d(g)}})}function l(W,U){var j=G(W);if(j){G(e.startCall)||r("Missing (");var A=U(j);return G(e.endCall)||r("Missing )"),A}}function u(){return f()||h()}function f(){return H("directional",e.sideOrCorner,1)}function h(){return H("angular",e.angleValue,1)}function E(){var W,U=w(),j;return U&&(W=[],W.push(U),j=t,G(e.comma)&&(U=w(),U?W.push(U):t=j)),W}function w(){var W=p()||S();if(W)W.at=m();else{var U=b();if(U){W=U;var j=m();j&&(W.at=j)}else{var A=v();A&&(W={type:"default-radial",at:A})}}return W}function p(){var W=H("shape",/^(circle)/i,0);return W&&(W.style=I()||b()),W}function S(){var W=H("shape",/^(ellipse)/i,0);return W&&(W.style=k()||b()),W}function b(){return H("extent-keyword",e.extentKeywords,1)}function m(){if(H("position",/^at/,0)){var W=v();return W||r("Missing positioning value"),W}}function v(){var W=y();if(W.x||W.y)return{type:"position",value:W}}function y(){return{x:k(),y:k()}}function d(W){var U=W(),j=[];if(U)for(j.push(U);G(e.comma);)U=W(),U?j.push(U):r("One extra comma");return j}function g(){var W=_();return W||r("Expected color definition"),W.length=k(),W}function _(){return C()||O()||P()||T()}function T(){return H("literal",e.literalColor,0)}function C(){return H("hex",e.hexColor,1)}function P(){return l(e.rgbColor,function(){return{type:"rgb",value:d(x)}})}function O(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(x)}})}function x(){return G(e.number)[1]}function k(){return H("%",e.percentageValue,1)||M()||I()}function M(){return H("position-keyword",e.positionKeywords,1)}function I(){return H("px",e.pixelValue,1)||H("em",e.emValue,1)}function H(W,U,j){var A=G(U);if(A)return{type:W,value:A[j]}}function G(W){var U,j;return j=/^[\n\r\t\s]+/.exec(t),j&&Q(j[0].length),U=W.exec(t),U&&Q(U[0].length),U}function Q(W){t=t.substr(W)}return function(W){return t=W.toString(),n()}}();Jy.parse=Cl.parse;Jy.stringify=Cl.stringify;(function(e){var t=me&&me.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const r=t(Jy),n=o=>o.indexOf("linear-gradient")>=0;e.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,e.isGradient)(o))return{rotation:0,stops:[{offset:0,color:o},{offset:1,color:o}]};const l=r.default.parse(o)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((u,f)=>({color:i(u),offset:u.length?parseFloat(u.length.value)/100:f/(l.colorStops.length-1)}))}};e.parseColor=a})(Qy);(function(e){var t=me&&me.__createBinding||(Object.create?function(f,h,E,w){w===void 0&&(w=E);var p=Object.getOwnPropertyDescriptor(h,E);p&&!("get"in p?!h.__esModule:p.writable||p.configurable)||(p={enumerable:!0,get:function(){return h[E]}}),Object.defineProperty(f,w,p)}:function(f,h,E,w){w===void 0&&(w=E),f[w]=h[E]}),r=me&&me.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=me&&me.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var E in f)E!=="default"&&Object.prototype.hasOwnProperty.call(f,E)&&t(h,f,E);return r(h,f),h},i=me&&me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(Je),o=n(Qy),l=i(wi),u=(f,h=f.fill,E="fill")=>a.default.useMemo(()=>{if(!o.isGradient(h))return{[E]:h};const{stops:w,rotation:p}=o.parseColor(h),S={x:f.a.width/2,y:f.a.height/2},b=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),m=l.default.Util.degToRad(p)-Math.PI/2,v=[];return w.forEach(({offset:y,color:d})=>{v.push(y,d)}),E==="fill"?{fillLinearGradientStartPointX:S.x-b*Math.cos(m),fillLinearGradientStartPointY:S.y-b*Math.sin(m),fillLinearGradientColorStops:v,fillLinearGradientEndPointX:S.x+b*Math.cos(m),fillLinearGradientEndPointY:S.y+b*Math.sin(m),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-b*Math.cos(m),strokeLinearGradientStartPointY:S.y-b*Math.sin(m),strokeLinearGradientColorStops:v,strokeLinearGradientEndPointX:S.x+b*Math.cos(m),strokeLinearGradientEndPointY:S.y+b*Math.sin(m)}},[h,f.width,f.height]);e.useColor=u})(Yc);var Vi={},kl={};(function(e){var t=me&&me.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFadeIn=e.isAnimationUsed=e.toggleFadeInAnimation=void 0;const r=t(Je),n=t(wi);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const h=r.default.useRef();r.default.useLayoutEffect(()=>{h.current&&h.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const E=u.current.opacity();return E?(u.current.opacity(0),h.current=new n.default.Tween({node:u.current,opacity:E,onFinish:()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}}),h.current.play(),()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(kl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=kl;let r=0,n=[],i=3e4;const a=v=>{i=v};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=v=>{l=v};e.setFontLoadTimeout=u;const f=()=>l;function h(v){r+=1;let y=!1;const d=setTimeout(()=>{y||(m(`Timeout loading asset ${v}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",v),y=!0,E())},i);return()=>{y||(clearTimeout(d),E())}}function E(){r-=1,r===0&&(n.forEach(v=>v()),n=[])}function w(v){r===0?v():n.push(v)}function p(){return new Promise(v=>w(()=>{(0,t.isAnimationUsed)()?setTimeout(v,300):v(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=h,e.decrementLoader=E,e.whenLoaded=p;let S=[];function b(v){S.push(v)}function m(v){S.forEach(y=>y(v))}e.onLoadError=b,e.triggerLoadError=m})(Vi);var Js={};(function(e){var t=me&&me.__createBinding||(Object.create?function(k,M,I,H){H===void 0&&(H=I);var G=Object.getOwnPropertyDescriptor(M,I);G&&!("get"in G?!M.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return M[I]}}),Object.defineProperty(k,H,G)}:function(k,M,I,H){H===void 0&&(H=I),k[H]=M[I]}),r=me&&me.__setModuleDefault||(Object.create?function(k,M){Object.defineProperty(k,"default",{enumerable:!0,value:M})}:function(k,M){k.default=M}),n=me&&me.__importStar||function(k){if(k&&k.__esModule)return k;var M={};if(k!=null)for(var I in k)I!=="default"&&Object.prototype.hasOwnProperty.call(k,I)&&t(M,k,I);return r(M,k),M};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=e.getGoogleFontsVariants=e.setGoogleFontsVariants=e.loadFont=e.isFontLoaded=e.replaceGlobalFonts=e.removeGlobalFont=e.addGlobalFont=e.globalFonts=e.getFontsList=e.setGoogleFonts=e.isGoogleFontChanged=void 0;const i=n(Xi),a=Vi;let o=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function u(){return l.value}function f(k){k!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...k)):l.value=!1}function h(){return o}function E(k){e.globalFonts.push(k)}function w(k){const M=e.globalFonts.findIndex(I=>I.fontFamily===k);M!==-1&&e.globalFonts.splice(M,1)}function p(k){e.globalFonts.replace(k)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=h,e.globalFonts=i.observable([]),e.addGlobalFont=E,e.removeGlobalFont=w,e.replaceGlobalFonts=p;var S="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",b=document.createElement("canvas");function m(k,M="Arial",I="normal",H="normal"){var G=b.getContext("2d");return G.font=`${I} ${H} 40px '${k}', ${M}`,G.measureText(S).width}const v={Arial:!0},y=k=>!!v[k];async function d(k,M,I){var H;if(v[k])return;const G=!!(!((H=document.fonts)===null||H===void 0)&&H.load),Q=m("Arial","Arial",M,I);if(G)try{await document.fonts.load(`16px '${k}', ${M} ${I}`);const A=m(k,"Arial",M,I);if(Q!==A)return void(v[k]=!0)}catch{}const W=m("Times","Times",M,I),U=m(k,"Arial",M,I),j=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let A=0;A<j;A++){const L=m(k,"Arial",M,I),z=m(k,"Times",M,I);if(L!==U||L!==Q||z!==W)return void(v[k]=!0);await new Promise(q=>setTimeout(q,60))}console.warn(`Timeout for loading font "${k}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${k}"`)}e.isFontLoaded=y,e.loadFont=d;const g={};let _="400,400italic,700,700italic";function T(k){_=k}function C(){return _}function P(k){if(g[k])return;const M=`https://fonts.googleapis.com/css?family=${k.replace(/ /g,"+")}:${_}`,I=document.createElement("link");I.type="text/css",I.href=M,I.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(I),g[k]=!0}e.setGoogleFontsVariants=T,e.getGoogleFontsVariants=C,e.injectGoogleFont=P;const O={};function x(k){const M=k.fontFamily;if(O[M]||!k.url&&!k.styles)return;const I=document.createElement("style");I.type="text/css";const H=k.styles||(k.url?[{src:`url("${k.url}")`}]:[]);let G="";H.forEach(Q=>{G+=`
77
- @font-face {
78
- font-family: '${M}';
79
- src: ${Q.src};
80
- font-style: ${Q.fontStyle||"normal"};
81
- font-weight: ${Q.fontWeight||"normal"};
82
- }
83
- `}),I.innerHTML=G,document.getElementsByTagName("head")[0].appendChild(I),O[k.fontFamily]=!0}e.injectCustomFont=x})(Js);var Kn={};(function(e){var t=me&&me.__createBinding||(Object.create?function(a,o,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(o,l);f&&!("get"in f?!o.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(a,u,f)}:function(a,o,l,u){u===void 0&&(u=l),a[u]=o[l]}),r=me&&me.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=me&&me.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(o,a,l);return r(o,a),o};Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=n(Xi);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(a=>{e.flags.textVerticalResizeEnabled=a}),e.useRemoveBackground=i.action(a=>{e.flags.removeBackgroundEnabled=a}),e.useHtmlTextRender=i.action(a=>{e.flags.htmlRenderEnabled=a}),e.setDownScalingEnabled=i.action(a=>{e.flags.imageDownScalingEnabled=a}),e.useDownScaling=i.action(a=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(a)}),e.setForceTextFit=i.action(a=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(a=>{e.flags.textOverflow=a}),e.setAnimationsEnabled=i.action(a=>{e.flags.animationsEnabled=a})})(Kn);var e2={};(function(e){function t(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(n,i,a)=>(a.slice(i+n.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:n)),r.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(e2);var Xc={};(function(e){var t=me&&me.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(wi);function n(i,a){var o;const l={filters:[]};a.brightnessEnabled&&(l.filters.push(r.default.Filters.Brighten),l.brightness=a.brightness),a.blurEnabled&&(l.filters.push(r.default.Filters.Blur),l.blurRadius=a.blurRadius),a.sepiaEnabled&&l.filters.push(r.default.Filters.Sepia),a.grayscaleEnabled&&l.filters.push(r.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:a.store._elementsPixelRatio}):i.clearCache(),(o=i.getLayer())===null||o===void 0||o.batchDraw()}e.applyFilter=n})(Xc);var Tl={};(function(e){var t=me&&me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const r=t(Je),n=bi,i=Aa,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(Tl);var To={};(function(e){var t=me&&me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(Je);e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=l=>`
85
- @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
- ${l}
87
- }
88
-
89
- .polotno-mobile & {
90
- ${l}
91
- }
92
- `;e.mobileStyle=i;const a=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=a;const o=()=>{const[l,u]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const f=()=>{u((0,e.isMobile)())};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]),l};e.useMobile=o})(To);var x4={},e7="warn";function t7(e){e7=e}function r7(){return e7}function oN(e){t7(e)}var fr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(fr||(fr={}));var mm=function(e,t){return mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},mm(e,t)};function It(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var hr=function(){return hr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},hr.apply(this,arguments)};function lN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function n7(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(h){return u([f,h])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(h){f=[6,h],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Ju(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ki(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function Yi(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Zc(e){return Ve(e).type}function sN(e,t){return Ve(e).getChildType(t)}function i7(e,t){return Ve(e).onPatch(t)}function uN(e,t){return Ve(e).onSnapshot(t)}function Ds(e,t){Ve(e).applyPatches(s2(t))}function cN(e,t){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=i7(e,function(o,l){t&&!t(o,l,i2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ds(o||e,r.patches)},undo:function(o){Ds(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function fN(e){var t=Ve(e);if(!t.isRoot)throw new Be("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function dN(e){var t=Ve(e);if(!t.isRoot)throw new Be("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function hN(e){return Ve(e).isProtected}function a7(e,t){return Ve(e).applySnapshot(t)}function t2(e,t){t===void 0&&(t=!0);var r=Ve(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function pN(e,t){t===void 0&&(t=1);for(var r=Ve(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function gN(e,t){t===void 0&&(t=1);for(var r=t,n=Ve(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new Be("Failed to find the parent of ".concat(Ve(e)," at depth ").concat(t))}function vN(e,t){for(var r=Ve(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function mN(e,t){for(var r=Ve(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Be("Failed to find the parent of ".concat(Ve(e)," of a given type"))}function o7(e){return Ve(e).root.storedValue}function l7(e){return Ve(e).path}function yN(e){return Us(Ve(e).path)}function bN(e){return Ve(e).isRoot}function _N(e,t){var r=x7(Ve(e),t);return r?r.value:void 0}function wN(e,t,r){var n=Ve(t).root.identifierCache.resolve(e,eu(r));return n==null?void 0:n.value}function s7(e){return Ve(e).identifier}function SN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Pt(r))return t?r2(r)?r:void 0:r;throw new Be("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return;throw n}}function EN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Pt(r))return t?r2(r):!0;throw new Be("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return!1;throw n}}function u7(e,t){var r=x7(Ve(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function ON(e,t){return O7(Ve(e),Ve(t))}function xN(e,t){t===void 0&&(t=!0);var r=Ve(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function PN(e){return Ve(e).detach(),e}function CN(e){var t=Ve(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function r2(e){return Ve(e).observableIsAlive}function kN(e,t){var r=Ve(e);return r.addDisposer(t),t}function TN(e){var t=Ve(e),r=t.root.environment;if(!r)throw new Be("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function AN(e){var t=Ve(e),r=t.root.environment;return!!r}function c7(e,t){var r=Ve(e);r.getChildren().forEach(function(n){Pt(n.storedValue)&&c7(n.storedValue,t)}),t(r.storedValue)}function f7(e){var t;return Pt(e)?t=Zc(e):t=e,{name:t.name,properties:hr({},t.properties)}}function RN(e){var t=Ve(e).type,r=hr(hr({},f7(t)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(e,i);if(a.get){I8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isFlowAction===!0&&r.flowActions.push(i),a.value._isMSTAction===!0?r.actions.push(i):j8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function MN(e){return e}function LN(e){return e}function NN(e){return e}function IN(e){return Ve(e).nodeId}var d7=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:kr.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new A7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=yc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?co(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==kr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===kr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=yc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===kr.CREATED){if(this.parent){if(this.parent.state!==kr.FINALIZED)return;this.fireHook(fr.afterAttach)}this.state=kr.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=kr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(fr.beforeDestroy)}}),e}(),Oc=function(e){It(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=kr.DEAD,u}return l.state=kr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Be("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===kr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(d7);Oc.prototype.die=ar(Oc.prototype.die);var DN=1,oi;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(oi||(oi={}));var wn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(wn||(wn={}));var jN={onError:function(e){throw e}},pn=function(e){It(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++DN}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:oi.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=gl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new nI),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var f=l._childNodes[l.identifierAttribute];f&&(u=f.value)}if(typeof u!="string"&&typeof u!="number")throw new Be("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=eu(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===oi.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=oi.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===oi.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Ju(l),h=f.next();!h.done;h=f.next()){var E=h.value;E.createObservableInstanceIfNeeded(!1)}}catch(b){n={error:b}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(b){throw this.state=kr.DEAD,b}finally{this._isRunningAction=!1}if(this._observableInstanceState=oi.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=zs,this.state=kr.CREATED,r){this.fireHook(fr.afterCreate),this.finalizeCreation();try{for(var p=Ju(l.reverse()),S=p.next();!S.done;S=p.next()){var E=S.value;E.fireHook(fr.afterCreate),E.finalizeCreation()}}catch(b){a={error:b}}finally{try{S&&!S.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(fr.beforeDetach);var r=this.state;this.state=kr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(fr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(As?As(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===oi.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Be(i);case"warn":vI(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&co(r.subpath)||"",a=r.actionContext||n2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&l7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===oi.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(zs),this._autoUnbox=!1;try{return this._observableInstanceState===oi.CREATED?this.type.getChildren(this):C7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Be("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Ju(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(fr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Be("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=xc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Us(i.path),o=P7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=xc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),el(this.storedValue,"$treenode",this),el(this.storedValue,"toJSON",aI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===kr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==oi.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(wn.Dispose),this._internalEventsClear(wn.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(wn.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(wn.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=hI({},r,{path:i}),o=Ki(SI(a),2),l=o[0],u=o[1];this._internalEventsEmit(wn.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(wn.Dispose,r,!0);return}throw new Be("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(wn.Dispose,r))throw new Be("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=C8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},jN);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new A7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Yi([r],Ki(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(d7);pn.prototype.createObservableInstance=ar(pn.prototype.createObservableInstance);pn.prototype.detach=ar(pn.prototype.detach);pn.prototype.die=ar(pn.prototype.die);var h7,ot;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(ot||(ot={}));var p7="cannotDetermine",FN=Symbol("$type"),Oa=function(){function e(t){Object.defineProperty(this,h7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return ya(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Be("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=E7(t);if(n){var i=Zc(t);return this.isAssignableFrom(i)?gn():vn(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Be("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Be("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Be("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Be("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();h7=FN;Oa.prototype.create=ar(Oa.prototype.create);var js=function(e){It(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===eu(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Pt(n)&&Ve(n)===r?!0:r.type===this&&k7(n)&&!Pt(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),Pt(n)&&this.isAssignableFrom(Zc(n))){var l=Ve(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Oa);js.prototype.create=ar(js.prototype.create);var Al=function(e){It(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Oa);function pr(e){return typeof e=="object"&&e&&e.isType===!0}var Ii=new Map;function zN(e){return function(r,n,i){switch(r.type){case"action":if(!e.filter||e.filter(r)===!0){var a=e.onStart(r);e.onResume(r,a),Ii.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ii.get(r.id).async===!1&&(Ii.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ii.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ii.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ii.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ii.get(r.rootId);return Ii.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ii.get(r.rootId);return Ii.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var BN=function(){function e(t,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),t&&t.onStart(r)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,t))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function UN(e){var t=new Map;return function(n,i){var a=n.parentActionEvent?t.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=hr(hr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new BN(u,o);t.set(n.id,f);var h=void 0;try{h=i(n)}catch(w){throw t.delete(n.id),f.finish(w),w}return f.hasFlowsPending||(t.delete(n.id),f.finish()),h}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var E=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(E))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function HN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Bs(n))return n;if(Pt(n))return bd("[MSTNode: ".concat(Zc(n).name,"]"));if(typeof n=="function")return bd("[function]");if(typeof n=="object"&&!Zo(n)&&!l2(n))return bd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return bd(""+i)}}function $N(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function bd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function g7(e,t){As(function(){s2(t).forEach(function(r){return GN(e,r)})})}function GN(e,t){var r=u7(e,t.path||"");if(!r)throw new Be("Invalid action path: ".concat(t.path||""));var n=Ve(r);if(t.name==="@APPLY_PATCHES")return Ds.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return a7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new Be("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(i){return $N(n,i)}):[])}function VN(e,t){var r=[],n=function(o){var l=t?t(o,i2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=v7(e,n))},replay:function(o){g7(o,r)}};return a.resume(),a}function v7(e,t,r){return r===void 0&&(r=!1),b7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=Ve(i.context),l={name:i.name,path:O7(Ve(e),o),args:i.args.map(function(f,h){return HN(o,i.name,h,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var qN=1,ec;function n2(){return ec}function m7(){return qN++}function ym(e,t){var r=Ve(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=ec;ec=e;try{return YN(r,e,t)}finally{ec=i,r._isRunningAction=n}}function y7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function xc(e,t,r){var n=function(){var i=m7(),a=ec,o=y7(a);return ym({type:"action",name:t,id:i,args:R7(arguments),context:e,tree:o7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Yi(Yi([],Ki(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function b7(e,t,r){r===void 0&&(r=!0);var n=Ve(e);return n.addMiddleWare(t,r)}function WN(e,t,r){r===void 0&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var KN=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function YN(e,t,r){var n=new KN(e,r);if(n.isEmpty)return ar(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return ar(r).apply(null,o.args);if(!l.includeHooks&&fr[o.name])return a(o);function f(E,w){i=a(E),w&&(i=w(i))}function h(E){i=E}return u(o,f,h),i}return a(t)}function i2(){for(var e=n2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function _7(e,t,r){for(var n=typeof t=="number"?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function XN(e,t){return _7(e,t,!1)}function ZN(e,t){return _7(e,t,!0)}function QN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function w7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Pt(e)?"<".concat(e,">"):"`".concat(QN(e),"`")}function JN(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function eI(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=Pt(t)?"value of type ".concat(Ve(t).type.name,":"):Bs(t)?"value":"snapshot",o=r&&Pt(t)&&r.is(Ve(t).snapshot);return"".concat(i).concat(a," ").concat(w7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?G7(r)||Bs(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function a2(e,t,r){return e.concat([{path:t,type:r}])}function gn(){return Fs}function vn(e,t,r){return[{context:e,value:t,message:r}]}function Kp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ya(e,t){mI()&&S7(e,t)}function S7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Be(tI(e,t,r))}function tI(e,t,r){if(r.length!==0)return"Error while converting ".concat(JN(w7(t))," to `").concat(e.name,`\`:
93
-
94
- `)+r.map(eI).join(`
95
- `)}var rI=0,nI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:rI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,Tt.array([],Yp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Be("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Oy(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return F8(this.cache).forEach(function(a){for(var o=Ki(a,2),l=o[0],u=o[1],f=!1,h=u.length-1;h>=0;h--){var E=u[h];(E===t||E.path.indexOf(i)===0)&&(n.addNodeToCache(E,!1),u.splice(h,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Be("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function o2(e,t,r,n,i){var a=E7(i);if(a){if(a.parent)throw new Be("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new pn(e,t,r,n,i)}function Ao(e,t,r,n,i){return new Oc(e,t,r,n,i)}function iI(e){return e instanceof Oc||e instanceof pn}var kr;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(kr||(kr={}));function Pt(e){return!!(e&&e.$treenode)}function Ve(e){if(!Pt(e))throw new Be("Value ".concat(e," is no MST Node"));return e.$treenode}function E7(e){return e&&e.$treenode||null}function aI(){return Ve(this).snapshot}var oI=function(e){return".."};function O7(e,t){if(e.root!==t.root)throw new Be("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=Us(e.path),n=Us(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(oI).join("/")+Eh(n.slice(i))}function x7(e,t,r){return r===void 0&&(r=!0),P7(e,Us(t),r)}function P7(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof Oc){var o=n.value;Pt(o)&&(n=Ve(o))}if(n instanceof pn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Be("Could not resolve '".concat(a,"' in path '").concat(Eh(t.slice(0,i))||"/","' while resolving '").concat(Eh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function C7(e){if(!e)return Fs;var t=Object.keys(e);if(!t.length)return Fs;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function lI(e){return M7(),L7(e)}var sI=Object.toString(),Fs=Object.freeze([]),zs=Object.freeze({}),Yp=g8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Yp);var Be=function(e){It(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function uI(e){return e}var cI=Number.isInteger;function fI(e){return Number(e)===e&&e%1!==0}function dI(e){return Number.isFinite(e)}function l2(e){return Array.isArray(e)||Qr(e)}function s2(e){return e?l2(e)?e:[e]:Fs}function hI(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function Zo(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===sI}function k7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Bs(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function T7(e){return typeof e!="function"}function pI(e,t,r){Er(e)?Py(e,t,r):Object.defineProperty(e,t,r)}function el(e,t,r){pI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var gI=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Yi([],Ki(t),!1))})}}),e}(),A7=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new gI),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,Yi([],Ki(n),!1))}}),e}();function R7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function tg(e,t){return e.indexOf(t)===0}var M7=function(e,t){};M7.ids={};function vI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function mI(){return typeof process<"u"&&x4&&x4.ENABLE_TYPE_CHECK==="true"}function rg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function L7(e){return wI(e.name,e)}function yI(e){return e}function bI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return n7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,Yi([],Ki(r),!1))];case 1:return[2,n.sent()]}})}}function _I(e){return n7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function wI(e,t){var r=function(){var i=m7(),a=n2();if(!a)throw new Be("a mst flow must always have a parent context");var o=y7(a);if(!o)throw new Be("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:Yi(Yi([],Ki(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(h,E,w){return h.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:E,args:[w]}),h)}return new Promise(function(h,E){var w,p=function(){w=t.apply(null,arguments),S(void 0)};p.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:"flow_spawn",args:R7(u)}),p);function S(v){var y;try{var d=f(function(g){y=w.next(g)},"flow_resume",v);d instanceof Error&&(y=w.throw(d))}catch(g){rg(function(){f(function(_){E(g)},"flow_throw",g)});return}m(y)}function b(v){var y;try{f(function(d){y=w.throw(d)},"flow_resume_error",v)}catch(d){rg(function(){f(function(g){E(d)},"flow_throw",d)});return}m(y)}function m(v){if(v.done){rg(function(){f(function(y){h(y)},"flow_return",v.value)});return}if(!v.value||typeof v.value.then!="function")throw new Be("Only promises can be yielded to `async`, got: "+v);return v.value.then(S,b)}})};return r._isFlowAction=!0,r}function SI(e){if(!("oldValue"in e))throw new Be("Patches without `oldValue` field cannot be inversed");return[EI(e),OI(e)]}function EI(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function OI(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function xI(e){return typeof e=="number"}function co(e){return xI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function N7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Eh(e){if(e.length===0)return"";var t=function(r){return r.map(co).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Us(e){var t=e.split("/").map(N7),r=e===""||e==="."||e===".."||tg(e,"/")||tg(e,"./")||tg(e,"../");if(!r)throw new Be("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var ng=Symbol("$preProcessorFailed"),PI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return ng}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;CI(r.type,this,"create"),r instanceof pn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},q7(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Pt(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===ng?vn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=pr(r)?this._subtype:Pt(r)?t2(r,!1):this.preProcessSnapshotSafe(r);return n===ng?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof js))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Oa);function CI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Ju(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function kI(e,t,r){return new PI(e,t,r)}var P4="Map.put can only be used to store complex values that have an identifier type attribute";function I7(e,t){var r,n,i=e.getSubTypes();if(i===p7)return!1;if(i){var a=s2(i);try{for(var o=Ju(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!I7(u,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof Pc&&t.push(e),!0}var Za;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Za||(Za={}));var TI=function(e){It(t,e);function t(r,n){return e.call(this,r,Tt.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Be("Map.put cannot be used to set empty values");if(Pt(r)){var n=Ve(r);if(n.identifier===null)throw new Be(P4);return this.set(n.identifier,r),r}else if(k7(r)){var i=Ve(this),a=i.type;if(a.identifierMode!==Za.YES)throw new Be(P4);var o=a.mapIdentifierAttribute,l=r[o];if(!c2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(t2(u))}var f=eu(l);return this.set(f,r),this.get(f)}else throw new Be("Map.put can only be used to store complex values")}}),t}(Jh),Oh=function(e){It(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Za.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Za.UNKNOWN){var r=[];if(I7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Be("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=Za.YES,this.mapIdentifierAttribute=n):this.identifierMode=Za.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new TI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ey(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=xc(n,l,u);el(n,l,f)})}),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Oy(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Be("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ve(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;ya(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ya(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Za.YES&&n instanceof pn){var i=n.identifier;if(i!==r)throw new Be("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ve(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:co(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:co(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:co(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ya(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Zo(r)?Kp(Object.keys(r).map(function(a){return i._subType.validate(r[a],a2(n,a,i._subType))})):vn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return zs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(js);Oh.prototype.applySnapshot=ar(Oh.prototype.applySnapshot);function AI(e){return new Oh("Map<string, ".concat(e.name,">"),e)}function RI(e){return pr(e)&&(e.flags&ot.Map)>0}var xh=function(e){It(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Yp),{name:this.name});return Tt.array(C7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mi(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=xc(n,l,u);el(n,l,f)})}),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Be("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ve(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=C4(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,h=C4(n,i,a.slice(l,l+u),f,f.map(function(w,p){return l+p}));if(!h)return null;r.added=h;for(var E=l+u;E<a.length;E++)a[E].setParent(n,""+(E+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ve(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ya(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return l2(r)?Kp(r.map(function(a,o){return i._subType.validate(a,a2(n,""+o,i._subType))})):vn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(js);xh.prototype.applySnapshot=ar(xh.prototype.applySnapshot);function MI(e){return new xh("".concat(e.name,"[]"),e)}function C4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,h=""+i[o];if(iI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof pn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(k4(u,f))r[o]=ig(t,e,h,f,u);else{for(var w=void 0,p=o;p<r.length;p++)if(k4(r[p],f)){w=r.splice(p,1)[0];break}a=!1;var E=ig(t,e,h,f,w);r.splice(o,0,E)}else{if(Pt(f)&&Ve(f).parent===e)throw new Be("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(Ve(f).path,"'"));a=!1;var E=ig(t,e,h,f);r.splice(o,0,E)}}return a?null:r}function ig(e,t,r,n,i){ya(e,n);function a(){if(Pt(n)){var l=Ve(n);if(l.assertAlive(zs),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof pn&&i.createObservableInstanceIfNeeded(),i.die()),o}function k4(e,t){if(!e.isAlive)return!1;if(Pt(t)){var r=Ve(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof pn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Zo(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function LI(e){return pr(e)&&(e.flags&ot.Array)>0}var T4="preProcessSnapshot",A4="postProcessSnapshot";function NI(){return Ve(this).toString()}var R4={name:"AnonymousModel",properties:{},initializers:Fs};function II(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Be("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in fr)throw new Be("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Be("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Be("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Bs(o))n[i]=tl(UI(o),o);else if(o instanceof Oh)n[i]=tl(o,{});else if(o instanceof xh)n[i]=tl(o,[]);else if(!pr(o))throw new Be("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},hr({},e))}var Pc=function(e){It(t,e);function t(r){var n=e.call(this,r.name||R4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,R4,r),n.properties=II(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&ot.Identifier){if(r)throw new Be("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===T4)throw new Be("Cannot define action '".concat(T4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===A4)throw new Be("Cannot define action '".concat(A4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in fr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var h=xc(r,i,f);n[i]=h,el(r,i,h)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Be("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("volatile state initializer should return a plain object containing state");xy(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,h=lN(o,["actions","views","state"]);for(var E in h)throw new Be("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(E,"'"));return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)Py(r,i,o),Cy(r,(a={},a[i]=gl,a));else if(typeof o.value=="function")el(r,i,o.value);else throw new Be("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?a:this.applySnapshotPreProcessor(a);return o2(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Yp),{name:this.name});return Tt.object(r,zs,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){el(n,"toString",NI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ve(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(ya(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ve(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:co(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Be("Not a value property: "+n);var a=mi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Be("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=Wi(r.storedValue,o);u.reportObserved()}catch{throw new Be("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Be("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ya(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return Zo(a)?Kp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],a2(n,o,i.properties[o]))})):vn(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return zs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(js);Pc.prototype.applySnapshot=ar(Pc.prototype.applySnapshot);function DI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Pc({name:r,properties:n})}function jI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function D7(e){return pr(e)&&(e.flags&ot.Object)>0}var Ra=function(e){It(t,e);function t(r,n,i,a){a===void 0&&(a=uI);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(Bs(r)&&this.checker(r))return gn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return vn(n,r,"Value is not a ".concat(i))}}),t}(Al),j7=new Ra("string",ot.String,function(e){return typeof e=="string"}),F7=new Ra("number",ot.Number,function(e){return typeof e=="number"}),FI=new Ra("integer",ot.Integer,function(e){return cI(e)}),zI=new Ra("float",ot.Float,function(e){return fI(e)}),BI=new Ra("finite",ot.Finite,function(e){return dI(e)}),z7=new Ra("boolean",ot.Boolean,function(e){return typeof e=="boolean"}),B7=new Ra("null",ot.Null,function(e){return e===null}),U7=new Ra("undefined",ot.Undefined,function(e){return e===void 0}),H7=new Ra("Date",ot.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});H7.getSnapshot=function(e){return e.storedValue.getTime()};var $7=H7;function UI(e){switch(typeof e){case"string":return j7;case"number":return F7;case"boolean":return z7;case"object":if(e instanceof Date)return $7}throw new Be("Cannot determine primitive type from value "+e)}function G7(e){return pr(e)&&(e.flags&(ot.String|ot.Number|ot.Integer|ot.Boolean|ot.Date))>0}var HI=function(e){It(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Bs(r)&&r===this.value?gn():vn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Al);function V7(e){return new HI(e)}function $I(e){return pr(e)&&(e.flags&ot.Literal)>0}var GI=function(e){It(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=Pt(r)?Ve(r).snapshot:r;return this._predicate(a)?gn():vn(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Oa);function VI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():pr(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new GI(r,n,i,a)}function qI(e){return pr(e)&&(e.flags&ot.Refinement)>0}function WI(e,t){var r=typeof e=="string"?t:e,n=Xp.apply(void 0,Yi([],Ki(r.map(function(i){return V7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var KI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=hr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=ot.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new Be("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new Be("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return gn();a++}else i.push(u)}return a===1?gn():vn(n,r,"No type is applicable for the union").concat(Kp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Oa);function Xp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=pr(e)?void 0:e,i=pr(e)?Yi([e],Ki(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new KI(a,i,n)}function q7(e){return pr(e)&&(e.flags&ot.Union)>0}var YI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&ya(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?gn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Oa);function XI(e,t){if(typeof t!="function"&&Pt(t))throw new Be("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function tl(e,t,r){return XI(e,t),new YI(e,t,r||ZI)}var ZI=[void 0];function QI(e){return pr(e)&&(e.flags&ot.Optional)>0}var JI=tl(U7,void 0),eD=tl(B7,null);function W7(e){return Xp(e,JI)}function tD(e){return Xp(e,eD)}var rD=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ot.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Be("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):gn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||p7}}),t}(Oa);function nD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new rD(r,n)}function iD(e){return pr(e)&&(e.flags&ot.Late)>0}function aD(e,t){return new oD(e,t)}var oD=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Tt.array()}),nm(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(ar(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=Ao(this,r,n,i,a);return this.pendingNodeList.push(l),nm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):T7(r)?gn():vn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Al),K7=function(e){It(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return T7(r)?this.subType?this.subType.validate(r,n):gn():vn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Al),M4=new K7;function lD(e){return arguments.length===0?M4:pr(e)?new K7(e):tl(M4,e)}function sD(e){return pr(e)&&(e.flags&ot.Frozen)>0}function uD(e){switch(e){case fr.beforeDestroy:return"destroy";case fr.beforeDetach:return"detach";default:return}}var cD=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c2(t))this.identifier=t;else if(Pt(t)){var n=Ve(t);if(!n.identifierAttribute)throw new Be("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Be("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Be("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=eu(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new u2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),u2=function(e){It(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),Y7=function(e){It(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return c2(r)?gn():vn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){Ds(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){D7(o.type)?this.replaceRef(void 0):Ds(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Ve(a),l=function(h,E){var w=uD(E);w&&i.fireInvalidated(w,r,n,o)},u=o.registerHook(fr.beforeDetach,l),f=o.registerHook(fr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(fr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,h=f&&f.storedValue;if(f&&f.isAlive&&h){var E=void 0;i?E=!!i.get(n,h):E=r.root.identifierCache.has(a.targetType,eu(n)),E?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===kr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(fr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(fr.afterAttach,function(){l(!1)}))}}}),t}(Al),fD=function(e){It(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?s7(a):a,l=new cD(a,this.targetType),u=Ao(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Pt(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(Y7),dD=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?this.options.set(a,r?r.storedValue:null):a,l=Ao(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(Y7);function X7(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new dD(e,{get:r.get,set:r.set},n):new fD(e,n)}function hD(e){return pr(e)&&(e.flags&ot.Reference)>0}function pD(e,t){var r=X7(e,hr(hr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:W7(r)}var Z7=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof Pc))throw new Be("Identifier types can only be instantiated as direct child of a model type");return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Be("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?vn(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):gn()}}),t}(Al),gD=function(e){It(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(Z7),vD=function(e){It(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(Z7),mD=new gD,yD=new vD;function bD(e){return pr(e)&&(e.flags&ot.Identifier)>0}function eu(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function _D(e){return new wD(e)}var wD=function(e){It(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return gn();var i=this.options.getValidationMessage(r);return i?vn(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):gn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Ao(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,f=this.instantiate(i,a,void 0,u);return r.die(),f}}),t}(Al),L4={enumeration:WI,model:DI,compose:jI,custom:_D,reference:X7,safeReference:pD,union:Xp,optional:tl,literal:V7,maybe:W7,maybeNull:tD,refinement:VI,string:j7,boolean:z7,number:F7,integer:FI,float:zI,finite:BI,Date:$7,map:AI,array:MI,frozen:lD,identifier:mD,identifierNumber:yD,late:nD,lazy:aD,undefined:U7,null:B7,snapshotProcessor:kI};const SD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:kN,addMiddleware:b7,applyAction:g7,applyPatch:Ds,applySnapshot:a7,cast:MN,castFlowReturn:yI,castToReferenceSnapshot:NN,castToSnapshot:LN,clone:xN,createActionTrackingMiddleware:zN,createActionTrackingMiddleware2:UN,decorate:WN,destroy:CN,detach:PN,escapeJsonPath:co,flow:L7,getChildType:sN,getEnv:TN,getIdentifier:s7,getLivelinessChecking:r7,getMembers:RN,getNodeId:IN,getParent:gN,getParentOfType:mN,getPath:l7,getPathParts:yN,getPropertyMembers:f7,getRelativePath:ON,getRoot:o7,getRunningActionContext:i2,getSnapshot:t2,getType:Zc,hasEnv:AN,hasParent:pN,hasParentOfType:vN,isActionContextChildOf:XN,isActionContextThisOrChildOf:ZN,isAlive:r2,isArrayType:LI,isFrozenType:sD,isIdentifierType:bD,isLateType:iD,isLiteralType:$I,isMapType:RI,isModelType:D7,isOptionalType:QI,isPrimitiveType:G7,isProtected:hN,isReferenceType:hD,isRefinementType:qI,isRoot:bN,isStateTreeNode:Pt,isType:pr,isUnionType:q7,isValidReference:EN,joinJsonPath:Eh,onAction:v7,onPatch:i7,onSnapshot:uN,process:lI,protect:fN,recordActions:VN,recordPatches:cN,resolveIdentifier:wN,resolvePath:_N,setLivelinessChecking:t7,setLivelynessChecking:oN,splitJsonPath:Us,t:L4,toGenerator:_I,toGeneratorFunction:bI,tryReference:SN,tryResolve:u7,typecheck:S7,types:L4,unescapeJsonPath:N7,unprotect:dN,walk:c7},Symbol.toStringTag,{value:"Module"})),Si=mo(SD);var f2={};(function(e){function t({oldText:r,newText:n,element:i}){if(!(n.length/Math.max(20,r.length)>=4))return i.fontSize;const a=i.width*i.page.computedHeight/n.length,o=1.5*Math.sqrt(a),l=i.fontSize;return Math.min(l,Math.max(5,Math.round(o)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=void 0,e.getLimitedFontSize=t})(f2);(function(e){var t=me&&me.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(Je),n=bi,i=Aa,a=Kc,o=Xi,l=t(wi),u=aN,f=Yc,h=Vi,E=Js,w=Kn,p=e2,S=Xc,b=kl,m=Tl,v=To,y=Si,d=f2;l.default._fixTextRendering=!0;const g=document.createElement("style");g.type="text/css",document.head.appendChild(g);const _={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function T(A){var L="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+L+"]*?["+L+"]").test(A)}function C(A){A=A.replace(/\s/g,"");let L=0;for(var z=0;z<A.length;z++)T(A[z])&&(L+=1);return L>A.length/2}function P(A){return C(A)?"rtl":"ltr"}e.isRTLText=C,e.getDir=P;const O=(0,n.observer)(({textNodeRef:A,element:L,onBlur:z,selectAll:q,cursorPosition:K})=>{const[F,$]=r.default.useState(_),B=A.current;r.default.useLayoutEffect(()=>{const ee={};ee.width=B.width()-2*B.padding()+"px",ee.height=B.height()-2*B.padding()+B.fontSize()*B.lineHeight()+"px",ee.fontSize=B.fontSize()+"px",ee.lineHeight=B.lineHeight()+.01,ee.fontFamily=B.fontFamily(),ee.textAlign=B.align(),ee.color=B.fill(),ee.fontWeight=L.fontWeight,ee.fontStyle=L.fontStyle,ee.letterSpacing=L.letterSpacing+"em";const ne=`
96
- .polotno-input::placeholder {
97
- color: ${F.color};
98
- opacity: 0.6;
99
- }
100
- `;g.innerHTML="",g.appendChild(document.createTextNode(ne)),JSON.stringify(ee)!==JSON.stringify(F)&&$(ee)});const Y=r.default.useRef(null);r.default.useLayoutEffect(()=>{var ee;const ne=Y.current;if(!ne)return;(ee=Y.current)===null||ee===void 0||ee.focus();const ie=K||ne.value.length;ne.selectionStart=ne.selectionEnd=ie,q&&(ne==null||ne.select(),document.execCommand("selectAll",!1,null))},[]),r.default.useEffect(()=>{window.addEventListener("blur",z);const ee=ne=>{var ie;!((ie=Y.current)===null||ie===void 0)&&ie.contains(ne.target)||z()};return window.addEventListener("touchstart",ee),()=>{window.removeEventListener("blur",z),window.removeEventListener("touchstart",ee)}},[]);let X=0;const Z=B.textArr.length*B.lineHeight()*B.fontSize();L.verticalAlign==="middle"&&(X=(L.a.height-Z)/2),L.verticalAlign==="bottom"&&(X=L.a.height-Z);const te=(0,p.removeTags)(L.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:P(te),style:Object.assign(Object.assign(Object.assign({},_),F),{paddingTop:X+"px"}),value:te,onChange:ee=>{const ne=(0,d.getLimitedFontSize)({oldText:L.text,newText:ee.target.value,element:L});L.set({text:ee.target.value,fontSize:ne})},placeholder:L.placeholder,onBlur:z})}),x=A=>r.default.createElement(a.Html,null,r.default.createElement(O,Object.assign({},A))),k=A=>{const[L,z]=r.default.useState(!1),q=r.default.useRef(!1);return r.default.useEffect(()=>{var K=!0;return setTimeout(()=>{K&&(A._editModeEnabled&&(q.current=!0),z(!0),setTimeout(()=>{q.current=!1},50))},50),()=>{K=!1}},[]),{editorEnabled:L&&A._editModeEnabled,selectAll:q.current}},M=(A,L)=>{const[z,q]=r.default.useReducer(F=>F+1,0),K=r.default.useRef((0,E.isFontLoaded)(L));return r.default.useLayoutEffect(()=>{if(K.current=(0,E.isFontLoaded)(L),K.current)return;let F=!0;return(async()=>{K.current=!1,q();const $=(0,h.incrementLoader)(`text ${L}`);await A.loadFont(L),setTimeout($,100),F&&(K.current=!0,q())})(),()=>{F=!1}},[L]),[K.current]};e.useFontLoader=M;const I=({fontLoaded:A,fontFamily:L,fontSize:z,lineHeight:q})=>r.default.useMemo(()=>{if(typeof q=="number")return q;const K=document.createElement("div");K.style.fontFamily=L,K.style.fontSize=z+"px",K.style.lineHeight=q,K.innerText="Test text",document.body.appendChild(K);const F=K.offsetHeight;return document.body.removeChild(K),F/z},[A,L,z,q]);function H(A){var L=A.getAbsoluteTransform().copy();L.invert();var z=A.getStage().getPointerPosition();return L.point(z)}function G(A){var L;const z=A.target,q=H(z),K=z.textArr,F=Math.floor(q.y/(z.fontSize()*z.lineHeight())),$=K.slice(0,F).reduce((X,Z)=>X+Z.text.length,F),B=(L=K[F])!==null&&L!==void 0?L:K[0];let Y=0;return z.align()==="right"?Y=z.width()-B.width:z.align()==="center"&&(Y=z.width()/2-B.width/2),$+Math.round((q.x-Y)/B.width*B.text.length)}function Q(A){const L=r.default.useRef(A),z=r.default.useRef(A);return r.default.useMemo(()=>{z.current=L.current,L.current=A},[A]),z.current}function W(A){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(A)}function U(A,L){const z=A.fontSize(),q=A.height(),K=(0,p.removeTags)(L.text);let F=L.a.fontSize;A.height(void 0);const $=Math.round(2*L.a.fontSize)-1;for(let B=1;B<$;B++){const Y=L.a.height&&A.height()>L.a.height;let X=K.split(`
101
- `).join(" ").split(/[\s-]+/).reduce((ee,ne)=>W(ne)?ee.concat(ne.split("")):ee.concat(ne),[]),Z=A.textArr.map(ee=>ee.text).join(";");const te=X.find(ee=>!Z.includes(ee)||(Z=Z.replace(ee,""),!1));if(!(Y||te))break;F-=.5,A.fontSize(F)}return A.fontSize(z),A.height(q),F}function j({lines:A,lineHeight:L,width:z,align:q="left",padding:K=0,cornerRadius:F=0}){var $;A.forEach((Z,te)=>{Z.cx=z/2,q==="right"?Z.cx=z-Z.width/2:q==="left"&&(Z.cx=Z.width/2),q!=="justify"||Z.lastInParagraph||(Z.width=z),q==="justify"&&(Z.cx=Z.width/2)});let B=`M ${($=A[0])===null||$===void 0?void 0:$.cx} ${-K}`;A.forEach((Z,te)=>{const{cx:ee}=Z,ne=A[te-1];ne&&ne.width>Z.width?B+=` L ${ee+Z.width/2+K} ${te*L+K}`:B+=` L ${ee+Z.width/2+K} ${te*L-K}`;const ie=A[te+1];ie&&ie.width>Z.width?B+=` L ${ee+Z.width/2+K} ${(te+1)*L-K}`:B+=` L ${ee+Z.width/2+K} ${(te+1)*L+K}`});for(var Y=A.length-1;Y>=0;Y--){const Z=A[Y],{cx:te}=Z,ee=A[Y+1];ee&&ee.width>Z.width?B+=` L ${te-Z.width/2-K} ${(Y+1)*L-K}`:B+=` L ${te-Z.width/2-K} ${(Y+1)*L+K}`;const ne=A[Y-1];ne&&ne.width>Z.width?B+=` L ${te-Z.width/2-K} ${Y*L+K}`:B+=` L ${te-Z.width/2-K} ${Y*L-K}`}B+=" Z";const X=(0,u.parsePath)(B);return(0,u.roundCommands)(X,F).path}e.getLineHeight=I,e.usePrevious=Q,e.TextElement=(0,n.observer)(({element:A,store:L})=>{const z=r.default.useRef(null),q=r.default.useRef(null),{editorEnabled:K,selectAll:F}=k(A),[$,B]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Z=r.default.useRef(A.a.height),te=L.selectedShapes.indexOf(A)>=0,{textVerticalResizeEnabled:ee}=w.flags,ne=Q(A.fontFamily),[ie,ce]=r.default.useState([]);r.default.useEffect(()=>{var Ce,ke;const Ne=(ke=(Ce=z.current)===null||Ce===void 0?void 0:Ce.textArr)!==null&&ke!==void 0?ke:[];JSON.stringify(Ne)!==JSON.stringify(ie)&&ce(Ne)}),r.default.useEffect(()=>{if(A.a.width)return;const Ce=z.current;Ce.width(600),A.set({width:1.4*Ce.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Ce=z.current;(0,S.applyFilter)(Ce,A)}));const[Oe]=(0,e.useFontLoader)(L,A.fontFamily),Te=(0,p.removeTags)(A.text),ae=()=>{const Ce=z.current.clone({height:void 0}),ke=Math.ceil(Ce.fontSize()*Ce.lineHeight()*Ce.textArr.length+1);return Ce.destroy(),ke};r.default.useLayoutEffect(()=>{if(!Oe)return;const{textOverflow:Ce}=w.flags;if(A.a.height)if(Ce!=="change-font-size"||Y||L.isPlaying){if(Ce==="resize"){const ke=ae();ee&&A.a.height<ke&&L.history.ignore(()=>{var Ne;(0,y.isAlive)(A)&&A.set({height:ke}),(Ne=z.current)===null||Ne===void 0||Ne.height(ke)},!1,!0),ee||A.a.height===ke||L.history.ignore(()=>{var Ne;(0,y.isAlive)(A)&&A.set({height:ke}),(Ne=z.current)===null||Ne===void 0||Ne.height(ke)},!1,!0)}}else{const ke=U(z.current,A);if(ke!==A.a.fontSize)return void L.history.ignore(()=>{A.set({fontSize:ke})},!1,!0);const Ne=ae();A.a.height===Ne||ee||L.history.ignore(()=>{A.set({height:Ne})},!1,!0)}else{const ke=ae();L.history.ignore(()=>{A.set({height:ke})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Ce=z.current;Ce&&(Ce.width(Ce.width()+1e-8),Ce._setTextData(),(0,S.applyFilter)(Ce,A))},[Oe]);const de=r.default.useRef(null),ye=r.default.useRef(0),ve=Ce=>{Ce.evt.preventDefault(),L.selectedShapes.find(Ne=>Ne===A)&&A.contentEditable&&(ye.current=G(Ce),A.toggleEditMode())},re=!Te&&A.placeholder?.6:A.a.opacity;(0,b.useFadeIn)(z,re);const oe=(0,e.getLineHeight)({fontLoaded:Oe,fontFamily:A.fontFamily,fontSize:A.a.fontSize,lineHeight:A.lineHeight}),be=A.selectable||L.role==="admin",Ee=(0,f.useColor)(A),Ge=r.default.useMemo(()=>A.backgroundEnabled?j({lines:JSON.parse(JSON.stringify(ie)),cornerRadius:A.backgroundCornerRadius*(A.a.fontSize*oe*.5),lineHeight:oe*A.a.fontSize,padding:A.backgroundPadding*(A.a.fontSize*oe*.5),width:A.a.width,align:A.align}):"",[A.backgroundEnabled,A.backgroundCornerRadius,A.a.fontSize,oe,A.backgroundPadding,A.a.width,A.align,ie]),et=(0,v.isTouchDevice)();let Ae=0;return A.verticalAlign==="middle"?Ae=(A.a.height-ie.length*oe*A.a.fontSize)/2:A.verticalAlign==="bottom"&&(Ae=A.a.height-ie.length*oe*A.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:q,x:A.a.x,y:A.a.y,rotation:A.a.rotation,hideInExport:!A.showInExport,listening:!1,visible:A.backgroundEnabled,opacity:A.backgroundOpacity*re,data:Ge,fill:A.backgroundColor,offsetY:-Ae}),r.default.createElement(i.Text,Object.assign({ref:z,id:A.id,name:"element",hideInExport:!A.showInExport,editModeEnabled:A._editModeEnabled,x:A.a.x,y:A.a.y,rotation:A.a.rotation,width:A.a.width,height:A.a.height,text:Te||A.placeholder},Ee,{stroke:A.stroke,lineJoin:"round",strokeWidth:A.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:A.a.fontSize,fontFamily:`"${A.fontFamily}", "${ne}"`,fontStyle:A.fontStyle+" "+A.fontWeight,textDecoration:A.textDecoration,align:A.align,verticalAlign:A.verticalAlign,draggable:et?A.draggable&&te:A.draggable,preventDefault:!et||te,opacity:re,visible:!A._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,lineHeight:oe,letterSpacing:A.letterSpacing*A.a.fontSize,listening:be,onDragMove:Ce=>{A.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{A.set({x:Ce.target.x(),y:Ce.target.y()})},onMouseEnter:()=>{B(!0)},onMouseLeave:()=>{B(!1)},onClick:ve,onTap:ve,onTransformStart:()=>{X(!0),Z.current=z.current.height()},onTransform:Ce=>{var ke,Ne;const Ze=Ce.target;(ke=q.current)===null||ke===void 0||ke.setAttrs({x:Ze.x(),y:Ze.y(),rotation:Ze.rotation(),scale:Ze.scale()});const ue=((Ne=Ze.getStage())===null||Ne===void 0?void 0:Ne.findOne("Transformer")).getActiveAnchor();if(ue==="middle-left"||ue==="middle-right"){const fe=Ze.scaleX(),Ye=Ze.width()*fe,_e=A.a.fontSize;let De=Ye;Ye<_e&&(De=_e,de.current&&Ze.position(de.current)),Ze.width(De),Ze.scaleX(1),Ze.scaleY(1);const Le=ae();if(w.flags.textOverflow!=="ellipsis"){const we=Math.max(Le,Z.current);Ze.height(we),A.set({height:Ze.height()})}A.set({x:Ze.x(),y:Ze.y(),width:Ze.width(),rotation:Ze.rotation()}),(0,S.applyFilter)(Ze,A)}if(ue==="top-center"||ue==="bottom-center"){let fe=w.flags.textOverflow==="resize"?ae():oe*A.a.fontSize;Ce.target.height(Math.max(fe,Ce.target.height()*Ce.target.scaleY())),Ce.target.scaleY(1)}de.current=Ce.target.position()},onTransformEnd:Ce=>{var ke;const Ne=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),A.set({fontSize:Math.round(A.a.fontSize*Ne),width:Math.ceil(Ce.target.width()*Ne),x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),height:Ce.target.height()*Ne,shadowBlur:A.shadowBlur*Ne,shadowOffsetX:A.shadowOffsetX*Ne,shadowOffsetY:A.shadowOffsetY*Ne,strokeWidth:A.strokeWidth*Ne}),(ke=q.current)===null||ke===void 0||ke.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),K&&r.default.createElement(i.Group,{x:A.a.x,y:A.a.y,rotation:A.a.rotation},r.default.createElement(x,{textNodeRef:z,element:A,selectAll:F,cursorPosition:ye.current,onBlur:()=>{A.toggleEditMode(!1)}})),!Y&&($||te)&&r.default.createElement(m.Highlighter,{element:A}))})})(Zy);var d2={},tu={},Q7={exports:{}},J7={exports:{}};(function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
102
- `)}})(J7);var h2=J7.exports;(function(e,t){h2("lex"),e.exports=r;function r(n){var i="",a,o=0,l=-1,u=0,f=1,h="before-selector",E=[h],w={},p=[],S=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function b(){return P(),n[l]}function m(W){return W?E[E.length-1-W]:h}function v(W){var U=l+1;return W===n.slice(U,U+W.length)}function y(W){var U=n.slice(l).indexOf(W);return U>0?U:!1}function d(W){return W===g(1)}function g(W){return n[l+(W||1)]}function _(){var W=E.pop();return h=E[E.length-1],W}function T(W){return h=W,E.push(h),E.length}function C(W){var U=h;return E[E.length-1]=h=W,U}function P(W){if((W||1)==1)n[l]==`
103
- `?(f++,o=1):o++,l++;else{var U=n.slice(l,l+W).split(`
104
- `);U.length>1&&(f+=U.length-1,o=1),o+=U[U.length-1].length,l=l+W}}function O(){w.end={line:f,col:o},p.push(w),i="",w={}}function x(W){w={type:W,start:{line:f,col:o}}}for(;a=b();)switch(a){case" ":switch(m()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
105
- `:case" ":case"\r":case"\f":switch(m()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
106
- `&&(w.value=i.trim(),O(),_());break}break;case":":switch(m()){case"name":w.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=a,x("selector"),T("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a;break}break;case";":switch(m()){case"name":case"before-value":case"value":i.trim().length>0&&(w.value=i.trim(),O()),C("before-name");break;case"value-paren":i+=a;break;case"at-value":w.value=i.trim(),O(),_();break;case"before-name":break;default:i+=a;break}break;case"{":switch(m()){case"selector":if(g(-1)==="\\"){i+=a;break}w.text=i.trim(),O(),C("before-name"),u=u+1;break;case"at-group":switch(w.name=i.trim(),w.type){case"font-face":case"viewport":case"page":T("before-name");break;default:T("before-selector")}O(),u=u+1;break;case"name":case"at-rule":w.name=i.trim(),O(),T("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break}break;case"}":switch(m()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&O(),x("end"),O(),_(),m()==="at-group"&&(x("at-group-end"),O(),_()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(g(-1)==="\\"){i+=a;break}u>0&&m(1)==="at-group"&&(x("at-group-end"),O()),u>1&&_(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(m()){case"double-string":a==='"'&&g(-1)!=="\\"&&_();break;case"single-string":a==="'"&&g(-1)!=="\\"&&_();break;case"before-at-value":C("at-value"),T(a==='"'?"double-string":"single-string");break;case"before-value":C("value"),T(a==='"'?"double-string":"single-string");break;case"comment":break;default:g(-1)!=="\\"&&T(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(m()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var k=y("*/");k&&P(k+1)}else m()=="before-value"&&C("value"),i+=a;break;default:d("*")?(x("comment"),T("comment"),P()):i+=a;break}break;case"*":switch(m()){case"comment":d("/")?(w.text=i,P(),O(),_()):i+=a;break;case"before-selector":i+=a,x("selector"),T("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a}break;case"@":switch(m()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break;default:for(var M=!1,I,H,G=0,Q=S.length;!M&&G<Q;++G)H=S[G],I=H.name||H,v(I)&&(M=!0,x(I),T(H.state||"at-group"),P(I.length),H.prefix&&(w.prefix=H.prefix),H.type&&(w.type=H.type));M||(i+=a);break}break;case"(":switch(m()){case"value":T("value-paren");break;case"before-value":C("value");break}i+=a;break;case")":switch(m()){case"value-paren":_();break;case"before-value":C("value");break}i+=a;break;default:switch(m()){case"before-selector":x("selector"),T("selector");break;case"before-name":x("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=a;break}return p}})(Q7);var eS=Q7.exports,tS={exports:{}};(function(e,t){h2("parse");var r=eS;e.exports=l;var n,i,a,o;function l(_,T){T||(T={}),n=!!T.comments,a=!!T.position,i=0,o=Array.isArray(_)?_.slice():r(_);for(var C,P=[],O;O=f();)C=v(O),C&&P.push(C);return{type:"stylesheet",stylesheet:{rules:P}}}function u(_,T){T||(T={});for(var C,P=["type","name","value"],O={},x=0;x<P.length;++x)C=P[x],_[C]&&(O[C]=T[C]||_[C]);for(P=Object.keys(T),x=0;x<P.length;++x)C=P[x],O[C]||(O[C]=T[C]);return a&&(O.position={start:_.start,end:_.end}),O}function f(){var _=o.shift();return _}function h(_){i=i+1;var T={};switch(_.type){case"font-face":case"viewport":T.declarations=d();break;case"page":T.prefix=_.prefix,T.declarations=d();break;default:T.prefix=_.prefix,T.rules=g()}return u(_,T)}function E(_){return u(_)}function w(_){return u(_)}function p(_){return u(_,{text:_.text})}function S(_){return u(_)}function b(_){return u(_)}function m(_){function T(C){return C.trim()}return u(_,{type:"rule",selectors:_.text.split(",").map(T),declarations:d()})}function v(_){switch(_.type){case"property":return b(_);case"selector":return m(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(_);case"comment":if(n)return p(_);break;case"charset":return w(_);case"import":return E(_);case"namespace":return S(_);case"font-face":case"supports":case"viewport":case"document":case"page":return h(_)}}function y(_){for(var T,C=[],P;(P=f())&&_&&_(P);)T=v(P),T&&C.push(T);return P&&P.type!=="end"&&o.unshift(P),C}function d(){return y(function(_){return _.type==="property"||_.type==="comment"})}function g(){return y(function(){return i})}})(tS);var ED=tS.exports,rS={exports:{}};(function(e,t){h2("stringify");var r,n,i,a,o,l;e.exports=u;function u(g,_){_||(_={}),i=_.indentation||"",n=!!_.compress,r=!!_.comments,a=1,n?o=l="":(o=`
107
- `,l=" ");var T=S(g.stylesheet.rules,y).join(`
108
- `).trim();return T}function f(g){if(g){a+=g;return}return n?"":Array(a).join(i||"")}function h(g){return"@"+g.type+" "+g.value+";"+o}function E(g){var _="",T=g.prefix||"";g.name&&(_=" "+g.name);var C=g.type!=="page";return"@"+T+g.type+_+l+b(g,C)+o}function w(g){return r?"/*"+(g.text||"")+"*/"+o:""}function p(g){var _;return g.selectors?_=g.selectors.join(","+o):(_="@"+g.type,_+=g.name?" "+g.name:""),f()+_+l+b(g)+o}function S(g,_){return g.reduce(function(T,C){var P=C.type==="comment"?w(C):_(C);return P&&T.push(P),T},[])}function b(g,_){var T=g.declarations,C=v;return g.rules&&(T=g.rules,C=p),T=m(T,C),T&&(T=o+T+(_?"":o)),"{"+T+f()+"}"}function m(g,_){if(!g)return"";f(1);var T=S(g,_);return f(-1),T.length?T.join(o):""}function v(g){if(g.type==="property")return d(g)}function y(g){switch(g.type){case"rule":return p(g);case"media":case"keyframes":return E(g);case"comment":return w(g);case"import":case"charset":case"namespace":return h(g);case"font-face":case"supports":case"viewport":case"document":case"page":return E(g)}}function d(g){var _=g.name?g.name+":"+l:"";return f()+_+g.value+";"}})(rS);var OD=rS.exports,xD={lex:eS,parse:ED,stringify:OD};(function(e){var t=me&&me.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(wi),n=t(Je),i=Qy,a=t(xD);function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const T={};return _.querySelectorAll("style").forEach(C=>{const P=a.default.parse(C.textContent).stylesheet.rules;for(let O of P)O.selectors&&O.selectors.forEach(x=>{const k=T[x]||{};O.declarations.forEach(M=>{k[M.name]=M.value}),T[x]=k})}),T}function u(_,T){var C;const P={fill:"",stroke:""},O=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],x=_.getAttribute("id");let k={};if(x&&T[`#${x}`]?k=T[`#${x}`]:O.forEach(M=>{T[`.${M}`]&&(k=Object.assign(Object.assign({},k),T[`.${M}`]))}),T[_.nodeName]&&(k=Object.assign(Object.assign({},k),T[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?P.fill=_.getAttribute("fill"):k.fill&&k.fill!=="none"&&(P.fill=k.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?P.stroke=_.getAttribute("stroke"):k.stroke&&k.stroke!=="none"&&(P.stroke=k.stroke),!P.fill&&_.style.fill&&_.style.fill!=="none"&&(P.fill=_.style.fill),!P.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(P.stroke=_.style.stroke),!P.stroke&&!P.fill){const M=_.ownerSVGElement,I=M&&M!==_&&u(M,T);(I==null?void 0:I.fill)==="currentColor"||(I==null?void 0:I.stroke)==="currentColor"||(P.fill="black")}return P}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var T=[],C=_.getElementsByTagName("*"),P=0,O=C.length;P<O;P++){const x=C[P];o(x)||(x.getAttribute("fill")!==null&&T.push(x),(x.getAttribute("stroke")!==null||x.style&&x.style.fill||f.indexOf(x.nodeName)>=0)&&T.push(x))}return T}async function E(_){const T=await fetch(_);return S(await T.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function p(_){var T=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(T),P=h(T),O=[];return P.forEach(x=>{const{fill:k,stroke:M}=u(x,C);[k,M].forEach(I=>{I&&(I==="currentColor"&&(I="black"),r.default.Util.colorToRGBA(I)&&O.indexOf(I)===-1&&O.push(I))})}),O}function S(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function b(_){const T=await w(_),C=new DOMParser().parseFromString(T,"image/svg+xml").documentElement.getAttribute("viewBox"),[P,O,x,k]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(x),height:parseFloat(k)}}function m(_){var T=new DOMParser().parseFromString(_,"image/svg+xml");const C=T.documentElement.getAttribute("viewBox"),[P,O,x,k]=(C==null?void 0:C.split(" "))||[],M=T.documentElement.getAttribute("width");!M&&T.documentElement.setAttribute("width",x+"px");const I=T.documentElement.getAttribute("height");if((!I||I.indexOf("%")>=0)&&T.documentElement.setAttribute("height",k+"px"),M&&M.indexOf("%")>=0&&I&&I.indexOf("%")===-1){const H=parseFloat(I)/parseFloat(k);T.documentElement.setAttribute("width",H*parseFloat(x)+"px")}if(I&&I.indexOf("%")>=0&&M&&M.indexOf("%")===-1){const H=parseFloat(M)/parseFloat(x);T.documentElement.setAttribute("height",H*parseFloat(k)+"px")}return M==="100%"&&I==="100%"&&(T.documentElement.setAttribute("width",x+"px"),T.documentElement.setAttribute("height",k+"px")),new XMLSerializer().serializeToString(T)}e.urlToBase64=E,e.urlToString=w,e.getColors=p,e.svgToURL=S,e.getSvgSize=b,e.fixSize=m;const v=(_,T)=>{if(!_||!T)return!1;if(T==="currentColor"&&_==="black")return!0;const C=r.default.Util.colorToRGBA(_),P=r.default.Util.colorToRGBA(T);return C&&P?C.r===P.r&&C.g===P.g&&C.b===P.b&&C.a===P.a:void 0};function y(_,T,C,P){var O=_.namespaceURI,x=document.createElementNS(O,"linearGradient");const k=r.default.Util.degToRad(C+90),M=(Math.cos(k)+1)/2,I=(Math.sin(k)+1)/2,H=(Math.cos(k+Math.PI)+1)/2,G=(Math.sin(k+Math.PI)+1)/2;x.setAttribute("x1",100*M+"%"),x.setAttribute("y1",100*I+"%"),x.setAttribute("x2",100*H+"%"),x.setAttribute("y2",100*G+"%"),x.setAttribute("gradientUnits","userSpaceOnUse"),x.setAttribute("id",T);for(var Q=0;Q<P.length;Q++){var W=P[Q],U=document.createElementNS(O,"stop");for(var j in W)W.hasOwnProperty(j)&&U.setAttribute(j,W[j]);x.appendChild(U)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(O,"defs"),_.firstChild)).appendChild(x)}function d(_,T){var C=new DOMParser().parseFromString(_,"image/svg+xml");const P=h(C),O=Array.from(T.keys()),x=l(C);return P.forEach(k=>{const{fill:M,stroke:I}=u(k,x);[{prop:"fill",color:M},{prop:"stroke",color:I}].forEach(({prop:H,color:G})=>{const Q=O.find(W=>(0,e.sameColors)(W,G));if(Q){const W=T.get(Q);if((0,i.isGradient)(W)){const{rotation:U,stops:j}=(0,i.parseColor)(W),A=j.map(z=>({offset:100*z.offset+"%","stop-color":z.color})),L="color"+Math.round(1e8*Math.random());y(C.children[0],L,U,A),k.style[H]=null,k.setAttribute(H,`url('#${L}')`)}else k.style[H]=T.get(Q)}})}),S(new XMLSerializer().serializeToString(C))}e.sameColors=v,e.replaceColors=d;const g=_=>{const[T,C]=n.default.useState([]);return n.default.useEffect(()=>{let P=!1;return(async()=>{C([]);const O=p(await w(_));P||C(O)})(),()=>{P=!0}},[_]),T};e.useSvgColors=g})(tu);(function(e){var t=me&&me.__createBinding||(Object.create?function(F,$,B,Y){Y===void 0&&(Y=B);var X=Object.getOwnPropertyDescriptor($,B);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[B]}}),Object.defineProperty(F,Y,X)}:function(F,$,B,Y){Y===void 0&&(Y=B),F[Y]=$[B]}),r=me&&me.__setModuleDefault||(Object.create?function(F,$){Object.defineProperty(F,"default",{enumerable:!0,value:$})}:function(F,$){F.default=$}),n=me&&me.__importStar||function(F){if(F&&F.__esModule)return F;var $={};if(F!=null)for(var B in F)B!=="default"&&Object.prototype.hasOwnProperty.call(F,B)&&t($,F,B);return r($,F),$},i=me&&me.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Je),o=bi,l=Xi,u=Aa,f=i(Wp),h=i(wi),E=Kc,w=Tl,p=Vi,S=n(tu),b=Kn,m=Xc,v=kl,y=To;function d(){return document.createElement("canvas")}async function g(F){if(!(F.indexOf("data:image/svg+xml")>=0||F.indexOf(".svg")>=0))return F;const $=await S.urlToString(F),B=S.fixSize($);return S.svgToURL(B)}const _=F=>{const[$,B]=a.default.useState(F);return a.default.useEffect(()=>{(async()=>{const Y=await g(F);Y!==$&&B(Y)})()},[F]),$};function T(F,$){return Math.sqrt(Math.pow($.x-F.x,2)+Math.pow($.y-F.y,2))}function C(F,$){return{x:(F.x+$.x)/2,y:(F.y+$.y)/2}}const P=(F,$,B)=>{let Y=$,X=B,Z=1;for(;Y>0&&X>0;){F.width=Y,F.height=X;const te=F.getContext("2d");if(!te)return;if(te.fillStyle="rgba(0,0,0,0.1)",te.fillRect(0,0,1,1),te.getImageData(0,0,1,1).data[3]!==0)return void te.clearRect(0,0,F.width,F.height);if(Z*=.9,Y=Math.floor($*Z),X=Math.floor(B*Z),Y=Math.max(Y,1),X=Math.max(X,1),Y<=1&&X<=1)return F.width=1,void(F.height=1)}},O=(F,$,B)=>{const Y=a.default.useMemo(()=>{var X,Z;const{flipX:te,flipY:ee}=F,ne=F.type==="svg"||F.src.indexOf("data:image/svg+xml")>=0||F.src.indexOf(".svg")>=0,ie=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,ce=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||ie)&&ne||F.maskSrc;if(!te&&!ee&&!ce)return $;if(!$||!$.width||!$.height)return null;const Oe=d();let Te=1;F.type==="svg"&&(Te=Math.max(F.a.width/$.width*B,F.a.height/$.height*B)),P(Oe,Math.max($.width*Te,1),Math.max($.height*Te,1));let ae=te?-Oe.width:0,de=ee?-Oe.height:0;return(X=Oe.getContext("2d"))===null||X===void 0||X.scale(te?-1:1,ee?-1:1),(Z=Oe.getContext("2d"))===null||Z===void 0||Z.drawImage($,ae,de,Oe.width,Oe.height),Oe},[F.maskSrc,F.flipX,F.flipY,$,F.a.width,F.a.height,B]);return a.default.useEffect(()=>()=>{Y&&Y.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(Y)},[Y]),Y};function x(F,$){const B=$.width/$.height;let Y,X;return B>=F.width/F.height?(Y=F.width,X=F.width/B):(Y=F.height*B,X=F.height),{x:(F.width-Y)/2,y:(F.height-X)/2,width:Y,height:X}}function k(F,$,B,Y,X,Z,te){for(var ee=new ImageData($,B),ne=new Int32Array(F.data.buffer),ie=F.width,ce=new Int32Array(ee.data.buffer),Oe=ee.width,Te=$/Z,ae=B/te,de=Math.round(1/Te),ye=Math.round(1/ae),ve=de*ye,re=0;re<ee.height;re++)for(var oe=0;oe<Oe;oe++){for(var be=Y+Math.round(oe/Te)+(X+Math.round(re/ae))*ie,Ee=0,Ge=0,et=0,Ae=0,Ce=0;Ce<ye;Ce++)for(var ke=0;ke<de;ke++){var Ne=ne[be+ke+Ce*ie];Ee+=Ne<<24>>>24,Ge+=Ne<<16>>>24,et+=Ne<<8>>>24,Ae+=Ne>>>24}Ee=Math.round(Ee/ve),Ge=Math.round(Ge/ve),et=Math.round(et/ve),Ae=Math.round(Ae/ve),ce[oe+re*Oe]=Ae<<24|et<<16|Ge<<8|Ee}return ee}function M(F,$){var B,Y;const X=d();X.width=F.width,X.height=F.height;const Z=Math.max(1,Math.floor(X.width*$)),te=Math.max(1,Math.floor(X.height*$));(B=X.getContext("2d"))===null||B===void 0||B.drawImage(F,0,0,X.width,X.height);const ee=k(X.getContext("2d").getImageData(0,0,X.width,X.height),Z,te,0,0,X.width,X.height);return X.width=Z,X.height=te,(Y=X.getContext("2d"))===null||Y===void 0||Y.putImageData(ee,0,0),X}const I=(F,$)=>{const[B,Y]=A(F.maskSrc,"anonymous"),X=F.maskSrc?Y:"loaded";return(0,e.useImageLoader)(X,F.id+"-mask"),a.default.useMemo(()=>{if(!B||!$||!$.width||!$.height)return $;const Z=d();Z.width=Math.max($.width,1),Z.height=Math.max($.height,1);const te=Z.getContext("2d");if(!te)return $;te.drawImage($,0,0),te.globalCompositeOperation="source-in";const ee=x(B,F);return te.drawImage(B,ee.x,ee.y,ee.width,ee.height,0,0,$.width,$.height),Z},[$,B,F.a.width,F.a.height])},H=(F,$,B)=>Math.max($,Math.min(B,F)),G=(F,$,B,Y,X=0,Z=!1,te=!0)=>{const ee=te?1e5:$.width,ne=te?1e5:$.height,ie=Math.floor(H(F.a.width*Y,1,ee)),ce=Math.floor(H(F.a.height*Y,1,ne)),Oe=Math.min(X*Y,ie/2,ce/2),Te=Math.max(F.a.width/B.width,F.a.height/B.height)*Y,ae=F.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&Te<1&&!Z,de=B.x===0&&B.y===0&&B.width===($==null?void 0:$.width)&&B.height===($==null?void 0:$.height),ye=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return de&&Oe===0&&!ae?void 0:d()},[$,Oe,ae,de]);return a.default.useLayoutEffect(()=>{if(!ye||!$)return;ye.width=ie,ye.height=ce;const ve=ye.getContext("2d");if(!ve)return;Oe&&(ve.beginPath(),ve.moveTo(Oe,0),ve.lineTo(ie-Oe,0),ve.arc(ie-Oe,Oe,Oe,3*Math.PI/2,0,!1),ve.lineTo(ie,ce-Oe),ve.arc(ie-Oe,ce-Oe,Oe,0,Math.PI/2,!1),ve.lineTo(Oe,ce),ve.arc(Oe,ce-Oe,Oe,Math.PI/2,Math.PI,!1),ve.lineTo(0,Oe),ve.arc(Oe,Oe,Oe,Math.PI,3*Math.PI/2,!1),ve.clip());const re=ae?M($,Te):$,oe=ae?{x:Math.floor(B.x*Te),y:Math.floor(B.y*Te),width:Math.floor(B.width*Te),height:Math.floor(B.height*Te)}:B;ve.drawImage(re,oe.x,oe.y,oe.width,oe.height,0,0,ye.width,ye.height)},[ye,F.a.width,F.a.height,B.x,B.y,B.width,B.height,X,Y,Z,F.page._exportingOrRendering,ae]),a.default.useEffect(()=>()=>{ye&&ye.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(ye)},[ye]),ye||$},Q=(F,$,B,Y)=>{const X=_(F.clipSrc||""),[Z,te]=A(X,"anonymous"),ee=F.clipSrc?te:"loaded";(0,e.useImageLoader)(ee,F.id+"-clip");const ne=a.default.useMemo(()=>{if($&&Z)return d()},[$,Z]);return a.default.useLayoutEffect(()=>{var ie;if(!Z||!$||!$.width||!$.height||!Z||!Z.width||!Z.height||!ne)return;const ce=d(),Oe=Math.max(F.a.width/Z.width*B,F.a.height/Z.height*B);ce.width=Z.width*Oe,ce.height=Z.height*Oe,(ie=ce.getContext("2d"))===null||ie===void 0||ie.drawImage(Z,0,0,ce.width,ce.height),ne.width=Math.max($.width,1),ne.height=Math.max($.height,1);const Te=ne.getContext("2d");Te&&(Te.save(),Te.drawImage(ce,0,0,$.width,$.height),h.default.Util.releaseCanvas(ce),Te.globalCompositeOperation="source-in",Te.drawImage($,0,0,ne.width,ne.height),Te.restore())},[ne,$,Z,F.a.width,F.a.height,B,...Y]),F.clipSrc&&Z?ne:$},W=d(),U=(0,o.observer)(({element:F})=>{const $=Math.min(30,F.a.width/4,F.a.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const Y=B.current;if(!Y)return;const X=new h.default.Animation(Z=>{Y.rotate(((Z==null?void 0:Z.timeDiff)||0)/2)},Y.getLayer());return X.start(),()=>{X.stop()}}),a.default.createElement(u.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},a.default.createElement(u.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:F.a.width/2,y:F.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),j=(0,o.observer)(({element:F})=>{const $="Can not load the image...",B=Math.max(10,Math.min(30,F.a.width/25));return a.default.createElement(u.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},a.default.createElement(u.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:$,fontSize:B,width:F.a.width,height:F.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let A=f.default;const L=F=>{A=F};e.setImageLoaderHook=L;const z=(F,$)=>{const B=a.default.useRef(),Y=()=>{var X;(X=B.current)===null||X===void 0||X.call(B),B.current=void 0};a.default.useEffect(()=>Y,[]),a.default.useLayoutEffect(()=>{F!=="loading"||B.current||(B.current=(0,p.incrementLoader)(`image ${$}`)),F!=="loading"&&Y(),F==="failed"&&(0,p.triggerLoadError)(`image ${$}`)},[F])};e.useImageLoader=z;const q=({image:F,status:$,type:B})=>{const Y=a.default.useRef();return a.default.useEffect(()=>{Y.current=F||Y.current},[F]),$!=="failed"||$!=="failed"&&B==="svg"?Y.current:void 0},K=F=>{const[$,B]=a.default.useReducer(te=>te+1,0),Y=a.default.useRef("loading"),X=a.default.useRef(F.src),Z=a.default.useRef(F.src);return Z.current!==F.src&&(Z.current=F.src,Y.current="loading"),a.default.useEffect(()=>{if(F.type!=="svg"||!F.src)return;let te=!1;return(async()=>{Y.current="loading",B();const ee=await S.urlToString(F.src),ne=S.fixSize(ee),ie=S.replaceColors(ne,F.colorsReplace);te||(X.current=ie,Y.current="loaded",B())})(),()=>{te=!0}},[F.src,JSON.stringify(F.colorsReplace)]),F.type!=="svg"?[F.src,"loaded"]:[X.current,Y.current]};e.ImageElement=(0,o.observer)(({element:F,store:$})=>{var B;const[Y,X]=a.default.useState(!1),Z=a.default.useRef(null),te=a.default.useRef(null),[ee,ne]=a.default.useState(!1),ie=$.selectedShapes.indexOf(F)>=0,[ce,Oe]=K(F),[Te,ae]=A(ce,"anonymous"),de=F.type!=="svg"||Oe==="loaded"?ae:"loading";(0,e.useImageLoader)(de,F.id);const ye=F.page._exportingOrRendering?1:Math.max(1,$.scale),ve=$._elementsPixelRatio*ye,re=q({image:Te,status:ae,type:F.type}),oe=I(F,O(F,Te||re,ve))||W;let{cropX:be,cropY:Ee,cropWidth:Ge,cropHeight:et}=F;ae!=="loaded"&&(be=Ee=0,Ge=et=1);const Ae=oe.width*Ge,Ce=oe.height*et,ke=F.a.width/F.a.height;let Ne,Ze;const ue=Ae/Ce,fe=F.type==="svg";fe?(Ne=Ae,Ze=Ce):ke>=ue?(Ne=Ae,Ze=Ae/ke):(Ne=Ce*ke,Ze=Ce);const Ye={x:oe.width*be,y:oe.height*Ee,width:Ne,height:Ze},_e=(B=F.cornerRadius)!==null&&B!==void 0?B:0,De=F.page._exportingOrRendering?1:Math.min(2,$.scale),Le=$._elementsPixelRatio*De;let we=Q(F,G(F,oe,Ye,Le,_e,Y||F._cropModeEnabled||F.type==="svg",!0),Le,[Ye,_e,Le]);const Qe=Math.max(F.a.width/Ne,F.a.height/Ze);a.default.useEffect(()=>{var Ie;if(!F._cropModeEnabled)return;const rt=(Ie=Z.current)===null||Ie===void 0?void 0:Ie.getStage();function pt(Ct){F._cropModeEnabled&&Ct.target!==te.current&&F.toggleCropMode(!1)}function Xt(Ct){F._cropModeEnabled&&Ct.target.parentNode!==rt.content&&F.toggleCropMode(!1)}return document.body.addEventListener("click",Xt),rt==null||rt.on("click",pt),rt==null||rt.on("tap",pt),()=>{document.body.removeEventListener("click",Xt),document.body.removeEventListener("touchstart",Xt),rt==null||rt.off("click",pt),rt==null||rt.off("click",pt)}},[F._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(Y||F._cropModeEnabled))return(0,m.applyFilter)(Z.current,F),(0,l.autorun)(()=>{(0,m.applyFilter)(Z.current,F)},{delay:100})},[we,F.page._exportingOrRendering,Y,Ge,et,F._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ie;Y||F._cropModeEnabled?(Ie=Z.current)===null||Ie===void 0||Ie.clearCache():(0,m.applyFilter)(Z.current,F)},[Y,F.a.width,F.a.height,F._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(Z.current,F)},[F.shadowEnabled,F.shadowBlur,F.cornerRadius,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);const Se=a.default.useRef(null),Ke=a.default.useRef(null),Mr=a.default.useRef(null);a.default.useLayoutEffect(()=>{F._cropModeEnabled&&(Ke.current.nodes([Se.current]),Mr.current.nodes([te.current]))},[F._cropModeEnabled]);var xe=a.default.useRef(null),Fe=a.default.useRef(0),tt=a.default.useRef(!1);const mt=Ie=>{var rt;((rt=Ie.evt.touches)===null||rt===void 0?void 0:rt.length)>2&&Ie.target.stopDrag(),Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const pt=Ie.target.width()*Ie.target.scaleX(),Xt=Ie.target.height()*Ie.target.scaleY(),Ct=Math.min(1,Ne/pt),or=Math.min(1,Ze/Xt),Nr=1-Ct,lr=Math.min(Nr,Math.max(0,Math.round(-Ie.target.x())/pt)),Mn=1-or,Oi=Math.min(Mn,Math.max(0,Math.round(-Ie.target.y())/Xt));Ie.target.setAttrs({x:-lr*oe.width,y:-Oi*oe.height,scaleX:1,scaleY:1}),F.set({cropX:lr,cropY:Oi,cropWidth:Ct,cropHeight:or})},Ot=()=>{F.type!=="svg"&&F.contentEditable&&setTimeout(()=>{F.toggleCropMode(!0)})},Lr=F.type==="svg"&&re,Vr=ae==="loading"&&!Lr,Or=ae==="failed",Rn=!Vr&&!Or,mn=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),yn=Rn?F.a.opacity:0;(0,v.useFadeIn)(Z,yn);const Zn=F.selectable||$.role==="admin",Ei=(0,y.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Vr&&a.default.createElement(U,{element:F}),Or&&a.default.createElement(j,{element:F}),a.default.createElement(u.Image,{ref:Z,name:"element",id:F.id,image:we,x:F.a.x,y:F.a.y,width:F.a.width||1,height:F.a.height||1,rotation:F.a.rotation,opacity:yn,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,customCrop:Ye,listening:Zn,draggable:Ei?F.draggable&&ie:F.draggable,preventDefault:!Ei||ie,hideInExport:!F.showInExport,onMouseEnter:()=>{ne(!0)},onMouseLeave:()=>{ne(!1)},onDragMove:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:Ot,onDblTap:Ot,onTransformStart:()=>{X(!0),mn.current={cropX:F.cropX,cropY:F.cropY,cropWidth:F.cropWidth,cropHeight:F.cropHeight}},onTransform:Ie=>{var rt;const pt=Ie.currentTarget,Xt=Math.abs(pt.scaleX()-1)<1e-7?1:pt.scaleX(),Ct=Math.abs(pt.scaleY()-1)<1e-7?1:pt.scaleY();pt.scaleX(1),pt.scaleY(1);const or=(rt=Ie.target.getStage())===null||rt===void 0?void 0:rt.findOne("Transformer"),Nr=1-Ne/oe.width,lr=Math.min(Nr,Math.max(0,F.cropX)),Mn=1-Ze/oe.height,Oi=Math.min(Mn,Math.max(0,F.cropY)),Ji=or.getActiveAnchor(),Ma=!(Ji.indexOf("middle")>=0||Ji.indexOf("center")>=0),au=!Ma&&Xt<1&&mn.current.cropHeight>Ze/oe.height;let Ro=Ma?F.cropWidth:F.cropWidth*Xt;au&&(Ro=F.cropWidth);const Mo=!Ma&&Ct<1&&mn.current.cropWidth>Ne/oe.width;let xi=Ma?F.cropHeight:F.cropHeight*Ct;Mo&&(xi=F.cropHeight),fe&&(Ro=F.cropWidth,xi=F.cropHeight),F.set({cropX:lr,cropY:Oi,x:pt.x(),y:pt.y(),width:pt.width()*Xt,height:pt.height()*Ct,rotation:Ie.target.rotation(),cropWidth:Math.min(Ro,1-lr),cropHeight:Math.min(xi,1-Oi)})},onTransformEnd:Ie=>{const rt=Ie.currentTarget;F.set({width:rt.width(),height:rt.height(),x:rt.x(),y:rt.y(),rotation:Ie.target.rotation(),cropWidth:Ne/oe.width,cropHeight:Ze/oe.height}),X(!1)}}),a.default.createElement(u.Rect,{x:F.x,y:F.y,width:Math.max(F.a.width-F.borderSize,0),height:Math.max(F.a.height-F.borderSize,0),opacity:yn,offsetX:-F.borderSize/2,offsetY:-F.borderSize/2,stroke:F.borderColor,strokeWidth:F.borderSize,listening:!1,visible:!!F.borderSize,rotation:F.rotation,cornerRadius:Math.max(0,_e-F.borderSize),hideInExport:!F.showInExport}),F._cropModeEnabled&&a.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:we,x:F.x,y:F.y,width:F.a.width,height:F.a.height,rotation:F.rotation,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur}),a.default.createElement(u.Group,{x:F.x,y:F.y,rotation:F.rotation,scaleX:Qe,scaleY:Qe},a.default.createElement(u.Image,{image:oe,ref:te,opacity:.4,draggable:!0,x:-F.cropX*oe.width,y:-F.cropY*oe.height,onDragMove:mt,onTransform:mt,onTouchMove:Ie=>{Ie.evt.preventDefault();const rt=Ie.target.getStage().getPointersPositions();var pt=rt[0],Xt=rt[1];const Ct=Ie.target;if(pt&&!Xt&&!Ct.isDragging()&&tt.current&&(Ct.startDrag(),tt.current=!1),pt&&Xt){h.default.hitOnDragEnabled=!0,Ct.isDragging()&&(tt.current=!0,Ct.stopDrag());const Mo=Ie.target.getAbsoluteTransform().copy();Mo.invert();var or={x:pt.x,y:pt.y},Nr={x:Xt.x,y:Xt.y};if(!xe.current)return void(xe.current=C(or,Nr));var lr=C(or,Nr),Mn=T(or,Nr);Fe.current||(Fe.current=Mn);const xi=Ct.position();var Oi={x:lr.x-xi.x,y:lr.y-xi.y},Ji=Mn/Fe.current;Ct.scaleX(Ji),Ct.scaleY(Ji);const La=Mo.point(lr),Rl=Mo.point(xe.current);var Ma=La.x-Rl.x,au=La.y-Rl.y,Ro={x:Math.min(0,lr.x-Oi.x*Ji+Ma),y:Math.min(0,lr.y-Oi.y*Ji+au)};Ct.position(Ro),Fe.current=Mn,xe.current=lr,mt(Ie)}},onTouchEnd:Ie=>{Fe.current=0,xe.current=null,h.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Mr,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,rt)=>rt.width<5||rt.height<5?Ie:rt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Ne,height:Ze,ref:Se,listening:!1,onTransform:Ie=>{Ie.target.x()<-F.cropX*oe.width-1e-9&&(Ie.target.x(-F.cropX*oe.width),Ie.target.scaleX(1)),Ie.target.y()<-F.cropY*oe.height-1e-9&&(Ie.target.y(-F.cropY*oe.height),Ie.target.scaleY(1));const rt=Math.min(1,Math.max(0,F.cropX+Ie.target.x()/oe.width)),pt=Math.min(1,Math.max(0,Ie.target.y()/oe.height+F.cropY)),Xt=Ie.target.width()*Ie.target.scaleX(),Ct=Ie.target.height()*Ie.target.scaleY(),or=Math.min(1-rt,Xt/oe.width),Nr=Math.min(1-pt,Ct/oe.height),lr=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),F.set({x:lr.x,y:lr.y,cropX:rt,cropY:pt,cropWidth:or,cropHeight:Nr,width:Math.min(Xt*Qe,oe.width*(1-rt)*Qe),height:Math.min(Ct*Qe,oe.height*(1-pt)*Qe)})}}),a.default.createElement(u.Transformer,{ref:Ke,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,rt)=>rt.width<5||rt.height<5?Ie:rt,visible:F.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(ee||ie)&&a.default.createElement(w.Highlighter,{element:F}))})})(d2);var nS={},iS={exports:{}};/*!
109
- * Quill Editor v1.3.7
110
- * https://quilljs.com/
111
- * Copyright (c) 2014, Jason Chen
112
- * Copyright (c) 2013, salesforce.com
113
- */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:me,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),h=i(47),E=i(48),w=i(49),p=i(12),S=i(32),b=i(33),m=i(31),v=i(1),y={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:E.default,Scroll:u.default,Block:h.default,Inline:f.default,Text:w.default,Attributor:{Attribute:p.default,Class:S.default,Style:b.default,Store:m.default}};n.default=y},function(r,n,i){var a=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var d in y)y.hasOwnProperty(d)&&(v[d]=y[d])};return function(v,y){m(v,y);function d(){this.constructor=v}v.prototype=y===null?Object.create(y):(d.prototype=y.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(m){a(v,m);function v(y){var d=this;return y="[Parchment] "+y,d=m.call(this,y)||this,d.message=y,d.name=d.constructor.name,d}return v}(Error);n.ParchmentError=o;var l={},u={},f={},h={};n.DATA_KEY="__blot";var E;(function(m){m[m.TYPE=3]="TYPE",m[m.LEVEL=12]="LEVEL",m[m.ATTRIBUTE=13]="ATTRIBUTE",m[m.BLOT=14]="BLOT",m[m.INLINE=7]="INLINE",m[m.BLOCK=11]="BLOCK",m[m.BLOCK_BLOT=10]="BLOCK_BLOT",m[m.INLINE_BLOT=6]="INLINE_BLOT",m[m.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",m[m.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",m[m.ANY=15]="ANY"})(E=n.Scope||(n.Scope={}));function w(m,v){var y=S(m);if(y==null)throw new o("Unable to create "+m+" blot");var d=y,g=m instanceof Node||m.nodeType===Node.TEXT_NODE?m:d.create(v);return new d(g,v)}n.create=w;function p(m,v){return v===void 0&&(v=!1),m==null?null:m[n.DATA_KEY]!=null?m[n.DATA_KEY].blot:v?p(m.parentNode,v):null}n.find=p;function S(m,v){v===void 0&&(v=E.ANY);var y;if(typeof m=="string")y=h[m]||l[m];else if(m instanceof Text||m.nodeType===Node.TEXT_NODE)y=h.text;else if(typeof m=="number")m&E.LEVEL&E.BLOCK?y=h.block:m&E.LEVEL&E.INLINE&&(y=h.inline);else if(m instanceof HTMLElement){var d=(m.getAttribute("class")||"").split(/\s+/);for(var g in d)if(y=u[d[g]],y)break;y=y||f[m.tagName]}return y==null?null:v&E.LEVEL&y.scope&&v&E.TYPE&y.scope?y:null}n.query=S;function b(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];if(m.length>1)return m.map(function(g){return b(g)});var y=m[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new o("Invalid definition");if(y.blotName==="abstract")throw new o("Cannot register abstract class");if(h[y.blotName||y.attrName]=y,typeof y.keyName=="string")l[y.keyName]=y;else if(y.className!=null&&(u[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(g){return g.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var d=Array.isArray(y.tagName)?y.tagName:[y.tagName];d.forEach(function(g){(f[g]==null||y.className==null)&&(f[g]=y)})}return y}n.register=b},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",h=function(E){Array.isArray(E)?this.ops=E:E!=null&&Array.isArray(E.ops)?this.ops=E.ops:this.ops=[]};h.prototype.insert=function(E,w){var p={};return E.length===0?this:(p.insert=E,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(p.attributes=w),this.push(p))},h.prototype.delete=function(E){return E<=0?this:this.push({delete:E})},h.prototype.retain=function(E,w){if(E<=0)return this;var p={retain:E};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(p.attributes=w),this.push(p)},h.prototype.push=function(E){var w=this.ops.length,p=this.ops[w-1];if(E=l(!0,{},E),typeof p=="object"){if(typeof E.delete=="number"&&typeof p.delete=="number")return this.ops[w-1]={delete:p.delete+E.delete},this;if(typeof p.delete=="number"&&E.insert!=null&&(w-=1,p=this.ops[w-1],typeof p!="object"))return this.ops.unshift(E),this;if(o(E.attributes,p.attributes)){if(typeof E.insert=="string"&&typeof p.insert=="string")return this.ops[w-1]={insert:p.insert+E.insert},typeof E.attributes=="object"&&(this.ops[w-1].attributes=E.attributes),this;if(typeof E.retain=="number"&&typeof p.retain=="number")return this.ops[w-1]={retain:p.retain+E.retain},typeof E.attributes=="object"&&(this.ops[w-1].attributes=E.attributes),this}}return w===this.ops.length?this.ops.push(E):this.ops.splice(w,0,E),this},h.prototype.chop=function(){var E=this.ops[this.ops.length-1];return E&&E.retain&&!E.attributes&&this.ops.pop(),this},h.prototype.filter=function(E){return this.ops.filter(E)},h.prototype.forEach=function(E){this.ops.forEach(E)},h.prototype.map=function(E){return this.ops.map(E)},h.prototype.partition=function(E){var w=[],p=[];return this.forEach(function(S){var b=E(S)?w:p;b.push(S)}),[w,p]},h.prototype.reduce=function(E,w){return this.ops.reduce(E,w)},h.prototype.changeLength=function(){return this.reduce(function(E,w){return w.insert?E+u.length(w):w.delete?E-w.delete:E},0)},h.prototype.length=function(){return this.reduce(function(E,w){return E+u.length(w)},0)},h.prototype.slice=function(E,w){E=E||0,typeof w!="number"&&(w=1/0);for(var p=[],S=u.iterator(this.ops),b=0;b<w&&S.hasNext();){var m;b<E?m=S.next(E-b):(m=S.next(w-b),p.push(m)),b+=u.length(m)}return new h(p)},h.prototype.compose=function(E){var w=u.iterator(this.ops),p=u.iterator(E.ops),S=[],b=p.peek();if(b!=null&&typeof b.retain=="number"&&b.attributes==null){for(var m=b.retain;w.peekType()==="insert"&&w.peekLength()<=m;)m-=w.peekLength(),S.push(w.next());b.retain-m>0&&p.next(b.retain-m)}for(var v=new h(S);w.hasNext()||p.hasNext();)if(p.peekType()==="insert")v.push(p.next());else if(w.peekType()==="delete")v.push(w.next());else{var y=Math.min(w.peekLength(),p.peekLength()),d=w.next(y),g=p.next(y);if(typeof g.retain=="number"){var _={};typeof d.retain=="number"?_.retain=y:_.insert=d.insert;var T=u.attributes.compose(d.attributes,g.attributes,typeof d.retain=="number");if(T&&(_.attributes=T),v.push(_),!p.hasNext()&&o(v.ops[v.ops.length-1],_)){var C=new h(w.rest());return v.concat(C).chop()}}else typeof g.delete=="number"&&typeof d.retain=="number"&&v.push(g)}return v.chop()},h.prototype.concat=function(E){var w=new h(this.ops.slice());return E.ops.length>0&&(w.push(E.ops[0]),w.ops=w.ops.concat(E.ops.slice(1))),w},h.prototype.diff=function(E,w){if(this.ops===E.ops)return new h;var p=[this,E].map(function(y){return y.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var g=y===E?"on":"with";throw new Error("diff() called "+g+" non-document")}).join("")}),S=new h,b=a(p[0],p[1],w),m=u.iterator(this.ops),v=u.iterator(E.ops);return b.forEach(function(y){for(var d=y[1].length;d>0;){var g=0;switch(y[0]){case a.INSERT:g=Math.min(v.peekLength(),d),S.push(v.next(g));break;case a.DELETE:g=Math.min(d,m.peekLength()),m.next(g),S.delete(g);break;case a.EQUAL:g=Math.min(m.peekLength(),v.peekLength(),d);var _=m.next(g),T=v.next(g);o(_.insert,T.insert)?S.retain(g,u.attributes.diff(_.attributes,T.attributes)):S.push(T).delete(g);break}d-=g}}),S.chop()},h.prototype.eachLine=function(E,w){w=w||`
114
- `;for(var p=u.iterator(this.ops),S=new h,b=0;p.hasNext();){if(p.peekType()!=="insert")return;var m=p.peek(),v=u.length(m)-p.peekLength(),y=typeof m.insert=="string"?m.insert.indexOf(w,v)-v:-1;if(y<0)S.push(p.next());else if(y>0)S.push(p.next(y));else{if(E(S,p.next(1).attributes||{},b)===!1)return;b+=1,S=new h}}S.length()>0&&E(S,{},b)},h.prototype.transform=function(E,w){if(w=!!w,typeof E=="number")return this.transformPosition(E,w);for(var p=u.iterator(this.ops),S=u.iterator(E.ops),b=new h;p.hasNext()||S.hasNext();)if(p.peekType()==="insert"&&(w||S.peekType()!=="insert"))b.retain(u.length(p.next()));else if(S.peekType()==="insert")b.push(S.next());else{var m=Math.min(p.peekLength(),S.peekLength()),v=p.next(m),y=S.next(m);if(v.delete)continue;y.delete?b.push(y):b.retain(m,u.attributes.transform(v.attributes,y.attributes,w))}return b.chop()},h.prototype.transformPosition=function(E,w){w=!!w;for(var p=u.iterator(this.ops),S=0;p.hasNext()&&S<=E;){var b=p.peekLength(),m=p.peekType();if(p.next(),m==="delete"){E-=Math.min(b,E-S);continue}else m==="insert"&&(S<E||!w)&&(E+=b);S+=b}return E},r.exports=h},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},f=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var S=i.call(p,"constructor"),b=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!S&&!b)return!1;var m;for(m in p);return typeof m>"u"||i.call(p,m)},h=function(p,S){o&&S.name==="__proto__"?o(p,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):p[S.name]=S.newValue},E=function(p,S){if(S==="__proto__")if(i.call(p,S)){if(l)return l(p,S).value}else return;return p[S]};r.exports=function w(){var p,S,b,m,v,y,d=arguments[0],g=1,_=arguments.length,T=!1;for(typeof d=="boolean"&&(T=d,d=arguments[1]||{},g=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});g<_;++g)if(p=arguments[g],p!=null)for(S in p)b=E(d,S),m=E(p,S),d!==m&&(T&&m&&(f(m)||(v=u(m)))?(v?(v=!1,y=b&&u(b)?b:[]):y=b&&f(b)?b:{},h(d,{name:S,newValue:w(T,y,m)})):typeof m<"u"&&h(d,{name:S,newValue:m}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function k(M,I){for(var H=0;H<I.length;H++){var G=I[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(M,G.key,G)}}return function(M,I,H){return I&&k(M.prototype,I),H&&k(M,H),M}}(),o=function k(M,I,H){M===null&&(M=Function.prototype);var G=Object.getOwnPropertyDescriptor(M,I);if(G===void 0){var Q=Object.getPrototypeOf(M);return Q===null?void 0:k(Q,I,H)}else{if("value"in G)return G.value;var W=G.get;return W===void 0?void 0:W.call(H)}},l=i(3),u=d(l),f=i(2),h=d(f),E=i(0),w=d(E),p=i(16),S=d(p),b=i(6),m=d(b),v=i(7),y=d(v);function d(k){return k&&k.__esModule?k:{default:k}}function g(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function _(k,M){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:k}function T(k,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);k.prototype=Object.create(M&&M.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(k,M):k.__proto__=M)}var C=1,P=function(k){T(M,k);function M(){return g(this,M),_(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return a(M,[{key:"attach",value:function(){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"attach",this).call(this),this.attributes=new w.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(H,G){var Q=w.default.query(H,w.default.Scope.BLOCK_ATTRIBUTE);Q!=null&&this.attributes.attribute(Q,G)}},{key:"formatAt",value:function(H,G,Q,W){this.format(Q,W)}},{key:"insertAt",value:function(H,G,Q){if(typeof G=="string"&&G.endsWith(`
115
- `)){var W=w.default.create(O.blotName);this.parent.insertBefore(W,H===0?this:this.next),W.insertAt(0,G.slice(0,-1))}else o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,H,G,Q)}}]),M}(w.default.Embed);P.scope=w.default.Scope.BLOCK_BLOT;var O=function(k){T(M,k);function M(I){g(this,M);var H=_(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,I));return H.cache={},H}return a(M,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(w.default.Leaf).reduce(function(H,G){return G.length()===0?H:H.insert(G.value(),x(G))},new h.default).insert(`
116
- `,x(this))),this.cache.delta}},{key:"deleteAt",value:function(H,G){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"deleteAt",this).call(this,H,G),this.cache={}}},{key:"formatAt",value:function(H,G,Q,W){G<=0||(w.default.query(Q,w.default.Scope.BLOCK)?H+G===this.length()&&this.format(Q,W):o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"formatAt",this).call(this,H,Math.min(G,this.length()-H-1),Q,W),this.cache={})}},{key:"insertAt",value:function(H,G,Q){if(Q!=null)return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,H,G,Q);if(G.length!==0){var W=G.split(`
117
- `),U=W.shift();U.length>0&&(H<this.length()-1||this.children.tail==null?o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,Math.min(H,this.length()-1),U):this.children.tail.insertAt(this.children.tail.length(),U),this.cache={});var j=this;W.reduce(function(A,L){return j=j.split(A,!0),j.insertAt(0,L),L.length},H+U.length)}}},{key:"insertBefore",value:function(H,G){var Q=this.children.head;o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertBefore",this).call(this,H,G),Q instanceof S.default&&Q.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(H,G){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"moveChildren",this).call(this,H,G),this.cache={}}},{key:"optimize",value:function(H){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"optimize",this).call(this,H),this.cache={}}},{key:"path",value:function(H){return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"path",this).call(this,H,!0)}},{key:"removeChild",value:function(H){o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"removeChild",this).call(this,H),this.cache={}}},{key:"split",value:function(H){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(G&&(H===0||H>=this.length()-C)){var Q=this.clone();return H===0?(this.parent.insertBefore(Q,this),this):(this.parent.insertBefore(Q,this.next),Q)}else{var W=o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"split",this).call(this,H,G);return this.cache={},W}}}]),M}(w.default.Block);O.blotName="block",O.tagName="P",O.defaultChild="break",O.allowedChildren=[m.default,w.default.Embed,y.default];function x(k){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(M=(0,u.default)(M,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?M:x(k.parent,M)}n.bubbleFormats=x,n.BlockEmbed=P,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o=function(){function j(A,L){var z=[],q=!0,K=!1,F=void 0;try{for(var $=A[Symbol.iterator](),B;!(q=(B=$.next()).done)&&(z.push(B.value),!(L&&z.length===L));q=!0);}catch(Y){K=!0,F=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw F}}return z}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return j(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function j(A,L){for(var z=0;z<L.length;z++){var q=L[z];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(A,q.key,q)}}return function(A,L,z){return L&&j(A.prototype,L),z&&j(A,z),A}}();i(50);var u=i(2),f=x(u),h=i(14),E=x(h),w=i(8),p=x(w),S=i(9),b=x(S),m=i(0),v=x(m),y=i(15),d=x(y),g=i(3),_=x(g),T=i(10),C=x(T),P=i(34),O=x(P);function x(j){return j&&j.__esModule?j:{default:j}}function k(j,A,L){return A in j?Object.defineProperty(j,A,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[A]=L,j}function M(j,A){if(!(j instanceof A))throw new TypeError("Cannot call a class as a function")}var I=(0,C.default)("quill"),H=function(){l(j,null,[{key:"debug",value:function(L){L===!0&&(L="log"),C.default.level(L)}},{key:"find",value:function(L){return L.__quill||v.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&I.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,z){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var F=L.attrName||L.blotName;typeof F=="string"?this.register("formats/"+F,L,z):Object.keys(L).forEach(function($){q.register($,L[$],z)})}else this.imports[L]!=null&&!K&&I.warn("Overwriting "+L+" with",z),this.imports[L]=z,(L.startsWith("blots/")||L.startsWith("formats/"))&&z.blotName!=="abstract"?v.default.register(z):L.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function j(A){var L=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(this,j),this.options=G(A,z),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",A);this.options.debug&&j.debug(this.options.debug);var q=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new E.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(F){F===p.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(F,$){var B=L.selection.lastRange,Y=B&&B.length===0?B.index:void 0;Q.call(L,function(){return L.editor.update(null,$,Y)},F)});var K=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+q+"<p><br></p></div>");this.setContents(K),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(j,[{key:"addContainer",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var q=L;L=document.createElement("div"),L.classList.add(q)}return this.container.insertBefore(L,z),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,z,q){var K=this,F=W(L,z,q),$=o(F,4);return L=$[0],z=$[1],q=$[3],Q.call(this,function(){return K.editor.deleteText(L,z)},q,L,-1*z)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,z){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return Q.call(this,function(){var F=q.getSelection(!0),$=new f.default;if(F==null)return $;if(v.default.query(L,v.default.Scope.BLOCK))$=q.editor.formatLine(F.index,F.length,k({},L,z));else{if(F.length===0)return q.selection.format(L,z),$;$=q.editor.formatText(F.index,F.length,k({},L,z))}return q.setSelection(F,p.default.sources.SILENT),$},K)}},{key:"formatLine",value:function(L,z,q,K,F){var $=this,B=void 0,Y=W(L,z,q,K,F),X=o(Y,4);return L=X[0],z=X[1],B=X[2],F=X[3],Q.call(this,function(){return $.editor.formatLine(L,z,B)},F,L,0)}},{key:"formatText",value:function(L,z,q,K,F){var $=this,B=void 0,Y=W(L,z,q,K,F),X=o(Y,4);return L=X[0],z=X[1],B=X[2],F=X[3],Q.call(this,function(){return $.editor.formatText(L,z,B)},F,L,0)}},{key:"getBounds",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=void 0;typeof L=="number"?q=this.selection.getBounds(L,z):q=this.selection.getBounds(L.index,L.length);var K=this.container.getBoundingClientRect();return{bottom:q.bottom-K.top,height:q.height,left:q.left-K.left,right:q.right-K.left,top:q.top-K.top,width:q.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,q=W(L,z),K=o(q,2);return L=K[0],z=K[1],this.editor.getContents(L,z)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,z):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,z)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,q=W(L,z),K=o(q,2);return L=K[0],z=K[1],this.editor.getText(L,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,z,q){var K=this,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:j.sources.API;return Q.call(this,function(){return K.editor.insertEmbed(L,z,q)},F,L)}},{key:"insertText",value:function(L,z,q,K,F){var $=this,B=void 0,Y=W(L,0,q,K,F),X=o(Y,4);return L=X[0],B=X[2],F=X[3],Q.call(this,function(){return $.editor.insertText(L,z,B)},F,L,z.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(L,z,q){this.clipboard.dangerouslyPasteHTML(L,z,q)}},{key:"removeFormat",value:function(L,z,q){var K=this,F=W(L,z,q),$=o(F,4);return L=$[0],z=$[1],q=$[3],Q.call(this,function(){return K.editor.removeFormat(L,z)},q,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var z=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return Q.call(this,function(){L=new f.default(L);var K=z.getLength(),F=z.editor.deleteText(0,K),$=z.editor.applyDelta(L),B=$.ops[$.ops.length-1];B!=null&&typeof B.insert=="string"&&B.insert[B.insert.length-1]===`
118
- `&&(z.editor.deleteText(z.getLength()-1,1),$.delete(1));var Y=F.compose($);return Y},q)}},{key:"setSelection",value:function(L,z,q){if(L==null)this.selection.setRange(null,z||j.sources.API);else{var K=W(L,z,q),F=o(K,4);L=F[0],z=F[1],q=F[3],this.selection.setRange(new y.Range(L,z),q),q!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,q=new f.default().insert(L);return this.setContents(q,z)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,z=this.scroll.update(L);return this.selection.update(L),z}},{key:"updateContents",value:function(L){var z=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return Q.call(this,function(){return L=new f.default(L),z.editor.applyDelta(L,q)},q,!0)}}]),j}();H.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},H.events=p.default.events,H.sources=p.default.sources,H.version="1.3.7",H.imports={delta:f.default,parchment:v.default,"core/module":b.default,"core/theme":O.default};function G(j,A){if(A=(0,_.default)(!0,{container:j,modules:{clipboard:!0,keyboard:!0,history:!0}},A),!A.theme||A.theme===H.DEFAULTS.theme)A.theme=O.default;else if(A.theme=H.import("themes/"+A.theme),A.theme==null)throw new Error("Invalid theme "+A.theme+". Did you register it?");var L=(0,_.default)(!0,{},A.theme.DEFAULTS);[L,A].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(F){K.modules[F]===!0&&(K.modules[F]={})})});var z=Object.keys(L.modules).concat(Object.keys(A.modules)),q=z.reduce(function(K,F){var $=H.import("modules/"+F);return $==null?I.error("Cannot load "+F+" module. Are you sure you registered it?"):K[F]=$.DEFAULTS||{},K},{});return A.modules!=null&&A.modules.toolbar&&A.modules.toolbar.constructor!==Object&&(A.modules.toolbar={container:A.modules.toolbar}),A=(0,_.default)(!0,{},H.DEFAULTS,{modules:q},L,A),["bounds","container","scrollingContainer"].forEach(function(K){typeof A[K]=="string"&&(A[K]=document.querySelector(A[K]))}),A.modules=Object.keys(A.modules).reduce(function(K,F){return A.modules[F]&&(K[F]=A.modules[F]),K},{}),A}function Q(j,A,L,z){if(this.options.strict&&!this.isEnabled()&&A===p.default.sources.USER)return new f.default;var q=L==null?null:this.getSelection(),K=this.editor.delta,F=j();if(q!=null&&(L===!0&&(L=q.index),z==null?q=U(q,F,A):z!==0&&(q=U(q,L,z,A)),this.setSelection(q,p.default.sources.SILENT)),F.length()>0){var $,B=[p.default.events.TEXT_CHANGE,F,K,A];if(($=this.emitter).emit.apply($,[p.default.events.EDITOR_CHANGE].concat(B)),A!==p.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,B)}}return F}function W(j,A,L,z,q){var K={};return typeof j.index=="number"&&typeof j.length=="number"?typeof A!="number"?(q=z,z=L,L=A,A=j.length,j=j.index):(A=j.length,j=j.index):typeof A!="number"&&(q=z,z=L,L=A,A=0),(typeof L>"u"?"undefined":a(L))==="object"?(K=L,q=z):typeof L=="string"&&(z!=null?K[L]=z:q=L),q=q||p.default.sources.API,[j,A,K,q]}function U(j,A,L,z){if(j==null)return null;var q=void 0,K=void 0;if(A instanceof f.default){var F=[j.index,j.index+j.length].map(function(X){return A.transformPosition(X,z!==p.default.sources.USER)}),$=o(F,2);q=$[0],K=$[1]}else{var B=[j.index,j.index+j.length].map(function(X){return X<A||X===A&&z===p.default.sources.USER?X:L>=0?X+L:Math.max(A,X+L)}),Y=o(B,2);q=Y[0],K=Y[1]}return new y.Range(q,K-q)}n.expandConfig=G,n.overload=W,n.default=H},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(v,y){for(var d=0;d<y.length;d++){var g=y[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,y,d){return y&&m(v.prototype,y),d&&m(v,d),v}}(),o=function m(v,y,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,y);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:m(_,y,d)}else{if("value"in g)return g.value;var T=g.get;return T===void 0?void 0:T.call(d)}},l=i(7),u=E(l),f=i(0),h=E(f);function E(m){return m&&m.__esModule?m:{default:m}}function w(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function S(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var b=function(m){S(v,m);function v(){return w(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"formatAt",value:function(d,g,_,T){if(v.compare(this.statics.blotName,_)<0&&h.default.query(_,h.default.Scope.BLOT)){var C=this.isolate(d,g);T&&C.wrap(_,T)}else o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,d,g,_,T)}},{key:"optimize",value:function(d){if(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,d),this.parent instanceof v&&v.compare(this.statics.blotName,this.parent.statics.blotName)>0){var g=this.parent.isolate(this.offset(),this.length());this.moveChildren(g),g.wrap(this)}}}],[{key:"compare",value:function(d,g){var _=v.order.indexOf(d),T=v.order.indexOf(g);return _>=0||T>=0?_-T:d===g?0:d<g?-1:1}}]),v}(h.default.Inline);b.allowedChildren=[b,h.default.Embed,u.default],b.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Text);n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(d,g){for(var _=0;_<g.length;_++){var T=g[_];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}return function(d,g,_){return g&&y(d.prototype,g),_&&y(d,_),d}}(),o=function y(d,g,_){d===null&&(d=Function.prototype);var T=Object.getOwnPropertyDescriptor(d,g);if(T===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:y(C,g,_)}else{if("value"in T)return T.value;var P=T.get;return P===void 0?void 0:P.call(_)}},l=i(54),u=E(l),f=i(10),h=E(f);function E(y){return y&&y.__esModule?y:{default:y}}function w(y,d){if(!(y instanceof d))throw new TypeError("Cannot call a class as a function")}function p(y,d){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:y}function S(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);y.prototype=Object.create(d&&d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(y,d):y.__proto__=d)}var b=(0,h.default)("quill:events"),m=["selectionchange","mousedown","mouseup","click"];m.forEach(function(y){document.addEventListener(y,function(){for(var d=arguments.length,g=Array(d),_=0;_<d;_++)g[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(T){if(T.__quill&&T.__quill.emitter){var C;(C=T.__quill.emitter).handleDOM.apply(C,g)}})})});var v=function(y){S(d,y);function d(){w(this,d);var g=p(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return g.listeners={},g.on("error",b.error),g}return a(d,[{key:"emit",value:function(){b.log.apply(b,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var T=arguments.length,C=Array(T>1?T-1:0),P=1;P<T;P++)C[P-1]=arguments[P];(this.listeners[_.type]||[]).forEach(function(O){var x=O.node,k=O.handler;(_.target===x||x.contains(_.target))&&k.apply(void 0,[_].concat(C))})}},{key:"listenDOM",value:function(_,T,C){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:T,handler:C})}}]),d}(u.default);v.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},v.sources={API:"api",SILENT:"silent",USER:"user"},n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var h,E=arguments.length,w=Array(E>1?E-1:0),p=1;p<E;p++)w[p-1]=arguments[p];(h=console)[f].apply(h,w)}}function u(f){return a.reduce(function(h,E){return h[E]=l.bind(console,E,f),h},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(w,p,S){return S||(S={}),w===p?!0:w instanceof Date&&p instanceof Date?w.getTime()===p.getTime():!w||!p||typeof w!="object"&&typeof p!="object"?S.strict?w===p:w==p:E(w,p,S)};function f(w){return w==null}function h(w){return!(!w||typeof w!="object"||typeof w.length!="number"||typeof w.copy!="function"||typeof w.slice!="function"||w.length>0&&typeof w[0]!="number")}function E(w,p,S){var b,m;if(f(w)||f(p)||w.prototype!==p.prototype)return!1;if(l(w))return l(p)?(w=a.call(w),p=a.call(p),u(w,p,S)):!1;if(h(w)){if(!h(p)||w.length!==p.length)return!1;for(b=0;b<w.length;b++)if(w[b]!==p[b])return!1;return!0}try{var v=o(w),y=o(p)}catch{return!1}if(v.length!=y.length)return!1;for(v.sort(),y.sort(),b=v.length-1;b>=0;b--)if(v[b]!=y[b])return!1;for(b=v.length-1;b>=0;b--)if(m=v[b],!u(w[m],p[m],S))return!1;return typeof w==typeof p}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,h){h===void 0&&(h={}),this.attrName=u,this.keyName=f;var E=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|E:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var h=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function P(O,x){var k=[],M=!0,I=!1,H=void 0;try{for(var G=O[Symbol.iterator](),Q;!(M=(Q=G.next()).done)&&(k.push(Q.value),!(x&&k.length===x));M=!0);}catch(W){I=!0,H=W}finally{try{!M&&G.return&&G.return()}finally{if(I)throw H}}return k}return function(O,x){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return P(O,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(O,x){for(var k=0;k<x.length;k++){var M=x[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}return function(O,x,k){return x&&P(O.prototype,x),k&&P(O,k),O}}(),l=function P(O,x,k){O===null&&(O=Function.prototype);var M=Object.getOwnPropertyDescriptor(O,x);if(M===void 0){var I=Object.getPrototypeOf(O);return I===null?void 0:P(I,x,k)}else{if("value"in M)return M.value;var H=M.get;return H===void 0?void 0:H.call(k)}},u=i(2),f=y(u),h=i(0),E=y(h),w=i(4),p=y(w),S=i(6),b=y(S),m=i(7),v=y(m);function y(P){return P&&P.__esModule?P:{default:P}}function d(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}function g(P,O){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:P}function _(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);P.prototype=Object.create(O&&O.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(P,O):P.__proto__=O)}var T=function(P){_(O,P);function O(){return d(this,O),g(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return O}(b.default);T.blotName="code",T.tagName="CODE";var C=function(P){_(O,P);function O(){return d(this,O),g(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return o(O,[{key:"delta",value:function(){var k=this,M=this.domNode.textContent;return M.endsWith(`
119
- `)&&(M=M.slice(0,-1)),M.split(`
120
- `).reduce(function(I,H){return I.insert(H).insert(`
121
- `,k.formats())},new f.default)}},{key:"format",value:function(k,M){if(!(k===this.statics.blotName&&M)){var I=this.descendant(v.default,this.length()-1),H=a(I,1),G=H[0];G!=null&&G.deleteAt(G.length()-1,1),l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,k,M)}}},{key:"formatAt",value:function(k,M,I,H){if(M!==0&&!(E.default.query(I,E.default.Scope.BLOCK)==null||I===this.statics.blotName&&H===this.statics.formats(this.domNode))){var G=this.newlineIndex(k);if(!(G<0||G>=k+M)){var Q=this.newlineIndex(k,!0)+1,W=G-Q+1,U=this.isolate(Q,W),j=U.next;U.format(I,H),j instanceof O&&j.formatAt(0,k-Q+M-W,I,H)}}}},{key:"insertAt",value:function(k,M,I){if(I==null){var H=this.descendant(v.default,k),G=a(H,2),Q=G[0],W=G[1];Q.insertAt(W,M)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
- `)?k:k+1}},{key:"newlineIndex",value:function(k){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(M)return this.domNode.textContent.slice(0,k).lastIndexOf(`
123
- `);var I=this.domNode.textContent.slice(k).indexOf(`
124
- `);return I>-1?k+I:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
125
- `)||this.appendChild(E.default.create("text",`
126
- `)),l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,k);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===M.statics.formats(M.domNode)&&(M.optimize(k),M.moveChildren(this),M.remove())}},{key:"replace",value:function(k){l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(M){var I=E.default.find(M);I==null?M.parentNode.removeChild(M):I instanceof E.default.Embed?I.remove():I.unwrap()})}}],[{key:"create",value:function(k){var M=l(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,k);return M.setAttribute("spellcheck",!1),M}},{key:"formats",value:function(){return!0}}]),O}(p.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=T,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o=function(){function j(A,L){var z=[],q=!0,K=!1,F=void 0;try{for(var $=A[Symbol.iterator](),B;!(q=(B=$.next()).done)&&(z.push(B.value),!(L&&z.length===L));q=!0);}catch(Y){K=!0,F=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw F}}return z}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return j(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function j(A,L){for(var z=0;z<L.length;z++){var q=L[z];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(A,q.key,q)}}return function(A,L,z){return L&&j(A.prototype,L),z&&j(A,z),A}}(),u=i(2),f=M(u),h=i(20),E=M(h),w=i(0),p=M(w),S=i(13),b=M(S),m=i(24),v=M(m),y=i(4),d=M(y),g=i(16),_=M(g),T=i(21),C=M(T),P=i(11),O=M(P),x=i(3),k=M(x);function M(j){return j&&j.__esModule?j:{default:j}}function I(j,A,L){return A in j?Object.defineProperty(j,A,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[A]=L,j}function H(j,A){if(!(j instanceof A))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Q=function(){function j(A){H(this,j),this.scroll=A,this.delta=this.getDelta()}return l(j,[{key:"applyDelta",value:function(L){var z=this,q=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),L=U(L),L.reduce(function(F,$){var B=$.retain||$.delete||$.insert.length||1,Y=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var X=$.insert;X.endsWith(`
127
- `)&&q&&(q=!1,X=X.slice(0,-1)),F>=K&&!X.endsWith(`
128
- `)&&(q=!0),z.scroll.insertAt(F,X);var Z=z.scroll.line(F),te=o(Z,2),ee=te[0],ne=te[1],ie=(0,k.default)({},(0,y.bubbleFormats)(ee));if(ee instanceof d.default){var ce=ee.descendant(p.default.Leaf,ne),Oe=o(ce,1),Te=Oe[0];ie=(0,k.default)(ie,(0,y.bubbleFormats)(Te))}Y=E.default.attributes.diff(ie,Y)||{}}else if(a($.insert)==="object"){var ae=Object.keys($.insert)[0];if(ae==null)return F;z.scroll.insertAt(F,ae,$.insert[ae])}K+=B}return Object.keys(Y).forEach(function(de){z.scroll.formatAt(F,B,de,Y[de])}),F+B},0),L.reduce(function(F,$){return typeof $.delete=="number"?(z.scroll.deleteAt(F,$.delete),F):F+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,z){return this.scroll.deleteAt(L,z),this.update(new f.default().retain(L).delete(z))}},{key:"formatLine",value:function(L,z){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(F){if(!(q.scroll.whitelist!=null&&!q.scroll.whitelist[F])){var $=q.scroll.lines(L,Math.max(z,1)),B=z;$.forEach(function(Y){var X=Y.length();if(!(Y instanceof b.default))Y.format(F,K[F]);else{var Z=L-Y.offset(q.scroll),te=Y.newlineIndex(Z+B)-Z+1;Y.formatAt(Z,te,F,K[F])}B-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(L).retain(z,(0,C.default)(K)))}},{key:"formatText",value:function(L,z){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(F){q.scroll.formatAt(L,z,F,K[F])}),this.update(new f.default().retain(L).retain(z,(0,C.default)(K)))}},{key:"getContents",value:function(L,z){return this.delta.slice(L,L+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,z){return L.concat(z.delta())},new f.default)}},{key:"getFormat",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=[],K=[];z===0?this.scroll.path(L).forEach(function($){var B=o($,1),Y=B[0];Y instanceof d.default?q.push(Y):Y instanceof p.default.Leaf&&K.push(Y)}):(q=this.scroll.lines(L,z),K=this.scroll.descendants(p.default.Leaf,L,z));var F=[q,K].map(function($){if($.length===0)return{};for(var B=(0,y.bubbleFormats)($.shift());Object.keys(B).length>0;){var Y=$.shift();if(Y==null)return B;B=W((0,y.bubbleFormats)(Y),B)}return B});return k.default.apply(k.default,F)}},{key:"getText",value:function(L,z){return this.getContents(L,z).filter(function(q){return typeof q.insert=="string"}).map(function(q){return q.insert}).join("")}},{key:"insertEmbed",value:function(L,z,q){return this.scroll.insertAt(L,z,q),this.update(new f.default().retain(L).insert(I({},z,q)))}},{key:"insertText",value:function(L,z){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
129
- `).replace(/\r/g,`
130
- `),this.scroll.insertAt(L,z),Object.keys(K).forEach(function(F){q.scroll.formatAt(L,z.length,F,K[F])}),this.update(new f.default().retain(L).insert(z,(0,C.default)(K)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==d.default.blotName||L.children.length>1?!1:L.children.head instanceof _.default}},{key:"removeFormat",value:function(L,z){var q=this.getText(L,z),K=this.scroll.line(L+z),F=o(K,2),$=F[0],B=F[1],Y=0,X=new f.default;$!=null&&($ instanceof b.default?Y=$.newlineIndex(B)-B+1:Y=$.length()-B,X=$.delta().slice(B,B+Y-1).insert(`
131
- `));var Z=this.getContents(L,z+Y),te=Z.diff(new f.default().insert(q).concat(X)),ee=new f.default().retain(L).concat(te);return this.applyDelta(ee)}},{key:"update",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(G)&&p.default.find(z[0].target)){var F=p.default.find(z[0].target),$=(0,y.bubbleFormats)(F),B=F.offset(this.scroll),Y=z[0].oldValue.replace(v.default.CONTENTS,""),X=new f.default().insert(Y),Z=new f.default().insert(F.value()),te=new f.default().retain(B).concat(X.diff(Z,q));L=te.reduce(function(ee,ne){return ne.insert?ee.insert(ne.insert,$):ee.push(ne)},new f.default),this.delta=K.compose(L)}else this.delta=this.getDelta(),(!L||!(0,O.default)(K.compose(L),this.delta))&&(L=K.diff(this.delta,q));return L}}]),j}();function W(j,A){return Object.keys(A).reduce(function(L,z){return j[z]==null||(A[z]===j[z]?L[z]=A[z]:Array.isArray(A[z])?A[z].indexOf(j[z])<0&&(L[z]=A[z].concat([j[z]])):L[z]=[A[z],j[z]]),L},{})}function U(j){return j.reduce(function(A,L){if(L.insert===1){var z=(0,C.default)(L.attributes);return delete z.image,A.insert({image:L.attributes.image},z)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,C.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var q=L.insert.replace(/\r\n/g,`
132
- `).replace(/\r/g,`
133
- `);return A.insert(q,L.attributes)}return A.push(L)},new f.default)}n.default=Q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function P(O,x){var k=[],M=!0,I=!1,H=void 0;try{for(var G=O[Symbol.iterator](),Q;!(M=(Q=G.next()).done)&&(k.push(Q.value),!(x&&k.length===x));M=!0);}catch(W){I=!0,H=W}finally{try{!M&&G.return&&G.return()}finally{if(I)throw H}}return k}return function(O,x){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return P(O,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(O,x){for(var k=0;k<x.length;k++){var M=x[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}return function(O,x,k){return x&&P(O.prototype,x),k&&P(O,k),O}}(),l=i(0),u=v(l),f=i(21),h=v(f),E=i(11),w=v(E),p=i(8),S=v(p),b=i(10),m=v(b);function v(P){return P&&P.__esModule?P:{default:P}}function y(P){if(Array.isArray(P)){for(var O=0,x=Array(P.length);O<P.length;O++)x[O]=P[O];return x}else return Array.from(P)}function d(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}var g=(0,m.default)("quill:selection"),_=function P(O){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,P),this.index=O,this.length=x},T=function(){function P(O,x){var k=this;d(this,P),this.emitter=x,this.scroll=O,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){k.mouseDown||setTimeout(k.update.bind(k,S.default.sources.USER),1)}),this.emitter.on(S.default.events.EDITOR_CHANGE,function(M,I){M===S.default.events.TEXT_CHANGE&&I.length()>0&&k.update(S.default.sources.SILENT)}),this.emitter.on(S.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var M=k.getNativeRange();M!=null&&M.start.node!==k.cursor.textNode&&k.emitter.once(S.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(M.start.node,M.start.offset,M.end.node,M.end.offset)}catch{}})}}),this.emitter.on(S.default.events.SCROLL_OPTIMIZE,function(M,I){if(I.range){var H=I.range,G=H.startNode,Q=H.startOffset,W=H.endNode,U=H.endOffset;k.setNativeRange(G,Q,W,U)}}),this.update(S.default.sources.SILENT)}return o(P,[{key:"handleComposition",value:function(){var x=this;this.root.addEventListener("compositionstart",function(){x.composing=!0}),this.root.addEventListener("compositionend",function(){if(x.composing=!1,x.cursor.parent){var k=x.cursor.restore();if(!k)return;setTimeout(function(){x.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var x=this;this.emitter.listenDOM("mousedown",document.body,function(){x.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){x.mouseDown=!1,x.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(x,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[x])){this.scroll.update();var M=this.getNativeRange();if(!(M==null||!M.native.collapsed||u.default.query(x,u.default.Scope.BLOCK))){if(M.start.node!==this.cursor.textNode){var I=u.default.find(M.start.node,!1);if(I==null)return;if(I instanceof u.default.Leaf){var H=I.split(M.start.offset);I.parent.insertBefore(this.cursor,H)}else I.insertBefore(this.cursor,M.start.node);this.cursor.attach()}this.cursor.format(x,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(x){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=this.scroll.length();x=Math.min(x,M-1),k=Math.min(x+k,M-1)-x;var I=void 0,H=this.scroll.leaf(x),G=a(H,2),Q=G[0],W=G[1];if(Q==null)return null;var U=Q.position(W,!0),j=a(U,2);I=j[0],W=j[1];var A=document.createRange();if(k>0){A.setStart(I,W);var L=this.scroll.leaf(x+k),z=a(L,2);if(Q=z[0],W=z[1],Q==null)return null;var q=Q.position(W,!0),K=a(q,2);return I=K[0],W=K[1],A.setEnd(I,W),A.getBoundingClientRect()}else{var F="left",$=void 0;return I instanceof Text?(W<I.data.length?(A.setStart(I,W),A.setEnd(I,W+1)):(A.setStart(I,W-1),A.setEnd(I,W),F="right"),$=A.getBoundingClientRect()):($=Q.domNode.getBoundingClientRect(),W>0&&(F="right")),{bottom:$.top+$.height,height:$.height,left:$[F],right:$[F],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var x=document.getSelection();if(x==null||x.rangeCount<=0)return null;var k=x.getRangeAt(0);if(k==null)return null;var M=this.normalizeNative(k);return g.info("getNativeRange",M),M}},{key:"getRange",value:function(){var x=this.getNativeRange();if(x==null)return[null,null];var k=this.normalizedToRange(x);return[k,x]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(x){var k=this,M=[[x.start.node,x.start.offset]];x.native.collapsed||M.push([x.end.node,x.end.offset]);var I=M.map(function(Q){var W=a(Q,2),U=W[0],j=W[1],A=u.default.find(U,!0),L=A.offset(k.scroll);return j===0?L:A instanceof u.default.Container?L+A.length():L+A.index(U,j)}),H=Math.min(Math.max.apply(Math,y(I)),this.scroll.length()-1),G=Math.min.apply(Math,[H].concat(y(I)));return new _(G,H-G)}},{key:"normalizeNative",value:function(x){if(!C(this.root,x.startContainer)||!x.collapsed&&!C(this.root,x.endContainer))return null;var k={start:{node:x.startContainer,offset:x.startOffset},end:{node:x.endContainer,offset:x.endOffset},native:x};return[k.start,k.end].forEach(function(M){for(var I=M.node,H=M.offset;!(I instanceof Text)&&I.childNodes.length>0;)if(I.childNodes.length>H)I=I.childNodes[H],H=0;else if(I.childNodes.length===H)I=I.lastChild,H=I instanceof Text?I.data.length:I.childNodes.length+1;else break;M.node=I,M.offset=H}),k}},{key:"rangeToNative",value:function(x){var k=this,M=x.collapsed?[x.index]:[x.index,x.index+x.length],I=[],H=this.scroll.length();return M.forEach(function(G,Q){G=Math.min(H-1,G);var W=void 0,U=k.scroll.leaf(G),j=a(U,2),A=j[0],L=j[1],z=A.position(L,Q!==0),q=a(z,2);W=q[0],L=q[1],I.push(W,L)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(x){var k=this.lastRange;if(k!=null){var M=this.getBounds(k.index,k.length);if(M!=null){var I=this.scroll.length()-1,H=this.scroll.line(Math.min(k.index,I)),G=a(H,1),Q=G[0],W=Q;if(k.length>0){var U=this.scroll.line(Math.min(k.index+k.length,I)),j=a(U,1);W=j[0]}if(!(Q==null||W==null)){var A=x.getBoundingClientRect();M.top<A.top?x.scrollTop-=A.top-M.top:M.bottom>A.bottom&&(x.scrollTop+=M.bottom-A.bottom)}}}}},{key:"setNativeRange",value:function(x,k){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(g.info("setNativeRange",x,k,M,I),!(x!=null&&(this.root.parentNode==null||x.parentNode==null||M.parentNode==null))){var G=document.getSelection();if(G!=null)if(x!=null){this.hasFocus()||this.root.focus();var Q=(this.getNativeRange()||{}).native;if(Q==null||H||x!==Q.startContainer||k!==Q.startOffset||M!==Q.endContainer||I!==Q.endOffset){x.tagName=="BR"&&(k=[].indexOf.call(x.parentNode.childNodes,x),x=x.parentNode),M.tagName=="BR"&&(I=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode);var W=document.createRange();W.setStart(x,k),W.setEnd(M,I),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(x){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof k=="string"&&(M=k,k=!1),g.info("setRange",x),x!=null){var I=this.rangeToNative(x);this.setNativeRange.apply(this,y(I).concat([k]))}else this.setNativeRange(null);this.update(M)}},{key:"update",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.default.sources.USER,k=this.lastRange,M=this.getRange(),I=a(M,2),H=I[0],G=I[1];if(this.lastRange=H,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(k,this.lastRange)){var Q;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[S.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(k),x];if((Q=this.emitter).emit.apply(Q,[S.default.events.EDITOR_CHANGE].concat(W)),x!==S.default.sources.SILENT){var U;(U=this.emitter).emit.apply(U,W)}}}}]),P}();function C(P,O){try{O.parentNode}catch{return!1}return O instanceof Text&&(O=O.parentNode),P.contains(O)}n.Range=_,n.default=T},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}return function(b,m,v){return m&&S(b.prototype,m),v&&S(b,v),b}}(),o=function S(b,m,v){b===null&&(b=Function.prototype);var y=Object.getOwnPropertyDescriptor(b,m);if(y===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,m,v)}else{if("value"in y)return y.value;var g=y.get;return g===void 0?void 0:g.call(v)}},l=i(0),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"insertInto",value:function(v,y){v.children.length===0?o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertInto",this).call(this,v,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),b}(u.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.build(),S}return w.prototype.appendChild=function(p){this.insertBefore(p)},w.prototype.attach=function(){E.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},w.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var b=h(S);p.insertBefore(b,p.children.head||void 0)}catch(m){if(m instanceof u.ParchmentError)return;throw m}})},w.prototype.deleteAt=function(p,S){if(p===0&&S===this.length())return this.remove();this.children.forEachAt(p,S,function(b,m,v){b.deleteAt(m,v)})},w.prototype.descendant=function(p,S){var b=this.children.find(S),m=b[0],v=b[1];return p.blotName==null&&p(m)||p.blotName!=null&&m instanceof p?[m,v]:m instanceof w?m.descendant(p,v):[null,-1]},w.prototype.descendants=function(p,S,b){S===void 0&&(S=0),b===void 0&&(b=Number.MAX_VALUE);var m=[],v=b;return this.children.forEachAt(S,b,function(y,d,g){(p.blotName==null&&p(y)||p.blotName!=null&&y instanceof p)&&m.push(y),y instanceof w&&(m=m.concat(y.descendants(p,d,v))),v-=g}),m},w.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),E.prototype.detach.call(this)},w.prototype.formatAt=function(p,S,b,m){this.children.forEachAt(p,S,function(v,y,d){v.formatAt(y,d,b,m)})},w.prototype.insertAt=function(p,S,b){var m=this.children.find(p),v=m[0],y=m[1];if(v)v.insertAt(y,S,b);else{var d=b==null?u.create("text",S):u.create(S,b);this.appendChild(d)}},w.prototype.insertBefore=function(p,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(b){return p instanceof b}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,S)},w.prototype.length=function(){return this.children.reduce(function(p,S){return p+S.length()},0)},w.prototype.moveChildren=function(p,S){this.children.forEach(function(b){p.insertBefore(b,S)})},w.prototype.optimize=function(p){if(E.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var S=u.create(this.statics.defaultChild);this.appendChild(S),S.optimize(p)}else this.remove()},w.prototype.path=function(p,S){S===void 0&&(S=!1);var b=this.children.find(p,S),m=b[0],v=b[1],y=[[this,p]];return m instanceof w?y.concat(m.path(v,S)):(m!=null&&y.push([m,v]),y)},w.prototype.removeChild=function(p){this.children.remove(p)},w.prototype.replace=function(p){p instanceof w&&p.moveChildren(this),E.prototype.replace.call(this,p)},w.prototype.split=function(p,S){if(S===void 0&&(S=!1),!S){if(p===0)return this;if(p===this.length())return this.next}var b=this.clone();return this.parent.insertBefore(b,this.next),this.children.forEachAt(p,this.length(),function(m,v,y){m=m.split(v,S),b.appendChild(m)}),b},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(p,S){var b=this,m=[],v=[];p.forEach(function(y){y.target===b.domNode&&y.type==="childList"&&(m.push.apply(m,y.addedNodes),v.push.apply(v,y.removedNodes))}),v.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(y);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===b.domNode)&&d.detach()}}),m.filter(function(y){return y.parentNode==b.domNode}).sort(function(y,d){return y===d?0:y.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var d=null;y.nextSibling!=null&&(d=u.find(y.nextSibling));var g=h(y);(g.next!=d||g.next==null)&&(g.parent!=null&&g.parent.removeChild(b),b.insertBefore(g,d||void 0))})},w}(l.default);function h(E){var w=u.find(E);if(w==null)try{w=u.create(E)}catch{w=u.create(u.Scope.INLINE),[].slice.call(E.childNodes).forEach(function(S){w.domNode.appendChild(S)}),E.parentNode&&E.parentNode.replaceChild(w.domNode,E),w.attach()}return w}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),h=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.attributes=new l.default(S.domNode),S}return w.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},w.prototype.format=function(p,S){var b=f.query(p);b instanceof o.default?this.attributes.attribute(b,S):S&&b!=null&&(p!==this.statics.blotName||this.formats()[p]!==S)&&this.replaceWith(p,S)},w.prototype.formats=function(){var p=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(p[this.statics.blotName]=S),p},w.prototype.replaceWith=function(p,S){var b=E.prototype.replaceWith.call(this,p,S);return this.attributes.copy(b),b},w.prototype.update=function(p,S){var b=this;E.prototype.update.call(this,p,S),p.some(function(m){return m.target===b.domNode&&m.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(p,S){var b=E.prototype.wrap.call(this,p,S);return b instanceof w&&b.statics.scope===this.statics.scope&&this.attributes.move(b),b},w}(u.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(E){return!0},h.prototype.index=function(E,w){return this.domNode===E||this.domNode.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(E,w){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return E>0&&(p+=1),[this.parent.domNode,p]},h.prototype.value=function(){var E;return E={},E[this.statics.blotName]=this.statics.value(this.domNode)||!0,E},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,h,E){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var w=o(!0,{},h);E||(w=Object.keys(w).reduce(function(S,b){return w[b]!=null&&(S[b]=w[b]),S},{}));for(var p in f)f[p]!==void 0&&h[p]===void 0&&(w[p]=f[p]);return Object.keys(w).length>0?w:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var E=Object.keys(f).concat(Object.keys(h)).reduce(function(w,p){return a(f[p],h[p])||(w[p]=h[p]===void 0?null:h[p]),w},{});return Object.keys(E).length>0?E:void 0},transform:function(f,h,E){if(typeof f!="object")return h;if(typeof h=="object"){if(!E)return h;var w=Object.keys(h).reduce(function(p,S){return f[S]===void 0&&(p[S]=h[S]),p},{});return Object.keys(w).length>0?w:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var E=this.offset,w=l.length(h);if(f>=w-E?(f=w-E,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var p={};return h.attributes&&(p.attributes=h.attributes),typeof h.retain=="number"?p.retain=f:typeof h.insert=="string"?p.insert=h.insert.substr(E,f):p.insert=h.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,E=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=h,[E].concat(w)}else return[]},r.exports=l},function(r,n){var i=function(){function a(b,m){return m!=null&&b instanceof m}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(b,m,v,y,d){typeof m=="object"&&(v=m.depth,y=m.prototype,d=m.includeNonEnumerable,m=m.circular);var g=[],_=[],T=typeof Buffer<"u";typeof m>"u"&&(m=!0),typeof v>"u"&&(v=1/0);function C(P,O){if(P===null)return null;if(O===0)return P;var x,k;if(typeof P!="object")return P;if(a(P,o))x=new o;else if(a(P,l))x=new l;else if(a(P,u))x=new u(function(A,L){P.then(function(z){A(C(z,O-1))},function(z){L(C(z,O-1))})});else if(f.__isArray(P))x=[];else if(f.__isRegExp(P))x=new RegExp(P.source,S(P)),P.lastIndex&&(x.lastIndex=P.lastIndex);else if(f.__isDate(P))x=new Date(P.getTime());else{if(T&&Buffer.isBuffer(P))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(P.length):x=new Buffer(P.length),P.copy(x),x;a(P,Error)?x=Object.create(P):typeof y>"u"?(k=Object.getPrototypeOf(P),x=Object.create(k)):(x=Object.create(y),k=y)}if(m){var M=g.indexOf(P);if(M!=-1)return _[M];g.push(P),_.push(x)}a(P,o)&&P.forEach(function(A,L){var z=C(L,O-1),q=C(A,O-1);x.set(z,q)}),a(P,l)&&P.forEach(function(A){var L=C(A,O-1);x.add(L)});for(var I in P){var H;k&&(H=Object.getOwnPropertyDescriptor(k,I)),!(H&&H.set==null)&&(x[I]=C(P[I],O-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(P),I=0;I<G.length;I++){var Q=G[I],W=Object.getOwnPropertyDescriptor(P,Q);W&&!W.enumerable&&!d||(x[Q]=C(P[Q],O-1),W.enumerable||Object.defineProperty(x,Q,{enumerable:!1}))}if(d)for(var U=Object.getOwnPropertyNames(P),I=0;I<U.length;I++){var j=U[I],W=Object.getOwnPropertyDescriptor(P,j);W&&W.enumerable||(x[j]=C(P[j],O-1),Object.defineProperty(x,j,{enumerable:!1}))}return x}return C(b,v)}f.clonePrototype=function(m){if(m===null)return null;var v=function(){};return v.prototype=m,new v};function h(b){return Object.prototype.toString.call(b)}f.__objToStr=h;function E(b){return typeof b=="object"&&h(b)==="[object Date]"}f.__isDate=E;function w(b){return typeof b=="object"&&h(b)==="[object Array]"}f.__isArray=w;function p(b){return typeof b=="object"&&h(b)==="[object RegExp]"}f.__isRegExp=p;function S(b){var m="";return b.global&&(m+="g"),b.ignoreCase&&(m+="i"),b.multiline&&(m+="m"),m}return f.__getRegExpFlags=S,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(k,M){var I=[],H=!0,G=!1,Q=void 0;try{for(var W=k[Symbol.iterator](),U;!(H=(U=W.next()).done)&&(I.push(U.value),!(M&&I.length===M));H=!0);}catch(j){G=!0,Q=j}finally{try{!H&&W.return&&W.return()}finally{if(G)throw Q}}return I}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return x(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(k,M){for(var I=0;I<M.length;I++){var H=M[I];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(k,H.key,H)}}return function(k,M,I){return M&&x(k.prototype,M),I&&x(k,I),k}}(),l=function x(k,M,I){k===null&&(k=Function.prototype);var H=Object.getOwnPropertyDescriptor(k,M);if(H===void 0){var G=Object.getPrototypeOf(k);return G===null?void 0:x(G,M,I)}else{if("value"in H)return H.value;var Q=H.get;return Q===void 0?void 0:Q.call(I)}},u=i(0),f=g(u),h=i(8),E=g(h),w=i(4),p=g(w),S=i(16),b=g(S),m=i(13),v=g(m),y=i(25),d=g(y);function g(x){return x&&x.__esModule?x:{default:x}}function _(x,k){if(!(x instanceof k))throw new TypeError("Cannot call a class as a function")}function T(x,k){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:x}function C(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);x.prototype=Object.create(k&&k.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(x,k):x.__proto__=k)}function P(x){return x instanceof p.default||x instanceof w.BlockEmbed}var O=function(x){C(k,x);function k(M,I){_(this,k);var H=T(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M));return H.emitter=I.emitter,Array.isArray(I.whitelist)&&(H.whitelist=I.whitelist.reduce(function(G,Q){return G[Q]=!0,G},{})),H.domNode.addEventListener("DOMNodeInserted",function(){}),H.optimize(),H.enable(),H}return o(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(I,H){var G=this.line(I),Q=a(G,2),W=Q[0],U=Q[1],j=this.line(I+H),A=a(j,1),L=A[0];if(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,I,H),L!=null&&W!==L&&U>0){if(W instanceof w.BlockEmbed||L instanceof w.BlockEmbed){this.optimize();return}if(W instanceof v.default){var z=W.newlineIndex(W.length(),!0);if(z>-1&&(W=W.split(z+1),W===L)){this.optimize();return}}else if(L instanceof v.default){var q=L.newlineIndex(0);q>-1&&L.split(q+1)}var K=L.children.head instanceof b.default?null:L.children.head;W.moveChildren(L,K),W.remove()}this.optimize()}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",I)}},{key:"formatAt",value:function(I,H,G,Q){this.whitelist!=null&&!this.whitelist[G]||(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,I,H,G,Q),this.optimize())}},{key:"insertAt",value:function(I,H,G){if(!(G!=null&&this.whitelist!=null&&!this.whitelist[H])){if(I>=this.length())if(G==null||f.default.query(H,f.default.Scope.BLOCK)==null){var Q=f.default.create(this.statics.defaultChild);this.appendChild(Q),G==null&&H.endsWith(`
134
- `)&&(H=H.slice(0,-1)),Q.insertAt(0,H,G)}else{var W=f.default.create(H,G);this.appendChild(W)}else l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,I,H,G);this.optimize()}}},{key:"insertBefore",value:function(I,H){if(I.statics.scope===f.default.Scope.INLINE_BLOT){var G=f.default.create(this.statics.defaultChild);G.appendChild(I),I=G}l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,I,H)}},{key:"leaf",value:function(I){return this.path(I).pop()||[null,-1]}},{key:"line",value:function(I){return I===this.length()?this.line(I-1):this.descendant(P,I)}},{key:"lines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,G=function Q(W,U,j){var A=[],L=j;return W.children.forEachAt(U,j,function(z,q,K){P(z)?A.push(z):z instanceof f.default.Container&&(A=A.concat(Q(z,q,L))),L-=K}),A};return G(this,I,H)}},{key:"optimize",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,I,H),I.length>0&&this.emitter.emit(E.default.events.SCROLL_OPTIMIZE,I,H))}},{key:"path",value:function(I){return l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,I).slice(1)}},{key:"update",value:function(I){if(this.batch!==!0){var H=E.default.sources.USER;typeof I=="string"&&(H=I),Array.isArray(I)||(I=this.observer.takeRecords()),I.length>0&&this.emitter.emit(E.default.events.SCROLL_BEFORE_UPDATE,H,I),l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,I.concat([])),I.length>0&&this.emitter.emit(E.default.events.SCROLL_UPDATE,H,I)}}}]),k}(f.default.Scroll);O.blotName="scroll",O.className="ql-editor",O.tagName="DIV",O.defaultChild="block",O.allowedChildren=[p.default,w.BlockEmbed,d.default],n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(B,Y){var X=[],Z=!0,te=!1,ee=void 0;try{for(var ne=B[Symbol.iterator](),ie;!(Z=(ie=ne.next()).done)&&(X.push(ie.value),!(Y&&X.length===Y));Z=!0);}catch(ce){te=!0,ee=ce}finally{try{!Z&&ne.return&&ne.return()}finally{if(te)throw ee}}return X}return function(B,Y){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return $(B,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(B,Y){for(var X=0;X<Y.length;X++){var Z=Y[X];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(B,Z.key,Z)}}return function(B,Y,X){return Y&&$(B.prototype,Y),X&&$(B,X),B}}(),u=i(21),f=x(u),h=i(11),E=x(h),w=i(3),p=x(w),S=i(2),b=x(S),m=i(20),v=x(m),y=i(0),d=x(y),g=i(5),_=x(g),T=i(10),C=x(T),P=i(9),O=x(P);function x($){return $&&$.__esModule?$:{default:$}}function k($,B,Y){return B in $?Object.defineProperty($,B,{value:Y,enumerable:!0,configurable:!0,writable:!0}):$[B]=Y,$}function M($,B){if(!($ instanceof B))throw new TypeError("Cannot call a class as a function")}function I($,B){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B&&(typeof B=="object"||typeof B=="function")?B:$}function H($,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);$.prototype=Object.create(B&&B.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf($,B):$.__proto__=B)}var G=(0,C.default)("quill:keyboard"),Q=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function($){H(B,$),l(B,null,[{key:"match",value:function(X,Z){return Z=F(Z),["altKey","ctrlKey","metaKey","shiftKey"].some(function(te){return!!Z[te]!==X[te]&&Z[te]!==null})?!1:Z.key===(X.which||X.keyCode)}}]);function B(Y,X){M(this,B);var Z=I(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,Y,X));return Z.bindings={},Object.keys(Z.options.bindings).forEach(function(te){te==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Z.options.bindings[te]&&Z.addBinding(Z.options.bindings[te])}),Z.addBinding({key:B.keys.ENTER,shiftKey:null},z),Z.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Z.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},j),Z.addBinding({key:B.keys.DELETE},{collapsed:!0},A)):(Z.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},j),Z.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},A)),Z.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},L),Z.addBinding({key:B.keys.DELETE},{collapsed:!1},L),Z.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},j),Z.listen(),Z}return l(B,[{key:"addBinding",value:function(X){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=F(X);if(ee==null||ee.key==null)return G.warn("Attempted to add invalid keyboard binding",ee);typeof Z=="function"&&(Z={handler:Z}),typeof te=="function"&&(te={handler:te}),ee=(0,p.default)(ee,Z,te),this.bindings[ee.key]=this.bindings[ee.key]||[],this.bindings[ee.key].push(ee)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Z){if(!Z.defaultPrevented){var te=Z.which||Z.keyCode,ee=(X.bindings[te]||[]).filter(function(ke){return B.match(Z,ke)});if(ee.length!==0){var ne=X.quill.getSelection();if(!(ne==null||!X.quill.hasFocus())){var ie=X.quill.getLine(ne.index),ce=o(ie,2),Oe=ce[0],Te=ce[1],ae=X.quill.getLeaf(ne.index),de=o(ae,2),ye=de[0],ve=de[1],re=ne.length===0?[ye,ve]:X.quill.getLeaf(ne.index+ne.length),oe=o(re,2),be=oe[0],Ee=oe[1],Ge=ye instanceof d.default.Text?ye.value().slice(0,ve):"",et=be instanceof d.default.Text?be.value().slice(Ee):"",Ae={collapsed:ne.length===0,empty:ne.length===0&&Oe.length()<=1,format:X.quill.getFormat(ne),offset:Te,prefix:Ge,suffix:et},Ce=ee.some(function(ke){if(ke.collapsed!=null&&ke.collapsed!==Ae.collapsed||ke.empty!=null&&ke.empty!==Ae.empty||ke.offset!=null&&ke.offset!==Ae.offset)return!1;if(Array.isArray(ke.format)){if(ke.format.every(function(Ne){return Ae.format[Ne]==null}))return!1}else if(a(ke.format)==="object"&&!Object.keys(ke.format).every(function(Ne){return ke.format[Ne]===!0?Ae.format[Ne]!=null:ke.format[Ne]===!1?Ae.format[Ne]==null:(0,E.default)(ke.format[Ne],Ae.format[Ne])}))return!1;return ke.prefix!=null&&!ke.prefix.test(Ae.prefix)||ke.suffix!=null&&!ke.suffix.test(Ae.suffix)?!1:ke.handler.call(X,ne,Ae)!==!0});Ce&&Z.preventDefault()}}}})}}]),B}(O.default);W.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},W.DEFAULTS={bindings:{bold:K("bold"),italic:K("italic"),underline:K("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(B,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:W.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(B,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:W.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(B,Y){Y.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):Y.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":q(!0),"outdent code-block":q(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(B){this.quill.deleteText(B.index-1,1,_.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(B){this.quill.history.cutoff();var Y=new b.default().retain(B.index).delete(B.length).insert(" ");this.quill.updateContents(Y,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index+1,_.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(B,Y){this.quill.format("list",!1,_.default.sources.USER),Y.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(B){var Y=this.quill.getLine(B.index),X=o(Y,2),Z=X[0],te=X[1],ee=(0,p.default)({},Z.formats(),{list:"checked"}),ne=new b.default().retain(B.index).insert(`
135
- `,ee).retain(Z.length()-te-1).retain(1,{list:"unchecked"});this.quill.updateContents(ne,_.default.sources.USER),this.quill.setSelection(B.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(B,Y){var X=this.quill.getLine(B.index),Z=o(X,2),te=Z[0],ee=Z[1],ne=new b.default().retain(B.index).insert(`
136
- `,Y.format).retain(te.length()-ee-1).retain(1,{header:null});this.quill.updateContents(ne,_.default.sources.USER),this.quill.setSelection(B.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(B,Y){var X=Y.prefix.length,Z=this.quill.getLine(B.index),te=o(Z,2),ee=te[0],ne=te[1];if(ne>X)return!0;var ie=void 0;switch(Y.prefix.trim()){case"[]":case"[ ]":ie="unchecked";break;case"[x]":ie="checked";break;case"-":case"*":ie="bullet";break;default:ie="ordered"}this.quill.insertText(B.index," ",_.default.sources.USER),this.quill.history.cutoff();var ce=new b.default().retain(B.index-ne).delete(X+1).retain(ee.length()-2-ne).retain(1,{list:ie});this.quill.updateContents(ce,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index-X,_.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(B){var Y=this.quill.getLine(B.index),X=o(Y,2),Z=X[0],te=X[1],ee=new b.default().retain(B.index+Z.length()-te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,_.default.sources.USER)}},"embed left":U(W.keys.LEFT,!1),"embed left shift":U(W.keys.LEFT,!0),"embed right":U(W.keys.RIGHT,!1),"embed right shift":U(W.keys.RIGHT,!0)}};function U($,B){var Y,X=$===W.keys.LEFT?"prefix":"suffix";return Y={key:$,shiftKey:B,altKey:null},k(Y,X,/^$/),k(Y,"handler",function(te){var ee=te.index;$===W.keys.RIGHT&&(ee+=te.length+1);var ne=this.quill.getLeaf(ee),ie=o(ne,1),ce=ie[0];return ce instanceof d.default.Embed?($===W.keys.LEFT?B?this.quill.setSelection(te.index-1,te.length+1,_.default.sources.USER):this.quill.setSelection(te.index-1,_.default.sources.USER):B?this.quill.setSelection(te.index,te.length+1,_.default.sources.USER):this.quill.setSelection(te.index+te.length+1,_.default.sources.USER),!1):!0}),Y}function j($,B){if(!($.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine($.index),X=o(Y,1),Z=X[0],te={};if(B.offset===0){var ee=this.quill.getLine($.index-1),ne=o(ee,1),ie=ne[0];if(ie!=null&&ie.length()>1){var ce=Z.formats(),Oe=this.quill.getFormat($.index-1,1);te=v.default.attributes.diff(ce,Oe)||{}}}var Te=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText($.index-Te,Te,_.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine($.index-Te,Te,te,_.default.sources.USER),this.quill.focus()}}function A($,B){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(B.suffix)?2:1;if(!($.index>=this.quill.getLength()-Y)){var X={},Z=0,te=this.quill.getLine($.index),ee=o(te,1),ne=ee[0];if(B.offset>=ne.length()-1){var ie=this.quill.getLine($.index+1),ce=o(ie,1),Oe=ce[0];if(Oe){var Te=ne.formats(),ae=this.quill.getFormat($.index,1);X=v.default.attributes.diff(Te,ae)||{},Z=Oe.length()}}this.quill.deleteText($.index,Y,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index+Z-1,Y,X,_.default.sources.USER)}}function L($){var B=this.quill.getLines($),Y={};if(B.length>1){var X=B[0].formats(),Z=B[B.length-1].formats();Y=v.default.attributes.diff(Z,X)||{}}this.quill.deleteText($,_.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine($.index,1,Y,_.default.sources.USER),this.quill.setSelection($.index,_.default.sources.SILENT),this.quill.focus()}function z($,B){var Y=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var X=Object.keys(B.format).reduce(function(Z,te){return d.default.query(te,d.default.Scope.BLOCK)&&!Array.isArray(B.format[te])&&(Z[te]=B.format[te]),Z},{});this.quill.insertText($.index,`
137
- `,X,_.default.sources.USER),this.quill.setSelection($.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(B.format).forEach(function(Z){X[Z]==null&&(Array.isArray(B.format[Z])||Z!=="link"&&Y.quill.format(Z,B.format[Z],_.default.sources.USER))})}function q($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Z=Y.index,te=Y.length,ee=this.quill.scroll.descendant(X,Z),ne=o(ee,2),ie=ne[0],ce=ne[1];if(ie!=null){var Oe=this.quill.getIndex(ie),Te=ie.newlineIndex(ce,!0)+1,ae=ie.newlineIndex(Oe+ce+te),de=ie.domNode.textContent.slice(Te,ae).split(`
138
- `);ce=0,de.forEach(function(ye,ve){$?(ie.insertAt(Te+ce,X.TAB),ce+=X.TAB.length,ve===0?Z+=X.TAB.length:te+=X.TAB.length):ye.startsWith(X.TAB)&&(ie.deleteAt(Te+ce,X.TAB.length),ce-=X.TAB.length,ve===0?Z-=X.TAB.length:te-=X.TAB.length),ce+=ye.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Z,te,_.default.sources.SILENT)}}}}function K($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format($,!X.format[$],_.default.sources.USER)}}}function F($){if(typeof $=="string"||typeof $=="number")return F({key:$});if((typeof $>"u"?"undefined":a($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(W.keys[$.key.toUpperCase()]!=null)$.key=W.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Q]=$.shortKey,delete $.shortKey),$}n.default=W,n.SHORTKEY=Q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(y,d){var g=[],_=!0,T=!1,C=void 0;try{for(var P=y[Symbol.iterator](),O;!(_=(O=P.next()).done)&&(g.push(O.value),!(d&&g.length===d));_=!0);}catch(x){T=!0,C=x}finally{try{!_&&P.return&&P.return()}finally{if(T)throw C}}return g}return function(y,d){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return v(y,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function v(y,d,g){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:v(T,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=function(){function v(y,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,g){return d&&v(y.prototype,d),g&&v(y,g),y}}(),u=i(0),f=w(u),h=i(7),E=w(h);function w(v){return v&&v.__esModule?v:{default:v}}function p(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function S(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function b(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var m=function(v){b(y,v),l(y,null,[{key:"value",value:function(){}}]);function y(d,g){p(this,y);var _=S(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return _.selection=g,_.textNode=document.createTextNode(y.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(g,_){if(this._length!==0)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,g,_);for(var T=this,C=0;T!=null&&T.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=T.offset(T.parent),T=T.parent;T!=null&&(this._length=y.CONTENTS.length,T.optimize(),T.formatAt(C,y.CONTENTS.length,g,_),this._length=0)}},{key:"index",value:function(g,_){return g===this.textNode?0:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,g,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var g=this.textNode,_=this.selection.getNativeRange(),T=void 0,C=void 0,P=void 0;if(_!=null&&_.start.node===g&&_.end.node===g){var O=[g,_.start.offset,_.end.offset];T=O[0],C=O[1],P=O[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var x=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof E.default?(T=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=y.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var k=[C,P].map(function(I){return Math.max(0,Math.min(T.data.length,I-1))}),M=a(k,2);return C=M[0],P=M[1],{startNode:T,startOffset:C,endNode:T,endOffset:P}}}}},{key:"update",value:function(g,_){var T=this;if(g.some(function(P){return P.type==="characterData"&&P.target===T.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),y}(f.default.Embed);m.blotName="cursor",m.className="ql-cursor",m.tagName="span",m.CONTENTS="\uFEFF",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Container);p.allowedChildren=[u.default,l.BlockEmbed,p],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function m(v,y){for(var d=0;d<y.length;d++){var g=y[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,y,d){return y&&m(v.prototype,y),d&&m(v,d),v}}(),o=function m(v,y,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,y);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:m(_,y,d)}else{if("value"in g)return g.value;var T=g.get;return T===void 0?void 0:T.call(d)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function h(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function E(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function w(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var p=function(m){w(v,m);function v(){return h(this,v),E(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"value",value:function(d){var g=o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,d);return g.startsWith("rgb(")?(g=g.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+g.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):g}}]),v}(u.default.Attributor.Style),S=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),b=new p("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=S,n.ColorStyle=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function b(m,v){for(var y=0;y<v.length;y++){var d=v[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,v,y){return v&&b(m.prototype,v),y&&b(m,y),m}}(),o=function b(m,v,y){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,v);if(d===void 0){var g=Object.getPrototypeOf(m);return g===null?void 0:b(g,v,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(6),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function E(b,m){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:b}function w(b,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);b.prototype=Object.create(m&&m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(b,m):b.__proto__=m)}var p=function(b){w(m,b);function m(){return h(this,m),E(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"format",value:function(y,d){if(y!==this.statics.blotName||!d)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,y,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(y){var d=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,y);return y=this.sanitize(y),d.setAttribute("href",y),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return S(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),m}(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(b,m){var v=document.createElement("a");v.href=b;var y=v.href.slice(0,v.href.indexOf(":"));return m.indexOf(y)>-1}n.default=p,n.sanitize=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},o=function(){function m(v,y){for(var d=0;d<y.length;d++){var g=y[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,y,d){return y&&m(v.prototype,y),d&&m(v,d),v}}(),l=i(23),u=E(l),f=i(107),h=E(f);function E(m){return m&&m.__esModule?m:{default:m}}function w(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}var p=0;function S(m,v){m.setAttribute(v,m.getAttribute(v)!=="true")}var b=function(){function m(v){var y=this;w(this,m),this.select=v,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:y.togglePicker();break;case u.default.keys.ESCAPE:y.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(m,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),S(this.label,"aria-expanded"),S(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var d=this,g=document.createElement("span");return g.tabIndex="0",g.setAttribute("role","button"),g.classList.add("ql-picker-item"),y.hasAttribute("value")&&g.setAttribute("data-value",y.getAttribute("value")),y.textContent&&g.setAttribute("data-label",y.textContent),g.addEventListener("click",function(){d.selectItem(g,!0)}),g.addEventListener("keydown",function(_){switch(_.keyCode){case u.default.keys.ENTER:d.selectItem(g,!0),_.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),g}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=h.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(g){var _=y.buildItem(g);d.appendChild(_),g.selected===!0&&y.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(d){y.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(y){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.container.querySelector(".ql-selected");if(y!==g&&(g!=null&&g.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var g=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",g)}}]),m}();n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=G(a),l=i(5),u=G(l),f=i(4),h=G(f),E=i(16),w=G(E),p=i(25),S=G(p),b=i(24),m=G(b),v=i(35),y=G(v),d=i(6),g=G(d),_=i(22),T=G(_),C=i(7),P=G(C),O=i(55),x=G(O),k=i(42),M=G(k),I=i(23),H=G(I);function G(Q){return Q&&Q.__esModule?Q:{default:Q}}u.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":S.default,"blots/cursor":m.default,"blots/embed":y.default,"blots/inline":g.default,"blots/scroll":T.default,"blots/text":P.default,"modules/clipboard":x.default,"modules/history":M.default,"modules/keyboard":H.default}),o.default.register(h.default,w.default,m.default,g.default,T.default,P.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?f=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?f=document.createElement(u):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,f){var h=this.isolate(u,f);h.remove()},l.prototype.formatAt=function(u,f,h,E){var w=this.isolate(u,f);if(a.query(h,a.Scope.BLOT)!=null&&E)w.wrap(h,E);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);w.wrap(p),p.format(h,E)}},l.prototype.insertAt=function(u,f,h){var E=h==null?a.create("text",f):a.create(f,h),w=this.split(u);this.parent.insertBefore(E,w)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var h=this.split(u);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return h.replace(this),h},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function h(E){this.attributes={},this.domNode=E,this.build()}return h.prototype.attribute=function(E,w){w?E.add(this.domNode,w)&&(E.value(this.domNode)!=null?this.attributes[E.attrName]=E:delete this.attributes[E.attrName]):(E.remove(this.domNode),delete this.attributes[E.attrName])},h.prototype.build=function(){var E=this;this.attributes={};var w=a.default.keys(this.domNode),p=o.default.keys(this.domNode),S=l.default.keys(this.domNode);w.concat(p).concat(S).forEach(function(b){var m=u.query(b,u.Scope.ATTRIBUTE);m instanceof a.default&&(E.attributes[m.attrName]=m)})},h.prototype.copy=function(E){var w=this;Object.keys(this.attributes).forEach(function(p){var S=w.attributes[p].value(w.domNode);E.format(p,S)})},h.prototype.move=function(E){var w=this;this.copy(E),Object.keys(this.attributes).forEach(function(p){w.attributes[p].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var E=this;return Object.keys(this.attributes).reduce(function(w,p){return w[p]=E.attributes[p].value(E.domNode),w},{})},h}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,h){var E=f.getAttribute("class")||"";return E.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(E){return(E.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(E,w){return this.canAdd(E,w)?(this.remove(E),E.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(E){var w=l(E,this.keyName);w.forEach(function(p){E.classList.remove(p)}),E.classList.length===0&&E.removeAttribute("class")},h.prototype.value=function(E){var w=l(E,this.keyName)[0]||"",p=w.slice(this.keyName.length+1);return this.canAdd(E,p)?p:""},h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var h=f.split("-"),E=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+E}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(E){return(E.getAttribute("style")||"").split(";").map(function(w){var p=w.split(":");return p[0].trim()})},h.prototype.add=function(E,w){return this.canAdd(E,w)?(E.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(E){E.style[l(this.keyName)]="",E.getAttribute("style")||E.removeAttribute("style")},h.prototype.value=function(E){var w=E.style[l(this.keyName)];return this.canAdd(E,w)?w:""},h}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var E=0;E<h.length;E++){var w=h[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,E){return h&&u(f.prototype,h),E&&u(f,E),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){o(this,u),this.quill=f,this.options=h,this.modules={}}return a(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(E){h.modules[E]==null&&h.addModule(E)})}},{key:"addModule",value:function(h){var E=this.quill.constructor.import("modules/"+h);return this.modules[h]=new E(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(y,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,g){return d&&v(y.prototype,d),g&&v(y,g),y}}(),o=function v(y,d,g){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:v(T,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=i(0),u=E(l),f=i(7),h=E(f);function E(v){return v&&v.__esModule?v:{default:v}}function w(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function p(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function S(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var b="\uFEFF",m=function(v){S(y,v);function y(d){w(this,y);var g=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return g.contentNode=document.createElement("span"),g.contentNode.setAttribute("contenteditable",!1),[].slice.call(g.domNode.childNodes).forEach(function(_){g.contentNode.appendChild(_)}),g.leftGuard=document.createTextNode(b),g.rightGuard=document.createTextNode(b),g.domNode.appendChild(g.leftGuard),g.domNode.appendChild(g.contentNode),g.domNode.appendChild(g.rightGuard),g}return a(y,[{key:"index",value:function(g,_){return g===this.leftGuard?0:g===this.rightGuard?1:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,g,_)}},{key:"restore",value:function(g){var _=void 0,T=void 0,C=g.data.split(b).join("");if(g===this.leftGuard)if(this.prev instanceof h.default){var P=this.prev.length();this.prev.insertAt(P,C),_={startNode:this.prev.domNode,startOffset:P+C.length}}else T=document.createTextNode(C),this.parent.insertBefore(u.default.create(T),this),_={startNode:T,startOffset:C.length};else g===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(T=document.createTextNode(C),this.parent.insertBefore(u.default.create(T),this.next),_={startNode:T,startOffset:C.length}));return g.data=b,_}},{key:"update",value:function(g,_){var T=this;g.forEach(function(C){if(C.type==="characterData"&&(C.target===T.leftGuard||C.target===T.rightGuard)){var P=T.restore(C.target);P&&(_.range=P)}})}}]),y}(u.default.Embed);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),E=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=h,n.AlignStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(E){return E&&E.__esModule?E:{default:E}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),E=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=h,n.DirectionStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function v(y,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,g){return d&&v(y.prototype,d),g&&v(y,g),y}}(),o=function v(y,d,g){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:v(T,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=i(0),u=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function h(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function E(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function w(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new u.default.Attributor.Class("font","ql-font",p),b=function(v){w(y,v);function y(){return h(this,y),E(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"value",value:function(g){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,g).replace(/["']/g,"")}}]),y}(u.default.Attributor.Style),m=new b("font","font-family",p);n.FontStyle=m,n.FontClass=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(g,_){for(var T=0;T<_.length;T++){var C=_[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(g,C.key,C)}}return function(g,_,T){return _&&d(g.prototype,_),T&&d(g,T),g}}(),o=i(0),l=w(o),u=i(5),f=w(u),h=i(9),E=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function p(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function S(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function b(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var m=function(d){b(g,d);function g(_,T){p(this,g);var C=S(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,_,T));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(P,O,x,k){P!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||k===f.default.sources.USER?C.record(O,x):C.transform(O))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return a(g,[{key:"change",value:function(T,C){if(this.stack[T].length!==0){var P=this.stack[T].pop();this.stack[C].push(P),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(P[T],f.default.sources.USER),this.ignoreChange=!1;var O=y(P[T]);this.quill.setSelection(O)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(T,C){if(T.ops.length!==0){this.stack.redo=[];var P=this.quill.getContents().diff(C),O=Date.now();if(this.lastRecorded+this.options.delay>O&&this.stack.undo.length>0){var x=this.stack.undo.pop();P=P.compose(x.undo),T=x.redo.compose(T)}else this.lastRecorded=O;this.stack.undo.push({redo:T,undo:P}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(T){this.stack.undo.forEach(function(C){C.undo=T.transform(C.undo,!0),C.redo=T.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=T.transform(C.undo,!0),C.redo=T.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),g}(E.default);m.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function v(d){var g=d.ops[d.ops.length-1];return g==null?!1:g.insert!=null?typeof g.insert=="string"&&g.insert.endsWith(`
139
- `):g.attributes!=null?Object.keys(g.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function y(d){var g=d.reduce(function(T,C){return T+=C.delete||0,T},0),_=d.length()-g;return v(d)&&(_-=1),_}n.default=m,n.getLastChangeIndex=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function z(q,K){for(var F=0;F<K.length;F++){var $=K[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(q,$.key,$)}}return function(q,K,F){return K&&z(q.prototype,K),F&&z(q,F),q}}(),o=function z(q,K,F){q===null&&(q=Function.prototype);var $=Object.getOwnPropertyDescriptor(q,K);if($===void 0){var B=Object.getPrototypeOf(q);return B===null?void 0:z(B,K,F)}else{if("value"in $)return $.value;var Y=$.get;return Y===void 0?void 0:Y.call(F)}},l=i(3),u=O(l),f=i(2),h=O(f),E=i(8),w=O(E),p=i(23),S=O(p),b=i(34),m=O(b),v=i(59),y=O(v),d=i(60),g=O(d),_=i(28),T=O(_),C=i(61),P=O(C);function O(z){return z&&z.__esModule?z:{default:z}}function x(z,q){if(!(z instanceof q))throw new TypeError("Cannot call a class as a function")}function k(z,q){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:z}function M(z,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);z.prototype=Object.create(q&&q.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(z,q):z.__proto__=q)}var I=[!1,"center","right","justify"],H=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],G=[!1,"serif","monospace"],Q=["1","2","3",!1],W=["small",!1,"large","huge"],U=function(z){M(q,z);function q(K,F){x(this,q);var $=k(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,F)),B=function Y(X){if(!document.body.contains(K.root))return document.body.removeEventListener("click",Y);$.tooltip!=null&&!$.tooltip.root.contains(X.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(Z){Z.container.contains(X.target)||Z.close()})};return K.emitter.listenDOM("click",document.body,B),$}return a(q,[{key:"addModule",value:function(F){var $=o(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"addModule",this).call(this,F);return F==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(F,$){F.forEach(function(B){var Y=B.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")B.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")B.innerHTML=$[X];else{var Z=B.value||"";Z!=null&&$[X][Z]&&(B.innerHTML=$[X][Z])}})})}},{key:"buildPickers",value:function(F,$){var B=this;this.pickers=F.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&L(X,I),new g.default(X,$.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Z=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&L(X,H,Z==="background"?"#ffffff":"#000000"),new y.default(X,$[Z])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?L(X,G):X.classList.contains("ql-header")?L(X,Q):X.classList.contains("ql-size")&&L(X,W)),new T.default(X)});var Y=function(){B.pickers.forEach(function(Z){Z.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,Y)}}]),q}(m.default);U.DEFAULTS=(0,u.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var q=this,K=this.container.querySelector("input.ql-image[type=file]");K==null&&(K=document.createElement("input"),K.setAttribute("type","file"),K.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),K.classList.add("ql-image"),K.addEventListener("change",function(){if(K.files!=null&&K.files[0]!=null){var F=new FileReader;F.onload=function($){var B=q.quill.getSelection(!0);q.quill.updateContents(new h.default().retain(B.index).delete(B.length).insert({image:$.target.result}),w.default.sources.USER),q.quill.setSelection(B.index+1,w.default.sources.SILENT),K.value=""},F.readAsDataURL(K.files[0])}}),this.container.appendChild(K)),K.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var j=function(z){M(q,z);function q(K,F){x(this,q);var $=k(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,F));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return a(q,[{key:"listen",value:function(){var F=this;this.textbox.addEventListener("keydown",function($){S.default.match($,"enter")?(F.save(),$.preventDefault()):S.default.match($,"escape")&&(F.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:F!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+F)||""),this.root.setAttribute("data-mode",F)}},{key:"restoreFocus",value:function(){var F=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=F}},{key:"save",value:function(){var F=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",F,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",F,w.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":F=A(F);case"formula":{if(!F)break;var B=this.quill.getSelection(!0);if(B!=null){var Y=B.index+B.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),F,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Y+1," ",w.default.sources.USER),this.quill.setSelection(Y+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),q}(P.default);function A(z){var q=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return q?(q[1]||"https")+"://www.youtube.com/embed/"+q[2]+"?showinfo=0":(q=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(q[1]||"https")+"://player.vimeo.com/video/"+q[2]+"/":z}function L(z,q){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;q.forEach(function(F){var $=document.createElement("option");F===K?$.setAttribute("selected","selected"):$.setAttribute("value",F),z.appendChild($)})}n.BaseTooltip=j,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,h=this.iterator();f=h();){var E=f.length();if(l<E||u&&l===E&&(f.next==null||f.next.length()!==0))return[f,l];l-=E}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var h=this.find(l),E=h[0],w=h[1],p,S=l-w,b=this.iterator(E);(p=b())&&S<l+u;){var m=p.length();l>S?f(p,l-S,Math.min(u,S+m-l)):f(p,0,Math.min(m,l+u-S)),S+=m}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,h=this.iterator();f=h();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.scroll=S,S.observer=new MutationObserver(function(b){S.update(b)}),S.observer.observe(S.domNode,u),S.attach(),S}return w.prototype.detach=function(){E.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(p,S){this.update(),p===0&&S===this.length()?this.children.forEach(function(b){b.remove()}):E.prototype.deleteAt.call(this,p,S)},w.prototype.formatAt=function(p,S,b,m){this.update(),E.prototype.formatAt.call(this,p,S,b,m)},w.prototype.insertAt=function(p,S,b){this.update(),E.prototype.insertAt.call(this,p,S,b)},w.prototype.optimize=function(p,S){var b=this;p===void 0&&(p=[]),S===void 0&&(S={}),E.prototype.optimize.call(this,S);for(var m=[].slice.call(this.observer.takeRecords());m.length>0;)p.push(m.pop());for(var v=function(_,T){T===void 0&&(T=!0),!(_==null||_===b)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),T&&v(_.parent))},y=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof o.default&&_.children.forEach(y),_.optimize(S))},d=p,g=0;d.length>0;g+=1){if(g>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var T=l.find(_.target,!0);T!=null&&(T.domNode===_.target&&(_.type==="childList"?(v(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var P=l.find(C,!1);v(P,!1),P instanceof o.default&&P.children.forEach(function(O){v(O,!1)})})):_.type==="attributes"&&v(T.prev)),v(T))}),this.children.forEach(y),d=[].slice.call(this.observer.takeRecords()),m=d.slice();m.length>0;)p.push(m.pop())}},w.prototype.update=function(p,S){var b=this;S===void 0&&(S={}),p=p||this.observer.takeRecords(),p.map(function(m){var v=l.find(m.target,!0);return v==null?null:v.domNode[l.DATA_KEY].mutations==null?(v.domNode[l.DATA_KEY].mutations=[m],v):(v.domNode[l.DATA_KEY].mutations.push(m),null)}).forEach(function(m){m==null||m===b||m.domNode[l.DATA_KEY]==null||m.update(m.domNode[l.DATA_KEY].mutations||[],S)}),this.domNode[l.DATA_KEY].mutations!=null&&E.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,S),this.optimize(p,S)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var p in w)w.hasOwnProperty(p)&&(E[p]=w[p])};return function(E,w){h(E,w);function p(){this.constructor=E}E.prototype=w===null?Object.create(w):(p.prototype=w.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(h,E){if(Object.keys(h).length!==Object.keys(E).length)return!1;for(var w in h)if(h[w]!==E[w])return!1;return!0}var f=function(h){a(E,h);function E(){return h!==null&&h.apply(this,arguments)||this}return E.formats=function(w){if(w.tagName!==E.tagName)return h.formats.call(this,w)},E.prototype.format=function(w,p){var S=this;w===this.statics.blotName&&!p?(this.children.forEach(function(b){b instanceof o.default||(b=b.wrap(E.blotName,!0)),S.attributes.copy(b)}),this.unwrap()):h.prototype.format.call(this,w,p)},E.prototype.formatAt=function(w,p,S,b){if(this.formats()[S]!=null||l.query(S,l.Scope.ATTRIBUTE)){var m=this.isolate(w,p);m.format(S,b)}else h.prototype.formatAt.call(this,w,p,S,b)},E.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var S=this.next;S instanceof E&&S.prev===this&&u(p,S.formats())&&(S.moveChildren(this),S.remove())},E.blotName="inline",E.scope=l.Scope.INLINE_BLOT,E.tagName="SPAN",E}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(E){var w=l.query(h.blotName).tagName;if(E.tagName!==w)return f.formats.call(this,E)},h.prototype.format=function(E,w){l.query(E,l.Scope.BLOCK)!=null&&(E===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,E,w))},h.prototype.formatAt=function(E,w,p,S){l.query(p,l.Scope.BLOCK)!=null?this.format(p,S):f.prototype.formatAt.call(this,E,w,p,S)},h.prototype.insertAt=function(E,w,p){if(p==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,E,w,p);else{var S=this.split(E),b=l.create(w,p);S.parent.insertBefore(b,S)}},h.prototype.update=function(E,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,E,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var E in h)h.hasOwnProperty(E)&&(f[E]=h[E])};return function(f,h){u(f,h);function E(){this.constructor=f}f.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,E){u.prototype.formatAt.call(this,0,this.length(),h,E)},f.prototype.formatAt=function(h,E,w,p){h===0&&E===this.length()?this.format(w,p):u.prototype.formatAt.call(this,h,E,w,p)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(h,f);function h(E){var w=f.call(this,E)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(E){return document.createTextNode(E)},h.value=function(E){var w=E.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(E,w){this.domNode.data=this.text=this.text.slice(0,E)+this.text.slice(E+w)},h.prototype.index=function(E,w){return this.domNode===E?w:-1},h.prototype.insertAt=function(E,w,p){p==null?(this.text=this.text.slice(0,E)+w+this.text.slice(E),this.domNode.data=this.text):f.prototype.insertAt.call(this,E,w,p)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(E){f.prototype.optimize.call(this,E),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(E,w){return[this.domNode,E]},h.prototype.split=function(E,w){if(w===void 0&&(w=!1),!w){if(E===0)return this;if(E===this.length())return this.next}var p=l.create(this.domNode.splitText(E));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},h.prototype.update=function(E,w){var p=this;E.some(function(S){return S.type==="characterData"&&S.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var h=f.indexOf(l,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,E=arguments[1],w,p=0;p<h;p++)if(w=f[p],u.call(E,w,p,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(g,_,T){if(g==_)return g?[[o,g]]:[];(T<0||g.length<T)&&(T=null);var C=E(g,_),P=g.substring(0,C);g=g.substring(C),_=_.substring(C),C=w(g,_);var O=g.substring(g.length-C);g=g.substring(0,g.length-C),_=_.substring(0,_.length-C);var x=u(g,_);return P&&x.unshift([o,P]),O&&x.push([o,O]),S(x),T!=null&&(x=v(x,T)),x=y(x),x}function u(g,_){var T;if(!g)return[[a,_]];if(!_)return[[i,g]];var C=g.length>_.length?g:_,P=g.length>_.length?_:g,O=C.indexOf(P);if(O!=-1)return T=[[a,C.substring(0,O)],[o,P],[a,C.substring(O+P.length)]],g.length>_.length&&(T[0][0]=T[2][0]=i),T;if(P.length==1)return[[i,g],[a,_]];var x=p(g,_);if(x){var k=x[0],M=x[1],I=x[2],H=x[3],G=x[4],Q=l(k,I),W=l(M,H);return Q.concat([[o,G]],W)}return f(g,_)}function f(g,_){for(var T=g.length,C=_.length,P=Math.ceil((T+C)/2),O=P,x=2*P,k=new Array(x),M=new Array(x),I=0;I<x;I++)k[I]=-1,M[I]=-1;k[O+1]=0,M[O+1]=0;for(var H=T-C,G=H%2!=0,Q=0,W=0,U=0,j=0,A=0;A<P;A++){for(var L=-A+Q;L<=A-W;L+=2){var z=O+L,q;L==-A||L!=A&&k[z-1]<k[z+1]?q=k[z+1]:q=k[z-1]+1;for(var K=q-L;q<T&&K<C&&g.charAt(q)==_.charAt(K);)q++,K++;if(k[z]=q,q>T)W+=2;else if(K>C)Q+=2;else if(G){var F=O+H-L;if(F>=0&&F<x&&M[F]!=-1){var $=T-M[F];if(q>=$)return h(g,_,q,K)}}}for(var B=-A+U;B<=A-j;B+=2){var F=O+B,$;B==-A||B!=A&&M[F-1]<M[F+1]?$=M[F+1]:$=M[F-1]+1;for(var Y=$-B;$<T&&Y<C&&g.charAt(T-$-1)==_.charAt(C-Y-1);)$++,Y++;if(M[F]=$,$>T)j+=2;else if(Y>C)U+=2;else if(!G){var z=O+H-B;if(z>=0&&z<x&&k[z]!=-1){var q=k[z],K=O+q-z;if($=T-$,q>=$)return h(g,_,q,K)}}}}return[[i,g],[a,_]]}function h(g,_,T,C){var P=g.substring(0,T),O=_.substring(0,C),x=g.substring(T),k=_.substring(C),M=l(P,O),I=l(x,k);return M.concat(I)}function E(g,_){if(!g||!_||g.charAt(0)!=_.charAt(0))return 0;for(var T=0,C=Math.min(g.length,_.length),P=C,O=0;T<P;)g.substring(O,P)==_.substring(O,P)?(T=P,O=T):C=P,P=Math.floor((C-T)/2+T);return P}function w(g,_){if(!g||!_||g.charAt(g.length-1)!=_.charAt(_.length-1))return 0;for(var T=0,C=Math.min(g.length,_.length),P=C,O=0;T<P;)g.substring(g.length-P,g.length-O)==_.substring(_.length-P,_.length-O)?(T=P,O=T):C=P,P=Math.floor((C-T)/2+T);return P}function p(g,_){var T=g.length>_.length?g:_,C=g.length>_.length?_:g;if(T.length<4||C.length*2<T.length)return null;function P(W,U,j){for(var A=W.substring(j,j+Math.floor(W.length/4)),L=-1,z="",q,K,F,$;(L=U.indexOf(A,L+1))!=-1;){var B=E(W.substring(j),U.substring(L)),Y=w(W.substring(0,j),U.substring(0,L));z.length<Y+B&&(z=U.substring(L-Y,L)+U.substring(L,L+B),q=W.substring(0,j-Y),K=W.substring(j+B),F=U.substring(0,L-Y),$=U.substring(L+B))}return z.length*2>=W.length?[q,K,F,$,z]:null}var O=P(T,C,Math.ceil(T.length/4)),x=P(T,C,Math.ceil(T.length/2)),k;if(!O&&!x)return null;x?O?k=O[4].length>x[4].length?O:x:k=x:k=O;var M,I,H,G;g.length>_.length?(M=k[0],I=k[1],H=k[2],G=k[3]):(H=k[0],G=k[1],M=k[2],I=k[3]);var Q=k[4];return[M,I,H,G,Q]}function S(g){g.push([o,""]);for(var _=0,T=0,C=0,P="",O="",x;_<g.length;)switch(g[_][0]){case a:C++,O+=g[_][1],_++;break;case i:T++,P+=g[_][1],_++;break;case o:T+C>1?(T!==0&&C!==0&&(x=E(O,P),x!==0&&(_-T-C>0&&g[_-T-C-1][0]==o?g[_-T-C-1][1]+=O.substring(0,x):(g.splice(0,0,[o,O.substring(0,x)]),_++),O=O.substring(x),P=P.substring(x)),x=w(O,P),x!==0&&(g[_][1]=O.substring(O.length-x)+g[_][1],O=O.substring(0,O.length-x),P=P.substring(0,P.length-x))),T===0?g.splice(_-C,T+C,[a,O]):C===0?g.splice(_-T,T+C,[i,P]):g.splice(_-T-C,T+C,[i,P],[a,O]),_=_-T-C+(T?1:0)+(C?1:0)+1):_!==0&&g[_-1][0]==o?(g[_-1][1]+=g[_][1],g.splice(_,1)):_++,C=0,T=0,P="",O="";break}g[g.length-1][1]===""&&g.pop();var k=!1;for(_=1;_<g.length-1;)g[_-1][0]==o&&g[_+1][0]==o&&(g[_][1].substring(g[_][1].length-g[_-1][1].length)==g[_-1][1]?(g[_][1]=g[_-1][1]+g[_][1].substring(0,g[_][1].length-g[_-1][1].length),g[_+1][1]=g[_-1][1]+g[_+1][1],g.splice(_-1,1),k=!0):g[_][1].substring(0,g[_+1][1].length)==g[_+1][1]&&(g[_-1][1]+=g[_+1][1],g[_][1]=g[_][1].substring(g[_+1][1].length)+g[_+1][1],g.splice(_+1,1),k=!0)),_++;k&&S(g)}var b=l;b.INSERT=a,b.DELETE=i,b.EQUAL=o,r.exports=b;function m(g,_){if(_===0)return[o,g];for(var T=0,C=0;C<g.length;C++){var P=g[C];if(P[0]===i||P[0]===o){var O=T+P[1].length;if(_===O)return[C+1,g];if(_<O){g=g.slice();var x=_-T,k=[P[0],P[1].slice(0,x)],M=[P[0],P[1].slice(x)];return g.splice(C,1,k,M),[C+1,g]}else T=O}}throw new Error("cursor_pos is out of bounds!")}function v(g,_){var T=m(g,_),C=T[1],P=T[0],O=C[P],x=C[P+1];if(O==null)return g;if(O[0]!==o)return g;if(x!=null&&O[1]+x[1]===x[1]+O[1])return C.splice(P,2,x,O),d(C,P,2);if(x!=null&&x[1].indexOf(O[1])===0){C.splice(P,2,[x[0],O[1]],[0,O[1]]);var k=x[1].slice(O[1].length);return k.length>0&&C.splice(P+2,0,[x[0],k]),d(C,P,3)}else return g}function y(g){for(var _=!1,T=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},C=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},P=2;P<g.length;P+=1)g[P-2][0]===o&&C(g[P-2][1])&&g[P-1][0]===i&&T(g[P-1][1])&&g[P][0]===a&&T(g[P][1])&&(_=!0,g[P-1][1]=g[P-2][1].slice(-1)+g[P-1][1],g[P][1]=g[P-2][1].slice(-1)+g[P][1],g[P-2][1]=g[P-2][1].slice(0,-1));if(!_)return g;for(var O=[],P=0;P<g.length;P+=1)g[P][1].length>0&&O.push(g[P]);return O}function d(g,_,T){for(var C=_+T-1;C>=0&&C>=_-1;C--)if(C+1<g.length){var P=g[C],O=g[C+1];P[0]===O[1]&&g.splice(C,2,[P[0],P[1]+O[1]])}return g}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,h,E){this.fn=f,this.context=h,this.once=E||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],E,w;if(this._eventsCount===0)return h;for(w in E=this._events)i.call(E,w)&&h.push(a?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(E)):h},u.prototype.listeners=function(h,E){var w=a?a+h:h,p=this._events[w];if(E)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var S=0,b=p.length,m=new Array(b);S<b;S++)m[S]=p[S].fn;return m},u.prototype.emit=function(h,E,w,p,S,b){var m=a?a+h:h;if(!this._events[m])return!1;var v=this._events[m],y=arguments.length,d,g;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,E),!0;case 3:return v.fn.call(v.context,E,w),!0;case 4:return v.fn.call(v.context,E,w,p),!0;case 5:return v.fn.call(v.context,E,w,p,S),!0;case 6:return v.fn.call(v.context,E,w,p,S,b),!0}for(g=1,d=new Array(y-1);g<y;g++)d[g-1]=arguments[g];v.fn.apply(v.context,d)}else{var _=v.length,T;for(g=0;g<_;g++)switch(v[g].once&&this.removeListener(h,v[g].fn,void 0,!0),y){case 1:v[g].fn.call(v[g].context);break;case 2:v[g].fn.call(v[g].context,E);break;case 3:v[g].fn.call(v[g].context,E,w);break;case 4:v[g].fn.call(v[g].context,E,w,p);break;default:if(!d)for(T=1,d=new Array(y-1);T<y;T++)d[T-1]=arguments[T];v[g].fn.apply(v[g].context,d)}}return!0},u.prototype.on=function(h,E,w){var p=new l(E,w||this),S=a?a+h:h;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],p]:this._events[S].push(p):(this._events[S]=p,this._eventsCount++),this},u.prototype.once=function(h,E,w){var p=new l(E,w||this,!0),S=a?a+h:h;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],p]:this._events[S].push(p):(this._events[S]=p,this._eventsCount++),this},u.prototype.removeListener=function(h,E,w,p){var S=a?a+h:h;if(!this._events[S])return this;if(!E)return--this._eventsCount===0?this._events=new o:delete this._events[S],this;var b=this._events[S];if(b.fn)b.fn===E&&(!p||b.once)&&(!w||b.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[S]);else{for(var m=0,v=[],y=b.length;m<y;m++)(b[m].fn!==E||p&&!b[m].once||w&&b[m].context!==w)&&v.push(b[m]);v.length?this._events[S]=v.length===1?v[0]:v:--this._eventsCount===0?this._events=new o:delete this._events[S]}return this},u.prototype.removeAllListeners=function(h){var E;return h?(E=a?a+h:h,this._events[E]&&(--this._eventsCount===0?this._events=new o:delete this._events[E])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},o=function(){function ae(de,ye){var ve=[],re=!0,oe=!1,be=void 0;try{for(var Ee=de[Symbol.iterator](),Ge;!(re=(Ge=Ee.next()).done)&&(ve.push(Ge.value),!(ye&&ve.length===ye));re=!0);}catch(et){oe=!0,be=et}finally{try{!re&&Ee.return&&Ee.return()}finally{if(oe)throw be}}return ve}return function(de,ye){if(Array.isArray(de))return de;if(Symbol.iterator in Object(de))return ae(de,ye);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function ae(de,ye){for(var ve=0;ve<ye.length;ve++){var re=ye[ve];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(de,re.key,re)}}return function(de,ye,ve){return ye&&ae(de.prototype,ye),ve&&ae(de,ve),de}}(),u=i(3),f=M(u),h=i(2),E=M(h),w=i(0),p=M(w),S=i(5),b=M(S),m=i(10),v=M(m),y=i(9),d=M(y),g=i(36),_=i(37),T=i(13),C=M(T),P=i(26),O=i(38),x=i(39),k=i(40);function M(ae){return ae&&ae.__esModule?ae:{default:ae}}function I(ae,de,ye){return de in ae?Object.defineProperty(ae,de,{value:ye,enumerable:!0,configurable:!0,writable:!0}):ae[de]=ye,ae}function H(ae,de){if(!(ae instanceof de))throw new TypeError("Cannot call a class as a function")}function G(ae,de){if(!ae)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de&&(typeof de=="object"||typeof de=="function")?de:ae}function Q(ae,de){if(typeof de!="function"&&de!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof de);ae.prototype=Object.create(de&&de.prototype,{constructor:{value:ae,enumerable:!1,writable:!0,configurable:!0}}),de&&(Object.setPrototypeOf?Object.setPrototypeOf(ae,de):ae.__proto__=de)}var W=(0,v.default)("quill:clipboard"),U="__ql-matcher",j=[[Node.TEXT_NODE,Te],[Node.TEXT_NODE,ie],["br",te],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,Z],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,Oe],["li",ne],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",ee]],A=[g.AlignAttribute,O.DirectionAttribute].reduce(function(ae,de){return ae[de.keyName]=de,ae},{}),L=[g.AlignStyle,_.BackgroundStyle,P.ColorStyle,O.DirectionStyle,x.FontStyle,k.SizeStyle].reduce(function(ae,de){return ae[de.keyName]=de,ae},{}),z=function(ae){Q(de,ae);function de(ye,ve){H(this,de);var re=G(this,(de.__proto__||Object.getPrototypeOf(de)).call(this,ye,ve));return re.quill.root.addEventListener("paste",re.onPaste.bind(re)),re.container=re.quill.addContainer("ql-clipboard"),re.container.setAttribute("contenteditable",!0),re.container.setAttribute("tabindex",-1),re.matchers=[],j.concat(re.options.matchers).forEach(function(oe){var be=o(oe,2),Ee=be[0],Ge=be[1];!ve.matchVisual&&Ge===ce||re.addMatcher(Ee,Ge)}),re}return l(de,[{key:"addMatcher",value:function(ve,re){this.matchers.push([ve,re])}},{key:"convert",value:function(ve){if(typeof ve=="string")return this.container.innerHTML=ve.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[C.default.blotName]){var oe=this.container.innerText;return this.container.innerHTML="",new E.default().insert(oe,I({},C.default.blotName,re[C.default.blotName]))}var be=this.prepareMatching(),Ee=o(be,2),Ge=Ee[0],et=Ee[1],Ae=B(this.container,Ge,et);return F(Ae,`
140
- `)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new E.default().retain(Ae.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(ve,re){var oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof ve=="string")this.quill.setContents(this.convert(ve),re),this.quill.setSelection(0,b.default.sources.SILENT);else{var be=this.convert(re);this.quill.updateContents(new E.default().retain(ve).concat(be),oe),this.quill.setSelection(ve+be.length(),b.default.sources.SILENT)}}},{key:"onPaste",value:function(ve){var re=this;if(!(ve.defaultPrevented||!this.quill.isEnabled())){var oe=this.quill.getSelection(),be=new E.default().retain(oe.index),Ee=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(b.default.sources.SILENT),setTimeout(function(){be=be.concat(re.convert()).delete(oe.length),re.quill.updateContents(be,b.default.sources.USER),re.quill.setSelection(be.length()-oe.length,b.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=Ee,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ve=this,re=[],oe=[];return this.matchers.forEach(function(be){var Ee=o(be,2),Ge=Ee[0],et=Ee[1];switch(Ge){case Node.TEXT_NODE:oe.push(et);break;case Node.ELEMENT_NODE:re.push(et);break;default:[].forEach.call(ve.container.querySelectorAll(Ge),function(Ae){Ae[U]=Ae[U]||[],Ae[U].push(et)});break}}),[re,oe]}}]),de}(d.default);z.DEFAULTS={matchers:[],matchVisual:!0};function q(ae,de,ye){return(typeof de>"u"?"undefined":a(de))==="object"?Object.keys(de).reduce(function(ve,re){return q(ve,re,de[re])},ae):ae.reduce(function(ve,re){return re.attributes&&re.attributes[de]?ve.push(re):ve.insert(re.insert,(0,f.default)({},I({},de,ye),re.attributes))},new E.default)}function K(ae){if(ae.nodeType!==Node.ELEMENT_NODE)return{};var de="__ql-computed-style";return ae[de]||(ae[de]=window.getComputedStyle(ae))}function F(ae,de){for(var ye="",ve=ae.ops.length-1;ve>=0&&ye.length<de.length;--ve){var re=ae.ops[ve];if(typeof re.insert!="string")break;ye=re.insert+ye}return ye.slice(-1*de.length)===de}function $(ae){if(ae.childNodes.length===0)return!1;var de=K(ae);return["block","list-item"].indexOf(de.display)>-1}function B(ae,de,ye){return ae.nodeType===ae.TEXT_NODE?ye.reduce(function(ve,re){return re(ae,ve)},new E.default):ae.nodeType===ae.ELEMENT_NODE?[].reduce.call(ae.childNodes||[],function(ve,re){var oe=B(re,de,ye);return re.nodeType===ae.ELEMENT_NODE&&(oe=de.reduce(function(be,Ee){return Ee(re,be)},oe),oe=(re[U]||[]).reduce(function(be,Ee){return Ee(re,be)},oe)),ve.concat(oe)},new E.default):new E.default}function Y(ae,de,ye){return q(ye,ae,!0)}function X(ae,de){var ye=p.default.Attributor.Attribute.keys(ae),ve=p.default.Attributor.Class.keys(ae),re=p.default.Attributor.Style.keys(ae),oe={};return ye.concat(ve).concat(re).forEach(function(be){var Ee=p.default.query(be,p.default.Scope.ATTRIBUTE);Ee!=null&&(oe[Ee.attrName]=Ee.value(ae),oe[Ee.attrName])||(Ee=A[be],Ee!=null&&(Ee.attrName===be||Ee.keyName===be)&&(oe[Ee.attrName]=Ee.value(ae)||void 0),Ee=L[be],Ee!=null&&(Ee.attrName===be||Ee.keyName===be)&&(Ee=L[be],oe[Ee.attrName]=Ee.value(ae)||void 0))}),Object.keys(oe).length>0&&(de=q(de,oe)),de}function Z(ae,de){var ye=p.default.query(ae);if(ye==null)return de;if(ye.prototype instanceof p.default.Embed){var ve={},re=ye.value(ae);re!=null&&(ve[ye.blotName]=re,de=new E.default().insert(ve,ye.formats(ae)))}else typeof ye.formats=="function"&&(de=q(de,ye.blotName,ye.formats(ae)));return de}function te(ae,de){return F(de,`
141
- `)||de.insert(`
142
- `),de}function ee(){return new E.default}function ne(ae,de){var ye=p.default.query(ae);if(ye==null||ye.blotName!=="list-item"||!F(de,`
143
- `))return de;for(var ve=-1,re=ae.parentNode;!re.classList.contains("ql-clipboard");)(p.default.query(re)||{}).blotName==="list"&&(ve+=1),re=re.parentNode;return ve<=0?de:de.compose(new E.default().retain(de.length()-1).retain(1,{indent:ve}))}function ie(ae,de){return F(de,`
144
- `)||($(ae)||de.length()>0&&ae.nextSibling&&$(ae.nextSibling))&&de.insert(`
145
- `),de}function ce(ae,de){if($(ae)&&ae.nextElementSibling!=null&&!F(de,`
146
-
147
- `)){var ye=ae.offsetHeight+parseFloat(K(ae).marginTop)+parseFloat(K(ae).marginBottom);ae.nextElementSibling.offsetTop>ae.offsetTop+ye*1.5&&de.insert(`
148
- `)}return de}function Oe(ae,de){var ye={},ve=ae.style||{};return ve.fontStyle&&K(ae).fontStyle==="italic"&&(ye.italic=!0),ve.fontWeight&&(K(ae).fontWeight.startsWith("bold")||parseInt(K(ae).fontWeight)>=700)&&(ye.bold=!0),Object.keys(ye).length>0&&(de=q(de,ye)),parseFloat(ve.textIndent||0)>0&&(de=new E.default().insert(" ").concat(de)),de}function Te(ae,de){var ye=ae.data;if(ae.parentNode.tagName==="O:P")return de.insert(ye.trim());if(ye.trim().length===0&&ae.parentNode.classList.contains("ql-clipboard"))return de;if(!K(ae.parentNode).whiteSpace.startsWith("pre")){var ve=function(oe,be){return be=be.replace(/[^\u00a0]/g,""),be.length<1&&oe?" ":be};ye=ye.replace(/\r\n/g," ").replace(/\n/g," "),ye=ye.replace(/\s\s+/g,ve.bind(ve,!0)),(ae.previousSibling==null&&$(ae.parentNode)||ae.previousSibling!=null&&$(ae.previousSibling))&&(ye=ye.replace(/^\s+/,ve.bind(ve,!1))),(ae.nextSibling==null&&$(ae.parentNode)||ae.nextSibling!=null&&$(ae.nextSibling))&&(ye=ye.replace(/\s+$/,ve.bind(ve,!1)))}return de.insert(ye)}n.default=z,n.matchAttributor=X,n.matchBlot=Z,n.matchNewline=ie,n.matchSpacing=ce,n.matchText=Te},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}return function(b,m,v){return m&&S(b.prototype,m),v&&S(b,v),b}}(),o=function S(b,m,v){b===null&&(b=Function.prototype);var y=Object.getOwnPropertyDescriptor(b,m);if(y===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,m,v)}else{if("value"in y)return y.value;var g=y.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"optimize",value:function(v){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,v),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),b}(u.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function k(M,I){var H=[],G=!0,Q=!1,W=void 0;try{for(var U=M[Symbol.iterator](),j;!(G=(j=U.next()).done)&&(H.push(j.value),!(I&&H.length===I));G=!0);}catch(A){Q=!0,W=A}finally{try{!G&&U.return&&U.return()}finally{if(Q)throw W}}return H}return function(M,I){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return k(M,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function k(M,I){for(var H=0;H<I.length;H++){var G=I[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(M,G.key,G)}}return function(M,I,H){return I&&k(M.prototype,I),H&&k(M,H),M}}(),l=i(2),u=v(l),f=i(0),h=v(f),E=i(5),w=v(E),p=i(10),S=v(p),b=i(9),m=v(b);function v(k){return k&&k.__esModule?k:{default:k}}function y(k,M,I){return M in k?Object.defineProperty(k,M,{value:I,enumerable:!0,configurable:!0,writable:!0}):k[M]=I,k}function d(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function g(k,M){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:k}function _(k,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);k.prototype=Object.create(M&&M.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(k,M):k.__proto__=M)}var T=(0,S.default)("quill:toolbar"),C=function(k){_(M,k);function M(I,H){d(this,M);var G=g(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,I,H));if(Array.isArray(G.options.container)){var Q=document.createElement("div");O(Q,G.options.container),I.container.parentNode.insertBefore(Q,I.container),G.container=Q}else typeof G.options.container=="string"?G.container=document.querySelector(G.options.container):G.container=G.options.container;if(!(G.container instanceof HTMLElement)){var W;return W=T.error("Container required for toolbar",G.options),g(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(U){G.addHandler(U,G.options.handlers[U])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(U){G.attach(U)}),G.quill.on(w.default.events.EDITOR_CHANGE,function(U,j){U===w.default.events.SELECTION_CHANGE&&G.update(j)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var U=G.quill.selection.getRange(),j=a(U,1),A=j[0];G.update(A)}),G}return o(M,[{key:"addHandler",value:function(H,G){this.handlers[H]=G}},{key:"attach",value:function(H){var G=this,Q=[].find.call(H.classList,function(U){return U.indexOf("ql-")===0});if(Q){if(Q=Q.slice(3),H.tagName==="BUTTON"&&H.setAttribute("type","button"),this.handlers[Q]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Q]==null){T.warn("ignoring attaching to disabled format",Q,H);return}if(h.default.query(Q)==null){T.warn("ignoring attaching to nonexistent format",Q,H);return}}var W=H.tagName==="SELECT"?"change":"click";H.addEventListener(W,function(U){var j=void 0;if(H.tagName==="SELECT"){if(H.selectedIndex<0)return;var A=H.options[H.selectedIndex];A.hasAttribute("selected")?j=!1:j=A.value||!1}else H.classList.contains("ql-active")?j=!1:j=H.value||!H.hasAttribute("value"),U.preventDefault();G.quill.focus();var L=G.quill.selection.getRange(),z=a(L,1),q=z[0];if(G.handlers[Q]!=null)G.handlers[Q].call(G,j);else if(h.default.query(Q).prototype instanceof h.default.Embed){if(j=prompt("Enter "+Q),!j)return;G.quill.updateContents(new u.default().retain(q.index).delete(q.length).insert(y({},Q,j)),w.default.sources.USER)}else G.quill.format(Q,j,w.default.sources.USER);G.update(q)}),this.controls.push([Q,H])}}},{key:"update",value:function(H){var G=H==null?{}:this.quill.getFormat(H);this.controls.forEach(function(Q){var W=a(Q,2),U=W[0],j=W[1];if(j.tagName==="SELECT"){var A=void 0;if(H==null)A=null;else if(G[U]==null)A=j.querySelector("option[selected]");else if(!Array.isArray(G[U])){var L=G[U];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),A=j.querySelector('option[value="'+L+'"]')}A==null?(j.value="",j.selectedIndex=-1):A.selected=!0}else if(H==null)j.classList.remove("ql-active");else if(j.hasAttribute("value")){var z=G[U]===j.getAttribute("value")||G[U]!=null&&G[U].toString()===j.getAttribute("value")||G[U]==null&&!j.getAttribute("value");j.classList.toggle("ql-active",z)}else j.classList.toggle("ql-active",G[U]!=null)})}}]),M}(m.default);C.DEFAULTS={};function P(k,M,I){var H=document.createElement("button");H.setAttribute("type","button"),H.classList.add("ql-"+M),I!=null&&(H.value=I),k.appendChild(H)}function O(k,M){Array.isArray(M[0])||(M=[M]),M.forEach(function(I){var H=document.createElement("span");H.classList.add("ql-formats"),I.forEach(function(G){if(typeof G=="string")P(H,G);else{var Q=Object.keys(G)[0],W=G[Q];Array.isArray(W)?x(H,Q,W):P(H,Q,W)}}),k.appendChild(H)})}function x(k,M,I){var H=document.createElement("select");H.classList.add("ql-"+M),I.forEach(function(G){var Q=document.createElement("option");G!==!1?Q.setAttribute("value",G):Q.setAttribute("selected","selected"),H.appendChild(Q)}),k.appendChild(H)}C.DEFAULTS={container:null,handlers:{clean:function(){var M=this,I=this.quill.getSelection();if(I!=null)if(I.length==0){var H=this.quill.getFormat();Object.keys(H).forEach(function(G){h.default.query(G,h.default.Scope.INLINE)!=null&&M.quill.format(G,!1)})}else this.quill.removeFormat(I,w.default.sources.USER)},direction:function(M){var I=this.quill.getFormat().align;M==="rtl"&&I==null?this.quill.format("align","right",w.default.sources.USER):!M&&I==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",M,w.default.sources.USER)},indent:function(M){var I=this.quill.getSelection(),H=this.quill.getFormat(I),G=parseInt(H.indent||0);if(M==="+1"||M==="-1"){var Q=M==="+1"?1:-1;H.direction==="rtl"&&(Q*=-1),this.quill.format("indent",G+Q,w.default.sources.USER)}},link:function(M){M===!0&&(M=prompt("Enter link URL:")),this.quill.format("link",M,w.default.sources.USER)},list:function(M){var I=this.quill.getSelection(),H=this.quill.getFormat(I);M==="check"?H.list==="checked"||H.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",M,w.default.sources.USER)}}},n.default=C,n.addControls=O},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}return function(b,m,v){return m&&S(b.prototype,m),v&&S(b,v),b}}(),o=function S(b,m,v){b===null&&(b=Function.prototype);var y=Object.getOwnPropertyDescriptor(b,m);if(y===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,m,v)}else{if("value"in y)return y.value;var g=y.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(m,v){h(this,b);var y=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,m));return y.label.innerHTML=v,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),y}return a(b,[{key:"buildItem",value:function(v){var y=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"buildItem",this).call(this,v);return y.style.backgroundColor=v.getAttribute("value")||"",y}},{key:"selectItem",value:function(v,y){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,v,y);var d=this.label.querySelector(".ql-color-label"),g=v&&v.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=g:d.style.fill=g)}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}return function(b,m,v){return m&&S(b.prototype,m),v&&S(b,v),b}}(),o=function S(b,m,v){b===null&&(b=Function.prototype);var y=Object.getOwnPropertyDescriptor(b,m);if(y===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,m,v)}else{if("value"in y)return y.value;var g=y.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(m,v){h(this,b);var y=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,m));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=v[d.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return a(b,[{key:"selectItem",value:function(v,y){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,v,y),v=v||this.defaultItem,this.label.innerHTML=v.innerHTML}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var E=0;E<h.length;E++){var w=h[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,E){return h&&u(f.prototype,h),E&&u(f,E),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){var E=this;o(this,u),this.quill=f,this.boundsContainer=h||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){E.root.style.marginTop=-1*E.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var E=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=E+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),b=0;if(S.right>p.right&&(b=p.right-S.right,this.root.style.left=E+b+"px"),S.left<p.left&&(b=p.left-S.left,this.root.style.left=E+b+"px"),S.bottom>p.bottom){var m=S.bottom-S.top,v=h.bottom-h.top+m;this.root.style.top=w-v+"px",this.root.classList.add("ql-flip")}return b}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(k,M){var I=[],H=!0,G=!1,Q=void 0;try{for(var W=k[Symbol.iterator](),U;!(H=(U=W.next()).done)&&(I.push(U.value),!(M&&I.length===M));H=!0);}catch(j){G=!0,Q=j}finally{try{!H&&W.return&&W.return()}finally{if(G)throw Q}}return I}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return x(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(k,M,I){k===null&&(k=Function.prototype);var H=Object.getOwnPropertyDescriptor(k,M);if(H===void 0){var G=Object.getPrototypeOf(k);return G===null?void 0:x(G,M,I)}else{if("value"in H)return H.value;var Q=H.get;return Q===void 0?void 0:Q.call(I)}},l=function(){function x(k,M){for(var I=0;I<M.length;I++){var H=M[I];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(k,H.key,H)}}return function(k,M,I){return M&&x(k.prototype,M),I&&x(k,I),k}}(),u=i(3),f=d(u),h=i(8),E=d(h),w=i(43),p=d(w),S=i(27),b=d(S),m=i(15),v=i(41),y=d(v);function d(x){return x&&x.__esModule?x:{default:x}}function g(x,k){if(!(x instanceof k))throw new TypeError("Cannot call a class as a function")}function _(x,k){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:x}function T(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);x.prototype=Object.create(k&&k.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(x,k):x.__proto__=k)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],P=function(x){T(k,x);function k(M,I){g(this,k),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=C);var H=_(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M,I));return H.quill.container.classList.add("ql-snow"),H}return l(k,[{key:"extendToolbar",value:function(I){I.container.classList.add("ql-snow"),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),y.default),this.tooltip=new O(this.quill,this.options.bounds),I.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(H,G){I.handlers.link.call(I,!G.format.link)})}}]),k}(p.default);P.DEFAULTS=(0,f.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var M=this.quill.getSelection();if(M==null||M.length==0)return;var I=this.quill.getText(M);/^\S+@\S+\.\S+$/.test(I)&&I.indexOf("mailto:")!==0&&(I="mailto:"+I);var H=this.quill.theme.tooltip;H.edit("link",I)}else this.quill.format("link",!1)}}}}});var O=function(x){T(k,x);function k(M,I){g(this,k);var H=_(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,M,I));return H.preview=H.root.querySelector("a.ql-preview"),H}return l(k,[{key:"listen",value:function(){var I=this;o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(H){I.root.classList.contains("ql-editing")?I.save():I.edit("link",I.preview.textContent),H.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(H){if(I.linkRange!=null){var G=I.linkRange;I.restoreFocus(),I.quill.formatText(G,"link",!1,E.default.sources.USER),delete I.linkRange}H.preventDefault(),I.hide()}),this.quill.on(E.default.events.SELECTION_CHANGE,function(H,G,Q){if(H!=null){if(H.length===0&&Q===E.default.sources.USER){var W=I.quill.scroll.descendant(b.default,H.index),U=a(W,2),j=U[0],A=U[1];if(j!=null){I.linkRange=new m.Range(H.index-A,j.length());var L=b.default.formats(j.domNode);I.preview.textContent=L,I.preview.setAttribute("href",L),I.show(),I.position(I.quill.getBounds(I.linkRange));return}}else delete I.linkRange;I.hide()}})}},{key:"show",value:function(){o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(w.BaseTooltip);O.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=re(a),l=i(36),u=i(38),f=i(64),h=i(65),E=re(h),w=i(66),p=re(w),S=i(67),b=re(S),m=i(37),v=i(26),y=i(39),d=i(40),g=i(56),_=re(g),T=i(68),C=re(T),P=i(27),O=re(P),x=i(69),k=re(x),M=i(70),I=re(M),H=i(71),G=re(H),Q=i(72),W=re(Q),U=i(73),j=re(U),A=i(13),L=re(A),z=i(74),q=re(z),K=i(75),F=re(K),$=i(57),B=re($),Y=i(41),X=re(Y),Z=i(28),te=re(Z),ee=i(59),ne=re(ee),ie=i(60),ce=re(ie),Oe=i(61),Te=re(Oe),ae=i(108),de=re(ae),ye=i(62),ve=re(ye);function re(oe){return oe&&oe.__esModule?oe:{default:oe}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":m.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":m.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":m.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":y.FontClass,"formats/size":d.SizeClass,"formats/blockquote":E.default,"formats/code-block":L.default,"formats/header":p.default,"formats/list":b.default,"formats/bold":_.default,"formats/code":A.Code,"formats/italic":C.default,"formats/link":O.default,"formats/script":k.default,"formats/strike":I.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":j.default,"formats/list/item":S.ListItem,"modules/formula":q.default,"modules/syntax":F.default,"modules/toolbar":B.default,"themes/bubble":de.default,"themes/snow":ve.default,"ui/icons":X.default,"ui/picker":te.default,"ui/icon-picker":ce.default,"ui/color-picker":ne.default,"ui/tooltip":Te.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function b(m,v){for(var y=0;y<v.length;y++){var d=v[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,v,y){return v&&b(m.prototype,v),y&&b(m,y),m}}(),o=function b(m,v,y){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,v);if(d===void 0){var g=Object.getPrototypeOf(m);return g===null?void 0:b(g,v,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(0),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function E(b,m){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:b}function w(b,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);b.prototype=Object.create(m&&m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(b,m):b.__proto__=m)}var p=function(b){w(m,b);function m(){return h(this,m),E(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"add",value:function(y,d){if(d==="+1"||d==="-1"){var g=this.value(y)||0;d=d==="+1"?g+1:g-1}return d===0?(this.remove(y),!0):o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"add",this).call(this,y,d)}},{key:"canAdd",value:function(y,d){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,y,d)||o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,y,parseInt(d))}},{key:"value",value:function(y){return parseInt(o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,y))||void 0}}]),m}(u.default.Attributor.Class),S=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="blockquote",E.tagName="blockquote",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(S,b){for(var m=0;m<b.length;m++){var v=b[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,b,m){return b&&p(S.prototype,b),m&&p(S,m),S}}(),o=i(4),l=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function f(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}function h(p,S){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:p}function E(p,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);p.prototype=Object.create(S&&S.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(p,S):p.__proto__=S)}var w=function(p){E(S,p);function S(){return f(this,S),h(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"formats",value:function(m){return this.tagName.indexOf(m.tagName)+1}}]),S}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function g(_,T){for(var C=0;C<T.length;C++){var P=T[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(_,P.key,P)}}return function(_,T,C){return T&&g(_.prototype,T),C&&g(_,C),_}}(),o=function g(_,T,C){_===null&&(_=Function.prototype);var P=Object.getOwnPropertyDescriptor(_,T);if(P===void 0){var O=Object.getPrototypeOf(_);return O===null?void 0:g(O,T,C)}else{if("value"in P)return P.value;var x=P.get;return x===void 0?void 0:x.call(C)}},l=i(0),u=p(l),f=i(4),h=p(f),E=i(25),w=p(E);function p(g){return g&&g.__esModule?g:{default:g}}function S(g,_,T){return _ in g?Object.defineProperty(g,_,{value:T,enumerable:!0,configurable:!0,writable:!0}):g[_]=T,g}function b(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function m(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:g}function v(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var y=function(g){v(_,g);function _(){return b(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(C,P){C===d.blotName&&!P?this.replaceWith(u.default.create(this.statics.scope)):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,P)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,P){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,P),this):(this.parent.unwrap(),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,P))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(h.default);y.blotName="list-item",y.tagName="LI";var d=function(g){v(_,g),a(_,null,[{key:"create",value:function(C){var P=C==="ordered"?"OL":"UL",O=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,P);return(C==="checked"||C==="unchecked")&&O.setAttribute("data-checked",C==="checked"),O}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(T){b(this,_);var C=m(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,T)),P=function(x){if(x.target.parentNode===T){var k=C.statics.formats(T),M=u.default.find(x.target);k==="checked"?M.format("list","unchecked"):k==="unchecked"&&M.format("list","checked")}};return T.addEventListener("touchstart",P),T.addEventListener("mousedown",P),C}return a(_,[{key:"format",value:function(C,P){this.children.length>0&&this.children.tail.format(C,P)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,P){if(C instanceof y)o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,P);else{var O=P==null?this.length():P.offset(this),x=this.split(O);x.parent.insertBefore(C,x)}}},{key:"optimize",value:function(C){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var P=this.next;P!=null&&P.prev===this&&P.statics.blotName===this.statics.blotName&&P.domNode.tagName===this.domNode.tagName&&P.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(P.moveChildren(this),P.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var P=u.default.create(this.statics.defaultChild);C.moveChildren(P),this.appendChild(P)}o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,C)}}]),_}(w.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[y],n.ListItem=y,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="italic",E.tagName=["EM","I"],n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}return function(b,m,v){return m&&S(b.prototype,m),v&&S(b,v),b}}(),o=function S(b,m,v){b===null&&(b=Function.prototype);var y=Object.getOwnPropertyDescriptor(b,m);if(y===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,m,v)}else{if("value"in y)return y.value;var g=y.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(v){return v==="super"?document.createElement("sup"):v==="sub"?document.createElement("sub"):o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,v)}},{key:"formats",value:function(v){if(v.tagName==="SUB")return"sub";if(v.tagName==="SUP")return"super"}}]),b}(u.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="strike",E.tagName="S",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="underline",E.tagName="U",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(v,y){for(var d=0;d<y.length;d++){var g=y[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,y,d){return y&&m(v.prototype,y),d&&m(v,d),v}}(),o=function m(v,y,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,y);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:m(_,y,d)}else{if("value"in g)return g.value;var T=g.get;return T===void 0?void 0:T.call(d)}},l=i(0),u=h(l),f=i(27);function h(m){return m&&m.__esModule?m:{default:m}}function E(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function w(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function p(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var S=["alt","height","width"],b=function(m){p(v,m);function v(){return E(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){S.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return typeof d=="string"&&g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return S.reduce(function(g,_){return d.hasAttribute(_)&&(g[_]=d.getAttribute(_)),g},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),v}(u.default.Embed);b.blotName="image",b.tagName="IMG",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(v,y){for(var d=0;d<y.length;d++){var g=y[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,y,d){return y&&m(v.prototype,y),d&&m(v,d),v}}(),o=function m(v,y,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,y);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:m(_,y,d)}else{if("value"in g)return g.value;var T=g.get;return T===void 0?void 0:T.call(d)}},l=i(4),u=i(27),f=h(u);function h(m){return m&&m.__esModule?m:{default:m}}function E(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function w(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function p(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}var S=["height","width"],b=function(m){p(v,m);function v(){return E(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){S.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return g.setAttribute("frameborder","0"),g.setAttribute("allowfullscreen",!0),g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return S.reduce(function(g,_){return d.hasAttribute(_)&&(g[_]=d.getAttribute(_)),g},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),v}(l.BlockEmbed);b.blotName="video",b.className="ql-video",b.tagName="IFRAME",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(g,_){for(var T=0;T<_.length;T++){var C=_[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(g,C.key,C)}}return function(g,_,T){return _&&d(g.prototype,_),T&&d(g,T),g}}(),o=function d(g,_,T){g===null&&(g=Function.prototype);var C=Object.getOwnPropertyDescriptor(g,_);if(C===void 0){var P=Object.getPrototypeOf(g);return P===null?void 0:d(P,_,T)}else{if("value"in C)return C.value;var O=C.get;return O===void 0?void 0:O.call(T)}},l=i(35),u=p(l),f=i(5),h=p(f),E=i(9),w=p(E);function p(d){return d&&d.__esModule?d:{default:d}}function S(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function b(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function m(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var v=function(d){m(g,d);function g(){return S(this,g),b(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,null,[{key:"create",value:function(T){var C=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,T);return typeof T=="string"&&(window.katex.render(T,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",T)),C}},{key:"value",value:function(T){return T.getAttribute("data-value")}}]),g}(u.default);v.blotName="formula",v.className="ql-formula",v.tagName="SPAN";var y=function(d){m(g,d),a(g,null,[{key:"register",value:function(){h.default.register(v,!0)}}]);function g(){S(this,g);var _=b(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return g}(w.default);n.FormulaBlot=v,n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function T(C,P){for(var O=0;O<P.length;O++){var x=P[O];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(C,x.key,x)}}return function(C,P,O){return P&&T(C.prototype,P),O&&T(C,O),C}}(),o=function T(C,P,O){C===null&&(C=Function.prototype);var x=Object.getOwnPropertyDescriptor(C,P);if(x===void 0){var k=Object.getPrototypeOf(C);return k===null?void 0:T(k,P,O)}else{if("value"in x)return x.value;var M=x.get;return M===void 0?void 0:M.call(O)}},l=i(0),u=b(l),f=i(5),h=b(f),E=i(9),w=b(E),p=i(13),S=b(p);function b(T){return T&&T.__esModule?T:{default:T}}function m(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function v(T,C){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:T}function y(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(T,C):T.__proto__=C)}var d=function(T){y(C,T);function C(){return m(this,C),v(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"replaceWith",value:function(O){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,O)}},{key:"highlight",value:function(O){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=O(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),C}(S.default);d.className="ql-syntax";var g=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),_=function(T){y(C,T),a(C,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(d,!0)}}]);function C(P,O){m(this,C);var x=v(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,P,O));if(typeof x.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return x.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){x.highlight(),k=null},x.options.interval)}),x.highlight(),x}return a(C,[{key:"highlight",value:function(){var O=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(k){k.highlight(O.options.highlight)}),this.quill.update(h.default.sources.SILENT),x!=null&&this.quill.setSelection(x,h.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(T){var C=window.hljs.highlightAuto(T);return C.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=g,n.default=_},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function C(P,O,x){P===null&&(P=Function.prototype);var k=Object.getOwnPropertyDescriptor(P,O);if(k===void 0){var M=Object.getPrototypeOf(P);return M===null?void 0:C(M,O,x)}else{if("value"in k)return k.value;var I=k.get;return I===void 0?void 0:I.call(x)}},o=function(){function C(P,O){for(var x=0;x<O.length;x++){var k=O[x];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(P,k.key,k)}}return function(P,O,x){return O&&C(P.prototype,O),x&&C(P,x),P}}(),l=i(3),u=m(l),f=i(8),h=m(f),E=i(43),w=m(E),p=i(15),S=i(41),b=m(S);function m(C){return C&&C.__esModule?C:{default:C}}function v(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function y(C,P){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:C}function d(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(C,P):C.__proto__=P)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(P,C);function P(O,x){v(this,P),x.modules.toolbar!=null&&x.modules.toolbar.container==null&&(x.modules.toolbar.container=g);var k=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,x));return k.quill.container.classList.add("ql-bubble"),k}return o(P,[{key:"extendToolbar",value:function(x){this.tooltip=new T(this.quill,this.options.bounds),this.tooltip.root.appendChild(x.container),this.buildButtons([].slice.call(x.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(x.container.querySelectorAll("select")),b.default)}}]),P}(w.default);_.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){P?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var T=function(C){d(P,C);function P(O,x){v(this,P);var k=y(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,x));return k.quill.on(h.default.events.EDITOR_CHANGE,function(M,I,H,G){if(M===h.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&G===h.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var Q=k.quill.getLines(I.index,I.length);if(Q.length===1)k.position(k.quill.getBounds(I));else{var W=Q[Q.length-1],U=k.quill.getIndex(W),j=Math.min(W.length()-1,I.index+I.length-U),A=k.quill.getBounds(new p.Range(U,j));k.position(A)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return o(P,[{key:"listen",value:function(){var x=this;a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){x.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!x.root.classList.contains("ql-hidden")){var k=x.quill.getSelection();k!=null&&x.position(x.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(x){var k=a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"position",this).call(this,x),M=this.root.querySelector(".ql-tooltip-arrow");if(M.style.marginLeft="",k===0)return k;M.style.marginLeft=-1*k-M.offsetWidth/2+"px"}}]),P}(E.BaseTooltip);T.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=T,n.default=_},function(r,n,i){r.exports=i(63)}]).default})})(iS);var PD=iS.exports,p2={},aS={exports:{}},Vo={},Bu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Bu.exports;var N4;function CD(){return N4||(N4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof me=="object"&&me;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,h=26,E=38,w=700,p=72,S=128,b="-",m=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=u-f,_=Math.floor,T=String.fromCharCode,C;function P(A){throw new RangeError(d[A])}function O(A,L){for(var z=A.length,q=[];z--;)q[z]=L(A[z]);return q}function x(A,L){var z=A.split("@"),q="";z.length>1&&(q=z[0]+"@",A=z[1]),A=A.replace(y,".");var K=A.split("."),F=O(K,L).join(".");return q+F}function k(A){for(var L=[],z=0,q=A.length,K,F;z<q;)K=A.charCodeAt(z++),K>=55296&&K<=56319&&z<q?(F=A.charCodeAt(z++),(F&64512)==56320?L.push(((K&1023)<<10)+(F&1023)+65536):(L.push(K),z--)):L.push(K);return L}function M(A){return O(A,function(L){var z="";return L>65535&&(L-=65536,z+=T(L>>>10&1023|55296),L=56320|L&1023),z+=T(L),z}).join("")}function I(A){return A-48<10?A-22:A-65<26?A-65:A-97<26?A-97:u}function H(A,L){return A+22+75*(A<26)-((L!=0)<<5)}function G(A,L,z){var q=0;for(A=z?_(A/w):A>>1,A+=_(A/L);A>g*h>>1;q+=u)A=_(A/g);return _(q+(g+1)*A/(A+E))}function Q(A){var L=[],z=A.length,q,K=0,F=S,$=p,B,Y,X,Z,te,ee,ne,ie,ce;for(B=A.lastIndexOf(b),B<0&&(B=0),Y=0;Y<B;++Y)A.charCodeAt(Y)>=128&&P("not-basic"),L.push(A.charCodeAt(Y));for(X=B>0?B+1:0;X<z;){for(Z=K,te=1,ee=u;X>=z&&P("invalid-input"),ne=I(A.charCodeAt(X++)),(ne>=u||ne>_((l-K)/te))&&P("overflow"),K+=ne*te,ie=ee<=$?f:ee>=$+h?h:ee-$,!(ne<ie);ee+=u)ce=u-ie,te>_(l/ce)&&P("overflow"),te*=ce;q=L.length+1,$=G(K-Z,q,Z==0),_(K/q)>l-F&&P("overflow"),F+=_(K/q),K%=q,L.splice(K++,0,F)}return M(L)}function W(A){var L,z,q,K,F,$,B,Y,X,Z,te,ee=[],ne,ie,ce,Oe;for(A=k(A),ne=A.length,L=S,z=0,F=p,$=0;$<ne;++$)te=A[$],te<128&&ee.push(T(te));for(q=K=ee.length,K&&ee.push(b);q<ne;){for(B=l,$=0;$<ne;++$)te=A[$],te>=L&&te<B&&(B=te);for(ie=q+1,B-L>_((l-z)/ie)&&P("overflow"),z+=(B-L)*ie,L=B,$=0;$<ne;++$)if(te=A[$],te<L&&++z>l&&P("overflow"),te==L){for(Y=z,X=u;Z=X<=F?f:X>=F+h?h:X-F,!(Y<Z);X+=u)Oe=Y-Z,ce=u-Z,ee.push(T(H(Z+Oe%ce,0))),Y=_(Oe/ce);ee.push(T(H(Y,0))),F=G(z,ie,q==K),z=0,++q}++z,++L}return ee.join("")}function U(A){return x(A,function(L){return m.test(L)?Q(L.slice(4).toLowerCase()):L})}function j(A){return x(A,function(L){return v.test(L)?"xn--"+W(L):L})}if(o={version:"1.4.1",ucs2:{decode:k,encode:M},decode:Q,encode:W,toASCII:j,toUnicode:U},n&&i)if(e.exports==n)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(n[C]=o[C]);else r.punycode=o})(me)}(Bu,Bu.exports)),Bu.exports}var ag,I4;function kD(){return I4||(I4=1,ag=Error),ag}var og,D4;function TD(){return D4||(D4=1,og=EvalError),og}var lg,j4;function AD(){return j4||(j4=1,lg=RangeError),lg}var sg,F4;function RD(){return F4||(F4=1,sg=ReferenceError),sg}var ug,z4;function oS(){return z4||(z4=1,ug=SyntaxError),ug}var cg,B4;function Qc(){return B4||(B4=1,cg=TypeError),cg}var fg,U4;function MD(){return U4||(U4=1,fg=URIError),fg}var dg,H4;function LD(){return H4||(H4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),dg}var hg,$4;function ND(){if($4)return hg;$4=1;var e=typeof Symbol<"u"&&Symbol,t=LD();return hg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hg}var pg,G4;function ID(){if(G4)return pg;G4=1;var e={__proto__:null,foo:{}},t=Object;return pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},pg}var gg,V4;function DD(){if(V4)return gg;V4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var h=[],E=0;E<u.length;E+=1)h[E]=u[E];for(var w=0;w<f.length;w+=1)h[w+u.length]=f[w];return h},a=function(u,f){for(var h=[],E=f,w=0;E<u.length;E+=1,w+=1)h[w]=u[E];return h},o=function(l,u){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=u);return f};return gg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var h=a(arguments,1),E,w=function(){if(this instanceof E){var v=f.apply(this,i(h,arguments));return Object(v)===v?v:this}return f.apply(u,i(h,arguments))},p=r(0,f.length-h.length),S=[],b=0;b<p;b++)S[b]="$"+b;if(E=Function("binder","return function ("+o(S,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var m=function(){};m.prototype=f.prototype,E.prototype=new m,m.prototype=null}return E},gg}var vg,q4;function g2(){if(q4)return vg;q4=1;var e=DD();return vg=Function.prototype.bind||e,vg}var mg,W4;function jD(){if(W4)return mg;W4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=g2();return mg=r.call(e,t),mg}var yg,K4;function ru(){if(K4)return yg;K4=1;var e,t=kD(),r=TD(),n=AD(),i=RD(),a=oS(),o=Qc(),l=MD(),u=Function,f=function(W){try{return u('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var E=function(){throw new o},w=h?function(){try{return arguments.callee,E}catch{try{return h(arguments,"callee").get}catch{return E}}}():E,p=ND()(),S=ID()(),b=Object.getPrototypeOf||(S?function(W){return W.__proto__}:null),m={},v=typeof Uint8Array>"u"||!b?e:b(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&b?b([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":m,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&b?b(b([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!b?e:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!b?e:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&b?b(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":v,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(b)try{null.error}catch(W){var d=b(b(W));y["%Error.prototype%"]=d}var g=function W(U){var j;if(U==="%AsyncFunction%")j=f("async function () {}");else if(U==="%GeneratorFunction%")j=f("function* () {}");else if(U==="%AsyncGeneratorFunction%")j=f("async function* () {}");else if(U==="%AsyncGenerator%"){var A=W("%AsyncGeneratorFunction%");A&&(j=A.prototype)}else if(U==="%AsyncIteratorPrototype%"){var L=W("%AsyncGenerator%");L&&b&&(j=b(L.prototype))}return y[U]=j,j},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=g2(),C=jD(),P=T.call(Function.call,Array.prototype.concat),O=T.call(Function.apply,Array.prototype.splice),x=T.call(Function.call,String.prototype.replace),k=T.call(Function.call,String.prototype.slice),M=T.call(Function.call,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,G=function(U){var j=k(U,0,1),A=k(U,-1);if(j==="%"&&A!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(A==="%"&&j!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var L=[];return x(U,I,function(z,q,K,F){L[L.length]=K?x(F,H,"$1"):q||z}),L},Q=function(U,j){var A=U,L;if(C(_,A)&&(L=_[A],A="%"+L[0]+"%"),C(y,A)){var z=y[A];if(z===m&&(z=g(A)),typeof z>"u"&&!j)throw new o("intrinsic "+U+" exists, but is not available. Please file an issue!");return{alias:L,name:A,value:z}}throw new a("intrinsic "+U+" does not exist!")};return yg=function(U,j){if(typeof U!="string"||U.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof j!="boolean")throw new o('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,U)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var A=G(U),L=A.length>0?A[0]:"",z=Q("%"+L+"%",j),q=z.name,K=z.value,F=!1,$=z.alias;$&&(L=$[0],O(A,P([0,1],$)));for(var B=1,Y=!0;B<A.length;B+=1){var X=A[B],Z=k(X,0,1),te=k(X,-1);if((Z==='"'||Z==="'"||Z==="`"||te==='"'||te==="'"||te==="`")&&Z!==te)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(F=!0),L+="."+X,q="%"+L+"%",C(y,q))K=y[q];else if(K!=null){if(!(X in K)){if(!j)throw new o("base intrinsic for "+U+" exists, but the property is not available.");return}if(h&&B+1>=A.length){var ee=h(K,X);Y=!!ee,Y&&"get"in ee&&!("originalValue"in ee.get)?K=ee.get:K=K[X]}else Y=C(K,X),K=K[X];Y&&!F&&(y[q]=K)}}return K},yg}var bg={exports:{}},_g,Y4;function v2(){if(Y4)return _g;Y4=1;var e=ru(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return _g=t,_g}var wg,X4;function lS(){if(X4)return wg;X4=1;var e=ru(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return wg=t,wg}var Sg,Z4;function FD(){if(Z4)return Sg;Z4=1;var e=v2(),t=oS(),r=Qc(),n=lS();return Sg=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,E=arguments.length>6?arguments[6]:!1,w=!!n&&n(a,o);if(e)e(a,o,{configurable:h===null&&w?w.configurable:!h,enumerable:u===null&&w?w.enumerable:!u,value:l,writable:f===null&&w?w.writable:!f});else if(E||!u&&!f&&!h)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,Q4;function zD(){if(Q4)return Eg;Q4=1;var e=v2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Eg=t,Eg}var Og,J4;function BD(){if(J4)return Og;J4=1;var e=ru(),t=FD(),r=zD()(),n=lS(),i=Qc(),a=e("%Math.floor%");return Og=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,E=!0;if("length"in l&&n){var w=n(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(E=!1)}return(h||E||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Og}var e_;function UD(){return e_||(e_=1,function(e){var t=g2(),r=ru(),n=BD(),i=Qc(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=v2(),f=r("%Math.max%");e.exports=function(w){if(typeof w!="function")throw new i("a function is required");var p=l(t,o,arguments);return n(p,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h}(bg)),bg.exports}var xg,t_;function HD(){if(t_)return xg;t_=1;var e=ru(),t=UD(),r=t(e("String.prototype.indexOf"));return xg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},xg}const $D={},GD=Object.freeze(Object.defineProperty({__proto__:null,default:$D},Symbol.toStringTag,{value:"Module"})),VD=mo(GD);var Pg,r_;function qD(){if(r_)return Pg;r_=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,E=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,p=w?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,b=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,g=String.prototype.toUpperCase,_=String.prototype.toLowerCase,T=RegExp.prototype.test,C=Array.prototype.concat,P=Array.prototype.join,O=Array.prototype.slice,x=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,M=Object.getOwnPropertySymbols,I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,H=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===H||!0)?Symbol.toStringTag:null,Q=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ue){return ue.__proto__}:null);function U(ue,fe){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||T.call(/e/,fe))return fe;var Ye=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var _e=ue<0?-x(-ue):x(ue);if(_e!==ue){var De=String(_e),Le=y.call(fe,De.length+1);return d.call(De,Ye,"$&_")+"."+d.call(d.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(fe,Ye,"$&_")}var j=VD,A=j.custom,L=te(A)?A:null;Pg=function ue(fe,Ye,_e,De){var Le=Ye||{};if(ie(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ie(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var we=ie(Le,"customInspect")?Le.customInspect:!0;if(typeof we!="boolean"&&we!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ie(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ie(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Qe=Le.numericSeparator;if(typeof fe>"u")return"undefined";if(fe===null)return"null";if(typeof fe=="boolean")return fe?"true":"false";if(typeof fe=="string")return be(fe,Le);if(typeof fe=="number"){if(fe===0)return 1/0/fe>0?"0":"-0";var Se=String(fe);return Qe?U(fe,Se):Se}if(typeof fe=="bigint"){var Ke=String(fe)+"n";return Qe?U(fe,Ke):Ke}var Mr=typeof Le.depth>"u"?5:Le.depth;if(typeof _e>"u"&&(_e=0),_e>=Mr&&Mr>0&&typeof fe=="object")return K(fe)?"[Array]":"[Object]";var xe=ke(Le,_e);if(typeof De>"u")De=[];else if(Te(De,fe)>=0)return"[Circular]";function Fe(or,Nr,lr){if(Nr&&(De=O.call(De),De.push(Nr)),lr){var Mn={depth:Le.depth};return ie(Le,"quoteStyle")&&(Mn.quoteStyle=Le.quoteStyle),ue(or,Mn,_e+1,De)}return ue(or,Le,_e+1,De)}if(typeof fe=="function"&&!$(fe)){var tt=Oe(fe),mt=Ze(fe,Fe);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(mt.length>0?" { "+P.call(mt,", ")+" }":"")}if(te(fe)){var Ot=H?d.call(String(fe),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(fe);return typeof fe=="object"&&!H?Ge(Ot):Ot}if(oe(fe)){for(var Lr="<"+_.call(String(fe.nodeName)),Vr=fe.attributes||[],Or=0;Or<Vr.length;Or++)Lr+=" "+Vr[Or].name+"="+z(q(Vr[Or].value),"double",Le);return Lr+=">",fe.childNodes&&fe.childNodes.length&&(Lr+="..."),Lr+="</"+_.call(String(fe.nodeName))+">",Lr}if(K(fe)){if(fe.length===0)return"[]";var Rn=Ze(fe,Fe);return xe&&!Ce(Rn)?"["+Ne(Rn,xe)+"]":"[ "+P.call(Rn,", ")+" ]"}if(B(fe)){var mn=Ze(fe,Fe);return!("cause"in Error.prototype)&&"cause"in fe&&!Q.call(fe,"cause")?"{ ["+String(fe)+"] "+P.call(C.call("[cause]: "+Fe(fe.cause),mn),", ")+" }":mn.length===0?"["+String(fe)+"]":"{ ["+String(fe)+"] "+P.call(mn,", ")+" }"}if(typeof fe=="object"&&we){if(L&&typeof fe[L]=="function"&&j)return j(fe,{depth:Mr-_e});if(we!=="symbol"&&typeof fe.inspect=="function")return fe.inspect()}if(ae(fe)){var yn=[];return n&&n.call(fe,function(or,Nr){yn.push(Fe(Nr,fe,!0)+" => "+Fe(or,fe))}),Ae("Map",r.call(fe),yn,xe)}if(ve(fe)){var Zn=[];return l&&l.call(fe,function(or){Zn.push(Fe(or,fe))}),Ae("Set",o.call(fe),Zn,xe)}if(de(fe))return et("WeakMap");if(re(fe))return et("WeakSet");if(ye(fe))return et("WeakRef");if(X(fe))return Ge(Fe(Number(fe)));if(ee(fe))return Ge(Fe(k.call(fe)));if(Z(fe))return Ge(S.call(fe));if(Y(fe))return Ge(Fe(String(fe)));if(typeof window<"u"&&fe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&fe===globalThis||typeof me<"u"&&fe===me)return"{ [object globalThis] }";if(!F(fe)&&!$(fe)){var Ei=Ze(fe,Fe),Ie=W?W(fe)===Object.prototype:fe instanceof Object||fe.constructor===Object,rt=fe instanceof Object?"":"null prototype",pt=!Ie&&G&&Object(fe)===fe&&G in fe?y.call(ce(fe),8,-1):rt?"Object":"",Xt=Ie||typeof fe.constructor!="function"?"":fe.constructor.name?fe.constructor.name+" ":"",Ct=Xt+(pt||rt?"["+P.call(C.call([],pt||[],rt||[]),": ")+"] ":"");return Ei.length===0?Ct+"{}":xe?Ct+"{"+Ne(Ei,xe)+"}":Ct+"{ "+P.call(Ei,", ")+" }"}return String(fe)};function z(ue,fe,Ye){var _e=(Ye.quoteStyle||fe)==="double"?'"':"'";return _e+ue+_e}function q(ue){return d.call(String(ue),/"/g,"&quot;")}function K(ue){return ce(ue)==="[object Array]"&&(!G||!(typeof ue=="object"&&G in ue))}function F(ue){return ce(ue)==="[object Date]"&&(!G||!(typeof ue=="object"&&G in ue))}function $(ue){return ce(ue)==="[object RegExp]"&&(!G||!(typeof ue=="object"&&G in ue))}function B(ue){return ce(ue)==="[object Error]"&&(!G||!(typeof ue=="object"&&G in ue))}function Y(ue){return ce(ue)==="[object String]"&&(!G||!(typeof ue=="object"&&G in ue))}function X(ue){return ce(ue)==="[object Number]"&&(!G||!(typeof ue=="object"&&G in ue))}function Z(ue){return ce(ue)==="[object Boolean]"&&(!G||!(typeof ue=="object"&&G in ue))}function te(ue){if(H)return ue&&typeof ue=="object"&&ue instanceof Symbol;if(typeof ue=="symbol")return!0;if(!ue||typeof ue!="object"||!I)return!1;try{return I.call(ue),!0}catch{}return!1}function ee(ue){if(!ue||typeof ue!="object"||!k)return!1;try{return k.call(ue),!0}catch{}return!1}var ne=Object.prototype.hasOwnProperty||function(ue){return ue in this};function ie(ue,fe){return ne.call(ue,fe)}function ce(ue){return b.call(ue)}function Oe(ue){if(ue.name)return ue.name;var fe=v.call(m.call(ue),/^function\s*([\w$]+)/);return fe?fe[1]:null}function Te(ue,fe){if(ue.indexOf)return ue.indexOf(fe);for(var Ye=0,_e=ue.length;Ye<_e;Ye++)if(ue[Ye]===fe)return Ye;return-1}function ae(ue){if(!r||!ue||typeof ue!="object")return!1;try{r.call(ue);try{o.call(ue)}catch{return!0}return ue instanceof Map}catch{}return!1}function de(ue){if(!f||!ue||typeof ue!="object")return!1;try{f.call(ue,f);try{E.call(ue,E)}catch{return!0}return ue instanceof WeakMap}catch{}return!1}function ye(ue){if(!p||!ue||typeof ue!="object")return!1;try{return p.call(ue),!0}catch{}return!1}function ve(ue){if(!o||!ue||typeof ue!="object")return!1;try{o.call(ue);try{r.call(ue)}catch{return!0}return ue instanceof Set}catch{}return!1}function re(ue){if(!E||!ue||typeof ue!="object")return!1;try{E.call(ue,E);try{f.call(ue,f)}catch{return!0}return ue instanceof WeakSet}catch{}return!1}function oe(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function be(ue,fe){if(ue.length>fe.maxStringLength){var Ye=ue.length-fe.maxStringLength,_e="... "+Ye+" more character"+(Ye>1?"s":"");return be(y.call(ue,0,fe.maxStringLength),fe)+_e}var De=d.call(d.call(ue,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ee);return z(De,"single",fe)}function Ee(ue){var fe=ue.charCodeAt(0),Ye={8:"b",9:"t",10:"n",12:"f",13:"r"}[fe];return Ye?"\\"+Ye:"\\x"+(fe<16?"0":"")+g.call(fe.toString(16))}function Ge(ue){return"Object("+ue+")"}function et(ue){return ue+" { ? }"}function Ae(ue,fe,Ye,_e){var De=_e?Ne(Ye,_e):P.call(Ye,", ");return ue+" ("+fe+") {"+De+"}"}function Ce(ue){for(var fe=0;fe<ue.length;fe++)if(Te(ue[fe],`
149
- `)>=0)return!1;return!0}function ke(ue,fe){var Ye;if(ue.indent===" ")Ye=" ";else if(typeof ue.indent=="number"&&ue.indent>0)Ye=P.call(Array(ue.indent+1)," ");else return null;return{base:Ye,prev:P.call(Array(fe+1),Ye)}}function Ne(ue,fe){if(ue.length===0)return"";var Ye=`
150
- `+fe.prev+fe.base;return Ye+P.call(ue,","+Ye)+`
151
- `+fe.prev}function Ze(ue,fe){var Ye=K(ue),_e=[];if(Ye){_e.length=ue.length;for(var De=0;De<ue.length;De++)_e[De]=ie(ue,De)?fe(ue[De],ue):""}var Le=typeof M=="function"?M(ue):[],we;if(H){we={};for(var Qe=0;Qe<Le.length;Qe++)we["$"+Le[Qe]]=Le[Qe]}for(var Se in ue)ie(ue,Se)&&(Ye&&String(Number(Se))===Se&&Se<ue.length||H&&we["$"+Se]instanceof Symbol||(T.call(/[^\w$]/,Se)?_e.push(fe(Se,ue)+": "+fe(ue[Se],ue)):_e.push(Se+": "+fe(ue[Se],ue))));if(typeof M=="function")for(var Ke=0;Ke<Le.length;Ke++)Q.call(ue,Le[Ke])&&_e.push("["+fe(Le[Ke])+"]: "+fe(ue[Le[Ke]],ue));return _e}return Pg}var Cg,n_;function WD(){if(n_)return Cg;n_=1;var e=ru(),t=HD(),r=qD(),n=Qc(),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),h=t("Map.prototype.set",!0),E=t("Map.prototype.has",!0),w=function(m,v){for(var y=m,d;(d=y.next)!==null;y=d)if(d.key===v)return y.next=d.next,d.next=m.next,m.next=d,d},p=function(m,v){var y=w(m,v);return y&&y.value},S=function(m,v,y){var d=w(m,v);d?d.value=y:m.next={key:v,next:m.next,value:y}},b=function(m,v){return!!w(m,v)};return Cg=function(){var v,y,d,g={assert:function(_){if(!g.has(_))throw new n("Side channel does not contain "+r(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(v)return o(v,_)}else if(a){if(y)return f(y,_)}else if(d)return p(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(v)return u(v,_)}else if(a){if(y)return E(y,_)}else if(d)return b(d,_);return!1},set:function(_,T){i&&_&&(typeof _=="object"||typeof _=="function")?(v||(v=new i),l(v,_,T)):a?(y||(y=new a),h(y,_,T)):(d||(d={key:{},next:null}),S(d,_,T))}};return g},Cg}var kg,i_;function m2(){if(i_)return kg;i_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},kg}var Tg,a_;function sS(){if(a_)return Tg;a_=1;var e=m2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var m=[],v=0;v<256;++v)m.push("%"+((v<16?"0":"")+v.toString(16)).toUpperCase());return m}(),i=function(v){for(;v.length>1;){var y=v.pop(),d=y.obj[y.prop];if(r(d)){for(var g=[],_=0;_<d.length;++_)typeof d[_]<"u"&&g.push(d[_]);y.obj[y.prop]=g}}},a=function(v,y){for(var d=y&&y.plainObjects?Object.create(null):{},g=0;g<v.length;++g)typeof v[g]<"u"&&(d[g]=v[g]);return d},o=function m(v,y,d){if(!y)return v;if(typeof y!="object"){if(r(v))v.push(y);else if(v&&typeof v=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,y))&&(v[y]=!0);else return[v,y];return v}if(!v||typeof v!="object")return[v].concat(y);var g=v;return r(v)&&!r(y)&&(g=a(v,d)),r(v)&&r(y)?(y.forEach(function(_,T){if(t.call(v,T)){var C=v[T];C&&typeof C=="object"&&_&&typeof _=="object"?v[T]=m(C,_,d):v.push(_)}else v[T]=_}),v):Object.keys(y).reduce(function(_,T){var C=y[T];return t.call(_,T)?_[T]=m(_[T],C,d):_[T]=C,_},g)},l=function(v,y){return Object.keys(y).reduce(function(d,g){return d[g]=y[g],d},v)},u=function(m,v,y){var d=m.replace(/\+/g," ");if(y==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(v,y,d,g,_){if(v.length===0)return v;var T=v;if(typeof v=="symbol"?T=Symbol.prototype.toString.call(v):typeof v!="string"&&(T=String(v)),d==="iso-8859-1")return escape(T).replace(/%u[0-9a-f]{4}/gi,function(I){return"%26%23"+parseInt(I.slice(2),16)+"%3B"});for(var C="",P=0;P<T.length;P+=f){for(var O=T.length>=f?T.slice(P,P+f):T,x=[],k=0;k<O.length;++k){var M=O.charCodeAt(k);if(M===45||M===46||M===95||M===126||M>=48&&M<=57||M>=65&&M<=90||M>=97&&M<=122||_===e.RFC1738&&(M===40||M===41)){x[x.length]=O.charAt(k);continue}if(M<128){x[x.length]=n[M];continue}if(M<2048){x[x.length]=n[192|M>>6]+n[128|M&63];continue}if(M<55296||M>=57344){x[x.length]=n[224|M>>12]+n[128|M>>6&63]+n[128|M&63];continue}k+=1,M=65536+((M&1023)<<10|O.charCodeAt(k)&1023),x[x.length]=n[240|M>>18]+n[128|M>>12&63]+n[128|M>>6&63]+n[128|M&63]}C+=x.join("")}return C},E=function(v){for(var y=[{obj:{o:v},prop:"o"}],d=[],g=0;g<y.length;++g)for(var _=y[g],T=_.obj[_.prop],C=Object.keys(T),P=0;P<C.length;++P){var O=C[P],x=T[O];typeof x=="object"&&x!==null&&d.indexOf(x)===-1&&(y.push({obj:T,prop:O}),d.push(x))}return i(y),v},w=function(v){return Object.prototype.toString.call(v)==="[object RegExp]"},p=function(v){return!v||typeof v!="object"?!1:!!(v.constructor&&v.constructor.isBuffer&&v.constructor.isBuffer(v))},S=function(v,y){return[].concat(v,y)},b=function(v,y){if(r(v)){for(var d=[],g=0;g<v.length;g+=1)d.push(y(v[g]));return d}return y(v)};return Tg={arrayToObject:a,assign:l,combine:S,compact:E,decode:u,encode:h,isBuffer:p,isRegExp:w,maybeMap:b,merge:o},Tg}var Ag,o_;function KD(){if(o_)return Ag;o_=1;var e=WD(),t=sS(),r=m2(),n=Object.prototype.hasOwnProperty,i={brackets:function(m){return m+"[]"},comma:"comma",indices:function(m,v){return m+"["+v+"]"},repeat:function(m){return m}},a=Array.isArray,o=Array.prototype.push,l=function(b,m){o.apply(b,a(m)?m:[m])},u=Date.prototype.toISOString,f=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(m){return u.call(m)},skipNulls:!1,strictNullHandling:!1},E=function(m){return typeof m=="string"||typeof m=="number"||typeof m=="boolean"||typeof m=="symbol"||typeof m=="bigint"},w={},p=function b(m,v,y,d,g,_,T,C,P,O,x,k,M,I,H,G,Q,W){for(var U=m,j=W,A=0,L=!1;(j=j.get(w))!==void 0&&!L;){var z=j.get(m);if(A+=1,typeof z<"u"){if(z===A)throw new RangeError("Cyclic object value");L=!0}typeof j.get(w)>"u"&&(A=0)}if(typeof O=="function"?U=O(v,U):U instanceof Date?U=M(U):y==="comma"&&a(U)&&(U=t.maybeMap(U,function(ce){return ce instanceof Date?M(ce):ce})),U===null){if(_)return P&&!G?P(v,h.encoder,Q,"key",I):v;U=""}if(E(U)||t.isBuffer(U)){if(P){var q=G?v:P(v,h.encoder,Q,"key",I);return[H(q)+"="+H(P(U,h.encoder,Q,"value",I))]}return[H(v)+"="+H(String(U))]}var K=[];if(typeof U>"u")return K;var F;if(y==="comma"&&a(U))G&&P&&(U=t.maybeMap(U,P)),F=[{value:U.length>0?U.join(",")||null:void 0}];else if(a(O))F=O;else{var $=Object.keys(U);F=x?$.sort(x):$}var B=C?v.replace(/\./g,"%2E"):v,Y=d&&a(U)&&U.length===1?B+"[]":B;if(g&&a(U)&&U.length===0)return Y+"[]";for(var X=0;X<F.length;++X){var Z=F[X],te=typeof Z=="object"&&typeof Z.value<"u"?Z.value:U[Z];if(!(T&&te===null)){var ee=k&&C?Z.replace(/\./g,"%2E"):Z,ne=a(U)?typeof y=="function"?y(Y,ee):Y:Y+(k?"."+ee:"["+ee+"]");W.set(m,A);var ie=e();ie.set(w,W),l(K,b(te,ne,y,d,g,_,T,C,y==="comma"&&G&&a(U)?null:P,O,x,k,M,I,H,G,Q,ie))}}return K},S=function(m){if(!m)return h;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.encodeDotInKeys<"u"&&typeof m.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(m.encoder!==null&&typeof m.encoder<"u"&&typeof m.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=m.charset||h.charset;if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=r.default;if(typeof m.format<"u"){if(!n.call(r.formatters,m.format))throw new TypeError("Unknown format option provided.");y=m.format}var d=r.formatters[y],g=h.filter;(typeof m.filter=="function"||a(m.filter))&&(g=m.filter);var _;if(m.arrayFormat in i?_=m.arrayFormat:"indices"in m?_=m.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in m&&typeof m.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var T=typeof m.allowDots>"u"?m.encodeDotInKeys===!0?!0:h.allowDots:!!m.allowDots;return{addQueryPrefix:typeof m.addQueryPrefix=="boolean"?m.addQueryPrefix:h.addQueryPrefix,allowDots:T,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:v,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:h.charsetSentinel,commaRoundTrip:m.commaRoundTrip,delimiter:typeof m.delimiter>"u"?h.delimiter:m.delimiter,encode:typeof m.encode=="boolean"?m.encode:h.encode,encodeDotInKeys:typeof m.encodeDotInKeys=="boolean"?m.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof m.encoder=="function"?m.encoder:h.encoder,encodeValuesOnly:typeof m.encodeValuesOnly=="boolean"?m.encodeValuesOnly:h.encodeValuesOnly,filter:g,format:y,formatter:d,serializeDate:typeof m.serializeDate=="function"?m.serializeDate:h.serializeDate,skipNulls:typeof m.skipNulls=="boolean"?m.skipNulls:h.skipNulls,sort:typeof m.sort=="function"?m.sort:null,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:h.strictNullHandling}};return Ag=function(b,m){var v=b,y=S(m),d,g;typeof y.filter=="function"?(g=y.filter,v=g("",v)):a(y.filter)&&(g=y.filter,d=g);var _=[];if(typeof v!="object"||v===null)return"";var T=i[y.arrayFormat],C=T==="comma"&&y.commaRoundTrip;d||(d=Object.keys(v)),y.sort&&d.sort(y.sort);for(var P=e(),O=0;O<d.length;++O){var x=d[O];y.skipNulls&&v[x]===null||l(_,p(v[x],x,T,C,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,P))}var k=_.join(y.delimiter),M=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),k.length>0?M+k:""},Ag}var Rg,l_;function YD(){if(l_)return Rg;l_=1;var e=sS(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(p,S){return String.fromCharCode(parseInt(S,10))})},a=function(w,p){return w&&typeof w=="string"&&p.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(p,S){var b={__proto__:null},m=S.ignoreQueryPrefix?p.replace(/^\?/,""):p;m=m.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=S.parameterLimit===1/0?void 0:S.parameterLimit,y=m.split(S.delimiter,v),d=-1,g,_=S.charset;if(S.charsetSentinel)for(g=0;g<y.length;++g)y[g].indexOf("utf8=")===0&&(y[g]===l?_="utf-8":y[g]===o&&(_="iso-8859-1"),d=g,g=y.length);for(g=0;g<y.length;++g)if(g!==d){var T=y[g],C=T.indexOf("]="),P=C===-1?T.indexOf("="):C+1,O,x;P===-1?(O=S.decoder(T,n.decoder,_,"key"),x=S.strictNullHandling?null:""):(O=S.decoder(T.slice(0,P),n.decoder,_,"key"),x=e.maybeMap(a(T.slice(P+1),S),function(M){return S.decoder(M,n.decoder,_,"value")})),x&&S.interpretNumericEntities&&_==="iso-8859-1"&&(x=i(x)),T.indexOf("[]=")>-1&&(x=r(x)?[x]:x);var k=t.call(b,O);k&&S.duplicates==="combine"?b[O]=e.combine(b[O],x):(!k||S.duplicates==="last")&&(b[O]=x)}return b},f=function(w,p,S,b){for(var m=b?p:a(p,S),v=w.length-1;v>=0;--v){var y,d=w[v];if(d==="[]"&&S.parseArrays)y=S.allowEmptyArrays&&m===""?[]:[].concat(m);else{y=S.plainObjects?Object.create(null):{};var g=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=S.decodeDotInKeys?g.replace(/%2E/g,"."):g,T=parseInt(_,10);!S.parseArrays&&_===""?y={0:m}:!isNaN(T)&&d!==_&&String(T)===_&&T>=0&&S.parseArrays&&T<=S.arrayLimit?(y=[],y[T]=m):_!=="__proto__"&&(y[_]=m)}m=y}return m},h=function(p,S,b,m){if(p){var v=b.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,y=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,g=b.depth>0&&y.exec(v),_=g?v.slice(0,g.index):v,T=[];if(_){if(!b.plainObjects&&t.call(Object.prototype,_)&&!b.allowPrototypes)return;T.push(_)}for(var C=0;b.depth>0&&(g=d.exec(v))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&t.call(Object.prototype,g[1].slice(1,-1))&&!b.allowPrototypes)return;T.push(g[1])}return g&&T.push("["+v.slice(g.index)+"]"),f(T,S,b,m)}},E=function(p){if(!p)return n;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=typeof p.charset>"u"?n.charset:p.charset,b=typeof p.duplicates>"u"?n.duplicates:p.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var m=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:n.allowDots:!!p.allowDots;return{allowDots:m,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:n.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:n.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:n.arrayLimit,charset:S,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:n.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:n.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:n.decoder,delimiter:typeof p.delimiter=="string"||e.isRegExp(p.delimiter)?p.delimiter:n.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:n.depth,duplicates:b,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:n.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:n.plainObjects,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:n.strictNullHandling}};return Rg=function(w,p){var S=E(p);if(w===""||w===null||typeof w>"u")return S.plainObjects?Object.create(null):{};for(var b=typeof w=="string"?u(w,S):w,m=S.plainObjects?Object.create(null):{},v=Object.keys(b),y=0;y<v.length;++y){var d=v[y],g=h(d,b[d],S,typeof w=="string");m=e.merge(m,g,S)}return S.allowSparse===!0?m:e.compact(m)},Rg}var Mg,s_;function XD(){if(s_)return Mg;s_=1;var e=KD(),t=YD(),r=m2();return Mg={formats:r,parse:t,stringify:e},Mg}var u_;function uS(){if(u_)return Vo;u_=1;var e=CD();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
152
- `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,E=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=XD();function v(_,T,C){if(_&&typeof _=="object"&&_ instanceof t)return _;var P=new t;return P.parse(_,T,C),P}t.prototype.parse=function(_,T,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var P=_.indexOf("?"),O=P!==-1&&P<_.indexOf("#")?"?":"#",x=_.split(O),k=/\\/g;x[0]=x[0].replace(k,"/"),_=x.join(O);var M=_;if(M=M.trim(),!C&&_.split("#").length===1){var I=i.exec(M);if(I)return this.path=M,this.href=M,this.pathname=I[1],I[2]?(this.search=I[2],T?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):T&&(this.search="",this.query={}),this}var H=r.exec(M);if(H){H=H[0];var G=H.toLowerCase();this.protocol=G,M=M.substr(H.length)}if(C||H||M.match(/^\/\/[^@/]+@[^@/]+/)){var Q=M.substr(0,2)==="//";Q&&!(H&&S[H])&&(M=M.substr(2),this.slashes=!0)}if(!S[H]&&(Q||H&&!b[H])){for(var W=-1,U=0;U<f.length;U++){var j=M.indexOf(f[U]);j!==-1&&(W===-1||j<W)&&(W=j)}var A,L;W===-1?L=M.lastIndexOf("@"):L=M.lastIndexOf("@",W),L!==-1&&(A=M.slice(0,L),M=M.slice(L+1),this.auth=decodeURIComponent(A)),W=-1;for(var U=0;U<u.length;U++){var j=M.indexOf(u[U]);j!==-1&&(W===-1||j<W)&&(W=j)}W===-1&&(W=M.length),this.host=M.slice(0,W),M=M.slice(W),this.parseHost(),this.hostname=this.hostname||"";var z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!z)for(var q=this.hostname.split(/\./),U=0,K=q.length;U<K;U++){var F=q[U];if(F&&!F.match(E)){for(var $="",B=0,Y=F.length;B<Y;B++)F.charCodeAt(B)>127?$+="x":$+=F[B];if(!$.match(E)){var X=q.slice(0,U),Z=q.slice(U+1),te=F.match(w);te&&(X.push(te[1]),Z.unshift(te[2])),Z.length&&(M="/"+Z.join(".")+M),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=e.toASCII(this.hostname));var ee=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+ee,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),M[0]!=="/"&&(M="/"+M))}if(!p[G])for(var U=0,K=l.length;U<K;U++){var ie=l[U];if(M.indexOf(ie)!==-1){var ce=encodeURIComponent(ie);ce===ie&&(ce=escape(ie)),M=M.split(ie).join(ce)}}var Oe=M.indexOf("#");Oe!==-1&&(this.hash=M.substr(Oe),M=M.slice(0,Oe));var Te=M.indexOf("?");if(Te!==-1?(this.search=M.substr(Te),this.query=M.substr(Te+1),T&&(this.query=m.parse(this.query)),M=M.slice(0,Te)):T&&(this.search="",this.query={}),M&&(this.pathname=M),b[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",ae=this.search||"";this.path=ee+ae}return this.href=this.format(),this};function y(_){return typeof _=="string"&&(_=v(_)),_ instanceof t?_.format():t.prototype.format.call(_)}t.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var T=this.protocol||"",C=this.pathname||"",P=this.hash||"",O=!1,x="";this.host?O=_+this.host:this.hostname&&(O=_+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(O+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(x=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||x&&"?"+x||"";return T&&T.substr(-1)!==":"&&(T+=":"),this.slashes||(!T||b[T])&&O!==!1?(O="//"+(O||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):O||(O=""),P&&P.charAt(0)!=="#"&&(P="#"+P),k&&k.charAt(0)!=="?"&&(k="?"+k),C=C.replace(/[?#]/g,function(M){return encodeURIComponent(M)}),k=k.replace("#","%23"),T+O+C+k+P};function d(_,T){return v(_,!1,!0).resolve(T)}t.prototype.resolve=function(_){return this.resolveObject(v(_,!1,!0)).format()};function g(_,T){return _?v(_,!1,!0).resolveObject(T):T}return t.prototype.resolveObject=function(_){if(typeof _=="string"){var T=new t;T.parse(_,!1,!0),_=T}for(var C=new t,P=Object.keys(this),O=0;O<P.length;O++){var x=P[O];C[x]=this[x]}if(C.hash=_.hash,_.href==="")return C.href=C.format(),C;if(_.slashes&&!_.protocol){for(var k=Object.keys(_),M=0;M<k.length;M++){var I=k[M];I!=="protocol"&&(C[I]=_[I])}return b[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(_.protocol&&_.protocol!==C.protocol){if(!b[_.protocol]){for(var H=Object.keys(_),G=0;G<H.length;G++){var Q=H[G];C[Q]=_[Q]}return C.href=C.format(),C}if(C.protocol=_.protocol,!_.host&&!S[_.protocol]){for(var K=(_.pathname||"").split("/");K.length&&!(_.host=K.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),C.pathname=K.join("/")}else C.pathname=_.pathname;if(C.search=_.search,C.query=_.query,C.host=_.host||"",C.auth=_.auth,C.hostname=_.hostname||_.host,C.port=_.port,C.pathname||C.search){var W=C.pathname||"",U=C.search||"";C.path=W+U}return C.slashes=C.slashes||_.slashes,C.href=C.format(),C}var j=C.pathname&&C.pathname.charAt(0)==="/",A=_.host||_.pathname&&_.pathname.charAt(0)==="/",L=A||j||C.host&&_.pathname,z=L,q=C.pathname&&C.pathname.split("/")||[],K=_.pathname&&_.pathname.split("/")||[],F=C.protocol&&!b[C.protocol];if(F&&(C.hostname="",C.port=null,C.host&&(q[0]===""?q[0]=C.host:q.unshift(C.host)),C.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(K[0]===""?K[0]=_.host:K.unshift(_.host)),_.host=null),L=L&&(K[0]===""||q[0]==="")),A)C.host=_.host||_.host===""?_.host:C.host,C.hostname=_.hostname||_.hostname===""?_.hostname:C.hostname,C.search=_.search,C.query=_.query,q=K;else if(K.length)q||(q=[]),q.pop(),q=q.concat(K),C.search=_.search,C.query=_.query;else if(_.search!=null){if(F){C.host=q.shift(),C.hostname=C.host;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return C.search=_.search,C.query=_.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!q.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var B=q.slice(-1)[0],Y=(C.host||_.host||q.length>1)&&(B==="."||B==="..")||B==="",X=0,Z=q.length;Z>=0;Z--)B=q[Z],B==="."?q.splice(Z,1):B===".."?(q.splice(Z,1),X++):X&&(q.splice(Z,1),X--);if(!L&&!z)for(;X--;X)q.unshift("..");L&&q[0]!==""&&(!q[0]||q[0].charAt(0)!=="/")&&q.unshift(""),Y&&q.join("/").substr(-1)!=="/"&&q.push("");var te=q[0]===""||q[0]&&q[0].charAt(0)==="/";if(F){C.hostname=te?"":q.length?q.shift():"",C.host=C.hostname;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return L=L||C.host&&q.length,L&&!te&&q.unshift(""),q.length>0?C.pathname=q.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=_.auth||C.auth,C.slashes=C.slashes||_.slashes,C.href=C.format(),C},t.prototype.parseHost=function(){var _=this.host,T=n.exec(_);T&&(T=T[0],T!==":"&&(this.port=T.substr(1)),_=_.substr(0,_.length-T.length)),_&&(this.hostname=_)},Vo.parse=v,Vo.resolve=d,Vo.resolveObject=g,Vo.format=y,Vo.Url=t,Vo}var Lg={exports:{}},c_;function ZD(){return c_||(c_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(me,function(){var t=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(p){var S=p.value;return" "+p.name+'="'+r(S)+'"'},a=function(p){var S=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(S=S.toLowerCase()),S},o=function(p,S){var b=Array.prototype.map.call(p.attributes||p.attrs,function(m){return m.name}).indexOf("xmlns")>=0;return!b&&(S||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},l=function(p){return Array.prototype.map.call(p.childNodes,function(S){return w(S)}).join("")},u=function(p,S){var b="<"+a(p);return b+=o(p,S),Array.prototype.forEach.call(p.attributes||p.attrs,function(m){b+=i(m)}),p.childNodes.length>0?(b+=">",b+=l(p),b+="</"+a(p)+">"):b+="/>",b},f=function(p){var S=p.nodeValue||p.value||"";return n(S)},h=function(p){return"<!--"+p.data.replace(/-/g,"&#45;")+"-->"},E=function(p){return"<![CDATA["+p.nodeValue+"]]>"},w=function(p,S){var b=S&&S.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return l(p);if(p.tagName)return u(p,b);if(p.nodeName==="#text")return f(p);if(p.nodeName==="#comment")return h(p);if(p.nodeName==="#cdata-section")return E(p)};return{serializeToString:function(p){return t(w(p,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},f_;function QD(){if(f_)return Ng;f_=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
- ?</div>`),new RegExp(`^(.+)
154
- `)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Ng.failOnParseError=function(a){return i(a),a},Ng}var Ig={},Dg={},d_;function Zp(){return d_||(d_=1,function(e){var t=uS();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(h){u.push(h)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,h){var E=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),p,S=function(){h({msg:"Unable to load url",url:w})};p=n(w,u.cache),E.addEventListener("load",function(){E.status===200||E.status===0?f(E.response):S()},!1),E.addEventListener("error",S,!1);try{E.open("GET",p,!0),E.overrideMimeType(u.mimeType),E.send(null)}catch{S()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(h){for(var E="",w=0;w<h.length;w++)E+=String.fromCharCode(h.charCodeAt(w)&255);return E})};var i=function(l){var u=function(f,h){return f.substring(0,h.length)===h};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var h=btoa(f),E=i(f);return"data:"+E+";base64,"+h})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),E=u(h),w=o(l),p;return f[w]&&f[w][E]?f[w][E]:(p=l.apply(null,h),f[w]=f[w]||{},f[w][E]=p,p)}}}(Dg)),Dg}var jg={},h_;function JD(){if(h_)return jg;h_=1;var e=Zp(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return jg.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var h=r(l);return e.collectAndReportErrors(h.map(function(E){return t(E,o).then(function(w){E.attributes.src?E.attributes.src.value=w:E.attributes["xlink:href"]?E.attributes["xlink:href"].value=w:E.attributes.href&&(E.attributes.href.value=w)})}))},jg}var Fg={},p_;function ej(){if(p_)return Fg;p_=1;var e=Zp(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return Fg.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(f){n(u,f)})}))},Fg}var zg={},Bg={},g_;function y2(){return g_||(g_=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(Bg)),Bg}var Ug={},v_;function tj(){return v_||(v_=1,function(e){var t=y2(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),E,w=[],p=function(S){var b=new RegExp(l,"g"),m=[],v;for(v=b.exec(S);v;)m.push(v[1]),v=b.exec(S);return m};if(a.match(new RegExp(f))){for(E=h.exec(a);E;)w.push(p(E[0])),E=h.exec(a);return w}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(Ug)),Ug}function _d(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},m_;function rj(){return m_||(m_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,h){if(!i[f]){if(!n[f]){var E=typeof _d=="function"&&_d;if(!h&&E)return E(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var p=i[f]={exports:{}};n[f][0].call(p.exports,function(S){var b=n[f][1][S];return o(b||S)},p,p.exports,r,n,i,a)}return i[f].exports}for(var l=typeof _d=="function"&&_d,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function h(){this.constructor=u}h.prototype=f.prototype,u.prototype=new h}function o(u,f,h,E){this.message=u,this.expected=f,this.found=h,this.location=E,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var h={literal:function(v){return'"'+w(v.text)+'"'},class:function(v){var y="",d;for(d=0;d<v.parts.length;d++)y+=v.parts[d]instanceof Array?p(v.parts[d][0])+"-"+p(v.parts[d][1]):p(v.parts[d]);return"["+(v.inverted?"^":"")+y+"]"},any:function(v){return"any character"},end:function(v){return"end of input"},other:function(v){return v.description}};function E(v){return v.charCodeAt(0).toString(16).toUpperCase()}function w(v){return v.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+E(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+E(y)})}function p(v){return v.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+E(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+E(y)})}function S(v){return h[v.type](v)}function b(v){var y=new Array(v.length),d,g;for(d=0;d<v.length;d++)y[d]=S(v[d]);if(y.sort(),y.length>0){for(d=1,g=1;d<y.length;d++)y[d-1]!==y[d]&&(y[g]=y[d],g++);y.length=g}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}function m(v){return v?'"'+w(v)+'"':"end of input"}return"Expected "+b(u)+" but "+m(f)+" found."};function l(u,f){f=f!==void 0?f:{};var h={},E={start:ee},w=ee,p="",S=function(){return[]},b=",",m=F(",",!1),v=function(re,oe){return[re].concat(oe)},y=function(re){return[re]},d=function(re,oe){return{url:re,format:oe}},g=function(re){return{url:re}},_="url(",T=F("url(",!1),C=")",P=F(")",!1),O=function(re){return re},x="format(",k=F("format(",!1),M="local(",I=F("local(",!1),H=function(re){return{local:re}},G=/^[^)]/,Q=$([")"],!0,!1),W=function(re){return ve.extractValue(re.join(""))},U=/^[ \t\r\n\f]/,j=$([" "," ","\r",`
155
- `,"\f"],!1,!1),A=0,L=[{line:1,column:1}],z=0,q=[],K;if("startRule"in f){if(!(f.startRule in E))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=E[f.startRule]}function F(re,oe){return{type:"literal",text:re,ignoreCase:oe}}function $(re,oe,be){return{type:"class",parts:re,inverted:oe,ignoreCase:be}}function B(){return{type:"end"}}function Y(re){var oe=L[re],be;if(oe)return oe;for(be=re-1;!L[be];)be--;for(oe=L[be],oe={line:oe.line,column:oe.column};be<re;)u.charCodeAt(be)===10?(oe.line++,oe.column=1):oe.column++,be++;return L[re]=oe,oe}function X(re,oe){var be=Y(re),Ee=Y(oe);return{start:{offset:re,line:be.line,column:be.column},end:{offset:oe,line:Ee.line,column:Ee.column}}}function Z(re){A<z||(A>z&&(z=A,q=[]),q.push(re))}function te(re,oe,be){return new o(o.buildMessage(re,oe),re,oe,be)}function ee(){var re,oe;return re=ne(),re===h&&(re=A,oe=p,oe!==h&&(oe=S()),re=oe),re}function ne(){var re,oe,be,Ee,Ge,et;if(re=A,oe=ie(),oe!==h){for(be=[],Ee=ye();Ee!==h;)be.push(Ee),Ee=ye();if(be!==h)if(u.charCodeAt(A)===44?(Ee=b,A++):(Ee=h,Z(m)),Ee!==h){for(Ge=[],et=ye();et!==h;)Ge.push(et),et=ye();Ge!==h?(et=ne(),et!==h?(oe=v(oe,et),re=oe):(A=re,re=h)):(A=re,re=h)}else A=re,re=h;else A=re,re=h}else A=re,re=h;return re===h&&(re=A,oe=ie(),oe!==h&&(oe=y(oe)),re=oe),re}function ie(){var re;return re=ce(),re===h&&(re=ae()),re}function ce(){var re,oe,be,Ee;if(re=A,oe=Oe(),oe!==h){if(be=[],Ee=ye(),Ee!==h)for(;Ee!==h;)be.push(Ee),Ee=ye();else be=h;be!==h?(Ee=Te(),Ee!==h?(oe=d(oe,Ee),re=oe):(A=re,re=h)):(A=re,re=h)}else A=re,re=h;return re===h&&(re=A,oe=Oe(),oe!==h&&(oe=g(oe)),re=oe),re}function Oe(){var re,oe,be,Ee;return re=A,u.substr(A,4)===_?(oe=_,A+=4):(oe=h,Z(T)),oe!==h?(be=de(),be!==h?(u.charCodeAt(A)===41?(Ee=C,A++):(Ee=h,Z(P)),Ee!==h?(oe=O(be),re=oe):(A=re,re=h)):(A=re,re=h)):(A=re,re=h),re}function Te(){var re,oe,be,Ee;return re=A,u.substr(A,7)===x?(oe=x,A+=7):(oe=h,Z(k)),oe!==h?(be=de(),be!==h?(u.charCodeAt(A)===41?(Ee=C,A++):(Ee=h,Z(P)),Ee!==h?(oe=O(be),re=oe):(A=re,re=h)):(A=re,re=h)):(A=re,re=h),re}function ae(){var re,oe,be,Ee;return re=A,u.substr(A,6)===M?(oe=M,A+=6):(oe=h,Z(I)),oe!==h?(be=de(),be!==h?(u.charCodeAt(A)===41?(Ee=C,A++):(Ee=h,Z(P)),Ee!==h?(oe=H(be),re=oe):(A=re,re=h)):(A=re,re=h)):(A=re,re=h),re}function de(){var re,oe,be;if(re=A,oe=[],G.test(u.charAt(A))?(be=u.charAt(A),A++):(be=h,Z(Q)),be!==h)for(;be!==h;)oe.push(be),G.test(u.charAt(A))?(be=u.charAt(A),A++):(be=h,Z(Q));else oe=h;return oe!==h&&(oe=W(oe)),re=oe,re}function ye(){var re;return U.test(u.charAt(A))?(re=u.charAt(A),A++):(re=h,Z(j)),re}var ve=r("../util");if(K=w(),K!==h&&A===u.length)return K;throw K!==h&&A<u.length&&Z(B()),te(q,z<u.length?u.charAt(z):null,z<u.length?X(z,z+1):X(z,z))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var y_;function nj(){return y_||(y_=1,function(e){var t=Zp(),r=y2(),n=tj(),i=rj(),a=function(y,d,g){y.style.setProperty(d,g,y.style.getPropertyPriority(d))},o=function(y){return y.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(y){var d=[];return y.forEach(function(g){g.style.getPropertyValue("background-image")?d.push({property:"background-image",value:g.style.getPropertyValue("background-image"),rule:g}):g.style.getPropertyValue("background")&&d.push({property:"background",value:g.style.getPropertyValue("background"),rule:g})}),d},u=function(y){return y.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(y){return y.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(y){var d=[];return y.forEach(function(g,_){g.url&&!t.isDataUri(g.url)&&d.push(_)}),d},E=function(y){var d=[];return y.forEach(function(g,_){g.url&&!t.isDataUri(g.url)&&d.push(_)}),d};e.adjustPathsOfCssResources=function(y,d){var g=o(d),_=l(g),T=!1;return _.forEach(function(C){var P=n.parse(C.value),O=h(P),x;O.length>0&&(O.forEach(function(k){var M=P[k].url,I=t.joinUrl(y,M);P[k].url=I}),x=n.serialize(P),a(C.rule,C.property,x),T=!0)}),u(d).forEach(function(C){var P=C.style.getPropertyValue("src"),O,x;try{O=i.parse(P)}catch{return}x=E(O),x.length>0&&(x.forEach(function(k){var M=O[k].url,I=t.joinUrl(y,M);O[k].url=I}),r.changeFontFaceRuleSrc(d,C,i.serialize(O)),T=!0)}),f(d).forEach(function(C){var P=C.href,O=t.joinUrl(y,P);r.exchangeRule(d,C,"@import url("+O+");"),T=!0}),T};var w=function(y,d,g){var _=y.indexOf(d);y.splice(_,1),g.forEach(function(T,C){y.splice(_+C,0,T)})},p=function(y,d,g,_){var T=d.href,C;return T=r.unquoteString(T),C=t.joinUrl(_.baseUrl,T),g.indexOf(C)>=0?(w(y,d,[]),Promise.resolve([])):(g.push(C),t.ajax(T,_).then(function(P){var O=r.rulesForCssText(P);return e.loadCSSImportsForRules(O,g,_).then(function(x){return e.adjustPathsOfCssResources(T,O),w(y,d,O),x.errors})},function(P){throw{resourceType:"stylesheet",url:P.url,msg:"Unable to load stylesheet "+P.url}}))};e.loadCSSImportsForRules=function(y,d,g){var _=f(y),T=[],C=!1;return Promise.all(_.map(function(P){return p(y,P,d,g).then(function(O){T=T.concat(O),C=!0},function(O){T.push(O)})})).then(function(){return{hasChanges:C,errors:T}})};var S=function(y,d){var g=n.parse(y),_=h(g),T=!1;return t.collectAndReportErrors(_.map(function(C){var P=g[C].url;return t.getDataURIForImageURL(P,d).then(function(O){g[C].url=O,T=!0},function(O){throw{resourceType:"backgroundImage",url:O.url,msg:"Unable to load background-image "+O.url}})})).then(function(C){return{backgroundValue:n.serialize(g),hasChanges:T,errors:C}})},b=function(y,d){var g=o(y),_=l(g),T=[],C=!1;return Promise.all(_.map(function(P){return S(P.value,d).then(function(O){O.hasChanges&&(a(P.rule,P.property,O.backgroundValue),C=!0),T=T.concat(O.errors)})})).then(function(){return{hasChanges:C,errors:T}})},m=function(y,d){var g=!1,_,T;try{_=i.parse(y)}catch{_=[]}return T=E(_),t.collectAndReportErrors(T.map(function(C){var P=_[C],O=P.format||"woff";return t.binaryAjax(P.url,d).then(function(x){var k=btoa(x);P.url="data:font/"+O+";base64,"+k,g=!0},function(x){throw{resourceType:"fontFace",url:x.url,msg:"Unable to load font-face "+x.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:g,errors:C}})},v=function(y,d){var g=u(y),_=[],T=!1;return Promise.all(g.map(function(C){var P=C.style.getPropertyValue("src");return m(P,d).then(function(O){O.hasChanges&&(r.changeFontFaceRuleSrc(y,C,O.srcDeclarationValue),T=!0),_=_.concat(O.errors)})})).then(function(){return{hasChanges:T,errors:_}})};e.loadAndInlineCSSResourcesForRules=function(y,d){var g=!1,_=[];return Promise.all([b,v].map(function(T){return T(y,d).then(function(C){g=g||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:g,errors:_}})}}(zg)),zg}var b_;function ij(){return b_||(b_=1,function(e){var t=Zp(),r=JD(),n=ej(),i=nj(),a=y2(),o=function(m){return t.joinUrl(m,".")},l=function(m){var v=m.map(function(y,d){return d===m.length-1&&(y={baseUrl:o(y.baseUrl)}),JSON.stringify(y)});return v},u=function(m,v){return v.cache!==!1&&v.cache!=="none"&&v.cacheBucket?t.memoize(m,l,v.cacheBucket):m},f=function(m,v,y){var d=a.rulesForCssText(m);return i.loadCSSImportsForRules(d,v,y).then(function(g){return i.loadAndInlineCSSResourcesForRules(d,y).then(function(_){var T=g.errors.concat(_.errors),C=g.hasChanges||_.hasChanges;return C&&(m=a.cssRulesToText(d)),{hasChanges:C,content:m,errors:T}})})},h=function(m,v,y){var d=m.textContent,g=u(f,v);return g(d,y,v).then(function(_){return _.hasChanges&&(m.childNodes[0].nodeValue=_.content),t.cloneArray(_.errors)})},E=function(m){var v=m.getElementsByTagName("style");return Array.prototype.filter.call(v,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(m,v){var y=E(m),d=[],g=[],_;return _=t.clone(v),_.baseUrl=_.baseUrl||t.getDocumentBaseUrl(m),Promise.all(y.map(function(T){return h(T,_,g).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(m,v){var y=m.parentNode,d;v=v.trim(),v&&(d=m.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(m.ownerDocument.createTextNode(v)),y.insertBefore(d,m)),y.removeChild(m)},p=function(m,v){return t.ajax(m,v).then(function(y){var d=a.rulesForCssText(y);return{content:y,cssRules:d}}).then(function(y){var d=i.adjustPathsOfCssResources(m,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:d}}).then(function(y){return i.loadCSSImportsForRules(y.cssRules,[],v).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(y){return i.loadAndInlineCSSResourcesForRules(y.cssRules,v).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:y.errors.concat(d.errors)}})}).then(function(y){var d=y.content;return y.hasChanges&&(d=a.cssRulesToText(y.cssRules)),{content:d,errors:y.errors}})},S=function(m,v){var y=m.attributes.href.value,d=t.getDocumentBaseUrl(m.ownerDocument),g=t.clone(v);!g.baseUrl&&d&&(g.baseUrl=d);var _=u(p,v);return _(y,g).then(function(T){return{content:T.content,errors:t.cloneArray(T.errors)}})},b=function(m){var v=m.getElementsByTagName("link");return Array.prototype.filter.call(v,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(m,v){var y=b(m),d=[];return Promise.all(y.map(function(g){return S(g,v).then(function(_){w(g,_.content+`
156
- `),d=d.concat(_.errors)},function(_){d.push({resourceType:"stylesheet",url:_.url,msg:"Unable to load stylesheet "+_.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(m,v){var y=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return v.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(g){return g(m,v).then(function(_){y=y.concat(_)})})).then(function(){return y})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
157
- * http://www.github.com/cburgmer/rasterizeHTML.js
158
- * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(uS(),ZD(),QD(),ij()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(me,function(t,r,n,i){var a=function(S){var b={},m=[];b.joinUrl=function(d,g){return d?S.resolve(d,g):g},b.getConstantUniqueIdFor=function(d){return m.indexOf(d)<0&&m.push(d),m.indexOf(d)},b.clone=function(d){var g={},_;for(_ in d)d.hasOwnProperty(_)&&(g[_]=d[_]);return g};var v=function(d){return typeof d=="object"&&d!==null},y=function(d){return v(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return b.parseOptionalParameters=function(d){var g={canvas:null,options:{}};return d[0]==null||y(d[0])?(g.canvas=d[0]||null,g.options=b.clone(d[1])):g.options=b.clone(d[0]),g},b}(t),o=function(S){var b={},m=function(v,y,d){var g=v[y];return v[y]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,g])},g};return b.baseUrlRespectingXhr=function(v,y){var d=function(){var g=new v;return m(g,"open",function(_,T){var C=_.shift(),P=_.shift(),O=S.joinUrl(y,P);return T.apply(this,[C,O].concat(_))}),g};return d},b.finishNotifyingXhr=function(v){var y=0,d=0,g=!1,_,T=new Promise(function(P){_=function(){var O=y-d;O<=0&&g&&P({totalCount:y})}}),C=function(){var P=new v;return m(P,"send",function(O,x){return y+=1,x.apply(this,arguments)}),P.addEventListener("load",function(){d+=1,_()}),P};return C.waitForRequestsToFinish=function(){return g=!0,_(),T},C},b}(a),l=function(){var S={},b=function(C){return Array.prototype.slice.call(C)};S.addClassName=function(C,P){C.className+=" "+P},S.addClassNameRecursively=function(C,P){S.addClassName(C,P),C.parentNode!==C.ownerDocument&&S.addClassNameRecursively(C.parentNode,P)};var m=function(C,P){var O=C.parentStyleSheet,x=b(O.cssRules).indexOf(C);O.insertRule(P,x+1),O.deleteRule(x)},v=function(C,P){var O=C.cssText.replace(/^[^\{]+/,""),x=P+" "+O;m(C,x)},y=function(C){return b(C).reduce(function(P,O){return P+O.cssText},"")},d=function(C){C.textContent=y(C.sheet.cssRules)},g=function(C){var P=document.implementation.createHTMLDocument(""),O=document.createElement("style");O.textContent=C.textContent,P.body.appendChild(O),C.sheet=O.sheet},_=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},T=function(C,P,O){var x=_(P);b(C.querySelectorAll("style")).forEach(function(k){typeof k.sheet>"u"&&g(k);var M=b(k.sheet.cssRules).filter(function(I){return I.selectorText&&new RegExp(x,"i").test(I.selectorText)});M.length&&(M.forEach(function(I){var H=I.selectorText.replace(new RegExp(x,"gi"),function(G,Q,W){return Q+O(W)});H!==I.selectorText&&v(I,H)}),d(k))})};return S.rewriteCssSelectorWith=function(C,P,O){T(C,[P],function(){return O})},S.lowercaseCssTypeSelectors=function(C,P){T(C,P,function(O){return O.toLowerCase()})},S.findHtmlOnlyNodeNames=function(C){var P=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),O={},x={},k;do k=P.currentNode.tagName.toLowerCase(),P.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?O[k]=!0:x[k]=!0;while(P.nextNode());return Object.keys(O).filter(function(M){return!x[M]})},S}(),u=function(S){var b={},m=function(y){return Array.prototype.slice.call(y)},v={active:!0,hover:!0,focus:!1,target:!1};return b.fakeUserAction=function(y,d,g){var _=y.querySelector(d),T=":"+g,C="rasterizehtml"+g;_&&(v[g]?S.addClassNameRecursively(_,C):S.addClassName(_,C),S.rewriteCssSelectorWith(y,T,"."+C))},b.persistInputValues=function(y){var d=y.querySelectorAll("input"),g=y.querySelectorAll("textarea"),_=function(T){return T.type==="checkbox"||T.type==="radio"};m(d).filter(_).forEach(function(T){T.checked?T.setAttribute("checked",""):T.removeAttribute("checked")}),m(d).filter(function(T){return!_(T)}).forEach(function(T){T.setAttribute("value",T.value)}),m(g).forEach(function(T){T.textContent=T.value})},b.rewriteTagNameSelectorsToLowerCase=function(y){S.lowercaseCssTypeSelectors(y,S.findHtmlOnlyNodeNames(y))},b}(l),f=function(S,b,m,v){var y={},d=function(W,U,j,A){var L=W.createElement(U);return L.style.visibility="hidden",L.style.width=j+"px",L.style.height=A+"px",L.style.position="absolute",L.style.top=-1e4-A+"px",L.style.left=-1e4-j+"px",W.getElementsByTagName("body")[0].appendChild(L),L},g=function(W){return W>0?new Promise(function(U){setTimeout(U,W)}):Promise.resolve()};y.executeJavascript=function(W,U){return new Promise(function(j){var A=d(v.document,"iframe",U.width,U.height),L=W.outerHTML,z=[],q=U.executeJsTimeout||0,K=function(){v.document.getElementsByTagName("body")[0].removeChild(A)},F=function(){var X=A.contentDocument;j({document:X,errors:z,cleanUp:K})},$=A.contentWindow.XMLHttpRequest,B=b.finishNotifyingXhr($),Y=b.baseUrlRespectingXhr(B,U.baseUrl);A.onload=function(){g(q).then(B.waitForRequestsToFinish).then(F)},A.contentDocument.open(),A.contentWindow.XMLHttpRequest=Y,A.contentWindow.onerror=function(X){z.push({resourceType:"scriptExecution",msg:X})},A.contentDocument.write("<!DOCTYPE html>"),A.contentDocument.write(L),A.contentDocument.close()})};var _=function(W,U,j){var A=W.createElement("iframe");return A.style.width=U+"px",A.style.height=j+"px",A.style.visibility="hidden",A.style.position="absolute",A.style.top=-1e4-j+"px",A.style.left=-1e4-U+"px",A.style.borderWidth=0,A.sandbox="allow-same-origin",A.scrolling="no",A},T=function(W,U,j){var A=Math.floor(W/j),L=Math.floor(U/j);return _(v.document,A,L)},C=function(W,U,j,A){return{width:Math.max(W.width*A,U),height:Math.max(W.height*A,j)}},P=function(W,U){var j=W.querySelector(U);if(j)return j;if(W.ownerDocument.querySelector(U)===W)return W;throw{message:"Clipping selector not found"}},O=function(W,U,j,A,L){var z=Math.max(W.scrollWidth,W.clientWidth),q=Math.max(W.scrollHeight,W.clientHeight),K,F,$,B,Y,X,Z,te;return U?(X=P(W,U),Z=X.getBoundingClientRect(),K=Z.top,F=Z.left,$=Z.width,B=Z.height):(K=0,F=0,$=z,B=q),te=C({width:$,height:B},j,A,L),Y=v.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:F,top:K,width:te.width,height:te.height,viewportWidth:z,viewportHeight:q,rootFontSize:Y}},x=function(W,U){var j=W.tagName;return U.querySelector(j)},k=function(W){var U=W.tagName.toLowerCase();return U==="html"||U==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};y.calculateDocumentContentSize=function(W,U){return new Promise(function(j,A){var L=U.zoom||1,z;z=T(U.width,U.height,L),v.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var q=z.contentDocument,K;try{K=O(x(W,q),U.clip,U.width,U.height,L),j(K)}catch(F){A(F)}finally{v.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(k(W)),z.contentDocument.close()})},y.parseHtmlFragment=function(W){var U=v.document.implementation.createHTMLDocument("");U.documentElement.innerHTML=W;var j=U.querySelector("body").firstChild;if(!j)throw"Invalid source";return j};var M=function(W,U){var j=/<html((?:\s+[^>]*)?)>/im.exec(U),A=v.document.implementation.createHTMLDocument(""),L,z,q,K;if(j)for(L="<div"+j[1]+"></div>",A.documentElement.innerHTML=L,q=A.querySelector("div"),z=0;z<q.attributes.length;z++)K=q.attributes[z],W.documentElement.setAttribute(K.name,K.value)};y.parseHTML=function(W){var U=v.document.implementation.createHTMLDocument("");return U.documentElement.innerHTML=W,M(U,W),U};var I=function(W){try{return m.failOnParseError(W)}catch(U){throw{message:"Invalid source",originalError:U}}};y.validateXHTML=function(W){var U=new DOMParser,j=U.parseFromString(W,"application/xml");I(j)};var H=null,G=function(W,U){return U==="none"||U==="repeated"?((H===null||U!=="repeated")&&(H=Date.now()),W+"?_="+H):W},Q=function(W,U){return new Promise(function(j,A){var L=new window.XMLHttpRequest,z=S.joinUrl(U.baseUrl,W),q=G(z,U.cache),K=function(F){A({message:"Unable to load page",originalError:F})};L.addEventListener("load",function(){L.status===200||L.status===0?j(L.responseXML):K(L.statusText)},!1),L.addEventListener("error",function(F){K(F)},!1);try{L.open("GET",q,!0),L.responseType="document",L.send(null)}catch(F){K(F)}})};return y.loadDocument=function(W,U){return Q(W,U).then(function(j){return I(j)})},y}(a,o,n,window),h=function(S){var b={},m=function(x,k){return k?URL.createObjectURL(new Blob([x],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x)},v=function(x){x instanceof Blob&&URL.revokeObjectURL(x)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(x){return new Promise(function(k,M){var I=document.createElement("canvas"),H=new Image;H.onload=function(){var G=I.getContext("2d");try{G.drawImage(H,0,0),I.toDataURL("image/png"),k(!0)}catch{k(!1)}},H.onerror=M,H.src=x})},g=function(){var x=m(y,!0);return d(x).then(function(k){return v(x),k?!1:d(m(y,!1)).then(function(M){return M})},function(){return!1})},_=function(){if(S.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},T=function(){return new Promise(function(x,k){_()&&S.URL?g().then(function(M){x(!M)},function(){k()}):x(!1)})},C,P=function(){return C===void 0&&(C=T()),C},O=function(x){return P().then(function(k){return m(x,k)})};return b.renderSvg=function(x){return new Promise(function(k,M){var I,H,G=function(){H.onload=null,H.onerror=null},Q=function(){I&&v(I)};H=new Image,H.onload=function(){G(),Q(),k(H)},H.onerror=function(){Q(),M()},O(x).then(function(W){I=W,H.src=I},M)})},b}(window),E=function(S,b,m,v){var y={},d=function(x,k){var M=k||1,I={width:x.width,height:x.height,"font-size":x.rootFontSize};return M!==1&&(I.style="transform:scale("+M+"); transform-origin: 0 0;"),I},g=function(x){var k,M,I,H;k=Math.round(x.viewportWidth),M=Math.round(x.viewportHeight),I=-x.left,H=-x.top;var G={x:I,y:H,width:k,height:M};return G},_=function(x){var k=x.style||"";x.style=k+"float: left;"},T=function(x){x.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},P=function(x){var k=Object.keys(x);return k.length?" "+k.map(function(M){return M+'="'+x[M]+'"'}).join(" "):""},O=function(x,k,M){var I=v.serializeToString(x);b.validateXHTML(I);var H=g(k);return _(H),T(H),'<svg xmlns="http://www.w3.org/2000/svg"'+P(d(k,M))+">"+C()+"<foreignObject"+P(H)+">"+I+"</foreignObject></svg>"};return y.getSvgForDocument=function(x,k,M){return m.rewriteTagNameSelectorsToLowerCase(x),O(x,k,M)},y.drawDocumentAsSvg=function(x,k){return["hover","active","focus","target"].forEach(function(M){k[M]&&m.fakeUserAction(x,k[M],M)}),b.calculateDocumentContentSize(x,k).then(function(M){return y.getSvgForDocument(x,M,k.zoom)})},y}(a,f,u,r),w=function(S,b,m,v,y,d){var g={},_=function(x){return{message:"Error rendering page",originalError:x}},T=function(x){return y.renderSvg(x).then(function(k){return{image:k,svg:x}},function(k){throw _(k)})},C=function(x,k){try{k.getContext("2d").drawImage(x,0,0)}catch(M){throw _(M)}},P=function(x,k,M){return v.drawDocumentAsSvg(x,M).then(T).then(function(I){return k&&C(I.image,k),I})},O=function(x,k){return b.executeJavascript(x,k).then(function(M){var I=M.document;return m.persistInputValues(I),{document:I,errors:M.errors,cleanUp:M.cleanUp}})};return g.rasterize=function(x,k,M){var I;return I=S.clone(M),I.inlineScripts=M.executeJs===!0,d.inlineReferences(x,I).then(function(H){return M.executeJs?O(x,M).then(function(G){return{element:G.document.documentElement,errors:H.concat(G.errors),cleanUp:G.cleanUp}}):{element:x,errors:H,cleanUp:function(){}}}).then(function(H){return P(H.element,k,M).then(function(G){return H.cleanUp(),{image:G.image,svg:G.svg,errors:H.errors}})})},g}(a,f,u,E,h,i),p=function(S,b,m){var v={},y=function(C,P){var O=300,x=200,k=C?C.width:O,M=C?C.height:x,I=P.width!==void 0?P.width:k,H=P.height!==void 0?P.height:M;return{width:I,height:H}},d=function(C){var P=y(C.canvas,C.options),O;return O=S.clone(C.options),O.width=P.width,O.height=P.height,O};v.drawDocument=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P),x=C.documentElement?C.documentElement:C;return m.rasterize(x,O.canvas,d(O))};var g=function(C,P,O){var x=b.parseHTML(C);return v.drawDocument(x,P,O)};v.drawHTML=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P);return g(C,O.canvas,O.options)};var _=function(C,P,O){var x=document.implementation.createHTMLDocument("");x.replaceChild(C.documentElement,x.documentElement);var k=O?S.clone(O):{};return O.baseUrl||(k.baseUrl=P),{document:x,options:k}},T=function(C,P,O){return b.loadDocument(C,O).then(function(x){var k=_(x,C,O);return v.drawDocument(k.document,P,k.options)})};return v.drawURL=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P);return T(C,O.canvas,O.options)},v}(a,f,w);return p})})(aS);var aj=aS.exports;(function(e){var t=me&&me.__createBinding||(Object.create?function(d,g,_,T){T===void 0&&(T=_);var C=Object.getOwnPropertyDescriptor(g,_);C&&!("get"in C?!g.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return g[_]}}),Object.defineProperty(d,T,C)}:function(d,g,_,T){T===void 0&&(T=_),d[T]=g[_]}),r=me&&me.__setModuleDefault||(Object.create?function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}:function(d,g){d.default=g}),n=me&&me.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var _ in d)_!=="default"&&Object.prototype.hasOwnProperty.call(d,_)&&t(g,d,_);return r(g,d),g};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.isContentWrapping=e.prerenderFont=e.resetStyleContent=void 0;const i=n(aj),a=Js;e.resetStyleContent=`
159
- p {
160
- margin: 0;
161
- padding: 0;
162
- word-wrap: break-word; /* Required for Firefox */
163
- /* a text may have several spaces, we need to preserve them */
164
- white-space: pre-wrap;
165
- }
166
- ul, ol {
167
- list-style-position: outside;
168
- margin: 0;
169
- padding: 0;
170
- display: inline-block;
171
- text-align: left;
172
- width: 100%;
173
- }
174
- li {
175
- margin-left: 1.7em;
176
- padding-left: 0.5em; /* This should match the margin-left value */
177
- }
178
- /* Add resets */
179
- ul {
180
- list-style-type: disc;
181
- }
182
- ol {
183
- list-style-type: decimal;
184
- }
185
-
186
- `;const o=`
187
- <style>
188
- html, body {
189
- padding: 0;
190
- margin: 0;
191
- }
192
- ${e.resetStyleContent}
193
- </style>
194
- `;let l;const u=()=>(l||(l=document.createElement("div"),l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),l),f=new Map,h=navigator.userAgent.includes("Firefox"),E=async d=>{if(f.has(d))return f.get(d);const g=(async()=>{const _=`<div style="font-family: ${d}; font-size: 100px;">${d}<strong>${d}</strong></div>`,T=document.createElement("div");T.innerHTML=_,T.style.visibility="hidden",T.style.position="absolute";const C=u();C.appendChild(T);const P=h?180:50;await new Promise(O=>setTimeout(O,P)),C.removeChild(T)})();return f.set(d,g),g};function w({html:d}){const g=document.createElement("div");g.innerHTML=d,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000",g.style.whiteSpace="nowrap",g.style.visibility="hidden";const _=u();_.appendChild(g);const T=g.textContent,C=g.childNodes[0],P=T.split(/\s+/);let O=!1;for(let x=0;x<P.length;x++){const k=P[x];if(C.textContent=k,O=C.scrollWidth>g.clientWidth,O)break}return _.removeChild(g),O}function p(d){d.indexOf("Avellino");const g=document.createElement("div");g.innerHTML=d,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000";const _=u();_.appendChild(g);const T=g.getBoundingClientRect();return _.removeChild(g),{width:T.width,height:T.height}}e.prerenderFont=E,e.isContentWrapping=w,e.detectSize=p;const S={};function b(d){const g=[];for(const _ of document.styleSheets)try{for(const T of _.cssRules)T instanceof CSSFontFaceRule&&T.style.fontFamily.replace(/['"]/g,"")===d&&g.push(T)}catch(T){console.warn(`Could not access stylesheet: ${_.href}`,T)}return g}const m={},v=d=>{if(m[d])return m[d];const g=b(d).filter(_=>_.style.fontFamily.replace(/['"]/g,"")===d).map(_=>({src:_.style.src,fontStyle:_.style.fontStyle||"normal",fontWeight:_.style.fontWeight||"normal"}));return m[d]=g,g};async function y({html:d,width:g,height:_,fontFamily:T,padding:C,font:P,pixelRatio:O}){const x=document.createElement("canvas");if(T!=="Arial"&&!P){const I=(0,a.getGoogleFontsVariants)();d+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${T}:${I}" rel="stylesheet">`}if(P){const I=P.styles||(P.url?[{src:`url("${P.url}")`}]:v(T));d+="<style>",I.forEach(H=>{d+=`
195
- @font-face {
196
- font-family: '${T}';
197
- src: ${H.src};
198
- font-style: ${H.fontStyle||"normal"};
199
- font-weight: ${H.fontWeight||"normal"};
200
- }
201
- `}),d+="</style>"}d+=o;const k=await i.drawHTML(`<div style="padding: ${C}px;">${d}</div>`,x,{width:g+2*C,height:_+2*C,cacheBucket:S});x.width=(g+2*C)*O,x.height=(_+2*C)*O;const M=x.getContext("2d");return M==null||M.drawImage(k.image,0,0,k.image.width*O,k.image.height*O),x}e.htmlToCanvas=y})(p2);var b2={},_2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.styled=e.setup=e.keyframes=e.glob=e.extractCss=e.css=void 0;let t={data:""},r=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||t,n=d=>{let g=r(d),_=g.data;return g.data="",_},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,g)=>{let _="",T="",C="";for(let P in d){let O=d[P];P[0]=="@"?P[1]=="i"?_=P+" "+O+";":T+=P[1]=="f"?o(O,P):P+"{"+o(O,P[1]=="k"?"":g)+"}":typeof O=="object"?T+=o(O,g?g.replace(/([^,])+/g,x=>P.replace(/(^:.*)|([^,])+/g,k=>/&/.test(k)?k.replace(/&/g,x):x?x+" "+k:k)):P):O!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=o.p?o.p(P,O):P+":"+O+";")}return _+(g&&C?g+"{"+C+"}":C)+T},l={},u=d=>{if(typeof d=="object"){let g="";for(let _ in d)g+=_+u(d[_]);return g}return d},f=(d,g,_,T,C)=>{let P=u(d),O=l[P]||(l[P]=(x=>{let k=0,M=11;for(;k<x.length;)M=101*M+x.charCodeAt(k++)>>>0;return"go"+M})(P));if(!l[O]){let x=P!==d?d:(k=>{let M,I=[{}];for(;M=i.exec(k.replace(a,""));)M[4]?I.shift():M[3]?I.unshift(I[0][M[3]]=I[0][M[3]]||{}):I[0][M[1]]=M[2];return I[0]})(d);l[O]=o(C?{["@keyframes "+O]:x}:x,_?"":"."+O)}return((x,k,M)=>{k.data.indexOf(x)==-1&&(k.data=M?x+k.data:k.data+x)})(l[O],g,T),O},h=(d,g,_)=>d.reduce((T,C,P)=>{let O=g[P];if(O&&O.call){let x=O(_),k=x&&x.props&&x.props.className||/^go/.test(x)&&x;O=k?"."+k:x&&typeof x=="object"?x.props?"":o(x,""):x===!1?"":x}return T+C+(O??"")},"");function E(d){let g=this||{},_=d.call?d(g.p):d;return f(_.unshift?_.raw?h(_,[].slice.call(arguments,1),g.p):_.reduce((T,C)=>Object.assign(T,C&&C.call?C(g.p):C),{}):_,r(g.target),g.g,g.o,g.k)}e.extractCss=n,e.css=E;let w,p,S,b=E.bind({g:1}),m=E.bind({k:1});function v(d,g,_,T){o.p=g,w=d,p=_,S=T}function y(d,g){let _=this||{};return function(){let T=arguments;function C(P,O){let x=Object.assign({},P),k=x.className||C.className;_.p=Object.assign({theme:p&&p()},x),_.o=/ *go\d+/.test(k),x.className=E.apply(_,T)+(k?" "+k:""),g&&(x.ref=O);let M=d;return d[0]&&(M=x.as||d,delete x.as),S&&M[0]&&S(x),w(M,x)}return g?g(C):C}}e.glob=b,e.keyframes=m,e.setup=v,e.styled=y})(_2);var oj=me&&me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(b2,"__esModule",{value:!0});const lj=oj(Je),__=_2;(0,__.setup)(lj.default.createElement),b2.default=__.styled;(function(e){var t=me&&me.__createBinding||(Object.create?function(j,A,L,z){z===void 0&&(z=L);var q=Object.getOwnPropertyDescriptor(A,L);q&&!("get"in q?!A.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return A[L]}}),Object.defineProperty(j,z,q)}:function(j,A,L,z){z===void 0&&(z=L),j[z]=A[L]}),r=me&&me.__setModuleDefault||(Object.create?function(j,A){Object.defineProperty(j,"default",{enumerable:!0,value:A})}:function(j,A){j.default=A}),n=me&&me.__importStar||function(j){if(j&&j.__esModule)return j;var A={};if(j!=null)for(var L in j)L!=="default"&&Object.prototype.hasOwnProperty.call(j,L)&&t(A,j,L);return r(A,j),A},i=me&&me.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.quillRef=void 0;const a=i(Je),o=bi,l=Aa,u=i(PD),f=i(wi),h=n(Xi),E=Kn,w=Xc,p=Zy,S=Yc,b=p2,m=kl,v=Tl,y=Kc,d=i(b2),g=Vi,_=e2,T=n(Js),C=To,P=f2;e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const O=(0,d.default)("div",a.default.forwardRef)`
202
- .ql-editor {
203
- outline: none;
204
- }
205
- ${b.resetStyleContent}
206
- strong {
207
- font-weight: 700;
208
- }
209
- .ql-direction-rtl {
210
- direction: rtl;
211
- }
212
- `,x=j=>new u.default(j,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=x;const k=(j,A)=>{var L=j.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+A+"<p><br></p></div>");j.setContents(L),j.history.clear()};e.setQuillContent=k;const M=({html:j,onBlur:A,onChange:L,element:z})=>{const q=a.default.useRef(null);a.default.useEffect(()=>{if(!q.current)return;const F=(0,e.createQuill)(q.current);return h.runInAction(()=>{e.quillRef.editor.instance=F}),window.__polotnoQuill=F,F.on("text-change",()=>{F.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=F.getFormat()}),setTimeout(()=>{var $;const B=($=q.current)===null||$===void 0?void 0:$.childNodes[0];L(B.innerHTML)},10)}),F.setSelection(0,0,"api"),F.on("selection-change",$=>{$||A(),$&&h.runInAction(()=>{e.quillRef.currentFormat=F.getFormat()})}),q.current.childNodes[0].addEventListener("blur",$=>{var B;!((B=$.relatedTarget)===null||B===void 0)&&B.classList.contains("ql-clipboard")||A()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var F;const $=e.quillRef.editor.instance;if(!$)return;const B=$.getSelection();((F=q.current)===null||F===void 0?void 0:F.childNodes[0].innerHTML)===z.text||((0,e.setQuillContent)($,j),B&&($.setSelection(B.index,B.length),h.runInAction(()=>{e.quillRef.currentFormat=$.getFormat()})))},[z.text]);const K={color:z.fill};return z.fill.indexOf("gradient")>=0&&(K.backgroundColor=z.fill,K.backgroundImage=z.fill,K.backgroundSize="100% 100%",K.backgroundRepeat="repeat",K.webkitBackgroundClip="text",K.MozBackgroundClip="text",K.WebkitTextFillColor="transparent",K.MozTextFillColor="transparent"),a.default.createElement(O,{ref:q,style:Object.assign(Object.assign({},K),{fontSize:z.fontSize,width:z.a.width,fontFamily:z.fontFamily,lineHeight:z.lineHeight,letterSpacing:z.letterSpacing+"rem",textAlign:z.align}),dir:(0,p.getDir)((0,_.removeTags)(z.text))})};function I(j,A,L){return a.default.useMemo(()=>(0,b.detectSize)(j),[j,A.width,L])}function H(j){const A=j.getContext("2d").getImageData(0,0,j.width,j.height).data;for(let L=0;L<A.length;L+=4)if(A[L+3]!==0)return!0;return!1}function G(j){return!H(j)}function Q(j,{fontFamily:A="",color:L="black"}={}){let z=`color: ${L||j.fill}`;return j.fill.indexOf("gradient")>=0&&(z=`
213
- background-color: ${L};
214
- background-image: ${j.fill};
215
- background-size: 100% 100%;
216
- background-repeat: repeat;
217
- -webkit-background-clip: text;
218
- -moz-background-clip: text;
219
- -webkit-text-fill-color: transparent;
220
- -moz-text-fill-color: transparent;
221
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(j.width||100)}px`,z,`font-size: ${j.fontSize}px`,`font-family: '${A}'`,`text-align: ${j.align}`,j.textDecoration?`text-decoration: ${j.textDecoration}`:"",j.lineHeight?`line-height: ${j.lineHeight}`:"",j.letterSpacing?`letter-spacing: ${j.letterSpacing}rem`:"",j.fontStyle?`font-style: ${j.fontStyle}`:"",j.fontWeight?`font-weight: ${j.fontWeight}`:"",j.strokeWidth?`-webkit-text-stroke: ${j.strokeWidth}px ${j.stroke}`:"",j.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,p.getDir)((0,_.removeTags)(j.text))}">${j.text.replaceAll(`
222
- `,"</br>")}</div>`}const W=j=>{let A=j.fontSize;for(let L=1;L<50;L++){const z=Q(Object.assign(Object.assign({},j.toJSON()),{fontSize:A}),{fontFamily:j.fontFamily}),{height:q}=(0,b.detectSize)(z),K=j.height&&q>j.height,F=(0,b.isContentWrapping)({html:z});if(!(K||F))break;A-=.5}return A},U=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:j,store:A})=>{const L=a.default.useRef(null),[z,q]=a.default.useState(),[K,F]=a.default.useState(!1),[$,B]=a.default.useState(!0),[Y,X]=a.default.useState(!1),Z=a.default.useRef(j.height),te=A.selectedShapes.indexOf(j)>=0,ee=j.fontSize/3,{textVerticalResizeEnabled:ne}=E.flags,ie=(0,p.usePrevious)(j.fontFamily),[ce]=(0,p.useFontLoader)(A,j.fontFamily),Oe=j._editModeEnabled;(0,m.useFadeIn)(L);const Te=ce?j.fontFamily:ie!==j.fontFamily?ie:"Arial",ae=(0,S.useColor)(j).fill,de=Q(j,{fontFamily:Te,color:ae}),{width:ye,height:ve}=I(de,j,ce);a.default.useEffect(()=>{if(!ce)return;if(!j.height)return void j.set({height:ve});const{textOverflow:Ae}=E.flags;if(Ae!=="change-font-size"||K)Ae==="resize"&&(ne&&j.height<ve&&A.history.ignore(()=>{j.set({height:ve})}),ne||j.height===ve||A.history.ignore(()=>{j.set({height:ve})}));else{const Ce=W(j);Ce!==j.fontSize?A.history.ignore(()=>{j.set({fontSize:Ce})}):j.height!==ve&&(ne&&j.height<ve?A.history.ignore(()=>{j.set({height:ve})}):ne||A.history.ignore(()=>{j.set({height:ve})}))}});const re=a.default.useRef(0),oe=a.default.useMemo(()=>{const Ae={lastArgs:null,lastResult:null};return async function(Ce){return Ae.lastArgs&&Ae.lastResult&&(ke=Ae.lastArgs,Ne=Ce,JSON.stringify(ke)===JSON.stringify(Ne))||(Ae.lastResult=await(0,b.htmlToCanvas)(Ce),Ae.lastArgs=Object.assign({},Ce)),Ae.lastResult;var ke,Ne}},[]);a.default.useEffect(()=>{K||Oe||(async()=>{re.current++;const Ae=re.current,Ce=(0,g.incrementLoader)(`text ${j.id}`);B(!0);let ke=null;const Ne=U?5:1;for(let Ze=0;Ze<Ne;Ze++){if(ke=await(Ze>0?oe:b.htmlToCanvas)({skipCache:Ze>0,html:de,width:j.width||1,height:j.height||ve||1,fontFamily:Te,padding:ee,pixelRatio:A._elementsPixelRatio,font:A.fonts.find(fe=>fe.fontFamily===Te)||T.globalFonts.find(fe=>fe.fontFamily===Te)}),Ae!==re.current)return void Ce();G(ke)&&U&&await new Promise(fe=>setTimeout(fe,50*(Ze+1)))}ke?(q(ke),B(!1),f.default.Util.requestAnimFrame(Ce)):Ce()})()},[de,K,ve,Oe,Te,j.height,A._elementsPixelRatio]);const be=K||$;a.default.useEffect(()=>h.autorun(()=>{const Ae=L.current;(0,w.applyFilter)(Ae,j)}),[z,be,j.shadowColor,j.shadowOffsetX,j.shadowOffsetY,j.shadowOpacity]);let Ee=0;j.verticalAlign==="middle"&&(Ee=(j.height-ve)/2),j.verticalAlign==="bottom"&&(Ee=j.height-ve);const Ge=(0,p.getLineHeight)({fontLoaded:ce,fontFamily:j.fontFamily,fontSize:j.fontSize,lineHeight:j.lineHeight}),et=(0,C.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:j.a.x,y:j.a.y,offsetX:j.backgroundPadding*(j.fontSize*Ge*.5),offsetY:j.backgroundPadding*(j.fontSize*Ge*.5),rotation:j.a.rotation,hideInExport:!j.showInExport,listening:!1,visible:j.backgroundEnabled,opacity:j.backgroundOpacity*j.a.opacity,fill:j.backgroundColor,width:j.a.width+j.backgroundPadding*(j.fontSize*Ge),height:j.a.height+j.backgroundPadding*(j.fontSize*Ge),cornerRadius:j.backgroundCornerRadius*(j.fontSize*Ge*.5)}),a.default.createElement(l.Rect,{ref:L,name:"element",x:j.a.x,y:j.a.y,listening:j.selectable,rotation:j.a.rotation,width:j.a.width,height:j.a.height,visible:!be,draggable:et?j.draggable&&te:j.draggable,preventDefault:!et||te,opacity:Oe?0:j.a.opacity,hideInExport:!j.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{j.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{j.set({x:Ae.target.x(),y:Ae.target.y()})},id:j.id,onDblClick:()=>{j.contentEditable&&j.toggleEditMode(!0)},onDblTap:()=>{j.contentEditable&&j.toggleEditMode(!0)},onTransformStart:Ae=>{F(!0),Z.current=j.height},onTransform:Ae=>{var Ce;const ke=Ae.target,Ne=((Ce=ke.getStage())===null||Ce===void 0?void 0:Ce.findOne("Transformer")).getActiveAnchor(),Ze=Ne==="middle-left"||Ne==="middle-right",ue=Ne==="top-center"||Ne==="bottom-center",fe=ke.scaleX();if(Ze){const Ye=ke.scaleX(),_e=Math.max(ke.width()*Ye,j.fontSize);if(ke.width(_e),ke.scaleX(1),E.flags.textVerticalResizeEnabled){const De=Math.max(ve,Z.current);j.set({height:De})}j.set({width:_e,x:ke.x(),y:ke.y()})}else if(ue){let Ye=E.flags.textOverflow==="resize"?ve:j.lineHeight*j.fontSize;const _e=Math.max(Ye,Ae.target.height()*Ae.target.scaleY());ke.scaleY(1),j.set({x:ke.x(),y:ke.y(),height:_e,rotation:ke.rotation()})}else ke.scaleX(1),ke.scaleY(1),j.set({fontSize:j.fontSize*fe,width:ke.width()*fe,x:ke.x(),y:ke.y(),rotation:ke.rotation(),height:ke.height()*fe})},onTransformEnd:Ae=>{F(!1),B(!0);const Ce=Ae.target.scaleX();Ae.target.scaleX(1),Ae.target.scaleY(1),j.set({fontSize:j.fontSize*Ce,width:Ae.target.width()*Ce,x:Ae.target.x(),y:Ae.target.y(),rotation:Ae.target.rotation(),shadowBlur:j.shadowBlur*Ce,shadowOffsetX:j.shadowOffsetX*Ce,shadowOffsetY:j.shadowOffsetY*Ce,strokeWidth:j.strokeWidth*Ce})}}),a.default.createElement(l.Image,{ref:L,image:z,x:j.a.x,y:j.a.y,offsetX:ee,offsetY:ee-Ee,listening:!1,rotation:j.rotation,width:j.a.width+2*ee,height:j.a.height+2*ee,visible:!be,opacity:Oe?0:j.a.opacity,shadowEnabled:j.shadowEnabled,shadowBlur:j.shadowBlur,shadowOffsetX:j.shadowOffsetX,shadowOffsetY:j.shadowOffsetY,shadowColor:j.shadowColor,shadowOpacity:j.shadowOpacity,hideInExport:!j.showInExport}),be&&a.default.createElement(l.Group,{x:j.a.x,y:j.a.y,rotation:j.rotation,offsetY:-Ee},a.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(O,{dangerouslySetInnerHTML:{__html:de},style:{pointerEvents:"none",display:"inline-block"}}))),Oe&&a.default.createElement(l.Group,{x:j.a.x,y:j.a.y,rotation:j.rotation,offsetY:-Ee},a.default.createElement(y.Html,null,a.default.createElement(M,{html:de,element:j,onChange:Ae=>{const Ce=(0,P.getLimitedFontSize)({oldText:(0,_.removeTags)(j.text),newText:(0,_.removeTags)(Ae),element:j});j.set({text:Ae,fontSize:Ce})},onBlur:Ae=>{j.toggleEditMode(!1)}}))),(te||Y)&&a.default.createElement(v.Highlighter,{element:j}))})})(nS);var cS={},w2={},nu={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,h,E,w){const p=Math.sqrt(h*h+E*E);return w+=Math.atan2(E,h),{x:u+p*Math.cos(w),y:f+p*Math.sin(w)}}function n(u){const{x:f,y:h,width:E,height:w}=u,p=t(u.rotation),S=r(f,h,0,0,p),b=r(f,h,E,0,p),m=r(f,h,E,w,p),v=r(f,h,0,w,p),y=Math.min(S.x,b.x,m.x,v.x),d=Math.min(S.y,b.y,m.y,v.y),g=Math.max(S.x,b.x,m.x,v.x),_=Math.max(S.y,b.y,m.y,v.y);return{x:y,y:d,width:g-y,height:_-d,minX:y,minY:d,maxX:g,maxY:_}}function i(u){const f=u.map(S=>n(S)),h=Math.min(...f.map(S=>S.minX)),E=Math.min(...f.map(S=>S.minY)),w=Math.max(...f.map(S=>S.maxX)),p=Math.max(...f.map(S=>S.maxY));return{x:h,y:E,width:w-h,height:p-E,minX:h,minY:E,maxX:w,maxY:p}}function a(u){const f=t(u.rotation||0);return{x:u.x+u.width/2*Math.cos(f)+u.height/2*Math.sin(-f),y:u.y+u.height/2*Math.cos(f)+u.width/2*Math.sin(f)}}function o(u,f,h){const E=t(f),w=h.x+(u.x-h.x)*Math.cos(E)-(u.y-h.y)*Math.sin(E),p=h.y+(u.x-h.x)*Math.sin(E)+(u.y-h.y)*Math.cos(E);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:w,y:p})}function l(u,f){return o(u,f,a(u))}Object.defineProperty(e,"__esModule",{value:!0}),e.rotateAroundCenter=e.rotateAroundPoint=e.getCenter=e.getTotalClientRect=e.getClientRect=e.degToRad=void 0,e.degToRad=t,e.getClientRect=n,e.getTotalClientRect=i,e.getCenter=a,e.rotateAroundPoint=o,e.rotateAroundCenter=l})(nu);(function(e){var t=me&&me.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(Je),n=t(wi),i=nu;var a=5;function o(E){const w=E.__getNodeRect(),p=(0,i.getClientRect)(Object.assign(Object.assign({},w),{rotation:n.default.Util.radToDeg(w.rotation)})),S=E.getAbsolutePosition();return{vertical:[{guide:p.x,offset:S.x-p.x,snap:"start"},{guide:p.x+p.width/2,offset:S.x-p.x-p.width/2,snap:"center"},{guide:p.x+p.width,offset:S.x-p.x-p.width,snap:"end"}],horizontal:[{guide:p.y,offset:S.y-p.y,snap:"start"},{guide:p.y+p.height/2,offset:S.y-p.y-p.height/2,snap:"center"},{guide:p.y+p.height,offset:S.y-p.y-p.height,snap:"end"}]}}function l(E,w){var p=[],S=[];E.vertical.forEach(g=>{w.vertical.forEach(_=>{var T=Math.abs(g-_.guide);T<a&&p.push({lineGuide:g,diff:T,snap:_.snap,offset:_.offset})})}),E.horizontal.forEach(g=>{w.horizontal.forEach(_=>{var T=Math.abs(g-_.guide);T<a&&S.push({lineGuide:g,diff:T,snap:_.snap,offset:_.offset})})});var b=[];const m=p.sort((g,_)=>g.diff-_.diff),v=S.sort((g,_)=>g.diff-_.diff);var y=m[0],d=v[0];return y&&m.filter(g=>Math.abs(g.diff-y.diff)<.1).forEach(g=>{b.push(Object.assign({orientation:"V"},g))}),d&&v.filter(g=>Math.abs(g.diff-d.diff)<.1).forEach(g=>{b.push(Object.assign({orientation:"H"},g))}),b}function u(E,w){const p=r.default.useRef(),S=_=>_.hasName("element")||_.hasName("page-background")||!p.current&&_.hasName("elements-area");function b(_){var T;const C=(T=E.current)===null||T===void 0?void 0:T.getStage();var P=[],O=[];return C.find(S).forEach(x=>{if(!(_.indexOf(x)>=0)){var k=x.getClientRect({skipShadow:!0,skipStroke:!0});P.push(k.x,k.x+k.width,k.x+k.width/2),O.push(k.y,k.y+k.height,k.y+k.height/2)}}),{vertical:P,horizontal:O}}function m(_){var T;const C=(T=E.current)===null||T===void 0?void 0:T.getLayer(),P=C==null?void 0:C.children.find(O=>O.name()==="line-guides");_.forEach(O=>{if(O.orientation==="H"){var x=new n.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});P==null||P.add(x),C.batchDraw()}else O.orientation==="V"&&(x=new n.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),P==null||P.add(x))})}const v=_=>{_.target.getLayer().children.find(k=>k.name()==="line-guides").destroyChildren();var T=l(b(_.target.nodes()),o(_.target));if(!T.length)return;m(T);const C=_.target.getAbsolutePosition(),P=(_.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},C));T.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":P.x=k.lineGuide+k.offset;break;case"H":P.y=k.lineGuide+k.offset}}});const O=P.x-C.x,x=P.y-C.y;_.evt.ctrlKey||_.evt.metaKey||_.target.nodes().forEach(k=>{const M=k.getAbsolutePosition();k.setAbsolutePosition({x:M.x+O,y:M.y+x})})},y=(_,T,C)=>{const P=E.current,O=P.getLayer();if(O.children.find(G=>G.name()==="line-guides").destroyChildren(),P.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(T.x-_.x,2)+Math.pow(T.y-_.y,2))>50||!O)return T;var x=l(b(P.nodes()),{vertical:[{guide:T.x,offset:0,snap:"start"}],horizontal:[{guide:T.y,offset:0,snap:"start"}]});if(!x.length||(m(x),C.ctrlKey||C.metaKey))return T;let k=T.x,M=T.x;x.forEach(G=>{switch(G.orientation){case"V":k=G.lineGuide;break;case"H":M=G.lineGuide}});const I=Math.abs(T.x-k)<10,H=Math.abs(T.y-M)<10;return I&&!H?{x:k,y:_.y}:H&&!I?{x:_.x,y:M}:I&&H?{x:k,y:M}:T},d=_=>{if(p.current=!1,!_.target)return;const T=_.target.getLayer();T.children.find(C=>C.name()==="line-guides").destroyChildren(),T.batchDraw()},g=()=>{const _=E.current.nodes().map(C=>C.id()),T=w.getElementById(_[0]);p.current=(T==null?void 0:T.type)==="image"};r.default.useEffect(()=>{E.current&&(E.current.anchorDragBoundFunc(y),E.current.on("dragstart",()=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const _=[...n.default.DD._dragElements.entries()],T=_.find(([C,P])=>P.node instanceof n.default.Transformer);_.splice(_.indexOf(T),1),_.unshift(T),n.default.DD._dragElements.clear(),_.forEach(([C,P])=>{n.default.DD._dragElements.set(C,P)})}),g()}),E.current.on("dragmove",v),E.current.on("dragend",d),E.current.on("transformstart",()=>{g()}),E.current.on("transformend",d),E.current.on("transform",_=>{var T,C;_.evt.ctrlKey||_.evt.metaKey?(T=E.current)===null||T===void 0||T.rotationSnapTolerance(0):(C=E.current)===null||C===void 0||C.rotationSnapTolerance(5)}))},[])}function f(E){return{vertical:[{guide:E.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:E.absolutePosition().y,offset:0,snap:"center"}]}}function h(E,w,p){const S=v=>v.hasName("element")||v.hasName("line-anchor")||v.hasName("page-background")||v.hasName("elements-area"),b=v=>{v.target.getLayer().children.find(C=>C.name()==="line-guides").destroyChildren();var y=l(function(C){var P;const O=(P=E.current)===null||P===void 0?void 0:P.getStage();var x=[],k=[];return O.find(S).forEach(M=>{if(!(C.indexOf(M)>=0)){var I=M.getClientRect({skipShadow:!0,skipStroke:!0});M.hasName("line-anchor")&&(I={x:M.absolutePosition().x,y:M.absolutePosition().y,width:0,height:0}),x.push(I.x,I.x+I.width,I.x+I.width/2),k.push(I.y,I.y+I.height,I.y+I.height/2)}}),{vertical:x,horizontal:k}}([v.target,...w.map(C=>C.current)]),f(v.target));if(!y.length)return;(function(C){var P;const O=(P=E.current)===null||P===void 0?void 0:P.getLayer(),x=O==null?void 0:O.children.find(k=>k.name()==="line-guides");C.forEach(k=>{if(k.orientation==="H"){var M=new n.default.Line({points:[-6e3,k.lineGuide,6e3,k.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});x==null||x.add(M),O.batchDraw()}else k.orientation==="V"&&(M=new n.default.Line({points:[k.lineGuide,-6e3,k.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),x==null||x.add(M))})})(y);const d=v.target.getAbsolutePosition(),g=Object.assign({},d);y.forEach(C=>{switch(C.snap){case"start":case"center":case"end":switch(C.orientation){case"V":g.x=C.lineGuide+C.offset;break;case"H":g.y=C.lineGuide+C.offset}}});const _=g.x-d.x,T=g.y-d.y;if(!(v.evt.ctrlKey||v.evt.metaKey)){const C=v.target.getAbsolutePosition();v.target.absolutePosition({x:C.x+_,y:C.y+T})}},m=v=>{if(!v.target)return;const y=v.target.getLayer();y.children.find(d=>d.name()==="line-guides").destroyChildren(),y.batchDraw()};r.default.useEffect(()=>{E.current&&(E.current.on("dragmove",b),E.current.on("dragend",m))},p)}e.useSnap=u,e.useAnchorSnap=h})(w2);(function(e){var t=me&&me.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(Je),n=bi,i=Aa,a=Yc,o=Kc,l=Tl,u=w2,f=To;function h(S){const{x:b,y:m,width:v,height:y,rotation:d}=S.a,g=d*Math.PI/180,_={x:b+y/2*Math.cos(g+Math.PI/2),y:m+y/2*Math.sin(g+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+v*Math.cos(g),y:_.y+v*Math.sin(g)}}}function E(S,b,m){const v=Math.sqrt(Math.pow(b.x-S.x,2)+Math.pow(b.y-S.y,2)),y=Math.atan2(b.y-S.y,b.x-S.x),d=180*y/Math.PI;return{x:S.x+Math.cos(y-Math.PI/2)*m/2,y:S.y+Math.sin(y-Math.PI/2)*m/2,width:v,height:m,rotation:d}}e.getMiddlePoints=h,e.getLinePositionFromMiddlePoints=E;const w=(S,b)=>({offsetX:5/S,offsetY:5/S,width:10/S,height:10/S,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:m=>{m.target.getStage().container().style.cursor="crosshair"},onMouseLeave:m=>{m.target.getStage().container().style.cursor=""},onDragStart:m=>{b.history.startTransaction()},onDragEnd:m=>{b.history.endTransaction()}}),p=(0,n.observer)(({element:S,type:b})=>{const m=(0,a.useColor)(S,S.a.color,"fill"),v=(0,a.useColor)(S,S.a.color,"stroke"),y=Object.assign(Object.assign(Object.assign({strokeWidth:S.height,lineCap:"round",lineJoin:"round"},v),m),{opacity:S.a.opacity,hideInExport:!S.showInExport});return r.default.createElement(r.default.Fragment,null,b==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height]},y)),b==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height],closed:!0},y)),b==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-S.height,0,2*S.height],closed:!0},y)),b==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-S.height,4*S.height,2*-S.height,4*S.height,2*S.height,0,2*S.height],closed:!0},y)),b==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*S.height,y:0,radius:2*S.height},y)))});e.LineElement=(0,n.observer)(({element:S,store:b})=>{const m=r.default.useRef(null),v=r.default.useRef(null),y=r.default.useRef(null),d=S.selectable||b.role==="admin",g=(0,f.isTouchDevice)(),[_,T]=r.default.useState(!1),C=b.selectedElements.indexOf(S)>=0&&b.selectedElements.length===1,P=b.selectedShapes.indexOf(S)>=0,{middleLeft:O,middleRight:x}=h(S);(0,u.useAnchorSnap)(v,[m],[C]),(0,u.useAnchorSnap)(y,[m],[C]);const k=(0,a.useColor)(S,S.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:m,name:"element",id:S.id,x:S.a.x,y:S.a.y,points:[0,0,S.a.width,0],offsetY:-S.a.height/2,strokeWidth:S.a.height,hitStrokeWidth:Math.max(S.a.height,20),dash:S.dash.map(M=>M*S.a.height)},k,{rotation:S.a.rotation,opacity:S.animated("opacity"),shadowEnabled:S.shadowEnabled,shadowBlur:S.shadowBlur,shadowOffsetX:S.shadowOffsetX,shadowOffsetY:S.shadowOffsetY,shadowColor:S.shadowColor,shadowOpacity:S.shadowOpacity,listening:d,draggable:g?S.draggable&&P:S.draggable,preventDefault:!g||P,hideInExport:!S.showInExport,onMouseEnter:()=>{T(!0)},onMouseLeave:()=>{T(!1)},onDragMove:M=>{S.set({x:M.target.x(),y:M.target.y()})},onDragEnd:M=>{S.set({x:M.target.x(),y:M.target.y()})},onTransform:M=>{const I=M.target.scaleX();M.target.scaleX(1),M.target.scaleY(1),S.set({height:S.height*I,width:S.width*I,x:M.target.x(),y:M.target.y(),rotation:M.target.rotation()})}})),r.default.createElement(i.Group,{x:O.x,y:O.y,rotation:S.rotation,hideInExport:!S.showInExport},r.default.createElement(p,{element:S,type:S.startHead})),r.default.createElement(i.Group,{x:x.x,y:x.y,rotation:S.rotation+180},r.default.createElement(p,{element:S,type:S.endHead})),_&&!P&&r.default.createElement(l.Highlighter,{element:S}),C&&S.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:C},r.default.createElement(i.Rect,Object.assign({x:O.x,y:O.y,ref:v,name:"line-anchor"},w(b.scale,b),{onDragMove:M=>{const I=E(M.target.position(),x,S.height);S.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:x.x,y:x.y,ref:y,name:"line-anchor"},w(b.scale,b),{onDragMove:M=>{const I=E(O,M.target.position(),S.height);S.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})))))})})(cS);var fS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(A,L,z,q){q===void 0&&(q=z);var K=Object.getOwnPropertyDescriptor(L,z);K&&!("get"in K?!L.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return L[z]}}),Object.defineProperty(A,q,K)}:function(A,L,z,q){q===void 0&&(q=z),A[q]=L[z]}),r=me&&me.__setModuleDefault||(Object.create?function(A,L){Object.defineProperty(A,"default",{enumerable:!0,value:L})}:function(A,L){A.default=L}),n=me&&me.__importStar||function(A){if(A&&A.__esModule)return A;var L={};if(A!=null)for(var z in A)z!=="default"&&Object.prototype.hasOwnProperty.call(A,z)&&t(L,A,z);return r(L,A),L},i=me&&me.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Je),o=bi,l=Xi,u=Aa,f=i(Wp),h=i(wi),E=Kc,w=Tl,p=Vi,S=n(tu),b=Kn,m=Xc,v=kl,y=To;function d(){return document.createElement("canvas")}async function g(A){if(!(A.indexOf("data:image/svg+xml")>=0||A.indexOf(".svg")>=0))return A;const L=await S.urlToString(A),z=S.fixSize(L);return S.svgToURL(z)}const _=A=>{const[L,z]=a.default.useState(A);return a.default.useEffect(()=>{(async()=>{const q=await g(A);q!==L&&z(q)})()},[A]),L},T=new window.Image;T.src=S.svgToURL(`
223
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
224
- <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
225
- <path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
226
- </svg>
227
- `);const C=new window.Image;C.src=S.svgToURL(`
228
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
229
- <path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
230
- <path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
231
- <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
232
- <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
233
- </svg>
234
- `);function P(A,L,z,q,K,F,$){for(var B=new ImageData(L,z),Y=new Int32Array(A.data.buffer),X=A.width,Z=new Int32Array(B.data.buffer),te=B.width,ee=L/F,ne=z/$,ie=Math.round(1/ee),ce=Math.round(1/ne),Oe=ie*ce,Te=0;Te<B.height;Te++)for(var ae=0;ae<te;ae++){for(var de=q+Math.round(ae/ee)+(K+Math.round(Te/ne))*X,ye=0,ve=0,re=0,oe=0,be=0;be<ce;be++)for(var Ee=0;Ee<ie;Ee++){var Ge=Y[de+Ee+be*X];ye+=Ge<<24>>>24,ve+=Ge<<16>>>24,re+=Ge<<8>>>24,oe+=Ge>>>24}ye=Math.round(ye/Oe),ve=Math.round(ve/Oe),re=Math.round(re/Oe),oe=Math.round(oe/Oe),Z[ae+Te*te]=oe<<24|re<<16|ve<<8|ye}return B}function O(A,L){var z,q;const K=d();K.width=A.width,K.height=A.height,(z=K.getContext("2d"))===null||z===void 0||z.drawImage(A,0,0,K.width,K.height);const F=P(K.getContext("2d").getImageData(0,0,K.width,K.height),Math.floor(K.width*L),Math.floor(K.height*L),0,0,K.width,K.height);return K.width=Math.floor(K.width*L),K.height=Math.floor(K.height*L),(q=K.getContext("2d"))===null||q===void 0||q.putImageData(F,0,0),K}const x=(A,L,z,q,K=0,F=!1)=>{const $=Math.floor(Math.max(A.width*q,1)),B=Math.floor(Math.max(A.height*q,1)),Y=Math.min(K*q,$/2,B/2),X=Math.max(A.width/z.width,A.height/z.height)*q,Z=A.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&X<1&&!F,te=z.x===0&&z.y===0&&z.width===(L==null?void 0:L.width)&&z.height===(L==null?void 0:L.height),ee=a.default.useMemo(()=>{if(!(!L||!L.width||!L.height))return te&&Y===0&&!Z?void 0:d()},[L,Y,Z,te]);return a.default.useLayoutEffect(()=>{if(!ee||!L)return;ee.width=$,ee.height=B;const ne=ee.getContext("2d");if(!ne)return;Y&&(ne.beginPath(),ne.moveTo(Y,0),ne.lineTo($-Y,0),ne.arc($-Y,Y,Y,3*Math.PI/2,0,!1),ne.lineTo($,B-Y),ne.arc($-Y,B-Y,Y,0,Math.PI/2,!1),ne.lineTo(Y,B),ne.arc(Y,B-Y,Y,Math.PI/2,Math.PI,!1),ne.lineTo(0,Y),ne.arc(Y,Y,Y,Math.PI,3*Math.PI/2,!1),ne.clip());const ie=Z?O(L,X):L,ce=Z?{x:Math.floor(z.x*X),y:Math.floor(z.y*X),width:Math.floor(z.width*X),height:Math.floor(z.height*X)}:z;ne.drawImage(ie,ce.x,ce.y,ce.width,ce.height,0,0,ee.width,ee.height)},[ee,A.width,A.height,z.x,z.y,z.width,z.height,K,q,F,A.page._exportingOrRendering,Z]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(ee)},[ee]),ee||L},k=(A,L,z,q)=>{const K=_(A.clipSrc||""),[F,$]=G(K,"anonymous"),B=A.clipSrc?$:"loaded";(0,e.useImageLoader)(B,A.id+"-clip");const Y=a.default.useMemo(()=>{if(L&&F)return d()},[L,F]);return a.default.useLayoutEffect(()=>{var X;if(!F||!L||!L.width||!L.height||!F||!F.width||!F.height||!Y)return;const Z=d(),te=Math.max(A.width/F.width*z,A.height/F.height*z);Z.width=F.width*te,Z.height=F.height*te,(X=Z.getContext("2d"))===null||X===void 0||X.drawImage(F,0,0,Z.width,Z.height),Y.width=Math.max(L.width,1),Y.height=Math.max(L.height,1);const ee=Y.getContext("2d");ee&&(ee.save(),ee.drawImage(Z,0,0,L.width,L.height),h.default.Util.releaseCanvas(Z),ee.globalCompositeOperation="source-in",ee.drawImage(L,0,0,Y.width,Y.height),ee.restore())},[Y,L,F,A.width,A.height,z,...q]),A.clipSrc&&F?Y:L},M=d(),I=(0,o.observer)(({element:A})=>{const L=Math.min(30,A.width/4,A.height/4),z=a.default.useRef(null);return a.default.useEffect(()=>{const q=z.current;if(!q)return;const K=new h.default.Animation(F=>{q.rotate(((F==null?void 0:F.timeDiff)||0)/2)},q.getLayer());return K.start(),()=>{K.stop()}}),a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},a.default.createElement(u.Rect,{width:A.width,height:A.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:z,x:A.width/2,y:A.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),H=(0,o.observer)(({element:A})=>{const L="Can not load the video...",z=Math.max(10,Math.min(30,A.width/25));return a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,listening:!1,opacity:A.a.opacity,hideInExport:!A.showInExport},a.default.createElement(u.Rect,{width:A.width,height:A.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:L,fontSize:z,width:A.width,height:A.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Q=A=>{G=A};e.setImageLoaderHook=Q;const W=(A,L)=>{const z=a.default.useRef(),q=()=>{var K;(K=z.current)===null||K===void 0||K.call(z),z.current=void 0};a.default.useEffect(()=>q,[]),a.default.useLayoutEffect(()=>{A!=="loading"||z.current||(z.current=(0,p.incrementLoader)(`video ${L}`)),A!=="loading"&&q(),A==="failed"&&(0,p.triggerLoadError)(`video ${L}`)},[A])};e.useImageLoader=W;function U(A,L){for(var z=A.buffered,q=0;q<z.length;q++)if(L>=z.start(q)&&L<=z.end(q))return!0;return!1}function j(A,L,z){const q=a.default.useRef("loading"),K=a.default.useRef(null),[F,$]=a.default.useState(0),B=a.default.useRef(),Y=a.default.useRef(),X=a.default.useRef();return B.current===A&&Y.current===L&&X.current===z||(q.current="loading",K.current=void 0,B.current=A,Y.current=L,X.current=z),a.default.useLayoutEffect(function(){if(A){var Z=document.createElement("video");return Z.addEventListener("canplay",te),Z.addEventListener("error",ee),Z.crossOrigin=L,Z.src=A,function(){Z.removeEventListener("canplay",te),Z.removeEventListener("error",ee)}}function te(){q.current="loaded",K.current=Z,K.current.currentTime=0,$(Math.random()),K.current.removeEventListener("canplay",te)}function ee(ne){q.current="failed",K.current=void 0,$(Math.random())}},[A,L,z]),[K.current,q.current]}e.VideoElement=(0,o.observer)(({element:A,store:L})=>{var z;const[q,K]=a.default.useState(!1),F=a.default.useRef(null),$=a.default.useRef(null),[B,Y]=a.default.useState(!1),X=L.selectedShapes.indexOf(A)>=0,[Z,te]=a.default.useState(!1),[ee,ne]=j(A.src,"anonymous"),ie=L.activePage===A.page;(0,e.useImageLoader)(ne,A.id+"-video"),ee&&(ee.width=ee.videoWidth,ee.height=ee.videoHeight);const ce=ee||M;a.default.useEffect(()=>{ee&&L.history.ignore(()=>{A.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var xe;if(!ee)return;const Fe=ie&&(L.isPlaying||Z);if(!Fe)return void ee.pause();Fe&&(ee.currentTime=A.startTime*ee.duration,ee.play());const tt=new h.default.Animation(()=>{},(xe=F.current)===null||xe===void 0?void 0:xe.getLayer());tt.start();const mt=()=>{te(!1),ee.currentTime=A.startTime*ee.duration},Ot=()=>{ee.currentTime>=A.endTime*ee.duration&&(ee.pause(),ee.currentTime=A.startTime*ee.duration,te(!1))};return ee.addEventListener("ended",mt),ee.addEventListener("timeupdate",Ot),()=>{tt.stop(),ee.removeEventListener("ended",mt),ee.removeEventListener("timeupdate",Ot)}},[ee,Z,L.isPlaying,ie]),a.default.useEffect(()=>{ee&&(ee.volume=A.volume)},[ee,A.volume]);const Oe=a.default.useRef();a.default.useEffect(()=>{const xe=(0,l.autorun)(()=>{var Fe,tt;if(ee){const mt=(L.currentTime-A.page.startTime)%A.duration;(Math.abs(1e3*ee.currentTime-mt)>500||!L.isPlaying)&&(ee.currentTime=mt/1e3,L.isPlaying||(Oe.current=(0,p.incrementLoader)(`video ${A.id}`))),(tt=(Fe=F.current)===null||Fe===void 0?void 0:Fe.getLayer())===null||tt===void 0||tt.batchDraw()}});return()=>{xe(),Oe.current&&(Oe.current(),Oe.current=null)}},[L,ee]),a.default.useEffect(()=>{if(!ee)return;let xe=null;const Fe=()=>{var mt,Ot;Oe.current&&((Ot=(mt=F.current)===null||mt===void 0?void 0:mt.getLayer())===null||Ot===void 0||Ot.batchDraw(),Oe.current(),Oe.current=null),U(ee,ee.currentTime)||(xe&&(console.error("finish already exists"),xe()),xe=(0,p.incrementLoader)(`video ${A.id}`))},tt=()=>{xe&&(xe(),xe=null)};return ee.addEventListener("timeupdate",Fe),ee.addEventListener("canplay",tt),()=>{ee.removeEventListener("timeupdate",Fe),ee.removeEventListener("canplay",tt)}},[ee,A.id,p.incrementLoader]);let{cropX:Te,cropY:ae,cropWidth:de,cropHeight:ye}=A;ne!=="loaded"&&(Te=ae=0,de=ye=1);const ve=ce.width*de,re=ce.height*ye,oe=A.width/A.height;let be,Ee;const Ge=ve/re,et=A.type==="svg";et?(be=ve,Ee=re):oe>=Ge?(be=ve,Ee=ve/oe):(be=re*oe,Ee=re);const Ae={x:ce.width*Te,y:ce.height*ae,width:be,height:Ee},Ce=(z=A.cornerRadius)!==null&&z!==void 0?z:0;let ke=k(A,x(A,ce,Ae,L._elementsPixelRatio,Ce,q||A._cropModeEnabled||A.type==="svg"),L._elementsPixelRatio,[Ae,Ce,L._elementsPixelRatio]);const Ne=Math.max(A.width/be,A.height/Ee);a.default.useEffect(()=>{var xe;if(!A._cropModeEnabled)return;const Fe=(xe=F.current)===null||xe===void 0?void 0:xe.getStage();function tt(Ot){A._cropModeEnabled&&Ot.target!==$.current&&A.toggleCropMode(!1)}function mt(Ot){A._cropModeEnabled&&Ot.target.parentNode!==Fe.content&&A.toggleCropMode(!1)}return document.body.addEventListener("click",mt),Fe==null||Fe.on("click",tt),Fe==null||Fe.on("tap",tt),()=>{document.body.removeEventListener("click",mt),document.body.removeEventListener("touchstart",mt),Fe==null||Fe.off("click",tt),Fe==null||Fe.off("click",tt)}},[A._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(q||A._cropModeEnabled))return(0,m.applyFilter)(F.current,A),(0,l.autorun)(()=>{(0,m.applyFilter)(F.current,A)},{delay:100})},[ce,q,de,ye,A._cropModeEnabled]),a.default.useLayoutEffect(()=>{var xe;q||A._cropModeEnabled?(xe=F.current)===null||xe===void 0||xe.clearCache():(0,m.applyFilter)(F.current,A)},[q,A.width,A.height,A._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(F.current,A)},[A.shadowEnabled,A.shadowBlur,A.cornerRadius,A.shadowColor,A.shadowOffsetX,A.shadowOffsetY,A.shadowOpacity]);const Ze=a.default.useRef(null),ue=a.default.useRef(null),fe=a.default.useRef(null);a.default.useLayoutEffect(()=>{A._cropModeEnabled&&(ue.current.nodes([Ze.current]),fe.current.nodes([$.current]))},[A._cropModeEnabled]);const Ye=xe=>{Math.round(xe.target.x())>0&&(xe.target.x(0),xe.target.scaleX(1)),Math.round(xe.target.y())>0&&(xe.target.y(0),xe.target.scaleY(1));const Fe=xe.target.width()*xe.target.scaleX(),tt=xe.target.height()*xe.target.scaleY(),mt=Math.min(1,be/Fe),Ot=Math.min(1,Ee/tt),Lr=1-mt,Vr=Math.min(Lr,Math.max(0,Math.round(-xe.target.x())/Fe)),Or=1-Ot,Rn=Math.min(Or,Math.max(0,Math.round(-xe.target.y())/tt));xe.target.setAttrs({x:-Vr*ce.width,y:-Rn*ce.height,scaleX:1,scaleY:1}),A.set({cropX:Vr,cropY:Rn,cropWidth:mt,cropHeight:Ot})},_e=()=>{A.type!=="svg"&&A.contentEditable&&setTimeout(()=>{A.toggleCropMode(!0)})},De=ne==="loading",Le=ne==="failed",we=!De&&!Le,Qe=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Se=we?A.a.opacity:0;(0,v.useFadeIn)(F,Se);const Ke=A.selectable||L.role==="admin",Mr=(0,y.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,De&&a.default.createElement(I,{element:A}),Le&&a.default.createElement(H,{element:A}),a.default.createElement(u.Image,{ref:F,name:"element",id:A.id,image:ce,x:A.x,y:A.y,width:A.width||1,height:A.height||1,rotation:A.rotation,opacity:Se,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur,shadowOffsetX:A.shadowOffsetX,shadowOffsetY:A.shadowOffsetY,shadowColor:A.shadowColor,shadowOpacity:A.shadowOpacity,customCrop:Ae,listening:Ke,cropX:Ae.x,cropY:Ae.y,cropWidth:Ae.width,cropHeight:Ae.height,draggable:Mr?A.draggable&&X:A.draggable,preventDefault:!Mr||X,hideInExport:!A.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:xe=>{A.set({x:xe.target.x(),y:xe.target.y()})},onDragEnd:xe=>{A.set({x:xe.target.x(),y:xe.target.y()})},onDblClick:_e,onDblTap:_e,onTransformStart:()=>{K(!0),Qe.current={cropX:A.cropX,cropY:A.cropY,cropWidth:A.cropWidth,cropHeight:A.cropHeight}},onTransform:xe=>{var Fe;const tt=xe.currentTarget,mt=Math.abs(tt.scaleX()-1)<1e-7?1:tt.scaleX(),Ot=Math.abs(tt.scaleY()-1)<1e-7?1:tt.scaleY();tt.scaleX(1),tt.scaleY(1);const Lr=(Fe=xe.target.getStage())===null||Fe===void 0?void 0:Fe.findOne("Transformer"),Vr=1-be/ce.width,Or=Math.min(Vr,Math.max(0,A.cropX)),Rn=1-Ee/ce.height,mn=Math.min(Rn,Math.max(0,A.cropY)),yn=Lr.getActiveAnchor(),Zn=!(yn.indexOf("middle")>=0||yn.indexOf("center")>=0),Ei=!Zn&&mt<1&&Qe.current.cropHeight>Ee/ce.height;let Ie=Zn?A.cropWidth:A.cropWidth*mt;Ei&&(Ie=A.cropWidth);const rt=!Zn&&Ot<1&&Qe.current.cropWidth>be/ce.width;let pt=Zn?A.cropHeight:A.cropHeight*Ot;rt&&(pt=A.cropHeight),et&&(Ie=A.cropWidth,pt=A.cropHeight),A.set({cropX:Or,cropY:mn,x:tt.x(),y:tt.y(),width:tt.width()*mt,height:tt.height()*Ot,rotation:xe.target.rotation(),cropWidth:Math.min(Ie,1-Or),cropHeight:Math.min(pt,1-mn)})},onTransformEnd:xe=>{const Fe=xe.currentTarget;A.set({width:Fe.width(),height:Fe.height(),x:Fe.x(),y:Fe.y(),rotation:xe.target.rotation(),cropWidth:be/ce.width,cropHeight:Ee/ce.height}),K(!1)}}),a.default.createElement(u.Rect,{x:A.x,y:A.y,width:Math.max(A.width-A.borderSize,0),height:Math.max(A.height-A.borderSize,0),opacity:Se,offsetX:-A.borderSize/2,offsetY:-A.borderSize/2,stroke:A.borderColor,strokeWidth:A.borderSize,listening:!1,visible:!!A.borderSize,rotation:A.rotation,cornerRadius:Math.max(0,Ce-A.borderSize),hideInExport:!A.showInExport}),!Z&&!L.isPlaying&&a.default.createElement(u.Image,{image:T,x:A.x+A.width/2-15/L.scale,y:A.y+A.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!0)}}),Z&&!L.isPlaying&&a.default.createElement(u.Image,{image:C,x:A.x+A.width/2-15/L.scale,y:A.y+A.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!1)}}),A._cropModeEnabled&&a.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/L.scale,y:-window.innerWidth/L.scale,width:window.innerWidth/L.scale*3,height:window.innerWidth/L.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:ke,x:A.x,y:A.y,width:A.width,height:A.height,rotation:A.rotation,shadowEnabled:A.shadowEnabled,shadowBlur:A.shadowBlur}),a.default.createElement(u.Group,{x:A.x,y:A.y,rotation:A.rotation,scaleX:Ne,scaleY:Ne},a.default.createElement(u.Image,{image:ce,ref:$,opacity:.4,draggable:!0,x:-A.cropX*ce.width,y:-A.cropY*ce.height,onDragMove:Ye,onTransform:Ye}),a.default.createElement(u.Transformer,{ref:fe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,Fe)=>Fe.width<5||Fe.height<5?xe:Fe,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:be,height:Ee,ref:Ze,listening:!1,onTransform:xe=>{xe.target.x()<-A.cropX*ce.width-1e-9&&(xe.target.x(-A.cropX*ce.width),xe.target.scaleX(1)),xe.target.y()<-A.cropY*ce.height-1e-9&&(xe.target.y(-A.cropY*ce.height),xe.target.scaleY(1));const Fe=Math.min(1,Math.max(0,A.cropX+xe.target.x()/ce.width)),tt=Math.min(1,Math.max(0,xe.target.y()/ce.height+A.cropY)),mt=xe.target.width()*xe.target.scaleX(),Ot=xe.target.height()*xe.target.scaleY(),Lr=Math.min(1-Fe,mt/ce.width),Vr=Math.min(1-tt,Ot/ce.height),Or=xe.target.getAbsolutePosition(xe.target.getParent().getParent());xe.target.scale({x:1,y:1}),xe.target.position({x:0,y:0}),A.set({x:Or.x,y:Or.y,cropX:Fe,cropY:tt,cropWidth:Lr,cropHeight:Vr,width:Math.min(mt*Ne,ce.width*(1-Fe)*Ne),height:Math.min(Ot*Ne,ce.height*(1-tt)*Ne)})}}),a.default.createElement(u.Transformer,{ref:ue,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,Fe)=>Fe.width<5||Fe.height<5?xe:Fe,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(B||X)&&a.default.createElement(w.Highlighter,{element:A}))})})(fS);var dS={},Qp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:b,height:m,cornerRadius:v})=>{if(v>0){const y=Math.min(v,b/2,m/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${b-y} 0 A ${y} ${y} 0 0 1 ${b} ${y} L ${b} ${m-y} A ${y} ${y} 0 0 1 ${b-y} ${m} L ${y} ${m} A ${y} ${y} 0 0 1 0 ${m-y} Z`}return`M 0 0 L ${b} 0 L ${b} ${m} L 0 ${m} Z`};e.rectData=t;const r=({width:b,height:m})=>`M ${b/2} 0 L ${b} ${m} L 0 ${m} Z`;e.triangleData=r;const n=({width:b,height:m})=>`M 0 0 L ${b} 0 L 0 ${m} Z`;e.rightTriangleData=n;const i=({width:b,height:m})=>`M ${b/2} ${m/2} m -${b/2}, 0 a ${b/2},${m/2} 0 1,0 ${b},0 a ${b/2},${m/2} 0 1,0 -${b},0`;function a({width:b,height:m}){const v=b/2,y=m/2,d=b/2,g=m/2,_=d/2,T=g/2;let C="",P=Math.PI/5;for(let O=0;O<10;O++){const x=O%2==0?g:T,k=v+(O%2==0?d:_)*Math.sin(O*P),M=y-x*Math.cos(O*P);O===0?C=`M ${k} ${M}`:C+=` L ${k} ${M}`}return C+" Z"}function o({width:b,height:m}){const v=b/2,y=m/2;return`M ${v} 0 L ${b} ${y} L ${v} ${m} L 0 ${y} Z`}function l({width:b,height:m}){const v=b/2,y=m/2,d=b/2,g=m/2;let _="",T=2*Math.PI/5;for(let C=0;C<5;C++){const P=g,O=v+d*Math.sin(C*T),x=y-P*Math.cos(C*T);C===0?_=`M ${O} ${x}`:_+=` L ${O} ${x}`}return _+" Z"}function u({width:b,height:m}){const v=b/2,y=m/2,d=b/2,g=m/2;let _="",T=2*Math.PI/6;for(let C=0;C<6;C++){const P=g,O=v+d*Math.sin(C*T),x=y-P*Math.cos(C*T);C===0?_=`M ${O} ${x}`:_+=` L ${O} ${x}`}return _+" Z"}function f({path:b,aspectRatio:m,width:v,height:y}){return{path:b,scaleX:v/m.width,scaleY:y/m.height}}function h({width:b,height:m}){const v=.1*Math.min(b,m),y=.2*b,d=.2*m,g=.5*b;let _=`M ${v},0`;return _+=" H "+(b-v),_+=` A ${v},${v} 0 0 1 ${b},${v}`,_+=" V "+(m-v-d),_+=` A ${v},${v} 0 0 1 ${b-v},${m-d}`,_+=` H ${g+y/2}`,_+=` L ${g},${m}`,_+=` L ${g-y/2},${m-d}`,_+=` H ${v}`,_+=` A ${v},${v} 0 0 1 0,${m-v-d}`,_+=` V ${v}`,_+=` A ${v},${v} 0 0 1 ${v},0`,_+=" Z",_}function E({width:b,height:m}){const v=.3*b,y=.3*m,d=b/2,g=m/2,_=d-v/2,T=d+v/2,C=g-y/2,P=g+y/2;let O=`M ${_},0 `;return O+=`H ${T} `,O+=`V ${C} `,O+=`H ${b} `,O+=`V ${P} `,O+=`H ${T} `,O+=`V ${m} `,O+=`H ${_} `,O+=`V ${P} `,O+="H 0 ",O+=`V ${C} `,O+=`H ${_} `,O+="V 0 ",O+="Z",O}function w(b){return e.TYPES[b]||e.rectData}function p(b,m){const{width:v,height:y,fill:d,stroke:g,strokeWidth:_,dash:T}=b,C=(T||[]).map(M=>M*_);let P=m(b),O=1,x=1;typeof P!="string"&&(O=P.scaleX,x=P.scaleY,P=P.path);const k=`clip-${b.id||Math.random()}`;return`
235
- <svg xmlns="http://www.w3.org/2000/svg" width="${v}" height="${y}">
236
- <defs>
237
- <clipPath id="${k}">
238
- <path d="${P}" />
239
- </clipPath>
240
- </defs>
241
-
242
- <!-- Path for the fill -->
243
- <path d="${P}" fill="${d}" transform="scale(${O}, ${x})"/>
244
-
245
- <!-- Path for the stroke, clipped by the star path -->
246
- <path d="${P}" fill="none" stroke="${g}" stroke-width="${2*_}" clip-path="url(#${k})" transform="scale(${O}, ${x})" stroke-dasharray="${C.join(" ")}"/>
247
- </svg>
248
- `}function S(b){const{subType:m}=b,v=w(m);return v?p(b,v):(console.error(`Polotno error: Can not convert ${b.subType} figure to svg.`),(0,e.rectData)(b))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=h,e.crossPath=E,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:h,cross:E,arc:({width:b,height:m})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:b,height:m}),cloud:({width:b,height:m})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:b,height:m}),rightArrow:({width:b,height:m})=>{const v=.6*b;return`M 0 ${m/4} L ${v} ${m/4} L ${v} 0 L ${b} ${m/2} L ${v} ${m} L ${v} ${.75*m} L 0 ${.75*m} Z`},leftArrow:({width:b,height:m})=>{const v=.4*b;return`M ${b} ${m/4} L ${v} ${m/4} L ${v} 0 L 0 ${m/2} L ${v} ${m} L ${v} ${.75*m} L ${b} ${.75*m} Z`},downArrow:({width:b,height:m})=>{const v=.6*m;return`M ${b/4} 0 L ${b/4} ${v} L 0 ${v} L ${b/2} ${m} L ${b} ${v} L ${.75*b} ${v} L ${.75*b} 0 Z`},upArrow:({width:b,height:m})=>{const v=.4*m;return`M ${b/4} ${m} L ${b/4} ${v} L 0 ${v} L ${b/2} 0 L ${b} ${v} L ${.75*b} ${v} L ${.75*b} ${m} Z`},asterisk1:({width:b,height:m})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:b,height:m}),asterisk2:({width:b,height:m})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:b,height:m}),bookmark:({width:b,height:m})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:b,height:m}),butterfly:({width:b,height:m})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:b,height:m}),cylinder:({width:b,height:m})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:b,height:m}),diamond2:({width:b,height:m})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:b,height:m}),door:({width:b,height:m})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:b,height:m}),drop1:({width:b,height:m})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:b,height:m}),drop2:({width:b,height:m})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:b,height:m}),explosion:({width:b,height:m})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:b,height:m}),flag:({width:b,height:m})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:b,height:m}),flower:({width:b,height:m})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:b,height:m}),frame:({width:b,height:m})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:b,height:m}),heart1:({width:b,height:m})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:b,height:m}),home:({width:b,height:m})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:b,height:m}),home2:({width:b,height:m})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:b,height:m}),hourglass:({width:b,height:m})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:b,height:m}),house:({width:b,height:m})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:b,height:m}),keyhole:({width:b,height:m})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:b,height:m}),kiss:({width:b,height:m})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:b,height:m}),leaf:({width:b,height:m})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:b,height:m}),lightning1:({width:b,height:m})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:b,height:m}),lightning2:({width:b,height:m})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:b,height:m}),magnet:({width:b,height:m})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:b,height:m}),mithosis:({width:b,height:m})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:b,height:m}),orangeRicky:({width:b,height:m})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:b,height:m}),party:({width:b,height:m})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:b,height:m}),pillow:({width:b,height:m})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:b,height:m}),polygon:({width:b,height:m})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:b,height:m}),rainbow:({width:b,height:m})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:b,height:m}),rhodeIsland:({width:b,height:m})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:b,height:m}),shell:({width:b,height:m})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:b,height:m}),shield1:({width:b,height:m})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:b,height:m}),shield2:({width:b,height:m})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:b,height:m}),skewedRectangle:({width:b,height:m})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:b,height:m}),softFlower:({width:b,height:m})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:b,height:m}),softStar:({width:b,height:m})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:b,height:m}),stairs1:({width:b,height:m})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:b,height:m}),stairs2:({width:b,height:m})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:b,height:m}),teewee:({width:b,height:m})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:b,height:m}),blob1:({width:b,height:m})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:b,height:m}),blob10:({width:b,height:m})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:b,height:m}),blob11:({width:b,height:m})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:b,height:m}),blob12:({width:b,height:m})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:b,height:m}),blob13:({width:b,height:m})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:b,height:m}),blob14:({width:b,height:m})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:b,height:m}),blob15:({width:b,height:m})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:b,height:m}),blob16:({width:b,height:m})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:b,height:m}),blob17:({width:b,height:m})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:b,height:m}),blob18:({width:b,height:m})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:b,height:m}),blob19:({width:b,height:m})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:b,height:m}),blob2:({width:b,height:m})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:b,height:m}),blob20:({width:b,height:m})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:b,height:m}),blob21:({width:b,height:m})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:b,height:m}),blob22:({width:b,height:m})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:b,height:m}),blob23:({width:b,height:m})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:b,height:m}),blob24:({width:b,height:m})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:b,height:m}),blob25:({width:b,height:m})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:b,height:m}),blob26:({width:b,height:m})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:b,height:m}),blob27:({width:b,height:m})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:b,height:m}),blob28:({width:b,height:m})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:b,height:m}),blob29:({width:b,height:m})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:b,height:m}),blob3:({width:b,height:m})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:b,height:m}),blob30:({width:b,height:m})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:b,height:m}),blob31:({width:b,height:m})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:b,height:m}),blob32:({width:b,height:m})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:b,height:m}),blob4:({width:b,height:m})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:b,height:m}),blob5:({width:b,height:m})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:b,height:m}),blob6:({width:b,height:m})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:b,height:m}),blob7:({width:b,height:m})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:b,height:m}),blob8:({width:b,height:m})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:b,height:m}),blob9:({width:b,height:m})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:b,height:m})},e.subTypeToPathDataFunc=w,e.figureToSvg=S})(Qp);(function(e){var t=me&&me.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(Je),n=bi,i=Aa,a=Qp,o=Tl,l=To,u=Yc,f={};e.FigureElement=(0,n.observer)(({element:h,store:E})=>{const w=h.selectable||E.role==="admin",p=(0,l.isTouchDevice)(),[S,b]=r.default.useState(!1),m=E.selectedShapes.indexOf(h)>=0,v=Math.min(h.strokeWidth,h.width/2,h.height/2),y=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),d=(0,u.useColor)(h,h.a.fill,"fill"),g=Object.assign(Object.assign({width:h.a.width,height:h.a.height},d),{cornerRadius:y,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!p||m,hideInExport:!h.showInExport}),_=(0,u.useColor)(h,h.stroke,"stroke"),T=Object.assign(Object.assign({visible:v>0,x:v/2,y:v/2,width:h.a.width-v,height:h.a.height-v},_),{strokeWidth:v,cornerRadius:Math.max(0,y-v),dash:h.dash.map(x=>x*v),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),C=(P=h.subType,f[P]||(f[P]=(O=(0,a.subTypeToPathDataFunc)(P),(0,n.observer)(({element:x,fillProps:k,strokeProps:M})=>{let I=O({width:x.a.width,height:x.a.height,cornerRadius:x.cornerRadius}),H=1,G=1;typeof I!="string"&&(H=I.scaleX,G=I.scaleY,I=I.path);const Q=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:x.width,height:x.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},k,{ref:Q,data:I,scaleX:H,scaleY:G})),r.default.createElement(i.Group,{clipFunc:W=>{const U=Q.current;if(U){var j=U.dataArray;W.beginPath();for(var A=0;A<j.length;A++){var L=j[A].command,z=j[A].points;switch(L){case"L":W.lineTo(z[0],z[1]);break;case"M":W.moveTo(z[0],z[1]);break;case"C":W.bezierCurveTo(z[0],z[1],z[2],z[3],z[4],z[5]);break;case"Q":W.quadraticCurveTo(z[0],z[1],z[2],z[3]);break;case"A":var q=z[0],K=z[1],F=z[2],$=z[3],B=z[4],Y=z[5],X=z[6],Z=z[7],te=F>$?F:$,ee=F>$?1:F/$,ne=F>$?$/F:1;W.translate(q,K),W.rotate(X),W.scale(ee,ne),W.arc(0,0,te,B,B+Y,1-Z),W.scale(1/ee,1/ne),W.rotate(-X),W.translate(-q,-K);break;case"z":W.closePath()}}}},scaleX:H,scaleY:G},r.default.createElement(i.Path,Object.assign({},M,{x:0,y:0,data:I,strokeWidth:2*M.strokeWidth,dash:M.dash.map(W=>W)}))))}))),f[P]||i.Group);var P,O;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:h.id,x:h.a.x,y:h.a.y,rotation:h.a.rotation,opacity:h.a.opacity,listening:w,draggable:p?h.draggable&&m:h.draggable,name:"element",onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},onDragMove:x=>{h.set({x:x.target.x(),y:x.target.y()})},onDragEnd:x=>{h.set({x:x.target.x(),y:x.target.y()})},onTransform:x=>{const k=x.target.scale();x.target.scaleX(1),x.target.scaleY(1),h.set({width:h.width*k.x,height:h.height*k.y,x:x.target.x(),y:x.target.y(),rotation:x.target.rotation()})}},r.default.createElement(C,{element:h,fillProps:g,strokeProps:T})),S&&!m&&r.default.createElement(o.Highlighter,{element:h}))})})(dS);(function(e){var t=me&&me.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(Je),n=bi,i=Zy,a=d2,o=nS,l=cS,u=fS,f=dS,h=Aa,E=Kn,w=(0,n.observer)(m=>{const{element:v,store:y}=m,{children:d}=v,g=v.selectable||y.role==="admin";return r.default.createElement(h.Group,{opacity:v.opacity,listening:g,hideInExport:!v.showInExport},d.map(_=>r.default.createElement(b,Object.assign({},m,{key:_.id,store:y,element:_}))))}),p={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:w};function S(m,v){p[m]=v}e.registerShapeComponent=S;const b=(0,n.observer)(m=>{let v=p[m.element.type];return m.element.type==="text"&&E.flags.htmlRenderEnabled&&(v=o.HTMLElement),m.element.visible?v?r.default.createElement(v,Object.assign({},m)):(console.error("Can not find component for "+m.element.type),null):null});e.default=b})(W9);var hS={};(function(e){function t(r,n,i="scale"){const a=n.width/n.height;let o,l;a>=r.width/r.height?(o=r.width,l=r.width/a):(o=r.height*a,l=r.height);let u=0,f=0;return i==="left-top"?(u=0,f=0):i==="left-middle"?(u=0,f=(r.height-l)/2):i==="left-bottom"?(u=0,f=r.height-l):i==="center-top"?(u=(r.width-o)/2,f=0):i==="center-middle"?(u=(r.width-o)/2,f=(r.height-l)/2):i==="center-bottom"?(u=(r.width-o)/2,f=r.height-l):i==="right-top"?(u=r.width-o,f=0):i==="right-middle"?(u=r.width-o,f=(r.height-l)/2):i==="right-bottom"?(u=r.width-o,f=r.height-l):i==="scale"?(u=0,f=0,o=r.width,l=r.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:u,cropY:f,cropWidth:o,cropHeight:l}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=void 0,e.getCrop=t})(hS);var $g={},Gg={},w_;function sj(){return w_||(w_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const t=S2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const r=()=>e.URL+"/api";e.getAPI=r;const n={},i=(d,g)=>{n[d]||(n[d]=!0,console.error(g))},a=`API for iconscout is provided as a demonstration.
249
- For production usage you have to use your own API endpoint.
250
- https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
251
- https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${g}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:g=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${g}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:g=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:g=1,sizeQuery:_})=>`${(0,e.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${g}&KEY=${(0,t.getKey)()}`};const o=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=o;const l=d=>{return`${e.URL}/google-fonts-previews/black/${g=d,_=" ",T="-",g.replace(new RegExp(_,"g"),T)}.png`;var g,_,T};e.getGoogleFontImage=l;const u=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=u;const f=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=f;const h=d=>e.URLS.templateList(d);e.templateList=h;const E=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=E;const w=d=>e.URLS.unsplashList(d);e.unsplashList=w;const p=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=p;const S=d=>e.URLS.svgapiList(d);e.svgapiList=S;const b=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=b;const m=d=>e.URLS.iconscoutList(d);e.iconscoutList=m;const v=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=v;const y=(d,g)=>{e.URLS[d]=g};e.setAPI=y}(Gg)),Gg}var S_;function S2(){return S_||(S_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(T,C,P,O){O===void 0&&(O=P);var x=Object.getOwnPropertyDescriptor(C,P);x&&!("get"in x?!C.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return C[P]}}),Object.defineProperty(T,O,x)}:function(T,C,P,O){O===void 0&&(O=P),T[O]=C[P]}),r=me&&me.__setModuleDefault||(Object.create?function(T,C){Object.defineProperty(T,"default",{enumerable:!0,value:C})}:function(T,C){T.default=C}),n=me&&me.__importStar||function(T){if(T&&T.__esModule)return T;var C={};if(T!=null)for(var P in T)P!=="default"&&Object.prototype.hasOwnProperty.call(T,P)&&t(C,T,P);return r(C,T),C};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Xi),a=sj(),o=Kn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const h=5,E=3e3,w="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",p="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",S="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let m=window.location.origin;const v=navigator.userAgent.indexOf("Headless")>-1,y=navigator.userAgent.indexOf("Electron")>-1;m==="file://"&&v&&(m="headless"),m==="file://"&&y&&(m="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${m}" here: https://polotno.com/cabinet`;async function g(T){for(let C=0;C<h;C++)try{const P=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:T,site:location.host})});if(!T)return console.warn(w),!1;if(P.status!==200){await new Promise(x=>setTimeout(x,E));continue}const O=await P.json();return O.is_valid||console.warn(p),O.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,E))}return console.error(S),!0}async function _(T,C){u=T,await g(T)&&!C||l()}e.isKeyPaid=g,e.validateKey=_}($g)),$g}var Jp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const t=({px:a,unit:o="px",dpi:l})=>{switch(o){case"pt":default:return a;case"mm":return a/(l/25.4);case"cm":return a/(l/2.54);case"in":return a/l}};e.pxToUnit=t;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,e.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));e.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,e.pxToUnit)({px:1,unit:l,dpi:o});e.unitToPx=n;const i=a=>{const o=parseFloat((0,e.pxToUnit)(a).toFixed(1));switch(a.unit){case"pt":return`${Math.round(o)}pt`;case"mm":return`${o}mm`;case"cm":return`${o}cm`;case"in":return`${o}in`;default:return`${Math.round(o)}px`}};e.pxToUnitString=i})(Jp);(function(e){var t=me&&me.__rest||function(U,j){var A={};for(var L in U)Object.prototype.hasOwnProperty.call(U,L)&&j.indexOf(L)<0&&(A[L]=U[L]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var z=0;for(L=Object.getOwnPropertySymbols(U);z<L.length;z++)j.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(U,L[z])&&(A[L[z]]=U[L[z]])}return A},r=me&&me.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(Je),i=bi,a=Xi,o=Aa,l=r(Wp),u=r(wi),f=r(W9),h=w2,E=d2,w=hS,p=S2(),S=nu,b=Jp,m=Kn,v=To,y=u.default.DD._drag;window.removeEventListener("mousemove",y),u.default.DD._drag=function(U){(0,a.runInAction)(()=>{y.call(this,U)})},window.addEventListener("mousemove",u.default.DD._drag);const d=new u.default.Group;d.add(new u.default.Rect({width:20,height:20,fill:"white"})),d.add(new u.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const g=d.toCanvas({pixelRatio:2,width:20,height:20}),_={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:U=>{U.hasName("rotater")&&U.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:g,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},T=U=>{Object.assign(_,U)};e.setTransformerStyle=T;const C={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}};function P(U,j){C[U]=C[U]||j,Object.assign(C[U],j)}e.registerTransformerAttrs=P;const O=U=>n.default.createElement(o.Rect,Object.assign({},U,{preventDefault:!1})),x=U=>{var{url:j}=U,A=t(U,["url"]);const[L,z]=(0,l.default)(j,"anonymous"),q=L?(0,w.getCrop)(L,{width:A.width,height:A.height},"center-middle"):{};return(0,E.useImageLoader)(z,"background"),n.default.createElement(o.Image,Object.assign({image:L},A,q))},k=U=>n.default.createElement(o.Rect,Object.assign({},U)),M=U=>{const{background:j,scale:A,borderColor:L}=U,z=t(U,["background","scale","borderColor"]),q=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(j),[j]),K=n.default.useMemo(()=>{const F=document.createElement("canvas"),$=30;F.width=60,F.height=60;const B=F.getContext("2d");return B&&(B.fillStyle="black",B.fillRect($,0,$,$),B.fillRect(0,$,$,$)),F},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:K},z,{opacity:.1,hideInExport:!0})),q?n.default.createElement(k,Object.assign({fill:j},z)):n.default.createElement(x,Object.assign({url:j},z)))},I=(0,i.observer)(({selection:U})=>U.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(U.x1,U.x2),y:Math.min(U.y1,U.y2),width:Math.abs(U.x1-U.x2),height:Math.abs(U.y1-U.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),H=(0,i.observer)(({x:U,y:j,width:A,height:L,rotation:z,anchor:q,store:K})=>{const F=(0,S.getClientRect)({x:U,y:j,width:A,height:L,rotation:u.default.Util.radToDeg(z)});if(q===void 0)return null;const $=(L/2+70)*Math.cos(z-Math.PI/2),B=(L/2+70)*Math.sin(z-Math.PI/2),Y=(0,b.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:A/K.scale,precious:K.unit==="px"?0:1})+" x "+(0,b.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:L/K.scale,precious:K.unit==="px"?0:1})+(K.unit==="px"?"":" "+K.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(F.minX+F.maxX)/2+$,y:(F.minY+F.maxY)/2+B,offsetX:14,offsetY:14,visible:q==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(z)).toString()+"°"})),n.default.createElement(o.Label,{x:(F.minX+F.maxX)/2,y:F.maxY+20,visible:q!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Y})))}),G=(0,i.observer)(({elements:U,store:j})=>{const A=U.filter(z=>z.alwaysOnTop),L=U.filter(z=>!z.alwaysOnTop).concat(A);return n.default.createElement(n.default.Fragment,null,L.map(z=>n.default.createElement(f.default,{key:z.id,store:j,element:z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Q=null;const W=U=>{Q=U};e.registerNextDomDrop=W,e.default=(0,i.observer)(({store:U,page:j,width:A,height:L,pageControlsEnabled:z,backColor:q,pageBorderColor:K,activePageBorderColor:F,components:$,bleedColor:B,altCloneEnabled:Y})=>{const X=U.bleedVisible?j.bleed:0,Z=j.computedWidth+2*X,te=j.computedHeight+2*X,ee=(A-Z*U.scale)/2,ne=(L-te*U.scale)/2,ie=n.default.useRef(null),ce=n.default.useRef(null),Oe=n.default.useRef(null),Te=z==null||z,[ae,de]=n.default.useState(null),[ye,ve]=n.default.useState({}),re=U.selectedElements.find(_e=>_e._cropModeEnabled),oe=U.selectedShapes.filter(_e=>!_e.resizable).length>0,be=U.selectedShapes.filter(_e=>!_e.draggable).length>0,Ee=U.selectedElements.filter(_e=>!_e.visible).length>0;n.default.useLayoutEffect(()=>{var _e,De,Le;if(!ie.current)return;const we=ie.current.getStage(),Qe=U.selectedShapes.map(Ke=>Ke._cropModeEnabled?null:we.findOne("#"+Ke.id)).filter(Ke=>Ke),Se=U.selectedElements.length===1&&((_e=U.selectedElements[0])===null||_e===void 0?void 0:_e.type)||"many";C[Se]?(ie.current.setAttrs(Object.assign(Object.assign({},_),C[Se])),Se!=="svg"&&Se!=="image"||U.selectedElements[0].keepRatio||ie.current.setAttrs({enabledAnchors:_.enabledAnchors}),Se==="text"&&m.flags.textVerticalResizeEnabled&&ie.current.setAttrs({enabledAnchors:(De=C.text.enabledAnchors)===null||De===void 0?void 0:De.concat(["bottom-center"])})):ie.current.setAttrs(_),oe&&ie.current.enabledAnchors([]),be&&ie.current.rotateEnabled(!1),Qe.find(Ke=>Ke==null?void 0:Ke.isDragging())&&Qe.forEach(Ke=>{Ke.isDragging()||Ke==null||Ke.startDrag()}),ie.current.nodes(Qe),(Le=ie.current.getLayer())===null||Le===void 0||Le.batchDraw()},[U.selectedElements,re,oe,Ee,be]);const Ge=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),et=n.default.useRef(!1),Ae=(0,v.isTouchDevice)(),Ce=(0,a.action)(_e=>{var De,Le;if(Ae)return;et.current=!1;const we=_e.target.findAncestor(".elements-container"),Qe=_e.target.findAncestor("Transformer"),Se=_e.target.findAncestor(".page-abs-container");if(we||Qe||Se)return;const Ke=(De=_e.target.getStage())===null||De===void 0?void 0:De.getPointerPosition();Ke&&(Ge.visible=!0,Ge.x1=Ke.x,Ge.y1=Ke.y,Ge.x2=Ke.x,Ge.y2=Ke.y,((Le=_e.target.getStage())===null||Le===void 0?void 0:Le.getPointersPositions().length)>=2&&(Ge.visible=!1))});n.default.useEffect(()=>{const _e=(0,a.action)(Le=>{var we,Qe;if(!Ge.visible)return;(we=ce.current)===null||we===void 0||we.setPointersPositions(Le);let Se=((Qe=ce.current)===null||Qe===void 0?void 0:Qe.getPointerPosition())||{x:Ge.x2,y:Ge.y2};Ge.x2=Se.x,Ge.y2=Se.y}),De=(0,a.action)(()=>{if(!Ge.visible||!ce.current)return;const Le=ce.current.findOne(".selection"),we=Le?Le.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const Qe=[];ce.current.find(".element").forEach(Ke=>{const Mr=Ke.getClientRect(),xe=U.getElementById(Ke.id()),Fe=xe==null?void 0:xe.draggable,tt=xe==null?void 0:xe.selectable;u.default.Util.haveIntersection(we,Mr)&&Fe&&tt&&Qe.push(xe.top.id)});const Se=[...new Set(Qe)];U.selectElements(Se)}Ge.visible=!1,et.current=!0});return window.addEventListener("mousemove",_e),window.addEventListener("touchmove",_e),window.addEventListener("mouseup",De),window.addEventListener("touchend",De),()=>{window.removeEventListener("mousemove",_e),window.removeEventListener("touchmove",_e),window.removeEventListener("mouseup",De),window.removeEventListener("touchend",De)}},[]);const ke=_e=>{if(U.activePage!==j&&j.select(),et.current)return;const De=_e.evt.ctrlKey||_e.evt.metaKey||_e.evt.shiftKey,Le=_e.target.findAncestor(".elements-container"),we=_e.target.findAncestor(".page-abs-container"),Qe=_e.target.findAncestor("Transformer");if(!(De||Le||Qe||we))return void U.selectElements([]);const Se=_e.target.findAncestor(".element",!0),Ke=U.getElementById(Se==null?void 0:Se.id()),Mr=Ke==null?void 0:Ke.top,xe=Mr==null?void 0:Mr.id,Fe=U.selectedElementsIds.indexOf(xe)>=0;xe&&De&&!Fe?U.selectElements(U.selectedElementsIds.concat([xe])):xe&&De&&Fe?U.selectElements(U.selectedElementsIds.filter(tt=>tt!==xe)):!xe||De||Fe||U.selectElements([xe])};(0,h.useSnap)(ie,U);const Ne=U.activePage===j,Ze=$==null?void 0:$.PageControls,ue=$==null?void 0:$.Tooltip,fe=1/U.scale,Ye=0/U.scale;return n.default.createElement("div",{ref:Oe,onDragOver:_e=>_e.preventDefault(),onDrop:_e=>{if(_e.preventDefault(),!ce.current)return;ce.current.setPointersPositions(_e);const De=ce.current.findOne(".elements-container").getRelativePointerPosition(),Le=ce.current.getPointerPosition(),we=ce.current.getAllIntersections(Le).map(Ke=>Ke.findAncestor(".element",!0)).filter(Boolean),Qe=[...new Set(we.reverse())].map(Ke=>U.getElementById(Ke.id())),Se=Qe[0];Q&&(Q(De,Se,{elements:Qe,page:j}),Q=null)},style:{position:"relative",width:A+"px"},className:"polotno-page-container"+(Ne?" active-page":"")},n.default.createElement(o.Stage,{ref:ce,width:Math.min(A,4*window.innerWidth),height:Math.min(L,4*window.innerHeight),onClick:ke,onTap:ke,onMouseDown:Ce,onMouseMove:_e=>{if(!_e.evt.altKey&&ae)return void de(null);if(!_e.evt.altKey)return;const De=_e.target.findAncestor(".element",!0),Le=De==null?void 0:De.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(Le))return;const we=(0,S.getTotalClientRect)(U.selectedShapes),Qe=Le?U.getElementById(Le):{x:0,y:0,width:j.computedWidth,height:j.computedHeight,rotation:0},Se=(0,S.getClientRect)(Qe),Ke=[];we.minX>Se.maxX&&Ke.push({distance:we.minX-Se.maxX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),we.maxX<Se.minX&&Ke.push({distance:Se.minX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),we.minY>Se.maxY&&Ke.push({box1:we,box2:Se,distance:we.minY-Se.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]}),we.maxY<Se.minY&&Ke.push({box1:we,box2:Se,distance:Se.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),we.minX>=Se.minX&&we.maxX<=Se.maxX&&we.minY>=Se.minY&&we.maxY<=Se.maxY&&(Ke.push({distance:we.minX-Se.minX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),Ke.push({distance:Se.maxX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),Ke.push({box1:we,box2:Se,distance:we.minY-Se.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),Ke.push({box1:we,box2:Se,distance:Se.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]})),JSON.stringify(ae)!==JSON.stringify(Ke)&&de(Ke)},onDragStart:_e=>{var De;const Le=_e.target.findAncestor(".element",!0);if(Le){const we=U.getElementById(Le==null?void 0:Le.id()),Qe=we==null?void 0:we.top,Se=Qe==null?void 0:Qe.id;!(U.selectedElementsIds.indexOf(Se)>=0)&&Se&&(U.selectElements([Se]),_e.target.stopDrag(),_e.target.startDrag(_e),(De=ie.current)===null||De===void 0||De.startDrag(_e))}ae&&de(null)},pageId:j.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:A,height:L,fill:q}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:U.scale,scaleY:U.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:X,y:X},n.default.createElement(M,{x:-j.bleed,y:-j.bleed,width:j.computedWidth+2*j.bleed,height:j.computedHeight+2*j.bleed,background:j.background,name:"page-background",preventDefault:!1,scale:U.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!U.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:j.computedWidth,height:j.computedHeight,listening:!1}),n.default.createElement(G,{elements:j.children,store:U})),n.default.createElement(o.Rect,{stroke:B,name:"bleed",strokeWidth:j.bleed,x:j.bleed/2,y:j.bleed/2,width:j.computedWidth+j.bleed,height:j.computedHeight+j.bleed,listening:!1,visible:j.bleed>0&&U.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,A,0,A,L,0,L,0,0,ee,ne,ee,L-ne,A-ee,L-ne,A-ee,ne,ee,ne],listening:!1,closed:!0,fill:q}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:U.scale,scaleY:U.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-fe/2-Ye,y:-fe/2-Ye,width:Z+fe+2*Ye,height:te+fe+2*Ye,stroke:Ne&&U.pages.length>1?F:K,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ee+X*U.scale,y:ne+X*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ie,onDragStart:_e=>{var De;!((De=_e.evt)===null||De===void 0)&&De.altKey&&Y&&U.selectedElements.forEach(Le=>{const we=Le.clone({},{skipSelect:!0}),Qe=j.children.indexOf(Le);j.setElementZIndex(we.id,Qe)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(_e,De)=>{const Le=Math.abs(De.width)<1||Math.abs(De.height)<1,we=Math.abs(_e.width)<1||Math.abs(_e.height)<1;return Le&&!we?_e:De},onTransform:_e=>{var De,Le;const we=ie.current.nodes(),Qe=we[we.length-1];if(_e.target!==Qe)return;const Se=(De=ie.current)===null||De===void 0?void 0:De.__getNodeRect(),Ke=(Le=ie.current)===null||Le===void 0?void 0:Le.getActiveAnchor();ve({anchor:Ke,x:Se.x,y:Se.y,rotation:Se.rotation,width:Se.width,height:Se.height})},onTransformEnd:_e=>{ve({}),U.history.endTransaction()},visible:!U.isPlaying}),ae&&ae.map(({points:_e,distance:De,box1:Le,box2:we},Qe)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Qe,listening:!1},n.default.createElement(o.Rect,Object.assign({},Le,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},we,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[_e[0].x,_e[0].y,_e[1].x,_e[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[_e[1].x,_e[1].y,_e[2].x,_e[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(_e[0].x+_e[1].x)/2,y:(_e[0].y+_e[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,b.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:De})})))),j._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Z,height:te,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Z,height:te,align:"center",verticalAlign:"middle"})),ue&&n.default.createElement(ue,{components:$,store:U,page:j,stageRef:ce})),n.default.createElement(H,Object.assign({},ye,{store:U})),n.default.createElement(I,{selection:Ge}),p.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:A-170,y:L-18,onMouseEnter:_e=>{_e.target.getStage().container().style.cursor="pointer"},onMouseLeave:_e=>{_e.target.getStage().container().style.cursor=""},onTouchStart:_e=>{_e.cancelBubble=!0},onMouseDown:_e=>{_e.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Te&&Ne&&Ze&&n.default.createElement(Ze,{store:U,page:j,xPadding:ee,yPadding:ne}))})})(t9);var pS={};(function(e){var t=me&&me.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(Je),n=nu,i=Jp,a=bi,o=_2,l=(0,o.styled)("div",r.default.forwardRef)`
252
- position: absolute;
253
- top: 0;
254
- left: 0;
255
- pointer-events: none;
256
- `,u=(0,o.styled)("div",r.default.forwardRef)`
257
- height: 14px;
258
- position: sticky;
259
- font-size: 8px;
260
- line-height: 14px;
261
- top: 0;
262
- left: 0;
263
- color: grey;
264
- border-bottom: 1px solid grey;
265
- background-color: #e8e8e8;
266
- overflow: hidden;
267
- `,f=(0,o.styled)("div",r.default.forwardRef)`
268
- left: 0;
269
- width: 14px;
270
- position: sticky;
271
- font-size: 8px;
272
- line-height: 14px;
273
- color: grey;
274
- border-right: 1px solid grey;
275
- background-color: #e8e8e8;
276
- overflow: hidden;
277
- `,h=(0,o.styled)("div",r.default.forwardRef)`
278
- position: absolute;
279
- border-left: 1px solid grey;
280
- padding-left: 2px;
281
- `,E=(0,o.styled)("div",r.default.forwardRef)`
282
- position: absolute;
283
- left: 14px;
284
- border-left: 1px solid grey;
285
- padding-left: 2px;
286
- transform: rotate(90deg);
287
- transform-origin: left top;
288
- overflow: hidden;
289
- `,w=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function p(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:S,width:b,height:m})=>{const v=r.default.useRef(null);if(!S.activePage)return null;const y=S.activePage,d=(S.bleedVisible&&y.bleed,y.computedWidth*S.scale),g=y.computedHeight*S.scale,_=(b-d)/2,T=(C=M=>(0,i.unitToPx)({unitVal:M,dpi:S.dpi,unit:S.unit})*S.scale,w.find(M=>C(M)>30)||1e4);var C;const P=(0,i.unitToPx)({unitVal:T,dpi:S.dpi,unit:S.unit})*S.scale,O=Math.round(d/P)+1,x=Math.round(g/P)+1,k=(0,n.getTotalClientRect)(S.selectedShapes);return r.default.createElement(l,{ref:v,className:"polotno-rulers"},r.default.createElement(u,{style:{width:b+"px"},className:"polotno-x-ruler"},[...Array(O)].map((M,I)=>r.default.createElement(h,{key:I,style:{left:_+I*P+"px",width:P+"px"}},S.unit==="px"||T>=1?Math.round(T*I):(T*I).toFixed(1))),!!S.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:_+k.x*S.scale+"px",height:"14px",width:k.width*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),S.pages.map((M,I)=>{var H;const G=M.computedHeight*S.scale,Q=(m-G)/2;return r.default.createElement(f,{key:M.id,style:{height:m+"px"},className:"polotno-y-ruler"},[...Array(x)].map((W,U)=>r.default.createElement(E,{key:U,style:{top:Q+U*P-14+"px",width:P+"px"}},S.unit==="px"||T>=1?Math.round(T*U):(T*U).toFixed(1))),((H=S.selectedShapes[0])===null||H===void 0?void 0:H.page)===M&&r.default.createElement("div",{style:{position:"absolute",top:Q+k.y*S.scale-14+"px",width:"14px",height:k.height*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=p})(pS);var gS={},Vg={};let uj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vS=e=>crypto.getRandomValues(new Uint8Array(e)),mS=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(a=t)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=e[l[u]&n]||"",o.length===a)return o}}},cj=(e,t=21)=>mS(e,t,vS),fj=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const dj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:cj,customRandom:mS,nanoid:fj,random:vS,urlAlphabet:uj},Symbol.toStringTag,{value:"Module"})),e0=mo(dj);var qg={},Wg={},yS={},E2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const t=function(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(var i in r)if(!n.hasOwnProperty(i)||!(0,e.deepEqual)(r[i],n[i]))return!1;return!0}return!1};e.deepEqual=t})(E2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=Si,r=E2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const h=()=>f>0;function E(){const p=(0,t.getSnapshot)(i);return{pages:p.pages,width:p.width,height:p.height,custom:p.custom}}function w(p){const S=i.pages.map(m=>m.id),b=p.pages.map(m=>m.id);(0,r.deepEqual)(S,b)?i.pages.forEach((m,v)=>{(0,t.applySnapshot)(m,p.pages[v])}):(0,t.applySnapshot)(i.pages,p.pages),i.setSize(p.width,p.height)}return{startTransaction(){f++},endTransaction(p){f--,p||this.requestAddState(E())},async ignore(p,S=!1,b=!1){b&&await new Promise(g=>setTimeout(g,10)),u&&n.addUndoState();let m=h();n.startTransaction();let v=f;try{await p()}catch(g){setTimeout(()=>{throw g})}const y=v!==f,d=!y;n.endTransaction(d),S||m||n.replaceState(),y||(clearTimeout(u),u=0)},async transaction(p){await n.ignore(p,!0),this.addUndoState()},requestAddState(p){l=p,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const p=n.history[n.undoIdx];!(0,r.deepEqual)(l,p)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(E())}),n.history.length===0&&this.requestAddState(E())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(E())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,w(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,w(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=E()}}}),e.default=e.UndoManager})(yS);var bS={};(function(e){async function t(r,n){const i=await(await fetch(r)).blob(),a=document.createElement("a"),o=URL.createObjectURL(i);a.href=o,a.download=n,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=void 0,e.downloadFile=t})(bS);var _S={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=void 0;const t="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let r;function n(){return r?Promise.resolve(r):new Promise(i=>{var a=document.createElement("script");a.onload=function(){r=window.jspdf.jsPDF,i(r)},a.src=t,document.head.appendChild(a)})}e.getJsPDF=n})(_S);var wS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createGIF=e.getGIF=void 0;const t="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function r(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var a=document.createElement("script");a.onload=function(){i(window.GIF)},a.src=t,document.head.appendChild(a)})}async function n({width:i,height:a}){return new(await r())({workers:4,width:i,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
290
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
291
- `],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(wS);var SS={};(function(e){async function t(r){for(let n=0;n<30;n++){const i=await r();if(i)return i;await new Promise(a=>setTimeout(a,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=void 0,e.waitTillAvailable=t})(SS);var ES={},Cc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=tu;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=h=>{u(h)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const E=h.getContext("2d");let{cropX:w,cropY:p}=l;const S=f.width*l.cropWidth,b=f.height*l.cropHeight,m=l.width/l.height;let v,y;const d=S/b;return l.type==="svg"?(v=S,y=b):m>=d?(v=S,y=S/m):(v=b*m,y=b),E.drawImage(f,w*f.width,p*f.height,v,y,0,0,h.width,h.height),h.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,h=u/f;let E,w;h>=l.width/l.height?(E=l.width,w=l.width/h):(E=l.height*h,w=l.height);const p=(l.width-E)/2,S=(l.height-w)/2;return{cropX:p/l.width,cropY:S/l.height,cropWidth:E/l.width,cropHeight:w/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(Cc);(function(e){var t=me&&me.__createBinding||(Object.create?function(O,x,k,M){M===void 0&&(M=k);var I=Object.getOwnPropertyDescriptor(x,k);I&&!("get"in I?!x.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return x[k]}}),Object.defineProperty(O,M,I)}:function(O,x,k,M){M===void 0&&(M=k),O[M]=x[k]}),r=me&&me.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&t(x,O,k);return r(x,O),x},i=me&&me.__rest||function(O,x){var k={};for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&x.indexOf(M)<0&&(k[M]=O[M]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(M=Object.getOwnPropertySymbols(O);I<M.length;I++)x.indexOf(M[I])<0&&Object.prototype.propertyIsEnumerable.call(O,M[I])&&(k[M[I]]=O[M[I]])}return k};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=Cc,o=n(tu),l=Cc,u=Qp,f=p2,h=(O,x,...k)=>({type:O,props:x,children:k||[]});function E(O){var x=new DOMParser().parseFromString(O,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=E;const w=async({element:O,page:x,store:k})=>{let{src:M}=O;if(O.type==="svg"&&Object.keys(O.colorsReplace).length){const X=await o.urlToString(M);M=o.replaceColors(X,new Map(Object.entries(O.colorsReplace)))}let I="";O.flipX&&(I+="scaleX(-1)"),O.flipY&&(I+="scaleY(-1)"),I||(I="none");const H={};if(O.clipSrc){const X=await o.urlToBase64(O.clipSrc);H["clip-path"]=`url(${X})`}const G=await(0,l.loadImage)(M),Q=G.width*O.cropWidth,W=G.height*O.cropHeight,U=O.width/O.height;let j,A;const L=Q/W;O.type==="svg"?(j=Q,A=W):U>=L?(j=Q,A=Q/U):(j=W*U,A=W);const z=j/G.width,q=A/G.height,K=j/A>O.width/O.height?O.height/A:O.width/j,F=j*K/z,$=A*K/q,B=O.cropX*K*G.width,Y=O.cropY*K*G.height;return h("div",{style:Object.assign(Object.assign({},H),{width:"100%",height:"100%","border-radius":O.cornerRadius+"px",border:O.borderSize?`${O.borderSize}px solid ${O.borderColor}`:"none",background:`url(${M})`,transform:I,"background-size":`${Math.round(F)}px ${Math.round($)}px`,"background-position-x":-Math.round(B)+"px","background-position-y":-Math.round(Y)+"px"})})},p=async({element:O,page:x,store:k})=>{let M={top:0,left:0};O.fill.indexOf("gradient")>=0&&(M=Object.assign(Object.assign({},M),{"background-color":O.fill,"background-image":O.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const I=O.backgroundPadding*(O.fontSize*O.lineHeight),H=h("div",{style:{position:"absolute",top:-I/2+"px",left:-I/2+"px",display:O.backgroundEnabled?"block":"none",width:O.width+I+"px",height:O.height+I+"px","background-color":O.backgroundColor,"border-radius":O.backgroundCornerRadius*(O.fontSize*O.lineHeight*.5)+"px"}});O.verticalAlign==="middle"?(M.top="50%",M.transform="translateY(-50%)"):O.verticalAlign==="bottom"&&(M.bottom=0);const G=/<[a-z][\s\S]*>/i.test(O.text),Q=Object.assign(Object.assign({},M),{position:"absolute",width:O.width+"px",color:O.fill,"white-space":"pre-wrap","font-size":O.fontSize+"px","text-align":O.align,"font-family":O.fontFamily,"text-decoration":O.textDecoration||"none","line-height":O.lineHeight,"letter-spacing":O.letterSpacing+"em","font-style":O.fontStyle,"font-weight":O.fontWeight,"-webkit-text-stroke":`${O.strokeWidth}px ${O.stroke}`,"text-stroke":`${O.strokeWidth}px ${O.stroke}`}),W="el-"+O.id,U=G?{id:W}:{},j=`<style>#${W} {${f.resetStyleContent}}</style>`,A=h("div",Object.assign(Object.assign({style:Q},U),{innerHTML:G?`${j}${O.text}`:O.text.split(`
292
- `).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},H,A)},S=({element:O,type:x})=>{const k={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return x==="arrow"||x==="triangle"?h("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},k)):x==="bar"?h("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},k)):x==="circle"?h("circle",Object.assign({r:O.height},k)):x==="square"?h("polyline",Object.assign({points:`${-O.height},${-O.height} ${-O.height},${O.height} ${O.height},${O.height} ${O.height},${-O.height}`},k)):null},b=async({element:O,page:x,store:k})=>h("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},h("rect",{x:0,y:0,width:O.width,height:O.height,fill:O.color}),h("g",{transform:`translate(0 ${O.height/2})`},S({element:O,type:O.startHead})),h("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},S({element:O,type:O.endHead}))),m=async({element:O,page:x,store:k,elementHook:M})=>{const I=await Promise.all(O.children.map(G=>d({element:G,page:x,store:k,elementHook:M}))),H=h("div",{style:{"transform-origin":"top left",opacity:O.opacity}},...I);return M&&M({dom:H,element:O})||H},v=async({element:O,page:x,store:k,elementHook:M})=>{const I=(0,u.figureToSvg)(O),H=h("div",{innerHTML:I});return M&&M({dom:H,element:O})||H},y={image:w,svg:w,text:p,line:b,figure:v,group:m};async function d({element:O,page:x,store:k,elementHook:M}){let I=await y[O.type];I||(I=()=>h("div",{}),console.error(`HTML export does not support ${O.type} type...`));const H=await I({element:O,page:x,store:k}),G=[];O.blurEnabled&&G.push(`blur(${O.blurRadius/2}px)`),O.brightnessEnabled&&G.push(`brightness(${100*O.brightness+100}%)`),O.sepiaEnabled&&G.push("sepia()"),O.grayscaleEnabled&&G.push("grayscale()"),O.shadowEnabled&&G.push(`drop-shadow(${O.shadowOffsetX}px ${O.shadowOffsetY}px ${O.shadowBlur}px ${O.shadowColor})`);const Q=h("div",{id:O.id,style:{position:"absolute",left:O.x+"px",top:O.y+"px",width:O.width+"px",height:O.height+"px",transform:`rotate(${O.rotation}deg)`,"transform-origin":"top left",opacity:O.opacity,display:O.visible&&O.showInExport?"block":"none",filter:G.join(" ")||"none"}},H);return M&&M({dom:Q,element:O})||Q}async function g({page:O,store:x,elementHook:k}){const M=await Promise.all(O.children.map(Q=>d({element:Q,page:O,store:x,elementHook:k}))),I=O.width==="auto"?x.width:O.width,H=O.height==="auto"?x.height:O.height;let G={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const{width:Q,height:W}=await(0,l.loadImage)(O.background),U=await w({element:Object.assign({x:0,y:0,width:Q,height:W,src:O.background,cornerRadius:0},(0,a.getCrop)({width:Q,height:W},{width:Q,height:W})),page:O,store:x});M.unshift(U)}else G=Object.assign(Object.assign({},G),{"background-color":O.background});return h("div",{className:"page",id:O.id,style:Object.assign(Object.assign({},G),{width:I+"px",height:H+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...M)}async function _({json:O,elementHook:x}){const k=await Promise.all(O.pages.map(H=>g({page:H,store:O,elementHook:x}))),M=[];O.pages.forEach(H=>{H.children.forEach(G=>{G.type==="text"&&M.indexOf(G.fontFamily)===-1&&M.push(G.fontFamily)})});const I=M.map(H=>O.fonts.find(G=>G.fontFamily===H)?h("style",{},""):h("link",{href:`https://fonts.googleapis.com/css?family=${H}`,rel:"stylesheet"}));return h("div",{className:"design"},...I,...k)}e.jsonToDOM=_;const T=(O,x)=>typeof x=="object"?`${O}="${Object.keys(x).map(k=>`${k}:${x[k]};`).join(" ")}"`:`${O}="${x}"`,C=({dom:O})=>{if(typeof O=="string")return O;if(!O)return"";const x=O.props,{innerHTML:k}=x,M=i(x,["innerHTML"]);return`<${O.type} ${Object.keys(M).map(I=>T(I,O.props[I])).join(" ")}>${k||O.children.map(I=>C({dom:I})).join("")}</${O.type}>`};async function P({json:O,elementHook:x}){const k=await _({json:O,elementHook:x});return C({dom:k})}e.jsonToHTML=P})(ES);var OS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(O,x,k,M){M===void 0&&(M=k);var I=Object.getOwnPropertyDescriptor(x,k);I&&!("get"in I?!x.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return x[k]}}),Object.defineProperty(O,M,I)}:function(O,x,k,M){M===void 0&&(M=k),O[M]=x[k]}),r=me&&me.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&t(x,O,k);return r(x,O),x},i=me&&me.__rest||function(O,x){var k={};for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&x.indexOf(M)<0&&(k[M]=O[M]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(M=Object.getOwnPropertySymbols(O);I<M.length;I++)x.indexOf(M[I])<0&&Object.prototype.propertyIsEnumerable.call(O,M[I])&&(k[M[I]]=O[M[I]])}return k};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=Cc,o=n(tu),l=Cc,u=Qp,f=(O,x,...k)=>({type:O,props:x,children:k||[]});function h(O){var x=new DOMParser().parseFromString(O,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=h;const E=async({element:O,page:x,store:k})=>{let{src:M}=O;if(O.type==="svg"){const Z=await o.urlToString(M);M=o.replaceColors(Z,new Map(Object.entries(O.colorsReplace)))}let I="";O.flipX&&(I+="scaleX(-1)"),O.flipY&&(I+="scaleY(-1)"),O.clipSrc&&await o.urlToBase64(O.clipSrc);const H=await(0,l.loadImage)(M),G=H.width*O.cropWidth,Q=H.height*O.cropHeight,W=O.width/O.height;let U,j;const A=G/Q;O.type==="svg"?(U=G,j=Q):W>=A?(U=G,j=G/W):(U=Q*W,j=Q);const L=U/H.width,z=j/H.height,q=U/j>O.width/O.height?O.height/j:O.width/U,K=U*q/L,F=j*q/z,$=O.cropX*H.width*q,B=O.cropY*H.height*q,Y=`clip-${O.id}`,X=M.replace(/&/g,"&amp;");return f("g",{style:{transform:I}},f("defs",{},f("clipPath",{id:Y},f("rect",{x:0,y:0,width:O.width,height:O.height}))),f("image",{"xlink:href":X,x:-$,y:-B,width:K,height:F,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},w=async({element:O,page:x,store:k})=>{const M=(W,U,j,A,L)=>{const z=document.createElement("canvas").getContext("2d");return z.font=`${L} ${A} ${U}px ${j}`,z.measureText(W).width},I=((W,U,j,A,L,z)=>{const q=[];return W.split(`
293
- `).forEach(K=>{const F=K.split(" ");let $="";for(let B=0;B<F.length;B++){const Y=$+F[B]+" ";M(Y,j,A,L,z)>U&&B>0?(q.push($.trim()),$=F[B]+" "):$=Y}q.push($.trim())}),q})(O.text,O.width,O.fontSize,O.fontFamily,O.fontWeight,O.fontStyle),H=O.fontSize*O.lineHeight,G=O.align==="center"?"middle":O.align==="right"?"end":"start",Q=I.map((W,U)=>f("tspan",{x:O.align==="center"?O.width/2:O.align==="right"?O.width:0,dy:U===0?0:H,innerHTML:W}));return f("g",{},f("text",{fill:O.fill,y:O.fontSize,"font-size":O.fontSize+"px","text-anchor":G,"font-family":O.fontFamily,"font-style":O.fontStyle,"font-weight":O.fontWeight,"text-decoration":O.textDecoration,"line-height":O.lineHeight,"letter-spacing":O.letterSpacing+"em","stroke-width":O.strokeWidth,stroke:O.stroke},...Q))},p=({element:O,type:x})=>{const k={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},k)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},k)):x==="circle"?f("circle",Object.assign({r:O.height},k)):x==="square"?f("polyline",Object.assign({points:`${-O.height},${-O.height} ${-O.height},${O.height} ${O.height},${O.height} ${O.height},${-O.height}`},k)):null},S=async({element:O,page:x,store:k})=>f("g",{},f("line",{x1:0,y1:O.height/2,x2:O.width,y2:O.height/2,stroke:O.color,"stroke-width":O.height}),f("g",{transform:`translate(0 ${O.height/2})`},p({element:O,type:O.startHead})),f("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},p({element:O,type:O.endHead}))),b=async({element:O,page:x,store:k,elementHook:M})=>{const I=await Promise.all(O.children.map(G=>d({element:G,page:x,store:k,elementHook:M}))),H=f("g",{opacity:O.opacity,transform:`translate(${O.x}, ${O.y}) rotate(${O.rotation})`,style:{"transform-origin":"top left"}},...I);return M&&M({dom:H,element:O})||H};function m(O){let x=O.replace(/<svg[^>]*>/,"");return x=x.replace(/<\/svg>/,""),x}const v=async({element:O,page:x,store:k,elementHook:M})=>{const I=m((0,u.figureToSvg)(O)),H=f("g",{innerHTML:I});return M&&M({dom:H,element:O})||H},y={image:E,svg:E,text:w,line:S,figure:v,group:b};async function d({element:O,page:x,store:k,elementHook:M}){let I=await y[O.type];I||(I=()=>f("g",{}),console.error(`SVG export does not support ${O.type} type...`));const H=await I({element:O,page:x,store:k}),G=[];O.blurEnabled&&G.push(`blur(${O.blurRadius/2}px)`),O.brightnessEnabled&&G.push(`brightness(${100*O.brightness+100}%)`),O.sepiaEnabled&&G.push("sepia()"),O.grayscaleEnabled&&G.push("grayscale()"),O.shadowEnabled&&G.push(`drop-shadow(${O.shadowOffsetX}px ${O.shadowOffsetY}px ${O.shadowBlur}px ${O.shadowColor})`);const Q=f("g",{className:"element",id:O.id,transform:`translate(${O.x}, ${O.y}) rotate(${O.rotation})`,display:O.visible?void 0:"none",style:{"transform-origin":"top left",filter:G.join(" ")}},H);return M&&M({dom:Q,element:O})||Q}async function g({page:O,store:x,elementHook:k}){const M=await Promise.all(O.children.map(H=>d({element:H,page:O,store:x,elementHook:k})));let I={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const H=await(0,l.loadImage)(O.background),G=await(0,l.cropImage)(O.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,a.getCrop)({width:x.width,height:x.height},{width:H.width,height:H.height})));I=Object.assign(Object.assign({},I),{"background-image":`url(${G})`})}return f("g",{className:"page",style:Object.assign(Object.assign({},I),{background:O.background})},f("rect",{x:0,y:0,width:x.width,height:x.height,fill:O.background}),...M)}async function _({json:O,elementHook:x}){const k=await Promise.all(O.pages.map(H=>g({page:H,store:O,elementHook:x}))),M=[];O.pages.forEach(H=>{H.children.forEach(G=>{G.type==="text"&&M.indexOf(G.fontFamily)===-1&&M.push(G.fontFamily)})});const I=M.map(H=>O.fonts.find(G=>G.fontFamily===H)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${H}:bi,normal,i,b');`.replace(/&/g,"&amp;")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${O.width} ${O.height}`},...I,...k)}e.jsonToDOM=_;const T=(O,x)=>typeof x=="object"?`${O}="${Object.keys(x).map(k=>`${k}:${x[k]};`).join(" ")}"`:x==null||x===""?"":`${O}="${x}"`,C=({dom:O,nestLevel:x=0})=>{if(typeof O=="string")return O;if(!O)return"";const k=O.props,{innerHTML:M}=k,I=i(k,["innerHTML"]),H=" ".repeat(x);return`${H}<${O.type} ${Object.keys(I).map(G=>T(G,I[G])).join(" ")}>${M||`
294
- `+O.children.map(G=>C({dom:G,nestLevel:x+1})).join("")}${H}</${O.type}>
295
- `};async function P({json:O,elementHook:x}){const k=await _({json:O,elementHook:x});return C({dom:k})}e.jsonToSVG=P})(OS);var Kg={},E_;function xS(){return E_||(E_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=Si,r=e0,n=kc(),i=O2(),a=kc(),o=nu;e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(l=>{const u=Object.assign({},l),f={};for(var h in u)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let u=0;for(const f of l.store.pages){if(f.id===l.id)return u;u+=f.duration}return u},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(l))),_forEachElementUp(u,f){const h=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));h.sort((E,w)=>w.index-E.index);for(const{index:E}of h){if(E==-1)continue;const w=E<l.children.length-1&&l.children[E+1],p=u.indexOf(w==null?void 0:w.id)>=0;E===l.children.length-1||p||f(E)}},_forEachElementDown(u,f){const h=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));h.sort((E,w)=>E.index-w.index);for(const{index:E}of h){if(E==-1)continue;const w=E>0&&l.children[E-1],p=u.indexOf(w==null?void 0:w.id)>=0;E===0||p||f(E)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(p=>{p.id=(0,r.nanoid)(10),(0,a.forEveryChild)(p,S=>{S.id=(0,r.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),E=l.store.addPage(h),w=l.store.pages.indexOf(l);E.setZIndex(w+1),E.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.id)},addElement(u,{skipSelect:f=!1}={}){const h=a.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(w=>{w.id=(0,r.nanoid)(10)});const E=h.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(E),E.selectable&&!f&&l.store.selectElements([E.id]),E},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],h=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):h.push(E)}),l.children.replace(h.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],h=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):h.push(E)}),l.children.replace(f.concat(h))},setElementZIndex(u,f){const h=l.children.find(E=>E.id===u);h&&((0,t.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:u,height:f,useMagic:h,softChange:E}){if(h){const w=[],p=I=>I.type==="image"&&I.x<1&&I.y<1&&I.width>=l.computedWidth-2&&I.height>=l.computedHeight-2;(0,a.forEveryChild)(l,I=>{I.type!=="group"&&(p(I)||w.push(I))});const S=w.length?(0,o.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},b=0,m=Math.max(0,Math.min(S.x,l.computedWidth-S.x-S.width)),v=l.computedWidth*b,y=Math.max(0,m-v),d=Math.max(0,Math.min(S.y,l.computedHeight-S.y-S.height)),g=l.computedHeight*b,_=Math.max(0,d-g),T=l.computedWidth-2*y,C=l.computedHeight-2*_,P=u/T,O=f/C,x=Math.min(P,O),k=(u-T*x)/2-y*x,M=(f-C*x)/2-_*x;(0,a.forEveryChild)(l,I=>{I.type!=="group"&&(p(I)?I.set({x:I.x*x,y:I.y*x,width:I.width*P,height:I.height*O,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(I.set({x:k+I.x*x,y:M+I.y*x,width:I.width*x,height:I.height*x}),I.type==="text"?I.set({fontSize:I.fontSize*x}):I.type==="figure"&&I.set({strokeWidth:I.strokeWidth*x})))})}E||(l.width=u),E||(l.height=f)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Kg)),Kg}var O_;function O2(){return O_||(O_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(P,O,x,k){k===void 0&&(k=x);var M=Object.getOwnPropertyDescriptor(O,x);M&&!("get"in M?!O.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return O[x]}}),Object.defineProperty(P,k,M)}:function(P,O,x,k){k===void 0&&(k=x),P[k]=O[x]}),r=me&&me.__setModuleDefault||(Object.create?function(P,O){Object.defineProperty(P,"default",{enumerable:!0,value:O})}:function(P,O){P.default=O}),n=me&&me.__importStar||function(P){if(P&&P.__esModule)return P;var O={};if(P!=null)for(var x in P)x!=="default"&&Object.prototype.hasOwnProperty.call(P,x)&&t(O,P,x);return r(O,P),O},i=me&&me.__rest||function(P,O){var x={};for(var k in P)Object.prototype.hasOwnProperty.call(P,k)&&O.indexOf(k)<0&&(x[k]=P[k]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(k=Object.getOwnPropertySymbols(P);M<k.length;M++)O.indexOf(k[M])<0&&Object.prototype.propertyIsEnumerable.call(P,k[M])&&(x[k[M]]=P[k[M]])}return x},a=me&&me.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=Si,l=yS,u=e0,f=a(wi),h=bS,E=_S,w=wS,p=S2(),S=n(Js),b=Vi,m=Jp,v=E2,y=SS,d=ES,g=OS,_=xS(),T=kc();function C({key:P,showCredit:O}={key:"",showCredit:!1}){const x=e.Store.create();return(0,p.validateKey)(P,O),x}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(P=>Object.assign(Object.assign({},P),{fontFamily:P.fontFamily||P.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(_.Page),fonts:o.types.array(e.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:o.types.frozen(),selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:""}).views(P=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),P.bleedVisible},get selectedElements(){return P.selectedElementsIds.map(O=>{for(const x of P.pages)for(const k of x.children)if(k.id===O)return k}).filter(O=>!!O)},get children(){return P.pages},get selectedShapes(){const O=[];return(0,T.forEveryChild)({children:P.selectedElements},x=>{x.type!=="group"&&O.push(x)}),O},get activePage(){return P.pages.slice().find(O=>O.id===P._activePageId)||(P.pages.length?P.pages[0]:null)},get duration(){let O=0;return P.pages.forEach(x=>{O+=x.duration}),O},get _hasCroppedImages(){return P.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let x;return(0,T.forEveryChild)({children:P.pages},k=>{if(!x&&O(k))return x=k,!0}),x},getElementById:O=>P.find(x=>x.id===O)})).actions(P=>{let O=0,x=null,k=!1;return{afterCreate(){P.history.canUndo},setCurrentTime(M){P.currentTime=M},play({animatedElementsIds:M=[],startTime:I=0,currentTime:H=0,endTime:G=P.duration,repeat:Q=!1}={}){H&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),I=H),P.animatedElementsIds=(0,o.cast)(M),P.currentTime=I,P.isPlaying=!0,O=Date.now(),x=G,k=Q,requestAnimationFrame(P.seek)},checkActivePage(){let M=0;for(const I of P.pages){if(P.currentTime>=I.startTime&&P.currentTime<I.startTime+I.duration){P.selectPage(I.id);break}M+=I.duration}},seek(){if(!P.isPlaying)return;const M=Date.now(),I=M-O;O=M,P.currentTime+=I,P.checkActivePage();const H=x||P.duration;P.isPlaying&&P.currentTime<H?requestAnimationFrame(P.seek):P.isPlaying&&k?(P.currentTime=0,requestAnimationFrame(P.seek)):P.stop()},stop(){P.isPlaying=!1,P.currentTime=0,P.animatedElementsIds=(0,o.cast)([]),P.checkActivePage()}}}).actions(P=>({set(O){Object.assign(P,O)},setUnit({unit:O,dpi:x}){P.unit=O||P.unit,P.dpi=x||P.dpi},setRole(O){P.role=O},addPage(O){const x=_.Page.create(Object.assign({id:(0,u.nanoid)(10)},O));return P.pages.push(x),P._activePageId=x.id,x},selectPage(O){P._activePageId=O},selectElements(O){const x=O.map(k=>P.getElementById(k)).sort((k,M)=>k.page.children.indexOf(k)-k.page.children.indexOf(M)).filter(k=>!!k).map(k=>k.id);P.selectedElementsIds=(0,o.cast)(x)},toggleBleed(O){P.bleedVisible=O??!P.bleedVisible},toggleRulers(O){P.rulesVisible=O??!P.rulesVisible},openSidePanel(O){P.openedSidePanel!==O&&(P.previousOpenedSidePanel=P.openedSidePanel,P.openedSidePanel=O)},setScale(O){P.scale=O},_setScaleToFit(O){P.scaleToFit=O},setElementsPixelRatio(O){P._elementsPixelRatio=O},setSize(O,x,k){P.pages.forEach(M=>{M.setSize({width:O,height:x,useMagic:k,softChange:!0})}),P.width=O,P.height=x},setPageZIndex(O,x){const k=P.pages.find(M=>M.id===O);k&&((0,o.detach)(k),P.pages.remove(k),P.pages.splice(x,0,k))},deletePages(O){const x=P.pages.indexOf(P.activePage);O.forEach(I=>{const H=P.pages.find(G=>G.id===I);(0,o.destroy)(H)});const k=Math.min(P.pages.length-1,x),M=P.pages[k];M&&(P._activePageId=M.id),P.selectedElementsIds=(0,o.cast)(P.selectedElementsIds.filter(I=>P.getElementById(I)))},groupElements(O){const x=O.map(I=>P.getElementById(I));x.forEach(I=>{I&&(0,o.detach)(I)});const k=P.activePage,M={id:(0,u.nanoid)(10),children:x,type:"group"};return k.children.push(M),P.selectedElementsIds=(0,o.cast)([M.id]),M},ungroupElements(O){const x=O.map(M=>P.getElementById(M)),k=[];x.forEach(M=>{if(M&&M.type==="group"){const I=M.page,H=I.children.indexOf(M);M.children.forEach(G=>{k.push(G.id)}),M.children.forEach(G=>{(0,o.detach)(G),I.children.push(G)}),I.children.splice(H,1)}}),P.selectedElementsIds=(0,o.cast)(k)},deleteElements(O){const x=[];P.find(k=>(O.includes(k.id)&&x.push(k),!1)),x.forEach(k=>{(0,o.destroy)(k)}),P.selectedElementsIds=(0,o.cast)(P.selectedElementsIds.filter(k=>P.getElementById(k)))},on(O,x){if(O==="change"){let k=P.toJSON();return(0,o.onSnapshot)(P,M=>{const I=P.toJSON();!(0,v.deepEqual)(k,I)&&(k=I,x(I))})}},async _toCanvas({pixelRatio:O,ignoreBackground:x,pageId:k,mimeType:M,includeBleed:I,_skipTimeout:H}={}){var G;const Q=O||1;k=k||((G=P.pages[0])===null||G===void 0?void 0:G.id);const W=P.pages.find(ie=>ie.id===k);if(!W)throw new Error(`No page for export with id ${k}`);W==null||W.set({_exporting:!0});const U=await(0,y.waitTillAvailable)(()=>f.default.stages.find(ie=>ie.getAttr("pageId")===k));if(!U)throw new Error(`Export is failed. Can not find stage for page ${k}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const j=!!U.findOne(".page-container"),A=P._elementsPixelRatio;Q>P._elementsPixelRatio&&P.setElementsPixelRatio(Q),await P.waitLoading({_skipTimeout:H});const L=U.findOne(".page-container");if(!L)throw P.setElementsPixelRatio(A),new Error(`Export is failed. Can't find page container. ${j}`);U.find("Transformer").forEach(ie=>ie.visible(!1)),L.find(".page-background").forEach(ie=>ie.shadowEnabled(!1)),L.find(".page-background").forEach(ie=>ie.strokeEnabled(!1)),L.find(".highlighter").forEach(ie=>ie.visible(!1));const z=L.findOne(".page-background-group"),q=z.clip();z.clip({x:null,y:null,width:null,height:null});const K=L.findOne(".elements-container"),F=K.clip();K.clip({x:null,y:null,width:null,height:null});const $=L.find(ie=>ie.getAttr("hideInExport"));$.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.hide()});const B=L.find(ie=>!ie.visible()&&ie.getAttr("editModeEnabled"));B.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.show()}),x&&L.find(".page-background").forEach(ie=>ie.hide());const Y=I?W.bleed:0;let X=Y;!P.bleedVisible&&I||(P.bleedVisible||I?P.bleedVisible&&I?X=0:P.bleedVisible&&!I&&(X=-W.bleed):X=0);const Z=document.createElement("canvas");Z.width=Math.round((W.computedWidth+2*Y)*Q),Z.height=Math.round((W.computedHeight+2*Y)*Q);const te=Z.getContext("2d");M==="image/jpeg"&&(te.fillStyle="white",te.fillRect(0,0,Z.width,Z.height));const ee=L.scale();L.scale({x:1,y:1});const ne=L.toCanvas({x:L.x()-X,y:L.y()-X,width:W.computedWidth+2*Y,height:W.computedHeight+2*Y,pixelRatio:Q});return L.scale(ee),te.drawImage(ne,0,0,Z.width,Z.height),f.default.Util.releaseCanvas(ne),x&&L.find(".page-background").forEach(ie=>ie.show()),$.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),B.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),L.find(".page-background").forEach(ie=>ie.shadowEnabled(!0)),L.find(".page-background").forEach(ie=>ie.strokeEnabled(!0)),U.find("Transformer").forEach(ie=>ie.visible(!0)),L.find(".highlighter").forEach(ie=>ie.visible(!0)),z.clip(q),K.clip(F),P.setElementsPixelRatio(A),W==null||W.set({_exporting:!1}),Z},async toDataURL(O={}){var{mimeType:x,quality:k}=O,M=i(O,["mimeType","quality"]);const I=await P._toCanvas(Object.assign({mimeType:x},M)),H=I.toDataURL(x,k);return f.default.Util.releaseCanvas(I),H},async toBlob(O={}){var{mimeType:x,quality:k}=O,M=i(O,["mimeType","quality"]);const I=await P._toCanvas(Object.assign({mimeType:x},M)),H=new Promise(G=>{I.toBlob(G,x,k)});return f.default.Util.releaseCanvas(I),H},async saveAsImage(O={}){var{fileName:x}=O,k=i(O,["fileName"]);const M=k.mimeType||"image/png",I=M.split("/")[1];(0,h.downloadFile)(await P.toDataURL(k),x||"polotno."+I,M)},async _toPDF(O){const x=O.dpi||P.dpi,k=O.parallel||1,M=O.unit||(P.unit==="px"?"mm":P.unit),I=O.pixelRatio||1,H=O.pageIds||P.pages.map($=>$.id),G=P.pages.filter($=>H.includes($.id)),Q=await(0,E.getJsPDF)(),W=$=>(0,m.pxToUnit)({px:$,unit:M,dpi:x}),U=W(O.cropMarkSize||0),j=G[0]||{},A=O.includeBleed?j.bleed:0,L=W(j.computedWidth+2*A)+2*U,z=W(j.computedHeight+2*A)+2*U;var q=new Q({unit:M,orientation:L>z?"landscape":"portrait",format:[L,z],compress:!0,putOnlyUsedFonts:!0});q.deletePage(1);const K=(($,B)=>{for(var Y=[],X=0;X<$.length;X+=B)Y.push($.slice(X,X+B));return Y})(G,k);let F=0;for(const $ of K){const B=$.map(async Y=>{const X=O.includeBleed?Y.bleed:0,Z=W(Y.computedWidth+2*X)+2*U,te=W(Y.computedHeight+2*X)+2*U;let ee=0,ne=I;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ie=await P.toDataURL(Object.assign(Object.assign({},O),{pageId:Y.id,pixelRatio:ne}));if(ie.length>20)return O.onProgress&&O.onProgress(++F/H.length*.9),{url:ie,width:Z,height:te};ne*=.8}});(await Promise.all(B)).forEach(({url:Y,width:X,height:Z})=>{q.addPage([X,Z],X>Z?"landscape":"portrait"),U&&(q.setLineWidth(W(1)),q.line(2*U,0,2*U,U),q.line(0,2*U,U,2*U),q.line(X-2*U,0,X-2*U,U),q.line(X,2*U,X-U,2*U),q.line(0,Z-2*U,U,Z-2*U),q.line(2*U,Z,2*U,Z-U),q.line(X,Z-2*U,X-U,Z-2*U),q.line(X-2*U,Z,X-2*U,Z-U)),q.addImage(Y,U,U,X-2*U,Z-2*U,void 0,"FAST")})}return q},toPDFDataURL:async O=>(await P._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const x=O.pixelRatio||1,k=await(0,w.createGIF)({width:P.width*x,height:P.height*x}),M=1e3/(O.fps||10),I=P.duration/M;for(let H=0;H<I-1;H++){const G=H*M||1;P.setCurrentTime(G);let Q=0,W="";for(const j of P.pages)if(Q+=j.duration,j.set({_rendering:Q>G}),Q>G){W=j.id;break}const U=await P._toCanvas({pixelRatio:x,pageId:W,_skipTimeout:!0});k.addFrame(U.getContext("2d"),{delay:M,copy:!0})}for(const H of P.pages)H.set({_rendering:!1});return P.stop(),k.render(),new Promise(H=>{k.on("finished",function(G){(function(Q,W){var U=new FileReader;U.onload=function(j){W(j.target.result)},U.readAsDataURL(Q)})(G,H)})})},async saveAsGIF(O={}){var{fileName:x}=O,k=i(O,["fileName"]);const M=await P.toGIFDataURL(k);(0,h.downloadFile)(M,x||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const x=P.toJSON();return(0,d.jsonToHTML)({json:x,elementHook:O})},async saveAsHTML({fileName:O}={}){const x=await P.toHTML(),k="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(x)));(0,h.downloadFile)(k,O||"polotno.html")},async toSVG({elementHook:O}={elementHook:void 0}){const x=P.toJSON();return(0,g.jsonToSVG)({json:x,elementHook:O})},async saveAsSVG({fileName:O,elementHook:x}={}){const k=await P.toSVG({elementHook:x}),M="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,h.downloadFile)(M,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:x}=O,k=i(O,["fileName"]);(await P._toPDF(Object.assign({mimeType:"image/jpeg"},k))).save(x||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(x=>setTimeout(x,50)),await(0,b.whenLoaded)()},toJSON:()=>({width:P.width,height:P.height,fonts:(0,o.getSnapshot)(P.fonts),pages:(0,o.getSnapshot)(P.pages),unit:P.unit,dpi:P.dpi,custom:P.custom}),loadJSON(O,x=!1){var k;const M=Object.assign({},O),I=P.pages.indexOf(P.activePage);let H=(k=M.pages[I]||M.pages[0])===null||k===void 0?void 0:k.id;M._activePageId=H;const G=Object.assign({},(0,o.getSnapshot)(P));Object.assign(G,M),G.history=x?P.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(P,G)},clear({keepHistory:O=!1}={}){const x=P.pages.map(k=>k.id);P.deletePages(x),O||P.history.clear()},addFont(O){P.removeFont(O.fontFamily),P.fonts.push(O),P.loadFont(O.fontFamily)},removeFont(O){P.fonts.filter(x=>x.fontFamily===O).forEach(x=>(0,o.destroy)(x))},async loadFont(O){const x=P.fonts.find(M=>M.fontFamily===O)||S.globalFonts.find(M=>M.fontFamily===O);let k=[{fontStyle:"normal",fontWeight:"normal"}];return x?(x.styles&&(k=x.styles.map(M=>({fontStyle:M.fontStyle||"normal",fontWeight:M.fontWeight||"normal"}))),S.injectCustomFont(x)):S.injectGoogleFont(O),Promise.all(k.map(M=>S.loadFont(O,M.fontStyle,M.fontWeight)))},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(x=>({path:"store"+x.context.map(k=>k.path).join("."),message:x.message}))})),e.createStore=C,e.default=C}(Wg)),Wg}var x_;function PS(){return x_||(x_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=Si,r=e0,n=O2(),i=xS(),a=kc();e.Node=t.types.model("Node",{id:t.types.identifier,type:"none",name:"",opacity:1,custom:t.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,t.getParentOfType)(o,i.Page)},get store(){return(0,t.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,t.hasParentOfType)(l,a.GroupElement))return l;l=(0,t.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,t.hasParentOfType)(o,a.GroupElement)?(0,t.getParentOfType)(o,a.GroupElement):(0,t.hasParentOfType)(o,i.Page)?(0,t.getParentOfType)(o,i.Page):(0,t.hasParentOfType)(o,n.Store)?(0,t.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,h=>{h.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(qg)),qg}var Yg={},CS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t=nu,r={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};e.animations={fade:({dTime:a,element:o,animation:l})=>{const u=a/l.duration;return l.type==="enter"?{opacity:u*o.opacity}:{opacity:(1-u)*o.opacity}},rotate:({dTime:a,element:o,animation:l})=>{const u=a/l.duration*360;return(0,t.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},u)},blink:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=a%u/(u/2),h=f<=1?f:2-f;return{opacity:o.opacity*h}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,h={},E={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},p=a%u/f,S=p<=1?p:2-p;for(let b in E){const m=E[b],v=w[b]-m;h[b]=m+S*v}return h},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var h in u.from){let E=u.from[h],w=u.to[h];l.type==="exit"&&(E=u.to[h],w=-u.from[h]);const p=o[h]+E,S=o[h]+w-p;f[h]=p+a/l.duration*S}return f},zoom:({dTime:a,element:o,animation:l})=>{const u={},f={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},h={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var E in f){let w=f[E],p=h[E];if(l.type==="exit"){const b=w;w=p,p=b}const S=p-w;u[E]=w+a/l.duration*S}return u}};const n=({element:a,dTime:o,animation:l})=>{const u=e.animations[l.name];return u?u({element:a,dTime:o,animation:l}):(console.error("Can not find animation type: "+l.name),{})};e.animate=n;const i=(a,o)=>{};e.registerAnimation=i})(CS);var P_;function iu(){return P_||(P_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=Si,r=CS,n=Xi,i=PS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:t.types.frozen({})}),e.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:t.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{const o=Object.assign(Object.assign({},a),{x:a.x||0,y:a.y||0});return"width"in a&&(o.width=o.width||1),"height"in a&&(o.height=o.height||1),a.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(a=>{const o=(0,n.observable)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),l=(0,n.action)(u=>{Object.assign(o,u)});return{get a(){const{currentTime:u}=a.store;if(l({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),u===0)return o;const f=u-a.page.startTime;if(f>a.page.duration||f<0)return o;const h=a.store.animatedElementsIds;if(h.length&&!h.includes(a.id))return o;const E=a.animations.find(S=>S.type==="enter");if(E!=null&&E.enabled&&f<E.delay&&l({opacity:0}),E!=null&&E.enabled&&f>=E.delay&&f<=E.delay+E.duration){const S=f-E.delay,b=(0,r.animate)({element:a,animation:E,dTime:S});l(b)}const w=a.animations.find(S=>S.type==="exit");if(w!=null&&w.enabled&&f>=a.page.duration-w.duration-w.delay&&f<=a.page.duration-w.delay){const S=f-(a.page.duration-w.duration-w.delay),b=(0,r.animate)({element:a,animation:w,dTime:S});l(b)}w!=null&&w.enabled&&f>=a.page.duration-w.delay&&l({opacity:0});const p=a.animations.find(S=>S.type==="loop");if(p!=null&&p.enabled){const S=f,b=(0,r.animate)({element:a,animation:p,dTime:S});l(b)}return o},animated:u=>a.a[u]}}).actions(a=>({setAnimation(o,l){const u=a.animations.find(f=>f.type===o);u?Object.assign(u,l):a.animations.push(Object.assign({type:o},l))}}))}(Yg)),Yg}var Xg={},C_;function hj(){return C_||(C_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=Si,r=iu();e.TextElement=r.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},k_;function kS(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=iu();e.ImageElement=t.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},T_;function pj(){return T_||(T_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=kS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},A_;function gj(){return A_||(A_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=Si,r=iu();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Jg)),Jg}var ev={},R_;function vj(){return R_||(R_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=Si,r=iu();e.SVGElement=r.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(ev)),ev}var tv={},M_;function mj(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=Si,r=iu();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var L_;function kc(){return L_||(L_=1,function(e){var t=me&&me.__rest||function(m,v){var y={};for(var d in m)Object.prototype.hasOwnProperty.call(m,d)&&v.indexOf(d)<0&&(y[d]=m[d]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(d=Object.getOwnPropertySymbols(m);g<d.length;g++)v.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(m,d[g])&&(y[d[g]]=m[d[g]])}return y};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=Si,n=e0,i=PS(),a=iu(),o=hj(),l=kS(),u=pj(),f=gj(),h=vj(),E=mj(),w=(m,v)=>{if(m.children)for(const y of m.children){if(v(y)===!0)break;(0,e.forEveryChild)(y,v)}};e.forEveryChild=w;const p=[...new Array(20)].map((m,v)=>r.types.late(()=>S[v]));e.ElementTypes=r.types.union({dispatcher:m=>{const v=e.TYPES_MAP[m.type];if(!v)throw new Error(`Unknown element type: "${m.type}"`);return v}},h.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,E.FigureElement,r.types.late(()=>e.GroupElement),...p),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(m=>({get draggable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.draggable||(v=!1)}),v},get resizable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.resizable||(v=!1)}),v},get contentEditable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.contentEditable||(v=!1)}),v},get styleEditable(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.styleEditable||(v=!1)}),v},get locked(){let v=!0;return(0,e.forEveryChild)(m,y=>{y.locked||(v=!1)}),v}})).actions(m=>({set(v){var{draggable:y,contentEditable:d,styleEditable:g,resizable:_}=v,T=t(v,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({draggable:y})}),d!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({contentEditable:d})}),g!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({styleEditable:g})}),_!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({resizable:_})}),Object.assign(m,T)},addElement(v,{skipSelect:y=!1}={}){const d=e.TYPES_MAP[v.type];if(!d)return void console.error("Can not find model with type "+v.type);v.children&&v.children.forEach(_=>{_.id=(0,n.nanoid)(10)});const g=d.create(Object.assign({id:(0,n.nanoid)(10)},v));return m.children.push(g),g.selectable&&!y&&m.store.selectElements([g.id]),g},setElementZIndex(v,y){const d=m.children.find(g=>g.id===v);d&&((0,r.detach)(d),m.children.remove(d),m.children.splice(y,0,d))}}));const S=[];function b(m,v){const y=m.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(y).props(m);v&&(d=v(d)),e.TYPES_MAP[y]=d,S.push(d)}e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:E.FigureElement},e.registerShapeModel=b}(Vg)),Vg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=kc();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var h,E,w,p,S,b,m,v;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((E=document.activeElement)===null||E===void 0?void 0:E.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const y=f.selectedElements.filter(T=>T.removable),d=y.map(T=>T.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const g=u.ctrlKey||u.metaKey,_=u.shiftKey;if(g&&!_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),g&&_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),g&&u.code==="KeyA"){u.preventDefault();const T=(p=f.activePage)===null||p===void 0?void 0:p.children.filter(P=>P.selectable),C=(T==null?void 0:T.map(P=>P.id))||[];f.selectElements(C)}if(g&&u.code==="KeyC"&&(u.preventDefault(),n=(S=f.activePage)===null||S===void 0?void 0:S.id,a(f.selectedElements.map(T=>T.toJSON()))),g&&u.code==="KeyX"&&(u.preventDefault(),n=(b=f.activePage)===null||b===void 0?void 0:b.id,a(f.selectedElements.map(T=>T.toJSON())),f.deleteElements(y)),g&&u.code==="KeyV"){u.preventDefault();let T=0;n===((m=f.activePage)===null||m===void 0?void 0:m.id)&&(T=f.width/20),n=(v=f.activePage)===null||v===void 0?void 0:v.id,f.history.transaction(()=>{const C=[],P=o();(0,t.forEveryChild)({children:P},O=>{delete O.id,O.type!=="group"&&(O.x+=T,O.y+=T)}),P.forEach(O=>{var x;const k=(x=f.activePage)===null||x===void 0?void 0:x.addElement(O);k&&C.push(k.id)}),a(P),f.selectElements(C)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(T=>{T.set({y:T.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(T=>{T.set({y:T.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(T=>{T.set({x:T.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(T=>{T.set({x:T.x+1})}))}e.handleHotkey=l})(gS);var TS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=Xi,r=(0,t.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page"}});function n(h,E){var w,p=E.split("."),S=h;for(w=0;w<p.length;++w){if(S[p[w]]==null)return;S=S[p[w]]}return S}const i=h=>h&&typeof h=="object";function a(h,E){Object.keys(E).forEach(w=>{const p=h[w],S=E[w];i(S)&&i(p)?a(p,S):h[w]=S})}function o(h,E,w=""){Object.keys(E).forEach(p=>{const S=E[p],b=w?`${w}.${p}`:p;i(S)?i(h[p])?o(h[p],S,b):console.warn(`Missing nested translation object at '${b}'`):h[p]===void 0&&console.warn(`Missing translation '${b}'`)})}e.setTranslations=(0,t.action)((h,{validate:E=!1}={})=>{E&&o(h,r),a(r,h)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=h=>{const E=n(r,h);if(E!==void 0)return E;u[h]||(u[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),p=w[w.length-1]||" ";return p.charAt(0).toUpperCase()+p.slice(1)};e.t=f})(TS);(function(e){var t=me&&me.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(Je),n=bi,i=t(t9),a=pS,o=gS,l=TS,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
296
- Width or height of parent elements is equal 0.
297
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
298
- For simpler debugging here is the log of the parent element:`,f=(p,S,b,m,v,y)=>{const d=r.default.useRef({width:S,height:b}),g=r.default.useRef({top:0,left:0}),_=r.default.useRef(!1),T=r.default.useRef(v.pages.length);_.current=T.current!==v.pages.length,T.current=v.pages.length,r.default.useEffect(()=>{const C=p.current,P=O=>{g.current={top:C.scrollTop,left:C.scrollLeft}};return C.addEventListener("scroll",P),()=>{C.removeEventListener("scroll",P)}},[]),r.default.useLayoutEffect(()=>{if(!p.current||_.current)return;const C=p.current,P=(g.current.left+C.offsetWidth/2)/d.current.width,O=(g.current.top+C.offsetHeight/2)/d.current.height;y.current=!0,C.scrollLeft=P*S-C.offsetWidth/2,C.scrollTop=O*b-C.offsetHeight/2,d.current={width:S,height:b}},[m,S,b])},h=(p,S,b,m,v)=>{const y=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const _=p.current,T=()=>{v.current};return _.addEventListener("scroll",T),()=>{_.removeEventListener("scroll",T)}},[]);const g=b.pages.indexOf(b.activePage);return r.default.useLayoutEffect(()=>{if(!b.activePage||!p.current||y.current)return;const _=p.current,T=b.pages.indexOf(b.activePage)*S;Math.abs(T-_.scrollTop)>.5*S&&(v.current=!0,_.scrollTop=T)},[b.activePage,g]),{handleScroll:_=>{if(v.current)return void(v.current=!1);y.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{y.current=!1},300);const T=_.currentTarget.childNodes[0].offsetHeight,C=_.currentTarget.scrollTop,P=Math.floor((C+m.height/3)/T),O=b.pages[P];O&&O.select()}}},E=({store:p})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{p.addPage()}},(0,l.t)("workspace.addPage"))),w=({width:p,height:S,xPadding:b,yPadding:m,backgroundColor:v})=>r.default.createElement("div",{style:{width:p+"px",height:S+"px",backgroundColor:v,paddingLeft:b+"px",paddingRight:b+"px",paddingTop:m+"px",paddingBottom:m+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:S,backgroundColor:b,pageBorderColor:m,activePageBorderColor:v,bleedColor:y,components:d,onKeyDown:g,paddingX:_,paddingY:T,altCloneEnabled:C=!0,visiblePagesOffset:P})=>{const O=_??20,x=T??55,[k,M]=r.default.useState({width:100,height:100}),I=r.default.useRef(k),H=r.default.useRef(null),G=r.default.useRef(null),Q=p.bleedVisible?Math.max(0,...p.pages.map(ee=>ee.bleed)):0,W=Math.max(...p.pages.map(ee=>ee.computedWidth)),U=Math.max(...p.pages.map(ee=>ee.computedHeight)),j=W+2*Q,A=U+2*Q,L=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(de=>setTimeout(de,50)),H.current===null)return;const ne=H.current.getBoundingClientRect();ne.width!==0&&ne.height!==0||(console.warn(u),console.log(H.current));const ie=G.current.clientWidth||ne.width,ce={width:ie,height:ne.height};(I.current.width!==ce.width||I.current.height!==ce.height)&&(M(ce),I.current=ce);const Oe=(ie-2*O)/j,Te=(ne.height-2*x)/A,ae=Math.max(Math.min(Oe,Te),.01);p.scaleToFit!==ae&&(p.setScale(ae),p._setScaleToFit(ae))};r.default.useLayoutEffect(()=>{L({skipTimeout:!0})},[]),r.default.useEffect(()=>{L()},[j,A]),r.default.useEffect(()=>{const ee=H.current;if(window.ResizeObserver){const ne=new ResizeObserver(()=>{L({skipTimeout:!0})});return ne.observe(ee),()=>ne.unobserve(ee)}{const ne=setInterval(()=>{L({skipTimeout:!0})},100);return()=>clearInterval(ne)}},[j,A]);const z=Math.max(O,(k.width-j*p.scale)/2),q=A*p.scale*p.pages.length,K=Math.max(x,(k.height-q)/p.pages.length/2);r.default.useEffect(()=>{const ee=ne=>{(g||o.handleHotkey)(ne,p)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const ne=ie=>{if(ie.ctrlKey||ie.metaKey){ie.preventDefault();const ae=Math.max(3,p.scaleToFit),de=Math.min(.1,p.scaleToFit),ye=(ce=ie.deltaY<0?1.05*p.scale:p.scale/1.05,Oe=de,Te=ae,Math.max(Oe,Math.min(Te,ce)));p.setScale(ye)}else var ce,Oe,Te};return(ee=G.current)===null||ee===void 0||ee.addEventListener("wheel",ne),()=>{var ie;return(ie=G.current)===null||ie===void 0?void 0:ie.removeEventListener("wheel",ne)}},[]);const F=r.default.useRef(!1);f(G,j*p.scale+2*z,A*p.scale+2*K,p.scale,p,F);const{handleScroll:$}=h(G,A*p.scale+2*K,p,k,F),B=k.width>=j*p.scale+2*z,Y=b||"rgba(232, 232, 232, 0.9)",X=p.pages.indexOf(p.activePage),Z=(d==null?void 0:d.NoPages)||E,te=P??Math.min(3,Math.max(1,Math.ceil(k.height/2/(A*p.scale))));return r.default.createElement("div",{ref:H,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:Y},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:G,onScroll:$,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:B?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ee,ne)=>Math.abs(ne-X)<=te||ee._exportingOrRendering?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:z,yPadding:K,width:j*p.scale+2*z,height:A*p.scale+2*K,store:p,pageControlsEnabled:S,backColor:Y,pageBorderColor:m||"lightgrey",activePageBorderColor:v||"rgb(0, 161, 255)",altCloneEnabled:C,bleedColor:y||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(w,{key:ee.id,width:j*p.scale+2*z,height:A*p.scale+2*K,backgroundColor:Y,xPadding:z,yPadding:K})),p.rulesVisible&&r.default.createElement(a.TopRules,{store:p,xPadding:z,yPadding:K,width:j*p.scale+2*z,height:A*p.scale+2*K}),p.pages.length===0&&r.default.createElement(Z,{store:p})))}),e.default=e.WorkspaceCanvas})(Vw);var yj=O2();kl.toggleFadeInAnimation(!1);Kn.setTextOverflow("change-font-size");const bj=new URLSearchParams(location.search).get("key"),AS=yj.createStore({key:bj});window.store=AS;window.config={addGlobalFont:Js.addGlobalFont,unstable_useHtmlTextRender:Kn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Kn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Kn.setTextOverflow,onLoadError:Vi.onLoadError,setAssetLoadTimeout:Vi.setAssetLoadTimeout,setFontLoadTimeout:Vi.setFontLoadTimeout};const _j=jd.createRoot(document.getElementById("root"));_j.render(dt.createElement(Vw.WorkspaceCanvas,{visiblePagesOffset:0,store:AS,components:{PageControls:()=>null,Tooltip:()=>null}}));