polotno-node 2.9.30 → 2.9.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,298 @@
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 xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function po(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:{}},pt={};/**
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 Cc=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 zs(e,t,r){this.props=e,this.context=t,this.refs=j_,this.updater=r||I_}zs.prototype.isReactComponent={};zs.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")};zs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F_(){}F_.prototype=zs.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,zs.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:Cc,type:e,key:a,ref:o,props:i,_owner:wm.current}}function NE(e,t){return{$$typeof:Cc,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===Cc}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 _d(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 Cc: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,"$&/")+"/"),_d(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+=_d(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+=_d(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 Gf(e,t,r){if(e==null)return e;var n=[],i=0;return _d(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 Kr={current:null},wd={transition:null},jE={ReactCurrentDispatcher:Kr,ReactCurrentBatchConfig:wd,ReactCurrentOwner:wm};function H_(){throw Error("act(...) is not supported in production builds of React.")}pt.Children={map:Gf,forEach:function(e,t,r){Gf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Gf(e,function(){t++}),t},toArray:function(e){return Gf(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}};pt.Component=zs;pt.Fragment=OE;pt.Profiler=PE;pt.PureComponent=bm;pt.StrictMode=xE;pt.Suspense=AE;pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jE;pt.act=H_;pt.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:Cc,type:e.type,key:i,ref:a,props:n,_owner:o}};pt.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};pt.createElement=U_;pt.createFactory=function(e){var t=U_.bind(null,e);return t.type=e,t};pt.createRef=function(){return{current:null}};pt.forwardRef=function(e){return{$$typeof:TE,render:e}};pt.isValidElement=Sm;pt.lazy=function(e){return{$$typeof:ME,_payload:{_status:-1,_result:e},_init:DE}};pt.memo=function(e,t){return{$$typeof:RE,type:e,compare:t===void 0?null:t}};pt.startTransition=function(e){var t=wd.transition;wd.transition={};try{e()}finally{wd.transition=t}};pt.unstable_act=H_;pt.useCallback=function(e,t){return Kr.current.useCallback(e,t)};pt.useContext=function(e){return Kr.current.useContext(e)};pt.useDebugValue=function(){};pt.useDeferredValue=function(e){return Kr.current.useDeferredValue(e)};pt.useEffect=function(e,t){return Kr.current.useEffect(e,t)};pt.useId=function(){return Kr.current.useId()};pt.useImperativeHandle=function(e,t,r){return Kr.current.useImperativeHandle(e,t,r)};pt.useInsertionEffect=function(e,t){return Kr.current.useInsertionEffect(e,t)};pt.useLayoutEffect=function(e,t){return Kr.current.useLayoutEffect(e,t)};pt.useMemo=function(e,t){return Kr.current.useMemo(e,t)};pt.useReducer=function(e,t,r){return Kr.current.useReducer(e,t,r)};pt.useRef=function(e){return Kr.current.useRef(e)};pt.useState=function(e){return Kr.current.useState(e)};pt.useSyncExternalStore=function(e,t,r){return Kr.current.useSyncExternalStore(e,t,r)};pt.useTransition=function(){return Kr.current.useTransition()};pt.version="18.3.1";N_.exports=pt;var Ze=N_.exports;const ht=xh(Ze);var Dd={},$_={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(B,F){var T=B.length;B.push(F);e:for(;0<T;){var L=T-1>>>1,z=B[L];if(0<i(z,F))B[L]=F,B[T]=z,T=L;else break e}}function r(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var F=B[0],T=B.pop();if(T!==F){B[0]=T;e:for(var L=0,z=B.length,D=z>>>1;L<D;){var $=2*(L+1)-1,K=B[$],V=$+1,U=B[V];if(0>i(K,T))V<z&&0>i(U,K)?(B[L]=U,B[V]=T,L=V):(B[L]=K,B[$]=T,L=$);else if(V<z&&0>i(U,T))B[L]=U,B[V]=T,L=V;else break e}}return F}function i(B,F){var T=B.sortIndex-F.sortIndex;return T!==0?T:B.id-F.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=[],p=1,E=null,w=3,m=!1,S=!1,b=!1,g=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(B){for(var F=r(f);F!==null;){if(F.callback===null)n(f);else if(F.startTime<=B)n(f),F.sortIndex=F.expirationTime,t(u,F);else break;F=r(f)}}function y(B){if(b=!1,d(B),!S)if(r(u)!==null)S=!0,Z(_);else{var F=r(f);F!==null&&W(y,F.startTime-B)}}function _(B,F){S=!1,b&&(b=!1,h(x),x=-1),m=!0;var T=w;try{for(d(F),E=r(u);E!==null&&(!(E.expirationTime>F)||B&&!k());){var L=E.callback;if(typeof L=="function"){E.callback=null,w=E.priorityLevel;var z=L(E.expirationTime<=F);F=e.unstable_now(),typeof z=="function"?E.callback=z:E===r(u)&&n(u),d(F)}else n(u);E=r(u)}if(E!==null)var D=!0;else{var $=r(f);$!==null&&W(y,$.startTime-F),D=!1}return D}finally{E=null,w=T,m=!1}}var R=!1,C=null,x=-1,O=5,P=-1;function k(){return!(e.unstable_now()-P<O)}function M(){if(C!==null){var B=e.unstable_now();P=B;var F=!0;try{F=C(!0,B)}finally{F?I():(R=!1,C=null)}}else R=!1}var I;if(typeof v=="function")I=function(){v(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(){g(M,0)};function Z(B){C=B,R||(R=!0,I())}function W(B,F){x=g(function(){B(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){S||m||(S=!0,Z(_))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(B){switch(w){case 1:case 2:case 3:var F=3;break;default:F=w}var T=w;w=F;try{return B()}finally{w=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,F){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var T=w;w=B;try{return F()}finally{w=T}},e.unstable_scheduleCallback=function(B,F,T){var L=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?L+T:L):T=L,B){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=T+z,B={id:p++,callback:F,priorityLevel:B,startTime:T,expirationTime:z,sortIndex:-1},T>L?(B.sortIndex=T,t(f,B),r(u)===null&&B===r(f)&&(b?(h(x),x=-1):b=!0,W(y,T-L))):(B.sortIndex=z,t(u,B),S||m||(S=!0,Z(_))),B},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(B){var F=w;return function(){var T=w;w=F;try{return B.apply(this,arguments)}finally{w=T}}}})(V_);G_.exports=V_;var zu=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=Ze,Pn=zu;function Ce(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,Ju={};function cl(e,t){ms(e,t),ms(e+"Capture",t)}function ms(e,t){for(Ju[e]=t,e=0;e<t.length;e++)q_.add(t[e])}var va=!(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 Yr(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 Rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rr[e]=new Yr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rr[t]=new Yr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rr[e]=new Yr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rr[e]=new Yr(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){Rr[e]=new Yr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rr[e]=new Yr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rr[e]=new Yr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rr[e]=new Yr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rr[e]=new Yr(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);Rr[t]=new Yr(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);Rr[t]=new Yr(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);Rr[t]=new Yr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rr[e]=new Yr(e,1,!1,e.toLowerCase(),null,!1,!1)});Rr.xlinkHref=new Yr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rr[e]=new Yr(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,r,n){var i=Rr.hasOwnProperty(t)?Rr[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 Sa=FE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Vf=Symbol.for("react.element"),Yl=Symbol.for("react.portal"),Xl=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"),Ga=Symbol.for("react.lazy"),Y_=Symbol.for("react.offscreen"),f3=Symbol.iterator;function Su(e){return e===null||typeof e!="object"?null:(e=f3&&e[f3]||e["@@iterator"],typeof e=="function"?e:null)}var Xt=Object.assign,d1;function Nu(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:"")?Nu(e):""}function $E(e){switch(e.tag){case 5:return Nu(e.type);case 16:return Nu("Lazy");case 13:return Nu("Suspense");case 19:return Nu("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 Xl:return"Fragment";case Yl: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 Ga: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 so(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 qf(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 jd(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 Xt({},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=so(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=so(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,so(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"||jd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Iu=Array.isArray;function cs(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=""+so(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(Ce(91));return Xt({},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(Ce(92));if(Iu(r)){if(1<r.length)throw Error(Ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:so(r)}}function J_(e,t){var r=so(t.value),n=so(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 Wf,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(Wf=Wf||document.createElement("div"),Wf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ec(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Bu={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(Bu).forEach(function(e){qE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bu[t]=Bu[e]})});function r6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Bu.hasOwnProperty(e)&&Bu[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=Xt({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(Ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ce(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,fs=null,ds=null;function v3(e){if(e=Ac(e)){if(typeof gv!="function")throw Error(Ce(280));var t=e.stateNode;t&&(t=Ah(t),gv(e.stateNode,e.type,t))}}function i6(e){fs?ds?ds.push(e):ds=[e]:fs=e}function a6(){if(fs){var e=fs,t=ds;if(ds=fs=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,(fs!==null||ds!==null)&&(l6(),a6())}}function tc(e,t){var r=e.stateNode;if(r===null)return null;var n=Ah(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(Ce(231,t,typeof r));return r}var vv=!1;if(va)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}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(p){this.onError(p)}}var Uu=!1,Fd=null,zd=!1,mv=null,YE={onError:function(e){Uu=!0,Fd=e}};function XE(e,t,r,n,i,a,o,l,u){Uu=!1,Fd=null,KE.apply(YE,arguments)}function ZE(e,t,r,n,i,a,o,l,u){if(XE.apply(this,arguments),Uu){if(Uu){var f=Fd;Uu=!1,Fd=null}else throw Error(Ce(198));zd||(zd=!0,mv=f)}}function fl(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(fl(e)!==e)throw Error(Ce(188))}function QE(e){var t=e.alternate;if(!t){if(t=fl(e),t===null)throw Error(Ce(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(Ce(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(Ce(189))}}if(r.alternate!==n)throw Error(Ce(190))}if(r.tag!==3)throw Error(Ce(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,rr=Pn.unstable_now,tO=Pn.unstable_getCurrentPriorityLevel,Am=Pn.unstable_ImmediatePriority,h6=Pn.unstable_UserBlockingPriority,Bd=Pn.unstable_NormalPriority,rO=Pn.unstable_LowPriority,p6=Pn.unstable_IdlePriority,Ph=null,zi=null;function nO(e){if(zi&&typeof zi.onCommitFiberRoot=="function")try{zi.onCommitFiberRoot(Ph,e,void 0,(e.current.flags&128)===128)}catch{}}var fi=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 Kf=64,Yf=4194304;function Du(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 Ud(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=Du(l):(a&=o,a!==0&&(n=Du(a)))}else o=r&~i,o!==0?n=Du(o):a!==0&&(n=Du(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-fi(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-fi(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=Kf;return Kf<<=1,!(Kf&4194240)&&(Kf=64),e}function v1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function kc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(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-fi(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-fi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Pt=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,Xf=[],Qa=null,Ja=null,eo=null,rc=new Map,nc=new Map,qa=[],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":Qa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":eo=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(t.pointerId)}}function Ou(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=Ac(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 Qa=Ou(Qa,e,t,r,n,i),!0;case"dragenter":return Ja=Ou(Ja,e,t,r,n,i),!0;case"mouseover":return eo=Ou(eo,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return rc.set(a,Ou(rc.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,nc.set(a,Ou(nc.get(a)||null,e,t,r,n,i)),!0}return!1}function w6(e){var t=Vo(e.target);if(t!==null){var r=fl(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 Sd(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=Ac(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function _3(e,t,r){Sd(e)&&r.delete(t)}function dO(){bv=!1,Qa!==null&&Sd(Qa)&&(Qa=null),Ja!==null&&Sd(Ja)&&(Ja=null),eo!==null&&Sd(eo)&&(eo=null),rc.forEach(_3),nc.forEach(_3)}function xu(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,dO)))}function ic(e){function t(i){return xu(i,e)}if(0<Xf.length){xu(Xf[0],e);for(var r=1;r<Xf.length;r++){var n=Xf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Qa!==null&&xu(Qa,e),Ja!==null&&xu(Ja,e),eo!==null&&xu(eo,e),rc.forEach(t),nc.forEach(t),r=0;r<qa.length;r++)n=qa[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<qa.length&&(r=qa[0],r.blockedOn===null);)w6(r),r.blockedOn===null&&qa.shift()}var hs=Sa.ReactCurrentBatchConfig,Hd=!0;function hO(e,t,r,n){var i=Pt,a=hs.transition;hs.transition=null;try{Pt=1,Lm(e,t,r,n)}finally{Pt=i,hs.transition=a}}function pO(e,t,r,n){var i=Pt,a=hs.transition;hs.transition=null;try{Pt=4,Lm(e,t,r,n)}finally{Pt=i,hs.transition=a}}function Lm(e,t,r,n){if(Hd){var i=_v(e,t,r,n);if(i===null)P1(e,t,n,$d,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=Ac(i);if(a!==null&&m6(a),a=_v(e,t,r,n),a===null&&P1(e,t,n,$d,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else P1(e,t,n,null,r)}}var $d=null;function _v(e,t,r,n){if($d=null,e=Tm(n),e=Vo(e),e!==null)if(t=fl(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 $d=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 Bd:case rO:return 16;case p6:return 536870912;default:return 16}default:return 16}}var Ya=null,Nm=null,Ed=null;function E6(){if(Ed)return Ed;var e,t=Nm,r=t.length,n,i="value"in Ya?Ya.value:Ya.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 Ed=i.slice(e,1<n?1-n:void 0)}function Od(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 Zf(){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)?Zf:w3,this.isPropagationStopped=w3,this}return Xt(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=Zf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),t}var Bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Tn(Bs),Tc=Xt({},Bs,{view:0,detail:0}),gO=Tn(Tc),m1,y1,Pu,Ch=Xt({},Tc,{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!==Pu&&(Pu&&e.type==="mousemove"?(m1=e.screenX-Pu.screenX,y1=e.screenY-Pu.screenY):y1=m1=0,Pu=e),m1)},movementY:function(e){return"movementY"in e?e.movementY:y1}}),S3=Tn(Ch),vO=Xt({},Ch,{dataTransfer:0}),mO=Tn(vO),yO=Xt({},Tc,{relatedTarget:0}),b1=Tn(yO),bO=Xt({},Bs,{animationName:0,elapsedTime:0,pseudoElement:0}),_O=Tn(bO),wO=Xt({},Bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),SO=Tn(wO),EO=Xt({},Bs,{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=Xt({},Tc,{key:function(e){if(e.key){var t=OO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Od(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"?Od(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Od(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TO=Tn(kO),AO=Xt({},Ch,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O3=Tn(AO),RO=Xt({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),MO=Tn(RO),LO=Xt({},Bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),NO=Tn(LO),IO=Xt({},Ch,{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=va&&"CompositionEvent"in window,Hu=null;va&&"documentMode"in document&&(Hu=document.documentMode);var FO=va&&"TextEvent"in window&&!Hu,O6=va&&(!jm||Hu&&8<Hu&&11>=Hu),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 Zl=!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(Zl)return e==="compositionend"||!jm&&x6(e,t)?(e=E6(),Ed=Nm=Ya=null,Zl=!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=Gd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var $u=null,ac=null;function HO(e){F6(e,0)}function kh(e){var t=es(e);if(Z_(t))return e}function $O(e,t){if(e==="change")return t}var k6=!1;if(va){var _1;if(va){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(){$u&&($u.detachEvent("onpropertychange",T6),ac=$u=null)}function T6(e){if(e.propertyName==="value"&&kh(ac)){var t=[];C6(t,ac,e,Tm(e)),s6(HO,t)}}function GO(e,t,r){e==="focusin"?(T3(),$u=t,ac=r,$u.attachEvent("onpropertychange",T6)):e==="focusout"&&T3()}function VO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kh(ac)}function qO(e,t){if(e==="click")return kh(t)}function WO(e,t){if(e==="input"||e==="change")return kh(t)}function KO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mi=typeof Object.is=="function"?Object.is:KO;function oc(e,t){if(mi(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)||!mi(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=jd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=jd(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=va&&"documentMode"in document&&11>=document.documentMode,Ql=null,wv=null,Gu=null,Sv=!1;function M3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||Ql==null||Ql!==jd(n)||(n=Ql,"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}),Gu&&oc(Gu,n)||(Gu=n,n=Gd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ql)))}function Qf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Jl={animationend:Qf("Animation","AnimationEnd"),animationiteration:Qf("Animation","AnimationIteration"),animationstart:Qf("Animation","AnimationStart"),transitionend:Qf("Transition","TransitionEnd")},S1={},M6={};va&&(M6=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function Th(e){if(S1[e])return S1[e];if(!Jl[e])return e;var t=Jl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in M6)return S1[e]=t[r];return e}var L6=Th("animationend"),N6=Th("animationiteration"),I6=Th("animationstart"),D6=Th("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 go(e,t){j6.set(e,t),cl(t,[e])}for(var E1=0;E1<L3.length;E1++){var O1=L3[E1],ZO=O1.toLowerCase(),QO=O1[0].toUpperCase()+O1.slice(1);go(ZO,"on"+QO)}go(L6,"onAnimationEnd");go(N6,"onAnimationIteration");go(I6,"onAnimationStart");go("dblclick","onDoubleClick");go("focusin","onFocus");go("focusout","onBlur");go(D6,"onTransitionEnd");ms("onMouseEnter",["mouseout","mouseover"]);ms("onMouseLeave",["mouseout","mouseover"]);ms("onPointerEnter",["pointerout","pointerover"]);ms("onPointerLeave",["pointerout","pointerover"]);cl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cl("onBeforeInput",["compositionend","keypress","textInput","paste"]);cl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ju="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(ju));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(zd)throw e=mv,zd=!1,mv=null,e}function zt(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 Jf="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[Jf]){e[Jf]=!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[Jf]||(t[Jf]=!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=Vo(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,p=Tm(r),E=[];e:{var w=j6.get(e);if(w!==void 0){var m=Im,S=e;switch(e){case"keypress":if(Od(r)===0)break e;case"keydown":case"keyup":m=TO;break;case"focusin":S="focus",m=b1;break;case"focusout":S="blur",m=b1;break;case"beforeblur":case"afterblur":m=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":m=S3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=mO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=MO;break;case L6:case N6:case I6:m=_O;break;case D6:m=NO;break;case"scroll":m=gO;break;case"wheel":m=DO;break;case"copy":case"cut":case"paste":m=SO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=O3}var b=(t&4)!==0,g=!b&&e==="scroll",h=b?w!==null?w+"Capture":null:w;b=[];for(var v=f,d;v!==null;){d=v;var y=d.stateNode;if(d.tag===5&&y!==null&&(d=y,h!==null&&(y=tc(v,h),y!=null&&b.push(sc(v,y,d)))),g)break;v=v.return}0<b.length&&(w=new m(w,S,null,r,p),E.push({event:w,listeners:b}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",w&&r!==pv&&(S=r.relatedTarget||r.fromElement)&&(Vo(S)||S[ma]))break e;if((m||w)&&(w=p.window===p?p:(w=p.ownerDocument)?w.defaultView||w.parentWindow:window,m?(S=r.relatedTarget||r.toElement,m=f,S=S?Vo(S):null,S!==null&&(g=fl(S),S!==g||S.tag!==5&&S.tag!==6)&&(S=null)):(m=null,S=f),m!==S)){if(b=S3,y="onMouseLeave",h="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=O3,y="onPointerLeave",h="onPointerEnter",v="pointer"),g=m==null?w:es(m),d=S==null?w:es(S),w=new b(y,v+"leave",m,r,p),w.target=g,w.relatedTarget=d,y=null,Vo(p)===f&&(b=new b(h,v+"enter",S,r,p),b.target=d,b.relatedTarget=g,y=b),g=y,m&&S)t:{for(b=m,h=S,v=0,d=b;d;d=$l(d))v++;for(d=0,y=h;y;y=$l(y))d++;for(;0<v-d;)b=$l(b),v--;for(;0<d-v;)h=$l(h),d--;for(;v--;){if(b===h||h!==null&&b===h.alternate)break t;b=$l(b),h=$l(h)}b=null}else b=null;m!==null&&I3(E,w,m,b,!1),S!==null&&g!==null&&I3(E,g,S,b,!0)}}e:{if(w=f?es(f):window,m=w.nodeName&&w.nodeName.toLowerCase(),m==="select"||m==="input"&&w.type==="file")var _=$O;else if(C3(w))if(k6)_=WO;else{_=VO;var R=GO}else(m=w.nodeName)&&m.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(_=qO);if(_&&(_=_(e,f))){C6(E,_,r,p);break e}R&&R(e,w,f),e==="focusout"&&(R=w._wrapperState)&&R.controlled&&w.type==="number"&&uv(w,"number",w.value)}switch(R=f?es(f):window,e){case"focusin":(C3(R)||R.contentEditable==="true")&&(Ql=R,wv=f,Gu=null);break;case"focusout":Gu=wv=Ql=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,M3(E,r,p);break;case"selectionchange":if(XO)break;case"keydown":case"keyup":M3(E,r,p)}var C;if(jm)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Zl?x6(e,r)&&(x="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(x="onCompositionStart");x&&(O6&&r.locale!=="ko"&&(Zl||x!=="onCompositionStart"?x==="onCompositionEnd"&&Zl&&(C=E6()):(Ya=p,Nm="value"in Ya?Ya.value:Ya.textContent,Zl=!0)),R=Gd(f,x),0<R.length&&(x=new E3(x,e,null,r,p),E.push({event:x,listeners:R}),C?x.data=C:(C=P6(r),C!==null&&(x.data=C)))),(C=FO?zO(e,r):BO(e,r))&&(f=Gd(f,"onBeforeInput"),0<f.length&&(p=new E3("onBeforeInput","beforeinput",null,r,p),E.push({event:p,listeners:f}),p.data=C))}F6(E,t)})}function sc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Gd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tc(e,r),a!=null&&n.unshift(sc(e,a,i)),a=tc(e,t),a!=null&&n.push(sc(e,a,i))),e=e.return}return n}function $l(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=tc(r,a),u!=null&&o.unshift(sc(r,u,l))):i||(u=tc(r,a),u!=null&&o.push(sc(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 ed(e,t,r){if(t=D3(t),D3(e)!==t&&r)throw Error(Ce(425))}function Vd(){}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),ic(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ic(t)}function to(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 Us=Math.random().toString(36).slice(2),Ii="__reactFiber$"+Us,uc="__reactProps$"+Us,ma="__reactContainer$"+Us,Cv="__reactEvents$"+Us,ax="__reactListeners$"+Us,ox="__reactHandles$"+Us;function Vo(e){var t=e[Ii];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ma]||r[Ii]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=F3(e);e!==null;){if(r=e[Ii])return r;e=F3(e)}return t}e=r,r=e.parentNode}return null}function Ac(e){return e=e[Ii]||e[ma],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ce(33))}function Ah(e){return e[uc]||null}var kv=[],ts=-1;function vo(e){return{current:e}}function Bt(e){0>ts||(e.current=kv[ts],kv[ts]=null,ts--)}function Nt(e,t){ts++,kv[ts]=e.current,e.current=t}var uo={},Ur=vo(uo),hn=vo(!1),Jo=uo;function ys(e,t){var r=e.type.contextTypes;if(!r)return uo;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 pn(e){return e=e.childContextTypes,e!=null}function qd(){Bt(hn),Bt(Ur)}function z3(e,t,r){if(Ur.current!==uo)throw Error(Ce(168));Nt(Ur,t),Nt(hn,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(Ce(108,GE(e)||"Unknown",i));return Xt({},r,n)}function Wd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||uo,Jo=Ur.current,Nt(Ur,e),Nt(hn,hn.current),!0}function B3(e,t,r){var n=e.stateNode;if(!n)throw Error(Ce(169));r?(e=B6(e,t,Jo),n.__reactInternalMemoizedMergedChildContext=e,Bt(hn),Bt(Ur),Nt(Ur,e)):Bt(hn),Nt(hn,r)}var la=null,Rh=!1,k1=!1;function U6(e){la===null?la=[e]:la.push(e)}function lx(e){Rh=!0,U6(e)}function mo(){if(!k1&&la!==null){k1=!0;var e=0,t=Pt;try{var r=la;for(Pt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}la=null,Rh=!1}catch(i){throw la!==null&&(la=la.slice(e+1)),d6(Am,mo),i}finally{Pt=t,k1=!1}}return null}var rs=[],ns=0,Kd=null,Yd=0,$n=[],Gn=0,el=null,ua=1,ca="";function $o(e,t){rs[ns++]=Yd,rs[ns++]=Kd,Kd=e,Yd=t}function H6(e,t,r){$n[Gn++]=ua,$n[Gn++]=ca,$n[Gn++]=el,el=e;var n=ua;e=ca;var i=32-fi(n)-1;n&=~(1<<i),r+=1;var a=32-fi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,ua=1<<32-fi(t)+i|r<<i|n,ca=a+e}else ua=1<<a|r<<i|n,ca=e}function zm(e){e.return!==null&&($o(e,1),H6(e,1,0))}function Bm(e){for(;e===Kd;)Kd=rs[--ns],rs[ns]=null,Yd=rs[--ns],rs[ns]=null;for(;e===el;)el=$n[--Gn],$n[Gn]=null,ca=$n[--Gn],$n[Gn]=null,ua=$n[--Gn],$n[Gn]=null}var xn=null,On=null,Gt=!1,ci=null;function $6(e,t){var r=Wn(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=to(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=el!==null?{id:ua,overflow:ca}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Wn(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(Gt){var t=On;if(t){var r=t;if(!U3(e,t)){if(Tv(e))throw Error(Ce(418));t=to(r.nextSibling);var n=xn;t&&U3(e,t)?$6(n,r):(e.flags=e.flags&-4097|2,Gt=!1,xn=e)}}else{if(Tv(e))throw Error(Ce(418));e.flags=e.flags&-4097|2,Gt=!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 td(e){if(e!==xn)return!1;if(!Gt)return H3(e),Gt=!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(Ce(418));for(;t;)$6(e,t),t=to(t.nextSibling)}if(H3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){On=to(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}On=null}}else On=xn?to(e.stateNode.nextSibling):null;return!0}function G6(){for(var e=On;e;)e=to(e.nextSibling)}function bs(){On=xn=null,Gt=!1}function Um(e){ci===null?ci=[e]:ci.push(e)}var sx=Sa.ReactCurrentBatchConfig;function Cu(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(Ce(309));var n=r.stateNode}if(!n)throw Error(Ce(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(Ce(284));if(!r._owner)throw Error(Ce(290,e))}return e}function rd(e,t){throw e=Object.prototype.toString.call(t),Error(Ce(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(h,v){if(e){var d=h.deletions;d===null?(h.deletions=[v],h.flags|=16):d.push(v)}}function r(h,v){if(!e)return null;for(;v!==null;)t(h,v),v=v.sibling;return null}function n(h,v){for(h=new Map;v!==null;)v.key!==null?h.set(v.key,v):h.set(v.index,v),v=v.sibling;return h}function i(h,v){return h=ao(h,v),h.index=0,h.sibling=null,h}function a(h,v,d){return h.index=d,e?(d=h.alternate,d!==null?(d=d.index,d<v?(h.flags|=2,v):d):(h.flags|=2,v)):(h.flags|=1048576,v)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function l(h,v,d,y){return v===null||v.tag!==6?(v=I1(d,h.mode,y),v.return=h,v):(v=i(v,d),v.return=h,v)}function u(h,v,d,y){var _=d.type;return _===Xl?p(h,v,d.props.children,y,d.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ga&&$3(_)===v.type)?(y=i(v,d.props),y.ref=Cu(h,v,d),y.return=h,y):(y=Rd(d.type,d.key,d.props,null,h.mode,y),y.ref=Cu(h,v,d),y.return=h,y)}function f(h,v,d,y){return v===null||v.tag!==4||v.stateNode.containerInfo!==d.containerInfo||v.stateNode.implementation!==d.implementation?(v=D1(d,h.mode,y),v.return=h,v):(v=i(v,d.children||[]),v.return=h,v)}function p(h,v,d,y,_){return v===null||v.tag!==7?(v=Xo(d,h.mode,y,_),v.return=h,v):(v=i(v,d),v.return=h,v)}function E(h,v,d){if(typeof v=="string"&&v!==""||typeof v=="number")return v=I1(""+v,h.mode,d),v.return=h,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Vf:return d=Rd(v.type,v.key,v.props,null,h.mode,d),d.ref=Cu(h,null,v),d.return=h,d;case Yl:return v=D1(v,h.mode,d),v.return=h,v;case Ga:var y=v._init;return E(h,y(v._payload),d)}if(Iu(v)||Su(v))return v=Xo(v,h.mode,d,null),v.return=h,v;rd(h,v)}return null}function w(h,v,d,y){var _=v!==null?v.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return _!==null?null:l(h,v,""+d,y);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Vf:return d.key===_?u(h,v,d,y):null;case Yl:return d.key===_?f(h,v,d,y):null;case Ga:return _=d._init,w(h,v,_(d._payload),y)}if(Iu(d)||Su(d))return _!==null?null:p(h,v,d,y,null);rd(h,d)}return null}function m(h,v,d,y,_){if(typeof y=="string"&&y!==""||typeof y=="number")return h=h.get(d)||null,l(v,h,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Vf:return h=h.get(y.key===null?d:y.key)||null,u(v,h,y,_);case Yl:return h=h.get(y.key===null?d:y.key)||null,f(v,h,y,_);case Ga:var R=y._init;return m(h,v,d,R(y._payload),_)}if(Iu(y)||Su(y))return h=h.get(d)||null,p(v,h,y,_,null);rd(v,y)}return null}function S(h,v,d,y){for(var _=null,R=null,C=v,x=v=0,O=null;C!==null&&x<d.length;x++){C.index>x?(O=C,C=null):O=C.sibling;var P=w(h,C,d[x],y);if(P===null){C===null&&(C=O);break}e&&C&&P.alternate===null&&t(h,C),v=a(P,v,x),R===null?_=P:R.sibling=P,R=P,C=O}if(x===d.length)return r(h,C),Gt&&$o(h,x),_;if(C===null){for(;x<d.length;x++)C=E(h,d[x],y),C!==null&&(v=a(C,v,x),R===null?_=C:R.sibling=C,R=C);return Gt&&$o(h,x),_}for(C=n(h,C);x<d.length;x++)O=m(C,h,x,d[x],y),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?x:O.key),v=a(O,v,x),R===null?_=O:R.sibling=O,R=O);return e&&C.forEach(function(k){return t(h,k)}),Gt&&$o(h,x),_}function b(h,v,d,y){var _=Su(d);if(typeof _!="function")throw Error(Ce(150));if(d=_.call(d),d==null)throw Error(Ce(151));for(var R=_=null,C=v,x=v=0,O=null,P=d.next();C!==null&&!P.done;x++,P=d.next()){C.index>x?(O=C,C=null):O=C.sibling;var k=w(h,C,P.value,y);if(k===null){C===null&&(C=O);break}e&&C&&k.alternate===null&&t(h,C),v=a(k,v,x),R===null?_=k:R.sibling=k,R=k,C=O}if(P.done)return r(h,C),Gt&&$o(h,x),_;if(C===null){for(;!P.done;x++,P=d.next())P=E(h,P.value,y),P!==null&&(v=a(P,v,x),R===null?_=P:R.sibling=P,R=P);return Gt&&$o(h,x),_}for(C=n(h,C);!P.done;x++,P=d.next())P=m(C,h,x,P.value,y),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?x:P.key),v=a(P,v,x),R===null?_=P:R.sibling=P,R=P);return e&&C.forEach(function(M){return t(h,M)}),Gt&&$o(h,x),_}function g(h,v,d,y){if(typeof d=="object"&&d!==null&&d.type===Xl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Vf:e:{for(var _=d.key,R=v;R!==null;){if(R.key===_){if(_=d.type,_===Xl){if(R.tag===7){r(h,R.sibling),v=i(R,d.props.children),v.return=h,h=v;break e}}else if(R.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ga&&$3(_)===R.type){r(h,R.sibling),v=i(R,d.props),v.ref=Cu(h,R,d),v.return=h,h=v;break e}r(h,R);break}else t(h,R);R=R.sibling}d.type===Xl?(v=Xo(d.props.children,h.mode,y,d.key),v.return=h,h=v):(y=Rd(d.type,d.key,d.props,null,h.mode,y),y.ref=Cu(h,v,d),y.return=h,h=y)}return o(h);case Yl:e:{for(R=d.key;v!==null;){if(v.key===R)if(v.tag===4&&v.stateNode.containerInfo===d.containerInfo&&v.stateNode.implementation===d.implementation){r(h,v.sibling),v=i(v,d.children||[]),v.return=h,h=v;break e}else{r(h,v);break}else t(h,v);v=v.sibling}v=D1(d,h.mode,y),v.return=h,h=v}return o(h);case Ga:return R=d._init,g(h,v,R(d._payload),y)}if(Iu(d))return S(h,v,d,y);if(Su(d))return b(h,v,d,y);rd(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,v!==null&&v.tag===6?(r(h,v.sibling),v=i(v,d),v.return=h,h=v):(r(h,v),v=I1(d,h.mode,y),v.return=h,h=v),o(h)):r(h,v)}return g}var _s=V6(!0),q6=V6(!1),Xd=vo(null),Zd=null,is=null,Hm=null;function $m(){Hm=is=Zd=null}function Gm(e){var t=Xd.current;Bt(Xd),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 ps(e,t){Zd=e,Hm=is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(cn=!0),e.firstContext=null)}function Xn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},is===null){if(Zd===null)throw Error(Ce(308));is=e,Zd.dependencies={lanes:0,firstContext:e}}else is=is.next=e;return t}var qo=null;function Vm(e){qo===null?qo=[e]:qo.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,ya(e,n)}function ya(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 Va=!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 fa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ro(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,mt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ya(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,ya(e,r)}function xd(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 Qd(e,t,r,n){var i=e.updateQueue;Va=!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 p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==o&&(l===null?p.firstBaseUpdate=f:l.next=f,p.lastBaseUpdate=u))}if(a!==null){var E=i.baseState;o=0,p=f=u=null,l=a;do{var w=l.lane,m=l.eventTime;if((n&w)===w){p!==null&&(p=p.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var S=e,b=l;switch(w=t,m=r,b.tag){case 1:if(S=b.payload,typeof S=="function"){E=S.call(m,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(m,E,w):S,w==null)break e;E=Xt({},E,w);break e;case 2:Va=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else m={eventTime:m,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(f=p=m,u=E):p=p.next=m,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(p===null&&(u=E),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=p,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);rl|=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(Ce(191,i));i.call(n)}}}var Rc={},Bi=vo(Rc),cc=vo(Rc),fc=vo(Rc);function Wo(e){if(e===Rc)throw Error(Ce(174));return e}function Wm(e,t){switch(Nt(fc,t),Nt(cc,e),Nt(Bi,Rc),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)}Bt(Bi),Nt(Bi,t)}function ws(){Bt(Bi),Bt(cc),Bt(fc)}function Y6(e){Wo(fc.current);var t=Wo(Bi.current),r=fv(t,e.type);t!==r&&(Nt(cc,e),Nt(Bi,r))}function Km(e){cc.current===e&&(Bt(Bi),Bt(cc))}var Kt=vo(0);function Jd(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 Pd=Sa.ReactCurrentDispatcher,A1=Sa.ReactCurrentBatchConfig,tl=0,Yt=null,cr=null,Sr=null,eh=!1,Vu=!1,dc=0,ux=0;function Fr(){throw Error(Ce(321))}function Xm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!mi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(tl=a,Yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pd.current=e===null||e.memoizedState===null?hx:px,e=r(n,i),Vu){a=0;do{if(Vu=!1,dc=0,25<=a)throw Error(Ce(301));a+=1,Sr=cr=null,t.updateQueue=null,Pd.current=gx,e=r(n,i)}while(Vu)}if(Pd.current=th,t=cr!==null&&cr.next!==null,tl=0,Sr=cr=Yt=null,eh=!1,t)throw Error(Ce(300));return e}function Qm(){var e=dc!==0;return dc=0,e}function Ni(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?Yt.memoizedState=Sr=e:Sr=Sr.next=e,Sr}function Zn(){if(cr===null){var e=Yt.alternate;e=e!==null?e.memoizedState:null}else e=cr.next;var t=Sr===null?Yt.memoizedState:Sr.next;if(t!==null)Sr=t,cr=e;else{if(e===null)throw Error(Ce(310));cr=e,e={memoizedState:cr.memoizedState,baseState:cr.baseState,baseQueue:cr.baseQueue,queue:cr.queue,next:null},Sr===null?Yt.memoizedState=Sr=e:Sr=Sr.next=e}return Sr}function hc(e,t){return typeof t=="function"?t(e):t}function R1(e){var t=Zn(),r=t.queue;if(r===null)throw Error(Ce(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 p=f.lane;if((tl&p)===p)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:p,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=E,o=n):u=u.next=E,Yt.lanes|=p,rl|=p}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,mi(n,t.memoizedState)||(cn=!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,Yt.lanes|=a,rl|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function M1(e){var t=Zn(),r=t.queue;if(r===null)throw Error(Ce(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);mi(a,t.memoizedState)||(cn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function X6(){}function Z6(e,t){var r=Yt,n=Zn(),i=t(),a=!mi(n.memoizedState,i);if(a&&(n.memoizedState=i,cn=!0),n=n.queue,Jm(ew.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Sr!==null&&Sr.memoizedState.tag&1){if(r.flags|=2048,pc(9,J6.bind(null,r,n,i,t),void 0,null),Er===null)throw Error(Ce(349));tl&30||Q6(r,t,i)}return i}function Q6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.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!mi(e,r)}catch{return!0}}function rw(e){var t=ya(e,1);t!==null&&di(t,e,1,-1)}function q3(e){var t=Ni();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hc,lastRenderedState:e},t.queue=e,e=e.dispatch=dx.bind(null,Yt,e),[t.memoizedState,e]}function pc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.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 Zn().memoizedState}function Cd(e,t,r,n){var i=Ni();Yt.flags|=e,i.memoizedState=pc(1|t,r,void 0,n===void 0?null:n)}function Mh(e,t,r,n){var i=Zn();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=pc(t,r,a,n);return}}Yt.flags|=e,i.memoizedState=pc(1|t,r,a,n)}function W3(e,t){return Cd(8390656,8,e,t)}function Jm(e,t){return Mh(2048,8,e,t)}function iw(e,t){return Mh(4,2,e,t)}function aw(e,t){return Mh(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,Mh(4,4,ow.bind(null,t,e),r)}function ey(){}function sw(e,t){var r=Zn();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=Zn();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 tl&21?(mi(r,t)||(r=g6(),Yt.lanes|=r,rl|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,cn=!0),e.memoizedState=r)}function cx(e,t){var r=Pt;Pt=r!==0&&4>r?r:4,e(!0);var n=A1.transition;A1.transition={};try{e(!1),t()}finally{Pt=r,A1.transition=n}}function fw(){return Zn().memoizedState}function fx(e,t,r){var n=io(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=qr();di(r,e,n,i),pw(r,t,n)}}function dx(e,t,r){var n=io(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,mi(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=qr(),di(r,e,n,i),pw(r,t,n))}}function dw(e){var t=e.alternate;return e===Yt||t!==null&&t===Yt}function hw(e,t){Vu=eh=!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 th={readContext:Xn,useCallback:Fr,useContext:Fr,useEffect:Fr,useImperativeHandle:Fr,useInsertionEffect:Fr,useLayoutEffect:Fr,useMemo:Fr,useReducer:Fr,useRef:Fr,useState:Fr,useDebugValue:Fr,useDeferredValue:Fr,useTransition:Fr,useMutableSource:Fr,useSyncExternalStore:Fr,useId:Fr,unstable_isNewReconciler:!1},hx={readContext:Xn,useCallback:function(e,t){return Ni().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:W3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Cd(4194308,4,ow.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cd(4,2,e,t)},useMemo:function(e,t){var r=Ni();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ni();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,Yt,e),[n.memoizedState,e]},useRef:function(e){var t=Ni();return e={current:e},t.memoizedState=e},useState:q3,useDebugValue:ey,useDeferredValue:function(e){return Ni().memoizedState=e},useTransition:function(){var e=q3(!1),t=e[0];return e=cx.bind(null,e[1]),Ni().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Yt,i=Ni();if(Gt){if(r===void 0)throw Error(Ce(407));r=r()}else{if(r=t(),Er===null)throw Error(Ce(349));tl&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,pc(9,J6.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ni(),t=Er.identifierPrefix;if(Gt){var r=ca,n=ua;r=(n&~(1<<32-fi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=dc++,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:Xn,useCallback:sw,useContext:Xn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:R1,useRef:nw,useState:function(){return R1(hc)},useDebugValue:ey,useDeferredValue:function(e){var t=Zn();return cw(t,cr.memoizedState,e)},useTransition:function(){var e=R1(hc)[0],t=Zn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1},gx={readContext:Xn,useCallback:sw,useContext:Xn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:M1,useRef:nw,useState:function(){return M1(hc)},useDebugValue:ey,useDeferredValue:function(e){var t=Zn();return cr===null?t.memoizedState=e:cw(t,cr.memoizedState,e)},useTransition:function(){var e=M1(hc)[0],t=Zn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1};function si(e,t){if(e&&e.defaultProps){t=Xt({},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:Xt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Lh={isMounted:function(e){return(e=e._reactInternals)?fl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=qr(),i=io(e),a=fa(n,i);a.payload=t,r!=null&&(a.callback=r),t=ro(e,a,i),t!==null&&(di(t,e,i,n),xd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=qr(),i=io(e),a=fa(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ro(e,a,i),t!==null&&(di(t,e,i,n),xd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qr(),n=io(e),i=fa(r,n);i.tag=2,t!=null&&(i.callback=t),t=ro(e,i,n),t!==null&&(di(t,e,n,r),xd(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?!oc(r,n)||!oc(i,a):!0}function gw(e,t,r){var n=!1,i=uo,a=t.contextType;return typeof a=="object"&&a!==null?a=Xn(a):(i=pn(t)?Jo:Ur.current,n=t.contextTypes,a=(n=n!=null)?ys(e,i):uo),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lh,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&&Lh.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=Xn(a):(a=pn(t)?Jo:Ur.current,i.context=ys(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&&Lh.enqueueReplaceState(i,i.state,null),Qd(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ss(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=fa(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){nh||(nh=!0,Gv=n),Nv(e,t)},r}function mw(e,t,r){r=fa(-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"&&(no===null?no=new Set([this]):no.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=fa(-1,1),t.tag=2,ro(r,t,1))),r.lanes|=1),e)}var mx=Sa.ReactCurrentOwner,cn=!1;function Vr(e,t,r,n){t.child=e===null?q6(t,null,r,n):_s(t,e.child,r,n)}function J3(e,t,r,n,i){r=r.render;var a=t.ref;return ps(t,i),n=Zm(e,t,r,n,a,i),r=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ba(e,t,i)):(Gt&&r&&zm(t),t.flags|=1,Vr(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=Rd(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:oc,r(o,n)&&e.ref===t.ref)return ba(e,t,i)}return t.flags|=1,e=ao(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(oc(a,n)&&e.ref===t.ref)if(cn=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(cn=!0);else return t.lanes=e.lanes,ba(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},Nt(os,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,Nt(os,Sn),Sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Nt(os,Sn),Sn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Nt(os,Sn),Sn|=n;return Vr(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=pn(r)?Jo:Ur.current;return a=ys(t,a),ps(t,i),r=Zm(e,t,r,n,a,i),n=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ba(e,t,i)):(Gt&&n&&zm(t),t.flags|=1,Vr(e,t,r,i),t.child)}function t5(e,t,r,n,i){if(pn(r)){var a=!0;Wd(t)}else a=!1;if(ps(t,i),t.stateNode===null)kd(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=Xn(f):(f=pn(r)?Jo:Ur.current,f=ys(t,f));var p=r.getDerivedStateFromProps,E=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";E||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&Y3(t,o,n,f),Va=!1;var w=t.memoizedState;o.state=w,Qd(t,n,o,i),u=t.memoizedState,l!==n||w!==u||hn.current||Va?(typeof p=="function"&&(Mv(t,r,p,n),u=t.memoizedState),(l=Va||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:si(t.type,l),o.props=f,E=t.pendingProps,w=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Xn(u):(u=pn(r)?Jo:Ur.current,u=ys(t,u));var m=r.getDerivedStateFromProps;(p=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==E||w!==u)&&Y3(t,o,n,u),Va=!1,w=t.memoizedState,o.state=w,Qd(t,n,o,i);var S=t.memoizedState;l!==E||w!==S||hn.current||Va?(typeof m=="function"&&(Mv(t,r,m,n),S=t.memoizedState),(f=Va||K3(t,r,f,n,w,S,u)||!1)?(p||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),ba(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=_s(t,e.child,null,a),t.child=_s(t,null,l,a)):Vr(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 bs(),Um(i),t.flags|=256,Vr(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=Kt.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),Nt(Kt,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=Dh(o,n,0,null),e=Xo(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=ao(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=ao(l,a):(a=Xo(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=ao(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=Dh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nd(e,t,r,n){return n!==null&&Um(n),_s(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(Ce(422))),nd(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Dh({mode:"visible",children:n.children},i,0,null),a=Xo(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&_s(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return nd(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Ce(419)),n=L1(a,n,void 0),nd(e,t,o,n)}if(l=(o&e.childLanes)!==0,cn||l){if(n=Er,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,ya(e,i),di(n,e,i,-1))}return ly(),n=L1(Error(Ce(421))),nd(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=to(i.nextSibling),xn=t,Gt=!0,ci=null,e!==null&&($n[Gn++]=ua,$n[Gn++]=ca,$n[Gn++]=el,ua=e.id,ca=e.overflow,el=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(Vr(e,t,n.children,r),n=Kt.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(Nt(Kt,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&&Jd(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&&Jd(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 kd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ba(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),rl|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ce(153));if(t.child!==null){for(e=t.child,r=ao(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ao(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function bx(e,t,r){switch(t.tag){case 3:ww(t),bs();break;case 5:Y6(t);break;case 1:pn(t.type)&&Wd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Nt(Xd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Nt(Kt,Kt.current&1),t.flags|=128,null):r&t.child.childLanes?Sw(e,t,r):(Nt(Kt,Kt.current&1),e=ba(e,t,r),e!==null?e.sibling:null);Nt(Kt,Kt.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),Nt(Kt,Kt.current),n)break;return null;case 22:case 23:return t.lanes=0,bw(e,t,r)}return ba(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,Wo(Bi.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Xt({},i,{value:void 0}),n=Xt({},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=Vd)}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"&&(Ju.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"&&(Ju.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&zt("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 ku(e,t){if(!Gt)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 zr(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 zr(t),null;case 1:return pn(t.type)&&qd(),zr(t),null;case 3:return n=t.stateNode,ws(),Bt(hn),Bt(Ur),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ci!==null&&(Wv(ci),ci=null))),zv(e,t),zr(t),null;case 5:Km(t);var i=Wo(fc.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(Ce(166));return zr(t),null}if(e=Wo(Bi.current),td(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Ii]=t,n[uc]=a,e=(t.mode&1)!==0,r){case"dialog":zt("cancel",n),zt("close",n);break;case"iframe":case"object":case"embed":zt("load",n);break;case"video":case"audio":for(i=0;i<ju.length;i++)zt(ju[i],n);break;case"source":zt("error",n);break;case"img":case"image":case"link":zt("error",n),zt("load",n);break;case"details":zt("toggle",n);break;case"input":d3(n,a),zt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},zt("invalid",n);break;case"textarea":p3(n,a),zt("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&&ed(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&ed(n.textContent,l,e),i=["children",""+l]):Ju.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&zt("scroll",n)}switch(r){case"input":qf(n),h3(n,a,!0);break;case"textarea":qf(n),g3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Vd)}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[Ii]=t,e[uc]=n,Ow(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":zt("cancel",e),zt("close",e),i=n;break;case"iframe":case"object":case"embed":zt("load",e),i=n;break;case"video":case"audio":for(i=0;i<ju.length;i++)zt(ju[i],e);i=n;break;case"source":zt("error",e),i=n;break;case"img":case"image":case"link":zt("error",e),zt("load",e),i=n;break;case"details":zt("toggle",e),i=n;break;case"input":d3(e,n),i=lv(e,n),zt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Xt({},n,{value:void 0}),zt("invalid",e);break;case"textarea":p3(e,n),i=cv(e,n),zt("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!=="")&&ec(e,u):typeof u=="number"&&ec(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ju.hasOwnProperty(a)?u!=null&&a==="onScroll"&&zt("scroll",e):u!=null&&xm(e,a,u,o))}switch(r){case"input":qf(e),h3(e,n,!1);break;case"textarea":qf(e),g3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+so(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?cs(e,!!n.multiple,a,!1):n.defaultValue!=null&&cs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Vd)}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 zr(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(Ce(166));if(r=Wo(fc.current),Wo(Bi.current),td(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ii]=t,(a=n.nodeValue!==r)&&(e=xn,e!==null))switch(e.tag){case 3:ed(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ii]=t,t.stateNode=n}return zr(t),null;case 13:if(Bt(Kt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Gt&&On!==null&&t.mode&1&&!(t.flags&128))G6(),bs(),t.flags|=98560,a=!1;else if(a=td(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ce(317));a[Ii]=t}else bs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zr(t),a=!1}else ci!==null&&(Wv(ci),ci=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||Kt.current&1?dr===0&&(dr=3):ly())),t.updateQueue!==null&&(t.flags|=4),zr(t),null);case 4:return ws(),zv(e,t),e===null&&lc(t.stateNode.containerInfo),zr(t),null;case 10:return Gm(t.type._context),zr(t),null;case 17:return pn(t.type)&&qd(),zr(t),null;case 19:if(Bt(Kt),a=t.memoizedState,a===null)return zr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)ku(a,!1);else{if(dr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Jd(e),o!==null){for(t.flags|=128,ku(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 Nt(Kt,Kt.current&1|2),t.child}e=e.sibling}a.tail!==null&&rr()>Es&&(t.flags|=128,n=!0,ku(a,!1),t.lanes=4194304)}else{if(!n)if(e=Jd(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ku(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Gt)return zr(t),null}else 2*rr()-a.renderingStartTime>Es&&r!==1073741824&&(t.flags|=128,n=!0,ku(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=rr(),t.sibling=null,r=Kt.current,Nt(Kt,n?r&1|2:r&1),t):(zr(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&&(zr(t),t.subtreeFlags&6&&(t.flags|=8192)):zr(t),null;case 24:return null;case 25:return null}throw Error(Ce(156,t.tag))}function wx(e,t){switch(Bm(t),t.tag){case 1:return pn(t.type)&&qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ws(),Bt(hn),Bt(Ur),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Km(t),null;case 13:if(Bt(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ce(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(Kt),null;case 4:return ws(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var id=!1,Br=!1,Sx=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function as(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Qt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Qt(e,t,n)}}var i5=!1;function Ex(e,t){if(Ev=Hd,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,p=0,E=e,w=null;t:for(;;){for(var m;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),(m=E.firstChild)!==null;)w=E,E=m;for(;;){if(E===e)break t;if(w===r&&++f===i&&(l=o),w===a&&++p===n&&(u=o),(m=E.nextSibling)!==null)break;E=w,w=E.parentNode}E=m}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},Hd=!1,Ue=t;Ue!==null;)if(t=Ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ue=e;else for(;Ue!==null;){t=Ue;try{var 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,g=S.memoizedState,h=t.stateNode,v=h.getSnapshotBeforeUpdate(t.elementType===t.type?b:si(t.type,b),g);h.__reactInternalSnapshotBeforeUpdate=v}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(Ce(163))}}catch(y){Qt(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,Ue=e;break}Ue=t.return}return S=i5,i5=!1,S}function qu(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 Nh(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[Ii],delete t[uc],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=Vd));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 kr=null,ui=!1;function Ua(e,t,r){for(r=r.child;r!==null;)Tw(e,t,r),r=r.sibling}function Tw(e,t,r){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(Ph,r)}catch{}switch(r.tag){case 5:Br||as(r,t);case 6:var n=kr,i=ui;kr=null,Ua(e,t,r),kr=n,ui=i,kr!==null&&(ui?(e=kr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kr.removeChild(r.stateNode));break;case 18:kr!==null&&(ui?(e=kr,r=r.stateNode,e.nodeType===8?C1(e.parentNode,r):e.nodeType===1&&C1(e,r),ic(e)):C1(kr,r.stateNode));break;case 4:n=kr,i=ui,kr=r.stateNode.containerInfo,ui=!0,Ua(e,t,r),kr=n,ui=i;break;case 0:case 11:case 14:case 15:if(!Br&&(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)}Ua(e,t,r);break;case 1:if(!Br&&(as(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Qt(r,t,l)}Ua(e,t,r);break;case 21:Ua(e,t,r);break;case 22:r.mode&1?(Br=(n=Br)||r.memoizedState!==null,Ua(e,t,r),Br=n):Ua(e,t,r);break;default:Ua(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 ai(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:kr=l.stateNode,ui=!1;break e;case 3:kr=l.stateNode.containerInfo,ui=!0;break e;case 4:kr=l.stateNode.containerInfo,ui=!0;break e}l=l.return}if(kr===null)throw Error(Ce(160));Tw(a,o,i),kr=null,ui=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Qt(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(ai(t,e),Mi(e),n&4){try{qu(3,e,e.return),Nh(3,e)}catch(b){Qt(e,e.return,b)}try{qu(5,e,e.return)}catch(b){Qt(e,e.return,b)}}break;case 1:ai(t,e),Mi(e),n&512&&r!==null&&as(r,r.return);break;case 5:if(ai(t,e),Mi(e),n&512&&r!==null&&as(r,r.return),e.flags&32){var i=e.stateNode;try{ec(i,"")}catch(b){Qt(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 p=u[o],E=u[o+1];p==="style"?n6(i,E):p==="dangerouslySetInnerHTML"?t6(i,E):p==="children"?ec(i,E):xm(i,p,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 m=a.value;m!=null?cs(i,!!a.multiple,m,!1):w!==!!a.multiple&&(a.defaultValue!=null?cs(i,!!a.multiple,a.defaultValue,!0):cs(i,!!a.multiple,a.multiple?[]:"",!1))}i[uc]=a}catch(b){Qt(e,e.return,b)}}break;case 6:if(ai(t,e),Mi(e),n&4){if(e.stateNode===null)throw Error(Ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){Qt(e,e.return,b)}}break;case 3:if(ai(t,e),Mi(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ic(t.containerInfo)}catch(b){Qt(e,e.return,b)}break;case 4:ai(t,e),Mi(e);break;case 13:ai(t,e),Mi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=rr())),n&4&&o5(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(Br=(f=Br)||p,ai(t,e),Br=f):ai(t,e),Mi(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!p&&e.mode&1)for(Ue=e,p=e.child;p!==null;){for(E=Ue=p;Ue!==null;){switch(w=Ue,m=w.child,w.tag){case 0:case 11:case 14:case 15:qu(4,w,w.return);break;case 1:as(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){Qt(n,r,b)}}break;case 5:as(w,w.return);break;case 22:if(w.memoizedState!==null){s5(E);continue}}m!==null?(m.return=w,Ue=m):s5(E)}p=p.sibling}e:for(p=null,E=e;;){if(E.tag===5){if(p===null){p=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){Qt(e,e.return,b)}}}else if(E.tag===6){if(p===null)try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(b){Qt(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;p===E&&(p=null),E=E.return}p===E&&(p=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:ai(t,e),Mi(e),n&4&&o5(e);break;case 21:break;default:ai(t,e),Mi(e)}}function Mi(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(Ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(ec(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(Ce(161))}}catch(u){Qt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ox(e,t,r){Ue=e,Rw(e)}function Rw(e,t,r){for(var n=(e.mode&1)!==0;Ue!==null;){var i=Ue,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||id;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Br;l=id;var f=Br;if(id=o,(Br=u)&&!f)for(Ue=i;Ue!==null;)o=Ue,u=o.child,o.tag===22&&o.memoizedState!==null?u5(i):u!==null?(u.return=o,Ue=u):u5(i);for(;a!==null;)Ue=a,Rw(a),a=a.sibling;Ue=i,id=l,Br=f}l5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ue=a):l5(e)}}function l5(e){for(;Ue!==null;){var t=Ue;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Br||Nh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Br)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:si(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 p=f.memoizedState;if(p!==null){var E=p.dehydrated;E!==null&&ic(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}Br||t.flags&512&&Uv(t)}catch(w){Qt(t,t.return,w)}}if(t===e){Ue=null;break}if(r=t.sibling,r!==null){r.return=t.return,Ue=r;break}Ue=t.return}}function s5(e){for(;Ue!==null;){var t=Ue;if(t===e){Ue=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Ue=r;break}Ue=t.return}}function u5(e){for(;Ue!==null;){var t=Ue;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Nh(4,t)}catch(u){Qt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Qt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Qt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Qt(t,o,u)}}}catch(u){Qt(t,t.return,u)}if(t===e){Ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ue=l;break}Ue=t.return}}var xx=Math.ceil,rh=Sa.ReactCurrentDispatcher,ry=Sa.ReactCurrentOwner,Kn=Sa.ReactCurrentBatchConfig,mt=0,Er=null,ar=null,Ar=0,Sn=0,os=vo(0),dr=0,gc=null,rl=0,Ih=0,ny=0,Wu=null,un=null,iy=0,Es=1/0,oa=null,nh=!1,Gv=null,no=null,ad=!1,Xa=null,ih=0,Ku=0,Vv=null,Td=-1,Ad=0;function qr(){return mt&6?rr():Td!==-1?Td:Td=rr()}function io(e){return e.mode&1?mt&2&&Ar!==0?Ar&-Ar:sx.transition!==null?(Ad===0&&(Ad=g6()),Ad):(e=Pt,e!==0||(e=window.event,e=e===void 0?16:S6(e.type)),e):1}function di(e,t,r,n){if(50<Ku)throw Ku=0,Vv=null,Error(Ce(185));kc(e,r,n),(!(mt&2)||e!==Er)&&(e===Er&&(!(mt&2)&&(Ih|=r),dr===4&&Wa(e,Ar)),gn(e,n),r===1&&mt===0&&!(t.mode&1)&&(Es=rr()+500,Rh&&mo()))}function gn(e,t){var r=e.callbackNode;sO(e,t);var n=Ud(e,e===Er?Ar: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(){!(mt&6)&&mo()}),r=null;else{switch(v6(n)){case 1:r=Am;break;case 4:r=h6;break;case 16:r=Bd;break;case 536870912:r=p6;break;default:r=Bd}r=zw(r,Mw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mw(e,t){if(Td=-1,Ad=0,mt&6)throw Error(Ce(327));var r=e.callbackNode;if(gs()&&e.callbackNode!==r)return null;var n=Ud(e,e===Er?Ar:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ah(e,n);else{t=n;var i=mt;mt|=2;var a=Nw();(Er!==e||Ar!==t)&&(oa=null,Es=rr()+500,Yo(e,t));do try{kx();break}catch(l){Lw(e,l)}while(!0);$m(),rh.current=a,mt=i,ar!==null?t=0:(Er=null,Ar=0,t=dr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=gc,Yo(e,0),Wa(e,n),gn(e,rr()),r;if(t===6)Wa(e,n);else{if(i=e.current.alternate,!(n&30)&&!Px(i)&&(t=ah(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=gc,Yo(e,0),Wa(e,n),gn(e,rr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Ce(345));case 2:Go(e,un,oa);break;case 3:if(Wa(e,n),(n&130023424)===n&&(t=iy+500-rr(),10<t)){if(Ud(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){qr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pv(Go.bind(null,e,un,oa),t);break}Go(e,un,oa);break;case 4:if(Wa(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-fi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=rr()-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(Go.bind(null,e,un,oa),n);break}Go(e,un,oa);break;case 5:Go(e,un,oa);break;default:throw Error(Ce(329))}}}return gn(e,rr()),e.callbackNode===r?Mw.bind(null,e):null}function qv(e,t){var r=Wu;return e.current.memoizedState.isDehydrated&&(Yo(e,t).flags|=256),e=ah(e,t),e!==2&&(t=un,un=r,t!==null&&Wv(t)),e}function Wv(e){un===null?un=e:un.push.apply(un,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(!mi(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 Wa(e,t){for(t&=~ny,t&=~Ih,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-fi(t),n=1<<r;e[r]=-1,t&=~n}}function c5(e){if(mt&6)throw Error(Ce(327));gs();var t=Ud(e,0);if(!(t&1))return gn(e,rr()),null;var r=ah(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=gc,Yo(e,0),Wa(e,t),gn(e,rr()),r;if(r===6)throw Error(Ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Go(e,un,oa),gn(e,rr()),null}function ay(e,t){var r=mt;mt|=1;try{return e(t)}finally{mt=r,mt===0&&(Es=rr()+500,Rh&&mo())}}function nl(e){Xa!==null&&Xa.tag===0&&!(mt&6)&&gs();var t=mt;mt|=1;var r=Kn.transition,n=Pt;try{if(Kn.transition=null,Pt=1,e)return e()}finally{Pt=n,Kn.transition=r,mt=t,!(mt&6)&&mo()}}function oy(){Sn=os.current,Bt(os)}function Yo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,rx(r)),ar!==null)for(r=ar.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&qd();break;case 3:ws(),Bt(hn),Bt(Ur),Ym();break;case 5:Km(n);break;case 4:ws();break;case 13:Bt(Kt);break;case 19:Bt(Kt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(Er=e,ar=e=ao(e.current,null),Ar=Sn=t,dr=0,gc=null,ny=Ih=rl=0,un=Wu=null,qo!==null){for(t=0;t<qo.length;t++)if(r=qo[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}qo=null}return e}function Lw(e,t){do{var r=ar;try{if($m(),Pd.current=th,eh){for(var n=Yt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}eh=!1}if(tl=0,Sr=cr=Yt=null,Vu=!1,dc=0,ry.current=null,r===null||r.return===null){dr=1,gc=t,ar=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Ar,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,p=l,E=p.tag;if(!(p.mode&1)&&(E===0||E===11||E===15)){var w=p.alternate;w?(p.updateQueue=w.updateQueue,p.memoizedState=w.memoizedState,p.lanes=w.lanes):(p.updateQueue=null,p.memoizedState=null)}var m=Z3(o);if(m!==null){m.flags&=-257,Q3(m,o,l,a,t),m.mode&1&&X3(a,f,t),t=m,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(Ce(426))}}else if(Gt&&l.mode&1){var g=Z3(o);if(g!==null){!(g.flags&65536)&&(g.flags|=256),Q3(g,o,l,a,t),Um(Ss(u,l));break e}}a=u=Ss(u,l),dr!==4&&(dr=2),Wu===null?Wu=[a]:Wu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var h=vw(a,u,t);G3(a,h);break e;case 1:l=u;var v=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(no===null||!no.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var y=mw(a,l,t);G3(a,y);break e}}a=a.return}while(a!==null)}Dw(r)}catch(_){t=_,ar===r&&r!==null&&(ar=r=r.return);continue}break}while(!0)}function Nw(){var e=rh.current;return rh.current=th,e===null?th:e}function ly(){(dr===0||dr===3||dr===2)&&(dr=4),Er===null||!(rl&268435455)&&!(Ih&268435455)||Wa(Er,Ar)}function ah(e,t){var r=mt;mt|=2;var n=Nw();(Er!==e||Ar!==t)&&(oa=null,Yo(e,t));do try{Cx();break}catch(i){Lw(e,i)}while(!0);if($m(),mt=r,rh.current=n,ar!==null)throw Error(Ce(261));return Er=null,Ar=0,dr}function Cx(){for(;ar!==null;)Iw(ar)}function kx(){for(;ar!==null&&!JE();)Iw(ar)}function Iw(e){var t=Fw(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Dw(e):ar=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,ar=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dr=6,ar=null;return}}else if(r=_x(r,t,Sn),r!==null){ar=r;return}if(t=t.sibling,t!==null){ar=t;return}ar=t=e}while(t!==null);dr===0&&(dr=5)}function Go(e,t,r){var n=Pt,i=Kn.transition;try{Kn.transition=null,Pt=1,Tx(e,t,r,n)}finally{Kn.transition=i,Pt=n}return null}function Tx(e,t,r,n){do gs();while(Xa!==null);if(mt&6)throw Error(Ce(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(Ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(uO(e,a),e===Er&&(ar=Er=null,Ar=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ad||(ad=!0,zw(Bd,function(){return gs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Kn.transition,Kn.transition=null;var o=Pt;Pt=1;var l=mt;mt|=4,ry.current=null,Ex(e,r),Aw(r,e),YO(Ov),Hd=!!Ev,Ov=Ev=null,e.current=r,Ox(r),eO(),mt=l,Pt=o,Kn.transition=a}else e.current=r;if(ad&&(ad=!1,Xa=e,ih=i),a=e.pendingLanes,a===0&&(no=null),nO(r.stateNode),gn(e,rr()),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(nh)throw nh=!1,e=Gv,Gv=null,e;return ih&1&&e.tag!==0&&gs(),a=e.pendingLanes,a&1?e===Vv?Ku++:(Ku=0,Vv=e):Ku=0,mo(),null}function gs(){if(Xa!==null){var e=v6(ih),t=Kn.transition,r=Pt;try{if(Kn.transition=null,Pt=16>e?16:e,Xa===null)var n=!1;else{if(e=Xa,Xa=null,ih=0,mt&6)throw Error(Ce(331));var i=mt;for(mt|=4,Ue=e.current;Ue!==null;){var a=Ue,o=a.child;if(Ue.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Ue=f;Ue!==null;){var p=Ue;switch(p.tag){case 0:case 11:case 15:qu(8,p,a)}var E=p.child;if(E!==null)E.return=p,Ue=E;else for(;Ue!==null;){p=Ue;var w=p.sibling,m=p.return;if(Cw(p),p===f){Ue=null;break}if(w!==null){w.return=m,Ue=w;break}Ue=m}}}var S=a.alternate;if(S!==null){var b=S.child;if(b!==null){S.child=null;do{var g=b.sibling;b.sibling=null,b=g}while(b!==null)}}Ue=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,Ue=o;else e:for(;Ue!==null;){if(a=Ue,a.flags&2048)switch(a.tag){case 0:case 11:case 15:qu(9,a,a.return)}var h=a.sibling;if(h!==null){h.return=a.return,Ue=h;break e}Ue=a.return}}var v=e.current;for(Ue=v;Ue!==null;){o=Ue;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,Ue=d;else e:for(o=v;Ue!==null;){if(l=Ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Nh(9,l)}}catch(_){Qt(l,l.return,_)}if(l===o){Ue=null;break e}var y=l.sibling;if(y!==null){y.return=l.return,Ue=y;break e}Ue=l.return}}if(mt=i,mo(),zi&&typeof zi.onPostCommitFiberRoot=="function")try{zi.onPostCommitFiberRoot(Ph,e)}catch{}n=!0}return n}finally{Pt=r,Kn.transition=t}}return!1}function f5(e,t,r){t=Ss(r,t),t=vw(e,t,1),e=ro(e,t,1),t=qr(),e!==null&&(kc(e,1,t),gn(e,t))}function Qt(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"&&(no===null||!no.has(n))){e=Ss(r,e),e=mw(t,e,1),t=ro(t,e,1),e=qr(),t!==null&&(kc(t,1,e),gn(t,e));break}}t=t.return}}function Ax(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=qr(),e.pingedLanes|=e.suspendedLanes&r,Er===e&&(Ar&r)===r&&(dr===4||dr===3&&(Ar&130023424)===Ar&&500>rr()-iy?Yo(e,0):ny|=r),gn(e,t)}function jw(e,t){t===0&&(e.mode&1?(t=Yf,Yf<<=1,!(Yf&130023424)&&(Yf=4194304)):t=1);var r=qr();e=ya(e,t),e!==null&&(kc(e,t,r),gn(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(Ce(314))}n!==null&&n.delete(t),jw(e,r)}var Fw;Fw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||hn.current)cn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return cn=!1,bx(e,t,r);cn=!!(e.flags&131072)}else cn=!1,Gt&&t.flags&1048576&&H6(t,Yd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;kd(e,t),e=t.pendingProps;var i=ys(t,Ur.current);ps(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,pn(n)?(a=!0,Wd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Lh,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,Gt&&a&&zm(t),Vr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(kd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Nx(n),e=si(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,si(n.type,e),r);break e}throw Error(Ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),t5(e,t,n,i,r);case 3:e:{if(ww(t),e===null)throw Error(Ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,K6(e,t),Qd(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=Ss(Error(Ce(423)),t),t=r5(e,t,n,r,i);break e}else if(n!==i){i=Ss(Error(Ce(424)),t),t=r5(e,t,n,r,i);break e}else for(On=to(t.stateNode.containerInfo.firstChild),xn=t,Gt=!0,ci=null,r=q6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(bs(),n===i){t=ba(e,t,r);break e}Vr(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),Vr(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=_s(t,null,n,r):Vr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),J3(e,t,n,i,r);case 7:return Vr(e,t,t.pendingProps,r),t.child;case 8:return Vr(e,t,t.pendingProps.children,r),t.child;case 12:return Vr(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,Nt(Xd,n._currentValue),n._currentValue=o,a!==null)if(mi(a.value,o)){if(a.children===i.children&&!hn.current){t=ba(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=fa(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?u.next=u:(u.next=p.next,p.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(Ce(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}Vr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ps(t,r),i=Xn(i),n=n(i),t.flags|=1,Vr(e,t,n,r),t.child;case 14:return n=t.type,i=si(n,t.pendingProps),i=si(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:si(n,i),kd(e,t),t.tag=1,pn(n)?(e=!0,Wd(t)):e=!1,ps(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(Ce(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 Wn(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 ao(e,t){var r=e.alternate;return r===null?(r=Wn(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 Rd(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 Xl:return Xo(r.children,i,a,t);case Pm:o=8,i|=8;break;case nv:return e=Wn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=Wn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=Wn(19,r,t,i),e.elementType=av,e.lanes=a,e;case Y_:return Dh(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 Ga:o=16,n=null;break e}throw Error(Ce(130,e==null?e:typeof e,""))}return t=Wn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Xo(e,t,r,n){return e=Wn(7,e,n,t),e.lanes=r,e}function Dh(e,t,r,n){return e=Wn(22,e,n,t),e.elementType=Y_,e.lanes=r,e.stateNode={isHidden:!1},e}function I1(e,t,r){return e=Wn(6,e,null,t),e.lanes=r,e}function D1(e,t,r){return t=Wn(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=Wn(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:Yl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Bw(e){if(!e)return uo;e=e._reactInternals;e:{if(fl(e)!==e||e.tag!==1)throw Error(Ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ce(171))}if(e.tag===1){var r=e.type;if(pn(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=qr(),i=io(r),a=fa(n,i),a.callback=t??null,ro(r,a,i),e.current.lanes=i,kc(e,i,n),gn(e,n),e}function jh(e,t,r,n){var i=t.current,a=qr(),o=io(i);return r=Bw(r),t.context===null?t.context=r:t.pendingContext=r,t=fa(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ro(i,t,o),e!==null&&(di(e,i,o,a),xd(e,i,o)),o}function oh(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}Fh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ce(409));jh(e,t,null,null)};Fh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nl(function(){jh(null,e,null,null)}),t[ma]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=b6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qa.length&&t!==0&&t<qa[r].priority;r++);qa.splice(r,0,e),r===0&&w6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zh(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=oh(o);a.call(f)}}var o=Uw(t,n,e,0,null,!1,!1,"",h5);return e._reactRootContainer=o,e[ma]=o.current,lc(e.nodeType===8?e.parentNode:e),nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=oh(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",h5);return e._reactRootContainer=u,e[ma]=u.current,lc(e.nodeType===8?e.parentNode:e),nl(function(){jh(t,u,r,n)}),u}function Bh(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=oh(o);l.call(u)}}jh(t,o,e,i)}else o=Fx(r,t,e,i,n);return oh(o)}m6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Du(t.pendingLanes);r!==0&&(Rm(t,r|1),gn(t,rr()),!(mt&6)&&(Es=rr()+500,mo()))}break;case 13:nl(function(){var n=ya(e,1);if(n!==null){var i=qr();di(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=ya(e,134217728);if(t!==null){var r=qr();di(t,e,134217728,r)}cy(e,134217728)}};y6=function(e){if(e.tag===13){var t=io(e),r=ya(e,t);if(r!==null){var n=qr();di(r,e,t,n)}cy(e,t)}};b6=function(){return Pt};_6=function(e,t){var r=Pt;try{return Pt=e,t()}finally{Pt=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=Ah(n);if(!i)throw Error(Ce(90));Z_(n),sv(n,i)}}}break;case"textarea":J_(e,r);break;case"select":t=r.value,t!=null&&cs(e,!!r.multiple,t,!1)}};o6=ay;l6=nl;var zx={usingClientEntryPoint:!1,Events:[Ac,es,Ah,i6,a6,ay]},Tu={findFiberByHostInstance:Vo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bx={bundleType:Tu.bundleType,version:Tu.version,rendererPackageName:Tu.rendererPackageName,rendererConfig:Tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Sa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=c6(e),e===null?null:e.stateNode},findFiberByHostInstance:Tu.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 od=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!od.isDisabled&&od.supportsFiber)try{Ph=od.inject(Bx),zi=od}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(Ce(200));return Dx(e,t,null,r)};kn.createRoot=function(e,t){if(!dy(e))throw Error(Ce(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[ma]=t.current,lc(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(Ce(188)):(e=Object.keys(e).join(","),Error(Ce(268,e)));return e=c6(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return nl(e)};kn.hydrate=function(e,t,r){if(!zh(t))throw Error(Ce(200));return Bh(null,e,t,!0,r)};kn.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(Ce(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[ma]=t.current,lc(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 Fh(t)};kn.render=function(e,t,r){if(!zh(t))throw Error(Ce(200));return Bh(null,e,t,!1,r)};kn.unmountComponentAtNode=function(e){if(!zh(e))throw Error(Ce(40));return e._reactRootContainer?(nl(function(){Bh(null,null,e,!1,function(){e._reactRootContainer=null,e[ma]=null})}),!0):!1};kn.unstable_batchedUpdates=ay;kn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!zh(r))throw Error(Ce(200));if(e==null||e._reactInternals===void 0)throw Error(Ce(38));return Bh(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;Dd.createRoot=p5.createRoot,Dd.hydrateRoot=p5.hydrateRoot;var Vw={};function rt(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,lh=Object.getOwnPropertyDescriptor,Ui=Object.defineProperty,Mc=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var Hx=typeof Proxy<"u",$x=Object.toString();function Ww(){Hx||rt("Proxy not available")}function Kw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var ls=function(){};function Cn(e){return typeof e=="function"}function il(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Uh(e){return e!==null&&typeof e=="object"}function _a(e){if(!Uh(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 Lc(e,t,r){Ui(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Xw(e,t,r){Ui(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function yo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Uh(n)&&n[r]===!0}}function Hs(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 sa(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 Mc.propertyIsEnumerable.call(e,n)})):t}var Os=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 da(e,t){return Mc.hasOwnProperty.call(e,t)}var qx=Object.getOwnPropertyDescriptors||function(t){var r={};return Os(t).forEach(function(n){r[n]=lh(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 Hh(e,t,r){return t&&Wx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ss(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 co(){return co=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},co.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 Fi=Symbol("mobx-stored-annotations");function hi(e){function t(r,n){if(Nc(n))return e.decorate_20223_(r,n);$s(r,n,e)}return Object.assign(t,e)}function $s(e,t,r){da(e,Fi)||Lc(e,Fi,co({},e[Fi])),aP(r)||(e[Fi][t]=r)}function Zx(e){return da(e,Fi)||Lc(e,Fi,co({},e[Fi])),e[Fi]}function Nc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),Ic=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(){fn(),b8(this),dn()},t.toString=function(){return this.name_},e}(),gy=yo("Atom",Ic);function vc(e,t,r){t===void 0&&(t=ls),r===void 0&&(r=ls);var n=new Ic(e);return t!==ls&&k8(n,t),r!==ls&&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 al={identity:Qx,structural:Jx,default:tP,shallow:eP};function ol(e,t,r){return Xh(e)?e:Array.isArray(e)?Tt.array(e,{name:r}):_a(e)?Tt.object(e,void 0,{name:r}):Hs(e)?Tt.map(e,{name:r}):sa(e)?Tt.set(e,{name:r}):typeof e=="function"&&!jc(e)&&!ks(e)?Yw(e)?sl(e):Ps(r,e):e}function rP(e,t,r){if(e==null||Or(e)||Xr(e)||Mr(e)||Wr(e))return e;if(Array.isArray(e))return Tt.array(e,{name:r,deep:!1});if(_a(e))return Tt.object(e,void 0,{name:r,deep:!1});if(Hs(e))return Tt.map(e,{name:r,deep:!1});if(sa(e))return Tt.set(e,{name:r,deep:!1})}function $h(e){return e}function nP(e,t){return Ry(e,t)?t:e}var e8="override",iP=hi({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){rt("'"+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 Dc(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(jc(r.value))return 1;var a=t8(e,this,t,r,!1);return Ui(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 p,E,w,m;return fo((p=(E=a.options_)==null?void 0:E.name)!=null?p:n.toString(),f,(w=(m=a.options_)==null?void 0:m.autoAction)!=null?w:!1)};if(r=="field"){i(function(){$s(this,n,a)});return}if(r=="method"){var l;return jc(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}rt("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,p,E;i===void 0&&(i=Me.safeDescriptors),dP(e,t,r,n);var w=n.value;if((a=t.options_)!=null&&a.bound){var m;w=w.bind((m=e.proxy_)!=null?m:e.target_)}return{value:fo((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,(p=t.options_)!=null&&p.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&&(!da(e.target_,t)||!ks(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ks(r.value))return 1;var a=n8(e,this,t,r,!1,!1);return Ui(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 ks(e)||(e=sl(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(ks(o)||(o=sl(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,co({},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=pl(this)[Ke],o=co({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Gi(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function _P(e,t,r,n){t.annotationType_,n.get}function Gh(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:ol,n)}function EP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,p,E=pl(l)[Ke],w=new oo(u,(f=(p=r.options_)==null?void 0:p.enhancer)!=null?f:ol,"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[Ke].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ke].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 dl.make_(e,t,r,n);if(r.set){var o=fo(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Ui(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?sl.bound:sl;return f.make_(e,t,r,n)}var p=(l=this.options_)!=null&&l.autoBind?Ps.bound:Ps;return p.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 dl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:fo(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){rt("'"+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 ld(e){return e||a8}var Xv=Gh(AP),NP=Gh(RP,{enhancer:$h}),IP=Gh(MP,{enhancer:rP}),DP=Gh(LP,{enhancer:nP}),o8=hi(Xv);function sd(e){return e.deep===!0?ol:e.deep===!1?$h: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:ol}function l8(e,t,r){if(Nc(t))return Xv.decorate_20223_(e,t);if(il(t)){$s(e,t,Xv);return}return Xh(e)?e:_a(e)?Tt.object(e,t,r):Array.isArray(e)?Tt.array(e,t):Hs(e)?Tt.map(e,t):sa(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=ld(r);return new oo(t,sd(n),n.name,!0,n.equals)},array:function(t,r){var n=ld(r);return(Me.useProxies===!1||n.proxy===!1?VC:IC)(t,sd(n),n.name)},map:function(t,r){var n=ld(r);return new Qh(t,sd(n),n.name)},set:function(t,r){var n=ld(r);return new Ty(t,sd(n),n.name)},object:function(t,r,n){return bo(function(){return Sy(Me.useProxies===!1||(n==null?void 0:n.proxy)===!1?pl({},n):RC({},n),t,r)})},ref:hi(NP),shallow:hi(IP),deep:o8,struct:hi(DP)},Tt=qw(l8,zP),s8="computed",BP="computed.struct",Zv=vy(s8),UP=vy(BP,{equals:al.structural}),dl=function(t,r){if(Nc(r))return Zv.decorate_20223_(t,r);if(il(r))return $s(t,r,Zv);if(_a(t))return hi(vy(s8,t));var n=_a(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Gi(n)};Object.assign(dl,Zv);dl.struct=hi(UP);var v5,m5,sh=0,HP=1,$P=(v5=(m5=lh(function(){},"name"))==null?void 0:m5.configurable)!=null?v5:!1,y5={value:"action",configurable:!0,writable:!1,enumerable:!1};function fo(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,Ui(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;fn();var u=Me.allowStateChanges;l&&(hl(),u=Vh(!0));var f=Wh(!0),p={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:HP++,parentActionId_:sh};return sh=p.actionId_,p}function f8(e){sh!==e.actionId_&&rt(30),sh=e.parentActionId_,e.error_!==void 0&&(Me.suppressReactionErrors=!0),qh(e.prevAllowStateChanges_),vs(e.prevAllowStateReads_),dn(),e.runAsAction_&&ha(e.prevDerivation_),Me.suppressReactionErrors=!1}function my(e,t){var r=Vh(e);try{return t()}finally{qh(r)}}function Vh(e){var t=Me.allowStateChanges;return Me.allowStateChanges=e,t}function qh(e){Me.allowStateChanges=e}var oo=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=al.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(Vn(this)){var a=qn(this,{object:this,type:Hi,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(),pi(this)&&gi(this,{type:Hi,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Fc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Hi,newValue:this.value_,oldValue:void 0}),zc(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}(Ic),yy=yo("ObservableValue",oo);function ud(e,t){return!!(e&t)}function cd(e,t,r){return r?e|=t:e&=~t,e}var Gi=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 ch(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=uh.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||rt(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=fo("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?al.structural:al.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&&rt(32,this.name_,this.derivation),Me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),fn(),this.value_=this.computeValue_(!1),dn());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(Md(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&rt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else rt(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===St.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Md(n)||Md(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=Vh(!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 ch(o)}return qh(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=hl();n({observableKind:"computed",debugObjectName:a.name_,type:Hi,object:a,newValue:u,oldValue:l}),ha(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()},Hh(e,[{key:"isComputing",get:function(){return ud(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=cd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return ud(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=cd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return ud(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=cd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return ud(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=cd(this.flags_,e.isPendingUnobservationMask_,n)}}])}();Gi.isComputingMask_=1;Gi.isRunningSetterMask_=2;Gi.isBeingObservedMask_=4;Gi.isPendingUnobservationMask_=8;var ll=yo("ComputedValue",Gi),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 uh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(uh||(uh={}));var ch=function(t){this.cause=void 0,this.cause=t};function Md(e){return e instanceof ch}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=Wh(!0),r=hl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(ll(o)){if(Me.disableErrorBoundaries)o.get();else try{o.get()}catch{return ha(r),vs(t),!0}if(e.dependenciesState_===St.STALE_)return ha(r),vs(t),!0}}return h8(e),ha(r),vs(t),!1}}}function GP(){return Me.trackingDerivation!==null}function d8(e,t,r){var n=Wh(!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 ch(o)}return Me.inBatch--,Me.trackingDerivation=i,VP(e),vs(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=hl();try{return e()}finally{ha(t)}}function hl(){var e=Me.trackingDerivation;return Me.trackingDerivation=null,e}function ha(e){Me.trackingDerivation=e}function Wh(e){var t=Me.allowStateReads;return Me.allowStateReads=e,t}function vs(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"],Yu=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},Ld=!0,p8=!1,Me=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ld=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Yu().version&&(Ld=!1),Ld?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Yu):(setTimeout(function(){p8||rt(35)},1),new Yu)}();function WP(){if((Me.pendingReactions.length||Me.inBatch||Me.isRunningReactions)&&rt(36),p8=!0,Ld){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Me=new Yu}}function g8(){return Me}function KP(){var e=new Yu;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 fn(){Me.inBatch++}function dn(){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 Gi&&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 xs=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_=uh.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_){fn(),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,dn()}},t.track=function(n){if(!this.isDisposed_){fn(),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),Md(a)&&this.reportExceptionInDerivation_(a.cause),dn()}},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_||(fn(),Jv(this),dn()))},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[Ke]=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 fh=yo("Reaction",xs);function nC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function Xu(){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=Dc(S8),oC=Dc(iC,{bound:!0}),rm=Dc(E8,{autoAction:!0}),lC=Dc(aC,{autoAction:!0,bound:!0});function x8(e){var t=function(n,i){if(Cn(n))return fo(n.name||O8,n,e);if(Cn(i))return fo(n,i,e);if(Nc(i))return(e?rm:tm).decorate_20223_(n,i);if(il(i))return $s(n,i,e?rm:tm);if(il(n))return hi(Dc(e?E8:S8,{name:n,autoAction:e}))};return t}var or=x8(!1);Object.assign(or,tm);var Ps=x8(!0);Object.assign(Ps,rm);or.bound=hi(oC);Ps.bound=hi(lC);function Cs(e){return u8(e.name||O8,!1,e,this,void 0)}function jc(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 xs(o,function(){this.track(E)},t.onError,t.requiresObservable);else{var f=P8(t),p=!1;u=new xs(o,function(){p||(p=!0,f(function(){p=!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=or(o,r.onError?uC(r.onError,t):t),u=!r.scheduler&&!r.delay,f=P8(r),p=!0,E=!1,w,m=r.compareStructural?al.structural:r.equals||al.default,S=new xs(o,function(){p||u?b():E||(E=!0,f(b))},r.onError,r.requiresObservable);function b(){if(E=!1,!S.isDisposed_){var g=!1,h=w;S.track(function(){var v=my(!1,function(){return e(S)});g=p||!m(w,v),w=v}),(p&&r.fireImmediately||!p&&g)&&l(w,h,S),p=!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"?Vi(t,r):Vi(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",fd="always",hC="observed";function A8(e){e.isolateGlobalState===!0&&WP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Me.useProxies=t===fd?!0:t===dC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Me.verifyProxies=!0),r!==void 0){var n=r===fd?fd:r===hC;Me.enforceActions=n,Me.allowStateChanges=!(n===!0||n===fd)}["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 bo(function(){var a=pl(e,n)[Ke];Os(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function R8(e,t){return M8(Vi(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(Vi(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 Kh(){this.message="FLOW_CANCELLED"}Kh.prototype=Object.create(Error.prototype);function mC(e){return e instanceof Kh}var j1=r8("flow"),yC=r8("flow.bound",{bound:!0}),sl=Object.assign(function(t,r){if(Nc(r))return j1.decorate_20223_(t,r);if(il(r))return $s(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++vC,p=or(i+" - runid: "+f+" - init",n).apply(l,u),E,w=void 0,m=new Promise(function(S,b){var g=0;E=b;function h(y){w=void 0;var _;try{_=or(i+" - runid: "+f+" - yield "+g++,p.next).call(p,y)}catch(R){return b(R)}d(_)}function v(y){w=void 0;var _;try{_=or(i+" - runid: "+f+" - yield "+g++,p.throw).call(p,y)}catch(R){return b(R)}d(_)}function d(y){if(Cn(y==null?void 0:y.then)){y.then(d,b);return}return y.done?S(y.value):(w=Promise.resolve(y.value),w.then(h,v))}h(void 0)});return m.cancel=or(i+" - runid: "+f+" - cancel",function(){try{w&&b5(w);var S=p.return(void 0),b=Promise.resolve(S.value);b.then(ls,ls),b5(b),E(new Kh)}catch(g){E(g)}}),m};return a.isMobXFlow=!0,a},j1);sl.bound=hi(yC);function b5(e){Cn(e.cancel)&&e.cancel()}function bC(e){return e}function ks(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Mr(e)||Xr(e)||yy(e)?n=yi(e):Or(e)&&(n=yi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Yh(e,t,r){return Cn(r)?wC(e,t,r):_C(e,t)}function _C(e,t){return yi(e).intercept_(t)}function wC(e,t,r){return yi(e,t).intercept_(r)}function N8(e,t){if(t===void 0)return ll(e);if(Or(e)===!1||!e[Ke].values_.has(t))return!1;var r=Vi(e,t);return ll(r)}function SC(e){return N8(e)}function I8(e,t){return N8(e,t)}function D8(e,t){return e?t!==void 0?Or(e)?e[Ke].values_.has(t):!1:Or(e)||!!e[Ke]||gy(e)||fh(e)||ll(e):!1}function Xh(e){return D8(e)}function j8(e,t){return D8(e,t)}function mc(e){if(Or(e))return e[Ke].keys_();if(Mr(e)||Wr(e))return Array.from(e.keys());if(Xr(e))return e.map(function(t,r){return r});rt(5)}function Oy(e){if(Or(e))return mc(e).map(function(t){return e[t]});if(Mr(e))return mc(e).map(function(t){return e.get(t)});if(Wr(e))return Array.from(e.values());if(Xr(e))return e.slice();rt(6)}function F8(e){if(Or(e))return mc(e).map(function(t){return[t,e[t]]});if(Mr(e))return mc(e).map(function(t){return[t,e.get(t)]});if(Wr(e))return Array.from(e.entries());if(Xr(e))return e.map(function(t,r){return[r,t]});rt(7)}function xy(e,t,r){if(arguments.length===2&&!Wr(e)){fn();var n=t;try{for(var i in n)xy(e,i,n[i])}finally{dn()}return}Or(e)?e[Ke].set_(t,r):Mr(e)?e.set(t,r):Wr(e)?e.add(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&rt("Invalid index: '"+t+"'"),fn(),t>=e.length&&(e.length=t+1),e[t]=r,dn()):rt(8)}function EC(e,t){Or(e)?e[Ke].delete_(t):Mr(e)||Wr(e)?e.delete(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):rt(9)}function z8(e,t){if(Or(e))return e[Ke].has_(t);if(Mr(e))return e.has(t);if(Wr(e))return e.has(t);if(Xr(e))return t>=0&&t<e.length;rt(10)}function OC(e,t){if(z8(e,t)){if(Or(e))return e[Ke].get_(t);if(Mr(e))return e.get(t);if(Xr(e))return e[t];rt(11)}}function Py(e,t,r){if(Or(e))return e[Ke].defineProperty_(t,r);rt(39)}function B8(e){if(Or(e))return e[Ke].ownKeys_();rt(38)}function Zh(e,t,r,n){return Cn(r)?PC(e,t,r,n):xC(e,t,r)}function xC(e,t,r){return yi(e).observe_(t,r)}function PC(e,t,r,n){return yi(e,t).observe_(r,n)}function dd(e,t,r){return e.set(t,r),r}function Kl(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Xh(e))return e;if(yy(e)||ll(e))return Kl(e.get(),t);if(t.has(e))return t.get(e);if(Xr(e)){var r=dd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Kl(o,t)}),r}if(Wr(e)){var n=dd(t,e,new Set);return e.forEach(function(o){n.add(Kl(o,t))}),n}if(Mr(e)){var i=dd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Kl(o,t))}),i}else{var a=dd(t,e,{});return B8(e).forEach(function(o){Mc.propertyIsEnumerable.call(e,o)&&(a[o]=Kl(e[o],t))}),a}}function CC(e,t){return Kl(e,new Map)}function kC(){}function Di(e,t){t===void 0&&(t=void 0),fn();try{return e.apply(t)}finally{dn()}}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[Ke].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=fo("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,co({},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 Gl(e){return e[Ke]}var AC={has:function(t,r){return Gl(t).has_(r)},get:function(t,r){return Gl(t).get_(r)},set:function(t,r,n){var i;return il(r)?(i=Gl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return il(r)?(n=Gl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Gl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Gl(t).ownKeys_()},preventExtensions:function(t){rt(13)}};function RC(e,t){var r,n;return Ww(),e=pl(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,AC)}function Vn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Fc(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 qn(e,t){var r=hl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&rt(14),!!t);i++);return t}finally{ha(r)}}function pi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function zc(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 gi(e,t){var r=hl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ha(r)}}function Cy(e,t,r){return bo(function(){var n,i=pl(e,r)[Ke];(n=t)!=null||(t=Zx(e)),Os(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function MC(e,t,r){return _a(e)?Sy(e,e,t,r):(bo(function(){var n=pl(e,r)[Ke];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Os(e),Os(i)));a.delete("constructor"),a.delete(Ke),Lc(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var _5="splice",Hi="update",LC=1e4,NC={get:function(t,r){var n=t[Ke];return r===Ke?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):da(dh,r)?dh[r]:t[r]},set:function(t,r,n){var i=t[Ke];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){rt(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 Ic(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 Fc(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}),zc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&rt("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_&&rt(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),Vn(this)){var u=qn(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 p=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,p),this.dehanceValues_(p)},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 p=0;p<u.length;p++)this.values_[n+a.length+p]=u[p];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Xu(),l=pi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Hi,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&gi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Xu(),l=pi(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&&gi(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&&rt(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Vn(this)){var l=qn(this,{type:Hi,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),p=0;p<f.length-1;p++)f[p]=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(),bo(function(){var i=new ky(r,t,n,!1);Xw(i.values_,Ke,i);var a=new Proxy(i.values_,NC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var dh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ke];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[Ke];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[Ke].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ke],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[Ke].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ke],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&&rt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Me.trackingDerivation&&rt(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ke],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};It("at",An);It("concat",An);It("flat",An);It("includes",An);It("indexOf",An);It("join",An);It("lastIndexOf",An);It("slice",An);It("toString",An);It("toLocaleString",An);It("toSorted",An);It("toSpliced",An);It("with",An);It("every",bi);It("filter",bi);It("find",bi);It("findIndex",bi);It("findLast",bi);It("findLastIndex",bi);It("flatMap",bi);It("forEach",bi);It("map",bi);It("some",bi);It("toReversed",bi);It("reduce",H8);It("reduceRight",H8);function It(e,t){typeof Array.prototype[e]=="function"&&(dh[e]=t(e))}function An(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function bi(e){return function(t,r){var n=this,i=this[Ke];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[Ke];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=yo("ObservableArrayAdministration",ky);function Xr(e){return Uh(e)&&DC(e[Ke])}var jC={},Za="add",hh="delete",Qh=function(){function e(r,n,i){var a=this;n===void 0&&(n=ol),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=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)||rt(18),bo(function(){a.keysAtom_=vc("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 oo(this.has_(n),$h,"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(Vn(this)){var o=qn(this,{type:a?Hi:Za,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_,Vn(this)){var a=qn(this,{type:hh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:hh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Di(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var p=i.data_.get(n);p.setNewValue_(void 0),i.data_.delete(n)}),l&&gi(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=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Hi,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Di(function(){var f,p=new oo(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,p),i=p.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Za,object:this,name:n,newValue:i}:null;l&&gi(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 yc({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 yc({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=ss(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 Mr(n)&&(n=new Map(n)),Di(function(){_a(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)}):Hs(n)?(Gx(n)||rt(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&rt(20,n)}),this},t.clear=function(){var n=this;Di(function(){by(function(){for(var i=ss(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Di(function(){for(var a=FC(n),o=new Map,l=!1,u=ss(i.data_.keys()),f;!(f=u()).done;){var p=f.value;if(!a.has(p)){var E=i.delete(p);if(E)l=!0;else{var w=i.data_.get(p);o.set(p,w)}}}for(var m=ss(a.entries()),S;!(S=m()).done;){var b=S.value,g=b[0],h=b[1],v=i.data_.has(g);if(i.set(g,h),i.data_.has(g)){var d=i.data_.get(g);o.set(g,d),v||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var y=i.data_.keys(),_=o.keys(),R=y.next(),C=_.next();!R.done;){if(R.value!==C.value){i.keysAtom_.reportChanged();break}R=y.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 zc(this,n)},t.intercept_=function(n){return Fc(this,n)},Hh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Mr=yo("ObservableMap",Qh);function FC(e){if(Hs(e)||Mr(e))return e;if(Array.isArray(e))return new Map(e);if(_a(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return rt(21,e)}var zC={},Ty=function(){function e(r,n,i){var a=this;n===void 0&&(n=ol),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=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)||rt(22),this.enhancer_=function(o,l){return n(o,l,i)},bo(function(){a.atom_=vc(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;Di(function(){by(function(){for(var i=ss(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=ss(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_,Vn(this)){var a=qn(this,{type:Za,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Di(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Za,object:this,newValue:n}:null;l&&gi(this,u)}return this},t.delete=function(n){var i=this;if(Vn(this)){var a=qn(this,{type:hh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:hh,object:this,oldValue:n}:null;return Di(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&gi(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 yc({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 yc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.intersection=function(n){if(sa(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(sa(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(sa(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(sa(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Wr(n)&&(n=new Set(n)),Di(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):sa(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&rt("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return zc(this,n)},t.intercept_=function(n){return Fc(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Hh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Wr=yo("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 Ic("ObservableObject.keys"),this.isPlainObject_=_a(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 Gi)return a.set(i),!0;if(Vn(this)){var o=qn(this,{type:Hi,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=pi(this),u=!1,f=l||u?{type:Hi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,f)}return!0},t.get_=function(n){return Me.trackingDerivation&&!da(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),da(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 oo(n in this.target_,$h,"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_[Fi])!=null&&a[n])return;rt(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Mc;){var l=lh(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{fn();var o=this.delete_(n);if(!o)return o;if(Vn(this)){var l=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=co({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Ui(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{dn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{fn();var l=this.delete_(n);if(!l)return l;if(Vn(this)){var u=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,newValue:i});if(!u)return null;i=u.newValue}var f=E5(n),p={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,p))return!1}else Ui(this.target_,n,p);var E=new oo(i,a,"ObservableObject.key",!1);this.values_.set(n,E),this.notifyPropertyAddition_(n,E.value_)}finally{dn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{fn();var o=this.delete_(n);if(!o)return o;if(Vn(this)){var l=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,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 Ui(this.target_,n,f);this.values_.set(n,new Gi(i)),this.notifyPropertyAddition_(n,void 0)}finally{dn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!da(this.target_,n))return!0;if(Vn(this)){var a=qn(this,{object:this.proxy_||this.target_,name:n,type:S5});if(!a)return null}try{var o;fn();var l=pi(this),u=!1,f=this.values_.get(n),p=void 0;if(!f&&(l||u)){var E;p=(E=lh(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 oo&&(p=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:p,name:n};l&&gi(this,w)}}finally{dn()}return!0},t.observe_=function(n,i){return zc(this,n)},t.intercept_=function(n){return Fc(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=pi(this),l=!1;if(o||l){var u=o||l?{type:Za,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&gi(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Os(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function pl(e,t){var r;if(da(e,Ke))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 Lc(e,Ke,i),e}var BC=yo("ObservableObjectAdministration",$8);function E5(e){return w5[e]||(w5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function Or(e){return Uh(e)?BC(e[Ke]):!1}function O5(e,t,r){var n;(n=e.target_[Fi])==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,bo(function(){var u=new ky(a,i,o,!0);u.proxy_=l,Xw(l,Ke,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[Ke].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 Xr(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return yc({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Hh(t,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(i){this[Ke].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(G8);Object.entries(dh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Lc(Ay.prototype,t,r)});function V8(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function GC(e){Ui(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 Vi(e,t){if(typeof e=="object"&&e!==null){if(Xr(e))return t!==void 0&&rt(23),e[Ke].atom_;if(Wr(e))return e.atom_;if(Mr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||rt(25,t,ph(e)),r}if(Or(e)){if(!t)return rt(26);var n=e[Ke].values_.get(t);return n||rt(27,t,ph(e)),n}if(gy(e)||ll(e)||fh(e))return e}else if(Cn(e)&&fh(e[Ke]))return e[Ke];rt(28)}function yi(e,t){if(e||rt(29),t!==void 0)return yi(Vi(e,t));if(gy(e)||ll(e)||fh(e)||Mr(e)||Wr(e))return e;if(e[Ke])return e[Ke];rt(24,e)}function ph(e,t){var r;if(t!==void 0)r=Vi(e,t);else{if(jc(e))return e.name;Or(e)||Mr(e)||Wr(e)?r=yi(e):r=Vi(e)}return r.name_}function bo(e){var t=hl(),r=Vh(!0);fn();try{return e()}finally{dn(),qh(r),ha(t)}}var x5=Mc.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 p=n.length;p--;)if(n[p]===e)return i[p]===t;if(n.push(e),i.push(t),l){if(p=e.length,p!==t.length)return!1;for(;p--;)if(!im(e[p],t[p],r-1,n,i))return!1}else{var E=Object.keys(e),w;if(p=E.length,Object.keys(t).length!==p)return!1;for(;p--;)if(w=E[p],!(da(t,w)&&im(e[w],t[w],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function P5(e){return Xr(e)?e.slice():Hs(e)||Mr(e)||sa(e)||Wr(e)?Array.from(e.entries()):e}function yc(e){return e[Symbol.iterator]=qC,e}function qC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&rt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:w8,extras:{getDebugName:ph},$mobx:Ke});const WC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:Kh,ObservableMap:Qh,ObservableSet:Ty,Reaction:xs,_allowStateChanges:my,_allowStateChangesInsideComputed:Cs,_allowStateReadsEnd:vs,_allowStateReadsStart:Wh,_autoAction:Ps,_endAction:f8,_getAdministration:yi,_getGlobalState:g8,_interceptReads:Ey,_isComputingDerivation:GP,_resetGlobalState:KP,_startAction:c8,action:or,autorun:_y,comparer:al,computed:dl,configure:A8,createAtom:vc,defineProperty:Py,entries:F8,extendObservable:Sy,flow:sl,flowResult:bC,get:OC,getAtom:Vi,getDebugName:ph,getDependencyTree:R8,getObserverTree:pC,has:z8,intercept:Yh,isAction:jc,isBoxedObservable:yy,isComputed:SC,isComputedProp:I8,isFlow:ks,isFlowCancellationError:mC,isObservable:Xh,isObservableArray:Xr,isObservableMap:Mr,isObservableObject:Or,isObservableProp:j8,isObservableSet:Wr,keys:mc,makeAutoObservable:MC,makeObservable:Cy,observable:Tt,observe:Zh,onBecomeObserved:k8,onBecomeUnobserved:wy,onReactionError:eC,override:iP,ownKeys:B8,reaction:C8,remove:EC,runInAction:Cs,set:xy,spy:w8,toJS:CC,trace:kC,transaction:Di,untracked:by,values:Oy,when:nm},Symbol.toStringTag,{value:"Module"}));if(!Ze.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,gh=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 Ts=Ze;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=Ts.useState,ik=Ts.useEffect,ak=Ts.useLayoutEffect,ok=Ts.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=Ts.useSyncExternalStore!==void 0?Ts.useSyncExternalStore:uk;X8.exports=Z8;var ck=X8.exports;function C5(e){e.reaction=new xs("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=ht.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return gh.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),gh.register(r,i,i)),ht.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 Ze.forwardRef=="function"&&Ze.forwardRef(function(e){return null}).$$typeof,T5=Q8?Symbol.for("react.memo"):typeof Ze.memo=="function"&&Ze.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=Ze.forwardRef(o)),o=Ze.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 Ze.useState(function(){return Tt(e(),t,{autoBind:!0})})[0]}function e9(e){var t=Ze.useState(function(){return Tt(e,{},{deep:!1})})[0];return Cs(function(){Object.assign(t,e)}),t}function vk(e,t){var r=t&&e9(t);return Ze.useState(function(){return Tt(e(r),void 0,{autoBind:!0})})[0]}var $1;W8(Gw.unstable_batchedUpdates);var mk=($1=gh.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:gh,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"})),_i=po(_k);var t9={};const Ki=po(WC);var Ny={exports:{}},Jh={},vh={},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 Zt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ut;class r{constructor(y=[1,0,0,1,0,0]){this.dirty=!1,this.m=y&&y.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(y){y.m[0]=this.m[0],y.m[1]=this.m[1],y.m[2]=this.m[2],y.m[3]=this.m[3],y.m[4]=this.m[4],y.m[5]=this.m[5]}point(y){var _=this.m;return{x:_[0]*y.x+_[2]*y.y+_[4],y:_[1]*y.x+_[3]*y.y+_[5]}}translate(y,_){return this.m[4]+=this.m[0]*y+this.m[2]*_,this.m[5]+=this.m[1]*y+this.m[3]*_,this}scale(y,_){return this.m[0]*=y,this.m[1]*=y,this.m[2]*=_,this.m[3]*=_,this}rotate(y){var _=Math.cos(y),R=Math.sin(y),C=this.m[0]*_+this.m[2]*R,x=this.m[1]*_+this.m[3]*R,O=this.m[0]*-R+this.m[2]*_,P=this.m[1]*-R+this.m[3]*_;return this.m[0]=C,this.m[1]=x,this.m[2]=O,this.m[3]=P,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(y,_){var R=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,x=this.m[2]+this.m[0]*y,O=this.m[3]+this.m[1]*y;return this.m[0]=R,this.m[1]=C,this.m[2]=x,this.m[3]=O,this}multiply(y){var _=this.m[0]*y.m[0]+this.m[2]*y.m[1],R=this.m[1]*y.m[0]+this.m[3]*y.m[1],C=this.m[0]*y.m[2]+this.m[2]*y.m[3],x=this.m[1]*y.m[2]+this.m[3]*y.m[3],O=this.m[0]*y.m[4]+this.m[2]*y.m[5]+this.m[4],P=this.m[1]*y.m[4]+this.m[3]*y.m[5]+this.m[5];return this.m[0]=_,this.m[1]=R,this.m[2]=C,this.m[3]=x,this.m[4]=O,this.m[5]=P,this}invert(){var y=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*y,R=-this.m[1]*y,C=-this.m[2]*y,x=this.m[0]*y,O=y*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),P=y*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=R,this.m[2]=C,this.m[3]=x,this.m[4]=O,this.m[5]=P,this}getMatrix(){return this.m}decompose(){var y=this.m[0],_=this.m[1],R=this.m[2],C=this.m[3],x=this.m[4],O=this.m[5],P=y*C-_*R;let k={x,y:O,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(y!=0||_!=0){var M=Math.sqrt(y*y+_*_);k.rotation=_>0?Math.acos(y/M):-Math.acos(y/M),k.scaleX=M,k.scaleY=P/M,k.skewX=(y*R+_*C)/P,k.skewY=0}else if(R!=0||C!=0){var I=Math.sqrt(R*R+C*C);k.rotation=Math.PI/2-(C>0?Math.acos(-R/I):-Math.acos(R/I)),k.scaleX=P/I,k.scaleY=I,k.skewX=0,k.skewY=(y*R+_*C)/P}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="#",p="",E="0",w="Konva warning: ",m="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]},g=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,h=[];const v=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 y=d[0];return y==="#"||y==="."||y===y.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){h.push(d),h.length===1&&v(function(){const y=h;h=[],y.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,y){var _=e.Util.createImageElement();_.onload=function(){y(_)},_.src=d},_rgbToHex(d,y,_){return((1<<24)+(d<<16)+(y<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,p);var y=parseInt(d,16);return{r:y>>16&255,g:y>>8&255,b:y&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=E+d;return f+d},getRGB(d){var y;return d in b?(y=b[d],{r:y[0],g:y[1],b:y[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===S?(y=g.exec(d.replace(/ /g,"")),{r:parseInt(y[1],10),g:parseInt(y[2],10),b:parseInt(y[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 y=b[d.toLowerCase()];return y?{r:y[0],g:y[1],b:y[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var y=d.split(/ *, */).map(Number);return{r:y[0],g:y[1],b:y[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var y=d.split(/ *, */).map((_,R)=>_.slice(-1)==="%"?R===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:y[0],g:y[1],b:y[2],a:y[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[y,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),R=Number(_[0])/360,C=Number(_[1])/100,x=Number(_[2])/100;let O,P,k;if(C===0)return k=x*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};x<.5?O=x*(1+C):O=x+C-x*C;const M=2*x-O,I=[0,0,0];for(let H=0;H<3;H++)P=R+1/3*-(H-1),P<0&&P++,P>1&&P--,6*P<1?k=M+(O-M)*6*P:2*P<1?k=O:3*P<2?k=M+(O-M)*(2/3-P)*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,y){return!(y.x>d.x+d.width||y.x+y.width<d.x||y.y>d.y+d.height||y.y+y.height<d.y)},cloneObject(d){var y={};for(var _ in d)this._isPlainObject(d[_])?y[_]=this.cloneObject(d[_]):this._isArray(d[_])?y[_]=this.cloneArray(d[_]):y[_]=d[_];return y},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(m+d)},error(d){console.error(m+d)},warn(d){t.Konva.showWarnings&&console.warn(w+d)},each(d,y){for(var _ in d)y(_,d[_])},_inRange(d,y,_){return y<=d&&d<_},_getProjectionToSegment(d,y,_,R,C,x){var O,P,k,M=(d-_)*(d-_)+(y-R)*(y-R);if(M==0)O=d,P=y,k=(C-_)*(C-_)+(x-R)*(x-R);else{var I=((C-d)*(_-d)+(x-y)*(R-y))/M;I<0?(O=d,P=y,k=(d-C)*(d-C)+(y-x)*(y-x)):I>1?(O=_,P=R,k=(_-C)*(_-C)+(R-x)*(R-x)):(O=d+I*(_-d),P=y+I*(R-y),k=(O-C)*(O-C)+(P-x)*(P-x))}return[O,P,k]},_getProjectionToLine(d,y,_){var R=e.Util.cloneObject(d),C=Number.MAX_VALUE;return y.forEach(function(x,O){if(!(!_&&O===y.length-1)){var P=y[(O+1)%y.length],k=e.Util._getProjectionToSegment(x.x,x.y,P.x,P.y,d.x,d.y),M=k[0],I=k[1],H=k[2];H<C&&(R.x=M,R.y=I,C=H)}}),R},_prepareArrayForTween(d,y,_){var R,C=[],x=[];if(d.length>y.length){var O=y;y=d,d=O}for(R=0;R<d.length;R+=2)C.push({x:d[R],y:d[R+1]});for(R=0;R<y.length;R+=2)x.push({x:y[R],y:y[R+1]});var P=[];return x.forEach(function(k){var M=e.Util._getProjectionToLine(k,C,_);P.push(M.x),P.push(M.y)}),P},_prepareToStringify(d){var y;d.visitedByCircularReferenceRemoval=!0;for(var _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(y=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||e.Util._isElement(d[_]))if(y.configurable)delete d[_];else return null;else if(e.Util._prepareToStringify(d[_])===null)if(y.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,y){for(var _ in y)d[_]=y[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(y=>{y.width=0,y.height=0})},drawRoundedRectPath(d,y,_,R){let C=0,x=0,O=0,P=0;typeof R=="number"?C=x=O=P=Math.min(R,y/2,_/2):(C=Math.min(R[0]||0,y/2,_/2),x=Math.min(R[1]||0,y/2,_/2),P=Math.min(R[2]||0,y/2,_/2),O=Math.min(R[3]||0,y/2,_/2)),d.moveTo(C,0),d.lineTo(y-x,0),d.arc(y-x,x,x,Math.PI*3/2,0,!1),d.lineTo(y,_-P),d.arc(y-P,_-P,P,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)}}})(Zt);var Vt={},ft={},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 Ea=ut,Jt=Zt;function Oa(e){return Jt.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Jt.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(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isNumber(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}qe.getNumberValidator=Ek;function Ok(e){if(Ea.Konva.isUnminified)return function(t,r){let n=Jt.Util._isNumber(t),i=Jt.Util._isArray(t)&&t.length==e;return!n&&!i&&Jt.Util.warn(Oa(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(Ea.Konva.isUnminified)return function(e,t){var r=Jt.Util._isNumber(e),n=e==="auto";return r||n||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}qe.getNumberOrAutoValidator=xk;function Pk(){if(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isString(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}qe.getStringValidator=Pk;function Ck(){if(Ea.Konva.isUnminified)return function(e,t){const r=Jt.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||Jt.Util.warn(Oa(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(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isFunction(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}qe.getFunctionValidator=kk;function Tk(){if(Ea.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(Jt.Util._isArray(e)?e.forEach(function(n){Jt.Util._isNumber(n)||Jt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}qe.getNumberArrayValidator=Tk;function Ak(){if(Ea.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}qe.getBooleanValidator=Ak;function Rk(e){if(Ea.Konva.isUnminified)return function(t,r){return t==null||Jt.Util.isObject(t)||Jt.Util.warn(Oa(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=Zt,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(p){return l&&p!==void 0&&p!==null&&(p=l.call(this,p,o)),this._setAttr(o,p),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var p=l.length,E=t.Util._capitalize,w=n+E(o),m=i+E(o),S,b;a.prototype[w]=function(){var h={};for(S=0;S<p;S++)b=l[S],h[b]=this.getAttr(o+E(b));return h};var g=(0,r.getComponentValidator)(l);a.prototype[m]=function(h){var v=this.attrs[o],d;u&&(h=u.call(this,h)),g&&g.call(this,h,o);for(d in h)h.hasOwnProperty(d)&&this._setAttr(o+E(d),h[d]);return h||l.forEach(y=>{this._setAttr(o+E(y),void 0)}),this._fireChangeEvent(o,v,h),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),p=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(p);var E=this.attrs[o];return E===void 0?l:E},e.Factory.addSetter(a,o,u,function(){t.Util.error(p)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],p=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[p]=w,a.prototype[E]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ft);var vi={},pa={};Object.defineProperty(pa,"__esModule",{value:!0});pa.HitContext=pa.SceneContext=pa.Context=void 0;const r9=Zt,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 ep{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(p=>typeof p=="number"?Math.floor(p):p)),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 p=arguments,E=this._context;p.length===3?E.drawImage(t,r,n):p.length===5?E.drawImage(t,r,n,i,a):p.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)}}pa.Context=ep;Uk.forEach(function(e){Object.defineProperty(ep.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class $k extends ep{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(),p=u.x*f,E=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(p),Math.abs(E))),this.setAttr("shadowOffsetX",l.x*p),this.setAttr("shadowOffsetY",l.y*E)}}pa.SceneContext=$k;class Gk extends ep{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()}}}pa.HitContext=Gk;Object.defineProperty(vi,"__esModule",{value:!0});vi.HitCanvas=vi.SceneCanvas=vi.Canvas=void 0;const mh=Zt,n9=pa,i9=ut,Vk=ft,qk=qe;var hd;function Wk(){if(hd)return hd;var e=mh.Util.createCanvasElement(),t=e.getContext("2d");return hd=function(){var r=i9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),mh.Util.releaseCanvas(e),hd}class tp{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=mh.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 mh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}vi.Canvas=tp;Vk.Factory.addGetterSetter(tp,"pixelRatio",void 0,(0,qk.getNumberValidator)());class Kk extends tp{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)}}vi.SceneCanvas=Kk;class Yk extends tp{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new n9.HitContext(this),this.setSize(t.width,t.height)}}vi.HitCanvas=Yk;var rp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ut,r=Zt;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 p=l.dragDistance(),E=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(E<p||(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(p=>p.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))})(rp);Object.defineProperty(Vt,"__esModule",{value:!0});Vt.Node=void 0;const gt=Zt,Bc=ft,Au=vi,Ha=ut,Hn=rp,nr=qe;var Nd="absoluteOpacity",pd="allEventListeners",aa="absoluteTransform",M5="absoluteScale",Bo="canvas",Xk="Change",Zk="children",Qk="konva",am="listening",L5="mouseenter",N5="mouseleave",I5="set",D5="Shape",Id=" ",j5="stage",$a="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(Id);let tT=1,ot=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===$a||t===aa)&&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===$a||t===aa,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(Id);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(Bo)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===aa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Bo)){const{scene:t,filter:r,hit:n}=this._cache.get(Bo);gt.Util.releaseCanvas(t,r,n),this._cache.delete(Bo)}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,p=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,m=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+w,a+=f*2+m,l-=f,u-=f;var S=new Au.SceneCanvas({pixelRatio:o,width:i,height:a}),b=new Au.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),g=new Au.HitCanvas({pixelRatio:E,width:i,height:a}),h=S.getContext(),v=g.getContext();return g.isCache=!0,S.isCache=!0,this._cache.delete(Bo),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(S.getContext()._context.imageSmoothingEnabled=!1,b.getContext()._context.imageSmoothingEnabled=!1),h.save(),v.save(),h.translate(-l,-u),v.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Nd),this._clearSelfAndDescendantCache(M5),this.drawScene(S,this),this.drawHit(g,this),this._isUnderCache=!1,h.restore(),v.restore(),p&&(h.save(),h.beginPath(),h.rect(0,0,i,a),h.closePath(),h.setAttr("strokeStyle","red"),h.setAttr("lineWidth",5),h.stroke(),h.restore()),this._cache.set(Bo,{scene:S,filter:b,hit:g,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Bo)}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 p=u.point(f);i===void 0&&(i=o=p.x,a=l=p.y),i=Math.min(i,p.x),a=Math.min(a,p.y),o=Math.max(o,p.x),l=Math.max(l,p.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 p=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()/p,n.getHeight()/p),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(pd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Id),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(Id),i=n.length,a,o,l,u,f,p;if(this._cache&&this._cache.delete(pd),!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],p=u[1],f)this.eventListeners[f]&&this._off(f,p,r);else for(o in this.eventListeners)this._off(o,p,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(),Hn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(aa),this._clearSelfAndDescendantCache(Nd),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;Hn.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Ha.Konva.hitOnDragEnabled&&(i||Ha.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(p){for(i=[],a=p.length,o=0;o<a;o++)l=p[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($a),this._clearSelfAndDescendantCache(aa)),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($a);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($a),this._clearSelfAndDescendantCache(aa),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(Nd,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(aa,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(aa)||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($a,this._getTransform)}_getTransform(){var t,r,n=this._cache.get($a)||new gt.Transform;n.reset();var i=this.x(),a=this.y(),o=Ha.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,p=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||p!==0)&&n.skew(f,p),(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 Au.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 Au.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():Ha.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(Ha.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(pd))!==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(pd,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;Hn.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){Hn.DD._dragElements.has(this._id)||this._createDragElement(t);const n=Hn.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=Hn.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Hn.DD._endDragBefore(t),Hn.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Hn.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||Ha.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Hn.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=Hn.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Hn.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),Ha.Konva[n]||(gt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Ha.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}};Vt.Node=ot;ot.prototype.nodeType="Node";ot.prototype._attrsAffectingSize=[];ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,eT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache($a),this._clearSelfAndDescendantCache(aa)});ot.prototype.on.call(ot.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});ot.prototype.on.call(ot.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});ot.prototype.on.call(ot.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Nd)});const Rt=Bc.Factory.addGetterSetter;Rt(ot,"zIndex");Rt(ot,"absolutePosition");Rt(ot,"position");Rt(ot,"x",0,(0,nr.getNumberValidator)());Rt(ot,"y",0,(0,nr.getNumberValidator)());Rt(ot,"globalCompositeOperation","source-over",(0,nr.getStringValidator)());Rt(ot,"opacity",1,(0,nr.getNumberValidator)());Rt(ot,"name","",(0,nr.getStringValidator)());Rt(ot,"id","",(0,nr.getStringValidator)());Rt(ot,"rotation",0,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(ot,"scale",["x","y"]);Rt(ot,"scaleX",1,(0,nr.getNumberValidator)());Rt(ot,"scaleY",1,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(ot,"skew",["x","y"]);Rt(ot,"skewX",0,(0,nr.getNumberValidator)());Rt(ot,"skewY",0,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(ot,"offset",["x","y"]);Rt(ot,"offsetX",0,(0,nr.getNumberValidator)());Rt(ot,"offsetY",0,(0,nr.getNumberValidator)());Rt(ot,"dragDistance",null,(0,nr.getNumberValidator)());Rt(ot,"width",0,(0,nr.getNumberValidator)());Rt(ot,"height",0,(0,nr.getNumberValidator)());Rt(ot,"listening",!0,(0,nr.getBooleanValidator)());Rt(ot,"preventDefault",!0,(0,nr.getBooleanValidator)());Rt(ot,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(ot,"visible",!0,(0,nr.getBooleanValidator)());Rt(ot,"transformsEnabled","all",(0,nr.getStringValidator)());Rt(ot,"size");Rt(ot,"dragBoundFunc");Rt(ot,"draggable",!1,(0,nr.getBooleanValidator)());Bc.Factory.backCompat(ot,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var gl={};Object.defineProperty(gl,"__esModule",{value:!0});gl.Container=void 0;const Gs=ft,G1=Vt,np=qe;class vl 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 p=this.getAbsoluteTransform(r).getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[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(),p=typeof l=="number"&&typeof u=="number"||f;const E=n===this;if(p){o.save();var w=this.getAbsoluteTransform(n),m=w.getMatrix();o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath();let h;if(f)h=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,h),m=w.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var g=!E&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";g&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(h){h[t](r,n,i)}),g&&o.restore(),p&&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},p=this;(r=this.children)===null||r===void 0||r.forEach(function(b){if(b.visible()){var g=b.getClientRect({relativeTo:p,skipShadow:t.skipShadow,skipStroke:t.skipStroke});g.width===0&&g.height===0||(a===void 0?(a=g.x,o=g.y,l=g.x+g.width,u=g.y+g.height):(a=Math.min(a,g.x),o=Math.min(o,g.y),l=Math.max(l,g.x+g.width),u=Math.max(u,g.y+g.height)))}});for(var E=this.find("Shape"),w=!1,m=0;m<E.length;m++){var S=E[m];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)}}gl.Container=vl;Gs.Factory.addComponentsGetterSetter(vl,"clip",["x","y","width","height"]);Gs.Factory.addGetterSetter(vl,"clipX",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipY",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipWidth",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipHeight",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"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,bc=new Map,o9=rT.Konva._global.PointerEvent!==void 0;function nT(e){return bc.get(e)}En.getCapturedShape=nT;function Iy(e){return{evt:e,pointerId:e.pointerId}}En.createEvent=Iy;function iT(e,t){return bc.get(e)===t}En.hasPointerCapture=iT;function aT(e,t){l9(e),t.getStage()&&(bc.set(e,t),o9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}En.setPointerCapture=aT;function l9(e,t){const r=bc.get(e);if(!r)return;const n=r.getStage();n&&n.content,bc.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=Zt,r=ft,n=gl,i=ut,a=vi,o=rp,l=ut,u=En;var f="Stage",p="string",E="px",w="mouseout",m="mouseleave",S="mouseover",b="mouseenter",g="mousemove",h="mousedown",v="mouseup",d="pointermove",y="pointerdown",_="pointerup",R="pointercancel",C="lostpointercapture",x="pointerout",O="pointerleave",P="pointerover",k="pointerenter",M="contextmenu",I="touchstart",H="touchend",G="touchmove",Z="touchcancel",W="wheel",B=5,F=[[b,"_pointerenter"],[h,"_pointerdown"],[g,"_pointermove"],[v,"_pointerup"],[m,"_pointerleave"],[I,"_pointerdown"],[G,"_pointermove"],[H,"_pointerup"],[Z,"_pointercancel"],[S,"_pointerover"],[W,"_wheel"],[M,"_contextmenu"],[y,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[R,"_pointercancel"],[C,"_lostpointercapture"]];const T={mouse:{[x]:w,[O]:m,[P]:S,[k]:b,[d]:g,[y]:h,[_]:v,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[x]:"touchout",[O]:"touchleave",[P]:"touchover",[k]:"touchenter",[d]:G,[y]:I,[_]:H,[R]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[x]:x,[O]:O,[P]:P,[k]:k,[d]:d,[y]:y,[_]:_,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},L=V=>V.indexOf("pointer")>=0?"pointer":V.indexOf("touch")>=0?"touch":"mouse",z=V=>{const U=L(V);if(U==="pointer")return i.Konva.pointerEventsEnabled&&T.pointer;if(U==="touch")return T.touch;if(U==="mouse")return T.mouse};function D(V={}){return(V.clipFunc||V.clipWidth||V.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),V}const $="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 K extends n.Container{constructor(U){super(D(U)),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",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(U){const Y=U.getType()==="Layer",X=U.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const U=this.visible()?"":"none";this.content.style.display=U}setContainer(U){if(typeof U===p){if(U.charAt(0)==="."){var Y=U.slice(1);U=document.getElementsByClassName(Y)[0]}else{var X;U.charAt(0)!=="#"?X=U:X=U.slice(1),U=document.getElementById(X)}if(!U)throw"Can not find container in document with id "+X}return this._setAttr("container",U),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),U.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var U=this.children,Y=U.length,X;for(X=0;X<Y;X++)U[X].clear();return this}clone(U){return U||(U={}),U.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,U)}destroy(){super.destroy();var U=this.content;U&&t.Util._isInDocument(U)&&this.container().removeChild(U);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 U=this._pointerPositions[0]||this._changedPointerPositions[0];return U?{x:U.x,y:U.y}:(t.Util.warn($),null)}_getPointerById(U){return this._pointerPositions.find(Y=>Y.id===U)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(U){U=U||{},U.x=U.x||0,U.y=U.y||0,U.width=U.width||this.width(),U.height=U.height||this.height();var Y=new a.SceneCanvas({width:U.width,height:U.height,pixelRatio:U.pixelRatio||1}),X=Y.getContext()._context,Q=this.children;return(U.x||U.y)&&X.translate(-1*U.x,-1*U.y),Q.forEach(function(te){if(te.isVisible()){var ee=te._toKonvaCanvas(U);X.drawImage(ee._canvas,U.x,U.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),Y}getIntersection(U){if(!U)return null;var Y=this.children,X=Y.length,Q=X-1,te;for(te=Q;te>=0;te--){const ee=Y[te].getIntersection(U);if(ee)return ee}return null}_resizeDOM(){var U=this.width(),Y=this.height();this.content&&(this.content.style.width=U+E,this.content.style.height=Y+E),this.bufferCanvas.setSize(U,Y),this.bufferHitCanvas.setSize(U,Y),this.children.forEach(X=>{X.setSize({width:U,height:Y}),X.draw()})}add(U,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(U);var Q=this.children.length;return Q>B&&t.Util.warn("The stage has "+Q+" 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."),U.setSize({width:this.width(),height:this.height()}),U.draw(),i.Konva.isBrowser&&this.content.appendChild(U.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(U){return u.hasPointerCapture(U,this)}setPointerCapture(U){u.setPointerCapture(U,this)}releaseCapture(U){u.releaseCapture(U,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&F.forEach(([U,Y])=>{this.content.addEventListener(U,X=>{this[Y](X)},{passive:!1})})}_pointerenter(U){this.setPointersPositions(U);const Y=z(U.type);Y&&this._fire(Y.pointerenter,{evt:U,target:this,currentTarget:this})}_pointerover(U){this.setPointersPositions(U);const Y=z(U.type);Y&&this._fire(Y.pointerover,{evt:U,target:this,currentTarget:this})}_getTargetShape(U){let Y=this[U+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(U){const Y=z(U.type),X=L(U.type);if(Y){this.setPointersPositions(U);var Q=this._getTargetShape(X),te=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&te?(Q._fireAndBubble(Y.pointerout,{evt:U}),Q._fireAndBubble(Y.pointerleave,{evt:U}),this._fire(Y.pointerleave,{evt:U,target:this,currentTarget:this}),this[X+"targetShape"]=null):te&&(this._fire(Y.pointerleave,{evt:U,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:U,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(U){const Y=z(U.type),X=L(U.type);if(Y){this.setPointersPositions(U);var Q=!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:U,pointerId:te.id}),Q=!0;const ne=U.type.indexOf("touch")>=0;ee.preventDefault()&&U.cancelable&&ne&&U.preventDefault()}),Q||this._fire(Y.pointerdown,{evt:U,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(U){const Y=z(U.type),X=L(U.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&U.cancelable&&U.preventDefault(),this.setPointersPositions(U);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var te={};let ee=!1;var ne=this._getTargetShape(X);this._changedPointerPositions.forEach(ie=>{const oe=u.getCapturedShape(ie.id)||this.getIntersection(ie),ke=ie.id,Ie={evt:U,pointerId:ke};var le=ne!==oe;if(le&&ne&&(ne._fireAndBubble(Y.pointerout,{...Ie},oe),ne._fireAndBubble(Y.pointerleave,{...Ie},oe)),oe){if(te[oe._id])return;te[oe._id]=!0}oe&&oe.isListening()?(ee=!0,le&&(oe._fireAndBubble(Y.pointerover,{...Ie},ne),oe._fireAndBubble(Y.pointerenter,{...Ie},ne),this[X+"targetShape"]=oe),oe._fireAndBubble(Y.pointermove,{...Ie})):ne&&(this._fire(Y.pointerover,{evt:U,target:this,currentTarget:this,pointerId:ke}),this[X+"targetShape"]=null)}),ee||this._fire(Y.pointermove,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(U){const Y=z(U.type),X=L(U.type);if(!Y)return;this.setPointersPositions(U);const Q=this[X+"ClickStartShape"],te=this[X+"ClickEndShape"];var ee={};let ne=!1;this._changedPointerPositions.forEach(ie=>{const oe=u.getCapturedShape(ie.id)||this.getIntersection(ie);if(oe){if(oe.releaseCapture(ie.id),ee[oe._id])return;ee[oe._id]=!0}const ke=ie.id,Ie={evt:U,pointerId:ke};let le=!1;i.Konva["_"+X+"InDblClickWindow"]?(le=!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),oe&&oe.isListening()?(ne=!0,this[X+"ClickEndShape"]=oe,oe._fireAndBubble(Y.pointerup,{...Ie}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===oe&&(oe._fireAndBubble(Y.pointerclick,{...Ie}),le&&te&&te===oe&&oe._fireAndBubble(Y.pointerdblclick,{...Ie}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:U,target:this,currentTarget:this,pointerId:ke}),le&&this._fire(Y.pointerdblclick,{evt:U,target:this,currentTarget:this,pointerId:ke}))}),ne||this._fire(Y.pointerup,{evt:U,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,U.cancelable&&X!=="touch"&&U.preventDefault()}_contextmenu(U){this.setPointersPositions(U);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(M,{evt:U}):this._fire(M,{evt:U,target:this,currentTarget:this})}_wheel(U){this.setPointersPositions(U);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(W,{evt:U}):this._fire(W,{evt:U,target:this,currentTarget:this})}_pointercancel(U){this.setPointersPositions(U);const Y=u.getCapturedShape(U.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(_,u.createEvent(U)),u.releaseCapture(U.pointerId)}_lostpointercapture(U){u.releaseCapture(U.pointerId)}setPointersPositions(U){var Y=this._getContentPosition(),X=null,Q=null;U=U||window.event,U.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(U.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(U.changedTouches||U.touches,te=>{this._changedPointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})})):(X=(U.clientX-Y.left)/Y.scaleX,Q=(U.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(U)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(U)}])}_setPointerPosition(U){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(U)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var U=this.content.getBoundingClientRect();return{top:U.top,left:U.left,scaleX:U.width/this.content.clientWidth||1,scaleY:U.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 U=this.container();if(!U)throw"Stage has no container. A container is required.";U.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"),U.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(U){U.batchDraw()}),this}}e.Stage=K,K.prototype.nodeType=f,(0,l._registerNode)(K),r.Factory.addGetterSetter(K,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(V=>{V.batchDraw()})})})(a9);var Uc={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ut,r=Zt,n=ft,i=Vt,a=qe,o=ut,l=En;var u="hasShadow",f="shadowRGBA",p="patternImage",E="linearGradient",w="radialGradient";let m;function S(){return m||(m=r.Util.createCanvasElement().getContext("2d"),m)}e.shapes={};function b(O){const P=this.attrs.fillRule;P?O.fill(P):O.fill()}function g(O){O.stroke()}function h(O){O.fill()}function v(O){O.stroke()}function d(){this._clearCache(u)}function y(){this._clearCache(f)}function _(){this._clearCache(p)}function R(){this._clearCache(E)}function C(){this._clearCache(w)}class x extends i.Node{constructor(P){super(P);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(p,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var P=S();const k=P.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 P=this.fillLinearGradientColorStops();if(P){for(var k=S(),M=this.fillLinearGradientStartPoint(),I=this.fillLinearGradientEndPoint(),H=k.createLinearGradient(M.x,M.y,I.x,I.y),G=0;G<P.length;G+=2)H.addColorStop(P[G],P[G+1]);return H}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){var P=this.fillRadialGradientColorStops();if(P){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<P.length;G+=2)H.addColorStop(P[G],P[G+1]);return H}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var P=r.Util.colorToRGBA(this.shadowColor());if(P)return"rgba("+P.r+","+P.g+","+P.b+","+P.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 P=this.hitStrokeWidth();return P==="auto"?this.hasStroke():this.strokeEnabled()&&!!P}intersects(P){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(P.x),Math.round(P.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(P){var k;if(!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const I=P||this.hasFill(),H=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(I&&H&&G)return!0;const Z=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(I&&H&&Z&&W)}setStrokeHitEnabled(P){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),P?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var P=this.size();return{x:this._centroid?-P.width/2:0,y:this._centroid?-P.height/2:0,width:P.width,height:P.height}}getClientRect(P={}){let k=!1,M=this.getParent();for(;M;){if(M.isCached()){k=!0;break}M=M.getParent()}const I=P.skipTransform,H=P.relativeTo||k&&this.getStage()||void 0,G=this.getSelfRect(),W=!P.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,B=G.width+W,F=G.height+W,T=!P.skipShadow&&this.hasShadow(),L=T?this.shadowOffsetX():0,z=T?this.shadowOffsetY():0,D=B+Math.abs(L),$=F+Math.abs(z),K=T&&this.shadowBlur()||0,V=D+K*2,U=$+K*2,Y={width:V,height:U,x:-(W/2+K)+Math.min(L,0)+G.x,y:-(W/2+K)+Math.min(z,0)+G.y};return I?Y:this._transformedRect(Y,H)}drawScene(P,k,M){var I=this.getLayer(),H=P||I.getCanvas(),G=H.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),B=this.hasShadow(),F,T,L=H.isCache,z=k===this;if(!this.isVisible()&&!z)return this;if(Z){G.save();var D=this.getAbsoluteTransform(k).getMatrix();return G.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!L){F=this.getStage();const V=M||F.bufferCanvas;T=V.getContext(),T.clear(),T.save(),T._applyLineJoin(this);var $=this.getAbsoluteTransform(k).getMatrix();T.transform($[0],$[1],$[2],$[3],$[4],$[5]),W.call(this,T,this),T.restore();var K=V.pixelRatio;B&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage(V._canvas,0,0,V.width/K,V.height/K)}else{if(G._applyLineJoin(this),!z){var $=this.getAbsoluteTransform(k).getMatrix();G.transform($[0],$[1],$[2],$[3],$[4],$[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}B&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(P,k,M=!1){if(!this.shouldDrawHit(k,M))return this;var I=this.getLayer(),H=P||I.hitCanvas,G=H&&H.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),B=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()"),B){G.save();var F=this.getAbsoluteTransform(k).getMatrix();return G.transform(F[0],F[1],F[2],F[3],F[4],F[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Z)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 Z.call(this,G,this),G.restore(),this}drawHitFromCache(P=0){var k=this._getCanvasCache(),M=this._getCachedSceneCanvas(),I=k.hit,H=I.getContext(),G=I.getWidth(),Z=I.getHeight(),W,B,F,T,L,z;H.clear(),H.drawImage(M._canvas,0,0,G,Z);try{for(W=H.getImageData(0,0,G,Z),B=W.data,F=B.length,T=r.Util._hexToRgb(this.colorKey),L=0;L<F;L+=4)z=B[L+3],z>P?(B[L]=T.r,B[L+1]=T.g,B[L+2]=T.b,B[L+3]=255):B[L+3]=0;H.putImageData(W,0,0)}catch(D){r.Util.error("Unable to draw hit graph from cached scene canvas. "+D.message)}return this}hasPointerCapture(P){return l.hasPointerCapture(P,this)}setPointerCapture(P){l.setPointerCapture(P,this)}releaseCapture(P){l.releaseCapture(P,this)}}e.Shape=x,x.prototype._fillFunc=b,x.prototype._strokeFunc=g,x.prototype._fillFuncHit=h,x.prototype._strokeFuncHit=v,x.prototype._centroid=!1,x.prototype.nodeType="Shape",(0,o._registerNode)(x),x.prototype.eventListeners={},x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),x.prototype.on.call(x.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),x.prototype.on.call(x.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),n.Factory.addGetterSetter(x,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(x,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(x,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(x,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(x,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(x,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(x,"lineJoin"),n.Factory.addGetterSetter(x,"lineCap"),n.Factory.addGetterSetter(x,"sceneFunc"),n.Factory.addGetterSetter(x,"hitFunc"),n.Factory.addGetterSetter(x,"dash"),n.Factory.addGetterSetter(x,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(x,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(x,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(x,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillPatternImage"),n.Factory.addGetterSetter(x,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(x,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(x,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(x,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(x,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(x,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(x,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(x,"fillEnabled",!0),n.Factory.addGetterSetter(x,"strokeEnabled",!0),n.Factory.addGetterSetter(x,"shadowEnabled",!0),n.Factory.addGetterSetter(x,"dashEnabled",!0),n.Factory.addGetterSetter(x,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(x,"fillPriority","color"),n.Factory.addComponentsGetterSetter(x,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(x,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(x,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(x,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(x,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(x,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(x,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(x,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(x,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(x,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(x,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(x,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(x,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(x,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(x,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(x,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(x,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(x,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(x,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(x,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(x,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(x,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(x,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(x,"fillPatternRotation",0),n.Factory.addGetterSetter(x,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(x,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(gr);Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Layer=void 0;const ia=Zt,V1=gl,Vl=Vt,Dy=ft,F5=vi,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 Vs=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(){Vl.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=Vl.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(Vl.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(Vl.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 Vl.Node.prototype.remove.call(this),t&&t.parentNode&&ia.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"&&ia.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(),Vl.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(){ia.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ia.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ia.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=ia.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){ia.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ia.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 ia.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Uc.Layer=Vs;Vs.prototype.nodeType="Layer";(0,sT._registerNode)(Vs);Dy.Factory.addGetterSetter(Vs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Vs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Vs,"hitGraphEnabled",!0,(0,oT.getBooleanValidator)());var ip={};Object.defineProperty(ip,"__esModule",{value:!0});ip.FastLayer=void 0;const hT=Zt,pT=Uc,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.')}};ip.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,gT._registerNode)(jy);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.Group=void 0;const vT=Zt,mT=gl,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.")}};qs.Group=Fy;Fy.prototype.nodeType="Group";(0,yT._registerNode)(Fy);var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Animation=void 0;const q1=ut,z5=Zt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class ji{constructor(t,r){this.id=ji.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=ji.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(),ji._addAnimation(this),this}stop(){return ji._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 p=a[f];p._id!==void 0&&(t[p._id]=p)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=ji;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))}}Ws.Animation=ji;ji.animations=[];ji.animIdCounter=0;ji.animRunning=!1;var u9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Zt,r=Ws,n=Vt,i=ut;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,p=["fill","stroke","shadowColor"];class E{constructor(S,b,g,h,v,d,y){this.prop=S,this.propFunc=b,this.begin=h,this._pos=h,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=y,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=g,this._change=v-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,g=S.node,h=g._id,v,d=S.easing||e.Easings.Linear,y=!!S.yoyo,_;typeof S.duration>"u"?v=.3:S.duration===0?v=.001:v=S.duration,this.node=g,this._id=f++;var R=g.getLayer()||(g instanceof i.Konva.Stage?g.getLayers():null);R||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()},R),this.tween=new E(_,function(C){b._tweenFunc(C)},d,0,1,v*1e3,y),this._addListeners(),w.attrs[h]||(w.attrs[h]={}),w.attrs[h][this._id]||(w.attrs[h][this._id]={}),w.tweens[h]||(w.tweens[h]={});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 g=this.node,h=g._id,v,d,y,_,R,C,x,O;if(y=w.tweens[h][S],y&&delete w.attrs[h][y][S],v=g.getAttr(S),t.Util._isArray(b))if(d=[],R=Math.max(b.length,v.length),S==="points"&&b.length!==v.length&&(b.length>v.length?(x=v,v=t.Util._prepareArrayForTween(v,b,g.closed())):(C=b,b=t.Util._prepareArrayForTween(b,v,g.closed()))),S.indexOf("fill")===0)for(_=0;_<R;_++)if(_%2===0)d.push(b[_]-v[_]);else{var P=t.Util.colorToRGBA(v[_]);O=t.Util.colorToRGBA(b[_]),v[_]=P,d.push({r:O.r-P.r,g:O.g-P.g,b:O.b-P.b,a:O.a-P.a})}else for(_=0;_<R;_++)d.push(b[_]-v[_]);else p.indexOf(S)!==-1?(v=t.Util.colorToRGBA(v),O=t.Util.colorToRGBA(b),d={r:O.r-v.r,g:O.g-v.g,b:O.b-v.b,a:O.a-v.a}):d=b-v;w.attrs[h][this._id][S]={start:v,diff:d,end:b,trueEnd:C,trueStart:x},w.tweens[h][S]=this._id}_tweenFunc(S){var b=this.node,g=w.attrs[b._id][this._id],h,v,d,y,_,R,C,x;for(h in g){if(v=g[h],d=v.start,y=v.diff,x=v.end,t.Util._isArray(d))if(_=[],C=Math.max(d.length,x.length),h.indexOf("fill")===0)for(R=0;R<C;R++)R%2===0?_.push((d[R]||0)+y[R]*S):_.push("rgba("+Math.round(d[R].r+y[R].r*S)+","+Math.round(d[R].g+y[R].g*S)+","+Math.round(d[R].b+y[R].b*S)+","+(d[R].a+y[R].a*S)+")");else for(R=0;R<C;R++)_.push((d[R]||0)+y[R]*S);else p.indexOf(h)!==-1?_="rgba("+Math.round(d.r+y.r*S)+","+Math.round(d.g+y.g*S)+","+Math.round(d.b+y.b*S)+","+(d.a+y.a*S)+")":_=d+y*S;b.setAttr(h,_)}}_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,g=w.tweens[S],h;this.pause();for(h in g)delete w.tweens[S][h];delete w.attrs[S][b]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(m){var S=m.onFinish;m.node=this,m.onFinish=function(){this.destroy(),S&&S()};var b=new w(m);b.play()},e.Easings={BackEaseIn(m,S,b,g){var h=1.70158;return b*(m/=g)*m*((h+1)*m-h)+S},BackEaseOut(m,S,b,g){var h=1.70158;return b*((m=m/g-1)*m*((h+1)*m+h)+1)+S},BackEaseInOut(m,S,b,g){var h=1.70158;return(m/=g/2)<1?b/2*(m*m*(((h*=1.525)+1)*m-h))+S:b/2*((m-=2)*m*(((h*=1.525)+1)*m+h)+2)+S},ElasticEaseIn(m,S,b,g,h,v){var d=0;return m===0?S:(m/=g)===1?S+b:(v||(v=g*.3),!h||h<Math.abs(b)?(h=b,d=v/4):d=v/(2*Math.PI)*Math.asin(b/h),-(h*Math.pow(2,10*(m-=1))*Math.sin((m*g-d)*(2*Math.PI)/v))+S)},ElasticEaseOut(m,S,b,g,h,v){var d=0;return m===0?S:(m/=g)===1?S+b:(v||(v=g*.3),!h||h<Math.abs(b)?(h=b,d=v/4):d=v/(2*Math.PI)*Math.asin(b/h),h*Math.pow(2,-10*m)*Math.sin((m*g-d)*(2*Math.PI)/v)+b+S)},ElasticEaseInOut(m,S,b,g,h,v){var d=0;return m===0?S:(m/=g/2)===2?S+b:(v||(v=g*(.3*1.5)),!h||h<Math.abs(b)?(h=b,d=v/4):d=v/(2*Math.PI)*Math.asin(b/h),m<1?-.5*(h*Math.pow(2,10*(m-=1))*Math.sin((m*g-d)*(2*Math.PI)/v))+S:h*Math.pow(2,-10*(m-=1))*Math.sin((m*g-d)*(2*Math.PI)/v)*.5+b+S)},BounceEaseOut(m,S,b,g){return(m/=g)<1/2.75?b*(7.5625*m*m)+S:m<2/2.75?b*(7.5625*(m-=1.5/2.75)*m+.75)+S:m<2.5/2.75?b*(7.5625*(m-=2.25/2.75)*m+.9375)+S:b*(7.5625*(m-=2.625/2.75)*m+.984375)+S},BounceEaseIn(m,S,b,g){return b-e.Easings.BounceEaseOut(g-m,0,b,g)+S},BounceEaseInOut(m,S,b,g){return m<g/2?e.Easings.BounceEaseIn(m*2,0,b,g)*.5+S:e.Easings.BounceEaseOut(m*2-g,0,b,g)*.5+b*.5+S},EaseIn(m,S,b,g){return b*(m/=g)*m+S},EaseOut(m,S,b,g){return-b*(m/=g)*(m-2)+S},EaseInOut(m,S,b,g){return(m/=g/2)<1?b/2*m*m+S:-b/2*(--m*(m-2)-1)+S},StrongEaseIn(m,S,b,g){return b*(m/=g)*m*m*m*m+S},StrongEaseOut(m,S,b,g){return b*((m=m/g-1)*m*m*m*m+1)+S},StrongEaseInOut(m,S,b,g){return(m/=g/2)<1?b/2*m*m*m*m*m+S:b/2*((m-=2)*m*m*m*m+2)+S},Linear(m,S,b,g){return b*m/g+S}}})(u9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ut,r=Zt,n=Vt,i=gl,a=a9,o=Uc,l=ip,u=qs,f=rp,p=gr,E=Ws,w=u9,m=pa,S=vi;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:p.Shape,shapes:p.shapes,Animation:E.Animation,Tween:w.Tween,Easings:w.Easings,Context:m.Context,Canvas:S.Canvas}),e.default=e.Konva})(vh);var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.Arc=void 0;const op=ft,bT=gr,B5=ut,lp=qe,_T=ut;let xa=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),p=o*r,E=l*(l>0?t:r),w=u*(u>0?r:t);return{x:f,y:n?-1*w:E,width:p-f,height:w-E}}};ap.Arc=xa;xa.prototype._centroid=!0;xa.prototype.className="Arc";xa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_T._registerNode)(xa);op.Factory.addGetterSetter(xa,"innerRadius",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"outerRadius",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"angle",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"clockwise",!1,(0,lp.getBooleanValidator)());var sp={},Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Line=void 0;const up=ft,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),p=o*u/(l+u),E=r-f*(i-e),w=n-f*(a-t),m=r+p*(i-e),S=n+p*(a-t);return[E,w,m,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 _o=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}}};Hc.Line=_o;_o.prototype.className="Line";_o.prototype._attrsAffectingSize=["points","bezier","tension"];(0,ST._registerNode)(_o);up.Factory.addGetterSetter(_o,"closed",!1);up.Factory.addGetterSetter(_o,"bezier",!1);up.Factory.addGetterSetter(_o,"tension",0,(0,c9.getNumberValidator)());up.Factory.addGetterSetter(_o,"points",[],(0,c9.getNumberArrayValidator)());var Ks={},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,p,E;f=u/2,p=0;for(let m=0;m<20;m++)E=f*e.tValues[20][m]+f,p+=e.cValues[20][m]*n(o,l,E);return f*p};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],p=l[0]-2*l[1]+l[2],E=2*o[1]-2*o[0],w=2*l[1]-2*l[0],m=4*(f*f+p*p),S=4*(f*E+p*w),b=E*E+w*w;if(m===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const g=S/(2*m),h=b/m,v=u+g,d=h-g*g,y=v*v+d>0?Math.sqrt(v*v+d):0,_=g*g+d>0?Math.sqrt(g*g+d):0,R=g+Math.sqrt(g*g+d)!==0?d*Math.log(Math.abs((v+y)/(g+_))):0;return Math.sqrt(m)/2*(v*y-g*_+R)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),p=i(1,u,l),E=f*f+p*p;return Math.sqrt(E)}const i=(o,l,u)=>{const f=u.length-1;let p,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{p=new Array(f);for(let w=0;w<f;w++)p[w]=f*(u[w+1]-u[w]);return i(o-1,l,p)}},a=(o,l,u)=>{let f=1,p=o/l,E=(o-u(p))/l,w=0;for(;f>.001;){const m=u(p+E),S=Math.abs(o-m)/l;if(S<f)f=S,p+=E;else{const b=u(p-E),g=Math.abs(o-b)/l;g<f?(f=g,p-=E):E/=2}if(w++,w>500)break}return p};e.t2length=a})(f9);Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Path=void 0;const ET=ft,OT=gr,xT=ut,ql=f9;let $c=class sn extends OT.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=sn.parsePathData(this.data()),this.pathLength=sn.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],p=o[3],E=o[4],w=o[5],m=o[6],S=o[7],b=f>p?f:p,g=f>p?1:f/p,h=f>p?p/f:1;t.translate(l,u),t.rotate(m),t.scale(g,h),t.arc(0,0,b,E,E+w,1-S),t.scale(1/g,1/h),t.rotate(-m),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 p=f.points[4],E=f.points[5],w=f.points[4]+E,m=Math.PI/180;if(Math.abs(p-w)<m&&(m=Math.abs(p-w)),E<0)for(let S=p-m;S>w;S-=m){const b=sn.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=p+m;S<w;S+=m){const b=sn.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=sn.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 sn.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 sn.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return sn.getPointOnCubicBezier((0,ql.t2length)(t,sn.getPathLength(r),b=>(0,ql.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 sn.getPointOnQuadraticBezier((0,ql.t2length)(t,sn.getPathLength(r),b=>(0,ql.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],p=l[2],E=l[3],w=l[4],m=l[5],S=l[6];return w+=m*t/o.pathLength,sn.getPointOnEllipticalArc(u,f,p,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),p=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),E=f*p;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+p,y:l+E};const w=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),m=r+w*(i-r),S=n+w*(a-n),b=this.getLineLength(o,l,m,S),g=Math.sqrt(t*t-b*b),h=Math.sqrt(g*g/(1+f*f))*(i<r?-1:1),v=f*h;return{x:m+h,y:S+v}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function p(g){return g*g*g}function E(g){return 3*g*g*(1-g)}function w(g){return 3*g*(1-g)*(1-g)}function m(g){return(1-g)*(1-g)*(1-g)}var S=u*p(t)+o*E(t)+i*w(t)+r*m(t),b=f*p(t)+l*E(t)+a*w(t)+n*m(t);return{x:S,y:b}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(m){return m*m}function f(m){return 2*m*(1-m)}function p(m){return(1-m)*(1-m)}var E=o*u(t)+i*f(t)+r*p(t),w=l*u(t)+a*f(t)+n*p(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,p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,E;for(i=1;i<a.length;i++){var w=a[i],m=w.charAt(0);for(w=w.slice(1),l.length=0;E=p.exec(w);)l.push(E[0]);for(var S=[],b=0,g=l.length;b<g;b++){if(l[b]==="00"){S.push(0,0);continue}var h=parseFloat(l[b]);isNaN(h)?S.push(0):S.push(h)}for(;S.length>0&&!isNaN(S[0]);){var v="",d=[],y=u,_=f,R,C,x,O,P,k,M,I,H,G;switch(m){case"l":u+=S.shift(),f+=S.shift(),v="L",d.push(u,f);break;case"L":u=S.shift(),f=S.shift(),d.push(u,f);break;case"m":var Z=S.shift(),W=S.shift();if(u+=Z,f+=W,v="M",o.length>2&&o[o.length-1].command==="z"){for(var B=o.length-2;B>=0;B--)if(o[B].command==="M"){u=o[B].points[0]+Z,f=o[B].points[1]+W;break}}d.push(u,f),m="l";break;case"M":u=S.shift(),f=S.shift(),v="M",d.push(u,f),m="L";break;case"h":u+=S.shift(),v="L",d.push(u,f);break;case"H":u=S.shift(),v="L",d.push(u,f);break;case"v":f+=S.shift(),v="L",d.push(u,f);break;case"V":f=S.shift(),v="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(),v="C",d.push(u,f);break;case"S":C=u,x=f,R=o[o.length-1],R.command==="C"&&(C=u+(u-R.points[2]),x=f+(f-R.points[3])),d.push(C,x,S.shift(),S.shift()),u=S.shift(),f=S.shift(),v="C",d.push(u,f);break;case"s":C=u,x=f,R=o[o.length-1],R.command==="C"&&(C=u+(u-R.points[2]),x=f+(f-R.points[3])),d.push(C,x,u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),v="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(),v="Q",d.push(u,f);break;case"T":C=u,x=f,R=o[o.length-1],R.command==="Q"&&(C=u+(u-R.points[0]),x=f+(f-R.points[1])),u=S.shift(),f=S.shift(),v="Q",d.push(C,x,u,f);break;case"t":C=u,x=f,R=o[o.length-1],R.command==="Q"&&(C=u+(u-R.points[0]),x=f+(f-R.points[1])),u+=S.shift(),f+=S.shift(),v="Q",d.push(C,x,u,f);break;case"A":O=S.shift(),P=S.shift(),k=S.shift(),M=S.shift(),I=S.shift(),H=u,G=f,u=S.shift(),f=S.shift(),v="A",d=this.convertEndpointToCenterParameterization(H,G,u,f,M,I,O,P,k);break;case"a":O=S.shift(),P=S.shift(),k=S.shift(),M=S.shift(),I=S.shift(),H=u,G=f,u+=S.shift(),f+=S.shift(),v="A",d=this.convertEndpointToCenterParameterization(H,G,u,f,M,I,O,P,k);break}o.push({command:v||m,points:d,start:{x:y,y:_},pathLength:this.calcLength(y,_,v||m,d)})}(m==="z"||m==="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=sn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,ql.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,ql.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var p=i[4],E=i[5],w=i[4]+E,m=Math.PI/180;if(Math.abs(p-w)<m&&(m=Math.abs(p-w)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),E<0)for(u=p-m;u>w;u-=m)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=p+m;u<w;u+=m)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 p=f*(Math.PI/180),E=Math.cos(p)*(t-n)/2+Math.sin(p)*(r-i)/2,w=-1*Math.sin(p)*(t-n)/2+Math.cos(p)*(r-i)/2,m=E*E/(l*l)+w*w/(u*u);m>1&&(l*=Math.sqrt(m),u*=Math.sqrt(m));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,g=S*-u*E/l,h=(t+n)/2+Math.cos(p)*b-Math.sin(p)*g,v=(r+i)/2+Math.sin(p)*b+Math.cos(p)*g,d=function(P){return Math.sqrt(P[0]*P[0]+P[1]*P[1])},y=function(P,k){return(P[0]*k[0]+P[1]*k[1])/(d(P)*d(k))},_=function(P,k){return(P[0]*k[1]<P[1]*k[0]?-1:1)*Math.acos(y(P,k))},R=_([1,0],[(E-b)/l,(w-g)/u]),C=[(E-b)/l,(w-g)/u],x=[(-1*E-b)/l,(-1*w-g)/u],O=_(C,x);return y(C,x)<=-1&&(O=Math.PI),y(C,x)>=1&&(O=0),o===0&&O>0&&(O=O-2*Math.PI),o===1&&O<0&&(O=O+2*Math.PI),[h,v,l,u,R,O,p,o]}};Ks.Path=$c;$c.prototype.className="Path";$c.prototype._attrsAffectingSize=["data"];(0,xT._registerNode)($c);ET.Factory.addGetterSetter($c,"data");Object.defineProperty(sp,"__esModule",{value:!0});sp.Arrow=void 0;const cp=ft,PT=Hc,d9=qe,CT=ut,H5=Ks;let ml=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]],m=H5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),S=H5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/m),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 p=(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(p),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}}};sp.Arrow=ml;ml.prototype.className="Arrow";(0,CT._registerNode)(ml);cp.Factory.addGetterSetter(ml,"pointerLength",10,(0,d9.getNumberValidator)());cp.Factory.addGetterSetter(ml,"pointerWidth",10,(0,d9.getNumberValidator)());cp.Factory.addGetterSetter(ml,"pointerAtBeginning",!1);cp.Factory.addGetterSetter(ml,"pointerAtEnding",!0);var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.Circle=void 0;const kT=ft,TT=gr,AT=qe,RT=ut;let Ys=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)}};fp.Circle=Ys;Ys.prototype._centroid=!0;Ys.prototype.className="Circle";Ys.prototype._attrsAffectingSize=["radius"];(0,RT._registerNode)(Ys);kT.Factory.addGetterSetter(Ys,"radius",0,(0,AT.getNumberValidator)());var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Ellipse=void 0;const zy=ft,MT=gr,h9=qe,LT=ut;let wo=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)}};dp.Ellipse=wo;wo.prototype.className="Ellipse";wo.prototype._centroid=!0;wo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,LT._registerNode)(wo);zy.Factory.addComponentsGetterSetter(wo,"radius",["x","y"]);zy.Factory.addGetterSetter(wo,"radiusX",0,(0,h9.getNumberValidator)());zy.Factory.addGetterSetter(wo,"radiusY",0,(0,h9.getNumberValidator)());var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Image=void 0;const K1=Zt,yl=ft,NT=gr,IT=ut,Gc=qe;let Yi=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}};hp.Image=Yi;Yi.prototype.className="Image";(0,IT._registerNode)(Yi);yl.Factory.addGetterSetter(Yi,"cornerRadius",0,(0,Gc.getNumberOrArrayOfNumbersValidator)(4));yl.Factory.addGetterSetter(Yi,"image");yl.Factory.addComponentsGetterSetter(Yi,"crop",["x","y","width","height"]);yl.Factory.addGetterSetter(Yi,"cropX",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropY",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropWidth",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropHeight",0,(0,Gc.getNumberValidator)());var As={};Object.defineProperty(As,"__esModule",{value:!0});As.Tag=As.Label=void 0;const pp=ft,DT=gr,jT=qs,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})}}};As.Label=Uy;Uy.prototype.className="Label";(0,g9._registerNode)(Uy);let bl=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,p=0,E=0;typeof l=="number"?u=f=p=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),p=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(p,n),t.arc(p,n-p,p,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}}};As.Tag=bl;bl.prototype.className="Tag";(0,g9._registerNode)(bl);pp.Factory.addGetterSetter(bl,"pointerDirection",zT);pp.Factory.addGetterSetter(bl,"pointerWidth",0,(0,By.getNumberValidator)());pp.Factory.addGetterSetter(bl,"pointerHeight",0,(0,By.getNumberValidator)());pp.Factory.addGetterSetter(bl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Rect=void 0;const UT=ft,HT=gr,$T=ut,GT=Zt,VT=qe;let gp=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)}};Vc.Rect=gp;gp.prototype.className="Rect";(0,$T._registerNode)(gp);UT.Factory.addGetterSetter(gp,"cornerRadius",0,(0,VT.getNumberOrArrayOfNumbersValidator)(4));var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.RegularPolygon=void 0;const m9=ft,qT=gr,y9=qe,WT=ut;let _l=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)}};vp.RegularPolygon=_l;_l.prototype.className="RegularPolygon";_l.prototype._centroid=!0;_l.prototype._attrsAffectingSize=["radius"];(0,WT._registerNode)(_l);m9.Factory.addGetterSetter(_l,"radius",0,(0,y9.getNumberValidator)());m9.Factory.addGetterSetter(_l,"sides",0,(0,y9.getNumberValidator)());var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Ring=void 0;const b9=ft,KT=gr,_9=qe,YT=ut;var $5=Math.PI*2;let wl=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)}};mp.Ring=wl;wl.prototype.className="Ring";wl.prototype._centroid=!0;wl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,YT._registerNode)(wl);b9.Factory.addGetterSetter(wl,"innerRadius",0,(0,_9.getNumberValidator)());b9.Factory.addGetterSetter(wl,"outerRadius",0,(0,_9.getNumberValidator)());var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Sprite=void 0;const Sl=ft,XT=gr,ZT=Ws,w9=qe,QT=ut;let Xi=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],p=a[i+3],E=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,p),t.closePath(),t.fillStrokeShape(this)),E)if(o){var w=o[r],m=n*2;t.drawImage(E,l,u,f,p,w[m+0],w[m+1],f,p)}else t.drawImage(E,l,u,f,p,0,0,f,p)}_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],p=n*2;t.rect(f[p+0],f[p+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)}};yp.Sprite=Xi;Xi.prototype.className="Sprite";(0,QT._registerNode)(Xi);Sl.Factory.addGetterSetter(Xi,"animation");Sl.Factory.addGetterSetter(Xi,"animations");Sl.Factory.addGetterSetter(Xi,"frameOffsets");Sl.Factory.addGetterSetter(Xi,"image");Sl.Factory.addGetterSetter(Xi,"frameIndex",0,(0,w9.getNumberValidator)());Sl.Factory.addGetterSetter(Xi,"frameRate",17,(0,w9.getNumberValidator)());Sl.Factory.backCompat(Xi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Star=void 0;const Hy=ft,JT=gr,$y=qe,eA=ut;let So=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)}};bp.Star=So;So.prototype.className="Star";So.prototype._centroid=!0;So.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,eA._registerNode)(So);Hy.Factory.addGetterSetter(So,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(So,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(So,"outerRadius",0,(0,$y.getNumberValidator)());var ul={};Object.defineProperty(ul,"__esModule",{value:!0});ul.Text=ul.stringToArray=void 0;const hm=Zt,Hr=ft,tA=gr,Y1=ut,Eo=qe,rA=ut;function S9(e){return Array.from(e)}ul.stringToArray=S9;var Wl="auto",nA="center",E9="inherit",Ru="justify",iA="Change.konva",aA="2d",G5="-",O9="left",oA="text",lA="Text",sA="top",uA="bottom",V5="middle",x9="normal",cA="px ",gd=" ",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 vd;function Z1(){return vd||(vd=hm.Util.createCanvasElement().getContext(aA),vd)}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 er=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,p=this.align(),E=this.getWidth(),w=this.letterSpacing(),m=this.fill(),S=this.textDecoration(),b=S.indexOf("underline")!==-1,g=S.indexOf("line-through")!==-1,h;u=u===E9?t.direction:u;var v=o/2,d=V5;if(Y1.Konva._fixTextRendering){var y=this.measureSize("M");d="alphabetic",v=(y.fontBoundingBoxAscent-y.fontBoundingBoxDescent)/2+o/2}var _=0,R=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),h=0;h<n;h++){var _=0,R=0,C=r[h],x=C.text,O=C.width,P=C.lastInParagraph,k,M,I;if(t.save(),p===fA?_+=E-O-i*2:p===nA&&(_+=(E-O-i*2)/2),b){t.save(),t.beginPath();let F=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const T=_,L=v+R+F;t.moveTo(T,L),k=x.split(" ").length-1,M=k===0,I=p===Ru&&!P?E-i*2:O,t.lineTo(T+Math.round(I),L),t.lineWidth=a/15;const z=this._getLinearGradient();t.strokeStyle=z||m,t.stroke(),t.restore()}if(g){t.save(),t.beginPath();let F=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(_,v+R+F),k=x.split(" ").length-1,M=k===0,I=p===Ru&&P&&!M?E-i*2:O,t.lineTo(_+Math.round(I),v+R+F),t.lineWidth=a/15;const T=this._getLinearGradient();t.strokeStyle=T||m,t.stroke(),t.restore()}if(u!==q5&&(w!==0||p===Ru)){k=x.split(" ").length-1;for(var H=S9(x),G=0;G<H.length;G++){var Z=H[G];Z===" "&&!P&&p===Ru&&(_+=(E-i*2-O)/k),this._partialTextX=_,this._partialTextY=v+R,this._partialText=Z,t.fillStrokeShape(this),_+=this.measureSize(Z).width+w}}else w!==0&&t.setAttr("letterSpacing",`${w}px`),this._partialTextX=_,this._partialTextY=v+R,this._partialText=x,t.fillStrokeShape(this);t.restore(),n>1&&(v+=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===Wl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Wl||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,p,E,w,m=Z1(),S=this.fontSize(),b;m.save(),m.font=this._getContextFont(),b=m.measureText(t),m.restore();const g=S/100;return{actualBoundingBoxAscent:(r=b.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*g,actualBoundingBoxDescent:(n=b.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=b.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*g,actualBoundingBoxRight:(a=b.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*g,alphabeticBaseline:(o=b.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(l=b.emHeightAscent)!==null&&l!==void 0?l:100*g,emHeightDescent:(u=b.emHeightDescent)!==null&&u!==void 0?u:-20*g,fontBoundingBoxAscent:(f=b.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*g,fontBoundingBoxDescent:(p=b.fontBoundingBoxDescent)!==null&&p!==void 0?p:21*g,hangingBaseline:(E=b.hangingBaseline)!==null&&E!==void 0?E:72.80000305175781*g,ideographicBaseline:(w=b.ideographicBaseline)!==null&&w!==void 0?w:-21*g,width:b.width,height:S}}_getContextFont(){return this.fontStyle()+gd+this.fontVariant()+gd+(this.fontSize()+cA)+gA(this.fontFamily())}_addTextLine(t){this.align()===Ru&&(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!==Wl&&a!==void 0,u=o!==Wl&&o!==void 0,f=this.padding(),p=a-f*2,E=o-f*2,w=0,m=this.wrap(),S=m!==W5,b=m!==hA&&S,g=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var h=g?this._getTextWidth(X1):0,v=0,d=t.length;v<d;++v){var y=t[v],_=this._getTextWidth(y);if(l&&_>p)for(;y.length>0;){for(var R=0,C=y.length,x="",O=0;R<C;){var P=R+C>>>1,k=y.slice(0,P+1),M=this._getTextWidth(k)+h;M<=p?(R=P+1,x=k,O=M):C=P}if(x){if(b){var I,H=y[x.length],G=H===gd||H===G5;G&&O<=p?I=x.length:I=Math.max(x.lastIndexOf(gd),x.lastIndexOf(G5))+1,I>0&&(R=I,x=x.slice(0,R),O=this._getTextWidth(x))}x=x.trimRight(),this._addTextLine(x),n=Math.max(n,O),w+=i;var Z=this._shouldHandleEllipsis(w);if(Z){this._tryToAddEllipsisToLastLine();break}if(y=y.slice(R),y=y.trimLeft(),y.length>0&&(_=this._getTextWidth(y),_<=p)){this._addTextLine(y),w+=i,n=Math.max(n,_);break}}else break}else this._addTextLine(y),w+=i,n=Math.max(n,_),this._shouldHandleEllipsis(w)&&v<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!==Wl&&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!==Wl&&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()}};ul.Text=er;er.prototype._fillFunc=vA;er.prototype._strokeFunc=mA;er.prototype.className=lA;er.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,rA._registerNode)(er);Hr.Factory.overWriteSetter(er,"width",(0,Eo.getNumberOrAutoValidator)());Hr.Factory.overWriteSetter(er,"height",(0,Eo.getNumberOrAutoValidator)());Hr.Factory.addGetterSetter(er,"direction",E9);Hr.Factory.addGetterSetter(er,"fontFamily","Arial");Hr.Factory.addGetterSetter(er,"fontSize",12,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"fontStyle",x9);Hr.Factory.addGetterSetter(er,"fontVariant",x9);Hr.Factory.addGetterSetter(er,"padding",0,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"align",O9);Hr.Factory.addGetterSetter(er,"verticalAlign",sA);Hr.Factory.addGetterSetter(er,"lineHeight",1,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"wrap",dA);Hr.Factory.addGetterSetter(er,"ellipsis",!1,(0,Eo.getBooleanValidator)());Hr.Factory.addGetterSetter(er,"letterSpacing",0,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"text","",(0,Eo.getStringValidator)());Hr.Factory.addGetterSetter(er,"textDecoration","");var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.TextPath=void 0;const Q1=Zt,wi=ft,bA=gr,Mu=Ks,J1=ul,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 Mu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Mu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Mu.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 p=0;p<u.length;p++){const E=this._getPointAtLength(f);if(!E)return;let w=this._getTextSize(u[p]).width+n;if(u[p]===" "&&i==="justify"){const v=this.text().split(" ").length-1;w+=(this.pathLength-o)/v}const m=this._getPointAtLength(f+w);if(!m)return;const S=Mu.Path.getLineLength(E.x,E.y,m.x,m.y);let b=0;if(a)try{b=a(u[p-1],u[p])*this.fontSize()}catch{b=0}E.x+=b,m.x+=b,this.textWidth+=b;const g=Mu.Path.getPointOnLine(b+S/2,E.x,E.y,m.x,m.y),h=Math.atan2(m.y-E.y,m.x-E.x);this.glyphInfo.push({transposeX:g.x,transposeY:g.y,text:u[p],rotation:h,p0:E,p1:m}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(p){t.push(p.p0.x),t.push(p.p0.y),t.push(p.p1.x),t.push(p.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()}};_p.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);wi.Factory.addGetterSetter(vr,"data");wi.Factory.addGetterSetter(vr,"fontFamily","Arial");wi.Factory.addGetterSetter(vr,"fontSize",12,(0,C9.getNumberValidator)());wi.Factory.addGetterSetter(vr,"fontStyle",k9);wi.Factory.addGetterSetter(vr,"align","left");wi.Factory.addGetterSetter(vr,"letterSpacing",0,(0,C9.getNumberValidator)());wi.Factory.addGetterSetter(vr,"textBaseline","middle");wi.Factory.addGetterSetter(vr,"fontVariant",k9);wi.Factory.addGetterSetter(vr,"text",wA);wi.Factory.addGetterSetter(vr,"textDecoration",null);wi.Factory.addGetterSetter(vr,"kerningFunc",null);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Transformer=void 0;const kt=Zt,Ot=ft,K5=Vt,SA=gr,EA=Vc,Y5=qs,oi=ut,Oo=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 oi.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 yh=["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=oi.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=(oi.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),p={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(p,-oi.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 p=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var E=[{x:p.x,y:p.y},{x:p.x+p.width,y:p.y},{x:p.x+p.width,y:p.y+p.height},{x:p.x,y:p.y+p.height}],w=f.getAbsoluteTransform();E.forEach(function(m){var S=w.point(m);r.push(S)})});const n=new kt.Transform;n.rotate(-oi.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var p=n.point(f);i===void 0&&(i=o=p.x,a=l=p.y),i=Math.min(i,p.x),a=Math.min(a,p.y),o=Math.max(o,p.x),l=Math.max(l,p.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:oi.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(),yh.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=oi.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 p=a.getAbsolutePosition();if(!(f.x===p.x&&f.y===p.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=oi.Konva.getAngle(this.rotation());const H=w+I,G=oi.Konva.getAngle(this.rotationSnapTolerance()),W=MA(this.rotationSnaps(),H,G)-E.rotation,B=RA(E,W);this._fitNodesInto(B,t);return}var m=this.shiftBehavior(),S;m==="inverted"?S=this.keepRatio()&&!t.shiftKey:m==="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 g=this.findOne(".top-left").x()>b.x?-1:1,h=this.findOne(".top-left").y()>b.y?-1:1;r=i*this.cos*g,n=i*this.sin*h,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 g=this.findOne(".top-right").x()<b.x?-1:1,h=this.findOne(".top-right").y()>b.y?-1:1;r=i*this.cos*g,n=i*this.sin*h,this.findOne(".top-right").x(b.x+r),this.findOne(".top-right").y(b.y-n)}var v=a.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.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 g=b.x<a.x()?-1:1,h=a.y()<b.y?-1:1;r=i*this.cos*g,n=i*this.sin*h,a.x(b.x-r),a.y(b.y+n)}v=a.position(),this.findOne(".top-left").x(v.x),this.findOne(".bottom-right").y(v.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 g=this.findOne(".bottom-right").x()<b.x?-1:1,h=this.findOne(".bottom-right").y()<b.y?-1:1;r=i*this.cos*g,n=i*this.sin*h,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 y=this.findOne(".top-left"),_=this.findOne(".bottom-right"),R=y.x(),C=y.y(),x=this.getWidth()-_.x(),O=this.getHeight()-_.y();_.move({x:-R,y:-C}),y.move({x,y:O})}var P=this.findOne(".top-left").getAbsolutePosition();r=P.x,n=P.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:oi.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(oi.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,p=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(p))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,p));const E=u.multiply(l.invert());this._nodes.forEach(w=>{var m;const S=w.getParent().getAbsoluteTransform(),b=w.getTransform().copy();b.translate(w.offsetX(),w.offsetY());const g=new kt.Transform;g.multiply(S.copy().invert()).multiply(E).multiply(S).multiply(b);const h=g.decompose();w.setAttrs(h),(m=w.getLayer())===null||m===void 0||m.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 p=this.anchorStyleFunc();p&&f.forEach(E=>{p(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}}};wp.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){yh.indexOf(t)===-1&&kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+yh.join(", "))}),e||[]}vt.prototype.className="Transformer";(0,OA._registerNode)(vt);Ot.Factory.addGetterSetter(vt,"enabledAnchors",yh,LA);Ot.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,Oo.getBooleanValidator)());Ot.Factory.addGetterSetter(vt,"resizeEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorSize",10,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateEnabled",!0);Ot.Factory.addGetterSetter(vt,"rotateLineVisible",!0);Ot.Factory.addGetterSetter(vt,"rotationSnaps",[]);Ot.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");Ot.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"anchorFill","white");Ot.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderDash");Ot.Factory.addGetterSetter(vt,"keepRatio",!0);Ot.Factory.addGetterSetter(vt,"shiftBehavior","default");Ot.Factory.addGetterSetter(vt,"centeredScaling",!1);Ot.Factory.addGetterSetter(vt,"ignoreStroke",!1);Ot.Factory.addGetterSetter(vt,"padding",0,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"node");Ot.Factory.addGetterSetter(vt,"nodes");Ot.Factory.addGetterSetter(vt,"boundBoxFunc");Ot.Factory.addGetterSetter(vt,"anchorDragBoundFunc");Ot.Factory.addGetterSetter(vt,"anchorStyleFunc");Ot.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);Ot.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);Ot.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Wedge=void 0;const Ep=ft,NA=gr,IA=ut,L9=qe,DA=ut;let Pa=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)}};Sp.Wedge=Pa;Pa.prototype.className="Wedge";Pa.prototype._centroid=!0;Pa.prototype._attrsAffectingSize=["radius"];(0,DA._registerNode)(Pa);Ep.Factory.addGetterSetter(Pa,"radius",0,(0,L9.getNumberValidator)());Ep.Factory.addGetterSetter(Pa,"angle",0,(0,L9.getNumberValidator)());Ep.Factory.addGetterSetter(Pa,"clockwise",!1);Ep.Factory.backCompat(Pa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Blur=void 0;const Q5=ft,jA=Vt,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,p,E,w,m,S,b,g,h,v,d,y,_,R,C,x,O,P,k,M,I=t+t+1,H=n-1,G=i-1,Z=t+1,W=Z*(Z+1)/2,B=new J5,F=null,T=B,L=null,z=null,D=zA[t],$=BA[t];for(l=1;l<I;l++)T=T.next=new J5,l===Z&&(F=T);for(T.next=B,E=p=0,o=0;o<i;o++){for(y=_=R=C=w=m=S=b=0,g=Z*(x=r[p]),h=Z*(O=r[p+1]),v=Z*(P=r[p+2]),d=Z*(k=r[p+3]),w+=W*x,m+=W*O,S+=W*P,b+=W*k,T=B,l=0;l<Z;l++)T.r=x,T.g=O,T.b=P,T.a=k,T=T.next;for(l=1;l<Z;l++)u=p+((H<l?H:l)<<2),w+=(T.r=x=r[u])*(M=Z-l),m+=(T.g=O=r[u+1])*M,S+=(T.b=P=r[u+2])*M,b+=(T.a=k=r[u+3])*M,y+=x,_+=O,R+=P,C+=k,T=T.next;for(L=B,z=F,a=0;a<n;a++)r[p+3]=k=b*D>>$,k!==0?(k=255/k,r[p]=(w*D>>$)*k,r[p+1]=(m*D>>$)*k,r[p+2]=(S*D>>$)*k):r[p]=r[p+1]=r[p+2]=0,w-=g,m-=h,S-=v,b-=d,g-=L.r,h-=L.g,v-=L.b,d-=L.a,u=E+((u=a+t+1)<H?u:H)<<2,y+=L.r=r[u],_+=L.g=r[u+1],R+=L.b=r[u+2],C+=L.a=r[u+3],w+=y,m+=_,S+=R,b+=C,L=L.next,g+=x=z.r,h+=O=z.g,v+=P=z.b,d+=k=z.a,y-=x,_-=O,R-=P,C-=k,z=z.next,p+=4;E+=n}for(a=0;a<n;a++){for(_=R=C=y=m=S=b=w=0,p=a<<2,g=Z*(x=r[p]),h=Z*(O=r[p+1]),v=Z*(P=r[p+2]),d=Z*(k=r[p+3]),w+=W*x,m+=W*O,S+=W*P,b+=W*k,T=B,l=0;l<Z;l++)T.r=x,T.g=O,T.b=P,T.a=k,T=T.next;for(f=n,l=1;l<=t;l++)p=f+a<<2,w+=(T.r=x=r[p])*(M=Z-l),m+=(T.g=O=r[p+1])*M,S+=(T.b=P=r[p+2])*M,b+=(T.a=k=r[p+3])*M,y+=x,_+=O,R+=P,C+=k,T=T.next,l<G&&(f+=n);for(p=a,L=B,z=F,o=0;o<i;o++)u=p<<2,r[u+3]=k=b*D>>$,k>0?(k=255/k,r[u]=(w*D>>$)*k,r[u+1]=(m*D>>$)*k,r[u+2]=(S*D>>$)*k):r[u]=r[u+1]=r[u+2]=0,w-=g,m-=h,S-=v,b-=d,g-=L.r,h-=L.g,v-=L.b,d-=L.a,u=a+((u=o+Z)<G?u:G)*n<<2,w+=y+=L.r=r[u],m+=_+=L.g=r[u+1],S+=R+=L.b=r[u+2],b+=C+=L.a=r[u+3],L=L.next,g+=x=z.r,h+=O=z.g,v+=P=z.b,d+=k=z.a,y-=x,_-=O,R-=P,C-=k,z=z.next,p+=n}}const HA=function(t){var r=Math.round(this.blurRadius());r>0&&UA(t,r)};Op.Blur=HA;Q5.Factory.addGetterSetter(jA.Node,"blurRadius",0,(0,FA.getNumberValidator)(),Q5.Factory.afterSetFilter);var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Brighten=void 0;const e4=ft,$A=Vt,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};xp.Brighten=VA;e4.Factory.addGetterSetter($A.Node,"brightness",0,(0,GA.getNumberValidator)(),e4.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Contrast=void 0;const t4=ft,qA=Vt,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};Pp.Contrast=KA;t4.Factory.addGetterSetter(qA.Node,"contrast",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Emboss=void 0;const ho=ft,kp=Vt,YA=Zt,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,p=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)*p,m=a;E+m<1&&(m=0),E+m>f&&(m=0);var S=(E-1+m)*u*4,b=u;do{var g=w+(b-1)*4,h=o;b+h<1&&(h=0),b+h>u&&(h=0);var v=S+(b-1+h)*4,d=l[g]-l[v],y=l[g+1]-l[v+1],_=l[g+2]-l[v+2],R=d,C=R>0?R:-R,x=y>0?y:-y,O=_>0?_:-_;if(x>C&&(R=y),O>C&&(R=_),R*=t,i){var P=l[g]+R,k=l[g+1]+R,M=l[g+2]+R;l[g]=P>255?255:P<0?0:P,l[g+1]=k>255?255:k<0?0:k,l[g+2]=M>255?255:M<0?0:M}else{var I=r-R;I<0?I=0:I>255&&(I=255),l[g]=l[g+1]=l[g+2]=I}}while(--b)}while(--E)};Cp.Emboss=XA;ho.Factory.addGetterSetter(kp.Node,"embossStrength",.5,(0,N9.getNumberValidator)(),ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossWhiteLevel",.5,(0,N9.getNumberValidator)(),ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossDirection","top-left",null,ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossBlend",!1,null,ho.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Enhance=void 0;const r4=ft,ZA=Vt,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],p=f,E,w,m=this.enhance();if(m!==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>p&&(p=E);i===n&&(i=255,n=0),l===o&&(l=255,o=0),p===f&&(p=255,f=0);var S,b,g,h,v,d,y,_,R;for(m>0?(b=i+m*(255-i),g=n-m*(n-0),v=l+m*(255-l),d=o-m*(o-0),_=p+m*(255-p),R=f-m*(f-0)):(S=(i+n)*.5,b=i+m*(i-S),g=n+m*(n-S),h=(l+o)*.5,v=l+m*(l-h),d=o+m*(o-h),y=(p+f)*.5,_=p+m*(p-y),R=f+m*(f-y)),w=0;w<r;w+=4)t[w+0]=eg(t[w+0],n,i,g,b),t[w+1]=eg(t[w+1],o,l,d,v),t[w+2]=eg(t[w+2],f,p,R,_)}};Tp.Enhance=JA;r4.Factory.addGetterSetter(ZA.Node,"enhance",0,(0,QA.getNumberValidator)(),r4.Factory.afterSetFilter);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.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};Ap.Grayscale=eR;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.HSL=void 0;const Rs=ft,Gy=Vt,Vy=qe;Rs.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Rs.Factory.afterSetFilter);Rs.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Rs.Factory.afterSetFilter);Rs.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Rs.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),p=.299*n+.701*u+.167*f,E=.587*n-.587*u+.33*f,w=.114*n-.114*u-.497*f,m=.299*n-.299*u-.328*f,S=.587*n+.413*u+.035*f,b=.114*n-.114*u+.293*f,g=.299*n-.3*u+1.25*f,h=.587*n-.586*u-1.05*f,v=.114*n+.886*u-.2*f,d,y,_,R;for(l=0;l<r;l+=4)d=t[l+0],y=t[l+1],_=t[l+2],R=t[l+3],t[l+0]=p*d+E*y+w*_+o,t[l+1]=m*d+S*y+b*_+o,t[l+2]=g*d+h*y+v*_+o,t[l+3]=R};Rp.HSL=tR;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.HSV=void 0;const Ms=ft,qy=Vt,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,p=.587*n-.587*l+.33*u,E=.114*n-.114*l-.497*u,w=.299*n-.299*l-.328*u,m=.587*n+.413*l+.035*u,S=.114*n-.114*l+.293*u,b=.299*n-.3*l+1.25*u,g=.587*n-.586*l-1.05*u,h=.114*n+.886*l-.2*u,v,d,y,_;for(o=0;o<r;o+=4)v=t[o+0],d=t[o+1],y=t[o+2],_=t[o+3],t[o+0]=f*v+p*d+E*y,t[o+1]=w*v+m*d+S*y,t[o+2]=b*v+g*d+h*y,t[o+3]=_};Mp.HSV=rR;Ms.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);Ms.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);Ms.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.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]};Lp.Invert=nR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Kaleidoscope=void 0;const bh=ft,I9=Vt,n4=Zt,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,p,E,w=0,m=0,S=0,b=0,g,h=Math.sqrt(l*l+u*u);p=a-l,E=o-u,g=Math.sqrt(p*p+E*E),h=g>h?g:h;var v=o,d=a,y,_,R=360/d*Math.PI/180,C,x;for(_=0;_<d;_+=1)for(C=Math.sin(_*R),x=Math.cos(_*R),y=0;y<v;y+=1)p=Math.floor(l+h*y/v*x),E=Math.floor(u+h*y/v*C),f=(E*a+p)*4,w=n[f+0],m=n[f+1],S=n[f+2],b=n[f+3],f=(_+y*a)*4,i[f+0]=w,i[f+1]=m,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,p,E,w,m,S=0,b=0,g=0,h=0,v,d=Math.sqrt(l*l+u*u);p=a-l,E=o-u,v=Math.sqrt(p*p+E*E),d=v>d?v:d;var y=o,_=a,R,C,x=0,O,P;for(p=0;p<a;p+=1)for(E=0;E<o;E+=1)w=p-l,m=E-u,R=Math.sqrt(w*w+m*m)*y/d,C=(Math.atan2(m,w)*180/Math.PI+360+x)%360,C=C*_/360,O=Math.floor(C),P=Math.floor(R),f=(P*a+O)*4,S=n[f+0],b=n[f+1],g=n[f+2],h=n[f+3],f=(E*a+p)*4,i[f+0]=S,i[f+1]=b,i[f+2]=g,i[f+3]=h};const oR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,p,E,w,m=Math.round(this.kaleidoscopePower()),S=Math.round(this.kaleidoscopeAngle()),b=Math.floor(t*(S%360)/360);if(!(m<1)){var g=n4.Util.createCanvasElement();g.width=t,g.height=r;var h=g.getContext("2d").getImageData(0,0,t,r);n4.Util.releaseCanvas(g),iR(e,h,{polarCenterX:t/2,polarCenterY:r/2});for(var v=t/Math.pow(2,m);v<=8;)v=v*2,m-=1;v=Math.ceil(v);var d=v,y=0,_=d,R=1;for(b+v>t&&(y=d,_=0,R=-1),i=0;i<r;i+=1)for(n=y;n!==_;n+=R)a=Math.round(n+b)%t,E=(t*i+a)*4,l=h.data[E+0],u=h.data[E+1],f=h.data[E+2],p=h.data[E+3],w=(t*i+n)*4,h.data[w+0]=l,h.data[w+1]=u,h.data[w+2]=f,h.data[w+3]=p;for(i=0;i<r;i+=1)for(d=Math.floor(v),o=0;o<m;o+=1){for(n=0;n<d+1;n+=1)E=(t*i+n)*4,l=h.data[E+0],u=h.data[E+1],f=h.data[E+2],p=h.data[E+3],w=(t*i+d*2-n-1)*4,h.data[w+0]=l,h.data[w+1]=u,h.data[w+2]=f,h.data[w+3]=p;d*=2}aR(h,e,{polarRotation:0})}};Np.Kaleidoscope=oR;bh.Factory.addGetterSetter(I9.Node,"kaleidoscopePower",2,(0,D9.getNumberValidator)(),bh.Factory.afterSetFilter);bh.Factory.addGetterSetter(I9.Node,"kaleidoscopeAngle",0,(0,D9.getNumberValidator)(),bh.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Mask=void 0;const i4=ft,lR=Vt,sR=qe;function md(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 Lu(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=md(e,0,0),n=md(e,e.width-1,0),i=md(e,0,e.height-1),a=md(e,e.width-1,e.height-1),o=t||10;if(Lu(r,n)<o&&Lu(n,a)<o&&Lu(a,i)<o&&Lu(i,r)<o){for(var l=uR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var p=Lu(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=p<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,p=0,E=0;E<i;E++)for(var w=0;w<i;w++){var m=l+E-a,S=u+w-a;if(m>=0&&m<r&&S>=0&&S<t){var b=m*t+S,g=n[E*i+w];p+=e[b]*g}}o[f]=p===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,p=0,E=0;E<i;E++)for(var w=0;w<i;w++){var m=l+E-a,S=u+w-a;if(m>=0&&m<r&&S>=0&&S<t){var b=m*t+S,g=n[E*i+w];p+=e[b]*g}}o[f]=p>=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,p=0,E=0;E<i;E++)for(var w=0;w<i;w++){var m=l+E-a,S=u+w-a;if(m>=0&&m<r&&S>=0&&S<t){var b=m*t+S,g=n[E*i+w];p+=e[b]*g}}o[f]=p}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};Ip.Mask=gR;i4.Factory.addGetterSetter(lR.Node,"threshold",0,(0,sR.getNumberValidator)(),i4.Factory.afterSetFilter);var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Noise=void 0;const a4=ft,vR=Vt,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()};Dp.Noise=yR;a4.Factory.addGetterSetter(vR.Node,"noise",.2,(0,mR.getNumberValidator)(),a4.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Pixelate=void 0;const o4=ft,bR=Zt,_R=Vt,wR=qe,SR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,p,E=Math.ceil(r/t),w=Math.ceil(n/t),m,S,b,g,h,v,d,y=e.data;if(t<=0){bR.Util.error("pixelSize value can not be <= 0");return}for(h=0;h<E;h+=1)for(v=0;v<w;v+=1){for(l=0,u=0,f=0,p=0,m=h*t,S=m+t,b=v*t,g=b+t,d=0,i=m;i<S;i+=1)if(!(i>=r))for(a=b;a<g;a+=1)a>=n||(o=(r*a+i)*4,l+=y[o+0],u+=y[o+1],f+=y[o+2],p+=y[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,p=p/d,i=m;i<S;i+=1)if(!(i>=r))for(a=b;a<g;a+=1)a>=n||(o=(r*a+i)*4,y[o+0]=l,y[o+1]=u,y[o+2]=f,y[o+3]=p)}};jp.Pixelate=SR;o4.Factory.addGetterSetter(_R.Node,"pixelSize",8,(0,wR.getNumberValidator)(),o4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Posterize=void 0;const l4=ft,ER=Vt,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};Fp.Posterize=xR;l4.Factory.addGetterSetter(ER.Node,"levels",.5,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.RGB=void 0;const _h=ft,Ky=Vt,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]};zp.RGB=CR;_h.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_h.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_h.Factory.addGetterSetter(Ky.Node,"blue",0,PR.RGBComponent,_h.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.RGBA=void 0;const _c=ft,Up=Vt,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};Bp.RGBA=TR;_c.Factory.addGetterSetter(Up.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_c.Factory.addGetterSetter(Up.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_c.Factory.addGetterSetter(Up.Node,"blue",0,kR.RGBComponent,_c.Factory.afterSetFilter);_c.Factory.addGetterSetter(Up.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.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)};Hp.Sepia=AR;var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.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],p=t[u+1],E=t[u+2];f>127&&(f=255-f),p>127&&(p=255-p),E>127&&(E=255-E),t[u]=f,t[u+1]=p,t[u+2]=E}while(--l)}while(--a)};$p.Solarize=RR;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Threshold=void 0;const s4=ft,MR=Vt,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};Gp.Threshold=NR;s4.Factory.addGetterSetter(MR.Node,"threshold",.5,(0,LR.getNumberValidator)(),s4.Factory.afterSetFilter);Object.defineProperty(Jh,"__esModule",{value:!0});Jh.Konva=void 0;const u4=vh,IR=ap,DR=sp,jR=fp,FR=dp,zR=hp,c4=As,BR=Hc,UR=Ks,HR=Vc,$R=vp,GR=mp,VR=yp,qR=bp,WR=ul,KR=_p,YR=wp,XR=Sp,ZR=Op,QR=xp,JR=Pp,eM=Cp,tM=Tp,rM=Ap,nM=Rp,iM=Mp,aM=Lp,oM=Np,lM=Ip,sM=Dp,uM=jp,cM=Fp,fM=zp,dM=Bp,hM=Hp,pM=$p,gM=Gp;Jh.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=Jh;Ny.exports=mM.Konva;var Si=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=vh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=vh;e.exports=n.Konva})(gm,gm.exports);var yM=gm.exports;const wc=xh(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=Ze,i=zu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,A=1;A<arguments.length;A++)c+="&args[]="+encodeURIComponent(arguments[A]);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"),p=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),_=Symbol.iterator;function R(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 p:return"Fragment";case f:return"Portal";case w:return"Profiler";case E:return"StrictMode";case g:return"Suspense";case h:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case S:return(s.displayName||"Context")+".Consumer";case m: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 v: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 x(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,A=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(A=c.return),s=c.return;while(s)}return c.tag===3?A:null}function P(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 A=s,N=c;;){var j=A.return;if(j===null)break;var q=j.alternate;if(q===null){if(N=j.return,N!==null){A=N;continue}break}if(j.child===q.child){for(q=j.child;q;){if(q===A)return P(j),s;if(q===N)return P(j),c;q=q.sibling}throw Error(o(188))}if(A.return!==N.return)A=j,N=q;else{for(var J=!1,ae=j.child;ae;){if(ae===A){J=!0,A=j,N=q;break}if(ae===N){J=!0,N=j,A=q;break}ae=ae.sibling}if(!J){for(ae=q.child;ae;){if(ae===A){J=!0,A=q,N=j;break}if(ae===N){J=!0,N=q,A=j;break}ae=ae.sibling}if(!J)throw Error(o(189))}}if(A.alternate!==N)throw Error(o(190))}if(A.tag!==3)throw Error(o(188));return A.stateNode.current===A?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,Z=t.getPublicInstance,W=t.getRootHostContext,B=t.getChildHostContext,F=t.prepareForCommit,T=t.resetAfterCommit,L=t.createInstance,z=t.appendInitialChild,D=t.finalizeInitialChildren,$=t.prepareUpdate,K=t.shouldSetTextContent,V=t.createTextInstance,U=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,te=t.supportsMutation,ee=t.supportsPersistence,ne=t.supportsHydration,ie=t.getInstanceFromNode,oe=t.preparePortalMount,ke=t.getCurrentEventPriority,Ie=t.detachDeletedInstance,le=t.supportsMicrotasks,fe=t.scheduleMicrotask,_e=t.supportsTestSelectors,ge=t.findFiberRoot,re=t.getBoundingRect,de=t.getTextContent,ye=t.isHiddenSubtree,Se=t.matchAccessibilityRole,$e=t.setFocusIfFocusable,Qe=t.setupIntersectionObserver,Re=t.appendChild,Oe=t.appendChildToContainer,Pe=t.commitTextUpdate,He=t.commitMount,lt=t.commitUpdate,ue=t.insertBefore,ce=t.insertInContainerBefore,Xe=t.removeChild,be=t.removeChildFromContainer,Le=t.resetTextContent,Ae=t.hideInstance,we=t.hideTextInstance,Je=t.unhideInstance,Ee=t.unhideTextInstance,We=t.clearContainer,lr=t.cloneInstance,xe=t.createContainerChildSet,ze=t.appendChildToContainerChildSet,tt=t.finalizeContainerChildren,yt=t.replaceContainerChildren,xt=t.cloneHiddenInstance,xr=t.cloneHiddenTextInstance,Zr=t.canHydrateInstance,mr=t.canHydrateTextInstance,Qr=t.canHydrateSuspenseInstance,Qn=t.isSuspenseInstancePending,Rn=t.isSuspenseInstanceFallback,Ne=t.getSuspenseInstanceFallbackErrorDetails,et=t.registerSuspenseInstanceRetry,ct=t.getNextHydratableSibling,Mt=t.getFirstHydratableChild,Et=t.getFirstHydratableChildWithinContainer,Jr=t.getFirstHydratableChildWithinSuspenseInstance,$r=t.hydrateInstance,Ut=t.hydrateTextInstance,en=t.hydrateSuspenseInstance,Mn=t.getNextHydratableInstanceAfterSuspenseInstance,Ln=t.commitHydratedContainer,Ta=t.commitHydratedSuspenseInstance,ru=t.clearSuspenseBoundary,ko=t.clearSuspenseBoundaryFromContainer,To=t.shouldDeleteUnhydratedTailInstances,Aa=t.didNotMatchHydratedContainerTextInstance,Zc=t.didNotMatchHydratedTextInstance,kl;function nu(s){if(kl===void 0)try{throw Error()}catch(A){var c=A.stack.trim().match(/\n( *(at )?)/);kl=c&&c[1]||""}return`
52
+ `+kl+s}var e0=!1;function t0(s,c){if(!s||e0)return"";e0=!0;var A=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(Te){var N=Te}Reflect.construct(s,[],c)}else{try{c.call()}catch(Te){N=Te}s.call(c.prototype)}else{try{throw Error()}catch(Te){N=Te}s()}}catch(Te){if(Te&&N&&typeof Te.stack=="string"){for(var j=Te.stack.split(`
53
+ `),q=N.stack.split(`
54
+ `),J=j.length-1,ae=q.length-1;1<=J&&0<=ae&&j[J]!==q[ae];)ae--;for(;1<=J&&0<=ae;J--,ae--)if(j[J]!==q[ae]){if(J!==1||ae!==1)do if(J--,ae--,0>ae||j[J]!==q[ae]){var pe=`
55
+ `+j[J].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=J&&0<=ae);break}}}finally{e0=!1,Error.prepareStackTrace=A}return(s=s?s.displayName||s.name:"")?nu(s):""}var RS=Object.prototype.hasOwnProperty,r0=[],Tl=-1;function Ra(s){return{current:s}}function jt(s){0>Tl||(s.current=r0[Tl],r0[Tl]=null,Tl--)}function Lt(s,c){Tl++,r0[Tl]=s.current,s.current=c}var Ma={},Lr=Ra(Ma),tn=Ra(!1),Ao=Ma;function Al(s,c){var A=s.type.contextTypes;if(!A)return Ma;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var j={},q;for(q in A)j[q]=c[q];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function rn(s){return s=s.childContextTypes,s!=null}function Qc(){jt(tn),jt(Lr)}function x2(s,c,A){if(Lr.current!==Ma)throw Error(o(168));Lt(Lr,c),Lt(tn,A)}function P2(s,c,A){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return A;N=N.getChildContext();for(var j in N)if(!(j in c))throw Error(o(108,x(s)||"Unknown",j));return a({},A,N)}function Jc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Ma,Ao=Lr.current,Lt(Lr,s),Lt(tn,tn.current),!0}function C2(s,c,A){var N=s.stateNode;if(!N)throw Error(o(169));A?(s=P2(s,c,Ao),N.__reactInternalMemoizedMergedChildContext=s,jt(tn),jt(Lr),Lt(Lr,s)):jt(tn),Lt(tn,A)}var Jn=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 ef=64,tf=4194304;function iu(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 rf(s,c){var A=s.pendingLanes;if(A===0)return 0;var N=0,j=s.suspendedLanes,q=s.pingedLanes,J=A&268435455;if(J!==0){var ae=J&~j;ae!==0?N=iu(ae):(q&=J,q!==0&&(N=iu(q)))}else J=A&~j,J!==0?N=iu(J):q!==0&&(N=iu(q));if(N===0)return 0;if(c!==0&&c!==N&&!(c&j)&&(j=N&-N,q=c&-c,j>=q||j===16&&(q&4194240)!==0))return c;if(N&4&&(N|=A&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)A=31-Jn(c),j=1<<A,N|=s[A],c&=~j;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 A=s.suspendedLanes,N=s.pingedLanes,j=s.expirationTimes,q=s.pendingLanes;0<q;){var J=31-Jn(q),ae=1<<J,pe=j[J];pe===-1?(!(ae&A)||ae&N)&&(j[J]=IS(ae,c)):pe<=c&&(s.expiredLanes|=ae),q&=~ae}}function n0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function k2(){var s=ef;return ef<<=1,!(ef&4194240)&&(ef=64),s}function i0(s){for(var c=[],A=0;31>A;A++)c.push(s);return c}function au(s,c,A){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Jn(c),s[c]=A}function jS(s,c){var A=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<A;){var j=31-Jn(A),q=1<<j;c[j]=0,N[j]=-1,s[j]=-1,A&=~q}}function a0(s,c){var A=s.entangledLanes|=c;for(s=s.entanglements;A;){var N=31-Jn(A),j=1<<N;j&c|s[N]&c&&(s[N]|=c),A&=~j}}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,yr=i.unstable_now,l0=i.unstable_ImmediatePriority,BS=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,US=i.unstable_IdlePriority,nf=null,Oi=null;function HS(s){if(Oi&&typeof Oi.onCommitFiberRoot=="function")try{Oi.onCommitFiberRoot(nf,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 ei=typeof Object.is=="function"?Object.is:$S,Zi=null,af=!1,u0=!1;function R2(s){Zi===null?Zi=[s]:Zi.push(s)}function GS(s){af=!0,R2(s)}function xi(){if(!u0&&Zi!==null){u0=!0;var s=0,c=bt;try{var A=Zi;for(bt=1;s<A.length;s++){var N=A[s];do N=N(!0);while(N!==null)}Zi=null,af=!1}catch(j){throw Zi!==null&&(Zi=Zi.slice(s+1)),o0(l0,xi),j}finally{bt=c,u0=!1}}return null}var Rl=[],Ml=0,of=null,lf=0,Nn=[],In=0,Ro=null,Qi=1,Ji="";function Mo(s,c){Rl[Ml++]=lf,Rl[Ml++]=of,of=s,lf=c}function M2(s,c,A){Nn[In++]=Qi,Nn[In++]=Ji,Nn[In++]=Ro,Ro=s;var N=Qi;s=Ji;var j=32-Jn(N)-1;N&=~(1<<j),A+=1;var q=32-Jn(c)+j;if(30<q){var J=j-j%5;q=(N&(1<<J)-1).toString(32),N>>=J,j-=J,Qi=1<<32-Jn(c)+j|A<<j|N,Ji=q+s}else Qi=1<<q|A<<j|N,Ji=s}function c0(s){s.return!==null&&(Mo(s,1),M2(s,1,0))}function f0(s){for(;s===of;)of=Rl[--Ml],Rl[Ml]=null,lf=Rl[--Ml],Rl[Ml]=null;for(;s===Ro;)Ro=Nn[--In],Nn[In]=null,Ji=Nn[--In],Nn[In]=null,Qi=Nn[--In],Nn[In]=null}var bn=null,Dn=null,Ht=!1,ou=!1,ti=null;function L2(s,c){var A=Un(5,null,null,0);A.elementType="DELETED",A.stateNode=c,A.return=s,c=s.deletions,c===null?(s.deletions=[A],s.flags|=16):c.push(A)}function N2(s,c){switch(s.tag){case 5:return c=Zr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,bn=s,Dn=Mt(c),!0):!1;case 6:return c=mr(c,s.pendingProps),c!==null?(s.stateNode=c,bn=s,Dn=null,!0):!1;case 13:if(c=Qr(c),c!==null){var A=Ro!==null?{id:Qi,overflow:Ji}:null;return s.memoizedState={dehydrated:c,treeContext:A,retryLane:1073741824},A=Un(18,null,null,0),A.stateNode=c,A.return=s,s.child=A,bn=s,Dn=null,!0}return!1;default:return!1}}function d0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function h0(s){if(Ht){var c=Dn;if(c){var A=c;if(!N2(s,c)){if(d0(s))throw Error(o(418));c=ct(A);var N=bn;c&&N2(s,c)?L2(N,A):(s.flags=s.flags&-4097|2,Ht=!1,bn=s)}}else{if(d0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Ht=!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 sf(s){if(!ne||s!==bn)return!1;if(!Ht)return I2(s),Ht=!0,!1;if(s.tag!==3&&(s.tag!==5||To(s.type)&&!K(s.type,s.memoizedProps))){var c=Dn;if(c){if(d0(s))throw D2(),Error(o(418));for(;c;)L2(s,c),c=ct(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));Dn=Mn(s)}else Dn=bn?ct(s.stateNode):null;return!0}function D2(){for(var s=Dn;s;)s=ct(s)}function Ll(){ne&&(Dn=bn=null,ou=Ht=!1)}function p0(s){ti===null?ti=[s]:ti.push(s)}var VS=l.ReactCurrentBatchConfig;function uf(s,c){if(ei(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var A=Object.keys(s),N=Object.keys(c);if(A.length!==N.length)return!1;for(N=0;N<A.length;N++){var j=A[N];if(!RS.call(c,j)||!ei(s[j],c[j]))return!1}return!0}function qS(s){switch(s.tag){case 5:return nu(s.type);case 16:return nu("Lazy");case 13:return nu("Suspense");case 19:return nu("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 lu(s,c,A){if(s=A.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(o(309));var N=A.stateNode}if(!N)throw Error(o(147,s));var j=N,q=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===q?c.ref:(c=function(J){var ae=j.refs;J===null?delete ae[q]:ae[q]=J},c._stringRef=q,c)}if(typeof s!="string")throw Error(o(284));if(!A._owner)throw Error(o(290,s))}return s}function cf(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 ve=he.deletions;ve===null?(he.deletions=[se],he.flags|=16):ve.push(se)}}function A(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 j(he,se){return he=za(he,se),he.index=0,he.sibling=null,he}function q(he,se,ve){return he.index=ve,s?(ve=he.alternate,ve!==null?(ve=ve.index,ve<se?(he.flags|=2,se):ve):(he.flags|=2,se)):(he.flags|=1048576,se)}function J(he){return s&&he.alternate===null&&(he.flags|=2),he}function ae(he,se,ve,je){return se===null||se.tag!==6?(se=u1(ve,he.mode,je),se.return=he,se):(se=j(se,ve),se.return=he,se)}function pe(he,se,ve,je){var Ye=ve.type;return Ye===p?Ge(he,se,ve.props.children,je,ve.key):se!==null&&(se.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===d&&j2(Ye)===se.type)?(je=j(se,ve.props),je.ref=lu(he,se,ve),je.return=he,je):(je=Uf(ve.type,ve.key,ve.props,null,he.mode,je),je.ref=lu(he,se,ve),je.return=he,je)}function Te(he,se,ve,je){return se===null||se.tag!==4||se.stateNode.containerInfo!==ve.containerInfo||se.stateNode.implementation!==ve.implementation?(se=c1(ve,he.mode,je),se.return=he,se):(se=j(se,ve.children||[]),se.return=he,se)}function Ge(he,se,ve,je,Ye){return se===null||se.tag!==7?(se=zo(ve,he.mode,je,Ye),se.return=he,se):(se=j(se,ve),se.return=he,se)}function nt(he,se,ve){if(typeof se=="string"&&se!==""||typeof se=="number")return se=u1(""+se,he.mode,ve),se.return=he,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case u:return ve=Uf(se.type,se.key,se.props,null,he.mode,ve),ve.ref=lu(he,null,se),ve.return=he,ve;case f:return se=c1(se,he.mode,ve),se.return=he,se;case d:var je=se._init;return nt(he,je(se._payload),ve)}if(G(se)||R(se))return se=zo(se,he.mode,ve,null),se.return=he,se;cf(he,se)}return null}function De(he,se,ve,je){var Ye=se!==null?se.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return Ye!==null?null:ae(he,se,""+ve,je);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:return ve.key===Ye?pe(he,se,ve,je):null;case f:return ve.key===Ye?Te(he,se,ve,je):null;case d:return Ye=ve._init,De(he,se,Ye(ve._payload),je)}if(G(ve)||R(ve))return Ye!==null?null:Ge(he,se,ve,je,null);cf(he,ve)}return null}function Ft(he,se,ve,je,Ye){if(typeof je=="string"&&je!==""||typeof je=="number")return he=he.get(ve)||null,ae(se,he,""+je,Ye);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case u:return he=he.get(je.key===null?ve:je.key)||null,pe(se,he,je,Ye);case f:return he=he.get(je.key===null?ve:je.key)||null,Te(se,he,je,Ye);case d:var st=je._init;return Ft(he,se,ve,st(je._payload),Ye)}if(G(je)||R(je))return he=he.get(ve)||null,Ge(se,he,je,Ye,null);cf(se,je)}return null}function At(he,se,ve,je){for(var Ye=null,st=null,it=se,_t=se=0,wr=null;it!==null&&_t<ve.length;_t++){it.index>_t?(wr=it,it=null):wr=it.sibling;var wt=De(he,it,ve[_t],je);if(wt===null){it===null&&(it=wr);break}s&&it&&wt.alternate===null&&c(he,it),se=q(wt,se,_t),st===null?Ye=wt:st.sibling=wt,st=wt,it=wr}if(_t===ve.length)return A(he,it),Ht&&Mo(he,_t),Ye;if(it===null){for(;_t<ve.length;_t++)it=nt(he,ve[_t],je),it!==null&&(se=q(it,se,_t),st===null?Ye=it:st.sibling=it,st=it);return Ht&&Mo(he,_t),Ye}for(it=N(he,it);_t<ve.length;_t++)wr=Ft(it,he,_t,ve[_t],je),wr!==null&&(s&&wr.alternate!==null&&it.delete(wr.key===null?_t:wr.key),se=q(wr,se,_t),st===null?Ye=wr:st.sibling=wr,st=wr);return s&&it.forEach(function(Ba){return c(he,Ba)}),Ht&&Mo(he,_t),Ye}function ln(he,se,ve,je){var Ye=R(ve);if(typeof Ye!="function")throw Error(o(150));if(ve=Ye.call(ve),ve==null)throw Error(o(151));for(var st=Ye=null,it=se,_t=se=0,wr=null,wt=ve.next();it!==null&&!wt.done;_t++,wt=ve.next()){it.index>_t?(wr=it,it=null):wr=it.sibling;var Ba=De(he,it,wt.value,je);if(Ba===null){it===null&&(it=wr);break}s&&it&&Ba.alternate===null&&c(he,it),se=q(Ba,se,_t),st===null?Ye=Ba:st.sibling=Ba,st=Ba,it=wr}if(wt.done)return A(he,it),Ht&&Mo(he,_t),Ye;if(it===null){for(;!wt.done;_t++,wt=ve.next())wt=nt(he,wt.value,je),wt!==null&&(se=q(wt,se,_t),st===null?Ye=wt:st.sibling=wt,st=wt);return Ht&&Mo(he,_t),Ye}for(it=N(he,it);!wt.done;_t++,wt=ve.next())wt=Ft(it,he,_t,wt.value,je),wt!==null&&(s&&wt.alternate!==null&&it.delete(wt.key===null?_t:wt.key),se=q(wt,se,_t),st===null?Ye=wt:st.sibling=wt,st=wt);return s&&it.forEach(function(SE){return c(he,SE)}),Ht&&Mo(he,_t),Ye}function na(he,se,ve,je){if(typeof ve=="object"&&ve!==null&&ve.type===p&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:e:{for(var Ye=ve.key,st=se;st!==null;){if(st.key===Ye){if(Ye=ve.type,Ye===p){if(st.tag===7){A(he,st.sibling),se=j(st,ve.props.children),se.return=he,he=se;break e}}else if(st.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===d&&j2(Ye)===st.type){A(he,st.sibling),se=j(st,ve.props),se.ref=lu(he,st,ve),se.return=he,he=se;break e}A(he,st);break}else c(he,st);st=st.sibling}ve.type===p?(se=zo(ve.props.children,he.mode,je,ve.key),se.return=he,he=se):(je=Uf(ve.type,ve.key,ve.props,null,he.mode,je),je.ref=lu(he,se,ve),je.return=he,he=je)}return J(he);case f:e:{for(st=ve.key;se!==null;){if(se.key===st)if(se.tag===4&&se.stateNode.containerInfo===ve.containerInfo&&se.stateNode.implementation===ve.implementation){A(he,se.sibling),se=j(se,ve.children||[]),se.return=he,he=se;break e}else{A(he,se);break}else c(he,se);se=se.sibling}se=c1(ve,he.mode,je),se.return=he,he=se}return J(he);case d:return st=ve._init,na(he,se,st(ve._payload),je)}if(G(ve))return At(he,se,ve,je);if(R(ve))return ln(he,se,ve,je);cf(he,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,se!==null&&se.tag===6?(A(he,se.sibling),se=j(se,ve),se.return=he,he=se):(A(he,se),se=u1(ve,he.mode,je),se.return=he,he=se),J(he)):A(he,se)}return na}var Nl=F2(!0),z2=F2(!1),ff=Ra(null),df=null,Il=null,g0=null;function v0(){g0=Il=df=null}function B2(s,c,A){Q?(Lt(ff,c._currentValue),c._currentValue=A):(Lt(ff,c._currentValue2),c._currentValue2=A)}function m0(s){var c=ff.current;jt(ff),Q?s._currentValue=c:s._currentValue2=c}function y0(s,c,A){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===A)break;s=s.return}}function Dl(s,c){df=s,g0=Il=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(nn=!0),s.firstContext=null)}function jn(s){var c=Q?s._currentValue:s._currentValue2;if(g0!==s)if(s={context:s,memoizedValue:c,next:null},Il===null){if(df===null)throw Error(o(308));Il=s,df.dependencies={lanes:0,firstContext:s}}else Il=Il.next=s;return c}var Lo=null;function b0(s){Lo===null?Lo=[s]:Lo.push(s)}function U2(s,c,A,N){var j=c.interleaved;return j===null?(A.next=A,b0(c)):(A.next=j.next,j.next=A),c.interleaved=A,Pi(s,N)}function Pi(s,c){s.lanes|=c;var A=s.alternate;for(A!==null&&(A.lanes|=c),A=s,s=s.return;s!==null;)s.childLanes|=c,A=s.alternate,A!==null&&(A.childLanes|=c),A=s,s=s.return;return A.tag===3?A.stateNode:null}var La=!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 ea(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Na(s,c,A){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,dt&2){var j=N.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),N.pending=c,Pi(s,A)}return j=N.interleaved,j===null?(c.next=c,b0(N)):(c.next=j.next,j.next=c),N.interleaved=c,Pi(s,A)}function hf(s,c,A){if(c=c.updateQueue,c!==null&&(c=c.shared,(A&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,A|=N,c.lanes=A,a0(s,A)}}function $2(s,c){var A=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,A===N)){var j=null,q=null;if(A=A.firstBaseUpdate,A!==null){do{var J={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};q===null?j=q=J:q=q.next=J,A=A.next}while(A!==null);q===null?j=q=c:q=q.next=c}else j=q=c;A={baseState:N.baseState,firstBaseUpdate:j,lastBaseUpdate:q,shared:N.shared,effects:N.effects},s.updateQueue=A;return}s=A.lastBaseUpdate,s===null?A.firstBaseUpdate=c:s.next=c,A.lastBaseUpdate=c}function pf(s,c,A,N){var j=s.updateQueue;La=!1;var q=j.firstBaseUpdate,J=j.lastBaseUpdate,ae=j.shared.pending;if(ae!==null){j.shared.pending=null;var pe=ae,Te=pe.next;pe.next=null,J===null?q=Te:J.next=Te,J=pe;var Ge=s.alternate;Ge!==null&&(Ge=Ge.updateQueue,ae=Ge.lastBaseUpdate,ae!==J&&(ae===null?Ge.firstBaseUpdate=Te:ae.next=Te,Ge.lastBaseUpdate=pe))}if(q!==null){var nt=j.baseState;J=0,Ge=Te=pe=null,ae=q;do{var De=ae.lane,Ft=ae.eventTime;if((N&De)===De){Ge!==null&&(Ge=Ge.next={eventTime:Ft,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var At=s,ln=ae;switch(De=c,Ft=A,ln.tag){case 1:if(At=ln.payload,typeof At=="function"){nt=At.call(Ft,nt,De);break e}nt=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=ln.payload,De=typeof At=="function"?At.call(Ft,nt,De):At,De==null)break e;nt=a({},nt,De);break e;case 2:La=!0}}ae.callback!==null&&ae.lane!==0&&(s.flags|=64,De=j.effects,De===null?j.effects=[ae]:De.push(ae))}else Ft={eventTime:Ft,lane:De,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ge===null?(Te=Ge=Ft,pe=nt):Ge=Ge.next=Ft,J|=De;if(ae=ae.next,ae===null){if(ae=j.shared.pending,ae===null)break;De=ae,ae=De.next,De.next=null,j.lastBaseUpdate=De,j.shared.pending=null}}while(!0);if(Ge===null&&(pe=nt),j.baseState=pe,j.firstBaseUpdate=Te,j.lastBaseUpdate=Ge,c=j.shared.interleaved,c!==null){j=c;do J|=j.lane,j=j.next;while(j!==c)}else q===null&&(j.shared.lanes=0);Io|=J,s.lanes=J,s.memoizedState=nt}}function G2(s,c,A){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var N=s[c],j=N.callback;if(j!==null){if(N.callback=null,N=A,typeof j!="function")throw Error(o(191,j));j.call(N)}}}var su={},Fn=Ra(su),uu=Ra(su),jl=Ra(su);function Ci(s){if(s===su)throw Error(o(174));return s}function w0(s,c){Lt(jl,c),Lt(uu,s),Lt(Fn,su),s=W(c),jt(Fn),Lt(Fn,s)}function Fl(){jt(Fn),jt(uu),jt(jl)}function V2(s){var c=Ci(jl.current),A=Ci(Fn.current);c=B(A,s.type,c),A!==c&&(Lt(uu,s),Lt(Fn,c))}function S0(s){uu.current===s&&(jt(Fn),jt(uu))}var qt=Ra(0);function gf(s){for(var c=s;c!==null;){if(c.tag===13){var A=c.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||Qn(A)||Rn(A)))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];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var vf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,No=0,Wt=null,sr=null,br=null,mf=!1,cu=!1,fu=0,WS=0;function Nr(){throw Error(o(321))}function P0(s,c){if(c===null)return!1;for(var A=0;A<c.length&&A<s.length;A++)if(!ei(s[A],c[A]))return!1;return!0}function C0(s,c,A,N,j,q){if(No=q,Wt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,vf.current=s===null||s.memoizedState===null?ZS:QS,s=A(N,j),cu){q=0;do{if(cu=!1,fu=0,25<=q)throw Error(o(301));q+=1,br=sr=null,c.updateQueue=null,vf.current=JS,s=A(N,j)}while(cu)}if(vf.current=_f,c=sr!==null&&sr.next!==null,No=0,br=sr=Wt=null,mf=!1,c)throw Error(o(300));return s}function k0(){var s=fu!==0;return fu=0,s}function ki(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?Wt.memoizedState=br=s:br=br.next=s,br}function zn(){if(sr===null){var s=Wt.alternate;s=s!==null?s.memoizedState:null}else s=sr.next;var c=br===null?Wt.memoizedState:br.next;if(c!==null)br=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},br===null?Wt.memoizedState=br=s:br=br.next=s}return br}function du(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=zn(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var N=sr,j=N.baseQueue,q=A.pending;if(q!==null){if(j!==null){var J=j.next;j.next=q.next,q.next=J}N.baseQueue=j=q,A.pending=null}if(j!==null){q=j.next,N=N.baseState;var ae=J=null,pe=null,Te=q;do{var Ge=Te.lane;if((No&Ge)===Ge)pe!==null&&(pe=pe.next={lane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),N=Te.hasEagerState?Te.eagerState:s(N,Te.action);else{var nt={lane:Ge,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null};pe===null?(ae=pe=nt,J=N):pe=pe.next=nt,Wt.lanes|=Ge,Io|=Ge}Te=Te.next}while(Te!==null&&Te!==q);pe===null?J=N:pe.next=ae,ei(N,c.memoizedState)||(nn=!0),c.memoizedState=N,c.baseState=J,c.baseQueue=pe,A.lastRenderedState=N}if(s=A.interleaved,s!==null){j=s;do q=j.lane,Wt.lanes|=q,Io|=q,j=j.next;while(j!==s)}else j===null&&(A.lanes=0);return[c.memoizedState,A.dispatch]}function A0(s){var c=zn(),A=c.queue;if(A===null)throw Error(o(311));A.lastRenderedReducer=s;var N=A.dispatch,j=A.pending,q=c.memoizedState;if(j!==null){A.pending=null;var J=j=j.next;do q=s(q,J.action),J=J.next;while(J!==j);ei(q,c.memoizedState)||(nn=!0),c.memoizedState=q,c.baseQueue===null&&(c.baseState=q),A.lastRenderedState=q}return[q,N]}function q2(){}function W2(s,c){var A=Wt,N=zn(),j=c(),q=!ei(N.memoizedState,j);if(q&&(N.memoizedState=j,nn=!0),N=N.queue,R0(X2.bind(null,A,N,s),[s]),N.getSnapshot!==c||q||br!==null&&br.memoizedState.tag&1){if(A.flags|=2048,hu(9,Y2.bind(null,A,N,j,c),void 0,null),_r===null)throw Error(o(349));No&30||K2(A,c,j)}return j}function K2(s,c,A){s.flags|=16384,s={getSnapshot:c,value:A},c=Wt.updateQueue,c===null?(c={lastEffect:null,stores:null},Wt.updateQueue=c,c.stores=[s]):(A=c.stores,A===null?c.stores=[s]:A.push(s))}function Y2(s,c,A,N){c.value=A,c.getSnapshot=N,Z2(c)&&Q2(s)}function X2(s,c,A){return A(function(){Z2(c)&&Q2(s)})}function Z2(s){var c=s.getSnapshot;s=s.value;try{var A=c();return!ei(s,A)}catch{return!0}}function Q2(s){var c=Pi(s,1);c!==null&&Bn(c,s,1,-1)}function J2(s){var c=ki();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:du,lastRenderedState:s},c.queue=s,s=s.dispatch=XS.bind(null,Wt,s),[c.memoizedState,s]}function hu(s,c,A,N){return s={tag:s,create:c,destroy:A,deps:N,next:null},c=Wt.updateQueue,c===null?(c={lastEffect:null,stores:null},Wt.updateQueue=c,c.lastEffect=s.next=s):(A=c.lastEffect,A===null?c.lastEffect=s.next=s:(N=A.next,A.next=s,s.next=N,c.lastEffect=s)),s}function eb(){return zn().memoizedState}function yf(s,c,A,N){var j=ki();Wt.flags|=s,j.memoizedState=hu(1|c,A,void 0,N===void 0?null:N)}function bf(s,c,A,N){var j=zn();N=N===void 0?null:N;var q=void 0;if(sr!==null){var J=sr.memoizedState;if(q=J.destroy,N!==null&&P0(N,J.deps)){j.memoizedState=hu(c,A,q,N);return}}Wt.flags|=s,j.memoizedState=hu(1|c,A,q,N)}function tb(s,c){return yf(8390656,8,s,c)}function R0(s,c){return bf(2048,8,s,c)}function rb(s,c){return bf(4,2,s,c)}function nb(s,c){return bf(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,A){return A=A!=null?A.concat([s]):null,bf(4,4,ib.bind(null,c,s),A)}function M0(){}function ob(s,c){var A=zn();c=c===void 0?null:c;var N=A.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(A.memoizedState=[s,c],s)}function lb(s,c){var A=zn();c=c===void 0?null:c;var N=A.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(s=s(),A.memoizedState=[s,c],s)}function sb(s,c,A){return No&21?(ei(A,c)||(A=k2(),Wt.lanes|=A,Io|=A,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,nn=!0),s.memoizedState=A)}function KS(s,c){var A=bt;bt=A!==0&&4>A?A:4,s(!0);var N=x0.transition;x0.transition={};try{s(!1),c()}finally{bt=A,x0.transition=N}}function ub(){return zn().memoizedState}function YS(s,c,A){var N=ja(s);if(A={lane:N,action:A,hasEagerState:!1,eagerState:null,next:null},cb(s))fb(c,A);else if(A=U2(s,c,A,N),A!==null){var j=jr();Bn(A,s,N,j),db(A,c,N)}}function XS(s,c,A){var N=ja(s),j={lane:N,action:A,hasEagerState:!1,eagerState:null,next:null};if(cb(s))fb(c,j);else{var q=s.alternate;if(s.lanes===0&&(q===null||q.lanes===0)&&(q=c.lastRenderedReducer,q!==null))try{var J=c.lastRenderedState,ae=q(J,A);if(j.hasEagerState=!0,j.eagerState=ae,ei(ae,J)){var pe=c.interleaved;pe===null?(j.next=j,b0(c)):(j.next=pe.next,pe.next=j),c.interleaved=j;return}}catch{}finally{}A=U2(s,c,j,N),A!==null&&(j=jr(),Bn(A,s,N,j),db(A,c,N))}}function cb(s){var c=s.alternate;return s===Wt||c!==null&&c===Wt}function fb(s,c){cu=mf=!0;var A=s.pending;A===null?c.next=c:(c.next=A.next,A.next=c),s.pending=c}function db(s,c,A){if(A&4194240){var N=c.lanes;N&=s.pendingLanes,A|=N,c.lanes=A,a0(s,A)}}var _f={readContext:jn,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},ZS={readContext:jn,useCallback:function(s,c){return ki().memoizedState=[s,c===void 0?null:c],s},useContext:jn,useEffect:tb,useImperativeHandle:function(s,c,A){return A=A!=null?A.concat([s]):null,yf(4194308,4,ib.bind(null,c,s),A)},useLayoutEffect:function(s,c){return yf(4194308,4,s,c)},useInsertionEffect:function(s,c){return yf(4,2,s,c)},useMemo:function(s,c){var A=ki();return c=c===void 0?null:c,s=s(),A.memoizedState=[s,c],s},useReducer:function(s,c,A){var N=ki();return c=A!==void 0?A(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,Wt,s),[N.memoizedState,s]},useRef:function(s){var c=ki();return s={current:s},c.memoizedState=s},useState:J2,useDebugValue:M0,useDeferredValue:function(s){return ki().memoizedState=s},useTransition:function(){var s=J2(!1),c=s[0];return s=KS.bind(null,s[1]),ki().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,A){var N=Wt,j=ki();if(Ht){if(A===void 0)throw Error(o(407));A=A()}else{if(A=c(),_r===null)throw Error(o(349));No&30||K2(N,c,A)}j.memoizedState=A;var q={value:A,getSnapshot:c};return j.queue=q,tb(X2.bind(null,N,q,s),[s]),N.flags|=2048,hu(9,Y2.bind(null,N,q,A,c),void 0,null),A},useId:function(){var s=ki(),c=_r.identifierPrefix;if(Ht){var A=Ji,N=Qi;A=(N&~(1<<32-Jn(N)-1)).toString(32)+A,c=":"+c+"R"+A,A=fu++,0<A&&(c+="H"+A.toString(32)),c+=":"}else A=WS++,c=":"+c+"r"+A.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},QS={readContext:jn,useCallback:ob,useContext:jn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:T0,useRef:eb,useState:function(){return T0(du)},useDebugValue:M0,useDeferredValue:function(s){var c=zn();return sb(c,sr.memoizedState,s)},useTransition:function(){var s=T0(du)[0],c=zn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1},JS={readContext:jn,useCallback:ob,useContext:jn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:A0,useRef:eb,useState:function(){return A0(du)},useDebugValue:M0,useDeferredValue:function(s){var c=zn();return sr===null?c.memoizedState=s:sb(c,sr.memoizedState,s)},useTransition:function(){var s=A0(du)[0],c=zn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1};function ri(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var A in s)c[A]===void 0&&(c[A]=s[A]);return c}return c}function L0(s,c,A,N){c=s.memoizedState,A=A(N,c),A=A==null?c:a({},c,A),s.memoizedState=A,s.lanes===0&&(s.updateQueue.baseState=A)}var wf={isMounted:function(s){return(s=s._reactInternals)?O(s)===s:!1},enqueueSetState:function(s,c,A){s=s._reactInternals;var N=jr(),j=ja(s),q=ea(N,j);q.payload=c,A!=null&&(q.callback=A),c=Na(s,q,j),c!==null&&(Bn(c,s,j,N),hf(c,s,j))},enqueueReplaceState:function(s,c,A){s=s._reactInternals;var N=jr(),j=ja(s),q=ea(N,j);q.tag=1,q.payload=c,A!=null&&(q.callback=A),c=Na(s,q,j),c!==null&&(Bn(c,s,j,N),hf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var A=jr(),N=ja(s),j=ea(A,N);j.tag=2,c!=null&&(j.callback=c),c=Na(s,j,N),c!==null&&(Bn(c,s,N,A),hf(c,s,N))}};function hb(s,c,A,N,j,q,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,q,J):c.prototype&&c.prototype.isPureReactComponent?!uf(A,N)||!uf(j,q):!0}function pb(s,c,A){var N=!1,j=Ma,q=c.contextType;return typeof q=="object"&&q!==null?q=jn(q):(j=rn(c)?Ao:Lr.current,N=c.contextTypes,q=(N=N!=null)?Al(s,j):Ma),c=new c(A,q),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=wf,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=q),c}function gb(s,c,A,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(A,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(A,N),c.state!==s&&wf.enqueueReplaceState(c,c.state,null)}function N0(s,c,A,N){var j=s.stateNode;j.props=A,j.state=s.memoizedState,j.refs={},_0(s);var q=c.contextType;typeof q=="object"&&q!==null?j.context=jn(q):(q=rn(c)?Ao:Lr.current,j.context=Al(s,q)),j.state=s.memoizedState,q=c.getDerivedStateFromProps,typeof q=="function"&&(L0(s,c,q,A),j.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&wf.enqueueReplaceState(j,j.state,null),pf(s,A,j,N),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function zl(s,c){try{var A="",N=c;do A+=qS(N),N=N.return;while(N);var j=A}catch(q){j=`
56
+ Error generating stack: `+q.message+`
57
+ `+q.stack}return{value:s,source:c,stack:j,digest:null}}function I0(s,c,A){return{value:s,source:null,stack:A??null,digest:c??null}}function D0(s,c){try{console.error(c.value)}catch(A){setTimeout(function(){throw A})}}var eE=typeof WeakMap=="function"?WeakMap:Map;function vb(s,c,A){A=ea(-1,A),A.tag=3,A.payload={element:null};var N=c.value;return A.callback=function(){If||(If=!0,r1=N),D0(s,c)},A}function mb(s,c,A){A=ea(-1,A),A.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var j=c.value;A.payload=function(){return N(j)},A.callback=function(){D0(s,c)}}var q=s.stateNode;return q!==null&&typeof q.componentDidCatch=="function"&&(A.callback=function(){D0(s,c),typeof N!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),A}function yb(s,c,A){var N=s.pingCache;if(N===null){N=s.pingCache=new eE;var j=new Set;N.set(c,j)}else j=N.get(c),j===void 0&&(j=new Set,N.set(c,j));j.has(A)||(j.add(A),s=pE.bind(null,s,c,A),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,A,N,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(c=ea(-1,1),c.tag=2,Na(A,c,1))),A.lanes|=1),s)}var tE=l.ReactCurrentOwner,nn=!1;function Gr(s,c,A,N){c.child=s===null?z2(c,null,A,N):Nl(c,s.child,A,N)}function wb(s,c,A,N,j){A=A.render;var q=c.ref;return Dl(c,j),N=C0(s,c,A,N,q,j),A=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,ta(s,c,j)):(Ht&&A&&c0(c),c.flags|=1,Gr(s,c,N,j),c.child)}function Sb(s,c,A,N,j){if(s===null){var q=A.type;return typeof q=="function"&&!s1(q)&&q.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(c.tag=15,c.type=q,Eb(s,c,q,N,j)):(s=Uf(A.type,null,N,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(q=s.child,!(s.lanes&j)){var J=q.memoizedProps;if(A=A.compare,A=A!==null?A:uf,A(J,N)&&s.ref===c.ref)return ta(s,c,j)}return c.flags|=1,s=za(q,N),s.ref=c.ref,s.return=c,c.child=s}function Eb(s,c,A,N,j){if(s!==null){var q=s.memoizedProps;if(uf(q,N)&&s.ref===c.ref)if(nn=!1,c.pendingProps=N=q,(s.lanes&j)!==0)s.flags&131072&&(nn=!0);else return c.lanes=s.lanes,ta(s,c,j)}return j0(s,c,A,N,j)}function Ob(s,c,A){var N=c.pendingProps,j=N.children,q=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(Ul,_n),_n|=A;else{if(!(A&1073741824))return s=q!==null?q.baseLanes|A:A,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Lt(Ul,_n),_n|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=q!==null?q.baseLanes:A,Lt(Ul,_n),_n|=N}else q!==null?(N=q.baseLanes|A,c.memoizedState=null):N=A,Lt(Ul,_n),_n|=N;return Gr(s,c,j,A),c.child}function xb(s,c){var A=c.ref;(s===null&&A!==null||s!==null&&s.ref!==A)&&(c.flags|=512,c.flags|=2097152)}function j0(s,c,A,N,j){var q=rn(A)?Ao:Lr.current;return q=Al(c,q),Dl(c,j),A=C0(s,c,A,N,q,j),N=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,ta(s,c,j)):(Ht&&N&&c0(c),c.flags|=1,Gr(s,c,A,j),c.child)}function Pb(s,c,A,N,j){if(rn(A)){var q=!0;Jc(c)}else q=!1;if(Dl(c,j),c.stateNode===null)Ef(s,c),pb(c,A,N),N0(c,A,N,j),N=!0;else if(s===null){var J=c.stateNode,ae=c.memoizedProps;J.props=ae;var pe=J.context,Te=A.contextType;typeof Te=="object"&&Te!==null?Te=jn(Te):(Te=rn(A)?Ao:Lr.current,Te=Al(c,Te));var Ge=A.getDerivedStateFromProps,nt=typeof Ge=="function"||typeof J.getSnapshotBeforeUpdate=="function";nt||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==N||pe!==Te)&&gb(c,J,N,Te),La=!1;var De=c.memoizedState;J.state=De,pf(c,N,J,j),pe=c.memoizedState,ae!==N||De!==pe||tn.current||La?(typeof Ge=="function"&&(L0(c,A,Ge,N),pe=c.memoizedState),(ae=La||hb(c,A,ae,N,De,pe,Te))?(nt||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=Te,N=ae):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{J=c.stateNode,H2(s,c),ae=c.memoizedProps,Te=c.type===c.elementType?ae:ri(c.type,ae),J.props=Te,nt=c.pendingProps,De=J.context,pe=A.contextType,typeof pe=="object"&&pe!==null?pe=jn(pe):(pe=rn(A)?Ao:Lr.current,pe=Al(c,pe));var Ft=A.getDerivedStateFromProps;(Ge=typeof Ft=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==nt||De!==pe)&&gb(c,J,N,pe),La=!1,De=c.memoizedState,J.state=De,pf(c,N,J,j);var At=c.memoizedState;ae!==nt||De!==At||tn.current||La?(typeof Ft=="function"&&(L0(c,A,Ft,N),At=c.memoizedState),(Te=La||hb(c,A,Te,N,De,At,pe)||!1)?(Ge||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"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=At),J.props=N,J.state=At,J.context=pe,N=Te):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=1024),N=!1)}return F0(s,c,A,N,q,j)}function F0(s,c,A,N,j,q){xb(s,c);var J=(c.flags&128)!==0;if(!N&&!J)return j&&C2(c,A,!1),ta(s,c,q);N=c.stateNode,tE.current=c;var ae=J&&typeof A.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&J?(c.child=Nl(c,s.child,null,q),c.child=Nl(c,null,ae,q)):Gr(s,c,ae,q),c.memoizedState=N.state,j&&C2(c,A,!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,A,N,j){return Ll(),p0(j),c.flags|=256,Gr(s,c,A,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,A){var N=c.pendingProps,j=qt.current,q=!1,J=(c.flags&128)!==0,ae;if((ae=J)||(ae=s!==null&&s.memoizedState===null?!1:(j&2)!==0),ae?(q=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),Lt(qt,j&1),s===null)return h0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Rn(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=N.children,s=N.fallback,q?(N=c.mode,q=c.child,J={mode:"hidden",children:J},!(N&1)&&q!==null?(q.childLanes=0,q.pendingProps=J):q=Hf(J,N,0,null),s=zo(s,N,A,null),q.return=c,s.return=c,q.sibling=s,c.child=q,c.child.memoizedState=B0(A),c.memoizedState=z0,s):U0(c,J));if(j=s.memoizedState,j!==null&&(ae=j.dehydrated,ae!==null))return rE(s,c,J,N,ae,j,A);if(q){q=N.fallback,J=c.mode,j=s.child,ae=j.sibling;var pe={mode:"hidden",children:N.children};return!(J&1)&&c.child!==j?(N=c.child,N.childLanes=0,N.pendingProps=pe,c.deletions=null):(N=za(j,pe),N.subtreeFlags=j.subtreeFlags&14680064),ae!==null?q=za(ae,q):(q=zo(q,J,A,null),q.flags|=2),q.return=c,N.return=c,N.sibling=q,c.child=N,N=q,q=c.child,J=s.child.memoizedState,J=J===null?B0(A):{baseLanes:J.baseLanes|A,cachePool:null,transitions:J.transitions},q.memoizedState=J,q.childLanes=s.childLanes&~A,c.memoizedState=z0,N}return q=s.child,s=q.sibling,N=za(q,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=A),N.return=c,N.sibling=null,s!==null&&(A=c.deletions,A===null?(c.deletions=[s],c.flags|=16):A.push(s)),c.child=N,c.memoizedState=null,N}function U0(s,c){return c=Hf({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Sf(s,c,A,N){return N!==null&&p0(N),Nl(c,s.child,null,A),s=U0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function rE(s,c,A,N,j,q,J){if(A)return c.flags&256?(c.flags&=-257,N=I0(Error(o(422))),Sf(s,c,J,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(q=N.fallback,j=c.mode,N=Hf({mode:"visible",children:N.children},j,0,null),q=zo(q,j,J,null),q.flags|=2,N.return=c,q.return=c,N.sibling=q,c.child=N,c.mode&1&&Nl(c,s.child,null,J),c.child.memoizedState=B0(J),c.memoizedState=z0,q);if(!(c.mode&1))return Sf(s,c,J,null);if(Rn(j))return N=Ne(j).digest,q=Error(o(419)),N=I0(q,N,void 0),Sf(s,c,J,N);if(A=(J&s.childLanes)!==0,nn||A){if(N=_r,N!==null){switch(J&-J){case 4:j=2;break;case 16:j=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:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(N.suspendedLanes|J)?0:j,j!==0&&j!==q.retryLane&&(q.retryLane=j,Pi(s,j),Bn(N,s,j,-1))}return l1(),N=I0(Error(o(421))),Sf(s,c,J,N)}return Qn(j)?(c.flags|=128,c.child=s.child,c=gE.bind(null,s),et(j,c),null):(s=q.treeContext,ne&&(Dn=Jr(j),bn=c,Ht=!0,ti=null,ou=!1,s!==null&&(Nn[In++]=Qi,Nn[In++]=Ji,Nn[In++]=Ro,Qi=s.id,Ji=s.overflow,Ro=c)),c=U0(c,N.children),c.flags|=4096,c)}function Ab(s,c,A){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),y0(s.return,c,A)}function H0(s,c,A,N,j){var q=s.memoizedState;q===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:A,tailMode:j}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=N,q.tail=A,q.tailMode=j)}function Rb(s,c,A){var N=c.pendingProps,j=N.revealOrder,q=N.tail;if(Gr(s,c,N.children,A),N=qt.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,A,c);else if(s.tag===19)Ab(s,A,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(Lt(qt,N),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(A=c.child,j=null;A!==null;)s=A.alternate,s!==null&&gf(s)===null&&(j=A),A=A.sibling;A=j,A===null?(j=c.child,c.child=null):(j=A.sibling,A.sibling=null),H0(c,!1,j,A,q);break;case"backwards":for(A=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&gf(s)===null){c.child=j;break}s=j.sibling,j.sibling=A,A=j,j=s}H0(c,!0,A,null,q);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Ef(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function ta(s,c,A){if(s!==null&&(c.dependencies=s.dependencies),Io|=c.lanes,!(A&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,A=za(s,s.pendingProps),c.child=A,A.return=c;s.sibling!==null;)s=s.sibling,A=A.sibling=za(s,s.pendingProps),A.return=c;A.sibling=null}return c.child}function nE(s,c,A){switch(c.tag){case 3:Cb(c),Ll();break;case 5:V2(c);break;case 1:rn(c.type)&&Jc(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?(Lt(qt,qt.current&1),c.flags|=128,null):A&c.child.childLanes?Tb(s,c,A):(Lt(qt,qt.current&1),s=ta(s,c,A),s!==null?s.sibling:null);Lt(qt,qt.current&1);break;case 19:if(N=(A&c.childLanes)!==0,s.flags&128){if(N)return Rb(s,c,A);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Lt(qt,qt.current),N)break;return null;case 22:case 23:return c.lanes=0,Ob(s,c,A)}return ta(s,c,A)}function Ti(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 pu,gu,Of,xf;if(te)pu=function(s,c){for(var A=c.child;A!==null;){if(A.tag===5||A.tag===6)z(s,A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},gu=function(){},Of=function(s,c,A,N,j){if(s=s.memoizedProps,s!==N){var q=c.stateNode,J=Ci(Fn.current);A=$(q,A,s,N,j,J),(c.updateQueue=A)&&Ti(c)}},xf=function(s,c,A,N){A!==N&&Ti(c)};else if(ee){pu=function(s,c,A,N){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;A&&N&&(q=xt(q,j.type,j.memoizedProps,j)),z(s,q)}else if(j.tag===6)q=j.stateNode,A&&N&&(q=xr(q,j.memoizedProps,j)),z(s,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),pu(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Lb=function(s,c,A,N){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;A&&N&&(q=xt(q,j.type,j.memoizedProps,j)),ze(s,q)}else if(j.tag===6)q=j.stateNode,A&&N&&(q=xr(q,j.memoizedProps,j)),ze(s,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),Lb(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};gu=function(s,c){var A=c.stateNode;if(!Mb(s,c)){s=A.containerInfo;var N=xe(s);Lb(N,c,!1,!1),A.pendingChildren=N,Ti(c),tt(s,N)}},Of=function(s,c,A,N,j){var q=s.stateNode,J=s.memoizedProps;if((s=Mb(s,c))&&J===N)c.stateNode=q;else{var ae=c.stateNode,pe=Ci(Fn.current),Te=null;J!==N&&(Te=$(ae,A,J,N,j,pe)),s&&Te===null?c.stateNode=q:(q=lr(q,Te,A,J,N,c,s,ae),D(q,A,N,j,pe)&&Ti(c),c.stateNode=q,s?Ti(c):pu(q,c,!1,!1))}},xf=function(s,c,A,N){A!==N?(s=Ci(jl.current),A=Ci(Fn.current),c.stateNode=V(N,s,A,c),Ti(c)):c.stateNode=s.stateNode}}else gu=function(){},Of=function(){},xf=function(){};function vu(s,c){if(!Ht)switch(s.tailMode){case"hidden":c=s.tail;for(var A=null;c!==null;)c.alternate!==null&&(A=c),c=c.sibling;A===null?s.tail=null:A.sibling=null;break;case"collapsed":A=s.tail;for(var N=null;A!==null;)A.alternate!==null&&(N=A),A=A.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function Ir(s){var c=s.alternate!==null&&s.alternate.child===s.child,A=0,N=0;if(c)for(var j=s.child;j!==null;)A|=j.lanes|j.childLanes,N|=j.subtreeFlags&14680064,N|=j.flags&14680064,j.return=s,j=j.sibling;else for(j=s.child;j!==null;)A|=j.lanes|j.childLanes,N|=j.subtreeFlags,N|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=N,s.childLanes=A,c}function iE(s,c,A){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 Ir(c),null;case 1:return rn(c.type)&&Qc(),Ir(c),null;case 3:return A=c.stateNode,Fl(),jt(tn),jt(Lr),O0(),A.pendingContext&&(A.context=A.pendingContext,A.pendingContext=null),(s===null||s.child===null)&&(sf(c)?Ti(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ti!==null&&(a1(ti),ti=null))),gu(s,c),Ir(c),null;case 5:S0(c),A=Ci(jl.current);var j=c.type;if(s!==null&&c.stateNode!=null)Of(s,c,j,N,A),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return Ir(c),null}if(s=Ci(Fn.current),sf(c)){if(!ne)throw Error(o(175));s=$r(c.stateNode,c.type,c.memoizedProps,A,s,c,!ou),c.updateQueue=s,s!==null&&Ti(c)}else{var q=L(j,N,A,s,c);pu(q,c,!1,!1),c.stateNode=q,D(q,j,N,A,s)&&Ti(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Ir(c),null;case 6:if(s&&c.stateNode!=null)xf(s,c,s.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(o(166));if(s=Ci(jl.current),A=Ci(Fn.current),sf(c)){if(!ne)throw Error(o(176));if(s=c.stateNode,A=c.memoizedProps,(N=Ut(s,A,c,!ou))&&(j=bn,j!==null))switch(j.tag){case 3:Aa(j.stateNode.containerInfo,s,A,(j.mode&1)!==0);break;case 5:Zc(j.type,j.memoizedProps,j.stateNode,s,A,(j.mode&1)!==0)}N&&Ti(c)}else c.stateNode=V(N,s,A,c)}return Ir(c),null;case 13:if(jt(qt),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Ht&&Dn!==null&&c.mode&1&&!(c.flags&128))D2(),Ll(),c.flags|=98560,j=!1;else if(j=sf(c),N!==null&&N.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!ne)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));en(j,c)}else Ll(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Ir(c),j=!1}else ti!==null&&(a1(ti),ti=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=A,c):(A=N!==null,A!==(s!==null&&s.memoizedState!==null)&&A&&(c.child.flags|=8192,c.mode&1&&(s===null||qt.current&1?ur===0&&(ur=3):l1())),c.updateQueue!==null&&(c.flags|=4),Ir(c),null);case 4:return Fl(),gu(s,c),s===null&&oe(c.stateNode.containerInfo),Ir(c),null;case 10:return m0(c.type._context),Ir(c),null;case 17:return rn(c.type)&&Qc(),Ir(c),null;case 19:if(jt(qt),j=c.memoizedState,j===null)return Ir(c),null;if(N=(c.flags&128)!==0,q=j.rendering,q===null)if(N)vu(j,!1);else{if(ur!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(q=gf(s),q!==null){for(c.flags|=128,vu(j,!1),s=q.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=A,A=c.child;A!==null;)N=A,j=s,N.flags&=14680066,q=N.alternate,q===null?(N.childLanes=0,N.lanes=j,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=q.childLanes,N.lanes=q.lanes,N.child=q.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=q.memoizedProps,N.memoizedState=q.memoizedState,N.updateQueue=q.updateQueue,N.type=q.type,j=q.dependencies,N.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),A=A.sibling;return Lt(qt,qt.current&1|2),c.child}s=s.sibling}j.tail!==null&&yr()>t1&&(c.flags|=128,N=!0,vu(j,!1),c.lanes=4194304)}else{if(!N)if(s=gf(q),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),vu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!q.alternate&&!Ht)return Ir(c),null}else 2*yr()-j.renderingStartTime>t1&&A!==1073741824&&(c.flags|=128,N=!0,vu(j,!1),c.lanes=4194304);j.isBackwards?(q.sibling=c.child,c.child=q):(s=j.last,s!==null?s.sibling=q:c.child=q,j.last=q)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=yr(),c.sibling=null,s=qt.current,Lt(qt,N?s&1|2:s&1),c):(Ir(c),null);case 22:case 23:return o1(),A=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==A&&(c.flags|=8192),A&&c.mode&1?_n&1073741824&&(Ir(c),te&&c.subtreeFlags&6&&(c.flags|=8192)):Ir(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 rn(c.type)&&Qc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Fl(),jt(tn),jt(Lr),O0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return S0(c),null;case 13:if(jt(qt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));Ll()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return jt(qt),null;case 4:return Fl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var Pf=!1,Dr=!1,oE=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Bl(s,c){var A=s.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(N){$t(s,c,N)}else A.current=null}function $0(s,c,A){try{A()}catch(N){$t(s,c,N)}}var Nb=!1;function lE(s,c){for(F(s.containerInfo),Be=c;Be!==null;)if(s=Be,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Be=c;else for(;Be!==null;){s=Be;try{var A=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var N=A.memoizedProps,j=A.memoizedState,q=s.stateNode,J=q.getSnapshotBeforeUpdate(s.elementType===s.type?N:ri(s.type,N),j);q.__reactInternalSnapshotBeforeUpdate=J}break;case 3:te&&We(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ae){$t(s,s.return,ae)}if(c=s.sibling,c!==null){c.return=s.return,Be=c;break}Be=s.return}return A=Nb,Nb=!1,A}function mu(s,c,A){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var j=N=N.next;do{if((j.tag&s)===s){var q=j.destroy;j.destroy=void 0,q!==void 0&&$0(c,A,q)}j=j.next}while(j!==N)}}function Cf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var A=c=c.next;do{if((A.tag&s)===s){var N=A.create;A.destroy=N()}A=A.next}while(A!==c)}}function G0(s){var c=s.ref;if(c!==null){var A=s.stateNode;switch(s.tag){case 5:s=Z(A);break;default:s=A}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&&Ie(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,A){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?ce(A,s,c):Oe(A,s);else if(N!==4&&(s=s.child,s!==null))for(V0(s,c,A),s=s.sibling;s!==null;)V0(s,c,A),s=s.sibling}function q0(s,c,A){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?ue(A,s,c):Re(A,s);else if(N!==4&&(s=s.child,s!==null))for(q0(s,c,A),s=s.sibling;s!==null;)q0(s,c,A),s=s.sibling}var Pr=null,ni=!1;function Ai(s,c,A){for(A=A.child;A!==null;)W0(s,c,A),A=A.sibling}function W0(s,c,A){if(Oi&&typeof Oi.onCommitFiberUnmount=="function")try{Oi.onCommitFiberUnmount(nf,A)}catch{}switch(A.tag){case 5:Dr||Bl(A,c);case 6:if(te){var N=Pr,j=ni;Pr=null,Ai(s,c,A),Pr=N,ni=j,Pr!==null&&(ni?be(Pr,A.stateNode):Xe(Pr,A.stateNode))}else Ai(s,c,A);break;case 18:te&&Pr!==null&&(ni?ko(Pr,A.stateNode):ru(Pr,A.stateNode));break;case 4:te?(N=Pr,j=ni,Pr=A.stateNode.containerInfo,ni=!0,Ai(s,c,A),Pr=N,ni=j):(ee&&(N=A.stateNode.containerInfo,j=xe(N),yt(N,j)),Ai(s,c,A));break;case 0:case 11:case 14:case 15:if(!Dr&&(N=A.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){j=N=N.next;do{var q=j,J=q.destroy;q=q.tag,J!==void 0&&(q&2||q&4)&&$0(A,c,J),j=j.next}while(j!==N)}Ai(s,c,A);break;case 1:if(!Dr&&(Bl(A,c),N=A.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=A.memoizedProps,N.state=A.memoizedState,N.componentWillUnmount()}catch(ae){$t(A,c,ae)}Ai(s,c,A);break;case 21:Ai(s,c,A);break;case 22:A.mode&1?(Dr=(N=Dr)||A.memoizedState!==null,Ai(s,c,A),Dr=N):Ai(s,c,A);break;default:Ai(s,c,A)}}function Fb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var A=s.stateNode;A===null&&(A=s.stateNode=new oE),c.forEach(function(N){var j=vE.bind(null,s,N);A.has(N)||(A.add(N),N.then(j,j))})}}function ii(s,c){var A=c.deletions;if(A!==null)for(var N=0;N<A.length;N++){var j=A[N];try{var q=s,J=c;if(te){var ae=J;e:for(;ae!==null;){switch(ae.tag){case 5:Pr=ae.stateNode,ni=!1;break e;case 3:Pr=ae.stateNode.containerInfo,ni=!0;break e;case 4:Pr=ae.stateNode.containerInfo,ni=!0;break e}ae=ae.return}if(Pr===null)throw Error(o(160));W0(q,J,j),Pr=null,ni=!1}else W0(q,J,j);var pe=j.alternate;pe!==null&&(pe.return=null),j.return=null}catch(Te){$t(j,c,Te)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)zb(c,s),c=c.sibling}function zb(s,c){var A=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ii(c,s),Ri(s),N&4){try{mu(3,s,s.return),Cf(3,s)}catch(De){$t(s,s.return,De)}try{mu(5,s,s.return)}catch(De){$t(s,s.return,De)}}break;case 1:ii(c,s),Ri(s),N&512&&A!==null&&Bl(A,A.return);break;case 5:if(ii(c,s),Ri(s),N&512&&A!==null&&Bl(A,A.return),te){if(s.flags&32){var j=s.stateNode;try{Le(j)}catch(De){$t(s,s.return,De)}}if(N&4&&(j=s.stateNode,j!=null)){var q=s.memoizedProps;if(A=A!==null?A.memoizedProps:q,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{lt(j,c,N,A,q,s)}catch(De){$t(s,s.return,De)}}}break;case 6:if(ii(c,s),Ri(s),N&4&&te){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,q=s.memoizedProps,A=A!==null?A.memoizedProps:q;try{Pe(j,A,q)}catch(De){$t(s,s.return,De)}}break;case 3:if(ii(c,s),Ri(s),N&4){if(te&&ne&&A!==null&&A.memoizedState.isDehydrated)try{Ln(c.containerInfo)}catch(De){$t(s,s.return,De)}if(ee){j=c.containerInfo,q=c.pendingChildren;try{yt(j,q)}catch(De){$t(s,s.return,De)}}}break;case 4:if(ii(c,s),Ri(s),N&4&&ee){q=s.stateNode,j=q.containerInfo,q=q.pendingChildren;try{yt(j,q)}catch(De){$t(s,s.return,De)}}break;case 13:ii(c,s),Ri(s),j=s.child,j.flags&8192&&(q=j.memoizedState!==null,j.stateNode.isHidden=q,!q||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=yr())),N&4&&Fb(s);break;case 22:var J=A!==null&&A.memoizedState!==null;if(s.mode&1?(Dr=(A=Dr)||J,ii(c,s),Dr=A):ii(c,s),Ri(s),N&8192){if(A=s.memoizedState!==null,(s.stateNode.isHidden=A)&&!J&&s.mode&1)for(Be=s,N=s.child;N!==null;){for(c=Be=N;Be!==null;){J=Be;var ae=J.child;switch(J.tag){case 0:case 11:case 14:case 15:mu(4,J,J.return);break;case 1:Bl(J,J.return);var pe=J.stateNode;if(typeof pe.componentWillUnmount=="function"){var Te=J,Ge=J.return;try{var nt=Te;pe.props=nt.memoizedProps,pe.state=nt.memoizedState,pe.componentWillUnmount()}catch(De){$t(Te,Ge,De)}}break;case 5:Bl(J,J.return);break;case 22:if(J.memoizedState!==null){Hb(c);continue}}ae!==null?(ae.return=J,Be=ae):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{j=c.stateNode,A?Ae(j):Je(c.stateNode,c.memoizedProps)}catch(De){$t(s,s.return,De)}}}else if(c.tag===6){if(N===null)try{q=c.stateNode,A?we(q):Ee(q,c.memoizedProps)}catch(De){$t(s,s.return,De)}}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:ii(c,s),Ri(s),N&4&&Fb(s);break;case 21:break;default:ii(c,s),Ri(s)}}function Ri(s){var c=s.flags;if(c&2){try{if(te){e:{for(var A=s.return;A!==null;){if(Db(A)){var N=A;break e}A=A.return}throw Error(o(160))}switch(N.tag){case 5:var j=N.stateNode;N.flags&32&&(Le(j),N.flags&=-33);var q=jb(s);q0(s,q,j);break;case 3:case 4:var J=N.stateNode.containerInfo,ae=jb(s);V0(s,ae,J);break;default:throw Error(o(161))}}}catch(pe){$t(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function sE(s,c,A){Be=s,Bb(s)}function Bb(s,c,A){for(var N=(s.mode&1)!==0;Be!==null;){var j=Be,q=j.child;if(j.tag===22&&N){var J=j.memoizedState!==null||Pf;if(!J){var ae=j.alternate,pe=ae!==null&&ae.memoizedState!==null||Dr;ae=Pf;var Te=Dr;if(Pf=J,(Dr=pe)&&!Te)for(Be=j;Be!==null;)J=Be,pe=J.child,J.tag===22&&J.memoizedState!==null?$b(j):pe!==null?(pe.return=J,Be=pe):$b(j);for(;q!==null;)Be=q,Bb(q),q=q.sibling;Be=j,Pf=ae,Dr=Te}Ub(s)}else j.subtreeFlags&8772&&q!==null?(q.return=j,Be=q):Ub(s)}}function Ub(s){for(;Be!==null;){var c=Be;if(c.flags&8772){var A=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Dr||Cf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Dr)if(A===null)N.componentDidMount();else{var j=c.elementType===c.type?A.memoizedProps:ri(c.type,A.memoizedProps);N.componentDidUpdate(j,A.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var q=c.updateQueue;q!==null&&G2(c,q,N);break;case 3:var J=c.updateQueue;if(J!==null){if(A=null,c.child!==null)switch(c.child.tag){case 5:A=Z(c.child.stateNode);break;case 1:A=c.child.stateNode}G2(c,J,A)}break;case 5:var ae=c.stateNode;A===null&&c.flags&4&&He(ae,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 Te=pe.memoizedState;if(Te!==null){var Ge=Te.dehydrated;Ge!==null&&Ta(Ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Dr||c.flags&512&&G0(c)}catch(nt){$t(c,c.return,nt)}}if(c===s){Be=null;break}if(A=c.sibling,A!==null){A.return=c.return,Be=A;break}Be=c.return}}function Hb(s){for(;Be!==null;){var c=Be;if(c===s){Be=null;break}var A=c.sibling;if(A!==null){A.return=c.return,Be=A;break}Be=c.return}}function $b(s){for(;Be!==null;){var c=Be;try{switch(c.tag){case 0:case 11:case 15:var A=c.return;try{Cf(4,c)}catch(pe){$t(c,A,pe)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var j=c.return;try{N.componentDidMount()}catch(pe){$t(c,j,pe)}}var q=c.return;try{G0(c)}catch(pe){$t(c,q,pe)}break;case 5:var J=c.return;try{G0(c)}catch(pe){$t(c,J,pe)}}}catch(pe){$t(c,c.return,pe)}if(c===s){Be=null;break}var ae=c.sibling;if(ae!==null){ae.return=c.return,Be=ae;break}Be=c.return}}var kf=0,Tf=1,Af=2,Rf=3,Mf=4;if(typeof Symbol=="function"&&Symbol.for){var yu=Symbol.for;kf=yu("selector.component"),Tf=yu("selector.has_pseudo_class"),Af=yu("selector.role"),Rf=yu("selector.test_id"),Mf=yu("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=ge(s),s===null)throw Error(o(362));return s.stateNode.current}function Y0(s,c){switch(c.$$typeof){case kf:if(s.type===c.value)return!0;break;case Tf:e:{c=c.value,s=[s,0];for(var A=0;A<s.length;){var N=s[A++],j=s[A++],q=c[j];if(N.tag!==5||!ye(N)){for(;q!=null&&Y0(N,q);)j++,q=c[j];if(j===c.length){c=!0;break e}else for(N=N.child;N!==null;)s.push(N,j),N=N.sibling}}c=!1}return c;case Af:if(s.tag===5&&Se(s.stateNode,c.value))return!0;break;case Mf:if((s.tag===5||s.tag===6)&&(s=de(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Rf: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 kf:return"<"+(C(s.value)||"Unknown")+">";case Tf:return":has("+(X0(s)||"")+")";case Af:return'[role="'+s.value+'"]';case Mf:return'"'+s.value+'"';case Rf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Gb(s,c){var A=[];s=[s,0];for(var N=0;N<s.length;){var j=s[N++],q=s[N++],J=c[q];if(j.tag!==5||!ye(j)){for(;J!=null&&Y0(j,J);)q++,J=c[q];if(q===c.length)A.push(j);else for(j=j.child;j!==null;)s.push(j,q),j=j.sibling}}return A}function Z0(s,c){if(!_e)throw Error(o(363));s=K0(s),s=Gb(s,c),c=[],s=Array.from(s);for(var A=0;A<s.length;){var N=s[A++];if(N.tag===5)ye(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var uE=Math.ceil,Lf=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,tr=l.ReactCurrentBatchConfig,dt=0,_r=null,ir=null,Cr=0,_n=0,Ul=Ra(0),ur=0,bu=null,Io=0,Nf=0,J0=0,_u=null,an=null,e1=0,t1=1/0,ra=null;function Hl(){t1=yr()+500}var If=!1,r1=null,Ia=null,Df=!1,Da=null,jf=0,wu=0,n1=null,Ff=-1,zf=0;function jr(){return dt&6?yr():Ff!==-1?Ff:Ff=yr()}function ja(s){return s.mode&1?dt&2&&Cr!==0?Cr&-Cr:VS.transition!==null?(zf===0&&(zf=k2()),zf):(s=bt,s!==0?s:ke()):1}function Bn(s,c,A,N){if(50<wu)throw wu=0,n1=null,Error(o(185));au(s,A,N),(!(dt&2)||s!==_r)&&(s===_r&&(!(dt&2)&&(Nf|=A),ur===4&&Fa(s,Cr)),on(s,N),A===1&&dt===0&&!(c.mode&1)&&(Hl(),af&&xi()))}function on(s,c){var A=s.callbackNode;DS(s,c);var N=rf(s,s===_r?Cr:0);if(N===0)A!==null&&A2(A),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(A!=null&&A2(A),c===1)s.tag===0?GS(qb.bind(null,s)):R2(qb.bind(null,s)),le?fe(function(){!(dt&6)&&xi()}):o0(l0,xi),A=null;else{switch(T2(N)){case 1:A=l0;break;case 4:A=BS;break;case 16:A=s0;break;case 536870912:A=US;break;default:A=s0}A=t3(A,Vb.bind(null,s))}s.callbackPriority=c,s.callbackNode=A}}function Vb(s,c){if(Ff=-1,zf=0,dt&6)throw Error(o(327));var A=s.callbackNode;if(Fo()&&s.callbackNode!==A)return null;var N=rf(s,s===_r?Cr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=Bf(s,N);else{c=N;var j=dt;dt|=2;var q=Yb();(_r!==s||Cr!==c)&&(ra=null,Hl(),Do(s,c));do try{dE();break}catch(ae){Kb(s,ae)}while(!0);v0(),Lf.current=q,dt=j,ir!==null?c=0:(_r=null,Cr=0,c=ur)}if(c!==0){if(c===2&&(j=n0(s),j!==0&&(N=j,c=i1(s,j))),c===1)throw A=bu,Do(s,0),Fa(s,N),on(s,yr()),A;if(c===6)Fa(s,N);else{if(j=s.current.alternate,!(N&30)&&!cE(j)&&(c=Bf(s,N),c===2&&(q=n0(s),q!==0&&(N=q,c=i1(s,q))),c===1))throw A=bu,Do(s,0),Fa(s,N),on(s,yr()),A;switch(s.finishedWork=j,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:jo(s,an,ra);break;case 3:if(Fa(s,N),(N&130023424)===N&&(c=e1+500-yr(),10<c)){if(rf(s,0)!==0)break;if(j=s.suspendedLanes,(j&N)!==N){jr(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=U(jo.bind(null,s,an,ra),c);break}jo(s,an,ra);break;case 4:if(Fa(s,N),(N&4194240)===N)break;for(c=s.eventTimes,j=-1;0<N;){var J=31-Jn(N);q=1<<J,J=c[J],J>j&&(j=J),N&=~q}if(N=j,N=yr()-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=U(jo.bind(null,s,an,ra),N);break}jo(s,an,ra);break;case 5:jo(s,an,ra);break;default:throw Error(o(329))}}}return on(s,yr()),s.callbackNode===A?Vb.bind(null,s):null}function i1(s,c){var A=_u;return s.current.memoizedState.isDehydrated&&(Do(s,c).flags|=256),s=Bf(s,c),s!==2&&(c=an,an=A,c!==null&&a1(c)),s}function a1(s){an===null?an=s:an.push.apply(an,s)}function cE(s){for(var c=s;;){if(c.flags&16384){var A=c.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var N=0;N<A.length;N++){var j=A[N],q=j.getSnapshot;j=j.value;try{if(!ei(q(),j))return!1}catch{return!1}}}if(A=c.child,c.subtreeFlags&16384&&A!==null)A.return=c,c=A;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 Fa(s,c){for(c&=~J0,c&=~Nf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var A=31-Jn(c),N=1<<A;s[A]=-1,c&=~N}}function qb(s){if(dt&6)throw Error(o(327));Fo();var c=rf(s,0);if(!(c&1))return on(s,yr()),null;var A=Bf(s,c);if(s.tag!==0&&A===2){var N=n0(s);N!==0&&(c=N,A=i1(s,N))}if(A===1)throw A=bu,Do(s,0),Fa(s,c),on(s,yr()),A;if(A===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,jo(s,an,ra),on(s,yr()),null}function Wb(s){Da!==null&&Da.tag===0&&!(dt&6)&&Fo();var c=dt;dt|=1;var A=tr.transition,N=bt;try{if(tr.transition=null,bt=1,s)return s()}finally{bt=N,tr.transition=A,dt=c,!(dt&6)&&xi()}}function o1(){_n=Ul.current,jt(Ul)}function Do(s,c){s.finishedWork=null,s.finishedLanes=0;var A=s.timeoutHandle;if(A!==X&&(s.timeoutHandle=X,Y(A)),ir!==null)for(A=ir.return;A!==null;){var N=A;switch(f0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&Qc();break;case 3:Fl(),jt(tn),jt(Lr),O0();break;case 5:S0(N);break;case 4:Fl();break;case 13:jt(qt);break;case 19:jt(qt);break;case 10:m0(N.type._context);break;case 22:case 23:o1()}A=A.return}if(_r=s,ir=s=za(s.current,null),Cr=_n=c,ur=0,bu=null,J0=Nf=Io=0,an=_u=null,Lo!==null){for(c=0;c<Lo.length;c++)if(A=Lo[c],N=A.interleaved,N!==null){A.interleaved=null;var j=N.next,q=A.pending;if(q!==null){var J=q.next;q.next=j,N.next=J}A.pending=N}Lo=null}return s}function Kb(s,c){do{var A=ir;try{if(v0(),vf.current=_f,mf){for(var N=Wt.memoizedState;N!==null;){var j=N.queue;j!==null&&(j.pending=null),N=N.next}mf=!1}if(No=0,br=sr=Wt=null,cu=!1,fu=0,Q0.current=null,A===null||A.return===null){ur=1,bu=c,ir=null;break}e:{var q=s,J=A.return,ae=A,pe=c;if(c=Cr,ae.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Te=pe,Ge=ae,nt=Ge.tag;if(!(Ge.mode&1)&&(nt===0||nt===11||nt===15)){var De=Ge.alternate;De?(Ge.updateQueue=De.updateQueue,Ge.memoizedState=De.memoizedState,Ge.lanes=De.lanes):(Ge.updateQueue=null,Ge.memoizedState=null)}var Ft=bb(J);if(Ft!==null){Ft.flags&=-257,_b(Ft,J,ae,q,c),Ft.mode&1&&yb(q,Te,c),c=Ft,pe=Te;var At=c.updateQueue;if(At===null){var ln=new Set;ln.add(pe),c.updateQueue=ln}else At.add(pe);break e}else{if(!(c&1)){yb(q,Te,c),l1();break e}pe=Error(o(426))}}else if(Ht&&ae.mode&1){var na=bb(J);if(na!==null){!(na.flags&65536)&&(na.flags|=256),_b(na,J,ae,q,c),p0(zl(pe,ae));break e}}q=pe=zl(pe,ae),ur!==4&&(ur=2),_u===null?_u=[q]:_u.push(q),q=J;do{switch(q.tag){case 3:q.flags|=65536,c&=-c,q.lanes|=c;var he=vb(q,pe,c);$2(q,he);break e;case 1:ae=pe;var se=q.type,ve=q.stateNode;if(!(q.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(Ia===null||!Ia.has(ve)))){q.flags|=65536,c&=-c,q.lanes|=c;var je=mb(q,ae,c);$2(q,je);break e}}q=q.return}while(q!==null)}Zb(A)}catch(Ye){c=Ye,ir===A&&A!==null&&(ir=A=A.return);continue}break}while(!0)}function Yb(){var s=Lf.current;return Lf.current=_f,s===null?_f:s}function l1(){(ur===0||ur===3||ur===2)&&(ur=4),_r===null||!(Io&268435455)&&!(Nf&268435455)||Fa(_r,Cr)}function Bf(s,c){var A=dt;dt|=2;var N=Yb();(_r!==s||Cr!==c)&&(ra=null,Do(s,c));do try{fE();break}catch(j){Kb(s,j)}while(!0);if(v0(),dt=A,Lf.current=N,ir!==null)throw Error(o(261));return _r=null,Cr=0,ur}function fE(){for(;ir!==null;)Xb(ir)}function dE(){for(;ir!==null&&!FS();)Xb(ir)}function Xb(s){var c=e3(s.alternate,s,_n);s.memoizedProps=s.pendingProps,c===null?Zb(s):ir=c,Q0.current=null}function Zb(s){var c=s;do{var A=c.alternate;if(s=c.return,c.flags&32768){if(A=aE(A,c),A!==null){A.flags&=32767,ir=A;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ur=6,ir=null;return}}else if(A=iE(A,c,_n),A!==null){ir=A;return}if(c=c.sibling,c!==null){ir=c;return}ir=c=s}while(c!==null);ur===0&&(ur=5)}function jo(s,c,A){var N=bt,j=tr.transition;try{tr.transition=null,bt=1,hE(s,c,A,N)}finally{tr.transition=j,bt=N}return null}function hE(s,c,A,N){do Fo();while(Da!==null);if(dt&6)throw Error(o(327));A=s.finishedWork;var j=s.finishedLanes;if(A===null)return null;if(s.finishedWork=null,s.finishedLanes=0,A===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var q=A.lanes|A.childLanes;if(jS(s,q),s===_r&&(ir=_r=null,Cr=0),!(A.subtreeFlags&2064)&&!(A.flags&2064)||Df||(Df=!0,t3(s0,function(){return Fo(),null})),q=(A.flags&15990)!==0,A.subtreeFlags&15990||q){q=tr.transition,tr.transition=null;var J=bt;bt=1;var ae=dt;dt|=4,Q0.current=null,lE(s,A),zb(A,s),T(s.containerInfo),s.current=A,sE(A),zS(),dt=ae,bt=J,tr.transition=q}else s.current=A;if(Df&&(Df=!1,Da=s,jf=j),q=s.pendingLanes,q===0&&(Ia=null),HS(A.stateNode),on(s,yr()),c!==null)for(N=s.onRecoverableError,A=0;A<c.length;A++)j=c[A],N(j.value,{componentStack:j.stack,digest:j.digest});if(If)throw If=!1,s=r1,r1=null,s;return jf&1&&s.tag!==0&&Fo(),q=s.pendingLanes,q&1?s===n1?wu++:(wu=0,n1=s):wu=0,xi(),null}function Fo(){if(Da!==null){var s=T2(jf),c=tr.transition,A=bt;try{if(tr.transition=null,bt=16>s?16:s,Da===null)var N=!1;else{if(s=Da,Da=null,jf=0,dt&6)throw Error(o(331));var j=dt;for(dt|=4,Be=s.current;Be!==null;){var q=Be,J=q.child;if(Be.flags&16){var ae=q.deletions;if(ae!==null){for(var pe=0;pe<ae.length;pe++){var Te=ae[pe];for(Be=Te;Be!==null;){var Ge=Be;switch(Ge.tag){case 0:case 11:case 15:mu(8,Ge,q)}var nt=Ge.child;if(nt!==null)nt.return=Ge,Be=nt;else for(;Be!==null;){Ge=Be;var De=Ge.sibling,Ft=Ge.return;if(Ib(Ge),Ge===Te){Be=null;break}if(De!==null){De.return=Ft,Be=De;break}Be=Ft}}}var At=q.alternate;if(At!==null){var ln=At.child;if(ln!==null){At.child=null;do{var na=ln.sibling;ln.sibling=null,ln=na}while(ln!==null)}}Be=q}}if(q.subtreeFlags&2064&&J!==null)J.return=q,Be=J;else e:for(;Be!==null;){if(q=Be,q.flags&2048)switch(q.tag){case 0:case 11:case 15:mu(9,q,q.return)}var he=q.sibling;if(he!==null){he.return=q.return,Be=he;break e}Be=q.return}}var se=s.current;for(Be=se;Be!==null;){J=Be;var ve=J.child;if(J.subtreeFlags&2064&&ve!==null)ve.return=J,Be=ve;else e:for(J=se;Be!==null;){if(ae=Be,ae.flags&2048)try{switch(ae.tag){case 0:case 11:case 15:Cf(9,ae)}}catch(Ye){$t(ae,ae.return,Ye)}if(ae===J){Be=null;break e}var je=ae.sibling;if(je!==null){je.return=ae.return,Be=je;break e}Be=ae.return}}if(dt=j,xi(),Oi&&typeof Oi.onPostCommitFiberRoot=="function")try{Oi.onPostCommitFiberRoot(nf,s)}catch{}N=!0}return N}finally{bt=A,tr.transition=c}}return!1}function Qb(s,c,A){c=zl(A,c),c=vb(s,c,1),s=Na(s,c,1),c=jr(),s!==null&&(au(s,1,c),on(s,c))}function $t(s,c,A){if(s.tag===3)Qb(s,s,A);else for(;c!==null;){if(c.tag===3){Qb(c,s,A);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Ia===null||!Ia.has(N))){s=zl(A,s),s=mb(c,s,1),c=Na(c,s,1),s=jr(),c!==null&&(au(c,1,s),on(c,s));break}}c=c.return}}function pE(s,c,A){var N=s.pingCache;N!==null&&N.delete(c),c=jr(),s.pingedLanes|=s.suspendedLanes&A,_r===s&&(Cr&A)===A&&(ur===4||ur===3&&(Cr&130023424)===Cr&&500>yr()-e1?Do(s,0):J0|=A),on(s,c)}function Jb(s,c){c===0&&(s.mode&1?(c=tf,tf<<=1,!(tf&130023424)&&(tf=4194304)):c=1);var A=jr();s=Pi(s,c),s!==null&&(au(s,c,A),on(s,A))}function gE(s){var c=s.memoizedState,A=0;c!==null&&(A=c.retryLane),Jb(s,A)}function vE(s,c){var A=0;switch(s.tag){case 13:var N=s.stateNode,j=s.memoizedState;j!==null&&(A=j.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),Jb(s,A)}var e3;e3=function(s,c,A){if(s!==null)if(s.memoizedProps!==c.pendingProps||tn.current)nn=!0;else{if(!(s.lanes&A)&&!(c.flags&128))return nn=!1,nE(s,c,A);nn=!!(s.flags&131072)}else nn=!1,Ht&&c.flags&1048576&&M2(c,lf,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Ef(s,c),s=c.pendingProps;var j=Al(c,Lr.current);Dl(c,A),j=C0(null,c,N,s,j,A);var q=k0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,rn(N)?(q=!0,Jc(c)):q=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=wf,c.stateNode=j,j._reactInternals=c,N0(c,N,s,A),c=F0(null,c,N,!0,q,A)):(c.tag=0,Ht&&q&&c0(c),Gr(null,c,j,A),c=c.child),c;case 16:N=c.elementType;e:{switch(Ef(s,c),s=c.pendingProps,j=N._init,N=j(N._payload),c.type=N,j=c.tag=yE(N),s=ri(N,s),j){case 0:c=j0(null,c,N,s,A);break e;case 1:c=Pb(null,c,N,s,A);break e;case 11:c=wb(null,c,N,s,A);break e;case 14:c=Sb(null,c,N,ri(N.type,s),A);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),j0(s,c,N,j,A);case 1:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),Pb(s,c,N,j,A);case 3:e:{if(Cb(c),s===null)throw Error(o(387));N=c.pendingProps,q=c.memoizedState,j=q.element,H2(s,c),pf(c,N,null,A);var J=c.memoizedState;if(N=J.element,ne&&q.isDehydrated)if(q={element:N,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=q,c.memoizedState=q,c.flags&256){j=zl(Error(o(423)),c),c=kb(s,c,N,A,j);break e}else if(N!==j){j=zl(Error(o(424)),c),c=kb(s,c,N,A,j);break e}else for(ne&&(Dn=Et(c.stateNode.containerInfo),bn=c,Ht=!0,ti=null,ou=!1),A=z2(c,null,N,A),c.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(Ll(),N===j){c=ta(s,c,A);break e}Gr(s,c,N,A)}c=c.child}return c;case 5:return V2(c),s===null&&h0(c),N=c.type,j=c.pendingProps,q=s!==null?s.memoizedProps:null,J=j.children,K(N,j)?J=null:q!==null&&K(N,q)&&(c.flags|=32),xb(s,c),Gr(s,c,J,A),c.child;case 6:return s===null&&h0(c),null;case 13:return Tb(s,c,A);case 4:return w0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=Nl(c,null,N,A):Gr(s,c,N,A),c.child;case 11:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),wb(s,c,N,j,A);case 7:return Gr(s,c,c.pendingProps,A),c.child;case 8:return Gr(s,c,c.pendingProps.children,A),c.child;case 12:return Gr(s,c,c.pendingProps.children,A),c.child;case 10:e:{if(N=c.type._context,j=c.pendingProps,q=c.memoizedProps,J=j.value,B2(c,N,J),q!==null)if(ei(q.value,J)){if(q.children===j.children&&!tn.current){c=ta(s,c,A);break e}}else for(q=c.child,q!==null&&(q.return=c);q!==null;){var ae=q.dependencies;if(ae!==null){J=q.child;for(var pe=ae.firstContext;pe!==null;){if(pe.context===N){if(q.tag===1){pe=ea(-1,A&-A),pe.tag=2;var Te=q.updateQueue;if(Te!==null){Te=Te.shared;var Ge=Te.pending;Ge===null?pe.next=pe:(pe.next=Ge.next,Ge.next=pe),Te.pending=pe}}q.lanes|=A,pe=q.alternate,pe!==null&&(pe.lanes|=A),y0(q.return,A,c),ae.lanes|=A;break}pe=pe.next}}else if(q.tag===10)J=q.type===c.type?null:q.child;else if(q.tag===18){if(J=q.return,J===null)throw Error(o(341));J.lanes|=A,ae=J.alternate,ae!==null&&(ae.lanes|=A),y0(J,A,c),J=q.sibling}else J=q.child;if(J!==null)J.return=q;else for(J=q;J!==null;){if(J===c){J=null;break}if(q=J.sibling,q!==null){q.return=J.return,J=q;break}J=J.return}q=J}Gr(s,c,j.children,A),c=c.child}return c;case 9:return j=c.type,N=c.pendingProps.children,Dl(c,A),j=jn(j),N=N(j),c.flags|=1,Gr(s,c,N,A),c.child;case 14:return N=c.type,j=ri(N,c.pendingProps),j=ri(N.type,j),Sb(s,c,N,j,A);case 15:return Eb(s,c,c.type,c.pendingProps,A);case 17:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),Ef(s,c),c.tag=1,rn(N)?(s=!0,Jc(c)):s=!1,Dl(c,A),pb(c,N,j),N0(c,N,j,A),F0(null,c,N,!0,s,A);case 19:return Rb(s,c,A);case 22:return Ob(s,c,A)}throw Error(o(156,c.tag))};function t3(s,c){return o0(s,c)}function mE(s,c,A,N){this.tag=s,this.key=A,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 Un(s,c,A,N){return new mE(s,c,A,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===v)return 14}return 2}function za(s,c){var A=s.alternate;return A===null?(A=Un(s.tag,c,s.key,s.mode),A.elementType=s.elementType,A.type=s.type,A.stateNode=s.stateNode,A.alternate=s,s.alternate=A):(A.pendingProps=c,A.type=s.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=s.flags&14680064,A.childLanes=s.childLanes,A.lanes=s.lanes,A.child=s.child,A.memoizedProps=s.memoizedProps,A.memoizedState=s.memoizedState,A.updateQueue=s.updateQueue,c=s.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},A.sibling=s.sibling,A.index=s.index,A.ref=s.ref,A}function Uf(s,c,A,N,j,q){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 p:return zo(A.children,j,q,c);case E:J=8,j|=8;break;case w:return s=Un(12,A,c,j|2),s.elementType=w,s.lanes=q,s;case g:return s=Un(13,A,c,j),s.elementType=g,s.lanes=q,s;case h:return s=Un(19,A,c,j),s.elementType=h,s.lanes=q,s;case y:return Hf(A,j,q,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case m:J=10;break e;case S:J=9;break e;case b:J=11;break e;case v:J=14;break e;case d:J=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Un(J,A,c,j),c.elementType=s,c.type=N,c.lanes=q,c}function zo(s,c,A,N){return s=Un(7,s,N,c),s.lanes=A,s}function Hf(s,c,A,N){return s=Un(22,s,N,c),s.elementType=y,s.lanes=A,s.stateNode={isHidden:!1},s}function u1(s,c,A){return s=Un(6,s,null,c),s.lanes=A,s}function c1(s,c,A){return c=Un(4,s.children!==null?s.children:[],s.key,c),c.lanes=A,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function bE(s,c,A,N,j){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=j,ne&&(this.mutableSourceEagerHydrationData=null)}function r3(s,c,A,N,j,q,J,ae,pe){return s=new bE(s,c,A,ae,pe),c===1?(c=1,q===!0&&(c|=8)):c=0,q=Un(3,null,null,c),s.current=q,q.stateNode=s,q.memoizedState={element:N,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(q),s}function n3(s){if(!s)return Ma;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(rn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var A=s.type;if(rn(A))return P2(s,A,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 A=s.retryLane;s.retryLane=A!==0&&A<c?A:c}}function $f(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=Pi(s,134217728);if(c!==null){var A=jr();Bn(c,s,134217728,A)}$f(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=Pi(s,1);if(c!==null){var A=jr();Bn(c,s,1,A)}$f(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=ja(s),A=Pi(s,c);if(A!==null){var N=jr();Bn(A,s,c,N)}$f(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var A=iu(c.pendingLanes);A!==0&&(a0(c,A|1),on(c,yr()),!(dt&6)&&(Hl(),xi()))}break;case 13:Wb(function(){var N=Pi(s,1);if(N!==null){var j=jr();Bn(N,s,1,j)}}),$f(s,1)}},r.batchedUpdates=function(s,c){var A=dt;dt|=1;try{return s(c)}finally{dt=A,dt===0&&(Hl(),af&&xi())}},r.createComponentSelector=function(s){return{$$typeof:kf,value:s}},r.createContainer=function(s,c,A,N,j,q,J){return r3(s,c,!1,null,A,N,j,q,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Tf,value:s}},r.createHydrationContainer=function(s,c,A,N,j,q,J,ae,pe){return s=r3(A,N,!0,s,j,q,J,ae,pe),s.context=n3(null),A=s.current,N=jr(),j=ja(A),q=ea(N,j),q.callback=c??null,Na(A,q,j),s.current.lanes=j,au(s,j,N),on(s,N),s},r.createPortal=function(s,c,A){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:A}},r.createRoleSelector=function(s){return{$$typeof:Af,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Rf,value:s}},r.createTextSelector=function(s){return{$$typeof:Mf,value:s}},r.deferredUpdates=function(s){var c=bt,A=tr.transition;try{return tr.transition=null,bt=16,s()}finally{bt=c,tr.transition=A}},r.discreteUpdates=function(s,c,A,N,j){var q=bt,J=tr.transition;try{return tr.transition=null,bt=1,s(c,A,N,j)}finally{bt=q,tr.transition=J,dt===0&&Hl()}},r.findAllNodes=Z0,r.findBoundingRects=function(s,c){if(!_e)throw Error(o(363));c=Z0(s,c),s=[];for(var A=0;A<c.length;A++)s.push(re(c[A]));for(c=s.length-1;0<c;c--){A=s[c];for(var N=A.x,j=N+A.width,q=A.y,J=q+A.height,ae=c-1;0<=ae;ae--)if(c!==ae){var pe=s[ae],Te=pe.x,Ge=Te+pe.width,nt=pe.y,De=nt+pe.height;if(N>=Te&&q>=nt&&j<=Ge&&J<=De){s.splice(c,1);break}else if(N!==Te||A.width!==pe.width||De<q||nt>J){if(!(q!==nt||A.height!==pe.height||Ge<N||Te>j)){Te>N&&(pe.width+=Te-N,pe.x=N),Ge<j&&(pe.width=j-Te),s.splice(c,1);break}}else{nt>q&&(pe.height+=nt-q,pe.y=q),De<J&&(pe.height=J-nt),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=dt;dt|=1;var A=tr.transition,N=bt;try{tr.transition=null,bt=1,s()}finally{bt=N,tr.transition=A,dt=c,dt===0&&(Hl(),xi())}},r.flushPassiveEffects=Fo,r.flushSync=Wb,r.focusWithin=function(s,c){if(!_e)throw Error(o(363));for(s=K0(s),c=Gb(s,c),c=Array.from(c),s=0;s<c.length;){var A=c[s++];if(!ye(A)){if(A.tag===5&&$e(A.stateNode))return!0;for(A=A.child;A!==null;)c.push(A),A=A.sibling}}return!1},r.getCurrentUpdatePriority=function(){return bt},r.getFindAllNodesFailureDescription=function(s,c){if(!_e)throw Error(o(363));var A=0,N=[];s=[K0(s),0];for(var j=0;j<s.length;){var q=s[j++],J=s[j++],ae=c[J];if((q.tag!==5||!ye(q))&&(Y0(q,ae)&&(N.push(X0(ae)),J++,J>A&&(A=J)),J<c.length))for(q=q.child;q!==null;)s.push(q,J),q=q.sibling}if(A<c.length){for(s=[];A<c.length;A++)s.push(X0(c[A]));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 Z(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{nf=c.inject(s),Oi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,A,N){if(!_e)throw Error(o(363));s=Z0(s,c);var j=Qe(s,A,N).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var A=c._getVersion;A=A(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,A]:s.mutableSourceEagerHydrationData.push(c,A)},r.runWithPriority=function(s,c){var A=bt;try{return bt=s,c()}finally{bt=A}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,A,N){var j=c.current,q=jr(),J=ja(j);return A=n3(A),c.context===null?c.context=A:c.pendingContext=A,c=ea(q,J),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=Na(j,c,J),s!==null&&(Bn(s,j,J,q),hf(s,j,J)),J},r};j9.exports=bM;var _M=j9.exports;const wM=xh(_M);var F9={exports:{}},El={};/**
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
+ */El.ConcurrentRoot=1;El.ContinuousEventPriority=4;El.DefaultEventPriority=16;El.DiscreteEventPriority=1;El.IdleEventPriority=536870912;El.LegacyRoot=0;F9.exports=El;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 Vp(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 p=B9||t._useStrictMode,E={},w=!1;const m={};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]&&(m[u]=t[a])}!o&&(t[a]!==r[a]||p&&t[a]!==e.getAttr(a))&&(w=!0,E[a]=t[a])}w&&(e.setAttrs(E),xo(e));for(var u in m)e.on(u+Yy,m[u])}function xo(e){if(!ut.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const U9={},PM={};wc.Node.prototype._applyProps=Vp;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),xo(e)}function kM(e,t,r){let n=wc[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=wc.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 Vp(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),xo(e)}function KM(e,t){t.parent===e?t.moveToTop():e.add(t),xo(e)}function H9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),xo(e)}function YM(e,t,r){H9(e,t,r)}function XM(e,t){t.destroy(),t.off(Yy),xo(e)}function ZM(e,t){t.destroy(),t.off(Yy),xo(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){Vp(e,i,n)}function tL(e){e.hide(),xo(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:zu.unstable_IdlePriority,insertBefore:H9,insertInContainerBefore:YM,isPrimaryRenderer:GM,noTimeout:HM,now:zu.unstable_now,prepareForCommit:MM,preparePortalMount:LM,prepareUpdate:NM,removeChild:XM,removeChildFromContainer:ZM,resetAfterCommit:IM,resetTextContent:DM,run:zu.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")?Ze.useLayoutEffect:Ze.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(Ze.createContext(null));class V9 extends Ze.Component{render(){return Ze.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function gL(){const e=Ze.useContext(Xy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Ze.useId();return Ze.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]=Ze.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,Ze.useContext(G9(i)))}r=r.return}return t}function q9(){const e=vL();return Ze.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>Ze.createElement(t,null,Ze.createElement(r.Provider,pL(v4({},n),{value:e.get(r)}))),t=>Ze.createElement(V9,v4({},t))),[e])}function mL(e){const t=ht.useRef({});return ht.useLayoutEffect(()=>{t.current=e}),ht.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const yL=e=>{const t=ht.useRef(),r=ht.useRef(),n=ht.useRef(),i=mL(e),a=q9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return ht.useLayoutEffect(()=>(r.current=new wc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=us.createContainer(r.current,z9.LegacyRoot,!1,null),us.updateContainer(ht.createElement(a,{},e.children),n.current),()=>{wc.isBrowser&&(o(null),us.updateContainer(null,n.current,null),r.current.destroy())}),[]),ht.useLayoutEffect(()=>{o(r.current),Vp(r.current,e,i),us.updateContainer(ht.createElement(a,{},e.children),n.current,null)}),ht.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",wh="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",us=wM(sL);us.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ht.version,rendererPackageName:"react-konva"});const BL=ht.forwardRef((e,t)=>ht.createElement(V9,{},ht.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:wh,Image:kL,KonvaRenderer:us,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"})),Ca=po(HL);var Uo=Ze,qp=function(t,r,n){const i=Uo.useRef("loading"),a=Uo.useRef(),[o,l]=Uo.useState(0),u=Uo.useRef(),f=Uo.useRef(),p=Uo.useRef();return(u.current!==t||f.current!==r||p.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,p.current=n),Uo.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){i.current="loaded",a.current=E,l(Math.random())}function m(){i.current="failed",a.current=void 0,l(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",m),r&&(E.crossOrigin=r),n&&(E.referrerPolicy=n),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",m)}},[t,r,n]),[a.current,i.current]};const $L=xh(qp);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=ht.useRef(e);return t.current=e,ht.useCallback((...r)=>t.current.apply(null,r),[])}const qL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=q9(),o=ht.useRef(null);ht.useRef();const[l]=ht.useState(()=>document.createElement("div")),u=ht.useMemo(()=>Dd.createRoot(l),[l]),f=n??!0,p=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,m=GL(E,["style"]);Object.assign(l.style,w),Object.assign(l,m)});return ht.useLayoutEffect(()=>{var E;const w=o.current;if(!w)return;const m=(E=w.getStage())===null||E===void 0?void 0:E.container();if(m)return m.appendChild(l),f&&VL(m)&&(m.style.position="relative"),w.on("absoluteTransformChange",p),p(),()=>{var S;w.off("absoluteTransformChange",p),(S=l.parentNode)===null||S===void 0||S.removeChild(l)}},[f]),ht.useLayoutEffect(()=>{p()},[r,i]),ht.useLayoutEffect(()=>{u.render(ht.createElement(a,null,e))}),ht.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),ht.createElement(wh,Object.assign({ref:o},t))},WL=({selector:e,enabled:t,children:r})=>{const n=ht.useRef(null),i=ht.useRef(null),a=ht.useRef(),o=t??!0;return ht.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 p=u.getLayer();if(!p)return;p.batchDraw()}},[e,o]),ht.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ht.createElement(wh,{name:"_outer_portal",ref:n},ht.createElement(wh,{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"})),qc=po(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),m=_4(l.values,E.values),S=_4(l.values,w.values),b=S-m,g=b*(180/Math.PI),h=JL(l,E,w),v=Math.abs(eN(b/2,h/2)),d=Math.min(t,v),y=tN(b,d),_=y.offset,R=y.sweepFlag,C=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const x=[l.values.x+S4(m,_),l.values.y+E4(m,_)],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(x[0].toFixed(3)),y:parseFloat(x[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:g,largeArc:0,sweep:R,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=po(iN);var Wc={},Qy={},Jy={},Ol=Ol||{};Ol.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 Ol=Ol||{};Ol.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 B=new Error(t+": "+W);throw B.source=t,B}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,B,F){return l(B,function(T){var L=F();return L&&(G(e.comma)||r("Missing comma before color stops")),{type:W,orientation:L,colorStops:d(y)}})}function l(W,B){var F=G(W);if(F){G(e.startCall)||r("Missing (");var T=B(F);return G(e.endCall)||r("Missing )"),T}}function u(){return f()||p()}function f(){return H("directional",e.sideOrCorner,1)}function p(){return H("angular",e.angleValue,1)}function E(){var W,B=w(),F;return B&&(W=[],W.push(B),F=t,G(e.comma)&&(B=w(),B?W.push(B):t=F)),W}function w(){var W=m()||S();if(W)W.at=g();else{var B=b();if(B){W=B;var F=g();F&&(W.at=F)}else{var T=h();T&&(W={type:"default-radial",at:T})}}return W}function m(){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 g(){if(H("position",/^at/,0)){var W=h();return W||r("Missing positioning value"),W}}function h(){var W=v();if(W.x||W.y)return{type:"position",value:W}}function v(){return{x:k(),y:k()}}function d(W){var B=W(),F=[];if(B)for(F.push(B);G(e.comma);)B=W(),B?F.push(B):r("One extra comma");return F}function y(){var W=_();return W||r("Expected color definition"),W.length=k(),W}function _(){return C()||O()||x()||R()}function R(){return H("literal",e.literalColor,0)}function C(){return H("hex",e.hexColor,1)}function x(){return l(e.rgbColor,function(){return{type:"rgb",value:d(P)}})}function O(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(P)}})}function P(){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,B,F){var T=G(B);if(T)return{type:W,value:T[F]}}function G(W){var B,F;return F=/^[\n\r\t\s]+/.exec(t),F&&Z(F[0].length),B=W.exec(t),B&&Z(B[0].length),B}function Z(W){t=t.substr(W)}return function(W){return t=W.toString(),n()}}();Jy.parse=Ol.parse;Jy.stringify=Ol.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,p,E,w){w===void 0&&(w=E);var m=Object.getOwnPropertyDescriptor(p,E);m&&!("get"in m?!p.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return p[E]}}),Object.defineProperty(f,w,m)}:function(f,p,E,w){w===void 0&&(w=E),f[w]=p[E]}),r=me&&me.__setModuleDefault||(Object.create?function(f,p){Object.defineProperty(f,"default",{enumerable:!0,value:p})}:function(f,p){f.default=p}),n=me&&me.__importStar||function(f){if(f&&f.__esModule)return f;var p={};if(f!=null)for(var E in f)E!=="default"&&Object.prototype.hasOwnProperty.call(f,E)&&t(p,f,E);return r(p,f),p},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(Ze),o=n(Qy),l=i(Si),u=(f,p=f.fill,E="fill")=>a.default.useMemo(()=>{if(!o.isGradient(p))return{[E]:p};const{stops:w,rotation:m}=o.parseColor(p),S={x:f.a.width/2,y:f.a.height/2},b=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),g=l.default.Util.degToRad(m)-Math.PI/2,h=[];return w.forEach(({offset:v,color:d})=>{h.push(v,d)}),E==="fill"?{fillLinearGradientStartPointX:S.x-b*Math.cos(g),fillLinearGradientStartPointY:S.y-b*Math.sin(g),fillLinearGradientColorStops:h,fillLinearGradientEndPointX:S.x+b*Math.cos(g),fillLinearGradientEndPointY:S.y+b*Math.sin(g),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-b*Math.cos(g),strokeLinearGradientStartPointY:S.y-b*Math.sin(g),strokeLinearGradientColorStops:h,strokeLinearGradientEndPointX:S.x+b*Math.cos(g),strokeLinearGradientEndPointY:S.y+b*Math.sin(g)}},[p,f.width,f.height]);e.useColor=u})(Wc);var $i={},xl={};(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(Ze),n=t(Si);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const p=r.default.useRef();r.default.useLayoutEffect(()=>{p.current&&p.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const E=u.current.opacity();return E?(u.current.opacity(0),p.current=new n.default.Tween({node:u.current,opacity:E,onFinish:()=>{var w;(w=p.current)===null||w===void 0||w.destroy()}}),p.current.play(),()=>{var w;(w=p.current)===null||w===void 0||w.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(xl);(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=xl;let r=0,n=[],i=3e4;const a=h=>{i=h};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=h=>{l=h};e.setFontLoadTimeout=u;const f=()=>l;function p(h){r+=1;let v=!1;const d=setTimeout(()=>{v||(g(`Timeout loading asset ${h}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",h),v=!0,E())},i);return()=>{v||(clearTimeout(d),E())}}function E(){r-=1,r===0&&(n.forEach(h=>h()),n=[])}function w(h){r===0?h():n.push(h)}function m(){return new Promise(h=>w(()=>{(0,t.isAnimationUsed)()?setTimeout(h,300):h(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=p,e.decrementLoader=E,e.whenLoaded=m;let S=[];function b(h){S.push(h)}function g(h){S.forEach(v=>v(h))}e.onLoadError=b,e.triggerLoadError=g})($i);var Xs={};(function(e){var t=me&&me.__createBinding||(Object.create?function(I,H,G,Z){Z===void 0&&(Z=G);var W=Object.getOwnPropertyDescriptor(H,G);W&&!("get"in W?!H.__esModule:W.writable||W.configurable)||(W={enumerable:!0,get:function(){return H[G]}}),Object.defineProperty(I,Z,W)}:function(I,H,G,Z){Z===void 0&&(Z=G),I[Z]=H[G]}),r=me&&me.__setModuleDefault||(Object.create?function(I,H){Object.defineProperty(I,"default",{enumerable:!0,value:H})}:function(I,H){I.default=H}),n=me&&me.__importStar||function(I){if(I&&I.__esModule)return I;var H={};if(I!=null)for(var G in I)G!=="default"&&Object.prototype.hasOwnProperty.call(I,G)&&t(H,I,G);return r(H,I),H};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(Ki),a=$i;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(I){I!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...I)):l.value=!1}function p(){return o}function E(I){e.globalFonts.push(I)}function w(I){const H=e.globalFonts.findIndex(G=>G.fontFamily===I);H!==-1&&e.globalFonts.splice(H,1)}function m(I){e.globalFonts.replace(I)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=p,e.globalFonts=i.observable([]),e.addGlobalFont=E,e.removeGlobalFont=w,e.replaceGlobalFonts=m;var S="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",b=document.createElement("canvas");function g(){return v("Arial")}function h(){return v("Times","Times")}function v(I,H="Arial"){var G=b.getContext("2d");return G.font=`normal 40px '${I}', ${H}`,G.measureText(S).width}const d={Arial:!0},y=I=>!!d[I];async function _(I){var H;if(d[I])return;const G=!!(!((H=document.fonts)===null||H===void 0)&&H.load),Z=g();if(G)try{await document.fonts.load(`16px '${I}'`);const T=v(I);if(Z!==T)return void(d[I]=!0)}catch{}const W=h(),B=v(I),F=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let T=0;T<F;T++){const L=v(I,"Arial"),z=v(I,"Times");if(L!==B||L!==Z||z!==W)return void(d[I]=!0);await new Promise(D=>setTimeout(D,60))}console.warn(`Timeout for loading font "${I}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${I}"`)}e.isFontLoaded=y,e.loadFont=_;const R={};let C="400,400italic,700,700italic";function x(I){C=I}function O(){return C}function P(I){if(R[I])return;const H=`https://fonts.googleapis.com/css?family=${I.replace(/ /g,"+")}:${C}`,G=document.createElement("link");G.type="text/css",G.href=H,G.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(G),R[I]=!0}e.setGoogleFontsVariants=x,e.getGoogleFontsVariants=O,e.injectGoogleFont=P;const k={};function M(I){const H=I.fontFamily;if(k[H]||!I.url&&!I.styles)return;const G=document.createElement("style");G.type="text/css";const Z=I.styles||(I.url?[{src:`url("${I.url}")`}]:[]);let W="";Z.forEach(B=>{W+=`
77
+ @font-face {
78
+ font-family: '${H}';
79
+ src: ${B.src};
80
+ font-style: ${B.fontStyle||"normal"};
81
+ font-weight: ${B.fontWeight||"normal"};
82
+ }
83
+ `}),G.innerHTML=W,document.getElementsByTagName("head")[0].appendChild(G),k[I.fontFamily]=!0}e.injectCustomFont=M})(Xs);var Yn={};(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(Ki);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})})(Yn);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 Kc={};(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(Si);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})(Kc);var Pl={};(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(Ze),n=_i,i=Ca,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)))})(Pl);var Po={};(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(Ze);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})(Po);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 Dt(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(p){return u([f,p])}}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(p){f=[6,p],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Zu(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 qi(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 Wi(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 Yc(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 Ls(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){Ls(o||e,r.patches)},undo:function(o){Ls(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function fN(e){var t=Ve(e);if(!t.isRoot)throw new Fe("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function dN(e){var t=Ve(e);if(!t.isRoot)throw new Fe("`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 Fe("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 Fe("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 Fs(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,Zs(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(Ct(r))return t?r2(r)?r:void 0:r;throw new Fe("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(Ct(r))return t?r2(r):!0;throw new Fe("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 Fe("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){Ct(n.storedValue)&&c7(n.storedValue,t)}),t(r.storedValue)}function f7(e){var t;return Ct(e)?t=Yc(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:Tr.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=vc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?lo(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!==Tr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=vc("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===Tr.CREATED){if(this.parent){if(this.parent.state!==Tr.FINALIZED)return;this.fireHook(fr.afterAttach)}this.state=Tr.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=Tr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(fr.beforeDestroy)}}),e}(),Sc=function(e){Dt(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=Tr.DEAD,u}return l.state=Tr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Fe("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===Tr.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);Sc.prototype.die=or(Sc.prototype.die);var DN=1,li;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(li||(li={}));var wn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(wn||(wn={}));var jN={onError:function(e){throw e}},vn=function(e){Dt(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:li.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=dl(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 Fe("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=Zs(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===li.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=li.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===li.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Zu(l),p=f.next();!p.done;p=f.next()){var E=p.value;E.createObservableInstanceIfNeeded(!1)}}catch(b){n={error:b}}finally{try{p&&!p.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=Tr.DEAD,b}finally{this._isRunningAction=!1}if(this._observableInstanceState=li.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ds,this.state=Tr.CREATED,r){this.fireHook(fr.afterCreate),this.finalizeCreation();try{for(var m=Zu(l.reverse()),S=m.next();!S.done;S=m.next()){var E=S.value;E.fireHook(fr.afterCreate),E.finalizeCreation()}}catch(b){a={error:b}}finally{try{S&&!S.done&&(o=m.return)&&o.call(m)}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=Tr.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"&&(Cs?Cs(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===li.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 Fe(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&&lo(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===li.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(Ds),this._autoUnbox=!1;try{return this._observableInstanceState===li.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 Fe("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=Zu(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 Fe("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=Ec(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Fs(i.path),o=P7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Ec(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Zo(this.storedValue,"$treenode",this),Zo(this.storedValue,"toJSON",aI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==li.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=qi(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 Fe("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 Fe("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,Wi([r],qi(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);vn.prototype.createObservableInstance=or(vn.prototype.createObservableInstance);vn.prototype.detach=or(vn.prototype.detach);vn.prototype.die=or(vn.prototype.die);var h7,at;(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"})(at||(at={}));var p7="cannotDetermine",FN=Symbol("$type"),wa=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 ga(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 Fe("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=Yc(t);return this.isAssignableFrom(i)?mn():yn(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 Fe("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 Fe("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 Fe("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 Fe("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;wa.prototype.create=or(wa.prototype.create);var Ns=function(e){Dt(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===Zs(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||Ct(n)&&Ve(n)===r?!0:r.type===this&&k7(n)&&!Ct(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(),Ct(n)&&this.isAssignableFrom(Yc(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}(wa);Ns.prototype.create=or(Ns.prototype.create);var Cl=function(e){Dt(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}(wa);function pr(e){return typeof e=="object"&&e&&e.isType===!0}var Li=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),Li.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Li.get(r.id).async===!1&&(Li.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Li.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Li.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Li.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Li.get(r.rootId);return Li.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Li.get(r.rootId);return Li.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 p=void 0;try{p=i(n)}catch(w){throw t.delete(n.id),f.finish(w),w}return f.hasFlowsPending||(t.delete(n.id),f.finish()),p}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(js(n))return n;if(Ct(n))return yd("[MSTNode: ".concat(Yc(n).name,"]"));if(typeof n=="function")return yd("[function]");if(typeof n=="object"&&!Ko(n)&&!l2(n))return yd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return yd(""+i)}}function $N(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function yd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function g7(e,t){Cs(function(){s2(t).forEach(function(r){return GN(e,r)})})}function GN(e,t){var r=u7(e,t.path||"");if(!r)throw new Fe("Invalid action path: ".concat(t.path||""));var n=Ve(r);if(t.name==="@APPLY_PATCHES")return Ls.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 Fe("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,p){return HN(o,i.name,p,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var qN=1,Qu;function n2(){return Qu}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=Qu;Qu=e;try{return YN(r,e,t)}finally{Qu=i,r._isRunningAction=n}}function y7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Ec(e,t,r){var n=function(){var i=m7(),a=Qu,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?Wi(Wi([],qi(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 or(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return or(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 p(E){i=E}return u(o,f,p),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:"",">"):Ct(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=Ct(t)?"value of type ".concat(Ve(t).type.name,":"):js(t)?"value":"snapshot",o=r&&Ct(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)||js(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 mn(){return Is}function yn(e,t,r){return[{context:e,value:t,message:r}]}function Wp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ga(e,t){mI()&&S7(e,t)}function S7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Fe(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([],Kp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Fe("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=qi(a,2),l=o[0],u=o[1],f=!1,p=u.length-1;p>=0;p--){var E=u[p];(E===t||E.path.indexOf(i)===0)&&(n.addNodeToCache(E,!1),u.splice(p,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 Fe("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 Fe("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 vn(e,t,r,n,i)}function Co(e,t,r,n,i){return new Sc(e,t,r,n,i)}function iI(e){return e instanceof Sc||e instanceof vn}var Tr;(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"})(Tr||(Tr={}));function Ct(e){return!!(e&&e.$treenode)}function Ve(e){if(!Ct(e))throw new Fe("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 Fe("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=Fs(e.path),n=Fs(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(oI).join("/")+Sh(n.slice(i))}function x7(e,t,r){return r===void 0&&(r=!0),P7(e,Fs(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 Sc){var o=n.value;Ct(o)&&(n=Ve(o))}if(n instanceof vn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Fe("Could not resolve '".concat(a,"' in path '").concat(Sh(t.slice(0,i))||"/","' while resolving '").concat(Sh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function C7(e){if(!e)return Is;var t=Object.keys(e);if(!t.length)return Is;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(),Is=Object.freeze([]),Ds=Object.freeze({}),Kp=g8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Kp);var Fe=function(e){Dt(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)||Xr(e)}function s2(e){return e?l2(e)?e:[e]:Is}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 Ko(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 js(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){Or(e)?Py(e,t,r):Object.defineProperty(e,t,r)}function Zo(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,Wi([],qi(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,Wi([],qi(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,Wi([],qi(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 Fe("a mst flow must always have a parent context");var o=y7(a);if(!o)throw new Fe("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:Wi(Wi([],qi(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(p,E,w){return p.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:E,args:[w]}),p)}return new Promise(function(p,E){var w,m=function(){w=t.apply(null,arguments),S(void 0)};m.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:"flow_spawn",args:R7(u)}),m);function S(h){var v;try{var d=f(function(y){v=w.next(y)},"flow_resume",h);d instanceof Error&&(v=w.throw(d))}catch(y){rg(function(){f(function(_){E(y)},"flow_throw",y)});return}g(v)}function b(h){var v;try{f(function(d){v=w.throw(d)},"flow_resume_error",h)}catch(d){rg(function(){f(function(y){E(d)},"flow_throw",d)});return}g(v)}function g(h){if(h.done){rg(function(){f(function(v){p(v)},"flow_return",h.value)});return}if(!h.value||typeof h.value.then!="function")throw new Fe("Only promises can be yielded to `async`, got: "+h);return h.value.then(S,b)}})};return r._isFlowAction=!0,r}function SI(e){if(!("oldValue"in e))throw new Fe("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 lo(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 Sh(e){if(e.length===0)return"";var t=function(r){return r.map(lo).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Fs(e){var t=e.split("/").map(N7),r=e===""||e==="."||e===".."||tg(e,"/")||tg(e,"./")||tg(e,"../");if(!r)throw new Fe("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){Dt(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|at.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 vn&&(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=Ct(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,Ct(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?yn(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:Ct(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 Ns))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(wa);function CI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Zu(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=Zu(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 Oc&&t.push(e),!0}var Ka;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Ka||(Ka={}));var TI=function(e){Dt(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 Fe("Map.put cannot be used to set empty values");if(Ct(r)){var n=Ve(r);if(n.identifier===null)throw new Fe(P4);return this.set(n.identifier,r),r}else if(k7(r)){var i=Ve(this),a=i.type;if(a.identifierMode!==Ka.YES)throw new Fe(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=Zs(l);return this.set(f,r),this.get(f)}else throw new Fe("Map.put can only be used to store complex values")}}),t}(Qh),Eh=function(e){Dt(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:Ka.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:at.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===Ka.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 Fe("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=Ka.YES,this.mapIdentifierAttribute=n):this.identifierMode=Ka.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=Ec(n,l,u);Zo(n,l,f)})}),Yh(n,this.willChange),Zh(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 Fe("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;ga(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ga(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===Ka.YES&&n instanceof vn){var i=n.identifier;if(i!==r)throw new Fe("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:lo(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:lo(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:lo(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){ga(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 Ko(r)?Wp(Object.keys(r).map(function(a){return i._subType.validate(r[a],a2(n,a,i._subType))})):yn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ds}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Ns);Eh.prototype.applySnapshot=or(Eh.prototype.applySnapshot);function AI(e){return new Eh("Map<string, ".concat(e.name,">"),e)}function RI(e){return pr(e)&&(e.flags&at.Map)>0}var Oh=function(e){Dt(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:at.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({},Kp),{name:this.name});return Tt.array(C7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){yi(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=Ec(n,l,u);Zo(n,l,f)})}),Yh(n,this.willChange),Zh(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 Fe("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,p=C4(n,i,a.slice(l,l+u),f,f.map(function(w,m){return l+m}));if(!p)return null;r.added=p;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){ga(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)?Wp(r.map(function(a,o){return i._subType.validate(a,a2(n,""+o,i._subType))})):yn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Is}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Ns);Oh.prototype.applySnapshot=or(Oh.prototype.applySnapshot);function MI(e){return new Oh("".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,p=""+i[o];if(iI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof vn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(k4(u,f))r[o]=ig(t,e,p,f,u);else{for(var w=void 0,m=o;m<r.length;m++)if(k4(r[m],f)){w=r.splice(m,1)[0];break}a=!1;var E=ig(t,e,p,f,w);r.splice(o,0,E)}else{if(Ct(f)&&Ve(f).parent===e)throw new Fe("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(p,"', but it lives already at '").concat(Ve(f).path,"'"));a=!1;var E=ig(t,e,p,f);r.splice(o,0,E)}}return a?null:r}function ig(e,t,r,n,i){ga(e,n);function a(){if(Ct(n)){var l=Ve(n);if(l.assertAlive(Ds),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 vn&&i.createObservableInstanceIfNeeded(),i.die()),o}function k4(e,t){if(!e.isAlive)return!1;if(Ct(t)){var r=Ve(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof vn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ko(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function LI(e){return pr(e)&&(e.flags&at.Array)>0}var T4="preProcessSnapshot",A4="postProcessSnapshot";function NI(){return Ve(this).toString()}var R4={name:"AnonymousModel",properties:{},initializers:Is};function II(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Fe("".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 Fe("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 Fe("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Fe("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(js(o))n[i]=Qo(UI(o),o);else if(o instanceof Eh)n[i]=Qo(o,{});else if(o instanceof Oh)n[i]=Qo(o,[]);else if(!pr(o))throw new Fe("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 Oc=function(e){Dt(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:at.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&at.Identifier){if(r)throw new Fe("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(!Ko(n))throw new Fe("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===T4)throw new Fe("Cannot define action '".concat(T4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===A4)throw new Fe("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 p=Ec(r,i,f);n[i]=p,Zo(r,i,p)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Fe("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(!Ko(n))throw new Fe("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,p=lN(o,["actions","views","state"]);for(var E in p)throw new Fe("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(!Ko(n))throw new Fe("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]=dl,a));else if(typeof o.value=="function")Zo(r,i,o.value);else throw new Fe("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=Ct(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({},Kp),{name:this.name});return Tt.object(r,Ds,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Zo(n,"toString",NI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Yh(n,this.willChange),Zh(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&&(ga(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:lo(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 Fe("Not a value property: "+n);var a=yi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Fe("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=Vi(r.storedValue,o);u.reportObserved()}catch{throw new Fe("".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 Fe("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){ga(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 Ko(a)?Wp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],a2(n,o,i.properties[o]))})):yn(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 Ds}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Ns);Oc.prototype.applySnapshot=or(Oc.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 Oc({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&at.Object)>0}var ka=function(e){Dt(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 Co(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(js(r)&&this.checker(r))return mn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return yn(n,r,"Value is not a ".concat(i))}}),t}(Cl),j7=new ka("string",at.String,function(e){return typeof e=="string"}),F7=new ka("number",at.Number,function(e){return typeof e=="number"}),FI=new ka("integer",at.Integer,function(e){return cI(e)}),zI=new ka("float",at.Float,function(e){return fI(e)}),BI=new ka("finite",at.Finite,function(e){return dI(e)}),z7=new ka("boolean",at.Boolean,function(e){return typeof e=="boolean"}),B7=new ka("null",at.Null,function(e){return e===null}),U7=new ka("undefined",at.Undefined,function(e){return e===void 0}),H7=new ka("Date",at.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 Fe("Cannot determine primitive type from value "+e)}function G7(e){return pr(e)&&(e.flags&(at.String|at.Number|at.Integer|at.Boolean|at.Date))>0}var HI=function(e){Dt(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:at.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Co(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 js(r)&&r===this.value?mn():yn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Cl);function V7(e){return new HI(e)}function $I(e){return pr(e)&&(e.flags&at.Literal)>0}var GI=function(e){Dt(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|at.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=Ct(r)?Ve(r).snapshot:r;return this._predicate(a)?mn():yn(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}(wa);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&at.Refinement)>0}function WI(e,t){var r=typeof e=="string"?t:e,n=Yp.apply(void 0,Wi([],qi(r.map(function(i){return V7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var KI=function(e){Dt(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=at.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 Fe("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 Fe("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 mn();a++}else i.push(u)}return a===1?mn():yn(n,r,"No type is applicable for the union").concat(Wp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(wa);function Yp(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)?Wi([e],qi(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&at.Union)>0}var YI=function(e){Dt(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|at.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"&&ga(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?mn():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}(wa);function XI(e,t){if(typeof t!="function"&&Ct(t))throw new Fe("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Qo(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&at.Optional)>0}var JI=Qo(U7,void 0),eD=Qo(B7,null);function W7(e){return Yp(e,JI)}function tD(e){return Yp(e,eD)}var rD=function(e){Dt(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)|at.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 Fe("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):mn()}}),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}(wa);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&at.Late)>0}function aD(e,t){return new oD(e,t)}var oD=function(e){Dt(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:at.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(or(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=Co(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)?mn():yn(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}(Cl),K7=function(e){Dt(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:at.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 Co(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):mn():yn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Cl),M4=new K7;function lD(e){return arguments.length===0?M4:pr(e)?new K7(e):Qo(M4,e)}function sD(e){return pr(e)&&(e.flags&at.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(Ct(t)){var n=Ve(t);if(!n.identifierAttribute)throw new Fe("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Fe("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Fe("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=Zs(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){Dt(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){Dt(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:at.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)?mn():yn(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){Ls(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){D7(o.type)?this.replaceRef(void 0):Ls(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(p,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,p=f&&f.storedValue;if(f&&f.isAlive&&p){var E=void 0;i?E=!!i.get(n,p):E=r.root.identifierCache.has(a.targetType,Zs(n)),E?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Tr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(fr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(fr.afterAttach,function(){l(!1)}))}}}),t}(Cl),fD=function(e){Dt(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=Ct(a)?s7(a):a,l=new cD(a,this.targetType),u=Co(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=Ct(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){Dt(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=Ct(a)?this.options.set(a,r?r.storedValue:null):a,l=Co(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=Ct(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&at.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){Dt(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:at.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 Oc))throw new Fe("Identifier types can only be instantiated as direct child of a model type");return Co(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 Fe("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?yn(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):mn()}}),t}(Cl),gD=function(e){Dt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:at.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(Z7),vD=function(e){Dt(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&at.Identifier)>0}function Zs(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function _D(e){return new wD(e)}var wD=function(e){Dt(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:at.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 mn();var i=this.options.getValidationMessage(r);return i?yn(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):mn()}}),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 Co(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}(Cl),L4={enumeration:WI,model:DI,compose:jI,custom:_D,reference:X7,safeReference:pD,union:Yp,optional:Qo,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:Ls,applySnapshot:a7,cast:MN,castFlowReturn:yI,castToReferenceSnapshot:NN,castToSnapshot:LN,clone:xN,createActionTrackingMiddleware:zN,createActionTrackingMiddleware2:UN,decorate:WN,destroy:CN,detach:PN,escapeJsonPath:lo,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:Yc,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:Ct,isType:pr,isUnionType:q7,isValidReference:EN,joinJsonPath:Sh,onAction:v7,onPatch:i7,onSnapshot:uN,process:lI,protect:fN,recordActions:VN,recordPatches:cN,resolveIdentifier:wN,resolvePath:_N,setLivelinessChecking:t7,setLivelynessChecking:oN,splitJsonPath:Fs,t:L4,toGenerator:_I,toGeneratorFunction:bI,tryReference:SN,tryResolve:u7,typecheck:S7,types:L4,unescapeJsonPath:N7,unprotect:dN,walk:c7},Symbol.toStringTag,{value:"Module"})),Ei=po(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(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(Ze),n=_i,i=Ca,a=qc,o=Ki,l=t(Si),u=aN,f=Wc,p=$i,E=Xs,w=Yn,m=e2,S=Kc,b=xl,g=Pl,h=Po,v=Ei,d=f2;l.default._fixTextRendering=!0;const y=document.createElement("style");y.type="text/css",document.head.appendChild(y);const _={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function R(T){var L="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+L+"]*?["+L+"]").test(T)}function C(T){T=T.replace(/\s/g,"");let L=0;for(var z=0;z<T.length;z++)R(T[z])&&(L+=1);return L>T.length/2}function x(T){return C(T)?"rtl":"ltr"}e.isRTLText=C,e.getDir=x;const O=(0,n.observer)(({textNodeRef:T,element:L,onBlur:z,selectAll:D,cursorPosition:$})=>{const[K,V]=r.default.useState(_),U=T.current;r.default.useLayoutEffect(()=>{const ee={};ee.width=U.width()-2*U.padding()+"px",ee.height=U.height()-2*U.padding()+U.fontSize()*U.lineHeight()+"px",ee.fontSize=U.fontSize()+"px",ee.lineHeight=U.lineHeight()+.01,ee.fontFamily=U.fontFamily(),ee.textAlign=U.align(),ee.color=U.fill(),ee.fontWeight=L.fontWeight,ee.fontStyle=L.fontStyle,ee.letterSpacing=L.letterSpacing+"em";const ne=`
96
+ .polotno-input::placeholder {
97
+ color: ${K.color};
98
+ opacity: 0.6;
99
+ }
100
+ `;y.innerHTML="",y.appendChild(document.createTextNode(ne)),JSON.stringify(ee)!==JSON.stringify(K)&&V(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=$||ne.value.length;ne.selectionStart=ne.selectionEnd=ie,D&&(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 Q=U.textArr.length*U.lineHeight()*U.fontSize();L.verticalAlign==="middle"&&(X=(L.a.height-Q)/2),L.verticalAlign==="bottom"&&(X=L.a.height-Q);const te=(0,m.removeTags)(L.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:x(te),style:Object.assign(Object.assign(Object.assign({},_),K),{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})}),P=T=>r.default.createElement(a.Html,null,r.default.createElement(O,Object.assign({},T))),k=T=>{const[L,z]=r.default.useState(!1),D=r.default.useRef(!1);return r.default.useEffect(()=>{var $=!0;return setTimeout(()=>{$&&(T._editModeEnabled&&(D.current=!0),z(!0),setTimeout(()=>{D.current=!1},50))},50),()=>{$=!1}},[]),{editorEnabled:L&&T._editModeEnabled,selectAll:D.current}},M=(T,L)=>{const[z,D]=r.default.useReducer(K=>K+1,0),$=r.default.useRef((0,E.isFontLoaded)(L));return r.default.useLayoutEffect(()=>{if($.current=(0,E.isFontLoaded)(L),$.current)return;let K=!0;return(async()=>{$.current=!1,D();const V=(0,p.incrementLoader)(`text ${L}`);await T.loadFont(L),setTimeout(V,100),K&&($.current=!0,D())})(),()=>{K=!1}},[L]),[$.current]};e.useFontLoader=M;const I=({fontLoaded:T,fontFamily:L,fontSize:z,lineHeight:D})=>r.default.useMemo(()=>{if(typeof D=="number")return D;const $=document.createElement("div");$.style.fontFamily=L,$.style.fontSize=z+"px",$.style.lineHeight=D,$.innerText="Test text",document.body.appendChild($);const K=$.offsetHeight;return document.body.removeChild($),K/z},[T,L,z,D]);function H(T){var L=T.getAbsoluteTransform().copy();L.invert();var z=T.getStage().getPointerPosition();return L.point(z)}function G(T){var L;const z=T.target,D=H(z),$=z.textArr,K=Math.floor(D.y/(z.fontSize()*z.lineHeight())),V=$.slice(0,K).reduce((X,Q)=>X+Q.text.length,K),U=(L=$[K])!==null&&L!==void 0?L:$[0];let Y=0;return z.align()==="right"?Y=z.width()-U.width:z.align()==="center"&&(Y=z.width()/2-U.width/2),V+Math.round((D.x-Y)/U.width*U.text.length)}function Z(T){const L=r.default.useRef(T),z=r.default.useRef(T);return r.default.useMemo(()=>{z.current=L.current,L.current=T},[T]),z.current}function W(T){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(T)}function B(T,L){const z=T.fontSize(),D=T.height(),$=(0,m.removeTags)(L.text);let K=L.a.fontSize;T.height(void 0);const V=Math.round(2*L.a.fontSize)-1;for(let U=1;U<V;U++){const Y=L.a.height&&T.height()>L.a.height;let X=$.split(`
101
+ `).join(" ").split(/[\s-]+/).reduce((ee,ne)=>W(ne)?ee.concat(ne.split("")):ee.concat(ne),[]),Q=T.textArr.map(ee=>ee.text).join(";");const te=X.find(ee=>!Q.includes(ee)||(Q=Q.replace(ee,""),!1));if(!(Y||te))break;K-=.5,T.fontSize(K)}return T.fontSize(z),T.height(D),K}function F({lines:T,lineHeight:L,width:z,align:D="left",padding:$=0,cornerRadius:K=0}){var V;T.forEach((Q,te)=>{Q.cx=z/2,D==="right"?Q.cx=z-Q.width/2:D==="left"&&(Q.cx=Q.width/2),D!=="justify"||Q.lastInParagraph||(Q.width=z),D==="justify"&&(Q.cx=Q.width/2)});let U=`M ${(V=T[0])===null||V===void 0?void 0:V.cx} ${-$}`;T.forEach((Q,te)=>{const{cx:ee}=Q,ne=T[te-1];ne&&ne.width>Q.width?U+=` L ${ee+Q.width/2+$} ${te*L+$}`:U+=` L ${ee+Q.width/2+$} ${te*L-$}`;const ie=T[te+1];ie&&ie.width>Q.width?U+=` L ${ee+Q.width/2+$} ${(te+1)*L-$}`:U+=` L ${ee+Q.width/2+$} ${(te+1)*L+$}`});for(var Y=T.length-1;Y>=0;Y--){const Q=T[Y],{cx:te}=Q,ee=T[Y+1];ee&&ee.width>Q.width?U+=` L ${te-Q.width/2-$} ${(Y+1)*L-$}`:U+=` L ${te-Q.width/2-$} ${(Y+1)*L+$}`;const ne=T[Y-1];ne&&ne.width>Q.width?U+=` L ${te-Q.width/2-$} ${Y*L+$}`:U+=` L ${te-Q.width/2-$} ${Y*L-$}`}U+=" Z";const X=(0,u.parsePath)(U);return(0,u.roundCommands)(X,K).path}e.getLineHeight=I,e.usePrevious=Z,e.TextElement=(0,n.observer)(({element:T,store:L})=>{const z=r.default.useRef(null),D=r.default.useRef(null),{editorEnabled:$,selectAll:K}=k(T),[V,U]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Q=r.default.useRef(T.a.height),te=L.selectedElements.indexOf(T)>=0,{textVerticalResizeEnabled:ee}=w.flags,ne=Z(T.fontFamily),[ie,oe]=r.default.useState([]);r.default.useEffect(()=>{var Oe,Pe;const He=(Pe=(Oe=z.current)===null||Oe===void 0?void 0:Oe.textArr)!==null&&Pe!==void 0?Pe:[];JSON.stringify(He)!==JSON.stringify(ie)&&oe(He)}),r.default.useEffect(()=>{if(T.a.width)return;const Oe=z.current;Oe.width(600),T.set({width:1.4*Oe.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Oe=z.current;(0,S.applyFilter)(Oe,T)}));const[ke]=(0,e.useFontLoader)(L,T.fontFamily),Ie=(0,m.removeTags)(T.text),le=()=>{const Oe=z.current.clone({height:void 0}),Pe=Math.ceil(Oe.fontSize()*Oe.lineHeight()*Oe.textArr.length+1);return Oe.destroy(),Pe};r.default.useLayoutEffect(()=>{if(!ke)return;const{textOverflow:Oe}=w.flags;if(T.a.height)if(Oe!=="change-font-size"||Y||L.isPlaying){if(Oe==="resize"){const Pe=le();ee&&T.a.height<Pe&&L.history.ignore(()=>{var He;(0,v.isAlive)(T)&&T.set({height:Pe}),(He=z.current)===null||He===void 0||He.height(Pe)},!1,!0),ee||T.a.height===Pe||L.history.ignore(()=>{var He;(0,v.isAlive)(T)&&T.set({height:Pe}),(He=z.current)===null||He===void 0||He.height(Pe)},!1,!0)}}else{const Pe=B(z.current,T);if(Pe!==T.a.fontSize)return void L.history.ignore(()=>{T.set({fontSize:Pe})},!1,!0);const He=le();T.a.height===He||ee||L.history.ignore(()=>{T.set({height:He})},!1,!0)}else{const Pe=le();L.history.ignore(()=>{T.set({height:Pe})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Oe=z.current;Oe&&(Oe.width(Oe.width()+1e-8),Oe._setTextData(),(0,S.applyFilter)(Oe,T))},[ke]);const fe=r.default.useRef(null),_e=r.default.useRef(0),ge=Oe=>{Oe.evt.preventDefault(),L.selectedShapes.find(He=>He===T)&&T.contentEditable&&(_e.current=G(Oe),T.toggleEditMode())},re=!Ie&&T.placeholder?.6:T.a.opacity;(0,b.useFadeIn)(z,re);const de=(0,e.getLineHeight)({fontLoaded:ke,fontFamily:T.fontFamily,fontSize:T.a.fontSize,lineHeight:T.lineHeight}),ye=T.selectable||L.role==="admin",Se=(0,f.useColor)(T),$e=r.default.useMemo(()=>T.backgroundEnabled?F({lines:JSON.parse(JSON.stringify(ie)),cornerRadius:T.backgroundCornerRadius*(T.a.fontSize*de*.5),lineHeight:de*T.a.fontSize,padding:T.backgroundPadding*(T.a.fontSize*de*.5),width:T.a.width,align:T.align}):"",[T.backgroundEnabled,T.backgroundCornerRadius,T.a.fontSize,de,T.backgroundPadding,T.a.width,T.align,ie]),Qe=(0,h.isTouchDevice)();let Re=0;return T.verticalAlign==="middle"?Re=(T.a.height-ie.length*de*T.a.fontSize)/2:T.verticalAlign==="bottom"&&(Re=T.a.height-ie.length*de*T.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:D,x:T.a.x,y:T.a.y,rotation:T.a.rotation,hideInExport:!T.showInExport,listening:!1,visible:T.backgroundEnabled,opacity:T.backgroundOpacity*re,data:$e,fill:T.backgroundColor,offsetY:-Re}),r.default.createElement(i.Text,Object.assign({ref:z,id:T.id,name:"element",hideInExport:!T.showInExport,editModeEnabled:T._editModeEnabled,x:T.a.x,y:T.a.y,rotation:T.a.rotation,width:T.a.width,height:T.a.height,text:Ie||T.placeholder},Se,{stroke:T.stroke,lineJoin:"round",strokeWidth:T.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:T.a.fontSize,fontFamily:`"${T.fontFamily}", "${ne}"`,fontStyle:T.fontStyle+" "+T.fontWeight,textDecoration:T.textDecoration,align:T.align,verticalAlign:T.verticalAlign,draggable:Qe?T.draggable&&te:T.draggable,preventDefault:!Qe||te,opacity:re,visible:!T._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:T.shadowEnabled,shadowBlur:T.shadowBlur,shadowOffsetX:T.shadowOffsetX,shadowOffsetY:T.shadowOffsetY,shadowColor:T.shadowColor,shadowOpacity:T.shadowOpacity,lineHeight:de,letterSpacing:T.letterSpacing*T.a.fontSize,listening:ye,onDragMove:Oe=>{T.set({x:Oe.target.x(),y:Oe.target.y()})},onDragEnd:Oe=>{T.set({x:Oe.target.x(),y:Oe.target.y()})},onMouseEnter:()=>{U(!0)},onMouseLeave:()=>{U(!1)},onClick:ge,onTap:ge,onTransformStart:()=>{X(!0),Q.current=z.current.height()},onTransform:Oe=>{var Pe,He;const lt=Oe.target;(Pe=D.current)===null||Pe===void 0||Pe.setAttrs({x:lt.x(),y:lt.y(),rotation:lt.rotation(),scale:lt.scale()});const ue=((He=lt.getStage())===null||He===void 0?void 0:He.findOne("Transformer")).getActiveAnchor();if(ue==="middle-left"||ue==="middle-right"){const ce=lt.scaleX(),Xe=lt.width()*ce,be=T.a.fontSize;let Le=Xe;Xe<be&&(Le=be,fe.current&&lt.position(fe.current)),lt.width(Le),lt.scaleX(1),lt.scaleY(1);const Ae=le();if(w.flags.textOverflow!=="ellipsis"){const we=Math.max(Ae,Q.current);lt.height(we),T.set({height:lt.height()})}T.set({x:lt.x(),y:lt.y(),width:lt.width(),rotation:lt.rotation()}),(0,S.applyFilter)(lt,T)}if(ue==="top-center"||ue==="bottom-center"){let ce=w.flags.textOverflow==="resize"?le():de*T.a.fontSize;Oe.target.height(Math.max(ce,Oe.target.height()*Oe.target.scaleY())),Oe.target.scaleY(1)}fe.current=Oe.target.position()},onTransformEnd:Oe=>{var Pe;const He=Oe.target.scaleX();Oe.target.scaleX(1),Oe.target.scaleY(1),T.set({fontSize:Math.round(T.a.fontSize*He),width:Math.ceil(Oe.target.width()*He),x:Oe.target.x(),y:Oe.target.y(),rotation:Oe.target.rotation(),height:Oe.target.height()*He,shadowBlur:T.shadowBlur*He,shadowOffsetX:T.shadowOffsetX*He,shadowOffsetY:T.shadowOffsetY*He,strokeWidth:T.strokeWidth*He}),(Pe=D.current)===null||Pe===void 0||Pe.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),$&&r.default.createElement(i.Group,{x:T.a.x,y:T.a.y,rotation:T.a.rotation},r.default.createElement(P,{textNodeRef:z,element:T,selectAll:K,cursorPosition:_e.current,onBlur:()=>{T.toggleEditMode(!1)}})),!Y&&(V||te)&&r.default.createElement(g.Highlighter,{element:T}))})})(Zy);var d2={},Qs={},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,p="before-selector",E=[p],w={},m=[],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 x(),n[l]}function g(W){return W?E[E.length-1-W]:p}function h(W){var B=l+1;return W===n.slice(B,B+W.length)}function v(W){var B=n.slice(l).indexOf(W);return B>0?B:!1}function d(W){return W===y(1)}function y(W){return n[l+(W||1)]}function _(){var W=E.pop();return p=E[E.length-1],W}function R(W){return p=W,E.push(p),E.length}function C(W){var B=p;return E[E.length-1]=p=W,B}function x(W){if((W||1)==1)n[l]==`
103
+ `?(f++,o=1):o++,l++;else{var B=n.slice(l,l+W).split(`
104
+ `);B.length>1&&(f+=B.length-1,o=1),o+=B[B.length-1].length,l=l+W}}function O(){w.end={line:f,col:o},m.push(w),i="",w={}}function P(W){w={type:W,start:{line:f,col:o}}}for(;a=b();)switch(a){case" ":switch(g()){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(g()){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(g()){case"name":w.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=a,P("selector"),R("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a;break}break;case";":switch(g()){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(g()){case"selector":if(y(-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":R("before-name");break;default:R("before-selector")}O(),u=u+1;break;case"name":case"at-rule":w.name=i.trim(),O(),R("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(g()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&O(),P("end"),O(),_(),g()==="at-group"&&(P("at-group-end"),O(),_()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(y(-1)==="\\"){i+=a;break}u>0&&g(1)==="at-group"&&(P("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(g()){case"double-string":a==='"'&&y(-1)!=="\\"&&_();break;case"single-string":a==="'"&&y(-1)!=="\\"&&_();break;case"before-at-value":C("at-value"),R(a==='"'?"double-string":"single-string");break;case"before-value":C("value"),R(a==='"'?"double-string":"single-string");break;case"comment":break;default:y(-1)!=="\\"&&R(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(g()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var k=v("*/");k&&x(k+1)}else g()=="before-value"&&C("value"),i+=a;break;default:d("*")?(P("comment"),R("comment"),x()):i+=a;break}break;case"*":switch(g()){case"comment":d("/")?(w.text=i,x(),O(),_()):i+=a;break;case"before-selector":i+=a,P("selector"),R("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a}break;case"@":switch(g()){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,Z=S.length;!M&&G<Z;++G)H=S[G],I=H.name||H,h(I)&&(M=!0,P(I),R(H.state||"at-group"),x(I.length),H.prefix&&(w.prefix=H.prefix),H.type&&(w.type=H.type));M||(i+=a);break}break;case"(":switch(g()){case"value":R("value-paren");break;case"before-value":C("value");break}i+=a;break;case")":switch(g()){case"value-paren":_();break;case"before-value":C("value");break}i+=a;break;default:switch(g()){case"before-selector":P("selector"),R("selector");break;case"before-name":P("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=a;break}return m}})(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(_,R){R||(R={}),n=!!R.comments,a=!!R.position,i=0,o=Array.isArray(_)?_.slice():r(_);for(var C,x=[],O;O=f();)C=h(O),C&&x.push(C);return{type:"stylesheet",stylesheet:{rules:x}}}function u(_,R){R||(R={});for(var C,x=["type","name","value"],O={},P=0;P<x.length;++P)C=x[P],_[C]&&(O[C]=R[C]||_[C]);for(x=Object.keys(R),P=0;P<x.length;++P)C=x[P],O[C]||(O[C]=R[C]);return a&&(O.position={start:_.start,end:_.end}),O}function f(){var _=o.shift();return _}function p(_){i=i+1;var R={};switch(_.type){case"font-face":case"viewport":R.declarations=d();break;case"page":R.prefix=_.prefix,R.declarations=d();break;default:R.prefix=_.prefix,R.rules=y()}return u(_,R)}function E(_){return u(_)}function w(_){return u(_)}function m(_){return u(_,{text:_.text})}function S(_){return u(_)}function b(_){return u(_)}function g(_){function R(C){return C.trim()}return u(_,{type:"rule",selectors:_.text.split(",").map(R),declarations:d()})}function h(_){switch(_.type){case"property":return b(_);case"selector":return g(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return p(_);case"comment":if(n)return m(_);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 p(_)}}function v(_){for(var R,C=[],x;(x=f())&&_&&_(x);)R=h(x),R&&C.push(R);return x&&x.type!=="end"&&o.unshift(x),C}function d(){return v(function(_){return _.type==="property"||_.type==="comment"})}function y(){return v(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(y,_){_||(_={}),i=_.indentation||"",n=!!_.compress,r=!!_.comments,a=1,n?o=l="":(o=`
107
+ `,l=" ");var R=S(y.stylesheet.rules,v).join(`
108
+ `).trim();return R}function f(y){if(y){a+=y;return}return n?"":Array(a).join(i||"")}function p(y){return"@"+y.type+" "+y.value+";"+o}function E(y){var _="",R=y.prefix||"";y.name&&(_=" "+y.name);var C=y.type!=="page";return"@"+R+y.type+_+l+b(y,C)+o}function w(y){return r?"/*"+(y.text||"")+"*/"+o:""}function m(y){var _;return y.selectors?_=y.selectors.join(","+o):(_="@"+y.type,_+=y.name?" "+y.name:""),f()+_+l+b(y)+o}function S(y,_){return y.reduce(function(R,C){var x=C.type==="comment"?w(C):_(C);return x&&R.push(x),R},[])}function b(y,_){var R=y.declarations,C=h;return y.rules&&(R=y.rules,C=m),R=g(R,C),R&&(R=o+R+(_?"":o)),"{"+R+f()+"}"}function g(y,_){if(!y)return"";f(1);var R=S(y,_);return f(-1),R.length?R.join(o):""}function h(y){if(y.type==="property")return d(y)}function v(y){switch(y.type){case"rule":return m(y);case"media":case"keyframes":return E(y);case"comment":return w(y);case"import":case"charset":case"namespace":return p(y);case"font-face":case"supports":case"viewport":case"document":case"page":return E(y)}}function d(y){var _=y.name?y.name+":"+l:"";return f()+_+y.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(Si),n=t(Ze),i=Qy,a=t(xD);function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const R={};return _.querySelectorAll("style").forEach(C=>{const x=a.default.parse(C.textContent).stylesheet.rules;for(let O of x)O.selectors&&O.selectors.forEach(P=>{const k=R[P]||{};O.declarations.forEach(M=>{k[M.name]=M.value}),R[P]=k})}),R}function u(_,R){var C;const x={fill:"",stroke:""},O=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],P=_.getAttribute("id");let k={};if(P&&R[`#${P}`]?k=R[`#${P}`]:O.forEach(M=>{R[`.${M}`]&&(k=Object.assign(Object.assign({},k),R[`.${M}`]))}),R[_.nodeName]&&(k=Object.assign(Object.assign({},k),R[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?x.fill=_.getAttribute("fill"):k.fill&&k.fill!=="none"&&(x.fill=k.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?x.stroke=_.getAttribute("stroke"):k.stroke&&k.stroke!=="none"&&(x.stroke=k.stroke),!x.fill&&_.style.fill&&_.style.fill!=="none"&&(x.fill=_.style.fill),!x.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(x.stroke=_.style.stroke),!x.stroke&&!x.fill){const M=_.ownerSVGElement,I=M&&M!==_&&u(M,R);(I==null?void 0:I.fill)==="currentColor"||(I==null?void 0:I.stroke)==="currentColor"||(x.fill="black")}return x}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function p(_){for(var R=[],C=_.getElementsByTagName("*"),x=0,O=C.length;x<O;x++){const P=C[x];o(P)||(P.getAttribute("fill")!==null&&R.push(P),(P.getAttribute("stroke")!==null||P.style&&P.style.fill||f.indexOf(P.nodeName)>=0)&&R.push(P))}return R}async function E(_){const R=await fetch(_);return S(await R.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function m(_){var R=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(R),x=p(R),O=[];return x.forEach(P=>{const{fill:k,stroke:M}=u(P,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 R=await w(_),C=new DOMParser().parseFromString(R,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,O,P,k]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(P),height:parseFloat(k)}}function g(_){var R=new DOMParser().parseFromString(_,"image/svg+xml");const C=R.documentElement.getAttribute("viewBox"),[x,O,P,k]=(C==null?void 0:C.split(" "))||[],M=R.documentElement.getAttribute("width");!M&&R.documentElement.setAttribute("width",P+"px");const I=R.documentElement.getAttribute("height");if((!I||I.indexOf("%")>=0)&&R.documentElement.setAttribute("height",k+"px"),M&&M.indexOf("%")>=0&&I&&I.indexOf("%")===-1){const H=parseFloat(I)/parseFloat(k);R.documentElement.setAttribute("width",H*parseFloat(P)+"px")}if(I&&I.indexOf("%")>=0&&M&&M.indexOf("%")===-1){const H=parseFloat(M)/parseFloat(P);R.documentElement.setAttribute("height",H*parseFloat(k)+"px")}return M==="100%"&&I==="100%"&&(R.documentElement.setAttribute("width",P+"px"),R.documentElement.setAttribute("height",k+"px")),new XMLSerializer().serializeToString(R)}e.urlToBase64=E,e.urlToString=w,e.getColors=m,e.svgToURL=S,e.getSvgSize=b,e.fixSize=g;const h=(_,R)=>{if(!_||!R)return!1;if(R==="currentColor"&&_==="black")return!0;const C=r.default.Util.colorToRGBA(_),x=r.default.Util.colorToRGBA(R);return C&&x?C.r===x.r&&C.g===x.g&&C.b===x.b&&C.a===x.a:void 0};function v(_,R,C,x){var O=_.namespaceURI,P=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;P.setAttribute("x1",100*M+"%"),P.setAttribute("y1",100*I+"%"),P.setAttribute("x2",100*H+"%"),P.setAttribute("y2",100*G+"%"),P.setAttribute("gradientUnits","userSpaceOnUse"),P.setAttribute("id",R);for(var Z=0;Z<x.length;Z++){var W=x[Z],B=document.createElementNS(O,"stop");for(var F in W)W.hasOwnProperty(F)&&B.setAttribute(F,W[F]);P.appendChild(B)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(O,"defs"),_.firstChild)).appendChild(P)}function d(_,R){var C=new DOMParser().parseFromString(_,"image/svg+xml");const x=p(C),O=Array.from(R.keys()),P=l(C);return x.forEach(k=>{const{fill:M,stroke:I}=u(k,P);[{prop:"fill",color:M},{prop:"stroke",color:I}].forEach(({prop:H,color:G})=>{const Z=O.find(W=>(0,e.sameColors)(W,G));if(Z){const W=R.get(Z);if((0,i.isGradient)(W)){const{rotation:B,stops:F}=(0,i.parseColor)(W),T=F.map(z=>({offset:100*z.offset+"%","stop-color":z.color})),L="color"+Math.round(1e8*Math.random());v(C.children[0],L,B,T),k.style[H]=null,k.setAttribute(H,`url('#${L}')`)}else k.style[H]=R.get(Z)}})}),S(new XMLSerializer().serializeToString(C))}e.sameColors=h,e.replaceColors=d;const y=_=>{const[R,C]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{C([]);const O=m(await w(_));x||C(O)})(),()=>{x=!0}},[_]),R};e.useSvgColors=y})(Qs);(function(e){var t=me&&me.__createBinding||(Object.create?function(D,$,K,V){V===void 0&&(V=K);var U=Object.getOwnPropertyDescriptor($,K);U&&!("get"in U?!$.__esModule:U.writable||U.configurable)||(U={enumerable:!0,get:function(){return $[K]}}),Object.defineProperty(D,V,U)}:function(D,$,K,V){V===void 0&&(V=K),D[V]=$[K]}),r=me&&me.__setModuleDefault||(Object.create?function(D,$){Object.defineProperty(D,"default",{enumerable:!0,value:$})}:function(D,$){D.default=$}),n=me&&me.__importStar||function(D){if(D&&D.__esModule)return D;var $={};if(D!=null)for(var K in D)K!=="default"&&Object.prototype.hasOwnProperty.call(D,K)&&t($,D,K);return r($,D),$},i=me&&me.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Ze),o=_i,l=Ki,u=Ca,f=i(qp),p=i(Si),E=qc,w=Pl,m=$i,S=n(Qs),b=Yn,g=Kc,h=xl,v=Po;function d(){return document.createElement("canvas")}async function y(D){if(!(D.indexOf("data:image/svg+xml")>=0||D.indexOf(".svg")>=0))return D;const $=await S.urlToString(D),K=S.fixSize($);return S.svgToURL(K)}const _=D=>{const[$,K]=a.default.useState(D);return a.default.useEffect(()=>{(async()=>{const V=await y(D);V!==$&&K(V)})()},[D]),$};function R(D,$){return Math.sqrt(Math.pow($.x-D.x,2)+Math.pow($.y-D.y,2))}function C(D,$){return{x:(D.x+$.x)/2,y:(D.y+$.y)/2}}const x=(D,$,K)=>{const V=a.default.useMemo(()=>{var U,Y;const{flipX:X,flipY:Q}=D,te=D.type==="svg"||D.src.indexOf("data:image/svg+xml")>=0||D.src.indexOf(".svg")>=0,ee=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&te||D.maskSrc;if(!X&&!Q&&!ee)return $;if(!$||!$.width||!$.height)return null;const ne=d();let ie=1;D.type==="svg"&&(ie=Math.max(D.a.width/$.width*K,D.a.height/$.height*K)),ne.width=Math.max($.width*ie,1),ne.height=Math.max($.height*ie,1);let oe=X?-ne.width:0,ke=Q?-ne.height:0;return(U=ne.getContext("2d"))===null||U===void 0||U.scale(X?-1:1,Q?-1:1),(Y=ne.getContext("2d"))===null||Y===void 0||Y.drawImage($,oe,ke,ne.width,ne.height),ne},[D.maskSrc,D.flipX,D.flipY,$,D.a.width,D.a.height,K]);return a.default.useEffect(()=>()=>{V&&V.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(V)},[V]),V};function O(D,$){const K=$.width/$.height;let V,U;return K>=D.width/D.height?(V=D.width,U=D.width/K):(V=D.height*K,U=D.height),{x:(D.width-V)/2,y:(D.height-U)/2,width:V,height:U}}function P(D,$,K,V,U,Y,X){for(var Q=new ImageData($,K),te=new Int32Array(D.data.buffer),ee=D.width,ne=new Int32Array(Q.data.buffer),ie=Q.width,oe=$/Y,ke=K/X,Ie=Math.round(1/oe),le=Math.round(1/ke),fe=Ie*le,_e=0;_e<Q.height;_e++)for(var ge=0;ge<ie;ge++){for(var re=V+Math.round(ge/oe)+(U+Math.round(_e/ke))*ee,de=0,ye=0,Se=0,$e=0,Qe=0;Qe<le;Qe++)for(var Re=0;Re<Ie;Re++){var Oe=te[re+Re+Qe*ee];de+=Oe<<24>>>24,ye+=Oe<<16>>>24,Se+=Oe<<8>>>24,$e+=Oe>>>24}de=Math.round(de/fe),ye=Math.round(ye/fe),Se=Math.round(Se/fe),$e=Math.round($e/fe),ne[ge+_e*ie]=$e<<24|Se<<16|ye<<8|de}return Q}function k(D,$){var K,V;const U=d();U.width=D.width,U.height=D.height;const Y=Math.max(1,Math.floor(U.width*$)),X=Math.max(1,Math.floor(U.height*$));(K=U.getContext("2d"))===null||K===void 0||K.drawImage(D,0,0,U.width,U.height);const Q=P(U.getContext("2d").getImageData(0,0,U.width,U.height),Y,X,0,0,U.width,U.height);return U.width=Y,U.height=X,(V=U.getContext("2d"))===null||V===void 0||V.putImageData(Q,0,0),U}const M=(D,$)=>{const[K,V]=B(D.maskSrc,"anonymous"),U=D.maskSrc?V:"loaded";return(0,e.useImageLoader)(U,D.id+"-mask"),a.default.useMemo(()=>{if(!K||!$||!$.width||!$.height)return $;const Y=d();Y.width=Math.max($.width,1),Y.height=Math.max($.height,1);const X=Y.getContext("2d");if(!X)return $;X.drawImage($,0,0),X.globalCompositeOperation="source-in";const Q=O(K,D);return X.drawImage(K,Q.x,Q.y,Q.width,Q.height,0,0,$.width,$.height),Y},[$,K,D.a.width,D.a.height])},I=(D,$,K,V,U=0,Y=!1)=>{const X=Math.floor(Math.max(D.a.width*V,1)),Q=Math.floor(Math.max(D.a.height*V,1)),te=Math.min(U*V,X/2,Q/2),ee=Math.max(D.a.width/K.width,D.a.height/K.height)*V,ne=D.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&ee<1&&!Y,ie=K.x===0&&K.y===0&&K.width===($==null?void 0:$.width)&&K.height===($==null?void 0:$.height),oe=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return ie&&te===0&&!ne?void 0:d()},[$,te,ne,ie]);return a.default.useLayoutEffect(()=>{if(!oe||!$)return;oe.width=X,oe.height=Q;const ke=oe.getContext("2d");if(!ke)return;te&&(ke.beginPath(),ke.moveTo(te,0),ke.lineTo(X-te,0),ke.arc(X-te,te,te,3*Math.PI/2,0,!1),ke.lineTo(X,Q-te),ke.arc(X-te,Q-te,te,0,Math.PI/2,!1),ke.lineTo(te,Q),ke.arc(te,Q-te,te,Math.PI/2,Math.PI,!1),ke.lineTo(0,te),ke.arc(te,te,te,Math.PI,3*Math.PI/2,!1),ke.clip());const Ie=ne?k($,ee):$,le=ne?{x:Math.floor(K.x*ee),y:Math.floor(K.y*ee),width:Math.floor(K.width*ee),height:Math.floor(K.height*ee)}:K;ke.drawImage(Ie,le.x,le.y,le.width,le.height,0,0,oe.width,oe.height)},[oe,D.a.width,D.a.height,K.x,K.y,K.width,K.height,U,V,Y,D.page._exportingOrRendering,ne]),a.default.useEffect(()=>()=>{oe&&oe.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(oe)},[oe]),oe||$},H=(D,$,K,V)=>{const U=_(D.clipSrc||""),[Y,X]=B(U,"anonymous"),Q=D.clipSrc?X:"loaded";(0,e.useImageLoader)(Q,D.id+"-clip");const te=a.default.useMemo(()=>{if($&&Y)return d()},[$,Y]);return a.default.useLayoutEffect(()=>{var ee;if(!Y||!$||!$.width||!$.height||!Y||!Y.width||!Y.height||!te)return;const ne=d(),ie=Math.max(D.a.width/Y.width*K,D.a.height/Y.height*K);ne.width=Y.width*ie,ne.height=Y.height*ie,(ee=ne.getContext("2d"))===null||ee===void 0||ee.drawImage(Y,0,0,ne.width,ne.height),te.width=Math.max($.width,1),te.height=Math.max($.height,1);const oe=te.getContext("2d");oe&&(oe.save(),oe.drawImage(ne,0,0,$.width,$.height),p.default.Util.releaseCanvas(ne),oe.globalCompositeOperation="source-in",oe.drawImage($,0,0,te.width,te.height),oe.restore())},[te,$,Y,D.a.width,D.a.height,K,...V]),D.clipSrc&&Y?te:$},G=d(),Z=(0,o.observer)(({element:D})=>{const $=Math.min(30,D.a.width/4,D.a.height/4),K=a.default.useRef(null);return a.default.useEffect(()=>{const V=K.current;if(!V)return;const U=new p.default.Animation(Y=>{V.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},V.getLayer());return U.start(),()=>{U.stop()}}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:K,x:D.a.width/2,y:D.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),W=(0,o.observer)(({element:D})=>{const $="Can not load the image...",K=Math.max(10,Math.min(30,D.a.width/25));return a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:$,fontSize:K,width:D.a.width,height:D.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let B=f.default;const F=D=>{B=D};e.setImageLoaderHook=F;const T=(D,$)=>{const K=a.default.useRef(),V=()=>{var U;(U=K.current)===null||U===void 0||U.call(K),K.current=void 0};a.default.useEffect(()=>V,[]),a.default.useLayoutEffect(()=>{D!=="loading"||K.current||(K.current=(0,m.incrementLoader)(`image ${$}`)),D!=="loading"&&V(),D==="failed"&&(0,m.triggerLoadError)(`image ${$}`)},[D])};e.useImageLoader=T;const L=({image:D,status:$,type:K})=>{const V=a.default.useRef();return a.default.useEffect(()=>{V.current=D||V.current},[D]),$!=="failed"||$!=="failed"&&K==="svg"?V.current:void 0},z=D=>{const[$,K]=a.default.useReducer(X=>X+1,0),V=a.default.useRef("loading"),U=a.default.useRef(D.src),Y=a.default.useRef(D.src);return Y.current!==D.src&&(Y.current=D.src,V.current="loading"),a.default.useEffect(()=>{if(D.type!=="svg"||!D.src)return;let X=!1;return(async()=>{V.current="loading",K();const Q=await S.urlToString(D.src),te=S.fixSize(Q),ee=S.replaceColors(te,D.colorsReplace);X||(U.current=ee,V.current="loaded",K())})(),()=>{X=!0}},[D.src,JSON.stringify(D.colorsReplace)]),D.type!=="svg"?[D.src,"loaded"]:[U.current,V.current]};e.ImageElement=(0,o.observer)(({element:D,store:$})=>{var K;const[V,U]=a.default.useState(!1),Y=a.default.useRef(null),X=a.default.useRef(null),[Q,te]=a.default.useState(!1),ee=$.selectedElements.indexOf(D)>=0,[ne,ie]=z(D),[oe,ke]=B(ne,"anonymous"),Ie=D.type!=="svg"||ie==="loaded"?ke:"loading";(0,e.useImageLoader)(Ie,D.id);const le=D.page._exportingOrRendering?1:Math.max(1,$.scale),fe=$._elementsPixelRatio*le,_e=L({image:oe,status:ke,type:D.type}),ge=M(D,x(D,oe||_e,fe))||G;let{cropX:re,cropY:de,cropWidth:ye,cropHeight:Se}=D;ke!=="loaded"&&(re=de=0,ye=Se=1);const $e=ge.width*ye,Qe=ge.height*Se,Re=D.a.width/D.a.height;let Oe,Pe;const He=$e/Qe,lt=D.type==="svg";lt?(Oe=$e,Pe=Qe):Re>=He?(Oe=$e,Pe=$e/Re):(Oe=Qe*Re,Pe=Qe);const ue={x:ge.width*re,y:ge.height*de,width:Oe,height:Pe},ce=(K=D.cornerRadius)!==null&&K!==void 0?K:0,Xe=D.page._exportingOrRendering?1:Math.min(2,$.scale),be=$._elementsPixelRatio*Xe;let Le=H(D,I(D,ge,ue,be,ce,V||D._cropModeEnabled||D.type==="svg"),be,[ue,ce,be]);const Ae=Math.max(D.a.width/Oe,D.a.height/Pe);a.default.useEffect(()=>{var Ne;if(!D._cropModeEnabled)return;const et=(Ne=Y.current)===null||Ne===void 0?void 0:Ne.getStage();function ct(Et){D._cropModeEnabled&&Et.target!==X.current&&D.toggleCropMode(!1)}function Mt(Et){D._cropModeEnabled&&Et.target.parentNode!==et.content&&D.toggleCropMode(!1)}return document.body.addEventListener("click",Mt),et==null||et.on("click",ct),et==null||et.on("tap",ct),()=>{document.body.removeEventListener("click",Mt),document.body.removeEventListener("touchstart",Mt),et==null||et.off("click",ct),et==null||et.off("click",ct)}},[D._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(V||D._cropModeEnabled))return(0,g.applyFilter)(Y.current,D),(0,l.autorun)(()=>{(0,g.applyFilter)(Y.current,D)},{delay:100})},[Le,D.page._exportingOrRendering,V,ye,Se,D._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ne;V||D._cropModeEnabled?(Ne=Y.current)===null||Ne===void 0||Ne.clearCache():(0,g.applyFilter)(Y.current,D)},[V,D.a.width,D.a.height,D._cropModeEnabled]),a.default.useEffect(()=>{(0,g.applyFilter)(Y.current,D)},[D.shadowEnabled,D.shadowBlur,D.cornerRadius,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);const we=a.default.useRef(null),Je=a.default.useRef(null),Ee=a.default.useRef(null);a.default.useLayoutEffect(()=>{D._cropModeEnabled&&(Je.current.nodes([we.current]),Ee.current.nodes([X.current]))},[D._cropModeEnabled]);var We=a.default.useRef(null),lr=a.default.useRef(0),xe=a.default.useRef(!1);const ze=Ne=>{var et;((et=Ne.evt.touches)===null||et===void 0?void 0:et.length)>2&&Ne.target.stopDrag(),Math.round(Ne.target.x())>0&&(Ne.target.x(0),Ne.target.scaleX(1)),Math.round(Ne.target.y())>0&&(Ne.target.y(0),Ne.target.scaleY(1));const ct=Ne.target.width()*Ne.target.scaleX(),Mt=Ne.target.height()*Ne.target.scaleY(),Et=Math.min(1,Oe/ct),Jr=Math.min(1,Pe/Mt),$r=1-Et,Ut=Math.min($r,Math.max(0,Math.round(-Ne.target.x())/ct)),en=1-Jr,Mn=Math.min(en,Math.max(0,Math.round(-Ne.target.y())/Mt));Ne.target.setAttrs({x:-Ut*ge.width,y:-Mn*ge.height,scaleX:1,scaleY:1}),D.set({cropX:Ut,cropY:Mn,cropWidth:Et,cropHeight:Jr})},tt=()=>{D.type!=="svg"&&D.contentEditable&&setTimeout(()=>{D.toggleCropMode(!0)})},yt=D.type==="svg"&&_e,xt=ke==="loading"&&!yt,xr=ke==="failed",Zr=!xt&&!xr,mr=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Qr=Zr?D.a.opacity:0;(0,h.useFadeIn)(Y,Qr);const Qn=D.selectable||$.role==="admin",Rn=(0,v.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,xt&&a.default.createElement(Z,{element:D}),xr&&a.default.createElement(W,{element:D}),a.default.createElement(u.Image,{ref:Y,name:"element",id:D.id,image:Le,x:D.a.x,y:D.a.y,width:D.a.width||1,height:D.a.height||1,rotation:D.a.rotation,opacity:Qr,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,customCrop:ue,listening:Qn,draggable:Rn?D.draggable&&ee:D.draggable,preventDefault:!Rn||ee,hideInExport:!D.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:Ne=>{D.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{D.set({x:Ne.target.x(),y:Ne.target.y()})},onDblClick:tt,onDblTap:tt,onTransformStart:()=>{U(!0),mr.current={cropX:D.cropX,cropY:D.cropY,cropWidth:D.cropWidth,cropHeight:D.cropHeight}},onTransform:Ne=>{var et;const ct=Ne.currentTarget,Mt=Math.abs(ct.scaleX()-1)<1e-7?1:ct.scaleX(),Et=Math.abs(ct.scaleY()-1)<1e-7?1:ct.scaleY();ct.scaleX(1),ct.scaleY(1);const Jr=(et=Ne.target.getStage())===null||et===void 0?void 0:et.findOne("Transformer"),$r=1-Oe/ge.width,Ut=Math.min($r,Math.max(0,D.cropX)),en=1-Pe/ge.height,Mn=Math.min(en,Math.max(0,D.cropY)),Ln=Jr.getActiveAnchor(),Ta=!(Ln.indexOf("middle")>=0||Ln.indexOf("center")>=0),ru=!Ta&&Mt<1&&mr.current.cropHeight>Pe/ge.height;let ko=Ta?D.cropWidth:D.cropWidth*Mt;ru&&(ko=D.cropWidth);const To=!Ta&&Et<1&&mr.current.cropWidth>Oe/ge.width;let Aa=Ta?D.cropHeight:D.cropHeight*Et;To&&(Aa=D.cropHeight),lt&&(ko=D.cropWidth,Aa=D.cropHeight),D.set({cropX:Ut,cropY:Mn,x:ct.x(),y:ct.y(),width:ct.width()*Mt,height:ct.height()*Et,rotation:Ne.target.rotation(),cropWidth:Math.min(ko,1-Ut),cropHeight:Math.min(Aa,1-Mn)})},onTransformEnd:Ne=>{const et=Ne.currentTarget;D.set({width:et.width(),height:et.height(),x:et.x(),y:et.y(),rotation:Ne.target.rotation(),cropWidth:Oe/ge.width,cropHeight:Pe/ge.height}),U(!1)}}),a.default.createElement(u.Rect,{x:D.x,y:D.y,width:Math.max(D.a.width-D.borderSize,0),height:Math.max(D.a.height-D.borderSize,0),opacity:Qr,offsetX:-D.borderSize/2,offsetY:-D.borderSize/2,stroke:D.borderColor,strokeWidth:D.borderSize,listening:!1,visible:!!D.borderSize,rotation:D.rotation,cornerRadius:Math.max(0,ce-D.borderSize),hideInExport:!D.showInExport}),D._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:Le,x:D.x,y:D.y,width:D.a.width,height:D.a.height,rotation:D.rotation,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,scaleX:Ae,scaleY:Ae},a.default.createElement(u.Image,{image:ge,ref:X,opacity:.4,draggable:!0,x:-D.cropX*ge.width,y:-D.cropY*ge.height,onDragMove:ze,onTransform:ze,onTouchMove:Ne=>{Ne.evt.preventDefault();const et=Ne.target.getStage().getPointersPositions();var ct=et[0],Mt=et[1];const Et=Ne.target;if(ct&&!Mt&&!Et.isDragging()&&xe.current&&(Et.startDrag(),xe.current=!1),ct&&Mt){p.default.hitOnDragEnabled=!0,Et.isDragging()&&(xe.current=!0,Et.stopDrag());const To=Ne.target.getAbsoluteTransform().copy();To.invert();var Jr={x:ct.x,y:ct.y},$r={x:Mt.x,y:Mt.y};if(!We.current)return void(We.current=C(Jr,$r));var Ut=C(Jr,$r),en=R(Jr,$r);lr.current||(lr.current=en);const Aa=Et.position();var Mn={x:Ut.x-Aa.x,y:Ut.y-Aa.y},Ln=en/lr.current;Et.scaleX(Ln),Et.scaleY(Ln);const Zc=To.point(Ut),kl=To.point(We.current);var Ta=Zc.x-kl.x,ru=Zc.y-kl.y,ko={x:Math.min(0,Ut.x-Mn.x*Ln+Ta),y:Math.min(0,Ut.y-Mn.y*Ln+ru)};Et.position(ko),lr.current=en,We.current=Ut,ze(Ne)}},onTouchEnd:Ne=>{lr.current=0,We.current=null,p.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Ee,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,et)=>et.width<5||et.height<5?Ne:et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Oe,height:Pe,ref:we,listening:!1,onTransform:Ne=>{Ne.target.x()<-D.cropX*ge.width-1e-9&&(Ne.target.x(-D.cropX*ge.width),Ne.target.scaleX(1)),Ne.target.y()<-D.cropY*ge.height-1e-9&&(Ne.target.y(-D.cropY*ge.height),Ne.target.scaleY(1));const et=Math.min(1,Math.max(0,D.cropX+Ne.target.x()/ge.width)),ct=Math.min(1,Math.max(0,Ne.target.y()/ge.height+D.cropY)),Mt=Ne.target.width()*Ne.target.scaleX(),Et=Ne.target.height()*Ne.target.scaleY(),Jr=Math.min(1-et,Mt/ge.width),$r=Math.min(1-ct,Et/ge.height),Ut=Ne.target.getAbsolutePosition(Ne.target.getParent().getParent());Ne.target.scale({x:1,y:1}),Ne.target.position({x:0,y:0}),D.set({x:Ut.x,y:Ut.y,cropX:et,cropY:ct,cropWidth:Jr,cropHeight:$r,width:Math.min(Mt*Ae,ge.width*(1-et)*Ae),height:Math.min(Et*Ae,ge.height*(1-ct)*Ae)})}}),a.default.createElement(u.Transformer,{ref:Je,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,et)=>et.width<5||et.height<5?Ne:et,visible:D.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(Q||ee)&&a.default.createElement(w.Highlighter,{element:D}))})})(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),p=i(47),E=i(48),w=i(49),m=i(12),S=i(32),b=i(33),g=i(31),h=i(1),v={Scope:h.Scope,create:h.create,find:h.find,query:h.query,register:h.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:E.default,Scroll:u.default,Block:p.default,Inline:f.default,Text:w.default,Attributor:{Attribute:m.default,Class:S.default,Style:b.default,Store:g.default}};n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var d in v)v.hasOwnProperty(d)&&(h[d]=v[d])};return function(h,v){g(h,v);function d(){this.constructor=h}h.prototype=v===null?Object.create(v):(d.prototype=v.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(g){a(h,g);function h(v){var d=this;return v="[Parchment] "+v,d=g.call(this,v)||this,d.message=v,d.name=d.constructor.name,d}return h}(Error);n.ParchmentError=o;var l={},u={},f={},p={};n.DATA_KEY="__blot";var E;(function(g){g[g.TYPE=3]="TYPE",g[g.LEVEL=12]="LEVEL",g[g.ATTRIBUTE=13]="ATTRIBUTE",g[g.BLOT=14]="BLOT",g[g.INLINE=7]="INLINE",g[g.BLOCK=11]="BLOCK",g[g.BLOCK_BLOT=10]="BLOCK_BLOT",g[g.INLINE_BLOT=6]="INLINE_BLOT",g[g.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",g[g.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",g[g.ANY=15]="ANY"})(E=n.Scope||(n.Scope={}));function w(g,h){var v=S(g);if(v==null)throw new o("Unable to create "+g+" blot");var d=v,y=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:d.create(h);return new d(y,h)}n.create=w;function m(g,h){return h===void 0&&(h=!1),g==null?null:g[n.DATA_KEY]!=null?g[n.DATA_KEY].blot:h?m(g.parentNode,h):null}n.find=m;function S(g,h){h===void 0&&(h=E.ANY);var v;if(typeof g=="string")v=p[g]||l[g];else if(g instanceof Text||g.nodeType===Node.TEXT_NODE)v=p.text;else if(typeof g=="number")g&E.LEVEL&E.BLOCK?v=p.block:g&E.LEVEL&E.INLINE&&(v=p.inline);else if(g instanceof HTMLElement){var d=(g.getAttribute("class")||"").split(/\s+/);for(var y in d)if(v=u[d[y]],v)break;v=v||f[g.tagName]}return v==null?null:h&E.LEVEL&v.scope&&h&E.TYPE&v.scope?v:null}n.query=S;function b(){for(var g=[],h=0;h<arguments.length;h++)g[h]=arguments[h];if(g.length>1)return g.map(function(y){return b(y)});var v=g[0];if(typeof v.blotName!="string"&&typeof v.attrName!="string")throw new o("Invalid definition");if(v.blotName==="abstract")throw new o("Cannot register abstract class");if(p[v.blotName||v.attrName]=v,typeof v.keyName=="string")l[v.keyName]=v;else if(v.className!=null&&(u[v.className]=v),v.tagName!=null){Array.isArray(v.tagName)?v.tagName=v.tagName.map(function(y){return y.toUpperCase()}):v.tagName=v.tagName.toUpperCase();var d=Array.isArray(v.tagName)?v.tagName:[v.tagName];d.forEach(function(y){(f[y]==null||v.className==null)&&(f[y]=v)})}return v}n.register=b},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",p=function(E){Array.isArray(E)?this.ops=E:E!=null&&Array.isArray(E.ops)?this.ops=E.ops:this.ops=[]};p.prototype.insert=function(E,w){var m={};return E.length===0?this:(m.insert=E,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(m.attributes=w),this.push(m))},p.prototype.delete=function(E){return E<=0?this:this.push({delete:E})},p.prototype.retain=function(E,w){if(E<=0)return this;var m={retain:E};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(m.attributes=w),this.push(m)},p.prototype.push=function(E){var w=this.ops.length,m=this.ops[w-1];if(E=l(!0,{},E),typeof m=="object"){if(typeof E.delete=="number"&&typeof m.delete=="number")return this.ops[w-1]={delete:m.delete+E.delete},this;if(typeof m.delete=="number"&&E.insert!=null&&(w-=1,m=this.ops[w-1],typeof m!="object"))return this.ops.unshift(E),this;if(o(E.attributes,m.attributes)){if(typeof E.insert=="string"&&typeof m.insert=="string")return this.ops[w-1]={insert:m.insert+E.insert},typeof E.attributes=="object"&&(this.ops[w-1].attributes=E.attributes),this;if(typeof E.retain=="number"&&typeof m.retain=="number")return this.ops[w-1]={retain:m.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},p.prototype.chop=function(){var E=this.ops[this.ops.length-1];return E&&E.retain&&!E.attributes&&this.ops.pop(),this},p.prototype.filter=function(E){return this.ops.filter(E)},p.prototype.forEach=function(E){this.ops.forEach(E)},p.prototype.map=function(E){return this.ops.map(E)},p.prototype.partition=function(E){var w=[],m=[];return this.forEach(function(S){var b=E(S)?w:m;b.push(S)}),[w,m]},p.prototype.reduce=function(E,w){return this.ops.reduce(E,w)},p.prototype.changeLength=function(){return this.reduce(function(E,w){return w.insert?E+u.length(w):w.delete?E-w.delete:E},0)},p.prototype.length=function(){return this.reduce(function(E,w){return E+u.length(w)},0)},p.prototype.slice=function(E,w){E=E||0,typeof w!="number"&&(w=1/0);for(var m=[],S=u.iterator(this.ops),b=0;b<w&&S.hasNext();){var g;b<E?g=S.next(E-b):(g=S.next(w-b),m.push(g)),b+=u.length(g)}return new p(m)},p.prototype.compose=function(E){var w=u.iterator(this.ops),m=u.iterator(E.ops),S=[],b=m.peek();if(b!=null&&typeof b.retain=="number"&&b.attributes==null){for(var g=b.retain;w.peekType()==="insert"&&w.peekLength()<=g;)g-=w.peekLength(),S.push(w.next());b.retain-g>0&&m.next(b.retain-g)}for(var h=new p(S);w.hasNext()||m.hasNext();)if(m.peekType()==="insert")h.push(m.next());else if(w.peekType()==="delete")h.push(w.next());else{var v=Math.min(w.peekLength(),m.peekLength()),d=w.next(v),y=m.next(v);if(typeof y.retain=="number"){var _={};typeof d.retain=="number"?_.retain=v:_.insert=d.insert;var R=u.attributes.compose(d.attributes,y.attributes,typeof d.retain=="number");if(R&&(_.attributes=R),h.push(_),!m.hasNext()&&o(h.ops[h.ops.length-1],_)){var C=new p(w.rest());return h.concat(C).chop()}}else typeof y.delete=="number"&&typeof d.retain=="number"&&h.push(y)}return h.chop()},p.prototype.concat=function(E){var w=new p(this.ops.slice());return E.ops.length>0&&(w.push(E.ops[0]),w.ops=w.ops.concat(E.ops.slice(1))),w},p.prototype.diff=function(E,w){if(this.ops===E.ops)return new p;var m=[this,E].map(function(v){return v.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var y=v===E?"on":"with";throw new Error("diff() called "+y+" non-document")}).join("")}),S=new p,b=a(m[0],m[1],w),g=u.iterator(this.ops),h=u.iterator(E.ops);return b.forEach(function(v){for(var d=v[1].length;d>0;){var y=0;switch(v[0]){case a.INSERT:y=Math.min(h.peekLength(),d),S.push(h.next(y));break;case a.DELETE:y=Math.min(d,g.peekLength()),g.next(y),S.delete(y);break;case a.EQUAL:y=Math.min(g.peekLength(),h.peekLength(),d);var _=g.next(y),R=h.next(y);o(_.insert,R.insert)?S.retain(y,u.attributes.diff(_.attributes,R.attributes)):S.push(R).delete(y);break}d-=y}}),S.chop()},p.prototype.eachLine=function(E,w){w=w||`
114
+ `;for(var m=u.iterator(this.ops),S=new p,b=0;m.hasNext();){if(m.peekType()!=="insert")return;var g=m.peek(),h=u.length(g)-m.peekLength(),v=typeof g.insert=="string"?g.insert.indexOf(w,h)-h:-1;if(v<0)S.push(m.next());else if(v>0)S.push(m.next(v));else{if(E(S,m.next(1).attributes||{},b)===!1)return;b+=1,S=new p}}S.length()>0&&E(S,{},b)},p.prototype.transform=function(E,w){if(w=!!w,typeof E=="number")return this.transformPosition(E,w);for(var m=u.iterator(this.ops),S=u.iterator(E.ops),b=new p;m.hasNext()||S.hasNext();)if(m.peekType()==="insert"&&(w||S.peekType()!=="insert"))b.retain(u.length(m.next()));else if(S.peekType()==="insert")b.push(S.next());else{var g=Math.min(m.peekLength(),S.peekLength()),h=m.next(g),v=S.next(g);if(h.delete)continue;v.delete?b.push(v):b.retain(g,u.attributes.transform(h.attributes,v.attributes,w))}return b.chop()},p.prototype.transformPosition=function(E,w){w=!!w;for(var m=u.iterator(this.ops),S=0;m.hasNext()&&S<=E;){var b=m.peekLength(),g=m.peekType();if(m.next(),g==="delete"){E-=Math.min(b,E-S);continue}else g==="insert"&&(S<E||!w)&&(E+=b);S+=b}return E},r.exports=p},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):a.call(m)==="[object Array]"},f=function(m){if(!m||a.call(m)!=="[object Object]")return!1;var S=i.call(m,"constructor"),b=m.constructor&&m.constructor.prototype&&i.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!S&&!b)return!1;var g;for(g in m);return typeof g>"u"||i.call(m,g)},p=function(m,S){o&&S.name==="__proto__"?o(m,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):m[S.name]=S.newValue},E=function(m,S){if(S==="__proto__")if(i.call(m,S)){if(l)return l(m,S).value}else return;return m[S]};r.exports=function w(){var m,S,b,g,h,v,d=arguments[0],y=1,_=arguments.length,R=!1;for(typeof d=="boolean"&&(R=d,d=arguments[1]||{},y=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});y<_;++y)if(m=arguments[y],m!=null)for(S in m)b=E(d,S),g=E(m,S),d!==g&&(R&&g&&(f(g)||(h=u(g)))?(h?(h=!1,v=b&&u(b)?b:[]):v=b&&f(b)?b:{},p(d,{name:S,newValue:w(R,v,g)})):typeof g<"u"&&p(d,{name:S,newValue:g}));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 Z=Object.getPrototypeOf(M);return Z===null?void 0:k(Z,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),p=d(f),E=i(0),w=d(E),m=i(16),S=d(m),b=i(6),g=d(b),h=i(7),v=d(h);function d(k){return k&&k.__esModule?k:{default:k}}function y(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 R(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,x=function(k){R(M,k);function M(){return y(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 p.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(H,G){var Z=w.default.query(H,w.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,G)}},{key:"formatAt",value:function(H,G,Z,W){this.format(Z,W)}},{key:"insertAt",value:function(H,G,Z){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,Z)}}]),M}(w.default.Embed);x.scope=w.default.Scope.BLOCK_BLOT;var O=function(k){R(M,k);function M(I){y(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(),P(G))},new p.default).insert(`
116
+ `,P(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,Z,W){G<=0||(w.default.query(Z,w.default.Scope.BLOCK)?H+G===this.length()&&this.format(Z,W):o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"formatAt",this).call(this,H,Math.min(G,this.length()-H-1),Z,W),this.cache={})}},{key:"insertAt",value:function(H,G,Z){if(Z!=null)return o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertAt",this).call(this,H,G,Z);if(G.length!==0){var W=G.split(`
117
+ `),B=W.shift();B.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),B):this.children.tail.insertAt(this.children.tail.length(),B),this.cache={});var F=this;W.reduce(function(T,L){return F=F.split(T,!0),F.insertAt(0,L),L.length},H+B.length)}}},{key:"insertBefore",value:function(H,G){var Z=this.children.head;o(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"insertBefore",this).call(this,H,G),Z instanceof S.default&&Z.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 Z=this.clone();return H===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}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=[g.default,w.default.Embed,v.default];function P(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:P(k.parent,M)}n.bubbleFormats=P,n.BlockEmbed=x,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(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},o=function(){function F(T,L){var z=[],D=!0,$=!1,K=void 0;try{for(var V=T[Symbol.iterator](),U;!(D=(U=V.next()).done)&&(z.push(U.value),!(L&&z.length===L));D=!0);}catch(Y){$=!0,K=Y}finally{try{!D&&V.return&&V.return()}finally{if($)throw K}}return z}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return F(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function F(T,L){for(var z=0;z<L.length;z++){var D=L[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}return function(T,L,z){return L&&F(T.prototype,L),z&&F(T,z),T}}();i(50);var u=i(2),f=P(u),p=i(14),E=P(p),w=i(8),m=P(w),S=i(9),b=P(S),g=i(0),h=P(g),v=i(15),d=P(v),y=i(3),_=P(y),R=i(10),C=P(R),x=i(34),O=P(x);function P(F){return F&&F.__esModule?F:{default:F}}function k(F,T,L){return T in F?Object.defineProperty(F,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):F[T]=L,F}function M(F,T){if(!(F instanceof T))throw new TypeError("Cannot call a class as a function")}var I=(0,C.default)("quill"),H=function(){l(F,null,[{key:"debug",value:function(L){L===!0&&(L="log"),C.default.level(L)}},{key:"find",value:function(L){return L.__quill||h.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 D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var K=L.attrName||L.blotName;typeof K=="string"?this.register("formats/"+K,L,z):Object.keys(L).forEach(function(V){D.register(V,L[V],z)})}else this.imports[L]!=null&&!$&&I.warn("Overwriting "+L+" with",z),this.imports[L]=z,(L.startsWith("blots/")||L.startsWith("formats/"))&&z.blotName!=="abstract"?h.default.register(z):L.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function F(T){var L=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(this,F),this.options=G(T,z),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",T);this.options.debug&&F.debug(this.options.debug);var D=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 m.default,this.scroll=h.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(m.default.events.EDITOR_CHANGE,function(K){K===m.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(m.default.events.SCROLL_UPDATE,function(K,V){var U=L.selection.lastRange,Y=U&&U.length===0?U.index:void 0;Z.call(L,function(){return L.editor.update(null,V,Y)},K)});var $=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents($),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(F,[{key:"addContainer",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var D=L;L=document.createElement("div"),L.classList.add(D)}return this.container.insertBefore(L,z),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,z,D){var $=this,K=W(L,z,D),V=o(K,4);return L=V[0],z=V[1],D=V[3],Z.call(this,function(){return $.editor.deleteText(L,z)},D,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 D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;return Z.call(this,function(){var K=D.getSelection(!0),V=new f.default;if(K==null)return V;if(h.default.query(L,h.default.Scope.BLOCK))V=D.editor.formatLine(K.index,K.length,k({},L,z));else{if(K.length===0)return D.selection.format(L,z),V;V=D.editor.formatText(K.index,K.length,k({},L,z))}return D.setSelection(K,m.default.sources.SILENT),V},$)}},{key:"formatLine",value:function(L,z,D,$,K){var V=this,U=void 0,Y=W(L,z,D,$,K),X=o(Y,4);return L=X[0],z=X[1],U=X[2],K=X[3],Z.call(this,function(){return V.editor.formatLine(L,z,U)},K,L,0)}},{key:"formatText",value:function(L,z,D,$,K){var V=this,U=void 0,Y=W(L,z,D,$,K),X=o(Y,4);return L=X[0],z=X[1],U=X[2],K=X[3],Z.call(this,function(){return V.editor.formatText(L,z,U)},K,L,0)}},{key:"getBounds",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof L=="number"?D=this.selection.getBounds(L,z):D=this.selection.getBounds(L.index,L.length);var $=this.container.getBoundingClientRect();return{bottom:D.bottom-$.top,height:D.height,left:D.left-$.left,right:D.right-$.left,top:D.top-$.top,width:D.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,D=W(L,z),$=o(D,2);return L=$[0],z=$[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,D=W(L,z),$=o(D,2);return L=$[0],z=$[1],this.editor.getText(L,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,z,D){var $=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F.sources.API;return Z.call(this,function(){return $.editor.insertEmbed(L,z,D)},K,L)}},{key:"insertText",value:function(L,z,D,$,K){var V=this,U=void 0,Y=W(L,0,D,$,K),X=o(Y,4);return L=X[0],U=X[2],K=X[3],Z.call(this,function(){return V.editor.insertText(L,z,U)},K,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,D){this.clipboard.dangerouslyPasteHTML(L,z,D)}},{key:"removeFormat",value:function(L,z,D){var $=this,K=W(L,z,D),V=o(K,4);return L=V[0],z=V[1],D=V[3],Z.call(this,function(){return $.editor.removeFormat(L,z)},D,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return Z.call(this,function(){L=new f.default(L);var $=z.getLength(),K=z.editor.deleteText(0,$),V=z.editor.applyDelta(L),U=V.ops[V.ops.length-1];U!=null&&typeof U.insert=="string"&&U.insert[U.insert.length-1]===`
118
+ `&&(z.editor.deleteText(z.getLength()-1,1),V.delete(1));var Y=K.compose(V);return Y},D)}},{key:"setSelection",value:function(L,z,D){if(L==null)this.selection.setRange(null,z||F.sources.API);else{var $=W(L,z,D),K=o($,4);L=K[0],z=K[1],D=K[3],this.selection.setRange(new v.Range(L,z),D),D!==m.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API,D=new f.default().insert(L);return this.setContents(D,z)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m.default.sources.USER,z=this.scroll.update(L);return this.selection.update(L),z}},{key:"updateContents",value:function(L){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return Z.call(this,function(){return L=new f.default(L),z.editor.applyDelta(L,D)},D,!0)}}]),F}();H.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},H.events=m.default.events,H.sources=m.default.sources,H.version="1.3.7",H.imports={delta:f.default,parchment:h.default,"core/module":b.default,"core/theme":O.default};function G(F,T){if(T=(0,_.default)(!0,{container:F,modules:{clipboard:!0,keyboard:!0,history:!0}},T),!T.theme||T.theme===H.DEFAULTS.theme)T.theme=O.default;else if(T.theme=H.import("themes/"+T.theme),T.theme==null)throw new Error("Invalid theme "+T.theme+". Did you register it?");var L=(0,_.default)(!0,{},T.theme.DEFAULTS);[L,T].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(K){$.modules[K]===!0&&($.modules[K]={})})});var z=Object.keys(L.modules).concat(Object.keys(T.modules)),D=z.reduce(function($,K){var V=H.import("modules/"+K);return V==null?I.error("Cannot load "+K+" module. Are you sure you registered it?"):$[K]=V.DEFAULTS||{},$},{});return T.modules!=null&&T.modules.toolbar&&T.modules.toolbar.constructor!==Object&&(T.modules.toolbar={container:T.modules.toolbar}),T=(0,_.default)(!0,{},H.DEFAULTS,{modules:D},L,T),["bounds","container","scrollingContainer"].forEach(function($){typeof T[$]=="string"&&(T[$]=document.querySelector(T[$]))}),T.modules=Object.keys(T.modules).reduce(function($,K){return T.modules[K]&&($[K]=T.modules[K]),$},{}),T}function Z(F,T,L,z){if(this.options.strict&&!this.isEnabled()&&T===m.default.sources.USER)return new f.default;var D=L==null?null:this.getSelection(),$=this.editor.delta,K=F();if(D!=null&&(L===!0&&(L=D.index),z==null?D=B(D,K,T):z!==0&&(D=B(D,L,z,T)),this.setSelection(D,m.default.sources.SILENT)),K.length()>0){var V,U=[m.default.events.TEXT_CHANGE,K,$,T];if((V=this.emitter).emit.apply(V,[m.default.events.EDITOR_CHANGE].concat(U)),T!==m.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,U)}}return K}function W(F,T,L,z,D){var $={};return typeof F.index=="number"&&typeof F.length=="number"?typeof T!="number"?(D=z,z=L,L=T,T=F.length,F=F.index):(T=F.length,F=F.index):typeof T!="number"&&(D=z,z=L,L=T,T=0),(typeof L>"u"?"undefined":a(L))==="object"?($=L,D=z):typeof L=="string"&&(z!=null?$[L]=z:D=L),D=D||m.default.sources.API,[F,T,$,D]}function B(F,T,L,z){if(F==null)return null;var D=void 0,$=void 0;if(T instanceof f.default){var K=[F.index,F.index+F.length].map(function(X){return T.transformPosition(X,z!==m.default.sources.USER)}),V=o(K,2);D=V[0],$=V[1]}else{var U=[F.index,F.index+F.length].map(function(X){return X<T||X===T&&z===m.default.sources.USER?X:L>=0?X+L:Math.max(T,X+L)}),Y=o(U,2);D=Y[0],$=Y[1]}return new v.Range(D,$-D)}n.expandConfig=G,n.overload=W,n.default=H},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(h,v){for(var d=0;d<v.length;d++){var y=v[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,v,d){return v&&g(h.prototype,v),d&&g(h,d),h}}(),o=function g(h,v,d){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,v);if(y===void 0){var _=Object.getPrototypeOf(h);return _===null?void 0:g(_,v,d)}else{if("value"in y)return y.value;var R=y.get;return R===void 0?void 0:R.call(d)}},l=i(7),u=E(l),f=i(0),p=E(f);function E(g){return g&&g.__esModule?g:{default:g}}function w(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function m(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function S(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var b=function(g){S(h,g);function h(){return w(this,h),m(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"formatAt",value:function(d,y,_,R){if(h.compare(this.statics.blotName,_)<0&&p.default.query(_,p.default.Scope.BLOT)){var C=this.isolate(d,y);R&&C.wrap(_,R)}else o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"formatAt",this).call(this,d,y,_,R)}},{key:"optimize",value:function(d){if(o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"optimize",this).call(this,d),this.parent instanceof h&&h.compare(this.statics.blotName,this.parent.statics.blotName)>0){var y=this.parent.isolate(this.offset(),this.length());this.moveChildren(y),y.wrap(this)}}}],[{key:"compare",value:function(d,y){var _=h.order.indexOf(d),R=h.order.indexOf(y);return _>=0||R>=0?_-R:d===y?0:d<y?-1:1}}]),h}(p.default.Inline);b.allowedChildren=[b,p.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,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function f(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function p(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var E=function(w){p(m,w);function m(){return u(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(o.default.Text);n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(d,y){for(var _=0;_<y.length;_++){var R=y[_];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(d,R.key,R)}}return function(d,y,_){return y&&v(d.prototype,y),_&&v(d,_),d}}(),o=function v(d,y,_){d===null&&(d=Function.prototype);var R=Object.getOwnPropertyDescriptor(d,y);if(R===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:v(C,y,_)}else{if("value"in R)return R.value;var x=R.get;return x===void 0?void 0:x.call(_)}},l=i(54),u=E(l),f=i(10),p=E(f);function E(v){return v&&v.__esModule?v:{default:v}}function w(v,d){if(!(v instanceof d))throw new TypeError("Cannot call a class as a function")}function m(v,d){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:v}function S(v,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);v.prototype=Object.create(d&&d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(v,d):v.__proto__=d)}var b=(0,p.default)("quill:events"),g=["selectionchange","mousedown","mouseup","click"];g.forEach(function(v){document.addEventListener(v,function(){for(var d=arguments.length,y=Array(d),_=0;_<d;_++)y[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(R){if(R.__quill&&R.__quill.emitter){var C;(C=R.__quill.emitter).handleDOM.apply(C,y)}})})});var h=function(v){S(d,v);function d(){w(this,d);var y=m(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return y.listeners={},y.on("error",b.error),y}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 R=arguments.length,C=Array(R>1?R-1:0),x=1;x<R;x++)C[x-1]=arguments[x];(this.listeners[_.type]||[]).forEach(function(O){var P=O.node,k=O.handler;(_.target===P||P.contains(_.target))&&k.apply(void 0,[_].concat(C))})}},{key:"listenDOM",value:function(_,R,C){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:R,handler:C})}}]),d}(u.default);h.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"},h.sources={API:"api",SILENT:"silent",USER:"user"},n.default=h},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 p,E=arguments.length,w=Array(E>1?E-1:0),m=1;m<E;m++)w[m-1]=arguments[m];(p=console)[f].apply(p,w)}}function u(f){return a.reduce(function(p,E){return p[E]=l.bind(console,E,f),p},{})}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,m,S){return S||(S={}),w===m?!0:w instanceof Date&&m instanceof Date?w.getTime()===m.getTime():!w||!m||typeof w!="object"&&typeof m!="object"?S.strict?w===m:w==m:E(w,m,S)};function f(w){return w==null}function p(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,m,S){var b,g;if(f(w)||f(m)||w.prototype!==m.prototype)return!1;if(l(w))return l(m)?(w=a.call(w),m=a.call(m),u(w,m,S)):!1;if(p(w)){if(!p(m)||w.length!==m.length)return!1;for(b=0;b<w.length;b++)if(w[b]!==m[b])return!1;return!0}try{var h=o(w),v=o(m)}catch{return!1}if(h.length!=v.length)return!1;for(h.sort(),v.sort(),b=h.length-1;b>=0;b--)if(h[b]!=v[b])return!1;for(b=h.length-1;b>=0;b--)if(g=h[b],!u(w[g],m[g],S))return!1;return typeof w==typeof m}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,p){p===void 0&&(p={}),this.attrName=u,this.keyName=f;var E=a.Scope.TYPE&a.Scope.ATTRIBUTE;p.scope!=null?this.scope=p.scope&a.Scope.LEVEL|E:this.scope=a.Scope.ATTRIBUTE,p.whitelist!=null&&(this.whitelist=p.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 p=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return p==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 x(O,P){var k=[],M=!0,I=!1,H=void 0;try{for(var G=O[Symbol.iterator](),Z;!(M=(Z=G.next()).done)&&(k.push(Z.value),!(P&&k.length===P));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,P){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return x(O,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(O,P){for(var k=0;k<P.length;k++){var M=P[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}return function(O,P,k){return P&&x(O.prototype,P),k&&x(O,k),O}}(),l=function x(O,P,k){O===null&&(O=Function.prototype);var M=Object.getOwnPropertyDescriptor(O,P);if(M===void 0){var I=Object.getPrototypeOf(O);return I===null?void 0:x(I,P,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=v(u),p=i(0),E=v(p),w=i(4),m=v(w),S=i(6),b=v(S),g=i(7),h=v(g);function v(x){return x&&x.__esModule?x:{default:x}}function d(x,O){if(!(x instanceof O))throw new TypeError("Cannot call a class as a function")}function y(x,O){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:x}function _(x,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);x.prototype=Object.create(O&&O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(x,O):x.__proto__=O)}var R=function(x){_(O,x);function O(){return d(this,O),y(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return O}(b.default);R.blotName="code",R.tagName="CODE";var C=function(x){_(O,x);function O(){return d(this,O),y(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(h.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 Z=this.newlineIndex(k,!0)+1,W=G-Z+1,B=this.isolate(Z,W),F=B.next;B.format(I,H),F instanceof O&&F.formatAt(0,k-Z+M-W,I,H)}}}},{key:"insertAt",value:function(k,M,I){if(I==null){var H=this.descendant(h.default,k),G=a(H,2),Z=G[0],W=G[1];Z.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}(m.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=R,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},o=function(){function F(T,L){var z=[],D=!0,$=!1,K=void 0;try{for(var V=T[Symbol.iterator](),U;!(D=(U=V.next()).done)&&(z.push(U.value),!(L&&z.length===L));D=!0);}catch(Y){$=!0,K=Y}finally{try{!D&&V.return&&V.return()}finally{if($)throw K}}return z}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return F(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function F(T,L){for(var z=0;z<L.length;z++){var D=L[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}return function(T,L,z){return L&&F(T.prototype,L),z&&F(T,z),T}}(),u=i(2),f=M(u),p=i(20),E=M(p),w=i(0),m=M(w),S=i(13),b=M(S),g=i(24),h=M(g),v=i(4),d=M(v),y=i(16),_=M(y),R=i(21),C=M(R),x=i(11),O=M(x),P=i(3),k=M(P);function M(F){return F&&F.__esModule?F:{default:F}}function I(F,T,L){return T in F?Object.defineProperty(F,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):F[T]=L,F}function H(F,T){if(!(F instanceof T))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Z=function(){function F(T){H(this,F),this.scroll=T,this.delta=this.getDelta()}return l(F,[{key:"applyDelta",value:function(L){var z=this,D=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),L=B(L),L.reduce(function(K,V){var U=V.retain||V.delete||V.insert.length||1,Y=V.attributes||{};if(V.insert!=null){if(typeof V.insert=="string"){var X=V.insert;X.endsWith(`
127
+ `)&&D&&(D=!1,X=X.slice(0,-1)),K>=$&&!X.endsWith(`
128
+ `)&&(D=!0),z.scroll.insertAt(K,X);var Q=z.scroll.line(K),te=o(Q,2),ee=te[0],ne=te[1],ie=(0,k.default)({},(0,v.bubbleFormats)(ee));if(ee instanceof d.default){var oe=ee.descendant(m.default.Leaf,ne),ke=o(oe,1),Ie=ke[0];ie=(0,k.default)(ie,(0,v.bubbleFormats)(Ie))}Y=E.default.attributes.diff(ie,Y)||{}}else if(a(V.insert)==="object"){var le=Object.keys(V.insert)[0];if(le==null)return K;z.scroll.insertAt(K,le,V.insert[le])}$+=U}return Object.keys(Y).forEach(function(fe){z.scroll.formatAt(K,U,fe,Y[fe])}),K+U},0),L.reduce(function(K,V){return typeof V.delete=="number"?(z.scroll.deleteAt(K,V.delete),K):K+(V.retain||V.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 D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys($).forEach(function(K){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[K])){var V=D.scroll.lines(L,Math.max(z,1)),U=z;V.forEach(function(Y){var X=Y.length();if(!(Y instanceof b.default))Y.format(K,$[K]);else{var Q=L-Y.offset(D.scroll),te=Y.newlineIndex(Q+U)-Q+1;Y.formatAt(Q,te,K,$[K])}U-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(L).retain(z,(0,C.default)($)))}},{key:"formatText",value:function(L,z){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(K){D.scroll.formatAt(L,z,K,$[K])}),this.update(new f.default().retain(L).retain(z,(0,C.default)($)))}},{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,D=[],$=[];z===0?this.scroll.path(L).forEach(function(V){var U=o(V,1),Y=U[0];Y instanceof d.default?D.push(Y):Y instanceof m.default.Leaf&&$.push(Y)}):(D=this.scroll.lines(L,z),$=this.scroll.descendants(m.default.Leaf,L,z));var K=[D,$].map(function(V){if(V.length===0)return{};for(var U=(0,v.bubbleFormats)(V.shift());Object.keys(U).length>0;){var Y=V.shift();if(Y==null)return U;U=W((0,v.bubbleFormats)(Y),U)}return U});return k.default.apply(k.default,K)}},{key:"getText",value:function(L,z){return this.getContents(L,z).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(L,z,D){return this.scroll.insertAt(L,z,D),this.update(new f.default().retain(L).insert(I({},z,D)))}},{key:"insertText",value:function(L,z){var D=this,$=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($).forEach(function(K){D.scroll.formatAt(L,z.length,K,$[K])}),this.update(new f.default().retain(L).insert(z,(0,C.default)($)))}},{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 D=this.getText(L,z),$=this.scroll.line(L+z),K=o($,2),V=K[0],U=K[1],Y=0,X=new f.default;V!=null&&(V instanceof b.default?Y=V.newlineIndex(U)-U+1:Y=V.length()-U,X=V.delta().slice(U,U+Y-1).insert(`
131
+ `));var Q=this.getContents(L,z+Y),te=Q.diff(new f.default().insert(D).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]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(G)&&m.default.find(z[0].target)){var K=m.default.find(z[0].target),V=(0,v.bubbleFormats)(K),U=K.offset(this.scroll),Y=z[0].oldValue.replace(h.default.CONTENTS,""),X=new f.default().insert(Y),Q=new f.default().insert(K.value()),te=new f.default().retain(U).concat(X.diff(Q,D));L=te.reduce(function(ee,ne){return ne.insert?ee.insert(ne.insert,V):ee.push(ne)},new f.default),this.delta=$.compose(L)}else this.delta=this.getDelta(),(!L||!(0,O.default)($.compose(L),this.delta))&&(L=$.diff(this.delta,D));return L}}]),F}();function W(F,T){return Object.keys(T).reduce(function(L,z){return F[z]==null||(T[z]===F[z]?L[z]=T[z]:Array.isArray(T[z])?T[z].indexOf(F[z])<0&&(L[z]=T[z].concat([F[z]])):L[z]=[T[z],F[z]]),L},{})}function B(F){return F.reduce(function(T,L){if(L.insert===1){var z=(0,C.default)(L.attributes);return delete z.image,T.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 D=L.insert.replace(/\r\n/g,`
132
+ `).replace(/\r/g,`
133
+ `);return T.insert(D,L.attributes)}return T.push(L)},new f.default)}n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function x(O,P){var k=[],M=!0,I=!1,H=void 0;try{for(var G=O[Symbol.iterator](),Z;!(M=(Z=G.next()).done)&&(k.push(Z.value),!(P&&k.length===P));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,P){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return x(O,P);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(O,P){for(var k=0;k<P.length;k++){var M=P[k];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}return function(O,P,k){return P&&x(O.prototype,P),k&&x(O,k),O}}(),l=i(0),u=h(l),f=i(21),p=h(f),E=i(11),w=h(E),m=i(8),S=h(m),b=i(10),g=h(b);function h(x){return x&&x.__esModule?x:{default:x}}function v(x){if(Array.isArray(x)){for(var O=0,P=Array(x.length);O<x.length;O++)P[O]=x[O];return P}else return Array.from(x)}function d(x,O){if(!(x instanceof O))throw new TypeError("Cannot call a class as a function")}var y=(0,g.default)("quill:selection"),_=function x(O){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,x),this.index=O,this.length=P},R=function(){function x(O,P){var k=this;d(this,x),this.emitter=P,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,Z=H.startOffset,W=H.endNode,B=H.endOffset;k.setNativeRange(G,Z,W,B)}}),this.update(S.default.sources.SILENT)}return o(x,[{key:"handleComposition",value:function(){var P=this;this.root.addEventListener("compositionstart",function(){P.composing=!0}),this.root.addEventListener("compositionend",function(){if(P.composing=!1,P.cursor.parent){var k=P.cursor.restore();if(!k)return;setTimeout(function(){P.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var P=this;this.emitter.listenDOM("mousedown",document.body,function(){P.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){P.mouseDown=!1,P.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(P,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[P])){this.scroll.update();var M=this.getNativeRange();if(!(M==null||!M.native.collapsed||u.default.query(P,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(P,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(P){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=this.scroll.length();P=Math.min(P,M-1),k=Math.min(P+k,M-1)-P;var I=void 0,H=this.scroll.leaf(P),G=a(H,2),Z=G[0],W=G[1];if(Z==null)return null;var B=Z.position(W,!0),F=a(B,2);I=F[0],W=F[1];var T=document.createRange();if(k>0){T.setStart(I,W);var L=this.scroll.leaf(P+k),z=a(L,2);if(Z=z[0],W=z[1],Z==null)return null;var D=Z.position(W,!0),$=a(D,2);return I=$[0],W=$[1],T.setEnd(I,W),T.getBoundingClientRect()}else{var K="left",V=void 0;return I instanceof Text?(W<I.data.length?(T.setStart(I,W),T.setEnd(I,W+1)):(T.setStart(I,W-1),T.setEnd(I,W),K="right"),V=T.getBoundingClientRect()):(V=Z.domNode.getBoundingClientRect(),W>0&&(K="right")),{bottom:V.top+V.height,height:V.height,left:V[K],right:V[K],top:V.top,width:0}}}},{key:"getNativeRange",value:function(){var P=document.getSelection();if(P==null||P.rangeCount<=0)return null;var k=P.getRangeAt(0);if(k==null)return null;var M=this.normalizeNative(k);return y.info("getNativeRange",M),M}},{key:"getRange",value:function(){var P=this.getNativeRange();if(P==null)return[null,null];var k=this.normalizedToRange(P);return[k,P]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(P){var k=this,M=[[P.start.node,P.start.offset]];P.native.collapsed||M.push([P.end.node,P.end.offset]);var I=M.map(function(Z){var W=a(Z,2),B=W[0],F=W[1],T=u.default.find(B,!0),L=T.offset(k.scroll);return F===0?L:T instanceof u.default.Container?L+T.length():L+T.index(B,F)}),H=Math.min(Math.max.apply(Math,v(I)),this.scroll.length()-1),G=Math.min.apply(Math,[H].concat(v(I)));return new _(G,H-G)}},{key:"normalizeNative",value:function(P){if(!C(this.root,P.startContainer)||!P.collapsed&&!C(this.root,P.endContainer))return null;var k={start:{node:P.startContainer,offset:P.startOffset},end:{node:P.endContainer,offset:P.endOffset},native:P};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(P){var k=this,M=P.collapsed?[P.index]:[P.index,P.index+P.length],I=[],H=this.scroll.length();return M.forEach(function(G,Z){G=Math.min(H-1,G);var W=void 0,B=k.scroll.leaf(G),F=a(B,2),T=F[0],L=F[1],z=T.position(L,Z!==0),D=a(z,2);W=D[0],L=D[1],I.push(W,L)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(P){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),Z=G[0],W=Z;if(k.length>0){var B=this.scroll.line(Math.min(k.index+k.length,I)),F=a(B,1);W=F[0]}if(!(Z==null||W==null)){var T=P.getBoundingClientRect();M.top<T.top?P.scrollTop-=T.top-M.top:M.bottom>T.bottom&&(P.scrollTop+=M.bottom-T.bottom)}}}}},{key:"setNativeRange",value:function(P,k){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(y.info("setNativeRange",P,k,M,I),!(P!=null&&(this.root.parentNode==null||P.parentNode==null||M.parentNode==null))){var G=document.getSelection();if(G!=null)if(P!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||H||P!==Z.startContainer||k!==Z.startOffset||M!==Z.endContainer||I!==Z.endOffset){P.tagName=="BR"&&(k=[].indexOf.call(P.parentNode.childNodes,P),P=P.parentNode),M.tagName=="BR"&&(I=[].indexOf.call(M.parentNode.childNodes,M),M=M.parentNode);var W=document.createRange();W.setStart(P,k),W.setEnd(M,I),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(P){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),y.info("setRange",P),P!=null){var I=this.rangeToNative(P);this.setNativeRange.apply(this,v(I).concat([k]))}else this.setNativeRange(null);this.update(M)}},{key:"update",value:function(){var P=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 Z;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[S.default.events.SELECTION_CHANGE,(0,p.default)(this.lastRange),(0,p.default)(k),P];if((Z=this.emitter).emit.apply(Z,[S.default.events.EDITOR_CHANGE].concat(W)),P!==S.default.sources.SILENT){var B;(B=this.emitter).emit.apply(B,W)}}}}]),x}();function C(x,O){try{O.parentNode}catch{return!1}return O instanceof Text&&(O=O.parentNode),x.contains(O)}n.Range=_,n.default=R},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,g){for(var h=0;h<g.length;h++){var v=g[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,g,h){return g&&S(b.prototype,g),h&&S(b,h),b}}(),o=function S(b,g,h){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,g);if(v===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,g,h)}else{if("value"in v)return v.value;var y=v.get;return y===void 0?void 0:y.call(h)}},l=i(0),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function p(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 m=function(S){w(b,S);function b(){return p(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"insertInto",value:function(h,v){h.children.length===0?o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertInto",this).call(this,h,v):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),b}(u.default.Embed);m.blotName="break",m.tagName="BR",n.default=m},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,m){w.__proto__=m}||function(w,m){for(var S in m)m.hasOwnProperty(S)&&(w[S]=m[S])};return function(w,m){E(w,m);function S(){this.constructor=w}w.prototype=m===null?Object.create(m):(S.prototype=m.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(m){var S=E.call(this,m)||this;return S.build(),S}return w.prototype.appendChild=function(m){this.insertBefore(m)},w.prototype.attach=function(){E.prototype.attach.call(this),this.children.forEach(function(m){m.attach()})},w.prototype.build=function(){var m=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var b=p(S);m.insertBefore(b,m.children.head||void 0)}catch(g){if(g instanceof u.ParchmentError)return;throw g}})},w.prototype.deleteAt=function(m,S){if(m===0&&S===this.length())return this.remove();this.children.forEachAt(m,S,function(b,g,h){b.deleteAt(g,h)})},w.prototype.descendant=function(m,S){var b=this.children.find(S),g=b[0],h=b[1];return m.blotName==null&&m(g)||m.blotName!=null&&g instanceof m?[g,h]:g instanceof w?g.descendant(m,h):[null,-1]},w.prototype.descendants=function(m,S,b){S===void 0&&(S=0),b===void 0&&(b=Number.MAX_VALUE);var g=[],h=b;return this.children.forEachAt(S,b,function(v,d,y){(m.blotName==null&&m(v)||m.blotName!=null&&v instanceof m)&&g.push(v),v instanceof w&&(g=g.concat(v.descendants(m,d,h))),h-=y}),g},w.prototype.detach=function(){this.children.forEach(function(m){m.detach()}),E.prototype.detach.call(this)},w.prototype.formatAt=function(m,S,b,g){this.children.forEachAt(m,S,function(h,v,d){h.formatAt(v,d,b,g)})},w.prototype.insertAt=function(m,S,b){var g=this.children.find(m),h=g[0],v=g[1];if(h)h.insertAt(v,S,b);else{var d=b==null?u.create("text",S):u.create(S,b);this.appendChild(d)}},w.prototype.insertBefore=function(m,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(b){return m instanceof b}))throw new u.ParchmentError("Cannot insert "+m.statics.blotName+" into "+this.statics.blotName);m.insertInto(this,S)},w.prototype.length=function(){return this.children.reduce(function(m,S){return m+S.length()},0)},w.prototype.moveChildren=function(m,S){this.children.forEach(function(b){m.insertBefore(b,S)})},w.prototype.optimize=function(m){if(E.prototype.optimize.call(this,m),this.children.length===0)if(this.statics.defaultChild!=null){var S=u.create(this.statics.defaultChild);this.appendChild(S),S.optimize(m)}else this.remove()},w.prototype.path=function(m,S){S===void 0&&(S=!1);var b=this.children.find(m,S),g=b[0],h=b[1],v=[[this,m]];return g instanceof w?v.concat(g.path(h,S)):(g!=null&&v.push([g,h]),v)},w.prototype.removeChild=function(m){this.children.remove(m)},w.prototype.replace=function(m){m instanceof w&&m.moveChildren(this),E.prototype.replace.call(this,m)},w.prototype.split=function(m,S){if(S===void 0&&(S=!1),!S){if(m===0)return this;if(m===this.length())return this.next}var b=this.clone();return this.parent.insertBefore(b,this.next),this.children.forEachAt(m,this.length(),function(g,h,v){g=g.split(h,S),b.appendChild(g)}),b},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(m,S){var b=this,g=[],h=[];m.forEach(function(v){v.target===b.domNode&&v.type==="childList"&&(g.push.apply(g,v.addedNodes),h.push.apply(h,v.removedNodes))}),h.forEach(function(v){if(!(v.parentNode!=null&&v.tagName!=="IFRAME"&&document.body.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(v);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===b.domNode)&&d.detach()}}),g.filter(function(v){return v.parentNode==b.domNode}).sort(function(v,d){return v===d?0:v.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(v){var d=null;v.nextSibling!=null&&(d=u.find(v.nextSibling));var y=p(v);(y.next!=d||y.next==null)&&(y.parent!=null&&y.parent.removeChild(b),b.insertBefore(y,d||void 0))})},w}(l.default);function p(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,m){w.__proto__=m}||function(w,m){for(var S in m)m.hasOwnProperty(S)&&(w[S]=m[S])};return function(w,m){E(w,m);function S(){this.constructor=w}w.prototype=m===null?Object.create(m):(S.prototype=m.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),p=function(E){a(w,E);function w(m){var S=E.call(this,m)||this;return S.attributes=new l.default(S.domNode),S}return w.formats=function(m){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return m.tagName.toLowerCase()},w.prototype.format=function(m,S){var b=f.query(m);b instanceof o.default?this.attributes.attribute(b,S):S&&b!=null&&(m!==this.statics.blotName||this.formats()[m]!==S)&&this.replaceWith(m,S)},w.prototype.formats=function(){var m=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(m[this.statics.blotName]=S),m},w.prototype.replaceWith=function(m,S){var b=E.prototype.replaceWith.call(this,m,S);return this.attributes.copy(b),b},w.prototype.update=function(m,S){var b=this;E.prototype.update.call(this,m,S),m.some(function(g){return g.target===b.domNode&&g.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(m,S){var b=E.prototype.wrap.call(this,m,S);return b instanceof w&&b.statics.scope===this.statics.scope&&this.attributes.move(b),b},w}(u.default);n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var w in E)E.hasOwnProperty(w)&&(p[w]=E[w])};return function(p,E){f(p,E);function w(){this.constructor=p}p.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(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.value=function(E){return!0},p.prototype.index=function(E,w){return this.domNode===E||this.domNode.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},p.prototype.position=function(E,w){var m=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return E>0&&(m+=1),[this.parent.domNode,m]},p.prototype.value=function(){var E;return E={},E[this.statics.blotName]=this.statics.value(this.domNode)||!0,E},p.scope=l.Scope.INLINE_BLOT,p}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,p,E){typeof f!="object"&&(f={}),typeof p!="object"&&(p={});var w=o(!0,{},p);E||(w=Object.keys(w).reduce(function(S,b){return w[b]!=null&&(S[b]=w[b]),S},{}));for(var m in f)f[m]!==void 0&&p[m]===void 0&&(w[m]=f[m]);return Object.keys(w).length>0?w:void 0},diff:function(f,p){typeof f!="object"&&(f={}),typeof p!="object"&&(p={});var E=Object.keys(f).concat(Object.keys(p)).reduce(function(w,m){return a(f[m],p[m])||(w[m]=p[m]===void 0?null:p[m]),w},{});return Object.keys(E).length>0?E:void 0},transform:function(f,p,E){if(typeof f!="object")return p;if(typeof p=="object"){if(!E)return p;var w=Object.keys(p).reduce(function(m,S){return f[S]===void 0&&(m[S]=p[S]),m},{});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 p=this.ops[this.index];if(p){var E=this.offset,w=l.length(p);if(f>=w-E?(f=w-E,this.index+=1,this.offset=0):this.offset+=f,typeof p.delete=="number")return{delete:f};var m={};return p.attributes&&(m.attributes=p.attributes),typeof p.retain=="number"?m.retain=f:typeof p.insert=="string"?m.insert=p.insert.substr(E,f):m.insert=p.insert,m}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,p=this.index,E=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=p,[E].concat(w)}else return[]},r.exports=l},function(r,n){var i=function(){function a(b,g){return g!=null&&b instanceof g}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,g,h,v,d){typeof g=="object"&&(h=g.depth,v=g.prototype,d=g.includeNonEnumerable,g=g.circular);var y=[],_=[],R=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof h>"u"&&(h=1/0);function C(x,O){if(x===null)return null;if(O===0)return x;var P,k;if(typeof x!="object")return x;if(a(x,o))P=new o;else if(a(x,l))P=new l;else if(a(x,u))P=new u(function(T,L){x.then(function(z){T(C(z,O-1))},function(z){L(C(z,O-1))})});else if(f.__isArray(x))P=[];else if(f.__isRegExp(x))P=new RegExp(x.source,S(x)),x.lastIndex&&(P.lastIndex=x.lastIndex);else if(f.__isDate(x))P=new Date(x.getTime());else{if(R&&Buffer.isBuffer(x))return Buffer.allocUnsafe?P=Buffer.allocUnsafe(x.length):P=new Buffer(x.length),x.copy(P),P;a(x,Error)?P=Object.create(x):typeof v>"u"?(k=Object.getPrototypeOf(x),P=Object.create(k)):(P=Object.create(v),k=v)}if(g){var M=y.indexOf(x);if(M!=-1)return _[M];y.push(x),_.push(P)}a(x,o)&&x.forEach(function(T,L){var z=C(L,O-1),D=C(T,O-1);P.set(z,D)}),a(x,l)&&x.forEach(function(T){var L=C(T,O-1);P.add(L)});for(var I in x){var H;k&&(H=Object.getOwnPropertyDescriptor(k,I)),!(H&&H.set==null)&&(P[I]=C(x[I],O-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(x),I=0;I<G.length;I++){var Z=G[I],W=Object.getOwnPropertyDescriptor(x,Z);W&&!W.enumerable&&!d||(P[Z]=C(x[Z],O-1),W.enumerable||Object.defineProperty(P,Z,{enumerable:!1}))}if(d)for(var B=Object.getOwnPropertyNames(x),I=0;I<B.length;I++){var F=B[I],W=Object.getOwnPropertyDescriptor(x,F);W&&W.enumerable||(P[F]=C(x[F],O-1),Object.defineProperty(P,F,{enumerable:!1}))}return P}return C(b,h)}f.clonePrototype=function(g){if(g===null)return null;var h=function(){};return h.prototype=g,new h};function p(b){return Object.prototype.toString.call(b)}f.__objToStr=p;function E(b){return typeof b=="object"&&p(b)==="[object Date]"}f.__isDate=E;function w(b){return typeof b=="object"&&p(b)==="[object Array]"}f.__isArray=w;function m(b){return typeof b=="object"&&p(b)==="[object RegExp]"}f.__isRegExp=m;function S(b){var g="";return b.global&&(g+="g"),b.ignoreCase&&(g+="i"),b.multiline&&(g+="m"),g}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 P(k,M){var I=[],H=!0,G=!1,Z=void 0;try{for(var W=k[Symbol.iterator](),B;!(H=(B=W.next()).done)&&(I.push(B.value),!(M&&I.length===M));H=!0);}catch(F){G=!0,Z=F}finally{try{!H&&W.return&&W.return()}finally{if(G)throw Z}}return I}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return P(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(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&&P(k.prototype,M),I&&P(k,I),k}}(),l=function P(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:P(G,M,I)}else{if("value"in H)return H.value;var Z=H.get;return Z===void 0?void 0:Z.call(I)}},u=i(0),f=y(u),p=i(8),E=y(p),w=i(4),m=y(w),S=i(16),b=y(S),g=i(13),h=y(g),v=i(25),d=y(v);function y(P){return P&&P.__esModule?P:{default:P}}function _(P,k){if(!(P instanceof k))throw new TypeError("Cannot call a class as a function")}function R(P,k){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:P}function C(P,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);P.prototype=Object.create(k&&k.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(P,k):P.__proto__=k)}function x(P){return P instanceof m.default||P instanceof w.BlockEmbed}var O=function(P){C(k,P);function k(M,I){_(this,k);var H=R(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,Z){return G[Z]=!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),Z=a(G,2),W=Z[0],B=Z[1],F=this.line(I+H),T=a(F,1),L=T[0];if(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,I,H),L!=null&&W!==L&&B>0){if(W instanceof w.BlockEmbed||L instanceof w.BlockEmbed){this.optimize();return}if(W instanceof h.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 h.default){var D=L.newlineIndex(0);D>-1&&L.split(D+1)}var $=L.children.head instanceof b.default?null:L.children.head;W.moveChildren(L,$),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,Z){this.whitelist!=null&&!this.whitelist[G]||(l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,I,H,G,Z),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 Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),G==null&&H.endsWith(`
134
+ `)&&(H=H.slice(0,-1)),Z.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(x,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 Z(W,B,F){var T=[],L=F;return W.children.forEachAt(B,F,function(z,D,$){x(z)?T.push(z):z instanceof f.default.Container&&(T=T.concat(Z(z,D,L))),L-=$}),T};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=[m.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(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},o=function(){function V(U,Y){var X=[],Q=!0,te=!1,ee=void 0;try{for(var ne=U[Symbol.iterator](),ie;!(Q=(ie=ne.next()).done)&&(X.push(ie.value),!(Y&&X.length===Y));Q=!0);}catch(oe){te=!0,ee=oe}finally{try{!Q&&ne.return&&ne.return()}finally{if(te)throw ee}}return X}return function(U,Y){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return V(U,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function V(U,Y){for(var X=0;X<Y.length;X++){var Q=Y[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(U,Q.key,Q)}}return function(U,Y,X){return Y&&V(U.prototype,Y),X&&V(U,X),U}}(),u=i(21),f=P(u),p=i(11),E=P(p),w=i(3),m=P(w),S=i(2),b=P(S),g=i(20),h=P(g),v=i(0),d=P(v),y=i(5),_=P(y),R=i(10),C=P(R),x=i(9),O=P(x);function P(V){return V&&V.__esModule?V:{default:V}}function k(V,U,Y){return U in V?Object.defineProperty(V,U,{value:Y,enumerable:!0,configurable:!0,writable:!0}):V[U]=Y,V}function M(V,U){if(!(V instanceof U))throw new TypeError("Cannot call a class as a function")}function I(V,U){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:V}function H(V,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);V.prototype=Object.create(U&&U.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(V,U):V.__proto__=U)}var G=(0,C.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function(V){H(U,V),l(U,null,[{key:"match",value:function(X,Q){return Q=K(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(te){return!!Q[te]!==X[te]&&Q[te]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function U(Y,X){M(this,U);var Q=I(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,Y,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(te){te==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Q.options.bindings[te]&&Q.addBinding(Q.options.bindings[te])}),Q.addBinding({key:U.keys.ENTER,shiftKey:null},z),Q.addBinding({key:U.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!0},F),Q.addBinding({key:U.keys.DELETE},{collapsed:!0},T)):(Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},F),Q.addBinding({key:U.keys.DELETE},{collapsed:!0,suffix:/^.?$/},T)),Q.addBinding({key:U.keys.BACKSPACE},{collapsed:!1},L),Q.addBinding({key:U.keys.DELETE},{collapsed:!1},L),Q.addBinding({key:U.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},F),Q.listen(),Q}return l(U,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=K(X);if(ee==null||ee.key==null)return G.warn("Attempted to add invalid keyboard binding",ee);typeof Q=="function"&&(Q={handler:Q}),typeof te=="function"&&(te={handler:te}),ee=(0,m.default)(ee,Q,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(Q){if(!Q.defaultPrevented){var te=Q.which||Q.keyCode,ee=(X.bindings[te]||[]).filter(function(Pe){return U.match(Q,Pe)});if(ee.length!==0){var ne=X.quill.getSelection();if(!(ne==null||!X.quill.hasFocus())){var ie=X.quill.getLine(ne.index),oe=o(ie,2),ke=oe[0],Ie=oe[1],le=X.quill.getLeaf(ne.index),fe=o(le,2),_e=fe[0],ge=fe[1],re=ne.length===0?[_e,ge]:X.quill.getLeaf(ne.index+ne.length),de=o(re,2),ye=de[0],Se=de[1],$e=_e instanceof d.default.Text?_e.value().slice(0,ge):"",Qe=ye instanceof d.default.Text?ye.value().slice(Se):"",Re={collapsed:ne.length===0,empty:ne.length===0&&ke.length()<=1,format:X.quill.getFormat(ne),offset:Ie,prefix:$e,suffix:Qe},Oe=ee.some(function(Pe){if(Pe.collapsed!=null&&Pe.collapsed!==Re.collapsed||Pe.empty!=null&&Pe.empty!==Re.empty||Pe.offset!=null&&Pe.offset!==Re.offset)return!1;if(Array.isArray(Pe.format)){if(Pe.format.every(function(He){return Re.format[He]==null}))return!1}else if(a(Pe.format)==="object"&&!Object.keys(Pe.format).every(function(He){return Pe.format[He]===!0?Re.format[He]!=null:Pe.format[He]===!1?Re.format[He]==null:(0,E.default)(Pe.format[He],Re.format[He])}))return!1;return Pe.prefix!=null&&!Pe.prefix.test(Re.prefix)||Pe.suffix!=null&&!Pe.suffix.test(Re.suffix)?!1:Pe.handler.call(X,ne,Re)!==!0});Oe&&Q.preventDefault()}}}})}}]),U}(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:$("bold"),italic:$("italic"),underline:$("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(U,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(U,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(U,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":D(!0),"outdent code-block":D(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(U){this.quill.deleteText(U.index-1,1,_.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(U){this.quill.history.cutoff();var Y=new b.default().retain(U.index).delete(U.length).insert(" ");this.quill.updateContents(Y,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index+1,_.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(U,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(U){var Y=this.quill.getLine(U.index),X=o(Y,2),Q=X[0],te=X[1],ee=(0,m.default)({},Q.formats(),{list:"checked"}),ne=new b.default().retain(U.index).insert(`
135
+ `,ee).retain(Q.length()-te-1).retain(1,{list:"unchecked"});this.quill.updateContents(ne,_.default.sources.USER),this.quill.setSelection(U.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(U,Y){var X=this.quill.getLine(U.index),Q=o(X,2),te=Q[0],ee=Q[1],ne=new b.default().retain(U.index).insert(`
136
+ `,Y.format).retain(te.length()-ee-1).retain(1,{header:null});this.quill.updateContents(ne,_.default.sources.USER),this.quill.setSelection(U.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(U,Y){var X=Y.prefix.length,Q=this.quill.getLine(U.index),te=o(Q,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(U.index," ",_.default.sources.USER),this.quill.history.cutoff();var oe=new b.default().retain(U.index-ne).delete(X+1).retain(ee.length()-2-ne).retain(1,{list:ie});this.quill.updateContents(oe,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(U.index-X,_.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(U){var Y=this.quill.getLine(U.index),X=o(Y,2),Q=X[0],te=X[1],ee=new b.default().retain(U.index+Q.length()-te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,_.default.sources.USER)}},"embed left":B(W.keys.LEFT,!1),"embed left shift":B(W.keys.LEFT,!0),"embed right":B(W.keys.RIGHT,!1),"embed right shift":B(W.keys.RIGHT,!0)}};function B(V,U){var Y,X=V===W.keys.LEFT?"prefix":"suffix";return Y={key:V,shiftKey:U,altKey:null},k(Y,X,/^$/),k(Y,"handler",function(te){var ee=te.index;V===W.keys.RIGHT&&(ee+=te.length+1);var ne=this.quill.getLeaf(ee),ie=o(ne,1),oe=ie[0];return oe instanceof d.default.Embed?(V===W.keys.LEFT?U?this.quill.setSelection(te.index-1,te.length+1,_.default.sources.USER):this.quill.setSelection(te.index-1,_.default.sources.USER):U?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 F(V,U){if(!(V.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine(V.index),X=o(Y,1),Q=X[0],te={};if(U.offset===0){var ee=this.quill.getLine(V.index-1),ne=o(ee,1),ie=ne[0];if(ie!=null&&ie.length()>1){var oe=Q.formats(),ke=this.quill.getFormat(V.index-1,1);te=h.default.attributes.diff(oe,ke)||{}}}var Ie=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(U.prefix)?2:1;this.quill.deleteText(V.index-Ie,Ie,_.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(V.index-Ie,Ie,te,_.default.sources.USER),this.quill.focus()}}function T(V,U){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(U.suffix)?2:1;if(!(V.index>=this.quill.getLength()-Y)){var X={},Q=0,te=this.quill.getLine(V.index),ee=o(te,1),ne=ee[0];if(U.offset>=ne.length()-1){var ie=this.quill.getLine(V.index+1),oe=o(ie,1),ke=oe[0];if(ke){var Ie=ne.formats(),le=this.quill.getFormat(V.index,1);X=h.default.attributes.diff(Ie,le)||{},Q=ke.length()}}this.quill.deleteText(V.index,Y,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(V.index+Q-1,Y,X,_.default.sources.USER)}}function L(V){var U=this.quill.getLines(V),Y={};if(U.length>1){var X=U[0].formats(),Q=U[U.length-1].formats();Y=h.default.attributes.diff(Q,X)||{}}this.quill.deleteText(V,_.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine(V.index,1,Y,_.default.sources.USER),this.quill.setSelection(V.index,_.default.sources.SILENT),this.quill.focus()}function z(V,U){var Y=this;V.length>0&&this.quill.scroll.deleteAt(V.index,V.length);var X=Object.keys(U.format).reduce(function(Q,te){return d.default.query(te,d.default.Scope.BLOCK)&&!Array.isArray(U.format[te])&&(Q[te]=U.format[te]),Q},{});this.quill.insertText(V.index,`
137
+ `,X,_.default.sources.USER),this.quill.setSelection(V.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(U.format).forEach(function(Q){X[Q]==null&&(Array.isArray(U.format[Q])||Q!=="link"&&Y.quill.format(Q,U.format[Q],_.default.sources.USER))})}function D(V){return{key:W.keys.TAB,shiftKey:!V,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Q=Y.index,te=Y.length,ee=this.quill.scroll.descendant(X,Q),ne=o(ee,2),ie=ne[0],oe=ne[1];if(ie!=null){var ke=this.quill.getIndex(ie),Ie=ie.newlineIndex(oe,!0)+1,le=ie.newlineIndex(ke+oe+te),fe=ie.domNode.textContent.slice(Ie,le).split(`
138
+ `);oe=0,fe.forEach(function(_e,ge){V?(ie.insertAt(Ie+oe,X.TAB),oe+=X.TAB.length,ge===0?Q+=X.TAB.length:te+=X.TAB.length):_e.startsWith(X.TAB)&&(ie.deleteAt(Ie+oe,X.TAB.length),oe-=X.TAB.length,ge===0?Q-=X.TAB.length:te-=X.TAB.length),oe+=_e.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,te,_.default.sources.SILENT)}}}}function $(V){return{key:V[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format(V,!X.format[V],_.default.sources.USER)}}}function K(V){if(typeof V=="string"||typeof V=="number")return K({key:V});if((typeof V>"u"?"undefined":a(V))==="object"&&(V=(0,f.default)(V,!1)),typeof V.key=="string")if(W.keys[V.key.toUpperCase()]!=null)V.key=W.keys[V.key.toUpperCase()];else if(V.key.length===1)V.key=V.key.toUpperCase().charCodeAt(0);else return null;return V.shortKey&&(V[Z]=V.shortKey,delete V.shortKey),V}n.default=W,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(v,d){var y=[],_=!0,R=!1,C=void 0;try{for(var x=v[Symbol.iterator](),O;!(_=(O=x.next()).done)&&(y.push(O.value),!(d&&y.length===d));_=!0);}catch(P){R=!0,C=P}finally{try{!_&&x.return&&x.return()}finally{if(R)throw C}}return y}return function(v,d){if(Array.isArray(v))return v;if(Symbol.iterator in Object(v))return h(v,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function h(v,d,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,d);if(_===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:h(R,d,y)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(y)}},l=function(){function h(v,d){for(var y=0;y<d.length;y++){var _=d[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,d,y){return d&&h(v.prototype,d),y&&h(v,y),v}}(),u=i(0),f=w(u),p=i(7),E=w(p);function w(h){return h&&h.__esModule?h:{default:h}}function m(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}function S(h,v){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:h}function b(h,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);h.prototype=Object.create(v&&v.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(h,v):h.__proto__=v)}var g=function(h){b(v,h),l(v,null,[{key:"value",value:function(){}}]);function v(d,y){m(this,v);var _=S(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,d));return _.selection=y,_.textNode=document.createTextNode(v.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(v,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(y,_){if(this._length!==0)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,y,_);for(var R=this,C=0;R!=null&&R.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=R.offset(R.parent),R=R.parent;R!=null&&(this._length=v.CONTENTS.length,R.optimize(),R.formatAt(C,v.CONTENTS.length,y,_),this._length=0)}},{key:"index",value:function(y,_){return y===this.textNode?0:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,y,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var y=this.textNode,_=this.selection.getNativeRange(),R=void 0,C=void 0,x=void 0;if(_!=null&&_.start.node===y&&_.end.node===y){var O=[y,_.start.offset,_.end.offset];R=O[0],C=O[1],x=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!==v.CONTENTS){var P=this.textNode.data.split(v.CONTENTS).join("");this.next instanceof E.default?(R=this.next.domNode,this.next.insertAt(0,P),this.textNode.data=v.CONTENTS):(this.textNode.data=P,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(v.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var k=[C,x].map(function(I){return Math.max(0,Math.min(R.data.length,I-1))}),M=a(k,2);return C=M[0],x=M[1],{startNode:R,startOffset:C,endNode:R,endOffset:x}}}}},{key:"update",value:function(y,_){var R=this;if(y.some(function(x){return x.type==="characterData"&&x.target===R.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),v}(f.default.Embed);g.blotName="cursor",g.className="ql-cursor",g.tagName="span",g.CONTENTS="\uFEFF",n.default=g},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 p(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 m=function(S){w(b,S);function b(){return p(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Container);m.allowedChildren=[u.default,l.BlockEmbed,m],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function g(h,v){for(var d=0;d<v.length;d++){var y=v[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,v,d){return v&&g(h.prototype,v),d&&g(h,d),h}}(),o=function g(h,v,d){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,v);if(y===void 0){var _=Object.getPrototypeOf(h);return _===null?void 0:g(_,v,d)}else{if("value"in y)return y.value;var R=y.get;return R===void 0?void 0:R.call(d)}},l=i(0),u=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function p(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function E(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function w(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var m=function(g){w(h,g);function h(){return p(this,h),E(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"value",value:function(d){var y=o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,d);return y.startsWith("rgb(")?(y=y.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+y.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):y}}]),h}(u.default.Attributor.Style),S=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),b=new m("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=m,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(g,h){for(var v=0;v<h.length;v++){var d=h[v];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}}return function(g,h,v){return h&&b(g.prototype,h),v&&b(g,v),g}}(),o=function b(g,h,v){g===null&&(g=Function.prototype);var d=Object.getOwnPropertyDescriptor(g,h);if(d===void 0){var y=Object.getPrototypeOf(g);return y===null?void 0:b(y,h,v)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(v)}},l=i(6),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function p(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function E(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function w(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}var m=function(b){w(g,b);function g(){return p(this,g),E(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"format",value:function(v,d){if(v!==this.statics.blotName||!d)return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,v,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(v){var d=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,v);return v=this.sanitize(v),d.setAttribute("href",v),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(v){return v.getAttribute("href")}},{key:"sanitize",value:function(v){return S(v,this.PROTOCOL_WHITELIST)?v:this.SANITIZED_URL}}]),g}(u.default);m.blotName="link",m.tagName="A",m.SANITIZED_URL="about:blank",m.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(b,g){var h=document.createElement("a");h.href=b;var v=h.href.slice(0,h.href.indexOf(":"));return g.indexOf(v)>-1}n.default=m,n.sanitize=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},o=function(){function g(h,v){for(var d=0;d<v.length;d++){var y=v[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,v,d){return v&&g(h.prototype,v),d&&g(h,d),h}}(),l=i(23),u=E(l),f=i(107),p=E(f);function E(g){return g&&g.__esModule?g:{default:g}}function w(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}var m=0;function S(g,h){g.setAttribute(h,g.getAttribute(h)!=="true")}var b=function(){function g(h){var v=this;w(this,g),this.select=h,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(){v.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:v.togglePicker();break;case u.default.keys.ESCAPE:v.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(g,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),S(this.label,"aria-expanded"),S(this.options,"aria-hidden")}},{key:"buildItem",value:function(v){var d=this,y=document.createElement("span");return y.tabIndex="0",y.setAttribute("role","button"),y.classList.add("ql-picker-item"),v.hasAttribute("value")&&y.setAttribute("data-value",v.getAttribute("value")),v.textContent&&y.setAttribute("data-label",v.textContent),y.addEventListener("click",function(){d.selectItem(y,!0)}),y.addEventListener("keydown",function(_){switch(_.keyCode){case u.default.keys.ENTER:d.selectItem(y,!0),_.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),y}},{key:"buildLabel",value:function(){var v=document.createElement("span");return v.classList.add("ql-picker-label"),v.innerHTML=p.default,v.tabIndex="0",v.setAttribute("role","button"),v.setAttribute("aria-expanded","false"),this.container.appendChild(v),v}},{key:"buildOptions",value:function(){var v=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+m,m+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(y){var _=v.buildItem(y);d.appendChild(_),y.selected===!0&&v.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var v=this;[].slice.call(this.select.attributes).forEach(function(d){v.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var v=this;this.close(),setTimeout(function(){return v.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(v){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=this.container.querySelector(".ql-selected");if(v!==y&&(y!=null&&y.classList.remove("ql-selected"),v!=null&&(v.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(v.parentNode.children,v),v.hasAttribute("data-value")?this.label.setAttribute("data-value",v.getAttribute("data-value")):this.label.removeAttribute("data-value"),v.hasAttribute("data-label")?this.label.setAttribute("data-label",v.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 v=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];v=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var y=v!=null&&v!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",y)}}]),g}();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),p=G(f),E=i(16),w=G(E),m=i(25),S=G(m),b=i(24),g=G(b),h=i(35),v=G(h),d=i(6),y=G(d),_=i(22),R=G(_),C=i(7),x=G(C),O=i(55),P=G(O),k=i(42),M=G(k),I=i(23),H=G(I);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":p.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":S.default,"blots/cursor":g.default,"blots/embed":v.default,"blots/inline":y.default,"blots/scroll":R.default,"blots/text":x.default,"modules/clipboard":P.default,"modules/history":M.default,"modules/keyboard":H.default}),o.default.register(p.default,w.default,g.default,y.default,R.default,x.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 p=this.isolate(u,f);p.remove()},l.prototype.formatAt=function(u,f,p,E){var w=this.isolate(u,f);if(a.query(p,a.Scope.BLOT)!=null&&E)w.wrap(p,E);else if(a.query(p,a.Scope.ATTRIBUTE)!=null){var m=a.create(this.statics.scope);w.wrap(m),m.format(p,E)}},l.prototype.insertAt=function(u,f,p){var E=p==null?a.create("text",f):a.create(f,p),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 p=null;u.children.insertBefore(this,f),f!=null&&(p=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=p)&&u.domNode.insertBefore(this.domNode,p),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var p=this.split(u);return p.split(f),p},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 p=typeof u=="string"?a.create(u,f):u;return p.replace(this),p},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 p=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(p,this.next),p.appendChild(this),p},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 p(E){this.attributes={},this.domNode=E,this.build()}return p.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])},p.prototype.build=function(){var E=this;this.attributes={};var w=a.default.keys(this.domNode),m=o.default.keys(this.domNode),S=l.default.keys(this.domNode);w.concat(m).concat(S).forEach(function(b){var g=u.query(b,u.Scope.ATTRIBUTE);g instanceof a.default&&(E.attributes[g.attrName]=g)})},p.prototype.copy=function(E){var w=this;Object.keys(this.attributes).forEach(function(m){var S=w.attributes[m].value(w.domNode);E.format(m,S)})},p.prototype.move=function(E){var w=this;this.copy(E),Object.keys(this.attributes).forEach(function(m){w.attributes[m].remove(w.domNode)}),this.attributes={}},p.prototype.values=function(){var E=this;return Object.keys(this.attributes).reduce(function(w,m){return w[m]=E.attributes[m].value(E.domNode),w},{})},p}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var w in E)E.hasOwnProperty(w)&&(p[w]=E[w])};return function(p,E){f(p,E);function w(){this.constructor=p}p.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,p){var E=f.getAttribute("class")||"";return E.split(/\s+/).filter(function(w){return w.indexOf(p+"-")===0})}var u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.keys=function(E){return(E.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},p.prototype.add=function(E,w){return this.canAdd(E,w)?(this.remove(E),E.classList.add(this.keyName+"-"+w),!0):!1},p.prototype.remove=function(E){var w=l(E,this.keyName);w.forEach(function(m){E.classList.remove(m)}),E.classList.length===0&&E.removeAttribute("class")},p.prototype.value=function(E){var w=l(E,this.keyName)[0]||"",m=w.slice(this.keyName.length+1);return this.canAdd(E,m)?m:""},p}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var w in E)E.hasOwnProperty(w)&&(p[w]=E[w])};return function(p,E){f(p,E);function w(){this.constructor=p}p.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 p=f.split("-"),E=p.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return p[0]+E}var u=function(f){a(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.keys=function(E){return(E.getAttribute("style")||"").split(";").map(function(w){var m=w.split(":");return m[0].trim()})},p.prototype.add=function(E,w){return this.canAdd(E,w)?(E.style[l(this.keyName)]=w,!0):!1},p.prototype.remove=function(E){E.style[l(this.keyName)]="",E.getAttribute("style")||E.removeAttribute("style")},p.prototype.value=function(E){var w=E.style[l(this.keyName)];return this.canAdd(E,w)?w:""},p}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,p){for(var E=0;E<p.length;E++){var w=p[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,p,E){return p&&u(f.prototype,p),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,p){o(this,u),this.quill=f,this.options=p,this.modules={}}return a(u,[{key:"init",value:function(){var p=this;Object.keys(this.options.modules).forEach(function(E){p.modules[E]==null&&p.addModule(E)})}},{key:"addModule",value:function(p){var E=this.quill.constructor.import("modules/"+p);return this.modules[p]=new E(this.quill,this.options.modules[p]||{}),this.modules[p]}}]),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 h(v,d){for(var y=0;y<d.length;y++){var _=d[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,d,y){return d&&h(v.prototype,d),y&&h(v,y),v}}(),o=function h(v,d,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,d);if(_===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:h(R,d,y)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(y)}},l=i(0),u=E(l),f=i(7),p=E(f);function E(h){return h&&h.__esModule?h:{default:h}}function w(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}function m(h,v){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:h}function S(h,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);h.prototype=Object.create(v&&v.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(h,v):h.__proto__=v)}var b="\uFEFF",g=function(h){S(v,h);function v(d){w(this,v);var y=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,d));return y.contentNode=document.createElement("span"),y.contentNode.setAttribute("contenteditable",!1),[].slice.call(y.domNode.childNodes).forEach(function(_){y.contentNode.appendChild(_)}),y.leftGuard=document.createTextNode(b),y.rightGuard=document.createTextNode(b),y.domNode.appendChild(y.leftGuard),y.domNode.appendChild(y.contentNode),y.domNode.appendChild(y.rightGuard),y}return a(v,[{key:"index",value:function(y,_){return y===this.leftGuard?0:y===this.rightGuard?1:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,y,_)}},{key:"restore",value:function(y){var _=void 0,R=void 0,C=y.data.split(b).join("");if(y===this.leftGuard)if(this.prev instanceof p.default){var x=this.prev.length();this.prev.insertAt(x,C),_={startNode:this.prev.domNode,startOffset:x+C.length}}else R=document.createTextNode(C),this.parent.insertBefore(u.default.create(R),this),_={startNode:R,startOffset:C.length};else y===this.rightGuard&&(this.next instanceof p.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(R=document.createTextNode(C),this.parent.insertBefore(u.default.create(R),this.next),_={startNode:R,startOffset:C.length}));return y.data=b,_}},{key:"update",value:function(y,_){var R=this;y.forEach(function(C){if(C.type==="characterData"&&(C.target===R.leftGuard||C.target===R.rightGuard)){var x=R.restore(C.target);x&&(_.range=x)}})}}]),v}(u.default.Embed);n.default=g},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),p=new o.default.Attributor.Class("align","ql-align",u),E=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=p,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}),p=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=p},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),p=new o.default.Attributor.Class("direction","ql-direction",u),E=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=p,n.DirectionStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function h(v,d){for(var y=0;y<d.length;y++){var _=d[y];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,d,y){return d&&h(v.prototype,d),y&&h(v,y),v}}(),o=function h(v,d,y){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,d);if(_===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:h(R,d,y)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(y)}},l=i(0),u=f(l);function f(h){return h&&h.__esModule?h:{default:h}}function p(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}function E(h,v){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:h}function w(h,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);h.prototype=Object.create(v&&v.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(h,v):h.__proto__=v)}var m={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new u.default.Attributor.Class("font","ql-font",m),b=function(h){w(v,h);function v(){return p(this,v),E(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"value",value:function(y){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,y).replace(/["']/g,"")}}]),v}(u.default.Attributor.Style),g=new b("font","font-family",m);n.FontStyle=g,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(p){return p&&p.__esModule?p:{default:p}}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(y,_){for(var R=0;R<_.length;R++){var C=_[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(y,C.key,C)}}return function(y,_,R){return _&&d(y.prototype,_),R&&d(y,R),y}}(),o=i(0),l=w(o),u=i(5),f=w(u),p=i(9),E=w(p);function w(d){return d&&d.__esModule?d:{default:d}}function m(d,y){if(!(d instanceof y))throw new TypeError("Cannot call a class as a function")}function S(d,y){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:d}function b(d,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);d.prototype=Object.create(y&&y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(d,y):d.__proto__=y)}var g=function(d){b(y,d);function y(_,R){m(this,y);var C=S(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,_,R));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(x,O,P,k){x!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||k===f.default.sources.USER?C.record(O,P):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(y,[{key:"change",value:function(R,C){if(this.stack[R].length!==0){var x=this.stack[R].pop();this.stack[C].push(x),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(x[R],f.default.sources.USER),this.ignoreChange=!1;var O=v(x[R]);this.quill.setSelection(O)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(R,C){if(R.ops.length!==0){this.stack.redo=[];var x=this.quill.getContents().diff(C),O=Date.now();if(this.lastRecorded+this.options.delay>O&&this.stack.undo.length>0){var P=this.stack.undo.pop();x=x.compose(P.undo),R=P.redo.compose(R)}else this.lastRecorded=O;this.stack.undo.push({redo:R,undo:x}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(R){this.stack.undo.forEach(function(C){C.undo=R.transform(C.undo,!0),C.redo=R.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=R.transform(C.undo,!0),C.redo=R.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),y}(E.default);g.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function h(d){var y=d.ops[d.ops.length-1];return y==null?!1:y.insert!=null?typeof y.insert=="string"&&y.insert.endsWith(`
139
+ `):y.attributes!=null?Object.keys(y.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function v(d){var y=d.reduce(function(R,C){return R+=C.delete||0,R},0),_=d.length()-y;return h(d)&&(_-=1),_}n.default=g,n.getLastChangeIndex=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function z(D,$){for(var K=0;K<$.length;K++){var V=$[K];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(D,V.key,V)}}return function(D,$,K){return $&&z(D.prototype,$),K&&z(D,K),D}}(),o=function z(D,$,K){D===null&&(D=Function.prototype);var V=Object.getOwnPropertyDescriptor(D,$);if(V===void 0){var U=Object.getPrototypeOf(D);return U===null?void 0:z(U,$,K)}else{if("value"in V)return V.value;var Y=V.get;return Y===void 0?void 0:Y.call(K)}},l=i(3),u=O(l),f=i(2),p=O(f),E=i(8),w=O(E),m=i(23),S=O(m),b=i(34),g=O(b),h=i(59),v=O(h),d=i(60),y=O(d),_=i(28),R=O(_),C=i(61),x=O(C);function O(z){return z&&z.__esModule?z:{default:z}}function P(z,D){if(!(z instanceof D))throw new TypeError("Cannot call a class as a function")}function k(z,D){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:z}function M(z,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);z.prototype=Object.create(D&&D.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(z,D):z.__proto__=D)}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"],Z=["1","2","3",!1],W=["small",!1,"large","huge"],B=function(z){M(D,z);function D($,K){P(this,D);var V=k(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,K)),U=function Y(X){if(!document.body.contains($.root))return document.body.removeEventListener("click",Y);V.tooltip!=null&&!V.tooltip.root.contains(X.target)&&document.activeElement!==V.tooltip.textbox&&!V.quill.hasFocus()&&V.tooltip.hide(),V.pickers!=null&&V.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return $.emitter.listenDOM("click",document.body,U),V}return a(D,[{key:"addModule",value:function(K){var V=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(V),V}},{key:"buildButtons",value:function(K,V){K.forEach(function(U){var Y=U.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),V[X]!=null))if(X==="direction")U.innerHTML=V[X][""]+V[X].rtl;else if(typeof V[X]=="string")U.innerHTML=V[X];else{var Q=U.value||"";Q!=null&&V[X][Q]&&(U.innerHTML=V[X][Q])}})})}},{key:"buildPickers",value:function(K,V){var U=this;this.pickers=K.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&L(X,I),new y.default(X,V.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&L(X,H,Q==="background"?"#ffffff":"#000000"),new v.default(X,V[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?L(X,G):X.classList.contains("ql-header")?L(X,Z):X.classList.contains("ql-size")&&L(X,W)),new R.default(X)});var Y=function(){U.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,Y)}}]),D}(g.default);B.DEFAULTS=(0,u.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,$=this.container.querySelector("input.ql-image[type=file]");$==null&&($=document.createElement("input"),$.setAttribute("type","file"),$.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),$.classList.add("ql-image"),$.addEventListener("change",function(){if($.files!=null&&$.files[0]!=null){var K=new FileReader;K.onload=function(V){var U=D.quill.getSelection(!0);D.quill.updateContents(new p.default().retain(U.index).delete(U.length).insert({image:V.target.result}),w.default.sources.USER),D.quill.setSelection(U.index+1,w.default.sources.SILENT),$.value=""},K.readAsDataURL($.files[0])}}),this.container.appendChild($)),$.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var F=function(z){M(D,z);function D($,K){P(this,D);var V=k(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,K));return V.textbox=V.root.querySelector('input[type="text"]'),V.listen(),V}return a(D,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(V){S.default.match(V,"enter")?(K.save(),V.preventDefault()):S.default.match(V,"escape")&&(K.cancel(),V.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),V!=null?this.textbox.value=V:K!==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-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var V=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,w.default.sources.USER)),this.quill.root.scrollTop=V;break}case"video":K=T(K);case"formula":{if(!K)break;var U=this.quill.getSelection(!0);if(U!=null){var Y=U.index+U.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),K,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()}}]),D}(x.default);function T(z){var D=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 D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":z}function L(z,D){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(K){var V=document.createElement("option");K===$?V.setAttribute("selected","selected"):V.setAttribute("value",K),z.appendChild(V)})}n.BaseTooltip=F,n.default=B},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,p=this.iterator();f=p();){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 p=this.find(l),E=p[0],w=p[1],m,S=l-w,b=this.iterator(E);(m=b())&&S<l+u;){var g=m.length();l>S?f(m,l-S,Math.min(u,S+g-l)):f(m,0,Math.min(g,l+u-S)),S+=g}},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,p=this.iterator();f=p();)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,m){w.__proto__=m}||function(w,m){for(var S in m)m.hasOwnProperty(S)&&(w[S]=m[S])};return function(w,m){E(w,m);function S(){this.constructor=w}w.prototype=m===null?Object.create(m):(S.prototype=m.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,p=function(E){a(w,E);function w(m){var S=E.call(this,m)||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(m,S){this.update(),m===0&&S===this.length()?this.children.forEach(function(b){b.remove()}):E.prototype.deleteAt.call(this,m,S)},w.prototype.formatAt=function(m,S,b,g){this.update(),E.prototype.formatAt.call(this,m,S,b,g)},w.prototype.insertAt=function(m,S,b){this.update(),E.prototype.insertAt.call(this,m,S,b)},w.prototype.optimize=function(m,S){var b=this;m===void 0&&(m=[]),S===void 0&&(S={}),E.prototype.optimize.call(this,S);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)m.push(g.pop());for(var h=function(_,R){R===void 0&&(R=!0),!(_==null||_===b)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),R&&h(_.parent))},v=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof o.default&&_.children.forEach(v),_.optimize(S))},d=m,y=0;d.length>0;y+=1){if(y>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var R=l.find(_.target,!0);R!=null&&(R.domNode===_.target&&(_.type==="childList"?(h(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var x=l.find(C,!1);h(x,!1),x instanceof o.default&&x.children.forEach(function(O){h(O,!1)})})):_.type==="attributes"&&h(R.prev)),h(R))}),this.children.forEach(v),d=[].slice.call(this.observer.takeRecords()),g=d.slice();g.length>0;)m.push(g.pop())}},w.prototype.update=function(m,S){var b=this;S===void 0&&(S={}),m=m||this.observer.takeRecords(),m.map(function(g){var h=l.find(g.target,!0);return h==null?null:h.domNode[l.DATA_KEY].mutations==null?(h.domNode[l.DATA_KEY].mutations=[g],h):(h.domNode[l.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g==null||g===b||g.domNode[l.DATA_KEY]==null||g.update(g.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(m,S)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var m in w)w.hasOwnProperty(m)&&(E[m]=w[m])};return function(E,w){p(E,w);function m(){this.constructor=E}E.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(p,E){if(Object.keys(p).length!==Object.keys(E).length)return!1;for(var w in p)if(p[w]!==E[w])return!1;return!0}var f=function(p){a(E,p);function E(){return p!==null&&p.apply(this,arguments)||this}return E.formats=function(w){if(w.tagName!==E.tagName)return p.formats.call(this,w)},E.prototype.format=function(w,m){var S=this;w===this.statics.blotName&&!m?(this.children.forEach(function(b){b instanceof o.default||(b=b.wrap(E.blotName,!0)),S.attributes.copy(b)}),this.unwrap()):p.prototype.format.call(this,w,m)},E.prototype.formatAt=function(w,m,S,b){if(this.formats()[S]!=null||l.query(S,l.Scope.ATTRIBUTE)){var g=this.isolate(w,m);g.format(S,b)}else p.prototype.formatAt.call(this,w,m,S,b)},E.prototype.optimize=function(w){p.prototype.optimize.call(this,w);var m=this.formats();if(Object.keys(m).length===0)return this.unwrap();var S=this.next;S instanceof E&&S.prev===this&&u(m,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(p,E){p.__proto__=E}||function(p,E){for(var w in E)E.hasOwnProperty(w)&&(p[w]=E[w])};return function(p,E){f(p,E);function w(){this.constructor=p}p.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(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.formats=function(E){var w=l.query(p.blotName).tagName;if(E.tagName!==w)return f.formats.call(this,E)},p.prototype.format=function(E,w){l.query(E,l.Scope.BLOCK)!=null&&(E===this.statics.blotName&&!w?this.replaceWith(p.blotName):f.prototype.format.call(this,E,w))},p.prototype.formatAt=function(E,w,m,S){l.query(m,l.Scope.BLOCK)!=null?this.format(m,S):f.prototype.formatAt.call(this,E,w,m,S)},p.prototype.insertAt=function(E,w,m){if(m==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,E,w,m);else{var S=this.split(E),b=l.create(w,m);S.parent.insertBefore(b,S)}},p.prototype.update=function(E,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,E,w)},p.blotName="block",p.scope=l.Scope.BLOCK_BLOT,p.tagName="P",p}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,p){f.__proto__=p}||function(f,p){for(var E in p)p.hasOwnProperty(E)&&(f[E]=p[E])};return function(f,p){u(f,p);function E(){this.constructor=f}f.prototype=p===null?Object.create(p):(E.prototype=p.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(p){},f.prototype.format=function(p,E){u.prototype.formatAt.call(this,0,this.length(),p,E)},f.prototype.formatAt=function(p,E,w,m){p===0&&E===this.length()?this.format(w,m):u.prototype.formatAt.call(this,p,E,w,m)},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(p,E){p.__proto__=E}||function(p,E){for(var w in E)E.hasOwnProperty(w)&&(p[w]=E[w])};return function(p,E){f(p,E);function w(){this.constructor=p}p.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(p,f);function p(E){var w=f.call(this,E)||this;return w.text=w.statics.value(w.domNode),w}return p.create=function(E){return document.createTextNode(E)},p.value=function(E){var w=E.data;return w.normalize&&(w=w.normalize()),w},p.prototype.deleteAt=function(E,w){this.domNode.data=this.text=this.text.slice(0,E)+this.text.slice(E+w)},p.prototype.index=function(E,w){return this.domNode===E?w:-1},p.prototype.insertAt=function(E,w,m){m==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,m)},p.prototype.length=function(){return this.text.length},p.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 p&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},p.prototype.position=function(E,w){return[this.domNode,E]},p.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 m=l.create(this.domNode.splitText(E));return this.parent.insertBefore(m,this.next),this.text=this.statics.value(this.domNode),m},p.prototype.update=function(E,w){var m=this;E.some(function(S){return S.type==="characterData"&&S.target===m.domNode})&&(this.text=this.statics.value(this.domNode))},p.prototype.value=function(){return this.text},p.blotName="text",p.scope=l.Scope.INLINE_BLOT,p}(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 p=f.indexOf(l,u);return p!==-1&&p===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),p=f.length>>>0,E=arguments[1],w,m=0;m<p;m++)if(w=f[m],u.call(E,w,m,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(y,_,R){if(y==_)return y?[[o,y]]:[];(R<0||y.length<R)&&(R=null);var C=E(y,_),x=y.substring(0,C);y=y.substring(C),_=_.substring(C),C=w(y,_);var O=y.substring(y.length-C);y=y.substring(0,y.length-C),_=_.substring(0,_.length-C);var P=u(y,_);return x&&P.unshift([o,x]),O&&P.push([o,O]),S(P),R!=null&&(P=h(P,R)),P=v(P),P}function u(y,_){var R;if(!y)return[[a,_]];if(!_)return[[i,y]];var C=y.length>_.length?y:_,x=y.length>_.length?_:y,O=C.indexOf(x);if(O!=-1)return R=[[a,C.substring(0,O)],[o,x],[a,C.substring(O+x.length)]],y.length>_.length&&(R[0][0]=R[2][0]=i),R;if(x.length==1)return[[i,y],[a,_]];var P=m(y,_);if(P){var k=P[0],M=P[1],I=P[2],H=P[3],G=P[4],Z=l(k,I),W=l(M,H);return Z.concat([[o,G]],W)}return f(y,_)}function f(y,_){for(var R=y.length,C=_.length,x=Math.ceil((R+C)/2),O=x,P=2*x,k=new Array(P),M=new Array(P),I=0;I<P;I++)k[I]=-1,M[I]=-1;k[O+1]=0,M[O+1]=0;for(var H=R-C,G=H%2!=0,Z=0,W=0,B=0,F=0,T=0;T<x;T++){for(var L=-T+Z;L<=T-W;L+=2){var z=O+L,D;L==-T||L!=T&&k[z-1]<k[z+1]?D=k[z+1]:D=k[z-1]+1;for(var $=D-L;D<R&&$<C&&y.charAt(D)==_.charAt($);)D++,$++;if(k[z]=D,D>R)W+=2;else if($>C)Z+=2;else if(G){var K=O+H-L;if(K>=0&&K<P&&M[K]!=-1){var V=R-M[K];if(D>=V)return p(y,_,D,$)}}}for(var U=-T+B;U<=T-F;U+=2){var K=O+U,V;U==-T||U!=T&&M[K-1]<M[K+1]?V=M[K+1]:V=M[K-1]+1;for(var Y=V-U;V<R&&Y<C&&y.charAt(R-V-1)==_.charAt(C-Y-1);)V++,Y++;if(M[K]=V,V>R)F+=2;else if(Y>C)B+=2;else if(!G){var z=O+H-U;if(z>=0&&z<P&&k[z]!=-1){var D=k[z],$=O+D-z;if(V=R-V,D>=V)return p(y,_,D,$)}}}}return[[i,y],[a,_]]}function p(y,_,R,C){var x=y.substring(0,R),O=_.substring(0,C),P=y.substring(R),k=_.substring(C),M=l(x,O),I=l(P,k);return M.concat(I)}function E(y,_){if(!y||!_||y.charAt(0)!=_.charAt(0))return 0;for(var R=0,C=Math.min(y.length,_.length),x=C,O=0;R<x;)y.substring(O,x)==_.substring(O,x)?(R=x,O=R):C=x,x=Math.floor((C-R)/2+R);return x}function w(y,_){if(!y||!_||y.charAt(y.length-1)!=_.charAt(_.length-1))return 0;for(var R=0,C=Math.min(y.length,_.length),x=C,O=0;R<x;)y.substring(y.length-x,y.length-O)==_.substring(_.length-x,_.length-O)?(R=x,O=R):C=x,x=Math.floor((C-R)/2+R);return x}function m(y,_){var R=y.length>_.length?y:_,C=y.length>_.length?_:y;if(R.length<4||C.length*2<R.length)return null;function x(W,B,F){for(var T=W.substring(F,F+Math.floor(W.length/4)),L=-1,z="",D,$,K,V;(L=B.indexOf(T,L+1))!=-1;){var U=E(W.substring(F),B.substring(L)),Y=w(W.substring(0,F),B.substring(0,L));z.length<Y+U&&(z=B.substring(L-Y,L)+B.substring(L,L+U),D=W.substring(0,F-Y),$=W.substring(F+U),K=B.substring(0,L-Y),V=B.substring(L+U))}return z.length*2>=W.length?[D,$,K,V,z]:null}var O=x(R,C,Math.ceil(R.length/4)),P=x(R,C,Math.ceil(R.length/2)),k;if(!O&&!P)return null;P?O?k=O[4].length>P[4].length?O:P:k=P:k=O;var M,I,H,G;y.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 Z=k[4];return[M,I,H,G,Z]}function S(y){y.push([o,""]);for(var _=0,R=0,C=0,x="",O="",P;_<y.length;)switch(y[_][0]){case a:C++,O+=y[_][1],_++;break;case i:R++,x+=y[_][1],_++;break;case o:R+C>1?(R!==0&&C!==0&&(P=E(O,x),P!==0&&(_-R-C>0&&y[_-R-C-1][0]==o?y[_-R-C-1][1]+=O.substring(0,P):(y.splice(0,0,[o,O.substring(0,P)]),_++),O=O.substring(P),x=x.substring(P)),P=w(O,x),P!==0&&(y[_][1]=O.substring(O.length-P)+y[_][1],O=O.substring(0,O.length-P),x=x.substring(0,x.length-P))),R===0?y.splice(_-C,R+C,[a,O]):C===0?y.splice(_-R,R+C,[i,x]):y.splice(_-R-C,R+C,[i,x],[a,O]),_=_-R-C+(R?1:0)+(C?1:0)+1):_!==0&&y[_-1][0]==o?(y[_-1][1]+=y[_][1],y.splice(_,1)):_++,C=0,R=0,x="",O="";break}y[y.length-1][1]===""&&y.pop();var k=!1;for(_=1;_<y.length-1;)y[_-1][0]==o&&y[_+1][0]==o&&(y[_][1].substring(y[_][1].length-y[_-1][1].length)==y[_-1][1]?(y[_][1]=y[_-1][1]+y[_][1].substring(0,y[_][1].length-y[_-1][1].length),y[_+1][1]=y[_-1][1]+y[_+1][1],y.splice(_-1,1),k=!0):y[_][1].substring(0,y[_+1][1].length)==y[_+1][1]&&(y[_-1][1]+=y[_+1][1],y[_][1]=y[_][1].substring(y[_+1][1].length)+y[_+1][1],y.splice(_+1,1),k=!0)),_++;k&&S(y)}var b=l;b.INSERT=a,b.DELETE=i,b.EQUAL=o,r.exports=b;function g(y,_){if(_===0)return[o,y];for(var R=0,C=0;C<y.length;C++){var x=y[C];if(x[0]===i||x[0]===o){var O=R+x[1].length;if(_===O)return[C+1,y];if(_<O){y=y.slice();var P=_-R,k=[x[0],x[1].slice(0,P)],M=[x[0],x[1].slice(P)];return y.splice(C,1,k,M),[C+1,y]}else R=O}}throw new Error("cursor_pos is out of bounds!")}function h(y,_){var R=g(y,_),C=R[1],x=R[0],O=C[x],P=C[x+1];if(O==null)return y;if(O[0]!==o)return y;if(P!=null&&O[1]+P[1]===P[1]+O[1])return C.splice(x,2,P,O),d(C,x,2);if(P!=null&&P[1].indexOf(O[1])===0){C.splice(x,2,[P[0],O[1]],[0,O[1]]);var k=P[1].slice(O[1].length);return k.length>0&&C.splice(x+2,0,[P[0],k]),d(C,x,3)}else return y}function v(y){for(var _=!1,R=function(P){return P.charCodeAt(0)>=56320&&P.charCodeAt(0)<=57343},C=function(P){return P.charCodeAt(P.length-1)>=55296&&P.charCodeAt(P.length-1)<=56319},x=2;x<y.length;x+=1)y[x-2][0]===o&&C(y[x-2][1])&&y[x-1][0]===i&&R(y[x-1][1])&&y[x][0]===a&&R(y[x][1])&&(_=!0,y[x-1][1]=y[x-2][1].slice(-1)+y[x-1][1],y[x][1]=y[x-2][1].slice(-1)+y[x][1],y[x-2][1]=y[x-2][1].slice(0,-1));if(!_)return y;for(var O=[],x=0;x<y.length;x+=1)y[x][1].length>0&&O.push(y[x]);return O}function d(y,_,R){for(var C=_+R-1;C>=0&&C>=_-1;C--)if(C+1<y.length){var x=y[C],O=y[C+1];x[0]===O[1]&&y.splice(C,2,[x[0],x[1]+O[1]])}return y}},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,p,E){this.fn=f,this.context=p,this.once=E||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var p=[],E,w;if(this._eventsCount===0)return p;for(w in E=this._events)i.call(E,w)&&p.push(a?w.slice(1):w);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(E)):p},u.prototype.listeners=function(p,E){var w=a?a+p:p,m=this._events[w];if(E)return!!m;if(!m)return[];if(m.fn)return[m.fn];for(var S=0,b=m.length,g=new Array(b);S<b;S++)g[S]=m[S].fn;return g},u.prototype.emit=function(p,E,w,m,S,b){var g=a?a+p:p;if(!this._events[g])return!1;var h=this._events[g],v=arguments.length,d,y;if(h.fn){switch(h.once&&this.removeListener(p,h.fn,void 0,!0),v){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,E),!0;case 3:return h.fn.call(h.context,E,w),!0;case 4:return h.fn.call(h.context,E,w,m),!0;case 5:return h.fn.call(h.context,E,w,m,S),!0;case 6:return h.fn.call(h.context,E,w,m,S,b),!0}for(y=1,d=new Array(v-1);y<v;y++)d[y-1]=arguments[y];h.fn.apply(h.context,d)}else{var _=h.length,R;for(y=0;y<_;y++)switch(h[y].once&&this.removeListener(p,h[y].fn,void 0,!0),v){case 1:h[y].fn.call(h[y].context);break;case 2:h[y].fn.call(h[y].context,E);break;case 3:h[y].fn.call(h[y].context,E,w);break;case 4:h[y].fn.call(h[y].context,E,w,m);break;default:if(!d)for(R=1,d=new Array(v-1);R<v;R++)d[R-1]=arguments[R];h[y].fn.apply(h[y].context,d)}}return!0},u.prototype.on=function(p,E,w){var m=new l(E,w||this),S=a?a+p:p;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],m]:this._events[S].push(m):(this._events[S]=m,this._eventsCount++),this},u.prototype.once=function(p,E,w){var m=new l(E,w||this,!0),S=a?a+p:p;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],m]:this._events[S].push(m):(this._events[S]=m,this._eventsCount++),this},u.prototype.removeListener=function(p,E,w,m){var S=a?a+p:p;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&&(!m||b.once)&&(!w||b.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[S]);else{for(var g=0,h=[],v=b.length;g<v;g++)(b[g].fn!==E||m&&!b[g].once||w&&b[g].context!==w)&&h.push(b[g]);h.length?this._events[S]=h.length===1?h[0]:h:--this._eventsCount===0?this._events=new o:delete this._events[S]}return this},u.prototype.removeAllListeners=function(p){var E;return p?(E=a?a+p:p,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(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},o=function(){function le(fe,_e){var ge=[],re=!0,de=!1,ye=void 0;try{for(var Se=fe[Symbol.iterator](),$e;!(re=($e=Se.next()).done)&&(ge.push($e.value),!(_e&&ge.length===_e));re=!0);}catch(Qe){de=!0,ye=Qe}finally{try{!re&&Se.return&&Se.return()}finally{if(de)throw ye}}return ge}return function(fe,_e){if(Array.isArray(fe))return fe;if(Symbol.iterator in Object(fe))return le(fe,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function le(fe,_e){for(var ge=0;ge<_e.length;ge++){var re=_e[ge];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(fe,re.key,re)}}return function(fe,_e,ge){return _e&&le(fe.prototype,_e),ge&&le(fe,ge),fe}}(),u=i(3),f=M(u),p=i(2),E=M(p),w=i(0),m=M(w),S=i(5),b=M(S),g=i(10),h=M(g),v=i(9),d=M(v),y=i(36),_=i(37),R=i(13),C=M(R),x=i(26),O=i(38),P=i(39),k=i(40);function M(le){return le&&le.__esModule?le:{default:le}}function I(le,fe,_e){return fe in le?Object.defineProperty(le,fe,{value:_e,enumerable:!0,configurable:!0,writable:!0}):le[fe]=_e,le}function H(le,fe){if(!(le instanceof fe))throw new TypeError("Cannot call a class as a function")}function G(le,fe){if(!le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe&&(typeof fe=="object"||typeof fe=="function")?fe:le}function Z(le,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof fe);le.prototype=Object.create(fe&&fe.prototype,{constructor:{value:le,enumerable:!1,writable:!0,configurable:!0}}),fe&&(Object.setPrototypeOf?Object.setPrototypeOf(le,fe):le.__proto__=fe)}var W=(0,h.default)("quill:clipboard"),B="__ql-matcher",F=[[Node.TEXT_NODE,Ie],[Node.TEXT_NODE,ie],["br",te],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,oe],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ke],["li",ne],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",ee]],T=[y.AlignAttribute,O.DirectionAttribute].reduce(function(le,fe){return le[fe.keyName]=fe,le},{}),L=[y.AlignStyle,_.BackgroundStyle,x.ColorStyle,O.DirectionStyle,P.FontStyle,k.SizeStyle].reduce(function(le,fe){return le[fe.keyName]=fe,le},{}),z=function(le){Z(fe,le);function fe(_e,ge){H(this,fe);var re=G(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this,_e,ge));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=[],F.concat(re.options.matchers).forEach(function(de){var ye=o(de,2),Se=ye[0],$e=ye[1];!ge.matchVisual&&$e===oe||re.addMatcher(Se,$e)}),re}return l(fe,[{key:"addMatcher",value:function(ge,re){this.matchers.push([ge,re])}},{key:"convert",value:function(ge){if(typeof ge=="string")return this.container.innerHTML=ge.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[C.default.blotName]){var de=this.container.innerText;return this.container.innerHTML="",new E.default().insert(de,I({},C.default.blotName,re[C.default.blotName]))}var ye=this.prepareMatching(),Se=o(ye,2),$e=Se[0],Qe=Se[1],Re=U(this.container,$e,Qe);return K(Re,`
140
+ `)&&Re.ops[Re.ops.length-1].attributes==null&&(Re=Re.compose(new E.default().retain(Re.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Re),this.container.innerHTML="",Re}},{key:"dangerouslyPasteHTML",value:function(ge,re){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof ge=="string")this.quill.setContents(this.convert(ge),re),this.quill.setSelection(0,b.default.sources.SILENT);else{var ye=this.convert(re);this.quill.updateContents(new E.default().retain(ge).concat(ye),de),this.quill.setSelection(ge+ye.length(),b.default.sources.SILENT)}}},{key:"onPaste",value:function(ge){var re=this;if(!(ge.defaultPrevented||!this.quill.isEnabled())){var de=this.quill.getSelection(),ye=new E.default().retain(de.index),Se=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(b.default.sources.SILENT),setTimeout(function(){ye=ye.concat(re.convert()).delete(de.length),re.quill.updateContents(ye,b.default.sources.USER),re.quill.setSelection(ye.length()-de.length,b.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=Se,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ge=this,re=[],de=[];return this.matchers.forEach(function(ye){var Se=o(ye,2),$e=Se[0],Qe=Se[1];switch($e){case Node.TEXT_NODE:de.push(Qe);break;case Node.ELEMENT_NODE:re.push(Qe);break;default:[].forEach.call(ge.container.querySelectorAll($e),function(Re){Re[B]=Re[B]||[],Re[B].push(Qe)});break}}),[re,de]}}]),fe}(d.default);z.DEFAULTS={matchers:[],matchVisual:!0};function D(le,fe,_e){return(typeof fe>"u"?"undefined":a(fe))==="object"?Object.keys(fe).reduce(function(ge,re){return D(ge,re,fe[re])},le):le.reduce(function(ge,re){return re.attributes&&re.attributes[fe]?ge.push(re):ge.insert(re.insert,(0,f.default)({},I({},fe,_e),re.attributes))},new E.default)}function $(le){if(le.nodeType!==Node.ELEMENT_NODE)return{};var fe="__ql-computed-style";return le[fe]||(le[fe]=window.getComputedStyle(le))}function K(le,fe){for(var _e="",ge=le.ops.length-1;ge>=0&&_e.length<fe.length;--ge){var re=le.ops[ge];if(typeof re.insert!="string")break;_e=re.insert+_e}return _e.slice(-1*fe.length)===fe}function V(le){if(le.childNodes.length===0)return!1;var fe=$(le);return["block","list-item"].indexOf(fe.display)>-1}function U(le,fe,_e){return le.nodeType===le.TEXT_NODE?_e.reduce(function(ge,re){return re(le,ge)},new E.default):le.nodeType===le.ELEMENT_NODE?[].reduce.call(le.childNodes||[],function(ge,re){var de=U(re,fe,_e);return re.nodeType===le.ELEMENT_NODE&&(de=fe.reduce(function(ye,Se){return Se(re,ye)},de),de=(re[B]||[]).reduce(function(ye,Se){return Se(re,ye)},de)),ge.concat(de)},new E.default):new E.default}function Y(le,fe,_e){return D(_e,le,!0)}function X(le,fe){var _e=m.default.Attributor.Attribute.keys(le),ge=m.default.Attributor.Class.keys(le),re=m.default.Attributor.Style.keys(le),de={};return _e.concat(ge).concat(re).forEach(function(ye){var Se=m.default.query(ye,m.default.Scope.ATTRIBUTE);Se!=null&&(de[Se.attrName]=Se.value(le),de[Se.attrName])||(Se=T[ye],Se!=null&&(Se.attrName===ye||Se.keyName===ye)&&(de[Se.attrName]=Se.value(le)||void 0),Se=L[ye],Se!=null&&(Se.attrName===ye||Se.keyName===ye)&&(Se=L[ye],de[Se.attrName]=Se.value(le)||void 0))}),Object.keys(de).length>0&&(fe=D(fe,de)),fe}function Q(le,fe){var _e=m.default.query(le);if(_e==null)return fe;if(_e.prototype instanceof m.default.Embed){var ge={},re=_e.value(le);re!=null&&(ge[_e.blotName]=re,fe=new E.default().insert(ge,_e.formats(le)))}else typeof _e.formats=="function"&&(fe=D(fe,_e.blotName,_e.formats(le)));return fe}function te(le,fe){return K(fe,`
141
+ `)||fe.insert(`
142
+ `),fe}function ee(){return new E.default}function ne(le,fe){var _e=m.default.query(le);if(_e==null||_e.blotName!=="list-item"||!K(fe,`
143
+ `))return fe;for(var ge=-1,re=le.parentNode;!re.classList.contains("ql-clipboard");)(m.default.query(re)||{}).blotName==="list"&&(ge+=1),re=re.parentNode;return ge<=0?fe:fe.compose(new E.default().retain(fe.length()-1).retain(1,{indent:ge}))}function ie(le,fe){return K(fe,`
144
+ `)||(V(le)||fe.length()>0&&le.nextSibling&&V(le.nextSibling))&&fe.insert(`
145
+ `),fe}function oe(le,fe){if(V(le)&&le.nextElementSibling!=null&&!K(fe,`
146
+
147
+ `)){var _e=le.offsetHeight+parseFloat($(le).marginTop)+parseFloat($(le).marginBottom);le.nextElementSibling.offsetTop>le.offsetTop+_e*1.5&&fe.insert(`
148
+ `)}return fe}function ke(le,fe){var _e={},ge=le.style||{};return ge.fontStyle&&$(le).fontStyle==="italic"&&(_e.italic=!0),ge.fontWeight&&($(le).fontWeight.startsWith("bold")||parseInt($(le).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(fe=D(fe,_e)),parseFloat(ge.textIndent||0)>0&&(fe=new E.default().insert(" ").concat(fe)),fe}function Ie(le,fe){var _e=le.data;if(le.parentNode.tagName==="O:P")return fe.insert(_e.trim());if(_e.trim().length===0&&le.parentNode.classList.contains("ql-clipboard"))return fe;if(!$(le.parentNode).whiteSpace.startsWith("pre")){var ge=function(de,ye){return ye=ye.replace(/[^\u00a0]/g,""),ye.length<1&&de?" ":ye};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,ge.bind(ge,!0)),(le.previousSibling==null&&V(le.parentNode)||le.previousSibling!=null&&V(le.previousSibling))&&(_e=_e.replace(/^\s+/,ge.bind(ge,!1))),(le.nextSibling==null&&V(le.parentNode)||le.nextSibling!=null&&V(le.nextSibling))&&(_e=_e.replace(/\s+$/,ge.bind(ge,!1)))}return fe.insert(_e)}n.default=z,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=ie,n.matchSpacing=oe,n.matchText=Ie},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,g){for(var h=0;h<g.length;h++){var v=g[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,g,h){return g&&S(b.prototype,g),h&&S(b,h),b}}(),o=function S(b,g,h){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,g);if(v===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,g,h)}else{if("value"in v)return v.value;var y=v.get;return y===void 0?void 0:y.call(h)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function p(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 m=function(S){w(b,S);function b(){return p(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"optimize",value:function(h){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,h),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);m.blotName="bold",m.tagName=["STRONG","B"],n.default=m},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,Z=!1,W=void 0;try{for(var B=M[Symbol.iterator](),F;!(G=(F=B.next()).done)&&(H.push(F.value),!(I&&H.length===I));G=!0);}catch(T){Z=!0,W=T}finally{try{!G&&B.return&&B.return()}finally{if(Z)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=h(l),f=i(0),p=h(f),E=i(5),w=h(E),m=i(10),S=h(m),b=i(9),g=h(b);function h(k){return k&&k.__esModule?k:{default:k}}function v(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 y(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 R=(0,S.default)("quill:toolbar"),C=function(k){_(M,k);function M(I,H){d(this,M);var G=y(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,I,H));if(Array.isArray(G.options.container)){var Z=document.createElement("div");O(Z,G.options.container),I.container.parentNode.insertBefore(Z,I.container),G.container=Z}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=R.error("Container required for toolbar",G.options),y(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(B){G.addHandler(B,G.options.handlers[B])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(B){G.attach(B)}),G.quill.on(w.default.events.EDITOR_CHANGE,function(B,F){B===w.default.events.SELECTION_CHANGE&&G.update(F)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var B=G.quill.selection.getRange(),F=a(B,1),T=F[0];G.update(T)}),G}return o(M,[{key:"addHandler",value:function(H,G){this.handlers[H]=G}},{key:"attach",value:function(H){var G=this,Z=[].find.call(H.classList,function(B){return B.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),H.tagName==="BUTTON"&&H.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){R.warn("ignoring attaching to disabled format",Z,H);return}if(p.default.query(Z)==null){R.warn("ignoring attaching to nonexistent format",Z,H);return}}var W=H.tagName==="SELECT"?"change":"click";H.addEventListener(W,function(B){var F=void 0;if(H.tagName==="SELECT"){if(H.selectedIndex<0)return;var T=H.options[H.selectedIndex];T.hasAttribute("selected")?F=!1:F=T.value||!1}else H.classList.contains("ql-active")?F=!1:F=H.value||!H.hasAttribute("value"),B.preventDefault();G.quill.focus();var L=G.quill.selection.getRange(),z=a(L,1),D=z[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,F);else if(p.default.query(Z).prototype instanceof p.default.Embed){if(F=prompt("Enter "+Z),!F)return;G.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(v({},Z,F)),w.default.sources.USER)}else G.quill.format(Z,F,w.default.sources.USER);G.update(D)}),this.controls.push([Z,H])}}},{key:"update",value:function(H){var G=H==null?{}:this.quill.getFormat(H);this.controls.forEach(function(Z){var W=a(Z,2),B=W[0],F=W[1];if(F.tagName==="SELECT"){var T=void 0;if(H==null)T=null;else if(G[B]==null)T=F.querySelector("option[selected]");else if(!Array.isArray(G[B])){var L=G[B];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),T=F.querySelector('option[value="'+L+'"]')}T==null?(F.value="",F.selectedIndex=-1):T.selected=!0}else if(H==null)F.classList.remove("ql-active");else if(F.hasAttribute("value")){var z=G[B]===F.getAttribute("value")||G[B]!=null&&G[B].toString()===F.getAttribute("value")||G[B]==null&&!F.getAttribute("value");F.classList.toggle("ql-active",z)}else F.classList.toggle("ql-active",G[B]!=null)})}}]),M}(g.default);C.DEFAULTS={};function x(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")x(H,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?P(H,Z,W):x(H,Z,W)}}),k.appendChild(H)})}function P(k,M,I){var H=document.createElement("select");H.classList.add("ql-"+M),I.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),H.appendChild(Z)}),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){p.default.query(G,p.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 Z=M==="+1"?1:-1;H.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,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,g){for(var h=0;h<g.length;h++){var v=g[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,g,h){return g&&S(b.prototype,g),h&&S(b,h),b}}(),o=function S(b,g,h){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,g);if(v===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,g,h)}else{if("value"in v)return v.value;var y=v.get;return y===void 0?void 0:y.call(h)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function p(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 m=function(S){w(b,S);function b(g,h){p(this,b);var v=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,g));return v.label.innerHTML=h,v.container.classList.add("ql-color-picker"),[].slice.call(v.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),v}return a(b,[{key:"buildItem",value:function(h){var v=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"buildItem",this).call(this,h);return v.style.backgroundColor=h.getAttribute("value")||"",v}},{key:"selectItem",value:function(h,v){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,h,v);var d=this.label.querySelector(".ql-color-label"),y=h&&h.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=y:d.style.fill=y)}}]),b}(u.default);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,g){for(var h=0;h<g.length;h++){var v=g[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,g,h){return g&&S(b.prototype,g),h&&S(b,h),b}}(),o=function S(b,g,h){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,g);if(v===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,g,h)}else{if("value"in v)return v.value;var y=v.get;return y===void 0?void 0:y.call(h)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function p(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 m=function(S){w(b,S);function b(g,h){p(this,b);var v=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,g));return v.container.classList.add("ql-icon-picker"),[].forEach.call(v.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=h[d.getAttribute("data-value")||""]}),v.defaultItem=v.container.querySelector(".ql-selected"),v.selectItem(v.defaultItem),v}return a(b,[{key:"selectItem",value:function(h,v){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,h,v),h=h||this.defaultItem,this.label.innerHTML=h.innerHTML}}]),b}(u.default);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,p){for(var E=0;E<p.length;E++){var w=p[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,p,E){return p&&u(f.prototype,p),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,p){var E=this;o(this,u),this.quill=f,this.boundsContainer=p||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(p){var E=p.left+p.width/2-this.root.offsetWidth/2,w=p.bottom+this.quill.root.scrollTop;this.root.style.left=E+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var m=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),b=0;if(S.right>m.right&&(b=m.right-S.right,this.root.style.left=E+b+"px"),S.left<m.left&&(b=m.left-S.left,this.root.style.left=E+b+"px"),S.bottom>m.bottom){var g=S.bottom-S.top,h=p.bottom-p.top+g;this.root.style.top=w-h+"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 P(k,M){var I=[],H=!0,G=!1,Z=void 0;try{for(var W=k[Symbol.iterator](),B;!(H=(B=W.next()).done)&&(I.push(B.value),!(M&&I.length===M));H=!0);}catch(F){G=!0,Z=F}finally{try{!H&&W.return&&W.return()}finally{if(G)throw Z}}return I}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return P(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function P(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:P(G,M,I)}else{if("value"in H)return H.value;var Z=H.get;return Z===void 0?void 0:Z.call(I)}},l=function(){function P(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&&P(k.prototype,M),I&&P(k,I),k}}(),u=i(3),f=d(u),p=i(8),E=d(p),w=i(43),m=d(w),S=i(27),b=d(S),g=i(15),h=i(41),v=d(h);function d(P){return P&&P.__esModule?P:{default:P}}function y(P,k){if(!(P instanceof k))throw new TypeError("Cannot call a class as a function")}function _(P,k){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:P}function R(P,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);P.prototype=Object.create(k&&k.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(P,k):P.__proto__=k)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],x=function(P){R(k,P);function k(M,I){y(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")),v.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),v.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}(m.default);x.DEFAULTS=(0,f.default)(!0,{},m.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(P){R(k,P);function k(M,I){y(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,Z){if(H!=null){if(H.length===0&&Z===E.default.sources.USER){var W=I.quill.scroll.descendant(b.default,H.index),B=a(W,2),F=B[0],T=B[1];if(F!=null){I.linkRange=new g.Range(H.index-T,F.length());var L=b.default.formats(F.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=x},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),p=i(65),E=re(p),w=i(66),m=re(w),S=i(67),b=re(S),g=i(37),h=i(26),v=i(39),d=i(40),y=i(56),_=re(y),R=i(68),C=re(R),x=i(27),O=re(x),P=i(69),k=re(P),M=i(70),I=re(M),H=i(71),G=re(H),Z=i(72),W=re(Z),B=i(73),F=re(B),T=i(13),L=re(T),z=i(74),D=re(z),$=i(75),K=re($),V=i(57),U=re(V),Y=i(41),X=re(Y),Q=i(28),te=re(Q),ee=i(59),ne=re(ee),ie=i(60),oe=re(ie),ke=i(61),Ie=re(ke),le=i(108),fe=re(le),_e=i(62),ge=re(_e);function re(de){return de&&de.__esModule?de:{default:de}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":g.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":v.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":g.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":v.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":g.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":v.FontClass,"formats/size":d.SizeClass,"formats/blockquote":E.default,"formats/code-block":L.default,"formats/header":m.default,"formats/list":b.default,"formats/bold":_.default,"formats/code":T.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":F.default,"formats/list/item":S.ListItem,"modules/formula":D.default,"modules/syntax":K.default,"modules/toolbar":U.default,"themes/bubble":fe.default,"themes/snow":ge.default,"ui/icons":X.default,"ui/picker":te.default,"ui/icon-picker":oe.default,"ui/color-picker":ne.default,"ui/tooltip":Ie.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(g,h){for(var v=0;v<h.length;v++){var d=h[v];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}}return function(g,h,v){return h&&b(g.prototype,h),v&&b(g,v),g}}(),o=function b(g,h,v){g===null&&(g=Function.prototype);var d=Object.getOwnPropertyDescriptor(g,h);if(d===void 0){var y=Object.getPrototypeOf(g);return y===null?void 0:b(y,h,v)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(v)}},l=i(0),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function p(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function E(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function w(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}var m=function(b){w(g,b);function g(){return p(this,g),E(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"add",value:function(v,d){if(d==="+1"||d==="-1"){var y=this.value(v)||0;d=d==="+1"?y+1:y-1}return d===0?(this.remove(v),!0):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"add",this).call(this,v,d)}},{key:"canAdd",value:function(v,d){return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,v,d)||o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,v,parseInt(d))}},{key:"value",value:function(v){return parseInt(o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,v))||void 0}}]),g}(u.default.Attributor.Class),S=new m("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,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function f(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function p(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var E=function(w){p(m,w);function m(){return u(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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 m(S,b){for(var g=0;g<b.length;g++){var h=b[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(S,h.key,h)}}return function(S,b,g){return b&&m(S.prototype,b),g&&m(S,g),S}}(),o=i(4),l=u(o);function u(m){return m&&m.__esModule?m:{default:m}}function f(m,S){if(!(m instanceof S))throw new TypeError("Cannot call a class as a function")}function p(m,S){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:m}function E(m,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);m.prototype=Object.create(S&&S.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(m,S):m.__proto__=S)}var w=function(m){E(S,m);function S(){return f(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"formats",value:function(g){return this.tagName.indexOf(g.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 y(_,R){for(var C=0;C<R.length;C++){var x=R[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,R,C){return R&&y(_.prototype,R),C&&y(_,C),_}}(),o=function y(_,R,C){_===null&&(_=Function.prototype);var x=Object.getOwnPropertyDescriptor(_,R);if(x===void 0){var O=Object.getPrototypeOf(_);return O===null?void 0:y(O,R,C)}else{if("value"in x)return x.value;var P=x.get;return P===void 0?void 0:P.call(C)}},l=i(0),u=m(l),f=i(4),p=m(f),E=i(25),w=m(E);function m(y){return y&&y.__esModule?y:{default:y}}function S(y,_,R){return _ in y?Object.defineProperty(y,_,{value:R,enumerable:!0,configurable:!0,writable:!0}):y[_]=R,y}function b(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function h(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var v=function(y){h(_,y);function _(){return b(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(C,x){C===d.blotName&&!x?this.replaceWith(u.default.create(this.statics.scope)):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,x)}},{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,x){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,x),this):(this.parent.unwrap(),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,x))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(p.default);v.blotName="list-item",v.tagName="LI";var d=function(y){h(_,y),a(_,null,[{key:"create",value:function(C){var x=C==="ordered"?"OL":"UL",O=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,x);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 _(R){b(this,_);var C=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,R)),x=function(P){if(P.target.parentNode===R){var k=C.statics.formats(R),M=u.default.find(P.target);k==="checked"?M.format("list","unchecked"):k==="unchecked"&&M.format("list","checked")}};return R.addEventListener("touchstart",x),R.addEventListener("mousedown",x),C}return a(_,[{key:"format",value:function(C,x){this.children.length>0&&this.children.tail.format(C,x)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,x){if(C instanceof v)o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,x);else{var O=x==null?this.length():x.offset(this),P=this.split(O);P.parent.insertBefore(C,P)}}},{key:"optimize",value:function(C){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var x=this.next;x!=null&&x.prev===this&&x.statics.blotName===this.statics.blotName&&x.domNode.tagName===this.domNode.tagName&&x.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(x.moveChildren(this),x.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var x=u.default.create(this.statics.defaultChild);C.moveChildren(x),this.appendChild(x)}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=[v],n.ListItem=v,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,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function f(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function p(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var E=function(w){p(m,w);function m(){return u(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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,g){for(var h=0;h<g.length;h++){var v=g[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,v.key,v)}}return function(b,g,h){return g&&S(b.prototype,g),h&&S(b,h),b}}(),o=function S(b,g,h){b===null&&(b=Function.prototype);var v=Object.getOwnPropertyDescriptor(b,g);if(v===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,g,h)}else{if("value"in v)return v.value;var y=v.get;return y===void 0?void 0:y.call(h)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function p(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 m=function(S){w(b,S);function b(){return p(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(h){return h==="super"?document.createElement("sup"):h==="sub"?document.createElement("sub"):o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,h)}},{key:"formats",value:function(h){if(h.tagName==="SUB")return"sub";if(h.tagName==="SUP")return"super"}}]),b}(u.default);m.blotName="script",m.tagName=["SUB","SUP"],n.default=m},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,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function f(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function p(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var E=function(w){p(m,w);function m(){return u(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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,m){if(!(w instanceof m))throw new TypeError("Cannot call a class as a function")}function f(w,m){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:w}function p(w,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);w.prototype=Object.create(m&&m.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(w,m):w.__proto__=m)}var E=function(w){p(m,w);function m(){return u(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(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 g(h,v){for(var d=0;d<v.length;d++){var y=v[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,v,d){return v&&g(h.prototype,v),d&&g(h,d),h}}(),o=function g(h,v,d){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,v);if(y===void 0){var _=Object.getPrototypeOf(h);return _===null?void 0:g(_,v,d)}else{if("value"in y)return y.value;var R=y.get;return R===void 0?void 0:R.call(d)}},l=i(0),u=p(l),f=i(27);function p(g){return g&&g.__esModule?g:{default:g}}function E(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function w(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function m(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var S=["alt","height","width"],b=function(g){m(h,g);function h(){return E(this,h),w(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"format",value:function(d,y){S.indexOf(d)>-1?y?this.domNode.setAttribute(d,y):this.domNode.removeAttribute(d):o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,d,y)}}],[{key:"create",value:function(d){var y=o(h.__proto__||Object.getPrototypeOf(h),"create",this).call(this,d);return typeof d=="string"&&y.setAttribute("src",this.sanitize(d)),y}},{key:"formats",value:function(d){return S.reduce(function(y,_){return d.hasAttribute(_)&&(y[_]=d.getAttribute(_)),y},{})}},{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")}}]),h}(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 g(h,v){for(var d=0;d<v.length;d++){var y=v[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,v,d){return v&&g(h.prototype,v),d&&g(h,d),h}}(),o=function g(h,v,d){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,v);if(y===void 0){var _=Object.getPrototypeOf(h);return _===null?void 0:g(_,v,d)}else{if("value"in y)return y.value;var R=y.get;return R===void 0?void 0:R.call(d)}},l=i(4),u=i(27),f=p(u);function p(g){return g&&g.__esModule?g:{default:g}}function E(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function w(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function m(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var S=["height","width"],b=function(g){m(h,g);function h(){return E(this,h),w(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"format",value:function(d,y){S.indexOf(d)>-1?y?this.domNode.setAttribute(d,y):this.domNode.removeAttribute(d):o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,d,y)}}],[{key:"create",value:function(d){var y=o(h.__proto__||Object.getPrototypeOf(h),"create",this).call(this,d);return y.setAttribute("frameborder","0"),y.setAttribute("allowfullscreen",!0),y.setAttribute("src",this.sanitize(d)),y}},{key:"formats",value:function(d){return S.reduce(function(y,_){return d.hasAttribute(_)&&(y[_]=d.getAttribute(_)),y},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),h}(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(y,_){for(var R=0;R<_.length;R++){var C=_[R];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(y,C.key,C)}}return function(y,_,R){return _&&d(y.prototype,_),R&&d(y,R),y}}(),o=function d(y,_,R){y===null&&(y=Function.prototype);var C=Object.getOwnPropertyDescriptor(y,_);if(C===void 0){var x=Object.getPrototypeOf(y);return x===null?void 0:d(x,_,R)}else{if("value"in C)return C.value;var O=C.get;return O===void 0?void 0:O.call(R)}},l=i(35),u=m(l),f=i(5),p=m(f),E=i(9),w=m(E);function m(d){return d&&d.__esModule?d:{default:d}}function S(d,y){if(!(d instanceof y))throw new TypeError("Cannot call a class as a function")}function b(d,y){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:d}function g(d,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);d.prototype=Object.create(y&&y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(d,y):d.__proto__=y)}var h=function(d){g(y,d);function y(){return S(this,y),b(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"create",value:function(R){var C=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,R);return typeof R=="string"&&(window.katex.render(R,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",R)),C}},{key:"value",value:function(R){return R.getAttribute("data-value")}}]),y}(u.default);h.blotName="formula",h.className="ql-formula",h.tagName="SPAN";var v=function(d){g(y,d),a(y,null,[{key:"register",value:function(){p.default.register(h,!0)}}]);function y(){S(this,y);var _=b(this,(y.__proto__||Object.getPrototypeOf(y)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return y}(w.default);n.FormulaBlot=h,n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function R(C,x){for(var O=0;O<x.length;O++){var P=x[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(C,P.key,P)}}return function(C,x,O){return x&&R(C.prototype,x),O&&R(C,O),C}}(),o=function R(C,x,O){C===null&&(C=Function.prototype);var P=Object.getOwnPropertyDescriptor(C,x);if(P===void 0){var k=Object.getPrototypeOf(C);return k===null?void 0:R(k,x,O)}else{if("value"in P)return P.value;var M=P.get;return M===void 0?void 0:M.call(O)}},l=i(0),u=b(l),f=i(5),p=b(f),E=i(9),w=b(E),m=i(13),S=b(m);function b(R){return R&&R.__esModule?R:{default:R}}function g(R,C){if(!(R instanceof C))throw new TypeError("Cannot call a class as a function")}function h(R,C){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:R}function v(R,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);R.prototype=Object.create(C&&C.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(R,C):R.__proto__=C)}var d=function(R){v(C,R);function C(){return g(this,C),h(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 P=this.domNode.textContent;this.cachedText!==P&&((P.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=O(P),this.domNode.normalize(),this.attach()),this.cachedText=P)}}]),C}(S.default);d.className="ql-syntax";var y=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),_=function(R){v(C,R),a(C,null,[{key:"register",value:function(){p.default.register(y,!0),p.default.register(d,!0)}}]);function C(x,O){g(this,C);var P=h(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,x,O));if(typeof P.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return P.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){P.highlight(),k=null},P.options.interval)}),P.highlight(),P}return a(C,[{key:"highlight",value:function(){var O=this;if(!this.quill.selection.composing){this.quill.update(p.default.sources.USER);var P=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(k){k.highlight(O.options.highlight)}),this.quill.update(p.default.sources.SILENT),P!=null&&this.quill.setSelection(P,p.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(R){var C=window.hljs.highlightAuto(R);return C.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=y,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(x,O,P){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,O);if(k===void 0){var M=Object.getPrototypeOf(x);return M===null?void 0:C(M,O,P)}else{if("value"in k)return k.value;var I=k.get;return I===void 0?void 0:I.call(P)}},o=function(){function C(x,O){for(var P=0;P<O.length;P++){var k=O[P];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,O,P){return O&&C(x.prototype,O),P&&C(x,P),x}}(),l=i(3),u=g(l),f=i(8),p=g(f),E=i(43),w=g(E),m=i(15),S=i(41),b=g(S);function g(C){return C&&C.__esModule?C:{default:C}}function h(C,x){if(!(C instanceof x))throw new TypeError("Cannot call a class as a function")}function v(C,x){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:C}function d(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);C.prototype=Object.create(x&&x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(C,x):C.__proto__=x)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(x,C);function x(O,P){h(this,x),P.modules.toolbar!=null&&P.modules.toolbar.container==null&&(P.modules.toolbar.container=y);var k=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,O,P));return k.quill.container.classList.add("ql-bubble"),k}return o(x,[{key:"extendToolbar",value:function(P){this.tooltip=new R(this.quill,this.options.bounds),this.tooltip.root.appendChild(P.container),this.buildButtons([].slice.call(P.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(P.container.querySelectorAll("select")),b.default)}}]),x}(w.default);_.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(x){x?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var R=function(C){d(x,C);function x(O,P){h(this,x);var k=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,O,P));return k.quill.on(p.default.events.EDITOR_CHANGE,function(M,I,H,G){if(M===p.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&G===p.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var Z=k.quill.getLines(I.index,I.length);if(Z.length===1)k.position(k.quill.getBounds(I));else{var W=Z[Z.length-1],B=k.quill.getIndex(W),F=Math.min(W.length()-1,I.index+I.length-B),T=k.quill.getBounds(new m.Range(B,F));k.position(T)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return o(x,[{key:"listen",value:function(){var P=this;a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){P.root.classList.remove("ql-editing")}),this.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!P.root.classList.contains("ql-hidden")){var k=P.quill.getSelection();k!=null&&P.position(P.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(P){var k=a(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"position",this).call(this,P),M=this.root.querySelector(".ql-tooltip-arrow");if(M.style.marginLeft="",k===0)return k;M.style.marginLeft=-1*k-M.offsetWidth/2+"px"}}]),x}(E.BaseTooltip);R.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=R,n.default=_},function(r,n,i){r.exports=i(63)}]).default})})(iS);var PD=iS.exports,p2={},aS={exports:{}},Ho={},Fu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Fu.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,p=26,E=38,w=700,m=72,S=128,b="-",g=/^xn--/,h=/[^\x20-\x7E]/,v=/[\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"},y=u-f,_=Math.floor,R=String.fromCharCode,C;function x(T){throw new RangeError(d[T])}function O(T,L){for(var z=T.length,D=[];z--;)D[z]=L(T[z]);return D}function P(T,L){var z=T.split("@"),D="";z.length>1&&(D=z[0]+"@",T=z[1]),T=T.replace(v,".");var $=T.split("."),K=O($,L).join(".");return D+K}function k(T){for(var L=[],z=0,D=T.length,$,K;z<D;)$=T.charCodeAt(z++),$>=55296&&$<=56319&&z<D?(K=T.charCodeAt(z++),(K&64512)==56320?L.push((($&1023)<<10)+(K&1023)+65536):(L.push($),z--)):L.push($);return L}function M(T){return O(T,function(L){var z="";return L>65535&&(L-=65536,z+=R(L>>>10&1023|55296),L=56320|L&1023),z+=R(L),z}).join("")}function I(T){return T-48<10?T-22:T-65<26?T-65:T-97<26?T-97:u}function H(T,L){return T+22+75*(T<26)-((L!=0)<<5)}function G(T,L,z){var D=0;for(T=z?_(T/w):T>>1,T+=_(T/L);T>y*p>>1;D+=u)T=_(T/y);return _(D+(y+1)*T/(T+E))}function Z(T){var L=[],z=T.length,D,$=0,K=S,V=m,U,Y,X,Q,te,ee,ne,ie,oe;for(U=T.lastIndexOf(b),U<0&&(U=0),Y=0;Y<U;++Y)T.charCodeAt(Y)>=128&&x("not-basic"),L.push(T.charCodeAt(Y));for(X=U>0?U+1:0;X<z;){for(Q=$,te=1,ee=u;X>=z&&x("invalid-input"),ne=I(T.charCodeAt(X++)),(ne>=u||ne>_((l-$)/te))&&x("overflow"),$+=ne*te,ie=ee<=V?f:ee>=V+p?p:ee-V,!(ne<ie);ee+=u)oe=u-ie,te>_(l/oe)&&x("overflow"),te*=oe;D=L.length+1,V=G($-Q,D,Q==0),_($/D)>l-K&&x("overflow"),K+=_($/D),$%=D,L.splice($++,0,K)}return M(L)}function W(T){var L,z,D,$,K,V,U,Y,X,Q,te,ee=[],ne,ie,oe,ke;for(T=k(T),ne=T.length,L=S,z=0,K=m,V=0;V<ne;++V)te=T[V],te<128&&ee.push(R(te));for(D=$=ee.length,$&&ee.push(b);D<ne;){for(U=l,V=0;V<ne;++V)te=T[V],te>=L&&te<U&&(U=te);for(ie=D+1,U-L>_((l-z)/ie)&&x("overflow"),z+=(U-L)*ie,L=U,V=0;V<ne;++V)if(te=T[V],te<L&&++z>l&&x("overflow"),te==L){for(Y=z,X=u;Q=X<=K?f:X>=K+p?p:X-K,!(Y<Q);X+=u)ke=Y-Q,oe=u-Q,ee.push(R(H(Q+ke%oe,0))),Y=_(ke/oe);ee.push(R(H(Y,0))),K=G(z,ie,D==$),z=0,++D}++z,++L}return ee.join("")}function B(T){return P(T,function(L){return g.test(L)?Z(L.slice(4).toLowerCase()):L})}function F(T){return P(T,function(L){return h.test(L)?"xn--"+W(L):L})}if(o={version:"1.4.1",ucs2:{decode:k,encode:M},decode:Z,encode:W,toASCII:F,toUnicode:B},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)}(Fu,Fu.exports)),Fu.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 Xc(){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 p=[],E=0;E<u.length;E+=1)p[E]=u[E];for(var w=0;w<f.length;w+=1)p[w+u.length]=f[w];return p},a=function(u,f){for(var p=[],E=f,w=0;E<u.length;E+=1,w+=1)p[w]=u[E];return p},o=function(l,u){for(var f="",p=0;p<l.length;p+=1)f+=l[p],p+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 p=a(arguments,1),E,w=function(){if(this instanceof E){var h=f.apply(this,i(p,arguments));return Object(h)===h?h:this}return f.apply(u,i(p,arguments))},m=r(0,f.length-p.length),S=[],b=0;b<m;b++)S[b]="$"+b;if(E=Function("binder","return function ("+o(S,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var g=function(){};g.prototype=f.prototype,E.prototype=new g,g.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 Js(){if(K4)return yg;K4=1;var e,t=kD(),r=TD(),n=AD(),i=RD(),a=oS(),o=Xc(),l=MD(),u=Function,f=function(W){try{return u('"use strict"; return ('+W+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var E=function(){throw new o},w=p?function(){try{return arguments.callee,E}catch{try{return p(arguments,"callee").get}catch{return E}}}():E,m=ND()(),S=ID()(),b=Object.getPrototypeOf||(S?function(W){return W.__proto__}:null),g={},h=typeof Uint8Array>"u"||!b?e:b(Uint8Array),v={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":m&&b?b([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%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%":g,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&b?b(b([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!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"||!m||!b?e:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&b?b(""[Symbol.iterator]()):e,"%Symbol%":m?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":h,"%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));v["%Error.prototype%"]=d}var y=function W(B){var F;if(B==="%AsyncFunction%")F=f("async function () {}");else if(B==="%GeneratorFunction%")F=f("function* () {}");else if(B==="%AsyncGeneratorFunction%")F=f("async function* () {}");else if(B==="%AsyncGenerator%"){var T=W("%AsyncGeneratorFunction%");T&&(F=T.prototype)}else if(B==="%AsyncIteratorPrototype%"){var L=W("%AsyncGenerator%");L&&b&&(F=b(L.prototype))}return v[B]=F,F},_={__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"]},R=g2(),C=jD(),x=R.call(Function.call,Array.prototype.concat),O=R.call(Function.apply,Array.prototype.splice),P=R.call(Function.call,String.prototype.replace),k=R.call(Function.call,String.prototype.slice),M=R.call(Function.call,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,G=function(B){var F=k(B,0,1),T=k(B,-1);if(F==="%"&&T!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(T==="%"&&F!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var L=[];return P(B,I,function(z,D,$,K){L[L.length]=$?P(K,H,"$1"):D||z}),L},Z=function(B,F){var T=B,L;if(C(_,T)&&(L=_[T],T="%"+L[0]+"%"),C(v,T)){var z=v[T];if(z===g&&(z=y(T)),typeof z>"u"&&!F)throw new o("intrinsic "+B+" exists, but is not available. Please file an issue!");return{alias:L,name:T,value:z}}throw new a("intrinsic "+B+" does not exist!")};return yg=function(B,F){if(typeof B!="string"||B.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof F!="boolean")throw new o('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,B)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var T=G(B),L=T.length>0?T[0]:"",z=Z("%"+L+"%",F),D=z.name,$=z.value,K=!1,V=z.alias;V&&(L=V[0],O(T,x([0,1],V)));for(var U=1,Y=!0;U<T.length;U+=1){var X=T[U],Q=k(X,0,1),te=k(X,-1);if((Q==='"'||Q==="'"||Q==="`"||te==='"'||te==="'"||te==="`")&&Q!==te)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(K=!0),L+="."+X,D="%"+L+"%",C(v,D))$=v[D];else if($!=null){if(!(X in $)){if(!F)throw new o("base intrinsic for "+B+" exists, but the property is not available.");return}if(p&&U+1>=T.length){var ee=p($,X);Y=!!ee,Y&&"get"in ee&&!("originalValue"in ee.get)?$=ee.get:$=$[X]}else Y=C($,X),$=$[X];Y&&!K&&(v[D]=$)}}return $},yg}var bg={exports:{}},_g,Y4;function v2(){if(Y4)return _g;Y4=1;var e=Js(),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=Js(),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=Xc(),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,p=arguments.length>5?arguments[5]:null,E=arguments.length>6?arguments[6]:!1,w=!!n&&n(a,o);if(e)e(a,o,{configurable:p===null&&w?w.configurable:!p,enumerable:u===null&&w?w.enumerable:!u,value:l,writable:f===null&&w?w.writable:!f});else if(E||!u&&!f&&!p)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=Js(),t=FD(),r=zD()(),n=lS(),i=Xc(),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],p=!0,E=!0;if("length"in l&&n){var w=n(l,"length");w&&!w.configurable&&(p=!1),w&&!w.writable&&(E=!1)}return(p||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=Js(),n=BD(),i=Xc(),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 m=l(t,o,arguments);return n(m,1+f(0,w.length-(arguments.length-1)),!0)};var p=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:p}):e.exports.apply=p}(bg)),bg.exports}var xg,t_;function HD(){if(t_)return xg;t_=1;var e=Js(),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=po(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,p=typeof WeakSet=="function"&&WeakSet.prototype,E=p?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,m=w?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,b=Object.prototype.toString,g=Function.prototype.toString,h=String.prototype.match,v=String.prototype.slice,d=String.prototype.replace,y=String.prototype.toUpperCase,_=String.prototype.toLowerCase,R=RegExp.prototype.test,C=Array.prototype.concat,x=Array.prototype.join,O=Array.prototype.slice,P=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,Z=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ue){return ue.__proto__}:null);function B(ue,ce){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||R.call(/e/,ce))return ce;var Xe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var be=ue<0?-P(-ue):P(ue);if(be!==ue){var Le=String(be),Ae=v.call(ce,Le.length+1);return d.call(Le,Xe,"$&_")+"."+d.call(d.call(Ae,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ce,Xe,"$&_")}var F=VD,T=F.custom,L=te(T)?T:null;Pg=function ue(ce,Xe,be,Le){var Ae=Xe||{};if(ie(Ae,"quoteStyle")&&Ae.quoteStyle!=="single"&&Ae.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ie(Ae,"maxStringLength")&&(typeof Ae.maxStringLength=="number"?Ae.maxStringLength<0&&Ae.maxStringLength!==1/0:Ae.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var we=ie(Ae,"customInspect")?Ae.customInspect:!0;if(typeof we!="boolean"&&we!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ie(Ae,"indent")&&Ae.indent!==null&&Ae.indent!==" "&&!(parseInt(Ae.indent,10)===Ae.indent&&Ae.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ie(Ae,"numericSeparator")&&typeof Ae.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Je=Ae.numericSeparator;if(typeof ce>"u")return"undefined";if(ce===null)return"null";if(typeof ce=="boolean")return ce?"true":"false";if(typeof ce=="string")return ye(ce,Ae);if(typeof ce=="number"){if(ce===0)return 1/0/ce>0?"0":"-0";var Ee=String(ce);return Je?B(ce,Ee):Ee}if(typeof ce=="bigint"){var We=String(ce)+"n";return Je?B(ce,We):We}var lr=typeof Ae.depth>"u"?5:Ae.depth;if(typeof be>"u"&&(be=0),be>=lr&&lr>0&&typeof ce=="object")return $(ce)?"[Array]":"[Object]";var xe=Pe(Ae,be);if(typeof Le>"u")Le=[];else if(Ie(Le,ce)>=0)return"[Circular]";function ze(Ut,en,Mn){if(en&&(Le=O.call(Le),Le.push(en)),Mn){var Ln={depth:Ae.depth};return ie(Ae,"quoteStyle")&&(Ln.quoteStyle=Ae.quoteStyle),ue(Ut,Ln,be+1,Le)}return ue(Ut,Ae,be+1,Le)}if(typeof ce=="function"&&!V(ce)){var tt=ke(ce),yt=lt(ce,ze);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(yt.length>0?" { "+x.call(yt,", ")+" }":"")}if(te(ce)){var xt=H?d.call(String(ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(ce);return typeof ce=="object"&&!H?$e(xt):xt}if(de(ce)){for(var xr="<"+_.call(String(ce.nodeName)),Zr=ce.attributes||[],mr=0;mr<Zr.length;mr++)xr+=" "+Zr[mr].name+"="+z(D(Zr[mr].value),"double",Ae);return xr+=">",ce.childNodes&&ce.childNodes.length&&(xr+="..."),xr+="</"+_.call(String(ce.nodeName))+">",xr}if($(ce)){if(ce.length===0)return"[]";var Qr=lt(ce,ze);return xe&&!Oe(Qr)?"["+He(Qr,xe)+"]":"[ "+x.call(Qr,", ")+" ]"}if(U(ce)){var Qn=lt(ce,ze);return!("cause"in Error.prototype)&&"cause"in ce&&!Z.call(ce,"cause")?"{ ["+String(ce)+"] "+x.call(C.call("[cause]: "+ze(ce.cause),Qn),", ")+" }":Qn.length===0?"["+String(ce)+"]":"{ ["+String(ce)+"] "+x.call(Qn,", ")+" }"}if(typeof ce=="object"&&we){if(L&&typeof ce[L]=="function"&&F)return F(ce,{depth:lr-be});if(we!=="symbol"&&typeof ce.inspect=="function")return ce.inspect()}if(le(ce)){var Rn=[];return n&&n.call(ce,function(Ut,en){Rn.push(ze(en,ce,!0)+" => "+ze(Ut,ce))}),Re("Map",r.call(ce),Rn,xe)}if(ge(ce)){var Ne=[];return l&&l.call(ce,function(Ut){Ne.push(ze(Ut,ce))}),Re("Set",o.call(ce),Ne,xe)}if(fe(ce))return Qe("WeakMap");if(re(ce))return Qe("WeakSet");if(_e(ce))return Qe("WeakRef");if(X(ce))return $e(ze(Number(ce)));if(ee(ce))return $e(ze(k.call(ce)));if(Q(ce))return $e(S.call(ce));if(Y(ce))return $e(ze(String(ce)));if(typeof window<"u"&&ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ce===globalThis||typeof me<"u"&&ce===me)return"{ [object globalThis] }";if(!K(ce)&&!V(ce)){var et=lt(ce,ze),ct=W?W(ce)===Object.prototype:ce instanceof Object||ce.constructor===Object,Mt=ce instanceof Object?"":"null prototype",Et=!ct&&G&&Object(ce)===ce&&G in ce?v.call(oe(ce),8,-1):Mt?"Object":"",Jr=ct||typeof ce.constructor!="function"?"":ce.constructor.name?ce.constructor.name+" ":"",$r=Jr+(Et||Mt?"["+x.call(C.call([],Et||[],Mt||[]),": ")+"] ":"");return et.length===0?$r+"{}":xe?$r+"{"+He(et,xe)+"}":$r+"{ "+x.call(et,", ")+" }"}return String(ce)};function z(ue,ce,Xe){var be=(Xe.quoteStyle||ce)==="double"?'"':"'";return be+ue+be}function D(ue){return d.call(String(ue),/"/g,"&quot;")}function $(ue){return oe(ue)==="[object Array]"&&(!G||!(typeof ue=="object"&&G in ue))}function K(ue){return oe(ue)==="[object Date]"&&(!G||!(typeof ue=="object"&&G in ue))}function V(ue){return oe(ue)==="[object RegExp]"&&(!G||!(typeof ue=="object"&&G in ue))}function U(ue){return oe(ue)==="[object Error]"&&(!G||!(typeof ue=="object"&&G in ue))}function Y(ue){return oe(ue)==="[object String]"&&(!G||!(typeof ue=="object"&&G in ue))}function X(ue){return oe(ue)==="[object Number]"&&(!G||!(typeof ue=="object"&&G in ue))}function Q(ue){return oe(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,ce){return ne.call(ue,ce)}function oe(ue){return b.call(ue)}function ke(ue){if(ue.name)return ue.name;var ce=h.call(g.call(ue),/^function\s*([\w$]+)/);return ce?ce[1]:null}function Ie(ue,ce){if(ue.indexOf)return ue.indexOf(ce);for(var Xe=0,be=ue.length;Xe<be;Xe++)if(ue[Xe]===ce)return Xe;return-1}function le(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 fe(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 _e(ue){if(!m||!ue||typeof ue!="object")return!1;try{return m.call(ue),!0}catch{}return!1}function ge(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 de(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function ye(ue,ce){if(ue.length>ce.maxStringLength){var Xe=ue.length-ce.maxStringLength,be="... "+Xe+" more character"+(Xe>1?"s":"");return ye(v.call(ue,0,ce.maxStringLength),ce)+be}var Le=d.call(d.call(ue,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Se);return z(Le,"single",ce)}function Se(ue){var ce=ue.charCodeAt(0),Xe={8:"b",9:"t",10:"n",12:"f",13:"r"}[ce];return Xe?"\\"+Xe:"\\x"+(ce<16?"0":"")+y.call(ce.toString(16))}function $e(ue){return"Object("+ue+")"}function Qe(ue){return ue+" { ? }"}function Re(ue,ce,Xe,be){var Le=be?He(Xe,be):x.call(Xe,", ");return ue+" ("+ce+") {"+Le+"}"}function Oe(ue){for(var ce=0;ce<ue.length;ce++)if(Ie(ue[ce],`
149
+ `)>=0)return!1;return!0}function Pe(ue,ce){var Xe;if(ue.indent===" ")Xe=" ";else if(typeof ue.indent=="number"&&ue.indent>0)Xe=x.call(Array(ue.indent+1)," ");else return null;return{base:Xe,prev:x.call(Array(ce+1),Xe)}}function He(ue,ce){if(ue.length===0)return"";var Xe=`
150
+ `+ce.prev+ce.base;return Xe+x.call(ue,","+Xe)+`
151
+ `+ce.prev}function lt(ue,ce){var Xe=$(ue),be=[];if(Xe){be.length=ue.length;for(var Le=0;Le<ue.length;Le++)be[Le]=ie(ue,Le)?ce(ue[Le],ue):""}var Ae=typeof M=="function"?M(ue):[],we;if(H){we={};for(var Je=0;Je<Ae.length;Je++)we["$"+Ae[Je]]=Ae[Je]}for(var Ee in ue)ie(ue,Ee)&&(Xe&&String(Number(Ee))===Ee&&Ee<ue.length||H&&we["$"+Ee]instanceof Symbol||(R.call(/[^\w$]/,Ee)?be.push(ce(Ee,ue)+": "+ce(ue[Ee],ue)):be.push(Ee+": "+ce(ue[Ee],ue))));if(typeof M=="function")for(var We=0;We<Ae.length;We++)Z.call(ue,Ae[We])&&be.push("["+ce(Ae[We])+"]: "+ce(ue[Ae[We]],ue));return be}return Pg}var Cg,n_;function WD(){if(n_)return Cg;n_=1;var e=Js(),t=HD(),r=qD(),n=Xc(),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),p=t("Map.prototype.set",!0),E=t("Map.prototype.has",!0),w=function(g,h){for(var v=g,d;(d=v.next)!==null;v=d)if(d.key===h)return v.next=d.next,d.next=g.next,g.next=d,d},m=function(g,h){var v=w(g,h);return v&&v.value},S=function(g,h,v){var d=w(g,h);d?d.value=v:g.next={key:h,next:g.next,value:v}},b=function(g,h){return!!w(g,h)};return Cg=function(){var h,v,d,y={assert:function(_){if(!y.has(_))throw new n("Side channel does not contain "+r(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(h)return o(h,_)}else if(a){if(v)return f(v,_)}else if(d)return m(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(h)return u(h,_)}else if(a){if(v)return E(v,_)}else if(d)return b(d,_);return!1},set:function(_,R){i&&_&&(typeof _=="object"||typeof _=="function")?(h||(h=new i),l(h,_,R)):a?(v||(v=new a),p(v,_,R)):(d||(d={key:{},next:null}),S(d,_,R))}};return y},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 g=[],h=0;h<256;++h)g.push("%"+((h<16?"0":"")+h.toString(16)).toUpperCase());return g}(),i=function(h){for(;h.length>1;){var v=h.pop(),d=v.obj[v.prop];if(r(d)){for(var y=[],_=0;_<d.length;++_)typeof d[_]<"u"&&y.push(d[_]);v.obj[v.prop]=y}}},a=function(h,v){for(var d=v&&v.plainObjects?Object.create(null):{},y=0;y<h.length;++y)typeof h[y]<"u"&&(d[y]=h[y]);return d},o=function g(h,v,d){if(!v)return h;if(typeof v!="object"){if(r(h))h.push(v);else if(h&&typeof h=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,v))&&(h[v]=!0);else return[h,v];return h}if(!h||typeof h!="object")return[h].concat(v);var y=h;return r(h)&&!r(v)&&(y=a(h,d)),r(h)&&r(v)?(v.forEach(function(_,R){if(t.call(h,R)){var C=h[R];C&&typeof C=="object"&&_&&typeof _=="object"?h[R]=g(C,_,d):h.push(_)}else h[R]=_}),h):Object.keys(v).reduce(function(_,R){var C=v[R];return t.call(_,R)?_[R]=g(_[R],C,d):_[R]=C,_},y)},l=function(h,v){return Object.keys(v).reduce(function(d,y){return d[y]=v[y],d},h)},u=function(g,h,v){var d=g.replace(/\+/g," ");if(v==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,p=function(h,v,d,y,_){if(h.length===0)return h;var R=h;if(typeof h=="symbol"?R=Symbol.prototype.toString.call(h):typeof h!="string"&&(R=String(h)),d==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(I){return"%26%23"+parseInt(I.slice(2),16)+"%3B"});for(var C="",x=0;x<R.length;x+=f){for(var O=R.length>=f?R.slice(x,x+f):R,P=[],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)){P[P.length]=O.charAt(k);continue}if(M<128){P[P.length]=n[M];continue}if(M<2048){P[P.length]=n[192|M>>6]+n[128|M&63];continue}if(M<55296||M>=57344){P[P.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),P[P.length]=n[240|M>>18]+n[128|M>>12&63]+n[128|M>>6&63]+n[128|M&63]}C+=P.join("")}return C},E=function(h){for(var v=[{obj:{o:h},prop:"o"}],d=[],y=0;y<v.length;++y)for(var _=v[y],R=_.obj[_.prop],C=Object.keys(R),x=0;x<C.length;++x){var O=C[x],P=R[O];typeof P=="object"&&P!==null&&d.indexOf(P)===-1&&(v.push({obj:R,prop:O}),d.push(P))}return i(v),h},w=function(h){return Object.prototype.toString.call(h)==="[object RegExp]"},m=function(h){return!h||typeof h!="object"?!1:!!(h.constructor&&h.constructor.isBuffer&&h.constructor.isBuffer(h))},S=function(h,v){return[].concat(h,v)},b=function(h,v){if(r(h)){for(var d=[],y=0;y<h.length;y+=1)d.push(v(h[y]));return d}return v(h)};return Tg={arrayToObject:a,assign:l,combine:S,compact:E,decode:u,encode:p,isBuffer:m,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(g){return g+"[]"},comma:"comma",indices:function(g,h){return g+"["+h+"]"},repeat:function(g){return g}},a=Array.isArray,o=Array.prototype.push,l=function(b,g){o.apply(b,a(g)?g:[g])},u=Date.prototype.toISOString,f=r.default,p={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(g){return u.call(g)},skipNulls:!1,strictNullHandling:!1},E=function(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"},w={},m=function b(g,h,v,d,y,_,R,C,x,O,P,k,M,I,H,G,Z,W){for(var B=g,F=W,T=0,L=!1;(F=F.get(w))!==void 0&&!L;){var z=F.get(g);if(T+=1,typeof z<"u"){if(z===T)throw new RangeError("Cyclic object value");L=!0}typeof F.get(w)>"u"&&(T=0)}if(typeof O=="function"?B=O(h,B):B instanceof Date?B=M(B):v==="comma"&&a(B)&&(B=t.maybeMap(B,function(oe){return oe instanceof Date?M(oe):oe})),B===null){if(_)return x&&!G?x(h,p.encoder,Z,"key",I):h;B=""}if(E(B)||t.isBuffer(B)){if(x){var D=G?h:x(h,p.encoder,Z,"key",I);return[H(D)+"="+H(x(B,p.encoder,Z,"value",I))]}return[H(h)+"="+H(String(B))]}var $=[];if(typeof B>"u")return $;var K;if(v==="comma"&&a(B))G&&x&&(B=t.maybeMap(B,x)),K=[{value:B.length>0?B.join(",")||null:void 0}];else if(a(O))K=O;else{var V=Object.keys(B);K=P?V.sort(P):V}var U=C?h.replace(/\./g,"%2E"):h,Y=d&&a(B)&&B.length===1?U+"[]":U;if(y&&a(B)&&B.length===0)return Y+"[]";for(var X=0;X<K.length;++X){var Q=K[X],te=typeof Q=="object"&&typeof Q.value<"u"?Q.value:B[Q];if(!(R&&te===null)){var ee=k&&C?Q.replace(/\./g,"%2E"):Q,ne=a(B)?typeof v=="function"?v(Y,ee):Y:Y+(k?"."+ee:"["+ee+"]");W.set(g,T);var ie=e();ie.set(w,W),l($,b(te,ne,v,d,y,_,R,C,v==="comma"&&G&&a(B)?null:x,O,P,k,M,I,H,G,Z,ie))}}return $},S=function(g){if(!g)return p;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.encodeDotInKeys<"u"&&typeof g.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");var h=g.charset||p.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=r.default;if(typeof g.format<"u"){if(!n.call(r.formatters,g.format))throw new TypeError("Unknown format option provided.");v=g.format}var d=r.formatters[v],y=p.filter;(typeof g.filter=="function"||a(g.filter))&&(y=g.filter);var _;if(g.arrayFormat in i?_=g.arrayFormat:"indices"in g?_=g.indices?"indices":"repeat":_=p.arrayFormat,"commaRoundTrip"in g&&typeof g.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof g.allowDots>"u"?g.encodeDotInKeys===!0?!0:p.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:p.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:_,charset:h,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:p.charsetSentinel,commaRoundTrip:g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?p.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:p.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:p.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:p.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:p.encodeValuesOnly,filter:y,format:v,formatter:d,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:p.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:p.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:p.strictNullHandling}};return Ag=function(b,g){var h=b,v=S(g),d,y;typeof v.filter=="function"?(y=v.filter,h=y("",h)):a(v.filter)&&(y=v.filter,d=y);var _=[];if(typeof h!="object"||h===null)return"";var R=i[v.arrayFormat],C=R==="comma"&&v.commaRoundTrip;d||(d=Object.keys(h)),v.sort&&d.sort(v.sort);for(var x=e(),O=0;O<d.length;++O){var P=d[O];v.skipNulls&&h[P]===null||l(_,m(h[P],P,R,C,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,x))}var k=_.join(v.delimiter),M=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.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(m,S){return String.fromCharCode(parseInt(S,10))})},a=function(w,m){return w&&typeof w=="string"&&m.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(m,S){var b={__proto__:null},g=S.ignoreQueryPrefix?m.replace(/^\?/,""):m;g=g.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var h=S.parameterLimit===1/0?void 0:S.parameterLimit,v=g.split(S.delimiter,h),d=-1,y,_=S.charset;if(S.charsetSentinel)for(y=0;y<v.length;++y)v[y].indexOf("utf8=")===0&&(v[y]===l?_="utf-8":v[y]===o&&(_="iso-8859-1"),d=y,y=v.length);for(y=0;y<v.length;++y)if(y!==d){var R=v[y],C=R.indexOf("]="),x=C===-1?R.indexOf("="):C+1,O,P;x===-1?(O=S.decoder(R,n.decoder,_,"key"),P=S.strictNullHandling?null:""):(O=S.decoder(R.slice(0,x),n.decoder,_,"key"),P=e.maybeMap(a(R.slice(x+1),S),function(M){return S.decoder(M,n.decoder,_,"value")})),P&&S.interpretNumericEntities&&_==="iso-8859-1"&&(P=i(P)),R.indexOf("[]=")>-1&&(P=r(P)?[P]:P);var k=t.call(b,O);k&&S.duplicates==="combine"?b[O]=e.combine(b[O],P):(!k||S.duplicates==="last")&&(b[O]=P)}return b},f=function(w,m,S,b){for(var g=b?m:a(m,S),h=w.length-1;h>=0;--h){var v,d=w[h];if(d==="[]"&&S.parseArrays)v=S.allowEmptyArrays&&g===""?[]:[].concat(g);else{v=S.plainObjects?Object.create(null):{};var y=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=S.decodeDotInKeys?y.replace(/%2E/g,"."):y,R=parseInt(_,10);!S.parseArrays&&_===""?v={0:g}:!isNaN(R)&&d!==_&&String(R)===_&&R>=0&&S.parseArrays&&R<=S.arrayLimit?(v=[],v[R]=g):_!=="__proto__"&&(v[_]=g)}g=v}return g},p=function(m,S,b,g){if(m){var h=b.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,v=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,y=b.depth>0&&v.exec(h),_=y?h.slice(0,y.index):h,R=[];if(_){if(!b.plainObjects&&t.call(Object.prototype,_)&&!b.allowPrototypes)return;R.push(_)}for(var C=0;b.depth>0&&(y=d.exec(h))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&t.call(Object.prototype,y[1].slice(1,-1))&&!b.allowPrototypes)return;R.push(y[1])}return y&&R.push("["+h.slice(y.index)+"]"),f(R,S,b,g)}},E=function(m){if(!m)return n;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.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");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 S=typeof m.charset>"u"?n.charset:m.charset,b=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var g=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:g,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:S,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||e.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:b,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return Rg=function(w,m){var S=E(m);if(w===""||w===null||typeof w>"u")return S.plainObjects?Object.create(null):{};for(var b=typeof w=="string"?u(w,S):w,g=S.plainObjects?Object.create(null):{},h=Object.keys(b),v=0;v<h.length;++v){var d=h[v],y=p(d,b[d],S,typeof w=="string");g=e.merge(g,y,S)}return S.allowSparse===!0?g:e.compact(g)},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 Ho;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=["/","?","#"],p=255,E=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={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},g=XD();function h(_,R,C){if(_&&typeof _=="object"&&_ instanceof t)return _;var x=new t;return x.parse(_,R,C),x}t.prototype.parse=function(_,R,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var x=_.indexOf("?"),O=x!==-1&&x<_.indexOf("#")?"?":"#",P=_.split(O),k=/\\/g;P[0]=P[0].replace(k,"/"),_=P.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],R?this.query=g.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(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 Z=M.substr(0,2)==="//";Z&&!(H&&S[H])&&(M=M.substr(2),this.slashes=!0)}if(!S[H]&&(Z||H&&!b[H])){for(var W=-1,B=0;B<f.length;B++){var F=M.indexOf(f[B]);F!==-1&&(W===-1||F<W)&&(W=F)}var T,L;W===-1?L=M.lastIndexOf("@"):L=M.lastIndexOf("@",W),L!==-1&&(T=M.slice(0,L),M=M.slice(L+1),this.auth=decodeURIComponent(T)),W=-1;for(var B=0;B<u.length;B++){var F=M.indexOf(u[B]);F!==-1&&(W===-1||F<W)&&(W=F)}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 D=this.hostname.split(/\./),B=0,$=D.length;B<$;B++){var K=D[B];if(K&&!K.match(E)){for(var V="",U=0,Y=K.length;U<Y;U++)K.charCodeAt(U)>127?V+="x":V+=K[U];if(!V.match(E)){var X=D.slice(0,B),Q=D.slice(B+1),te=K.match(w);te&&(X.push(te[1]),Q.unshift(te[2])),Q.length&&(M="/"+Q.join(".")+M),this.hostname=X.join(".");break}}}this.hostname.length>p?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(!m[G])for(var B=0,$=l.length;B<$;B++){var ie=l[B];if(M.indexOf(ie)!==-1){var oe=encodeURIComponent(ie);oe===ie&&(oe=escape(ie)),M=M.split(ie).join(oe)}}var ke=M.indexOf("#");ke!==-1&&(this.hash=M.substr(ke),M=M.slice(0,ke));var Ie=M.indexOf("?");if(Ie!==-1?(this.search=M.substr(Ie),this.query=M.substr(Ie+1),R&&(this.query=g.parse(this.query)),M=M.slice(0,Ie)):R&&(this.search="",this.query={}),M&&(this.pathname=M),b[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",le=this.search||"";this.path=ee+le}return this.href=this.format(),this};function v(_){return typeof _=="string"&&(_=h(_)),_ instanceof t?_.format():t.prototype.format.call(_)}t.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var R=this.protocol||"",C=this.pathname||"",x=this.hash||"",O=!1,P="";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&&(P=g.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||P&&"?"+P||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||b[R])&&O!==!1?(O="//"+(O||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):O||(O=""),x&&x.charAt(0)!=="#"&&(x="#"+x),k&&k.charAt(0)!=="?"&&(k="?"+k),C=C.replace(/[?#]/g,function(M){return encodeURIComponent(M)}),k=k.replace("#","%23"),R+O+C+k+x};function d(_,R){return h(_,!1,!0).resolve(R)}t.prototype.resolve=function(_){return this.resolveObject(h(_,!1,!0)).format()};function y(_,R){return _?h(_,!1,!0).resolveObject(R):R}return t.prototype.resolveObject=function(_){if(typeof _=="string"){var R=new t;R.parse(_,!1,!0),_=R}for(var C=new t,x=Object.keys(this),O=0;O<x.length;O++){var P=x[O];C[P]=this[P]}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 Z=H[G];C[Z]=_[Z]}return C.href=C.format(),C}if(C.protocol=_.protocol,!_.host&&!S[_.protocol]){for(var $=(_.pathname||"").split("/");$.length&&!(_.host=$.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),$[0]!==""&&$.unshift(""),$.length<2&&$.unshift(""),C.pathname=$.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||"",B=C.search||"";C.path=W+B}return C.slashes=C.slashes||_.slashes,C.href=C.format(),C}var F=C.pathname&&C.pathname.charAt(0)==="/",T=_.host||_.pathname&&_.pathname.charAt(0)==="/",L=T||F||C.host&&_.pathname,z=L,D=C.pathname&&C.pathname.split("/")||[],$=_.pathname&&_.pathname.split("/")||[],K=C.protocol&&!b[C.protocol];if(K&&(C.hostname="",C.port=null,C.host&&(D[0]===""?D[0]=C.host:D.unshift(C.host)),C.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&($[0]===""?$[0]=_.host:$.unshift(_.host)),_.host=null),L=L&&($[0]===""||D[0]==="")),T)C.host=_.host||_.host===""?_.host:C.host,C.hostname=_.hostname||_.hostname===""?_.hostname:C.hostname,C.search=_.search,C.query=_.query,D=$;else if($.length)D||(D=[]),D.pop(),D=D.concat($),C.search=_.search,C.query=_.query;else if(_.search!=null){if(K){C.host=D.shift(),C.hostname=C.host;var V=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;V&&(C.auth=V.shift(),C.hostname=V.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(!D.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var U=D.slice(-1)[0],Y=(C.host||_.host||D.length>1)&&(U==="."||U==="..")||U==="",X=0,Q=D.length;Q>=0;Q--)U=D[Q],U==="."?D.splice(Q,1):U===".."?(D.splice(Q,1),X++):X&&(D.splice(Q,1),X--);if(!L&&!z)for(;X--;X)D.unshift("..");L&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),Y&&D.join("/").substr(-1)!=="/"&&D.push("");var te=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(K){C.hostname=te?"":D.length?D.shift():"",C.host=C.hostname;var V=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;V&&(C.auth=V.shift(),C.hostname=V.shift(),C.host=C.hostname)}return L=L||C.host&&D.length,L&&!te&&D.unshift(""),D.length>0?C.pathname=D.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,R=n.exec(_);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),_=_.substr(0,_.length-R.length)),_&&(this.hostname=_)},Ho.parse=h,Ho.resolve=d,Ho.resolveObject=y,Ho.format=v,Ho.Url=t,Ho}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(m){return m.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(m){var S=m.value;return" "+m.name+'="'+r(S)+'"'},a=function(m){var S=m.tagName;return m.namespaceURI==="http://www.w3.org/1999/xhtml"&&(S=S.toLowerCase()),S},o=function(m,S){var b=Array.prototype.map.call(m.attributes||m.attrs,function(g){return g.name}).indexOf("xmlns")>=0;return!b&&(S||m.namespaceURI!==m.parentNode.namespaceURI)?' xmlns="'+m.namespaceURI+'"':""},l=function(m){return Array.prototype.map.call(m.childNodes,function(S){return w(S)}).join("")},u=function(m,S){var b="<"+a(m);return b+=o(m,S),Array.prototype.forEach.call(m.attributes||m.attrs,function(g){b+=i(g)}),m.childNodes.length>0?(b+=">",b+=l(m),b+="</"+a(m)+">"):b+="/>",b},f=function(m){var S=m.nodeValue||m.value||"";return n(S)},p=function(m){return"<!--"+m.data.replace(/-/g,"&#45;")+"-->"},E=function(m){return"<![CDATA["+m.nodeValue+"]]>"},w=function(m,S){var b=S&&S.rootNode;if(m.nodeName==="#document"||m.nodeName==="#document-fragment")return l(m);if(m.tagName)return u(m,b);if(m.nodeName==="#text")return f(m);if(m.nodeName==="#comment")return p(m);if(m.nodeName==="#cdata-section")return E(m)};return{serializeToString:function(m){return t(w(m,{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 Xp(){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(p){u.push(p)})})).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,p){var E=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),m,S=function(){p({msg:"Unable to load url",url:w})};m=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",m,!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(p){for(var E="",w=0;w<p.length;w++)E+=String.fromCharCode(p.charCodeAt(w)&255);return E})};var i=function(l){var u=function(f,p){return f.substring(0,p.length)===p};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 p=btoa(f),E=i(f);return"data:"+E+";base64,"+p})};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 p=Array.prototype.slice.call(arguments),E=u(p),w=o(l),m;return f[w]&&f[w][E]?f[w][E]:(m=l.apply(null,p),f[w]=f[w]||{},f[w][E]=m,m)}}}(Dg)),Dg}var jg={},h_;function JD(){if(h_)return jg;h_=1;var e=Xp(),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(p){return p},function(p){throw{resourceType:"image",url:p.url,msg:"Unable to load image "+p.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 p=r(l);return e.collectAndReportErrors(p.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=Xp(),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(p){throw{resourceType:"script",url:p.url,msg:"Unable to load script "+p.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*$",p=new RegExp(u,"g"),E,w=[],m=function(S){var b=new RegExp(l,"g"),g=[],h;for(h=b.exec(S);h;)g.push(h[1]),h=b.exec(S);return g};if(a.match(new RegExp(f))){for(E=p.exec(a);E;)w.push(m(E[0])),E=p.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 bd(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,p){if(!i[f]){if(!n[f]){var E=typeof bd=="function"&&bd;if(!p&&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 m=i[f]={exports:{}};n[f][0].call(m.exports,function(S){var b=n[f][1][S];return o(b||S)},m,m.exports,r,n,i,a)}return i[f].exports}for(var l=typeof bd=="function"&&bd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function p(){this.constructor=u}p.prototype=f.prototype,u.prototype=new p}function o(u,f,p,E){this.message=u,this.expected=f,this.found=p,this.location=E,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var p={literal:function(h){return'"'+w(h.text)+'"'},class:function(h){var v="",d;for(d=0;d<h.parts.length;d++)v+=h.parts[d]instanceof Array?m(h.parts[d][0])+"-"+m(h.parts[d][1]):m(h.parts[d]);return"["+(h.inverted?"^":"")+v+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function E(h){return h.charCodeAt(0).toString(16).toUpperCase()}function w(h){return h.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(v){return"\\x0"+E(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+E(v)})}function m(h){return h.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(v){return"\\x0"+E(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+E(v)})}function S(h){return p[h.type](h)}function b(h){var v=new Array(h.length),d,y;for(d=0;d<h.length;d++)v[d]=S(h[d]);if(v.sort(),v.length>0){for(d=1,y=1;d<v.length;d++)v[d-1]!==v[d]&&(v[y]=v[d],y++);v.length=y}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function g(h){return h?'"'+w(h)+'"':"end of input"}return"Expected "+b(u)+" but "+g(f)+" found."};function l(u,f){f=f!==void 0?f:{};var p={},E={start:ee},w=ee,m="",S=function(){return[]},b=",",g=K(",",!1),h=function(re,de){return[re].concat(de)},v=function(re){return[re]},d=function(re,de){return{url:re,format:de}},y=function(re){return{url:re}},_="url(",R=K("url(",!1),C=")",x=K(")",!1),O=function(re){return re},P="format(",k=K("format(",!1),M="local(",I=K("local(",!1),H=function(re){return{local:re}},G=/^[^)]/,Z=V([")"],!0,!1),W=function(re){return ge.extractValue(re.join(""))},B=/^[ \t\r\n\f]/,F=V([" "," ","\r",`
155
+ `,"\f"],!1,!1),T=0,L=[{line:1,column:1}],z=0,D=[],$;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 K(re,de){return{type:"literal",text:re,ignoreCase:de}}function V(re,de,ye){return{type:"class",parts:re,inverted:de,ignoreCase:ye}}function U(){return{type:"end"}}function Y(re){var de=L[re],ye;if(de)return de;for(ye=re-1;!L[ye];)ye--;for(de=L[ye],de={line:de.line,column:de.column};ye<re;)u.charCodeAt(ye)===10?(de.line++,de.column=1):de.column++,ye++;return L[re]=de,de}function X(re,de){var ye=Y(re),Se=Y(de);return{start:{offset:re,line:ye.line,column:ye.column},end:{offset:de,line:Se.line,column:Se.column}}}function Q(re){T<z||(T>z&&(z=T,D=[]),D.push(re))}function te(re,de,ye){return new o(o.buildMessage(re,de),re,de,ye)}function ee(){var re,de;return re=ne(),re===p&&(re=T,de=m,de!==p&&(de=S()),re=de),re}function ne(){var re,de,ye,Se,$e,Qe;if(re=T,de=ie(),de!==p){for(ye=[],Se=_e();Se!==p;)ye.push(Se),Se=_e();if(ye!==p)if(u.charCodeAt(T)===44?(Se=b,T++):(Se=p,Q(g)),Se!==p){for($e=[],Qe=_e();Qe!==p;)$e.push(Qe),Qe=_e();$e!==p?(Qe=ne(),Qe!==p?(de=h(de,Qe),re=de):(T=re,re=p)):(T=re,re=p)}else T=re,re=p;else T=re,re=p}else T=re,re=p;return re===p&&(re=T,de=ie(),de!==p&&(de=v(de)),re=de),re}function ie(){var re;return re=oe(),re===p&&(re=le()),re}function oe(){var re,de,ye,Se;if(re=T,de=ke(),de!==p){if(ye=[],Se=_e(),Se!==p)for(;Se!==p;)ye.push(Se),Se=_e();else ye=p;ye!==p?(Se=Ie(),Se!==p?(de=d(de,Se),re=de):(T=re,re=p)):(T=re,re=p)}else T=re,re=p;return re===p&&(re=T,de=ke(),de!==p&&(de=y(de)),re=de),re}function ke(){var re,de,ye,Se;return re=T,u.substr(T,4)===_?(de=_,T+=4):(de=p,Q(R)),de!==p?(ye=fe(),ye!==p?(u.charCodeAt(T)===41?(Se=C,T++):(Se=p,Q(x)),Se!==p?(de=O(ye),re=de):(T=re,re=p)):(T=re,re=p)):(T=re,re=p),re}function Ie(){var re,de,ye,Se;return re=T,u.substr(T,7)===P?(de=P,T+=7):(de=p,Q(k)),de!==p?(ye=fe(),ye!==p?(u.charCodeAt(T)===41?(Se=C,T++):(Se=p,Q(x)),Se!==p?(de=O(ye),re=de):(T=re,re=p)):(T=re,re=p)):(T=re,re=p),re}function le(){var re,de,ye,Se;return re=T,u.substr(T,6)===M?(de=M,T+=6):(de=p,Q(I)),de!==p?(ye=fe(),ye!==p?(u.charCodeAt(T)===41?(Se=C,T++):(Se=p,Q(x)),Se!==p?(de=H(ye),re=de):(T=re,re=p)):(T=re,re=p)):(T=re,re=p),re}function fe(){var re,de,ye;if(re=T,de=[],G.test(u.charAt(T))?(ye=u.charAt(T),T++):(ye=p,Q(Z)),ye!==p)for(;ye!==p;)de.push(ye),G.test(u.charAt(T))?(ye=u.charAt(T),T++):(ye=p,Q(Z));else de=p;return de!==p&&(de=W(de)),re=de,re}function _e(){var re;return B.test(u.charAt(T))?(re=u.charAt(T),T++):(re=p,Q(F)),re}var ge=r("../util");if($=w(),$!==p&&T===u.length)return $;throw $!==p&&T<u.length&&Q(U()),te(D,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=Xp(),r=y2(),n=tj(),i=rj(),a=function(v,d,y){v.style.setProperty(d,y,v.style.getPropertyPriority(d))},o=function(v){return v.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(v){var d=[];return v.forEach(function(y){y.style.getPropertyValue("background-image")?d.push({property:"background-image",value:y.style.getPropertyValue("background-image"),rule:y}):y.style.getPropertyValue("background")&&d.push({property:"background",value:y.style.getPropertyValue("background"),rule:y})}),d},u=function(v){return v.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(v){return v.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},p=function(v){var d=[];return v.forEach(function(y,_){y.url&&!t.isDataUri(y.url)&&d.push(_)}),d},E=function(v){var d=[];return v.forEach(function(y,_){y.url&&!t.isDataUri(y.url)&&d.push(_)}),d};e.adjustPathsOfCssResources=function(v,d){var y=o(d),_=l(y),R=!1;return _.forEach(function(C){var x=n.parse(C.value),O=p(x),P;O.length>0&&(O.forEach(function(k){var M=x[k].url,I=t.joinUrl(v,M);x[k].url=I}),P=n.serialize(x),a(C.rule,C.property,P),R=!0)}),u(d).forEach(function(C){var x=C.style.getPropertyValue("src"),O,P;try{O=i.parse(x)}catch{return}P=E(O),P.length>0&&(P.forEach(function(k){var M=O[k].url,I=t.joinUrl(v,M);O[k].url=I}),r.changeFontFaceRuleSrc(d,C,i.serialize(O)),R=!0)}),f(d).forEach(function(C){var x=C.href,O=t.joinUrl(v,x);r.exchangeRule(d,C,"@import url("+O+");"),R=!0}),R};var w=function(v,d,y){var _=v.indexOf(d);v.splice(_,1),y.forEach(function(R,C){v.splice(_+C,0,R)})},m=function(v,d,y,_){var R=d.href,C;return R=r.unquoteString(R),C=t.joinUrl(_.baseUrl,R),y.indexOf(C)>=0?(w(v,d,[]),Promise.resolve([])):(y.push(C),t.ajax(R,_).then(function(x){var O=r.rulesForCssText(x);return e.loadCSSImportsForRules(O,y,_).then(function(P){return e.adjustPathsOfCssResources(R,O),w(v,d,O),P.errors})},function(x){throw{resourceType:"stylesheet",url:x.url,msg:"Unable to load stylesheet "+x.url}}))};e.loadCSSImportsForRules=function(v,d,y){var _=f(v),R=[],C=!1;return Promise.all(_.map(function(x){return m(v,x,d,y).then(function(O){R=R.concat(O),C=!0},function(O){R.push(O)})})).then(function(){return{hasChanges:C,errors:R}})};var S=function(v,d){var y=n.parse(v),_=p(y),R=!1;return t.collectAndReportErrors(_.map(function(C){var x=y[C].url;return t.getDataURIForImageURL(x,d).then(function(O){y[C].url=O,R=!0},function(O){throw{resourceType:"backgroundImage",url:O.url,msg:"Unable to load background-image "+O.url}})})).then(function(C){return{backgroundValue:n.serialize(y),hasChanges:R,errors:C}})},b=function(v,d){var y=o(v),_=l(y),R=[],C=!1;return Promise.all(_.map(function(x){return S(x.value,d).then(function(O){O.hasChanges&&(a(x.rule,x.property,O.backgroundValue),C=!0),R=R.concat(O.errors)})})).then(function(){return{hasChanges:C,errors:R}})},g=function(v,d){var y=!1,_,R;try{_=i.parse(v)}catch{_=[]}return R=E(_),t.collectAndReportErrors(R.map(function(C){var x=_[C],O=x.format||"woff";return t.binaryAjax(x.url,d).then(function(P){var k=btoa(P);x.url="data:font/"+O+";base64,"+k,y=!0},function(P){throw{resourceType:"fontFace",url:P.url,msg:"Unable to load font-face "+P.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:y,errors:C}})},h=function(v,d){var y=u(v),_=[],R=!1;return Promise.all(y.map(function(C){var x=C.style.getPropertyValue("src");return g(x,d).then(function(O){O.hasChanges&&(r.changeFontFaceRuleSrc(v,C,O.srcDeclarationValue),R=!0),_=_.concat(O.errors)})})).then(function(){return{hasChanges:R,errors:_}})};e.loadAndInlineCSSResourcesForRules=function(v,d){var y=!1,_=[];return Promise.all([b,h].map(function(R){return R(v,d).then(function(C){y=y||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:y,errors:_}})}}(zg)),zg}var b_;function ij(){return b_||(b_=1,function(e){var t=Xp(),r=JD(),n=ej(),i=nj(),a=y2(),o=function(g){return t.joinUrl(g,".")},l=function(g){var h=g.map(function(v,d){return d===g.length-1&&(v={baseUrl:o(v.baseUrl)}),JSON.stringify(v)});return h},u=function(g,h){return h.cache!==!1&&h.cache!=="none"&&h.cacheBucket?t.memoize(g,l,h.cacheBucket):g},f=function(g,h,v){var d=a.rulesForCssText(g);return i.loadCSSImportsForRules(d,h,v).then(function(y){return i.loadAndInlineCSSResourcesForRules(d,v).then(function(_){var R=y.errors.concat(_.errors),C=y.hasChanges||_.hasChanges;return C&&(g=a.cssRulesToText(d)),{hasChanges:C,content:g,errors:R}})})},p=function(g,h,v){var d=g.textContent,y=u(f,h);return y(d,v,h).then(function(_){return _.hasChanges&&(g.childNodes[0].nodeValue=_.content),t.cloneArray(_.errors)})},E=function(g){var h=g.getElementsByTagName("style");return Array.prototype.filter.call(h,function(v){return!v.attributes.type||v.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(g,h){var v=E(g),d=[],y=[],_;return _=t.clone(h),_.baseUrl=_.baseUrl||t.getDocumentBaseUrl(g),Promise.all(v.map(function(R){return p(R,_,y).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(g,h){var v=g.parentNode,d;h=h.trim(),h&&(d=g.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(g.ownerDocument.createTextNode(h)),v.insertBefore(d,g)),v.removeChild(g)},m=function(g,h){return t.ajax(g,h).then(function(v){var d=a.rulesForCssText(v);return{content:v,cssRules:d}}).then(function(v){var d=i.adjustPathsOfCssResources(g,v.cssRules);return{content:v.content,cssRules:v.cssRules,hasChanges:d}}).then(function(v){return i.loadCSSImportsForRules(v.cssRules,[],h).then(function(d){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(v){return i.loadAndInlineCSSResourcesForRules(v.cssRules,h).then(function(d){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||d.hasChanges,errors:v.errors.concat(d.errors)}})}).then(function(v){var d=v.content;return v.hasChanges&&(d=a.cssRulesToText(v.cssRules)),{content:d,errors:v.errors}})},S=function(g,h){var v=g.attributes.href.value,d=t.getDocumentBaseUrl(g.ownerDocument),y=t.clone(h);!y.baseUrl&&d&&(y.baseUrl=d);var _=u(m,h);return _(v,y).then(function(R){return{content:R.content,errors:t.cloneArray(R.errors)}})},b=function(g){var h=g.getElementsByTagName("link");return Array.prototype.filter.call(h,function(v){return v.attributes.rel&&v.attributes.rel.value==="stylesheet"&&(!v.attributes.type||v.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(g,h){var v=b(g),d=[];return Promise.all(v.map(function(y){return S(y,h).then(function(_){w(y,_.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(g,h){var v=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return h.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(y){return y(g,h).then(function(_){v=v.concat(_)})})).then(function(){return v})}}(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={},g=[];b.joinUrl=function(d,y){return d?S.resolve(d,y):y},b.getConstantUniqueIdFor=function(d){return g.indexOf(d)<0&&g.push(d),g.indexOf(d)},b.clone=function(d){var y={},_;for(_ in d)d.hasOwnProperty(_)&&(y[_]=d[_]);return y};var h=function(d){return typeof d=="object"&&d!==null},v=function(d){return h(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return b.parseOptionalParameters=function(d){var y={canvas:null,options:{}};return d[0]==null||v(d[0])?(y.canvas=d[0]||null,y.options=b.clone(d[1])):y.options=b.clone(d[0]),y},b}(t),o=function(S){var b={},g=function(h,v,d){var y=h[v];return h[v]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,y])},y};return b.baseUrlRespectingXhr=function(h,v){var d=function(){var y=new h;return g(y,"open",function(_,R){var C=_.shift(),x=_.shift(),O=S.joinUrl(v,x);return R.apply(this,[C,O].concat(_))}),y};return d},b.finishNotifyingXhr=function(h){var v=0,d=0,y=!1,_,R=new Promise(function(x){_=function(){var O=v-d;O<=0&&y&&x({totalCount:v})}}),C=function(){var x=new h;return g(x,"send",function(O,P){return v+=1,P.apply(this,arguments)}),x.addEventListener("load",function(){d+=1,_()}),x};return C.waitForRequestsToFinish=function(){return y=!0,_(),R},C},b}(a),l=function(){var S={},b=function(C){return Array.prototype.slice.call(C)};S.addClassName=function(C,x){C.className+=" "+x},S.addClassNameRecursively=function(C,x){S.addClassName(C,x),C.parentNode!==C.ownerDocument&&S.addClassNameRecursively(C.parentNode,x)};var g=function(C,x){var O=C.parentStyleSheet,P=b(O.cssRules).indexOf(C);O.insertRule(x,P+1),O.deleteRule(P)},h=function(C,x){var O=C.cssText.replace(/^[^\{]+/,""),P=x+" "+O;g(C,P)},v=function(C){return b(C).reduce(function(x,O){return x+O.cssText},"")},d=function(C){C.textContent=v(C.sheet.cssRules)},y=function(C){var x=document.implementation.createHTMLDocument(""),O=document.createElement("style");O.textContent=C.textContent,x.body.appendChild(O),C.sheet=O.sheet},_=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},R=function(C,x,O){var P=_(x);b(C.querySelectorAll("style")).forEach(function(k){typeof k.sheet>"u"&&y(k);var M=b(k.sheet.cssRules).filter(function(I){return I.selectorText&&new RegExp(P,"i").test(I.selectorText)});M.length&&(M.forEach(function(I){var H=I.selectorText.replace(new RegExp(P,"gi"),function(G,Z,W){return Z+O(W)});H!==I.selectorText&&h(I,H)}),d(k))})};return S.rewriteCssSelectorWith=function(C,x,O){R(C,[x],function(){return O})},S.lowercaseCssTypeSelectors=function(C,x){R(C,x,function(O){return O.toLowerCase()})},S.findHtmlOnlyNodeNames=function(C){var x=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),O={},P={},k;do k=x.currentNode.tagName.toLowerCase(),x.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?O[k]=!0:P[k]=!0;while(x.nextNode());return Object.keys(O).filter(function(M){return!P[M]})},S}(),u=function(S){var b={},g=function(v){return Array.prototype.slice.call(v)},h={active:!0,hover:!0,focus:!1,target:!1};return b.fakeUserAction=function(v,d,y){var _=v.querySelector(d),R=":"+y,C="rasterizehtml"+y;_&&(h[y]?S.addClassNameRecursively(_,C):S.addClassName(_,C),S.rewriteCssSelectorWith(v,R,"."+C))},b.persistInputValues=function(v){var d=v.querySelectorAll("input"),y=v.querySelectorAll("textarea"),_=function(R){return R.type==="checkbox"||R.type==="radio"};g(d).filter(_).forEach(function(R){R.checked?R.setAttribute("checked",""):R.removeAttribute("checked")}),g(d).filter(function(R){return!_(R)}).forEach(function(R){R.setAttribute("value",R.value)}),g(y).forEach(function(R){R.textContent=R.value})},b.rewriteTagNameSelectorsToLowerCase=function(v){S.lowercaseCssTypeSelectors(v,S.findHtmlOnlyNodeNames(v))},b}(l),f=function(S,b,g,h){var v={},d=function(W,B,F,T){var L=W.createElement(B);return L.style.visibility="hidden",L.style.width=F+"px",L.style.height=T+"px",L.style.position="absolute",L.style.top=-1e4-T+"px",L.style.left=-1e4-F+"px",W.getElementsByTagName("body")[0].appendChild(L),L},y=function(W){return W>0?new Promise(function(B){setTimeout(B,W)}):Promise.resolve()};v.executeJavascript=function(W,B){return new Promise(function(F){var T=d(h.document,"iframe",B.width,B.height),L=W.outerHTML,z=[],D=B.executeJsTimeout||0,$=function(){h.document.getElementsByTagName("body")[0].removeChild(T)},K=function(){var X=T.contentDocument;F({document:X,errors:z,cleanUp:$})},V=T.contentWindow.XMLHttpRequest,U=b.finishNotifyingXhr(V),Y=b.baseUrlRespectingXhr(U,B.baseUrl);T.onload=function(){y(D).then(U.waitForRequestsToFinish).then(K)},T.contentDocument.open(),T.contentWindow.XMLHttpRequest=Y,T.contentWindow.onerror=function(X){z.push({resourceType:"scriptExecution",msg:X})},T.contentDocument.write("<!DOCTYPE html>"),T.contentDocument.write(L),T.contentDocument.close()})};var _=function(W,B,F){var T=W.createElement("iframe");return T.style.width=B+"px",T.style.height=F+"px",T.style.visibility="hidden",T.style.position="absolute",T.style.top=-1e4-F+"px",T.style.left=-1e4-B+"px",T.style.borderWidth=0,T.sandbox="allow-same-origin",T.scrolling="no",T},R=function(W,B,F){var T=Math.floor(W/F),L=Math.floor(B/F);return _(h.document,T,L)},C=function(W,B,F,T){return{width:Math.max(W.width*T,B),height:Math.max(W.height*T,F)}},x=function(W,B){var F=W.querySelector(B);if(F)return F;if(W.ownerDocument.querySelector(B)===W)return W;throw{message:"Clipping selector not found"}},O=function(W,B,F,T,L){var z=Math.max(W.scrollWidth,W.clientWidth),D=Math.max(W.scrollHeight,W.clientHeight),$,K,V,U,Y,X,Q,te;return B?(X=x(W,B),Q=X.getBoundingClientRect(),$=Q.top,K=Q.left,V=Q.width,U=Q.height):($=0,K=0,V=z,U=D),te=C({width:V,height:U},F,T,L),Y=h.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:K,top:$,width:te.width,height:te.height,viewportWidth:z,viewportHeight:D,rootFontSize:Y}},P=function(W,B){var F=W.tagName;return B.querySelector(F)},k=function(W){var B=W.tagName.toLowerCase();return B==="html"||B==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};v.calculateDocumentContentSize=function(W,B){return new Promise(function(F,T){var L=B.zoom||1,z;z=R(B.width,B.height,L),h.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var D=z.contentDocument,$;try{$=O(P(W,D),B.clip,B.width,B.height,L),F($)}catch(K){T(K)}finally{h.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(k(W)),z.contentDocument.close()})},v.parseHtmlFragment=function(W){var B=h.document.implementation.createHTMLDocument("");B.documentElement.innerHTML=W;var F=B.querySelector("body").firstChild;if(!F)throw"Invalid source";return F};var M=function(W,B){var F=/<html((?:\s+[^>]*)?)>/im.exec(B),T=h.document.implementation.createHTMLDocument(""),L,z,D,$;if(F)for(L="<div"+F[1]+"></div>",T.documentElement.innerHTML=L,D=T.querySelector("div"),z=0;z<D.attributes.length;z++)$=D.attributes[z],W.documentElement.setAttribute($.name,$.value)};v.parseHTML=function(W){var B=h.document.implementation.createHTMLDocument("");return B.documentElement.innerHTML=W,M(B,W),B};var I=function(W){try{return g.failOnParseError(W)}catch(B){throw{message:"Invalid source",originalError:B}}};v.validateXHTML=function(W){var B=new DOMParser,F=B.parseFromString(W,"application/xml");I(F)};var H=null,G=function(W,B){return B==="none"||B==="repeated"?((H===null||B!=="repeated")&&(H=Date.now()),W+"?_="+H):W},Z=function(W,B){return new Promise(function(F,T){var L=new window.XMLHttpRequest,z=S.joinUrl(B.baseUrl,W),D=G(z,B.cache),$=function(K){T({message:"Unable to load page",originalError:K})};L.addEventListener("load",function(){L.status===200||L.status===0?F(L.responseXML):$(L.statusText)},!1),L.addEventListener("error",function(K){$(K)},!1);try{L.open("GET",D,!0),L.responseType="document",L.send(null)}catch(K){$(K)}})};return v.loadDocument=function(W,B){return Z(W,B).then(function(F){return I(F)})},v}(a,o,n,window),p=function(S){var b={},g=function(P,k){return k?URL.createObjectURL(new Blob([P],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(P)},h=function(P){P instanceof Blob&&URL.revokeObjectURL(P)},v='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(P){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=P})},y=function(){var P=g(v,!0);return d(P).then(function(k){return h(P),k?!1:d(g(v,!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},R=function(){return new Promise(function(P,k){_()&&S.URL?y().then(function(M){P(!M)},function(){k()}):P(!1)})},C,x=function(){return C===void 0&&(C=R()),C},O=function(P){return x().then(function(k){return g(P,k)})};return b.renderSvg=function(P){return new Promise(function(k,M){var I,H,G=function(){H.onload=null,H.onerror=null},Z=function(){I&&h(I)};H=new Image,H.onload=function(){G(),Z(),k(H)},H.onerror=function(){Z(),M()},O(P).then(function(W){I=W,H.src=I},M)})},b}(window),E=function(S,b,g,h){var v={},d=function(P,k){var M=k||1,I={width:P.width,height:P.height,"font-size":P.rootFontSize};return M!==1&&(I.style="transform:scale("+M+"); transform-origin: 0 0;"),I},y=function(P){var k,M,I,H;k=Math.round(P.viewportWidth),M=Math.round(P.viewportHeight),I=-P.left,H=-P.top;var G={x:I,y:H,width:k,height:M};return G},_=function(P){var k=P.style||"";P.style=k+"float: left;"},R=function(P){P.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},x=function(P){var k=Object.keys(P);return k.length?" "+k.map(function(M){return M+'="'+P[M]+'"'}).join(" "):""},O=function(P,k,M){var I=h.serializeToString(P);b.validateXHTML(I);var H=y(k);return _(H),R(H),'<svg xmlns="http://www.w3.org/2000/svg"'+x(d(k,M))+">"+C()+"<foreignObject"+x(H)+">"+I+"</foreignObject></svg>"};return v.getSvgForDocument=function(P,k,M){return g.rewriteTagNameSelectorsToLowerCase(P),O(P,k,M)},v.drawDocumentAsSvg=function(P,k){return["hover","active","focus","target"].forEach(function(M){k[M]&&g.fakeUserAction(P,k[M],M)}),b.calculateDocumentContentSize(P,k).then(function(M){return v.getSvgForDocument(P,M,k.zoom)})},v}(a,f,u,r),w=function(S,b,g,h,v,d){var y={},_=function(P){return{message:"Error rendering page",originalError:P}},R=function(P){return v.renderSvg(P).then(function(k){return{image:k,svg:P}},function(k){throw _(k)})},C=function(P,k){try{k.getContext("2d").drawImage(P,0,0)}catch(M){throw _(M)}},x=function(P,k,M){return h.drawDocumentAsSvg(P,M).then(R).then(function(I){return k&&C(I.image,k),I})},O=function(P,k){return b.executeJavascript(P,k).then(function(M){var I=M.document;return g.persistInputValues(I),{document:I,errors:M.errors,cleanUp:M.cleanUp}})};return y.rasterize=function(P,k,M){var I;return I=S.clone(M),I.inlineScripts=M.executeJs===!0,d.inlineReferences(P,I).then(function(H){return M.executeJs?O(P,M).then(function(G){return{element:G.document.documentElement,errors:H.concat(G.errors),cleanUp:G.cleanUp}}):{element:P,errors:H,cleanUp:function(){}}}).then(function(H){return x(H.element,k,M).then(function(G){return H.cleanUp(),{image:G.image,svg:G.svg,errors:H.errors}})})},y}(a,f,u,E,p,i),m=function(S,b,g){var h={},v=function(C,x){var O=300,P=200,k=C?C.width:O,M=C?C.height:P,I=x.width!==void 0?x.width:k,H=x.height!==void 0?x.height:M;return{width:I,height:H}},d=function(C){var x=v(C.canvas,C.options),O;return O=S.clone(C.options),O.width=x.width,O.height=x.height,O};h.drawDocument=function(){var C=arguments[0],x=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(x),P=C.documentElement?C.documentElement:C;return g.rasterize(P,O.canvas,d(O))};var y=function(C,x,O){var P=b.parseHTML(C);return h.drawDocument(P,x,O)};h.drawHTML=function(){var C=arguments[0],x=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(x);return y(C,O.canvas,O.options)};var _=function(C,x,O){var P=document.implementation.createHTMLDocument("");P.replaceChild(C.documentElement,P.documentElement);var k=O?S.clone(O):{};return O.baseUrl||(k.baseUrl=x),{document:P,options:k}},R=function(C,x,O){return b.loadDocument(C,O).then(function(P){var k=_(P,C,O);return h.drawDocument(k.document,x,k.options)})};return h.drawURL=function(){var C=arguments[0],x=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(x);return R(C,O.canvas,O.options)},h}(a,f,w);return m})})(aS);var aj=aS.exports;(function(e){var t=me&&me.__createBinding||(Object.create?function(g,h,v,d){d===void 0&&(d=v);var y=Object.getOwnPropertyDescriptor(h,v);y&&!("get"in y?!h.__esModule:y.writable||y.configurable)||(y={enumerable:!0,get:function(){return h[v]}}),Object.defineProperty(g,d,y)}:function(g,h,v,d){d===void 0&&(d=v),g[d]=h[v]}),r=me&&me.__setModuleDefault||(Object.create?function(g,h){Object.defineProperty(g,"default",{enumerable:!0,value:h})}:function(g,h){g.default=h}),n=me&&me.__importStar||function(g){if(g&&g.__esModule)return g;var h={};if(g!=null)for(var v in g)v!=="default"&&Object.prototype.hasOwnProperty.call(g,v)&&t(h,g,v);return r(h,g),h};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.isContentWrapping=e.resetStyleContent=void 0;const i=n(aj),a=Xs;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);function f({html:g}){const h=document.createElement("div");h.innerHTML=g,h.style.display="inline-block",h.style.position="fixed",h.style.top="0px",h.style.left="0px",h.style.zIndex="1000",h.style.whiteSpace="nowrap",h.style.visibility="hidden";const v=u();v.appendChild(h);const d=h.textContent,y=h.childNodes[0],_=d.split(/\s+/);let R=!1;for(let C=0;C<_.length;C++){const x=_[C];if(y.textContent=x,R=y.scrollWidth>h.clientWidth,R)break}return v.removeChild(h),R}function p(g){const h=document.createElement("div");h.innerHTML=g,h.style.display="inline-block",h.style.position="fixed",h.style.top="0px",h.style.left="0px",h.style.zIndex="1000";const v=u();v.appendChild(h);const d=h.getBoundingClientRect();return v.removeChild(h),{width:d.width,height:d.height}}e.isContentWrapping=f,e.detectSize=p;const E={};function w(g){const h=[];for(const v of document.styleSheets)try{for(const d of v.cssRules)d instanceof CSSFontFaceRule&&d.style.fontFamily.replace(/['"]/g,"")===g&&h.push(d)}catch(d){console.warn(`Could not access stylesheet: ${v.href}`,d)}return h}const m={},S=g=>{if(m[g])return m[g];const h=w(g).filter(v=>v.style.fontFamily.replace(/['"]/g,"")===g).map(v=>({src:v.style.src,fontStyle:v.style.fontStyle||"normal",fontWeight:v.style.fontWeight||"normal"}));return m[g]=h,h};async function b({html:g,width:h,height:v,fontFamily:d,padding:y,font:_,pixelRatio:R}){const C=document.createElement("canvas");if(d!=="Arial"&&!_){const P=(0,a.getGoogleFontsVariants)();g+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${d}:${P}" rel="stylesheet">`}if(_){const P=_.styles||(_.url?[{src:`url("${_.url}")`}]:S(d));g+="<style>",P.forEach(k=>{g+=`
195
+ @font-face {
196
+ font-family: '${d}';
197
+ src: ${k.src};
198
+ font-style: ${k.fontStyle||"normal"};
199
+ font-weight: ${k.fontWeight||"normal"};
200
+ }
201
+ `}),g+="</style>"}g+=o;const x=await i.drawHTML(`<div style="padding: ${y}px;">${g}</div>`,C,{width:h+2*y,height:v+2*y,cacheBucket:E});C.width=(h+2*y)*R,C.height=(v+2*y)*R;const O=C.getContext("2d");return O==null||O.drawImage(x.image,0,0,x.image.width*R,x.image.height*R),C}e.htmlToCanvas=b})(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 y=r(d),_=y.data;return y.data="",_},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,y)=>{let _="",R="",C="";for(let x in d){let O=d[x];x[0]=="@"?x[1]=="i"?_=x+" "+O+";":R+=x[1]=="f"?o(O,x):x+"{"+o(O,x[1]=="k"?"":y)+"}":typeof O=="object"?R+=o(O,y?y.replace(/([^,])+/g,P=>x.replace(/(^:.*)|([^,])+/g,k=>/&/.test(k)?k.replace(/&/g,P):P?P+" "+k:k)):x):O!=null&&(x=x.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=o.p?o.p(x,O):x+":"+O+";")}return _+(y&&C?y+"{"+C+"}":C)+R},l={},u=d=>{if(typeof d=="object"){let y="";for(let _ in d)y+=_+u(d[_]);return y}return d},f=(d,y,_,R,C)=>{let x=u(d),O=l[x]||(l[x]=(P=>{let k=0,M=11;for(;k<P.length;)M=101*M+P.charCodeAt(k++)>>>0;return"go"+M})(x));if(!l[O]){let P=x!==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]:P}:P,_?"":"."+O)}return((P,k,M)=>{k.data.indexOf(P)==-1&&(k.data=M?P+k.data:k.data+P)})(l[O],y,R),O},p=(d,y,_)=>d.reduce((R,C,x)=>{let O=y[x];if(O&&O.call){let P=O(_),k=P&&P.props&&P.props.className||/^go/.test(P)&&P;O=k?"."+k:P&&typeof P=="object"?P.props?"":o(P,""):P===!1?"":P}return R+C+(O??"")},"");function E(d){let y=this||{},_=d.call?d(y.p):d;return f(_.unshift?_.raw?p(_,[].slice.call(arguments,1),y.p):_.reduce((R,C)=>Object.assign(R,C&&C.call?C(y.p):C),{}):_,r(y.target),y.g,y.o,y.k)}e.extractCss=n,e.css=E;let w,m,S,b=E.bind({g:1}),g=E.bind({k:1});function h(d,y,_,R){o.p=y,w=d,m=_,S=R}function v(d,y){let _=this||{};return function(){let R=arguments;function C(x,O){let P=Object.assign({},x),k=P.className||C.className;_.p=Object.assign({theme:m&&m()},P),_.o=/ *go\d+/.test(k),P.className=E.apply(_,R)+(k?" "+k:""),y&&(P.ref=O);let M=d;return d[0]&&(M=P.as||d,delete P.as),S&&M[0]&&S(P),w(M,P)}return y?y(C):C}}e.glob=b,e.keyframes=g,e.setup=h,e.styled=v})(_2);var oj=me&&me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(b2,"__esModule",{value:!0});const lj=oj(Ze),__=_2;(0,__.setup)(lj.default.createElement),b2.default=__.styled;(function(e){var t=me&&me.__createBinding||(Object.create?function(F,T,L,z){z===void 0&&(z=L);var D=Object.getOwnPropertyDescriptor(T,L);D&&!("get"in D?!T.__esModule:D.writable||D.configurable)||(D={enumerable:!0,get:function(){return T[L]}}),Object.defineProperty(F,z,D)}:function(F,T,L,z){z===void 0&&(z=L),F[z]=T[L]}),r=me&&me.__setModuleDefault||(Object.create?function(F,T){Object.defineProperty(F,"default",{enumerable:!0,value:T})}:function(F,T){F.default=T}),n=me&&me.__importStar||function(F){if(F&&F.__esModule)return F;var T={};if(F!=null)for(var L in F)L!=="default"&&Object.prototype.hasOwnProperty.call(F,L)&&t(T,F,L);return r(T,F),T},i=me&&me.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.quillRef=void 0;const a=i(Ze),o=_i,l=Ca,u=i(PD),f=i(Si),p=n(Ki),E=Yn,w=Kc,m=Zy,S=Wc,b=p2,g=xl,h=Pl,v=qc,d=i(b2),y=$i,_=e2,R=n(Xs),C=Po,x=f2;e.quillRef=p.observable({enabled:!1,currentFormat:{},editor:p.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
+ `,P=F=>new u.default(F,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=P;const k=(F,T)=>{var L=F.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+T+"<p><br></p></div>");F.setContents(L),F.history.clear()};e.setQuillContent=k;const M=({html:F,onBlur:T,onChange:L,element:z})=>{const D=a.default.useRef(null);a.default.useEffect(()=>{if(!D.current)return;const K=(0,e.createQuill)(D.current);return p.runInAction(()=>{e.quillRef.editor.instance=K}),window.__polotnoQuill=K,K.on("text-change",()=>{K.getSelection()&&p.runInAction(()=>{e.quillRef.currentFormat=K.getFormat()}),setTimeout(()=>{var V;const U=(V=D.current)===null||V===void 0?void 0:V.childNodes[0];L(U.innerHTML)},10)}),K.setSelection(0,0,"api"),K.on("selection-change",V=>{V||T(),V&&p.runInAction(()=>{e.quillRef.currentFormat=K.getFormat()})}),D.current.childNodes[0].addEventListener("blur",V=>{var U;!((U=V.relatedTarget)===null||U===void 0)&&U.classList.contains("ql-clipboard")||T()}),()=>{p.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var K;const V=e.quillRef.editor.instance;if(!V)return;const U=V.getSelection();((K=D.current)===null||K===void 0?void 0:K.childNodes[0].innerHTML)===z.text||((0,e.setQuillContent)(V,F),U&&(V.setSelection(U.index,U.length),p.runInAction(()=>{e.quillRef.currentFormat=V.getFormat()})))},[z.text]);const $={color:z.fill};return z.fill.indexOf("gradient")>=0&&($.backgroundColor=z.fill,$.backgroundImage=z.fill,$.backgroundSize="100% 100%",$.backgroundRepeat="repeat",$.webkitBackgroundClip="text",$.MozBackgroundClip="text",$.WebkitTextFillColor="transparent",$.MozTextFillColor="transparent"),a.default.createElement(O,{ref:D,style:Object.assign(Object.assign({},$),{fontSize:z.fontSize,width:z.a.width,fontFamily:z.fontFamily,lineHeight:z.lineHeight,letterSpacing:z.letterSpacing+"rem",textAlign:z.align}),dir:(0,m.getDir)((0,_.removeTags)(z.text))})};function I(F,T,L){return a.default.useMemo(()=>(0,b.detectSize)(F),[F,T.width,L])}function H(F){const T=F.getContext("2d").getImageData(0,0,F.width,F.height).data;for(let L=0;L<T.length;L+=4)if(T[L+3]!==0)return!0;return!1}function G(F){return!H(F)}function Z(F,{fontFamily:T="",color:L="black"}={}){let z=`color: ${L||F.fill}`;return F.fill.indexOf("gradient")>=0&&(z=`
213
+ background-color: ${L};
214
+ background-image: ${F.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(F.width||100)}px`,z,`font-size: ${F.fontSize}px`,`font-family: '${T}'`,`text-align: ${F.align}`,F.textDecoration?`text-decoration: ${F.textDecoration}`:"",F.lineHeight?`line-height: ${F.lineHeight}`:"",F.letterSpacing?`letter-spacing: ${F.letterSpacing}rem`:"",F.fontStyle?`font-style: ${F.fontStyle}`:"",F.fontWeight?`font-weight: ${F.fontWeight}`:"",F.strokeWidth?`-webkit-text-stroke: ${F.strokeWidth}px ${F.stroke}`:"",F.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,m.getDir)((0,_.removeTags)(F.text))}">${F.text.replaceAll(`
222
+ `,"</br>")}</div>`}const W=F=>{let T=F.fontSize;for(let L=1;L<50;L++){const z=Z(Object.assign(Object.assign({},F.toJSON()),{fontSize:T}),{fontFamily:F.fontFamily}),{height:D}=(0,b.detectSize)(z),$=F.height&&D>F.height,K=(0,b.isContentWrapping)({html:z});if(!($||K))break;T-=.5}return T},B=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:F,store:T})=>{const L=a.default.useRef(null),[z,D]=a.default.useState(),[$,K]=a.default.useState(!1),[V,U]=a.default.useState(!0),[Y,X]=a.default.useState(!1),Q=a.default.useRef(F.height),te=T.selectedElements.indexOf(F)>=0,ee=F.fontSize/3,{textVerticalResizeEnabled:ne}=E.flags,ie=(0,m.usePrevious)(F.fontFamily),[oe]=(0,m.useFontLoader)(T,F.fontFamily),ke=F._editModeEnabled;(0,g.useFadeIn)(L);const Ie=oe?F.fontFamily:ie!==F.fontFamily?ie:"Arial",le=(0,S.useColor)(F).fill,fe=Z(F,{fontFamily:Ie,color:le}),{width:_e,height:ge}=I(fe,F,oe);a.default.useEffect(()=>{if(!oe)return;if(!F.height)return void F.set({height:ge});const{textOverflow:Re}=E.flags;if(Re!=="change-font-size"||$)Re==="resize"&&(ne&&F.height<ge&&T.history.ignore(()=>{F.set({height:ge})}),ne||F.height===ge||T.history.ignore(()=>{F.set({height:ge})}));else{const Oe=W(F);Oe!==F.fontSize?T.history.ignore(()=>{F.set({fontSize:Oe})}):F.height!==ge&&(ne&&F.height<ge?T.history.ignore(()=>{F.set({height:ge})}):ne||T.history.ignore(()=>{F.set({height:ge})}))}});const re=a.default.useRef(0),de=a.default.useMemo(()=>{const Re={lastArgs:null,lastResult:null};return async function(Oe){return Re.lastArgs&&Re.lastResult&&(Pe=Re.lastArgs,He=Oe,JSON.stringify(Pe)===JSON.stringify(He))||(Re.lastResult=await(0,b.htmlToCanvas)(Oe),Re.lastArgs=Object.assign({},Oe)),Re.lastResult;var Pe,He}},[]);a.default.useEffect(()=>{$||ke||(async()=>{re.current++;const Re=re.current,Oe=(0,y.incrementLoader)(`text ${F.id}`);U(!0);let Pe=null;const He=B?5:1;for(let lt=0;lt<He;lt++){if(Pe=await(lt>0?de:b.htmlToCanvas)({skipCache:lt>0,html:fe,width:F.width||1,height:F.height||ge||1,fontFamily:Ie,padding:ee,pixelRatio:T._elementsPixelRatio,font:T.fonts.find(ce=>ce.fontFamily===Ie)||R.globalFonts.find(ce=>ce.fontFamily===Ie)}),Re!==re.current)return void Oe();G(Pe)&&B&&await new Promise(ce=>setTimeout(ce,50*(lt+1)))}Pe?(D(Pe),U(!1),f.default.Util.requestAnimFrame(Oe)):Oe()})()},[fe,$,ge,ke,Ie,F.height,T._elementsPixelRatio]);const ye=$||V;a.default.useEffect(()=>p.autorun(()=>{const Re=L.current;(0,w.applyFilter)(Re,F)}),[z,ye,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);let Se=0;F.verticalAlign==="middle"&&(Se=(F.height-ge)/2),F.verticalAlign==="bottom"&&(Se=F.height-ge);const $e=(0,m.getLineHeight)({fontLoaded:oe,fontFamily:F.fontFamily,fontSize:F.fontSize,lineHeight:F.lineHeight}),Qe=(0,C.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:F.a.x,y:F.a.y,offsetX:F.backgroundPadding*(F.fontSize*$e*.5),offsetY:F.backgroundPadding*(F.fontSize*$e*.5),rotation:F.a.rotation,hideInExport:!F.showInExport,listening:!1,visible:F.backgroundEnabled,opacity:F.backgroundOpacity*F.a.opacity,fill:F.backgroundColor,width:F.a.width+F.backgroundPadding*(F.fontSize*$e),height:F.a.height+F.backgroundPadding*(F.fontSize*$e),cornerRadius:F.backgroundCornerRadius*(F.fontSize*$e*.5)}),a.default.createElement(l.Rect,{ref:L,name:"element",x:F.a.x,y:F.a.y,listening:F.selectable,rotation:F.a.rotation,width:F.a.width,height:F.a.height,visible:!ye,draggable:Qe?F.draggable&&te:F.draggable,preventDefault:!Qe||te,opacity:ke?0:F.a.opacity,hideInExport:!F.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Re=>{F.set({x:Re.target.x(),y:Re.target.y()})},onDragEnd:Re=>{F.set({x:Re.target.x(),y:Re.target.y()})},id:F.id,onDblClick:()=>{F.contentEditable&&F.toggleEditMode(!0)},onDblTap:()=>{F.contentEditable&&F.toggleEditMode(!0)},onTransformStart:Re=>{K(!0),Q.current=F.height},onTransform:Re=>{var Oe;const Pe=Re.target,He=((Oe=Pe.getStage())===null||Oe===void 0?void 0:Oe.findOne("Transformer")).getActiveAnchor(),lt=He==="middle-left"||He==="middle-right",ue=He==="top-center"||He==="bottom-center",ce=Pe.scaleX();if(lt){const Xe=Pe.scaleX(),be=Math.max(Pe.width()*Xe,F.fontSize);if(Pe.width(be),Pe.scaleX(1),E.flags.textVerticalResizeEnabled){const Le=Math.max(ge,Q.current);F.set({height:Le})}F.set({width:be,x:Pe.x(),y:Pe.y()})}else if(ue){let Xe=E.flags.textOverflow==="resize"?ge:F.lineHeight*F.fontSize;const be=Math.max(Xe,Re.target.height()*Re.target.scaleY());Pe.scaleY(1),F.set({x:Pe.x(),y:Pe.y(),height:be,rotation:Pe.rotation()})}else Pe.scaleX(1),Pe.scaleY(1),F.set({fontSize:F.fontSize*ce,width:Pe.width()*ce,x:Pe.x(),y:Pe.y(),rotation:Pe.rotation(),height:Pe.height()*ce})},onTransformEnd:Re=>{K(!1),U(!0);const Oe=Re.target.scaleX();Re.target.scaleX(1),Re.target.scaleY(1),F.set({fontSize:F.fontSize*Oe,width:Re.target.width()*Oe,x:Re.target.x(),y:Re.target.y(),rotation:Re.target.rotation(),shadowBlur:F.shadowBlur*Oe,shadowOffsetX:F.shadowOffsetX*Oe,shadowOffsetY:F.shadowOffsetY*Oe,strokeWidth:F.strokeWidth*Oe})}}),a.default.createElement(l.Image,{ref:L,image:z,x:F.a.x,y:F.a.y,offsetX:ee,offsetY:ee-Se,listening:!1,rotation:F.rotation,width:F.a.width+2*ee,height:F.a.height+2*ee,visible:!ye,opacity:ke?0:F.a.opacity,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,hideInExport:!F.showInExport}),ye&&a.default.createElement(l.Group,{x:F.a.x,y:F.a.y,rotation:F.rotation,offsetY:-Se},a.default.createElement(v.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(O,{dangerouslySetInnerHTML:{__html:fe},style:{pointerEvents:"none",display:"inline-block"}}))),ke&&a.default.createElement(l.Group,{x:F.a.x,y:F.a.y,rotation:F.rotation,offsetY:-Se},a.default.createElement(v.Html,null,a.default.createElement(M,{html:fe,element:F,onChange:Re=>{const Oe=(0,x.getLimitedFontSize)({oldText:(0,_.removeTags)(F.text),newText:(0,_.removeTags)(Re),element:F});F.set({text:Re,fontSize:Oe})},onBlur:Re=>{F.toggleEditMode(!1)}}))),(te||Y)&&a.default.createElement(h.Highlighter,{element:F}))})})(nS);var cS={},w2={},eu={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,p,E,w){const m=Math.sqrt(p*p+E*E);return w+=Math.atan2(E,p),{x:u+m*Math.cos(w),y:f+m*Math.sin(w)}}function n(u){const{x:f,y:p,width:E,height:w}=u,m=t(u.rotation),S=r(f,p,0,0,m),b=r(f,p,E,0,m),g=r(f,p,E,w,m),h=r(f,p,0,w,m),v=Math.min(S.x,b.x,g.x,h.x),d=Math.min(S.y,b.y,g.y,h.y),y=Math.max(S.x,b.x,g.x,h.x),_=Math.max(S.y,b.y,g.y,h.y);return{x:v,y:d,width:y-v,height:_-d,minX:v,minY:d,maxX:y,maxY:_}}function i(u){const f=u.map(S=>n(S)),p=Math.min(...f.map(S=>S.minX)),E=Math.min(...f.map(S=>S.minY)),w=Math.max(...f.map(S=>S.maxX)),m=Math.max(...f.map(S=>S.maxY));return{x:p,y:E,width:w-p,height:m-E,minX:p,minY:E,maxX:w,maxY:m}}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,p){const E=t(f),w=p.x+(u.x-p.x)*Math.cos(E)-(u.y-p.y)*Math.sin(E),m=p.y+(u.x-p.x)*Math.sin(E)+(u.y-p.y)*Math.cos(E);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:w,y:m})}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})(eu);(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(Ze),n=t(Si),i=eu;var a=5;function o(E){const w=E.__getNodeRect(),m=(0,i.getClientRect)(Object.assign(Object.assign({},w),{rotation:n.default.Util.radToDeg(w.rotation)})),S=E.getAbsolutePosition();return{vertical:[{guide:m.x,offset:S.x-m.x,snap:"start"},{guide:m.x+m.width/2,offset:S.x-m.x-m.width/2,snap:"center"},{guide:m.x+m.width,offset:S.x-m.x-m.width,snap:"end"}],horizontal:[{guide:m.y,offset:S.y-m.y,snap:"start"},{guide:m.y+m.height/2,offset:S.y-m.y-m.height/2,snap:"center"},{guide:m.y+m.height,offset:S.y-m.y-m.height,snap:"end"}]}}function l(E,w){var m=[],S=[];E.vertical.forEach(y=>{w.vertical.forEach(_=>{var R=Math.abs(y-_.guide);R<a&&m.push({lineGuide:y,diff:R,snap:_.snap,offset:_.offset})})}),E.horizontal.forEach(y=>{w.horizontal.forEach(_=>{var R=Math.abs(y-_.guide);R<a&&S.push({lineGuide:y,diff:R,snap:_.snap,offset:_.offset})})});var b=[];const g=m.sort((y,_)=>y.diff-_.diff),h=S.sort((y,_)=>y.diff-_.diff);var v=g[0],d=h[0];return v&&g.filter(y=>Math.abs(y.diff-v.diff)<.1).forEach(y=>{b.push(Object.assign({orientation:"V"},y))}),d&&h.filter(y=>Math.abs(y.diff-d.diff)<.1).forEach(y=>{b.push(Object.assign({orientation:"H"},y))}),b}function u(E,w){const m=r.default.useRef(),S=_=>_.hasName("element")||_.hasName("page-background")||!m.current&&_.hasName("elements-area");function b(_){var R;const C=(R=E.current)===null||R===void 0?void 0:R.getStage();var x=[],O=[];return C.find(S).forEach(P=>{if(!(_.indexOf(P)>=0)){var k=P.getClientRect({skipShadow:!0,skipStroke:!0});x.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:x,horizontal:O}}function g(_){var R;const C=(R=E.current)===null||R===void 0?void 0:R.getLayer(),x=C==null?void 0:C.children.find(O=>O.name()==="line-guides");_.forEach(O=>{if(O.orientation==="H"){var P=new n.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});x==null||x.add(P),C.batchDraw()}else O.orientation==="V"&&(P=new n.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),x==null||x.add(P))})}const h=_=>{_.target.getLayer().children.find(k=>k.name()==="line-guides").destroyChildren();var R=l(b(_.target.nodes()),o(_.target));if(!R.length)return;g(R);const C=_.target.getAbsolutePosition(),x=(_.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},C));R.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":x.x=k.lineGuide+k.offset;break;case"H":x.y=k.lineGuide+k.offset}}});const O=x.x-C.x,P=x.y-C.y;if(!(_.evt.ctrlKey||_.evt.metaKey)){_.target.nodes().forEach(M=>{const I=M.getAbsolutePosition();M.setAbsolutePosition({x:I.x+O,y:I.y+P})});const k=_.target.nodes().map(M=>M.getAbsolutePosition().y);k.every(M=>Math.abs(M-k[0])<.1)}},v=(_,R,C)=>{const x=E.current,O=x.getLayer();if(O.children.find(G=>G.name()==="line-guides").destroyChildren(),x.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(R.x-_.x,2)+Math.pow(R.y-_.y,2))>50||!O)return R;var P=l(b(x.nodes()),{vertical:[{guide:R.x,offset:0,snap:"start"}],horizontal:[{guide:R.y,offset:0,snap:"start"}]});if(!P.length||(g(P),C.ctrlKey||C.metaKey))return R;let k=R.x,M=R.x;P.forEach(G=>{switch(G.orientation){case"V":k=G.lineGuide;break;case"H":M=G.lineGuide}});const I=Math.abs(R.x-k)<10,H=Math.abs(R.y-M)<10;return I&&!H?{x:k,y:_.y}:H&&!I?{x:_.x,y:M}:I&&H?{x:k,y:M}:R},d=_=>{if(m.current=!1,!_.target)return;const R=_.target.getLayer();R.children.find(C=>C.name()==="line-guides").destroyChildren(),R.batchDraw()},y=()=>{const _=E.current.nodes().map(C=>C.id()),R=w.getElementById(_[0]);m.current=(R==null?void 0:R.type)==="image"};r.default.useEffect(()=>{E.current&&(E.current.anchorDragBoundFunc(v),E.current.on("dragstart",()=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const _=[...n.default.DD._dragElements.entries()],R=_.find(([C,x])=>x.node instanceof n.default.Transformer);_.splice(_.indexOf(R),1),_.unshift(R),n.default.DD._dragElements.clear(),_.forEach(([C,x])=>{n.default.DD._dragElements.set(C,x)})}),y()}),E.current.on("dragmove",h),E.current.on("dragend",d),E.current.on("transformstart",()=>{y()}),E.current.on("transformend",d),E.current.on("transform",_=>{var R,C;_.evt.ctrlKey||_.evt.metaKey?(R=E.current)===null||R===void 0||R.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 p(E,w,m){const S=h=>h.hasName("element")||h.hasName("line-anchor")||h.hasName("page-background")||h.hasName("elements-area"),b=h=>{h.target.getLayer().children.find(C=>C.name()==="line-guides").destroyChildren();var v=l(function(C){var x;const O=(x=E.current)===null||x===void 0?void 0:x.getStage();var P=[],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}),P.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:P,horizontal:k}}([h.target,...w.map(C=>C.current)]),f(h.target));if(!v.length)return;(function(C){var x;const O=(x=E.current)===null||x===void 0?void 0:x.getLayer(),P=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]});P==null||P.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]}),P==null||P.add(M))})})(v);const d=h.target.getAbsolutePosition(),y=Object.assign({},d);v.forEach(C=>{switch(C.snap){case"start":case"center":case"end":switch(C.orientation){case"V":y.x=C.lineGuide+C.offset;break;case"H":y.y=C.lineGuide+C.offset}}});const _=y.x-d.x,R=y.y-d.y;if(!(h.evt.ctrlKey||h.evt.metaKey)){const C=h.target.getAbsolutePosition();h.target.absolutePosition({x:C.x+_,y:C.y+R})}},g=h=>{if(!h.target)return;const v=h.target.getLayer();v.children.find(d=>d.name()==="line-guides").destroyChildren(),v.batchDraw()};r.default.useEffect(()=>{E.current&&(E.current.on("dragmove",b),E.current.on("dragend",g))},m)}e.useSnap=u,e.useAnchorSnap=p})(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(Ze),n=_i,i=Ca,a=Wc,o=qc,l=Pl,u=w2,f=Po;function p(S){const{x:b,y:g,width:h,height:v,rotation:d}=S.a,y=d*Math.PI/180,_={x:b+v/2*Math.cos(y+Math.PI/2),y:g+v/2*Math.sin(y+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+h*Math.cos(y),y:_.y+h*Math.sin(y)}}}function E(S,b,g){const h=Math.sqrt(Math.pow(b.x-S.x,2)+Math.pow(b.y-S.y,2)),v=Math.atan2(b.y-S.y,b.x-S.x),d=180*v/Math.PI;return{x:S.x+Math.cos(v-Math.PI/2)*g/2,y:S.y+Math.sin(v-Math.PI/2)*g/2,width:h,height:g,rotation:d}}e.getMiddlePoints=p,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:g=>{g.target.getStage().container().style.cursor="crosshair"},onMouseLeave:g=>{g.target.getStage().container().style.cursor=""},onDragStart:g=>{b.history.startTransaction()},onDragEnd:g=>{b.history.endTransaction()}}),m=(0,n.observer)(({element:S,type:b})=>{const g=(0,a.useColor)(S,S.a.color,"fill"),h=(0,a.useColor)(S,S.a.color,"stroke"),v=Object.assign(Object.assign(Object.assign({strokeWidth:S.height,lineCap:"round",lineJoin:"round"},h),g),{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]},v)),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},v)),b==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-S.height,0,2*S.height],closed:!0},v)),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},v)),b==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*S.height,y:0,radius:2*S.height},v)))});e.LineElement=(0,n.observer)(({element:S,store:b})=>{const g=r.default.useRef(null),h=r.default.useRef(null),v=r.default.useRef(null),d=S.selectable||b.role==="admin",y=(0,f.isTouchDevice)(),[_,R]=r.default.useState(!1),C=b.selectedElements.indexOf(S)>=0&&b.selectedElements.length===1,{middleLeft:x,middleRight:O}=p(S);(0,u.useAnchorSnap)(h,[g],[C]),(0,u.useAnchorSnap)(v,[g],[C]);const P=(0,a.useColor)(S,S.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:g,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(k=>k*S.a.height)},P,{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:y?S.draggable&&C:S.draggable,preventDefault:!y||C,hideInExport:!S.showInExport,onMouseEnter:()=>{R(!0)},onMouseLeave:()=>{R(!1)},onDragMove:k=>{S.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{S.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const M=k.target.scaleX();k.target.scaleX(1),k.target.scaleY(1),S.set({height:S.height*M,width:S.width*M,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}})),r.default.createElement(i.Group,{x:x.x,y:x.y,rotation:S.rotation,hideInExport:!S.showInExport},r.default.createElement(m,{element:S,type:S.startHead})),r.default.createElement(i.Group,{x:O.x,y:O.y,rotation:S.rotation+180},r.default.createElement(m,{element:S,type:S.endHead})),_&&!C&&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:x.x,y:x.y,ref:h,name:"line-anchor"},w(b.scale,b),{onDragMove:k=>{const M=E(k.target.position(),O,S.height);S.set({x:M.x,y:M.y,width:M.width,rotation:M.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:O.x,y:O.y,ref:v,name:"line-anchor"},w(b.scale,b),{onDragMove:k=>{const M=E(x,k.target.position(),S.height);S.set({x:M.x,y:M.y,width:M.width,rotation:M.rotation})}})))))})})(cS);var fS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(T,L,z,D){D===void 0&&(D=z);var $=Object.getOwnPropertyDescriptor(L,z);$&&!("get"in $?!L.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return L[z]}}),Object.defineProperty(T,D,$)}:function(T,L,z,D){D===void 0&&(D=z),T[D]=L[z]}),r=me&&me.__setModuleDefault||(Object.create?function(T,L){Object.defineProperty(T,"default",{enumerable:!0,value:L})}:function(T,L){T.default=L}),n=me&&me.__importStar||function(T){if(T&&T.__esModule)return T;var L={};if(T!=null)for(var z in T)z!=="default"&&Object.prototype.hasOwnProperty.call(T,z)&&t(L,T,z);return r(L,T),L},i=me&&me.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Ze),o=_i,l=Ki,u=Ca,f=i(qp),p=i(Si),E=qc,w=Pl,m=$i,S=n(Qs),b=Yn,g=Kc,h=xl,v=Po;function d(){return document.createElement("canvas")}async function y(T){if(!(T.indexOf("data:image/svg+xml")>=0||T.indexOf(".svg")>=0))return T;const L=await S.urlToString(T),z=S.fixSize(L);return S.svgToURL(z)}const _=T=>{const[L,z]=a.default.useState(T);return a.default.useEffect(()=>{(async()=>{const D=await y(T);D!==L&&z(D)})()},[T]),L},R=new window.Image;R.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 x(T,L,z,D,$,K,V){for(var U=new ImageData(L,z),Y=new Int32Array(T.data.buffer),X=T.width,Q=new Int32Array(U.data.buffer),te=U.width,ee=L/K,ne=z/V,ie=Math.round(1/ee),oe=Math.round(1/ne),ke=ie*oe,Ie=0;Ie<U.height;Ie++)for(var le=0;le<te;le++){for(var fe=D+Math.round(le/ee)+($+Math.round(Ie/ne))*X,_e=0,ge=0,re=0,de=0,ye=0;ye<oe;ye++)for(var Se=0;Se<ie;Se++){var $e=Y[fe+Se+ye*X];_e+=$e<<24>>>24,ge+=$e<<16>>>24,re+=$e<<8>>>24,de+=$e>>>24}_e=Math.round(_e/ke),ge=Math.round(ge/ke),re=Math.round(re/ke),de=Math.round(de/ke),Q[le+Ie*te]=de<<24|re<<16|ge<<8|_e}return U}function O(T,L){var z,D;const $=d();$.width=T.width,$.height=T.height,(z=$.getContext("2d"))===null||z===void 0||z.drawImage(T,0,0,$.width,$.height);const K=x($.getContext("2d").getImageData(0,0,$.width,$.height),Math.floor($.width*L),Math.floor($.height*L),0,0,$.width,$.height);return $.width=Math.floor($.width*L),$.height=Math.floor($.height*L),(D=$.getContext("2d"))===null||D===void 0||D.putImageData(K,0,0),$}const P=(T,L,z,D,$=0,K=!1)=>{const V=Math.floor(Math.max(T.width*D,1)),U=Math.floor(Math.max(T.height*D,1)),Y=Math.min($*D,V/2,U/2),X=Math.max(T.width/z.width,T.height/z.height)*D,Q=T.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&X<1&&!K,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&&!Q?void 0:d()},[L,Y,Q,te]);return a.default.useLayoutEffect(()=>{if(!ee||!L)return;ee.width=V,ee.height=U;const ne=ee.getContext("2d");if(!ne)return;Y&&(ne.beginPath(),ne.moveTo(Y,0),ne.lineTo(V-Y,0),ne.arc(V-Y,Y,Y,3*Math.PI/2,0,!1),ne.lineTo(V,U-Y),ne.arc(V-Y,U-Y,Y,0,Math.PI/2,!1),ne.lineTo(Y,U),ne.arc(Y,U-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=Q?O(L,X):L,oe=Q?{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,oe.x,oe.y,oe.width,oe.height,0,0,ee.width,ee.height)},[ee,T.width,T.height,z.x,z.y,z.width,z.height,$,D,K,T.page._exportingOrRendering,Q]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(ee)},[ee]),ee||L},k=(T,L,z,D)=>{const $=_(T.clipSrc||""),[K,V]=G($,"anonymous"),U=T.clipSrc?V:"loaded";(0,e.useImageLoader)(U,T.id+"-clip");const Y=a.default.useMemo(()=>{if(L&&K)return d()},[L,K]);return a.default.useLayoutEffect(()=>{var X;if(!K||!L||!L.width||!L.height||!K||!K.width||!K.height||!Y)return;const Q=d(),te=Math.max(T.width/K.width*z,T.height/K.height*z);Q.width=K.width*te,Q.height=K.height*te,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(K,0,0,Q.width,Q.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(Q,0,0,L.width,L.height),p.default.Util.releaseCanvas(Q),ee.globalCompositeOperation="source-in",ee.drawImage(L,0,0,Y.width,Y.height),ee.restore())},[Y,L,K,T.width,T.height,z,...D]),T.clipSrc&&K?Y:L},M=d(),I=(0,o.observer)(({element:T})=>{const L=Math.min(30,T.width/4,T.height/4),z=a.default.useRef(null);return a.default.useEffect(()=>{const D=z.current;if(!D)return;const $=new p.default.Animation(K=>{D.rotate(((K==null?void 0:K.timeDiff)||0)/2)},D.getLayer());return $.start(),()=>{$.stop()}}),a.default.createElement(u.Group,{x:T.x,y:T.y,rotation:T.rotation,listening:!1,opacity:T.a.opacity,hideInExport:!T.showInExport},a.default.createElement(u.Rect,{width:T.width,height:T.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:z,x:T.width/2,y:T.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),H=(0,o.observer)(({element:T})=>{const L="Can not load the video...",z=Math.max(10,Math.min(30,T.width/25));return a.default.createElement(u.Group,{x:T.x,y:T.y,rotation:T.rotation,listening:!1,opacity:T.a.opacity,hideInExport:!T.showInExport},a.default.createElement(u.Rect,{width:T.width,height:T.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:L,fontSize:z,width:T.width,height:T.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=T=>{G=T};e.setImageLoaderHook=Z;const W=(T,L)=>{const z=a.default.useRef(),D=()=>{var $;($=z.current)===null||$===void 0||$.call(z),z.current=void 0};a.default.useEffect(()=>D,[]),a.default.useLayoutEffect(()=>{T!=="loading"||z.current||(z.current=(0,m.incrementLoader)(`video ${L}`)),T!=="loading"&&D(),T==="failed"&&(0,m.triggerLoadError)(`video ${L}`)},[T])};e.useImageLoader=W;function B(T,L){for(var z=T.buffered,D=0;D<z.length;D++)if(L>=z.start(D)&&L<=z.end(D))return!0;return!1}function F(T,L,z){const D=a.default.useRef("loading"),$=a.default.useRef(),[K,V]=a.default.useState(0),U=a.default.useRef(),Y=a.default.useRef(),X=a.default.useRef();return U.current===T&&Y.current===L&&X.current===z||(D.current="loading",$.current=void 0,U.current=T,Y.current=L,X.current=z),a.default.useLayoutEffect(function(){if(T){var Q=document.createElement("video");return Q.addEventListener("canplay",te),Q.addEventListener("error",ee),Q.crossOrigin=L,Q.src=T,function(){Q.removeEventListener("canplay",te),Q.removeEventListener("error",ee)}}function te(){D.current="loaded",$.current=Q,$.current.currentTime=0,V(Math.random()),$.current.removeEventListener("canplay",te)}function ee(ne){D.current="failed",$.current=void 0,V(Math.random())}},[T,L,z]),[$.current,D.current]}e.VideoElement=(0,o.observer)(({element:T,store:L})=>{var z;const[D,$]=a.default.useState(!1),K=a.default.useRef(null),V=a.default.useRef(null),[U,Y]=a.default.useState(!1),X=L.selectedElements.indexOf(T)>=0,[Q,te]=a.default.useState(!1),[ee,ne]=F(T.src,"anonymous"),ie=L.activePage===T.page;(0,e.useImageLoader)(ne,T.id+"-video"),ee&&(ee.width=ee.videoWidth,ee.height=ee.videoHeight);const oe=ee||M;a.default.useEffect(()=>{ee&&L.history.ignore(()=>{T.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var xe;if(!ee)return;const ze=ie&&(L.isPlaying||Q);if(!ze)return void ee.pause();ze&&(ee.currentTime=T.startTime*ee.duration,ee.play());const tt=new p.default.Animation(()=>{},(xe=K.current)===null||xe===void 0?void 0:xe.getLayer());tt.start();const yt=()=>{te(!1),ee.currentTime=T.startTime*ee.duration},xt=()=>{ee.currentTime>=T.endTime*ee.duration&&(ee.pause(),ee.currentTime=T.startTime*ee.duration,te(!1))};return ee.addEventListener("ended",yt),ee.addEventListener("timeupdate",xt),()=>{tt.stop(),ee.removeEventListener("ended",yt),ee.removeEventListener("timeupdate",xt)}},[ee,Q,L.isPlaying,ie]);const ke=a.default.useRef();a.default.useEffect(()=>{const xe=(0,l.autorun)(()=>{var ze,tt;if(ee){const yt=(L.currentTime-T.page.startTime)%T.duration;(Math.abs(1e3*ee.currentTime-yt)>500||!L.isPlaying)&&(ee.currentTime=yt/1e3,L.isPlaying||ee.currentTime===0||(ke.current=(0,m.incrementLoader)(`video ${T.id}`))),(tt=(ze=K.current)===null||ze===void 0?void 0:ze.getLayer())===null||tt===void 0||tt.batchDraw()}});return()=>{xe(),ke.current&&(ke.current(),ke.current=null)}},[L,ee]),a.default.useEffect(()=>{if(!ee)return;let xe=null;const ze=()=>{var yt,xt;ke.current&&((xt=(yt=K.current)===null||yt===void 0?void 0:yt.getLayer())===null||xt===void 0||xt.batchDraw(),ke.current(),ke.current=null),B(ee,ee.currentTime)||(xe&&(console.error("finish already exists"),xe()),xe=(0,m.incrementLoader)(`video ${T.id}`))},tt=()=>{xe&&(xe(),xe=null)};return ee.addEventListener("timeupdate",ze),ee.addEventListener("canplay",tt),()=>{ee.removeEventListener("timeupdate",ze),ee.removeEventListener("canplay",tt)}},[ee,T.id,m.incrementLoader]);let{cropX:Ie,cropY:le,cropWidth:fe,cropHeight:_e}=T;ne!=="loaded"&&(Ie=le=0,fe=_e=1);const ge=oe.width*fe,re=oe.height*_e,de=T.width/T.height;let ye,Se;const $e=ge/re,Qe=T.type==="svg";Qe?(ye=ge,Se=re):de>=$e?(ye=ge,Se=ge/de):(ye=re*de,Se=re);const Re={x:oe.width*Ie,y:oe.height*le,width:ye,height:Se},Oe=(z=T.cornerRadius)!==null&&z!==void 0?z:0;let Pe=k(T,P(T,oe,Re,L._elementsPixelRatio,Oe,D||T._cropModeEnabled||T.type==="svg"),L._elementsPixelRatio,[Re,Oe,L._elementsPixelRatio]);const He=Math.max(T.width/ye,T.height/Se);a.default.useEffect(()=>{var xe;if(!T._cropModeEnabled)return;const ze=(xe=K.current)===null||xe===void 0?void 0:xe.getStage();function tt(xt){T._cropModeEnabled&&xt.target!==V.current&&T.toggleCropMode(!1)}function yt(xt){T._cropModeEnabled&&xt.target.parentNode!==ze.content&&T.toggleCropMode(!1)}return document.body.addEventListener("click",yt),ze==null||ze.on("click",tt),ze==null||ze.on("tap",tt),()=>{document.body.removeEventListener("click",yt),document.body.removeEventListener("touchstart",yt),ze==null||ze.off("click",tt),ze==null||ze.off("click",tt)}},[T._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(D||T._cropModeEnabled))return(0,g.applyFilter)(K.current,T),(0,l.autorun)(()=>{(0,g.applyFilter)(K.current,T)},{delay:100})},[oe,D,fe,_e,T._cropModeEnabled]),a.default.useLayoutEffect(()=>{var xe;D||T._cropModeEnabled?(xe=K.current)===null||xe===void 0||xe.clearCache():(0,g.applyFilter)(K.current,T)},[D,T.width,T.height,T._cropModeEnabled]),a.default.useEffect(()=>{(0,g.applyFilter)(K.current,T)},[T.shadowEnabled,T.shadowBlur,T.cornerRadius,T.shadowColor,T.shadowOffsetX,T.shadowOffsetY,T.shadowOpacity]);const lt=a.default.useRef(null),ue=a.default.useRef(null),ce=a.default.useRef(null);a.default.useLayoutEffect(()=>{T._cropModeEnabled&&(ue.current.nodes([lt.current]),ce.current.nodes([V.current]))},[T._cropModeEnabled]);const Xe=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 ze=xe.target.width()*xe.target.scaleX(),tt=xe.target.height()*xe.target.scaleY(),yt=Math.min(1,ye/ze),xt=Math.min(1,Se/tt),xr=1-yt,Zr=Math.min(xr,Math.max(0,Math.round(-xe.target.x())/ze)),mr=1-xt,Qr=Math.min(mr,Math.max(0,Math.round(-xe.target.y())/tt));xe.target.setAttrs({x:-Zr*oe.width,y:-Qr*oe.height,scaleX:1,scaleY:1}),T.set({cropX:Zr,cropY:Qr,cropWidth:yt,cropHeight:xt})},be=()=>{T.type!=="svg"&&T.contentEditable&&setTimeout(()=>{T.toggleCropMode(!0)})},Le=ne==="loading",Ae=ne==="failed",we=!Le&&!Ae,Je=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ee=we?T.a.opacity:0;(0,h.useFadeIn)(K,Ee);const We=T.selectable||L.role==="admin",lr=(0,v.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Le&&a.default.createElement(I,{element:T}),Ae&&a.default.createElement(H,{element:T}),a.default.createElement(u.Image,{ref:K,name:"element",id:T.id,image:oe,x:T.x,y:T.y,width:T.width||1,height:T.height||1,rotation:T.rotation,opacity:Ee,shadowEnabled:T.shadowEnabled,shadowBlur:T.shadowBlur,shadowOffsetX:T.shadowOffsetX,shadowOffsetY:T.shadowOffsetY,shadowColor:T.shadowColor,shadowOpacity:T.shadowOpacity,customCrop:Re,listening:We,cropX:Re.x,cropY:Re.y,cropWidth:Re.width,cropHeight:Re.height,draggable:lr?T.draggable&&X:T.draggable,preventDefault:!lr||X,hideInExport:!T.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:xe=>{T.set({x:xe.target.x(),y:xe.target.y()})},onDragEnd:xe=>{T.set({x:xe.target.x(),y:xe.target.y()})},onDblClick:be,onDblTap:be,onTransformStart:()=>{$(!0),Je.current={cropX:T.cropX,cropY:T.cropY,cropWidth:T.cropWidth,cropHeight:T.cropHeight}},onTransform:xe=>{var ze;const tt=xe.currentTarget,yt=Math.abs(tt.scaleX()-1)<1e-7?1:tt.scaleX(),xt=Math.abs(tt.scaleY()-1)<1e-7?1:tt.scaleY();tt.scaleX(1),tt.scaleY(1);const xr=(ze=xe.target.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer"),Zr=1-ye/oe.width,mr=Math.min(Zr,Math.max(0,T.cropX)),Qr=1-Se/oe.height,Qn=Math.min(Qr,Math.max(0,T.cropY)),Rn=xr.getActiveAnchor(),Ne=!(Rn.indexOf("middle")>=0||Rn.indexOf("center")>=0),et=!Ne&&yt<1&&Je.current.cropHeight>Se/oe.height;let ct=Ne?T.cropWidth:T.cropWidth*yt;et&&(ct=T.cropWidth);const Mt=!Ne&&xt<1&&Je.current.cropWidth>ye/oe.width;let Et=Ne?T.cropHeight:T.cropHeight*xt;Mt&&(Et=T.cropHeight),Qe&&(ct=T.cropWidth,Et=T.cropHeight),T.set({cropX:mr,cropY:Qn,x:tt.x(),y:tt.y(),width:tt.width()*yt,height:tt.height()*xt,rotation:xe.target.rotation(),cropWidth:Math.min(ct,1-mr),cropHeight:Math.min(Et,1-Qn)})},onTransformEnd:xe=>{const ze=xe.currentTarget;T.set({width:ze.width(),height:ze.height(),x:ze.x(),y:ze.y(),rotation:xe.target.rotation(),cropWidth:ye/oe.width,cropHeight:Se/oe.height}),$(!1)}}),a.default.createElement(u.Rect,{x:T.x,y:T.y,width:Math.max(T.width-T.borderSize,0),height:Math.max(T.height-T.borderSize,0),opacity:Ee,offsetX:-T.borderSize/2,offsetY:-T.borderSize/2,stroke:T.borderColor,strokeWidth:T.borderSize,listening:!1,visible:!!T.borderSize,rotation:T.rotation,cornerRadius:Math.max(0,Oe-T.borderSize),hideInExport:!T.showInExport}),!Q&&!L.isPlaying&&a.default.createElement(u.Image,{image:R,x:T.x+T.width/2-15/L.scale,y:T.y+T.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!0)}}),Q&&!L.isPlaying&&a.default.createElement(u.Image,{image:C,x:T.x+T.width/2-15/L.scale,y:T.y+T.height/2-15/L.scale,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>{te(!1)}}),T._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:Pe,x:T.x,y:T.y,width:T.width,height:T.height,rotation:T.rotation,shadowEnabled:T.shadowEnabled,shadowBlur:T.shadowBlur}),a.default.createElement(u.Group,{x:T.x,y:T.y,rotation:T.rotation,scaleX:He,scaleY:He},a.default.createElement(u.Image,{image:oe,ref:V,opacity:.4,draggable:!0,x:-T.cropX*oe.width,y:-T.cropY*oe.height,onDragMove:Xe,onTransform:Xe}),a.default.createElement(u.Transformer,{ref:ce,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,ze)=>ze.width<5||ze.height<5?xe:ze,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:ye,height:Se,ref:lt,listening:!1,onTransform:xe=>{xe.target.x()<-T.cropX*oe.width-1e-9&&(xe.target.x(-T.cropX*oe.width),xe.target.scaleX(1)),xe.target.y()<-T.cropY*oe.height-1e-9&&(xe.target.y(-T.cropY*oe.height),xe.target.scaleY(1));const ze=Math.min(1,Math.max(0,T.cropX+xe.target.x()/oe.width)),tt=Math.min(1,Math.max(0,xe.target.y()/oe.height+T.cropY)),yt=xe.target.width()*xe.target.scaleX(),xt=xe.target.height()*xe.target.scaleY(),xr=Math.min(1-ze,yt/oe.width),Zr=Math.min(1-tt,xt/oe.height),mr=xe.target.getAbsolutePosition(xe.target.getParent().getParent());xe.target.scale({x:1,y:1}),xe.target.position({x:0,y:0}),T.set({x:mr.x,y:mr.y,cropX:ze,cropY:tt,cropWidth:xr,cropHeight:Zr,width:Math.min(yt*He,oe.width*(1-ze)*He),height:Math.min(xt*He,oe.height*(1-tt)*He)})}}),a.default.createElement(u.Transformer,{ref:ue,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,ze)=>ze.width<5||ze.height<5?xe:ze,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(U||X)&&a.default.createElement(w.Highlighter,{element:T}))})})(fS);var dS={},Zp={};(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:g,cornerRadius:h})=>{if(h>0){const v=Math.min(h,b/2,g/2);return`M 0 ${v} A ${v} ${v} 0 0 1 ${v} 0 L ${b-v} 0 A ${v} ${v} 0 0 1 ${b} ${v} L ${b} ${g-v} A ${v} ${v} 0 0 1 ${b-v} ${g} L ${v} ${g} A ${v} ${v} 0 0 1 0 ${g-v} Z`}return`M 0 0 L ${b} 0 L ${b} ${g} L 0 ${g} Z`};e.rectData=t;const r=({width:b,height:g})=>`M ${b/2} 0 L ${b} ${g} L 0 ${g} Z`;e.triangleData=r;const n=({width:b,height:g})=>`M 0 0 L ${b} 0 L 0 ${g} Z`;e.rightTriangleData=n;const i=({width:b,height:g})=>`M ${b/2} ${g/2} m -${b/2}, 0 a ${b/2},${g/2} 0 1,0 ${b},0 a ${b/2},${g/2} 0 1,0 -${b},0`;function a({width:b,height:g}){const h=b/2,v=g/2,d=b/2,y=g/2,_=d/2,R=y/2;let C="",x=Math.PI/5;for(let O=0;O<10;O++){const P=O%2==0?y:R,k=h+(O%2==0?d:_)*Math.sin(O*x),M=v-P*Math.cos(O*x);O===0?C=`M ${k} ${M}`:C+=` L ${k} ${M}`}return C+" Z"}function o({width:b,height:g}){const h=b/2,v=g/2;return`M ${h} 0 L ${b} ${v} L ${h} ${g} L 0 ${v} Z`}function l({width:b,height:g}){const h=b/2,v=g/2,d=b/2,y=g/2;let _="",R=2*Math.PI/5;for(let C=0;C<5;C++){const x=y,O=h+d*Math.sin(C*R),P=v-x*Math.cos(C*R);C===0?_=`M ${O} ${P}`:_+=` L ${O} ${P}`}return _+" Z"}function u({width:b,height:g}){const h=b/2,v=g/2,d=b/2,y=g/2;let _="",R=2*Math.PI/6;for(let C=0;C<6;C++){const x=y,O=h+d*Math.sin(C*R),P=v-x*Math.cos(C*R);C===0?_=`M ${O} ${P}`:_+=` L ${O} ${P}`}return _+" Z"}function f({path:b,aspectRatio:g,width:h,height:v}){return{path:b,scaleX:h/g.width,scaleY:v/g.height}}function p({width:b,height:g}){const h=.1*Math.min(b,g),v=.2*b,d=.2*g,y=.5*b;let _=`M ${h},0`;return _+=" H "+(b-h),_+=` A ${h},${h} 0 0 1 ${b},${h}`,_+=" V "+(g-h-d),_+=` A ${h},${h} 0 0 1 ${b-h},${g-d}`,_+=` H ${y+v/2}`,_+=` L ${y},${g}`,_+=` L ${y-v/2},${g-d}`,_+=` H ${h}`,_+=` A ${h},${h} 0 0 1 0,${g-h-d}`,_+=` V ${h}`,_+=` A ${h},${h} 0 0 1 ${h},0`,_+=" Z",_}function E({width:b,height:g}){const h=.3*b,v=.3*g,d=b/2,y=g/2,_=d-h/2,R=d+h/2,C=y-v/2,x=y+v/2;let O=`M ${_},0 `;return O+=`H ${R} `,O+=`V ${C} `,O+=`H ${b} `,O+=`V ${x} `,O+=`H ${R} `,O+=`V ${g} `,O+=`H ${_} `,O+=`V ${x} `,O+="H 0 ",O+=`V ${C} `,O+=`H ${_} `,O+="V 0 ",O+="Z",O}function w(b){return e.TYPES[b]||e.rectData}function m(b,g){const{width:h,height:v,fill:d,stroke:y,strokeWidth:_,dash:R}=b,C=(R||[]).map(M=>M*_);let x=g(b),O=1,P=1;typeof x!="string"&&(O=x.scaleX,P=x.scaleY,x=x.path);const k=`clip-${b.id||Math.random()}`;return`
235
+ <svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${v}">
236
+ <defs>
237
+ <clipPath id="${k}">
238
+ <path d="${x}" />
239
+ </clipPath>
240
+ </defs>
241
+
242
+ <!-- Path for the fill -->
243
+ <path d="${x}" fill="${d}" transform="scale(${O}, ${P})"/>
244
+
245
+ <!-- Path for the stroke, clipped by the star path -->
246
+ <path d="${x}" fill="none" stroke="${y}" stroke-width="${2*_}" clip-path="url(#${k})" transform="scale(${O}, ${P})" stroke-dasharray="${C.join(" ")}"/>
247
+ </svg>
248
+ `}function S(b){const{subType:g}=b,h=w(g);return h?m(b,h):(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=p,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:p,cross:E,arc:({width:b,height:g})=>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:g}),cloud:({width:b,height:g})=>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:g}),rightArrow:({width:b,height:g})=>{const h=.6*b;return`M 0 ${g/4} L ${h} ${g/4} L ${h} 0 L ${b} ${g/2} L ${h} ${g} L ${h} ${.75*g} L 0 ${.75*g} Z`},leftArrow:({width:b,height:g})=>{const h=.4*b;return`M ${b} ${g/4} L ${h} ${g/4} L ${h} 0 L 0 ${g/2} L ${h} ${g} L ${h} ${.75*g} L ${b} ${.75*g} Z`},downArrow:({width:b,height:g})=>{const h=.6*g;return`M ${b/4} 0 L ${b/4} ${h} L 0 ${h} L ${b/2} ${g} L ${b} ${h} L ${.75*b} ${h} L ${.75*b} 0 Z`},upArrow:({width:b,height:g})=>{const h=.4*g;return`M ${b/4} ${g} L ${b/4} ${h} L 0 ${h} L ${b/2} 0 L ${b} ${h} L ${.75*b} ${h} L ${.75*b} ${g} Z`},asterisk1:({width:b,height:g})=>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:g}),asterisk2:({width:b,height:g})=>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:g}),bookmark:({width:b,height:g})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:b,height:g}),butterfly:({width:b,height:g})=>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:g}),cylinder:({width:b,height:g})=>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:g}),diamond2:({width:b,height:g})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:b,height:g}),door:({width:b,height:g})=>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:g}),drop1:({width:b,height:g})=>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:g}),drop2:({width:b,height:g})=>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:g}),explosion:({width:b,height:g})=>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:g}),flag:({width:b,height:g})=>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:g}),flower:({width:b,height:g})=>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:g}),frame:({width:b,height:g})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:b,height:g}),heart1:({width:b,height:g})=>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:g}),home:({width:b,height:g})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:b,height:g}),home2:({width:b,height:g})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:b,height:g}),hourglass:({width:b,height:g})=>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:g}),house:({width:b,height:g})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:b,height:g}),keyhole:({width:b,height:g})=>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:g}),kiss:({width:b,height:g})=>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:g}),leaf:({width:b,height:g})=>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:g}),lightning1:({width:b,height:g})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:b,height:g}),lightning2:({width:b,height:g})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:b,height:g}),magnet:({width:b,height:g})=>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:g}),mithosis:({width:b,height:g})=>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:g}),orangeRicky:({width:b,height:g})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:b,height:g}),party:({width:b,height:g})=>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:g}),pillow:({width:b,height:g})=>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:g}),polygon:({width:b,height:g})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:b,height:g}),rainbow:({width:b,height:g})=>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:g}),rhodeIsland:({width:b,height:g})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:b,height:g}),shell:({width:b,height:g})=>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:g}),shield1:({width:b,height:g})=>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:g}),shield2:({width:b,height:g})=>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:g}),skewedRectangle:({width:b,height:g})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:b,height:g}),softFlower:({width:b,height:g})=>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:g}),softStar:({width:b,height:g})=>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:g}),stairs1:({width:b,height:g})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:b,height:g}),stairs2:({width:b,height:g})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:b,height:g}),teewee:({width:b,height:g})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:b,height:g}),blob1:({width:b,height:g})=>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:g}),blob10:({width:b,height:g})=>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:g}),blob11:({width:b,height:g})=>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:g}),blob12:({width:b,height:g})=>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:g}),blob13:({width:b,height:g})=>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:g}),blob14:({width:b,height:g})=>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:g}),blob15:({width:b,height:g})=>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:g}),blob16:({width:b,height:g})=>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:g}),blob17:({width:b,height:g})=>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:g}),blob18:({width:b,height:g})=>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:g}),blob19:({width:b,height:g})=>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:g}),blob2:({width:b,height:g})=>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:g}),blob20:({width:b,height:g})=>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:g}),blob21:({width:b,height:g})=>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:g}),blob22:({width:b,height:g})=>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:g}),blob23:({width:b,height:g})=>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:g}),blob24:({width:b,height:g})=>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:g}),blob25:({width:b,height:g})=>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:g}),blob26:({width:b,height:g})=>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:g}),blob27:({width:b,height:g})=>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:g}),blob28:({width:b,height:g})=>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:g}),blob29:({width:b,height:g})=>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:g}),blob3:({width:b,height:g})=>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:g}),blob30:({width:b,height:g})=>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:g}),blob31:({width:b,height:g})=>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:g}),blob32:({width:b,height:g})=>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:g}),blob4:({width:b,height:g})=>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:g}),blob5:({width:b,height:g})=>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:g}),blob6:({width:b,height:g})=>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:g}),blob7:({width:b,height:g})=>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:g}),blob8:({width:b,height:g})=>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:g}),blob9:({width:b,height:g})=>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:g})},e.subTypeToPathDataFunc=w,e.figureToSvg=S})(Zp);(function(e){var t=me&&me.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(Ze),n=_i,i=Ca,a=Zp,o=Pl,l=Po,u=Wc,f={};e.FigureElement=(0,n.observer)(({element:p,store:E})=>{const w=p.selectable||E.role==="admin",m=(0,l.isTouchDevice)(),[S,b]=r.default.useState(!1),g=E.selectedElements.indexOf(p)>=0&&E.selectedElements.length===1,h=Math.min(p.strokeWidth,p.width/2,p.height/2),v=Math.max(0,Math.min(p.width/2,p.height/2,p.cornerRadius)),d=(0,u.useColor)(p,p.a.fill,"fill"),y=Object.assign(Object.assign({width:p.a.width,height:p.a.height},d),{cornerRadius:v,opacity:p.animated("opacity"),shadowEnabled:p.shadowEnabled,shadowBlur:p.shadowBlur,shadowOffsetX:p.shadowOffsetX,shadowOffsetY:p.shadowOffsetY,shadowColor:p.shadowColor,shadowOpacity:p.shadowOpacity,preventDefault:!m||g,hideInExport:!p.showInExport}),_=(0,u.useColor)(p,p.stroke,"stroke"),R=Object.assign(Object.assign({visible:h>0,x:h/2,y:h/2,width:p.a.width-h,height:p.a.height-h},_),{strokeWidth:h,cornerRadius:Math.max(0,v-h),dash:p.dash.map(P=>P*h),opacity:p.animated("opacity"),hideInExport:!p.showInExport,listening:!1}),C=(x=p.subType,f[x]||(f[x]=(O=(0,a.subTypeToPathDataFunc)(x),(0,n.observer)(({element:P,fillProps:k,strokeProps:M})=>{let I=O({width:P.a.width,height:P.a.height,cornerRadius:P.cornerRadius}),H=1,G=1;typeof I!="string"&&(H=I.scaleX,G=I.scaleY,I=I.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:P.width,height:P.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},k,{ref:Z,data:I,scaleX:H,scaleY:G})),r.default.createElement(i.Group,{clipFunc:W=>{const B=Z.current;if(B){var F=B.dataArray;W.beginPath();for(var T=0;T<F.length;T++){var L=F[T].command,z=F[T].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 D=z[0],$=z[1],K=z[2],V=z[3],U=z[4],Y=z[5],X=z[6],Q=z[7],te=K>V?K:V,ee=K>V?1:K/V,ne=K>V?V/K:1;W.translate(D,$),W.rotate(X),W.scale(ee,ne),W.arc(0,0,te,U,U+Y,1-Q),W.scale(1/ee,1/ne),W.rotate(-X),W.translate(-D,-$);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[x]||i.Group);var x,O;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:p.id,x:p.a.x,y:p.a.y,rotation:p.a.rotation,opacity:p.a.opacity,listening:w,draggable:m?p.draggable&&g:p.draggable,name:"element",onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},onDragMove:P=>{p.set({x:P.target.x(),y:P.target.y()})},onDragEnd:P=>{p.set({x:P.target.x(),y:P.target.y()})},onTransform:P=>{const k=P.target.scale();P.target.scaleX(1),P.target.scaleY(1),p.set({width:p.width*k.x,height:p.height*k.y,x:P.target.x(),y:P.target.y(),rotation:P.target.rotation()})}},r.default.createElement(C,{element:p,fillProps:y,strokeProps:R})),S&&!g&&r.default.createElement(o.Highlighter,{element:p}))})})(dS);(function(e){var t=me&&me.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(Ze),n=_i,i=Zy,a=d2,o=nS,l=cS,u=fS,f=dS,p=Ca,E=Yn,w=(0,n.observer)(g=>{const{element:h,store:v}=g,{children:d}=h,y=h.selectable||v.role==="admin";return r.default.createElement(p.Group,{opacity:h.opacity,listening:y,hideInExport:!h.showInExport},d.map(_=>r.default.createElement(b,Object.assign({},g,{key:_.id,store:v,element:_}))))}),m={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:w};function S(g,h){m[g]=h}e.registerShapeComponent=S;const b=(0,n.observer)(g=>{let h=m[g.element.type];return g.element.type==="text"&&E.flags.htmlRenderEnabled&&(h=o.HTMLElement),g.element.visible?h?r.default.createElement(h,Object.assign({},g)):(console.error("Can not find component for "+g.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,y)=>{n[d]||(n[d]=!0,console.error(y))},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:y=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${y}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:y=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${y}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:y=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${y}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:y=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${y}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:y=1,sizeQuery:_})=>`${(0,e.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${y}&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/${y=d,_=" ",R="-",y.replace(new RegExp(_,"g"),R)}.png`;var y,_,R};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 p=d=>e.URLS.templateList(d);e.templateList=p;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 m=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=m;const S=d=>e.URLS.svgapiList(d);e.svgapiList=S;const b=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=b;const g=d=>e.URLS.iconscoutList(d);e.iconscoutList=g;const h=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=h;const v=(d,y)=>{e.URLS[d]=y};e.setAPI=v}(Gg)),Gg}var S_;function S2(){return S_||(S_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(R,C,x,O){O===void 0&&(O=x);var P=Object.getOwnPropertyDescriptor(C,x);P&&!("get"in P?!C.__esModule:P.writable||P.configurable)||(P={enumerable:!0,get:function(){return C[x]}}),Object.defineProperty(R,O,P)}:function(R,C,x,O){O===void 0&&(O=x),R[O]=C[x]}),r=me&&me.__setModuleDefault||(Object.create?function(R,C){Object.defineProperty(R,"default",{enumerable:!0,value:C})}:function(R,C){R.default=C}),n=me&&me.__importStar||function(R){if(R&&R.__esModule)return R;var C={};if(R!=null)for(var x in R)x!=="default"&&Object.prototype.hasOwnProperty.call(R,x)&&t(C,R,x);return r(C,R),C};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Ki),a=sj(),o=Yn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const p=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",m="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 g=window.location.origin;const h=navigator.userAgent.indexOf("Headless")>-1,v=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&h&&(g="headless"),g==="file://"&&v&&(g="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;async function y(R){for(let C=0;C<p;C++)try{const x=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host})});if(!R)return console.warn(w),!1;if(x.status!==200){await new Promise(P=>setTimeout(P,E));continue}const O=await x.json();return O.is_valid||console.warn(m),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 _(R,C){u=R,await y(R)&&!C||l()}e.isKeyPaid=y,e.validateKey=_}($g)),$g}var Qp={};(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})(Qp);(function(e){var t=me&&me.__rest||function(B,F){var T={};for(var L in B)Object.prototype.hasOwnProperty.call(B,L)&&F.indexOf(L)<0&&(T[L]=B[L]);if(B!=null&&typeof Object.getOwnPropertySymbols=="function"){var z=0;for(L=Object.getOwnPropertySymbols(B);z<L.length;z++)F.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(B,L[z])&&(T[L[z]]=B[L[z]])}return T},r=me&&me.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(Ze),i=_i,a=Ki,o=Ca,l=r(qp),u=r(Si),f=r(W9),p=w2,E=d2,w=hS,m=S2(),S=eu,b=Qp,g=Yn,h=Po,v=u.default.DD._drag;window.removeEventListener("mousemove",v),u.default.DD._drag=function(B){(0,a.runInAction)(()=>{v.call(this,B)})},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 y=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:B=>{B.hasName("rotater")&&B.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:y,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},R=B=>{Object.assign(_,B)};e.setTransformerStyle=R;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 x(B,F){C[B]=C[B]||F,Object.assign(C[B],F)}e.registerTransformerAttrs=x;const O=B=>n.default.createElement(o.Rect,Object.assign({},B,{preventDefault:!1})),P=B=>{var{url:F}=B,T=t(B,["url"]);const[L,z]=(0,l.default)(F,"anonymous"),D=L?(0,w.getCrop)(L,{width:T.width,height:T.height},"center-middle"):{};return(0,E.useImageLoader)(z,"background"),n.default.createElement(o.Image,Object.assign({image:L},T,D))},k=B=>n.default.createElement(o.Rect,Object.assign({},B)),M=B=>{const{background:F,scale:T,borderColor:L}=B,z=t(B,["background","scale","borderColor"]),D=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(F),[F]),$=n.default.useMemo(()=>{const K=document.createElement("canvas"),V=30;K.width=60,K.height=60;const U=K.getContext("2d");return U&&(U.fillStyle="black",U.fillRect(V,0,V,V),U.fillRect(0,V,V,V)),K},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:$},z,{opacity:.1,hideInExport:!0})),D?n.default.createElement(k,Object.assign({fill:F},z)):n.default.createElement(P,Object.assign({url:F},z)))},I=(0,i.observer)(({selection:B})=>B.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(B.x1,B.x2),y:Math.min(B.y1,B.y2),width:Math.abs(B.x1-B.x2),height:Math.abs(B.y1-B.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),H=(0,i.observer)(({x:B,y:F,width:T,height:L,rotation:z,anchor:D,store:$})=>{const K=(0,S.getClientRect)({x:B,y:F,width:T,height:L,rotation:u.default.Util.radToDeg(z)});if(D===void 0)return null;const V=(L/2+70)*Math.cos(z-Math.PI/2),U=(L/2+70)*Math.sin(z-Math.PI/2),Y=(0,b.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:T/$.scale,precious:$.unit==="px"?0:1})+" x "+(0,b.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:L/$.scale,precious:$.unit==="px"?0:1})+($.unit==="px"?"":" "+$.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(K.minX+K.maxX)/2+V,y:(K.minY+K.maxY)/2+U,offsetX:14,offsetY:14,visible:D==="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:(K.minX+K.maxX)/2,y:K.maxY+20,visible:D!=="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:B,store:F})=>{const T=B.filter(z=>z.alwaysOnTop),L=B.filter(z=>!z.alwaysOnTop).concat(T);return n.default.createElement(n.default.Fragment,null,L.map(z=>n.default.createElement(f.default,{key:z.id,store:F,element:z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const W=B=>{Z=B};e.registerNextDomDrop=W,e.default=(0,i.observer)(({store:B,page:F,width:T,height:L,pageControlsEnabled:z,backColor:D,pageBorderColor:$,activePageBorderColor:K,components:V,bleedColor:U,altCloneEnabled:Y})=>{const X=B.bleedVisible?F.bleed:0,Q=F.computedWidth+2*X,te=F.computedHeight+2*X,ee=(T-Q*B.scale)/2,ne=(L-te*B.scale)/2,ie=n.default.useRef(null),oe=n.default.useRef(null),ke=n.default.useRef(null),Ie=z==null||z,[le,fe]=n.default.useState(null),[_e,ge]=n.default.useState({}),re=B.selectedElements.find(be=>be._cropModeEnabled),de=B.selectedShapes.filter(be=>!be.resizable).length>0,ye=B.selectedShapes.filter(be=>!be.draggable).length>0,Se=B.selectedElements.filter(be=>!be.visible).length>0;n.default.useLayoutEffect(()=>{var be,Le,Ae;if(!ie.current)return;const we=ie.current.getStage(),Je=B.selectedShapes.map(We=>We._cropModeEnabled?null:we.findOne("#"+We.id)).filter(We=>We),Ee=B.selectedElements.length===1&&((be=B.selectedElements[0])===null||be===void 0?void 0:be.type)||"many";C[Ee]?(ie.current.setAttrs(Object.assign(Object.assign({},_),C[Ee])),Ee!=="svg"&&Ee!=="image"||B.selectedElements[0].keepRatio||ie.current.setAttrs({enabledAnchors:_.enabledAnchors}),Ee==="text"&&g.flags.textVerticalResizeEnabled&&ie.current.setAttrs({enabledAnchors:(Le=C.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])})):ie.current.setAttrs(_),de&&ie.current.enabledAnchors([]),ye&&ie.current.rotateEnabled(!1),Je.find(We=>We==null?void 0:We.isDragging())&&Je.forEach(We=>{We.isDragging()||We==null||We.startDrag()}),ie.current.nodes(Je),(Ae=ie.current.getLayer())===null||Ae===void 0||Ae.batchDraw()},[B.selectedElements,re,de,Se,ye]);const $e=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Qe=n.default.useRef(!1),Re=(0,h.isTouchDevice)(),Oe=(0,a.action)(be=>{var Le,Ae;if(Re)return;Qe.current=!1;const we=be.target.findAncestor(".elements-container"),Je=be.target.findAncestor("Transformer"),Ee=be.target.findAncestor(".page-abs-container");if(we||Je||Ee)return;const We=(Le=be.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();We&&($e.visible=!0,$e.x1=We.x,$e.y1=We.y,$e.x2=We.x,$e.y2=We.y,((Ae=be.target.getStage())===null||Ae===void 0?void 0:Ae.getPointersPositions().length)>=2&&($e.visible=!1))});n.default.useEffect(()=>{const be=(0,a.action)(Ae=>{var we,Je;if(!$e.visible)return;(we=oe.current)===null||we===void 0||we.setPointersPositions(Ae);let Ee=((Je=oe.current)===null||Je===void 0?void 0:Je.getPointerPosition())||{x:$e.x2,y:$e.y2};$e.x2=Ee.x,$e.y2=Ee.y}),Le=(0,a.action)(()=>{if(!$e.visible||!oe.current)return;const Ae=oe.current.findOne(".selection"),we=Ae?Ae.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const Je=[];oe.current.find(".element").forEach(We=>{const lr=We.getClientRect(),xe=B.getElementById(We.id()),ze=xe==null?void 0:xe.draggable,tt=xe==null?void 0:xe.selectable;u.default.Util.haveIntersection(we,lr)&&ze&&tt&&Je.push(xe.top.id)});const Ee=[...new Set(Je)];B.selectElements(Ee)}$e.visible=!1,Qe.current=!0});return window.addEventListener("mousemove",be),window.addEventListener("touchmove",be),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",be),window.removeEventListener("touchmove",be),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const Pe=be=>{if(B.activePage!==F&&F.select(),Qe.current)return;const Le=be.evt.ctrlKey||be.evt.metaKey||be.evt.shiftKey,Ae=be.target.findAncestor(".elements-container"),we=be.target.findAncestor(".page-abs-container"),Je=be.target.findAncestor("Transformer");if(!(Le||Ae||Je||we))return void B.selectElements([]);const Ee=be.target.findAncestor(".element",!0),We=B.getElementById(Ee==null?void 0:Ee.id()),lr=We==null?void 0:We.top,xe=lr==null?void 0:lr.id,ze=B.selectedElementsIds.indexOf(xe)>=0;xe&&Le&&!ze?B.selectElements(B.selectedElementsIds.concat([xe])):xe&&Le&&ze?B.selectElements(B.selectedElementsIds.filter(tt=>tt!==xe)):!xe||Le||ze||B.selectElements([xe])};(0,p.useSnap)(ie,B);const He=B.activePage===F,lt=V==null?void 0:V.PageControls,ue=V==null?void 0:V.Tooltip,ce=1/B.scale,Xe=0/B.scale;return n.default.createElement("div",{ref:ke,onDragOver:be=>be.preventDefault(),onDrop:be=>{if(be.preventDefault(),!oe.current)return;oe.current.setPointersPositions(be);const Le=oe.current.findOne(".elements-container").getRelativePointerPosition(),Ae=oe.current.getPointerPosition(),we=oe.current.getAllIntersections(Ae).map(We=>We.findAncestor(".element",!0)).filter(Boolean),Je=[...new Set(we.reverse())].map(We=>B.getElementById(We.id())),Ee=Je[0];Z&&(Z(Le,Ee,{elements:Je,page:F}),Z=null)},style:{position:"relative",width:T+"px"},className:"polotno-page-container"+(He?" active-page":"")},n.default.createElement(o.Stage,{ref:oe,width:Math.min(T,4*window.innerWidth),height:Math.min(L,4*window.innerHeight),onClick:Pe,onTap:Pe,onMouseDown:Oe,onMouseMove:be=>{if(!be.evt.altKey&&le)return void fe(null);if(!be.evt.altKey)return;const Le=be.target.findAncestor(".element",!0),Ae=Le==null?void 0:Le.id();if(!B.selectedElements[0]||B.selectedElementsIds.includes(Ae))return;const we=(0,S.getTotalClientRect)(B.selectedShapes),Je=Ae?B.getElementById(Ae):{x:0,y:0,width:F.computedWidth,height:F.computedHeight,rotation:0},Ee=(0,S.getClientRect)(Je),We=[];we.minX>Ee.maxX&&We.push({distance:we.minX-Ee.maxX,box1:we,box2:Ee,points:[{x:we.minX,y:we.minY+we.height/2},{x:Ee.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:Ee.minY+Ee.height/2}]}),we.maxX<Ee.minX&&We.push({distance:Ee.minX-we.maxX,box1:we,box2:Ee,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Ee.minX,y:we.minY+we.height/2},{x:Ee.minX,y:Ee.minY+Ee.height/2}]}),we.minY>Ee.maxY&&We.push({box1:we,box2:Ee,distance:we.minY-Ee.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Ee.maxY}]}),we.maxY<Ee.minY&&We.push({box1:we,box2:Ee,distance:Ee.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Ee.minY}]}),we.minX>=Ee.minX&&we.maxX<=Ee.maxX&&we.minY>=Ee.minY&&we.maxY<=Ee.maxY&&(We.push({distance:we.minX-Ee.minX,box1:we,box2:Ee,points:[{x:we.minX,y:we.minY+we.height/2},{x:Ee.minX,y:we.minY+we.height/2},{x:Ee.minX,y:Ee.minY+Ee.height/2}]}),We.push({distance:Ee.maxX-we.maxX,box1:we,box2:Ee,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:we.minY+we.height/2},{x:Ee.maxX,y:Ee.minY+Ee.height/2}]}),We.push({box1:we,box2:Ee,distance:we.minY-Ee.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Ee.minY}]}),We.push({box1:we,box2:Ee,distance:Ee.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Ee.maxY}]})),JSON.stringify(le)!==JSON.stringify(We)&&fe(We)},onDragStart:be=>{var Le;const Ae=be.target.findAncestor(".element",!0);if(Ae){const we=B.getElementById(Ae==null?void 0:Ae.id()),Je=we==null?void 0:we.top,Ee=Je==null?void 0:Je.id;!(B.selectedElementsIds.indexOf(Ee)>=0)&&Ee&&(B.selectElements([Ee]),be.target.stopDrag(),be.target.startDrag(be),(Le=ie.current)===null||Le===void 0||Le.startDrag(be))}le&&fe(null)},pageId:F.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:T,height:L,fill:D}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:B.scale,scaleY:B.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:-F.bleed,y:-F.bleed,width:F.computedWidth+2*F.bleed,height:F.computedHeight+2*F.bleed,background:F.background,name:"page-background",preventDefault:!1,scale:B.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!B.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:F.computedWidth,height:F.computedHeight,listening:!1}),n.default.createElement(G,{elements:F.children,store:B})),n.default.createElement(o.Rect,{stroke:U,name:"bleed",strokeWidth:F.bleed,x:F.bleed/2,y:F.bleed/2,width:F.computedWidth+F.bleed,height:F.computedHeight+F.bleed,listening:!1,visible:F.bleed>0&&B.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,T,0,T,L,0,L,0,0,ee,ne,ee,L-ne,T-ee,L-ne,T-ee,ne,ee,ne],listening:!1,closed:!0,fill:D}),n.default.createElement(o.Group,{x:ee,y:ne,scaleX:B.scale,scaleY:B.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-ce/2-Xe,y:-ce/2-Xe,width:Q+ce+2*Xe,height:te+ce+2*Xe,stroke:He&&B.pages.length>1?K:$,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ee+X*B.scale,y:ne+X*B.scale,scaleX:B.scale,scaleY:B.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ie,onDragStart:be=>{var Le;!((Le=be.evt)===null||Le===void 0)&&Le.altKey&&Y&&B.selectedElements.forEach(Ae=>{const we=Ae.clone({},{skipSelect:!0}),Je=F.children.indexOf(Ae);F.setElementZIndex(we.id,Je)}),B.history.startTransaction()},onDragEnd:()=>{B.history.endTransaction()},onTransformStart:()=>{B.history.startTransaction()},boundBoxFunc:(be,Le)=>{const Ae=Math.abs(Le.width)<1||Math.abs(Le.height)<1,we=Math.abs(be.width)<1||Math.abs(be.height)<1;return Ae&&!we?be:Le},onTransform:be=>{var Le,Ae;const we=ie.current.nodes(),Je=we[we.length-1];if(be.target!==Je)return;const Ee=(Le=ie.current)===null||Le===void 0?void 0:Le.__getNodeRect(),We=(Ae=ie.current)===null||Ae===void 0?void 0:Ae.getActiveAnchor();ge({anchor:We,x:Ee.x,y:Ee.y,rotation:Ee.rotation,width:Ee.width,height:Ee.height})},onTransformEnd:be=>{ge({}),B.history.endTransaction()},visible:!B.isPlaying}),le&&le.map(({points:be,distance:Le,box1:Ae,box2:we},Je)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Je,listening:!1},n.default.createElement(o.Rect,Object.assign({},Ae,{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:[be[0].x,be[0].y,be[1].x,be[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[be[1].x,be[1].y,be[2].x,be[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(be[0].x+be[1].x)/2,y:(be[0].y+be[1].y)/2,offsetY:-10,scaleX:1/B.scale,scaleY:1/B.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:B.unit,dpi:B.dpi,px:Le})})))),F._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:te,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:te,align:"center",verticalAlign:"middle"})),ue&&n.default.createElement(ue,{components:V,store:B,page:F,stageRef:oe})),n.default.createElement(H,Object.assign({},_e,{store:B})),n.default.createElement(I,{selection:$e}),m.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:T-170,y:L-18,onMouseEnter:be=>{be.target.getStage().container().style.cursor="pointer"},onMouseLeave:be=>{be.target.getStage().container().style.cursor=""},onTouchStart:be=>{be.cancelBubble=!0},onMouseDown:be=>{be.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Ie&&He&&lt&&n.default.createElement(lt,{store:B,page:F,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(Ze),n=eu,i=Qp,a=_i,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
+ `,p=(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 m(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:S,width:b,height:g})=>{const h=r.default.useRef(null);if(!S.activePage)return null;const v=S.activePage,d=(S.bleedVisible&&v.bleed,v.computedWidth*S.scale),y=v.computedHeight*S.scale,_=(b-d)/2,R=(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 x=(0,i.unitToPx)({unitVal:R,dpi:S.dpi,unit:S.unit})*S.scale,O=Math.round(d/x)+1,P=Math.round(y/x)+1,k=(0,n.getTotalClientRect)(S.selectedShapes);return r.default.createElement(l,{ref:h,className:"polotno-rulers"},r.default.createElement(u,{style:{width:b+"px"},className:"polotno-x-ruler"},[...Array(O)].map((M,I)=>r.default.createElement(p,{key:I,style:{left:_+I*x+"px",width:x+"px"}},S.unit==="px"||R>=1?Math.round(R*I):(R*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,Z=(g-G)/2;return r.default.createElement(f,{key:M.id,style:{height:g+"px"},className:"polotno-y-ruler"},[...Array(P)].map((W,B)=>r.default.createElement(E,{key:B,style:{top:Z+B*x-14+"px",width:x+"px"}},S.unit==="px"||R>=1?Math.round(R*B):(R*B).toFixed(1))),((H=S.selectedShapes[0])===null||H===void 0?void 0:H.page)===M&&r.default.createElement("div",{style:{position:"absolute",top:Z+k.y*S.scale-14+"px",width:"14px",height:k.height*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=m})(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"})),Jp=po(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=Ei,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 p=()=>f>0;function E(){const m=(0,t.getSnapshot)(i);return{pages:m.pages,width:m.width,height:m.height,custom:m.custom}}function w(m){const S=i.pages.map(g=>g.id),b=m.pages.map(g=>g.id);(0,r.deepEqual)(S,b)?i.pages.forEach((g,h)=>{(0,t.applySnapshot)(g,m.pages[h])}):(0,t.applySnapshot)(i.pages,m.pages),i.setSize(m.width,m.height)}return{startTransaction(){f++},endTransaction(m){f--,m||this.requestAddState(E())},async ignore(m,S=!1,b=!1){b&&await new Promise(y=>setTimeout(y,10)),u&&n.addUndoState();let g=p();n.startTransaction();let h=f;try{await m()}catch(y){setTimeout(()=>{throw y})}const v=h!==f,d=!v;n.endTransaction(d),S||g||n.replaceState(),v||(clearTimeout(u),u=0)},async transaction(m){await n.ignore(m,!0),this.addUndoState()},requestAddState(m){l=m,u||p()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),p()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const m=n.history[n.undoIdx];!(0,r.deepEqual)(l,m)&&(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={},xc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Qs;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=p=>{u(p)},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 p=document.createElement("canvas");p.width=l.width,p.height=l.height;const E=p.getContext("2d");let{cropX:w,cropY:m}=l;const S=f.width*l.cropWidth,b=f.height*l.cropHeight,g=l.width/l.height;let h,v;const d=S/b;return l.type==="svg"?(h=S,v=b):g>=d?(h=S,v=S/g):(h=b*g,v=b),E.drawImage(f,w*f.width,m*f.height,h,v,0,0,p.width,p.height),p.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,p=u/f;let E,w;p>=l.width/l.height?(E=l.width,w=l.width/p):(E=l.height*p,w=l.height);const m=(l.width-E)/2,S=(l.height-w)/2;return{cropX:m/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})(xc);(function(e){var t=me&&me.__createBinding||(Object.create?function(O,P,k,M){M===void 0&&(M=k);var I=Object.getOwnPropertyDescriptor(P,k);I&&!("get"in I?!P.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return P[k]}}),Object.defineProperty(O,M,I)}:function(O,P,k,M){M===void 0&&(M=k),O[M]=P[k]}),r=me&&me.__setModuleDefault||(Object.create?function(O,P){Object.defineProperty(O,"default",{enumerable:!0,value:P})}:function(O,P){O.default=P}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var P={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&t(P,O,k);return r(P,O),P},i=me&&me.__rest||function(O,P){var k={};for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&P.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++)P.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=xc,o=n(Qs),l=xc,u=Zp,f=p2,p=(O,P,...k)=>({type:O,props:P,children:k||[]});function E(O){var P=new DOMParser().parseFromString(O,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=E;const w=async({element:O,page:P,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),Z=G.width*O.cropWidth,W=G.height*O.cropHeight,B=O.width/O.height;let F,T;const L=Z/W;O.type==="svg"?(F=Z,T=W):B>=L?(F=Z,T=Z/B):(F=W*B,T=W);const z=F/G.width,D=T/G.height,$=F/T>O.width/O.height?O.height/T:O.width/F,K=F*$/z,V=T*$/D,U=O.cropX*$*G.width,Y=O.cropY*$*G.height;return p("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(K)}px ${Math.round(V)}px`,"background-position-x":-Math.round(U)+"px","background-position-y":-Math.round(Y)+"px"})})},m=async({element:O,page:P,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=p("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),Z=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,B=G?{id:W}:{},F=`<style>#${W} {${f.resetStyleContent}}</style>`,T=p("div",Object.assign(Object.assign({style:Z},B),{innerHTML:G?`${F}${O.text}`:O.text.split(`
292
+ `).join("<br />")}));return p("div",{style:{position:"relative",width:"100%",height:"100%"}},H,T)},S=({element:O,type:P})=>{const k={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return P==="arrow"||P==="triangle"?p("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},k)):P==="bar"?p("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},k)):P==="circle"?p("circle",Object.assign({r:O.height},k)):P==="square"?p("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:P,store:k})=>p("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},p("rect",{x:0,y:0,width:O.width,height:O.height,fill:O.color}),p("g",{transform:`translate(0 ${O.height/2})`},S({element:O,type:O.startHead})),p("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},S({element:O,type:O.endHead}))),g=async({element:O,page:P,store:k,elementHook:M})=>{const I=await Promise.all(O.children.map(G=>d({element:G,page:P,store:k,elementHook:M}))),H=p("div",{style:{"transform-origin":"top left",opacity:O.opacity}},...I);return M&&M({dom:H,element:O})||H},h=async({element:O,page:P,store:k,elementHook:M})=>{const I=(0,u.figureToSvg)(O),H=p("div",{innerHTML:I});return M&&M({dom:H,element:O})||H},v={image:w,svg:w,text:m,line:b,figure:h,group:g};async function d({element:O,page:P,store:k,elementHook:M}){let I=await v[O.type];I||(I=()=>p("div",{}),console.error(`HTML export does not support ${O.type} type...`));const H=await I({element:O,page:P,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 Z=p("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:Z,element:O})||Z}async function y({page:O,store:P,elementHook:k}){const M=await Promise.all(O.children.map(Z=>d({element:Z,page:O,store:P,elementHook:k}))),I=O.width==="auto"?P.width:O.width,H=O.height==="auto"?P.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:Z,height:W}=await(0,l.loadImage)(O.background),B=await w({element:Object.assign({x:0,y:0,width:Z,height:W,src:O.background,cornerRadius:0},(0,a.getCrop)({width:Z,height:W},{width:Z,height:W})),page:O,store:P});M.unshift(B)}else G=Object.assign(Object.assign({},G),{"background-color":O.background});return p("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:P}){const k=await Promise.all(O.pages.map(H=>y({page:H,store:O,elementHook:P}))),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)?p("style",{},""):p("link",{href:`https://fonts.googleapis.com/css?family=${H}`,rel:"stylesheet"}));return p("div",{className:"design"},...I,...k)}e.jsonToDOM=_;const R=(O,P)=>typeof P=="object"?`${O}="${Object.keys(P).map(k=>`${k}:${P[k]};`).join(" ")}"`:`${O}="${P}"`,C=({dom:O})=>{if(typeof O=="string")return O;if(!O)return"";const P=O.props,{innerHTML:k}=P,M=i(P,["innerHTML"]);return`<${O.type} ${Object.keys(M).map(I=>R(I,O.props[I])).join(" ")}>${k||O.children.map(I=>C({dom:I})).join("")}</${O.type}>`};async function x({json:O,elementHook:P}){const k=await _({json:O,elementHook:P});return C({dom:k})}e.jsonToHTML=x})(ES);var OS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(O,P,k,M){M===void 0&&(M=k);var I=Object.getOwnPropertyDescriptor(P,k);I&&!("get"in I?!P.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return P[k]}}),Object.defineProperty(O,M,I)}:function(O,P,k,M){M===void 0&&(M=k),O[M]=P[k]}),r=me&&me.__setModuleDefault||(Object.create?function(O,P){Object.defineProperty(O,"default",{enumerable:!0,value:P})}:function(O,P){O.default=P}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var P={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&t(P,O,k);return r(P,O),P},i=me&&me.__rest||function(O,P){var k={};for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&P.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++)P.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=xc,o=n(Qs),l=xc,u=Zp,f=(O,P,...k)=>({type:O,props:P,children:k||[]});function p(O){var P=new DOMParser().parseFromString(O,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=p;const E=async({element:O,page:P,store:k})=>{let{src:M}=O;if(O.type==="svg"){const Q=await o.urlToString(M);M=o.replaceColors(Q,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,Z=H.height*O.cropHeight,W=O.width/O.height;let B,F;const T=G/Z;O.type==="svg"?(B=G,F=Z):W>=T?(B=G,F=G/W):(B=Z*W,F=Z);const L=B/H.width,z=F/H.height,D=B/F>O.width/O.height?O.height/F:O.width/B,$=B*D/L,K=F*D/z,V=O.cropX*H.width*D,U=O.cropY*H.height*D,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:-V,y:-U,width:$,height:K,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},w=async({element:O,page:P,store:k})=>{const M=(W,B,F,T,L)=>{const z=document.createElement("canvas").getContext("2d");return z.font=`${L} ${T} ${B}px ${F}`,z.measureText(W).width},I=((W,B,F,T,L,z)=>{const D=[];return W.split(`
293
+ `).forEach($=>{const K=$.split(" ");let V="";for(let U=0;U<K.length;U++){const Y=V+K[U]+" ";M(Y,F,T,L,z)>B&&U>0?(D.push(V.trim()),V=K[U]+" "):V=Y}D.push(V.trim())}),D})(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",Z=I.map((W,B)=>f("tspan",{x:O.align==="center"?O.width/2:O.align==="right"?O.width:0,dy:B===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},...Z))},m=({element:O,type:P})=>{const k={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},k)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},k)):P==="circle"?f("circle",Object.assign({r:O.height},k)):P==="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:P,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})`},m({element:O,type:O.startHead})),f("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},m({element:O,type:O.endHead}))),b=async({element:O,page:P,store:k,elementHook:M})=>{const I=await Promise.all(O.children.map(G=>d({element:G,page:P,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 g(O){let P=O.replace(/<svg[^>]*>/,"");return P=P.replace(/<\/svg>/,""),P}const h=async({element:O,page:P,store:k,elementHook:M})=>{const I=g((0,u.figureToSvg)(O)),H=f("g",{innerHTML:I});return M&&M({dom:H,element:O})||H},v={image:E,svg:E,text:w,line:S,figure:h,group:b};async function d({element:O,page:P,store:k,elementHook:M}){let I=await v[O.type];I||(I=()=>f("g",{}),console.error(`SVG export does not support ${O.type} type...`));const H=await I({element:O,page:P,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 Z=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:Z,element:O})||Z}async function y({page:O,store:P,elementHook:k}){const M=await Promise.all(O.children.map(H=>d({element:H,page:O,store:P,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:P.width,height:P.height,x:0,y:0},(0,a.getCrop)({width:P.width,height:P.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:P.width,height:P.height,fill:O.background}),...M)}async function _({json:O,elementHook:P}){const k=await Promise.all(O.pages.map(H=>y({page:H,store:O,elementHook:P}))),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 R=(O,P)=>typeof P=="object"?`${O}="${Object.keys(P).map(k=>`${k}:${P[k]};`).join(" ")}"`:P==null||P===""?"":`${O}="${P}"`,C=({dom:O,nestLevel:P=0})=>{if(typeof O=="string")return O;if(!O)return"";const k=O.props,{innerHTML:M}=k,I=i(k,["innerHTML"]),H=" ".repeat(P);return`${H}<${O.type} ${Object.keys(I).map(G=>R(G,I[G])).join(" ")}>${M||`
294
+ `+O.children.map(G=>C({dom:G,nestLevel:P+1})).join("")}${H}</${O.type}>
295
+ `};async function x({json:O,elementHook:P}){const k=await _({json:O,elementHook:P});return C({dom:k})}e.jsonToSVG=x})(OS);var Kg={},E_;function xS(){return E_||(E_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=Ei,r=Jp,n=Pc(),i=O2(),a=Pc(),o=eu;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 p in u)p[0]!=="_"&&(f[p]=l[p]);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 p=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));p.sort((E,w)=>w.index-E.index);for(const{index:E}of p){if(E==-1)continue;const w=E<l.children.length-1&&l.children[E+1],m=u.indexOf(w==null?void 0:w.id)>=0;E===l.children.length-1||m||f(E)}},_forEachElementDown(u,f){const p=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));p.sort((E,w)=>E.index-w.index);for(const{index:E}of p){if(E==-1)continue;const w=E>0&&l.children[E-1],m=u.indexOf(w==null?void 0:w.id)>=0;E===0||m||f(E)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(m=>{m.id=(0,r.nanoid)(10),(0,a.forEveryChild)(m,S=>{S.id=(0,r.nanoid)(10)})});const p=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),E=l.store.addPage(p),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 p=a.TYPES_MAP[u.type];if(!p)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=p.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 p=l.children[f];(0,t.detach)(p),l.children.splice(f+1,0,p)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],p=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):p.push(E)}),l.children.replace(p.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const p=l.children[f];(0,t.detach)(p),l.children.splice(f-1,0,p)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],p=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):p.push(E)}),l.children.replace(f.concat(p))},setElementZIndex(u,f){const p=l.children.find(E=>E.id===u);p&&((0,t.detach)(p),l.children.remove(p),l.children.splice(f,0,p))},setSize({width:u,height:f,useMagic:p,softChange:E}){if(p){const w=[],m=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"&&(m(I)||w.push(I))});const S=w.length?(0,o.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},b=0,g=Math.max(0,Math.min(S.x,l.computedWidth-S.x-S.width)),h=l.computedWidth*b,v=Math.max(0,g-h),d=Math.max(0,Math.min(S.y,l.computedHeight-S.y-S.height)),y=l.computedHeight*b,_=Math.max(0,d-y),R=l.computedWidth-2*v,C=l.computedHeight-2*_,x=u/R,O=f/C,P=Math.min(x,O),k=(u-R*P)/2-v*P,M=(f-C*P)/2-_*P;(0,a.forEveryChild)(l,I=>{I.type!=="group"&&(m(I)?I.set({x:I.x*P,y:I.y*P,width:I.width*x,height:I.height*O,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(I.set({x:k+I.x*P,y:M+I.y*P,width:I.width*P,height:I.height*P}),I.type==="text"?I.set({fontSize:I.fontSize*P}):I.type==="figure"&&I.set({strokeWidth:I.strokeWidth*P})))})}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(x,O,P,k){k===void 0&&(k=P);var M=Object.getOwnPropertyDescriptor(O,P);M&&!("get"in M?!O.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return O[P]}}),Object.defineProperty(x,k,M)}:function(x,O,P,k){k===void 0&&(k=P),x[k]=O[P]}),r=me&&me.__setModuleDefault||(Object.create?function(x,O){Object.defineProperty(x,"default",{enumerable:!0,value:O})}:function(x,O){x.default=O}),n=me&&me.__importStar||function(x){if(x&&x.__esModule)return x;var O={};if(x!=null)for(var P in x)P!=="default"&&Object.prototype.hasOwnProperty.call(x,P)&&t(O,x,P);return r(O,x),O},i=me&&me.__rest||function(x,O){var P={};for(var k in x)Object.prototype.hasOwnProperty.call(x,k)&&O.indexOf(k)<0&&(P[k]=x[k]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(k=Object.getOwnPropertySymbols(x);M<k.length;M++)O.indexOf(k[M])<0&&Object.prototype.propertyIsEnumerable.call(x,k[M])&&(P[k[M]]=x[k[M]])}return P},a=me&&me.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=Ei,l=yS,u=Jp,f=a(Si),p=bS,E=_S,w=wS,m=S2(),S=n(Xs),b=$i,g=Qp,h=E2,v=SS,d=ES,y=OS,_=xS(),R=Pc();function C({key:x,showCredit:O}={key:"",showCredit:!1}){const P=e.Store.create();return(0,m.validateKey)(x,O),P}(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(x=>Object.assign(Object.assign({},x),{fontFamily:x.fontFamily||x.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:window.devicePixelRatio||1,_activePageId:""}).views(x=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),x.bleedVisible},get selectedElements(){return x.selectedElementsIds.map(O=>{for(const P of x.pages)for(const k of P.children)if(k.id===O)return k}).filter(O=>!!O)},get children(){return x.pages},get selectedShapes(){const O=[];return(0,R.forEveryChild)({children:x.selectedElements},P=>{P.type!=="group"&&O.push(P)}),O},get activePage(){return x.pages.slice().find(O=>O.id===x._activePageId)||(x.pages.length?x.pages[0]:null)},get duration(){let O=0;return x.pages.forEach(P=>{O+=P.duration}),O},get _hasCroppedImages(){return x.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let P;return(0,R.forEveryChild)({children:x.pages},k=>{if(!P&&O(k))return P=k,!0}),P},getElementById:O=>x.find(P=>P.id===O)})).actions(x=>{let O=0,P=null,k=!1;return{afterCreate(){x.history.canUndo},setCurrentTime(M){x.currentTime=M},play({animatedElementsIds:M=[],startTime:I=0,currentTime:H=0,endTime:G=x.duration,repeat:Z=!1}={}){H&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),I=H),x.animatedElementsIds=(0,o.cast)(M),x.currentTime=I,x.isPlaying=!0,O=Date.now(),P=G,k=Z,requestAnimationFrame(x.seek)},checkActivePage(){let M=0;for(const I of x.pages){if(x.currentTime>=I.startTime&&x.currentTime<I.startTime+I.duration){x.selectPage(I.id);break}M+=I.duration}},seek(){if(!x.isPlaying)return;const M=Date.now(),I=M-O;O=M,x.currentTime+=I,x.checkActivePage();const H=P||x.duration;x.isPlaying&&x.currentTime<H?requestAnimationFrame(x.seek):x.isPlaying&&k?(x.currentTime=0,requestAnimationFrame(x.seek)):x.stop()},stop(){x.isPlaying=!1,x.currentTime=0,x.animatedElementsIds=(0,o.cast)([]),x.checkActivePage()}}}).actions(x=>({set(O){Object.assign(x,O)},setUnit({unit:O,dpi:P}){x.unit=O||x.unit,x.dpi=P||x.dpi},setRole(O){x.role=O},addPage(O){const P=_.Page.create(Object.assign({id:(0,u.nanoid)(10)},O));return x.pages.push(P),x._activePageId=P.id,P},selectPage(O){x._activePageId=O},selectElements(O){const P=O.map(k=>x.getElementById(k)).sort((k,M)=>k.page.children.indexOf(k)-k.page.children.indexOf(M)).filter(k=>!!k).map(k=>k.id);x.selectedElementsIds=(0,o.cast)(P)},toggleBleed(O){x.bleedVisible=O??!x.bleedVisible},toggleRulers(O){x.rulesVisible=O??!x.rulesVisible},openSidePanel(O){x.openedSidePanel!==O&&(x.previousOpenedSidePanel=x.openedSidePanel,x.openedSidePanel=O)},setScale(O){x.scale=O},_setScaleToFit(O){x.scaleToFit=O},setElementsPixelRatio(O){x._elementsPixelRatio=O},setSize(O,P,k){x.pages.forEach(M=>{M.setSize({width:O,height:P,useMagic:k,softChange:!0})}),x.width=O,x.height=P},setPageZIndex(O,P){const k=x.pages.find(M=>M.id===O);k&&((0,o.detach)(k),x.pages.remove(k),x.pages.splice(P,0,k))},deletePages(O){const P=x.pages.indexOf(x.activePage);O.forEach(I=>{const H=x.pages.find(G=>G.id===I);(0,o.destroy)(H)});const k=Math.min(x.pages.length-1,P),M=x.pages[k];M&&(x._activePageId=M.id),x.selectedElementsIds=(0,o.cast)(x.selectedElementsIds.filter(I=>x.getElementById(I)))},groupElements(O){const P=O.map(I=>x.getElementById(I));P.forEach(I=>{I&&(0,o.detach)(I)});const k=x.activePage,M={id:(0,u.nanoid)(10),children:P,type:"group"};return k.children.push(M),x.selectedElementsIds=(0,o.cast)([M.id]),M},ungroupElements(O){const P=O.map(M=>x.getElementById(M)),k=[];P.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)}}),x.selectedElementsIds=(0,o.cast)(k)},deleteElements(O){const P=[];x.find(k=>(O.includes(k.id)&&P.push(k),!1)),P.forEach(k=>{(0,o.destroy)(k)}),x.selectedElementsIds=(0,o.cast)(x.selectedElementsIds.filter(k=>x.getElementById(k)))},on(O,P){if(O==="change"){let k=x.toJSON();return(0,o.onSnapshot)(x,M=>{const I=x.toJSON();!(0,h.deepEqual)(k,I)&&(k=I,P(I))})}},async _toCanvas({pixelRatio:O,ignoreBackground:P,pageId:k,mimeType:M,includeBleed:I,_skipTimeout:H}={}){var G;const Z=O||1;k=k||((G=x.pages[0])===null||G===void 0?void 0:G.id);const W=x.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 B=await(0,v.waitTillAvailable)(()=>f.default.stages.find(ie=>ie.getAttr("pageId")===k));if(!B)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 F=!!B.findOne(".page-container"),T=x._elementsPixelRatio;Z>x._elementsPixelRatio&&x.setElementsPixelRatio(Z),await x.waitLoading({_skipTimeout:H});const L=B.findOne(".page-container");if(!L)throw x.setElementsPixelRatio(T),new Error(`Export is failed. Can't find page container. ${F}`);B.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"),D=z.clip();z.clip({x:null,y:null,width:null,height:null});const $=L.findOne(".elements-container"),K=$.clip();$.clip({x:null,y:null,width:null,height:null});const V=L.find(ie=>ie.getAttr("hideInExport"));V.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.hide()});const U=L.find(ie=>!ie.visible()&&ie.getAttr("editModeEnabled"));U.forEach(ie=>{ie.setAttr("oldVisible",ie.visible()),ie.show()}),P&&L.find(".page-background").forEach(ie=>ie.hide());const Y=I?W.bleed:0;let X=Y;!x.bleedVisible&&I||(x.bleedVisible||I?x.bleedVisible&&I?X=0:x.bleedVisible&&!I&&(X=-W.bleed):X=0);const Q=document.createElement("canvas");Q.width=Math.round((W.computedWidth+2*Y)*Z),Q.height=Math.round((W.computedHeight+2*Y)*Z);const te=Q.getContext("2d");M==="image/jpeg"&&(te.fillStyle="white",te.fillRect(0,0,Q.width,Q.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:Z});return L.scale(ee),te.drawImage(ne,0,0,Q.width,Q.height),f.default.Util.releaseCanvas(ne),P&&L.find(".page-background").forEach(ie=>ie.show()),V.forEach(ie=>{ie.visible(ie.getAttr("oldVisible"))}),U.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)),B.find("Transformer").forEach(ie=>ie.visible(!0)),L.find(".highlighter").forEach(ie=>ie.visible(!0)),z.clip(D),$.clip(K),x.setElementsPixelRatio(T),W==null||W.set({_exporting:!1}),Q},async toDataURL(O={}){var{mimeType:P,quality:k}=O,M=i(O,["mimeType","quality"]);const I=await x._toCanvas(Object.assign({mimeType:P},M)),H=I.toDataURL(P,k);return f.default.Util.releaseCanvas(I),H},async toBlob(O={}){var{mimeType:P,quality:k}=O,M=i(O,["mimeType","quality"]);const I=await x._toCanvas(Object.assign({mimeType:P},M)),H=new Promise(G=>{I.toBlob(G,P,k)});return f.default.Util.releaseCanvas(I),H},async saveAsImage(O={}){var{fileName:P}=O,k=i(O,["fileName"]);const M=k.mimeType||"image/png",I=M.split("/")[1];(0,p.downloadFile)(await x.toDataURL(k),P||"polotno."+I,M)},async _toPDF(O){const P=O.dpi||x.dpi,k=O.parallel||1,M=O.unit||(x.unit==="px"?"mm":x.unit),I=O.pixelRatio||1,H=O.pageIds||x.pages.map(K=>K.id),G=x.pages.filter(K=>H.includes(K.id)),Z=await(0,E.getJsPDF)(),W=K=>(0,g.pxToUnit)({px:K,unit:M,dpi:P}),B=W(O.cropMarkSize||0),F=G[0]||{},T=O.includeBleed?F.bleed:0,L=W(F.computedWidth+2*T)+2*B,z=W(F.computedHeight+2*T)+2*B;var D=new Z({unit:M,orientation:L>z?"landscape":"portrait",format:[L,z],compress:!0,putOnlyUsedFonts:!0});D.deletePage(1);const $=((K,V)=>{for(var U=[],Y=0;Y<K.length;Y+=V)U.push(K.slice(Y,Y+V));return U})(G,k);for(const K of $){const V=K.map(async U=>{const Y=O.includeBleed?U.bleed:0,X=W(U.computedWidth+2*Y)+2*B,Q=W(U.computedHeight+2*Y)+2*B;let te=0,ee=I;for(;te<10;){te+=1,te===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ne=await x.toDataURL(Object.assign(Object.assign({},O),{pageId:U.id,pixelRatio:ee}));if(ne.length>20)return{url:ne,width:X,height:Q};ee*=.8}});(await Promise.all(V)).forEach(({url:U,width:Y,height:X})=>{D.addPage([Y,X],Y>X?"landscape":"portrait"),B&&(D.setLineWidth(W(1)),D.line(2*B,0,2*B,B),D.line(0,2*B,B,2*B),D.line(Y-2*B,0,Y-2*B,B),D.line(Y,2*B,Y-B,2*B),D.line(0,X-2*B,B,X-2*B),D.line(2*B,X,2*B,X-B),D.line(Y,X-2*B,Y-B,X-2*B),D.line(Y-2*B,X,Y-2*B,X-B)),D.addImage(U,B,B,Y-2*B,X-2*B,void 0,"FAST")})}return D},toPDFDataURL:async O=>(await x._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const P=O.pixelRatio||1,k=await(0,w.createGIF)({width:x.width*P,height:x.height*P}),M=1e3/(O.fps||10),I=x.duration/M;for(let H=0;H<I-1;H++){const G=H*M||1;x.setCurrentTime(G);let Z=0,W="";for(const F of x.pages)if(Z+=F.duration,F.set({_rendering:Z>G}),Z>G){W=F.id;break}const B=await x._toCanvas({pixelRatio:P,pageId:W,_skipTimeout:!0});k.addFrame(B.getContext("2d"),{delay:M,copy:!0})}for(const H of x.pages)H.set({_rendering:!1});return x.stop(),k.render(),new Promise(H=>{k.on("finished",function(G){(function(Z,W){var B=new FileReader;B.onload=function(F){W(F.target.result)},B.readAsDataURL(Z)})(G,H)})})},async saveAsGIF(O={}){var{fileName:P}=O,k=i(O,["fileName"]);const M=await x.toGIFDataURL(k);(0,p.downloadFile)(M,P||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const P=x.toJSON();return(0,d.jsonToHTML)({json:P,elementHook:O})},async saveAsHTML({fileName:O}={}){const P=await x.toHTML(),k="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(P)));(0,p.downloadFile)(k,O||"polotno.html")},async toSVG({elementHook:O}={elementHook:void 0}){const P=x.toJSON();return(0,y.jsonToSVG)({json:P,elementHook:O})},async saveAsSVG({fileName:O,elementHook:P}={}){const k=await x.toSVG({elementHook:P}),M="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,p.downloadFile)(M,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:P}=O,k=i(O,["fileName"]);(await x._toPDF(Object.assign({mimeType:"image/jpeg"},k))).save(P||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(P=>setTimeout(P,50)),await(0,b.whenLoaded)()},toJSON:()=>({width:x.width,height:x.height,fonts:(0,o.getSnapshot)(x.fonts),pages:(0,o.getSnapshot)(x.pages),unit:x.unit,dpi:x.dpi,custom:x.custom}),loadJSON(O,P=!1){var k;const M=Object.assign({},O),I=x.pages.indexOf(x.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)(x));Object.assign(G,M),G.history=P?x.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(x,G)},clear({keepHistory:O=!1}={}){const P=x.pages.map(k=>k.id);x.deletePages(P),O||x.history.clear()},addFont(O){x.removeFont(O.fontFamily),x.fonts.push(O),x.loadFont(O.fontFamily)},removeFont(O){x.fonts.filter(P=>P.fontFamily===O).forEach(P=>(0,o.destroy)(P))},async loadFont(O){const P=x.fonts.find(k=>k.fontFamily===O)||S.globalFonts.find(k=>k.fontFamily===O);P?S.injectCustomFont(P):S.injectGoogleFont(O),await S.loadFont(O)},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(P=>({path:"store"+P.context.map(k=>k.path).join("."),message:P.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=Ei,r=Jp,n=O2(),i=xS(),a=Pc();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,p=>{p.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=eu,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),p=f<=1?f:2-f;return{opacity:o.opacity*p}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,p={},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},m=a%u/f,S=m<=1?m:2-m;for(let b in E){const g=E[b],h=w[b]-g;p[b]=g+S*h}return p},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var p in u.from){let E=u.from[p],w=u.to[p];l.type==="exit"&&(E=u.to[p],w=-u.from[p]);const m=o[p]+E,S=o[p]+w-m;f[p]=m+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},p={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var E in f){let w=f[E],m=p[E];if(l.type==="exit"){const b=w;w=m,m=b}const S=m-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 tu(){return P_||(P_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=Ei,r=CS,n=Ki,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 p=a.store.animatedElementsIds;if(p.length&&!p.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 m=a.animations.find(S=>S.type==="loop");if(m!=null&&m.enabled){const S=f,b=(0,r.animate)({element:a,animation:m,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=Ei,r=tu();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=tu();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})}(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=Ei,r=tu();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=Ei,r=tu();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=Ei,r=tu();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 Pc(){return L_||(L_=1,function(e){var t=me&&me.__rest||function(g,h){var v={};for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&h.indexOf(d)<0&&(v[d]=g[d]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(d=Object.getOwnPropertySymbols(g);y<d.length;y++)h.indexOf(d[y])<0&&Object.prototype.propertyIsEnumerable.call(g,d[y])&&(v[d[y]]=g[d[y]])}return v};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=Ei,n=Jp,i=PS(),a=tu(),o=hj(),l=kS(),u=pj(),f=gj(),p=vj(),E=mj(),w=(g,h)=>{if(g.children)for(const v of g.children){if(h(v)===!0)break;(0,e.forEveryChild)(v,h)}};e.forEveryChild=w;const m=[...new Array(20)].map((g,h)=>r.types.late(()=>S[h]));e.ElementTypes=r.types.union({dispatcher:g=>{const h=e.TYPES_MAP[g.type];if(!h)throw new Error(`Unknown element type: "${g.type}"`);return h}},p.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,E.FigureElement,r.types.late(()=>e.GroupElement),...m),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(g=>({get draggable(){let h=!0;return(0,e.forEveryChild)(g,v=>{v.draggable||(h=!1)}),h},get resizable(){let h=!0;return(0,e.forEveryChild)(g,v=>{v.resizable||(h=!1)}),h},get contentEditable(){let h=!0;return(0,e.forEveryChild)(g,v=>{v.contentEditable||(h=!1)}),h},get styleEditable(){let h=!0;return(0,e.forEveryChild)(g,v=>{v.styleEditable||(h=!1)}),h},get locked(){let h=!0;return(0,e.forEveryChild)(g,v=>{v.locked||(h=!1)}),h}})).actions(g=>({set(h){var{draggable:v,contentEditable:d,styleEditable:y,resizable:_}=h,R=t(h,["draggable","contentEditable","styleEditable","resizable"]);v!==void 0&&(0,e.forEveryChild)(g,C=>{C.set({draggable:v})}),d!==void 0&&(0,e.forEveryChild)(g,C=>{C.set({contentEditable:d})}),y!==void 0&&(0,e.forEveryChild)(g,C=>{C.set({styleEditable:y})}),_!==void 0&&(0,e.forEveryChild)(g,C=>{C.set({resizable:_})}),Object.assign(g,R)},addElement(h,{skipSelect:v=!1}={}){const d=e.TYPES_MAP[h.type];if(!d)return void console.error("Can not find model with type "+h.type);h.children&&h.children.forEach(_=>{_.id=(0,n.nanoid)(10)});const y=d.create(Object.assign({id:(0,n.nanoid)(10)},h));return g.children.push(y),y.selectable&&!v&&g.store.selectElements([y.id]),y},setElementZIndex(h,v){const d=g.children.find(y=>y.id===h);d&&((0,r.detach)(d),g.children.remove(d),g.children.splice(v,0,d))}}));const S=[];function b(g,h){const v=g.type;if(!v)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(v).props(g);h&&(d=h(d)),e.TYPES_MAP[v]=d,S.push(d)}e.TYPES_MAP={svg:p.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=Pc();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 p,E,w,m,S,b,g,h;if(((p=document.activeElement)===null||p===void 0?void 0:p.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 v=f.selectedElements.filter(R=>R.removable),d=v.map(R=>R.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const y=u.ctrlKey||u.metaKey,_=u.shiftKey;if(y&&!_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),y&&_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),y&&u.code==="KeyA"){u.preventDefault();const R=(m=f.activePage)===null||m===void 0?void 0:m.children.filter(x=>x.selectable),C=(R==null?void 0:R.map(x=>x.id))||[];f.selectElements(C)}if(y&&u.code==="KeyC"&&(u.preventDefault(),n=(S=f.activePage)===null||S===void 0?void 0:S.id,a(f.selectedElements.map(R=>R.toJSON()))),y&&u.code==="KeyX"&&(u.preventDefault(),n=(b=f.activePage)===null||b===void 0?void 0:b.id,a(f.selectedElements.map(R=>R.toJSON())),f.deleteElements(v)),y&&u.code==="KeyV"){u.preventDefault();let R=0;n===((g=f.activePage)===null||g===void 0?void 0:g.id)&&(R=f.width/20),n=(h=f.activePage)===null||h===void 0?void 0:h.id,f.history.transaction(()=>{const C=[],x=o();(0,t.forEveryChild)({children:x},O=>{delete O.id,O.type!=="group"&&(O.x+=R,O.y+=R)}),x.forEach(O=>{var P;const k=(P=f.activePage)===null||P===void 0?void 0:P.addElement(O);k&&C.push(k.id)}),a(x),f.selectElements(C)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({y:R.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({y:R.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({x:R.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(R=>{R.set({x:R.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=Ki,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"}});function n(p,E){var w,m=E.split("."),S=p;for(w=0;w<m.length;++w){if(S[m[w]]==null)return;S=S[m[w]]}return S}const i=p=>p&&typeof p=="object";function a(p,E){Object.keys(E).forEach(w=>{const m=p[w],S=E[w];i(S)&&i(m)?a(m,S):p[w]=S})}function o(p,E,w=""){Object.keys(E).forEach(m=>{const S=E[m],b=w?`${w}.${m}`:m;i(S)?i(p[m])?o(p[m],S,b):console.warn(`Missing nested translation object at '${b}'`):p[m]===void 0&&console.warn(`Missing translation '${b}'`)})}e.setTranslations=(0,t.action)((p,{validate:E=!1}={})=>{E&&o(p,r),a(r,p)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=p=>{const E=n(r,p);if(E!==void 0)return E;u[p]||(u[p]=!0,console.warn(`Missing translation '${p}'`));const w=p.split("."),m=w[w.length-1]||" ";return m.charAt(0).toUpperCase()+m.slice(1)};e.t=f})(TS);(function(e){var t=me&&me.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(Ze),n=_i,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=(m,S,b,g,h,v)=>{const d=r.default.useRef({width:S,height:b}),y=r.default.useRef({top:0,left:0}),_=r.default.useRef(!1),R=r.default.useRef(h.pages.length);_.current=R.current!==h.pages.length,R.current=h.pages.length,r.default.useEffect(()=>{const C=m.current,x=O=>{y.current={top:C.scrollTop,left:C.scrollLeft}};return C.addEventListener("scroll",x),()=>{C.removeEventListener("scroll",x)}},[]),r.default.useLayoutEffect(()=>{if(!m.current||_.current)return;const C=m.current,x=(y.current.left+C.offsetWidth/2)/d.current.width,O=(y.current.top+C.offsetHeight/2)/d.current.height;v.current=!0,C.scrollLeft=x*S-C.offsetWidth/2,C.scrollTop=O*b-C.offsetHeight/2,d.current={width:S,height:b}},[g,S,b])},p=(m,S,b,g,h)=>{const v=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const _=m.current,R=()=>{h.current};return _.addEventListener("scroll",R),()=>{_.removeEventListener("scroll",R)}},[]);const y=b.pages.indexOf(b.activePage);return r.default.useLayoutEffect(()=>{if(!b.activePage||!m.current||v.current)return;const _=m.current,R=b.pages.indexOf(b.activePage)*S;Math.abs(R-_.scrollTop)>.5*S&&(h.current=!0,_.scrollTop=R)},[b.activePage,y]),{handleScroll:_=>{if(h.current)return void(h.current=!1);v.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{v.current=!1},300);const R=_.currentTarget.childNodes[0].offsetHeight,C=_.currentTarget.scrollTop,x=Math.floor((C+g.height/3)/R),O=b.pages[x];O&&O.select()}}},E=({store:m})=>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:()=>{m.addPage()}},(0,l.t)("workspace.addPage"))),w=({width:m,height:S,xPadding:b,yPadding:g,backgroundColor:h})=>r.default.createElement("div",{style:{width:m+"px",height:S+"px",backgroundColor:h,paddingLeft:b+"px",paddingRight:b+"px",paddingTop:g+"px",paddingBottom:g+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:m,pageControlsEnabled:S,backgroundColor:b,pageBorderColor:g,activePageBorderColor:h,bleedColor:v,components:d,onKeyDown:y,paddingX:_,paddingY:R,altCloneEnabled:C=!0,visiblePagesOffset:x})=>{const O=_??20,P=R??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),Z=m.bleedVisible?Math.max(0,...m.pages.map(ee=>ee.bleed)):0,W=Math.max(...m.pages.map(ee=>ee.computedWidth)),B=Math.max(...m.pages.map(ee=>ee.computedHeight)),F=W+2*Z,T=B+2*Z,L=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(fe=>setTimeout(fe,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,oe={width:ie,height:ne.height};(I.current.width!==oe.width||I.current.height!==oe.height)&&(M(oe),I.current=oe);const ke=(ie-2*O)/F,Ie=(ne.height-2*P)/T,le=Math.max(Math.min(ke,Ie),.01);m.scaleToFit!==le&&(m.setScale(le),m._setScaleToFit(le))};r.default.useLayoutEffect(()=>{L({skipTimeout:!0})},[]),r.default.useEffect(()=>{L()},[F,T]),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)}},[F,T]);const z=Math.max(O,(k.width-F*m.scale)/2),D=T*m.scale*m.pages.length,$=Math.max(P,(k.height-D)/m.pages.length/2);r.default.useEffect(()=>{const ee=ne=>{(y||o.handleHotkey)(ne,m)};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 le=Math.max(3,m.scaleToFit),fe=Math.min(.1,m.scaleToFit),_e=(oe=ie.deltaY<0?1.05*m.scale:m.scale/1.05,ke=fe,Ie=le,Math.max(ke,Math.min(Ie,oe)));m.setScale(_e)}else var oe,ke,Ie};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 K=r.default.useRef(!1);f(G,F*m.scale+2*z,T*m.scale+2*$,m.scale,m,K);const{handleScroll:V}=p(G,T*m.scale+2*$,m,k,K),U=k.width>=F*m.scale+2*z,Y=b||"rgba(232, 232, 232, 0.9)",X=m.pages.indexOf(m.activePage),Q=(d==null?void 0:d.NoPages)||E,te=x??Math.min(3,Math.max(1,Math.ceil(k.height/2/(T*m.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:V,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:U?"hidden":"auto"},className:"polotno-workspace-inner"},m.pages.map((ee,ne)=>Math.abs(ne-X)<=te||ee._exportingOrRendering?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:z,yPadding:$,width:F*m.scale+2*z,height:T*m.scale+2*$,store:m,pageControlsEnabled:S,backColor:Y,pageBorderColor:g||"lightgrey",activePageBorderColor:h||"rgb(0, 161, 255)",altCloneEnabled:C,bleedColor:v||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(w,{key:ee.id,width:F*m.scale+2*z,height:T*m.scale+2*$,backgroundColor:Y,xPadding:z,yPadding:$})),m.rulesVisible&&r.default.createElement(a.TopRules,{store:m,xPadding:z,yPadding:$,width:F*m.scale+2*z,height:T*m.scale+2*$}),m.pages.length===0&&r.default.createElement(Q,{store:m})))}),e.default=e.WorkspaceCanvas})(Vw);var yj=O2();xl.toggleFadeInAnimation(!1);Yn.setTextOverflow("change-font-size");const bj=new URLSearchParams(location.search).get("key"),AS=yj.createStore({key:bj});window.store=AS;window.config={addGlobalFont:Xs.addGlobalFont,unstable_useHtmlTextRender:Yn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Yn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Yn.setTextOverflow,onLoadError:$i.onLoadError,setAssetLoadTimeout:$i.setAssetLoadTimeout,setFontLoadTimeout:$i.setFontLoadTimeout};const _j=Dd.createRoot(document.getElementById("root"));_j.render(ht.createElement(Vw.WorkspaceCanvas,{visiblePagesOffset:0,store:AS,components:{PageControls:()=>null,Tooltip:()=>null}}));